@chamn/engine 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/BooleanSetter/index.d.ts +3 -1
- package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +1 -0
- package/dist/core/pluginManager.d.ts +14 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +92 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16965 -14061
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/Designer/components/Canvas/advanceCustomHook.d.ts +45 -0
- package/dist/plugins/Designer/components/Canvas/index.d.ts +56 -0
- package/dist/plugins/Designer/{style.module.scss.d.ts → components/Canvas/style.module.scss.d.ts} +1 -1
- package/dist/plugins/Designer/components/DefaultSelectToolBar/index.d.ts +7 -1
- package/dist/plugins/Designer/index.d.ts +2 -18
- package/dist/plugins/Designer/type.d.ts +22 -0
- package/dist/plugins/OutlineTree/components/TreeView/context.d.ts +2 -2
- package/dist/plugins/OutlineTree/components/TreeView/dataStruct.d.ts +1 -1
- package/dist/plugins/OutlineTree/components/TreeView/index.d.ts +2 -3
- package/dist/plugins/OutlineTree/util.d.ts +1 -2
- package/dist/style.css +1 -1
- package/dist/utils/defaultEngineConfig.d.ts +8 -1
- package/package.json +19 -14
- package/dist/plugins/Designer/view.d.ts +0 -37
|
@@ -9,6 +9,6 @@ export type CArraySetterProps = {
|
|
|
9
9
|
sortLabelKey?: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const ArraySetter: {
|
|
12
|
-
({ onValueChange, setterContext, item: { setters, initialValue }, sortLabelKey, ...props }: CSetterProps<CArraySetterProps>): JSX.Element;
|
|
12
|
+
({ onValueChange, setterContext, item: { setters, initialValue: itemInitialValue }, sortLabelKey, initialValue, ...props }: CSetterProps<CArraySetterProps>): JSX.Element;
|
|
13
13
|
setterName: string;
|
|
14
14
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SwitchProps } from 'antd';
|
|
2
2
|
import { CSetter } from '../type';
|
|
3
3
|
type BooleanSetterProps = SwitchProps;
|
|
4
|
-
export declare const BooleanSetter: CSetter<BooleanSetterProps
|
|
4
|
+
export declare const BooleanSetter: CSetter<BooleanSetterProps & {
|
|
5
|
+
initialValue?: boolean;
|
|
6
|
+
}>;
|
|
5
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DefaultTslibSource = "\ntype ContextType = {\n /** \u6E32\u67D3\u51FD\u6570\u7684\u5165\u53E3\u53C2\u6570 */\n params?: Record<any, any>;\n /** \u5168\u5C40\u72B6\u6001 */\n globalState?: Record<any, any>;\n /** \u66F4\u65B0\u5168\u5C40\u72B6\u6001 */\n updateGlobalState?: (newState: any) => void;\n /** \u5F53\u524D\u8282\u70B9\
|
|
1
|
+
export declare const DefaultTslibSource = "\ntype ContextType = {\n /** \u6E32\u67D3\u51FD\u6570\u7684\u5165\u53E3\u53C2\u6570 */\n params?: Record<any, any>;\n /** \u5168\u5C40\u72B6\u6001 */\n globalState?: Record<any, any>;\n /** \u66F4\u65B0\u5168\u5C40\u72B6\u6001 */\n updateGlobalState?: (newState: any) => void;\n /** \u5B58\u50A8\u5F53\u524D\u8282\u70B9\u7684\u6570\u636E\uFF0C\u4E0D\u5177\u6709\u54CD\u5E94\u6027 **/\n staticVar?: Record<string | number, any>;\n getStaticVar?: () => Record<string, any>;\n getStaticVarById?: (nodeId: string) => Record<string, any>;\n methods?: Record<string, (...arg: any) => any>;\n getMethods?: () => Record<string, (...arg: any) => any>;\n getMethodsById?: (nodeId: string) => Record<string, (...arg: any) => any>;\n /** \u5F53\u524D\u8282\u70B9\u72B6\u6001 **/\n state?: Record<any, any>;\n /** \u66F4\u65B0\u5F53\u524D\u8282\u70B9\u72B6\u6001 */\n updateState?: (newState: any) => void;\n getState?: () => Record<any, any>;\n getStateById?: (nodeId: string) => Record<any, any>;\n updateStateById?: (nodeId: string, newState: Record<any, any>) => void;\n getStateObj?: () => {\n state?: Record<any, any>;\n updateState?: (newState: any) => void;\n };\n getStateObjById?: (nodeId: string) => {\n state?: Record<any, any>;\n updateState?: (newState: any) => void;\n };\n /** \u7528\u4E8E\u8BBF\u8BBF\u95EE\u548C\u7BA1\u7406\u9875\u9762\u88AB\u6CE8\u518C\u4E3A\u5168\u5C40\u7684\u5C40\u90E8 state \u5FEB\u7167\uFF0C\u5728\u95ED\u5305\u4E2D\u4F7F\u7528\u4F1A\u5B58\u5728\u503C\u4E0D\u662F\u6700\u65B0\u7684\u60C5\u51B5 */\n stateManager?: Record<string, {\n state: any,\n updateState: (newState: Record<string, any>) => void\n }>;\n /** \u5FAA\u73AF\u6570\u636E */\n loopData?: Record<any, any>;\n /** \u7EC4\u4EF6\u8282\u70B9\u7684 Ref */\n refs?: {get: (nodeId: string) => any};\n storeManager?: StoreManager;\n /** \u7B2C\u4E09\u65B9\u8F85\u52A9\u5E93 */\n thirdLibs?: Record<string, any>;\n};\n\n/** \u6E32\u67D3\u4E0A\u4E0B\u6587 */\ndeclare var $$context: ContextType;\n";
|
|
@@ -3,21 +3,21 @@ import { AssetPackage, CPage } from '@chamn/model';
|
|
|
3
3
|
import { Emitter } from 'mitt';
|
|
4
4
|
import { Workbench } from '../component/Workbench';
|
|
5
5
|
import { CustomI18n } from '../i18n';
|
|
6
|
-
export type PluginObj = {
|
|
6
|
+
export type PluginObj<C, E = any> = {
|
|
7
7
|
name: string;
|
|
8
|
-
init: (ctx: CPluginCtx) => Promise<void>;
|
|
9
|
-
destroy: (ctx: CPluginCtx) => Promise<void>;
|
|
8
|
+
init: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
9
|
+
destroy: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
10
10
|
/** 用于暴露给外部重载插件 */
|
|
11
|
-
reload?: (ctx: CPluginCtx) => Promise<void>;
|
|
11
|
+
reload?: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
12
12
|
/** 插件暴露给外部可以调用的方法 */
|
|
13
|
-
|
|
13
|
+
export: (ctx: CPluginCtx<C>) => E;
|
|
14
14
|
meta: {
|
|
15
15
|
engine: {
|
|
16
16
|
version: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export type CPlugin = PluginObj | ((ctx: CPluginCtx) => PluginObj);
|
|
20
|
+
export type CPlugin<C = Record<string, any>, E = any> = PluginObj<C, E> | ((ctx: CPluginCtx<C>) => PluginObj<C, E>);
|
|
21
21
|
type PluginManagerOptions = {
|
|
22
22
|
getWorkbench: () => Workbench;
|
|
23
23
|
emitter: Emitter<any>;
|
|
@@ -33,13 +33,13 @@ export type CPluginCtx<C = any> = {
|
|
|
33
33
|
pluginManager: PluginManager;
|
|
34
34
|
pluginReadyOk: () => void;
|
|
35
35
|
} & PluginManagerOptions;
|
|
36
|
-
export type PluginInstance = {
|
|
37
|
-
ctx: CPluginCtx
|
|
38
|
-
|
|
39
|
-
source: PluginObj
|
|
36
|
+
export type PluginInstance<C = any, E = any> = {
|
|
37
|
+
ctx: CPluginCtx<C>;
|
|
38
|
+
export: E;
|
|
39
|
+
source: PluginObj<C, E>;
|
|
40
40
|
ready: boolean;
|
|
41
41
|
};
|
|
42
|
-
export type CustomPluginHook = (pluginInstance:
|
|
42
|
+
export type CustomPluginHook<P extends PluginInstance<any, any> = any> = (pluginInstance: P) => P;
|
|
43
43
|
export declare class PluginManager {
|
|
44
44
|
plugins: Map<string, PluginInstance>;
|
|
45
45
|
emitter: Emitter<any>;
|
|
@@ -51,11 +51,11 @@ export declare class PluginManager {
|
|
|
51
51
|
customPluginHooks: Record<string, CustomPluginHook[]>;
|
|
52
52
|
constructor({ getWorkbench, emitter, pageModel, i18n, assets, engine }: PluginManagerOptions);
|
|
53
53
|
/** 自定义插件, 可以修改插件的配置 */
|
|
54
|
-
customPlugin: (pluginName: string, customPluginHook: CustomPluginHook) => void;
|
|
54
|
+
customPlugin: <P extends PluginInstance<any, any>>(pluginName: string, customPluginHook: CustomPluginHook<P>) => void;
|
|
55
55
|
createPluginCtx: () => CPluginCtx<any>;
|
|
56
56
|
add(plugin: CPlugin): Promise<void>;
|
|
57
|
-
get(pluginName: string): Promise<
|
|
57
|
+
get<P extends PluginInstance<any, any>>(pluginName: string): Promise<P | undefined>;
|
|
58
58
|
remove(name: string): Promise<void>;
|
|
59
|
-
onPluginReadyOk(pluginName: string, cb?: (pluginHandle: PluginInstance) => void): Promise<PluginInstance
|
|
59
|
+
onPluginReadyOk(pluginName: string, cb?: (pluginHandle: PluginInstance) => void): Promise<PluginInstance<any, any>> | undefined;
|
|
60
60
|
}
|
|
61
61
|
export {};
|
package/dist/index.d.ts
CHANGED