@arronqzy/react-blueprint 1.0.10 → 1.0.11

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.
@@ -0,0 +1,327 @@
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
+ --xy-handle-background-color: hsl(var(--primary));
23
+ --xy-handle-border-color: hsl(var(--background));
24
+ background-color: transparent;
25
+ }
26
+
27
+ /*
28
+ * 全局 reset(apps/web style.css、Tailwind preflight)会给 svg 设 max-width:100%,
29
+ * 导致 React Flow 边线 SVG 坐标系被压扁;连线预览单独有 z-index:1001 所以能看见。
30
+ */
31
+ .bp-canvas svg.react-flow__connectionline,
32
+ .bp-canvas .react-flow__edges svg,
33
+ .bp-flow svg.react-flow__connectionline,
34
+ .bp-flow .react-flow__edges svg,
35
+ [data-workspace-region="blueprint"] svg.react-flow__connectionline,
36
+ [data-workspace-region="blueprint"] .react-flow__edges svg {
37
+ display: block;
38
+ max-width: none !important;
39
+ max-height: none !important;
40
+ width: auto !important;
41
+ height: auto !important;
42
+ overflow: visible !important;
43
+ }
44
+
45
+ /*
46
+ * 边层必须在节点之上:.react-flow__edges 与 .react-flow__nodes 为兄弟节点,
47
+ * 默认 DOM 顺序下节点后渲染会盖住边;连接线因有 z-index:1001 不受影响。
48
+ */
49
+ .bp-canvas .react-flow__edges,
50
+ .bp-flow .react-flow__edges,
51
+ [data-workspace-region="blueprint"] .react-flow__edges {
52
+ z-index: 1000 !important;
53
+ pointer-events: none;
54
+ }
55
+
56
+ .bp-canvas .react-flow__nodes,
57
+ .bp-flow .react-flow__nodes,
58
+ [data-workspace-region="blueprint"] .react-flow__nodes {
59
+ z-index: 0 !important;
60
+ }
61
+
62
+ .bp-canvas .react-flow__edge,
63
+ .bp-flow .react-flow__edge,
64
+ [data-workspace-region="blueprint"] .react-flow__edge {
65
+ pointer-events: visibleStroke;
66
+ }
67
+
68
+ /* 持久边 path:强制描边(覆盖 currentColor / 主题色) */
69
+ .bp-canvas .react-flow__edges path.react-flow__edge-path,
70
+ .bp-canvas .react-flow__edges path.bp-edge-visible,
71
+ .bp-flow .react-flow__edges path.react-flow__edge-path,
72
+ .bp-flow .react-flow__edges path.bp-edge-visible,
73
+ [data-workspace-region="blueprint"] .react-flow__edges path.react-flow__edge-path,
74
+ [data-workspace-region="blueprint"] .react-flow__edges path.bp-edge-visible {
75
+ fill: none !important;
76
+ stroke: #2563eb !important;
77
+ stroke-width: 2.5px !important;
78
+ opacity: 1 !important;
79
+ }
80
+
81
+ .bp-canvas .react-flow__edge.selected path.react-flow__edge-path,
82
+ .bp-flow .react-flow__edge.selected path.react-flow__edge-path,
83
+ [data-workspace-region="blueprint"] .react-flow__edge.selected path.react-flow__edge-path {
84
+ stroke: #1d4ed8 !important;
85
+ stroke-width: 3px !important;
86
+ }
87
+
88
+ .bp-canvas .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path,
89
+ .bp-flow .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path,
90
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-true path.react-flow__edge-path {
91
+ stroke: #16a34a !important;
92
+ stroke-width: 3px !important;
93
+ }
94
+
95
+ .bp-canvas .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path,
96
+ .bp-flow .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path,
97
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-false path.react-flow__edge-path {
98
+ stroke: #dc2626 !important;
99
+ stroke-width: 3px !important;
100
+ }
101
+
102
+ .bp-canvas .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline,
103
+ .bp-flow .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline,
104
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-true .react-flow__arrowhead polyline {
105
+ stroke: #16a34a;
106
+ fill: #16a34a;
107
+ }
108
+
109
+ .bp-canvas .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline,
110
+ .bp-flow .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline,
111
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-false .react-flow__arrowhead polyline {
112
+ stroke: #dc2626;
113
+ fill: #dc2626;
114
+ }
115
+
116
+ .bp-canvas .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path,
117
+ .bp-flow .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path,
118
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-clock-blue path.react-flow__edge-path {
119
+ stroke: #2563eb !important;
120
+ stroke-width: 3px !important;
121
+ }
122
+
123
+ .bp-canvas .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline,
124
+ .bp-flow .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline,
125
+ [data-workspace-region="blueprint"] .react-flow__edge.bp-edge--signal-clock-blue .react-flow__arrowhead polyline {
126
+ stroke: #2563eb;
127
+ fill: #2563eb;
128
+ }
129
+
130
+ .bp-canvas .react-flow__arrowhead polyline,
131
+ .bp-flow .react-flow__arrowhead polyline,
132
+ [data-workspace-region="blueprint"] .react-flow__arrowhead polyline {
133
+ stroke: #2563eb;
134
+ fill: #2563eb;
135
+ }
136
+
137
+ .bp-canvas .react-flow__connection-path,
138
+ .bp-flow .react-flow__connection-path,
139
+ [data-workspace-region="blueprint"] .react-flow__connection-path {
140
+ fill: none !important;
141
+ stroke: #2563eb !important;
142
+ stroke-width: 2.5px !important;
143
+ }
144
+
145
+ .bp-canvas .react-flow__edge-interaction,
146
+ .bp-flow .react-flow__edge-interaction,
147
+ [data-workspace-region="blueprint"] .react-flow__edge-interaction {
148
+ pointer-events: stroke;
149
+ stroke: transparent !important;
150
+ stroke-opacity: 0 !important;
151
+ stroke-width: 18px !important;
152
+ }
153
+
154
+ .bp-canvas .react-flow__edge.selected .react-flow__edge-interaction,
155
+ .bp-flow .react-flow__edge.selected .react-flow__edge-interaction,
156
+ [data-workspace-region="blueprint"] .react-flow__edge.selected .react-flow__edge-interaction {
157
+ pointer-events: stroke;
158
+ }
159
+
160
+ /* 节点容器:去掉默认包裹样式 */
161
+ .bp-canvas .react-flow__node,
162
+ .bp-flow .react-flow__node,
163
+ [data-workspace-region="blueprint"] .react-flow__node {
164
+ border: none;
165
+ background: transparent;
166
+ box-shadow: none;
167
+ padding: 0;
168
+ }
169
+
170
+ /* 连接点:禁止 transform,避免覆盖 React Flow 的 translate(-50%, -50%) 定位 */
171
+ .bp-canvas .react-flow__handle.bp-flow-handle,
172
+ .bp-flow .react-flow__handle.bp-flow-handle,
173
+ [data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle {
174
+ z-index: 3;
175
+ width: 10px;
176
+ height: 10px;
177
+ min-width: 10px;
178
+ min-height: 10px;
179
+ border: 2px solid hsl(var(--background)) !important;
180
+ border-radius: 9999px;
181
+ background-color: hsl(var(--foreground) / 0.42) !important;
182
+ transition:
183
+ background-color 0.15s ease,
184
+ border-color 0.15s ease,
185
+ box-shadow 0.15s ease;
186
+ }
187
+
188
+ .bp-canvas .react-flow__handle.bp-flow-handle:hover,
189
+ .bp-flow .react-flow__handle.bp-flow-handle:hover,
190
+ [data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle:hover {
191
+ background-color: hsl(var(--primary)) !important;
192
+ border-color: hsl(var(--background)) !important;
193
+ box-shadow: 0 0 0 3px hsl(var(--primary) / 0.28);
194
+ }
195
+
196
+ .bp-canvas .react-flow__handle.bp-flow-handle--target,
197
+ .bp-flow .react-flow__handle.bp-flow-handle--target,
198
+ [data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--target {
199
+ background-color: hsl(var(--foreground) / 0.48) !important;
200
+ }
201
+
202
+ .bp-canvas .react-flow__handle.bp-flow-handle--source,
203
+ .bp-flow .react-flow__handle.bp-flow-handle--source,
204
+ [data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--source {
205
+ background-color: hsl(var(--primary) / 0.72) !important;
206
+ }
207
+
208
+ .bp-node--selected .bp-flow-handle {
209
+ border-color: hsl(var(--card)) !important;
210
+ box-shadow: 0 0 0 2px hsl(var(--primary) / 0.35);
211
+ }
212
+
213
+ .bp-node--selected .bp-flow-handle--target {
214
+ background-color: hsl(var(--foreground) / 0.55) !important;
215
+ }
216
+
217
+ .bp-node--selected .bp-flow-handle--source {
218
+ background-color: hsl(var(--primary)) !important;
219
+ }
220
+
221
+ .bp-node--execution-true .bp-node-card {
222
+ border-color: rgb(22 163 74 / 0.65);
223
+ box-shadow:
224
+ 0 0 0 1px rgb(22 163 74 / 0.35),
225
+ 0 4px 14px rgb(22 163 74 / 0.18);
226
+ }
227
+
228
+ .bp-node--execution-true .bp-flow-handle {
229
+ border-color: hsl(var(--card));
230
+ box-shadow: 0 0 0 2px rgb(22 163 74 / 0.45);
231
+ }
232
+
233
+ .bp-node--execution-true .bp-flow-handle--source {
234
+ background-color: #16a34a !important;
235
+ }
236
+
237
+ .bp-node--execution-true .bp-flow-handle--target {
238
+ background-color: rgb(22 163 74 / 0.55) !important;
239
+ }
240
+
241
+ .bp-node--execution-false .bp-node-card {
242
+ border-color: hsl(var(--destructive) / 0.65);
243
+ box-shadow:
244
+ 0 0 0 1px hsl(var(--destructive) / 0.4),
245
+ 0 4px 14px hsl(var(--destructive) / 0.16);
246
+ }
247
+
248
+ .bp-node--execution-false .bp-flow-handle {
249
+ border-color: hsl(var(--card));
250
+ box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.4);
251
+ }
252
+
253
+ .bp-node--execution-false .bp-flow-handle--source {
254
+ background-color: hsl(var(--destructive)) !important;
255
+ }
256
+
257
+ .bp-node--execution-false .bp-flow-handle--target {
258
+ background-color: hsl(var(--destructive) / 0.55) !important;
259
+ }
260
+
261
+ /* 生命周期节点无输入口:隐藏任何左侧/目标连接点(含旧数据产生的幽灵 handle) */
262
+ .bp-node--lifecycle .react-flow__handle.bp-flow-handle--target,
263
+ .bp-node--lifecycle .react-flow__handle-left,
264
+ .bp-node--lifecycle .react-flow__handle[data-handlepos="left"] {
265
+ display: none !important;
266
+ visibility: hidden !important;
267
+ pointer-events: none !important;
268
+ width: 0 !important;
269
+ height: 0 !important;
270
+ opacity: 0 !important;
271
+ }
272
+
273
+ .bp-canvas .react-flow__handle.bp-flow-handle--signal,
274
+ .bp-flow .react-flow__handle.bp-flow-handle--signal,
275
+ [data-workspace-region="blueprint"] .react-flow__handle.bp-flow-handle--signal {
276
+ background-color: hsl(38 92% 50% / 0.75) !important;
277
+ width: 8px;
278
+ height: 8px;
279
+ }
280
+
281
+ .bp-node--selected .bp-flow-handle--signal {
282
+ background-color: hsl(38 92% 50%) !important;
283
+ }
284
+
285
+ /* 右键菜单 */
286
+ .bp-context-menu {
287
+ position: fixed;
288
+ z-index: 10050;
289
+ min-width: 148px;
290
+ padding: 4px;
291
+ border-radius: 8px;
292
+ border: 1px solid hsl(var(--border));
293
+ background: hsl(var(--card));
294
+ color: hsl(var(--card-foreground));
295
+ box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
296
+ }
297
+
298
+ .bp-context-menu__item {
299
+ display: block;
300
+ width: 100%;
301
+ padding: 6px 10px;
302
+ border: none;
303
+ border-radius: 6px;
304
+ background: transparent;
305
+ text-align: left;
306
+ font-size: 12px;
307
+ color: inherit;
308
+ cursor: pointer;
309
+ }
310
+
311
+ .bp-context-menu__item:hover {
312
+ background: hsl(var(--accent));
313
+ }
314
+
315
+ .bp-context-menu__item--danger {
316
+ color: hsl(var(--destructive));
317
+ }
318
+
319
+ .bp-context-menu__item--danger:hover {
320
+ background: hsl(var(--destructive) / 0.1);
321
+ }
322
+
323
+ .bp-context-menu__separator {
324
+ height: 1px;
325
+ margin: 4px 0;
326
+ background: hsl(var(--border));
327
+ }
package/package.json CHANGED
@@ -1,19 +1,25 @@
1
1
  {
2
2
  "name": "@arronqzy/react-blueprint",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "",
5
+ "files": [
6
+ "index.ts",
7
+ "src",
8
+ "dist",
9
+ "README.md"
10
+ ],
5
11
  "main": "index.ts",
6
12
  "exports": {
7
13
  ".": "./index.ts",
8
- "./blueprint.css": "./src/blueprint.css"
14
+ "./blueprint.css": "./dist/blueprint.css"
9
15
  },
10
16
  "dependencies": {
11
17
  "react": "^19",
12
18
  "dayjs": "^1.11.13",
13
19
  "react-dom": "^19",
14
20
  "@xyflow/react": "^12.9.3",
15
- "@arronqzy/i18n": "0.1.7",
16
21
  "@arronqzy/blueprint-dsl": "1.0.9",
22
+ "@arronqzy/i18n": "0.1.7",
17
23
  "@arronqzy/react-rx-store": "1.1.5",
18
24
  "@arronqzy/ui": "1.0.6"
19
25
  },
@@ -38,7 +44,8 @@
38
44
  "scripts": {
39
45
  "lint": "eslint \"src/**/*.{ts,tsx}\"",
40
46
  "typecheck": "tsc -p tsconfig.json --noEmit",
41
- "build": "pnpm run lint && pnpm run typecheck && vite build",
47
+ "build:css": "mkdir -p dist && cp src/blueprint.css dist/blueprint.css",
48
+ "build": "pnpm run lint && pnpm run typecheck && pnpm run build:css",
42
49
  "dev": "vite"
43
50
  }
44
51
  }
package/.eslintrc.cjs DELETED
@@ -1,5 +0,0 @@
1
- /** @type {import("eslint").Linter.Config} */
2
- module.exports = {
3
- root: true,
4
- extends: ["@arronqzy/eslint-config/index.js"],
5
- };
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>blue-print</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };
@@ -1,6 +0,0 @@
1
- import preset from "../tailwind/src/preset";
2
-
3
- export default {
4
- presets: [preset],
5
- content: ["./index.html", "./src/**/*.{ts,tsx}"],
6
- };
package/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "@arronqzy/typescript-config/react-library.json",
3
- "compilerOptions": {
4
- "baseUrl": ".",
5
- "paths": {
6
- "@arronqzy/blueprint-dsl": ["../blueprint-dsl/src/index.ts"],
7
- "@arronqzy/ui": ["../ui/index.ts"]
8
- }
9
- },
10
- "include": ["."],
11
- "exclude": ["node_modules"]
12
- }
package/vite.config.ts DELETED
@@ -1,16 +0,0 @@
1
- import path from "node:path";
2
-
3
- import react from "@vitejs/plugin-react";
4
- import { defineConfig } from "vite";
5
-
6
- export default defineConfig({
7
- plugins: [react()],
8
- resolve: {
9
- alias: {
10
- "@arronqzy/ui": path.resolve(process.cwd(), "../ui/index.ts"),
11
- },
12
- },
13
- server: {
14
- port: 31012,
15
- },
16
- });