@chamn/engine 0.0.41 → 0.0.42
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/Engine.module.scss.d.ts +5 -0
- package/dist/component/CSSEditor/index.d.ts +16 -0
- package/dist/component/CSSEditor/style.module.scss.d.ts +6 -0
- package/dist/component/CSSPropertiesEditor/cssProperties.d.ts +898 -0
- package/dist/component/CSSPropertiesEditor/index.d.ts +21 -0
- package/dist/component/CSSPropertiesEditor/signleProperty.d.ts +25 -0
- package/dist/component/CSSPropertiesEditor/style.module.scss.d.ts +17 -0
- package/dist/component/CSSPropertiesVariableBindEditor/SingleProperty.d.ts +24 -0
- package/dist/component/CSSPropertiesVariableBindEditor/cssProperties.d.ts +898 -0
- package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +19 -0
- package/dist/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +16 -0
- package/dist/component/CSSSizeInput/index.d.ts +39 -0
- package/dist/component/CSSSizeInput/style.module.scss.d.ts +10 -0
- package/dist/component/CSSUIPanel/BackgroundInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/BorderInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/DimensionInput/index.d.ts +11 -0
- package/dist/component/CSSUIPanel/FontInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/MarginAndPaddingInput/index.d.ts +11 -0
- package/dist/component/CSSUIPanel/ShadowInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/index.d.ts +9 -0
- package/dist/component/CSSUIPanel/style.module.scss.d.ts +11 -0
- package/dist/component/CSSUIPanel/type.d.ts +3 -0
- package/dist/component/ClassNameEditor/index.d.ts +10 -0
- package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +12 -0
- package/dist/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
- package/dist/component/CustomSchemaForm/components/Form/context.d.ts +12 -0
- package/dist/component/CustomSchemaForm/components/Form/index.d.ts +19 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +14 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
- package/dist/component/CustomSchemaForm/components/Setters/AntDColorSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +11 -0
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts +10 -0
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +14 -0
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
- package/dist/component/CustomSchemaForm/components/Setters/BooleanSetter/index.d.ts +7 -0
- package/dist/component/CustomSchemaForm/components/Setters/CSSSizeSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.d.ts +6 -0
- package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
- package/dist/component/CustomSchemaForm/components/Setters/ColorSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.d.ts +10 -0
- package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/JSONSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/NumberSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/RadioGroupSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/SelectSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/ShapeSetter/index.d.ts +8 -0
- package/dist/component/CustomSchemaForm/components/Setters/SliderSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/StringSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/index.d.ts +4 -0
- package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +20 -0
- package/dist/component/CustomSchemaForm/context.d.ts +15 -0
- package/dist/component/CustomSchemaForm/index.d.ts +22 -0
- package/dist/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
- package/dist/component/CustomSchemaForm/utils.d.ts +2 -0
- package/dist/component/InputNumberPlus/index.d.ts +9 -0
- package/dist/component/InputNumberPlus/style.module.scss.d.ts +6 -0
- package/dist/component/MonacoEditor/index.d.ts +14 -0
- package/dist/component/Workbench/index.d.ts +72 -0
- package/dist/component/Workbench/style.module.scss.d.ts +26 -0
- package/dist/config/colorPickerColorList.d.ts +4 -0
- package/dist/core/assetPackagesListManage.d.ts +8 -0
- package/dist/core/pluginManager.d.ts +63 -0
- package/dist/i18n/en_US/index.d.ts +5 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/zh_CN/index.d.ts +5 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/material/innerMaterial.d.ts +2 -0
- package/dist/plugins/AdvancePanel/index.d.ts +10 -0
- package/dist/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
- package/dist/plugins/ComponentLibrary/components/DragItem/index.d.ts +12 -0
- package/dist/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
- package/dist/plugins/ComponentLibrary/components/ListView/index.d.ts +9 -0
- package/dist/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
- package/dist/plugins/ComponentLibrary/index.d.ts +3 -0
- package/dist/plugins/ComponentLibrary/localize/en_US/index.d.ts +1 -0
- package/dist/plugins/ComponentLibrary/localize/index.d.ts +2 -0
- package/dist/plugins/ComponentLibrary/localize/zh_CN/index.d.ts +1 -0
- package/dist/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
- package/dist/plugins/ComponentLibrary/util.d.ts +1 -0
- package/dist/plugins/ComponentStatePanel/index.d.ts +10 -0
- package/dist/plugins/Designer/components/Canvas/advanceCustomHook.d.ts +45 -0
- package/dist/plugins/Designer/components/Canvas/index.d.ts +63 -0
- package/dist/plugins/Designer/components/Canvas/style.module.scss.d.ts +5 -0
- package/dist/plugins/Designer/components/DefaultSelectToolBar/index.d.ts +16 -0
- package/dist/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
- package/dist/plugins/Designer/components/GhostView/index.d.ts +5 -0
- package/dist/plugins/Designer/config.d.ts +1 -0
- package/dist/plugins/Designer/index.d.ts +2 -0
- package/dist/plugins/Designer/localize/en_US/index.d.ts +1 -0
- package/dist/plugins/Designer/localize/index.d.ts +2 -0
- package/dist/plugins/Designer/localize/zh_CN/index.d.ts +1 -0
- package/dist/plugins/Designer/type.d.ts +26 -0
- package/dist/plugins/Designer/util.d.ts +2 -0
- package/dist/plugins/DisplaySourceSchema/index.d.ts +9 -0
- package/dist/plugins/GlobalStatePanel/index.d.ts +3 -0
- package/dist/plugins/GlobalStatePanel/localize/en_US/index.d.ts +1 -0
- package/dist/plugins/GlobalStatePanel/localize/index.d.ts +2 -0
- package/dist/plugins/GlobalStatePanel/localize/zh_CN/index.d.ts +1 -0
- package/dist/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
- package/dist/plugins/History/index.d.ts +2 -0
- package/dist/plugins/History/type.d.ts +12 -0
- package/dist/plugins/OutlineTree/components/TreeView/context.d.ts +30 -0
- package/dist/plugins/OutlineTree/components/TreeView/dataStruct.d.ts +21 -0
- package/dist/plugins/OutlineTree/components/TreeView/index.d.ts +33 -0
- package/dist/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
- package/dist/plugins/OutlineTree/components/TreeView/treeNode.d.ts +11 -0
- package/dist/plugins/OutlineTree/index.d.ts +3 -0
- package/dist/plugins/OutlineTree/localize/en_US/index.d.ts +1 -0
- package/dist/plugins/OutlineTree/localize/index.d.ts +2 -0
- package/dist/plugins/OutlineTree/localize/zh_CN/index.d.ts +1 -0
- package/dist/plugins/OutlineTree/util.d.ts +14 -0
- package/dist/plugins/PropertyPanel/index.d.ts +9 -0
- package/dist/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
- package/dist/plugins/RightPanel/index.d.ts +2 -0
- package/dist/plugins/RightPanel/style.module.scss.d.ts +10 -0
- package/dist/plugins/RightPanel/view.d.ts +39 -0
- package/dist/plugins/VisualPanelPlus/index.d.ts +4 -0
- package/dist/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/utils/css.d.ts +40 -0
- package/dist/utils/defaultEngineConfig.d.ts +13 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/logger.d.ts +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import globalClassNames from '../../style.d';
|
|
2
|
+
declare const classNames: typeof globalClassNames & {
|
|
3
|
+
readonly workbenchContainer: 'workbenchContainer';
|
|
4
|
+
readonly topToolBarBox: 'topToolBarBox';
|
|
5
|
+
readonly topToolBarView: 'topToolBarView';
|
|
6
|
+
readonly bodyContent: 'bodyContent';
|
|
7
|
+
readonly leftBox: 'leftBox';
|
|
8
|
+
readonly pluginIconBar: 'pluginIconBar';
|
|
9
|
+
readonly pluginIconItem: 'pluginIconItem';
|
|
10
|
+
readonly active: 'active';
|
|
11
|
+
readonly pluginPanelBoxResizeBox: 'pluginPanelBoxResizeBox';
|
|
12
|
+
readonly pluginHeader: 'pluginHeader';
|
|
13
|
+
readonly pluginNameText: 'pluginNameText';
|
|
14
|
+
readonly closeBtn: 'closeBtn';
|
|
15
|
+
readonly fixedBtn: 'fixedBtn';
|
|
16
|
+
readonly pluginPanelBox: 'pluginPanelBox';
|
|
17
|
+
readonly rightResizeBox: 'rightResizeBox';
|
|
18
|
+
readonly arrowCursor: 'arrowCursor';
|
|
19
|
+
readonly rightBox: 'rightBox';
|
|
20
|
+
readonly centerBox: 'centerBox';
|
|
21
|
+
readonly subTopToolbarBox: 'subTopToolbarBox';
|
|
22
|
+
readonly canvasBox: 'canvasBox';
|
|
23
|
+
readonly scrollBox: 'scrollBox';
|
|
24
|
+
readonly customViewBox: 'customViewBox';
|
|
25
|
+
};
|
|
26
|
+
export = classNames;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AssetPackage } from '@chamn/model';
|
|
2
|
+
export declare class AssetsPackageListManager {
|
|
3
|
+
private _assets;
|
|
4
|
+
constructor(assets: AssetPackage[]);
|
|
5
|
+
getList(): AssetPackage[];
|
|
6
|
+
setList(newAssets: AssetPackage[]): void;
|
|
7
|
+
}
|
|
8
|
+
export declare const getUniqueAssetsList: (tempList: AssetPackage[]) => AssetPackage[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Engine } from '../index';
|
|
2
|
+
import { CPage } from '@chamn/model';
|
|
3
|
+
import { Emitter } from 'mitt';
|
|
4
|
+
import { Workbench } from '../component/Workbench';
|
|
5
|
+
import { CustomI18n } from '../i18n';
|
|
6
|
+
import { AssetsPackageListManager } from './assetPackagesListManage';
|
|
7
|
+
export type PluginObj<C, E = any> = {
|
|
8
|
+
name: string;
|
|
9
|
+
init: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
10
|
+
destroy: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
11
|
+
/** 用于暴露给外部重载插件 */
|
|
12
|
+
reload?: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
13
|
+
/** 插件暴露给外部可以调用的方法 */
|
|
14
|
+
export: (ctx: CPluginCtx<C>) => E;
|
|
15
|
+
meta: {
|
|
16
|
+
engine: {
|
|
17
|
+
version: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type CPlugin<C = Record<string, any>, E = any> = PluginObj<C, E> | ((ctx: CPluginCtx<C>) => PluginObj<C, E>);
|
|
22
|
+
type PluginManagerOptions = {
|
|
23
|
+
getWorkbench: () => Workbench;
|
|
24
|
+
emitter: Emitter<any>;
|
|
25
|
+
pageModel: CPage;
|
|
26
|
+
i18n: CustomI18n;
|
|
27
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
28
|
+
engine: Engine;
|
|
29
|
+
};
|
|
30
|
+
export type CPluginCtx<C = any> = {
|
|
31
|
+
name?: string;
|
|
32
|
+
globalEmitter: Emitter<any>;
|
|
33
|
+
/** 当前插件外部传入的配置 **/
|
|
34
|
+
config: C;
|
|
35
|
+
pluginManager: PluginManager;
|
|
36
|
+
pluginReadyOk: () => void;
|
|
37
|
+
} & PluginManagerOptions;
|
|
38
|
+
export type PluginInstance<C = any, E = any> = {
|
|
39
|
+
ctx: CPluginCtx<C>;
|
|
40
|
+
export: E;
|
|
41
|
+
source: PluginObj<C, E>;
|
|
42
|
+
ready: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type CustomPluginHook<P extends PluginInstance<any, any> = any> = (pluginInstance: P) => P;
|
|
45
|
+
export declare class PluginManager {
|
|
46
|
+
plugins: Map<string, PluginInstance>;
|
|
47
|
+
emitter: Emitter<any>;
|
|
48
|
+
getWorkbench: () => Workbench;
|
|
49
|
+
pageModel: CPage;
|
|
50
|
+
i18n: CustomI18n;
|
|
51
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
52
|
+
engine: Engine;
|
|
53
|
+
customPluginHooks: Record<string, CustomPluginHook[]>;
|
|
54
|
+
constructor({ getWorkbench, emitter, pageModel, i18n, assetsPackageListManager, engine }: PluginManagerOptions);
|
|
55
|
+
/** 自定义插件, 可以修改插件的配置 */
|
|
56
|
+
customPlugin: <P extends PluginInstance<any, any>>(pluginName: string, customPluginHook: CustomPluginHook<P>) => void;
|
|
57
|
+
createPluginCtx: () => CPluginCtx<any>;
|
|
58
|
+
add(plugin: CPlugin): Promise<void>;
|
|
59
|
+
get<P extends PluginInstance<any, any>>(pluginName: string): Promise<P | undefined>;
|
|
60
|
+
remove(name: string): Promise<void>;
|
|
61
|
+
onPluginReadyOk(pluginName: string, cb?: (pluginHandle: PluginInstance) => void): Promise<PluginInstance<any, any>>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Workbench } from './component/Workbench';
|
|
3
|
+
import { CPlugin, PluginManager } from './core/pluginManager';
|
|
4
|
+
import { Emitter } from 'mitt';
|
|
5
|
+
import { AssetPackage, CMaterialType, CNode, CPage, CPageDataType, CRootNode } from '@chamn/model';
|
|
6
|
+
import { ComponentsType } from '@chamn/render';
|
|
7
|
+
import { AssetsPackageListManager } from './core/assetPackagesListManage';
|
|
8
|
+
export type EnginContext = {
|
|
9
|
+
pluginManager: PluginManager;
|
|
10
|
+
engine: Engine;
|
|
11
|
+
};
|
|
12
|
+
export type EngineProps = {
|
|
13
|
+
plugins: CPlugin[];
|
|
14
|
+
schema: CPageDataType;
|
|
15
|
+
material?: CMaterialType[];
|
|
16
|
+
components?: Record<string, any>;
|
|
17
|
+
assetPackagesList?: AssetPackage[];
|
|
18
|
+
beforePluginRun?: (options: {
|
|
19
|
+
pluginManager: PluginManager;
|
|
20
|
+
}) => void;
|
|
21
|
+
/** 所有的加插件加载完成 */
|
|
22
|
+
onReady?: (ctx: EnginContext) => void;
|
|
23
|
+
onMount?: (ctx: EnginContext) => void;
|
|
24
|
+
/** 渲染器 umd 格式 js 地址, 默认 ./render.umd.js */
|
|
25
|
+
renderJSUrl?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare class Engine extends React.Component<EngineProps> {
|
|
30
|
+
static version: string;
|
|
31
|
+
currentSelectNode: CNode | CRootNode | null;
|
|
32
|
+
pluginManager: PluginManager;
|
|
33
|
+
workbenchRef: React.RefObject<Workbench>;
|
|
34
|
+
pageSchema: CPageDataType | undefined;
|
|
35
|
+
pageModel: CPage;
|
|
36
|
+
material: CMaterialType[] | undefined;
|
|
37
|
+
emitter: Emitter<any>;
|
|
38
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
39
|
+
constructor(props: EngineProps);
|
|
40
|
+
updateCurrentSelectNode(node: CNode | CRootNode | null): void;
|
|
41
|
+
componentDidMount(): Promise<void>;
|
|
42
|
+
getActiveNode(): CNode | CRootNode | null;
|
|
43
|
+
updatePage: (page: CPageDataType) => void;
|
|
44
|
+
updateMaterials: (materials: CMaterialType[], assetPackagesList: AssetPackage[], options?: {
|
|
45
|
+
formatComponents?: ((componentMap: ComponentsType) => ComponentsType) | undefined;
|
|
46
|
+
} | undefined) => Promise<void>;
|
|
47
|
+
refresh: () => Promise<void>;
|
|
48
|
+
getWorkbench: () => Workbench | null;
|
|
49
|
+
render(): JSX.Element;
|
|
50
|
+
}
|
|
51
|
+
export * as plugins from './plugins';
|
|
52
|
+
export * from '@chamn/layout';
|
|
53
|
+
export * from './material/innerMaterial';
|
|
54
|
+
export * from './component/CustomSchemaForm/components/Setters/type';
|
|
55
|
+
export * from './utils/index';
|
|
56
|
+
/** 注册自定义 setter */
|
|
57
|
+
export { registerCustomSetter } from './component/CustomSchemaForm/components/Form';
|