@chamn/engine 0.0.39 → 0.0.41

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.
Files changed (129) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +18 -18
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +7 -7
  6. package/dist/Engine.module.scss.d.ts +0 -5
  7. package/dist/component/CSSEditor/index.d.ts +0 -16
  8. package/dist/component/CSSEditor/style.module.scss.d.ts +0 -6
  9. package/dist/component/CSSPropertiesEditor/cssProperties.d.ts +0 -898
  10. package/dist/component/CSSPropertiesEditor/index.d.ts +0 -21
  11. package/dist/component/CSSPropertiesEditor/signleProperty.d.ts +0 -25
  12. package/dist/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -17
  13. package/dist/component/CSSPropertiesVariableBindEditor/SingleProperty.d.ts +0 -24
  14. package/dist/component/CSSPropertiesVariableBindEditor/cssProperties.d.ts +0 -898
  15. package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +0 -19
  16. package/dist/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -16
  17. package/dist/component/CSSSizeInput/index.d.ts +0 -39
  18. package/dist/component/CSSSizeInput/style.module.scss.d.ts +0 -10
  19. package/dist/component/CSSUIPanel/BackgroundInput/index.d.ts +0 -10
  20. package/dist/component/CSSUIPanel/BorderInput/index.d.ts +0 -10
  21. package/dist/component/CSSUIPanel/DimensionInput/index.d.ts +0 -11
  22. package/dist/component/CSSUIPanel/FontInput/index.d.ts +0 -10
  23. package/dist/component/CSSUIPanel/MarginAndPaddingInput/index.d.ts +0 -11
  24. package/dist/component/CSSUIPanel/ShadowInput/index.d.ts +0 -10
  25. package/dist/component/CSSUIPanel/index.d.ts +0 -9
  26. package/dist/component/CSSUIPanel/style.module.scss.d.ts +0 -11
  27. package/dist/component/CSSUIPanel/type.d.ts +0 -3
  28. package/dist/component/ClassNameEditor/index.d.ts +0 -10
  29. package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +0 -12
  30. package/dist/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
  31. package/dist/component/CustomSchemaForm/components/Form/context.d.ts +0 -12
  32. package/dist/component/CustomSchemaForm/components/Form/index.d.ts +0 -19
  33. package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +0 -14
  34. package/dist/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
  35. package/dist/component/CustomSchemaForm/components/Setters/AntDColorSetter/index.d.ts +0 -2
  36. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +0 -11
  37. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts +0 -10
  38. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +0 -14
  39. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
  40. package/dist/component/CustomSchemaForm/components/Setters/BooleanSetter/index.d.ts +0 -7
  41. package/dist/component/CustomSchemaForm/components/Setters/CSSSizeSetter/index.d.ts +0 -3
  42. package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.d.ts +0 -6
  43. package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
  44. package/dist/component/CustomSchemaForm/components/Setters/ColorSetter/index.d.ts +0 -2
  45. package/dist/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.d.ts +0 -10
  46. package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/index.d.ts +0 -2
  47. package/dist/component/CustomSchemaForm/components/Setters/JSONSetter/index.d.ts +0 -2
  48. package/dist/component/CustomSchemaForm/components/Setters/NumberSetter/index.d.ts +0 -3
  49. package/dist/component/CustomSchemaForm/components/Setters/RadioGroupSetter/index.d.ts +0 -2
  50. package/dist/component/CustomSchemaForm/components/Setters/SelectSetter/index.d.ts +0 -3
  51. package/dist/component/CustomSchemaForm/components/Setters/ShapeSetter/index.d.ts +0 -8
  52. package/dist/component/CustomSchemaForm/components/Setters/SliderSetter/index.d.ts +0 -3
  53. package/dist/component/CustomSchemaForm/components/Setters/StringSetter/index.d.ts +0 -3
  54. package/dist/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.d.ts +0 -3
  55. package/dist/component/CustomSchemaForm/components/Setters/index.d.ts +0 -4
  56. package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +0 -20
  57. package/dist/component/CustomSchemaForm/context.d.ts +0 -15
  58. package/dist/component/CustomSchemaForm/index.d.ts +0 -22
  59. package/dist/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
  60. package/dist/component/CustomSchemaForm/utils.d.ts +0 -2
  61. package/dist/component/InputNumberPlus/index.d.ts +0 -9
  62. package/dist/component/InputNumberPlus/style.module.scss.d.ts +0 -6
  63. package/dist/component/MonacoEditor/index.d.ts +0 -14
  64. package/dist/component/Workbench/index.d.ts +0 -72
  65. package/dist/component/Workbench/style.module.scss.d.ts +0 -26
  66. package/dist/config/colorPickerColorList.d.ts +0 -4
  67. package/dist/core/assetPackagesListManage.d.ts +0 -8
  68. package/dist/core/pluginManager.d.ts +0 -63
  69. package/dist/i18n/en_US/index.d.ts +0 -5
  70. package/dist/i18n/index.d.ts +0 -6
  71. package/dist/i18n/zh_CN/index.d.ts +0 -5
  72. package/dist/index.d.ts +0 -57
  73. package/dist/material/innerMaterial.d.ts +0 -2
  74. package/dist/plugins/AdvancePanel/index.d.ts +0 -10
  75. package/dist/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
  76. package/dist/plugins/ComponentLibrary/components/DragItem/index.d.ts +0 -12
  77. package/dist/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
  78. package/dist/plugins/ComponentLibrary/components/ListView/index.d.ts +0 -9
  79. package/dist/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
  80. package/dist/plugins/ComponentLibrary/index.d.ts +0 -3
  81. package/dist/plugins/ComponentLibrary/localize/en_US/index.d.ts +0 -1
  82. package/dist/plugins/ComponentLibrary/localize/index.d.ts +0 -2
  83. package/dist/plugins/ComponentLibrary/localize/zh_CN/index.d.ts +0 -1
  84. package/dist/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
  85. package/dist/plugins/ComponentLibrary/util.d.ts +0 -1
  86. package/dist/plugins/ComponentStatePanel/index.d.ts +0 -10
  87. package/dist/plugins/Designer/components/Canvas/advanceCustomHook.d.ts +0 -45
  88. package/dist/plugins/Designer/components/Canvas/index.d.ts +0 -63
  89. package/dist/plugins/Designer/components/Canvas/style.module.scss.d.ts +0 -5
  90. package/dist/plugins/Designer/components/DefaultSelectToolBar/index.d.ts +0 -16
  91. package/dist/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
  92. package/dist/plugins/Designer/components/GhostView/index.d.ts +0 -5
  93. package/dist/plugins/Designer/config.d.ts +0 -1
  94. package/dist/plugins/Designer/index.d.ts +0 -2
  95. package/dist/plugins/Designer/localize/en_US/index.d.ts +0 -1
  96. package/dist/plugins/Designer/localize/index.d.ts +0 -2
  97. package/dist/plugins/Designer/localize/zh_CN/index.d.ts +0 -1
  98. package/dist/plugins/Designer/type.d.ts +0 -26
  99. package/dist/plugins/Designer/util.d.ts +0 -2
  100. package/dist/plugins/DisplaySourceSchema/index.d.ts +0 -9
  101. package/dist/plugins/GlobalStatePanel/index.d.ts +0 -3
  102. package/dist/plugins/GlobalStatePanel/localize/en_US/index.d.ts +0 -1
  103. package/dist/plugins/GlobalStatePanel/localize/index.d.ts +0 -2
  104. package/dist/plugins/GlobalStatePanel/localize/zh_CN/index.d.ts +0 -1
  105. package/dist/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
  106. package/dist/plugins/History/index.d.ts +0 -2
  107. package/dist/plugins/History/type.d.ts +0 -12
  108. package/dist/plugins/OutlineTree/components/TreeView/context.d.ts +0 -30
  109. package/dist/plugins/OutlineTree/components/TreeView/dataStruct.d.ts +0 -21
  110. package/dist/plugins/OutlineTree/components/TreeView/index.d.ts +0 -33
  111. package/dist/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
  112. package/dist/plugins/OutlineTree/components/TreeView/treeNode.d.ts +0 -11
  113. package/dist/plugins/OutlineTree/index.d.ts +0 -3
  114. package/dist/plugins/OutlineTree/localize/en_US/index.d.ts +0 -1
  115. package/dist/plugins/OutlineTree/localize/index.d.ts +0 -2
  116. package/dist/plugins/OutlineTree/localize/zh_CN/index.d.ts +0 -1
  117. package/dist/plugins/OutlineTree/util.d.ts +0 -14
  118. package/dist/plugins/PropertyPanel/index.d.ts +0 -9
  119. package/dist/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
  120. package/dist/plugins/RightPanel/index.d.ts +0 -2
  121. package/dist/plugins/RightPanel/style.module.scss.d.ts +0 -10
  122. package/dist/plugins/RightPanel/view.d.ts +0 -39
  123. package/dist/plugins/VisualPanelPlus/index.d.ts +0 -4
  124. package/dist/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
  125. package/dist/plugins/index.d.ts +0 -9
  126. package/dist/utils/css.d.ts +0 -40
  127. package/dist/utils/defaultEngineConfig.d.ts +0 -13
  128. package/dist/utils/index.d.ts +0 -12
  129. package/dist/utils/logger.d.ts +0 -1
@@ -1,26 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export declare const DEFAULT_PRESET_COLORS: {
2
- label: string;
3
- colors: string[];
4
- }[];
@@ -1,8 +0,0 @@
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[];
@@ -1,63 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
1
- export declare const en_US: {
2
- translation: {
3
- 'Welcome to React': string;
4
- };
5
- };
@@ -1,6 +0,0 @@
1
- import i18n from 'i18next';
2
- export type CustomI18n = typeof i18n & {
3
- update: () => void;
4
- };
5
- declare const customI18n: CustomI18n;
6
- export default customI18n;
@@ -1,5 +0,0 @@
1
- export declare const zh_CN: {
2
- translation: {
3
- 'Welcome to React': string;
4
- };
5
- };
package/dist/index.d.ts DELETED
@@ -1,57 +0,0 @@
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';
@@ -1,2 +0,0 @@
1
- import { CMaterialType } from '@chamn/model';
2
- export declare const InnerComponentMeta: CMaterialType<"">[];
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { CNode, CRootNode } from '@chamn/model';
3
- import { CPluginCtx } from '../../core/pluginManager';
4
- import { CRightPanelItem } from '../RightPanel/view';
5
- export type AdvancePanelProps = {
6
- node: CNode | CRootNode | null;
7
- pluginCtx: CPluginCtx;
8
- };
9
- export declare const AdvancePanel: (props: AdvancePanelProps) => JSX.Element;
10
- export declare const AdvancePanelConfig: CRightPanelItem;
@@ -1,7 +0,0 @@
1
- import globalClassNames from '../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly advanceBox: 'advanceBox';
4
- readonly 'ant-input-affix-wrapper': 'ant-input-affix-wrapper';
5
- readonly 'ant-input-prefix': 'ant-input-prefix';
6
- };
7
- export = classNames;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export type DragComponentItemProps = {
3
- id: string;
4
- name: string;
5
- description?: any;
6
- icon: React.ReactNode | string;
7
- iconText?: string;
8
- style?: React.CSSProperties;
9
- containerClassName?: string;
10
- };
11
- export declare const DragComponentItem: (props: DragComponentItemProps) => JSX.Element;
12
- export declare const DRAG_ITEM_KEY = "data-drag-key";
@@ -1,9 +0,0 @@
1
- import globalClassNames from '../../../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly square: 'square';
4
- readonly componentItem: 'componentItem';
5
- readonly iconImg: 'iconImg';
6
- readonly iconBox: 'iconBox';
7
- readonly iconText: 'iconText';
8
- };
9
- export = classNames;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { SnippetsType } from '@chamn/model';
3
- export type ListViewProps = {
4
- dataSource: {
5
- name: string;
6
- list: SnippetsType[];
7
- }[];
8
- };
9
- export declare const ListView: (props: ListViewProps) => JSX.Element | null;
@@ -1,12 +0,0 @@
1
- import globalClassNames from '../../../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly ListBox: 'ListBox';
4
- readonly 'ant-collapse': 'ant-collapse';
5
- readonly 'ant-collapse-content': 'ant-collapse-content';
6
- readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
7
- readonly 'ant-collapse-header': 'ant-collapse-header';
8
- readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
9
- readonly 'ant-collapse-item': 'ant-collapse-item';
10
- readonly collapsePanel: 'collapsePanel';
11
- };
12
- export = classNames;
@@ -1,3 +0,0 @@
1
- import { CPlugin } from '../../core/pluginManager';
2
- export declare const PLUGIN_NAME = "ComponentLib";
3
- export declare const ComponentLibPlugin: CPlugin;
@@ -1 +0,0 @@
1
- export declare const en_US: Record<string, any>;
@@ -1,2 +0,0 @@
1
- declare const _default: Record<string, any>;
2
- export default _default;
@@ -1 +0,0 @@
1
- export declare const zh_CN: Record<string, any>;
@@ -1,11 +0,0 @@
1
- import globalClassNames from '../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly container: 'container';
4
- readonly 'ant-tabs': 'ant-tabs';
5
- readonly 'ant-tabs-tab': 'ant-tabs-tab';
6
- readonly 'ant-tabs-content': 'ant-tabs-content';
7
- readonly 'ant-tabs-content-top': 'ant-tabs-content-top';
8
- readonly 'ant-tabs-nav': 'ant-tabs-nav';
9
- readonly tabTitle: 'tabTitle';
10
- };
11
- export = classNames;
@@ -1 +0,0 @@
1
- export declare const getTargetMNodeKeyVal: (dom: HTMLElement | null, key: string) => null | string;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { CNode, CRootNode } from '@chamn/model';
3
- import { CPluginCtx } from '../../core/pluginManager';
4
- import { CRightPanelItem } from '../RightPanel/view';
5
- export type ComponentStatePanelProps = {
6
- node: CNode | CRootNode | null;
7
- pluginCtx: CPluginCtx;
8
- };
9
- export declare const ComponentStatePanel: (props: ComponentStatePanelProps) => JSX.Element;
10
- export declare const ComponentStatePanelConfig: CRightPanelItem;
@@ -1,45 +0,0 @@
1
- /// <reference types="react" />
2
- import { CPluginCtx } from '../../../../core/pluginManager';
3
- import { Layout, LayoutDragAndDropExtraDataType, LayoutDragEvent } from '../../../../index';
4
- import { AdvanceCustom, CNode, CRootNode } from '@chamn/model';
5
- export interface AdvanceCustomHookOptions {
6
- getPortalViewCtx: () => {
7
- setView: (view: React.ReactNode) => void;
8
- clearView: () => void;
9
- };
10
- ctx: CPluginCtx;
11
- layoutRef: React.RefObject<Layout>;
12
- }
13
- export type HookParameter = {
14
- dragNode?: CNode | CRootNode;
15
- dropNode?: CNode | CRootNode;
16
- eventObj: LayoutDragEvent<LayoutDragAndDropExtraDataType>;
17
- };
18
- export declare class AdvanceCustomHook {
19
- getPortalViewCtx: AdvanceCustomHookOptions['getPortalViewCtx'];
20
- ctx: CPluginCtx;
21
- layoutRef: AdvanceCustomHookOptions['layoutRef'];
22
- constructor(options: AdvanceCustomHookOptions);
23
- canDrag({ dragNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['canDragNode']>;
24
- canDrop({ dragNode, dropNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['canDropNode']>;
25
- onNewAdd({ dragNode, dropNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['onNewAdd']>;
26
- getSelectRectViewRender(node: CNode | CRootNode): ((props: import("@chamn/model").CustomViewRenderProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | undefined;
27
- getHoverRectViewRender(node?: CNode | CRootNode | null): ((props: import("@chamn/model").CustomViewRenderProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
28
- getDropViewRender(node?: CNode | CRootNode | null): ((props: import("@chamn/model").CustomViewRenderProps & {
29
- canDrop: boolean;
30
- posInfo: import("@chamn/model").DropPosType;
31
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
32
- getGhostViewRender(node?: CNode | CRootNode | null): ((props: import("@chamn/model").CustomViewRenderProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
33
- getToolbarViewRender(node?: CNode | CRootNode | null): ((props: {
34
- node: CNode | CRootNode;
35
- context: any;
36
- toolBarItems: {
37
- copyItem: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
38
- deleteItem: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
39
- visibleItem: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
40
- nodeLayout: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
41
- };
42
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
43
- onCopy(node: CNode | CRootNode): Promise<false | CNode | CRootNode>;
44
- onDelete(node: CNode | CRootNode): Promise<false | CNode | CRootNode>;
45
- }
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- import { Layout, LayoutPropsType } from '@chamn/layout';
3
- import { AdvanceCustom, CNode, CPage, CRootNode } from '@chamn/model';
4
- import { AssetPackage } from '@chamn/model';
5
- import { CPluginCtx } from '../../../../core/pluginManager';
6
- import { AdvanceCustomHook } from './advanceCustomHook';
7
- import { DesignerPluginConfig } from '../../type';
8
- import { AdvanceCustomFuncParam } from '@chamn/model';
9
- export type DesignerCtx = CPluginCtx<DesignerPluginConfig>;
10
- export type DesignerPropsType = {
11
- pluginCtx: DesignerCtx;
12
- };
13
- export type WrapComponentOptionsType = {
14
- ctx: DesignerCtx;
15
- node: CNode | CRootNode;
16
- };
17
- type DesignerStateType = {
18
- pageModel: CPage;
19
- hoverToolbarView: React.ReactNode;
20
- selectToolbarView: React.ReactNode;
21
- selectRectViewRender: AdvanceCustom['selectRectViewRender'] | null;
22
- hoverRectViewRender: AdvanceCustom['hoverRectViewRender'] | null;
23
- dropViewRender: AdvanceCustom['dropViewRender'] | null;
24
- ghostView: React.ReactNode;
25
- portalView: React.ReactNode;
26
- };
27
- export declare class Designer extends React.Component<DesignerPropsType, DesignerStateType> {
28
- layoutRef: React.RefObject<Layout>;
29
- customAdvanceHook: AdvanceCustomHook;
30
- constructor(props: DesignerPropsType);
31
- getPortalViewCtx: () => {
32
- setView: (view: React.ReactNode) => void;
33
- clearView: () => void;
34
- };
35
- /**
36
- * 更新 render 中的 components ;
37
- */
38
- updateRenderComponents(newComponentMap?: Record<string, any>): Promise<void>;
39
- componentDidMount(): void;
40
- reloadRender({ assets }: {
41
- assets?: AssetPackage[];
42
- }): void;
43
- init(): Promise<void>;
44
- onNodeDragging: LayoutPropsType['onNodeDragging'];
45
- onNodeDragEnd: LayoutPropsType['onNodeDraEnd'];
46
- onNodeDrop: LayoutPropsType['onNodeDrop'];
47
- onSelectNode: Required<LayoutPropsType>['onSelectNode'];
48
- onDragStart: LayoutPropsType['onNodeDragStart'];
49
- getGhostView: (dragNode: CNode | CRootNode, commonParam: AdvanceCustomFuncParam) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
50
- toSelectNode: (nodeId: string) => Promise<true | undefined>;
51
- toCopyNode: (id: string) => Promise<void>;
52
- toDeleteNode: (nodeId: string) => Promise<void>;
53
- toHidden: (id: string) => void;
54
- getToolbarView: (node: CNode | CRootNode) => JSX.Element;
55
- onHoverNode: LayoutPropsType['onHoverNode'];
56
- nodeCanDrag: LayoutPropsType['nodeCanDrag'];
57
- nodeCanDrop: LayoutPropsType['nodeCanDrop'];
58
- innerSelectRectViewRender: LayoutPropsType['selectRectViewRender'];
59
- innerHoverRectViewRender: LayoutPropsType['hoverRectViewRender'];
60
- innerDropViewRender: LayoutPropsType['dropViewRender'];
61
- render(): JSX.Element;
62
- }
63
- export {};
@@ -1,5 +0,0 @@
1
- import globalClassNames from '../../../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly hoverTips: 'hoverTips';
4
- };
5
- export = classNames;
@@ -1,16 +0,0 @@
1
- /// <reference types="react" />
2
- import { CNode } from '@chamn/model';
3
- export type DefaultSelectToolBarProps = {
4
- nodeList: CNode[];
5
- toSelectNode: (id: string) => void;
6
- toDelete: (id: string) => void;
7
- toCopy: (idd: string) => void;
8
- toHidden: (idd: string) => void;
9
- };
10
- export declare const getDefaultToolbarItem: (props: DefaultSelectToolBarProps) => {
11
- copyItem: JSX.Element;
12
- deleteItem: JSX.Element;
13
- visibleItem: JSX.Element;
14
- nodeLayout: JSX.Element;
15
- };
16
- export declare const DefaultSelectToolBar: (props: DefaultSelectToolBarProps) => JSX.Element;
@@ -1,11 +0,0 @@
1
- import globalClassNames from '../../../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly toolBarBox: 'toolBarBox';
4
- readonly item: 'item';
5
- readonly layoutSelectBox: 'layoutSelectBox';
6
- readonly hoverBox: 'hoverBox';
7
- readonly hoverBoxActive: 'hoverBoxActive';
8
- readonly hoverItem: 'hoverItem';
9
- readonly placeholder: 'placeholder';
10
- };
11
- export = classNames;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { CNode, CRootNode } from '@chamn/model';
3
- export declare const GhostView: ({ node }: {
4
- node: CNode | CRootNode;
5
- }) => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const PLUGIN_NAME = "Designer";
@@ -1,2 +0,0 @@
1
- import { DesignerPluginType } from './type';
2
- export declare const DesignerPlugin: DesignerPluginType;
@@ -1 +0,0 @@
1
- export declare const en_US: Record<string, any>;
@@ -1,2 +0,0 @@
1
- declare const _default: Record<string, any>;
2
- export default _default;
@@ -1 +0,0 @@
1
- export declare const zh_CN: Record<string, any>;
@@ -1,26 +0,0 @@
1
- /// <reference types="react" />
2
- import { CPlugin, PluginInstance } from '../../core/pluginManager';
3
- import { DragAndDrop, Layout, LayoutPropsType } from '@chamn/layout';
4
- import { AdvanceCustom, AssetPackage, CPageDataType } from '@chamn/model';
5
- import { RenderInstance } from '@chamn/render';
6
- import { Designer } from './components/Canvas';
7
- export type DesignerExport = {
8
- reload: (params?: {
9
- assets?: AssetPackage[];
10
- }) => void;
11
- getInstance: () => Designer | null;
12
- getDnd: () => DragAndDrop | undefined;
13
- selectNode: (nodeId: string) => void;
14
- copyNode: (nodeId: string) => void;
15
- deleteNode: (nodeId: string) => void;
16
- getSelectedNodeId: () => string | undefined;
17
- updatePage: (page: CPageDataType) => void;
18
- getComponentInstances: (id: string) => RenderInstance[];
19
- getDynamicComponentInstances: (id: string) => RenderInstance;
20
- getLayoutRef: () => React.RefObject<Layout>;
21
- getDesignerWindow: () => Window | null;
22
- updateRenderComponents: (newComponentMap: Record<string, string>) => void;
23
- };
24
- export type DesignerPluginConfig = Omit<LayoutPropsType, 'selectRectViewRender' | 'hoverRectViewRender' | 'dropViewRender' | 'ghostView' | 'selectToolBarView' | 'hoverToolBarView'> & Pick<AdvanceCustom, 'selectRectViewRender' | 'hoverRectViewRender' | 'dropViewRender' | 'ghostViewRender' | 'toolbarViewRender'>;
25
- export type DesignerPluginType = CPlugin<DesignerPluginConfig, DesignerExport>;
26
- export type DesignerPluginInstance = PluginInstance<DesignerPluginConfig, DesignerExport>;
@@ -1,2 +0,0 @@
1
- import { CNode, CRootNode } from '@chamn/model';
2
- export declare const getClosestNodeList: (node: CNode | CRootNode, level?: number) => CNode[];
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { CPage } from '@chamn/model';
3
- import { EnginContext } from '../../index';
4
- export type DisplaySourceSchemaProps = {
5
- pageModel: CPage;
6
- engineCtx: EnginContext;
7
- children: React.ReactNode;
8
- };
9
- export declare const DisplaySourceSchema: (props: DisplaySourceSchemaProps) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import { CPlugin } from '../../core/pluginManager';
2
- export declare const PLUGIN_NAME = "GlobalState";
3
- export declare const GlobalStatePanelPlugin: CPlugin;
@@ -1 +0,0 @@
1
- export declare const en_US: Record<string, any>;
@@ -1,2 +0,0 @@
1
- declare const _default: Record<string, any>;
2
- export default _default;
@@ -1 +0,0 @@
1
- export declare const zh_CN: Record<string, any>;
@@ -1,5 +0,0 @@
1
- import globalClassNames from '../../style.d';
2
- declare const classNames: typeof globalClassNames & {
3
- readonly box: 'box';
4
- };
5
- export = classNames;
@@ -1,2 +0,0 @@
1
- import { HistoryPluginType } from './type';
2
- export declare const HistoryPlugin: HistoryPluginType;
@@ -1,12 +0,0 @@
1
- import { CPlugin, PluginInstance } from '../../core/pluginManager';
2
- export type HistoryExport = {
3
- addStep: () => void;
4
- reset: () => Promise<void>;
5
- preStep: () => void;
6
- nextStep: () => Promise<void> | undefined;
7
- canGoPreStep: () => boolean;
8
- canGoNextStep: () => boolean;
9
- };
10
- export type HistoryPluginConfig = any;
11
- export type HistoryPluginType = CPlugin<HistoryPluginConfig, HistoryExport>;
12
- export type HistoryPluginInstance = PluginInstance<HistoryPluginConfig, HistoryExport>;
@@ -1,30 +0,0 @@
1
- import { Sensor } from '@chamn/layout';
2
- import { CPage } from '@chamn/model';
3
- import React from 'react';
4
- import { TreeNodeData } from './dataStruct';
5
- import { DesignerExport } from '../../../../plugins/Designer/type';
6
- export declare enum DragState {
7
- DRAGGING = "DRAGGING",
8
- NORMAL = "NORMAL"
9
- }
10
- export type ContextState = {
11
- treeData: TreeNodeData[];
12
- currentSelectNodeKeys: string[];
13
- expandKeys: string[];
14
- multiSelect: boolean;
15
- dragState: DragState;
16
- pageModel: CPage | null;
17
- };
18
- export type CTreeContextData = {
19
- sensor?: Sensor;
20
- state: ContextState;
21
- updateState: (state: Partial<ContextState>) => void;
22
- onSelectNode: (params: {
23
- keys: string[];
24
- node: TreeNodeData;
25
- }) => void;
26
- onDeleteNode: (id: string) => void;
27
- onCopyNode: (id: string) => void;
28
- getDesignerHandler?: () => Promise<DesignerExport>;
29
- };
30
- export declare const CTreeContext: React.Context<CTreeContextData>;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- export type TreeNodeData = {
3
- containerRender?: (params: {
4
- item: TreeNodeData;
5
- treeNodeView: JSX.Element;
6
- }) => React.ReactElement;
7
- titleViewRender?: (params: {
8
- item: TreeNodeData;
9
- titleView: React.ReactNode;
10
- }) => React.ReactElement;
11
- title: React.ReactNode;
12
- icon?: React.ReactNode;
13
- key?: string;
14
- children?: TreeNodeData[];
15
- parent?: TreeNodeData | null;
16
- canBeSelected?: boolean;
17
- canDrag?: boolean;
18
- canDropPos?: boolean | ('before' | 'after' | 'current')[];
19
- rootNode?: boolean;
20
- };
21
- export declare const DemoTreeData: TreeNodeData;