@yh-ui/flow 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +234 -0
- package/dist/Flow.d.vue.ts +306 -0
- package/dist/Flow.vue +959 -0
- package/dist/Flow.vue.d.ts +306 -0
- package/dist/__tests__/ai-workflow.ssr.test.cjs +352 -0
- package/dist/__tests__/ai-workflow.ssr.test.d.ts +1 -0
- package/dist/__tests__/ai-workflow.ssr.test.mjs +283 -0
- package/dist/__tests__/ai-workflow.test.cjs +109 -0
- package/dist/__tests__/ai-workflow.test.d.ts +1 -0
- package/dist/__tests__/ai-workflow.test.mjs +112 -0
- package/dist/__tests__/bpmn.ssr.test.cjs +278 -0
- package/dist/__tests__/bpmn.ssr.test.d.ts +1 -0
- package/dist/__tests__/bpmn.ssr.test.mjs +237 -0
- package/dist/__tests__/bpmn.test.cjs +103 -0
- package/dist/__tests__/bpmn.test.d.ts +1 -0
- package/dist/__tests__/bpmn.test.mjs +106 -0
- package/dist/__tests__/custom-types.test.cjs +300 -0
- package/dist/__tests__/custom-types.test.d.ts +1 -0
- package/dist/__tests__/custom-types.test.mjs +248 -0
- package/dist/__tests__/edge.test.cjs +56 -0
- package/dist/__tests__/edge.test.d.ts +1 -0
- package/dist/__tests__/edge.test.mjs +69 -0
- package/dist/__tests__/event-bus.test.cjs +80 -0
- package/dist/__tests__/event-bus.test.d.ts +1 -0
- package/dist/__tests__/event-bus.test.mjs +51 -0
- package/dist/__tests__/flow.ssr.test.cjs +156 -0
- package/dist/__tests__/flow.ssr.test.d.ts +1 -0
- package/dist/__tests__/flow.ssr.test.mjs +112 -0
- package/dist/__tests__/geometry.test.cjs +191 -0
- package/dist/__tests__/geometry.test.d.ts +1 -0
- package/dist/__tests__/geometry.test.mjs +105 -0
- package/dist/__tests__/graph.test.cjs +115 -0
- package/dist/__tests__/graph.test.d.ts +1 -0
- package/dist/__tests__/graph.test.mjs +85 -0
- package/dist/__tests__/history-plugin.test.cjs +191 -0
- package/dist/__tests__/history-plugin.test.d.ts +1 -0
- package/dist/__tests__/history-plugin.test.mjs +161 -0
- package/dist/__tests__/history.test.cjs +81 -0
- package/dist/__tests__/history.test.d.ts +1 -0
- package/dist/__tests__/history.test.mjs +43 -0
- package/dist/__tests__/layout.test.cjs +213 -0
- package/dist/__tests__/layout.test.d.ts +1 -0
- package/dist/__tests__/layout.test.mjs +170 -0
- package/dist/__tests__/node-edit-panel.ssr.test.cjs +168 -0
- package/dist/__tests__/node-edit-panel.ssr.test.d.ts +1 -0
- package/dist/__tests__/node-edit-panel.ssr.test.mjs +118 -0
- package/dist/__tests__/node-group-plugin.test.cjs +235 -0
- package/dist/__tests__/node-group-plugin.test.d.ts +1 -0
- package/dist/__tests__/node-group-plugin.test.mjs +187 -0
- package/dist/__tests__/node-handles.test.cjs +340 -0
- package/dist/__tests__/node-handles.test.d.ts +1 -0
- package/dist/__tests__/node-handles.test.mjs +230 -0
- package/dist/__tests__/plugin.test.cjs +151 -0
- package/dist/__tests__/plugin.test.d.ts +1 -0
- package/dist/__tests__/plugin.test.mjs +116 -0
- package/dist/__tests__/transform.test.cjs +58 -0
- package/dist/__tests__/transform.test.d.ts +1 -0
- package/dist/__tests__/transform.test.mjs +38 -0
- package/dist/__tests__/useAlignment.test.cjs +91 -0
- package/dist/__tests__/useAlignment.test.d.ts +1 -0
- package/dist/__tests__/useAlignment.test.mjs +52 -0
- package/dist/__tests__/useEdges.test.cjs +117 -0
- package/dist/__tests__/useEdges.test.d.ts +1 -0
- package/dist/__tests__/useEdges.test.mjs +80 -0
- package/dist/__tests__/useKeyboard.test.cjs +88 -0
- package/dist/__tests__/useKeyboard.test.d.ts +1 -0
- package/dist/__tests__/useKeyboard.test.mjs +56 -0
- package/dist/__tests__/useNodes.test.cjs +150 -0
- package/dist/__tests__/useNodes.test.d.ts +1 -0
- package/dist/__tests__/useNodes.test.mjs +80 -0
- package/dist/__tests__/useSelection.test.cjs +112 -0
- package/dist/__tests__/useSelection.test.d.ts +1 -0
- package/dist/__tests__/useSelection.test.mjs +76 -0
- package/dist/__tests__/useViewport.test.cjs +171 -0
- package/dist/__tests__/useViewport.test.d.ts +1 -0
- package/dist/__tests__/useViewport.test.mjs +82 -0
- package/dist/__tests__/utils/ssr.cjs +124 -0
- package/dist/__tests__/utils/ssr.d.ts +33 -0
- package/dist/__tests__/utils/ssr.mjs +129 -0
- package/dist/__tests__/validation.test.cjs +95 -0
- package/dist/__tests__/validation.test.d.ts +1 -0
- package/dist/__tests__/validation.test.mjs +36 -0
- package/dist/components/AiNodeEditPanel.d.vue.ts +13 -0
- package/dist/components/AiNodeEditPanel.vue +413 -0
- package/dist/components/AiNodeEditPanel.vue.d.ts +13 -0
- package/dist/components/EdgeEditPanel.d.vue.ts +14 -0
- package/dist/components/EdgeEditPanel.vue +205 -0
- package/dist/components/EdgeEditPanel.vue.d.ts +14 -0
- package/dist/components/NodeEditPanel.d.vue.ts +13 -0
- package/dist/components/NodeEditPanel.vue +214 -0
- package/dist/components/NodeEditPanel.vue.d.ts +13 -0
- package/dist/components/edges/BaseEdge.d.vue.ts +23 -0
- package/dist/components/edges/BaseEdge.vue +55 -0
- package/dist/components/edges/BaseEdge.vue.d.ts +23 -0
- package/dist/components/edges/BezierEdge.d.vue.ts +22 -0
- package/dist/components/edges/BezierEdge.vue +57 -0
- package/dist/components/edges/BezierEdge.vue.d.ts +22 -0
- package/dist/components/edges/DataFlowEdge.d.vue.ts +41 -0
- package/dist/components/edges/DataFlowEdge.vue +211 -0
- package/dist/components/edges/DataFlowEdge.vue.d.ts +41 -0
- package/dist/components/edges/SmoothEdge.d.vue.ts +22 -0
- package/dist/components/edges/SmoothEdge.vue +53 -0
- package/dist/components/edges/SmoothEdge.vue.d.ts +22 -0
- package/dist/components/edges/StepEdge.d.vue.ts +22 -0
- package/dist/components/edges/StepEdge.vue +42 -0
- package/dist/components/edges/StepEdge.vue.d.ts +22 -0
- package/dist/components/edges/index.cjs +41 -0
- package/dist/components/edges/index.d.ts +5 -0
- package/dist/components/edges/index.mjs +5 -0
- package/dist/components/nodes/BaseNode.d.vue.ts +25 -0
- package/dist/components/nodes/BaseNode.vue +93 -0
- package/dist/components/nodes/BaseNode.vue.d.ts +25 -0
- package/dist/components/nodes/CustomNode.d.vue.ts +36 -0
- package/dist/components/nodes/CustomNode.vue +44 -0
- package/dist/components/nodes/CustomNode.vue.d.ts +36 -0
- package/dist/components/nodes/DatabaseNode.d.vue.ts +19 -0
- package/dist/components/nodes/DatabaseNode.vue +62 -0
- package/dist/components/nodes/DatabaseNode.vue.d.ts +19 -0
- package/dist/components/nodes/DiamondNode.d.vue.ts +19 -0
- package/dist/components/nodes/DiamondNode.vue +62 -0
- package/dist/components/nodes/DiamondNode.vue.d.ts +19 -0
- package/dist/components/nodes/GroupNode.d.vue.ts +31 -0
- package/dist/components/nodes/GroupNode.vue +48 -0
- package/dist/components/nodes/GroupNode.vue.d.ts +31 -0
- package/dist/components/nodes/InputNode.d.vue.ts +23 -0
- package/dist/components/nodes/InputNode.vue +63 -0
- package/dist/components/nodes/InputNode.vue.d.ts +23 -0
- package/dist/components/nodes/NodeResizer.d.vue.ts +27 -0
- package/dist/components/nodes/NodeResizer.vue +89 -0
- package/dist/components/nodes/NodeResizer.vue.d.ts +27 -0
- package/dist/components/nodes/NodeToolbar.d.vue.ts +32 -0
- package/dist/components/nodes/NodeToolbar.vue +101 -0
- package/dist/components/nodes/NodeToolbar.vue.d.ts +32 -0
- package/dist/components/nodes/OutputNode.d.vue.ts +21 -0
- package/dist/components/nodes/OutputNode.vue +53 -0
- package/dist/components/nodes/OutputNode.vue.d.ts +21 -0
- package/dist/components/nodes/ai-workflow/AiAgentNode.d.vue.ts +20 -0
- package/dist/components/nodes/ai-workflow/AiAgentNode.vue +59 -0
- package/dist/components/nodes/ai-workflow/AiAgentNode.vue.d.ts +20 -0
- package/dist/components/nodes/ai-workflow/AiConditionNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiConditionNode.vue +65 -0
- package/dist/components/nodes/ai-workflow/AiConditionNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiEndNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiEndNode.vue +47 -0
- package/dist/components/nodes/ai-workflow/AiEndNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiLlmNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiLlmNode.vue +64 -0
- package/dist/components/nodes/ai-workflow/AiLlmNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiMemoryNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiMemoryNode.vue +59 -0
- package/dist/components/nodes/ai-workflow/AiMemoryNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiPromptNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiPromptNode.vue +61 -0
- package/dist/components/nodes/ai-workflow/AiPromptNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiStartNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiStartNode.vue +47 -0
- package/dist/components/nodes/ai-workflow/AiStartNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiToolNode.d.vue.ts +19 -0
- package/dist/components/nodes/ai-workflow/AiToolNode.vue +59 -0
- package/dist/components/nodes/ai-workflow/AiToolNode.vue.d.ts +19 -0
- package/dist/components/nodes/ai-workflow/index.cjs +109 -0
- package/dist/components/nodes/ai-workflow/index.d.ts +23 -0
- package/dist/components/nodes/ai-workflow/index.mjs +37 -0
- package/dist/components/nodes/bpmn/BpmnEndEvent.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnEndEvent.vue +50 -0
- package/dist/components/nodes/bpmn/BpmnEndEvent.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnExclusiveGateway.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnExclusiveGateway.vue +60 -0
- package/dist/components/nodes/bpmn/BpmnExclusiveGateway.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnInclusiveGateway.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnInclusiveGateway.vue +60 -0
- package/dist/components/nodes/bpmn/BpmnInclusiveGateway.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnParallelGateway.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnParallelGateway.vue +60 -0
- package/dist/components/nodes/bpmn/BpmnParallelGateway.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnServiceTask.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnServiceTask.vue +55 -0
- package/dist/components/nodes/bpmn/BpmnServiceTask.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnStartEvent.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnStartEvent.vue +50 -0
- package/dist/components/nodes/bpmn/BpmnStartEvent.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnTask.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnTask.vue +54 -0
- package/dist/components/nodes/bpmn/BpmnTask.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnUserTask.d.vue.ts +19 -0
- package/dist/components/nodes/bpmn/BpmnUserTask.vue +55 -0
- package/dist/components/nodes/bpmn/BpmnUserTask.vue.d.ts +19 -0
- package/dist/components/nodes/bpmn/index.cjs +109 -0
- package/dist/components/nodes/bpmn/index.d.ts +23 -0
- package/dist/components/nodes/bpmn/index.mjs +37 -0
- package/dist/components/nodes/index.cjs +246 -0
- package/dist/components/nodes/index.d.ts +13 -0
- package/dist/components/nodes/index.mjs +44 -0
- package/dist/core/FlowContext.cjs +21 -0
- package/dist/core/FlowContext.d.ts +10 -0
- package/dist/core/FlowContext.mjs +13 -0
- package/dist/core/index.cjs +104 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.mjs +9 -0
- package/dist/core/useAlignment.cjs +81 -0
- package/dist/core/useAlignment.d.ts +33 -0
- package/dist/core/useAlignment.mjs +71 -0
- package/dist/core/useEdges.cjs +132 -0
- package/dist/core/useEdges.d.ts +29 -0
- package/dist/core/useEdges.mjs +89 -0
- package/dist/core/useFlow.cjs +40 -0
- package/dist/core/useFlow.d.ts +31 -0
- package/dist/core/useFlow.mjs +32 -0
- package/dist/core/useHistory.cjs +63 -0
- package/dist/core/useHistory.d.ts +15 -0
- package/dist/core/useHistory.mjs +54 -0
- package/dist/core/useKeyboard.cjs +54 -0
- package/dist/core/useKeyboard.d.ts +18 -0
- package/dist/core/useKeyboard.mjs +45 -0
- package/dist/core/useNodeDistribution.cjs +171 -0
- package/dist/core/useNodeDistribution.d.ts +12 -0
- package/dist/core/useNodeDistribution.mjs +145 -0
- package/dist/core/useNodes.cjs +146 -0
- package/dist/core/useNodes.d.ts +26 -0
- package/dist/core/useNodes.mjs +101 -0
- package/dist/core/useSelection.cjs +83 -0
- package/dist/core/useSelection.d.ts +18 -0
- package/dist/core/useSelection.mjs +53 -0
- package/dist/core/useViewport.cjs +157 -0
- package/dist/core/useViewport.d.ts +65 -0
- package/dist/core/useViewport.mjs +125 -0
- package/dist/flow.cjs +240 -0
- package/dist/flow.d.ts +276 -0
- package/dist/flow.mjs +230 -0
- package/dist/index.cjs +378 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.mjs +50 -0
- package/dist/plugins/index.cjs +96 -0
- package/dist/plugins/index.d.ts +34 -0
- package/dist/plugins/index.mjs +47 -0
- package/dist/plugins/plugin.cjs +117 -0
- package/dist/plugins/plugin.d.ts +72 -0
- package/dist/plugins/plugin.mjs +110 -0
- package/dist/plugins/plugins/controls.cjs +38 -0
- package/dist/plugins/plugins/controls.d.ts +12 -0
- package/dist/plugins/plugins/controls.mjs +28 -0
- package/dist/plugins/plugins/export.cjs +102 -0
- package/dist/plugins/plugins/export.d.ts +12 -0
- package/dist/plugins/plugins/export.mjs +89 -0
- package/dist/plugins/plugins/grid.cjs +36 -0
- package/dist/plugins/plugins/grid.d.ts +11 -0
- package/dist/plugins/plugins/grid.mjs +26 -0
- package/dist/plugins/plugins/history.cjs +140 -0
- package/dist/plugins/plugins/history.d.ts +53 -0
- package/dist/plugins/plugins/history.mjs +132 -0
- package/dist/plugins/plugins/index.cjs +104 -0
- package/dist/plugins/plugins/index.d.ts +9 -0
- package/dist/plugins/plugins/index.mjs +9 -0
- package/dist/plugins/plugins/keyboard.cjs +27 -0
- package/dist/plugins/plugins/keyboard.d.ts +10 -0
- package/dist/plugins/plugins/keyboard.mjs +18 -0
- package/dist/plugins/plugins/layout.cjs +275 -0
- package/dist/plugins/plugins/layout.d.ts +34 -0
- package/dist/plugins/plugins/layout.mjs +246 -0
- package/dist/plugins/plugins/minimap.cjs +60 -0
- package/dist/plugins/plugins/minimap.d.ts +25 -0
- package/dist/plugins/plugins/minimap.mjs +50 -0
- package/dist/plugins/plugins/node-group.cjs +209 -0
- package/dist/plugins/plugins/node-group.d.ts +26 -0
- package/dist/plugins/plugins/node-group.mjs +178 -0
- package/dist/plugins/plugins/snap.cjs +36 -0
- package/dist/plugins/plugins/snap.d.ts +12 -0
- package/dist/plugins/plugins/snap.mjs +26 -0
- package/dist/renderer/AlignmentLines.d.vue.ts +5 -0
- package/dist/renderer/AlignmentLines.vue +113 -0
- package/dist/renderer/AlignmentLines.vue.d.ts +5 -0
- package/dist/renderer/Background.d.vue.ts +7 -0
- package/dist/renderer/Background.vue +86 -0
- package/dist/renderer/Background.vue.d.ts +7 -0
- package/dist/renderer/Controls.d.vue.ts +13 -0
- package/dist/renderer/Controls.vue +82 -0
- package/dist/renderer/Controls.vue.d.ts +13 -0
- package/dist/renderer/EdgeHandlesRenderer.d.vue.ts +11 -0
- package/dist/renderer/EdgeHandlesRenderer.vue +75 -0
- package/dist/renderer/EdgeHandlesRenderer.vue.d.ts +11 -0
- package/dist/renderer/EdgeRenderer.d.vue.ts +39 -0
- package/dist/renderer/EdgeRenderer.vue +204 -0
- package/dist/renderer/EdgeRenderer.vue.d.ts +39 -0
- package/dist/renderer/FlowBackground.d.vue.ts +11 -0
- package/dist/renderer/FlowBackground.vue +82 -0
- package/dist/renderer/FlowBackground.vue.d.ts +11 -0
- package/dist/renderer/Minimap.d.vue.ts +30 -0
- package/dist/renderer/Minimap.vue +290 -0
- package/dist/renderer/Minimap.vue.d.ts +30 -0
- package/dist/renderer/NodeRenderer.d.vue.ts +56 -0
- package/dist/renderer/NodeRenderer.vue +328 -0
- package/dist/renderer/NodeRenderer.vue.d.ts +56 -0
- package/dist/renderer/SelectionBox.d.vue.ts +11 -0
- package/dist/renderer/SelectionBox.vue +28 -0
- package/dist/renderer/SelectionBox.vue.d.ts +11 -0
- package/dist/types/edge.cjs +13 -0
- package/dist/types/edge.d.ts +65 -0
- package/dist/types/edge.mjs +6 -0
- package/dist/types/events.cjs +1 -0
- package/dist/types/events.d.ts +115 -0
- package/dist/types/events.mjs +0 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.ts +366 -0
- package/dist/types/index.mjs +0 -0
- package/dist/types/node.cjs +9 -0
- package/dist/types/node.d.ts +90 -0
- package/dist/types/node.mjs +3 -0
- package/dist/types/viewport.cjs +42 -0
- package/dist/types/viewport.d.ts +62 -0
- package/dist/types/viewport.mjs +36 -0
- package/dist/utils/bpmn-engine.cjs +390 -0
- package/dist/utils/bpmn-engine.d.ts +164 -0
- package/dist/utils/bpmn-engine.mjs +378 -0
- package/dist/utils/bpmn.cjs +492 -0
- package/dist/utils/bpmn.d.ts +53 -0
- package/dist/utils/bpmn.mjs +430 -0
- package/dist/utils/collaboration.cjs +537 -0
- package/dist/utils/collaboration.d.ts +189 -0
- package/dist/utils/collaboration.mjs +521 -0
- package/dist/utils/custom-types.cjs +138 -0
- package/dist/utils/custom-types.d.ts +78 -0
- package/dist/utils/custom-types.mjs +108 -0
- package/dist/utils/edge.cjs +235 -0
- package/dist/utils/edge.d.ts +79 -0
- package/dist/utils/edge.mjs +172 -0
- package/dist/utils/event-bus.cjs +91 -0
- package/dist/utils/event-bus.d.ts +39 -0
- package/dist/utils/event-bus.mjs +82 -0
- package/dist/utils/geometry.cjs +178 -0
- package/dist/utils/geometry.d.ts +186 -0
- package/dist/utils/geometry.mjs +144 -0
- package/dist/utils/graph.cjs +158 -0
- package/dist/utils/graph.d.ts +40 -0
- package/dist/utils/graph.mjs +147 -0
- package/dist/utils/index.cjs +137 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.mjs +12 -0
- package/dist/utils/performance.cjs +94 -0
- package/dist/utils/performance.d.ts +18 -0
- package/dist/utils/performance.mjs +82 -0
- package/dist/utils/screenshot.cjs +87 -0
- package/dist/utils/screenshot.d.ts +22 -0
- package/dist/utils/screenshot.mjs +66 -0
- package/dist/utils/theme.cjs +228 -0
- package/dist/utils/theme.d.ts +92 -0
- package/dist/utils/theme.mjs +217 -0
- package/dist/utils/transform.cjs +76 -0
- package/dist/utils/transform.d.ts +45 -0
- package/dist/utils/transform.mjs +57 -0
- package/dist/utils/validation.cjs +107 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.mjs +85 -0
- package/package.json +61 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!--
|
|
3
|
+
★ 性能优化背景:
|
|
4
|
+
- 不依赖 Vue 响应式,改由父组件手动调用 update(viewport) 驱动
|
|
5
|
+
- SVG pattern:只改 x/y/width/height 属性,浏览器不需要重绘
|
|
6
|
+
-->
|
|
7
|
+
<svg ref="svgRef" class="yh-flow-background" xmlns="http://www.w3.org/2000/svg">
|
|
8
|
+
<defs>
|
|
9
|
+
<pattern
|
|
10
|
+
ref="patternRef"
|
|
11
|
+
:id="patternId"
|
|
12
|
+
x="0"
|
|
13
|
+
y="0"
|
|
14
|
+
:width="patternSize"
|
|
15
|
+
:height="patternSize"
|
|
16
|
+
patternUnits="userSpaceOnUse"
|
|
17
|
+
>
|
|
18
|
+
<template v-if="type === 'dots'">
|
|
19
|
+
<circle
|
|
20
|
+
ref="dotRef"
|
|
21
|
+
:cx="patternSize / 2"
|
|
22
|
+
:cy="patternSize / 2"
|
|
23
|
+
r="1"
|
|
24
|
+
:fill="color || '#b1b1b7'"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
<template v-else-if="type === 'grid'">
|
|
28
|
+
<path
|
|
29
|
+
ref="gridPathRef"
|
|
30
|
+
:d="`M ${patternSize} 0 L 0 0 0 ${patternSize}`"
|
|
31
|
+
fill="none"
|
|
32
|
+
:stroke="color || '#e5e7eb'"
|
|
33
|
+
stroke-width="0.5"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
36
|
+
</pattern>
|
|
37
|
+
</defs>
|
|
38
|
+
<rect width="100%" height="100%" :fill="`url(#${patternId})`" />
|
|
39
|
+
</svg>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { ref, getCurrentInstance } from "vue";
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
type: { type: String, required: false },
|
|
46
|
+
color: { type: String, required: false },
|
|
47
|
+
gap: { type: Number, required: false }
|
|
48
|
+
});
|
|
49
|
+
const uid = getCurrentInstance()?.uid ?? Math.random().toString(36).slice(2);
|
|
50
|
+
const patternId = `yh-bg-pattern-${uid}`;
|
|
51
|
+
const svgRef = ref();
|
|
52
|
+
const patternRef = ref();
|
|
53
|
+
const dotRef = ref();
|
|
54
|
+
const gridPathRef = ref();
|
|
55
|
+
const INITIAL_GAP = props.gap || 20;
|
|
56
|
+
const patternSize = INITIAL_GAP;
|
|
57
|
+
function updateViewport(t) {
|
|
58
|
+
const pattern = patternRef.value;
|
|
59
|
+
if (!pattern) return;
|
|
60
|
+
const gap = props.gap || 20;
|
|
61
|
+
const scaledGap = gap * t.zoom;
|
|
62
|
+
const ox = t.x % scaledGap;
|
|
63
|
+
const oy = t.y % scaledGap;
|
|
64
|
+
pattern.setAttribute("x", String(ox));
|
|
65
|
+
pattern.setAttribute("y", String(oy));
|
|
66
|
+
pattern.setAttribute("width", String(scaledGap));
|
|
67
|
+
pattern.setAttribute("height", String(scaledGap));
|
|
68
|
+
if (props.type === "dots" && dotRef.value) {
|
|
69
|
+
const half = scaledGap / 2;
|
|
70
|
+
dotRef.value.setAttribute("cx", String(half));
|
|
71
|
+
dotRef.value.setAttribute("cy", String(half));
|
|
72
|
+
dotRef.value.setAttribute("r", String(Math.max(0.8, 1.5 * t.zoom)));
|
|
73
|
+
} else if (props.type === "grid" && gridPathRef.value) {
|
|
74
|
+
gridPathRef.value.setAttribute("d", `M ${scaledGap} 0 L 0 0 0 ${scaledGap}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
defineExpose({ updateViewport });
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<style scoped>
|
|
81
|
+
.yh-flow-background{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}
|
|
82
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ViewportTransform } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
type?: 'dots' | 'grid';
|
|
4
|
+
color?: string;
|
|
5
|
+
gap?: number;
|
|
6
|
+
};
|
|
7
|
+
declare function updateViewport(t: ViewportTransform): void;
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
updateViewport: typeof updateViewport;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Node } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
nodeColor?: string | ((node: Node) => string);
|
|
4
|
+
nodeStrokeColor?: string | ((node: Node) => string);
|
|
5
|
+
nodeStrokeWidth?: number;
|
|
6
|
+
maskColor?: string;
|
|
7
|
+
maskStrokeColor?: string;
|
|
8
|
+
maskStrokeWidth?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
12
|
+
pannable?: boolean;
|
|
13
|
+
zoomable?: boolean;
|
|
14
|
+
/** Enable interactive click-to-navigate */
|
|
15
|
+
interactive?: boolean;
|
|
16
|
+
/** Show layout control buttons */
|
|
17
|
+
showLayoutControls?: boolean;
|
|
18
|
+
/** Current layout type */
|
|
19
|
+
layoutType?: 'dagre' | 'elk' | 'force' | 'grid' | 'none';
|
|
20
|
+
/** Layout direction */
|
|
21
|
+
layoutDirection?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
24
|
+
layoutChange: (layout: "none" | "dagre" | "elk" | "force" | "grid") => any;
|
|
25
|
+
directionChange: (direction: "TB" | "BT" | "LR" | "RL") => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onLayoutChange?: ((layout: "none" | "dagre" | "elk" | "force" | "grid") => any) | undefined;
|
|
28
|
+
onDirectionChange?: ((direction: "TB" | "BT" | "LR" | "RL") => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="yh-flow-minimap"
|
|
4
|
+
:class="[position]"
|
|
5
|
+
:style="{
|
|
6
|
+
width: cW + 'px',
|
|
7
|
+
height: cH + 'px'
|
|
8
|
+
}"
|
|
9
|
+
@mousedown.stop="handleMouseDown"
|
|
10
|
+
>
|
|
11
|
+
<!-- Canvas:绘制节点+连线(静态部分,节点变化才重绘) -->
|
|
12
|
+
<canvas ref="canvasRef" :width="cW" :height="cH" class="yh-flow-minimap__canvas" />
|
|
13
|
+
<!-- SVG:视口框 -->
|
|
14
|
+
<svg
|
|
15
|
+
ref="svgRef"
|
|
16
|
+
class="yh-flow-minimap__vp"
|
|
17
|
+
:width="cW"
|
|
18
|
+
:height="cH"
|
|
19
|
+
:viewBox="`0 0 ${cW} ${cH}`"
|
|
20
|
+
:style="{
|
|
21
|
+
background: props.maskColor || 'transparent'
|
|
22
|
+
}"
|
|
23
|
+
>
|
|
24
|
+
<rect
|
|
25
|
+
ref="vpRectEl"
|
|
26
|
+
x="0"
|
|
27
|
+
y="0"
|
|
28
|
+
width="20"
|
|
29
|
+
height="20"
|
|
30
|
+
:fill="props.maskColor || 'rgba(59,130,246,0.08)'"
|
|
31
|
+
:stroke="props.maskStrokeColor || '#3b82f6'"
|
|
32
|
+
:stroke-width="props.maskStrokeWidth || 1.2"
|
|
33
|
+
rx="2"
|
|
34
|
+
class="yh-flow-minimap__rect"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
|
|
38
|
+
<!-- Layout Controls (optional) -->
|
|
39
|
+
<div v-if="props.showLayoutControls" class="yh-flow-minimap__layout-controls">
|
|
40
|
+
<button
|
|
41
|
+
class="layout-btn"
|
|
42
|
+
:class="{
|
|
43
|
+
active: props.layoutType === 'dagre'
|
|
44
|
+
}"
|
|
45
|
+
title="Dagre Layout"
|
|
46
|
+
@click.stop="emit('layoutChange', 'dagre')"
|
|
47
|
+
>
|
|
48
|
+
D
|
|
49
|
+
</button>
|
|
50
|
+
<button
|
|
51
|
+
class="layout-btn"
|
|
52
|
+
:class="{
|
|
53
|
+
active: props.layoutType === 'elk'
|
|
54
|
+
}"
|
|
55
|
+
title="ELK Layout"
|
|
56
|
+
@click.stop="emit('layoutChange', 'elk')"
|
|
57
|
+
>
|
|
58
|
+
E
|
|
59
|
+
</button>
|
|
60
|
+
<button
|
|
61
|
+
class="layout-btn"
|
|
62
|
+
:class="{
|
|
63
|
+
active: props.layoutType === 'force'
|
|
64
|
+
}"
|
|
65
|
+
title="Force Layout"
|
|
66
|
+
@click.stop="emit('layoutChange', 'force')"
|
|
67
|
+
>
|
|
68
|
+
F
|
|
69
|
+
</button>
|
|
70
|
+
<button
|
|
71
|
+
class="layout-btn"
|
|
72
|
+
:class="{
|
|
73
|
+
active: props.layoutDirection === 'TB'
|
|
74
|
+
}"
|
|
75
|
+
title="Top to Bottom"
|
|
76
|
+
@click.stop="emit('directionChange', 'TB')"
|
|
77
|
+
>
|
|
78
|
+
TB
|
|
79
|
+
</button>
|
|
80
|
+
<button
|
|
81
|
+
class="layout-btn"
|
|
82
|
+
:class="{
|
|
83
|
+
active: props.layoutDirection === 'LR'
|
|
84
|
+
}"
|
|
85
|
+
title="Left to Right"
|
|
86
|
+
@click.stop="emit('directionChange', 'LR')"
|
|
87
|
+
>
|
|
88
|
+
LR
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script setup>
|
|
95
|
+
import { ref, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
|
96
|
+
import { useFlowContext } from "../core/FlowContext";
|
|
97
|
+
const props = defineProps({
|
|
98
|
+
nodeColor: { type: [String, Function], required: false },
|
|
99
|
+
nodeStrokeColor: { type: [String, Function], required: false },
|
|
100
|
+
nodeStrokeWidth: { type: Number, required: false },
|
|
101
|
+
maskColor: { type: String, required: false },
|
|
102
|
+
maskStrokeColor: { type: String, required: false },
|
|
103
|
+
maskStrokeWidth: { type: Number, required: false },
|
|
104
|
+
width: { type: Number, required: false },
|
|
105
|
+
height: { type: Number, required: false },
|
|
106
|
+
position: { type: String, required: false },
|
|
107
|
+
pannable: { type: Boolean, required: false },
|
|
108
|
+
zoomable: { type: Boolean, required: false },
|
|
109
|
+
interactive: { type: Boolean, required: false },
|
|
110
|
+
showLayoutControls: { type: Boolean, required: false },
|
|
111
|
+
layoutType: { type: String, required: false },
|
|
112
|
+
layoutDirection: { type: String, required: false }
|
|
113
|
+
});
|
|
114
|
+
const emit = defineEmits(["layoutChange", "directionChange"]);
|
|
115
|
+
const cW = computed(() => props.width || 200);
|
|
116
|
+
const cH = computed(() => props.height || 150);
|
|
117
|
+
const canvasRef = ref();
|
|
118
|
+
const vpRectEl = ref();
|
|
119
|
+
const flowInstance = useFlowContext();
|
|
120
|
+
const nodes = flowInstance.nodes;
|
|
121
|
+
const edges = flowInstance.edges;
|
|
122
|
+
const viewport = flowInstance.viewport;
|
|
123
|
+
let _mapScale = 1;
|
|
124
|
+
let _minX = 0;
|
|
125
|
+
let _minY = 0;
|
|
126
|
+
let _offsetX = 0;
|
|
127
|
+
let _offsetY = 0;
|
|
128
|
+
const computeGraphBounds = () => {
|
|
129
|
+
const currentNodes = nodes.value;
|
|
130
|
+
if (!currentNodes.length) return { minX: 0, minY: 0, maxX: 1, maxY: 1 };
|
|
131
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
132
|
+
for (let i = 0; i < currentNodes.length; i++) {
|
|
133
|
+
const n = currentNodes[i];
|
|
134
|
+
if (n.hidden) continue;
|
|
135
|
+
const nw = n.width || 120;
|
|
136
|
+
const nh = n.height || 50;
|
|
137
|
+
if (n.position.x < minX) minX = n.position.x;
|
|
138
|
+
if (n.position.y < minY) minY = n.position.y;
|
|
139
|
+
if (n.position.x + nw > maxX) maxX = n.position.x + nw;
|
|
140
|
+
if (n.position.y + nh > maxY) maxY = n.position.y + nh;
|
|
141
|
+
}
|
|
142
|
+
if (minX === Infinity) return { minX: 0, minY: 0, maxX: 1, maxY: 1 };
|
|
143
|
+
return { minX, minY, maxX, maxY };
|
|
144
|
+
};
|
|
145
|
+
const toMX = (x) => (x - _minX) * _mapScale + _offsetX;
|
|
146
|
+
const toMY = (y) => (y - _minY) * _mapScale + _offsetY;
|
|
147
|
+
const drawCanvas = () => {
|
|
148
|
+
const canvas = canvasRef.value;
|
|
149
|
+
if (!canvas) return;
|
|
150
|
+
const ctx = canvas.getContext("2d", { alpha: true });
|
|
151
|
+
if (!ctx) return;
|
|
152
|
+
const b = computeGraphBounds();
|
|
153
|
+
_minX = b.minX;
|
|
154
|
+
_minY = b.minY;
|
|
155
|
+
const gW = b.maxX - b.minX || 1;
|
|
156
|
+
const gH = b.maxY - b.minY || 1;
|
|
157
|
+
const pad = 4;
|
|
158
|
+
_mapScale = Math.min((cW.value - pad * 2) / gW, (cH.value - pad * 2) / gH);
|
|
159
|
+
_offsetX = (cW.value - gW * _mapScale) / 2;
|
|
160
|
+
_offsetY = (cH.value - gH * _mapScale) / 2;
|
|
161
|
+
ctx.clearRect(0, 0, cW.value, cH.value);
|
|
162
|
+
if (!nodes.value.length) {
|
|
163
|
+
updateVpRect(viewport.value);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
167
|
+
nodes.value.forEach((n) => nodeMap.set(n.id, n));
|
|
168
|
+
const rootStyles = getComputedStyle(canvas);
|
|
169
|
+
const themeEdgeColor = rootStyles.getPropertyValue("--flow-edge-stroke").trim() || "#94a3b8";
|
|
170
|
+
const themeMinimapNodeColor = rootStyles.getPropertyValue("--flow-minimap-node-color").trim() || "#cbd5e1";
|
|
171
|
+
const themeAccentColor = rootStyles.getPropertyValue("--flow-node-selected-border").trim() || "#3b82f6";
|
|
172
|
+
ctx.strokeStyle = themeEdgeColor;
|
|
173
|
+
ctx.lineWidth = 1.2;
|
|
174
|
+
ctx.globalAlpha = 0.5;
|
|
175
|
+
ctx.beginPath();
|
|
176
|
+
edges.value.forEach((e) => {
|
|
177
|
+
if (e.hidden) return;
|
|
178
|
+
const src = nodeMap.get(e.source);
|
|
179
|
+
const tgt = nodeMap.get(e.target);
|
|
180
|
+
if (!src || !tgt) return;
|
|
181
|
+
ctx.moveTo(
|
|
182
|
+
toMX(src.position.x + (src.width || 120) / 2),
|
|
183
|
+
toMY(src.position.y + (src.height || 50) / 2)
|
|
184
|
+
);
|
|
185
|
+
ctx.lineTo(
|
|
186
|
+
toMX(tgt.position.x + (tgt.width || 120) / 2),
|
|
187
|
+
toMY(tgt.position.y + (tgt.height || 50) / 2)
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
ctx.stroke();
|
|
191
|
+
ctx.globalAlpha = 0.85;
|
|
192
|
+
nodes.value.forEach((n) => {
|
|
193
|
+
if (n.hidden) return;
|
|
194
|
+
let color = n.selected ? themeAccentColor : themeMinimapNodeColor;
|
|
195
|
+
if (!n.selected && props.nodeColor) {
|
|
196
|
+
color = typeof props.nodeColor === "function" ? props.nodeColor(n) : props.nodeColor;
|
|
197
|
+
}
|
|
198
|
+
ctx.fillStyle = color;
|
|
199
|
+
const nw = Math.max((n.width || 120) * _mapScale, 3);
|
|
200
|
+
const nh = Math.max((n.height || 50) * _mapScale, 3);
|
|
201
|
+
const nx = toMX(n.position.x);
|
|
202
|
+
const ny = toMY(n.position.y);
|
|
203
|
+
ctx.fillRect(nx, ny, nw, nh);
|
|
204
|
+
if (props.nodeStrokeWidth || props.nodeStrokeColor) {
|
|
205
|
+
let strokeColor = "#94a3b8";
|
|
206
|
+
if (props.nodeStrokeColor) {
|
|
207
|
+
strokeColor = typeof props.nodeStrokeColor === "function" ? props.nodeStrokeColor(n) : props.nodeStrokeColor;
|
|
208
|
+
}
|
|
209
|
+
ctx.strokeStyle = strokeColor;
|
|
210
|
+
ctx.lineWidth = props.nodeStrokeWidth || 0.5;
|
|
211
|
+
ctx.strokeRect(nx, ny, nw, nh);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
ctx.globalAlpha = 1;
|
|
215
|
+
updateVpRect(viewport.value);
|
|
216
|
+
};
|
|
217
|
+
const updateVpRect = (vp) => {
|
|
218
|
+
const el = vpRectEl.value;
|
|
219
|
+
if (!el || !_mapScale) return;
|
|
220
|
+
const container = flowInstance.$el;
|
|
221
|
+
const containerW = container?.clientWidth || 800;
|
|
222
|
+
const containerH = container?.clientHeight || 600;
|
|
223
|
+
const canvasLeft = -vp.x / vp.zoom;
|
|
224
|
+
const canvasTop = -vp.y / vp.zoom;
|
|
225
|
+
const canvasW = containerW / vp.zoom;
|
|
226
|
+
const canvasH = containerH / vp.zoom;
|
|
227
|
+
const rx = (canvasLeft - _minX) * _mapScale + _offsetX;
|
|
228
|
+
const ry = (canvasTop - _minY) * _mapScale + _offsetY;
|
|
229
|
+
const rw = Math.max(canvasW * _mapScale, 2);
|
|
230
|
+
const rh = Math.max(canvasH * _mapScale, 2);
|
|
231
|
+
el.setAttribute("x", String(rx));
|
|
232
|
+
el.setAttribute("y", String(ry));
|
|
233
|
+
el.setAttribute("width", String(rw));
|
|
234
|
+
el.setAttribute("height", String(rh));
|
|
235
|
+
};
|
|
236
|
+
let isDragging = false;
|
|
237
|
+
const handleMouseMove = (e) => {
|
|
238
|
+
if (!isDragging || props.pannable === false) return;
|
|
239
|
+
const rect = canvasRef.value?.getBoundingClientRect();
|
|
240
|
+
if (!rect) return;
|
|
241
|
+
const mx = e.clientX - rect.left;
|
|
242
|
+
const my = e.clientY - rect.top;
|
|
243
|
+
const canvasX = (mx - _offsetX) / _mapScale + _minX;
|
|
244
|
+
const canvasY = (my - _offsetY) / _mapScale + _minY;
|
|
245
|
+
const zoom = viewport.value.zoom;
|
|
246
|
+
const container = flowInstance.$el;
|
|
247
|
+
const containerW = container?.clientWidth || 800;
|
|
248
|
+
const containerH = container?.clientHeight || 600;
|
|
249
|
+
const newX = containerW / 2 - canvasX * zoom;
|
|
250
|
+
const newY = containerH / 2 - canvasY * zoom;
|
|
251
|
+
flowInstance.setViewport({ x: newX, y: newY, zoom });
|
|
252
|
+
};
|
|
253
|
+
const handleMouseUp = () => {
|
|
254
|
+
isDragging = false;
|
|
255
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
256
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
257
|
+
};
|
|
258
|
+
const handleMouseDown = (e) => {
|
|
259
|
+
if (props.interactive && !isDragging) {
|
|
260
|
+
const rect = canvasRef.value?.getBoundingClientRect();
|
|
261
|
+
if (rect) {
|
|
262
|
+
const mx = e.clientX - rect.left;
|
|
263
|
+
const my = e.clientY - rect.top;
|
|
264
|
+
const canvasX = (mx - _offsetX) / _mapScale + _minX;
|
|
265
|
+
const canvasY = (my - _offsetY) / _mapScale + _minY;
|
|
266
|
+
const zoom = viewport.value.zoom;
|
|
267
|
+
const container = flowInstance.$el;
|
|
268
|
+
const containerW = container?.clientWidth || 800;
|
|
269
|
+
const containerH = container?.clientHeight || 600;
|
|
270
|
+
const newX = containerW / 2 - canvasX * zoom;
|
|
271
|
+
const newY = containerH / 2 - canvasY * zoom;
|
|
272
|
+
flowInstance.setViewport({ x: newX, y: newY, zoom });
|
|
273
|
+
}
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (props.pannable === false) return;
|
|
277
|
+
isDragging = true;
|
|
278
|
+
handleMouseMove(e);
|
|
279
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
280
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
281
|
+
};
|
|
282
|
+
onMounted(drawCanvas);
|
|
283
|
+
onBeforeUnmount(handleMouseUp);
|
|
284
|
+
watch([nodes, edges], drawCanvas, { deep: true, flush: "post" });
|
|
285
|
+
watch(viewport, (vp) => updateVpRect(vp), { flush: "sync" });
|
|
286
|
+
</script>
|
|
287
|
+
|
|
288
|
+
<style scoped>
|
|
289
|
+
.yh-flow-minimap{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:var(--flow-minimap-background,hsla(0,0%,100%,.75));border:1px solid var(--flow-minimap-viewport-border,rgba(0,0,0,.08));border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);cursor:crosshair;overflow:hidden;pointer-events:auto;position:absolute;transition:transform .2s cubic-bezier(.4,0,.2,1);z-index:10}.yh-flow-minimap:hover{transform:scale(1.02)}.yh-flow-minimap.bottom-right{bottom:16px;right:16px}.yh-flow-minimap.top-right{right:16px;top:16px}.yh-flow-minimap.bottom-left{bottom:16px;left:16px}.yh-flow-minimap.top-left{left:16px;top:16px}.yh-flow-minimap__canvas,.yh-flow-minimap__vp{display:block;left:0;position:absolute;top:0}.yh-flow-minimap__vp{pointer-events:none}.yh-flow-minimap__rect{filter:drop-shadow(0 0 2px rgba(59,130,246,.3));transition:all .1s ease-out}.yh-flow-minimap__layout-controls{background:hsla(0,0%,100%,.9);border-radius:4px;bottom:4px;box-shadow:0 1px 3px rgba(0,0,0,.1);display:flex;gap:2px;left:4px;padding:2px;position:absolute}.layout-btn{background:transparent;border:none;border-radius:2px;color:#64748b;cursor:pointer;font-size:9px;font-weight:600;height:18px;transition:all .15s;width:20px}.layout-btn:hover{background:rgba(59,130,246,.1);color:#3b82f6}.layout-btn.active{background:#3b82f6;color:#fff}
|
|
290
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Node } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
nodeColor?: string | ((node: Node) => string);
|
|
4
|
+
nodeStrokeColor?: string | ((node: Node) => string);
|
|
5
|
+
nodeStrokeWidth?: number;
|
|
6
|
+
maskColor?: string;
|
|
7
|
+
maskStrokeColor?: string;
|
|
8
|
+
maskStrokeWidth?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
12
|
+
pannable?: boolean;
|
|
13
|
+
zoomable?: boolean;
|
|
14
|
+
/** Enable interactive click-to-navigate */
|
|
15
|
+
interactive?: boolean;
|
|
16
|
+
/** Show layout control buttons */
|
|
17
|
+
showLayoutControls?: boolean;
|
|
18
|
+
/** Current layout type */
|
|
19
|
+
layoutType?: 'dagre' | 'elk' | 'force' | 'grid' | 'none';
|
|
20
|
+
/** Layout direction */
|
|
21
|
+
layoutDirection?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
24
|
+
layoutChange: (layout: "none" | "dagre" | "elk" | "force" | "grid") => any;
|
|
25
|
+
directionChange: (direction: "TB" | "BT" | "LR" | "RL") => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onLayoutChange?: ((layout: "none" | "dagre" | "elk" | "force" | "grid") => any) | undefined;
|
|
28
|
+
onDirectionChange?: ((direction: "TB" | "BT" | "LR" | "RL") => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Node, HandleType, NodeTypes } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
nodes: Node[];
|
|
4
|
+
nodeTypes?: NodeTypes;
|
|
5
|
+
transform: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
zoom: number;
|
|
9
|
+
};
|
|
10
|
+
draggable?: boolean;
|
|
11
|
+
connectable?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare var __VLS_1: {
|
|
15
|
+
node: any;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
node?: (props: typeof __VLS_1) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
"node-click": (event: MouseEvent, node: Node<import("../types").NodeData>) => any;
|
|
22
|
+
"node-dblclick": (event: MouseEvent, node: Node<import("../types").NodeData>) => any;
|
|
23
|
+
"node-contextmenu": (event: MouseEvent, node: Node<import("../types").NodeData>) => any;
|
|
24
|
+
"node-drag-start": (event: MouseEvent, node: Node<import("../types").NodeData>) => any;
|
|
25
|
+
"node-drag": (event: MouseEvent, node: Node<import("../types").NodeData>, position: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
}) => any;
|
|
29
|
+
"node-drag-end": (event: MouseEvent, node: Node<import("../types").NodeData>) => any;
|
|
30
|
+
"connect-start": (event: MouseEvent, nodeId: string, handleId: string, handleType: HandleType) => any;
|
|
31
|
+
"node-select-toggle": (nodeId: string) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
"onNode-click"?: ((event: MouseEvent, node: Node<import("../types").NodeData>) => any) | undefined;
|
|
34
|
+
"onNode-dblclick"?: ((event: MouseEvent, node: Node<import("../types").NodeData>) => any) | undefined;
|
|
35
|
+
"onNode-contextmenu"?: ((event: MouseEvent, node: Node<import("../types").NodeData>) => any) | undefined;
|
|
36
|
+
"onNode-drag-start"?: ((event: MouseEvent, node: Node<import("../types").NodeData>) => any) | undefined;
|
|
37
|
+
"onNode-drag"?: ((event: MouseEvent, node: Node<import("../types").NodeData>, position: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}) => any) | undefined;
|
|
41
|
+
"onNode-drag-end"?: ((event: MouseEvent, node: Node<import("../types").NodeData>) => any) | undefined;
|
|
42
|
+
"onConnect-start"?: ((event: MouseEvent, nodeId: string, handleId: string, handleType: HandleType) => any) | undefined;
|
|
43
|
+
"onNode-select-toggle"?: ((nodeId: string) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
draggable: boolean;
|
|
46
|
+
connectable: boolean;
|
|
47
|
+
nodeTypes: NodeTypes;
|
|
48
|
+
readonly: boolean;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|