@chamn/engine 0.2.4 → 0.3.1

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 (72) hide show
  1. package/dist/component/CustomSchemaForm/components/CFiledWithSwitchSetter/index.d.ts +7 -0
  2. package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +16 -0
  3. package/dist/component/CustomSchemaForm/components/Form/context.d.ts +1 -1
  4. package/dist/component/CustomSchemaForm/components/Form/index.d.ts +2 -2
  5. package/dist/component/CustomSchemaForm/components/SetterSwitcher/core.d.ts +21 -0
  6. package/dist/component/CustomSchemaForm/components/SetterSwitcher/helper.d.ts +9 -0
  7. package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +1 -0
  8. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/CreateNewNodePopup/index.d.ts +8 -0
  9. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/CreateNewNodePopup/initData.d.ts +22 -0
  10. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/InputHandle/index.d.ts +2 -0
  11. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/NodeCard/index.d.ts +10 -0
  12. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/OutputHandle/index.d.ts +2 -0
  13. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/SelectNodeByTree/index.d.ts +9 -0
  14. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/SelectNodeByTree/modal.d.ts +13 -0
  15. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/SelectNodeByTree/util.d.ts +3 -0
  16. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/SelectNodeState/index.d.ts +12 -0
  17. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/component/SelectNodeState/util.d.ts +7 -0
  18. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/config.d.ts +4 -0
  19. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/context.d.ts +11 -0
  20. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/index.d.ts +11 -0
  21. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/AssignValueNode/index.d.ts +4 -0
  22. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/AssignValueNode/util.d.ts +1 -0
  23. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/CallNodeMethodNode/index.d.ts +4 -0
  24. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/CallNodeMethodNode/util.d.ts +11 -0
  25. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/JumpLinkNode.d.ts +4 -0
  26. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/RequestAPINode/helper.d.ts +6 -0
  27. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/RequestAPINode/index.d.ts +4 -0
  28. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/RequestAPINode/util.d.ts +1 -0
  29. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/RunCodeNode/index.d.ts +4 -0
  30. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/RunCodeNode/util.d.ts +1 -0
  31. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/StartNode.d.ts +3 -0
  32. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/node/index.d.ts +16 -0
  33. package/dist/component/CustomSchemaForm/components/Setters/ActionFlowSetter/util.d.ts +40 -0
  34. package/dist/component/CustomSchemaForm/components/Setters/AdvanceSetterList.d.ts +3 -0
  35. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +1 -0
  36. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +2 -1
  37. package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +1 -1
  38. package/dist/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.d.ts +4 -1
  39. package/dist/component/CustomSchemaForm/components/Setters/index.d.ts +2 -2
  40. package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +1 -1
  41. package/dist/component/CustomSchemaForm/context.d.ts +3 -1
  42. package/dist/component/CustomSchemaForm/utils.d.ts +2 -0
  43. package/dist/component/MonacoEditor/index.d.ts +2 -2
  44. package/dist/component/MoveableModal/index.d.ts +4 -0
  45. package/dist/core/pluginManager.d.ts +6 -1
  46. package/dist/index.cjs +136 -107
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.js +40338 -23921
  50. package/dist/index.js.map +1 -1
  51. package/dist/material/evetList.d.ts +2 -0
  52. package/dist/material/innerMaterial.d.ts +3 -5
  53. package/dist/plugins/EventPanel/index.d.ts +2 -0
  54. package/dist/plugins/EventPanel/panel.d.ts +7 -0
  55. package/dist/plugins/Hotkeys/hotKeyManager.d.ts +3 -0
  56. package/dist/plugins/Hotkeys/index.d.ts +2 -2
  57. package/dist/plugins/Hotkeys/type.d.ts +8 -0
  58. package/dist/plugins/OutlineTree/util.d.ts +1 -1
  59. package/dist/plugins/PropertyPanel/index.d.ts +0 -6
  60. package/dist/plugins/PropertyPanel/view.d.ts +6 -0
  61. package/dist/plugins/RightPanel/index.d.ts +2 -1
  62. package/dist/plugins/RightPanel/type.d.ts +15 -0
  63. package/dist/plugins/index.d.ts +13 -1
  64. package/dist/stories/components/CustomSchemaForm/components/Setters/actionFlow.stories.d.ts +17 -0
  65. package/dist/stories/components/CustomSchemaForm/components/Setters/mock.d.ts +63 -0
  66. package/dist/stories/components/inputPlus.stories.d.ts +5 -0
  67. package/dist/stories/plugins/CSSEditor.stories.d.ts +5 -0
  68. package/dist/stories/plugins/VisualPanelPlus.stories.d.ts +6 -0
  69. package/dist/stories/setters/colorSetter.stories.d.ts +5 -0
  70. package/dist/style.css +1 -1
  71. package/dist/utils/index.d.ts +2 -0
  72. package/package.json +26 -11
@@ -0,0 +1,7 @@
1
+ import { SetterType } from '@chamn/model';
2
+ import { CFieldProps } from '../Form/Field';
3
+ export declare const CFiledWithSwitchSetter: (props: Omit<CFieldProps, "children"> & {
4
+ setterList: SetterType[];
5
+ onSetterChange?: (setterName: string) => void;
6
+ defaultSetterName?: string;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,28 @@
1
1
  import { default as React, ReactNode } from 'react';
2
+ export type CFiledChildProps = {
3
+ onValueChange?: (val: any) => void;
4
+ initialValue?: any;
5
+ value?: any;
6
+ };
2
7
  export type CFieldProps = {
3
8
  children: React.ReactNode;
4
9
  label?: string;
10
+ labelWidth?: string;
11
+ labelAlign?: 'start' | 'center' | 'end';
5
12
  tips?: ReactNode | (() => ReactNode);
6
13
  name: string;
7
14
  condition?: (formState: Record<string, any>) => boolean;
8
15
  onConditionValueChange?: (val: boolean) => void;
16
+ /** 不做任何包裹, 不会渲染 switchSetter */
9
17
  noStyle?: boolean;
18
+ /** 隐藏 label, 会渲染 switchSetter */
10
19
  hiddenLabel?: boolean;
20
+ valueChangeEventName?: string;
21
+ formatEventValue?: (val: any) => any;
22
+ rules?: {
23
+ validator?: (value: any) => Promise<boolean | undefined>;
24
+ required?: boolean;
25
+ msg?: string;
26
+ }[];
11
27
  };
12
28
  export declare const CField: (props: CFieldProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -6,7 +6,7 @@ export type CFormContextData = {
6
6
  formState: ContextState;
7
7
  conditionConfig: Record<string, (state: ContextState) => boolean>;
8
8
  customSetterMap?: Record<string, CSetter>;
9
- updateContext: (newState: ContextState) => void;
9
+ updateContext: (newState: ContextState, changeKeys?: string[]) => void;
10
10
  updateConditionConfig: (name: string, cb: (state: ContextState) => boolean) => void;
11
11
  };
12
12
  export declare const CFormContext: React.Context<CFormContextData>;
@@ -5,8 +5,8 @@ export type CFormProps = {
5
5
  children?: ReactNode | ReactNode[];
6
6
  initialValue?: Record<string, any>;
7
7
  customSetterMap: CFormContextData['customSetterMap'];
8
- onValueChange?: (formData: Record<string, any>) => void;
9
- };
8
+ onValueChange?: (formData: Record<string, any>, changeKeys?: string[]) => void;
9
+ } & Partial<ContextState>;
10
10
  export declare const registerCustomSetter: (customSetterMap: CFormContextData["customSetterMap"]) => void;
11
11
  export declare class CForm extends React.Component<CFormProps, CFormContextData> {
12
12
  updateContext: (newState: ContextState) => void;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { SetterObjType } from '@chamn/model';
3
+ import { CFieldProps } from '../Form/Field';
4
+ import { CSetter, CSetterProps } from '../Setters/type';
5
+ export type SetterSwitcherProps = {
6
+ setters: SetterObjType[];
7
+ customSetterMap?: Record<string, CSetter>;
8
+ keyPaths: string[];
9
+ prefix?: React.ReactNode;
10
+ suffix?: React.ReactNode;
11
+ style?: React.CSSProperties;
12
+ /** 是否实用 CFile 包裹 */
13
+ useField?: boolean;
14
+ } & Omit<CFieldProps, 'children'>;
15
+ export declare const SetterSwitcherCore: ({ setters, keyPaths, currentSetter, setCurrentSetter, customSetterMap: customSetterMapProp, ...props }: Pick<SetterSwitcherProps, "setters" | "keyPaths"> & {
16
+ value?: any;
17
+ setterContext?: Partial<CSetterProps["setterContext"]>;
18
+ currentSetter: SetterObjType;
19
+ customSetterMap?: any;
20
+ setCurrentSetter: (setter: SetterObjType) => void;
21
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare function EmptySetter(props: {
2
+ setterName: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare const getEmptySetter: (setterName: string) => () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CollapseHeader: React.FC<{
6
+ label: React.ReactNode;
7
+ headerExt?: React.ReactNode;
8
+ switcher?: React.ReactNode;
9
+ }>;
@@ -9,6 +9,7 @@ export type SetterSwitcherProps = {
9
9
  prefix?: React.ReactNode;
10
10
  suffix?: React.ReactNode;
11
11
  style?: React.CSSProperties;
12
+ /** 是否实用 CFile 包裹 */
12
13
  useField?: boolean;
13
14
  } & Omit<CFieldProps, 'children'>;
14
15
  export declare const SetterSwitcher: ({ setters, keyPaths, condition, useField, ...props }: SetterSwitcherProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { TLogicItemHandlerFlow } from '@chamn/model';
2
+ export declare const CreateNewNodePopup: (props: {
3
+ title?: string;
4
+ children: React.ReactNode;
5
+ disabled?: boolean;
6
+ style?: React.CSSProperties;
7
+ onNewNodeAdd: (data: TLogicItemHandlerFlow[number]) => void;
8
+ }) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | null | undefined;
@@ -0,0 +1,22 @@
1
+ import { LogicType, TLogicAssignValueItem, TLogicCallNodeMethodItem, TLogicJumpLinkItem, TLogicRequestAPIItem, TLogicRunCodeItem } from '@chamn/model';
2
+ export declare const DEFAULT_NODE_LIST: ({
3
+ key: LogicType;
4
+ name: string;
5
+ getInitData: () => TLogicAssignValueItem;
6
+ } | {
7
+ key: LogicType;
8
+ name: string;
9
+ getInitData: () => TLogicJumpLinkItem;
10
+ } | {
11
+ key: LogicType;
12
+ name: string;
13
+ getInitData: () => TLogicRequestAPIItem;
14
+ } | {
15
+ key: LogicType;
16
+ name: string;
17
+ getInitData: () => TLogicCallNodeMethodItem;
18
+ } | {
19
+ key: LogicType;
20
+ name: string;
21
+ getInitData: () => TLogicRunCodeItem;
22
+ })[];
@@ -0,0 +1,2 @@
1
+ import { HandleProps } from '@xyflow/react';
2
+ export declare const InputHandle: (props: Partial<HandleProps>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { CardProps } from 'antd';
2
+ import { NodeProps } from '@xyflow/react';
3
+ export declare const NodeCard: ({ nodeProps, customHandle, handleNewNodeAdd: outHandleNewNodeAdd, useCardStyle, outputHandle, inputHandle, ...props }: CardProps & {
4
+ inputHandle?: boolean;
5
+ outputHandle?: boolean;
6
+ useCardStyle?: boolean;
7
+ nodeProps: NodeProps;
8
+ customHandle?: React.ReactNode;
9
+ handleNewNodeAdd?: (newNodeData: any) => void;
10
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { HandleProps } from '@xyflow/react';
2
+ export declare const OutputHandle: (props: Partial<HandleProps>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { CPage } from '@chamn/model';
2
+ export declare const SelectNodeByTree: (props: {
3
+ pageModel: CPage;
4
+ onChange?: (data: {
5
+ nodeId: string;
6
+ title: string;
7
+ }) => void;
8
+ value?: any;
9
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { CPage } from '@chamn/model';
2
+ interface SelectNodeModalProps {
3
+ open: boolean;
4
+ onCancel: () => void;
5
+ onOk: (data: {
6
+ nodeId: string;
7
+ title: string;
8
+ }) => void;
9
+ pageModel: CPage;
10
+ value?: string;
11
+ }
12
+ export declare const SelectNodeModal: (props: SelectNodeModalProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TreeDataNode } from 'antd';
2
+ export declare const getParentKey: (key: React.Key, tree: TreeDataNode[]) => React.Key;
3
+ export declare const getNodeInfo: (key: string, tree: TreeDataNode[]) => TreeDataNode | null;
@@ -0,0 +1,12 @@
1
+ import { CPage } from '@chamn/model';
2
+ export declare const SelectNodeState: (props: {
3
+ value?: {
4
+ nodeId: string;
5
+ keyPath: string;
6
+ };
7
+ pageModel: CPage;
8
+ onChange?: (data: {
9
+ nodeId: string;
10
+ keyPath: string;
11
+ }) => void;
12
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { TreeDataNode } from 'antd';
2
+ import { Key } from 'react';
3
+ export declare const getParentKey: (key: React.Key, tree: TreeDataNode[]) => React.Key;
4
+ export declare const generateKeyList: (data: TreeDataNode[]) => {
5
+ title: string;
6
+ key: Key;
7
+ }[];
@@ -0,0 +1,4 @@
1
+ export declare const REACT_FLOW_DRAG_CLASS_NAME = "chamn-action-drag-handler";
2
+ export declare const INPUT_HANDLE_ID = "INPUT_HANDLE_ID";
3
+ export declare const OUTPUT_HANDLE_ID = "OUTPUT_HANDLE_ID";
4
+ export declare const REQUEST_API_FAILED_HANDLE_ID = "REQUEST_API_FAILED_HANDLE_ID";
@@ -0,0 +1,11 @@
1
+ import { CPage } from '@chamn/model';
2
+ import { CPluginCtx } from '../../../../../core/pluginManager';
3
+ interface ActionFlowContextType {
4
+ pluginCtx: CPluginCtx;
5
+ pageModel: CPage;
6
+ /** 数据有改变时,包含节点内部的数据 */
7
+ onDataChange: () => void;
8
+ }
9
+ export declare const ActionFlowContext: import('react').Context<ActionFlowContextType>;
10
+ export declare const useActionFlow: () => ActionFlowContextType;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { TActionLogicItem } from '@chamn/model';
2
+ import { CSetterProps } from '../type';
3
+ export type TActionFlowSetterCore = CSetterProps<{
4
+ value?: TActionLogicItem;
5
+ children?: React.ReactNode;
6
+ }>;
7
+ export declare const ActionFlowSetterCore: (props: TActionFlowSetterCore) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ActionFlowSetter: {
9
+ (props: TActionFlowSetterCore): import("react/jsx-runtime").JSX.Element;
10
+ setterName: string;
11
+ };
@@ -0,0 +1,4 @@
1
+ import { TLogicAssignValueItem } from '@chamn/model';
2
+ import { NodeProps, Node } from '@xyflow/react';
3
+ export type TAssignValueNode = Node<TLogicAssignValueItem, 'AssignValueNode'>;
4
+ export declare const AssignValueNode: (props: NodeProps<TAssignValueNode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function isValidJSVariableName(name: string): boolean;
@@ -0,0 +1,4 @@
1
+ import { TLogicCallNodeMethodItem } from '@chamn/model';
2
+ import { NodeProps, Node } from '@xyflow/react';
3
+ export type TCallNodeMethodNode = Node<TLogicCallNodeMethodItem, 'CallNodeMethodNode'>;
4
+ export declare const CallNodeMethodNode: (props: NodeProps<TCallNodeMethodNode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { CPageNode } from '@chamn/model';
2
+ export declare function isValidJSVariableName(name: string): boolean;
3
+ /**
4
+ *
5
+ * @param node 结合 method 描述,合并为一个 FormSchema, 加 key 前缀是为了避免 key 冲突
6
+ * @param args
7
+ * @returns
8
+ */
9
+ export declare const getArgsObjFormSchema: (node: CPageNode, methodName: string) => (import('@chamn/model').MaterialPropType<""> | import('@chamn/model').SpecialMaterialPropType<"">)[];
10
+ export declare const formatArgsObjToArray: (val: Record<string, any>) => any[];
11
+ export declare const formatArgsToObject: (valArr: any[]) => any;
@@ -0,0 +1,4 @@
1
+ import { TLogicJumpLinkItem } from '@chamn/model';
2
+ import { NodeProps, Node } from '@xyflow/react';
3
+ export type TJumpLinkNode = Node<TLogicJumpLinkItem, 'JumpLinkNode'>;
4
+ export declare const JumpLinkNode: (props: NodeProps<TJumpLinkNode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { SetterType } from '@chamn/model';
2
+ export declare const requestParamsSchemaSetterList: SetterType[];
3
+ export declare const methodOptions: {
4
+ value: string;
5
+ label: string;
6
+ }[];
@@ -0,0 +1,4 @@
1
+ import { TLogicRequestAPIItem } from '@chamn/model';
2
+ import { NodeProps, Node } from '@xyflow/react';
3
+ export type TRequestAPINode = Node<TLogicRequestAPIItem, 'RequestAPINode'>;
4
+ export declare const RequestAPINode: (props: NodeProps<TRequestAPINode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function isValidJSVariableName(name: string): boolean;
@@ -0,0 +1,4 @@
1
+ import { TLogicRunCodeItem } from '@chamn/model';
2
+ import { NodeProps, Node } from '@xyflow/react';
3
+ export type TRunCodeNode = Node<TLogicRunCodeItem, 'RunCodeNode'>;
4
+ export declare const RunCodeNode: (props: NodeProps<TRunCodeNode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function isValidJSVariableName(name: string): boolean;
@@ -0,0 +1,3 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+ export type CounterNode = Node<any, 'StartNode'>;
3
+ export declare const StartNode: (props: NodeProps<CounterNode>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ export declare enum NODE_TYPE {
2
+ START_NODE = "START_NODE",
3
+ JUMP_LINK = "JUMP_LINK",
4
+ ASSIGN_VALUE = "ASSIGN_VALUE",
5
+ CALL_NODE_METHOD = "CALL_NODE_METHOD",
6
+ RUN_CODE = "RUN_CODE",
7
+ REQUEST_API = "REQUEST_API"
8
+ }
9
+ export declare const NODE_MAP: {
10
+ START_NODE: (props: import('@xyflow/react').NodeProps<import('./StartNode').CounterNode>) => import("react/jsx-runtime").JSX.Element;
11
+ JUMP_LINK: (props: import('@xyflow/react').NodeProps<import('./JumpLinkNode').TJumpLinkNode>) => import("react/jsx-runtime").JSX.Element;
12
+ ASSIGN_VALUE: (props: import('@xyflow/react').NodeProps<import('./AssignValueNode').TAssignValueNode>) => import("react/jsx-runtime").JSX.Element;
13
+ CALL_NODE_METHOD: (props: import('@xyflow/react').NodeProps<import('./CallNodeMethodNode').TCallNodeMethodNode>) => import("react/jsx-runtime").JSX.Element;
14
+ RUN_CODE: (props: import('@xyflow/react').NodeProps<import('./RunCodeNode').TRunCodeNode>) => import("react/jsx-runtime").JSX.Element;
15
+ REQUEST_API: (props: import('@xyflow/react').NodeProps<import('./RequestAPINode').TRequestAPINode>) => import("react/jsx-runtime").JSX.Element;
16
+ };
@@ -0,0 +1,40 @@
1
+ import { Edge, Node } from '@xyflow/react';
2
+ import { SetterType, TActionLogicItem } from '@chamn/model';
3
+ /** 自动布局 flow node */
4
+ export declare const calculateElementLayout: (nodes: Node[], edges: Edge[], options: {
5
+ direction: "TB" | "LR";
6
+ }) => {
7
+ nodes: Node[];
8
+ edges: Edge[];
9
+ };
10
+ export declare const parseActionLogicToNodeList: (value: TActionLogicItem) => {
11
+ nodes: Node[];
12
+ edges: Edge[];
13
+ };
14
+ export declare const revertNodeToActionLogic: (params: {
15
+ nodes: Node[];
16
+ edges: Edge[];
17
+ }) => TActionLogicItem;
18
+ /** 通用的 flow action 画布中的 setter 配置 */
19
+ export declare const CommonDynamicValueSetter: SetterType[];
20
+ export declare const UseNodeHasConnected: (data: any, handleId: string) => boolean;
21
+ export declare const getNewNodePosInfo: (currentNode: Node, newNodeData: any, sourceHandle?: string) => {
22
+ newEdge: {
23
+ id: string;
24
+ source: string;
25
+ sourceHandle: string;
26
+ target: any;
27
+ targetHandle: string;
28
+ };
29
+ newNode: {
30
+ id: any;
31
+ type: any;
32
+ position: {
33
+ x: number;
34
+ y: number;
35
+ };
36
+ /** 必须 */
37
+ dragHandle: string;
38
+ data: any;
39
+ };
40
+ };
@@ -0,0 +1,3 @@
1
+ import { CSetter } from './type';
2
+ /** 需要单独倒出避免循环以来,因为 ActionFlowSetter 使用了大量内置 setter */
3
+ export declare const BUILD_IN_ADVANCE_SETTER_MAP: Record<string, CSetter>;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { SetterObjType } from '@chamn/model';
3
3
  export declare function ArrayItem(props: {
4
4
  index: number;
5
+ labelPrefix?: string;
5
6
  keyPaths: string[];
6
7
  value: Record<string, any>;
7
8
  setters: SetterObjType[];
@@ -5,9 +5,10 @@ export type CArraySetterProps = {
5
5
  setters: SetterType[];
6
6
  initialValue?: any;
7
7
  };
8
+ itemLabelPrefix?: string;
8
9
  sortLabelKey?: string;
9
10
  };
10
11
  export declare const ArraySetter: {
11
- ({ onValueChange, setterContext, item: { setters, initialValue: itemInitialValue }, sortLabelKey, initialValue, ...props }: CSetterProps<CArraySetterProps>): import("react/jsx-runtime").JSX.Element;
12
+ ({ onValueChange, setterContext, item: { setters, initialValue: itemInitialValue }, sortLabelKey, initialValue, itemLabelPrefix, ...props }: CSetterProps<CArraySetterProps>): import("react/jsx-runtime").JSX.Element;
12
13
  setterName: string;
13
14
  };
@@ -64,7 +64,7 @@ type ContextType = {
64
64
  /** 循环数据 */
65
65
  loopData?: Record<any, any>;
66
66
  /** 组件节点的 Ref */
67
- refs?: {
67
+ nodeRefs?: {
68
68
  get: (nodeId: string) => any;
69
69
  };
70
70
  storeManager?: StoreManager;
@@ -1,3 +1,6 @@
1
1
  import { CSetter } from '../type';
2
2
  import { TextAreaProps } from 'antd/es/input';
3
- export declare const TextAreaSetter: CSetter<TextAreaProps>;
3
+ export type TTextAreaSetterProps = TextAreaProps & {
4
+ valueValidator?: (value: string) => boolean;
5
+ };
6
+ export declare const TextAreaSetter: CSetter<TTextAreaSetterProps>;
@@ -1,4 +1,4 @@
1
1
  import { CSetter } from './type';
2
- declare const _default: Record<string, CSetter>;
3
- export default _default;
2
+ export declare const BUILD_IN_SETTER_MAP: Record<string, CSetter>;
3
+ export default BUILD_IN_SETTER_MAP;
4
4
  export * from './type';
@@ -1,7 +1,7 @@
1
1
  import { CPluginCtx } from '../../../../core/pluginManager';
2
2
  export type CSetter<T = any> = {
3
3
  (props: CSetterProps<T>): JSX.Element;
4
- setterName: string;
4
+ setterName?: string;
5
5
  };
6
6
  export type CSetterProps<T = {
7
7
  _: any;
@@ -1,15 +1,17 @@
1
1
  import { default as React, Ref } from 'react';
2
- import { CustomSchemaFormInstance } from '.';
2
+ import { CustomSchemaFormInstance } from './index';
3
3
  import { CPluginCtx } from '../../core/pluginManager';
4
4
  import { CForm } from './components/Form';
5
5
  import { CFormContextData } from './components/Form/context';
6
6
  export type ContextState = Record<string, any>;
7
7
  export type CCustomSchemaFormContextData = {
8
8
  onSetterChange: (keyPaths: string[], setterName: string) => void;
9
+ /** 存储 field 默认的 setter 类型*/
9
10
  defaultSetterConfig: Record<string, {
10
11
  name: string;
11
12
  setter: string;
12
13
  }>;
14
+ /** schema 中的全局 setter map 配置*/
13
15
  customSetterMap: CFormContextData['customSetterMap'];
14
16
  formRef?: Ref<CustomSchemaFormInstance | CForm>;
15
17
  pluginCtx?: CPluginCtx;
@@ -1,2 +1,4 @@
1
1
  import { SetterBasicType, SetterObjType, SetterType } from '@chamn/model';
2
2
  export declare const getSetterList: <T extends SetterBasicType = "">(setters?: SetterType<T>[]) => SetterObjType<T>[];
3
+ /** 根据值获取默认的 setter */
4
+ export declare const getDefaultSetterByValue: (value: any, setterList: SetterObjType[]) => SetterObjType | undefined;
@@ -1,5 +1,5 @@
1
1
  import { EditorProps, Monaco } from '@monaco-editor/react';
2
- type EditorType = EditorProps;
2
+ export type EditorType = EditorProps;
3
3
  export type MonacoEditorInstance = Parameters<Required<EditorType>['onMount']>[0];
4
4
  export type MonacoEditorProps = {
5
5
  beforeMount?: (monaco: Monaco) => void;
@@ -8,6 +8,6 @@ export type MonacoEditorProps = {
8
8
  onChange?: EditorType['onChange'];
9
9
  initialValue?: string;
10
10
  language?: 'json' | 'javascript' | 'typescript';
11
+ theme?: 'vs-dark' | 'light';
11
12
  };
12
13
  export declare const MonacoEditor: (props: MonacoEditorProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -0,0 +1,4 @@
1
+ import { ModalProps } from 'antd';
2
+ export type SortItemOrderProps = {} & ModalProps;
3
+ /** 可拖拽移动的 Modal */
4
+ export declare const MoveableModal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ import { CustomI18n } from '../i18n';
6
6
  import { AssetsPackageListManager } from './assetPackagesListManage';
7
7
  export type PluginObj<C, E = any> = {
8
8
  name: string;
9
+ PLUGIN_NAME?: string;
9
10
  init: (ctx: CPluginCtx<C>) => Promise<void>;
10
11
  destroy: (ctx: CPluginCtx<C>) => Promise<void>;
11
12
  /** 用于暴露给外部重载插件 */
@@ -18,7 +19,11 @@ export type PluginObj<C, E = any> = {
18
19
  };
19
20
  };
20
21
  };
21
- export type CPlugin<C = Record<string, any>, E = any> = PluginObj<C, E> | ((ctx: CPluginCtx<C>) => PluginObj<C, E>);
22
+ interface PluginFunction<C, E> {
23
+ (ctx: CPluginCtx<C>): PluginObj<C, E>;
24
+ ['PLUGIN_NAME']?: string;
25
+ }
26
+ export type CPlugin<C = Record<string, any>, E = any> = PluginObj<C, E> | PluginFunction<C, E>;
22
27
  type PluginManagerOptions = {
23
28
  getWorkbench: () => Workbench;
24
29
  emitter: Emitter<any>;