@flowgram.ai/fixed-layout-core 1.0.2 → 1.0.6

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/fixed-layout-container-module.ts","../src/flow-registers.ts","../src/activities/end.ts","../src/activities/dynamic-split.ts","../src/activities/static-split.ts","../src/activities/block.ts","../src/activities/inline-blocks.ts","../src/activities/block-icon.ts","../src/activities/block-order-icon.ts","../src/activities/start.ts","../src/activities/try-catch.ts","../src/activities/try-catch-extends/catch-block.ts","../src/activities/try-catch-extends/catch-inline-blocks.ts","../src/activities/try-catch-extends/main-inline-blocks.ts","../src/activities/try-catch-extends/try-block.ts","../src/activities/try-catch-extends/try-slot.ts","../src/activities/loop.ts","../src/activities/loop-extends/constants.ts","../src/activities/loop-extends/loop-left-empty-block.ts","../src/activities/loop-extends/loop-right-empty-block.ts","../src/activities/loop-extends/loop-empty-branch.ts","../src/activities/loop-extends/loop-inline-blocks.ts","../src/activities/root.ts","../src/activities/empty.ts","../src/activities/simple-split.ts","../src/activities/break.ts","../src/activities/input.ts","../src/activities/output.ts","../src/activities/multi-outputs.ts","../src/activities/multi-inputs.ts","../src/activities/slot/slot.ts","../src/activities/slot/utils/transition.ts","../src/activities/slot/constants.ts","../src/activities/slot/typings.ts","../src/activities/slot/utils/node.ts","../src/activities/slot/utils/layout.ts","../src/activities/slot/utils/create.ts","../src/activities/slot/extends/slot-icon.ts","../src/activities/slot/extends/slot-inline-blocks.ts","../src/activities/slot/extends/slot-block.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './fixed-layout-container-module';\nimport { SlotIconRegistry, SlotInlineBlocksRegistry } from './activities/slot/extends';\nimport {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n LoopRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n StartRegistry,\n RootRegistry,\n InlineBlocksRegistry,\n EndRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n} from './activities';\n\nexport const FixedLayoutRegistries = {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n LoopRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n StartRegistry,\n RootRegistry,\n InlineBlocksRegistry,\n EndRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n SlotIconRegistry,\n SlotInlineBlocksRegistry,\n};\n\n// Export constant\nexport { SlotSpacingKey } from './activities/slot/constants';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { FlowRendererContribution } from '@flowgram.ai/renderer';\nimport { FlowDocumentContribution } from '@flowgram.ai/document';\nimport { PlaygroundContribution } from '@flowgram.ai/core';\nimport { bindContributions } from '@flowgram.ai/utils';\n\nimport { FlowRegisters } from './flow-registers';\n\nexport const FixedLayoutContainerModule = new ContainerModule(bind => {\n bindContributions(bind, FlowRegisters, [\n FlowDocumentContribution,\n FlowRendererContribution,\n PlaygroundContribution,\n ]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport {\n FlowLabelsLayer,\n FlowLinesLayer,\n FlowNodesContentLayer,\n FlowNodesTransformLayer,\n type FlowRendererContribution,\n type FlowRendererRegistry,\n} from '@flowgram.ai/renderer';\nimport {\n type FlowDocument,\n type FlowDocumentContribution,\n FlowNodeRenderData,\n FlowNodeTransformData,\n FlowNodeTransitionData,\n} from '@flowgram.ai/document';\nimport { type PlaygroundContribution, PlaygroundLayer } from '@flowgram.ai/core';\n\nimport { EndRegistry } from './activities/end';\nimport {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n InlineBlocksRegistry,\n LoopRegistry,\n RootRegistry,\n StartRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n SimpleSplitRegistry,\n BreakRegistry,\n MultiOuputsRegistry,\n MultiInputsRegistry,\n InputRegistry,\n OuputRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n} from './activities';\n\n@injectable()\nexport class FlowRegisters\n implements FlowDocumentContribution, FlowRendererContribution, PlaygroundContribution\n{\n /**\n * 注册数据层\n * @param document\n */\n registerDocument(document: FlowDocument) {\n /**\n * 注册节点 (ECS - Entity)\n */\n document.registerFlowNodes(\n RootRegistry, // 根节点\n StartRegistry, // 开始节点\n DynamicSplitRegistry, // 动态分支(并行、排他)\n StaticSplitRegistry, // 静态分支(审批)\n SimpleSplitRegistry, // 简单分支 (不带 orderIcon 节点)\n BlockRegistry, // 单条 block 注册\n InlineBlocksRegistry, // 多个 block 组成的 block 列表\n BlockIconRegistry, // icon 节点,如条件分支的菱形图标\n BlockOrderIconRegistry, // 带顺序的图标节点,一般为 block 第一个分支节点\n TryCatchRegistry, // TryCatch\n EndRegistry, // 结束节点\n LoopRegistry, // 循环节点\n EmptyRegistry, // 占位节点\n BreakRegistry, // 分支断开\n MultiOuputsRegistry,\n MultiInputsRegistry,\n InputRegistry,\n OuputRegistry,\n SlotRegistry,\n SlotBlockRegistry\n );\n /**\n * 注册节点数据 (ECS - Component)\n */\n document.registerNodeDatas(\n FlowNodeRenderData, // 渲染节点相关数据\n FlowNodeTransitionData, // 线条绘制数据\n FlowNodeTransformData // 坐标计算数据\n );\n }\n\n /**\n * 注册渲染层\n * @param renderer\n */\n registerRenderer(renderer: FlowRendererRegistry) {\n /**\n * 注册 layer (ECS - System)\n */\n renderer.registerLayers(\n FlowNodesTransformLayer, // 节点位置渲染\n FlowNodesContentLayer, // 节点内容渲染\n FlowLinesLayer, // 线条渲染\n FlowLabelsLayer, // Label 渲染\n PlaygroundLayer // 画布基础层,提供缩放、手势等能力\n );\n }\n\n /**\n * 画布开始渲染 (hook)\n */\n onReady(): void {}\n\n /**\n * 画布销毁 (hook)\n */\n onDispose(): void {}\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 结束节点\n */\nexport const EndRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.END,\n meta: {\n draggable: false,\n isNodeEnd: true,\n selectable: false,\n copyDisable: true,\n },\n // 结束节点没有出边和 label\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowTransitionLabelEnum,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 可以动态添加分支的分支节点\n * dynamicSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * block1\n * blockOrderIcon\n * block2\n * blockOrderIcon\n */\nexport const DynamicSplitRegistry: FlowNodeRegistry = {\n type: FlowNodeSplitType.DYNAMIC_SPLIT,\n meta: {\n hidden: true,\n inlineSpacingAfter: (node) =>\n node.collapsed && node.entity.collapsedChildren.length > 1 ? 21 : 0,\n // 判断是否有分支节点\n spacing: (node) => {\n const spacing = getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING);\n return node.children.length === 1 ? spacing : spacing / 2;\n },\n },\n getLabels(transition) {\n if (transition.isNodeEnd) {\n return [];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: transition.transform.outputPoint,\n },\n ];\n },\n onCreate(node, json) {\n return node.document.addInlineBlocks(node, json.blocks || []);\n },\n getInputPoint(transform) {\n // block icon\n return transform.firstChild?.inputPoint || transform.defaultInputPoint;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 没有分支节点\n const noInlineBlocks = transform.children.length === 1;\n const lastChildOutput = transform.lastChild?.outputPoint;\n const spacing = getDefaultSpacing(transform.entity, ConstantKeys.NODE_SPACING);\n\n if (isVertical) {\n return {\n x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,\n y: transform.bounds.bottom + (noInlineBlocks ? spacing / 2 : 0),\n };\n }\n\n return {\n x: transform.bounds.right + (noInlineBlocks ? spacing / 2 : 0),\n y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y,\n };\n },\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n const parentId = `$inlineBlocks$${node.id}`;\n let parent = document.getNode(parentId);\n if (!parent) {\n parent = document.addNode({\n id: parentId,\n type: 'inlineBlocks',\n originParent: node,\n parent: node,\n });\n }\n return document.addBlock(node, json, undefined, undefined, index);\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry, FlowNodeSplitType } from '@flowgram.ai/document';\n\n/**\n * 不能动态添加分支的分支节点\n * staticSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * block1\n * blockOrderIcon\n * block2\n * blockOrderIcon\n */\nexport const StaticSplitRegistry: FlowNodeRegistry = {\n extend: FlowNodeSplitType.DYNAMIC_SPLIT,\n type: FlowNodeSplitType.STATIC_SPLIT,\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n getLabels() {\n return [];\n },\n },\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n DEFAULT_SPACING,\n FlowLayoutDefault,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n LABEL_SIDE_TYPE,\n} from '@flowgram.ai/document';\n\n/**\n * block, block 的输入输出点由子节点决定\n */\nexport const BlockRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n inlineSpacingAfter: DEFAULT_SPACING.INLINE_BLOCK_PADDING_BOTTOM,\n hidden: true,\n },\n getLines(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n const lines: FlowTransitionLine[] = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: currentTransform.parent!.inputPoint,\n to: currentTransform.inputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n ];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 分支拖拽场景线条 push\n // 当有其余分支的时候,绘制一条两个分支之间的线条\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.inputPoint.y;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.DRAGGING_LINE,\n from: currentTransform.parent!.inputPoint,\n to: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.inputPoint.x;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.DRAGGING_LINE,\n from: currentTransform.parent!.inputPoint,\n to: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n }\n }\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: currentTransform.outputPoint,\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n\n return lines;\n },\n getInputPoint(trans) {\n const child = trans.firstChild;\n return child ? child.inputPoint : trans.defaultInputPoint;\n },\n getOutputPoint(trans, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const child = trans.lastChild;\n if (isVertical) {\n return {\n x: child ? child.outputPoint.x : trans.bounds.bottomCenter.x,\n y: trans.bounds.bottom,\n };\n }\n return {\n x: trans.bounds.right,\n y: child ? child.outputPoint.y : trans.bounds.rightCenter.y,\n };\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const draggingLabel = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 获取两个分支节点中间点作为拖拽标签插入位置\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.inputPoint.y;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetLeftX - currentOffsetRightX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.inputPoint.x;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetTopX - currentOffsetBottomX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n }\n }\n\n return [...draggingLabel];\n },\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n return document.addNode({\n ...json,\n ...options,\n parent: node,\n index: typeof index === 'number' ? index + 1 : undefined,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowNodeTransformData,\n type FlowNodeTransitionData,\n FlowTransitionLabelEnum,\n FlowLayoutDefault,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 水平 Block 的偏移\n */\nexport const InlineBlocksRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n hidden: true,\n spacing: (node) => getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING),\n isInlineBlocks: true,\n inlineSpacingPre: (node) =>\n getDefaultSpacing(node.entity, ConstantKeys.INLINE_BLOCKS_PADDING_TOP) ||\n DEFAULT_SPACING.INLINE_BLOCKS_PADDING_TOP,\n inlineSpacingAfter: (node) =>\n getDefaultSpacing(node.entity, ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM),\n },\n /**\n * 控制子分支的间距\n * @param child\n */\n getChildDelta(child, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n if (isVertical) {\n const leftSpacing = preTransform.size.width + preTransform.originDeltaX;\n\n // 如果小于最小宽度,偏移最小宽度的距离\n const delta = Math.max(\n child.parent!.minInlineBlockSpacing - leftSpacing,\n getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING) - child.originDeltaX\n );\n\n return {\n // 这里需要加上原点的偏移量,并加上水平间距\n x: preBounds.right + delta,\n y: 0,\n };\n } else {\n const bottomSpacing = preTransform.size.height + preTransform.originDeltaY;\n\n // 如果小于最小高度,偏移最小高度的距离\n const delta = Math.max(\n child.parent!.minInlineBlockSpacing - bottomSpacing,\n getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING) - child.originDeltaY\n );\n\n return {\n x: 0,\n // 这里需要加上原点的偏移量,并加上垂直间距\n y: preBounds.bottom + delta,\n };\n }\n }\n return {\n x: 0,\n y: 0,\n };\n },\n /**\n * 控制条件分支居中布局\n * @param trans\n */\n getDelta(trans, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const { pre, collapsed } = trans;\n\n if (collapsed) {\n return { x: 0, y: 0 };\n }\n\n if (isVertical) {\n const preCenter = pre!.localBounds.center.x;\n const firstBlockX = trans.firstChild?.transform.position.x || 0;\n const lastBlockX = trans.lastChild?.transform.position.x || 0;\n const currentCenter = (lastBlockX - firstBlockX) / 2;\n\n return {\n x: preCenter - currentCenter,\n y: 0,\n };\n }\n const preCenter = pre!.localBounds.center.y;\n const firstBlockY = trans.firstChild?.transform.position.y || 0;\n const lastBlockY = trans.lastChild?.transform.position.y || 0;\n const currentCenter = (lastBlockY - firstBlockY) / 2;\n\n return {\n x: 0,\n y: preCenter - currentCenter,\n };\n },\n getLabels(transition) {\n return getBranchAdderLabel(transition);\n },\n getLines() {\n return [];\n },\n // 和前序节点对齐\n getInputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || 0,\n y: transform.bounds.top,\n };\n }\n return {\n x: transform.bounds.left,\n y: transform.pre?.outputPoint.y || 0,\n };\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 收缩时,出点为入点\n if (transform.collapsed) {\n return transform.inputPoint;\n }\n\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || 0,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: transform.pre?.outputPoint.y || 0,\n };\n },\n};\n\n/**\n * inlineBlocks 获取 BranchAdder 和展开 label\n */\nexport function getBranchAdderLabel(transition: FlowNodeTransitionData) {\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n\n // 收起时展示收起 label\n if (currentTransform.collapsed) {\n return [\n {\n type: FlowTransitionLabelEnum.COLLAPSE_LABEL,\n offset: Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),\n props: {\n activateNode: transition.entity.pre,\n },\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { DefaultSpacingKey, getDefaultSpacing } from '@flowgram.ai/document';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 图标占位节点,如条件分支的菱形图标\n */\nexport const BlockIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: 20, // 占位节点下边偏小\n // 条件分支 icon 默认的高度比较高,在流程里下边有文字\n size: { width: 250, height: 84 },\n },\n /**\n * 是一个占位节点,后续要加上 label 展开收起的图标\n */\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n // 为节点,画一个加号即可\n if (transition.entity.parent!.collapsedChildren.length <= 1) {\n return [];\n }\n\n const collapsedSpacing = getDefaultSpacing(\n transition.entity,\n DefaultSpacingKey.COLLAPSED_SPACING\n );\n\n return [\n {\n type: FlowTransitionLabelEnum.COLLAPSE_LABEL,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }\n ),\n props: {\n collapseNode: transition.entity.parent,\n activateNode: transition.entity,\n },\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Point } from '@flowgram.ai/utils';\nimport { DefaultSpacingKey, getDefaultSpacing } from '@flowgram.ai/document';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 带顺序的图标节点,一般为 block 第一个分支节点\n * - 只有一个分支时,不需要展开收起\n */\nexport const BlockOrderIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ORDER_ICON,\n meta: {\n spacing: 40,\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const currentOutput = currentTransform.outputPoint;\n const nextTransform = currentTransform.next;\n const parentTransform = currentTransform.parent;\n\n // 为空分支,画一个加号即可\n if (transition.entity.parent!.collapsedChildren.length <= 1) {\n const parentOutput = parentTransform?.outputPoint as IPoint;\n return [\n {\n offset: parentOutput,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n }\n\n const collapsedSpacing = getDefaultSpacing(\n transition.entity,\n DefaultSpacingKey.COLLAPSED_SPACING\n );\n\n return [\n {\n offset: nextTransform\n ? Point.getMiddlePoint(currentOutput, nextTransform.inputPoint)\n : Point.move(\n currentOutput,\n isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }\n ),\n // 收起展开复合按钮\n type: FlowTransitionLabelEnum.COLLAPSE_ADDER_LABEL,\n props: {\n activateNode: transition.entity,\n collapseNode: transition.entity.parent,\n },\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 开始节点\n */\nexport const StartRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.START,\n meta: {\n isStart: true,\n draggable: false,\n selectable: false, // 触发器等开始节点不能被框选\n deleteDisable: true, // 禁止删除\n copyDisable: true, // 禁止copy\n addDisable: true, // 禁止添加\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n FlowNodeBaseType,\n type FlowNodeEntity,\n type FlowNodeJSON,\n type FlowNodeRegistry,\n} from '@flowgram.ai/document';\n\nimport {\n CatchBlockRegistry,\n CatchInlineBlocksRegistry,\n MainInlineBlocksRegistry,\n TryBlockRegistry,\n TryCatchSpacings,\n TryCatchTypeEnum,\n TrySlotRegistry,\n} from './try-catch-extends';\n\n/**\n * try catch 节点\n */\nexport const TryCatchRegistry: FlowNodeRegistry = {\n type: 'tryCatch',\n meta: {\n hidden: true,\n inlineSpacingAfter: TryCatchSpacings.INLINE_SPACING_BOTTOM,\n },\n /**\n * 结构\n * tryCatch\n * - tryCatchIcon\n * - mainInlineBlocks\n * - tryBlock // try 分支\n * - trySlot // 空节点用来占位,try 分支一开始没有节点\n * - catchInlineBlocks\n * - catchBlock // catch 分支 1\n * - blockOrderIcon\n * - node1\n * - catchBlock // catch 分支 2\n * - blockOrderIcon\n * - node 2\n * @param node\n * @param json\n */\n onCreate(node: FlowNodeEntity, json: FlowNodeJSON) {\n const { document } = node;\n const [tryBlock, ...catchBlocks] = json.blocks || [];\n const addedNodes: FlowNodeEntity[] = [];\n const tryCatchIconNode = document.addNode({\n id: `$tryCatchIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const mainBlockNode = document.addNode({\n id: `$mainInlineBlocks$${node.id}`,\n type: TryCatchTypeEnum.MAIN_INLINE_BLOCKS,\n originParent: node,\n parent: node,\n });\n const tryBlockNode = document.addNode({\n id: tryBlock.id,\n type: tryBlock.type || TryCatchTypeEnum.TRY_BLOCK,\n originParent: node,\n parent: mainBlockNode,\n data: tryBlock.data,\n });\n const trySlotNode = document.addNode({\n id: `$trySlot$${tryBlock.id}`,\n hidden: true,\n type: TryCatchTypeEnum.TRY_SLOT, // 占位节点\n originParent: node,\n parent: tryBlockNode,\n });\n const catchInlineBlocksNode = document.addNode({\n id: `$catchInlineBlocks$${node.id}`,\n type: TryCatchTypeEnum.CATCH_INLINE_BLOCKS,\n originParent: node,\n parent: mainBlockNode,\n });\n addedNodes.push(\n tryCatchIconNode,\n mainBlockNode,\n tryBlockNode,\n trySlotNode,\n catchInlineBlocksNode\n );\n (tryBlock.blocks || []).forEach((blockData) => {\n document.addNode(\n {\n ...blockData,\n parent: tryBlockNode,\n },\n addedNodes\n );\n });\n catchBlocks.forEach((blockData) => {\n document.addBlock(node, blockData, addedNodes);\n });\n return addedNodes;\n },\n /**\n * 添加 catch 分支\n * @param node\n * @param blockData\n * @param addedNodes\n */\n onBlockChildCreate(node, blockData, addedNodes) {\n const parent = node.document.getNode(`$catchInlineBlocks$${node.id}`);\n const block = node.document.addNode({\n id: blockData.id,\n type: blockData.type || TryCatchTypeEnum.CATCH_BLOCK,\n originParent: node,\n parent,\n data: blockData.data,\n });\n // 分支开始节点\n const blockOrderIcon = node.document.addNode({\n id: `$blockOrderIcon$${blockData.id}`,\n type: FlowNodeBaseType.BLOCK_ORDER_ICON,\n originParent: node,\n parent: block,\n });\n if (blockData.blocks) {\n node.document.addBlocksAsChildren(block, blockData.blocks || [], addedNodes);\n }\n addedNodes?.push(block, blockOrderIcon);\n return block;\n },\n getInputPoint(transform) {\n const tryCatchIcon = transform.firstChild!;\n // 使用图标的 inputPoint\n return tryCatchIcon.inputPoint;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const tryCatchIcon = transform.firstChild!;\n if (isVertical) {\n return {\n x: tryCatchIcon.inputPoint.x,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: tryCatchIcon.inputPoint.y,\n };\n },\n /**\n * tryCatch 子节点配置\n */\n extendChildRegistries: [\n /**\n * icon 节点\n */\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: TryCatchSpacings.INLINE_SPACING_TOP,\n },\n getLabels() {\n return [];\n },\n },\n MainInlineBlocksRegistry,\n CatchInlineBlocksRegistry,\n TryBlockRegistry,\n CatchBlockRegistry,\n TrySlotRegistry,\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLineEnum,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * catch 分支\n */\nexport const CatchBlockRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.BLOCK,\n type: TryCatchTypeEnum.CATCH_BLOCK,\n meta: {\n hidden: true,\n spacing: DEFAULT_SPACING.NULL,\n },\n getLines(transition) {\n const { transform } = transition;\n const { isVertical } = transition.entity;\n const parentPoint = transform.parent!;\n const { inputPoint, outputPoint } = transform;\n let parentInputPoint;\n if (isVertical) {\n parentInputPoint = {\n x: parentPoint.inputPoint.x,\n y: parentPoint.inputPoint.y - TryCatchSpacings.CATCH_INLINE_SPACING,\n };\n } else {\n parentInputPoint = {\n x: parentPoint.inputPoint.x - TryCatchSpacings.CATCH_INLINE_SPACING,\n y: parentPoint.inputPoint.y,\n };\n }\n\n const lines = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: parentInputPoint,\n to: inputPoint,\n },\n ];\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n let mergePoint;\n if (isVertical) {\n mergePoint = {\n x: parentPoint.outputPoint.x,\n y: parentPoint.bounds.bottom,\n };\n } else {\n mergePoint = {\n x: parentPoint.bounds.right,\n y: parentPoint.outputPoint.y,\n };\n }\n\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: outputPoint,\n to: mergePoint,\n });\n }\n\n return lines;\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n FlowLayoutDefault,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * catch 分支列表\n */\nexport const CatchInlineBlocksRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.INLINE_BLOCKS,\n type: TryCatchTypeEnum.CATCH_INLINE_BLOCKS,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n inlineSpacingPre: DEFAULT_SPACING.NULL,\n // inlineSpacingAfter: DEFAULT_SPACING.NULL,\n },\n getDelta() {\n return undefined;\n },\n getLines(transition) {\n const { transform } = transition;\n const mainInlineBlocks = transform.parent!;\n\n const lines = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: mainInlineBlocks.pre!.outputPoint,\n to: transform.inputPoint,\n },\n ];\n\n if (!transform.entity.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: transform.outputPoint,\n to: mainInlineBlocks.outputPoint,\n });\n }\n\n return lines;\n },\n getOriginDeltaX(transform) {\n const { firstChild } = transform;\n if (!firstChild) return 0;\n return firstChild.originDeltaX;\n },\n getLabels(transition) {\n const { inputPoint } = transition.transform;\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n\n // 实际输入点\n const actualInputPoint = {\n x: isVertical ? inputPoint.x : inputPoint.x - TryCatchSpacings.CATCH_INLINE_SPACING,\n y: isVertical ? inputPoint.y - TryCatchSpacings.CATCH_INLINE_SPACING : inputPoint.y,\n };\n\n if (currentTransform.collapsed) {\n return [];\n }\n\n // branch adder 节点\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: actualInputPoint,\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n },\n getInputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 因为是左偏移,所以用第一条 catch 分支\n const firstCatchBlock = transform.firstChild;\n if (firstCatchBlock) {\n return firstCatchBlock.inputPoint;\n }\n return isVertical ? transform.bounds.topCenter : transform.bounds.rightCenter;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n\n // 收缩时,出点为入点\n if (transform.collapsed) {\n return transform.inputPoint;\n }\n\n const firstCatchBlock = transform.firstChild;\n if (firstCatchBlock) {\n return isVertical\n ? {\n x: firstCatchBlock!.outputPoint?.x,\n y: transform.bounds.bottom,\n }\n : {\n x: transform.bounds.right,\n y: firstCatchBlock!.outputPoint?.y,\n };\n }\n return isVertical ? transform.bounds.bottomCenter : transform.bounds.rightCenter;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey, FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeTransformData,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n FlowLayoutDefault,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * 主 BLOCK\n */\nexport const MainInlineBlocksRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.INLINE_BLOCKS,\n type: TryCatchTypeEnum.MAIN_INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: TryCatchSpacings.MAIN_INLINE_SPACING_TOP,\n inlineSpacingAfter: TryCatchSpacings.MAIN_INLINE_SPACING_BOTTOM,\n },\n getLines(transition) {\n const { transform } = transition;\n const tryBranch = transform.firstChild!;\n\n const lines = [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: tryBranch.outputPoint,\n to: transform.originParent!.outputPoint,\n },\n ];\n\n return lines;\n },\n getLabels(transition) {\n const { transform } = transition;\n const { isVertical } = transition.entity;\n const catchInlineBlocks = transform.children[1]!;\n const errLabelX = isVertical\n ? (transform.parent!.outputPoint.x + catchInlineBlocks.inputPoint.x) / 2\n : transform.inputPoint.x - TryCatchSpacings.INLINE_SPACING_TOP;\n const errLabelY = isVertical\n ? transform.inputPoint.y - TryCatchSpacings.INLINE_SPACING_TOP\n : (transform.parent!.outputPoint.y + catchInlineBlocks.inputPoint.y) / 2;\n\n const errorLabelX = errLabelX;\n const errorLabelY = errLabelY;\n return [\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.TRY_START_TEXT,\n offset: {\n x: isVertical\n ? transform.inputPoint.x\n : transform.inputPoint.x + TryCatchSpacings.TRY_START_LABEL_DELTA,\n y: isVertical\n ? transform.inputPoint.y + TryCatchSpacings.TRY_START_LABEL_DELTA\n : transform.inputPoint.y,\n },\n },\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.TRY_END_TEXT,\n offset: {\n x: isVertical\n ? transform.inputPoint.x\n : transform.originParent!.outputPoint.x + TryCatchSpacings.TRY_END_LABEL_DELTA,\n y: isVertical\n ? transform.originParent!.outputPoint.y + TryCatchSpacings.TRY_END_LABEL_DELTA\n : transform.inputPoint.y,\n },\n },\n // 错误分支收起\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.TRY_CATCH_COLLAPSE,\n offset: {\n x: errorLabelX,\n y: errorLabelY,\n },\n props: {\n node: transform.lastChild?.entity,\n },\n },\n ];\n },\n getInputPoint(transform) {\n const tryBlock = transform.firstChild!;\n return tryBlock.inputPoint;\n },\n getOutputPoint(transform, layout) {\n const tryBlock = transform.firstChild!;\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (isVertical) {\n return {\n x: tryBlock.outputPoint.x,\n y: transform.bounds.bottom + TryCatchSpacings.CATCH_INLINE_SPACING,\n };\n }\n return {\n x: transform.bounds.right + TryCatchSpacings.CATCH_INLINE_SPACING,\n y: tryBlock.outputPoint.y,\n };\n },\n getDelta() {\n return undefined;\n },\n getChildDelta(child, layout) {\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n // try 分支和 catch 分支的最小间距不低于 minInlineBlockSpacing\n let delta = 0;\n if (isVertical) {\n delta = Math.max(\n child.parent!.minInlineBlockSpacing,\n -child.originDeltaX + getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING)\n );\n } else {\n delta = Math.max(\n child.parent!.minInlineBlockSpacing,\n -child.originDeltaY + getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING)\n );\n }\n\n return {\n // 分支只有两个所以这里可以写死间隔宽度\n x: isVertical ? preBounds.right + delta : 0,\n y: isVertical ? 0 : preBounds.bottom + delta,\n };\n }\n return {\n x: 0,\n y: 0,\n };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DEFAULT_SPACING, FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { TryCatchTypeEnum } from './constants';\n\n/**\n * try 分支\n */\nexport const TryBlockRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.BLOCK,\n type: TryCatchTypeEnum.TRY_BLOCK,\n meta: {\n hidden: true,\n spacing: DEFAULT_SPACING.NULL,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry, FlowTransitionLabelEnum } from '@flowgram.ai/document';\n\nimport { TryCatchTypeEnum } from './constants';\n\n/**\n * try 占位节点\n */\nexport const TrySlotRegistry: FlowNodeRegistry = {\n type: TryCatchTypeEnum.TRY_SLOT,\n meta: {\n inlineSpacingAfter: 16,\n spacing: 0,\n size: {\n width: 16,\n height: 0,\n },\n },\n onAfterUpdateLocalTransform(transform): void {\n // 根据布局要置换宽高数据\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: 16,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: 16,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n getLabels(transition) {\n return [\n {\n offset: transition.transform.bounds.center,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeEntity,\n type FlowNodeJSON,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport {\n LoopEmptyBranchRegistry,\n LoopInlineBlocksNodeRegistry,\n LoopLeftEmptyBlockRegistry,\n LoopRightEmptyBlockRegistry,\n LoopSpacings,\n LoopTypeEnum,\n} from './loop-extends';\n\n/**\n * 循环节点\n */\nexport const LoopRegistry: FlowNodeRegistry = {\n type: 'loop',\n meta: {\n hidden: true,\n inlineSpacingAfter: (node) => {\n if (node.collapsed) {\n return LoopSpacings.COLLAPSE_INLINE_SPACING_BOTTOM;\n }\n const inlineSpacingBottom = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_SPACING_BOTTOM,\n LoopSpacings.INLINE_SPACING_BOTTOM\n );\n return inlineSpacingBottom;\n },\n spacing: LoopSpacings.SPACING,\n },\n /**\n * - loopNode\n * - loopBlockIcon\n * - loopInlineBlocks\n * - loopEmptyBlock 左侧占位区域\n * - loopBlock\n * - xxx\n * - xxx\n * @param node\n * @param json\n */\n onCreate(node: FlowNodeEntity, json: FlowNodeJSON) {\n const { document } = node;\n const loopBlocks = json.blocks || [];\n\n const loopIconNode = document.addNode({\n id: `$blockIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const loopInlineBlocks = document.addNode({\n id: `$inlineBlocks$${node.id}`,\n hidden: true,\n type: FlowNodeBaseType.INLINE_BLOCKS,\n originParent: node,\n parent: node,\n });\n const loopEmptyBlockNode = document.addNode({\n id: `$loopLeftEmpty$${node.id}`,\n hidden: true,\n type: LoopTypeEnum.LOOP_LEFT_EMPTY_BLOCK,\n originParent: node,\n parent: loopInlineBlocks,\n });\n\n const loopBlockNode = document.addNode({\n id: `$block$${node.id}`,\n hidden: true,\n type: FlowNodeBaseType.BLOCK, // : LoopTypeEnum.LOOP_RIGHT_EMPTY_BLOCK,\n originParent: node,\n parent: loopInlineBlocks,\n });\n const loopBranch = document.addNode({\n id: `$loopRightEmpty$${node.id}`,\n hidden: true,\n type: LoopTypeEnum.LOOP_EMPTY_BRANCH,\n originParent: node,\n parent: loopBlockNode,\n });\n const otherNodes: FlowNodeEntity[] = [];\n loopBlocks.forEach((b) =>\n document.addNode(\n {\n ...b,\n type: b.type!,\n parent: loopBlockNode,\n },\n otherNodes\n )\n );\n\n return [\n loopIconNode,\n loopEmptyBlockNode,\n loopInlineBlocks,\n loopBlockNode,\n loopBranch,\n ...otherNodes,\n ];\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n return [\n // 循环结束\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_END_TEXT,\n // 循环 label 垂直样式展示,而非 rotate 旋转文案\n props: isVertical\n ? undefined\n : {\n style: {\n maxWidth: '20px',\n lineHeight: '12px',\n whiteSpace: 'pre-wrap',\n },\n },\n offset: Point.move(currentTransform.outputPoint, isVertical ? { y: -26 } : { x: -26 }),\n },\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: currentTransform.outputPoint,\n },\n ];\n },\n // 和前序节点对齐\n getInputPoint(transform) {\n const { isVertical } = transform.entity;\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,\n y: transform.bounds.top,\n };\n }\n return {\n x: transform.bounds.left,\n y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0,\n };\n },\n getOutputPoint(transform) {\n const { isVertical } = transform.entity;\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0,\n };\n },\n\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: LoopSpacings.LOOP_BLOCK_ICON_SPACING,\n },\n },\n LoopLeftEmptyBlockRegistry,\n LoopEmptyBranchRegistry,\n LoopRightEmptyBlockRegistry,\n LoopInlineBlocksNodeRegistry,\n ],\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n return document.addNode({\n ...json,\n ...options,\n parent: document.getNode(`$block$${node.id}`),\n index: typeof index === 'number' ? index + 1 : undefined,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ConstantKeys } from '@flowgram.ai/document';\n\nexport enum LoopTypeEnum {\n LOOP_LEFT_EMPTY_BLOCK = 'loopLeftEmptyBlock',\n LOOP_RIGHT_EMPTY_BLOCK = 'loopRightEmptyBlock',\n LOOP_EMPTY_BRANCH = 'loopEmptyBranch',\n}\n\nexport const LoopSpacings = {\n SPACING: 16, // 距离下面节点距离\n COLLAPSE_INLINE_SPACING_BOTTOM: 60, // 距离下面节点距离\n [ConstantKeys.INLINE_SPACING_BOTTOM]: 48, // 下边空白\n MIN_INLINE_BLOCK_SPACING: 280, // 最小循环圈宽度\n HORIZONTAL_MIN_INLINE_BLOCK_SPACING: 180, // 水平布局下的最小循环圈高度\n LEFT_EMPTY_BLOCK_WIDTH: 80, // 左边空分支宽度\n EMPTY_BRANCH_SPACING: 20, // 左边空分支宽度\n LOOP_BLOCK_ICON_SPACING: 13, // inlineBlocks 的 inlineBottom\n [ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM]: 23, // inlineBlocks 的 inlineBottom\n INLINE_BLOCKS_INLINE_SPACING_TOP: 30, // inlineBlocks 的 inlineTop\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { LoopSpacings, LoopTypeEnum } from './constants';\n\nexport const LoopLeftEmptyBlockRegistry: FlowNodeRegistry = {\n type: LoopTypeEnum.LOOP_LEFT_EMPTY_BLOCK,\n meta: {\n inlineSpacingAfter: 0,\n spacing: 0,\n size: {\n width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n height: 0,\n },\n },\n onAfterUpdateLocalTransform(transform): void {\n // 根据布局要置换宽高数据\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { BlockRegistry } from '../block';\nimport { LoopTypeEnum } from './constants';\n\nexport const LoopRightEmptyBlockRegistry: FlowNodeRegistry = {\n ...BlockRegistry,\n type: LoopTypeEnum.LOOP_RIGHT_EMPTY_BLOCK,\n meta: {\n ...BlockRegistry.meta,\n inlineSpacingAfter: 0,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry, FlowTransitionLabelEnum } from '@flowgram.ai/document';\n\nimport { LoopSpacings, LoopTypeEnum } from './constants';\n\nexport const LoopEmptyBranchRegistry: FlowNodeRegistry = {\n type: LoopTypeEnum.LOOP_EMPTY_BRANCH,\n meta: {\n inlineSpacingAfter: 0,\n spacing: LoopSpacings.EMPTY_BRANCH_SPACING,\n size: {\n width: 100,\n height: 0,\n },\n },\n getLabels(transition) {\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n if (isVertical) {\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: {\n x: currentTransform.inputPoint.x,\n y: currentTransform.bounds.center.y + 8, // 右边空节点\n },\n },\n ];\n }\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: {\n x: currentTransform.bounds.center.x + 8,\n y: currentTransform.inputPoint.y,\n },\n },\n ];\n },\n onAfterUpdateLocalTransform(transform): void {\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: 100,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: 100,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n type FlowTransitionLabel,\n FlowTransitionLabelEnum,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport { LoopSpacings } from './constants';\n\nexport const LoopInlineBlocksNodeRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: (node) => {\n const inlineBlocksInlineSpacingTop = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_TOP,\n LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_TOP\n );\n return inlineBlocksInlineSpacingTop;\n },\n inlineSpacingAfter: (node) => {\n const inlineBlocksInlineSpacingBottom = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM,\n LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_BOTTOM\n );\n return inlineBlocksInlineSpacingBottom;\n },\n minInlineBlockSpacing: (node) =>\n node.entity.isVertical\n ? LoopSpacings.MIN_INLINE_BLOCK_SPACING\n : LoopSpacings.HORIZONTAL_MIN_INLINE_BLOCK_SPACING,\n },\n getLines(transition) {\n const currentTransform = transition.transform;\n const parentTransform = currentTransform.parent!;\n const { isVertical } = transition.entity;\n\n const lines: FlowTransitionLine[] = [\n // 循环结束线\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: currentTransform.outputPoint,\n to: parentTransform.outputPoint,\n },\n ];\n\n // 收起时展示\n if (currentTransform.collapsed) {\n return lines;\n }\n\n const [leftBlockTransform] = currentTransform.children;\n\n return [\n ...lines,\n // 循环回撤线 - 1 分成两段可以被 viewport 识别出矩阵区域\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: currentTransform.outputPoint,\n to: leftBlockTransform.outputPoint,\n vertices: [\n isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.bottom }\n : { x: currentTransform.bounds.right, y: leftBlockTransform.inputPoint.y },\n ],\n },\n // 循环回撤线 - 2\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: leftBlockTransform.outputPoint,\n to: Point.move(\n currentTransform.inputPoint,\n isVertical ? { x: -12, y: 10 } : { x: 10, y: -12 }\n ),\n vertices: [\n isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.top + 10 }\n : { x: currentTransform.bounds.left + 10, y: leftBlockTransform.inputPoint.y },\n ],\n arrow: true,\n },\n ];\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const labels: FlowTransitionLabel[] = [];\n\n // 收起时展示\n if (currentTransform.collapsed) {\n return labels;\n }\n\n const leftBlockTransform = currentTransform.children[0];\n const rightBlockTransform = currentTransform.children[1];\n\n if (transition.entity.originParent?.id.startsWith('while_')) {\n // 满足条件时\n labels.push({\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_WHILE_TEXT,\n rotate: isVertical ? '' : '-90deg',\n offset: isVertical\n ? {\n x: (currentTransform.inputPoint.x + rightBlockTransform.inputPoint.x) / 2,\n y: currentTransform.inputPoint.y + 10,\n }\n : {\n x: currentTransform.inputPoint.x + 10,\n y: (currentTransform.inputPoint.y + rightBlockTransform.inputPoint.y) / 2,\n },\n });\n } else {\n // 循环遍历\n labels.push({\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_TRAVERSE_TEXT,\n // rotate: isVertical ? '' : '-90deg',\n offset: isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.center.y + 5 }\n : { x: currentTransform.bounds.center.x + 5, y: leftBlockTransform.inputPoint.y },\n });\n }\n\n return labels;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DEFAULT_SPACING, FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 根节点\n */\nexport const RootRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.ROOT,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n hidden: true,\n },\n getInputPoint(transform) {\n return transform.firstChild?.inputPoint || transform.bounds.topCenter;\n },\n getOutputPoint(transform) {\n return transform.firstChild?.outputPoint || transform.bounds.bottomCenter;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 占位节点,宽高为 0, 该节点下边同样有 \"添加 label\"\n */\nexport const EmptyRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.EMPTY,\n meta: {\n spacing: (node) => {\n const spacing = getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING);\n return spacing / 2;\n },\n size: { width: 0, height: 0 },\n hidden: true,\n },\n getLabels(transition) {\n return [\n {\n offset: transition.transform.bounds,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowNodeBaseType,\n FlowNodeJSON,\n FlowNodeEntity,\n} from '@flowgram.ai/document';\n\n/**\n * - simpleSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * node1\n * node2\n */\nexport const SimpleSplitRegistry: FlowNodeRegistry = {\n type: FlowNodeSplitType.SIMPLE_SPLIT,\n extend: FlowNodeSplitType.DYNAMIC_SPLIT,\n onBlockChildCreate(\n originParent: FlowNodeEntity,\n blockData: FlowNodeJSON,\n addedNodes: FlowNodeEntity[] = [] // 新创建的节点都要存在这里\n ) {\n const { document } = originParent;\n const parent = document.getNode(`$inlineBlocks$${originParent.id}`);\n const realBlock = document.addNode(\n {\n ...blockData,\n type: blockData.type || FlowNodeBaseType.BLOCK,\n parent,\n },\n addedNodes\n );\n addedNodes.push(realBlock);\n return realBlock;\n },\n // addChild(node, json, options = {}) {\n // const { index } = options;\n // const document = node.document;\n // return document.addBlock(node, json, undefined, undefined, index);\n // }\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * Break 节点, 用于分支断开\n */\nexport const BreakRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BREAK,\n extend: FlowNodeBaseType.END,\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n LABEL_SIDE_TYPE,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 输入节点\n */\nexport const InputRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INPUT,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n hidden: false,\n },\n getLines(transition, layout) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n const lines: FlowTransitionLine[] = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 分支拖拽场景线条 push\n // 当有其余分支的时候,绘制一条两个分支之间的线条\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.outputPoint.y;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n isDraggingLine: true,\n from: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.outputPoint.x;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n isDraggingLine: true,\n from: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n }\n }\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: currentTransform.outputPoint,\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n\n return lines;\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const draggingLabel = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 获取两个分支节点中间点作为拖拽标签插入位置\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.outputPoint.y;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetLeftX - currentOffsetRightX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.outputPoint.x;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetTopX - currentOffsetBottomX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n }\n }\n\n return [...draggingLabel];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 输出节点, 一般作为 end 节点\n */\nexport const OuputRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.OUTPUT,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n hidden: false,\n isNodeEnd: true,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowNodeBaseType,\n} from '@flowgram.ai/document';\n\nimport { DynamicSplitRegistry } from './dynamic-split';\nimport { BlockRegistry } from './block';\n\n/**\n * 多输出节点\n * - multiOutputs:\n * - blockIcon\n * - inlineBlocks\n * - output or multiOutputs\n * - output or multiOutputs\n */\nexport const MultiOuputsRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.MULTI_OUTPUTS,\n extend: FlowNodeSplitType.SIMPLE_SPLIT,\n meta: {\n isNodeEnd: true,\n },\n getLines: (transition, layout) => {\n // 嵌套在 mutliOutputs 下边\n if (transition.entity.parent?.flowNodeType === FlowNodeBaseType.INLINE_BLOCKS) {\n return BlockRegistry.getLines!(transition, layout);\n }\n return [];\n },\n getLabels: (transition, layout) => [\n ...DynamicSplitRegistry.getLabels!(transition, layout),\n ...BlockRegistry.getLabels!(transition, layout),\n ],\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const lastChildOutput = transform.lastChild?.outputPoint;\n\n if (isVertical) {\n return {\n x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,\n y: transform.bounds.bottom,\n };\n }\n\n return {\n x: transform.bounds.right,\n y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y,\n };\n },\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n // isNodeEnd: true\n },\n },\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowTransitionLabelEnum,\n FlowNodeSplitType,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\n/**\n * 多输入节点, 只能作为 开始节点\n * - multiInputs:\n * - inlineBlocks\n * - input\n * - input\n */\nexport const MultiInputsRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.MULTI_INPUTS,\n extend: FlowNodeSplitType.SIMPLE_SPLIT,\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n hidden: true,\n spacing: 0,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n },\n {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: 0,\n },\n getLabels(transition) {\n const isVertical = transition.entity.isVertical;\n const currentTransform = transition.transform;\n const spacing = getDefaultSpacing(\n transition.entity,\n ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM\n );\n\n if (currentTransform.collapsed || transition.entity.childrenLength === 0) {\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: spacing } : { x: spacing }\n ),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: -spacing / 2 } : { x: -spacing / 2 }\n ),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n },\n },\n ],\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType, getDefaultSpacing } from '@flowgram.ai/document';\n\nimport {\n drawStraightAdder,\n drawStraightLine,\n getInputPoint,\n getOutputPoint,\n} from './utils/transition';\nimport { insideSlot } from './utils/node';\nimport { getAllPortsMiddle } from './utils/layout';\nimport { createSlotFromJSON } from './utils/create';\nimport { SlotInlineBlocksRegistry, SlotIconRegistry } from './extends';\nimport {\n SLOT_NODE_LAST_SPACING,\n SLOT_SPACING,\n SLOT_START_DISTANCE,\n SlotSpacingKey,\n} from './constants';\n\nexport const SlotRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.SLOT,\n extend: 'block',\n meta: {\n // Slot 节点内部暂时不允许拖拽\n draggable: (node) => !insideSlot(node),\n hidden: true,\n spacing: (node) => getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_SPACING, SLOT_SPACING),\n padding: (node) => ({\n left: 0,\n right: node.collapsed\n ? getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_START_DISTANCE, SLOT_START_DISTANCE)\n : 0,\n bottom: !insideSlot(node.entity) && node.isLast ? SLOT_NODE_LAST_SPACING : 0,\n top: 0,\n }),\n copyDisable: false,\n defaultExpanded: false,\n },\n /**\n * 业务通常需要重载方法\n */\n onCreate: createSlotFromJSON,\n getLines: (transition) => [\n ...(!insideSlot(transition.entity) ? drawStraightLine(transition) : []),\n ],\n getLabels: (transition) => [\n ...(!insideSlot(transition.entity) ? drawStraightAdder(transition) : []),\n ],\n getInputPoint,\n getOutputPoint,\n onAfterUpdateLocalTransform(transform) {\n const { isVertical } = transform.entity;\n\n if (!isVertical) {\n return;\n }\n\n const icon = transform.firstChild;\n const inlineBlocks = transform.lastChild;\n\n if (!icon || !inlineBlocks) {\n return;\n }\n\n const iconSize = icon.localBounds.height;\n const inlineBlocksSize = inlineBlocks.localBounds.height;\n\n if (transform.collapsed || !inlineBlocks) {\n return;\n }\n\n // 所有 Ports 的中间点\n const portsMiddle = getAllPortsMiddle(inlineBlocks);\n\n icon.entity.clearMemoLocal();\n inlineBlocks.entity.clearMemoLocal();\n\n if (iconSize / 2 + portsMiddle > inlineBlocksSize || !inlineBlocks.children.length) {\n icon.transform.update({\n position: { x: icon.transform.position.x, y: 0 },\n });\n inlineBlocks.transform.update({\n position: {\n x: inlineBlocks.transform.position.x,\n y: Math.max(iconSize / 2 - inlineBlocksSize / 2, 0),\n },\n });\n\n return;\n }\n\n inlineBlocks.transform.update({\n position: { x: inlineBlocks.transform.position.x, y: 0 },\n });\n icon?.transform.update({\n position: {\n x: icon.transform.position.x,\n y: Math.max(portsMiddle - iconSize / 2, 0), // 所有 port 的中间点\n },\n });\n },\n extendChildRegistries: [SlotIconRegistry, SlotInlineBlocksRegistry],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Point } from '@flowgram.ai/utils';\nimport {\n type FlowNodeTransitionData,\n FlowTransitionLineEnum,\n FlowTransitionLabelEnum,\n type FlowNodeTransformData,\n type FlowTransitionLine,\n type FlowTransitionLabel,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\nimport { RENDER_SLOT_COLLAPSE_KEY, SlotSpacingKey, SLOT_START_DISTANCE } from '../constants';\nimport { getDisplayFirstChildTransform } from './node';\n\n/**\n * 画 Slot 节点虚线起点\n * @param iconTransform blockIcon 的 transform\n * @returns\n */\nexport const getSlotChildLineStartPoint = (iconTransform?: FlowNodeTransformData): IPoint => {\n if (!iconTransform) {\n return { x: 0, y: 0 };\n }\n\n const startDistance = getDefaultSpacing(\n iconTransform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n if (!iconTransform.entity.isVertical) {\n return {\n x: iconTransform?.bounds.center.x,\n y: iconTransform?.bounds.bottom + startDistance,\n };\n }\n return {\n x: iconTransform?.bounds.right + startDistance,\n y: iconTransform?.bounds.center.y,\n };\n};\n\nexport const getOutputPoint = (transform: FlowNodeTransformData): IPoint => {\n const icon = transform.firstChild;\n\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n if (!transform.entity.isVertical) {\n return {\n x: transform.bounds.right,\n y: icon.outputPoint.y,\n };\n }\n\n return {\n x: icon.outputPoint.x,\n y: transform.bounds.bottom,\n };\n};\n\nexport const getInputPoint = (transform: FlowNodeTransformData): IPoint => {\n const icon = transform.firstChild;\n\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n if (!transform.entity.isVertical) {\n return {\n x: transform.bounds.left,\n y: icon.outputPoint.y,\n };\n }\n\n return icon.inputPoint;\n};\n\n/**\n * 获取实连线终点\n * @param transition\n * @returns\n */\nexport const getTransitionToPoint = (transition: FlowNodeTransitionData): IPoint => {\n let toPoint = transition.transform.next?.inputPoint;\n const icon = transition.transform.firstChild;\n\n const parent = transition.transform.parent;\n\n if (!icon || !parent) {\n return { x: 0, y: 0 };\n }\n\n if (!transition.transform.next) {\n if (!transition.entity.isVertical) {\n toPoint = {\n x: parent.outputPoint.x,\n y: icon.outputPoint.y,\n };\n } else {\n toPoint = {\n x: icon.outputPoint.x,\n y: parent.outputPoint.y,\n };\n }\n }\n\n return toPoint || { x: 0, y: 0 };\n};\n\n/**\n * 画实现线\n * @param transition Slot 节点的 transition\n * @returns\n */\nexport const drawStraightLine = (transition: FlowNodeTransitionData): FlowTransitionLine[] => {\n const icon = transition.transform.firstChild;\n const toPoint = getTransitionToPoint(transition);\n\n if (!icon) {\n return [];\n }\n\n return [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: icon.outputPoint,\n to: toPoint,\n },\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: icon.inputPoint,\n to: transition.transform.inputPoint,\n },\n ];\n};\n\nexport const drawCollapseLabel = (transition: FlowNodeTransitionData): FlowTransitionLabel[] => {\n const icon = transition.transform;\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_COLLAPSE_KEY,\n offset: getSlotChildLineStartPoint(icon),\n props: {\n node: transition.entity.parent,\n },\n },\n ];\n};\n\nexport const drawCollapseLine = (transition: FlowNodeTransitionData): FlowTransitionLine[] => {\n const startDistance = getDefaultSpacing(\n transition.transform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n return [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: getSlotChildLineStartPoint(transition.transform),\n to: Point.move(\n getSlotChildLineStartPoint(transition.transform),\n transition.entity.isVertical ? { x: -startDistance, y: 0 } : { x: 0, y: -startDistance }\n ),\n style: {\n strokeDasharray: '5 5',\n },\n },\n ];\n};\n\n/**\n * 画实线上的叫号\n * @param transition\n * @returns\n */\nexport const drawStraightAdder = (transition: FlowNodeTransitionData): FlowTransitionLabel[] => {\n const toPoint = getTransitionToPoint(transition);\n const fromPoint = transition.transform.firstChild!.outputPoint;\n\n const hoverProps = transition.entity.isVertical\n ? {\n hoverHeight: toPoint.y - fromPoint.y,\n hoverWidth: transition.transform.firstChild?.bounds.width,\n }\n : {\n hoverHeight: transition.transform.firstChild?.bounds.height,\n hoverWidth: toPoint.x - fromPoint.x,\n };\n\n return [\n {\n offset: Point.getMiddlePoint(fromPoint, toPoint),\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n props: hoverProps,\n },\n ];\n};\n\n/**\n * 获取端口的子节点线条输入点\n * @param _child\n * @returns\n */\nexport const getPortChildInput = (_child?: FlowNodeTransformData) => {\n if (!_child) {\n return { x: 0, y: 0 };\n }\n\n const firstChild = getDisplayFirstChildTransform(_child);\n\n return { x: _child.bounds.left, y: firstChild.bounds.center.y };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\n\nexport const RENDER_SLOT_ADDER_KEY: string = FlowRendererKey.SLOT_ADDER;\nexport const RENDER_SLOT_LABEL_KEY: string = FlowRendererKey.SLOT_LABEL;\nexport const RENDER_SLOT_COLLAPSE_KEY: string = FlowRendererKey.SLOT_COLLAPSE;\n\nexport const SlotSpacingKey = {\n /**\n * = Next Node - Slot END\n */\n SLOT_SPACING: 'SLOT_SPACING',\n\n /**\n * = Slot Start Line - Slot Icon Right\n */\n SLOT_START_DISTANCE: 'SLOT_START_DISTANCE',\n\n /**\n * = Slot Radius\n */\n SLOT_RADIUS: 'SLOT_RADIUS',\n\n /**\n * = Slot Port - Slot Start\n */\n SLOT_PORT_DISTANCE: 'SLOT_PORT_DISTANCE',\n\n /**\n * = Slot Label - Slot Start\n */\n SLOT_LABEL_DISTANCE: 'SLOT_LABEL_DISTANCE',\n\n /**\n * = Slot Block - Slot Port\n */\n SLOT_BLOCK_PORT_DISTANCE: 'SLOT_BLOCK_PORT_DISTANCE',\n\n /**\n * Vertical Layout: Slot Block - Slot Block\n */\n SLOT_BLOCK_VERTICAL_SPACING: 'SLOT_BLOCK_VERTICAL_SPACING',\n};\n\nexport const SLOT_START_DISTANCE = 16;\nexport const SLOT_PORT_DISTANCE = 100;\nexport const SLOT_LABEL_DISTANCE = 32;\nexport const SLOT_BLOCK_PORT_DISTANCE = 32.5;\nexport const SLOT_RADIUS = 16;\nexport const SLOT_SPACING = 32;\nexport const SLOT_BLOCK_VERTICAL_SPACING = 32.5;\nexport const SLOT_NODE_LAST_SPACING = 10;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType } from '@flowgram.ai/document';\n\nexport enum SlotNodeType {\n Slot = FlowNodeBaseType.SLOT,\n SlotBlock = FlowNodeBaseType.SLOT_BLOCK,\n SlotInlineBlocks = 'slotInlineBlocks',\n SlotBlockInlineBlocks = 'slotBlockInlineBlocks',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\n\n/**\n * Slot 节点是否可下钻,看 inlineBlocks 是否有子节点\n * @param Slot Slot 节点\n */\nexport const canSlotDrilldown = (Slot: FlowNodeEntity): boolean =>\n !!Slot?.lastCollapsedChild?.blocks.length;\n\n/**\n * 是否是 Slot 内部\n * @param entity\n * @returns\n */\nexport const insideSlot = (entity?: FlowNodeEntity): boolean =>\n !!entity?.parent?.isTypeOrExtendType(SlotNodeType.SlotBlock);\n\n/**\n * 获取在页面上实际渲染的第一个 Child 节点\n * @param node\n */\nexport const getDisplayFirstChildTransform = (\n transform: FlowNodeTransformData\n): FlowNodeTransformData => {\n if (transform.firstChild) {\n return getDisplayFirstChildTransform(transform.firstChild);\n }\n\n return transform;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mean } from 'lodash-es';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nexport const getDisplayFirstChildTop = (transform: FlowNodeTransformData): number => {\n if (transform.firstChild) {\n return transform.localBounds.top + getDisplayFirstChildTop(transform.firstChild);\n }\n\n return transform.localBounds.center.y;\n};\n\n/**\n * 获取单个 Port 的中间点\n * @param inlineBlocks\n * @returns\n */\nexport const getPortMiddle = (_port: FlowNodeTransformData) => {\n if (!_port.children.length) {\n return _port.localBounds.top;\n }\n\n const portChildInputs = [_port.firstChild!, _port.lastChild!].map((_portChild) =>\n getDisplayFirstChildTop(_portChild)\n );\n\n return _port.localBounds.top + mean(portChildInputs);\n};\n\n/**\n * 获取所有 Port 的中间点\n * @param inlineBlocks\n * @returns\n */\nexport const getAllPortsMiddle = (inlineBlocks: FlowNodeTransformData) => {\n if (!inlineBlocks.children.length) {\n return inlineBlocks.localBounds.height / 2;\n }\n\n const portInputs = [inlineBlocks.firstChild!, inlineBlocks.lastChild!].map((_port) =>\n getPortMiddle(_port)\n );\n\n return mean(portInputs);\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType } from '@flowgram.ai/document';\nimport { type FlowNodeEntity } from '@flowgram.ai/document';\nimport { FlowNodeJSON } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\n\n// Slot 样例数据\n// const mock = {\n// type: 'slot',\n// id: 'reactor_parent',\n// blocks: [\n// {\n// id: 'port_LnSdK',\n// blocks: [{ type: 'Slot', id: 'reactor_child' }],\n// },\n// {\n// id: 'port_60X7U',\n// },\n// {\n// id: 'port_JWhcm',\n// },\n// {\n// id: 'port_scHWa',\n// },\n// ],\n// };\n\n/**\n * 创建 Slot 子节点\n * - Slot\n * - SlotBlockIcon\n * - SlotInlineBlocks\n * - SlotBlock 1\n * - SlotBlockIcon 1\n * - ChildSlot 1\n * - ChildSlot 2\n * - SlotBlock 2\n *\n * 范例数据:\n * {\n * type: 'Slot',\n * id: 'reactor_parent',\n * blocks: [\n * {\n * id: 'port_LnSdK',\n * blocks: [{ type: 'Slot', id: 'reactor_child' }],\n * },\n * {\n * id: 'port_60X7U',\n * }\n * ],\n * }\n *\n */\nexport const createSlotFromJSON = (node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeEntity[] => {\n const { document } = node;\n\n const addedNodes: FlowNodeEntity[] = [];\n\n // 块列表开始节点,用来展示块的按钮\n const blockIconNode = document.addNode({\n id: `$slotIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const inlineBlocksNode = document.addNode({\n id: `$slotInlineBlocks$${node.id}`,\n type: SlotNodeType.SlotInlineBlocks,\n originParent: node,\n parent: node,\n });\n addedNodes.push(blockIconNode);\n addedNodes.push(inlineBlocksNode);\n\n const portJSONList = json.blocks || [];\n\n portJSONList.forEach((_portJSON) => {\n const port = document.addNode({\n type: SlotNodeType.SlotBlock,\n ..._portJSON,\n originParent: node,\n parent: inlineBlocksNode,\n });\n addedNodes.push(port);\n\n (_portJSON.blocks || []).forEach((_portChild) => {\n document.addNode(\n {\n type: SlotNodeType.Slot,\n ..._portChild,\n parent: port,\n },\n addedNodes\n );\n });\n });\n\n return addedNodes;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType } from '@flowgram.ai/document';\n\nimport { drawCollapseLabel, drawCollapseLine } from '../utils/transition';\nimport { canSlotDrilldown, insideSlot } from '../utils/node';\n\nexport const SlotIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n defaultExpanded: false,\n spacing: 0,\n },\n getLines: (transition) => [\n ...(canSlotDrilldown(transition.entity.parent!) ? drawCollapseLine(transition) : []),\n ],\n getLabels: (transition) => [\n ...(canSlotDrilldown(transition.entity.parent!) ? drawCollapseLabel(transition) : []),\n ],\n getDelta: (transform) => {\n // Slot 节点内部时,重新纠正重心调整产生的偏移\n if (insideSlot(transform.entity.parent)) {\n return transform.entity.isVertical\n ? { x: -transform.originDeltaX, y: 0 }\n : { x: 0, y: -transform.originDeltaY };\n }\n return { x: 0, y: 0 };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType, getDefaultSpacing } from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\nimport {\n SlotSpacingKey,\n SLOT_START_DISTANCE,\n SLOT_PORT_DISTANCE,\n SLOT_BLOCK_PORT_DISTANCE,\n} from '../constants';\n\nexport const SlotInlineBlocksRegistry: FlowNodeRegistry = {\n type: SlotNodeType.SlotInlineBlocks,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n spacing: 0,\n inlineSpacingPre: 0,\n inlineSpacingAfter: 0,\n isInlineBlocks: (node) => !node.isVertical,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n getChildDelta(child, layout) {\n if (child.entity.isVertical) {\n return { x: 0, y: 0 };\n }\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n\n return {\n x: 0,\n y: preBounds.bottom + 30,\n };\n }\n\n return { x: 0, y: 0 };\n },\n /**\n * 控制条件分支居右布局\n */\n getDelta(transform) {\n if (!transform.children.length) {\n return { x: 0, y: 0 };\n }\n\n const icon = transform.pre;\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n const startDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n const portDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_PORT_DISTANCE,\n SLOT_PORT_DISTANCE\n );\n\n const portBlockDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_BLOCK_PORT_DISTANCE,\n SLOT_BLOCK_PORT_DISTANCE\n );\n\n if (!transform.entity.isVertical) {\n const noChildren = transform?.children?.every?.((_port) => !_port.children.length);\n /**\n * 如果没有 children 的时候,不需要有右侧的间距,避免水平布局的时候 Slot 右侧空间过大。\n */\n if (noChildren) {\n return {\n x: portDistance - icon.localBounds.width / 2,\n y: icon.localBounds.bottom + startDistance,\n };\n }\n return {\n x: portDistance + portBlockDistance - icon.localBounds.width / 2,\n y: icon.localBounds.bottom + startDistance,\n };\n }\n\n const slotInlineBlockDelta = startDistance + portDistance + portBlockDistance;\n return {\n x: icon.localBounds.right + slotInlineBlockDelta,\n y: -icon.localBounds.height,\n };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mean } from 'lodash-es';\nimport {\n FlowNodeRegistry,\n FlowNodeBaseType,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n getDefaultSpacing,\n Vertex,\n} from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { getPortChildInput, getSlotChildLineStartPoint } from '../utils/transition';\nimport { SlotNodeType } from '../typings';\nimport {\n RENDER_SLOT_ADDER_KEY,\n SlotSpacingKey,\n SLOT_PORT_DISTANCE,\n SLOT_RADIUS,\n SLOT_LABEL_DISTANCE,\n RENDER_SLOT_LABEL_KEY,\n SLOT_BLOCK_VERTICAL_SPACING,\n} from '../constants';\n\nexport const SlotBlockRegistry: FlowNodeRegistry = {\n type: SlotNodeType.SlotBlock,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n inlineSpacingAfter: 0,\n inlineSpacingPre: 0,\n spacing: (transform) => {\n // 水平布局没有子节点情况\n if (!transform.entity.isVertical && transform.size.width === 0) {\n return 90;\n }\n return getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_BLOCK_VERTICAL_SPACING,\n SLOT_BLOCK_VERTICAL_SPACING\n );\n },\n isInlineBlocks: (node) => !node.isVertical,\n },\n getLines(transition) {\n const icon = transition.transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n const portPoint = transition.transform.inputPoint;\n\n const radius = getDefaultSpacing(\n transition.transform.entity,\n SlotSpacingKey.SLOT_RADIUS,\n SLOT_RADIUS\n );\n\n let startPortVertices: Vertex[] = [{ x: start.x, y: portPoint.y }];\n\n /**\n * When Radius is not enough, we should use truncate strategy\n * 弧度不够时,采取截断策略\n */\n if (transition.entity.isVertical) {\n const deltaY = Math.abs(portPoint.y - start.y);\n let deltaX = radius;\n let isTruncated = false;\n\n if (deltaY < radius * 2) {\n isTruncated = true;\n if (deltaY < radius) {\n // Calculate the x by circle equation\n deltaX = Math.sqrt(radius ** 2 - (radius - deltaY) ** 2);\n }\n }\n\n startPortVertices = [\n {\n x: start.x + deltaX,\n y: start.y,\n radiusX: radius,\n radiusY: radius,\n radiusOverflow: 'truncate',\n },\n {\n x: start.x + deltaX,\n y: portPoint.y,\n ...(isTruncated ? { radiusX: 0, radiusY: 0 } : {}),\n },\n ];\n }\n\n /**\n * When One Children, we should keep dash array align, so we draw one line directly to child nodes\n * 只有一个子节点时,我们通常需要保证两条虚线是连贯的,因此我们直接合并,绘制一条线连到子节点\n */\n if (transition.transform.children.length === 1) {\n return [\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: start,\n to: getPortChildInput(transition.transform.children[0]),\n vertices: startPortVertices,\n style: {\n strokeDasharray: '5 5',\n },\n radius,\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: start,\n to: portPoint,\n vertices: startPortVertices,\n style: {\n strokeDasharray: '5 5',\n },\n radius,\n },\n ...transition.transform.children.map((_child) => {\n const childInput = getPortChildInput(_child);\n\n return {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n radius,\n from: portPoint,\n to: childInput,\n vertices: [{ x: portPoint.x, y: childInput.y }],\n style: {\n strokeDasharray: '5 5',\n },\n };\n }),\n ];\n },\n getLabels(transition) {\n const icon = transition.transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n const portPoint = transition.transform.inputPoint;\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_ADDER_KEY,\n props: {\n node: transition.entity,\n },\n offset: portPoint,\n },\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_LABEL_KEY,\n props: {\n node: transition.entity,\n },\n offset: {\n x:\n start.x +\n getDefaultSpacing(\n transition.entity,\n SlotSpacingKey.SLOT_LABEL_DISTANCE,\n SLOT_LABEL_DISTANCE\n ),\n y: portPoint.y,\n },\n origin: [0, 0.5],\n },\n ];\n },\n getInputPoint(transform) {\n const icon = transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n\n let inputY = transform.bounds.center.y;\n if (transform.children.length) {\n inputY = mean([\n getPortChildInput(transform.firstChild).y,\n getPortChildInput(transform.lastChild).y,\n ]);\n }\n\n return {\n x:\n start.x +\n getDefaultSpacing(transform.entity, SlotSpacingKey.SLOT_PORT_DISTANCE, SLOT_PORT_DISTANCE),\n y: inputY,\n };\n },\n getChildDelta(child, layout) {\n const hasChild = !!child.firstChild;\n\n if (child.entity.isVertical) {\n // 绑定普通节点时进行重心纠偏\n let deltaX = hasChild ? 0 : -child.originDeltaX;\n\n return { x: deltaX, y: 0 };\n }\n\n let deltaY = hasChild ? 0 : -child.originDeltaY;\n\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n\n return {\n x: 0,\n y: preBounds.bottom + 30 + deltaY,\n };\n }\n\n return { x: 0, y: deltaY };\n },\n getChildLabels() {\n return [];\n },\n getChildLines() {\n return [];\n },\n getDelta(transform) {\n return {\n x: 0,\n y: 0,\n };\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,oBAAgC;AAChC,IAAAC,mBAAyC;AACzC,IAAAC,oBAAyC;AACzC,IAAAC,eAAuC;AACvC,IAAAC,gBAAkC;;;ACJlC,uBAA2B;AAC3B,IAAAC,mBAOO;AACP,IAAAC,oBAMO;AACP,kBAA6D;;;AChB7D,sBAAwD;AAKjD,IAAM,cAAgC;AAAA,EAC3C,MAAM,iCAAiB;AAAA,EACvB,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,aAAa;AAAA,EACf;AAAA;AAAA,EAEA,WAAW;AACT,WAAO,CAAC;AAAA,EACV;AAAA,EACA,YAAY;AACV,WAAO,CAAC;AAAA,EACV;AACF;;;ACpBA,IAAAC,mBAOO;AAYA,IAAM,uBAAyC;AAAA,EACpD,MAAM,mCAAkB;AAAA,EACxB,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,oBAAoB,CAAC,SACnB,KAAK,aAAa,KAAK,OAAO,kBAAkB,SAAS,IAAI,KAAK;AAAA;AAAA,IAEpE,SAAS,CAAC,SAAS;AACjB,YAAM,cAAU,oCAAkB,KAAK,QAAQ,8BAA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A,UAAgB;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA,EAKjB,YAAkB;AAAA,EAAC;AACrB;AArEa,gBAAN;AAAA,MADN,6BAAW;AAAA,GACC;;;ADlCN,IAAM,6BAA6B,IAAI,kCAAgB,UAAQ;AACpE,uCAAkB,MAAM,eAAe;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,CAAC;;;ADKM,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["import_inversify","import_renderer","import_document","import_core","import_utils","import_renderer","import_document","import_document","import_document","import_document","import_document","preCenter","currentCenter","import_utils","import_document","import_utils","import_document","import_document","import_document","import_document","import_renderer","import_document","import_renderer","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_document","import_document","import_document","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_utils","import_document","import_renderer","import_document","SlotNodeType","import_document","import_document","import_document","import_lodash_es","import_document"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/fixed-layout-container-module.ts","../src/flow-registers.ts","../src/activities/end.ts","../src/activities/dynamic-split.ts","../src/activities/static-split.ts","../src/activities/block.ts","../src/activities/inline-blocks.ts","../src/activities/block-icon.ts","../src/activities/block-order-icon.ts","../src/activities/start.ts","../src/activities/try-catch.ts","../src/activities/try-catch-extends/catch-block.ts","../src/activities/try-catch-extends/catch-inline-blocks.ts","../src/activities/try-catch-extends/main-inline-blocks.ts","../src/activities/try-catch-extends/try-block.ts","../src/activities/try-catch-extends/try-slot.ts","../src/activities/loop.ts","../src/activities/loop-extends/constants.ts","../src/activities/loop-extends/loop-left-empty-block.ts","../src/activities/loop-extends/loop-right-empty-block.ts","../src/activities/loop-extends/loop-empty-branch.ts","../src/activities/loop-extends/loop-inline-blocks.ts","../src/activities/root.ts","../src/activities/empty.ts","../src/activities/simple-split.ts","../src/activities/break.ts","../src/activities/input.ts","../src/activities/output.ts","../src/activities/multi-outputs.ts","../src/activities/multi-inputs.ts","../src/activities/slot/slot.ts","../src/activities/slot/utils/transition.ts","../src/activities/slot/constants.ts","../src/activities/slot/typings.ts","../src/activities/slot/utils/node.ts","../src/activities/slot/utils/layout.ts","../src/activities/slot/utils/create.ts","../src/activities/slot/extends/slot-icon.ts","../src/activities/slot/extends/slot-inline-blocks.ts","../src/activities/slot/extends/slot-block.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './fixed-layout-container-module';\nimport { SlotIconRegistry, SlotInlineBlocksRegistry } from './activities/slot/extends';\nimport {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n LoopRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n StartRegistry,\n RootRegistry,\n InlineBlocksRegistry,\n EndRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n} from './activities';\n\nexport const FixedLayoutRegistries = {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n LoopRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n StartRegistry,\n RootRegistry,\n InlineBlocksRegistry,\n EndRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n SlotIconRegistry,\n SlotInlineBlocksRegistry,\n};\n\n// Export constant\nexport { SlotSpacingKey } from './activities/slot/constants';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ContainerModule } from 'inversify';\nimport { FlowRendererContribution } from '@flowgram.ai/renderer';\nimport { FlowDocumentContribution } from '@flowgram.ai/document';\nimport { PlaygroundContribution } from '@flowgram.ai/core';\nimport { bindContributions } from '@flowgram.ai/utils';\n\nimport { FlowRegisters } from './flow-registers';\n\nexport const FixedLayoutContainerModule = new ContainerModule(bind => {\n bindContributions(bind, FlowRegisters, [\n FlowDocumentContribution,\n FlowRendererContribution,\n PlaygroundContribution,\n ]);\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport {\n FlowLabelsLayer,\n FlowLinesLayer,\n FlowNodesContentLayer,\n FlowNodesTransformLayer,\n type FlowRendererContribution,\n type FlowRendererRegistry,\n} from '@flowgram.ai/renderer';\nimport {\n type FlowDocument,\n type FlowDocumentContribution,\n FlowNodeRenderData,\n FlowNodeTransformData,\n FlowNodeTransitionData,\n} from '@flowgram.ai/document';\nimport { type PlaygroundContribution, PlaygroundLayer } from '@flowgram.ai/core';\n\nimport { EndRegistry } from './activities/end';\nimport {\n BlockIconRegistry,\n BlockOrderIconRegistry,\n BlockRegistry,\n DynamicSplitRegistry,\n EmptyRegistry,\n InlineBlocksRegistry,\n LoopRegistry,\n RootRegistry,\n StartRegistry,\n StaticSplitRegistry,\n TryCatchRegistry,\n SimpleSplitRegistry,\n BreakRegistry,\n MultiOuputsRegistry,\n MultiInputsRegistry,\n InputRegistry,\n OuputRegistry,\n SlotRegistry,\n SlotBlockRegistry,\n} from './activities';\n\n@injectable()\nexport class FlowRegisters\n implements FlowDocumentContribution, FlowRendererContribution, PlaygroundContribution\n{\n /**\n * 注册数据层\n * @param document\n */\n registerDocument(document: FlowDocument) {\n /**\n * 注册节点 (ECS - Entity)\n */\n document.registerFlowNodes(\n RootRegistry, // 根节点\n StartRegistry, // 开始节点\n DynamicSplitRegistry, // 动态分支(并行、排他)\n StaticSplitRegistry, // 静态分支(审批)\n SimpleSplitRegistry, // 简单分支 (不带 orderIcon 节点)\n BlockRegistry, // 单条 block 注册\n InlineBlocksRegistry, // 多个 block 组成的 block 列表\n BlockIconRegistry, // icon 节点,如条件分支的菱形图标\n BlockOrderIconRegistry, // 带顺序的图标节点,一般为 block 第一个分支节点\n TryCatchRegistry, // TryCatch\n EndRegistry, // 结束节点\n LoopRegistry, // 循环节点\n EmptyRegistry, // 占位节点\n BreakRegistry, // 分支断开\n MultiOuputsRegistry,\n MultiInputsRegistry,\n InputRegistry,\n OuputRegistry,\n SlotRegistry,\n SlotBlockRegistry\n );\n /**\n * 注册节点数据 (ECS - Component)\n */\n document.registerNodeDatas(\n FlowNodeRenderData, // 渲染节点相关数据\n FlowNodeTransitionData, // 线条绘制数据\n FlowNodeTransformData // 坐标计算数据\n );\n }\n\n /**\n * 注册渲染层\n * @param renderer\n */\n registerRenderer(renderer: FlowRendererRegistry) {\n /**\n * 注册 layer (ECS - System)\n */\n renderer.registerLayers(\n FlowNodesTransformLayer, // 节点位置渲染\n FlowNodesContentLayer, // 节点内容渲染\n FlowLinesLayer, // 线条渲染\n FlowLabelsLayer, // Label 渲染\n PlaygroundLayer // 画布基础层,提供缩放、手势等能力\n );\n }\n\n /**\n * 画布开始渲染 (hook)\n */\n onReady(): void {}\n\n /**\n * 画布销毁 (hook)\n */\n onDispose(): void {}\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 结束节点\n */\nexport const EndRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.END,\n meta: {\n draggable: false,\n isNodeEnd: true,\n selectable: false,\n copyDisable: true,\n },\n // 结束节点没有出边和 label\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowTransitionLabelEnum,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 可以动态添加分支的分支节点\n * dynamicSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * block1\n * blockOrderIcon\n * block2\n * blockOrderIcon\n */\nexport const DynamicSplitRegistry: FlowNodeRegistry = {\n type: FlowNodeSplitType.DYNAMIC_SPLIT,\n meta: {\n hidden: true,\n inlineSpacingAfter: (node) =>\n node.collapsed && node.entity.collapsedChildren.length > 1 ? 21 : 0,\n // 判断是否有分支节点\n spacing: (node) => {\n const spacing = getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING);\n return node.children.length === 1 ? spacing : spacing / 2;\n },\n },\n getLabels(transition) {\n if (transition.isNodeEnd) {\n return [];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: transition.transform.outputPoint,\n },\n ];\n },\n onCreate(node, json) {\n return node.document.addInlineBlocks(node, json.blocks || []);\n },\n getInputPoint(transform) {\n // block icon\n return transform.firstChild?.inputPoint || transform.defaultInputPoint;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 没有分支节点\n const noInlineBlocks = transform.children.length === 1;\n const lastChildOutput = transform.lastChild?.outputPoint;\n const spacing = getDefaultSpacing(transform.entity, ConstantKeys.NODE_SPACING);\n\n if (isVertical) {\n return {\n x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,\n y: transform.bounds.bottom + (noInlineBlocks ? spacing / 2 : 0),\n };\n }\n\n return {\n x: transform.bounds.right + (noInlineBlocks ? spacing / 2 : 0),\n y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y,\n };\n },\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n const parentId = `$inlineBlocks$${node.id}`;\n let parent = document.getNode(parentId);\n if (!parent) {\n parent = document.addNode({\n id: parentId,\n type: 'inlineBlocks',\n originParent: node,\n parent: node,\n });\n }\n return document.addBlock(node, json, undefined, undefined, index);\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry, FlowNodeSplitType } from '@flowgram.ai/document';\n\n/**\n * 不能动态添加分支的分支节点\n * staticSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * block1\n * blockOrderIcon\n * block2\n * blockOrderIcon\n */\nexport const StaticSplitRegistry: FlowNodeRegistry = {\n extend: FlowNodeSplitType.DYNAMIC_SPLIT,\n type: FlowNodeSplitType.STATIC_SPLIT,\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n getLabels() {\n return [];\n },\n },\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n DEFAULT_SPACING,\n FlowLayoutDefault,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n LABEL_SIDE_TYPE,\n} from '@flowgram.ai/document';\n\n/**\n * block, block 的输入输出点由子节点决定\n */\nexport const BlockRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n inlineSpacingAfter: DEFAULT_SPACING.INLINE_BLOCK_PADDING_BOTTOM,\n hidden: true,\n },\n getLines(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n const lines: FlowTransitionLine[] = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: currentTransform.parent!.inputPoint,\n to: currentTransform.inputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n ];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 分支拖拽场景线条 push\n // 当有其余分支的时候,绘制一条两个分支之间的线条\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.inputPoint.y;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.DRAGGING_LINE,\n from: currentTransform.parent!.inputPoint,\n to: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.inputPoint.x;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.DRAGGING_LINE,\n from: currentTransform.parent!.inputPoint,\n to: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n }\n }\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: currentTransform.outputPoint,\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n\n return lines;\n },\n getInputPoint(trans) {\n const child = trans.firstChild;\n return child ? child.inputPoint : trans.defaultInputPoint;\n },\n getOutputPoint(trans, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const child = trans.lastChild;\n if (isVertical) {\n return {\n x: child ? child.outputPoint.x : trans.bounds.bottomCenter.x,\n y: trans.bounds.bottom,\n };\n }\n return {\n x: trans.bounds.right,\n y: child ? child.outputPoint.y : trans.bounds.rightCenter.y,\n };\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const draggingLabel = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 获取两个分支节点中间点作为拖拽标签插入位置\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.inputPoint.y;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetLeftX - currentOffsetRightX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.inputPoint.x;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetTopX - currentOffsetBottomX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n }\n }\n\n return [...draggingLabel];\n },\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n return document.addNode({\n ...json,\n ...options,\n parent: node,\n index: typeof index === 'number' ? index + 1 : undefined,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowNodeTransformData,\n type FlowNodeTransitionData,\n FlowTransitionLabelEnum,\n FlowLayoutDefault,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 水平 Block 的偏移\n */\nexport const InlineBlocksRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n hidden: true,\n spacing: (node) => getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING),\n isInlineBlocks: true,\n inlineSpacingPre: (transform) => {\n if (transform.entity.blocks.length === 0) {\n return 0;\n }\n return (\n getDefaultSpacing(transform.entity, ConstantKeys.INLINE_BLOCKS_PADDING_TOP) ||\n DEFAULT_SPACING.INLINE_BLOCKS_PADDING_TOP\n );\n },\n inlineSpacingAfter: (transform) => {\n if (transform.entity.blocks.length === 0) {\n return 0;\n }\n return getDefaultSpacing(transform.entity, ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM);\n },\n },\n /**\n * 控制子分支的间距\n * @param child\n */\n getChildDelta(child, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n if (isVertical) {\n const leftSpacing = preTransform.size.width + preTransform.originDeltaX;\n\n // 如果小于最小宽度,偏移最小宽度的距离\n const delta = Math.max(\n child.parent!.minInlineBlockSpacing - leftSpacing,\n getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING) - child.originDeltaX\n );\n\n return {\n // 这里需要加上原点的偏移量,并加上水平间距\n x: preBounds.right + delta,\n y: 0,\n };\n } else {\n const bottomSpacing = preTransform.size.height + preTransform.originDeltaY;\n\n // 如果小于最小高度,偏移最小高度的距离\n const delta = Math.max(\n child.parent!.minInlineBlockSpacing - bottomSpacing,\n getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING) - child.originDeltaY\n );\n\n return {\n x: 0,\n // 这里需要加上原点的偏移量,并加上垂直间距\n y: preBounds.bottom + delta,\n };\n }\n }\n return {\n x: 0,\n y: 0,\n };\n },\n /**\n * 控制条件分支居中布局\n * @param trans\n */\n getDelta(trans, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const { pre, collapsed } = trans;\n\n if (collapsed) {\n return { x: 0, y: 0 };\n }\n\n if (isVertical) {\n const preCenter = pre!.localBounds.center.x;\n const firstBlockX = trans.firstChild?.transform.position.x || 0;\n const lastBlockX = trans.lastChild?.transform.position.x || 0;\n const currentCenter = (lastBlockX - firstBlockX) / 2;\n\n return {\n x: preCenter - currentCenter,\n y: 0,\n };\n }\n const preCenter = pre!.localBounds.center.y;\n const firstBlockY = trans.firstChild?.transform.position.y || 0;\n const lastBlockY = trans.lastChild?.transform.position.y || 0;\n const currentCenter = (lastBlockY - firstBlockY) / 2;\n\n return {\n x: 0,\n y: preCenter - currentCenter,\n };\n },\n getLabels(transition) {\n return getBranchAdderLabel(transition);\n },\n getLines() {\n return [];\n },\n // 和前序节点对齐\n getInputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || 0,\n y: transform.bounds.top,\n };\n }\n return {\n x: transform.bounds.left,\n y: transform.pre?.outputPoint.y || 0,\n };\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 收缩时,出点为入点\n if (transform.collapsed) {\n return transform.inputPoint;\n }\n\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || 0,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: transform.pre?.outputPoint.y || 0,\n };\n },\n};\n\n/**\n * inlineBlocks 获取 BranchAdder 和展开 label\n */\nexport function getBranchAdderLabel(transition: FlowNodeTransitionData) {\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n\n // 收起时展示收起 label\n if (currentTransform.collapsed) {\n return [\n {\n type: FlowTransitionLabelEnum.COLLAPSE_LABEL,\n offset: Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),\n props: {\n activateNode: transition.entity.pre,\n },\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(currentTransform.inputPoint, isVertical ? { y: 10 } : { x: 10 }),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { DefaultSpacingKey, getDefaultSpacing } from '@flowgram.ai/document';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 图标占位节点,如条件分支的菱形图标\n */\nexport const BlockIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: 20, // 占位节点下边偏小\n // 条件分支 icon 默认的高度比较高,在流程里下边有文字\n size: { width: 250, height: 84 },\n },\n /**\n * 是一个占位节点,后续要加上 label 展开收起的图标\n */\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n // 为节点,画一个加号即可\n if (transition.entity.parent!.collapsedChildren.length <= 1) {\n return [];\n }\n\n const collapsedSpacing = getDefaultSpacing(\n transition.entity,\n DefaultSpacingKey.COLLAPSED_SPACING\n );\n\n return [\n {\n type: FlowTransitionLabelEnum.COLLAPSE_LABEL,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }\n ),\n props: {\n collapseNode: transition.entity.parent,\n activateNode: transition.entity,\n },\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Point } from '@flowgram.ai/utils';\nimport { DefaultSpacingKey, getDefaultSpacing } from '@flowgram.ai/document';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 带顺序的图标节点,一般为 block 第一个分支节点\n * - 只有一个分支时,不需要展开收起\n */\nexport const BlockOrderIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ORDER_ICON,\n meta: {\n spacing: 40,\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const currentOutput = currentTransform.outputPoint;\n const nextTransform = currentTransform.next;\n const parentTransform = currentTransform.parent;\n\n // 为空分支,画一个加号即可\n if (transition.entity.parent!.collapsedChildren.length <= 1) {\n const parentOutput = parentTransform?.outputPoint as IPoint;\n return [\n {\n offset: parentOutput,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n }\n\n const collapsedSpacing = getDefaultSpacing(\n transition.entity,\n DefaultSpacingKey.COLLAPSED_SPACING\n );\n\n return [\n {\n offset: nextTransform\n ? Point.getMiddlePoint(currentOutput, nextTransform.inputPoint)\n : Point.move(\n currentOutput,\n isVertical ? { y: collapsedSpacing } : { x: collapsedSpacing }\n ),\n // 收起展开复合按钮\n type: FlowTransitionLabelEnum.COLLAPSE_ADDER_LABEL,\n props: {\n activateNode: transition.entity,\n collapseNode: transition.entity.parent,\n },\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 开始节点\n */\nexport const StartRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.START,\n meta: {\n isStart: true,\n draggable: false,\n selectable: false, // 触发器等开始节点不能被框选\n deleteDisable: true, // 禁止删除\n copyDisable: true, // 禁止copy\n addDisable: true, // 禁止添加\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n FlowNodeBaseType,\n type FlowNodeEntity,\n type FlowNodeJSON,\n type FlowNodeRegistry,\n} from '@flowgram.ai/document';\n\nimport {\n CatchBlockRegistry,\n CatchInlineBlocksRegistry,\n MainInlineBlocksRegistry,\n TryBlockRegistry,\n TryCatchSpacings,\n TryCatchTypeEnum,\n TrySlotRegistry,\n} from './try-catch-extends';\n\n/**\n * try catch 节点\n */\nexport const TryCatchRegistry: FlowNodeRegistry = {\n type: 'tryCatch',\n meta: {\n hidden: true,\n inlineSpacingAfter: TryCatchSpacings.INLINE_SPACING_BOTTOM,\n },\n /**\n * 结构\n * tryCatch\n * - tryCatchIcon\n * - mainInlineBlocks\n * - tryBlock // try 分支\n * - trySlot // 空节点用来占位,try 分支一开始没有节点\n * - catchInlineBlocks\n * - catchBlock // catch 分支 1\n * - blockOrderIcon\n * - node1\n * - catchBlock // catch 分支 2\n * - blockOrderIcon\n * - node 2\n * @param node\n * @param json\n */\n onCreate(node: FlowNodeEntity, json: FlowNodeJSON) {\n const { document } = node;\n const [tryBlock, ...catchBlocks] = json.blocks || [];\n const addedNodes: FlowNodeEntity[] = [];\n const tryCatchIconNode = document.addNode({\n id: `$tryCatchIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const mainBlockNode = document.addNode({\n id: `$mainInlineBlocks$${node.id}`,\n type: TryCatchTypeEnum.MAIN_INLINE_BLOCKS,\n originParent: node,\n parent: node,\n });\n const tryBlockNode = document.addNode({\n id: tryBlock.id,\n type: tryBlock.type || TryCatchTypeEnum.TRY_BLOCK,\n originParent: node,\n parent: mainBlockNode,\n data: tryBlock.data,\n });\n const trySlotNode = document.addNode({\n id: `$trySlot$${tryBlock.id}`,\n hidden: true,\n type: TryCatchTypeEnum.TRY_SLOT, // 占位节点\n originParent: node,\n parent: tryBlockNode,\n });\n const catchInlineBlocksNode = document.addNode({\n id: `$catchInlineBlocks$${node.id}`,\n type: TryCatchTypeEnum.CATCH_INLINE_BLOCKS,\n originParent: node,\n parent: mainBlockNode,\n });\n addedNodes.push(\n tryCatchIconNode,\n mainBlockNode,\n tryBlockNode,\n trySlotNode,\n catchInlineBlocksNode\n );\n (tryBlock.blocks || []).forEach((blockData) => {\n document.addNode(\n {\n ...blockData,\n parent: tryBlockNode,\n },\n addedNodes\n );\n });\n catchBlocks.forEach((blockData) => {\n document.addBlock(node, blockData, addedNodes);\n });\n return addedNodes;\n },\n /**\n * 添加 catch 分支\n * @param node\n * @param blockData\n * @param addedNodes\n */\n onBlockChildCreate(node, blockData, addedNodes) {\n const parent = node.document.getNode(`$catchInlineBlocks$${node.id}`);\n const block = node.document.addNode({\n id: blockData.id,\n type: blockData.type || TryCatchTypeEnum.CATCH_BLOCK,\n originParent: node,\n parent,\n data: blockData.data,\n });\n // 分支开始节点\n const blockOrderIcon = node.document.addNode({\n id: `$blockOrderIcon$${blockData.id}`,\n type: FlowNodeBaseType.BLOCK_ORDER_ICON,\n originParent: node,\n parent: block,\n });\n if (blockData.blocks) {\n node.document.addBlocksAsChildren(block, blockData.blocks || [], addedNodes);\n }\n addedNodes?.push(block, blockOrderIcon);\n return block;\n },\n getInputPoint(transform) {\n const tryCatchIcon = transform.firstChild!;\n // 使用图标的 inputPoint\n return tryCatchIcon.inputPoint;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const tryCatchIcon = transform.firstChild!;\n if (isVertical) {\n return {\n x: tryCatchIcon.inputPoint.x,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: tryCatchIcon.inputPoint.y,\n };\n },\n /**\n * tryCatch 子节点配置\n */\n extendChildRegistries: [\n /**\n * icon 节点\n */\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: TryCatchSpacings.INLINE_SPACING_TOP,\n },\n getLabels() {\n return [];\n },\n },\n MainInlineBlocksRegistry,\n CatchInlineBlocksRegistry,\n TryBlockRegistry,\n CatchBlockRegistry,\n TrySlotRegistry,\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLineEnum,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * catch 分支\n */\nexport const CatchBlockRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.BLOCK,\n type: TryCatchTypeEnum.CATCH_BLOCK,\n meta: {\n hidden: true,\n spacing: DEFAULT_SPACING.NULL,\n },\n getLines(transition) {\n const { transform } = transition;\n const { isVertical } = transition.entity;\n const parentPoint = transform.parent!;\n const { inputPoint, outputPoint } = transform;\n let parentInputPoint;\n if (isVertical) {\n parentInputPoint = {\n x: parentPoint.inputPoint.x,\n y: parentPoint.inputPoint.y - TryCatchSpacings.CATCH_INLINE_SPACING,\n };\n } else {\n parentInputPoint = {\n x: parentPoint.inputPoint.x - TryCatchSpacings.CATCH_INLINE_SPACING,\n y: parentPoint.inputPoint.y,\n };\n }\n\n const lines = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: parentInputPoint,\n to: inputPoint,\n },\n ];\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n let mergePoint;\n if (isVertical) {\n mergePoint = {\n x: parentPoint.outputPoint.x,\n y: parentPoint.bounds.bottom,\n };\n } else {\n mergePoint = {\n x: parentPoint.bounds.right,\n y: parentPoint.outputPoint.y,\n };\n }\n\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: outputPoint,\n to: mergePoint,\n });\n }\n\n return lines;\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n DEFAULT_SPACING,\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n FlowLayoutDefault,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * catch 分支列表\n */\nexport const CatchInlineBlocksRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.INLINE_BLOCKS,\n type: TryCatchTypeEnum.CATCH_INLINE_BLOCKS,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n inlineSpacingPre: DEFAULT_SPACING.NULL,\n // inlineSpacingAfter: DEFAULT_SPACING.NULL,\n },\n getDelta() {\n return undefined;\n },\n getLines(transition) {\n const { transform } = transition;\n const mainInlineBlocks = transform.parent!;\n\n const lines = [\n {\n type: FlowTransitionLineEnum.DIVERGE_LINE,\n from: mainInlineBlocks.pre!.outputPoint,\n to: transform.inputPoint,\n },\n ];\n\n if (!transform.entity.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: transform.outputPoint,\n to: mainInlineBlocks.outputPoint,\n });\n }\n\n return lines;\n },\n getOriginDeltaX(transform) {\n const { firstChild } = transform;\n if (!firstChild) return 0;\n return firstChild.originDeltaX;\n },\n getLabels(transition) {\n const { inputPoint } = transition.transform;\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n\n // 实际输入点\n const actualInputPoint = {\n x: isVertical ? inputPoint.x : inputPoint.x - TryCatchSpacings.CATCH_INLINE_SPACING,\n y: isVertical ? inputPoint.y - TryCatchSpacings.CATCH_INLINE_SPACING : inputPoint.y,\n };\n\n if (currentTransform.collapsed) {\n return [];\n }\n\n // branch adder 节点\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: actualInputPoint,\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n },\n getInputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n // 因为是左偏移,所以用第一条 catch 分支\n const firstCatchBlock = transform.firstChild;\n if (firstCatchBlock) {\n return firstCatchBlock.inputPoint;\n }\n return isVertical ? transform.bounds.topCenter : transform.bounds.rightCenter;\n },\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n\n // 收缩时,出点为入点\n if (transform.collapsed) {\n return transform.inputPoint;\n }\n\n const firstCatchBlock = transform.firstChild;\n if (firstCatchBlock) {\n return isVertical\n ? {\n x: firstCatchBlock!.outputPoint?.x,\n y: transform.bounds.bottom,\n }\n : {\n x: transform.bounds.right,\n y: firstCatchBlock!.outputPoint?.y,\n };\n }\n return isVertical ? transform.bounds.bottomCenter : transform.bounds.rightCenter;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey, FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeTransformData,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n FlowLayoutDefault,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport { TryCatchSpacings, TryCatchTypeEnum } from './constants';\n\n/**\n * 主 BLOCK\n */\nexport const MainInlineBlocksRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.INLINE_BLOCKS,\n type: TryCatchTypeEnum.MAIN_INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: TryCatchSpacings.MAIN_INLINE_SPACING_TOP,\n inlineSpacingAfter: TryCatchSpacings.MAIN_INLINE_SPACING_BOTTOM,\n },\n getLines(transition) {\n const { transform } = transition;\n const tryBranch = transform.firstChild!;\n\n const lines = [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: tryBranch.outputPoint,\n to: transform.originParent!.outputPoint,\n },\n ];\n\n return lines;\n },\n getLabels(transition) {\n const { transform } = transition;\n const { isVertical } = transition.entity;\n const catchInlineBlocks = transform.children[1]!;\n const errLabelX = isVertical\n ? (transform.parent!.outputPoint.x + catchInlineBlocks.inputPoint.x) / 2\n : transform.inputPoint.x - TryCatchSpacings.INLINE_SPACING_TOP;\n const errLabelY = isVertical\n ? transform.inputPoint.y - TryCatchSpacings.INLINE_SPACING_TOP\n : (transform.parent!.outputPoint.y + catchInlineBlocks.inputPoint.y) / 2;\n\n const errorLabelX = errLabelX;\n const errorLabelY = errLabelY;\n return [\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.TRY_START_TEXT,\n offset: {\n x: isVertical\n ? transform.inputPoint.x\n : transform.inputPoint.x + TryCatchSpacings.TRY_START_LABEL_DELTA,\n y: isVertical\n ? transform.inputPoint.y + TryCatchSpacings.TRY_START_LABEL_DELTA\n : transform.inputPoint.y,\n },\n },\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.TRY_END_TEXT,\n offset: {\n x: isVertical\n ? transform.inputPoint.x\n : transform.originParent!.outputPoint.x + TryCatchSpacings.TRY_END_LABEL_DELTA,\n y: isVertical\n ? transform.originParent!.outputPoint.y + TryCatchSpacings.TRY_END_LABEL_DELTA\n : transform.inputPoint.y,\n },\n },\n // 错误分支收起\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.TRY_CATCH_COLLAPSE,\n offset: {\n x: errorLabelX,\n y: errorLabelY,\n },\n props: {\n node: transform.lastChild?.entity,\n },\n },\n ];\n },\n getInputPoint(transform) {\n const tryBlock = transform.firstChild!;\n return tryBlock.inputPoint;\n },\n getOutputPoint(transform, layout) {\n const tryBlock = transform.firstChild!;\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (isVertical) {\n return {\n x: tryBlock.outputPoint.x,\n y: transform.bounds.bottom + TryCatchSpacings.CATCH_INLINE_SPACING,\n };\n }\n return {\n x: transform.bounds.right + TryCatchSpacings.CATCH_INLINE_SPACING,\n y: tryBlock.outputPoint.y,\n };\n },\n getDelta() {\n return undefined;\n },\n getChildDelta(child, layout) {\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n const isVertical = FlowLayoutDefault.isVertical(layout);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n // try 分支和 catch 分支的最小间距不低于 minInlineBlockSpacing\n let delta = 0;\n if (isVertical) {\n delta = Math.max(\n child.parent!.minInlineBlockSpacing,\n -child.originDeltaX + getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING)\n );\n } else {\n delta = Math.max(\n child.parent!.minInlineBlockSpacing,\n -child.originDeltaY + getDefaultSpacing(child.entity, ConstantKeys.BRANCH_SPACING)\n );\n }\n\n return {\n // 分支只有两个所以这里可以写死间隔宽度\n x: isVertical ? preBounds.right + delta : 0,\n y: isVertical ? 0 : preBounds.bottom + delta,\n };\n }\n return {\n x: 0,\n y: 0,\n };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DEFAULT_SPACING, FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { TryCatchTypeEnum } from './constants';\n\n/**\n * try 分支\n */\nexport const TryBlockRegistry: FlowNodeRegistry = {\n extend: FlowNodeBaseType.BLOCK,\n type: TryCatchTypeEnum.TRY_BLOCK,\n meta: {\n hidden: true,\n spacing: DEFAULT_SPACING.NULL,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry, FlowTransitionLabelEnum } from '@flowgram.ai/document';\n\nimport { TryCatchTypeEnum } from './constants';\n\n/**\n * try 占位节点\n */\nexport const TrySlotRegistry: FlowNodeRegistry = {\n type: TryCatchTypeEnum.TRY_SLOT,\n meta: {\n inlineSpacingAfter: 16,\n spacing: 0,\n size: {\n width: 16,\n height: 0,\n },\n },\n onAfterUpdateLocalTransform(transform): void {\n // 根据布局要置换宽高数据\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: 16,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: 16,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n getLabels(transition) {\n return [\n {\n offset: transition.transform.bounds.center,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeEntity,\n type FlowNodeJSON,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport {\n LoopEmptyBranchRegistry,\n LoopInlineBlocksNodeRegistry,\n LoopLeftEmptyBlockRegistry,\n LoopRightEmptyBlockRegistry,\n LoopSpacings,\n LoopTypeEnum,\n} from './loop-extends';\n\n/**\n * 循环节点\n */\nexport const LoopRegistry: FlowNodeRegistry = {\n type: 'loop',\n meta: {\n hidden: true,\n inlineSpacingAfter: (node) => {\n if (node.collapsed) {\n return LoopSpacings.COLLAPSE_INLINE_SPACING_BOTTOM;\n }\n const inlineSpacingBottom = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_SPACING_BOTTOM,\n LoopSpacings.INLINE_SPACING_BOTTOM\n );\n return inlineSpacingBottom;\n },\n spacing: LoopSpacings.SPACING,\n },\n /**\n * - loopNode\n * - loopBlockIcon\n * - loopInlineBlocks\n * - loopEmptyBlock 左侧占位区域\n * - loopBlock\n * - xxx\n * - xxx\n * @param node\n * @param json\n */\n onCreate(node: FlowNodeEntity, json: FlowNodeJSON) {\n const { document } = node;\n const loopBlocks = json.blocks || [];\n\n const loopIconNode = document.addNode({\n id: `$blockIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const loopInlineBlocks = document.addNode({\n id: `$inlineBlocks$${node.id}`,\n hidden: true,\n type: FlowNodeBaseType.INLINE_BLOCKS,\n originParent: node,\n parent: node,\n });\n const loopEmptyBlockNode = document.addNode({\n id: `$loopLeftEmpty$${node.id}`,\n hidden: true,\n type: LoopTypeEnum.LOOP_LEFT_EMPTY_BLOCK,\n originParent: node,\n parent: loopInlineBlocks,\n });\n\n const loopBlockNode = document.addNode({\n id: `$block$${node.id}`,\n hidden: true,\n type: FlowNodeBaseType.BLOCK, // : LoopTypeEnum.LOOP_RIGHT_EMPTY_BLOCK,\n originParent: node,\n parent: loopInlineBlocks,\n });\n const loopBranch = document.addNode({\n id: `$loopRightEmpty$${node.id}`,\n hidden: true,\n type: LoopTypeEnum.LOOP_EMPTY_BRANCH,\n originParent: node,\n parent: loopBlockNode,\n });\n const otherNodes: FlowNodeEntity[] = [];\n loopBlocks.forEach((b) =>\n document.addNode(\n {\n ...b,\n type: b.type!,\n parent: loopBlockNode,\n },\n otherNodes\n )\n );\n\n return [\n loopIconNode,\n loopEmptyBlockNode,\n loopInlineBlocks,\n loopBlockNode,\n loopBranch,\n ...otherNodes,\n ];\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n return [\n // 循环结束\n {\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_END_TEXT,\n // 循环 label 垂直样式展示,而非 rotate 旋转文案\n props: isVertical\n ? undefined\n : {\n style: {\n maxWidth: '20px',\n lineHeight: '12px',\n whiteSpace: 'pre-wrap',\n },\n },\n offset: Point.move(currentTransform.outputPoint, isVertical ? { y: -26 } : { x: -26 }),\n },\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: currentTransform.outputPoint,\n },\n ];\n },\n // 和前序节点对齐\n getInputPoint(transform) {\n const { isVertical } = transform.entity;\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,\n y: transform.bounds.top,\n };\n }\n return {\n x: transform.bounds.left,\n y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0,\n };\n },\n getOutputPoint(transform) {\n const { isVertical } = transform.entity;\n if (isVertical) {\n return {\n x: transform.pre?.outputPoint.x || transform.firstChild?.outputPoint.x || 0,\n y: transform.bounds.bottom,\n };\n }\n return {\n x: transform.bounds.right,\n y: transform.pre?.outputPoint.y || transform.firstChild?.outputPoint.y || 0,\n };\n },\n\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n spacing: LoopSpacings.LOOP_BLOCK_ICON_SPACING,\n },\n },\n LoopLeftEmptyBlockRegistry,\n LoopEmptyBranchRegistry,\n LoopRightEmptyBlockRegistry,\n LoopInlineBlocksNodeRegistry,\n ],\n\n /**\n * @depreacted\n */\n addChild(node, json, options = {}) {\n const { index } = options;\n const document = node.document;\n return document.addNode({\n ...json,\n ...options,\n parent: document.getNode(`$block$${node.id}`),\n index: typeof index === 'number' ? index + 1 : undefined,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ConstantKeys } from '@flowgram.ai/document';\n\nexport enum LoopTypeEnum {\n LOOP_LEFT_EMPTY_BLOCK = 'loopLeftEmptyBlock',\n LOOP_RIGHT_EMPTY_BLOCK = 'loopRightEmptyBlock',\n LOOP_EMPTY_BRANCH = 'loopEmptyBranch',\n}\n\nexport const LoopSpacings = {\n SPACING: 16, // 距离下面节点距离\n COLLAPSE_INLINE_SPACING_BOTTOM: 60, // 距离下面节点距离\n [ConstantKeys.INLINE_SPACING_BOTTOM]: 48, // 下边空白\n MIN_INLINE_BLOCK_SPACING: 280, // 最小循环圈宽度\n HORIZONTAL_MIN_INLINE_BLOCK_SPACING: 180, // 水平布局下的最小循环圈高度\n LEFT_EMPTY_BLOCK_WIDTH: 80, // 左边空分支宽度\n EMPTY_BRANCH_SPACING: 20, // 左边空分支宽度\n LOOP_BLOCK_ICON_SPACING: 13, // inlineBlocks 的 inlineBottom\n [ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM]: 23, // inlineBlocks 的 inlineBottom\n INLINE_BLOCKS_INLINE_SPACING_TOP: 30, // inlineBlocks 的 inlineTop\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { LoopSpacings, LoopTypeEnum } from './constants';\n\nexport const LoopLeftEmptyBlockRegistry: FlowNodeRegistry = {\n type: LoopTypeEnum.LOOP_LEFT_EMPTY_BLOCK,\n meta: {\n inlineSpacingAfter: 0,\n spacing: 0,\n size: {\n width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n height: 0,\n },\n },\n onAfterUpdateLocalTransform(transform): void {\n // 根据布局要置换宽高数据\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: LoopSpacings.LEFT_EMPTY_BLOCK_WIDTH,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry } from '@flowgram.ai/document';\n\nimport { BlockRegistry } from '../block';\nimport { LoopTypeEnum } from './constants';\n\nexport const LoopRightEmptyBlockRegistry: FlowNodeRegistry = {\n ...BlockRegistry,\n type: LoopTypeEnum.LOOP_RIGHT_EMPTY_BLOCK,\n meta: {\n ...BlockRegistry.meta,\n inlineSpacingAfter: 0,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type FlowNodeRegistry, FlowTransitionLabelEnum } from '@flowgram.ai/document';\n\nimport { LoopSpacings, LoopTypeEnum } from './constants';\n\nexport const LoopEmptyBranchRegistry: FlowNodeRegistry = {\n type: LoopTypeEnum.LOOP_EMPTY_BRANCH,\n meta: {\n inlineSpacingAfter: 0,\n spacing: LoopSpacings.EMPTY_BRANCH_SPACING,\n size: {\n width: 100,\n height: 0,\n },\n },\n getLabels(transition) {\n const { isVertical } = transition.entity;\n const currentTransform = transition.transform;\n if (isVertical) {\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: {\n x: currentTransform.inputPoint.x,\n y: currentTransform.bounds.center.y + 8, // 右边空节点\n },\n },\n ];\n }\n return [\n {\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n offset: {\n x: currentTransform.bounds.center.x + 8,\n y: currentTransform.inputPoint.y,\n },\n },\n ];\n },\n onAfterUpdateLocalTransform(transform): void {\n if (transform.entity.isVertical) {\n transform.data.size = {\n width: 100,\n height: 0,\n };\n } else {\n transform.data.size = {\n width: 0,\n height: 100,\n };\n }\n transform.transform.update({\n size: transform.data.size,\n });\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowTextKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n type FlowTransitionLabel,\n FlowTransitionLabelEnum,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\nimport { LoopSpacings } from './constants';\n\nexport const LoopInlineBlocksNodeRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: (node) => {\n const inlineBlocksInlineSpacingTop = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_TOP,\n LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_TOP\n );\n return inlineBlocksInlineSpacingTop;\n },\n inlineSpacingAfter: (node) => {\n const inlineBlocksInlineSpacingBottom = getDefaultSpacing(\n node.entity,\n ConstantKeys.INLINE_BLOCKS_INLINE_SPACING_BOTTOM,\n LoopSpacings.INLINE_BLOCKS_INLINE_SPACING_BOTTOM\n );\n return inlineBlocksInlineSpacingBottom;\n },\n minInlineBlockSpacing: (node) =>\n node.entity.isVertical\n ? LoopSpacings.MIN_INLINE_BLOCK_SPACING\n : LoopSpacings.HORIZONTAL_MIN_INLINE_BLOCK_SPACING,\n },\n getLines(transition) {\n const currentTransform = transition.transform;\n const parentTransform = currentTransform.parent!;\n const { isVertical } = transition.entity;\n\n const lines: FlowTransitionLine[] = [\n // 循环结束线\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: currentTransform.outputPoint,\n to: parentTransform.outputPoint,\n },\n ];\n\n // 收起时展示\n if (currentTransform.collapsed) {\n return lines;\n }\n\n const [leftBlockTransform] = currentTransform.children;\n\n return [\n ...lines,\n // 循环回撤线 - 1 分成两段可以被 viewport 识别出矩阵区域\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: currentTransform.outputPoint,\n to: leftBlockTransform.outputPoint,\n vertices: [\n isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.bottom }\n : { x: currentTransform.bounds.right, y: leftBlockTransform.inputPoint.y },\n ],\n },\n // 循环回撤线 - 2\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: leftBlockTransform.outputPoint,\n to: Point.move(\n currentTransform.inputPoint,\n isVertical ? { x: -12, y: 10 } : { x: 10, y: -12 }\n ),\n vertices: [\n isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.top + 10 }\n : { x: currentTransform.bounds.left + 10, y: leftBlockTransform.inputPoint.y },\n ],\n arrow: true,\n },\n ];\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const labels: FlowTransitionLabel[] = [];\n\n // 收起时展示\n if (currentTransform.collapsed) {\n return labels;\n }\n\n const leftBlockTransform = currentTransform.children[0];\n const rightBlockTransform = currentTransform.children[1];\n\n if (transition.entity.originParent?.id.startsWith('while_')) {\n // 满足条件时\n labels.push({\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_WHILE_TEXT,\n rotate: isVertical ? '' : '-90deg',\n offset: isVertical\n ? {\n x: (currentTransform.inputPoint.x + rightBlockTransform.inputPoint.x) / 2,\n y: currentTransform.inputPoint.y + 10,\n }\n : {\n x: currentTransform.inputPoint.x + 10,\n y: (currentTransform.inputPoint.y + rightBlockTransform.inputPoint.y) / 2,\n },\n });\n } else {\n // 循环遍历\n labels.push({\n type: FlowTransitionLabelEnum.TEXT_LABEL,\n renderKey: FlowTextKey.LOOP_TRAVERSE_TEXT,\n // rotate: isVertical ? '' : '-90deg',\n offset: isVertical\n ? { x: leftBlockTransform.inputPoint.x, y: currentTransform.bounds.center.y + 5 }\n : { x: currentTransform.bounds.center.x + 5, y: leftBlockTransform.inputPoint.y },\n });\n }\n\n return labels;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { DEFAULT_SPACING, FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 根节点\n */\nexport const RootRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.ROOT,\n meta: {\n spacing: DEFAULT_SPACING.NULL,\n hidden: true,\n },\n getInputPoint(transform) {\n return transform.firstChild?.inputPoint || transform.bounds.topCenter;\n },\n getOutputPoint(transform) {\n return transform.lastChild?.outputPoint || transform.bounds.bottomCenter;\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowTransitionLabelEnum,\n ConstantKeys,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\n/**\n * 占位节点,宽高为 0, 该节点下边同样有 \"添加 label\"\n */\nexport const EmptyRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.EMPTY,\n meta: {\n spacing: (node) => {\n const spacing = getDefaultSpacing(node.entity, ConstantKeys.NODE_SPACING);\n return spacing / 2;\n },\n size: { width: 0, height: 0 },\n hidden: true,\n },\n getLabels(transition) {\n return [\n {\n offset: transition.transform.bounds,\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n },\n ];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowNodeBaseType,\n FlowNodeJSON,\n FlowNodeEntity,\n} from '@flowgram.ai/document';\n\n/**\n * - simpleSplit: (最原始的 id)\n * blockIcon\n * inlineBlocks\n * node1\n * node2\n */\nexport const SimpleSplitRegistry: FlowNodeRegistry = {\n type: FlowNodeSplitType.SIMPLE_SPLIT,\n extend: FlowNodeSplitType.DYNAMIC_SPLIT,\n onBlockChildCreate(\n originParent: FlowNodeEntity,\n blockData: FlowNodeJSON,\n addedNodes: FlowNodeEntity[] = [] // 新创建的节点都要存在这里\n ) {\n const { document } = originParent;\n const parent = document.getNode(`$inlineBlocks$${originParent.id}`);\n const realBlock = document.addNode(\n {\n ...blockData,\n type: blockData.type || FlowNodeBaseType.BLOCK,\n parent,\n },\n addedNodes\n );\n addedNodes.push(realBlock);\n return realBlock;\n },\n // addChild(node, json, options = {}) {\n // const { index } = options;\n // const document = node.document;\n // return document.addBlock(node, json, undefined, undefined, index);\n // }\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * Break 节点, 用于分支断开\n */\nexport const BreakRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BREAK,\n extend: FlowNodeBaseType.END,\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n type FlowTransitionLine,\n FlowTransitionLineEnum,\n LABEL_SIDE_TYPE,\n FlowTransitionLabelEnum,\n} from '@flowgram.ai/document';\n\n/**\n * 输入节点\n */\nexport const InputRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.INPUT,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n hidden: false,\n },\n getLines(transition, layout) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n const lines: FlowTransitionLine[] = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 分支拖拽场景线条 push\n // 当有其余分支的时候,绘制一条两个分支之间的线条\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.outputPoint.y;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n isDraggingLine: true,\n from: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next?.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.outputPoint.x;\n if (currentTransform?.next) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n isDraggingLine: true,\n from: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n }\n }\n\n // 最后一个节点是 end 节点,不绘制 mergeLine\n if (!transition.isNodeEnd) {\n lines.push({\n type: FlowTransitionLineEnum.MERGE_LINE,\n from: currentTransform.outputPoint,\n to: currentTransform.parent!.outputPoint,\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n });\n }\n\n return lines;\n },\n getLabels(transition) {\n const currentTransform = transition.transform;\n const { isVertical } = transition.entity;\n\n const draggingLabel = [];\n\n const hasBranchDraggingAdder =\n currentTransform && currentTransform.entity.isInlineBlock && transition.renderData.draggable;\n\n // 获取两个分支节点中间点作为拖拽标签插入位置\n if (hasBranchDraggingAdder) {\n if (isVertical) {\n const currentOffsetRightX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.right\n : currentTransform.bounds.right;\n const nextOffsetLeftX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.left\n : currentTransform.next?.bounds?.left) || 0;\n const currentInputPointY = currentTransform.outputPoint.y;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: (currentOffsetRightX + nextOffsetLeftX) / 2,\n y: currentInputPointY,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetLeftX - currentOffsetRightX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n } else {\n const currentOffsetBottomX = currentTransform.firstChild\n ? currentTransform.firstChild.bounds.bottom\n : currentTransform.bounds.bottom;\n const nextOffsetTopX =\n (currentTransform.next?.firstChild\n ? currentTransform.next.firstChild.bounds?.top\n : currentTransform.next?.bounds?.top) || 0;\n const currentInputPointX = currentTransform.outputPoint.x;\n if (currentTransform?.next) {\n draggingLabel.push({\n offset: {\n x: currentInputPointX,\n y: (currentOffsetBottomX + nextOffsetTopX) / 2,\n },\n type: FlowTransitionLabelEnum.BRANCH_DRAGGING_LABEL,\n width: nextOffsetTopX - currentOffsetBottomX,\n props: {\n side: LABEL_SIDE_TYPE.NORMAL_BRANCH,\n },\n });\n }\n }\n }\n\n return [...draggingLabel];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType, type FlowNodeRegistry } from '@flowgram.ai/document';\n\n/**\n * 输出节点, 一般作为 end 节点\n */\nexport const OuputRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.OUTPUT,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n hidden: false,\n isNodeEnd: true,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowLayoutDefault,\n type FlowNodeRegistry,\n FlowNodeSplitType,\n FlowNodeBaseType,\n} from '@flowgram.ai/document';\n\nimport { DynamicSplitRegistry } from './dynamic-split';\nimport { BlockRegistry } from './block';\n\n/**\n * 多输出节点\n * - multiOutputs:\n * - blockIcon\n * - inlineBlocks\n * - output or multiOutputs\n * - output or multiOutputs\n */\nexport const MultiOuputsRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.MULTI_OUTPUTS,\n extend: FlowNodeSplitType.SIMPLE_SPLIT,\n meta: {\n isNodeEnd: true,\n },\n getLines: (transition, layout) => {\n // 嵌套在 mutliOutputs 下边\n if (transition.entity.parent?.flowNodeType === FlowNodeBaseType.INLINE_BLOCKS) {\n return BlockRegistry.getLines!(transition, layout);\n }\n return [];\n },\n getLabels: (transition, layout) => [\n ...DynamicSplitRegistry.getLabels!(transition, layout),\n ...BlockRegistry.getLabels!(transition, layout),\n ],\n getOutputPoint(transform, layout) {\n const isVertical = FlowLayoutDefault.isVertical(layout);\n const lastChildOutput = transform.lastChild?.outputPoint;\n\n if (isVertical) {\n return {\n x: lastChildOutput ? lastChildOutput.x : transform.bounds.center.x,\n y: transform.bounds.bottom,\n };\n }\n\n return {\n x: transform.bounds.right,\n y: lastChildOutput ? lastChildOutput.y : transform.bounds.center.y,\n };\n },\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n // isNodeEnd: true\n },\n },\n ],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Point } from '@flowgram.ai/utils';\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\nimport {\n FlowNodeBaseType,\n type FlowNodeRegistry,\n FlowNodeRenderData,\n FlowTransitionLabelEnum,\n FlowNodeSplitType,\n getDefaultSpacing,\n ConstantKeys,\n} from '@flowgram.ai/document';\n\n/**\n * 多输入节点, 只能作为 开始节点\n * - multiInputs:\n * - inlineBlocks\n * - input\n * - input\n */\nexport const MultiInputsRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.MULTI_INPUTS,\n extend: FlowNodeSplitType.SIMPLE_SPLIT,\n extendChildRegistries: [\n {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n hidden: true,\n spacing: 0,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n },\n {\n type: FlowNodeBaseType.INLINE_BLOCKS,\n meta: {\n inlineSpacingPre: 0,\n },\n getLabels(transition) {\n const isVertical = transition.entity.isVertical;\n const currentTransform = transition.transform;\n const spacing = getDefaultSpacing(\n transition.entity,\n ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM\n );\n\n if (currentTransform.collapsed || transition.entity.childrenLength === 0) {\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: spacing } : { x: spacing }\n ),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: FlowRendererKey.BRANCH_ADDER,\n offset: Point.move(\n currentTransform.outputPoint,\n isVertical ? { y: -spacing / 2 } : { x: -spacing / 2 }\n ),\n props: {\n // 激活状态\n activated: transition.entity.getData(FlowNodeRenderData)!.activated,\n transform: currentTransform,\n // 传给外部使用的 node 信息\n node: currentTransform.originParent?.entity,\n },\n },\n ];\n },\n },\n ],\n getLabels() {\n return [];\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType, getDefaultSpacing } from '@flowgram.ai/document';\n\nimport {\n drawStraightAdder,\n drawStraightLine,\n getInputPoint,\n getOutputPoint,\n} from './utils/transition';\nimport { insideSlot } from './utils/node';\nimport { getAllPortsMiddle } from './utils/layout';\nimport { createSlotFromJSON } from './utils/create';\nimport { SlotInlineBlocksRegistry, SlotIconRegistry } from './extends';\nimport {\n SLOT_NODE_LAST_SPACING,\n SLOT_SPACING,\n SLOT_START_DISTANCE,\n SlotSpacingKey,\n} from './constants';\n\nexport const SlotRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.SLOT,\n extend: 'block',\n meta: {\n // Slot 节点内部暂时不允许拖拽\n draggable: (node) => !insideSlot(node),\n hidden: true,\n spacing: (node) => getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_SPACING, SLOT_SPACING),\n padding: (node) => ({\n left: 0,\n right: node.collapsed\n ? getDefaultSpacing(node.entity, SlotSpacingKey.SLOT_START_DISTANCE, SLOT_START_DISTANCE)\n : 0,\n bottom: !insideSlot(node.entity) && node.isLast ? SLOT_NODE_LAST_SPACING : 0,\n top: 0,\n }),\n copyDisable: false,\n defaultExpanded: false,\n },\n /**\n * 业务通常需要重载方法\n */\n onCreate: createSlotFromJSON,\n getLines: (transition) => [\n ...(!insideSlot(transition.entity) ? drawStraightLine(transition) : []),\n ],\n getLabels: (transition) => [\n ...(!insideSlot(transition.entity) ? drawStraightAdder(transition) : []),\n ],\n getInputPoint,\n getOutputPoint,\n onAfterUpdateLocalTransform(transform) {\n const { isVertical } = transform.entity;\n\n if (!isVertical) {\n return;\n }\n\n const icon = transform.firstChild;\n const inlineBlocks = transform.lastChild;\n\n if (!icon || !inlineBlocks) {\n return;\n }\n\n const iconSize = icon.localBounds.height;\n const inlineBlocksSize = inlineBlocks.localBounds.height;\n\n if (transform.collapsed || !inlineBlocks) {\n return;\n }\n\n // 所有 Ports 的中间点\n const portsMiddle = getAllPortsMiddle(inlineBlocks);\n\n icon.entity.clearMemoLocal();\n inlineBlocks.entity.clearMemoLocal();\n\n if (iconSize / 2 + portsMiddle > inlineBlocksSize || !inlineBlocks.children.length) {\n icon.transform.update({\n position: { x: icon.transform.position.x, y: 0 },\n });\n inlineBlocks.transform.update({\n position: {\n x: inlineBlocks.transform.position.x,\n y: Math.max(iconSize / 2 - inlineBlocksSize / 2, 0),\n },\n });\n\n return;\n }\n\n inlineBlocks.transform.update({\n position: { x: inlineBlocks.transform.position.x, y: 0 },\n });\n icon?.transform.update({\n position: {\n x: icon.transform.position.x,\n y: Math.max(portsMiddle - iconSize / 2, 0), // 所有 port 的中间点\n },\n });\n },\n extendChildRegistries: [SlotIconRegistry, SlotInlineBlocksRegistry],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Point } from '@flowgram.ai/utils';\nimport {\n type FlowNodeTransitionData,\n FlowTransitionLineEnum,\n FlowTransitionLabelEnum,\n type FlowNodeTransformData,\n type FlowTransitionLine,\n type FlowTransitionLabel,\n getDefaultSpacing,\n} from '@flowgram.ai/document';\n\nimport { RENDER_SLOT_COLLAPSE_KEY, SlotSpacingKey, SLOT_START_DISTANCE } from '../constants';\nimport { getDisplayFirstChildTransform } from './node';\n\n/**\n * 画 Slot 节点虚线起点\n * @param iconTransform blockIcon 的 transform\n * @returns\n */\nexport const getSlotChildLineStartPoint = (iconTransform?: FlowNodeTransformData): IPoint => {\n if (!iconTransform) {\n return { x: 0, y: 0 };\n }\n\n const startDistance = getDefaultSpacing(\n iconTransform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n if (!iconTransform.entity.isVertical) {\n return {\n x: iconTransform?.bounds.center.x,\n y: iconTransform?.bounds.bottom + startDistance,\n };\n }\n return {\n x: iconTransform?.bounds.right + startDistance,\n y: iconTransform?.bounds.center.y,\n };\n};\n\nexport const getOutputPoint = (transform: FlowNodeTransformData): IPoint => {\n const icon = transform.firstChild;\n\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n if (!transform.entity.isVertical) {\n return {\n x: transform.bounds.right,\n y: icon.outputPoint.y,\n };\n }\n\n return {\n x: icon.outputPoint.x,\n y: transform.bounds.bottom,\n };\n};\n\nexport const getInputPoint = (transform: FlowNodeTransformData): IPoint => {\n const icon = transform.firstChild;\n\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n if (!transform.entity.isVertical) {\n return {\n x: transform.bounds.left,\n y: icon.outputPoint.y,\n };\n }\n\n return icon.inputPoint;\n};\n\n/**\n * 获取实连线终点\n * @param transition\n * @returns\n */\nexport const getTransitionToPoint = (transition: FlowNodeTransitionData): IPoint => {\n let toPoint = transition.transform.next?.inputPoint;\n const icon = transition.transform.firstChild;\n\n const parent = transition.transform.parent;\n\n if (!icon || !parent) {\n return { x: 0, y: 0 };\n }\n\n if (!transition.transform.next) {\n if (!transition.entity.isVertical) {\n toPoint = {\n x: parent.outputPoint.x,\n y: icon.outputPoint.y,\n };\n } else {\n toPoint = {\n x: icon.outputPoint.x,\n y: parent.outputPoint.y,\n };\n }\n }\n\n return toPoint || { x: 0, y: 0 };\n};\n\n/**\n * 画实现线\n * @param transition Slot 节点的 transition\n * @returns\n */\nexport const drawStraightLine = (transition: FlowNodeTransitionData): FlowTransitionLine[] => {\n const icon = transition.transform.firstChild;\n const toPoint = getTransitionToPoint(transition);\n\n if (!icon) {\n return [];\n }\n\n return [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: icon.outputPoint,\n to: toPoint,\n },\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: icon.inputPoint,\n to: transition.transform.inputPoint,\n },\n ];\n};\n\nexport const drawCollapseLabel = (transition: FlowNodeTransitionData): FlowTransitionLabel[] => {\n const icon = transition.transform;\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_COLLAPSE_KEY,\n offset: getSlotChildLineStartPoint(icon),\n props: {\n node: transition.entity.parent,\n },\n },\n ];\n};\n\nexport const drawCollapseLine = (transition: FlowNodeTransitionData): FlowTransitionLine[] => {\n const startDistance = getDefaultSpacing(\n transition.transform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n return [\n {\n type: FlowTransitionLineEnum.STRAIGHT_LINE,\n from: getSlotChildLineStartPoint(transition.transform),\n to: Point.move(\n getSlotChildLineStartPoint(transition.transform),\n transition.entity.isVertical ? { x: -startDistance, y: 0 } : { x: 0, y: -startDistance }\n ),\n style: {\n strokeDasharray: '5 5',\n },\n },\n ];\n};\n\n/**\n * 画实线上的叫号\n * @param transition\n * @returns\n */\nexport const drawStraightAdder = (transition: FlowNodeTransitionData): FlowTransitionLabel[] => {\n const toPoint = getTransitionToPoint(transition);\n const fromPoint = transition.transform.firstChild!.outputPoint;\n\n const hoverProps = transition.entity.isVertical\n ? {\n hoverHeight: toPoint.y - fromPoint.y,\n hoverWidth: transition.transform.firstChild?.bounds.width,\n }\n : {\n hoverHeight: transition.transform.firstChild?.bounds.height,\n hoverWidth: toPoint.x - fromPoint.x,\n };\n\n return [\n {\n offset: Point.getMiddlePoint(fromPoint, toPoint),\n type: FlowTransitionLabelEnum.ADDER_LABEL,\n props: hoverProps,\n },\n ];\n};\n\n/**\n * 获取端口的子节点线条输入点\n * @param _child\n * @returns\n */\nexport const getPortChildInput = (_child?: FlowNodeTransformData) => {\n if (!_child) {\n return { x: 0, y: 0 };\n }\n\n const firstChild = getDisplayFirstChildTransform(_child);\n\n return { x: _child.bounds.left, y: firstChild.bounds.center.y };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowRendererKey } from '@flowgram.ai/renderer';\n\nexport const RENDER_SLOT_ADDER_KEY: string = FlowRendererKey.SLOT_ADDER;\nexport const RENDER_SLOT_LABEL_KEY: string = FlowRendererKey.SLOT_LABEL;\nexport const RENDER_SLOT_COLLAPSE_KEY: string = FlowRendererKey.SLOT_COLLAPSE;\n\nexport const SlotSpacingKey = {\n /**\n * = Next Node - Slot END\n */\n SLOT_SPACING: 'SLOT_SPACING',\n\n /**\n * = Slot Start Line - Slot Icon Right\n */\n SLOT_START_DISTANCE: 'SLOT_START_DISTANCE',\n\n /**\n * = Slot Radius\n */\n SLOT_RADIUS: 'SLOT_RADIUS',\n\n /**\n * = Slot Port - Slot Start\n */\n SLOT_PORT_DISTANCE: 'SLOT_PORT_DISTANCE',\n\n /**\n * = Slot Label - Slot Start\n */\n SLOT_LABEL_DISTANCE: 'SLOT_LABEL_DISTANCE',\n\n /**\n * = Slot Block - Slot Port\n */\n SLOT_BLOCK_PORT_DISTANCE: 'SLOT_BLOCK_PORT_DISTANCE',\n\n /**\n * Vertical Layout: Slot Block - Slot Block\n */\n SLOT_BLOCK_VERTICAL_SPACING: 'SLOT_BLOCK_VERTICAL_SPACING',\n};\n\nexport const SLOT_START_DISTANCE = 16;\nexport const SLOT_PORT_DISTANCE = 100;\nexport const SLOT_LABEL_DISTANCE = 32;\nexport const SLOT_BLOCK_PORT_DISTANCE = 32.5;\nexport const SLOT_RADIUS = 16;\nexport const SLOT_SPACING = 32;\nexport const SLOT_BLOCK_VERTICAL_SPACING = 32.5;\nexport const SLOT_NODE_LAST_SPACING = 10;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType } from '@flowgram.ai/document';\n\nexport enum SlotNodeType {\n Slot = FlowNodeBaseType.SLOT,\n SlotBlock = FlowNodeBaseType.SLOT_BLOCK,\n SlotInlineBlocks = 'slotInlineBlocks',\n SlotBlockInlineBlocks = 'slotBlockInlineBlocks',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeEntity } from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\n\n/**\n * Slot 节点是否可下钻,看 inlineBlocks 是否有子节点\n * @param Slot Slot 节点\n */\nexport const canSlotDrilldown = (Slot: FlowNodeEntity): boolean =>\n !!Slot?.lastCollapsedChild?.blocks.length;\n\n/**\n * 是否是 Slot 内部\n * @param entity\n * @returns\n */\nexport const insideSlot = (entity?: FlowNodeEntity): boolean =>\n !!entity?.parent?.isTypeOrExtendType(SlotNodeType.SlotBlock);\n\n/**\n * 获取在页面上实际渲染的第一个 Child 节点\n * @param node\n */\nexport const getDisplayFirstChildTransform = (\n transform: FlowNodeTransformData\n): FlowNodeTransformData => {\n if (transform.firstChild) {\n return getDisplayFirstChildTransform(transform.firstChild);\n }\n\n return transform;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mean } from 'lodash-es';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nexport const getDisplayFirstChildTop = (transform: FlowNodeTransformData): number => {\n if (transform.firstChild) {\n return transform.localBounds.top + getDisplayFirstChildTop(transform.firstChild);\n }\n\n return transform.localBounds.center.y;\n};\n\n/**\n * 获取单个 Port 的中间点\n * @param inlineBlocks\n * @returns\n */\nexport const getPortMiddle = (_port: FlowNodeTransformData) => {\n if (!_port.children.length) {\n return _port.localBounds.top;\n }\n\n const portChildInputs = [_port.firstChild!, _port.lastChild!].map((_portChild) =>\n getDisplayFirstChildTop(_portChild)\n );\n\n return _port.localBounds.top + mean(portChildInputs);\n};\n\n/**\n * 获取所有 Port 的中间点\n * @param inlineBlocks\n * @returns\n */\nexport const getAllPortsMiddle = (inlineBlocks: FlowNodeTransformData) => {\n if (!inlineBlocks.children.length) {\n return inlineBlocks.localBounds.height / 2;\n }\n\n const portInputs = [inlineBlocks.firstChild!, inlineBlocks.lastChild!].map((_port) =>\n getPortMiddle(_port)\n );\n\n return mean(portInputs);\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeBaseType } from '@flowgram.ai/document';\nimport { type FlowNodeEntity } from '@flowgram.ai/document';\nimport { FlowNodeJSON } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\n\n// Slot 样例数据\n// const mock = {\n// type: 'slot',\n// id: 'reactor_parent',\n// blocks: [\n// {\n// id: 'port_LnSdK',\n// blocks: [{ type: 'Slot', id: 'reactor_child' }],\n// },\n// {\n// id: 'port_60X7U',\n// },\n// {\n// id: 'port_JWhcm',\n// },\n// {\n// id: 'port_scHWa',\n// },\n// ],\n// };\n\n/**\n * 创建 Slot 子节点\n * - Slot\n * - SlotBlockIcon\n * - SlotInlineBlocks\n * - SlotBlock 1\n * - SlotBlockIcon 1\n * - ChildSlot 1\n * - ChildSlot 2\n * - SlotBlock 2\n *\n * 范例数据:\n * {\n * type: 'Slot',\n * id: 'reactor_parent',\n * blocks: [\n * {\n * id: 'port_LnSdK',\n * blocks: [{ type: 'Slot', id: 'reactor_child' }],\n * },\n * {\n * id: 'port_60X7U',\n * }\n * ],\n * }\n *\n */\nexport const createSlotFromJSON = (node: FlowNodeEntity, json: FlowNodeJSON): FlowNodeEntity[] => {\n const { document } = node;\n\n const addedNodes: FlowNodeEntity[] = [];\n\n // 块列表开始节点,用来展示块的按钮\n const blockIconNode = document.addNode({\n id: `$slotIcon$${node.id}`,\n type: FlowNodeBaseType.BLOCK_ICON,\n originParent: node,\n parent: node,\n });\n const inlineBlocksNode = document.addNode({\n id: `$slotInlineBlocks$${node.id}`,\n type: SlotNodeType.SlotInlineBlocks,\n originParent: node,\n parent: node,\n });\n addedNodes.push(blockIconNode);\n addedNodes.push(inlineBlocksNode);\n\n const portJSONList = json.blocks || [];\n\n portJSONList.forEach((_portJSON) => {\n const port = document.addNode({\n type: SlotNodeType.SlotBlock,\n ..._portJSON,\n originParent: node,\n parent: inlineBlocksNode,\n });\n addedNodes.push(port);\n\n (_portJSON.blocks || []).forEach((_portChild) => {\n document.addNode(\n {\n type: SlotNodeType.Slot,\n ..._portChild,\n parent: port,\n },\n addedNodes\n );\n });\n });\n\n return addedNodes;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType } from '@flowgram.ai/document';\n\nimport { drawCollapseLabel, drawCollapseLine } from '../utils/transition';\nimport { canSlotDrilldown, insideSlot } from '../utils/node';\n\nexport const SlotIconRegistry: FlowNodeRegistry = {\n type: FlowNodeBaseType.BLOCK_ICON,\n meta: {\n defaultExpanded: false,\n spacing: 0,\n },\n getLines: (transition) => [\n ...(canSlotDrilldown(transition.entity.parent!) ? drawCollapseLine(transition) : []),\n ],\n getLabels: (transition) => [\n ...(canSlotDrilldown(transition.entity.parent!) ? drawCollapseLabel(transition) : []),\n ],\n getDelta: (transform) => {\n // Slot 节点内部时,重新纠正重心调整产生的偏移\n if (insideSlot(transform.entity.parent)) {\n return transform.entity.isVertical\n ? { x: -transform.originDeltaX, y: 0 }\n : { x: 0, y: -transform.originDeltaY };\n }\n return { x: 0, y: 0 };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowNodeRegistry, FlowNodeBaseType, getDefaultSpacing } from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { SlotNodeType } from '../typings';\nimport {\n SlotSpacingKey,\n SLOT_START_DISTANCE,\n SLOT_PORT_DISTANCE,\n SLOT_BLOCK_PORT_DISTANCE,\n} from '../constants';\n\nexport const SlotInlineBlocksRegistry: FlowNodeRegistry = {\n type: SlotNodeType.SlotInlineBlocks,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n spacing: 0,\n inlineSpacingPre: 0,\n inlineSpacingAfter: 0,\n isInlineBlocks: (node) => !node.isVertical,\n },\n getLines() {\n return [];\n },\n getLabels() {\n return [];\n },\n getChildDelta(child, layout) {\n if (child.entity.isVertical) {\n return { x: 0, y: 0 };\n }\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n\n return {\n x: 0,\n y: preBounds.bottom + 30,\n };\n }\n\n return { x: 0, y: 0 };\n },\n /**\n * 控制条件分支居右布局\n */\n getDelta(transform) {\n if (!transform.children.length) {\n return { x: 0, y: 0 };\n }\n\n const icon = transform.pre;\n if (!icon) {\n return { x: 0, y: 0 };\n }\n\n const startDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_START_DISTANCE,\n SLOT_START_DISTANCE\n );\n\n const portDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_PORT_DISTANCE,\n SLOT_PORT_DISTANCE\n );\n\n const portBlockDistance = getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_BLOCK_PORT_DISTANCE,\n SLOT_BLOCK_PORT_DISTANCE\n );\n\n if (!transform.entity.isVertical) {\n const noChildren = transform?.children?.every?.((_port) => !_port.children.length);\n /**\n * 如果没有 children 的时候,不需要有右侧的间距,避免水平布局的时候 Slot 右侧空间过大。\n */\n if (noChildren) {\n return {\n x: portDistance - icon.localBounds.width / 2,\n y: icon.localBounds.bottom + startDistance,\n };\n }\n return {\n x: portDistance + portBlockDistance - icon.localBounds.width / 2,\n y: icon.localBounds.bottom + startDistance,\n };\n }\n\n const slotInlineBlockDelta = startDistance + portDistance + portBlockDistance;\n return {\n x: icon.localBounds.right + slotInlineBlockDelta,\n y: -icon.localBounds.height,\n };\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { mean } from 'lodash-es';\nimport {\n FlowNodeRegistry,\n FlowNodeBaseType,\n FlowTransitionLabelEnum,\n FlowTransitionLineEnum,\n getDefaultSpacing,\n Vertex,\n} from '@flowgram.ai/document';\nimport { FlowNodeTransformData } from '@flowgram.ai/document';\n\nimport { getPortChildInput, getSlotChildLineStartPoint } from '../utils/transition';\nimport { SlotNodeType } from '../typings';\nimport {\n RENDER_SLOT_ADDER_KEY,\n SlotSpacingKey,\n SLOT_PORT_DISTANCE,\n SLOT_RADIUS,\n SLOT_LABEL_DISTANCE,\n RENDER_SLOT_LABEL_KEY,\n SLOT_BLOCK_VERTICAL_SPACING,\n} from '../constants';\n\nexport const SlotBlockRegistry: FlowNodeRegistry = {\n type: SlotNodeType.SlotBlock,\n extend: FlowNodeBaseType.BLOCK,\n meta: {\n inlineSpacingAfter: 0,\n inlineSpacingPre: 0,\n spacing: (transform) => {\n // 水平布局没有子节点情况\n if (!transform.entity.isVertical && transform.size.width === 0) {\n return 90;\n }\n return getDefaultSpacing(\n transform.entity,\n SlotSpacingKey.SLOT_BLOCK_VERTICAL_SPACING,\n SLOT_BLOCK_VERTICAL_SPACING\n );\n },\n isInlineBlocks: (node) => !node.isVertical,\n },\n getLines(transition) {\n const icon = transition.transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n const portPoint = transition.transform.inputPoint;\n\n const radius = getDefaultSpacing(\n transition.transform.entity,\n SlotSpacingKey.SLOT_RADIUS,\n SLOT_RADIUS\n );\n\n let startPortVertices: Vertex[] = [{ x: start.x, y: portPoint.y }];\n\n /**\n * When Radius is not enough, we should use truncate strategy\n * 弧度不够时,采取截断策略\n */\n if (transition.entity.isVertical) {\n const deltaY = Math.abs(portPoint.y - start.y);\n let deltaX = radius;\n let isTruncated = false;\n\n if (deltaY < radius * 2) {\n isTruncated = true;\n if (deltaY < radius) {\n // Calculate the x by circle equation\n deltaX = Math.sqrt(radius ** 2 - (radius - deltaY) ** 2);\n }\n }\n\n startPortVertices = [\n {\n x: start.x + deltaX,\n y: start.y,\n radiusX: radius,\n radiusY: radius,\n radiusOverflow: 'truncate',\n },\n {\n x: start.x + deltaX,\n y: portPoint.y,\n ...(isTruncated ? { radiusX: 0, radiusY: 0 } : {}),\n },\n ];\n }\n\n /**\n * When One Children, we should keep dash array align, so we draw one line directly to child nodes\n * 只有一个子节点时,我们通常需要保证两条虚线是连贯的,因此我们直接合并,绘制一条线连到子节点\n */\n if (transition.transform.children.length === 1) {\n return [\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: start,\n to: getPortChildInput(transition.transform.children[0]),\n vertices: startPortVertices,\n style: {\n strokeDasharray: '5 5',\n },\n radius,\n },\n ];\n }\n\n return [\n {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n from: start,\n to: portPoint,\n vertices: startPortVertices,\n style: {\n strokeDasharray: '5 5',\n },\n radius,\n },\n ...transition.transform.children.map((_child) => {\n const childInput = getPortChildInput(_child);\n\n return {\n type: FlowTransitionLineEnum.ROUNDED_LINE,\n radius,\n from: portPoint,\n to: childInput,\n vertices: [{ x: portPoint.x, y: childInput.y }],\n style: {\n strokeDasharray: '5 5',\n },\n };\n }),\n ];\n },\n getLabels(transition) {\n const icon = transition.transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n const portPoint = transition.transform.inputPoint;\n\n return [\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_ADDER_KEY,\n props: {\n node: transition.entity,\n },\n offset: portPoint,\n },\n {\n type: FlowTransitionLabelEnum.CUSTOM_LABEL,\n renderKey: RENDER_SLOT_LABEL_KEY,\n props: {\n node: transition.entity,\n },\n offset: {\n x:\n start.x +\n getDefaultSpacing(\n transition.entity,\n SlotSpacingKey.SLOT_LABEL_DISTANCE,\n SLOT_LABEL_DISTANCE\n ),\n y: portPoint.y,\n },\n origin: [0, 0.5],\n },\n ];\n },\n getInputPoint(transform) {\n const icon = transform.parent?.pre;\n const start = getSlotChildLineStartPoint(icon);\n\n let inputY = transform.bounds.center.y;\n if (transform.children.length) {\n inputY = mean([\n getPortChildInput(transform.firstChild).y,\n getPortChildInput(transform.lastChild).y,\n ]);\n }\n\n return {\n x:\n start.x +\n getDefaultSpacing(transform.entity, SlotSpacingKey.SLOT_PORT_DISTANCE, SLOT_PORT_DISTANCE),\n y: inputY,\n };\n },\n getChildDelta(child, layout) {\n const hasChild = !!child.firstChild;\n\n if (child.entity.isVertical) {\n // 绑定普通节点时进行重心纠偏\n let deltaX = hasChild ? 0 : -child.originDeltaX;\n\n return { x: deltaX, y: 0 };\n }\n\n let deltaY = hasChild ? 0 : -child.originDeltaY;\n\n const preTransform = child.entity.pre?.getData(FlowNodeTransformData);\n if (preTransform) {\n const { localBounds: preBounds } = preTransform;\n\n return {\n x: 0,\n y: preBounds.bottom + 30 + deltaY,\n };\n }\n\n return { x: 0, y: deltaY };\n },\n getChildLabels() {\n return [];\n },\n getChildLines() {\n return [];\n },\n getDelta(transform) {\n return {\n x: 0,\n y: 0,\n };\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IA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A,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["import_inversify","import_renderer","import_document","import_core","import_utils","import_renderer","import_document","import_document","import_document","import_document","import_document","preCenter","currentCenter","import_utils","import_document","import_utils","import_document","import_document","import_document","import_document","import_renderer","import_document","import_renderer","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_document","import_document","import_document","import_document","import_document","import_document","import_utils","import_renderer","import_document","import_document","import_utils","import_document","import_renderer","import_document","SlotNodeType","import_document","import_document","import_document","import_lodash_es","import_document"]}