@arronqzy/react-blueprint 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +5 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/aix-ppc64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-arm.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/darwin-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/darwin-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/freebsd-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/freebsd-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-arm.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-ia32.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-loong64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-mips64el.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-ppc64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-riscv64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-s390x.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/netbsd-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/openbsd-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/sunos-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-ia32.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-android-arm-eabi.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-android-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-darwin-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-darwin-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-freebsd-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-freebsd-x64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm64-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm64-musl.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-riscv64-musl.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-s390x-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-x64-gnu.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-x64-musl.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-arm64-msvc.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-ia32-msvc.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-x64-msvc.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/eslint.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/fsevents.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/react-dom.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/react-is.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-darwin-64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-darwin-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-linux-64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-linux-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-windows-64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/turbo-windows-arm64.json +1 -0
- package/.pnpm-cache/metadata/registry.npmjs.org/typescript.json +1 -0
- package/.turbo/turbo-lint.log +4 -0
- package/dist/assets/index-CneNgzWb.css +1 -0
- package/dist/assets/index-DsVhHV0-.js +226 -0
- package/dist/index.html +14 -0
- package/index.html +13 -0
- package/index.ts +70 -0
- package/package.json +43 -0
- package/postcss.config.cjs +6 -0
- package/src/BlueprintCanvasContext.tsx +61 -0
- package/src/BlueprintContextMenu.tsx +108 -0
- package/src/BlueprintNodeConfigSidebar.tsx +358 -0
- package/src/blueprint.css +321 -0
- package/src/blueprintNodeTypes.ts +20 -0
- package/src/components/BlueprintExecutionLogPanel.tsx +427 -0
- package/src/components/BlueprintLibrarySelect.tsx +68 -0
- package/src/components/BlueprintMetaDialog.tsx +96 -0
- package/src/components/BlueprintNodeSwitchTaskDialog.tsx +58 -0
- package/src/components/BlueprintPanelToolbar.tsx +664 -0
- package/src/components/ClockNodeConfigPanel.tsx +139 -0
- package/src/components/FetchNodeConfigPanel.tsx +716 -0
- package/src/components/FetchUrlAutocomplete.tsx +190 -0
- package/src/components/JsonNodeConfigPanel.tsx +79 -0
- package/src/components/LogicNodeConfigPanel.tsx +80 -0
- package/src/components/ViewElementMultiSelect.tsx +140 -0
- package/src/createBlueprintEdgeTypes.tsx +10 -0
- package/src/dev-seed.ts +34 -0
- package/src/dev.css +38 -0
- package/src/edges/BlueprintSmoothEdge.tsx +35 -0
- package/src/fetch-config-task-store.ts +197 -0
- package/src/flowCoordinates.ts +19 -0
- package/src/flowDefaults.ts +9 -0
- package/src/graph/blueprint-graph.ts +261 -0
- package/src/graph/document.ts +384 -0
- package/src/graph/index.ts +7 -0
- package/src/graph/node-summary.ts +88 -0
- package/src/graph/node-types.ts +9 -0
- package/src/graph/react-flow-adapter.ts +127 -0
- package/src/graph/sync-edges.ts +69 -0
- package/src/graph/sync-nodes.ts +104 -0
- package/src/hooks/useBlueprintDebugSession.ts +515 -0
- package/src/hooks/useBlueprintFlowColorMode.ts +8 -0
- package/src/hooks/useBlueprintFlowState.ts +486 -0
- package/src/hooks/useBlueprintFlowViewport.ts +54 -0
- package/src/hooks/useBlueprintNodeSelectionGuard.ts +63 -0
- package/src/hooks/useBlueprintPageLifecycle.ts +245 -0
- package/src/index.tsx +271 -0
- package/src/library/blueprint-io.ts +108 -0
- package/src/library/blueprint-library-db.ts +112 -0
- package/src/library/execution-log-db.ts +171 -0
- package/src/library/execution-log-settings.ts +50 -0
- package/src/library/swagger-docs.ts +56 -0
- package/src/library/types.ts +35 -0
- package/src/main.tsx +43 -0
- package/src/nodes/AndFlowNode.tsx +59 -0
- package/src/nodes/BlueprintFlowNode.tsx +26 -0
- package/src/nodes/BlueprintNodeCard.tsx +169 -0
- package/src/nodes/BlueprintNodeShell.tsx +45 -0
- package/src/nodes/ClockFlowNode.tsx +67 -0
- package/src/nodes/FetchFlowNode.tsx +26 -0
- package/src/nodes/JsonFlowNode.tsx +26 -0
- package/src/nodes/LifecycleFlowNode.tsx +44 -0
- package/src/nodes/LogicFlowNode.tsx +26 -0
- package/src/runtime/document-to-runnable-graph.ts +48 -0
- package/src/runtime/execution-overlay.ts +169 -0
- package/src/types.ts +1 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.ts +6 -0
- package/tsconfig.json +12 -0
- package/vite.config.ts +16 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/* 画布:与 panel / next-themes 主题一致 */
|
|
2
|
+
.bp-canvas,
|
|
3
|
+
[data-workspace-region="blueprint"] .bp-canvas {
|
|
4
|
+
background-color: hsl(var(--background));
|
|
5
|
+
color: hsl(var(--foreground));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.bp-canvas .react-flow__pane,
|
|
9
|
+
.bp-flow.react-flow__pane {
|
|
10
|
+
cursor: default;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.bp-canvas .react-flow,
|
|
14
|
+
.bp-flow.react-flow,
|
|
15
|
+
[data-workspace-region="blueprint"] .react-flow {
|
|
16
|
+
--xy-background-color: transparent;
|
|
17
|
+
--xy-edge-stroke: #2563eb;
|
|
18
|
+
--xy-edge-stroke-width: 2.5;
|
|
19
|
+
--xy-edge-stroke-selected: #1d4ed8;
|
|
20
|
+
--xy-connectionline-stroke: #2563eb;
|
|
21
|
+
--xy-connectionline-stroke-width: 2.5;
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* 全局 reset(apps/web style.css、Tailwind preflight)会给 svg 设 max-width:100%,
|
|
27
|
+
* 导致 React Flow 边线 SVG 坐标系被压扁;连线预览单独有 z-index:1001 所以能看见。
|
|
28
|
+
*/
|
|
29
|
+
.bp-canvas svg.react-flow__connectionline,
|
|
30
|
+
.bp-canvas .react-flow__edges svg,
|
|
31
|
+
.bp-flow svg.react-flow__connectionline,
|
|
32
|
+
.bp-flow .react-flow__edges svg,
|
|
33
|
+
[data-workspace-region="blueprint"] svg.react-flow__connectionline,
|
|
34
|
+
[data-workspace-region="blueprint"] .react-flow__edges svg {
|
|
35
|
+
display: block;
|
|
36
|
+
max-width: none !important;
|
|
37
|
+
max-height: none !important;
|
|
38
|
+
width: auto !important;
|
|
39
|
+
height: auto !important;
|
|
40
|
+
overflow: visible !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* 边层必须在节点之上:.react-flow__edges 与 .react-flow__nodes 为兄弟节点,
|
|
45
|
+
* 默认 DOM 顺序下节点后渲染会盖住边;连接线因有 z-index:1001 不受影响。
|
|
46
|
+
*/
|
|
47
|
+
.bp-canvas .react-flow__edges,
|
|
48
|
+
.bp-flow .react-flow__edges,
|
|
49
|
+
[data-workspace-region="blueprint"] .react-flow__edges {
|
|
50
|
+
z-index: 1000 !important;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bp-canvas .react-flow__nodes,
|
|
55
|
+
.bp-flow .react-flow__nodes,
|
|
56
|
+
[data-workspace-region="blueprint"] .react-flow__nodes {
|
|
57
|
+
z-index: 0 !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bp-canvas .react-flow__edge,
|
|
61
|
+
.bp-flow .react-flow__edge,
|
|
62
|
+
[data-workspace-region="blueprint"] .react-flow__edge {
|
|
63
|
+
pointer-events: visibleStroke;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 持久边 path:强制描边(覆盖 currentColor / 主题色) */
|
|
67
|
+
.bp-canvas .react-flow__edges path.react-flow__edge-path,
|
|
68
|
+
.bp-canvas .react-flow__edges path.bp-edge-visible,
|
|
69
|
+
.bp-flow .react-flow__edges path.react-flow__edge-path,
|
|
70
|
+
.bp-flow .react-flow__edges path.bp-edge-visible,
|
|
71
|
+
[data-workspace-region="blueprint"] .react-flow__edges path.react-flow__edge-path,
|
|
72
|
+
[data-workspace-region="blueprint"] .react-flow__edges path.bp-edge-visible {
|
|
73
|
+
fill: none !important;
|
|
74
|
+
stroke: #2563eb !important;
|
|
75
|
+
stroke-width: 2.5px !important;
|
|
76
|
+
opacity: 1 !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.bp-canvas .react-flow__edge.selected path.react-flow__edge-path,
|
|
80
|
+
.bp-flow .react-flow__edge.selected path.react-flow__edge-path,
|
|
81
|
+
[data-workspace-region="blueprint"] .react-flow__edge.selected path.react-flow__edge-path {
|
|
82
|
+
stroke: #1d4ed8 !important;
|
|
83
|
+
stroke-width: 3px !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path,
|
|
87
|
+
.bp-flow .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path,
|
|
88
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path {
|
|
89
|
+
stroke: #16a34a !important;
|
|
90
|
+
stroke-width: 3px !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path,
|
|
94
|
+
.bp-flow .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path,
|
|
95
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path {
|
|
96
|
+
stroke: #dc2626 !important;
|
|
97
|
+
stroke-width: 3px !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline,
|
|
101
|
+
.bp-flow .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline,
|
|
102
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline {
|
|
103
|
+
stroke: #16a34a;
|
|
104
|
+
fill: #16a34a;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline,
|
|
108
|
+
.bp-flow .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline,
|
|
109
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline {
|
|
110
|
+
stroke: #dc2626;
|
|
111
|
+
fill: #dc2626;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path,
|
|
115
|
+
.bp-flow .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path,
|
|
116
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path {
|
|
117
|
+
stroke: #2563eb !important;
|
|
118
|
+
stroke-width: 3px !important;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.bp-canvas .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline,
|
|
122
|
+
.bp-flow .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline,
|
|
123
|
+
[data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline {
|
|
124
|
+
stroke: #2563eb;
|
|
125
|
+
fill: #2563eb;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bp-canvas .react-flow__arrowhead polyline,
|
|
129
|
+
.bp-flow .react-flow__arrowhead polyline,
|
|
130
|
+
[data-workspace-region="blueprint"] .react-flow__arrowhead polyline {
|
|
131
|
+
stroke: #2563eb;
|
|
132
|
+
fill: #2563eb;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.bp-canvas .react-flow__connection-path,
|
|
136
|
+
.bp-flow .react-flow__connection-path,
|
|
137
|
+
[data-workspace-region="blueprint"] .react-flow__connection-path {
|
|
138
|
+
fill: none !important;
|
|
139
|
+
stroke: #2563eb !important;
|
|
140
|
+
stroke-width: 2.5px !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.bp-canvas .react-flow__edge-interaction,
|
|
144
|
+
.bp-flow .react-flow__edge-interaction,
|
|
145
|
+
[data-workspace-region="blueprint"] .react-flow__edge-interaction {
|
|
146
|
+
pointer-events: stroke;
|
|
147
|
+
stroke: transparent !important;
|
|
148
|
+
stroke-opacity: 0 !important;
|
|
149
|
+
stroke-width: 18px !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.bp-canvas .react-flow__edge.selected .react-flow__edge-interaction,
|
|
153
|
+
.bp-flow .react-flow__edge.selected .react-flow__edge-interaction,
|
|
154
|
+
[data-workspace-region="blueprint"] .react-flow__edge.selected .react-flow__edge-interaction {
|
|
155
|
+
pointer-events: stroke;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 节点容器:去掉默认包裹样式 */
|
|
159
|
+
.bp-canvas .react-flow__node,
|
|
160
|
+
.bp-flow .react-flow__node,
|
|
161
|
+
[data-workspace-region="blueprint"] .react-flow__node {
|
|
162
|
+
border: none;
|
|
163
|
+
background: transparent;
|
|
164
|
+
box-shadow: none;
|
|
165
|
+
padding: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* 连接点:禁止 transform,避免覆盖 React Flow 的 translate(-50%, -50%) 定位 */
|
|
169
|
+
.bp-canvas .react-flow__handle.bp-flow-handle,
|
|
170
|
+
.bp-flow .react-flow__handle.bp-flow-handle,
|
|
171
|
+
[data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle {
|
|
172
|
+
z-index: 3;
|
|
173
|
+
width: 10px;
|
|
174
|
+
height: 10px;
|
|
175
|
+
min-width: 10px;
|
|
176
|
+
min-height: 10px;
|
|
177
|
+
border: 2px solid hsl(var(--background));
|
|
178
|
+
border-radius: 9999px;
|
|
179
|
+
background: hsl(var(--muted-foreground) / 0.45);
|
|
180
|
+
transition:
|
|
181
|
+
background 0.15s ease,
|
|
182
|
+
border-color 0.15s ease,
|
|
183
|
+
box-shadow 0.15s ease;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.bp-canvas .react-flow__handle.bp-flow-handle:hover,
|
|
187
|
+
.bp-flow .react-flow__handle.bp-flow-handle:hover,
|
|
188
|
+
[data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle:hover {
|
|
189
|
+
background: hsl(var(--primary));
|
|
190
|
+
border-color: hsl(var(--background));
|
|
191
|
+
box-shadow: 0 0 0 3px hsl(var(--primary) / 0.28);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.bp-canvas .react-flow__handle.bp-flow-handle--target,
|
|
195
|
+
.bp-flow .react-flow__handle.bp-flow-handle--target,
|
|
196
|
+
[data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--target {
|
|
197
|
+
background: hsl(var(--muted-foreground) / 0.35);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.bp-canvas .react-flow__handle.bp-flow-handle--source,
|
|
201
|
+
.bp-flow .react-flow__handle.bp-flow-handle--source,
|
|
202
|
+
[data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--source {
|
|
203
|
+
background: hsl(var(--primary) / 0.55);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.bp-node--selected .bp-flow-handle {
|
|
207
|
+
border-color: hsl(var(--card));
|
|
208
|
+
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.35);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.bp-node--selected .bp-flow-handle--source {
|
|
212
|
+
background: hsl(var(--primary));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.bp-node--execution-true .bp-node-card {
|
|
216
|
+
border-color: rgb(22 163 74 / 0.65);
|
|
217
|
+
box-shadow:
|
|
218
|
+
0 0 0 1px rgb(22 163 74 / 0.35),
|
|
219
|
+
0 4px 14px rgb(22 163 74 / 0.18);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.bp-node--execution-true .bp-flow-handle {
|
|
223
|
+
border-color: hsl(var(--card));
|
|
224
|
+
box-shadow: 0 0 0 2px rgb(22 163 74 / 0.45);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.bp-node--execution-true .bp-flow-handle--source {
|
|
228
|
+
background: #16a34a;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.bp-node--execution-true .bp-flow-handle--target {
|
|
232
|
+
background: rgb(22 163 74 / 0.55);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.bp-node--execution-false .bp-node-card {
|
|
236
|
+
border-color: hsl(var(--destructive) / 0.65);
|
|
237
|
+
box-shadow:
|
|
238
|
+
0 0 0 1px hsl(var(--destructive) / 0.4),
|
|
239
|
+
0 4px 14px hsl(var(--destructive) / 0.16);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.bp-node--execution-false .bp-flow-handle {
|
|
243
|
+
border-color: hsl(var(--card));
|
|
244
|
+
box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.4);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.bp-node--execution-false .bp-flow-handle--source {
|
|
248
|
+
background: hsl(var(--destructive));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.bp-node--execution-false .bp-flow-handle--target {
|
|
252
|
+
background: hsl(var(--destructive) / 0.55);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* 生命周期节点无输入口:隐藏任何左侧/目标连接点(含旧数据产生的幽灵 handle) */
|
|
256
|
+
.bp-node--lifecycle .react-flow__handle.bp-flow-handle--target,
|
|
257
|
+
.bp-node--lifecycle .react-flow__handle-left,
|
|
258
|
+
.bp-node--lifecycle .react-flow__handle[data-handlepos="left"] {
|
|
259
|
+
display: none !important;
|
|
260
|
+
visibility: hidden !important;
|
|
261
|
+
pointer-events: none !important;
|
|
262
|
+
width: 0 !important;
|
|
263
|
+
height: 0 !important;
|
|
264
|
+
opacity: 0 !important;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.bp-canvas .react-flow__handle.bp-flow-handle--signal,
|
|
268
|
+
.bp-flow .react-flow__handle.bp-flow-handle--signal,
|
|
269
|
+
[data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--signal {
|
|
270
|
+
background: hsl(38 92% 50% / 0.75);
|
|
271
|
+
width: 8px;
|
|
272
|
+
height: 8px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.bp-node--selected .bp-flow-handle--signal {
|
|
276
|
+
background: hsl(38 92% 50%);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* 右键菜单 */
|
|
280
|
+
.bp-context-menu {
|
|
281
|
+
position: fixed;
|
|
282
|
+
z-index: 10050;
|
|
283
|
+
min-width: 148px;
|
|
284
|
+
padding: 4px;
|
|
285
|
+
border-radius: 8px;
|
|
286
|
+
border: 1px solid hsl(var(--border));
|
|
287
|
+
background: hsl(var(--card));
|
|
288
|
+
color: hsl(var(--card-foreground));
|
|
289
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.bp-context-menu__item {
|
|
293
|
+
display: block;
|
|
294
|
+
width: 100%;
|
|
295
|
+
padding: 6px 10px;
|
|
296
|
+
border: none;
|
|
297
|
+
border-radius: 6px;
|
|
298
|
+
background: transparent;
|
|
299
|
+
text-align: left;
|
|
300
|
+
font-size: 12px;
|
|
301
|
+
color: inherit;
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.bp-context-menu__item:hover {
|
|
306
|
+
background: hsl(var(--accent));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.bp-context-menu__item--danger {
|
|
310
|
+
color: hsl(var(--destructive));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.bp-context-menu__item--danger:hover {
|
|
314
|
+
background: hsl(var(--destructive) / 0.1);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.bp-context-menu__separator {
|
|
318
|
+
height: 1px;
|
|
319
|
+
margin: 4px 0;
|
|
320
|
+
background: hsl(var(--border));
|
|
321
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NodeTypes } from "@xyflow/react";
|
|
2
|
+
|
|
3
|
+
import { BlueprintFlowNode } from "./nodes/BlueprintFlowNode";
|
|
4
|
+
import { AndFlowNode } from "./nodes/AndFlowNode";
|
|
5
|
+
import { ClockFlowNode } from "./nodes/ClockFlowNode";
|
|
6
|
+
import { FetchFlowNode } from "./nodes/FetchFlowNode";
|
|
7
|
+
import { JsonFlowNode } from "./nodes/JsonFlowNode";
|
|
8
|
+
import { LifecycleFlowNode } from "./nodes/LifecycleFlowNode";
|
|
9
|
+
import { LogicFlowNode } from "./nodes/LogicFlowNode";
|
|
10
|
+
|
|
11
|
+
/** 稳定引用,避免 React Flow 因 nodeTypes 变化反复卸载节点 */
|
|
12
|
+
export const blueprintNodeTypes = {
|
|
13
|
+
and: AndFlowNode,
|
|
14
|
+
blueprint: BlueprintFlowNode,
|
|
15
|
+
clock: ClockFlowNode,
|
|
16
|
+
fetch: FetchFlowNode,
|
|
17
|
+
json: JsonFlowNode,
|
|
18
|
+
logic: LogicFlowNode,
|
|
19
|
+
lifecycle: LifecycleFlowNode,
|
|
20
|
+
} satisfies NodeTypes;
|