+```
+
+
+| 参数 | 类型 | 说明 |
+| ----------------- | ---------------- | ---- |
+| item | LeftRegistComponentMapItem | 左侧对象 |
+| config | UserConfig | 用户设置 |
+
+
+
+## defaultStore
+
+默认store对象
+
+```js
+export const defaultStore: IMainStoreData = {
+ container: {
+ width: 375,
+ height: 667,
+ },
+ block: [],
+ modalMap: {},
+ dataSource: {
+ defaultKey: 'defaultValue',
+ },
+ globalState: {
+ containerColor: 'rgba(255,255,255,1)',
+ title: 'Dooringx',
+ bodyColor: 'rgba(255,255,255,1)',
+ script: [],
+ customAnimate: [],
+ lineHeight: 1.575,
+ fontSize: 14,
+ },
+ modalConfig: {},
+ modalEditName: '',
+ origin: null,
+};
+```
+
+## deepCopy
+
+用于深拷贝
+
+## specialCoList
+
+需要特殊处理的组件,用于弹窗mask和timeline的禁止移动,一般不做处理
+
+```js
+export const specialCoList = ['modalMask'];
+```
+
+## specialFnList
+
+需要特殊处理的函数,通过includes判断,函数不会像组件函数一样卸载。
+
+```js
+export const specialFnList = ['_inner'];
+```
+
+## locale
+
+国际化设置,不用可以在config上设置i18n为false。
+
+示例:
+
+```js
+import { IntlProvider } from 'react-intl';
+import { locale } from 'dooringx-lib';
+import { localeKey } from '../../../dooringx-lib/dist/locale';
+
+export default function Layout({ children }: IRouteComponentProps) {
+ const [l, setLocale] = useState('zh-CN');
+ return (
+
+
+ {children}
+
+
+ );
+}
+```
+
+### replaceLocale
+
+用于替换文字函数
+
+示例:
+
+```js
+ replaceLocale(
+ 'modal.popup.notfond',
+ `未找到该弹窗 ${sign.param}`,
+ props.config,
+ { name: sign.param },
+ '未找到该弹窗 {name}'
+)
+```
+
+
+| 参数 | 类型 | 说明 |
+| ----------------- | ---------------- | ---- |
+| id | LeftRegistComponentMapItem | 消息id |
+| msg | string | 消息名称 |
+| config | UserConfig | 用户设置 |
+| param | object | 序列化字符串参数 |
+| paramString | string | 序列化字符串,需要跟param参数结合使用 |
+
+### localeMap
+
+用于制作语言包
+
+```js
+import { en } from './en';
+import { zhCN } from './zh-CN';
+
+export const localeMap = {
+ 'zh-CN': zhCN,
+ en,
+};
+```
diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md
index 51f4347..a7d9dd5 100644
--- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md
+++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md
@@ -5,52 +5,54 @@ nav:
title: Change log
order: 6
---
+## 1.0.0
+New document and createcomponent function
## 0.15.3
-Modify check box selection algorithm
+Modify the checkbox and select the algorithm
## 0.15.2
-Fix inconsistencies in line element editing preview.
+Fixed inconsistency in editing preview of elements in the line.
Add line height font size configuration item.
## 0.15.1
Useregistfunc is added to register functions.
Update some documents.
## 0.15.0
-Discard storechanger and iframe containers.
-Add function configuration to unload correctly.
-Modify the pop-up logic to save the preview correctly.
+Discard the storechanger and iframe containers.
+Add function configuration to properly uninstall.
+Modify logic such as pop-up window to save preview correctly.
## 0.14.1
Add data source left panel settings.
## 0.14.0
-Fix the problem that the left and right configurations cannot get config.
+Fixed the problem that the left and right configurations could not get config.
## 0.13.3
-Fix the Title Failure and add the right panel configuration
+Fixed Title Failure and added right panel configuration
## 0.13.2
-Fixed possible invalidation of custom animation.
+Fixed the problem that custom animation might fail.
## 0.13.1
-Fixed editing problem of custom animation overloaded canvas.
+Fixed the editing problem of custom animation reloading canvas.
## 0.13.0
Add custom animation, you can customize the animation freely.
## 0.12.4
-Add a lifecycle.
-Modify the timeline color and style to optimize the selected state.
+Add lifecycle.
+Modify the color and style of timeline and optimize the selected state.
## 0.12.3
Fix double click positioning problem
## 0.12.2
-New double click positioning frame.
-Fixed drag frame reset pointer behavior after pause.
+Add double click positioning frame.
+Fixed the behavior of dragging frame to reset pointer after pause.
## 0.12.0
-The operation of adding frames to the animation can accurately view the animation status every 0.1 seconds!
-Timeline adds some class names to facilitate style modification.
+The operation of adding new frames in animation can accurately view the animation status every 0.1 seconds!
+Timeline adds some class names for easy style modification.
## 0.11.11
Fixed animation causing rotation preview not to take effect.
Add container overflow configuration.
-Adjust the style of the timeline section.
-Example part style adjustment.
+The style of timeline is adjusted.
+Example section style adjustment.
## 0.11.10
-New color pair
+Add color style settings for markline
## 0.11.9
-A new setting panel is added to control adsorption scaling and other behaviors.
-Fixed pop-up button style issues.
-Fix the problem that some prompts do not display.
+Add setting panel control to control adsorption, scaling and other behaviors.
+Fixed pop-up button style problem.
+Fixed the problem that some prompts were not displayed.
## 0.11.8
Timeline adds auto focus function.
## 0.11.7
@@ -59,105 +61,105 @@ Cancel the multi selection adsorption function.
Cancel the adsorption of the first mouse click.
Modify the selected color of timeline.
## 0.11.5
-Fix reference line adsorption and wrong displacement bug
-Change the position of rotation justification
+Fix the bug of reference line adsorption and wrong displacement
+Change the position of rotation back to normal
## 0.11.4
-Fix guide line bug
-Optimized drag and drop algorithm
+Fix reference line bug
+Optimize drag and drop algorithm
## 0.11.3
-Increase the function of rotary return.
-Optimize mouse style.
+Add the function of rotation return.
+Optimize the mouse style.
## 0.11.2
Optimize drag speed
## 0.11.1
-Compatible with legacy properties
+Compatible with old properties
## 0.11.0
-Modify the timeline style and add cansee attribute to make it easy to hide when editing.
+Modify the timeline style and add the cansee attribute to make it easy to hide when editing.
## 0.10.4
-Config adds a new custommap transfer, which is used to store temporary data that is not brought into JSON.
-The remote component configuration is changed from URL to object to store more configurations.
+Config adds a custommap transfer to store temporary data that is not brought into JSON.
+The configuration of remote components is changed from URL to object to store more configurations.
## 0.10.3
-Fix the color difference problem of the left tab.
+Fixed the color difference of the left tab.
## 0.10.2
-Modify the timeline, select the background color, and add the item class name to facilitate modification.
+Modify the background color of timeline, and add the item class name to facilitate modification.
## 0.10.1
Modify the timeline class name to facilitate style modification.
## 0.10.0
-The function name proposes name as a separate configuration item, the first parameter as ID and the last parameter as function name, so that the display name of the function can support conversion.
-A pop-up event will not appear if the pop-up name is not passed.
+The function name proposes that name is passed as a separate configuration item, the first parameter is ID, and the last parameter is function name. In this way, the display name of the function can support conversion.
+If the pop-up event does not pass the pop-up name, no pop-up window will appear.
## 0.9.5
-Scripts loading of preview component changes from concurrency to linearity.
+The scripts loading of the preview component changes from concurrent to linear.
Using remote components in edit mode will save the current canvas state.
## 0.9.4
Fix the bug that the preview component cannot release loading
## 0.9.3
Add double click to place the canvas.
Change the initial focus state of the element.
-If there is an element width and height, it is positioned at the center of the element when placed.
+If the width and height of an element exist, it is positioned at the center of the element during placement.
## 0.9.2
-Add remote component to call the whole process, and Add URL attribute in component to facilitate script loading.
+Add the whole process of remote component calling, and Add URL attribute in component to facilitate script loading.
## 0.9.1
-Add config I18N configuration. If internationalization is not used, there is no need to import the context of Intl.
+Add config.i18n configuration. If internationalization is not used, there is no need to import Intl context.
The first button of the control component is changed to drag and drop, and the functions are merged into the timeline
## 0.9.0
Add react Intl and modify some styles.
## 0.8.4
-Add the preview attribute to control loading from outside.
+Add the content of preview to control loading from outside.
## 0.8.3
Add timeline drag bar and select.
-Fix the error reported by the antd menu attribute.
+Fixed an error in the antd menu attribute.
## 0.8.2
Add left panel configuration.
-Fix timeline flicker.
+Fixed the problem of timeline flicker.
## 0.8.1
-Add animation component timeline. You can preview all animations better.
+New animation component timeline. All animations can be previewed better.
## 0.8.0
-The animation part is reconstructed, which can support the simultaneous configuration of multiple animations.
+Partial reconstruction of animation can support simultaneous configuration of multiple animations.
The minimum value of canvas drag is changed to 0.
## 0.7.7
Optimize the drag logic of the canvas to move more smoothly.
## 0.7.6
-The custom rightglobalcustom type on the right is changed to the function passed in config
+The user-defined rightglobalcustom type on the right side is changed to function, and config is passed in
## 0.7.5
Change the roller direction.
## 0.7.4
-Fix box move bug.
+Fixed the box move bug.
## 0.7.3
-Fix pop-up location and selection issues.
+Fixed pop-up location and selection issues.
## 0.7.2
-Fix the impact of locking components. You can't drag, zoom or rotate during locking.
+Fixed the effect of locking components. Dragging, zooming and rotating cannot be performed during locking.
## 0.7.1
-The repair lock component cannot be unlocked.
+Fix that the lock component cannot be unlocked.
## 0.7.0
Component rotation is supported!
-Fix optimization logic such as dragging reference lines.
+Fixed optimization logic such as dragging reference lines.
## 0.6.0
-The use of iframe in edit mode is supported!
-Fix the selected condition.
+Iframe is supported in editing mode!
+Repair the selected condition.
## 0.5.1
-Fix the problem on the right that cannot be unchecked.
+Fixed the problem that the right selection cannot be unchecked.
## 0.5.0
-Fix the problem that the width of the control component is not enough.
+Fixed the problem that the width of the control component was not enough.
Remove the antd custom icon, and the icon at the bottom of the container can be configured.
## 0.4.2
-Fix animation error initial value.
+Fix incorrect initial value of animate.
Modify the markline style.
-Global settings increase the height of the container.
+The global setting increases the height of the container.
## 0.4.1
Remove the Lib auto import style.
## 0.4.0
Remove the runtime export and get all properties from config.
## 0.3.1
1. Replace UUID with nanoid.
-2. Control component adds ruler control.
+2. The control component adds ruler control.
## 0.3.0
-1. Add a ruler. The containerwrapper needs to pass config before it can be used.
-2. Modify container minimum drag 667. Fix the inconsistency between the distance between the canvas and the mouse when zooming down and dragging.
+1. Add ruler. Containerwrapper needs to pass config before it can be used.
+2. Modify the minimum drag of the container 667. Fixed the inconsistency between the distance between the canvas and the mouse when zooming down and dragging.
3. Innercontainerdragup needs to pass config.
## 0.2.0
-Modify the transmission of the commander to obtain the config. The commander will no longer be exported from the index. When it needs to be used, it will be obtained from the config. Add the class name on the left to facilitate customization.
+Modify the transfer of the commander to obtain the config. The commander is no longer exported from the index, but needs to be obtained from the config. Add the class name on the left to facilitate customization.
## 0.1.10
-Modify eslint dependency recommendation
+Modify eslint dependency (recommended)
## 0.1.9
Add global body settings
## 0.1.8
@@ -165,7 +167,7 @@ Add pop-up settings and remove modalcontainer
## 0.1.7
Modify the preview special condition display and delete the console
## 0.1.6
-Adjust the initial zoom, the initial proportion of the canvas, and add the function of righting the canvas.
+Adjust the initial scale, the initial scale of the canvas, and add the function of aligning the canvas.
## 0.1.5
Delete the button not made and add the fixed configuration
## 0.1.4
diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md
index efa3cce..e14fdbf 100644
--- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md
+++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md
@@ -5,6 +5,10 @@ nav:
title: 变更日志
order: 6
---
+## 1.0.0
+
+新增文档,增加createComponent函数
+
## 0.15.3
修改选框选中算法
diff --git a/packages/dooringx-dumi-doc/docs/Guide/develop.md b/packages/dooringx-dumi-doc/docs/Guide/develop.md
index 186a84e..cd517cb 100644
--- a/packages/dooringx-dumi-doc/docs/Guide/develop.md
+++ b/packages/dooringx-dumi-doc/docs/Guide/develop.md
@@ -95,6 +95,7 @@ config可以拿到所有数据,用来制作事件时使用。
第七个参数needPosition,某些组件移入画布后会默认采取拖拽的落点,该配置项默认为true,就是需要拖拽的位置,为false时将使用组件自身top和left定位来放置。
+也可以使用对象形式传参,见`createComponent`函数
### 事件注册
diff --git a/packages/dooringx-dumi-doc/docs/Guide/index.md b/packages/dooringx-dumi-doc/docs/Guide/index.md
index 175d688..78dcea3 100644
--- a/packages/dooringx-dumi-doc/docs/Guide/index.md
+++ b/packages/dooringx-dumi-doc/docs/Guide/index.md
@@ -15,6 +15,8 @@ dooringx-lib 是 dooringx 的基座,是移除了 dooringx 插件的可视化
dooringx-lib 提供自己的一套数据流事件机制以及弹窗等解决方案,可以让你更快地自己定制开发可视化拖拽平台。
+区别于别的搭建平台,其较为适合制作移动端,主要是绝对定位搭建而非静态定位搭建,绝对定位的拖拽较为方便运营人员理解。
+
### dooringx-lib 如何工作?
@@ -22,6 +24,14 @@ dooringx-lib 在运行时维护一套数据流,主要分为json数据部分,
其除了提供基础的拖拽、移动、缩放、全选、旋转等功能外,还可以使用暴露的组件。如果觉得组件不够定制化,可以调整样式或者自己重新写。
+### 数据流转是怎样的?
+
+1、页面上渲染主要围绕store中json制作,你可以在任何地方通过`config.getStore().getData()`拿到store数据,修改后使用`config.setData()`设置数据。
+
+2、右侧配置项的开发本质也是通过修改json完成。
+
+3、事件流设计:每个组件可以抛出任意个函数,组件中可以设置时机,比如设置点击组件a按钮或b按钮为触发时机,触发后调用事件链。事件链可以设置由多个组件抛出的函数链接而成。
+
### 快速上手
@@ -269,3 +279,5 @@ export default IframePage;
```
此时拖拽组件进入画布后,点击按钮进入预览则可看见预览状态也被渲染出来了。
+
+
diff --git a/packages/dooringx-example/src/plugin/index.tsx b/packages/dooringx-example/src/plugin/index.tsx
index a2a3722..7159308 100644
--- a/packages/dooringx-example/src/plugin/index.tsx
+++ b/packages/dooringx-example/src/plugin/index.tsx
@@ -29,6 +29,14 @@ const LeftRegistMap: LeftRegistComponentMapItem[] = [
img: 'https://img.guguzhu.com/d/file/android/ico/2021/09/08/rytzi2w34tm.png',
displayName: '输入框',
},
+ {
+ type: 'basic',
+ component: 'testco',
+ img: 'icon-anniu',
+ imgCustom: ,
+ displayName: '测试按钮',
+ urlFn: () => import('./registComponents/testco'),
+ },
];
export const defaultConfig: Partial = {
diff --git a/packages/dooringx-example/src/plugin/registComponents/testco.tsx b/packages/dooringx-example/src/plugin/registComponents/testco.tsx
new file mode 100644
index 0000000..a3fcaec
--- /dev/null
+++ b/packages/dooringx-example/src/plugin/registComponents/testco.tsx
@@ -0,0 +1,150 @@
+/*
+ * @Author: yehuozhili
+ * @Date: 2021-07-07 14:35:38
+ * @LastEditors: yehuozhili
+ * @LastEditTime: 2022-04-27 22:24:23
+ * @FilePath: \dooringx\packages\dooringx-example\src\plugin\registComponents\button.tsx
+ */
+
+import { Button } from 'antd';
+import React, { useEffect, useMemo, useState } from 'react';
+import {
+ changeUserValue,
+ createComponent,
+ createPannelOptions,
+ useDynamicAddEventCenter,
+ useRegistFunc,
+} from 'dooringx-lib';
+import { FormMap } from '../formTypes';
+import { ComponentRenderConfigProps } from 'dooringx-lib/dist/core/components/componentItem';
+function ButtonTemp(pr: ComponentRenderConfigProps) {
+ const props = pr.data.props;
+ const eventCenter = useMemo(() => {
+ return pr.config.getEventCenter();
+ }, [pr.config]);
+
+ useDynamicAddEventCenter(pr, `${pr.data.id}-init`, '初始渲染时机'); //注册名必须带id 约定!
+ useDynamicAddEventCenter(pr, `${pr.data.id}-click`, '点击执行时机');
+ useEffect(() => {
+ // 模拟抛出事件
+ if (pr.context === 'preview') {
+ eventCenter.runEventQueue(`${pr.data.id}-init`, pr.config);
+ }
+ }, [eventCenter, pr.config, pr.context, pr.data.id]);
+
+ const [text, setText] = useState('');
+ const op1 = props.op1;
+
+ const fn = useMemo(() => {
+ const functionCenter = eventCenter.getFunctionCenter();
+ return functionCenter.register({
+ id: `${pr.data.id}+changeText`,
+ fn: async (ctx, next, config, args: any, _eventList, iname) => {
+ const userSelect = iname.data;
+ const ctxVal = changeUserValue(
+ userSelect['改变文本数据源'],
+ args,
+ '_changeval',
+ config,
+ ctx
+ );
+ const text = ctxVal[0];
+ setText(text);
+ next();
+ },
+ config: [
+ {
+ name: '改变文本数据源',
+ data: ['ctx', 'input', 'dataSource'],
+ options: {
+ receive: '_changeval',
+ multi: false,
+ },
+ },
+ ],
+ name: `${pr.data.id}+改变文本函数`,
+ componentId: pr.data.id,
+ });
+ }, []);
+
+ useRegistFunc(op1, pr.context, fn);
+
+ return (
+
+ );
+}
+
+const MButton = createComponent({
+ name: 'testco',
+ display: '测试按钮',
+ props: {
+ style: [
+ createPannelOptions('input', {
+ receive: 'text',
+ label: '文字',
+ }),
+ ],
+ fn: [
+ createPannelOptions('switch', {
+ receive: 'op1',
+ label: '改变文本函数',
+ }),
+ ],
+ animate: [createPannelOptions('animateControl', {})],
+ actions: [createPannelOptions('actionButton', {})],
+ },
+ initData: {
+ props: {
+ text: 'yehuozhili',
+ sizeData: [100, 30],
+ backgroundColor: 'rgba(0,132,255,1)',
+ lineHeight: 1,
+ borderRadius: 0,
+ op1: false,
+ borderData: {
+ borderWidth: 0,
+ borderColor: 'rgba(0,0,0,1)',
+ borderStyle: 'solid',
+ },
+ fontData: {
+ fontSize: 14,
+ textDecoration: 'none',
+ fontStyle: 'normal',
+ color: 'rgba(255,255,255,1)',
+ fontWeight: 'normal',
+ },
+ },
+ width: 100, // 绝对定位元素初始必须有宽高,否则适配会有问题。
+ height: 30, // 绝对定位元素初始必须有宽高,否则适配会有问题。
+ rotate: {
+ canRotate: true,
+ value: 0,
+ },
+ canDrag: true, // false就不能拖
+ },
+ render: (data, context, store, config) => {
+ return ;
+ },
+ resize: true,
+});
+
+export default MButton;
diff --git a/packages/dooringx-lib/README.md b/packages/dooringx-lib/README.md
index 607ed3b..58db62b 100644
--- a/packages/dooringx-lib/README.md
+++ b/packages/dooringx-lib/README.md
@@ -24,15 +24,8 @@ dooringx-lib 是 dooringx 的基座,是移除了 dooringx 插件的可视化
dooringx-lib 提供自己的一套数据流事件机制以及弹窗等解决方案,可以让你更快地自己定制开发可视化拖拽平台。
-dooringx-lib 在运行时维护一套数据流,主要分为json数据部分,左侧组件部分,右侧配置项部分,快捷键部分,弹窗部分,事件与函数部分,数据源部分。
-
-
-
-其除了提供基础的拖拽、移动、缩放、全选、旋转等功能外,还可以使用暴露的组件。如果觉得组件不够定制化,可以调整样式或者自己重新写。
-
## 文档 | Doc
-当前版本变化较大,请等待文档完善。
[Read the Docs to Learn More](https://h5-dooring.github.io/dooringx/).
@@ -165,6 +158,3 @@ Contributions, issues and feature requests are welcome!.
MIT
-## Todo
-
-完善文档
diff --git a/packages/dooringx-lib/package.json b/packages/dooringx-lib/package.json
index cab3791..c33ec9f 100644
--- a/packages/dooringx-lib/package.json
+++ b/packages/dooringx-lib/package.json
@@ -1,5 +1,5 @@
{
- "version": "0.15.3",
+ "version": "1.0.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/dooringx-lib.esm.js",
diff --git a/packages/dooringx-lib/src/core/components/abstract.ts b/packages/dooringx-lib/src/core/components/abstract.ts
index 00deb1a..00aafd3 100644
--- a/packages/dooringx-lib/src/core/components/abstract.ts
+++ b/packages/dooringx-lib/src/core/components/abstract.ts
@@ -21,3 +21,30 @@ export class ComponentItemFactory implements ComponentItem {
public remoteConfig: ComponentItem['remoteConfig'] = {}
) {}
}
+export interface IPluginConfig {
+ name: ComponentItemFactory['name'];
+ display: ComponentItemFactory['display'];
+ props: ComponentItemFactory['props'];
+ initData: ComponentItemFactory['initData'];
+ render: ComponentItem['render'];
+ resize?: ComponentItem['resize'];
+ needPosition?: ComponentItem['needPosition'];
+ init?: ComponentItem['init'];
+ destroy?: ComponentItem['destroy'];
+ remoteConfig?: ComponentItem['remoteConfig'];
+}
+
+export function createComponent(config: IPluginConfig) {
+ return new ComponentItemFactory(
+ config.name,
+ config.display,
+ config.props,
+ config.initData,
+ config.render,
+ config.resize,
+ config.needPosition,
+ config.init,
+ config.destroy,
+ config.remoteConfig
+ );
+}
diff --git a/packages/dooringx-lib/src/core/utils/index.ts b/packages/dooringx-lib/src/core/utils/index.ts
index 7d8e571..80fe6c5 100644
--- a/packages/dooringx-lib/src/core/utils/index.ts
+++ b/packages/dooringx-lib/src/core/utils/index.ts
@@ -7,20 +7,6 @@ import { specialCoList } from './special';
import deepCopys from 'deepcopy';
import { FunctionDataMap } from '../functionCenter/config';
import UserConfig from '../../config';
-import { IPluginConfig } from './types';
-import { ComponentItemFactory } from '../components/abstract';
-
-// 创建插件
-export const createPlugin = (config: IPluginConfig) => {
- return new ComponentItemFactory(
- config.key,
- config.name,
- {},
- config.attr,
- config.render,
- config.attr.resize
- );
-};
export function deepCopy(obj: T): T {
return deepCopys(obj);
diff --git a/packages/dooringx-lib/src/core/utils/types.ts b/packages/dooringx-lib/src/core/utils/types.ts
deleted file mode 100644
index bbb4a80..0000000
--- a/packages/dooringx-lib/src/core/utils/types.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export interface IPluginConfig {
- key: string;
- name: string;
- attr: any;
- render: (props: any) => JSX.Element;
- resize?: boolean;
-}
diff --git a/packages/dooringx-lib/src/index.tsx b/packages/dooringx-lib/src/index.tsx
index c1a6ca2..710b493 100644
--- a/packages/dooringx-lib/src/index.tsx
+++ b/packages/dooringx-lib/src/index.tsx
@@ -40,7 +40,7 @@ export { scaleFn } from './core/scale/index';
// 以下导出用于制作插件
// 用于制作组件的函数
-export { ComponentItemFactory } from './core/components/abstract';
+export { ComponentItemFactory, createComponent } from './core/components/abstract';
// 用于菜单拖拽的函数
export { dragEventResolve } from './core/crossDrag/index';
// 用于制作组件配置项的函数
diff --git a/packages/dooringx-plugin-template/package.json b/packages/dooringx-plugin-template/package.json
index a62036b..919ddc7 100644
--- a/packages/dooringx-plugin-template/package.json
+++ b/packages/dooringx-plugin-template/package.json
@@ -1,6 +1,6 @@
{
"name": "dooringx-plugin-template",
- "version": "0.15.3",
+ "version": "1.0.0",
"description": "> TODO: description",
"author": "yehuozhili <673632758@qq.com>",
"homepage": "https://github.com/H5-Dooring/dooringx#readme",
diff --git a/packages/dooringx-plugin-template/template/template.json b/packages/dooringx-plugin-template/template/template.json
index aed8217..4efba10 100644
--- a/packages/dooringx-plugin-template/template/template.json
+++ b/packages/dooringx-plugin-template/template/template.json
@@ -40,7 +40,7 @@
"@rollup/plugin-node-resolve": "^13.0.4",
"@rollup/plugin-url": "^6.1.0",
"@svgr/rollup": "^5.5.0",
- "dooringx-lib": "^0.15.3",
+ "dooringx-lib": "^1.0.0",
"postcss": "^8.3.6",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.1",