@flowgram-vue/form-core 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/LICENSE +22 -0
- package/dist/index.cjs +0 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
- package/src/client/NodeRender.vue +76 -0
- package/src/client/create-node-container-modules.ts +12 -0
- package/src/client/create-node-entity-datas.ts +13 -0
- package/src/client/index.ts +11 -0
- package/src/client/node-material-client.ts +18 -0
- package/src/client/node-render.ts +6 -0
- package/src/env.d.ts +10 -0
- package/src/error/client.ts +12 -0
- package/src/error/error-container-module.ts +14 -0
- package/src/error/error-node-contribution.ts +17 -0
- package/src/error/flow-node-error-data.ts +26 -0
- package/src/error/index.ts +9 -0
- package/src/error/renders/ErrorRender.vue +61 -0
- package/src/error/renders/default-error-render.ts +15 -0
- package/src/error/renders/error-render.ts +19 -0
- package/src/error/renders/index.ts +6 -0
- package/src/error/types.ts +13 -0
- package/src/form/FormRender.vue +39 -0
- package/src/form/abilities/decorator-ability/decorator-ability.ts +14 -0
- package/src/form/abilities/decorator-ability/index.ts +7 -0
- package/src/form/abilities/decorator-ability/types.ts +28 -0
- package/src/form/abilities/default-ability/default-ability.ts +14 -0
- package/src/form/abilities/default-ability/index.ts +7 -0
- package/src/form/abilities/default-ability/types.ts +15 -0
- package/src/form/abilities/effect-ability/effect-ability.ts +14 -0
- package/src/form/abilities/effect-ability/index.ts +7 -0
- package/src/form/abilities/effect-ability/types.ts +41 -0
- package/src/form/abilities/index.ts +11 -0
- package/src/form/abilities/setter-ability/index.ts +7 -0
- package/src/form/abilities/setter-ability/setter-ability.ts +14 -0
- package/src/form/abilities/setter-ability/types.ts +52 -0
- package/src/form/abilities/validation-ability/form-validate.types.ts +74 -0
- package/src/form/abilities/validation-ability/index.ts +7 -0
- package/src/form/abilities/validation-ability/types.ts +44 -0
- package/src/form/abilities/validation-ability/validation-ability.ts +14 -0
- package/src/form/abilities/visibility-ability/index.ts +6 -0
- package/src/form/abilities/visibility-ability/visibility-ability.ts +25 -0
- package/src/form/client/index.ts +17 -0
- package/src/form/flow-node-form-data.ts +109 -0
- package/src/form/form-contribution.ts +12 -0
- package/src/form/form-core-container-module.ts +19 -0
- package/src/form/form-node-contribution.ts +16 -0
- package/src/form/form-render.ts +13 -0
- package/src/form/index.ts +13 -0
- package/src/form/models/form-ability-extension-registry.ts +30 -0
- package/src/form/models/form-item-ability.ts +18 -0
- package/src/form/models/form-item-material-context.ts +50 -0
- package/src/form/models/form-item.ts +53 -0
- package/src/form/models/form-meta.ts +62 -0
- package/src/form/models/form-model.ts +84 -0
- package/src/form/models/index.ts +11 -0
- package/src/form/services/form-context-maker.ts +35 -0
- package/src/form/services/form-manager.ts +113 -0
- package/src/form/services/form-path-service.ts +88 -0
- package/src/form/services/index.ts +8 -0
- package/src/form/types/form-ability.types.ts +65 -0
- package/src/form/types/form-meta.types.ts +121 -0
- package/src/form/types/form-model.types.ts +33 -0
- package/src/form/types/index.ts +8 -0
- package/src/index.ts +10 -0
- package/src/node/core-materials.ts +9 -0
- package/src/node/core-plugins.ts +9 -0
- package/src/node/index.ts +13 -0
- package/src/node/node-container-module.ts +16 -0
- package/src/node/node-contribution.ts +12 -0
- package/src/node/node-engine-context.ts +54 -0
- package/src/node/node-engine.ts +16 -0
- package/src/node/node-manager.ts +63 -0
- package/src/node/types.ts +30 -0
- package/src/node-vue/composables/index.ts +7 -0
- package/src/node-vue/composables/use-form-item.ts +28 -0
- package/src/node-vue/composables/use-node-engine-context.ts +25 -0
- package/src/node-vue/context/index.ts +6 -0
- package/src/node-vue/context/node-engine-vue-context.ts +24 -0
- package/src/node-vue/hooks/index.ts +6 -0
- package/src/node-vue/index.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
4
|
+
Copyright (c) 2026 Crayon
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/node/node-contribution.ts","../src/node/node-manager.ts","../src/node/node-engine-context.ts","../src/node/node-engine.ts","../src/node/node-container-module.ts","../src/node/core-plugins.ts","../src/node/core-materials.ts","../src/error/flow-node-error-data.ts","../src/error/renders/default-error-render.ts","../src/error/renders/ErrorRender.vue","../src/error/renders/error-render.ts","../src/error/error-node-contribution.ts","../src/error/error-container-module.ts","../src/error/client.ts","../src/form/services/form-context-maker.ts","../src/form/services/form-path-service.ts","../src/form/models/form-model.ts","../src/form/models/form-item.ts","../src/form/models/form-meta.ts","../src/form/models/form-ability-extension-registry.ts","../src/form/form-contribution.ts","../src/form/abilities/setter-ability/setter-ability.ts","../src/form/abilities/decorator-ability/decorator-ability.ts","../src/form/abilities/visibility-ability/visibility-ability.ts","../src/form/abilities/effect-ability/effect-ability.ts","../src/form/abilities/default-ability/default-ability.ts","../src/form/abilities/validation-ability/validation-ability.ts","../src/form/services/form-manager.ts","../src/form/flow-node-form-data.ts","../src/form/FormRender.vue","../src/form/form-render.ts","../src/form/form-node-contribution.ts","../src/form/form-core-container-module.ts","../src/form/types/form-model.types.ts","../src/form/types/form-meta.types.ts","../src/form/client/index.ts","../src/client/create-node-container-modules.ts","../src/node-vue/context/node-engine-vue-context.ts","../src/node-vue/composables/use-node-engine-context.ts","../src/node-vue/composables/use-form-item.ts","../src/client/NodeRender.vue","../src/client/node-material-client.ts","../src/client/create-node-entity-datas.ts"],"names":["MaterialRenderKey","NodeManager","flow","multiInject","optional","postConstruct","injectable","NodeEngineContext","Emitter","NodeEngine","inject","ContainerModule","EntityData","h","defineComponent","useRefresh","useService","onBeforeUnmount","bindContributions","FormContextMaker","injectPlaygroundContext","FormPathService","FormModel","DisposableCollection","FormAbilityExtensionRegistry","FormManager","mapValues","Disposable","_sfc_main","FormItemEventName","provide","useEntityFromContext","PlaygroundContext","PluginContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,gBAAA,0BAA0B,kBAAkB;ACKlD,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,iBAAA,CAAA,GAAkB,0BAAA;AADR,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;AAKCC,sBAAN,iBAAA,CAAkB;AAAA,EAAlB,WAAA,GAAA;AACL,IAAA,IAAA,CAAS,sBAAA,uBAAkD,GAAA,EAAI;AAE/D,IAAA,IAAA,CAAS,oBAAA,uBAAgD,GAAA,EAAI;AAE7D,IAAA,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,GAAc,eAAA,CAAgB,KAAA,CAAM,IAAI,CAAA;AAE9C,MAAA,MAAM,gBAAgB,MAAM;AAC1B,QAAA,IAAI,WAAA,EAAa;AACf,UAAA,OAAO,gBAAiB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,eAAe,CAAA;AAChF,QAAA;AACA,QAAA,IAAI,CAAC,UAAU,QAAA,EAAU;AACvB,UAAA,OAAO,IAAA;AACT,QAAA;AACA,QAAA,IAAI,WAAA,EAAa;AACf,UAAA,OAAO,eAAgB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,eAAe,CAAA;AAC/E,QAAA;AACA,QAAA,OAAO,wBAAwB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,CAAA,IAAK,IAAA;AAC7E,MAAA,CAAA;AAEA,MAAA,MAAM,OAAA,GAAU,WAAA,CAAY,aAAA,CAAc,aAAa,CAAA;AACvD,MAAA,OAAO,OAAO,OAAA,KAAY,UAAA,GAAc,OAAA,EAAsB,GAAIjB,MAAE,OAAc,CAAA;AACpF,IAAA,CAAA;AACF,EAAA;AACF,CAAC,CAAA;;;;AClEM,SAAS,uBAAA,CAAwB,aAA0B,MAAA,EAAsB;AACtF,EAAA,WAAA,CAAY,sBAAA,CAAuB,YAAA,CAAa,iBAAA,EAAmB,MAAM,CAAA;AAC3E;AAEO,SAAS,6BAAA,CACd,aACA,MAAA,EACM;AACN,EAAA,WAAA,CAAY,sBAAA,CAAuB,YAAA,CAAa,uBAAA,EAAyB,MAAM,CAAA;AACjF;;;ACPO,SAAS,qBAAA,GAA8C;AAC5D,EAAA,OAAO,CAAC,kBAAkB,iBAAiB,CAAA;AAC7C","file":"index.cjs","sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type NodeManager } from './node-manager';\n\nexport const NodeContribution = Symbol('NodeContribution');\n\nexport interface NodeContribution {\n onRegister?(nodeManager: NodeManager): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { flow } from 'lodash-es';\nimport { injectable, multiInject, optional, postConstruct } from 'inversify';\n\nimport { NodeErrorRenderProps } from '../error';\nimport { NodePluginRender, NodeRenderHoc, Render } from './types';\nimport { NodeContribution } from './node-contribution';\n\nexport enum MaterialRenderKey {\n CustomNodeError = 'Material_CustomNodeError',\n}\n\n@injectable()\nexport class NodeManager {\n readonly materialRenderRegistry: Map<string, Render> = new Map();\n\n readonly pluginRenderRegistry: Map<string, Render> = new Map();\n\n readonly nodeRenderHocs: NodeRenderHoc[] = [];\n\n @multiInject(NodeContribution) @optional() protected nodeContributions: NodeContribution[] = [];\n\n registerMaterialRender(key: string, render: Render) {\n this.materialRenderRegistry.set(key, render);\n }\n\n getMaterialRender(key: string): Render | undefined {\n return this.materialRenderRegistry.get(key);\n }\n\n registerPluginRender(key: string, render: NodePluginRender): void {\n this.pluginRenderRegistry.set(key, render);\n }\n\n getPluginRender(key: string): NodePluginRender | undefined {\n return this.pluginRenderRegistry.get(key);\n }\n\n registerNodeErrorRender(render: Render<NodeErrorRenderProps>) {\n this.registerMaterialRender(MaterialRenderKey.CustomNodeError, render);\n }\n\n get nodeRenderHoc() {\n return flow(this.nodeRenderHocs);\n }\n\n registerNodeRenderHoc(hoc: NodeRenderHoc) {\n this.nodeRenderHocs.push(hoc);\n }\n\n get nodeErrorRender() {\n return this.materialRenderRegistry.get(MaterialRenderKey.CustomNodeError);\n }\n\n @postConstruct()\n protected init(): void {\n this.nodeContributions.forEach((contrib) => contrib.onRegister?.(this));\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\n\nexport interface INodeEngineContext {\n readonly: boolean;\n}\n\n/**\n * NodeEngineContext 在 Node Engine 中为全局单例, 它的作用是让Node之间共享数据。\n * context 分为内置context(如 readonly) 和 自定义context(业务可以按需注入)\n */\n@injectable()\nexport class NodeEngineContext {\n static DEFAULT_READONLY = false;\n\n static DEFAULT_JSON = { readonly: NodeEngineContext.DEFAULT_READONLY };\n\n readonly onChangeEmitter = new Emitter<NodeEngineContext>();\n\n readonly onChange = this.onChangeEmitter.event;\n\n private _readonly: boolean = NodeEngineContext.DEFAULT_READONLY;\n\n private _json: INodeEngineContext = NodeEngineContext.DEFAULT_JSON;\n\n get json(): INodeEngineContext {\n return this._json;\n }\n\n get readonly(): boolean {\n return this._readonly;\n }\n\n set readonly(value: boolean) {\n this._readonly = value;\n this.fireChange();\n }\n\n private fireChange(): void {\n this.updateJSON();\n this.onChangeEmitter.fire(this);\n }\n\n private updateJSON(): void {\n this._json = {\n readonly: this._readonly,\n };\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\n\nimport { NodeManager } from './node-manager';\nimport { NodeEngineContext } from './node-engine-context';\n\n@injectable()\nexport class NodeEngine {\n @inject(NodeManager) nodeManager: NodeManager;\n\n @inject(NodeEngineContext) context: NodeEngineContext;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\n\nimport { NodeManager } from './node-manager';\nimport { NodeEngineContext } from './node-engine-context';\nimport { NodeEngine } from './node-engine';\n\nexport const NodeContainerModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n bind(NodeEngine).toSelf().inSingletonScope();\n bind(NodeManager).toSelf().inSingletonScope();\n bind(NodeEngineContext).toSelf().inSingletonScope();\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const PLUGIN_KEY = {\n FORM: 'Plugin_Form',\n ERROR: 'Plugin_Error',\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const MATERIAL_KEY = {\n NODE_ERROR_RENDER: 'node_error_render',\n NODE_PLACEHOLDER_RENDER: 'node_placeholder_render',\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { EntityData } from '@flowgram-vue/core';\n\nexport interface ErrorData {\n error: Error | null;\n}\n\nexport class FlowNodeErrorData extends EntityData {\n static type = 'FlowNodeErrorData';\n\n getDefaultData(): ErrorData {\n return { error: null };\n }\n\n setError(e: ErrorData['error']) {\n this.update({ error: e });\n }\n\n getError(): Error {\n return this.data.error;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodeErrorRenderProps } from '../types';\n\nconst ERROR_STYLE = {\n color: '#f54a45',\n};\n\nexport const defaultErrorRender = ({ error }: NodeErrorRenderProps) =>\n h('div', { style: ERROR_STYLE }, error.message);\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, onBeforeUnmount, type PropType } from 'vue';\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { PlaygroundContext, useRefresh, useService, PluginContext } from '@flowgram-vue/core';\n\nimport { FlowNodeErrorData } from '../flow-node-error-data';\nimport { MATERIAL_KEY, NodeManager } from '../../node';\nimport { defaultErrorRender } from './default-error-render';\n\nexport default defineComponent({\n name: 'ErrorRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n playgroundContext: { type: Object as PropType<PlaygroundContext>, required: true },\n clientContext: { type: Object as PropType<PluginContext>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const nodeErrorData = props.node.getData<FlowNodeErrorData>(FlowNodeErrorData);\n const nodeManager = useService<NodeManager>(NodeManager);\n const nodeErrorRender = nodeManager.getMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER);\n\n const disposable = nodeErrorData.onDataChange(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return () => {\n const nodeError = nodeErrorData.getError();\n if (!nodeError) {\n return null;\n }\n if (!nodeErrorRender) {\n return defaultErrorRender({\n error: nodeError,\n context: {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n },\n });\n }\n return nodeErrorRender({\n error: nodeError,\n context: {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n },\n });\n };\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodePluginRender } from '../../node';\nimport ErrorRender from './ErrorRender.vue';\n\nexport { default as ErrorRender } from './ErrorRender.vue';\nexport { defaultErrorRender } from './default-error-render';\n\nexport const errorPluginRender: NodePluginRender = (props) =>\n h(ErrorRender, {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n });\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nimport { NodeContribution } from '../node';\nimport { NodeManager, PLUGIN_KEY } from '../node';\nimport { errorPluginRender } from './renders';\n\n@injectable()\nexport class ErrorNodeContribution implements NodeContribution {\n onRegister(nodeManager: NodeManager) {\n nodeManager.registerPluginRender(PLUGIN_KEY.ERROR, errorPluginRender);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { bindContributions } from '@flowgram-vue/utils';\n\nimport { NodeContribution } from '../node';\nimport { ErrorNodeContribution } from './error-node-contribution';\n\nexport const ErrorContainerModule = new ContainerModule(bind => {\n bindContributions(bind, ErrorNodeContribution, [NodeContribution]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FlowNodeErrorData } from './flow-node-error-data';\n\nexport function getNodeError(node: FlowNodeEntity) {\n return node.getData<FlowNodeErrorData>(FlowNodeErrorData).getError();\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\nimport { injectPlaygroundContext, PlaygroundContext } from '@flowgram-vue/core';\n\nimport { NodeEngineContext } from '../../node/node-engine-context';\nimport { FormItem } from '../models/form-item';\nimport { type FormItemMaterialContext } from '../models/form-item-material-context';\n\n@injectable()\nexport class FormContextMaker {\n @inject(NodeEngineContext) readonly nodeEngineContext: NodeEngineContext;\n\n @injectPlaygroundContext() readonly playgroundContext: PlaygroundContext;\n\n makeFormItemMaterialContext(\n formItem: FormItem,\n options?: { getIndex: () => number | undefined }\n ): FormItemMaterialContext {\n return {\n meta: formItem.meta,\n path: formItem.path,\n readonly: this.nodeEngineContext.readonly,\n getFormItemValueByPath: formItem.formModel.getFormItemValueByPath.bind(formItem.formModel),\n onFormValidate: formItem.formModel.onValidate.bind(formItem.formModel),\n form: formItem.formModel,\n node: formItem.formModel.flowNodeEntity,\n playgroundContext: this.playgroundContext,\n index: options?.getIndex(),\n };\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\n@injectable()\nexport class FormPathService {\n static readonly ROOT = '/';\n\n static readonly DIVIDER = '/';\n\n static readonly RELATIVE_PARENT = '..';\n\n static readonly RELATIVE_CURRENT = '.';\n\n static readonly ARRAY = '[]';\n\n static normalize(path: string) {\n if (path === FormPathService.ROOT) {\n return path;\n }\n // 去掉末尾的斜杠\n if (path.endsWith(FormPathService.DIVIDER)) {\n path = path.slice(0, -1);\n }\n return path;\n }\n\n static join(paths: string[]): string {\n if (paths[1].startsWith(FormPathService.ROOT)) {\n throw new Error(\n `FormPathService Error: join failed, invalid paths[1], paths[1]= ${paths[1]}`,\n );\n }\n if (paths[0].endsWith(FormPathService.DIVIDER)) {\n return `${paths[0]}${paths[1]}`;\n }\n return paths.join(FormPathService.DIVIDER);\n }\n\n static toArrayPath(path: string): string {\n return FormPathService.join([path, FormPathService.ARRAY]);\n }\n\n static parseArrayItemPath(path: string) {\n const names = path.split('/');\n\n let i = 0;\n while (i < names.length) {\n const itemIndex = parseInt(names[i]);\n\n if (!isNaN(itemIndex)) {\n const arrayPath = FormPathService.toArrayPath(\n names.slice(0, i).join(FormPathService.DIVIDER),\n );\n const restPath = names.slice(i + 1).join(FormPathService.DIVIDER);\n const itemMetaPath = FormPathService.join([arrayPath, restPath]);\n return { itemIndex, arrayPath, itemMetaPath };\n }\n i = i + 1;\n }\n return null;\n }\n\n simplify(path: string) {\n const segments = path.split(FormPathService.DIVIDER);\n const resSegments: string[] = [];\n\n for (let i = 0; i < segments.length; i++) {\n if (!segments[i]) {\n throw new Error('FormPathService: join failed');\n }\n\n if (segments[i] === FormPathService.RELATIVE_CURRENT) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (segments[i] === FormPathService.RELATIVE_PARENT) {\n resSegments.pop();\n }\n resSegments.push(segments[i]);\n }\n return resSegments.join(FormPathService.DIVIDER);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { DisposableCollection, Event, MaybePromise } from '@flowgram-vue/utils';\nimport { type FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FormFeedback, FormModelValid, IFormItem } from '../types';\nimport { type FormManager } from '../services/form-manager';\nimport { type FormItem } from './form-item';\n\nexport type FormModelFactory = (entity: FlowNodeEntity) => FormModel;\nexport const FormModelFactory = Symbol('FormModelFactory');\nexport const FormModelEntity = Symbol('FormModelEntity');\n\n@injectable()\nexport abstract class FormModel {\n readonly onValidate: Event<FormModel>;\n\n readonly onValidChange: Event<FormModelValid>;\n\n readonly onFeedbacksChange: Event<FormFeedback[]>;\n\n readonly onInitialized: Event<FormModel>;\n\n protected toDispose: DisposableCollection = new DisposableCollection();\n\n /**\n * @deprecated\n * use `formModel.node` instead in FormModelV2\n */\n abstract get flowNodeEntity(): FlowNodeEntity;\n\n /**\n * @deprecated\n */\n abstract get formManager(): FormManager;\n\n abstract get formMeta(): any;\n\n abstract get initialized(): boolean;\n\n abstract get valid(): FormModelValid;\n\n abstract updateFormValues(value: any): void;\n\n /**\n * @deprecated\n * use `formModel.getFieldIn` instead in FormModelV2 to get the model of a form field\n * do not use this in FormModelV2 since it only return an empty Map.\n */\n abstract get formItemPathMap(): Map<string, IFormItem>;\n\n /**\n * @deprecated\n */\n abstract clearValid(): void;\n\n abstract validate(): Promise<boolean>;\n\n abstract validateWithFeedbacks(): Promise<FormFeedback[]>;\n\n abstract init(formMetaOrFormMetaGenerator: any, initialValue?: any): MaybePromise<void>;\n\n abstract toJSON(): any;\n\n /**\n * @deprecated\n * use `formModel.getField` instead in FormModelV2\n */\n abstract getFormItemByPath(path: string): FormItem | undefined;\n\n /**\n * @deprecated\n * use `formModel.getFieldValue` instead in FormModelV2 to get the model of a form field by path\n */\n abstract getFormItemValueByPath<T = any>(path: string): any | undefined;\n\n abstract render(): any;\n\n abstract dispose(): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DisposableCollection, Emitter } from '@flowgram-vue/utils';\n\nimport { type FormItemDomRef, type IFormItemMeta } from '../types';\nimport { type FormModel } from './form-model';\n\nexport abstract class FormItem {\n readonly meta: IFormItemMeta;\n\n readonly path: string;\n\n readonly formModel: FormModel;\n\n readonly onInitEventEmitter = new Emitter<FormItem>();\n\n readonly onInit = this.onInitEventEmitter.event;\n\n protected toDispose: DisposableCollection = new DisposableCollection();\n\n readonly onDispose = this.toDispose.onDispose;\n\n // todo(heyuan): 将dom 相关逻辑拆到form item插件里\n private _domRef: FormItemDomRef;\n\n protected constructor(meta: IFormItemMeta, path: string, formModel: FormModel) {\n this.meta = meta;\n this.path = path;\n this.formModel = formModel;\n this.toDispose.push(this.onInitEventEmitter);\n }\n\n abstract get value(): any;\n\n abstract set value(value: any);\n\n abstract validate(): void;\n\n set domRef(domRef: FormItemDomRef) {\n this._domRef = domRef;\n }\n\n get domRef() {\n return this._domRef;\n }\n\n dispose(): void {\n this.toDispose.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type IFormItemMeta, type IFormMeta, type IFormMetaOptions } from '../types';\nimport { FormPathService } from '../services';\n\nexport interface FormMetaTraverseParams {\n formItemMeta: IFormItemMeta;\n parentPath?: string;\n handle: (params: { formItemMeta: IFormItemMeta; path: string }) => any;\n}\n\nexport class FormMeta implements IFormMeta {\n constructor(root: IFormItemMeta, options: IFormMetaOptions) {\n this._root = root;\n this._options = options;\n }\n\n protected _root: IFormItemMeta;\n\n get root(): IFormItemMeta {\n return this._root;\n }\n\n protected _options: IFormMetaOptions;\n\n get options(): IFormMetaOptions {\n return this._options;\n }\n\n static traverse({ formItemMeta, parentPath = '', handle }: FormMetaTraverseParams): void {\n if (!formItemMeta) {\n return;\n }\n\n const isRoot = !parentPath;\n\n const path = isRoot\n ? FormPathService.ROOT\n : formItemMeta.name\n ? FormPathService.join([parentPath, formItemMeta.name])\n : parentPath;\n\n handle({ formItemMeta, path });\n\n if (formItemMeta.items) {\n this.traverse({\n formItemMeta: formItemMeta.items,\n handle,\n parentPath: FormPathService.toArrayPath(path),\n });\n }\n\n if (formItemMeta.children && formItemMeta.children.length) {\n formItemMeta.children.forEach((child) => {\n this.traverse({ formItemMeta: child, handle, parentPath: path });\n });\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nexport interface Extension {\n key: string;\n}\n@injectable()\nexport class FormAbilityExtensionRegistry {\n protected registry = new Map<string, Extension>();\n\n register(extension: Extension): void {\n this.registry.set(extension.key, extension);\n }\n\n get<T extends Extension>(key: string): T | undefined {\n return this.registry.get(key) as T | undefined;\n }\n\n get objectMap(): Record<string, Extension> {\n return Object.fromEntries(this.registry);\n }\n\n get collection(): Extension[] {\n return Array.from(this.registry.values());\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FormManager } from './services/form-manager';\n\nexport const FormContribution = Symbol('FormContribution');\n\nexport interface FormContribution {\n onRegister?(formManager: FormManager): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class SetterAbility implements FormItemAbility {\n static readonly type = 'setter';\n\n get type(): string {\n return SetterAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class DecoratorAbility implements FormItemAbility {\n static readonly type = 'decorator';\n\n get type(): string {\n return DecoratorAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport interface VisibilityAbilityOptions {\n /**\n * 是否隐藏\n */\n hidden: string | boolean;\n /**\n * 隐藏是否要清空表单值, 默认为false\n */\n clearWhenHidden?: boolean;\n}\n\nexport class VisibilityAbility implements FormItemAbility {\n static readonly type = 'visibility';\n\n get type(): string {\n return VisibilityAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class EffectAbility implements FormItemAbility {\n static readonly type = 'effect';\n\n get type(): string {\n return EffectAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class DefaultAbility implements FormItemAbility {\n static readonly type = 'default';\n\n get type(): string {\n return DefaultAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class ValidationAbility implements FormItemAbility {\n static readonly type = 'validation';\n\n get type(): string {\n return ValidationAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mapValues } from 'lodash-es';\nimport { inject, injectable, multiInject, optional, postConstruct } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\nimport { injectPlaygroundContext, PlaygroundContext } from '@flowgram-vue/core';\n\nimport { AbilityClass, FormItemAbility } from '../models/form-item-ability';\nimport { FormAbilityExtensionRegistry, FormModel } from '../models';\nimport { FormContribution } from '../form-contribution';\nimport {\n DecoratorAbility,\n DecoratorExtension,\n SetterAbility,\n SetterExtension,\n SetterHoc,\n} from '../abilities';\nimport { FormContextMaker } from './form-context-maker';\nimport { FormPathService } from './form-path-service';\n\n@injectable()\nexport class FormManager {\n readonly abilityRegistry: Map<string, FormItemAbility> = new Map();\n\n readonly setterHocs: SetterHoc[] = [];\n\n readonly extensionRegistryMap: Map<string, FormAbilityExtensionRegistry> = new Map();\n\n @inject(FormPathService) readonly pathManager: FormPathService;\n\n @inject(FormContextMaker) readonly formContextMaker: FormContextMaker;\n\n @injectPlaygroundContext() readonly playgroundContext: PlaygroundContext;\n\n @multiInject(FormContribution) @optional() protected formContributions: FormContribution[] = [];\n\n private readonly onFormModelWillInitEmitter = new Emitter<{\n model: FormModel;\n data: any;\n }>();\n\n readonly onFormModelWillInit = this.onFormModelWillInitEmitter.event;\n\n get components(): Record<string, any> {\n return mapValues(\n this.extensionRegistryMap.get(SetterAbility.type)?.objectMap || {},\n (setter: SetterExtension) => setter.component\n );\n }\n\n get decorators(): Record<string, any> {\n return mapValues(\n this.extensionRegistryMap.get(DecoratorAbility.type)?.objectMap || {},\n (decorator: DecoratorExtension) => decorator.component\n );\n }\n\n registerAbilityExtension(type: string, extension: any): void {\n if (!this.extensionRegistryMap.get(type)) {\n this.extensionRegistryMap.set(type, new FormAbilityExtensionRegistry());\n }\n const registry = this.extensionRegistryMap.get(type);\n if (!registry) {\n return;\n }\n registry.register(extension);\n }\n\n getAbilityExtension(abilityType: string, extensionKey: string): any {\n return this.extensionRegistryMap.get(abilityType)?.get(extensionKey);\n }\n\n registerAbility(Ability: AbilityClass): void {\n const ability = new Ability();\n this.abilityRegistry.set(ability.type, ability);\n }\n\n registerAbilities(Abilities: AbilityClass[]): void {\n Abilities.forEach(this.registerAbility.bind(this));\n }\n\n getAbility<ExtendAbility>(type: string): (FormItemAbility & ExtendAbility) | undefined {\n return this.abilityRegistry.get(type) as FormItemAbility & ExtendAbility;\n }\n\n /**\n * @deprecated\n * Setter Hoc and setter are no longer supported in NodeEngineV2\n * @param hoc\n */\n registerSetterHoc(hoc: SetterHoc): void {\n this.setterHocs.push(hoc);\n }\n\n fireFormModelWillInit(model: FormModel, data: any) {\n this.onFormModelWillInitEmitter.fire({\n model,\n data,\n });\n }\n\n dispose() {\n this.onFormModelWillInitEmitter.dispose();\n }\n\n @postConstruct()\n protected init(): void {\n this.formContributions.forEach((contrib) => contrib.onRegister?.(this));\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Disposable, Emitter } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { EntityData } from '@flowgram-vue/core';\n\nimport { FlowNodeErrorData } from '../error';\nimport { FormMetaOrFormMetaGenerator } from './types';\nimport { FormModel, type FormModelFactory } from './models';\n\ninterface Options {\n formModelFactory: FormModelFactory;\n}\n\nexport interface DetailChangeEvent {\n path: string;\n oldValue: any;\n value: any;\n initialized: boolean;\n}\n\nexport interface OnFormValuesChangePayload {\n values: any;\n prevValues: any;\n name: string;\n}\n\nexport class FlowNodeFormData extends EntityData {\n static type = 'FlowNodeEntityFormData';\n\n readonly formModel: FormModel;\n\n protected flowNodeEntity: FlowNodeEntity;\n\n /**\n * @deprecated rehaje 版表单form Values change 事件\n * @protected\n */\n protected onDetailChangeEmitter = new Emitter<DetailChangeEvent>();\n\n /**\n * @deprecated 该方法为旧版引擎(rehaje)表单数据变更事件, 新版节点引擎请使用\n * this.getFormModel<FormModelV2>().onFormValuesChange.\n * @protected\n */\n readonly onDetailChange = this.onDetailChangeEmitter.event;\n\n constructor(entity: FlowNodeEntity, opts: Options) {\n super(entity);\n\n this.flowNodeEntity = entity;\n this.formModel = opts.formModelFactory(entity);\n\n this.toDispose.push(this.onDetailChangeEmitter);\n\n this.toDispose.push(\n Disposable.create(() => {\n this.formModel.dispose();\n })\n );\n }\n\n getFormModel<TFormModel>(): TFormModel {\n // @ts-ignore\n return this.formModel as TFormModel;\n }\n\n getDefaultData(): any {\n return {};\n }\n\n createForm(formMetaOrFormMetaGenerator: any, initialValue?: any): void {\n const errorData = this.flowNodeEntity.getData<FlowNodeErrorData>(FlowNodeErrorData);\n\n errorData.setError(null);\n try {\n this.formModel.init(formMetaOrFormMetaGenerator, initialValue);\n } catch (e) {\n errorData.setError(e as Error);\n }\n }\n\n updateFormValues(value: any) {\n this.formModel.updateFormValues(value);\n }\n\n recreateForm(formMetaOrFormMetaGenerator: FormMetaOrFormMetaGenerator, initialValue?: any): void {\n this.createForm(formMetaOrFormMetaGenerator, initialValue);\n }\n\n toJSON(): any {\n return this.formModel.toJSON();\n }\n\n dispose(): void {\n super.dispose();\n }\n\n /**\n * @deprecated rehaje 版表单form Values change 事件触发函数\n * @protected\n */\n fireDetaiChange(detailChangeEvent: DetailChangeEvent) {\n this.onDetailChangeEmitter.fire(detailChangeEvent);\n }\n}\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, onBeforeUnmount, type PropType } from 'vue';\n\nimport { useRefresh } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FormModel } from './models';\nimport { FlowNodeFormData } from './flow-node-form-data';\n\nfunction getFormModelFromNode(node: FlowNodeEntity) {\n return node.getData(FlowNodeFormData)?.getFormModel<FormModel>();\n}\n\nexport default defineComponent({\n name: 'FormRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const formModel = getFormModelFromNode(props.node);\n\n if (formModel) {\n const disposable = formModel.onInitialized(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n }\n\n return () => (formModel?.initialized ? formModel.render() : null);\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodeContext } from '../node';\nimport FormRender from './FormRender.vue';\n\nexport { default as FormRender } from './FormRender.vue';\n\nexport const formPluginRender = (props: NodeContext) => h(FormRender, { node: props.node });\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nimport { NodeContribution, NodeManager, PLUGIN_KEY } from '../node';\nimport { formPluginRender } from './form-render';\n\n@injectable()\nexport class FormNodeContribution implements NodeContribution {\n onRegister(nodeManager: NodeManager) {\n nodeManager.registerPluginRender(PLUGIN_KEY.FORM, formPluginRender);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { bindContributions } from '@flowgram-vue/utils';\n\nimport { FormContextMaker } from './services/form-context-maker';\nimport { NodeContribution } from '../node';\nimport { FormManager, FormPathService } from './services';\nimport { FormNodeContribution } from './form-node-contribution';\n\nexport const FormCoreContainerModule = new ContainerModule((bind) => {\n bind(FormManager).toSelf().inSingletonScope();\n bind(FormPathService).toSelf().inSingletonScope();\n bind(FormContextMaker).toSelf().inSingletonScope();\n bindContributions(bind, FormNodeContribution, [NodeContribution]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport interface IFormItem<T = any> {\n value: T;\n}\n\nexport enum FormItemEventName {\n onFormValueChange = 'onFormValueChange',\n onFormItemInit = 'onFormItemInit',\n}\n\nexport type FormModelValid = boolean | null;\n\nexport type FeedbackStatus = 'error' | 'warning' | 'pending';\nexport type FeedbackText = string;\n\nexport interface FormItemFeedback {\n feedbackStatus?: FeedbackStatus;\n feedbackText?: FeedbackText;\n}\n\nexport interface FormFeedback {\n feedbackStatus?: FeedbackStatus;\n feedbackText?: FeedbackText;\n path: string;\n}\n\nexport interface FormItemDomRef {\n current: HTMLElement | null;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MaybePromise } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { PlaygroundContext, PluginContext } from '@flowgram-vue/core';\n\nimport { type FormItemAbilityMeta } from './form-ability.types';\n\nexport type FormDataTypeName =\n | 'string'\n | 'number'\n | 'integer'\n | 'boolean'\n | 'object'\n | 'array'\n | 'null';\n\nexport type FormDataType =\n | string //\n | number\n | boolean\n | FormDataObject\n | DataArray\n | null;\n\nexport interface FormDataObject {\n [key: string]: FormDataType;\n}\n\nexport type DataArray = Array<FormDataType>;\n\nexport const FORM_VOID = 'form-void' as const;\n\nexport interface TreeNode<T> {\n name: string;\n children?: TreeNode<T>[];\n}\n\nexport interface IFormItemMeta extends TreeNode<IFormItemMeta> {\n /**\n * 表单项名称\n */\n name: string;\n /**\n * 数据类型\n */\n type: FormDataTypeName | typeof FORM_VOID;\n /**\n * 枚举值\n */\n enum?: FormDataType[];\n /**\n * 数组类型item的数据类型描述\n */\n items?: IFormItemMeta;\n /**\n * 表单项标题\n */\n title?: string;\n /**\n * 表单项描述\n */\n description?: string;\n /**\n * 表单项默认值\n */\n default?: FormDataType;\n /**\n * 是否必填\n */\n required?: boolean;\n /**\n * 扩展能力\n */\n abilities?: FormItemAbilityMeta[];\n\n /**\n * 子表单项\n */\n children?: IFormItemMeta[];\n}\n\nexport interface IFormMeta {\n /**\n * 表单树结构root\n */\n root?: IFormItemMeta;\n /**\n * 表单全局配置\n */\n options?: IFormMetaOptions;\n}\n\nexport interface NodeFormContext {\n node: FlowNodeEntity;\n playgroundContext: PlaygroundContext;\n clientContext: PluginContext & Record<string, any>;\n}\n\nexport interface IFormMetaOptions {\n formatOnInit?: (value: any, context: NodeFormContext) => any;\n\n formatOnSubmit?: (value: any, context: NodeFormContext) => any;\n\n [key: string]: any;\n}\n\nexport interface FormMetaGeneratorParams<PlaygroundContext, FormValue = any> {\n node: FlowNodeEntity;\n playgroundContext: PlaygroundContext;\n initialValue?: FormValue;\n}\n\nexport type FormMetaGenerator<PlaygroundContext = any, FormValue = any> = (\n params: FormMetaGeneratorParams<FormValue, FormValue>\n) => MaybePromise<IFormMeta>;\n\nexport type FormMetaOrFormMetaGenerator = FormMetaGenerator | IFormMeta;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FlowNodeFormData } from '../flow-node-form-data';\nimport { FormModel } from '../models';\n\nexport function isNodeFormReady(node: FlowNodeEntity) {\n return node.getData<FlowNodeFormData>(FlowNodeFormData).getFormModel<FormModel>().initialized;\n}\n\nexport function getFormModel(node: FlowNodeEntity) {\n return node.getData<FlowNodeFormData>(FlowNodeFormData).formModel;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { NodeContainerModule } from '../node/node-container-module';\nimport { FormCoreContainerModule } from '../form';\nimport { ErrorContainerModule } from '../error';\n\nexport function createNodeContainerModules() {\n return [NodeContainerModule, FormCoreContainerModule, ErrorContainerModule];\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { InjectionKey } from 'vue';\nimport { inject, provide } from 'vue';\n\nimport { INodeEngineContext, NodeEngineContext } from '../../node';\n\nexport const NodeEngineVueContextKey: InjectionKey<INodeEngineContext> = Symbol(\n 'NodeEngineVueContext'\n);\n\nexport function provideNodeEngineContext(ctx: INodeEngineContext): void {\n provide(NodeEngineVueContextKey, ctx);\n}\n\nexport function useNodeEngineVueContext(): INodeEngineContext {\n return inject(NodeEngineVueContextKey, NodeEngineContext.DEFAULT_JSON);\n}\n\n/** @deprecated use NodeEngineVueContextKey */\nexport const NodeEngineVueContext = NodeEngineVueContextKey;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount } from 'vue';\n\nimport { useService, useRefresh } from '@flowgram-vue/core';\n\nimport { NodeEngineContext } from '../../node';\n\nexport function useNodeEngineContext(): NodeEngineContext {\n const refresh = useRefresh();\n const nodeEngineContext = useService<NodeEngineContext>(NodeEngineContext);\n\n const disposable = nodeEngineContext.onChange(() => {\n refresh();\n });\n\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return nodeEngineContext;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount } from 'vue';\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { useEntityFromContext, useRefresh } from '@flowgram-vue/core';\n\nimport { FlowNodeFormData, FormModel, IFormItem } from '../../form';\n\nexport function useFormItem(path: string): IFormItem | undefined {\n const refresh = useRefresh();\n const node = useEntityFromContext<FlowNodeEntity>();\n const formData = node.getData<FlowNodeFormData>(FlowNodeFormData);\n const formItem = formData.getFormModel<FormModel>().getFormItemByPath(path);\n\n const disposable = formData.onDataChange(() => {\n refresh();\n });\n\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return formItem;\n}\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, h, onBeforeUnmount, provide, type PropType } from 'vue';\n\nimport { PlaygroundContext, useRefresh, useService, PluginContext } from '@flowgram-vue/core';\nimport type { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { NodeEngineVueContextKey } from '../node-vue/context/node-engine-vue-context';\nimport { useNodeEngineContext } from '../node-vue';\nimport { NodeManager } from '../node/node-manager';\nimport { PLUGIN_KEY } from '../node/core-plugins';\nimport { MATERIAL_KEY } from '../node';\nimport { getFormModel, isNodeFormReady } from '../form';\nimport { FlowNodeErrorData } from '../error/flow-node-error-data';\nimport { getNodeError } from '../error';\n\nexport default defineComponent({\n name: 'NodeRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const playgroundContext = useService<PlaygroundContext>(PlaygroundContext);\n const clientContext = useService<PluginContext>(PluginContext);\n const nodeManager = useService<NodeManager>(NodeManager);\n const nodeEngineContext = useNodeEngineContext();\n\n const nodeFormRender = nodeManager.getPluginRender(PLUGIN_KEY.FORM);\n const nodeErrorRender = nodeManager.getPluginRender(PLUGIN_KEY.ERROR);\n const nodePlaceholderRender = nodeManager.getMaterialRender(\n MATERIAL_KEY.NODE_PLACEHOLDER_RENDER\n );\n\n const nodeErrorData = props.node.getData<FlowNodeErrorData>(FlowNodeErrorData);\n const formModel = getFormModel(props.node);\n\n const errorDisposable = nodeErrorData.onDataChange(() => {\n refresh();\n });\n const formDisposable = formModel.onInitialized(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n errorDisposable.dispose();\n formDisposable.dispose();\n });\n\n provide(NodeEngineVueContextKey, nodeEngineContext.json);\n\n return () => {\n const isNodeError = !!getNodeError(props.node);\n const isFormReady = isNodeFormReady(props.node);\n\n const renderContent = () => {\n if (isNodeError) {\n return nodeErrorRender!({ node: props.node, playgroundContext, clientContext });\n }\n if (!formModel.formMeta) {\n return null;\n }\n if (isFormReady) {\n return nodeFormRender!({ node: props.node, playgroundContext, clientContext });\n }\n return nodePlaceholderRender?.({ node: props.node, playgroundContext }) || null;\n };\n\n const Wrapped = nodeManager.nodeRenderHoc(renderContent);\n return typeof Wrapped === 'function' ? (Wrapped as () => any)() : h(Wrapped as any);\n };\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MATERIAL_KEY } from '../node/core-materials';\nimport { NodeManager, NodePlaceholderRender, Render } from '../node';\n\nexport function registerNodeErrorRender(nodeManager: NodeManager, render: Render): void {\n nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER, render);\n}\n\nexport function registerNodePlaceholderRender(\n nodeManager: NodeManager,\n render: NodePlaceholderRender,\n): void {\n nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_PLACEHOLDER_RENDER, render);\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { EntityDataRegistry } from '@flowgram-vue/core';\n\nimport { FlowNodeFormData } from '../form';\nimport { FlowNodeErrorData } from '../error';\n\nexport function createNodeEntityDatas(): EntityDataRegistry[] {\n return [FlowNodeFormData, FlowNodeErrorData];\n}\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/index';
|
package/dist/index.js
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/node/node-contribution.ts","../src/node/node-manager.ts","../src/node/node-engine-context.ts","../src/node/node-engine.ts","../src/node/node-container-module.ts","../src/node/core-plugins.ts","../src/node/core-materials.ts","../src/error/flow-node-error-data.ts","../src/error/renders/default-error-render.ts","../src/error/renders/ErrorRender.vue","../src/error/renders/error-render.ts","../src/error/error-node-contribution.ts","../src/error/error-container-module.ts","../src/error/client.ts","../src/form/services/form-context-maker.ts","../src/form/services/form-path-service.ts","../src/form/models/form-model.ts","../src/form/models/form-item.ts","../src/form/models/form-meta.ts","../src/form/models/form-ability-extension-registry.ts","../src/form/form-contribution.ts","../src/form/abilities/setter-ability/setter-ability.ts","../src/form/abilities/decorator-ability/decorator-ability.ts","../src/form/abilities/visibility-ability/visibility-ability.ts","../src/form/abilities/effect-ability/effect-ability.ts","../src/form/abilities/default-ability/default-ability.ts","../src/form/abilities/validation-ability/validation-ability.ts","../src/form/services/form-manager.ts","../src/form/flow-node-form-data.ts","../src/form/FormRender.vue","../src/form/form-render.ts","../src/form/form-node-contribution.ts","../src/form/form-core-container-module.ts","../src/form/types/form-model.types.ts","../src/form/types/form-meta.types.ts","../src/form/client/index.ts","../src/client/create-node-container-modules.ts","../src/node-vue/context/node-engine-vue-context.ts","../src/node-vue/composables/use-node-engine-context.ts","../src/node-vue/composables/use-form-item.ts","../src/client/NodeRender.vue","../src/client/node-material-client.ts","../src/client/create-node-entity-datas.ts"],"names":["MaterialRenderKey","injectable","h","ContainerModule","inject","Emitter","DisposableCollection","injectPlaygroundContext","multiInject","optional","postConstruct","EntityData","_sfc_main","defineComponent","useRefresh","onBeforeUnmount","bindContributions","FormItemEventName","useService","PlaygroundContext","provide"],"mappings":";;;;;;;;;;;;;;;;;;;AAOO,IAAM,gBAAA,0BAA0B,kBAAkB;ACKlD,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,iBAAA,CAAA,GAAkB,0BAAA;A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M,IAAI,CAAA;AAE9C,MAAA,MAAM,gBAAgB,MAAM;AAC1B,QAAA,IAAI,WAAA,EAAa;AACf,UAAA,OAAO,gBAAiB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,eAAe,CAAA;AAChF,QAAA;AACA,QAAA,IAAI,CAAC,UAAU,QAAA,EAAU;AACvB,UAAA,OAAO,IAAA;AACT,QAAA;AACA,QAAA,IAAI,WAAA,EAAa;AACf,UAAA,OAAO,eAAgB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,eAAe,CAAA;AAC/E,QAAA;AACA,QAAA,OAAO,wBAAwB,EAAE,IAAA,EAAM,MAAM,IAAA,EAAM,iBAAA,EAAmB,CAAA,IAAK,IAAA;AAC7E,MAAA,CAAA;AAEA,MAAA,MAAM,OAAA,GAAU,WAAA,CAAY,aAAA,CAAc,aAAa,CAAA;AACvD,MAAA,OAAO,OAAO,OAAA,KAAY,UAAA,GAAc,OAAA,EAAsB,GAAIlB,EAAE,OAAc,CAAA;AACpF,IAAA,CAAA;AACF,EAAA;AACF,CAAC,CAAA;;;;AClEM,SAAS,uBAAA,CAAwB,aAA0B,MAAA,EAAsB;AACtF,EAAA,WAAA,CAAY,sBAAA,CAAuB,YAAA,CAAa,iBAAA,EAAmB,MAAM,CAAA;AAC3E;AAEO,SAAS,6BAAA,CACd,aACA,MAAA,EACM;AACN,EAAA,WAAA,CAAY,sBAAA,CAAuB,YAAA,CAAa,uBAAA,EAAyB,MAAM,CAAA;AACjF;;;ACPO,SAAS,qBAAA,GAA8C;AAC5D,EAAA,OAAO,CAAC,kBAAkB,iBAAiB,CAAA;AAC7C","file":"index.js","sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type NodeManager } from './node-manager';\n\nexport const NodeContribution = Symbol('NodeContribution');\n\nexport interface NodeContribution {\n onRegister?(nodeManager: NodeManager): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { flow } from 'lodash-es';\nimport { injectable, multiInject, optional, postConstruct } from 'inversify';\n\nimport { NodeErrorRenderProps } from '../error';\nimport { NodePluginRender, NodeRenderHoc, Render } from './types';\nimport { NodeContribution } from './node-contribution';\n\nexport enum MaterialRenderKey {\n CustomNodeError = 'Material_CustomNodeError',\n}\n\n@injectable()\nexport class NodeManager {\n readonly materialRenderRegistry: Map<string, Render> = new Map();\n\n readonly pluginRenderRegistry: Map<string, Render> = new Map();\n\n readonly nodeRenderHocs: NodeRenderHoc[] = [];\n\n @multiInject(NodeContribution) @optional() protected nodeContributions: NodeContribution[] = [];\n\n registerMaterialRender(key: string, render: Render) {\n this.materialRenderRegistry.set(key, render);\n }\n\n getMaterialRender(key: string): Render | undefined {\n return this.materialRenderRegistry.get(key);\n }\n\n registerPluginRender(key: string, render: NodePluginRender): void {\n this.pluginRenderRegistry.set(key, render);\n }\n\n getPluginRender(key: string): NodePluginRender | undefined {\n return this.pluginRenderRegistry.get(key);\n }\n\n registerNodeErrorRender(render: Render<NodeErrorRenderProps>) {\n this.registerMaterialRender(MaterialRenderKey.CustomNodeError, render);\n }\n\n get nodeRenderHoc() {\n return flow(this.nodeRenderHocs);\n }\n\n registerNodeRenderHoc(hoc: NodeRenderHoc) {\n this.nodeRenderHocs.push(hoc);\n }\n\n get nodeErrorRender() {\n return this.materialRenderRegistry.get(MaterialRenderKey.CustomNodeError);\n }\n\n @postConstruct()\n protected init(): void {\n this.nodeContributions.forEach((contrib) => contrib.onRegister?.(this));\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\n\nexport interface INodeEngineContext {\n readonly: boolean;\n}\n\n/**\n * NodeEngineContext 在 Node Engine 中为全局单例, 它的作用是让Node之间共享数据。\n * context 分为内置context(如 readonly) 和 自定义context(业务可以按需注入)\n */\n@injectable()\nexport class NodeEngineContext {\n static DEFAULT_READONLY = false;\n\n static DEFAULT_JSON = { readonly: NodeEngineContext.DEFAULT_READONLY };\n\n readonly onChangeEmitter = new Emitter<NodeEngineContext>();\n\n readonly onChange = this.onChangeEmitter.event;\n\n private _readonly: boolean = NodeEngineContext.DEFAULT_READONLY;\n\n private _json: INodeEngineContext = NodeEngineContext.DEFAULT_JSON;\n\n get json(): INodeEngineContext {\n return this._json;\n }\n\n get readonly(): boolean {\n return this._readonly;\n }\n\n set readonly(value: boolean) {\n this._readonly = value;\n this.fireChange();\n }\n\n private fireChange(): void {\n this.updateJSON();\n this.onChangeEmitter.fire(this);\n }\n\n private updateJSON(): void {\n this._json = {\n readonly: this._readonly,\n };\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\n\nimport { NodeManager } from './node-manager';\nimport { NodeEngineContext } from './node-engine-context';\n\n@injectable()\nexport class NodeEngine {\n @inject(NodeManager) nodeManager: NodeManager;\n\n @inject(NodeEngineContext) context: NodeEngineContext;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\n\nimport { NodeManager } from './node-manager';\nimport { NodeEngineContext } from './node-engine-context';\nimport { NodeEngine } from './node-engine';\n\nexport const NodeContainerModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n bind(NodeEngine).toSelf().inSingletonScope();\n bind(NodeManager).toSelf().inSingletonScope();\n bind(NodeEngineContext).toSelf().inSingletonScope();\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const PLUGIN_KEY = {\n FORM: 'Plugin_Form',\n ERROR: 'Plugin_Error',\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const MATERIAL_KEY = {\n NODE_ERROR_RENDER: 'node_error_render',\n NODE_PLACEHOLDER_RENDER: 'node_placeholder_render',\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { EntityData } from '@flowgram-vue/core';\n\nexport interface ErrorData {\n error: Error | null;\n}\n\nexport class FlowNodeErrorData extends EntityData {\n static type = 'FlowNodeErrorData';\n\n getDefaultData(): ErrorData {\n return { error: null };\n }\n\n setError(e: ErrorData['error']) {\n this.update({ error: e });\n }\n\n getError(): Error {\n return this.data.error;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodeErrorRenderProps } from '../types';\n\nconst ERROR_STYLE = {\n color: '#f54a45',\n};\n\nexport const defaultErrorRender = ({ error }: NodeErrorRenderProps) =>\n h('div', { style: ERROR_STYLE }, error.message);\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, onBeforeUnmount, type PropType } from 'vue';\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { PlaygroundContext, useRefresh, useService, PluginContext } from '@flowgram-vue/core';\n\nimport { FlowNodeErrorData } from '../flow-node-error-data';\nimport { MATERIAL_KEY, NodeManager } from '../../node';\nimport { defaultErrorRender } from './default-error-render';\n\nexport default defineComponent({\n name: 'ErrorRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n playgroundContext: { type: Object as PropType<PlaygroundContext>, required: true },\n clientContext: { type: Object as PropType<PluginContext>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const nodeErrorData = props.node.getData<FlowNodeErrorData>(FlowNodeErrorData);\n const nodeManager = useService<NodeManager>(NodeManager);\n const nodeErrorRender = nodeManager.getMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER);\n\n const disposable = nodeErrorData.onDataChange(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return () => {\n const nodeError = nodeErrorData.getError();\n if (!nodeError) {\n return null;\n }\n if (!nodeErrorRender) {\n return defaultErrorRender({\n error: nodeError,\n context: {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n },\n });\n }\n return nodeErrorRender({\n error: nodeError,\n context: {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n },\n });\n };\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodePluginRender } from '../../node';\nimport ErrorRender from './ErrorRender.vue';\n\nexport { default as ErrorRender } from './ErrorRender.vue';\nexport { defaultErrorRender } from './default-error-render';\n\nexport const errorPluginRender: NodePluginRender = (props) =>\n h(ErrorRender, {\n node: props.node,\n playgroundContext: props.playgroundContext,\n clientContext: props.clientContext,\n });\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nimport { NodeContribution } from '../node';\nimport { NodeManager, PLUGIN_KEY } from '../node';\nimport { errorPluginRender } from './renders';\n\n@injectable()\nexport class ErrorNodeContribution implements NodeContribution {\n onRegister(nodeManager: NodeManager) {\n nodeManager.registerPluginRender(PLUGIN_KEY.ERROR, errorPluginRender);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { bindContributions } from '@flowgram-vue/utils';\n\nimport { NodeContribution } from '../node';\nimport { ErrorNodeContribution } from './error-node-contribution';\n\nexport const ErrorContainerModule = new ContainerModule(bind => {\n bindContributions(bind, ErrorNodeContribution, [NodeContribution]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FlowNodeErrorData } from './flow-node-error-data';\n\nexport function getNodeError(node: FlowNodeEntity) {\n return node.getData<FlowNodeErrorData>(FlowNodeErrorData).getError();\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\nimport { injectPlaygroundContext, PlaygroundContext } from '@flowgram-vue/core';\n\nimport { NodeEngineContext } from '../../node/node-engine-context';\nimport { FormItem } from '../models/form-item';\nimport { type FormItemMaterialContext } from '../models/form-item-material-context';\n\n@injectable()\nexport class FormContextMaker {\n @inject(NodeEngineContext) readonly nodeEngineContext: NodeEngineContext;\n\n @injectPlaygroundContext() readonly playgroundContext: PlaygroundContext;\n\n makeFormItemMaterialContext(\n formItem: FormItem,\n options?: { getIndex: () => number | undefined }\n ): FormItemMaterialContext {\n return {\n meta: formItem.meta,\n path: formItem.path,\n readonly: this.nodeEngineContext.readonly,\n getFormItemValueByPath: formItem.formModel.getFormItemValueByPath.bind(formItem.formModel),\n onFormValidate: formItem.formModel.onValidate.bind(formItem.formModel),\n form: formItem.formModel,\n node: formItem.formModel.flowNodeEntity,\n playgroundContext: this.playgroundContext,\n index: options?.getIndex(),\n };\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\n@injectable()\nexport class FormPathService {\n static readonly ROOT = '/';\n\n static readonly DIVIDER = '/';\n\n static readonly RELATIVE_PARENT = '..';\n\n static readonly RELATIVE_CURRENT = '.';\n\n static readonly ARRAY = '[]';\n\n static normalize(path: string) {\n if (path === FormPathService.ROOT) {\n return path;\n }\n // 去掉末尾的斜杠\n if (path.endsWith(FormPathService.DIVIDER)) {\n path = path.slice(0, -1);\n }\n return path;\n }\n\n static join(paths: string[]): string {\n if (paths[1].startsWith(FormPathService.ROOT)) {\n throw new Error(\n `FormPathService Error: join failed, invalid paths[1], paths[1]= ${paths[1]}`,\n );\n }\n if (paths[0].endsWith(FormPathService.DIVIDER)) {\n return `${paths[0]}${paths[1]}`;\n }\n return paths.join(FormPathService.DIVIDER);\n }\n\n static toArrayPath(path: string): string {\n return FormPathService.join([path, FormPathService.ARRAY]);\n }\n\n static parseArrayItemPath(path: string) {\n const names = path.split('/');\n\n let i = 0;\n while (i < names.length) {\n const itemIndex = parseInt(names[i]);\n\n if (!isNaN(itemIndex)) {\n const arrayPath = FormPathService.toArrayPath(\n names.slice(0, i).join(FormPathService.DIVIDER),\n );\n const restPath = names.slice(i + 1).join(FormPathService.DIVIDER);\n const itemMetaPath = FormPathService.join([arrayPath, restPath]);\n return { itemIndex, arrayPath, itemMetaPath };\n }\n i = i + 1;\n }\n return null;\n }\n\n simplify(path: string) {\n const segments = path.split(FormPathService.DIVIDER);\n const resSegments: string[] = [];\n\n for (let i = 0; i < segments.length; i++) {\n if (!segments[i]) {\n throw new Error('FormPathService: join failed');\n }\n\n if (segments[i] === FormPathService.RELATIVE_CURRENT) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (segments[i] === FormPathService.RELATIVE_PARENT) {\n resSegments.pop();\n }\n resSegments.push(segments[i]);\n }\n return resSegments.join(FormPathService.DIVIDER);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { DisposableCollection, Event, MaybePromise } from '@flowgram-vue/utils';\nimport { type FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FormFeedback, FormModelValid, IFormItem } from '../types';\nimport { type FormManager } from '../services/form-manager';\nimport { type FormItem } from './form-item';\n\nexport type FormModelFactory = (entity: FlowNodeEntity) => FormModel;\nexport const FormModelFactory = Symbol('FormModelFactory');\nexport const FormModelEntity = Symbol('FormModelEntity');\n\n@injectable()\nexport abstract class FormModel {\n readonly onValidate: Event<FormModel>;\n\n readonly onValidChange: Event<FormModelValid>;\n\n readonly onFeedbacksChange: Event<FormFeedback[]>;\n\n readonly onInitialized: Event<FormModel>;\n\n protected toDispose: DisposableCollection = new DisposableCollection();\n\n /**\n * @deprecated\n * use `formModel.node` instead in FormModelV2\n */\n abstract get flowNodeEntity(): FlowNodeEntity;\n\n /**\n * @deprecated\n */\n abstract get formManager(): FormManager;\n\n abstract get formMeta(): any;\n\n abstract get initialized(): boolean;\n\n abstract get valid(): FormModelValid;\n\n abstract updateFormValues(value: any): void;\n\n /**\n * @deprecated\n * use `formModel.getFieldIn` instead in FormModelV2 to get the model of a form field\n * do not use this in FormModelV2 since it only return an empty Map.\n */\n abstract get formItemPathMap(): Map<string, IFormItem>;\n\n /**\n * @deprecated\n */\n abstract clearValid(): void;\n\n abstract validate(): Promise<boolean>;\n\n abstract validateWithFeedbacks(): Promise<FormFeedback[]>;\n\n abstract init(formMetaOrFormMetaGenerator: any, initialValue?: any): MaybePromise<void>;\n\n abstract toJSON(): any;\n\n /**\n * @deprecated\n * use `formModel.getField` instead in FormModelV2\n */\n abstract getFormItemByPath(path: string): FormItem | undefined;\n\n /**\n * @deprecated\n * use `formModel.getFieldValue` instead in FormModelV2 to get the model of a form field by path\n */\n abstract getFormItemValueByPath<T = any>(path: string): any | undefined;\n\n abstract render(): any;\n\n abstract dispose(): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DisposableCollection, Emitter } from '@flowgram-vue/utils';\n\nimport { type FormItemDomRef, type IFormItemMeta } from '../types';\nimport { type FormModel } from './form-model';\n\nexport abstract class FormItem {\n readonly meta: IFormItemMeta;\n\n readonly path: string;\n\n readonly formModel: FormModel;\n\n readonly onInitEventEmitter = new Emitter<FormItem>();\n\n readonly onInit = this.onInitEventEmitter.event;\n\n protected toDispose: DisposableCollection = new DisposableCollection();\n\n readonly onDispose = this.toDispose.onDispose;\n\n // todo(heyuan): 将dom 相关逻辑拆到form item插件里\n private _domRef: FormItemDomRef;\n\n protected constructor(meta: IFormItemMeta, path: string, formModel: FormModel) {\n this.meta = meta;\n this.path = path;\n this.formModel = formModel;\n this.toDispose.push(this.onInitEventEmitter);\n }\n\n abstract get value(): any;\n\n abstract set value(value: any);\n\n abstract validate(): void;\n\n set domRef(domRef: FormItemDomRef) {\n this._domRef = domRef;\n }\n\n get domRef() {\n return this._domRef;\n }\n\n dispose(): void {\n this.toDispose.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type IFormItemMeta, type IFormMeta, type IFormMetaOptions } from '../types';\nimport { FormPathService } from '../services';\n\nexport interface FormMetaTraverseParams {\n formItemMeta: IFormItemMeta;\n parentPath?: string;\n handle: (params: { formItemMeta: IFormItemMeta; path: string }) => any;\n}\n\nexport class FormMeta implements IFormMeta {\n constructor(root: IFormItemMeta, options: IFormMetaOptions) {\n this._root = root;\n this._options = options;\n }\n\n protected _root: IFormItemMeta;\n\n get root(): IFormItemMeta {\n return this._root;\n }\n\n protected _options: IFormMetaOptions;\n\n get options(): IFormMetaOptions {\n return this._options;\n }\n\n static traverse({ formItemMeta, parentPath = '', handle }: FormMetaTraverseParams): void {\n if (!formItemMeta) {\n return;\n }\n\n const isRoot = !parentPath;\n\n const path = isRoot\n ? FormPathService.ROOT\n : formItemMeta.name\n ? FormPathService.join([parentPath, formItemMeta.name])\n : parentPath;\n\n handle({ formItemMeta, path });\n\n if (formItemMeta.items) {\n this.traverse({\n formItemMeta: formItemMeta.items,\n handle,\n parentPath: FormPathService.toArrayPath(path),\n });\n }\n\n if (formItemMeta.children && formItemMeta.children.length) {\n formItemMeta.children.forEach((child) => {\n this.traverse({ formItemMeta: child, handle, parentPath: path });\n });\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nexport interface Extension {\n key: string;\n}\n@injectable()\nexport class FormAbilityExtensionRegistry {\n protected registry = new Map<string, Extension>();\n\n register(extension: Extension): void {\n this.registry.set(extension.key, extension);\n }\n\n get<T extends Extension>(key: string): T | undefined {\n return this.registry.get(key) as T | undefined;\n }\n\n get objectMap(): Record<string, Extension> {\n return Object.fromEntries(this.registry);\n }\n\n get collection(): Extension[] {\n return Array.from(this.registry.values());\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FormManager } from './services/form-manager';\n\nexport const FormContribution = Symbol('FormContribution');\n\nexport interface FormContribution {\n onRegister?(formManager: FormManager): void;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class SetterAbility implements FormItemAbility {\n static readonly type = 'setter';\n\n get type(): string {\n return SetterAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class DecoratorAbility implements FormItemAbility {\n static readonly type = 'decorator';\n\n get type(): string {\n return DecoratorAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport interface VisibilityAbilityOptions {\n /**\n * 是否隐藏\n */\n hidden: string | boolean;\n /**\n * 隐藏是否要清空表单值, 默认为false\n */\n clearWhenHidden?: boolean;\n}\n\nexport class VisibilityAbility implements FormItemAbility {\n static readonly type = 'visibility';\n\n get type(): string {\n return VisibilityAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class EffectAbility implements FormItemAbility {\n static readonly type = 'effect';\n\n get type(): string {\n return EffectAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class DefaultAbility implements FormItemAbility {\n static readonly type = 'default';\n\n get type(): string {\n return DefaultAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItemAbility } from '../../models/form-item-ability';\n\nexport class ValidationAbility implements FormItemAbility {\n static readonly type = 'validation';\n\n get type(): string {\n return ValidationAbility.type;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mapValues } from 'lodash-es';\nimport { inject, injectable, multiInject, optional, postConstruct } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\nimport { injectPlaygroundContext, PlaygroundContext } from '@flowgram-vue/core';\n\nimport { AbilityClass, FormItemAbility } from '../models/form-item-ability';\nimport { FormAbilityExtensionRegistry, FormModel } from '../models';\nimport { FormContribution } from '../form-contribution';\nimport {\n DecoratorAbility,\n DecoratorExtension,\n SetterAbility,\n SetterExtension,\n SetterHoc,\n} from '../abilities';\nimport { FormContextMaker } from './form-context-maker';\nimport { FormPathService } from './form-path-service';\n\n@injectable()\nexport class FormManager {\n readonly abilityRegistry: Map<string, FormItemAbility> = new Map();\n\n readonly setterHocs: SetterHoc[] = [];\n\n readonly extensionRegistryMap: Map<string, FormAbilityExtensionRegistry> = new Map();\n\n @inject(FormPathService) readonly pathManager: FormPathService;\n\n @inject(FormContextMaker) readonly formContextMaker: FormContextMaker;\n\n @injectPlaygroundContext() readonly playgroundContext: PlaygroundContext;\n\n @multiInject(FormContribution) @optional() protected formContributions: FormContribution[] = [];\n\n private readonly onFormModelWillInitEmitter = new Emitter<{\n model: FormModel;\n data: any;\n }>();\n\n readonly onFormModelWillInit = this.onFormModelWillInitEmitter.event;\n\n get components(): Record<string, any> {\n return mapValues(\n this.extensionRegistryMap.get(SetterAbility.type)?.objectMap || {},\n (setter: SetterExtension) => setter.component\n );\n }\n\n get decorators(): Record<string, any> {\n return mapValues(\n this.extensionRegistryMap.get(DecoratorAbility.type)?.objectMap || {},\n (decorator: DecoratorExtension) => decorator.component\n );\n }\n\n registerAbilityExtension(type: string, extension: any): void {\n if (!this.extensionRegistryMap.get(type)) {\n this.extensionRegistryMap.set(type, new FormAbilityExtensionRegistry());\n }\n const registry = this.extensionRegistryMap.get(type);\n if (!registry) {\n return;\n }\n registry.register(extension);\n }\n\n getAbilityExtension(abilityType: string, extensionKey: string): any {\n return this.extensionRegistryMap.get(abilityType)?.get(extensionKey);\n }\n\n registerAbility(Ability: AbilityClass): void {\n const ability = new Ability();\n this.abilityRegistry.set(ability.type, ability);\n }\n\n registerAbilities(Abilities: AbilityClass[]): void {\n Abilities.forEach(this.registerAbility.bind(this));\n }\n\n getAbility<ExtendAbility>(type: string): (FormItemAbility & ExtendAbility) | undefined {\n return this.abilityRegistry.get(type) as FormItemAbility & ExtendAbility;\n }\n\n /**\n * @deprecated\n * Setter Hoc and setter are no longer supported in NodeEngineV2\n * @param hoc\n */\n registerSetterHoc(hoc: SetterHoc): void {\n this.setterHocs.push(hoc);\n }\n\n fireFormModelWillInit(model: FormModel, data: any) {\n this.onFormModelWillInitEmitter.fire({\n model,\n data,\n });\n }\n\n dispose() {\n this.onFormModelWillInitEmitter.dispose();\n }\n\n @postConstruct()\n protected init(): void {\n this.formContributions.forEach((contrib) => contrib.onRegister?.(this));\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Disposable, Emitter } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { EntityData } from '@flowgram-vue/core';\n\nimport { FlowNodeErrorData } from '../error';\nimport { FormMetaOrFormMetaGenerator } from './types';\nimport { FormModel, type FormModelFactory } from './models';\n\ninterface Options {\n formModelFactory: FormModelFactory;\n}\n\nexport interface DetailChangeEvent {\n path: string;\n oldValue: any;\n value: any;\n initialized: boolean;\n}\n\nexport interface OnFormValuesChangePayload {\n values: any;\n prevValues: any;\n name: string;\n}\n\nexport class FlowNodeFormData extends EntityData {\n static type = 'FlowNodeEntityFormData';\n\n readonly formModel: FormModel;\n\n protected flowNodeEntity: FlowNodeEntity;\n\n /**\n * @deprecated rehaje 版表单form Values change 事件\n * @protected\n */\n protected onDetailChangeEmitter = new Emitter<DetailChangeEvent>();\n\n /**\n * @deprecated 该方法为旧版引擎(rehaje)表单数据变更事件, 新版节点引擎请使用\n * this.getFormModel<FormModelV2>().onFormValuesChange.\n * @protected\n */\n readonly onDetailChange = this.onDetailChangeEmitter.event;\n\n constructor(entity: FlowNodeEntity, opts: Options) {\n super(entity);\n\n this.flowNodeEntity = entity;\n this.formModel = opts.formModelFactory(entity);\n\n this.toDispose.push(this.onDetailChangeEmitter);\n\n this.toDispose.push(\n Disposable.create(() => {\n this.formModel.dispose();\n })\n );\n }\n\n getFormModel<TFormModel>(): TFormModel {\n // @ts-ignore\n return this.formModel as TFormModel;\n }\n\n getDefaultData(): any {\n return {};\n }\n\n createForm(formMetaOrFormMetaGenerator: any, initialValue?: any): void {\n const errorData = this.flowNodeEntity.getData<FlowNodeErrorData>(FlowNodeErrorData);\n\n errorData.setError(null);\n try {\n this.formModel.init(formMetaOrFormMetaGenerator, initialValue);\n } catch (e) {\n errorData.setError(e as Error);\n }\n }\n\n updateFormValues(value: any) {\n this.formModel.updateFormValues(value);\n }\n\n recreateForm(formMetaOrFormMetaGenerator: FormMetaOrFormMetaGenerator, initialValue?: any): void {\n this.createForm(formMetaOrFormMetaGenerator, initialValue);\n }\n\n toJSON(): any {\n return this.formModel.toJSON();\n }\n\n dispose(): void {\n super.dispose();\n }\n\n /**\n * @deprecated rehaje 版表单form Values change 事件触发函数\n * @protected\n */\n fireDetaiChange(detailChangeEvent: DetailChangeEvent) {\n this.onDetailChangeEmitter.fire(detailChangeEvent);\n }\n}\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, onBeforeUnmount, type PropType } from 'vue';\n\nimport { useRefresh } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FormModel } from './models';\nimport { FlowNodeFormData } from './flow-node-form-data';\n\nfunction getFormModelFromNode(node: FlowNodeEntity) {\n return node.getData(FlowNodeFormData)?.getFormModel<FormModel>();\n}\n\nexport default defineComponent({\n name: 'FormRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const formModel = getFormModelFromNode(props.node);\n\n if (formModel) {\n const disposable = formModel.onInitialized(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n }\n\n return () => (formModel?.initialized ? formModel.render() : null);\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { h } from 'vue';\n\nimport { NodeContext } from '../node';\nimport FormRender from './FormRender.vue';\n\nexport { default as FormRender } from './FormRender.vue';\n\nexport const formPluginRender = (props: NodeContext) => h(FormRender, { node: props.node });\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nimport { NodeContribution, NodeManager, PLUGIN_KEY } from '../node';\nimport { formPluginRender } from './form-render';\n\n@injectable()\nexport class FormNodeContribution implements NodeContribution {\n onRegister(nodeManager: NodeManager) {\n nodeManager.registerPluginRender(PLUGIN_KEY.FORM, formPluginRender);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { bindContributions } from '@flowgram-vue/utils';\n\nimport { FormContextMaker } from './services/form-context-maker';\nimport { NodeContribution } from '../node';\nimport { FormManager, FormPathService } from './services';\nimport { FormNodeContribution } from './form-node-contribution';\n\nexport const FormCoreContainerModule = new ContainerModule((bind) => {\n bind(FormManager).toSelf().inSingletonScope();\n bind(FormPathService).toSelf().inSingletonScope();\n bind(FormContextMaker).toSelf().inSingletonScope();\n bindContributions(bind, FormNodeContribution, [NodeContribution]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport interface IFormItem<T = any> {\n value: T;\n}\n\nexport enum FormItemEventName {\n onFormValueChange = 'onFormValueChange',\n onFormItemInit = 'onFormItemInit',\n}\n\nexport type FormModelValid = boolean | null;\n\nexport type FeedbackStatus = 'error' | 'warning' | 'pending';\nexport type FeedbackText = string;\n\nexport interface FormItemFeedback {\n feedbackStatus?: FeedbackStatus;\n feedbackText?: FeedbackText;\n}\n\nexport interface FormFeedback {\n feedbackStatus?: FeedbackStatus;\n feedbackText?: FeedbackText;\n path: string;\n}\n\nexport interface FormItemDomRef {\n current: HTMLElement | null;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MaybePromise } from '@flowgram-vue/utils';\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { PlaygroundContext, PluginContext } from '@flowgram-vue/core';\n\nimport { type FormItemAbilityMeta } from './form-ability.types';\n\nexport type FormDataTypeName =\n | 'string'\n | 'number'\n | 'integer'\n | 'boolean'\n | 'object'\n | 'array'\n | 'null';\n\nexport type FormDataType =\n | string //\n | number\n | boolean\n | FormDataObject\n | DataArray\n | null;\n\nexport interface FormDataObject {\n [key: string]: FormDataType;\n}\n\nexport type DataArray = Array<FormDataType>;\n\nexport const FORM_VOID = 'form-void' as const;\n\nexport interface TreeNode<T> {\n name: string;\n children?: TreeNode<T>[];\n}\n\nexport interface IFormItemMeta extends TreeNode<IFormItemMeta> {\n /**\n * 表单项名称\n */\n name: string;\n /**\n * 数据类型\n */\n type: FormDataTypeName | typeof FORM_VOID;\n /**\n * 枚举值\n */\n enum?: FormDataType[];\n /**\n * 数组类型item的数据类型描述\n */\n items?: IFormItemMeta;\n /**\n * 表单项标题\n */\n title?: string;\n /**\n * 表单项描述\n */\n description?: string;\n /**\n * 表单项默认值\n */\n default?: FormDataType;\n /**\n * 是否必填\n */\n required?: boolean;\n /**\n * 扩展能力\n */\n abilities?: FormItemAbilityMeta[];\n\n /**\n * 子表单项\n */\n children?: IFormItemMeta[];\n}\n\nexport interface IFormMeta {\n /**\n * 表单树结构root\n */\n root?: IFormItemMeta;\n /**\n * 表单全局配置\n */\n options?: IFormMetaOptions;\n}\n\nexport interface NodeFormContext {\n node: FlowNodeEntity;\n playgroundContext: PlaygroundContext;\n clientContext: PluginContext & Record<string, any>;\n}\n\nexport interface IFormMetaOptions {\n formatOnInit?: (value: any, context: NodeFormContext) => any;\n\n formatOnSubmit?: (value: any, context: NodeFormContext) => any;\n\n [key: string]: any;\n}\n\nexport interface FormMetaGeneratorParams<PlaygroundContext, FormValue = any> {\n node: FlowNodeEntity;\n playgroundContext: PlaygroundContext;\n initialValue?: FormValue;\n}\n\nexport type FormMetaGenerator<PlaygroundContext = any, FormValue = any> = (\n params: FormMetaGeneratorParams<FormValue, FormValue>\n) => MaybePromise<IFormMeta>;\n\nexport type FormMetaOrFormMetaGenerator = FormMetaGenerator | IFormMeta;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { FlowNodeFormData } from '../flow-node-form-data';\nimport { FormModel } from '../models';\n\nexport function isNodeFormReady(node: FlowNodeEntity) {\n return node.getData<FlowNodeFormData>(FlowNodeFormData).getFormModel<FormModel>().initialized;\n}\n\nexport function getFormModel(node: FlowNodeEntity) {\n return node.getData<FlowNodeFormData>(FlowNodeFormData).formModel;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { NodeContainerModule } from '../node/node-container-module';\nimport { FormCoreContainerModule } from '../form';\nimport { ErrorContainerModule } from '../error';\n\nexport function createNodeContainerModules() {\n return [NodeContainerModule, FormCoreContainerModule, ErrorContainerModule];\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { InjectionKey } from 'vue';\nimport { inject, provide } from 'vue';\n\nimport { INodeEngineContext, NodeEngineContext } from '../../node';\n\nexport const NodeEngineVueContextKey: InjectionKey<INodeEngineContext> = Symbol(\n 'NodeEngineVueContext'\n);\n\nexport function provideNodeEngineContext(ctx: INodeEngineContext): void {\n provide(NodeEngineVueContextKey, ctx);\n}\n\nexport function useNodeEngineVueContext(): INodeEngineContext {\n return inject(NodeEngineVueContextKey, NodeEngineContext.DEFAULT_JSON);\n}\n\n/** @deprecated use NodeEngineVueContextKey */\nexport const NodeEngineVueContext = NodeEngineVueContextKey;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount } from 'vue';\n\nimport { useService, useRefresh } from '@flowgram-vue/core';\n\nimport { NodeEngineContext } from '../../node';\n\nexport function useNodeEngineContext(): NodeEngineContext {\n const refresh = useRefresh();\n const nodeEngineContext = useService<NodeEngineContext>(NodeEngineContext);\n\n const disposable = nodeEngineContext.onChange(() => {\n refresh();\n });\n\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return nodeEngineContext;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount } from 'vue';\n\nimport { FlowNodeEntity } from '@flowgram-vue/document';\nimport { useEntityFromContext, useRefresh } from '@flowgram-vue/core';\n\nimport { FlowNodeFormData, FormModel, IFormItem } from '../../form';\n\nexport function useFormItem(path: string): IFormItem | undefined {\n const refresh = useRefresh();\n const node = useEntityFromContext<FlowNodeEntity>();\n const formData = node.getData<FlowNodeFormData>(FlowNodeFormData);\n const formItem = formData.getFormModel<FormModel>().getFormItemByPath(path);\n\n const disposable = formData.onDataChange(() => {\n refresh();\n });\n\n onBeforeUnmount(() => {\n disposable.dispose();\n });\n\n return formItem;\n}\n","<script lang=\"ts\">\n/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport { defineComponent, h, onBeforeUnmount, provide, type PropType } from 'vue';\n\nimport { PlaygroundContext, useRefresh, useService, PluginContext } from '@flowgram-vue/core';\nimport type { FlowNodeEntity } from '@flowgram-vue/document';\n\nimport { NodeEngineVueContextKey } from '../node-vue/context/node-engine-vue-context';\nimport { useNodeEngineContext } from '../node-vue';\nimport { NodeManager } from '../node/node-manager';\nimport { PLUGIN_KEY } from '../node/core-plugins';\nimport { MATERIAL_KEY } from '../node';\nimport { getFormModel, isNodeFormReady } from '../form';\nimport { FlowNodeErrorData } from '../error/flow-node-error-data';\nimport { getNodeError } from '../error';\n\nexport default defineComponent({\n name: 'NodeRender',\n props: {\n node: { type: Object as PropType<FlowNodeEntity>, required: true },\n },\n setup(props) {\n const refresh = useRefresh();\n const playgroundContext = useService<PlaygroundContext>(PlaygroundContext);\n const clientContext = useService<PluginContext>(PluginContext);\n const nodeManager = useService<NodeManager>(NodeManager);\n const nodeEngineContext = useNodeEngineContext();\n\n const nodeFormRender = nodeManager.getPluginRender(PLUGIN_KEY.FORM);\n const nodeErrorRender = nodeManager.getPluginRender(PLUGIN_KEY.ERROR);\n const nodePlaceholderRender = nodeManager.getMaterialRender(\n MATERIAL_KEY.NODE_PLACEHOLDER_RENDER\n );\n\n const nodeErrorData = props.node.getData<FlowNodeErrorData>(FlowNodeErrorData);\n const formModel = getFormModel(props.node);\n\n const errorDisposable = nodeErrorData.onDataChange(() => {\n refresh();\n });\n const formDisposable = formModel.onInitialized(() => {\n refresh();\n });\n onBeforeUnmount(() => {\n errorDisposable.dispose();\n formDisposable.dispose();\n });\n\n provide(NodeEngineVueContextKey, nodeEngineContext.json);\n\n return () => {\n const isNodeError = !!getNodeError(props.node);\n const isFormReady = isNodeFormReady(props.node);\n\n const renderContent = () => {\n if (isNodeError) {\n return nodeErrorRender!({ node: props.node, playgroundContext, clientContext });\n }\n if (!formModel.formMeta) {\n return null;\n }\n if (isFormReady) {\n return nodeFormRender!({ node: props.node, playgroundContext, clientContext });\n }\n return nodePlaceholderRender?.({ node: props.node, playgroundContext }) || null;\n };\n\n const Wrapped = nodeManager.nodeRenderHoc(renderContent);\n return typeof Wrapped === 'function' ? (Wrapped as () => any)() : h(Wrapped as any);\n };\n },\n});\n</script>\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MATERIAL_KEY } from '../node/core-materials';\nimport { NodeManager, NodePlaceholderRender, Render } from '../node';\n\nexport function registerNodeErrorRender(nodeManager: NodeManager, render: Render): void {\n nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER, render);\n}\n\nexport function registerNodePlaceholderRender(\n nodeManager: NodeManager,\n render: NodePlaceholderRender,\n): void {\n nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_PLACEHOLDER_RENDER, render);\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { EntityDataRegistry } from '@flowgram-vue/core';\n\nimport { FlowNodeFormData } from '../form';\nimport { FlowNodeErrorData } from '../error';\n\nexport function createNodeEntityDatas(): EntityDataRegistry[] {\n return [FlowNodeFormData, FlowNodeErrorData];\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowgram-vue/form-core",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "automation form core",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"flow",
|
|
8
|
+
"engine"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://flowgram.ai/",
|
|
11
|
+
"repository": "https://github.com/Crayon-hua/flowgram-vue",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.cjs",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"src",
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"inversify": "^6.0.1",
|
|
28
|
+
"lodash-es": "^4.17.21",
|
|
29
|
+
"reflect-metadata": "~0.2.2",
|
|
30
|
+
"@flowgram-vue/core": "0.2.0",
|
|
31
|
+
"@flowgram-vue/utils": "0.2.0",
|
|
32
|
+
"@flowgram-vue/document": "0.2.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"vue": "^3.5.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/lodash-es": "^4.17.12",
|
|
39
|
+
"@types/node": "^20",
|
|
40
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
41
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
42
|
+
"@vue/test-utils": "^2.4.6",
|
|
43
|
+
"eslint": "^9.0.0",
|
|
44
|
+
"jsdom": "^26.1.0",
|
|
45
|
+
"typescript": "^5.8.3",
|
|
46
|
+
"vitest": "^3.2.4",
|
|
47
|
+
"vue": "^3.5.18",
|
|
48
|
+
"@flowgram-vue/build-config": "0.2.0",
|
|
49
|
+
"@flowgram-vue/eslint-config": "0.2.0",
|
|
50
|
+
"@flowgram-vue/ts-config": "0.2.0"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public",
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "flowgram-build",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"lint": "eslint .",
|
|
60
|
+
"ts-check": "tsc --noEmit",
|
|
61
|
+
"type-check": "tsc --noEmit",
|
|
62
|
+
"build:fast": "flowgram-build --fast",
|
|
63
|
+
"build:watch": "flowgram-build --watch"
|
|
64
|
+
},
|
|
65
|
+
"module": "./dist/index.js"
|
|
66
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { defineComponent, h, onBeforeUnmount, provide, type PropType } from 'vue';
|
|
7
|
+
|
|
8
|
+
import { PlaygroundContext, useRefresh, useService, PluginContext } from '@flowgram-vue/core';
|
|
9
|
+
import type { FlowNodeEntity } from '@flowgram-vue/document';
|
|
10
|
+
|
|
11
|
+
import { NodeEngineVueContextKey } from '../node-vue/context/node-engine-vue-context';
|
|
12
|
+
import { useNodeEngineContext } from '../node-vue';
|
|
13
|
+
import { NodeManager } from '../node/node-manager';
|
|
14
|
+
import { PLUGIN_KEY } from '../node/core-plugins';
|
|
15
|
+
import { MATERIAL_KEY } from '../node';
|
|
16
|
+
import { getFormModel, isNodeFormReady } from '../form';
|
|
17
|
+
import { FlowNodeErrorData } from '../error/flow-node-error-data';
|
|
18
|
+
import { getNodeError } from '../error';
|
|
19
|
+
|
|
20
|
+
export default defineComponent({
|
|
21
|
+
name: 'NodeRender',
|
|
22
|
+
props: {
|
|
23
|
+
node: { type: Object as PropType<FlowNodeEntity>, required: true },
|
|
24
|
+
},
|
|
25
|
+
setup(props) {
|
|
26
|
+
const refresh = useRefresh();
|
|
27
|
+
const playgroundContext = useService<PlaygroundContext>(PlaygroundContext);
|
|
28
|
+
const clientContext = useService<PluginContext>(PluginContext);
|
|
29
|
+
const nodeManager = useService<NodeManager>(NodeManager);
|
|
30
|
+
const nodeEngineContext = useNodeEngineContext();
|
|
31
|
+
|
|
32
|
+
const nodeFormRender = nodeManager.getPluginRender(PLUGIN_KEY.FORM);
|
|
33
|
+
const nodeErrorRender = nodeManager.getPluginRender(PLUGIN_KEY.ERROR);
|
|
34
|
+
const nodePlaceholderRender = nodeManager.getMaterialRender(
|
|
35
|
+
MATERIAL_KEY.NODE_PLACEHOLDER_RENDER
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const nodeErrorData = props.node.getData<FlowNodeErrorData>(FlowNodeErrorData);
|
|
39
|
+
const formModel = getFormModel(props.node);
|
|
40
|
+
|
|
41
|
+
const errorDisposable = nodeErrorData.onDataChange(() => {
|
|
42
|
+
refresh();
|
|
43
|
+
});
|
|
44
|
+
const formDisposable = formModel.onInitialized(() => {
|
|
45
|
+
refresh();
|
|
46
|
+
});
|
|
47
|
+
onBeforeUnmount(() => {
|
|
48
|
+
errorDisposable.dispose();
|
|
49
|
+
formDisposable.dispose();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
provide(NodeEngineVueContextKey, nodeEngineContext.json);
|
|
53
|
+
|
|
54
|
+
return () => {
|
|
55
|
+
const isNodeError = !!getNodeError(props.node);
|
|
56
|
+
const isFormReady = isNodeFormReady(props.node);
|
|
57
|
+
|
|
58
|
+
const renderContent = () => {
|
|
59
|
+
if (isNodeError) {
|
|
60
|
+
return nodeErrorRender!({ node: props.node, playgroundContext, clientContext });
|
|
61
|
+
}
|
|
62
|
+
if (!formModel.formMeta) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (isFormReady) {
|
|
66
|
+
return nodeFormRender!({ node: props.node, playgroundContext, clientContext });
|
|
67
|
+
}
|
|
68
|
+
return nodePlaceholderRender?.({ node: props.node, playgroundContext }) || null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const Wrapped = nodeManager.nodeRenderHoc(renderContent);
|
|
72
|
+
return typeof Wrapped === 'function' ? (Wrapped as () => any)() : h(Wrapped as any);
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { NodeContainerModule } from '../node/node-container-module';
|
|
7
|
+
import { FormCoreContainerModule } from '../form';
|
|
8
|
+
import { ErrorContainerModule } from '../error';
|
|
9
|
+
|
|
10
|
+
export function createNodeContainerModules() {
|
|
11
|
+
return [NodeContainerModule, FormCoreContainerModule, ErrorContainerModule];
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { EntityDataRegistry } from '@flowgram-vue/core';
|
|
7
|
+
|
|
8
|
+
import { FlowNodeFormData } from '../form';
|
|
9
|
+
import { FlowNodeErrorData } from '../error';
|
|
10
|
+
|
|
11
|
+
export function createNodeEntityDatas(): EntityDataRegistry[] {
|
|
12
|
+
return [FlowNodeFormData, FlowNodeErrorData];
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export * from './create-node-container-modules';
|
|
7
|
+
export * from './node-render';
|
|
8
|
+
export * from './node-material-client';
|
|
9
|
+
export * from './create-node-entity-datas';
|
|
10
|
+
export * from '../form/client';
|
|
11
|
+
export * from '../error/client';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MATERIAL_KEY } from '../node/core-materials';
|
|
7
|
+
import { NodeManager, NodePlaceholderRender, Render } from '../node';
|
|
8
|
+
|
|
9
|
+
export function registerNodeErrorRender(nodeManager: NodeManager, render: Render): void {
|
|
10
|
+
nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER, render);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function registerNodePlaceholderRender(
|
|
14
|
+
nodeManager: NodeManager,
|
|
15
|
+
render: NodePlaceholderRender,
|
|
16
|
+
): void {
|
|
17
|
+
nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_PLACEHOLDER_RENDER, render);
|
|
18
|
+
}
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module '*.vue' {
|
|
7
|
+
import type { DefineComponent } from 'vue';
|
|
8
|
+
const component: DefineComponent<object, object, unknown>;
|
|
9
|
+
export default component;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { FlowNodeEntity } from '@flowgram-vue/document';
|
|
7
|
+
|
|
8
|
+
import { FlowNodeErrorData } from './flow-node-error-data';
|
|
9
|
+
|
|
10
|
+
export function getNodeError(node: FlowNodeEntity) {
|
|
11
|
+
return node.getData<FlowNodeErrorData>(FlowNodeErrorData).getError();
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ContainerModule } from 'inversify';
|
|
7
|
+
import { bindContributions } from '@flowgram-vue/utils';
|
|
8
|
+
|
|
9
|
+
import { NodeContribution } from '../node';
|
|
10
|
+
import { ErrorNodeContribution } from './error-node-contribution';
|
|
11
|
+
|
|
12
|
+
export const ErrorContainerModule = new ContainerModule(bind => {
|
|
13
|
+
bindContributions(bind, ErrorNodeContribution, [NodeContribution]);
|
|
14
|
+
});
|