@chamn/engine 0.1.0 → 0.2.0
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/_dev_/index.d.ts +1 -0
- package/dist/_dev_/lib/index.d.ts +1 -0
- package/dist/_dev_/page/Editor/index.d.ts +1 -0
- package/dist/_dev_/page/Preview/index.d.ts +1 -0
- package/dist/_dev_/render.d.ts +1 -0
- package/dist/_dev_/router.d.ts +1 -0
- package/dist/component/CSSEditor/index.d.ts +1 -1
- package/dist/component/CSSPropertiesEditor/index.d.ts +1 -2
- package/dist/component/CSSPropertiesEditor/signleProperty.d.ts +1 -2
- package/dist/component/CSSPropertiesEditor/util.d.ts +1 -0
- package/dist/component/CSSPropertiesVariableBindEditor/SingleProperty.d.ts +1 -2
- package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +1 -2
- package/dist/component/CSSPropertiesVariableBindEditor/util.d.ts +1 -0
- package/dist/component/CSSSizeInput/index.d.ts +7 -7
- package/dist/component/CSSUIPanel/BackgroundInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/BorderInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/DimensionInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/FontInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/MarginAndPaddingInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/ShadowInput/index.d.ts +1 -2
- package/dist/component/CSSUIPanel/index.d.ts +1 -2
- package/dist/component/ClassNameEditor/index.d.ts +1 -1
- package/dist/component/CustomColorPicker/index.d.ts +2 -3
- package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Form/context.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Form/index.d.ts +5 -3
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/CSSSizeSetter/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +78 -0
- package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +0 -1
- package/dist/component/CustomSchemaForm/context.d.ts +1 -1
- package/dist/component/CustomSchemaForm/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/utils.d.ts +2 -2
- package/dist/component/Workbench/index.d.ts +2 -2
- package/dist/core/pluginManager.d.ts +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/index.cjs +383 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +38342 -237
- package/dist/index.js.map +1 -1
- package/dist/material/innerMaterial.d.ts +37 -2
- package/dist/plugins/ComponentLibrary/components/DragItem/index.d.ts +1 -1
- package/dist/plugins/Designer/components/Canvas/advanceCustomHook.d.ts +12 -13
- package/dist/plugins/Designer/components/Canvas/index.d.ts +3 -4
- package/dist/plugins/Designer/type.d.ts +0 -1
- package/dist/plugins/DisplaySourceSchema/index.d.ts +1 -1
- 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 -2
- package/dist/plugins/PropertyPanel/utils.d.ts +2 -0
- package/dist/plugins/RightPanel/view.d.ts +1 -1
- package/dist/stories/components/inputPlus.stories.d.ts +5 -0
- package/dist/stories/plugins/CSSEditor.stories.d.ts +5 -0
- package/dist/stories/plugins/VisualPanelPlus.stories.d.ts +5 -0
- package/dist/stories/setters/colorSetter.stories.d.ts +5 -0
- package/dist/type.d.ts +0 -1
- package/dist/utils/css.d.ts +1 -1
- package/dist/utils/defaultEngineConfig.d.ts +7 -7
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/logger.d.ts +1 -1
- package/package.json +9 -8
- package/dist/index.mjs +0 -35957
- package/dist/index.mjs.map +0 -1
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
import { CMaterialType } from '@chamn/model';
|
|
2
|
-
export declare const InnerComponentMeta: CMaterialType
|
|
1
|
+
import { CMaterialPropsType, CMaterialType } from '@chamn/model';
|
|
2
|
+
export declare const InnerComponentMeta: (CMaterialType | {
|
|
3
|
+
npm: {
|
|
4
|
+
name: string;
|
|
5
|
+
package: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
componentName: string;
|
|
9
|
+
title: string;
|
|
10
|
+
screenshot?: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
tags?: string[];
|
|
13
|
+
groupName?: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
priority?: number;
|
|
16
|
+
snippets: import('@chamn/model').SnippetsType[];
|
|
17
|
+
props: CMaterialPropsType<"">;
|
|
18
|
+
fixedProps?: Record<string, any> | ((props: Record<string, any>) => Record<string, any>);
|
|
19
|
+
isContainer?: boolean | import('@chamn/model').ContainerConfig;
|
|
20
|
+
rootSelector?: string;
|
|
21
|
+
disableEditorDragDom?: {
|
|
22
|
+
class?: string[];
|
|
23
|
+
id?: string[];
|
|
24
|
+
} | boolean;
|
|
25
|
+
actions?: {
|
|
26
|
+
title: string;
|
|
27
|
+
name: string;
|
|
28
|
+
params?: {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}[];
|
|
32
|
+
template?: string;
|
|
33
|
+
}[];
|
|
34
|
+
events?: import('@chamn/model').CMaterialEventType[];
|
|
35
|
+
advanceCustom?: import('@chamn/model').AdvanceCustom;
|
|
36
|
+
extra?: Record<any, any>;
|
|
37
|
+
})[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CPluginCtx } from '../../../../core/pluginManager';
|
|
3
2
|
import { Layout, LayoutDragAndDropExtraDataType, LayoutDragEvent } from '../../../../index';
|
|
4
3
|
import { AdvanceCustom, CNode, CRootNode } from '@chamn/model';
|
|
@@ -23,24 +22,24 @@ export declare class AdvanceCustomHook {
|
|
|
23
22
|
canDrag({ dragNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['canDragNode']>;
|
|
24
23
|
canDrop({ dragNode, dropNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['canDropNode']>;
|
|
25
24
|
onNewAdd({ dragNode, dropNode, eventObj }: HookParameter): ReturnType<Required<AdvanceCustom>['onNewAdd']>;
|
|
26
|
-
getSelectRectViewRender(node: CNode | CRootNode): ((props: import(
|
|
27
|
-
getHoverRectViewRender(node?: CNode | CRootNode | null): ((props: import(
|
|
28
|
-
getDropViewRender(node?: CNode | CRootNode | null): ((props: import(
|
|
25
|
+
getSelectRectViewRender(node: CNode | CRootNode): ((props: import('@chamn/model').CustomViewRenderProps) => React.ReactElement) | undefined;
|
|
26
|
+
getHoverRectViewRender(node?: CNode | CRootNode | null): ((props: import('@chamn/model').CustomViewRenderProps) => React.ReactElement) | null | undefined;
|
|
27
|
+
getDropViewRender(node?: CNode | CRootNode | null): ((props: import('@chamn/model').CustomViewRenderProps & {
|
|
29
28
|
canDrop: boolean;
|
|
30
|
-
posInfo: import(
|
|
31
|
-
}) =>
|
|
32
|
-
getGhostViewRender(node?: CNode | CRootNode | null): ((props: import(
|
|
29
|
+
posInfo: import('@chamn/model').DropPosType;
|
|
30
|
+
}) => React.ReactElement) | null | undefined;
|
|
31
|
+
getGhostViewRender(node?: CNode | CRootNode | null): ((props: import('@chamn/model').CustomViewRenderProps) => React.ReactElement) | null | undefined;
|
|
33
32
|
getToolbarViewRender(node?: CNode | CRootNode | null): ((props: {
|
|
34
33
|
node: CNode | CRootNode;
|
|
35
34
|
context: any;
|
|
36
35
|
toolBarItems: {
|
|
37
|
-
copyItem:
|
|
38
|
-
deleteItem:
|
|
39
|
-
visibleItem:
|
|
40
|
-
nodeLayout:
|
|
36
|
+
copyItem: React.ReactElement;
|
|
37
|
+
deleteItem: React.ReactElement;
|
|
38
|
+
visibleItem: React.ReactElement;
|
|
39
|
+
nodeLayout: React.ReactElement;
|
|
41
40
|
};
|
|
42
|
-
toolBarItemList:
|
|
43
|
-
}) =>
|
|
41
|
+
toolBarItemList: React.ReactElement[];
|
|
42
|
+
}) => React.ReactElement) | null | undefined;
|
|
44
43
|
onCopy(node: CNode | CRootNode): Promise<false | CNode | CRootNode>;
|
|
45
44
|
onDelete(node: CNode | CRootNode): Promise<false | CNode | CRootNode>;
|
|
46
45
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import { Layout, LayoutPropsType } from '@chamn/layout';
|
|
3
|
-
import { AdvanceCustom, CNode, CPage, CRootNode } from '@chamn/model';
|
|
3
|
+
import { AdvanceCustom, CNode, CPage, CRootNode, AdvanceCustomFuncParam } from '@chamn/model';
|
|
4
4
|
import { CPluginCtx } from '../../../../core/pluginManager';
|
|
5
5
|
import { AdvanceCustomHook } from './advanceCustomHook';
|
|
6
6
|
import { DesignerPluginConfig } from '../../type';
|
|
7
|
-
import { AdvanceCustomFuncParam } from '@chamn/model';
|
|
8
7
|
export type DesignerCtx = CPluginCtx<DesignerPluginConfig>;
|
|
9
8
|
export type DesignerPropsType = {
|
|
10
9
|
pluginCtx: DesignerCtx;
|
|
@@ -36,7 +35,7 @@ export declare class Designer extends React.Component<DesignerPropsType, Designe
|
|
|
36
35
|
*/
|
|
37
36
|
updateRenderComponents(newComponentMap?: Record<string, any>): Promise<void>;
|
|
38
37
|
componentDidMount(): void;
|
|
39
|
-
getIframeDom(): import(
|
|
38
|
+
getIframeDom(): import('@chamn/layout').IFrameContainer | undefined;
|
|
40
39
|
reloadRender(): void;
|
|
41
40
|
init(): Promise<void>;
|
|
42
41
|
onNodeDragging: LayoutPropsType['onNodeDragging'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Sensor } from '@chamn/layout';
|
|
2
2
|
import { CPage } from '@chamn/model';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
4
|
import { TreeNodeData } from './dataStruct';
|
|
5
|
-
import { DesignerExport } from '
|
|
5
|
+
import { DesignerExport } from '../../../Designer/type';
|
|
6
6
|
export declare enum DragState {
|
|
7
7
|
DRAGGING = "DRAGGING",
|
|
8
8
|
NORMAL = "NORMAL"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sensor } from '@chamn/layout';
|
|
2
2
|
import { CNode, CRootNode } from '@chamn/model';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
4
|
import { WithTranslation } from 'react-i18next';
|
|
5
5
|
import { CPluginCtx } from '../../../../core/pluginManager';
|
|
6
6
|
import { ContextState } from './context';
|
|
@@ -19,7 +19,7 @@ export declare class TreeView extends React.Component<TreeViewProps, ContextStat
|
|
|
19
19
|
disposeCbList: (() => void)[];
|
|
20
20
|
sensor?: Sensor;
|
|
21
21
|
constructor(props: TreeViewProps);
|
|
22
|
-
getDesignerHandler: () => Promise<import('
|
|
22
|
+
getDesignerHandler: () => Promise<import('../../../Designer/type').DesignerExport>;
|
|
23
23
|
updateTreeDataFromNode: () => void;
|
|
24
24
|
getParentKeyPaths: (targetKey: string) => string[];
|
|
25
25
|
scrollNodeToView: (key: string) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const TargetComponent: (props: import('../../component/CSSSizeInput').CSSSizeInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const _default: Meta<typeof TargetComponent>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentMeta } from '@storybook/react';
|
|
2
|
+
import { VisualPanelPlus } from '../../plugins/VisualPanelPlus';
|
|
3
|
+
declare const _default: ComponentMeta<typeof VisualPanelPlus>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/type.d.ts
CHANGED
package/dist/utils/css.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type StyleArr = {
|
|
|
7
7
|
export declare const styleArr2Obj: (val: StyleArr) => Record<string, any>;
|
|
8
8
|
export declare const styleObjToArr: (obj?: Record<string, any>) => StyleArr;
|
|
9
9
|
export declare const styleList2Text: (val: StyleArr) => string;
|
|
10
|
-
export declare const formatStyleProperty: (styleList?: CNodeModelDataType[
|
|
10
|
+
export declare const formatStyleProperty: (styleList?: CNodeModelDataType["style"]) => {
|
|
11
11
|
normalProperty: {
|
|
12
12
|
property: string;
|
|
13
13
|
value: string;
|
|
@@ -3,11 +3,11 @@ import { LayoutPropsType } from '@chamn/layout';
|
|
|
3
3
|
export declare const beforeInitRender: LayoutPropsType['beforeInitRender'];
|
|
4
4
|
/** 默认使用 react 18 模式渲染 */
|
|
5
5
|
export declare const getDefaultRender: (components: Record<string, any>) => (options: {
|
|
6
|
-
iframe: import(
|
|
7
|
-
pageModel?: import(
|
|
8
|
-
page?: import(
|
|
9
|
-
assets: import(
|
|
10
|
-
renderJSUrl?: string
|
|
11
|
-
beforeInitRender?: (
|
|
12
|
-
ready: (designRender: import(
|
|
6
|
+
iframe: import('@chamn/layout').IFrameContainer;
|
|
7
|
+
pageModel?: import('@chamn/model').CPage;
|
|
8
|
+
page?: import('@chamn/model').CPageDataType;
|
|
9
|
+
assets: import('@chamn/model').AssetPackage[];
|
|
10
|
+
renderJSUrl?: string;
|
|
11
|
+
beforeInitRender?: () => void;
|
|
12
|
+
ready: (designRender: import('@chamn/render').DesignRender) => void;
|
|
13
13
|
}) => void;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
export declare const waitReactUpdate: ({ time, cb, }?: {
|
|
7
|
-
time?: number
|
|
8
|
-
cb?: (
|
|
7
|
+
time?: number;
|
|
8
|
+
cb?: (...args: any[]) => void;
|
|
9
9
|
}) => Promise<unknown>;
|
|
10
10
|
export * from './css';
|
|
11
11
|
export * from './defaultEngineConfig';
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LOGGER: import(
|
|
1
|
+
export declare const LOGGER: import('consola').Consola;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chamn/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"files": [
|
|
5
6
|
"dist"
|
|
6
7
|
],
|
|
7
8
|
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.
|
|
9
|
+
"module": "dist/index.js",
|
|
9
10
|
"types": "dist/index.d.ts",
|
|
10
11
|
"publishConfig": {
|
|
11
12
|
"access": "public"
|
|
@@ -36,9 +37,9 @@
|
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@ant-design/icons": "^5.4.0",
|
|
39
|
-
"@chamn/layout": "0.
|
|
40
|
-
"@chamn/model": "0.
|
|
41
|
-
"@chamn/render": "0.
|
|
40
|
+
"@chamn/layout": "0.2.0",
|
|
41
|
+
"@chamn/model": "0.2.0",
|
|
42
|
+
"@chamn/render": "0.2.0",
|
|
42
43
|
"@dnd-kit/core": "^6.0.7",
|
|
43
44
|
"@dnd-kit/modifiers": "^6.0.1",
|
|
44
45
|
"@dnd-kit/sortable": "^7.0.2",
|
|
@@ -59,8 +60,8 @@
|
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@babel/core": "^7.21.0",
|
|
62
|
-
"@chamn/build-script": "0.
|
|
63
|
-
"@chamn/demo-page": "0.
|
|
63
|
+
"@chamn/build-script": "0.2.0",
|
|
64
|
+
"@chamn/demo-page": "0.2.0",
|
|
64
65
|
"@storybook/addon-docs": "^7.4.0",
|
|
65
66
|
"@storybook/addon-essentials": "^7.4.0",
|
|
66
67
|
"@storybook/addon-interactions": "^7.4.0",
|
|
@@ -94,5 +95,5 @@
|
|
|
94
95
|
"storybook": "^7.4.0"
|
|
95
96
|
},
|
|
96
97
|
"config": {},
|
|
97
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "0803de3f04dcebe415446700f2e3e7ec73a0fb6e"
|
|
98
99
|
}
|