@chamn/engine 0.0.4 → 0.0.7
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/.eslintrc.js +1 -0
- package/CHANGELOG.md +16 -0
- package/README.md +31 -0
- package/build.config.js +4 -3
- 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 +43 -0
- package/dist/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
- package/dist/component/CSSPropertiesEditor/util.d.ts +1 -0
- package/dist/component/CSSPropertiesVariableBindEditor/cssProperties.d.ts +898 -0
- package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +37 -0
- package/dist/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
- package/dist/component/CSSPropertiesVariableBindEditor/util.d.ts +1 -0
- package/dist/component/ClassNameEditor/index.d.ts +16 -0
- package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +11 -0
- package/dist/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
- package/dist/component/CustomSchemaForm/components/Form/context.d.ts +10 -0
- package/dist/component/CustomSchemaForm/components/Form/index.d.ts +17 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +12 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -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 +5 -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/ExpressionSetter/index.d.ts +8 -0
- package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +1 -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/SelectSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/ShapeSetter/index.d.ts +8 -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 +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +19 -0
- package/dist/component/CustomSchemaForm/context.d.ts +15 -0
- package/dist/component/CustomSchemaForm/index.d.ts +17 -0
- package/dist/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
- package/dist/component/CustomSchemaForm/utils.d.ts +2 -0
- package/dist/component/MonacoEditor/index.d.ts +15 -0
- package/dist/component/Workbench/style.module.scss.d.ts +26 -0
- package/dist/core/pluginManager.d.ts +1 -1
- package/dist/index.cjs.js +295 -39
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.es.js +44920 -9933
- package/dist/index.es.js.map +1 -1
- package/dist/material/innerMaterial.d.ts +2 -0
- package/dist/monacoeditorwork/css.worker.bundle.js +45072 -0
- package/dist/monacoeditorwork/editor.worker.bundle.js +8294 -0
- package/dist/monacoeditorwork/html.worker.bundle.js +24321 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +15550 -0
- package/dist/monacoeditorwork/ts.worker.bundle.js +169967 -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/DefaultSelectToolBar/index.d.ts +10 -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 +15 -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/style.module.scss.d.ts +5 -0
- package/dist/plugins/Designer/util.d.ts +2 -0
- package/dist/plugins/Designer/view.d.ts +30 -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/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 +34 -0
- package/dist/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
- package/dist/plugins/OutlineTree/components/TreeView/treeNode.d.ts +9 -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 +15 -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 +34 -0
- package/dist/plugins/VisualPanelPlus/index.d.ts +9 -0
- package/dist/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/style.css +1 -1
- package/dist/utils/css.d.ts +19 -0
- package/dist/utils/logger.d.ts +1 -0
- package/package.json +16 -8
- package/public/Engine.module.scss.d.ts +5 -0
- package/public/component/CSSEditor/style.module.scss.d.ts +6 -0
- package/public/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
- package/public/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
- package/public/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
- package/public/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
- package/public/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
- package/public/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
- package/public/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
- package/public/component/Workbench/style.module.scss.d.ts +26 -0
- package/public/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
- package/public/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
- package/public/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
- package/public/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
- package/public/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
- package/public/plugins/Designer/style.module.scss.d.ts +5 -0
- package/public/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
- package/public/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
- package/public/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
- package/public/plugins/RightPanel/style.module.scss.d.ts +10 -0
- package/public/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
- package/public/render.umd.js +14 -14
- package/public/render.umd.js.map +1 -1
- package/src/Engine.module.scss.d.ts +5 -0
- package/src/_dev_/page/Editor/index.tsx +1 -1
- package/src/component/CSSEditor/index.tsx +4 -5
- package/src/component/CSSEditor/style.module.scss.d.ts +6 -0
- package/src/component/CSSPropertiesEditor/index.tsx +1 -5
- package/src/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
- package/src/component/CSSPropertiesVariableBindEditor/index.tsx +1 -1
- package/src/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
- package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
- package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
- package/src/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
- package/src/component/MonacoEditor/index.tsx +1 -41
- package/src/component/Workbench/style.module.scss.d.ts +26 -0
- package/src/core/pluginManager.ts +1 -1
- package/src/index.tsx +5 -2
- package/src/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
- package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
- package/src/plugins/ComponentLibrary/components/ListView/index.tsx +0 -1
- package/src/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
- package/src/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
- package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
- package/src/plugins/Designer/style.module.scss.d.ts +5 -0
- package/src/plugins/DisplaySourceSchema/index.tsx +1 -1
- package/src/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
- package/src/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
- package/src/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
- package/src/plugins/RightPanel/style.module.scss.d.ts +10 -0
- package/src/plugins/VisualPanelPlus/index.tsx +3 -19
- package/src/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
- package/src/plugins/index.tsx +3 -1
- package/src/style.d.ts +2 -0
- package/src/typing.d.ts +5 -0
- package/dist/typing.d.ts +0 -4
- package/dist/vite-env.d.ts +0 -1
- package/public/typing.d.ts +0 -4
- package/public/vite-env.d.ts +0 -1
- package/src/component/MonacoEditor/index copy.tsx +0 -119
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { JSExpressionPropType } from '@chamn/model';
|
|
3
|
+
export type SinglePropertyEditorProps = {
|
|
4
|
+
value?: {
|
|
5
|
+
key: string;
|
|
6
|
+
value: JSExpressionPropType;
|
|
7
|
+
};
|
|
8
|
+
onValueChange: (value: {
|
|
9
|
+
key: string;
|
|
10
|
+
value: JSExpressionPropType;
|
|
11
|
+
}) => void;
|
|
12
|
+
onDelete?: () => void;
|
|
13
|
+
onCreate?: (value: {
|
|
14
|
+
key: string;
|
|
15
|
+
value: JSExpressionPropType;
|
|
16
|
+
}) => {
|
|
17
|
+
errorKey?: string[];
|
|
18
|
+
} | void;
|
|
19
|
+
mod?: 'create' | 'edit';
|
|
20
|
+
};
|
|
21
|
+
export type CSSPropertiesVariableBindEditorProps = {
|
|
22
|
+
initialValue?: {
|
|
23
|
+
key: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
onValueChange?: (val: {
|
|
27
|
+
key: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[]) => void;
|
|
30
|
+
};
|
|
31
|
+
export type CSSPropertiesVariableBindEditorRef = {
|
|
32
|
+
setValue: (val: {
|
|
33
|
+
key: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[]) => void;
|
|
36
|
+
};
|
|
37
|
+
export declare const CSSPropertiesVariableBindEditor: import("react").ForwardRefExoticComponent<CSSPropertiesVariableBindEditorProps & import("react").RefAttributes<CSSPropertiesVariableBindEditorRef>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import globalClassNames from '../../style.d';
|
|
2
|
+
declare const classNames: typeof globalClassNames & {
|
|
3
|
+
readonly cssFieldBox: 'cssFieldBox';
|
|
4
|
+
readonly 'ant-select-selector': 'ant-select-selector';
|
|
5
|
+
readonly row: 'row';
|
|
6
|
+
readonly fieldLabel: 'fieldLabel';
|
|
7
|
+
readonly leftBox: 'leftBox';
|
|
8
|
+
readonly rightBox: 'rightBox';
|
|
9
|
+
readonly inputBox: 'inputBox';
|
|
10
|
+
readonly cssBox: 'cssBox';
|
|
11
|
+
readonly 'ant-collapse-borderless': 'ant-collapse-borderless';
|
|
12
|
+
readonly 'ant-collapse-item': 'ant-collapse-item';
|
|
13
|
+
readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
|
|
14
|
+
};
|
|
15
|
+
export = classNames;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTextWidth: (text: string, fontSize?: number) => Promise<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ClassNameType } from '@chamn/model';
|
|
3
|
+
export type ClassNameEditorProps = {
|
|
4
|
+
initialValue?: {
|
|
5
|
+
key: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
onValueChange?: (val: ClassNameType[]) => void;
|
|
9
|
+
};
|
|
10
|
+
export type ClassNameEditorRef = {
|
|
11
|
+
setValue: (val: {
|
|
12
|
+
key: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}[]) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const ClassNameEditor: import("react").ForwardRefExoticComponent<ClassNameEditorProps & import("react").RefAttributes<ClassNameEditorRef>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type CFieldProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
label?: string;
|
|
5
|
+
tips?: ReactNode | (() => ReactNode);
|
|
6
|
+
name: string;
|
|
7
|
+
condition?: (formState: Record<string, any>) => boolean;
|
|
8
|
+
onConditionValueChange?: (val: boolean) => void;
|
|
9
|
+
noStyle?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const CField: (props: CFieldProps) => JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ContextState = Record<string, any>;
|
|
3
|
+
export type CFormContextData = {
|
|
4
|
+
formName: string;
|
|
5
|
+
formState: ContextState;
|
|
6
|
+
conditionConfig: Record<string, (state: ContextState) => boolean>;
|
|
7
|
+
updateContext: (newState: ContextState) => void;
|
|
8
|
+
updateConditionConfig: (name: string, cb: (state: ContextState) => boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const CFormContext: React.Context<CFormContextData>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { CFormContextData, ContextState } from './context';
|
|
4
|
+
export type CFormProps = {
|
|
5
|
+
name: string;
|
|
6
|
+
children?: ReactNode | ReactNode[];
|
|
7
|
+
initialValue?: Record<string, any>;
|
|
8
|
+
onValueChange?: (formData: Record<string, any>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare class CForm extends React.Component<CFormProps, CFormContextData> {
|
|
11
|
+
updateContext: (newState: ContextState) => void;
|
|
12
|
+
constructor(props: CFormProps);
|
|
13
|
+
getFieldsValue: () => Record<string, any>;
|
|
14
|
+
setFields: (state: Record<string, any>) => void;
|
|
15
|
+
formatValue: (data: Record<string, any>) => Record<string, any>;
|
|
16
|
+
render(): ReactNode;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SetterObjType } from '@chamn/model';
|
|
3
|
+
import { CFieldProps } from '../Form/Field';
|
|
4
|
+
export type SetterSwitcherProps = {
|
|
5
|
+
setters: SetterObjType[];
|
|
6
|
+
keyPaths: string[];
|
|
7
|
+
prefix?: React.ReactNode;
|
|
8
|
+
suffix?: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
useField?: boolean;
|
|
11
|
+
} & Omit<CFieldProps, 'children'>;
|
|
12
|
+
export declare const SetterSwitcher: ({ setters, keyPaths, condition, useField, ...props }: SetterSwitcherProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SetterObjType } from '@chamn/model';
|
|
3
|
+
export declare function ArrayItem(props: {
|
|
4
|
+
index: number;
|
|
5
|
+
keyPaths: string[];
|
|
6
|
+
value: Record<string, any>;
|
|
7
|
+
setters: SetterObjType[];
|
|
8
|
+
style: React.CSSProperties;
|
|
9
|
+
onValueChange: (val: Record<string, any>) => void;
|
|
10
|
+
onDelete: () => void;
|
|
11
|
+
}): JSX.Element;
|
package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModalProps } from 'antd';
|
|
3
|
+
export type SortItemOrderProps = {
|
|
4
|
+
list: any[];
|
|
5
|
+
keyPaths: string[];
|
|
6
|
+
label: string;
|
|
7
|
+
sortLabelKey?: string;
|
|
8
|
+
onValueChange?: (newList: any[]) => void;
|
|
9
|
+
} & ModalProps;
|
|
10
|
+
export declare const SortItemOrderModal: ({ list, onValueChange, keyPaths, label, sortLabelKey, ...modalProps }: SortItemOrderProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CSetterProps } from '../type';
|
|
3
|
+
import { SetterType } from '@chamn/model';
|
|
4
|
+
export type CArraySetterProps = {
|
|
5
|
+
item: {
|
|
6
|
+
setters: SetterType[];
|
|
7
|
+
initialValue?: any;
|
|
8
|
+
};
|
|
9
|
+
sortLabelKey?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const ArraySetter: {
|
|
12
|
+
({ onValueChange, setterContext, item: { setters, initialValue }, sortLabelKey, ...props }: CSetterProps<CArraySetterProps>): JSX.Element;
|
|
13
|
+
setterName: string;
|
|
14
|
+
};
|
|
@@ -0,0 +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\u72B6\u6001 **/\n state?: Record<any, any>;\n /** \u5B58\u50A8\u5F53\u524D\u8282\u70B9\u7684\u6570\u636E\uFF0C\u4E0D\u5177\u6709\u54CD\u5E94\u6027 **/\n staticState?: Record<any, any>;\n /** \u66F4\u65B0\u5F53\u524D\u8282\u70B9\u72B6\u6001 */\n updateState?: (newState: any) => void;\n /** \u6240\u6709\u8282\u70B9\u7684\u7D22\u5F15 */\n refs?: RefManager;\n /** \u5FAA\u73AF\u6E32\u67D3\u4E2D\u7684\u5355\u4E2A\u5FAA\u73AF\u6570\u636E */\n loopData?: Record<any, any>;\n /** \u7528\u4E8E\u8BBF\u8BBF\u95EE\u548C\u7BA1\u7406\u9875\u9762\u88AB\u6CE8\u518C\u4E3A\u5168\u5C40\u7684\u5C40\u90E8 state */\n stateManager?: Record<string, {\n state: any,\n updateState: (newState: Record<string, any>) => void\n }>;\n};\n\n/** \u6E32\u67D3\u4E0A\u4E0B\u6587 */\ndeclare var $$context: ContextType;\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSetter } from '../type';
|
|
2
|
+
import { MaterialPropType } from '@chamn/model';
|
|
3
|
+
export type CShapeSetterProps = {
|
|
4
|
+
elements: MaterialPropType[];
|
|
5
|
+
initialValue?: Record<string, any>;
|
|
6
|
+
value: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ShapeSetter: CSetter<CShapeSetterProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CPluginCtx } from '../../../../core/pluginManager';
|
|
3
|
+
export type CSetter<T = any> = {
|
|
4
|
+
(props: CSetterProps<T>): JSX.Element;
|
|
5
|
+
setterName: string;
|
|
6
|
+
};
|
|
7
|
+
export type CSetterProps<T = {
|
|
8
|
+
_: any;
|
|
9
|
+
}> = {
|
|
10
|
+
onValueChange?: ((val: any) => void) | undefined;
|
|
11
|
+
value?: unknown;
|
|
12
|
+
setterContext: {
|
|
13
|
+
pluginCtx: CPluginCtx;
|
|
14
|
+
setCollapseHeaderExt?: (el: React.ReactNode) => void;
|
|
15
|
+
onSetterChange: (keyPaths: string[], setterName: string) => void;
|
|
16
|
+
keyPaths: string[];
|
|
17
|
+
label: string;
|
|
18
|
+
};
|
|
19
|
+
} & T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
|
+
import { CustomSchemaFormInstance } from '.';
|
|
3
|
+
import { CPluginCtx } from '../../core/pluginManager';
|
|
4
|
+
import { CForm } from './components/Form';
|
|
5
|
+
export type ContextState = Record<string, any>;
|
|
6
|
+
export type CCustomSchemaFormContextData = {
|
|
7
|
+
onSetterChange: (keyPaths: string[], setterName: string) => void;
|
|
8
|
+
defaultSetterConfig: Record<string, {
|
|
9
|
+
name: string;
|
|
10
|
+
setter: string;
|
|
11
|
+
}>;
|
|
12
|
+
formRef?: Ref<CustomSchemaFormInstance | CForm>;
|
|
13
|
+
pluginCtx?: CPluginCtx;
|
|
14
|
+
};
|
|
15
|
+
export declare const CCustomSchemaFormContext: React.Context<CCustomSchemaFormContextData>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CMaterialPropsType } from '@chamn/model';
|
|
3
|
+
import { CForm } from './components/Form';
|
|
4
|
+
import { CPluginCtx } from '../../core/pluginManager';
|
|
5
|
+
export type CustomSchemaFormInstance = CForm;
|
|
6
|
+
export type CustomSchemaFormProps = {
|
|
7
|
+
pluginCtx?: CPluginCtx;
|
|
8
|
+
initialValue: Record<string, any>;
|
|
9
|
+
properties: CMaterialPropsType<any>;
|
|
10
|
+
onValueChange?: (val: any) => void;
|
|
11
|
+
onSetterChange: (keyPaths: string[], setterName: string) => void;
|
|
12
|
+
defaultSetterConfig: Record<string, {
|
|
13
|
+
name: string;
|
|
14
|
+
setter: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
export declare const CustomSchemaForm: React.ForwardRefExoticComponent<CustomSchemaFormProps & React.RefAttributes<CForm>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import globalClassNames from '../../style.d';
|
|
2
|
+
declare const classNames: typeof globalClassNames & {
|
|
3
|
+
readonly CFromRenderBox: 'CFromRenderBox';
|
|
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-item': 'ant-collapse-item';
|
|
8
|
+
readonly 'ant-collapse-header': 'ant-collapse-header';
|
|
9
|
+
readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
|
|
10
|
+
};
|
|
11
|
+
export = classNames;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as monaco from 'monaco-editor';
|
|
3
|
+
import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';
|
|
4
|
+
export type MonacoEditorInstance = monacoEditor.editor.IStandaloneCodeEditor;
|
|
5
|
+
export type MonacoEditorProps = {
|
|
6
|
+
beforeMount?: (monaco: typeof monacoEditor) => void;
|
|
7
|
+
onDidMount?: (editor: MonacoEditorInstance) => void;
|
|
8
|
+
options?: monaco.editor.IStandaloneEditorConstructionOptions;
|
|
9
|
+
override?: monaco.editor.IEditorOverrideServices;
|
|
10
|
+
onChange?: (val: string, e: monaco.editor.IModelContentChangedEvent) => void;
|
|
11
|
+
onDidChangeMarkers?: (markers: monaco.editor.IMarker[]) => void;
|
|
12
|
+
initialValue?: string;
|
|
13
|
+
language?: 'json' | 'javascript' | 'typescript';
|
|
14
|
+
};
|
|
15
|
+
export declare const MonacoEditor: (props: MonacoEditorProps) => JSX.Element;
|
|
@@ -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 logo: 'logo';
|
|
6
|
+
readonly topToolBarView: 'topToolBarView';
|
|
7
|
+
readonly bodyContent: 'bodyContent';
|
|
8
|
+
readonly leftBox: 'leftBox';
|
|
9
|
+
readonly pluginIconBar: 'pluginIconBar';
|
|
10
|
+
readonly pluginIconItem: 'pluginIconItem';
|
|
11
|
+
readonly active: 'active';
|
|
12
|
+
readonly pluginPanelBoxResizeBox: 'pluginPanelBoxResizeBox';
|
|
13
|
+
readonly pluginHeader: 'pluginHeader';
|
|
14
|
+
readonly pluginNameText: 'pluginNameText';
|
|
15
|
+
readonly closeBtn: 'closeBtn';
|
|
16
|
+
readonly fixedBtn: 'fixedBtn';
|
|
17
|
+
readonly pluginPanelBox: 'pluginPanelBox';
|
|
18
|
+
readonly rightResizeBox: 'rightResizeBox';
|
|
19
|
+
readonly arrowCursor: 'arrowCursor';
|
|
20
|
+
readonly rightBox: 'rightBox';
|
|
21
|
+
readonly centerBox: 'centerBox';
|
|
22
|
+
readonly subTopToolbarBox: 'subTopToolbarBox';
|
|
23
|
+
readonly canvasBox: 'canvasBox';
|
|
24
|
+
readonly scrollBox: 'scrollBox';
|
|
25
|
+
};
|
|
26
|
+
export = classNames;
|