@dschz/solid-flow 0.2.2 → 0.2.3

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.
@@ -1,575 +1,21 @@
1
- /* src/components/container/styles.css */
2
- .solid-flow__zoom {
3
- z-index: 4;
4
- }
5
- .solid-flow__viewport {
6
- transform-origin: 0 0;
7
- z-index: 2;
8
- pointer-events: none;
9
- }
10
- .solid-flow__viewport-portal {
11
- user-select: none;
12
- }
13
- .solid-flow__pane {
14
- z-index: 1;
15
- &.draggable {
16
- cursor: grab;
17
- }
18
- &.dragging {
19
- cursor: grabbing;
20
- }
21
- &.selection {
22
- cursor: pointer;
23
- }
24
- }
25
- .solid-flow__panel {
26
- position: absolute;
27
- z-index: 5;
28
- margin: 15px;
29
- &.top {
30
- top: 0;
31
- }
32
- &.bottom {
33
- bottom: 0;
34
- }
35
- &.left {
36
- left: 0;
37
- }
38
- &.right {
39
- right: 0;
40
- }
41
- &.center {
42
- left: 50%;
43
- transform: translateX(-50%);
44
- }
45
- }
46
- .solid-flow__nodes {
47
- z-index: 0;
48
- pointer-events: none;
49
- transform-origin: 0 0;
50
- }
51
-
52
- /* src/components/accessibility/styles.css */
53
- .a11y-hidden {
54
- display: none;
55
- }
56
- .a11y-live-msg {
57
- position: absolute;
58
- width: 1px;
59
- height: 1px;
60
- margin: -1px;
61
- border: 0;
62
- padding: 0;
63
- overflow: hidden;
64
- clip: rect(0px, 0px, 0px, 0px);
65
- clip-path: inset(100%);
66
- }
67
-
68
- /* src/components/graph/connection/styles.css */
69
- .solid-flow {
70
- --xy-connectionline-stroke-default: #b1b1b7;
71
- --xy-connectionline-stroke-width-default: 1;
72
- }
73
- .solid-flow.dark {
74
- --xy-connectionline-stroke-default: #b1b1b7;
75
- --xy-connectionline-stroke-width-default: 1;
76
- }
77
- connectionline {
78
- z-index: 1001;
79
- overflow: visible;
80
- position: absolute;
81
- }
82
- .solid-flow__connection {
83
- pointer-events: none;
84
- .animated {
85
- stroke-dasharray: 5;
86
- animation: dashdraw 0.5s linear infinite;
87
- }
88
- }
89
- .solid-flow__connection-path {
90
- fill: none;
91
- stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));
92
- stroke-width: var( --xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default) );
93
- }
94
-
95
- /* src/components/graph/edge/styles.css */
96
- .solid-flow {
97
- --xy-edge-label-background-color-default: #ffffff;
98
- --xy-edge-label-color-default: inherit;
99
- --xy-edge-stroke-default: #b1b1b7;
100
- --xy-edge-stroke-width-default: 1;
101
- --xy-edge-stroke-selected-default: #555;
102
- }
103
- .solid-flow.dark {
104
- --xy-edge-stroke-default: #3e3e3e;
105
- --xy-edge-stroke-width-default: 1;
106
- --xy-edge-stroke-selected-default: #727272;
107
- }
108
- .solid-flow__edgeupdater {
109
- cursor: move;
110
- pointer-events: all;
111
- }
112
- .solid-flow__edgelabel-renderer {
113
- position: absolute;
114
- width: 100%;
115
- height: 100%;
116
- pointer-events: none;
117
- user-select: none;
118
- left: 0;
119
- top: 0;
120
- z-index: 0;
121
- }
122
- .solid-flow__edge-label {
123
- text-align: center;
124
- position: absolute;
125
- padding: 2px;
126
- font-size: 10px;
127
- cursor: pointer;
128
- color: var(--xy-edge-label-color, var(--xy-edge-label-color-default));
129
- background: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));
130
- }
131
- .solid-flow__edge-path {
132
- stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
133
- stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));
134
- fill: none;
135
- }
136
- .solid-flow__edges {
137
- position: absolute;
138
- svg {
139
- overflow: visible;
140
- position: absolute;
141
- pointer-events: none;
142
- }
143
- }
144
- .solid-flow__edge {
145
- pointer-events: visibleStroke;
146
- &.updating {
147
- .solid-flow__edge-path {
148
- stroke: #777;
149
- }
150
- }
151
- &.selectable {
152
- cursor: pointer;
153
- }
154
- &.animated path {
155
- stroke-dasharray: 5;
156
- animation: dashdraw 0.5s linear infinite;
157
- }
158
- &.animated path.solid-flow__edge-interaction {
159
- stroke-dasharray: none;
160
- animation: none;
161
- }
162
- &.inactive {
163
- pointer-events: none;
164
- }
165
- &.selected,
166
- &:focus,
167
- &:focus-visible {
168
- outline: none;
169
- }
170
- &.selected .solid-flow__edge-path,
171
- &.selectable:focus .solid-flow__edge-path,
172
- &.selectable:focus-visible .solid-flow__edge-path {
173
- stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));
174
- }
175
- &.textwrapper {
176
- pointer-events: all;
177
- }
178
- &.text {
179
- font-size: 10px;
180
- pointer-events: none;
181
- user-select: none;
182
- }
183
- }
184
-
185
- /* src/components/graph/handle/styles.css */
186
- .solid-flow {
187
- --xy-handle-background-color-default: #1a192b;
188
- --xy-handle-border-color-default: #fff;
189
- }
190
- .solid-flow.dark {
191
- --xy-handle-background-color-default: #bebebe;
192
- --xy-handle-border-color-default: #1e1e1e;
193
- }
194
- .solid-flow__handle {
195
- position: absolute;
196
- pointer-events: none;
197
- min-width: 5px;
198
- min-height: 5px;
199
- width: 6px;
200
- height: 6px;
201
- background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));
202
- border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));
203
- border-radius: 100%;
204
- &.connectingfrom {
205
- pointer-events: all;
206
- }
207
- &.connectionindicator {
208
- pointer-events: all;
209
- cursor: crosshair;
210
- }
211
- }
212
- .solid-flow__handle-left {
213
- top: 50%;
214
- left: 0;
215
- transform: translate(-50%, -50%);
216
- }
217
- .solid-flow__handle-right {
218
- top: 50%;
219
- right: 0;
220
- transform: translate(50%, -50%);
221
- }
222
- .solid-flow__handle-top {
223
- top: 0;
224
- left: 50%;
225
- transform: translate(-50%, -50%);
226
- }
227
- .solid-flow__handle-bottom {
228
- top: auto;
229
- left: 50%;
230
- bottom: 0;
231
- transform: translate(-50%, 50%);
232
- }
233
-
234
- /* src/components/graph/node/styles.css */
235
- .solid-flow {
236
- --xy-node-color-default: inherit;
237
- --xy-node-border-default: 1px solid #1a192b;
238
- --xy-node-background-color-default: #fff;
239
- --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
240
- --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
241
- --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;
242
- --xy-node-border-radius-default: 3px;
243
- --xy-node-border-selected-default: 1px solid #555;
244
- }
245
- .solid-flow.dark {
246
- --xy-node-color-default: #f8f8f8;
247
- --xy-node-border-default: 1px solid #3c3c3c;
248
- --xy-node-background-color-default: #1e1e1e;
249
- --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
250
- --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);
251
- --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;
252
- }
253
- .solid-flow__node {
254
- position: absolute;
255
- user-select: none;
256
- pointer-events: all;
257
- transform-origin: 0 0;
258
- box-sizing: border-box;
259
- cursor: default;
260
- &.selectable {
261
- cursor: pointer;
262
- }
263
- &.draggable {
264
- cursor: grab;
265
- pointer-events: all;
266
- &.dragging {
267
- cursor: grabbing;
268
- }
269
- }
270
- &.parent {
271
- background-color: rgba(220, 220, 255, 0.4);
272
- }
273
- }
274
- .solid-flow__node-input,
275
- .solid-flow__node-default,
276
- .solid-flow__node-output,
277
- .solid-flow__node-group {
278
- padding: 10px;
279
- border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));
280
- width: 150px;
281
- font-size: 12px;
282
- color: var(--xy-node-color, var(--xy-node-color-default));
283
- text-align: center;
284
- border: var(--xy-node-border, var(--xy-node-border-default));
285
- background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));
286
- &.selectable {
287
- &:hover {
288
- box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));
289
- }
290
- &.selected,
291
- &:focus,
292
- &:focus-visible {
293
- box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));
294
- border: var(--xy-node-border-selected, var(--xy-node-border-selected-default));
295
- outline: none;
296
- }
297
- }
298
- }
299
- .solid-flow__node-group {
300
- background-color: var( --xy-node-group-background-color, var(--xy-node-group-background-color-default) );
301
- }
302
-
303
- /* src/components/graph/plugins/background/styles.css */
304
- .solid-flow {
305
- --xy-background-color-default: transparent;
306
- --xy-background-pattern-dots-color-default: #91919a;
307
- --xy-background-pattern-lines-color-default: #eee;
308
- --xy-background-pattern-cross-color-default: #e2e2e2;
309
- --background-color-default: #fff;
310
- --background-pattern-color-default: #ddd;
311
- }
312
- .solid-flow.dark {
313
- --xy-background-color-default: #141414;
314
- --xy-background-pattern-dots-color-default: #777;
315
- --xy-background-pattern-lines-color-default: #777;
316
- --xy-background-pattern-cross-color-default: #777;
317
- }
318
- .solid-flow__background {
319
- pointer-events: none;
320
- z-index: -1;
321
- background-color: var( --xy-background-color, var(--xy-background-color-props, var(--xy-background-color-default)) );
322
- }
323
- .solid-flow__background-pattern {
324
- &.dots {
325
- fill: var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) );
326
- }
327
- &.lines {
328
- stroke: var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) );
329
- }
330
- &.cross {
331
- stroke: var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) );
332
- }
333
- }
334
-
335
- /* src/components/graph/plugins/controls/styles.css */
336
- .solid-flow {
337
- --xy-controls-button-background-color-default: #fefefe;
338
- --xy-controls-button-background-color-hover-default: #f4f4f4;
339
- --xy-controls-button-color-default: inherit;
340
- --xy-controls-button-color-hover-default: inherit;
341
- --xy-controls-button-border-color-default: #eee;
342
- --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);
343
- }
344
- .solid-flow.dark {
345
- --xy-controls-button-background-color-default: #2b2b2b;
346
- --xy-controls-button-background-color-hover-default: #3e3e3e;
347
- --xy-controls-button-color-default: #f8f8f8;
348
- --xy-controls-button-color-hover-default: #fff;
349
- --xy-controls-button-border-color-default: #5b5b5b;
350
- --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);
351
- }
352
- .solid-flow__controls {
353
- display: flex;
354
- flex-direction: column;
355
- box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));
356
- &.horizontal {
357
- flex-direction: row;
358
- }
359
- button {
360
- cursor: pointer;
361
- user-select: none;
362
- border: none;
363
- display: flex;
364
- justify-content: center;
365
- align-items: center;
366
- height: 26px;
367
- width: 26px;
368
- padding: 4px;
369
- background: var( --xy-controls-button-background-color, var(--xy-controls-button-background-color-default) );
370
- border-bottom: 1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );
371
- color: var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );
372
- &:hover {
373
- background: var( --xy-controls-button-background-color-hover-props, var( --xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default) ) );
374
- color: var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) );
375
- }
376
- &:disabled {
377
- pointer-events: none;
378
- svg {
379
- fill-opacity: 0.4;
380
- }
381
- }
382
- svg {
383
- width: 100%;
384
- max-width: 12px;
385
- max-height: 12px;
386
- fill: currentColor;
387
- }
388
- }
389
- button:last-child {
390
- border-bottom: none;
391
- }
392
- }
393
-
394
- /* src/components/graph/plugins/minimap/styles.css */
395
- .solid-flow {
396
- --xy-minimap-background-color-default: #fff;
397
- --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
398
- --xy-minimap-mask-stroke-color-default: transparent;
399
- --xy-minimap-mask-stroke-width-default: 1;
400
- --xy-minimap-node-background-color-default: #e2e2e2;
401
- --xy-minimap-node-stroke-color-default: transparent;
402
- --xy-minimap-node-stroke-width-default: 2;
403
- }
404
- .solid-flow.dark {
405
- --xy-minimap-background-color-default: #141414;
406
- --xy-minimap-mask-background-color-default: rgb(60, 60, 60, 0.6);
407
- --xy-minimap-mask-stroke-color-default: transparent;
408
- --xy-minimap-mask-stroke-width-default: 1;
409
- --xy-minimap-node-background-color-default: #2b2b2b;
410
- --xy-minimap-node-stroke-color-default: transparent;
411
- --xy-minimap-node-stroke-width-default: 2;
412
- }
413
- .solid-flow__minimap {
414
- background: var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) );
415
- }
416
- .solid-flow__minimap-svg {
417
- display: block;
418
- }
419
- .solid-flow__minimap-mask {
420
- fill: var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );
421
- stroke: var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );
422
- stroke-width: var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) );
423
- }
424
- .solid-flow__minimap-node {
425
- fill: var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );
426
- stroke: var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );
427
- stroke-width: var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) );
428
- }
429
-
430
- /* src/components/graph/plugins/nodeResizer/styles.css */
431
- .solid-flow {
432
- --xy-resize-background-color-default: #3367d9;
433
- }
434
- .solid-flow__resize-control {
435
- position: absolute;
436
- &.left,
437
- &.right {
438
- cursor: ew-resize;
439
- }
440
- &.top,
441
- &.bottom {
442
- cursor: ns-resize;
443
- }
444
- &.top.left,
445
- &.bottom.right {
446
- cursor: nwse-resize;
447
- }
448
- &.bottom.left,
449
- &.top.right {
450
- cursor: nesw-resize;
451
- }
452
- }
453
- .solid-flow__resize-control.handle {
454
- width: 4px;
455
- height: 4px;
456
- border: 1px solid #fff;
457
- border-radius: 1px;
458
- background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
459
- transform: translate(-50%, -50%);
460
- &.left {
461
- left: 0;
462
- top: 50%;
463
- }
464
- &.right {
465
- left: 100%;
466
- top: 50%;
467
- }
468
- &.top {
469
- left: 50%;
470
- top: 0;
471
- }
472
- &.bottom {
473
- left: 50%;
474
- top: 100%;
475
- }
476
- &.top.left {
477
- left: 0;
478
- }
479
- &.bottom.left {
480
- left: 0;
481
- }
482
- &.top.right {
483
- left: 100%;
484
- }
485
- &.bottom.right {
486
- left: 100%;
487
- }
488
- }
489
- .solid-flow__resize-control.line {
490
- border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
491
- border-width: 0;
492
- border-style: solid;
493
- &.left,
494
- &.right {
495
- width: 1px;
496
- height: 100%;
497
- transform: translate(-50%, 0);
498
- top: 0;
499
- }
500
- &.top,
501
- &.bottom {
502
- width: 100%;
503
- height: 1px;
504
- transform: translate(0, -50%);
505
- left: 0;
506
- }
507
- &.left {
508
- left: 0;
509
- border-left-width: 1px;
510
- }
511
- &.right {
512
- left: 100%;
513
- border-right-width: 1px;
514
- }
515
- &.top {
516
- top: 0;
517
- border-top-width: 1px;
518
- }
519
- &.bottom {
520
- top: 100%;
521
- border-bottom-width: 1px;
522
- }
523
- }
1
+ /* Container Styles */
2
+ @import "../components/container/styles.css";
3
+ @import "../components/accessibility/styles.css";
4
+
5
+ /* Graph Styles */
6
+ @import "../components/graph/connection/styles.css";
7
+ @import "../components/graph/edge/styles.css";
8
+ @import "../components/graph/handle/styles.css";
9
+ @import "../components/graph/node/styles.css";
10
+ @import "../components/graph/plugins/background/styles.css";
11
+ @import "../components/graph/plugins/controls/styles.css";
12
+ @import "../components/graph/plugins/minimap/styles.css";
13
+ @import "../components/graph/plugins/nodeResizer/styles.css";
14
+ @import "../components/graph/selection/styles.css";
15
+
16
+ /* Utility Styles */
17
+ @import "../components/utility/styles.css";
524
18
 
525
- /* src/components/graph/selection/styles.css */
526
- .solid-flow {
527
- --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);
528
- --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);
529
- }
530
- .solid-flow.dark {
531
- --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);
532
- --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);
533
- }
534
- .solid-flow__selection-wrapper {
535
- position: absolute;
536
- top: 0;
537
- left: 0;
538
- z-index: 2000;
539
- pointer-events: all;
540
- }
541
- .solid-flow__selection {
542
- background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));
543
- border: var(--xy-selection-border, var(--xy-selection-border-default));
544
- position: absolute;
545
- top: 0;
546
- left: 0;
547
- z-index: 6;
548
- &:focus,
549
- &:focus-visible {
550
- outline: none;
551
- }
552
- }
553
-
554
- /* src/components/utility/styles.css */
555
- .solid-flow {
556
- --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);
557
- }
558
- .solid-flow.dark {
559
- --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);
560
- }
561
- .solid-flow__attribution {
562
- font-size: 10px;
563
- background: var( --xy-attribution-background-color, var(--xy-attribution-background-color-default) );
564
- padding: 2px 3px;
565
- margin: 0;
566
- a {
567
- text-decoration: none;
568
- color: #999;
569
- }
570
- }
571
-
572
- /* src/styles/style.css */
573
19
  .solid-flow__container {
574
20
  position: absolute;
575
21
  width: 100%;
@@ -577,14 +23,17 @@ connectionline {
577
23
  top: 0;
578
24
  left: 0;
579
25
  }
26
+
580
27
  .solid-flow {
581
28
  width: 100%;
582
29
  height: 100%;
583
30
  overflow: hidden;
584
31
  position: relative;
585
32
  z-index: 0;
33
+
586
34
  background-color: var(--xy-background-color, var(--xy-background-color-default));
587
35
  }
36
+
588
37
  @keyframes dashdraw {
589
38
  from {
590
39
  stroke-dashoffset: 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dschz/solid-flow",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Solid Flow - A highly customizable Solid library for building node-based editors, workflow systems, diagrams and more.",
5
5
  "keywords": [
6
6
  "ai workflows",
@@ -75,8 +75,8 @@
75
75
  "access": "public"
76
76
  },
77
77
  "scripts": {
78
- "build": "tsup",
79
- "build:watch": "tsup --watch",
78
+ "build": "tsdown",
79
+ "build:watch": "tsdown --watch",
80
80
  "dev": "vite",
81
81
  "format": "oxfmt --check",
82
82
  "format:fix": "oxfmt",
@@ -89,7 +89,8 @@
89
89
  "start": "vite",
90
90
  "test": "vitest run",
91
91
  "test:cov": "vitest run --coverage",
92
- "typecheck": "tsc --noEmit"
92
+ "typecheck": "tsc --noEmit",
93
+ "test:ssr": "vitest run --config vite.config.ssr.ts"
93
94
  },
94
95
  "dependencies": {
95
96
  "@solid-primitives/map": "^0.7.4",
@@ -115,15 +116,18 @@
115
116
  "jiti": "2.7.0",
116
117
  "jsdom": "29.1.1",
117
118
  "oxfmt": "^0.60.0",
118
- "tsup": "8.5.1",
119
- "tsup-preset-solid": "2.2.0",
119
+ "tsdown": "0.22.14",
120
120
  "typescript": "6.0.3",
121
121
  "typescript-eslint": "8.65.0",
122
+ "unplugin-solid": "2.0.0",
122
123
  "vite": "8.1.5",
123
124
  "vite-plugin-solid": "2.11.13",
124
125
  "vitest": "4.1.10"
125
126
  },
126
127
  "peerDependencies": {
127
128
  "solid-js": ">=1.8.0"
129
+ },
130
+ "overrides": {
131
+ "babel-preset-solid": "1.9.6"
128
132
  }
129
133
  }
@@ -1,2 +0,0 @@
1
-
2
- export { }