@digitalsee-ai/rcs 1.1.8 → 2.0.0-beta10

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 (182) hide show
  1. package/README.md +6 -38
  2. package/README.npm.md +37 -0
  3. package/dist/components/digitalsee/JsonRenderer/index.d.ts +1 -1
  4. package/dist/components/digitalsee/workflow/Canvas/FastOperationButtons.d.ts +5 -2
  5. package/dist/components/digitalsee/workflow/Canvas/FullscreenLoading.d.ts +10 -2
  6. package/dist/components/digitalsee/workflow/Canvas/MiniMap.d.ts +1 -1
  7. package/dist/components/digitalsee/workflow/Canvas/NodePlaceholder.d.ts +12 -0
  8. package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +3 -6
  9. package/dist/components/digitalsee/workflow/Canvas/actionItemToNodeData.d.ts +1 -6
  10. package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +25 -26
  11. package/dist/components/digitalsee/workflow/Canvas/hooks/{classicNodeAddConnection.d.ts → nodePackageAddConnection.d.ts} +3 -3
  12. package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +4 -2
  13. package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +42 -5
  14. package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +2 -3
  15. package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +22 -4
  16. package/dist/components/digitalsee/workflow/Canvas/types.d.ts +18 -6
  17. package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +2 -0
  18. package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +3 -8
  19. package/dist/components/digitalsee/workflow/Edges/edgeLayout.d.ts +97 -0
  20. package/dist/components/digitalsee/workflow/Handles/CustomHandle.d.ts +1 -0
  21. package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +28 -1
  22. package/dist/components/digitalsee/workflow/Nodes/DeclaredNode.d.ts +37 -0
  23. package/dist/components/digitalsee/workflow/Nodes/DynamicNode.d.ts +24 -0
  24. package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +42 -4
  25. package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +2 -1
  26. package/dist/components/digitalsee/workflow/Nodes/classicPortLayout.d.ts +51 -0
  27. package/dist/components/digitalsee/workflow/Nodes/components/NodeStatusBadge.d.ts +11 -0
  28. package/dist/components/digitalsee/workflow/Nodes/{classicNodePackagePortLayout.d.ts → nodePackagePortLayout.d.ts} +4 -4
  29. package/dist/components/digitalsee/workflow/Nodes/nodeTypeRegistry.d.ts +131 -0
  30. package/dist/components/digitalsee/workflow/Nodes/useNodePackagePorts.d.ts +35 -0
  31. package/dist/components/digitalsee/workflow/NodesConfig/NodePackageConfig/fieldSchemaAdapter.d.ts +14 -0
  32. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/help.d.ts +5 -1
  33. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TextField/index.d.ts +2 -0
  34. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +1 -0
  35. package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.d.ts +2 -0
  36. package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.helpers.d.ts +11 -0
  37. package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/tree-help.d.ts +5 -12
  38. package/dist/components/digitalsee/workflow/NodesConfig/context.d.ts +13 -0
  39. package/dist/components/digitalsee/workflow/NodesConfig/submitPayload.d.ts +10 -17
  40. package/dist/components/digitalsee/workflow/NodesConfig/useClearVariableTargetOnFormMouseDown.d.ts +15 -0
  41. package/dist/components/digitalsee/workflow/NodesConfig/useVariableActiveTarget.d.ts +13 -0
  42. package/dist/components/digitalsee/workflow/Panels/CanvasConfigDebugger.d.ts +1 -1
  43. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryItem.d.ts +1 -1
  44. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
  45. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCard.d.ts +1 -1
  46. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeItem.d.ts +1 -1
  47. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/PanelHeader.d.ts +1 -1
  48. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +5 -8
  49. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +10 -4
  50. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.d.ts +6 -10
  51. package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +1 -1
  52. package/dist/components/digitalsee/workflow/api/dip.types.d.ts +30 -1
  53. package/dist/components/digitalsee/workflow/api/index.d.ts +3 -22
  54. package/dist/components/digitalsee/workflow/builtin/controls/ConfigSubflow/index.d.ts +2 -2
  55. package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +5 -1
  56. package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -5
  57. package/dist/components/digitalsee/workflow/config/layerConfig.d.ts +14 -0
  58. package/dist/components/digitalsee/workflow/config/themeConfig.d.ts +20 -23
  59. package/dist/components/digitalsee/workflow/constants/nodePackageHandles.d.ts +10 -0
  60. package/dist/components/digitalsee/workflow/context/workflowTriggerContext.d.ts +22 -0
  61. package/dist/components/digitalsee/workflow/coverage/acceptanceManifest.d.ts +30 -0
  62. package/dist/components/digitalsee/workflow/coverage/runtimeCoverage.d.ts +34 -0
  63. package/dist/components/digitalsee/workflow/design-system/AiFlowNodeTestPanel.d.ts +24 -0
  64. package/dist/components/digitalsee/workflow/design-system/AiFlowVariableTree.d.ts +34 -0
  65. package/dist/components/digitalsee/workflow/design-system/index.d.ts +3 -0
  66. package/dist/components/digitalsee/workflow/design-system/tokens.d.ts +103 -0
  67. package/dist/components/digitalsee/workflow/enums/canvas.d.ts +0 -12
  68. package/dist/components/digitalsee/workflow/enums/edge.d.ts +4 -2
  69. package/dist/components/digitalsee/workflow/enums/node.d.ts +5 -6
  70. package/dist/components/digitalsee/workflow/enums/workflow.d.ts +1 -1
  71. package/dist/components/digitalsee/workflow/examples/global-config-example.d.ts +1 -1
  72. package/dist/components/digitalsee/workflow/hooks/state.hooks.d.ts +1 -7
  73. package/dist/components/digitalsee/workflow/hooks/use-flow-data-operation.d.ts +1 -1
  74. package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +1 -1
  75. package/dist/components/digitalsee/workflow/hooks/useCanvasMode.d.ts +8 -0
  76. package/dist/components/digitalsee/workflow/hooks/useCanvasNavigate.d.ts +10 -0
  77. package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +11 -1
  78. package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +1 -0
  79. package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +1 -1
  80. package/dist/components/digitalsee/workflow/index.d.ts +39 -44
  81. package/dist/components/digitalsee/workflow/migration/umi.d.ts +1 -2
  82. package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +64 -0
  83. package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +5 -2
  84. package/dist/components/digitalsee/workflow/types/Node.d.ts +2 -0
  85. package/dist/components/digitalsee/workflow/types/NodeAddContext.d.ts +1 -1
  86. package/dist/components/digitalsee/workflow/types/Workflow.d.ts +1 -1
  87. package/dist/components/digitalsee/workflow/types/engine.d.ts +29 -12
  88. package/dist/components/digitalsee/workflow/types/flowVersion.d.ts +0 -30
  89. package/dist/components/digitalsee/workflow/utils/connectionCheck.d.ts +30 -0
  90. package/dist/components/digitalsee/workflow/utils/graphLoop.d.ts +12 -0
  91. package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -2
  92. package/dist/components/digitalsee/workflow/utils/mcpCanvas.d.ts +0 -40
  93. package/dist/components/digitalsee/workflow/utils/mode.d.ts +18 -0
  94. package/dist/components/digitalsee/workflow/utils/nodeAutoConnect.d.ts +24 -0
  95. package/dist/components/digitalsee/workflow/utils/nodeCommon.d.ts +5 -0
  96. package/dist/components/digitalsee/workflow/utils/nodeHandleLayout.d.ts +83 -0
  97. package/dist/components/digitalsee/workflow/utils/nodePackageConnection.d.ts +28 -0
  98. package/dist/components/digitalsee/workflow/utils/nodePackageGraphValidation.d.ts +29 -0
  99. package/dist/components/digitalsee/workflow/utils/nodePackageSchemaCache.d.ts +15 -0
  100. package/dist/components/digitalsee/workflow/utils/onNodeRemoveHook.d.ts +13 -0
  101. package/dist/components/digitalsee/workflow/utils/triggerNode.d.ts +13 -0
  102. package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.d.ts +1 -3
  103. package/dist/components/digitalsee/workflow/workflow.story-fixtures.d.ts +50 -0
  104. package/dist/components/dynamic-form/context/VariableSelectorContext.d.ts +17 -16
  105. package/dist/components/dynamic-form/index.d.ts +1 -4
  106. package/dist/index-B5ujKdXE.mjs +282 -0
  107. package/dist/{index-CRdKUD0G.mjs → index-BLqed5HY.mjs} +45697 -48347
  108. package/dist/locales/en-US/common.d.ts +29 -52
  109. package/dist/locales/en-US.d.ts +29 -52
  110. package/dist/locales/zh-CN/common.d.ts +29 -52
  111. package/dist/locales/zh-CN.d.ts +29 -52
  112. package/dist/locales/zh-TW/common.d.ts +29 -52
  113. package/dist/locales/zh-TW.d.ts +29 -52
  114. package/dist/rcs.css +1 -1
  115. package/dist/rcs.es.js +36 -35
  116. package/dist/rcs.umd.js +131 -78
  117. package/package.json +38 -23
  118. package/dist/components/digitalsee/workflow/Canvas/FlowVersionManager.d.ts +0 -16
  119. package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +0 -9
  120. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +0 -4
  121. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +0 -15
  122. package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +0 -38
  123. package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +0 -13
  124. package/dist/components/digitalsee/workflow/Nodes/AISubNode.d.ts +0 -9
  125. package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +0 -13
  126. package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +0 -10
  127. package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +0 -10
  128. package/dist/components/digitalsee/workflow/Nodes/BuiltinMCPNode.d.ts +0 -9
  129. package/dist/components/digitalsee/workflow/Nodes/ConditionNode.d.ts +0 -13
  130. package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +0 -15
  131. package/dist/components/digitalsee/workflow/Nodes/LoopNode.d.ts +0 -4
  132. package/dist/components/digitalsee/workflow/Nodes/MCPServerNode.d.ts +0 -9
  133. package/dist/components/digitalsee/workflow/Nodes/MCPToolNode.d.ts +0 -9
  134. package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +0 -12
  135. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +0 -9
  136. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +0 -16
  137. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +0 -10
  138. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +0 -10
  139. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +0 -10
  140. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +0 -9
  141. package/dist/components/digitalsee/workflow/Nodes/SelfLoopNode.d.ts +0 -4
  142. package/dist/components/digitalsee/workflow/Nodes/StartNode.d.ts +0 -1
  143. package/dist/components/digitalsee/workflow/Nodes/SwitchNode.d.ts +0 -13
  144. package/dist/components/digitalsee/workflow/Nodes/TriggerNode.d.ts +0 -10
  145. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +0 -16
  146. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +0 -11
  147. package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.d.ts +0 -27
  148. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +0 -13
  149. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +0 -17
  150. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +0 -17
  151. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +0 -10
  152. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +0 -17
  153. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +0 -6
  154. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +0 -6
  155. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +0 -6
  156. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +0 -49
  157. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/EntryTypeSelector.d.ts +0 -8
  158. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCardList.d.ts +0 -20
  159. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeActionState.d.ts +0 -28
  160. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.d.ts +0 -25
  161. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/filterEdgeInsertActions.d.ts +0 -62
  162. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/queryParams.d.ts +0 -18
  163. package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +0 -1
  164. package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.d.ts +0 -28
  165. package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.d.ts +0 -29
  166. package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +0 -14
  167. package/dist/components/digitalsee/workflow/utils/queuedNodeConfigOpen.d.ts +0 -12
  168. package/dist/components/dynamic-form/components/SelectWithExpression/index.d.ts +0 -25
  169. package/dist/components/dynamic-form/components/VariableInput/index.d.ts +0 -26
  170. package/dist/components/dynamic-form/components/VariableInput/utils.d.ts +0 -38
  171. package/dist/components/dynamic-form/components/VariableTextarea/index.d.ts +0 -10
  172. package/dist/index-CRdKUD0G.mjs.map +0 -1
  173. package/dist/index-rjDBrC08.mjs +0 -312
  174. package/dist/index-rjDBrC08.mjs.map +0 -1
  175. package/dist/postcss.config.js +0 -1
  176. package/dist/rcs.es.js.map +0 -1
  177. package/dist/rcs.umd.js.map +0 -1
  178. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/WorkflowNodeSchemaFieldProvider.d.ts +0 -0
  179. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowCodeField.d.ts +0 -0
  180. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowProxyField.d.ts +0 -0
  181. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/proxyField.d.ts +0 -0
  182. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/{next-compatible.d.ts → nodePackage-compatible.d.ts} +0 -0
@@ -11,40 +11,34 @@ export interface VariableInfo {
11
11
  /** 图标 URL 或 React 节点 */
12
12
  icon?: string | React.ReactNode;
13
13
  }
14
- export type ValueMode = 'normal' | 'expression' | 'code' | 'fixValue';
14
+ export type ValueMode = 'normal' | 'expression' | 'code' | 'formValue';
15
15
  interface RegisteredField {
16
16
  id: string;
17
17
  insertVariable: (variable: string, formatted: boolean) => void;
18
18
  focus: () => void;
19
19
  }
20
- export interface VariableSelectorContextValue {
21
- /** 当前激活的字段 ID */
20
+ /** 会随焦点/可见性变化的状态;仅真正需要订阅的组件应使用 */
21
+ export interface VariableSelectorStateValue {
22
22
  activeFieldId: string | null;
23
- /** 变量选择器是否可见 */
24
23
  selectorVisible: boolean;
25
- /** 可用变量列表 */
26
24
  availableVariables: VariableInfo[];
27
- /** 注册字段 */
25
+ }
26
+ /** 稳定操作接口;VariableInput 只消费这份,避免焦点切换拖垮整树 Slate 重渲染 */
27
+ export interface VariableSelectorActionsValue {
28
28
  registerField: (field: RegisteredField) => void;
29
- /** 注销字段 */
30
29
  unregisterField: (id: string) => void;
31
- /** 激活字段(获得焦点时调用) */
32
30
  activateField: (id: string) => void;
33
- /** 取消激活 */
34
31
  deactivateField: () => void;
35
- /** 显示/隐藏变量选择器 */
36
32
  setSelectorVisible: (visible: boolean) => void;
37
- /** 插入变量到当前激活的字段 */
38
33
  insertVariableToActiveField: (variable: string, wrapWithBraces?: boolean) => void;
39
- /** 设置可用变量列表 */
40
34
  setAvailableVariables: (variables: VariableInfo[]) => void;
41
- /** 验证变量是否有效 */
42
35
  validateVariable: (variable: string) => boolean;
43
- /** 格式化变量为 {{variable}} 格式 */
44
36
  formatVariable: (variable: string) => string;
45
- /** 从格式化字符串中提取变量 */
46
37
  extractVariable: (formatted: string) => string | null;
38
+ /** 读取当前激活字段(不触发订阅,供桥接插入使用) */
39
+ getActiveFieldId: () => string | null;
47
40
  }
41
+ export type VariableSelectorContextValue = VariableSelectorStateValue & VariableSelectorActionsValue;
48
42
  export interface VariableSelectorProviderProps {
49
43
  children: React.ReactNode;
50
44
  /** 初始可用变量列表 */
@@ -57,11 +51,18 @@ export interface VariableSelectorProviderProps {
57
51
  onValidateVariable?: (variable: string) => boolean;
58
52
  }
59
53
  export declare const VariableSelectorProvider: React.FC<VariableSelectorProviderProps>;
54
+ /** 完整读写(状态 + 操作)。焦点切换时会重渲染,仅桥接/面板使用 */
60
55
  export declare const useVariableSelector: () => VariableSelectorContextValue;
56
+ /**
57
+ * 注册字段:只订阅稳定 Actions,不因 activeFieldId 变化而重渲染。
58
+ * 这是创建账号弹窗内多个 Slate 与节点配置表单并存时避免假死的关键路径。
59
+ */
61
60
  export declare const useRegisterVariableField: (id: string, insertVariable: (variable: string, formatted: boolean) => void, focus: () => void) => {
62
61
  activate: () => void;
63
62
  deactivate: () => void;
64
- isActive: boolean;
65
63
  };
64
+ /** 仅订阅稳定操作,不因焦点切换重渲染 */
65
+ export declare const useVariableSelectorActionsOptional: () => VariableSelectorActionsValue | null;
66
+ /** 可选订阅:同时拿状态与操作;无 Provider 时返回 null */
66
67
  export declare const useVariableSelectorOptional: () => VariableSelectorContextValue | null;
67
68
  export {};
@@ -1,10 +1,7 @@
1
1
  export * from './AntdProvider';
2
2
  export { AI_FILL_VALUE, AIFieldWrapper, type AIFieldWrapperProps, } from './components/AIFieldWrapper';
3
- export { type SelectValueMode, SelectWithExpression, type SelectWithExpressionProps, } from './components/SelectWithExpression';
4
3
  export { useValueModePolicyOptional, type ValueMode, ValueModeFieldScope, ValueModePolicyScope, ValueModeSwitch, type ValueModeSwitchProps, ValueModeWrapper, type ValueModeWrapperProps, withInheritedValueModePolicy, } from './components/ValueModeWrapper';
5
- export { VariableInput, type VariableInputProps, } from './components/VariableInput';
6
- export { VariableTextarea, type VariableTextareaProps, } from './components/VariableTextarea';
7
- export { useRegisterVariableField, useVariableSelector, useVariableSelectorOptional, type VariableInfo, type VariableSelectorContextValue, VariableSelectorProvider, type VariableSelectorProviderProps, } from './context/VariableSelectorContext';
4
+ export { useRegisterVariableField, useVariableSelector, useVariableSelectorActionsOptional, useVariableSelectorOptional, type VariableInfo, type VariableSelectorActionsValue, type VariableSelectorContextValue, VariableSelectorProvider, type VariableSelectorProviderProps, type VariableSelectorStateValue, } from './context/VariableSelectorContext';
8
5
  export * from './DynamicForm';
9
6
  export * from './DynamicFormContext';
10
7
  export * from './FieldRenderer';
@@ -0,0 +1,282 @@
1
+ import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
+ import { D as T, V as L, e as V, i as P, t as l, f as R, d as O } from "./index-BLqed5HY.mjs";
3
+ import { useEventEmitter as B, useReactive as W, useSize as H } from "ahooks";
4
+ import { FormattedMessage as $ } from "react-intl";
5
+ import { CloseCircleFilled as A, CheckCircleFilled as K } from "@ant-design/icons";
6
+ import { Button as M } from "antd";
7
+ import * as z from "monaco-editor";
8
+ import { useRef as I, useEffect as j } from "react";
9
+ import { createPortal as q } from "react-dom";
10
+ import J from "react-monaco-editor";
11
+ const G = "_modalContainer_1ajlo_5", Q = "_editorContainer_1ajlo_16", U = "_sider_1ajlo_25", X = "_main_1ajlo_34", Y = "_header_1ajlo_40", Z = "_editor_1ajlo_16", w = {
12
+ modalContainer: G,
13
+ editorContainer: Q,
14
+ sider: U,
15
+ main: X,
16
+ header: Y,
17
+ editor: Z
18
+ }, ee = "_ideWrapper_sfar6_1", ne = {
19
+ ideWrapper: ee
20
+ }, te = (e) => {
21
+ const { nodeId: i, onInsert: o, open: c } = e, s = B();
22
+ return s.useSubscription((a) => {
23
+ a.type === "insert" && o(a.expression);
24
+ }), /* @__PURE__ */ t(T.Provider, { value: { event$: s }, children: /* @__PURE__ */ t("div", { className: ne.ideWrapper, children: /* @__PURE__ */ t(L, { nodeId: i, onInsert: o, open: c }) }) });
25
+ }, ie = "_siderContainer_fhkbn_1", oe = {
26
+ siderContainer: ie
27
+ };
28
+ function re(e) {
29
+ return /* @__PURE__ */ t("div", { className: oe.siderContainer, children: /* @__PURE__ */ t(te, { open: e.open, nodeId: e.nodeId, onInsert: e.onInsert }) });
30
+ }
31
+ function se({ language: e = "javascript" }) {
32
+ return /* @__PURE__ */ v("h2", { id: "workflow-online-ide-title", className: "workflow-online-ide-title", children: [
33
+ /* @__PURE__ */ t($, { id: "link.flow.code_editor" }),
34
+ " (Javascript)"
35
+ ] });
36
+ }
37
+ function ae(e) {
38
+ return /* @__PURE__ */ v("div", { className: "workflow-online-ide-toolbar", children: [
39
+ /* @__PURE__ */ t(M, { size: "small", onClick: e.onCancel, icon: /* @__PURE__ */ t(A, {}), children: /* @__PURE__ */ t($, { id: "app.common.word.cancel" }) }),
40
+ /* @__PURE__ */ t(M, { type: "primary", size: "small", onClick: e.onFinish, icon: /* @__PURE__ */ t(K, {}), children: /* @__PURE__ */ t($, { id: "app.common.word.finish" }) })
41
+ ] });
42
+ }
43
+ const le = [{ trigger: "log", content: "console.log('$1');$2", desc: "输出日志" }, { trigger: "imp", content: "import $1 from '$2';$3" }, { trigger: "loop", content: `for (let $1=0; i< $2.length;i++) {
44
+
45
+ }`, desc: "循环操作" }], de = {
46
+ snippets: le
47
+ }, ce = {
48
+ selectOnLineNumbers: !0,
49
+ automaticLayout: !0,
50
+ padding: {
51
+ top: 10
52
+ }
53
+ };
54
+ function ue(e) {
55
+ if (e.type === "global")
56
+ return [
57
+ `**${l("link.flow.variable_type_global")}**`,
58
+ `${l("link.flow.variable_path")}:\`${e.value}\``,
59
+ `${l("link.flow.variable_name")}:\`${e.path}\``
60
+ ].filter(Boolean).join(`
61
+
62
+ `);
63
+ if (e.type === "builtin") {
64
+ const i = R.getBuiltinVariableTips(e.firstPart);
65
+ return [
66
+ `**${l("link.flow.variable_type_builtin")}**`,
67
+ `${l("link.flow.variable_path")}:\`${e.value}\``,
68
+ i
69
+ ].filter(Boolean).join(`
70
+
71
+ `);
72
+ }
73
+ return e.type === "node" ? [
74
+ `**${l("link.flow.variable_type_node")}**`,
75
+ `${l("link.flow.variable_path")}:\`${e.value}\``,
76
+ e.path ? `${l("link.flow.variable_field")}:\`${e.path}\`` : ""
77
+ ].filter(Boolean).join(`
78
+
79
+ `) : [
80
+ `**${l("link.flow.variable_type_platform")}**`,
81
+ `${l("link.flow.variable_path")}:\`${e.value}\``
82
+ ].join(`
83
+
84
+ `);
85
+ }
86
+ const ge = (e) => ({
87
+ code: e.code,
88
+ severity: e.severity,
89
+ message: e.message,
90
+ source: e.source,
91
+ startLineNumber: e.startLineNumber,
92
+ startColumn: e.startColumn,
93
+ endLineNumber: e.endLineNumber,
94
+ endColumn: e.endColumn,
95
+ modelVersionId: e.modelVersionId,
96
+ relatedInformation: e.relatedInformation,
97
+ tags: e.tags
98
+ });
99
+ function N(e, i) {
100
+ const o = V(i.getValue());
101
+ if (!o.length)
102
+ return;
103
+ const c = e.editor.getModelMarkers({ resource: i.uri }), s = /* @__PURE__ */ new Map();
104
+ c.forEach((a) => {
105
+ const d = s.get(a.owner) ?? [];
106
+ d.push(a), s.set(a.owner, d);
107
+ }), s.forEach((a, d) => {
108
+ const u = a.filter(
109
+ (g) => !o.some((b) => O(b, g))
110
+ );
111
+ u.length !== a.length && e.editor.setModelMarkers(i, d, u.map(ge));
112
+ });
113
+ }
114
+ function pe(e, i) {
115
+ const o = [].map((c) => ({
116
+ insertText: c,
117
+ kind: e.languages.CompletionItemKind.Function,
118
+ // 对应提示图标的不同
119
+ label: c
120
+ }));
121
+ return e.languages.registerCompletionItemProvider(i, {
122
+ provideCompletionItems() {
123
+ return {
124
+ suggestions: o
125
+ };
126
+ },
127
+ quickSuggestions: !0,
128
+ // 默认提示关闭
129
+ triggerCharacters: ["{", ".", "=", ":"]
130
+ // 触发提示的字符 可以定义多个
131
+ });
132
+ }
133
+ function fe(e) {
134
+ return e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
135
+ noSemanticValidation: !0,
136
+ noSyntaxValidation: !1
137
+ }), e.languages.typescript.javascriptDefaults.setCompilerOptions({
138
+ target: e.languages.typescript.ScriptTarget.ES2015,
139
+ allowNonTsExtensions: !0
140
+ }), e.languages.registerCompletionItemProvider("javascript", {
141
+ provideCompletionItems: () => ({
142
+ suggestions: de.snippets.map((o) => ({
143
+ label: o.trigger,
144
+ kind: e.languages.CompletionItemKind.Method,
145
+ detail: o.desc ?? "",
146
+ insertText: o.content,
147
+ insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet
148
+ }))
149
+ })
150
+ });
151
+ }
152
+ function $e(e) {
153
+ const { open: i, nodeId: o, initialValue: c, language: s = "javascript", showVariableSidebar: a = !0 } = e, d = I(null), u = I([]), g = W({
154
+ code: "",
155
+ range: new z.Range(1, 1, 1, 1)
156
+ }), b = (n, r) => {
157
+ n.onDidChangeCursorPosition((p) => {
158
+ const m = p.position, { lineNumber: f = 0, column: C = 0 } = m;
159
+ g.range = new r.Range(f, C, f, C);
160
+ }), d.current = n, n.focus(), g.code = n.getValue();
161
+ const S = r.languages.registerHoverProvider(s, {
162
+ provideHover: (p, m) => new Promise((f) => {
163
+ const h = V(p.getValue()).find(
164
+ (F) => P(F, m.lineNumber, m.column)
165
+ );
166
+ if (!h) {
167
+ f(null);
168
+ return;
169
+ }
170
+ f({
171
+ range: new r.Range(
172
+ h.startLine,
173
+ h.startColumn,
174
+ h.endLine,
175
+ h.endColumn
176
+ ),
177
+ contents: [{ value: ue(h) }]
178
+ });
179
+ })
180
+ }), _ = n.getModel();
181
+ if (_) {
182
+ let p = !1;
183
+ const m = r.editor.onDidChangeMarkers((f) => {
184
+ p || !f.some((C) => C.toString() === _.uri.toString()) || (p = !0, window.setTimeout(() => {
185
+ try {
186
+ N(r, _);
187
+ } finally {
188
+ p = !1;
189
+ }
190
+ }, 0));
191
+ });
192
+ N(r, _), n.onDidDispose(() => m.dispose());
193
+ }
194
+ n.onDidDispose(() => S.dispose());
195
+ }, x = (n) => {
196
+ u.current.forEach((r) => {
197
+ r.dispose();
198
+ }), u.current = [pe(n, s)], s === "javascript" && u.current.push(fe(n));
199
+ };
200
+ j(
201
+ () => () => {
202
+ u.current.forEach((n) => {
203
+ n.dispose();
204
+ }), u.current = [];
205
+ },
206
+ []
207
+ ), j(() => {
208
+ if (!i)
209
+ return;
210
+ const n = (r) => {
211
+ r.key === "Escape" && (r.preventDefault(), e.onCancel());
212
+ };
213
+ return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
214
+ }, [i, e.onCancel]);
215
+ const E = (n) => {
216
+ const r = [
217
+ {
218
+ range: g.range,
219
+ text: n,
220
+ forceMoveMarkers: !0
221
+ }
222
+ ];
223
+ d.current && g.range && d.current.executeEdits("my-source", r);
224
+ }, k = () => {
225
+ var n;
226
+ (n = e.onFinish) == null || n.call(e, g.code);
227
+ }, D = I(null), y = H(D);
228
+ return q(
229
+ /* @__PURE__ */ t(
230
+ "div",
231
+ {
232
+ className: w.modalContainer,
233
+ ref: D,
234
+ style: { display: i ? "flex" : "none" },
235
+ role: "dialog",
236
+ "aria-modal": "true",
237
+ "aria-labelledby": "workflow-online-ide-title",
238
+ children: /* @__PURE__ */ v("div", { className: w.editorContainer, id: "javascript-code-editor", children: [
239
+ a ? /* @__PURE__ */ t("div", { className: w.sider, style: { maxWidth: "20%", padding: 0 }, children: /* @__PURE__ */ t(
240
+ re,
241
+ {
242
+ onCancel: e.onCancel,
243
+ onFinish: k,
244
+ editor: d.current,
245
+ nodeId: o,
246
+ open: i,
247
+ onInsert: E
248
+ }
249
+ ) }) : null,
250
+ /* @__PURE__ */ v("div", { className: w.main, children: [
251
+ /* @__PURE__ */ v("div", { className: w.header, children: [
252
+ /* @__PURE__ */ t(se, { language: s }),
253
+ /* @__PURE__ */ t(ae, { onCancel: e.onCancel, onFinish: k })
254
+ ] }),
255
+ /* @__PURE__ */ t("div", { className: w.editor, children: /* @__PURE__ */ t(
256
+ J,
257
+ {
258
+ width: "100%",
259
+ height: ((y == null ? void 0 : y.height) ?? 0) - 40,
260
+ language: s,
261
+ theme: "vs-dark",
262
+ value: c,
263
+ options: ce,
264
+ onChange: (n) => {
265
+ g.code = n;
266
+ },
267
+ editorWillMount: x,
268
+ editorDidMount: b
269
+ },
270
+ o
271
+ ) })
272
+ ] })
273
+ ] })
274
+ }
275
+ ),
276
+ document.body
277
+ );
278
+ }
279
+ export {
280
+ $e as default
281
+ };
282
+ //# sourceMappingURL=index-B5ujKdXE.mjs.map