@flowgram.ai/editor 0.1.0-alpha.14 → 0.1.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -20,6 +20,15 @@ export * from "@flowgram.ai/variable-plugin";
20
20
  export * from "@flowgram.ai/shortcuts-plugin";
21
21
  export * from "@flowgram.ai/node-core-plugin";
22
22
  export * from "@flowgram.ai/i18n-plugin";
23
+ import {
24
+ ReactiveState,
25
+ ReactiveBaseState,
26
+ Tracker,
27
+ useReactiveState,
28
+ useReadonlyReactiveState,
29
+ useObserve,
30
+ observe
31
+ } from "@flowgram.ai/reactive";
23
32
  import {
24
33
  injectable as injectable4,
25
34
  postConstruct,
@@ -55,10 +64,12 @@ var EditorProps;
55
64
  })(EditorProps || (EditorProps = {}));
56
65
 
57
66
  // src/preset/editor-default-preset.ts
67
+ import { getNodePrivateScope, getNodeScope } from "@flowgram.ai/variable-plugin";
58
68
  import { FlowRendererContainerModule, FlowRendererRegistry } from "@flowgram.ai/renderer";
59
69
  import { createReduxDevToolPlugin } from "@flowgram.ai/redux-devtool-plugin";
60
70
  import { createNodeVariablePlugin } from "@flowgram.ai/node-variable-plugin";
61
71
  import { createNodeCorePlugin } from "@flowgram.ai/node-core-plugin";
72
+ import { getNodeForm } from "@flowgram.ai/node";
62
73
  import { createMaterialsPlugin } from "@flowgram.ai/materials-plugin";
63
74
  import { createI18nPlugin } from "@flowgram.ai/i18n-plugin";
64
75
  import { createHistoryNodePlugin } from "@flowgram.ai/history-node-plugin";
@@ -294,6 +305,36 @@ function createDefaultPreset(opts, plugins = []) {
294
305
  if (opts.getNodeDefaultRegistry) {
295
306
  ctx2.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;
296
307
  }
308
+ ctx2.document.options.preNodeCreate = (node) => {
309
+ if (opts.nodeEngine && opts.nodeEngine.enable !== false) {
310
+ let cache;
311
+ Object.defineProperty(node, "form", {
312
+ get: () => {
313
+ if (cache) return cache;
314
+ cache = getNodeForm(node);
315
+ return cache;
316
+ }
317
+ });
318
+ }
319
+ if (opts.variableEngine && opts.variableEngine.enable !== false) {
320
+ let cache;
321
+ let privateCache;
322
+ Object.defineProperty(node, "scope", {
323
+ get: () => {
324
+ if (cache) return cache;
325
+ cache = getNodeScope(node);
326
+ return cache;
327
+ }
328
+ });
329
+ Object.defineProperty(node, "privateScope", {
330
+ get: () => {
331
+ if (privateCache) return privateCache;
332
+ privateCache = getNodePrivateScope(node);
333
+ return privateCache;
334
+ }
335
+ });
336
+ }
337
+ };
297
338
  ctx2.get(FlowRendererRegistry).init();
298
339
  },
299
340
  onReady(ctx2) {
@@ -380,6 +421,9 @@ export {
380
421
  NodeClient,
381
422
  NodeFocusService,
382
423
  NodeRender,
424
+ ReactiveBaseState,
425
+ ReactiveState,
426
+ Tracker,
383
427
  ValidateTrigger,
384
428
  createDefaultPreset,
385
429
  createFlowEditorClientPlugin,
@@ -390,6 +434,7 @@ export {
390
434
  injectable4 as injectable,
391
435
  multiInject,
392
436
  named,
437
+ observe,
393
438
  postConstruct,
394
439
  useCurrentField,
395
440
  useCurrentFieldState,
@@ -398,6 +443,9 @@ export {
398
443
  useFlowEditor,
399
444
  useForm,
400
445
  useHighlight,
446
+ useObserve,
447
+ useReactiveState,
448
+ useReadonlyReactiveState,
401
449
  useWatch
402
450
  };
403
451
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/preset/editor-props.ts","../../src/preset/editor-default-preset.ts","../../src/clients/flow-editor-client-plugins.ts","../../src/clients/node-client/create-node-client-plugins.ts","../../src/clients/node-client/node-focus-service.ts","../../src/clients/node-client/highlight/highlight-form-item.ts","../../src/clients/node-client/highlight/highlight-style.ts","../../src/clients/node-client/highlight/constants.ts","../../src/clients/node-client/highlight/use-highlight.ts","../../src/clients/node-client/node-client.ts","../../src/clients/node-client/highlight/create-node-highlight-plugin.ts","../../src/clients/flow-editor-client.ts","../../src/components/editor-provider.tsx","../../src/components/editor-renderer.tsx","../../src/components/editor.tsx","../../src/hooks/use-flow-editor.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport 'reflect-metadata';\nimport { FormModelV2 } from '@flowgram.ai/node';\n\n/* 核心 模块导出 */\nexport * from '@flowgram.ai/utils';\nexport * from '@flowgram.ai/core';\nexport * from '@flowgram.ai/document';\nexport * from '@flowgram.ai/renderer';\nexport * from '@flowgram.ai/variable-plugin';\nexport * from '@flowgram.ai/shortcuts-plugin';\nexport * from '@flowgram.ai/node-core-plugin';\nexport * from '@flowgram.ai/i18n-plugin';\nexport {\n type interfaces,\n injectable,\n postConstruct,\n named,\n Container,\n ContainerModule,\n AsyncContainerModule,\n inject,\n multiInject,\n} from 'inversify';\n\nexport { FlowNodeFormData, NodeRender, type NodeRenderProps } from '@flowgram.ai/form-core';\n\nexport type {\n FormState,\n FieldState,\n FieldArrayRenderProps,\n FieldRenderProps,\n FormRenderProps,\n Validate,\n FormControl,\n FieldName,\n FieldError,\n FieldWarning,\n IField,\n IFieldArray,\n IForm,\n Errors,\n Warnings,\n} from '@flowgram.ai/form';\n\nexport {\n Form,\n Field,\n FieldArray,\n useForm,\n useField,\n useCurrentField,\n useCurrentFieldState,\n useFieldValidate,\n useWatch,\n ValidateTrigger,\n FeedbackLevel,\n} from '@flowgram.ai/form';\nexport * from '@flowgram.ai/node';\nexport { FormModelV2 as FormModel };\n\n/**\n * 固定布局模块导出\n */\nexport * from './preset';\nexport * from './components';\nexport * from './hooks';\nexport * from './clients';\n\n/**\n * Plugin 导出\n */\n\nexport * from '@flowgram.ai/node-variable-plugin';\n\nexport { createPlaygroundReactPreset } from '@flowgram.ai/playground-react';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { VariablePluginOptions } from '@flowgram.ai/variable-plugin';\nimport { ReduxDevToolPluginOptions } from '@flowgram.ai/redux-devtool-plugin';\nimport { PlaygroundReactProps, SelectionService } from '@flowgram.ai/playground-react';\nimport { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';\nimport { MaterialsPluginOptions } from '@flowgram.ai/materials-plugin';\nimport { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';\nimport { HistoryPluginOptions } from '@flowgram.ai/history';\nimport { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';\nimport {\n FlowDocument,\n FlowDocumentJSON,\n FlowNodeEntity,\n type FlowNodeJSON,\n FlowNodeRegistry,\n FlowNodeType,\n} from '@flowgram.ai/document';\nimport { PluginContext } from '@flowgram.ai/core';\n\nexport interface EditorPluginContext extends PluginContext {\n document: FlowDocument;\n selection: SelectionService;\n}\n\nexport interface EditorProps<\n CTX extends EditorPluginContext = EditorPluginContext,\n JSON = FlowDocumentJSON\n> extends PlaygroundReactProps<CTX> {\n /**\n * Initialize data\n * 初始化数据\n */\n initialData?: JSON;\n /**\n * whether it is readonly\n * 是否为 readonly\n */\n readonly?: boolean;\n /**\n * node registries\n * 节点定义\n */\n nodeRegistries?: FlowNodeRegistry[];\n /**\n * Get the default node registry, which will be merged with the 'nodeRegistries'\n * 提供默认的节点注册,这个会和 nodeRegistries 做合并\n */\n getNodeDefaultRegistry?: (type: FlowNodeType) => FlowNodeRegistry;\n /**\n * Node engine configuration\n */\n nodeEngine?: NodeCorePluginOptions & {\n /**\n * Default formMeta\n */\n createDefaultFormMeta?: (node: FlowNodeEntity) => FormMetaOrFormMetaGenerator;\n /**\n * Enable node engine\n */\n enable?: boolean;\n };\n /**\n * By default, all nodes are expanded\n * 默认是否展开所有节点\n */\n allNodesDefaultExpanded?: boolean;\n /**\n * Canvas material, Used to customize react components\n * 画布物料, 用于自定义 react 组件\n */\n materials?: MaterialsPluginOptions;\n /**\n * 画布数据加载完成, 请使用 onAllLayersRendered 替代\n * @deprecated\n * */\n onLoad?: (ctx: CTX) => void;\n /**\n * 是否开启变量引擎\n * Variable engine enable\n */\n variableEngine?: VariablePluginOptions;\n /**\n * Redo/Undo enable\n */\n history?: HistoryPluginOptions<CTX> & { disableShortcuts?: boolean };\n\n /**\n * redux devtool configuration\n */\n reduxDevTool?: ReduxDevToolPluginOptions;\n\n /**\n * Scroll configuration\n * 滚动配置\n */\n scroll?: {\n enableScrollLimit?: boolean; // 开启滚动限制\n disableScrollBar?: boolean; // 关闭滚动条\n disableScroll?: boolean; // 禁止滚动\n };\n\n /**\n * Node data transformation, called by ctx.document.fromJSON\n * 节点数据转换, 由 ctx.document.fromJSON 调用\n * @param node - current node\n * @param json - Current node json data\n */\n toNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeJSON;\n /**\n * Node data transformation, called by ctx.document.toJSON\n * 节点数据转换, 由 ctx.document.toJSON 调用\n * @param node - current node\n * @param json - Current node json data\n * @param isFirstCreate - Whether it is created for the first time, If document.fromJSON is recalled, but the node already exists, isFirstCreate is false\n */\n fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): FlowNodeJSON;\n /**\n * Canvas internal constant customization\n * 画布内部常量自定义\n */\n constants?: Record<string, any>;\n /**\n * i18n\n * 国际化\n */\n i18n?: I18nPluginOptions;\n}\n\nexport namespace EditorProps {\n /**\n * 默认配置\n */\n export const DEFAULT: EditorProps = {\n background: {},\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { interfaces } from 'inversify';\nimport { FlowRendererContainerModule, FlowRendererRegistry } from '@flowgram.ai/renderer';\nimport { createReduxDevToolPlugin } from '@flowgram.ai/redux-devtool-plugin';\nimport { createNodeVariablePlugin } from '@flowgram.ai/node-variable-plugin';\nimport { createNodeCorePlugin } from '@flowgram.ai/node-core-plugin';\nimport { createMaterialsPlugin } from '@flowgram.ai/materials-plugin';\nimport { createI18nPlugin } from '@flowgram.ai/i18n-plugin';\nimport { createHistoryNodePlugin } from '@flowgram.ai/history-node-plugin';\nimport { FlowDocumentContainerModule } from '@flowgram.ai/document';\nimport { createPlaygroundPlugin, Plugin, PluginsProvider } from '@flowgram.ai/core';\n\nimport { createFlowEditorClientPlugins } from '../clients/flow-editor-client-plugins';\nimport { EditorPluginContext, EditorProps } from './editor-props';\n\nexport function createDefaultPreset<CTX extends EditorPluginContext = EditorPluginContext>(\n opts: EditorProps<CTX>,\n plugins: Plugin[] = []\n): PluginsProvider<CTX> {\n return (ctx: CTX) => {\n opts = { ...EditorProps.DEFAULT, ...opts };\n /**\n * i18n support\n */\n if (opts.i18n) {\n plugins.push(createI18nPlugin(opts.i18n));\n }\n /**\n * 默认注册顶层 flow editor client plugin\n */\n plugins.push(...createFlowEditorClientPlugins());\n\n /**\n * 注册 Redux 开发者工具\n */\n if (opts.reduxDevTool?.enable) {\n plugins.push(createReduxDevToolPlugin(opts.reduxDevTool));\n }\n\n /**\n * 注册画布模块\n */\n const defaultContainerModules: interfaces.ContainerModule[] = [\n FlowDocumentContainerModule, // 默认文档\n FlowRendererContainerModule, // 默认渲染\n ];\n /**\n * 注册物料\n */\n plugins.push(createMaterialsPlugin(opts.materials || {}));\n\n /**\n * 注册节点引擎\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n plugins.push(createNodeCorePlugin({ materials: opts.nodeEngine.materials }));\n\n if (opts.variableEngine?.enable) {\n plugins.push(createNodeVariablePlugin({}));\n }\n\n if (opts.history?.enable) {\n plugins.push(createHistoryNodePlugin({}));\n }\n }\n /**\n * 画布生命周期注册\n */\n plugins.push(\n createPlaygroundPlugin<CTX>({\n onInit: (ctx) => {\n if (opts.nodeRegistries) {\n ctx.document.registerFlowNodes(...opts.nodeRegistries);\n }\n // 自定义画布内部常量\n if (opts.constants) {\n ctx.document.options.constants = opts.constants;\n }\n if (opts.getNodeDefaultRegistry) {\n ctx.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;\n }\n // TODO\n // if (opts.onContentChange) {\n // ctx.document.onContentChange(event => opts.onContentChange!(ctx, event));\n // }\n // TODO 这个会触发组件注册,后续要废弃这个,通过 materials 插件来做\n ctx.get<FlowRendererRegistry>(FlowRendererRegistry).init();\n },\n onReady(ctx) {\n if (opts.initialData) {\n ctx.document.fromJSON(opts.initialData);\n }\n if (opts.readonly) {\n ctx.playground.config.readonly = opts.readonly;\n }\n ctx.document.load().then(() => {\n if (opts.onLoad) opts.onLoad(ctx);\n });\n },\n onDispose(ctx) {\n ctx.document.dispose();\n },\n containerModules: defaultContainerModules,\n })\n );\n\n return plugins;\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createNodeClientPlugins } from './node-client/create-node-client-plugins';\nimport { FlowEditorClient } from './flow-editor-client';\n\nexport const createFlowEditorClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(FlowEditorClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createFlowEditorClientPlugins = () => [\n ...createNodeClientPlugins(),\n createFlowEditorClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { NodeFocusService } from './node-focus-service';\nimport { NodeClient } from './node-client';\nimport { createNodeHighlightPlugin } from './highlight/create-node-highlight-plugin';\n\nexport const createNodeClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(NodeFocusService).toSelf().inSingletonScope();\n bind(NodeClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createNodeClientPlugins = () => [\n createNodeHighlightPlugin({}),\n createNodeClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { highlightFormItem, HighLightOptions } from './highlight';\n\nexport type FocusNodeCanvasOptions = PlaygroundConfigRevealOpts;\n\nexport interface FocusNodeFormItemOptions {\n canvas?: FocusNodeCanvasOptions;\n highlight?: boolean | HighLightOptions;\n}\n\n@injectable()\nexport class NodeFocusService {\n @inject(Playground) readonly playground: Playground;\n\n protected previousOverlay: HTMLDivElement | undefined;\n\n protected currentPromise: Promise<void> | undefined;\n\n highlightNodeFormItem(formItem: FormItem, options?: HighLightOptions) {\n this.previousOverlay = highlightFormItem(formItem, options);\n }\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions): Promise<void> {\n const node = formItem.formModel.flowNodeEntity;\n const { canvas = {}, highlight } = options || {};\n if (this.previousOverlay) {\n this.previousOverlay.remove();\n this.previousOverlay = undefined;\n }\n const currentPromise = this.playground\n .scrollToView({ entities: [node], scrollToCenter: true, ...canvas })\n .then(() => {\n if (!formItem || !highlight || this.currentPromise !== currentPromise) {\n return;\n }\n this.highlightNodeFormItem(formItem, typeof highlight === 'boolean' ? {} : highlight);\n });\n this.currentPromise = currentPromise;\n return this.currentPromise;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeRenderData } from '@flowgram.ai/document';\n\nimport { HIGHLIGHT_CLASSNAME } from './highlight-style';\nimport { DEFAULT_HIGHLIGHT_PADDING } from './constants';\n\nexport interface HighLightOptions {\n padding?: number;\n overlayClassName?: string;\n}\n\nexport function highlightFormItem(\n formItem: FormItem,\n options?: HighLightOptions,\n): HTMLDivElement | undefined {\n const parent =\n formItem.formModel.flowNodeEntity.getData<FlowNodeRenderData>(FlowNodeRenderData).node;\n const target = formItem.domRef.current;\n\n if (!target) {\n return undefined;\n }\n\n const overlay = document.createElement('div');\n\n const { padding = DEFAULT_HIGHLIGHT_PADDING, overlayClassName } = options || {};\n\n overlay.style.position = 'absolute';\n overlay.style.top = '0';\n overlay.style.left = '0';\n overlay.style.width = '100%';\n overlay.style.height = '100%';\n overlay.style.zIndex = '9999';\n\n parent.appendChild(overlay);\n\n const parentRect = parent.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n\n overlay.style.top = targetRect.top - parentRect.top - padding + 'px';\n overlay.style.left = targetRect.left - parentRect.left - padding + 'px';\n overlay.style.width = targetRect.width + padding * 2 + 'px';\n overlay.style.height = targetRect.height + padding * 2 + 'px';\n\n overlay.className = overlayClassName || HIGHLIGHT_CLASSNAME;\n setTimeout(() => {\n overlay.remove();\n }, 2000);\n return overlay;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const HIGHLIGHT_CLASSNAME = 'flowide-highlight';\n\nconst styleText = `\n@keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n@-webkit-keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n.${HIGHLIGHT_CLASSNAME} {\n background-color: rgba(238, 245, 40, 0.5);\n animation: flowide-fade 2s 1 forwards;\n -webkit-animation: flowide-fade 2s 1 forwards;\n}\n`;\n\nlet styleDom: HTMLStyleElement | undefined;\n\nexport function createHighlightStyle(): void {\n if (styleDom) return;\n styleDom = document.createElement('style');\n styleDom.innerHTML = styleText;\n document.head.appendChild(styleDom);\n}\n\nexport function removeHighlightStyle(): void {\n styleDom?.remove();\n styleDom = undefined;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const DEFAULT_HIGHLIGHT_COLOR = 'rgba(238, 245, 40, 0.5)';\nexport const DEFAULT_HIGHLIGHT_PADDING = 0;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useRef } from 'react';\n\nimport { FormModel } from '@flowgram.ai/form-core';\n\ninterface HighlightProps {\n form: FormModel;\n path: string;\n}\n\nexport function useHighlight(props: HighlightProps) {\n const ref = useRef<any>(null);\n const { form, path } = props;\n const formItem = form.getFormItemByPath(path);\n if (!formItem) {\n return null;\n }\n formItem.domRef = ref;\n return ref;\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 { NodeFocusService } from './node-focus-service';\n\n@injectable()\nexport class NodeClient {\n @inject(NodeFocusService) nodeFocusService: NodeFocusService;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createHighlightStyle, removeHighlightStyle } from './highlight-style';\n\nexport const createNodeHighlightPlugin = definePluginCreator<{}>({\n onInit() {\n createHighlightStyle();\n },\n onDispose() {\n removeHighlightStyle();\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';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { FocusNodeFormItemOptions, NodeClient } from './node-client';\n\ninterface FocusNodeOptions {\n zoom?: PlaygroundConfigRevealOpts['zoom'];\n easing?: PlaygroundConfigRevealOpts['easing']; // 是否开启缓动,默认开启\n easingDuration?: PlaygroundConfigRevealOpts['easingDuration']; // 默认 500 ms\n scrollToCenter?: PlaygroundConfigRevealOpts['scrollToCenter']; // 是否滚动到中心\n}\n\n@injectable()\nexport class FlowEditorClient {\n @inject(NodeClient) readonly nodeClient: NodeClient;\n\n @inject(Playground) readonly playground: Playground;\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions) {\n this.nodeClient.nodeFocusService.focusNodeFormItem(formItem, options);\n }\n\n focusNode(node: FlowNodeEntity, options?: FocusNodeOptions) {\n this.playground.scrollToView({ entities: [node], ...options });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useMemo, useCallback } from 'react';\n\nimport { interfaces } from 'inversify';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport {\n PlaygroundReactProvider,\n createPluginContextDefault,\n SelectionService,\n} from '@flowgram.ai/core';\n\nimport { EditorPluginContext, EditorProps, createDefaultPreset } from '../preset';\n\nexport const EditorProvider: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...others } = props;\n const preset = useMemo(() => createDefaultPreset(others), []);\n const customPluginContext = useCallback(\n (container: interfaces.Container) =>\n ({\n ...createPluginContextDefault(container),\n get document(): FlowDocument {\n return container.get<FlowDocument>(FlowDocument);\n },\n get selection(): SelectionService {\n return container.get<SelectionService>(SelectionService);\n },\n } as EditorPluginContext),\n []\n );\n return (\n <PlaygroundReactProvider plugins={preset} customPluginContext={customPluginContext}>\n {children}\n </PlaygroundReactProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React from 'react';\n\nimport { EditorProps } from '../preset';\nimport { EditorRenderer } from './editor-renderer';\nimport { EditorProvider } from './editor-provider';\n\n/**\n * 画布编辑器\n * @param props\n * @constructor\n */\nexport const Editor: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...otherProps } = props;\n return (\n <EditorProvider {...otherProps}>\n <EditorRenderer>{children}</EditorRenderer>\n </EditorProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { FlowEditorClient } from '../clients';\n\nexport function useFlowEditor(): FlowEditorClient {\n return useService(FlowEditorClient);\n}\n"],"mappings":";;;;;;;;;;;;AAKA,OAAO;AACP,SAAS,mBAAmB;AAG5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EAEE,cAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAAC;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB,kBAAwC;AAoBnE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;;;ACsEP,IAAU;AAAA,CAAV,CAAUC,iBAAV;AAIE,EAAMA,aAAA,UAAuB;AAAA,IAClC,YAAY,CAAC;AAAA,EACf;AAAA,GANe;;;AC9HjB,SAAS,6BAA6B,4BAA4B;AAClE,SAAS,gCAAgC;AACzC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,mCAAmC;AAC5C,SAAS,8BAAuD;;;ACThE,SAAS,uBAAAC,4BAA2B;;;ACApC,SAAS,uBAAAC,4BAA2B;;;ACApC,SAAS,YAAY,cAAc;AAEnC,SAAS,kBAA8C;;;ACDvD,SAAS,0BAA0B;;;ACD5B,IAAM,sBAAsB;AAEnC,IAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAiBf,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtB,IAAI;AAEG,SAAS,uBAA6B;AAC3C,MAAI,SAAU;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BAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIA,IAAM,iBAAwC,CAAC,UAAuB;AAC3E,QAAM,EAAE,UAAU,GAAG,OAAO,IAAI;AAChC,QAAM,SAAS,QAAQ,MAAM,oBAAoB,MAAM,GAAG,CAAC,CAAC;AAC5D,QAAM,sBAAsB;AAAA,IAC1B,CAAC,eACE;AAAA,MACC,GAAG,2BAA2B,SAAS;AAAA,MACvC,IAAI,WAAyB;AAC3B,eAAO,UAAU,IAAkB,YAAY;AAAA,MACjD;AAAA,MACA,IAAI,YAA8B;AAChC,eAAO,UAAU,IAAsB,gBAAgB;AAAA,MACzD;AAAA,IACF;AAAA,IACF,CAAC;AAAA,EACH;AACA,SACE,oCAAC,2BAAwB,SAAS,QAAQ,uBACvC,QACH;AAEJ;;;ACjCA,SAAoC,+BAAsB;;;ACA1D,OAAOC,YAAW;AAWX,IAAM,SAAgC,CAAC,UAAuB;AACnE,QAAM,EAAE,UAAU,GAAG,WAAW,IAAI;AACpC,SACE,gBAAAC,OAAA,cAAC,kBAAgB,GAAG,cAClB,gBAAAA,OAAA,cAAC,+BAAgB,QAAS,CAC5B;AAEJ;;;AClBA,SAAS,kBAAkB;AAIpB,SAAS,gBAAkC;AAChD,SAAO,WAAW,gBAAgB;AACpC;;;AhBkEA,cAAc;AAEd,SAAS,mCAAmC;","names":["injectable","inject","EditorProps","definePluginCreator","definePluginCreator","injectable","inject","inject","injectable","definePluginCreator","injectable","inject","Playground","inject","Playground","injectable","definePluginCreator","ctx","React","React"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/preset/editor-props.ts","../../src/preset/editor-default-preset.ts","../../src/clients/flow-editor-client-plugins.ts","../../src/clients/node-client/create-node-client-plugins.ts","../../src/clients/node-client/node-focus-service.ts","../../src/clients/node-client/highlight/highlight-form-item.ts","../../src/clients/node-client/highlight/highlight-style.ts","../../src/clients/node-client/highlight/constants.ts","../../src/clients/node-client/highlight/use-highlight.ts","../../src/clients/node-client/node-client.ts","../../src/clients/node-client/highlight/create-node-highlight-plugin.ts","../../src/clients/flow-editor-client.ts","../../src/components/editor-provider.tsx","../../src/components/editor-renderer.tsx","../../src/components/editor.tsx","../../src/hooks/use-flow-editor.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport 'reflect-metadata';\nimport { FormModelV2 } from '@flowgram.ai/node';\n\n/* 核心 模块导出 */\nexport * from '@flowgram.ai/utils';\nexport * from '@flowgram.ai/core';\nexport * from '@flowgram.ai/document';\nexport * from '@flowgram.ai/renderer';\nexport * from '@flowgram.ai/variable-plugin';\nexport * from '@flowgram.ai/shortcuts-plugin';\nexport * from '@flowgram.ai/node-core-plugin';\nexport * from '@flowgram.ai/i18n-plugin';\nexport {\n ReactiveState,\n ReactiveBaseState,\n Tracker,\n useReactiveState,\n useReadonlyReactiveState,\n useObserve,\n observe,\n} from '@flowgram.ai/reactive';\nexport {\n type interfaces,\n injectable,\n postConstruct,\n named,\n Container,\n ContainerModule,\n AsyncContainerModule,\n inject,\n multiInject,\n} from 'inversify';\n\nexport { FlowNodeFormData, NodeRender, type NodeRenderProps } from '@flowgram.ai/form-core';\n\nexport type {\n FormState,\n FieldState,\n FieldArrayRenderProps,\n FieldRenderProps,\n FormRenderProps,\n Validate,\n FormControl,\n FieldName,\n FieldError,\n FieldWarning,\n IField,\n IFieldArray,\n IForm,\n Errors,\n Warnings,\n} from '@flowgram.ai/form';\n\nexport {\n Form,\n Field,\n FieldArray,\n useForm,\n useField,\n useCurrentField,\n useCurrentFieldState,\n useFieldValidate,\n useWatch,\n ValidateTrigger,\n FeedbackLevel,\n} from '@flowgram.ai/form';\nexport * from '@flowgram.ai/node';\nexport { FormModelV2 as FormModel };\n\n/**\n * 固定布局模块导出\n */\nexport * from './preset';\nexport * from './components';\nexport * from './hooks';\nexport * from './clients';\n\n/**\n * Plugin 导出\n */\n\nexport * from '@flowgram.ai/node-variable-plugin';\n\nexport { createPlaygroundReactPreset } from '@flowgram.ai/playground-react';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeScope, VariablePluginOptions } from '@flowgram.ai/variable-plugin';\nimport { ReduxDevToolPluginOptions } from '@flowgram.ai/redux-devtool-plugin';\nimport { PlaygroundReactProps, SelectionService } from '@flowgram.ai/playground-react';\nimport { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';\nimport { type NodeFormProps } from '@flowgram.ai/node';\nimport { MaterialsPluginOptions } from '@flowgram.ai/materials-plugin';\nimport { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';\nimport { HistoryPluginOptions } from '@flowgram.ai/history';\nimport { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';\nimport {\n FlowDocument,\n FlowDocumentJSON,\n FlowNodeEntity,\n type FlowNodeJSON,\n FlowNodeRegistry,\n FlowNodeType,\n} from '@flowgram.ai/document';\nimport { PluginContext } from '@flowgram.ai/core';\n\ndeclare module '@flowgram.ai/document' {\n interface FlowNodeEntity {\n form: NodeFormProps<any> | undefined;\n scope: FlowNodeScope | undefined;\n privateScope: FlowNodeScope | undefined;\n }\n}\n\nexport interface EditorPluginContext extends PluginContext {\n document: FlowDocument;\n selection: SelectionService;\n}\n\nexport interface EditorProps<\n CTX extends EditorPluginContext = EditorPluginContext,\n JSON = FlowDocumentJSON\n> extends PlaygroundReactProps<CTX> {\n /**\n * Initialize data\n * 初始化数据\n */\n initialData?: JSON;\n /**\n * whether it is readonly\n * 是否为 readonly\n */\n readonly?: boolean;\n /**\n * node registries\n * 节点定义\n */\n nodeRegistries?: FlowNodeRegistry[];\n /**\n * Get the default node registry, which will be merged with the 'nodeRegistries'\n * 提供默认的节点注册,这个会和 nodeRegistries 做合并\n */\n getNodeDefaultRegistry?: (type: FlowNodeType) => FlowNodeRegistry;\n /**\n * Node engine configuration\n */\n nodeEngine?: NodeCorePluginOptions & {\n /**\n * Default formMeta\n */\n createDefaultFormMeta?: (node: FlowNodeEntity) => FormMetaOrFormMetaGenerator;\n /**\n * Enable node engine\n */\n enable?: boolean;\n };\n /**\n * By default, all nodes are expanded\n * 默认是否展开所有节点\n */\n allNodesDefaultExpanded?: boolean;\n /**\n * Canvas material, Used to customize react components\n * 画布物料, 用于自定义 react 组件\n */\n materials?: MaterialsPluginOptions;\n /**\n * 画布数据加载完成, 请使用 onAllLayersRendered 替代\n * @deprecated\n * */\n onLoad?: (ctx: CTX) => void;\n /**\n * 是否开启变量引擎\n * Variable engine enable\n */\n variableEngine?: VariablePluginOptions;\n /**\n * Redo/Undo enable\n */\n history?: HistoryPluginOptions<CTX> & { disableShortcuts?: boolean };\n\n /**\n * redux devtool configuration\n */\n reduxDevTool?: ReduxDevToolPluginOptions;\n\n /**\n * Scroll configuration\n * 滚动配置\n */\n scroll?: {\n enableScrollLimit?: boolean; // 开启滚动限制\n disableScrollBar?: boolean; // 关闭滚动条\n disableScroll?: boolean; // 禁止滚动\n };\n\n /**\n * Node data transformation, called by ctx.document.fromJSON\n * 节点数据转换, 由 ctx.document.fromJSON 调用\n * @param node - current node\n * @param json - Current node json data\n */\n toNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeJSON;\n /**\n * Node data transformation, called by ctx.document.toJSON\n * 节点数据转换, 由 ctx.document.toJSON 调用\n * @param node - current node\n * @param json - Current node json data\n * @param isFirstCreate - Whether it is created for the first time, If document.fromJSON is recalled, but the node already exists, isFirstCreate is false\n */\n fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): FlowNodeJSON;\n /**\n * Canvas internal constant customization\n * 画布内部常量自定义\n */\n constants?: Record<string, any>;\n /**\n * i18n\n * 国际化\n */\n i18n?: I18nPluginOptions;\n}\n\nexport namespace EditorProps {\n /**\n * 默认配置\n */\n export const DEFAULT: EditorProps = {\n background: {},\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { interfaces } from 'inversify';\nimport { FlowNodeScope, getNodePrivateScope, getNodeScope } from '@flowgram.ai/variable-plugin';\nimport { FlowRendererContainerModule, FlowRendererRegistry } from '@flowgram.ai/renderer';\nimport { createReduxDevToolPlugin } from '@flowgram.ai/redux-devtool-plugin';\nimport { createNodeVariablePlugin } from '@flowgram.ai/node-variable-plugin';\nimport { createNodeCorePlugin } from '@flowgram.ai/node-core-plugin';\nimport { getNodeForm, NodeFormProps } from '@flowgram.ai/node';\nimport { createMaterialsPlugin } from '@flowgram.ai/materials-plugin';\nimport { createI18nPlugin } from '@flowgram.ai/i18n-plugin';\nimport { createHistoryNodePlugin } from '@flowgram.ai/history-node-plugin';\nimport { FlowDocumentContainerModule } from '@flowgram.ai/document';\nimport { createPlaygroundPlugin, Plugin, PluginsProvider } from '@flowgram.ai/core';\n\nimport { createFlowEditorClientPlugins } from '../clients/flow-editor-client-plugins';\nimport { EditorPluginContext, EditorProps } from './editor-props';\n\nexport function createDefaultPreset<CTX extends EditorPluginContext = EditorPluginContext>(\n opts: EditorProps<CTX>,\n plugins: Plugin[] = []\n): PluginsProvider<CTX> {\n return (ctx: CTX) => {\n opts = { ...EditorProps.DEFAULT, ...opts };\n /**\n * i18n support\n */\n if (opts.i18n) {\n plugins.push(createI18nPlugin(opts.i18n));\n }\n /**\n * 默认注册顶层 flow editor client plugin\n */\n plugins.push(...createFlowEditorClientPlugins());\n\n /**\n * 注册 Redux 开发者工具\n */\n if (opts.reduxDevTool?.enable) {\n plugins.push(createReduxDevToolPlugin(opts.reduxDevTool));\n }\n\n /**\n * 注册画布模块\n */\n const defaultContainerModules: interfaces.ContainerModule[] = [\n FlowDocumentContainerModule, // 默认文档\n FlowRendererContainerModule, // 默认渲染\n ];\n /**\n * 注册物料\n */\n plugins.push(createMaterialsPlugin(opts.materials || {}));\n\n /**\n * 注册节点引擎\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n plugins.push(createNodeCorePlugin({ materials: opts.nodeEngine.materials }));\n\n if (opts.variableEngine?.enable) {\n plugins.push(createNodeVariablePlugin({}));\n }\n\n if (opts.history?.enable) {\n plugins.push(createHistoryNodePlugin({}));\n }\n }\n /**\n * 画布生命周期注册\n */\n plugins.push(\n createPlaygroundPlugin<CTX>({\n onInit: (ctx) => {\n if (opts.nodeRegistries) {\n ctx.document.registerFlowNodes(...opts.nodeRegistries);\n }\n // 自定义画布内部常量\n if (opts.constants) {\n ctx.document.options.constants = opts.constants;\n }\n if (opts.getNodeDefaultRegistry) {\n ctx.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;\n }\n ctx.document.options.preNodeCreate = (node) => {\n /**\n * Define node.form\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n let cache: NodeFormProps<any> | undefined;\n Object.defineProperty(node, 'form', {\n get: () => {\n if (cache) return cache;\n cache = getNodeForm(node);\n return cache;\n },\n });\n }\n\n /**\n * Define node.scope & node.privateScope\n */\n if (opts.variableEngine && opts.variableEngine.enable !== false) {\n let cache: FlowNodeScope | undefined;\n let privateCache: FlowNodeScope | undefined;\n\n Object.defineProperty(node, 'scope', {\n get: () => {\n if (cache) return cache;\n cache = getNodeScope(node);\n return cache;\n },\n });\n Object.defineProperty(node, 'privateScope', {\n get: () => {\n if (privateCache) return privateCache;\n privateCache = getNodePrivateScope(node);\n return privateCache;\n },\n });\n }\n };\n ctx.get<FlowRendererRegistry>(FlowRendererRegistry).init();\n },\n onReady(ctx) {\n if (opts.initialData) {\n ctx.document.fromJSON(opts.initialData);\n }\n if (opts.readonly) {\n ctx.playground.config.readonly = opts.readonly;\n }\n ctx.document.load().then(() => {\n if (opts.onLoad) opts.onLoad(ctx);\n });\n },\n onDispose(ctx) {\n ctx.document.dispose();\n },\n containerModules: defaultContainerModules,\n })\n );\n\n return plugins;\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createNodeClientPlugins } from './node-client/create-node-client-plugins';\nimport { FlowEditorClient } from './flow-editor-client';\n\nexport const createFlowEditorClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(FlowEditorClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createFlowEditorClientPlugins = () => [\n ...createNodeClientPlugins(),\n createFlowEditorClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { NodeFocusService } from './node-focus-service';\nimport { NodeClient } from './node-client';\nimport { createNodeHighlightPlugin } from './highlight/create-node-highlight-plugin';\n\nexport const createNodeClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(NodeFocusService).toSelf().inSingletonScope();\n bind(NodeClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createNodeClientPlugins = () => [\n createNodeHighlightPlugin({}),\n createNodeClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { highlightFormItem, HighLightOptions } from './highlight';\n\nexport type FocusNodeCanvasOptions = PlaygroundConfigRevealOpts;\n\nexport interface FocusNodeFormItemOptions {\n canvas?: FocusNodeCanvasOptions;\n highlight?: boolean | HighLightOptions;\n}\n\n@injectable()\nexport class NodeFocusService {\n @inject(Playground) readonly playground: Playground;\n\n protected previousOverlay: HTMLDivElement | undefined;\n\n protected currentPromise: Promise<void> | undefined;\n\n highlightNodeFormItem(formItem: FormItem, options?: HighLightOptions) {\n this.previousOverlay = highlightFormItem(formItem, options);\n }\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions): Promise<void> {\n const node = formItem.formModel.flowNodeEntity;\n const { canvas = {}, highlight } = options || {};\n if (this.previousOverlay) {\n this.previousOverlay.remove();\n this.previousOverlay = undefined;\n }\n const currentPromise = this.playground\n .scrollToView({ entities: [node], scrollToCenter: true, ...canvas })\n .then(() => {\n if (!formItem || !highlight || this.currentPromise !== currentPromise) {\n return;\n }\n this.highlightNodeFormItem(formItem, typeof highlight === 'boolean' ? {} : highlight);\n });\n this.currentPromise = currentPromise;\n return this.currentPromise;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeRenderData } from '@flowgram.ai/document';\n\nimport { HIGHLIGHT_CLASSNAME } from './highlight-style';\nimport { DEFAULT_HIGHLIGHT_PADDING } from './constants';\n\nexport interface HighLightOptions {\n padding?: number;\n overlayClassName?: string;\n}\n\nexport function highlightFormItem(\n formItem: FormItem,\n options?: HighLightOptions,\n): HTMLDivElement | undefined {\n const parent =\n formItem.formModel.flowNodeEntity.getData<FlowNodeRenderData>(FlowNodeRenderData).node;\n const target = formItem.domRef.current;\n\n if (!target) {\n return undefined;\n }\n\n const overlay = document.createElement('div');\n\n const { padding = DEFAULT_HIGHLIGHT_PADDING, overlayClassName } = options || {};\n\n overlay.style.position = 'absolute';\n overlay.style.top = '0';\n overlay.style.left = '0';\n overlay.style.width = '100%';\n overlay.style.height = '100%';\n overlay.style.zIndex = '9999';\n\n parent.appendChild(overlay);\n\n const parentRect = parent.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n\n overlay.style.top = targetRect.top - parentRect.top - padding + 'px';\n overlay.style.left = targetRect.left - parentRect.left - padding + 'px';\n overlay.style.width = targetRect.width + padding * 2 + 'px';\n overlay.style.height = targetRect.height + padding * 2 + 'px';\n\n overlay.className = overlayClassName || HIGHLIGHT_CLASSNAME;\n setTimeout(() => {\n overlay.remove();\n }, 2000);\n return overlay;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const HIGHLIGHT_CLASSNAME = 'flowide-highlight';\n\nconst styleText = `\n@keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n@-webkit-keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n.${HIGHLIGHT_CLASSNAME} {\n background-color: rgba(238, 245, 40, 0.5);\n animation: flowide-fade 2s 1 forwards;\n -webkit-animation: flowide-fade 2s 1 forwards;\n}\n`;\n\nlet styleDom: HTMLStyleElement | undefined;\n\nexport function createHighlightStyle(): void {\n if (styleDom) return;\n styleDom = document.createElement('style');\n styleDom.innerHTML = styleText;\n document.head.appendChild(styleDom);\n}\n\nexport function removeHighlightStyle(): void {\n styleDom?.remove();\n styleDom = undefined;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const DEFAULT_HIGHLIGHT_COLOR = 'rgba(238, 245, 40, 0.5)';\nexport const DEFAULT_HIGHLIGHT_PADDING = 0;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useRef } from 'react';\n\nimport { FormModel } from '@flowgram.ai/form-core';\n\ninterface HighlightProps {\n form: FormModel;\n path: string;\n}\n\nexport function useHighlight(props: HighlightProps) {\n const ref = useRef<any>(null);\n const { form, path } = props;\n const formItem = form.getFormItemByPath(path);\n if (!formItem) {\n return null;\n }\n formItem.domRef = ref;\n return ref;\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 { NodeFocusService } from './node-focus-service';\n\n@injectable()\nexport class NodeClient {\n @inject(NodeFocusService) nodeFocusService: NodeFocusService;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createHighlightStyle, removeHighlightStyle } from './highlight-style';\n\nexport const createNodeHighlightPlugin = definePluginCreator<{}>({\n onInit() {\n createHighlightStyle();\n },\n onDispose() {\n removeHighlightStyle();\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';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { FocusNodeFormItemOptions, NodeClient } from './node-client';\n\ninterface FocusNodeOptions {\n zoom?: PlaygroundConfigRevealOpts['zoom'];\n easing?: PlaygroundConfigRevealOpts['easing']; // 是否开启缓动,默认开启\n easingDuration?: PlaygroundConfigRevealOpts['easingDuration']; // 默认 500 ms\n scrollToCenter?: PlaygroundConfigRevealOpts['scrollToCenter']; // 是否滚动到中心\n}\n\n@injectable()\nexport class FlowEditorClient {\n @inject(NodeClient) readonly nodeClient: NodeClient;\n\n @inject(Playground) readonly playground: Playground;\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions) {\n this.nodeClient.nodeFocusService.focusNodeFormItem(formItem, options);\n }\n\n focusNode(node: FlowNodeEntity, options?: FocusNodeOptions) {\n this.playground.scrollToView({ entities: [node], ...options });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useMemo, useCallback } from 'react';\n\nimport { interfaces } from 'inversify';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport {\n PlaygroundReactProvider,\n createPluginContextDefault,\n SelectionService,\n} from '@flowgram.ai/core';\n\nimport { EditorPluginContext, EditorProps, createDefaultPreset } from '../preset';\n\nexport const EditorProvider: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...others } = props;\n const preset = useMemo(() => createDefaultPreset(others), []);\n const customPluginContext = useCallback(\n (container: interfaces.Container) =>\n ({\n ...createPluginContextDefault(container),\n get document(): FlowDocument {\n return container.get<FlowDocument>(FlowDocument);\n },\n get selection(): SelectionService {\n return container.get<SelectionService>(SelectionService);\n },\n } as EditorPluginContext),\n []\n );\n return (\n <PlaygroundReactProvider plugins={preset} customPluginContext={customPluginContext}>\n {children}\n </PlaygroundReactProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React from 'react';\n\nimport { EditorProps } from '../preset';\nimport { EditorRenderer } from './editor-renderer';\nimport { EditorProvider } from './editor-provider';\n\n/**\n * 画布编辑器\n * @param props\n * @constructor\n */\nexport const Editor: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...otherProps } = props;\n return (\n <EditorProvider {...otherProps}>\n <EditorRenderer>{children}</EditorRenderer>\n </EditorProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { FlowEditorClient } from '../clients';\n\nexport function useFlowEditor(): FlowEditorClient {\n return useService(FlowEditorClient);\n}\n"],"mappings":";;;;;;;;;;;;AAKA,OAAO;AACP,SAAS,mBAAmB;AAG5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE,cAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAAC;AA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CAAmC;","names":["injectable","inject","EditorProps","definePluginCreator","definePluginCreator","injectable","inject","inject","injectable","definePluginCreator","injectable","inject","Playground","inject","Playground","injectable","definePluginCreator","ctx","React","React"]}
package/dist/index.d.mts CHANGED
@@ -1,20 +1,22 @@
1
+ import { NodeFormProps } from '@flowgram.ai/node';
1
2
  export * from '@flowgram.ai/node';
2
3
  export { FormModelV2 as FormModel } from '@flowgram.ai/node';
3
4
  export * from '@flowgram.ai/utils';
4
5
  import * as _flowgram_ai_core from '@flowgram.ai/core';
5
- import { PluginContext, Plugin, PluginsProvider, PlaygroundConfigRevealOpts, Playground } from '@flowgram.ai/core';
6
+ import { PluginContext, Plugin, PluginsProvider, Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';
6
7
  export * from '@flowgram.ai/core';
7
8
  export { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';
8
9
  import { FlowDocument, FlowDocumentJSON, FlowNodeRegistry, FlowNodeType, FlowNodeEntity, FlowNodeJSON } from '@flowgram.ai/document';
9
10
  export * from '@flowgram.ai/document';
10
11
  export * from '@flowgram.ai/renderer';
11
- import { VariablePluginOptions } from '@flowgram.ai/variable-plugin';
12
+ import { FlowNodeScope, VariablePluginOptions } from '@flowgram.ai/variable-plugin';
12
13
  export * from '@flowgram.ai/variable-plugin';
13
14
  export * from '@flowgram.ai/shortcuts-plugin';
14
15
  import { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';
15
16
  export * from '@flowgram.ai/node-core-plugin';
16
17
  import { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';
17
18
  export * from '@flowgram.ai/i18n-plugin';
19
+ export { ReactiveBaseState, ReactiveState, Tracker, observe, useObserve, useReactiveState, useReadonlyReactiveState } from '@flowgram.ai/reactive';
18
20
  export { AsyncContainerModule, Container, ContainerModule, inject, injectable, interfaces, multiInject, named, postConstruct } from 'inversify';
19
21
  import { FormMetaOrFormMetaGenerator, FormItem, FormModel } from '@flowgram.ai/form-core';
20
22
  export { FlowNodeFormData, NodeRender, NodeRenderProps } from '@flowgram.ai/form-core';
@@ -33,6 +35,13 @@ export * from '@flowgram.ai/node-variable-plugin';
33
35
  * SPDX-License-Identifier: MIT
34
36
  */
35
37
 
38
+ declare module '@flowgram.ai/document' {
39
+ interface FlowNodeEntity {
40
+ form: NodeFormProps<any> | undefined;
41
+ scope: FlowNodeScope | undefined;
42
+ privateScope: FlowNodeScope | undefined;
43
+ }
44
+ }
36
45
  interface EditorPluginContext extends PluginContext {
37
46
  document: FlowDocument;
38
47
  selection: SelectionService;
package/dist/index.d.ts CHANGED
@@ -1,20 +1,22 @@
1
+ import { NodeFormProps } from '@flowgram.ai/node';
1
2
  export * from '@flowgram.ai/node';
2
3
  export { FormModelV2 as FormModel } from '@flowgram.ai/node';
3
4
  export * from '@flowgram.ai/utils';
4
5
  import * as _flowgram_ai_core from '@flowgram.ai/core';
5
- import { PluginContext, Plugin, PluginsProvider, PlaygroundConfigRevealOpts, Playground } from '@flowgram.ai/core';
6
+ import { PluginContext, Plugin, PluginsProvider, Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';
6
7
  export * from '@flowgram.ai/core';
7
8
  export { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';
8
9
  import { FlowDocument, FlowDocumentJSON, FlowNodeRegistry, FlowNodeType, FlowNodeEntity, FlowNodeJSON } from '@flowgram.ai/document';
9
10
  export * from '@flowgram.ai/document';
10
11
  export * from '@flowgram.ai/renderer';
11
- import { VariablePluginOptions } from '@flowgram.ai/variable-plugin';
12
+ import { FlowNodeScope, VariablePluginOptions } from '@flowgram.ai/variable-plugin';
12
13
  export * from '@flowgram.ai/variable-plugin';
13
14
  export * from '@flowgram.ai/shortcuts-plugin';
14
15
  import { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';
15
16
  export * from '@flowgram.ai/node-core-plugin';
16
17
  import { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';
17
18
  export * from '@flowgram.ai/i18n-plugin';
19
+ export { ReactiveBaseState, ReactiveState, Tracker, observe, useObserve, useReactiveState, useReadonlyReactiveState } from '@flowgram.ai/reactive';
18
20
  export { AsyncContainerModule, Container, ContainerModule, inject, injectable, interfaces, multiInject, named, postConstruct } from 'inversify';
19
21
  import { FormMetaOrFormMetaGenerator, FormItem, FormModel } from '@flowgram.ai/form-core';
20
22
  export { FlowNodeFormData, NodeRender, NodeRenderProps } from '@flowgram.ai/form-core';
@@ -33,6 +35,13 @@ export * from '@flowgram.ai/node-variable-plugin';
33
35
  * SPDX-License-Identifier: MIT
34
36
  */
35
37
 
38
+ declare module '@flowgram.ai/document' {
39
+ interface FlowNodeEntity {
40
+ form: NodeFormProps<any> | undefined;
41
+ scope: FlowNodeScope | undefined;
42
+ privateScope: FlowNodeScope | undefined;
43
+ }
44
+ }
36
45
  interface EditorPluginContext extends PluginContext {
37
46
  document: FlowDocument;
38
47
  selection: SelectionService;
package/dist/index.js CHANGED
@@ -37,8 +37,8 @@ var __decorateClass = (decorators, target, key, kind) => {
37
37
  };
38
38
 
39
39
  // src/index.ts
40
- var src_exports = {};
41
- __export(src_exports, {
40
+ var index_exports = {};
41
+ __export(index_exports, {
42
42
  AsyncContainerModule: () => import_inversify4.AsyncContainerModule,
43
43
  Container: () => import_inversify4.Container,
44
44
  ContainerModule: () => import_inversify4.ContainerModule,
@@ -52,10 +52,13 @@ __export(src_exports, {
52
52
  FlowEditorClient: () => FlowEditorClient,
53
53
  FlowNodeFormData: () => import_form_core.FlowNodeFormData,
54
54
  Form: () => import_form.Form,
55
- FormModel: () => import_node.FormModelV2,
55
+ FormModel: () => import_node2.FormModelV2,
56
56
  NodeClient: () => NodeClient,
57
57
  NodeFocusService: () => NodeFocusService,
58
58
  NodeRender: () => import_form_core.NodeRender,
59
+ ReactiveBaseState: () => import_reactive.ReactiveBaseState,
60
+ ReactiveState: () => import_reactive.ReactiveState,
61
+ Tracker: () => import_reactive.Tracker,
59
62
  ValidateTrigger: () => import_form.ValidateTrigger,
60
63
  createDefaultPreset: () => createDefaultPreset,
61
64
  createFlowEditorClientPlugin: () => createFlowEditorClientPlugin,
@@ -66,6 +69,7 @@ __export(src_exports, {
66
69
  injectable: () => import_inversify4.injectable,
67
70
  multiInject: () => import_inversify4.multiInject,
68
71
  named: () => import_inversify4.named,
72
+ observe: () => import_reactive.observe,
69
73
  postConstruct: () => import_inversify4.postConstruct,
70
74
  useCurrentField: () => import_form.useCurrentField,
71
75
  useCurrentFieldState: () => import_form.useCurrentFieldState,
@@ -74,23 +78,27 @@ __export(src_exports, {
74
78
  useFlowEditor: () => useFlowEditor,
75
79
  useForm: () => import_form.useForm,
76
80
  useHighlight: () => useHighlight,
81
+ useObserve: () => import_reactive.useObserve,
82
+ useReactiveState: () => import_reactive.useReactiveState,
83
+ useReadonlyReactiveState: () => import_reactive.useReadonlyReactiveState,
77
84
  useWatch: () => import_form.useWatch
78
85
  });
79
- module.exports = __toCommonJS(src_exports);
86
+ module.exports = __toCommonJS(index_exports);
80
87
  var import_reflect_metadata = require("reflect-metadata");
81
- var import_node = require("@flowgram.ai/node");
82
- __reExport(src_exports, require("@flowgram.ai/utils"), module.exports);
83
- __reExport(src_exports, require("@flowgram.ai/core"), module.exports);
84
- __reExport(src_exports, require("@flowgram.ai/document"), module.exports);
85
- __reExport(src_exports, require("@flowgram.ai/renderer"), module.exports);
86
- __reExport(src_exports, require("@flowgram.ai/variable-plugin"), module.exports);
87
- __reExport(src_exports, require("@flowgram.ai/shortcuts-plugin"), module.exports);
88
- __reExport(src_exports, require("@flowgram.ai/node-core-plugin"), module.exports);
89
- __reExport(src_exports, require("@flowgram.ai/i18n-plugin"), module.exports);
88
+ var import_node2 = require("@flowgram.ai/node");
89
+ __reExport(index_exports, require("@flowgram.ai/utils"), module.exports);
90
+ __reExport(index_exports, require("@flowgram.ai/core"), module.exports);
91
+ __reExport(index_exports, require("@flowgram.ai/document"), module.exports);
92
+ __reExport(index_exports, require("@flowgram.ai/renderer"), module.exports);
93
+ __reExport(index_exports, require("@flowgram.ai/variable-plugin"), module.exports);
94
+ __reExport(index_exports, require("@flowgram.ai/shortcuts-plugin"), module.exports);
95
+ __reExport(index_exports, require("@flowgram.ai/node-core-plugin"), module.exports);
96
+ __reExport(index_exports, require("@flowgram.ai/i18n-plugin"), module.exports);
97
+ var import_reactive = require("@flowgram.ai/reactive");
90
98
  var import_inversify4 = require("inversify");
91
99
  var import_form_core = require("@flowgram.ai/form-core");
92
100
  var import_form = require("@flowgram.ai/form");
93
- __reExport(src_exports, require("@flowgram.ai/node"), module.exports);
101
+ __reExport(index_exports, require("@flowgram.ai/node"), module.exports);
94
102
 
95
103
  // src/preset/editor-props.ts
96
104
  var EditorProps;
@@ -101,10 +109,12 @@ var EditorProps;
101
109
  })(EditorProps || (EditorProps = {}));
102
110
 
103
111
  // src/preset/editor-default-preset.ts
112
+ var import_variable_plugin = require("@flowgram.ai/variable-plugin");
104
113
  var import_renderer = require("@flowgram.ai/renderer");
105
114
  var import_redux_devtool_plugin = require("@flowgram.ai/redux-devtool-plugin");
106
115
  var import_node_variable_plugin = require("@flowgram.ai/node-variable-plugin");
107
116
  var import_node_core_plugin = require("@flowgram.ai/node-core-plugin");
117
+ var import_node = require("@flowgram.ai/node");
108
118
  var import_materials_plugin = require("@flowgram.ai/materials-plugin");
109
119
  var import_i18n_plugin = require("@flowgram.ai/i18n-plugin");
110
120
  var import_history_node_plugin = require("@flowgram.ai/history-node-plugin");
@@ -340,6 +350,36 @@ function createDefaultPreset(opts, plugins = []) {
340
350
  if (opts.getNodeDefaultRegistry) {
341
351
  ctx2.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;
342
352
  }
353
+ ctx2.document.options.preNodeCreate = (node) => {
354
+ if (opts.nodeEngine && opts.nodeEngine.enable !== false) {
355
+ let cache;
356
+ Object.defineProperty(node, "form", {
357
+ get: () => {
358
+ if (cache) return cache;
359
+ cache = (0, import_node.getNodeForm)(node);
360
+ return cache;
361
+ }
362
+ });
363
+ }
364
+ if (opts.variableEngine && opts.variableEngine.enable !== false) {
365
+ let cache;
366
+ let privateCache;
367
+ Object.defineProperty(node, "scope", {
368
+ get: () => {
369
+ if (cache) return cache;
370
+ cache = (0, import_variable_plugin.getNodeScope)(node);
371
+ return cache;
372
+ }
373
+ });
374
+ Object.defineProperty(node, "privateScope", {
375
+ get: () => {
376
+ if (privateCache) return privateCache;
377
+ privateCache = (0, import_variable_plugin.getNodePrivateScope)(node);
378
+ return privateCache;
379
+ }
380
+ });
381
+ }
382
+ };
343
383
  ctx2.get(import_renderer.FlowRendererRegistry).init();
344
384
  },
345
385
  onReady(ctx2) {
@@ -402,7 +442,7 @@ function useFlowEditor() {
402
442
  }
403
443
 
404
444
  // src/index.ts
405
- __reExport(src_exports, require("@flowgram.ai/node-variable-plugin"), module.exports);
445
+ __reExport(index_exports, require("@flowgram.ai/node-variable-plugin"), module.exports);
406
446
  var import_playground_react = require("@flowgram.ai/playground-react");
407
447
  // Annotate the CommonJS export names for ESM import in node:
408
448
  0 && (module.exports = {
@@ -423,6 +463,9 @@ var import_playground_react = require("@flowgram.ai/playground-react");
423
463
  NodeClient,
424
464
  NodeFocusService,
425
465
  NodeRender,
466
+ ReactiveBaseState,
467
+ ReactiveState,
468
+ Tracker,
426
469
  ValidateTrigger,
427
470
  createDefaultPreset,
428
471
  createFlowEditorClientPlugin,
@@ -433,6 +476,7 @@ var import_playground_react = require("@flowgram.ai/playground-react");
433
476
  injectable,
434
477
  multiInject,
435
478
  named,
479
+ observe,
436
480
  postConstruct,
437
481
  useCurrentField,
438
482
  useCurrentFieldState,
@@ -441,6 +485,9 @@ var import_playground_react = require("@flowgram.ai/playground-react");
441
485
  useFlowEditor,
442
486
  useForm,
443
487
  useHighlight,
488
+ useObserve,
489
+ useReactiveState,
490
+ useReadonlyReactiveState,
444
491
  useWatch,
445
492
  ...require("@flowgram.ai/utils"),
446
493
  ...require("@flowgram.ai/core"),
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/preset/editor-props.ts","../src/preset/editor-default-preset.ts","../src/clients/flow-editor-client-plugins.ts","../src/clients/node-client/create-node-client-plugins.ts","../src/clients/node-client/node-focus-service.ts","../src/clients/node-client/highlight/highlight-form-item.ts","../src/clients/node-client/highlight/highlight-style.ts","../src/clients/node-client/highlight/constants.ts","../src/clients/node-client/highlight/use-highlight.ts","../src/clients/node-client/node-client.ts","../src/clients/node-client/highlight/create-node-highlight-plugin.ts","../src/clients/flow-editor-client.ts","../src/components/editor-provider.tsx","../src/components/editor-renderer.tsx","../src/components/editor.tsx","../src/hooks/use-flow-editor.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport 'reflect-metadata';\nimport { FormModelV2 } from '@flowgram.ai/node';\n\n/* 核心 模块导出 */\nexport * from '@flowgram.ai/utils';\nexport * from '@flowgram.ai/core';\nexport * from '@flowgram.ai/document';\nexport * from '@flowgram.ai/renderer';\nexport * from '@flowgram.ai/variable-plugin';\nexport * from '@flowgram.ai/shortcuts-plugin';\nexport * from '@flowgram.ai/node-core-plugin';\nexport * from '@flowgram.ai/i18n-plugin';\nexport {\n type interfaces,\n injectable,\n postConstruct,\n named,\n Container,\n ContainerModule,\n AsyncContainerModule,\n inject,\n multiInject,\n} from 'inversify';\n\nexport { FlowNodeFormData, NodeRender, type NodeRenderProps } from '@flowgram.ai/form-core';\n\nexport type {\n FormState,\n FieldState,\n FieldArrayRenderProps,\n FieldRenderProps,\n FormRenderProps,\n Validate,\n FormControl,\n FieldName,\n FieldError,\n FieldWarning,\n IField,\n IFieldArray,\n IForm,\n Errors,\n Warnings,\n} from '@flowgram.ai/form';\n\nexport {\n Form,\n Field,\n FieldArray,\n useForm,\n useField,\n useCurrentField,\n useCurrentFieldState,\n useFieldValidate,\n useWatch,\n ValidateTrigger,\n FeedbackLevel,\n} from '@flowgram.ai/form';\nexport * from '@flowgram.ai/node';\nexport { FormModelV2 as FormModel };\n\n/**\n * 固定布局模块导出\n */\nexport * from './preset';\nexport * from './components';\nexport * from './hooks';\nexport * from './clients';\n\n/**\n * Plugin 导出\n */\n\nexport * from '@flowgram.ai/node-variable-plugin';\n\nexport { createPlaygroundReactPreset } from '@flowgram.ai/playground-react';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { VariablePluginOptions } from '@flowgram.ai/variable-plugin';\nimport { ReduxDevToolPluginOptions } from '@flowgram.ai/redux-devtool-plugin';\nimport { PlaygroundReactProps, SelectionService } from '@flowgram.ai/playground-react';\nimport { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';\nimport { MaterialsPluginOptions } from '@flowgram.ai/materials-plugin';\nimport { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';\nimport { HistoryPluginOptions } from '@flowgram.ai/history';\nimport { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';\nimport {\n FlowDocument,\n FlowDocumentJSON,\n FlowNodeEntity,\n type FlowNodeJSON,\n FlowNodeRegistry,\n FlowNodeType,\n} from '@flowgram.ai/document';\nimport { PluginContext } from '@flowgram.ai/core';\n\nexport interface EditorPluginContext extends PluginContext {\n document: FlowDocument;\n selection: SelectionService;\n}\n\nexport interface EditorProps<\n CTX extends EditorPluginContext = EditorPluginContext,\n JSON = FlowDocumentJSON\n> extends PlaygroundReactProps<CTX> {\n /**\n * Initialize data\n * 初始化数据\n */\n initialData?: JSON;\n /**\n * whether it is readonly\n * 是否为 readonly\n */\n readonly?: boolean;\n /**\n * node registries\n * 节点定义\n */\n nodeRegistries?: FlowNodeRegistry[];\n /**\n * Get the default node registry, which will be merged with the 'nodeRegistries'\n * 提供默认的节点注册,这个会和 nodeRegistries 做合并\n */\n getNodeDefaultRegistry?: (type: FlowNodeType) => FlowNodeRegistry;\n /**\n * Node engine configuration\n */\n nodeEngine?: NodeCorePluginOptions & {\n /**\n * Default formMeta\n */\n createDefaultFormMeta?: (node: FlowNodeEntity) => FormMetaOrFormMetaGenerator;\n /**\n * Enable node engine\n */\n enable?: boolean;\n };\n /**\n * By default, all nodes are expanded\n * 默认是否展开所有节点\n */\n allNodesDefaultExpanded?: boolean;\n /**\n * Canvas material, Used to customize react components\n * 画布物料, 用于自定义 react 组件\n */\n materials?: MaterialsPluginOptions;\n /**\n * 画布数据加载完成, 请使用 onAllLayersRendered 替代\n * @deprecated\n * */\n onLoad?: (ctx: CTX) => void;\n /**\n * 是否开启变量引擎\n * Variable engine enable\n */\n variableEngine?: VariablePluginOptions;\n /**\n * Redo/Undo enable\n */\n history?: HistoryPluginOptions<CTX> & { disableShortcuts?: boolean };\n\n /**\n * redux devtool configuration\n */\n reduxDevTool?: ReduxDevToolPluginOptions;\n\n /**\n * Scroll configuration\n * 滚动配置\n */\n scroll?: {\n enableScrollLimit?: boolean; // 开启滚动限制\n disableScrollBar?: boolean; // 关闭滚动条\n disableScroll?: boolean; // 禁止滚动\n };\n\n /**\n * Node data transformation, called by ctx.document.fromJSON\n * 节点数据转换, 由 ctx.document.fromJSON 调用\n * @param node - current node\n * @param json - Current node json data\n */\n toNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeJSON;\n /**\n * Node data transformation, called by ctx.document.toJSON\n * 节点数据转换, 由 ctx.document.toJSON 调用\n * @param node - current node\n * @param json - Current node json data\n * @param isFirstCreate - Whether it is created for the first time, If document.fromJSON is recalled, but the node already exists, isFirstCreate is false\n */\n fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): FlowNodeJSON;\n /**\n * Canvas internal constant customization\n * 画布内部常量自定义\n */\n constants?: Record<string, any>;\n /**\n * i18n\n * 国际化\n */\n i18n?: I18nPluginOptions;\n}\n\nexport namespace EditorProps {\n /**\n * 默认配置\n */\n export const DEFAULT: EditorProps = {\n background: {},\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { interfaces } from 'inversify';\nimport { FlowRendererContainerModule, FlowRendererRegistry } from '@flowgram.ai/renderer';\nimport { createReduxDevToolPlugin } from '@flowgram.ai/redux-devtool-plugin';\nimport { createNodeVariablePlugin } from '@flowgram.ai/node-variable-plugin';\nimport { createNodeCorePlugin } from '@flowgram.ai/node-core-plugin';\nimport { createMaterialsPlugin } from '@flowgram.ai/materials-plugin';\nimport { createI18nPlugin } from '@flowgram.ai/i18n-plugin';\nimport { createHistoryNodePlugin } from '@flowgram.ai/history-node-plugin';\nimport { FlowDocumentContainerModule } from '@flowgram.ai/document';\nimport { createPlaygroundPlugin, Plugin, PluginsProvider } from '@flowgram.ai/core';\n\nimport { createFlowEditorClientPlugins } from '../clients/flow-editor-client-plugins';\nimport { EditorPluginContext, EditorProps } from './editor-props';\n\nexport function createDefaultPreset<CTX extends EditorPluginContext = EditorPluginContext>(\n opts: EditorProps<CTX>,\n plugins: Plugin[] = []\n): PluginsProvider<CTX> {\n return (ctx: CTX) => {\n opts = { ...EditorProps.DEFAULT, ...opts };\n /**\n * i18n support\n */\n if (opts.i18n) {\n plugins.push(createI18nPlugin(opts.i18n));\n }\n /**\n * 默认注册顶层 flow editor client plugin\n */\n plugins.push(...createFlowEditorClientPlugins());\n\n /**\n * 注册 Redux 开发者工具\n */\n if (opts.reduxDevTool?.enable) {\n plugins.push(createReduxDevToolPlugin(opts.reduxDevTool));\n }\n\n /**\n * 注册画布模块\n */\n const defaultContainerModules: interfaces.ContainerModule[] = [\n FlowDocumentContainerModule, // 默认文档\n FlowRendererContainerModule, // 默认渲染\n ];\n /**\n * 注册物料\n */\n plugins.push(createMaterialsPlugin(opts.materials || {}));\n\n /**\n * 注册节点引擎\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n plugins.push(createNodeCorePlugin({ materials: opts.nodeEngine.materials }));\n\n if (opts.variableEngine?.enable) {\n plugins.push(createNodeVariablePlugin({}));\n }\n\n if (opts.history?.enable) {\n plugins.push(createHistoryNodePlugin({}));\n }\n }\n /**\n * 画布生命周期注册\n */\n plugins.push(\n createPlaygroundPlugin<CTX>({\n onInit: (ctx) => {\n if (opts.nodeRegistries) {\n ctx.document.registerFlowNodes(...opts.nodeRegistries);\n }\n // 自定义画布内部常量\n if (opts.constants) {\n ctx.document.options.constants = opts.constants;\n }\n if (opts.getNodeDefaultRegistry) {\n ctx.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;\n }\n // TODO\n // if (opts.onContentChange) {\n // ctx.document.onContentChange(event => opts.onContentChange!(ctx, event));\n // }\n // TODO 这个会触发组件注册,后续要废弃这个,通过 materials 插件来做\n ctx.get<FlowRendererRegistry>(FlowRendererRegistry).init();\n },\n onReady(ctx) {\n if (opts.initialData) {\n ctx.document.fromJSON(opts.initialData);\n }\n if (opts.readonly) {\n ctx.playground.config.readonly = opts.readonly;\n }\n ctx.document.load().then(() => {\n if (opts.onLoad) opts.onLoad(ctx);\n });\n },\n onDispose(ctx) {\n ctx.document.dispose();\n },\n containerModules: defaultContainerModules,\n })\n );\n\n return plugins;\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createNodeClientPlugins } from './node-client/create-node-client-plugins';\nimport { FlowEditorClient } from './flow-editor-client';\n\nexport const createFlowEditorClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(FlowEditorClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createFlowEditorClientPlugins = () => [\n ...createNodeClientPlugins(),\n createFlowEditorClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { NodeFocusService } from './node-focus-service';\nimport { NodeClient } from './node-client';\nimport { createNodeHighlightPlugin } from './highlight/create-node-highlight-plugin';\n\nexport const createNodeClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(NodeFocusService).toSelf().inSingletonScope();\n bind(NodeClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createNodeClientPlugins = () => [\n createNodeHighlightPlugin({}),\n createNodeClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { highlightFormItem, HighLightOptions } from './highlight';\n\nexport type FocusNodeCanvasOptions = PlaygroundConfigRevealOpts;\n\nexport interface FocusNodeFormItemOptions {\n canvas?: FocusNodeCanvasOptions;\n highlight?: boolean | HighLightOptions;\n}\n\n@injectable()\nexport class NodeFocusService {\n @inject(Playground) readonly playground: Playground;\n\n protected previousOverlay: HTMLDivElement | undefined;\n\n protected currentPromise: Promise<void> | undefined;\n\n highlightNodeFormItem(formItem: FormItem, options?: HighLightOptions) {\n this.previousOverlay = highlightFormItem(formItem, options);\n }\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions): Promise<void> {\n const node = formItem.formModel.flowNodeEntity;\n const { canvas = {}, highlight } = options || {};\n if (this.previousOverlay) {\n this.previousOverlay.remove();\n this.previousOverlay = undefined;\n }\n const currentPromise = this.playground\n .scrollToView({ entities: [node], scrollToCenter: true, ...canvas })\n .then(() => {\n if (!formItem || !highlight || this.currentPromise !== currentPromise) {\n return;\n }\n this.highlightNodeFormItem(formItem, typeof highlight === 'boolean' ? {} : highlight);\n });\n this.currentPromise = currentPromise;\n return this.currentPromise;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeRenderData } from '@flowgram.ai/document';\n\nimport { HIGHLIGHT_CLASSNAME } from './highlight-style';\nimport { DEFAULT_HIGHLIGHT_PADDING } from './constants';\n\nexport interface HighLightOptions {\n padding?: number;\n overlayClassName?: string;\n}\n\nexport function highlightFormItem(\n formItem: FormItem,\n options?: HighLightOptions,\n): HTMLDivElement | undefined {\n const parent =\n formItem.formModel.flowNodeEntity.getData<FlowNodeRenderData>(FlowNodeRenderData).node;\n const target = formItem.domRef.current;\n\n if (!target) {\n return undefined;\n }\n\n const overlay = document.createElement('div');\n\n const { padding = DEFAULT_HIGHLIGHT_PADDING, overlayClassName } = options || {};\n\n overlay.style.position = 'absolute';\n overlay.style.top = '0';\n overlay.style.left = '0';\n overlay.style.width = '100%';\n overlay.style.height = '100%';\n overlay.style.zIndex = '9999';\n\n parent.appendChild(overlay);\n\n const parentRect = parent.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n\n overlay.style.top = targetRect.top - parentRect.top - padding + 'px';\n overlay.style.left = targetRect.left - parentRect.left - padding + 'px';\n overlay.style.width = targetRect.width + padding * 2 + 'px';\n overlay.style.height = targetRect.height + padding * 2 + 'px';\n\n overlay.className = overlayClassName || HIGHLIGHT_CLASSNAME;\n setTimeout(() => {\n overlay.remove();\n }, 2000);\n return overlay;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const HIGHLIGHT_CLASSNAME = 'flowide-highlight';\n\nconst styleText = `\n@keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n@-webkit-keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n.${HIGHLIGHT_CLASSNAME} {\n background-color: rgba(238, 245, 40, 0.5);\n animation: flowide-fade 2s 1 forwards;\n -webkit-animation: flowide-fade 2s 1 forwards;\n}\n`;\n\nlet styleDom: HTMLStyleElement | undefined;\n\nexport function createHighlightStyle(): void {\n if (styleDom) return;\n styleDom = document.createElement('style');\n styleDom.innerHTML = styleText;\n document.head.appendChild(styleDom);\n}\n\nexport function removeHighlightStyle(): void {\n styleDom?.remove();\n styleDom = undefined;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const DEFAULT_HIGHLIGHT_COLOR = 'rgba(238, 245, 40, 0.5)';\nexport const DEFAULT_HIGHLIGHT_PADDING = 0;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useRef } from 'react';\n\nimport { FormModel } from '@flowgram.ai/form-core';\n\ninterface HighlightProps {\n form: FormModel;\n path: string;\n}\n\nexport function useHighlight(props: HighlightProps) {\n const ref = useRef<any>(null);\n const { form, path } = props;\n const formItem = form.getFormItemByPath(path);\n if (!formItem) {\n return null;\n }\n formItem.domRef = ref;\n return ref;\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 { NodeFocusService } from './node-focus-service';\n\n@injectable()\nexport class NodeClient {\n @inject(NodeFocusService) nodeFocusService: NodeFocusService;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createHighlightStyle, removeHighlightStyle } from './highlight-style';\n\nexport const createNodeHighlightPlugin = definePluginCreator<{}>({\n onInit() {\n createHighlightStyle();\n },\n onDispose() {\n removeHighlightStyle();\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';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { FocusNodeFormItemOptions, NodeClient } from './node-client';\n\ninterface FocusNodeOptions {\n zoom?: PlaygroundConfigRevealOpts['zoom'];\n easing?: PlaygroundConfigRevealOpts['easing']; // 是否开启缓动,默认开启\n easingDuration?: PlaygroundConfigRevealOpts['easingDuration']; // 默认 500 ms\n scrollToCenter?: PlaygroundConfigRevealOpts['scrollToCenter']; // 是否滚动到中心\n}\n\n@injectable()\nexport class FlowEditorClient {\n @inject(NodeClient) readonly nodeClient: NodeClient;\n\n @inject(Playground) readonly playground: Playground;\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions) {\n this.nodeClient.nodeFocusService.focusNodeFormItem(formItem, options);\n }\n\n focusNode(node: FlowNodeEntity, options?: FocusNodeOptions) {\n this.playground.scrollToView({ entities: [node], ...options });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useMemo, useCallback } from 'react';\n\nimport { interfaces } from 'inversify';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport {\n PlaygroundReactProvider,\n createPluginContextDefault,\n SelectionService,\n} from '@flowgram.ai/core';\n\nimport { EditorPluginContext, EditorProps, createDefaultPreset } from '../preset';\n\nexport const EditorProvider: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...others } = props;\n const preset = useMemo(() => createDefaultPreset(others), []);\n const customPluginContext = useCallback(\n (container: interfaces.Container) =>\n ({\n ...createPluginContextDefault(container),\n get document(): FlowDocument {\n return container.get<FlowDocument>(FlowDocument);\n },\n get selection(): SelectionService {\n return container.get<SelectionService>(SelectionService);\n },\n } as EditorPluginContext),\n []\n );\n return (\n <PlaygroundReactProvider plugins={preset} customPluginContext={customPluginContext}>\n {children}\n </PlaygroundReactProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React from 'react';\n\nimport { EditorProps } from '../preset';\nimport { EditorRenderer } from './editor-renderer';\nimport { EditorProvider } from './editor-provider';\n\n/**\n * 画布编辑器\n * @param props\n * @constructor\n */\nexport const Editor: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...otherProps } = props;\n return (\n <EditorProvider {...otherProps}>\n <EditorRenderer>{children}</EditorRenderer>\n </EditorProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { FlowEditorClient } from '../clients';\n\nexport function useFlowEditor(): FlowEditorClient {\n return useService(FlowEditorClient);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,8BAAO;AACP,kBAA4B;AAG5B,wBAAc,+BATd;AAUA,wBAAc,8BAVd;AAWA,wBAAc,kCAXd;AAYA,wBAAc,kCAZd;AAaA,wBAAc,yCAbd;AAcA,wBAAc,0CAdd;AAeA,wBAAc,0CAfd;AAgBA,wBAAc,qCAhBd;AAiBA,IAAAA,oBAUO;AAEP,uBAAmE;AAoBnE,kBAYO;AACP,wBAAc,8BA9Dd;;;ACoIO,IAAU;AAAA,CAAV,CAAUC,iBAAV;AAIE,EAAMA,aAAA,UAAuB;AAAA,IAClC,YAAY,CAAC;AAAA,EACf;AAAA,GANe;;;AC9HjB,sBAAkE;AAClE,kCAAyC;AACzC,kCAAyC;AACzC,8BAAqC;AACrC,8BAAsC;AACtC,yBAAiC;AACjC,iCAAwC;AACxC,IAAAC,mBAA4C;AAC5C,IAAAC,eAAgE;;;ACThE,IAAAC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E,KAAK,MAAM;AAC7B,gBAAI,KAAK,OAAQ,MAAK,OAAOA,IAAG;AAAA,UAClC,CAAC;AAAA,QACH;AAAA,QACA,UAAUA,MAAK;AACb,UAAAA,KAAI,SAAS,QAAQ;AAAA,QACvB;AAAA,QACA,kBAAkB;AAAA,MACpB,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF;;;AW3GA,IAAAC,gBAA4C;AAG5C,IAAAC,mBAA6B;AAC7B,IAAAC,eAIO;AAIA,IAAM,iBAAwC,CAAC,UAAuB;AAC3E,QAAM,EAAE,UAAU,GAAG,OAAO,IAAI;AAChC,QAAM,aAAS,uBAAQ,MAAM,oBAAoB,MAAM,GAAG,CAAC,CAAC;AAC5D,QAAM,0BAAsB;AAAA,IAC1B,CAAC,eACE;AAAA,MACC,OAAG,yCAA2B,SAAS;AAAA,MACvC,IAAI,WAAyB;AAC3B,eAAO,UAAU,IAAkB,6BAAY;AAAA,MACjD;AAAA,MACA,IAAI,YAA8B;AAChC,eAAO,UAAU,IAAsB,6BAAgB;AAAA,MACzD;AAAA,IACF;AAAA,IACF,CAAC;AAAA,EACH;AACA,SACE,8BAAAC,QAAA,cAAC,wCAAwB,SAAS,QAAQ,uBACvC,QACH;AAEJ;;;ACjCA,IAAAC,eAA0D;;;ACA1D,IAAAC,gBAAkB;AAWX,IAAM,SAAgC,CAAC,UAAuB;AACnE,QAAM,EAAE,UAAU,GAAG,WAAW,IAAI;AACpC,SACE,8BAAAC,QAAA,cAAC,kBAAgB,GAAG,cAClB,8BAAAA,QAAA,cAAC,4CAAgB,QAAS,CAC5B;AAEJ;;;AClBA,IAAAC,eAA2B;AAIpB,SAAS,gBAAkC;AAChD,aAAO,yBAAW,gBAAgB;AACpC;;;AhBkEA,wBAAc,8CA7Ed;AA+EA,8BAA4C;","names":["import_inversify","EditorProps","import_document","import_core","import_core","import_core","import_inversify","import_core","import_inversify","import_core","ctx","import_react","import_document","import_core","React","import_core","import_react","React","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/preset/editor-props.ts","../src/preset/editor-default-preset.ts","../src/clients/flow-editor-client-plugins.ts","../src/clients/node-client/create-node-client-plugins.ts","../src/clients/node-client/node-focus-service.ts","../src/clients/node-client/highlight/highlight-form-item.ts","../src/clients/node-client/highlight/highlight-style.ts","../src/clients/node-client/highlight/constants.ts","../src/clients/node-client/highlight/use-highlight.ts","../src/clients/node-client/node-client.ts","../src/clients/node-client/highlight/create-node-highlight-plugin.ts","../src/clients/flow-editor-client.ts","../src/components/editor-provider.tsx","../src/components/editor-renderer.tsx","../src/components/editor.tsx","../src/hooks/use-flow-editor.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport 'reflect-metadata';\nimport { FormModelV2 } from '@flowgram.ai/node';\n\n/* 核心 模块导出 */\nexport * from '@flowgram.ai/utils';\nexport * from '@flowgram.ai/core';\nexport * from '@flowgram.ai/document';\nexport * from '@flowgram.ai/renderer';\nexport * from '@flowgram.ai/variable-plugin';\nexport * from '@flowgram.ai/shortcuts-plugin';\nexport * from '@flowgram.ai/node-core-plugin';\nexport * from '@flowgram.ai/i18n-plugin';\nexport {\n ReactiveState,\n ReactiveBaseState,\n Tracker,\n useReactiveState,\n useReadonlyReactiveState,\n useObserve,\n observe,\n} from '@flowgram.ai/reactive';\nexport {\n type interfaces,\n injectable,\n postConstruct,\n named,\n Container,\n ContainerModule,\n AsyncContainerModule,\n inject,\n multiInject,\n} from 'inversify';\n\nexport { FlowNodeFormData, NodeRender, type NodeRenderProps } from '@flowgram.ai/form-core';\n\nexport type {\n FormState,\n FieldState,\n FieldArrayRenderProps,\n FieldRenderProps,\n FormRenderProps,\n Validate,\n FormControl,\n FieldName,\n FieldError,\n FieldWarning,\n IField,\n IFieldArray,\n IForm,\n Errors,\n Warnings,\n} from '@flowgram.ai/form';\n\nexport {\n Form,\n Field,\n FieldArray,\n useForm,\n useField,\n useCurrentField,\n useCurrentFieldState,\n useFieldValidate,\n useWatch,\n ValidateTrigger,\n FeedbackLevel,\n} from '@flowgram.ai/form';\nexport * from '@flowgram.ai/node';\nexport { FormModelV2 as FormModel };\n\n/**\n * 固定布局模块导出\n */\nexport * from './preset';\nexport * from './components';\nexport * from './hooks';\nexport * from './clients';\n\n/**\n * Plugin 导出\n */\n\nexport * from '@flowgram.ai/node-variable-plugin';\n\nexport { createPlaygroundReactPreset } from '@flowgram.ai/playground-react';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeScope, VariablePluginOptions } from '@flowgram.ai/variable-plugin';\nimport { ReduxDevToolPluginOptions } from '@flowgram.ai/redux-devtool-plugin';\nimport { PlaygroundReactProps, SelectionService } from '@flowgram.ai/playground-react';\nimport { NodeCorePluginOptions } from '@flowgram.ai/node-core-plugin';\nimport { type NodeFormProps } from '@flowgram.ai/node';\nimport { MaterialsPluginOptions } from '@flowgram.ai/materials-plugin';\nimport { I18nPluginOptions } from '@flowgram.ai/i18n-plugin';\nimport { HistoryPluginOptions } from '@flowgram.ai/history';\nimport { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';\nimport {\n FlowDocument,\n FlowDocumentJSON,\n FlowNodeEntity,\n type FlowNodeJSON,\n FlowNodeRegistry,\n FlowNodeType,\n} from '@flowgram.ai/document';\nimport { PluginContext } from '@flowgram.ai/core';\n\ndeclare module '@flowgram.ai/document' {\n interface FlowNodeEntity {\n form: NodeFormProps<any> | undefined;\n scope: FlowNodeScope | undefined;\n privateScope: FlowNodeScope | undefined;\n }\n}\n\nexport interface EditorPluginContext extends PluginContext {\n document: FlowDocument;\n selection: SelectionService;\n}\n\nexport interface EditorProps<\n CTX extends EditorPluginContext = EditorPluginContext,\n JSON = FlowDocumentJSON\n> extends PlaygroundReactProps<CTX> {\n /**\n * Initialize data\n * 初始化数据\n */\n initialData?: JSON;\n /**\n * whether it is readonly\n * 是否为 readonly\n */\n readonly?: boolean;\n /**\n * node registries\n * 节点定义\n */\n nodeRegistries?: FlowNodeRegistry[];\n /**\n * Get the default node registry, which will be merged with the 'nodeRegistries'\n * 提供默认的节点注册,这个会和 nodeRegistries 做合并\n */\n getNodeDefaultRegistry?: (type: FlowNodeType) => FlowNodeRegistry;\n /**\n * Node engine configuration\n */\n nodeEngine?: NodeCorePluginOptions & {\n /**\n * Default formMeta\n */\n createDefaultFormMeta?: (node: FlowNodeEntity) => FormMetaOrFormMetaGenerator;\n /**\n * Enable node engine\n */\n enable?: boolean;\n };\n /**\n * By default, all nodes are expanded\n * 默认是否展开所有节点\n */\n allNodesDefaultExpanded?: boolean;\n /**\n * Canvas material, Used to customize react components\n * 画布物料, 用于自定义 react 组件\n */\n materials?: MaterialsPluginOptions;\n /**\n * 画布数据加载完成, 请使用 onAllLayersRendered 替代\n * @deprecated\n * */\n onLoad?: (ctx: CTX) => void;\n /**\n * 是否开启变量引擎\n * Variable engine enable\n */\n variableEngine?: VariablePluginOptions;\n /**\n * Redo/Undo enable\n */\n history?: HistoryPluginOptions<CTX> & { disableShortcuts?: boolean };\n\n /**\n * redux devtool configuration\n */\n reduxDevTool?: ReduxDevToolPluginOptions;\n\n /**\n * Scroll configuration\n * 滚动配置\n */\n scroll?: {\n enableScrollLimit?: boolean; // 开启滚动限制\n disableScrollBar?: boolean; // 关闭滚动条\n disableScroll?: boolean; // 禁止滚动\n };\n\n /**\n * Node data transformation, called by ctx.document.fromJSON\n * 节点数据转换, 由 ctx.document.fromJSON 调用\n * @param node - current node\n * @param json - Current node json data\n */\n toNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeJSON;\n /**\n * Node data transformation, called by ctx.document.toJSON\n * 节点数据转换, 由 ctx.document.toJSON 调用\n * @param node - current node\n * @param json - Current node json data\n * @param isFirstCreate - Whether it is created for the first time, If document.fromJSON is recalled, but the node already exists, isFirstCreate is false\n */\n fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): FlowNodeJSON;\n /**\n * Canvas internal constant customization\n * 画布内部常量自定义\n */\n constants?: Record<string, any>;\n /**\n * i18n\n * 国际化\n */\n i18n?: I18nPluginOptions;\n}\n\nexport namespace EditorProps {\n /**\n * 默认配置\n */\n export const DEFAULT: EditorProps = {\n background: {},\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { interfaces } from 'inversify';\nimport { FlowNodeScope, getNodePrivateScope, getNodeScope } from '@flowgram.ai/variable-plugin';\nimport { FlowRendererContainerModule, FlowRendererRegistry } from '@flowgram.ai/renderer';\nimport { createReduxDevToolPlugin } from '@flowgram.ai/redux-devtool-plugin';\nimport { createNodeVariablePlugin } from '@flowgram.ai/node-variable-plugin';\nimport { createNodeCorePlugin } from '@flowgram.ai/node-core-plugin';\nimport { getNodeForm, NodeFormProps } from '@flowgram.ai/node';\nimport { createMaterialsPlugin } from '@flowgram.ai/materials-plugin';\nimport { createI18nPlugin } from '@flowgram.ai/i18n-plugin';\nimport { createHistoryNodePlugin } from '@flowgram.ai/history-node-plugin';\nimport { FlowDocumentContainerModule } from '@flowgram.ai/document';\nimport { createPlaygroundPlugin, Plugin, PluginsProvider } from '@flowgram.ai/core';\n\nimport { createFlowEditorClientPlugins } from '../clients/flow-editor-client-plugins';\nimport { EditorPluginContext, EditorProps } from './editor-props';\n\nexport function createDefaultPreset<CTX extends EditorPluginContext = EditorPluginContext>(\n opts: EditorProps<CTX>,\n plugins: Plugin[] = []\n): PluginsProvider<CTX> {\n return (ctx: CTX) => {\n opts = { ...EditorProps.DEFAULT, ...opts };\n /**\n * i18n support\n */\n if (opts.i18n) {\n plugins.push(createI18nPlugin(opts.i18n));\n }\n /**\n * 默认注册顶层 flow editor client plugin\n */\n plugins.push(...createFlowEditorClientPlugins());\n\n /**\n * 注册 Redux 开发者工具\n */\n if (opts.reduxDevTool?.enable) {\n plugins.push(createReduxDevToolPlugin(opts.reduxDevTool));\n }\n\n /**\n * 注册画布模块\n */\n const defaultContainerModules: interfaces.ContainerModule[] = [\n FlowDocumentContainerModule, // 默认文档\n FlowRendererContainerModule, // 默认渲染\n ];\n /**\n * 注册物料\n */\n plugins.push(createMaterialsPlugin(opts.materials || {}));\n\n /**\n * 注册节点引擎\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n plugins.push(createNodeCorePlugin({ materials: opts.nodeEngine.materials }));\n\n if (opts.variableEngine?.enable) {\n plugins.push(createNodeVariablePlugin({}));\n }\n\n if (opts.history?.enable) {\n plugins.push(createHistoryNodePlugin({}));\n }\n }\n /**\n * 画布生命周期注册\n */\n plugins.push(\n createPlaygroundPlugin<CTX>({\n onInit: (ctx) => {\n if (opts.nodeRegistries) {\n ctx.document.registerFlowNodes(...opts.nodeRegistries);\n }\n // 自定义画布内部常量\n if (opts.constants) {\n ctx.document.options.constants = opts.constants;\n }\n if (opts.getNodeDefaultRegistry) {\n ctx.document.options.getNodeDefaultRegistry = opts.getNodeDefaultRegistry;\n }\n ctx.document.options.preNodeCreate = (node) => {\n /**\n * Define node.form\n */\n if (opts.nodeEngine && opts.nodeEngine.enable !== false) {\n let cache: NodeFormProps<any> | undefined;\n Object.defineProperty(node, 'form', {\n get: () => {\n if (cache) return cache;\n cache = getNodeForm(node);\n return cache;\n },\n });\n }\n\n /**\n * Define node.scope & node.privateScope\n */\n if (opts.variableEngine && opts.variableEngine.enable !== false) {\n let cache: FlowNodeScope | undefined;\n let privateCache: FlowNodeScope | undefined;\n\n Object.defineProperty(node, 'scope', {\n get: () => {\n if (cache) return cache;\n cache = getNodeScope(node);\n return cache;\n },\n });\n Object.defineProperty(node, 'privateScope', {\n get: () => {\n if (privateCache) return privateCache;\n privateCache = getNodePrivateScope(node);\n return privateCache;\n },\n });\n }\n };\n ctx.get<FlowRendererRegistry>(FlowRendererRegistry).init();\n },\n onReady(ctx) {\n if (opts.initialData) {\n ctx.document.fromJSON(opts.initialData);\n }\n if (opts.readonly) {\n ctx.playground.config.readonly = opts.readonly;\n }\n ctx.document.load().then(() => {\n if (opts.onLoad) opts.onLoad(ctx);\n });\n },\n onDispose(ctx) {\n ctx.document.dispose();\n },\n containerModules: defaultContainerModules,\n })\n );\n\n return plugins;\n };\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createNodeClientPlugins } from './node-client/create-node-client-plugins';\nimport { FlowEditorClient } from './flow-editor-client';\n\nexport const createFlowEditorClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(FlowEditorClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createFlowEditorClientPlugins = () => [\n ...createNodeClientPlugins(),\n createFlowEditorClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { NodeFocusService } from './node-focus-service';\nimport { NodeClient } from './node-client';\nimport { createNodeHighlightPlugin } from './highlight/create-node-highlight-plugin';\n\nexport const createNodeClientPlugin = definePluginCreator<{}>({\n onBind({ bind }) {\n bind(NodeFocusService).toSelf().inSingletonScope();\n bind(NodeClient).toSelf().inSingletonScope();\n },\n});\n\nexport const createNodeClientPlugins = () => [\n createNodeHighlightPlugin({}),\n createNodeClientPlugin({}),\n];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { highlightFormItem, HighLightOptions } from './highlight';\n\nexport type FocusNodeCanvasOptions = PlaygroundConfigRevealOpts;\n\nexport interface FocusNodeFormItemOptions {\n canvas?: FocusNodeCanvasOptions;\n highlight?: boolean | HighLightOptions;\n}\n\n@injectable()\nexport class NodeFocusService {\n @inject(Playground) readonly playground: Playground;\n\n protected previousOverlay: HTMLDivElement | undefined;\n\n protected currentPromise: Promise<void> | undefined;\n\n highlightNodeFormItem(formItem: FormItem, options?: HighLightOptions) {\n this.previousOverlay = highlightFormItem(formItem, options);\n }\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions): Promise<void> {\n const node = formItem.formModel.flowNodeEntity;\n const { canvas = {}, highlight } = options || {};\n if (this.previousOverlay) {\n this.previousOverlay.remove();\n this.previousOverlay = undefined;\n }\n const currentPromise = this.playground\n .scrollToView({ entities: [node], scrollToCenter: true, ...canvas })\n .then(() => {\n if (!formItem || !highlight || this.currentPromise !== currentPromise) {\n return;\n }\n this.highlightNodeFormItem(formItem, typeof highlight === 'boolean' ? {} : highlight);\n });\n this.currentPromise = currentPromise;\n return this.currentPromise;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeRenderData } from '@flowgram.ai/document';\n\nimport { HIGHLIGHT_CLASSNAME } from './highlight-style';\nimport { DEFAULT_HIGHLIGHT_PADDING } from './constants';\n\nexport interface HighLightOptions {\n padding?: number;\n overlayClassName?: string;\n}\n\nexport function highlightFormItem(\n formItem: FormItem,\n options?: HighLightOptions,\n): HTMLDivElement | undefined {\n const parent =\n formItem.formModel.flowNodeEntity.getData<FlowNodeRenderData>(FlowNodeRenderData).node;\n const target = formItem.domRef.current;\n\n if (!target) {\n return undefined;\n }\n\n const overlay = document.createElement('div');\n\n const { padding = DEFAULT_HIGHLIGHT_PADDING, overlayClassName } = options || {};\n\n overlay.style.position = 'absolute';\n overlay.style.top = '0';\n overlay.style.left = '0';\n overlay.style.width = '100%';\n overlay.style.height = '100%';\n overlay.style.zIndex = '9999';\n\n parent.appendChild(overlay);\n\n const parentRect = parent.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n\n overlay.style.top = targetRect.top - parentRect.top - padding + 'px';\n overlay.style.left = targetRect.left - parentRect.left - padding + 'px';\n overlay.style.width = targetRect.width + padding * 2 + 'px';\n overlay.style.height = targetRect.height + padding * 2 + 'px';\n\n overlay.className = overlayClassName || HIGHLIGHT_CLASSNAME;\n setTimeout(() => {\n overlay.remove();\n }, 2000);\n return overlay;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const HIGHLIGHT_CLASSNAME = 'flowide-highlight';\n\nconst styleText = `\n@keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n@-webkit-keyframes flowide-fade {\n from {\n opacity: 1.0;\n }\n to {\n opacity: 0;\n }\n}\n.${HIGHLIGHT_CLASSNAME} {\n background-color: rgba(238, 245, 40, 0.5);\n animation: flowide-fade 2s 1 forwards;\n -webkit-animation: flowide-fade 2s 1 forwards;\n}\n`;\n\nlet styleDom: HTMLStyleElement | undefined;\n\nexport function createHighlightStyle(): void {\n if (styleDom) return;\n styleDom = document.createElement('style');\n styleDom.innerHTML = styleText;\n document.head.appendChild(styleDom);\n}\n\nexport function removeHighlightStyle(): void {\n styleDom?.remove();\n styleDom = undefined;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const DEFAULT_HIGHLIGHT_COLOR = 'rgba(238, 245, 40, 0.5)';\nexport const DEFAULT_HIGHLIGHT_PADDING = 0;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useRef } from 'react';\n\nimport { FormModel } from '@flowgram.ai/form-core';\n\ninterface HighlightProps {\n form: FormModel;\n path: string;\n}\n\nexport function useHighlight(props: HighlightProps) {\n const ref = useRef<any>(null);\n const { form, path } = props;\n const formItem = form.getFormItemByPath(path);\n if (!formItem) {\n return null;\n }\n formItem.domRef = ref;\n return ref;\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 { NodeFocusService } from './node-focus-service';\n\n@injectable()\nexport class NodeClient {\n @inject(NodeFocusService) nodeFocusService: NodeFocusService;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { createHighlightStyle, removeHighlightStyle } from './highlight-style';\n\nexport const createNodeHighlightPlugin = definePluginCreator<{}>({\n onInit() {\n createHighlightStyle();\n },\n onDispose() {\n removeHighlightStyle();\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';\nimport { type FormItem } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { Playground, PlaygroundConfigRevealOpts } from '@flowgram.ai/core';\n\nimport { FocusNodeFormItemOptions, NodeClient } from './node-client';\n\ninterface FocusNodeOptions {\n zoom?: PlaygroundConfigRevealOpts['zoom'];\n easing?: PlaygroundConfigRevealOpts['easing']; // 是否开启缓动,默认开启\n easingDuration?: PlaygroundConfigRevealOpts['easingDuration']; // 默认 500 ms\n scrollToCenter?: PlaygroundConfigRevealOpts['scrollToCenter']; // 是否滚动到中心\n}\n\n@injectable()\nexport class FlowEditorClient {\n @inject(NodeClient) readonly nodeClient: NodeClient;\n\n @inject(Playground) readonly playground: Playground;\n\n focusNodeFormItem(formItem: FormItem, options?: FocusNodeFormItemOptions) {\n this.nodeClient.nodeFocusService.focusNodeFormItem(formItem, options);\n }\n\n focusNode(node: FlowNodeEntity, options?: FocusNodeOptions) {\n this.playground.scrollToView({ entities: [node], ...options });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useMemo, useCallback } from 'react';\n\nimport { interfaces } from 'inversify';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport {\n PlaygroundReactProvider,\n createPluginContextDefault,\n SelectionService,\n} from '@flowgram.ai/core';\n\nimport { EditorPluginContext, EditorProps, createDefaultPreset } from '../preset';\n\nexport const EditorProvider: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...others } = props;\n const preset = useMemo(() => createDefaultPreset(others), []);\n const customPluginContext = useCallback(\n (container: interfaces.Container) =>\n ({\n ...createPluginContextDefault(container),\n get document(): FlowDocument {\n return container.get<FlowDocument>(FlowDocument);\n },\n get selection(): SelectionService {\n return container.get<SelectionService>(SelectionService);\n },\n } as EditorPluginContext),\n []\n );\n return (\n <PlaygroundReactProvider plugins={preset} customPluginContext={customPluginContext}>\n {children}\n </PlaygroundReactProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { PlaygroundReactRenderer as EditorRenderer } from '@flowgram.ai/core';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React from 'react';\n\nimport { EditorProps } from '../preset';\nimport { EditorRenderer } from './editor-renderer';\nimport { EditorProvider } from './editor-provider';\n\n/**\n * 画布编辑器\n * @param props\n * @constructor\n */\nexport const Editor: React.FC<EditorProps> = (props: EditorProps) => {\n const { children, ...otherProps } = props;\n return (\n <EditorProvider {...otherProps}>\n <EditorRenderer>{children}</EditorRenderer>\n </EditorProvider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { FlowEditorClient } from '../clients';\n\nexport function useFlowEditor(): FlowEditorClient {\n return useService(FlowEditorClient);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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BAAAA,QAAA,cAAC,4CAAgB,QAAS,CAC5B;AAEJ;;;AClBA,IAAAC,eAA2B;AAIpB,SAAS,gBAAkC;AAChD,aAAO,yBAAW,gBAAgB;AACpC;;;AhB2EA,0BAAc,8CAtFd;AAwFA,8BAA4C;","names":["import_node","import_inversify","EditorProps","import_document","import_core","import_core","import_core","import_inversify","import_core","import_inversify","import_core","ctx","import_react","import_document","import_core","React","import_core","import_react","React","import_core"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/editor",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.16",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
@@ -18,40 +18,39 @@
18
18
  "dependencies": {
19
19
  "inversify": "^6.0.1",
20
20
  "reflect-metadata": "~0.2.2",
21
- "@flowgram.ai/background-plugin": "0.1.0-alpha.14",
22
- "@flowgram.ai/document": "0.1.0-alpha.14",
23
- "@flowgram.ai/form": "0.1.0-alpha.14",
24
- "@flowgram.ai/core": "0.1.0-alpha.14",
25
- "@flowgram.ai/form-core": "0.1.0-alpha.14",
26
- "@flowgram.ai/group-plugin": "0.1.0-alpha.14",
27
- "@flowgram.ai/history": "0.1.0-alpha.14",
28
- "@flowgram.ai/history-node-plugin": "0.1.0-alpha.14",
29
- "@flowgram.ai/i18n-plugin": "0.1.0-alpha.14",
30
- "@flowgram.ai/materials-plugin": "0.1.0-alpha.14",
31
- "@flowgram.ai/node": "0.1.0-alpha.14",
32
- "@flowgram.ai/node-core-plugin": "0.1.0-alpha.14",
33
- "@flowgram.ai/playground-react": "0.1.0-alpha.14",
34
- "@flowgram.ai/redux-devtool-plugin": "0.1.0-alpha.14",
35
- "@flowgram.ai/node-variable-plugin": "0.1.0-alpha.14",
36
- "@flowgram.ai/renderer": "0.1.0-alpha.14",
37
- "@flowgram.ai/utils": "0.1.0-alpha.14",
38
- "@flowgram.ai/shortcuts-plugin": "0.1.0-alpha.14",
39
- "@flowgram.ai/variable-plugin": "0.1.0-alpha.14"
21
+ "@flowgram.ai/document": "0.1.0-alpha.16",
22
+ "@flowgram.ai/form": "0.1.0-alpha.16",
23
+ "@flowgram.ai/form-core": "0.1.0-alpha.16",
24
+ "@flowgram.ai/history": "0.1.0-alpha.16",
25
+ "@flowgram.ai/core": "0.1.0-alpha.16",
26
+ "@flowgram.ai/i18n-plugin": "0.1.0-alpha.16",
27
+ "@flowgram.ai/history-node-plugin": "0.1.0-alpha.16",
28
+ "@flowgram.ai/materials-plugin": "0.1.0-alpha.16",
29
+ "@flowgram.ai/node": "0.1.0-alpha.16",
30
+ "@flowgram.ai/node-core-plugin": "0.1.0-alpha.16",
31
+ "@flowgram.ai/node-variable-plugin": "0.1.0-alpha.16",
32
+ "@flowgram.ai/playground-react": "0.1.0-alpha.16",
33
+ "@flowgram.ai/redux-devtool-plugin": "0.1.0-alpha.16",
34
+ "@flowgram.ai/shortcuts-plugin": "0.1.0-alpha.16",
35
+ "@flowgram.ai/renderer": "0.1.0-alpha.16",
36
+ "@flowgram.ai/utils": "0.1.0-alpha.16",
37
+ "@flowgram.ai/reactive": "0.1.0-alpha.16",
38
+ "@flowgram.ai/variable-plugin": "0.1.0-alpha.16"
40
39
  },
41
40
  "devDependencies": {
42
41
  "@types/bezier-js": "4.1.3",
43
42
  "@types/lodash-es": "^4.17.12",
44
43
  "@types/react": "^18",
45
44
  "@types/react-dom": "^18",
46
- "@vitest/coverage-v8": "^0.32.0",
45
+ "@vitest/coverage-v8": "^3.2.4",
47
46
  "eslint": "^8.54.0",
48
47
  "react": "^18",
49
48
  "react-dom": "^18",
50
49
  "tsup": "^8.0.1",
51
50
  "typescript": "^5.8.3",
52
- "vitest": "^0.34.6",
53
- "@flowgram.ai/ts-config": "0.1.0-alpha.14",
54
- "@flowgram.ai/eslint-config": "0.1.0-alpha.14"
51
+ "vitest": "^3.2.4",
52
+ "@flowgram.ai/eslint-config": "0.1.0-alpha.16",
53
+ "@flowgram.ai/ts-config": "0.1.0-alpha.16"
55
54
  },
56
55
  "peerDependencies": {
57
56
  "react": ">=16.8",