@stonecrop/node-editor 0.31.0 → 0.33.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.
Files changed (32) hide show
  1. package/dist/assets/index.css +430 -0
  2. package/dist/node-editor.js +821 -644
  3. package/dist/node-editor.js.map +1 -1
  4. package/dist/src/components/EditableEdge.vue.d.ts +11 -0
  5. package/dist/src/components/EditableEdge.vue.d.ts.map +1 -0
  6. package/dist/src/components/EditableNode.vue.d.ts +10 -0
  7. package/dist/src/components/EditableNode.vue.d.ts.map +1 -0
  8. package/dist/src/components/NodeEditor.vue.d.ts +14 -0
  9. package/dist/src/components/NodeEditor.vue.d.ts.map +1 -0
  10. package/dist/src/components/SelfLoopEdge.vue.d.ts +11 -0
  11. package/dist/src/components/SelfLoopEdge.vue.d.ts.map +1 -0
  12. package/dist/src/components/StateEditor.vue.d.ts +69 -0
  13. package/dist/src/components/StateEditor.vue.d.ts.map +1 -0
  14. package/dist/{tsdoc-metadata.json → src/tsdoc-metadata.json} +1 -1
  15. package/package.json +35 -28
  16. package/dist/node-editor.css +0 -1
  17. package/dist/node-editor.d.ts +0 -60
  18. package/dist/node_editor.tsbuildinfo +0 -1
  19. package/dist/src/index.js +0 -16
  20. package/dist/src/types/index.js +0 -0
  21. package/dist/src/utils/autoLayout.js +0 -50
  22. package/dist/src/utils/stateTransforms.js +0 -148
  23. package/src/components/EditableEdge.vue +0 -92
  24. package/src/components/EditableNode.vue +0 -65
  25. package/src/components/NodeEditor.vue +0 -397
  26. package/src/components/SelfLoopEdge.vue +0 -88
  27. package/src/components/StateEditor.vue +0 -46
  28. package/src/index.ts +0 -22
  29. package/src/shims-vue.d.ts +0 -5
  30. package/src/types/index.ts +0 -33
  31. package/src/utils/autoLayout.ts +0 -67
  32. package/src/utils/stateTransforms.ts +0 -164
@@ -0,0 +1,430 @@
1
+
2
+ .editable-edge-label {
3
+ background-color: white;
4
+ position: relative;
5
+ font-size: 12px;
6
+ }
7
+ .label-input-wrapper {
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ }
17
+ .label-input {
18
+ text-align: center;
19
+ width: 40ch;
20
+ }
21
+
22
+ .label-input-wrapper {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ right: 0;
27
+ bottom: 0;
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ }
32
+ .label-input {
33
+ text-align: center;
34
+ }
35
+
36
+ /* Label + input styles are shared with EditableEdge (defined there, global scope). */
37
+ .vue-flow {
38
+ position: relative;
39
+ width: 100%;
40
+ height: 100%;
41
+ overflow: hidden;
42
+ z-index: 0;
43
+ direction: ltr;
44
+ }
45
+ .vue-flow__container {
46
+ position: absolute;
47
+ height: 100%;
48
+ width: 100%;
49
+ left: 0;
50
+ top: 0;
51
+ }
52
+ .vue-flow__pane {
53
+ z-index: 1;
54
+ }
55
+ .vue-flow__pane.draggable {
56
+ cursor: grab;
57
+ }
58
+ .vue-flow__pane.selection {
59
+ cursor: pointer;
60
+ }
61
+ .vue-flow__pane.dragging {
62
+ cursor: grabbing;
63
+ }
64
+ .vue-flow__transformationpane {
65
+ transform-origin: 0 0;
66
+ z-index: 2;
67
+ pointer-events: none;
68
+ }
69
+ .vue-flow__viewport {
70
+ z-index: 4;
71
+ overflow: clip;
72
+ }
73
+ .vue-flow__selection {
74
+ z-index: 6;
75
+ }
76
+ .vue-flow__edge-labels {
77
+ position: absolute;
78
+ width: 100%;
79
+ height: 100%;
80
+ pointer-events: none;
81
+ -webkit-user-select: none;
82
+ -moz-user-select: none;
83
+ user-select: none;
84
+ }
85
+ .vue-flow__nodesselection-rect:focus,
86
+ .vue-flow__nodesselection-rect:focus-visible {
87
+ outline: none;
88
+ }
89
+ .vue-flow .vue-flow__edges {
90
+ pointer-events: none;
91
+ overflow: visible;
92
+ }
93
+ .vue-flow__edge-path,
94
+ .vue-flow__connection-path {
95
+ stroke: #b1b1b7;
96
+ stroke-width: 1;
97
+ fill: none;
98
+ }
99
+ .vue-flow__edge {
100
+ pointer-events: visibleStroke;
101
+ cursor: pointer;
102
+ }
103
+ .vue-flow__edge.animated path {
104
+ stroke-dasharray: 5;
105
+ animation: dashdraw 0.5s linear infinite;
106
+ }
107
+ .vue-flow__edge.animated path.vue-flow__edge-interaction {
108
+ stroke-dasharray: none;
109
+ animation: none;
110
+ }
111
+ .vue-flow__edge.inactive {
112
+ pointer-events: none;
113
+ }
114
+ .vue-flow__edge.selected,
115
+ .vue-flow__edge:focus,
116
+ .vue-flow__edge:focus-visible {
117
+ outline: none;
118
+ }
119
+ .vue-flow__edge.selected .vue-flow__edge-path,
120
+ .vue-flow__edge:focus .vue-flow__edge-path,
121
+ .vue-flow__edge:focus-visible .vue-flow__edge-path {
122
+ stroke: #555;
123
+ }
124
+ .vue-flow__edge-textwrapper {
125
+ pointer-events: all;
126
+ }
127
+ .vue-flow__edge-textbg {
128
+ fill: white;
129
+ }
130
+ .vue-flow__edge-text {
131
+ pointer-events: none;
132
+ -webkit-user-select: none;
133
+ -moz-user-select: none;
134
+ user-select: none;
135
+ }
136
+ .vue-flow__connection {
137
+ pointer-events: none;
138
+ }
139
+ .vue-flow__connection .animated {
140
+ stroke-dasharray: 5;
141
+ animation: dashdraw 0.5s linear infinite;
142
+ }
143
+ .vue-flow__connectionline {
144
+ z-index: 1001;
145
+ }
146
+ .vue-flow__nodes {
147
+ pointer-events: none;
148
+ transform-origin: 0 0;
149
+ }
150
+ .vue-flow__node {
151
+ position: absolute;
152
+ -webkit-user-select: none;
153
+ -moz-user-select: none;
154
+ user-select: none;
155
+ pointer-events: all;
156
+ transform-origin: 0 0;
157
+ box-sizing: border-box;
158
+ cursor: default;
159
+ }
160
+ .vue-flow__node.draggable {
161
+ cursor: grab;
162
+ pointer-events: all;
163
+ }
164
+ .vue-flow__node.draggable.dragging {
165
+ cursor: grabbing;
166
+ }
167
+ .vue-flow__nodesselection {
168
+ z-index: 3;
169
+ transform-origin: left top;
170
+ pointer-events: none;
171
+ }
172
+ .vue-flow__nodesselection-rect {
173
+ position: absolute;
174
+ pointer-events: all;
175
+ cursor: grab;
176
+ }
177
+ .vue-flow__nodesselection-rect.dragging {
178
+ cursor: grabbing;
179
+ }
180
+ .vue-flow__handle {
181
+ position: absolute;
182
+ pointer-events: none;
183
+ min-width: 5px;
184
+ min-height: 5px;
185
+ }
186
+ .vue-flow__handle.connectable {
187
+ pointer-events: all;
188
+ cursor: crosshair;
189
+ }
190
+ .vue-flow__handle-bottom {
191
+ left: 50%;
192
+ bottom: 0;
193
+ transform: translate(-50%, 50%);
194
+ }
195
+ .vue-flow__handle-top {
196
+ left: 50%;
197
+ top: 0;
198
+ transform: translate(-50%, -50%);
199
+ }
200
+ .vue-flow__handle-left {
201
+ top: 50%;
202
+ left: 0;
203
+ transform: translate(-50%, -50%);
204
+ }
205
+ .vue-flow__handle-right {
206
+ top: 50%;
207
+ right: 0;
208
+ transform: translate(50%, -50%);
209
+ }
210
+ .vue-flow__edgeupdater {
211
+ cursor: move;
212
+ pointer-events: all;
213
+ }
214
+ .vue-flow__panel {
215
+ position: absolute;
216
+ z-index: 5;
217
+ margin: 15px;
218
+ }
219
+ .vue-flow__panel.top {
220
+ top: 0;
221
+ }
222
+ .vue-flow__panel.bottom {
223
+ bottom: 0;
224
+ }
225
+ .vue-flow__panel.left {
226
+ left: 0;
227
+ }
228
+ .vue-flow__panel.right {
229
+ right: 0;
230
+ }
231
+ .vue-flow__panel.center {
232
+ left: 50%;
233
+ transform: translateX(-50%);
234
+ }
235
+ @keyframes dashdraw {
236
+ from {
237
+ stroke-dashoffset: 10;
238
+ }
239
+ }
240
+ :root {
241
+ --vf-node-bg: #fff;
242
+ --vf-node-text: #222;
243
+ --vf-connection-path: #b1b1b7;
244
+ --vf-handle: #555;
245
+ }
246
+ .vue-flow__edge.updating .vue-flow__edge-path {
247
+ stroke: #777;
248
+ }
249
+ .vue-flow__edge-text {
250
+ font-size: 10px;
251
+ }
252
+ .vue-flow__edge-textbg {
253
+ fill: #fff;
254
+ }
255
+ .vue-flow__connection-path {
256
+ stroke: var(--vf-connection-path);
257
+ }
258
+ .vue-flow__node {
259
+ cursor: grab;
260
+ }
261
+ .vue-flow__node.selectable:focus,
262
+ .vue-flow__node.selectable:focus-visible {
263
+ outline: none;
264
+ }
265
+ .vue-flow__node-default,
266
+ .vue-flow__node-input,
267
+ .vue-flow__node-output {
268
+ padding: 10px;
269
+ border-radius: 3px;
270
+ width: 150px;
271
+ font-size: 12px;
272
+ text-align: center;
273
+ border-width: 1px;
274
+ border-style: solid;
275
+ color: var(--vf-node-text);
276
+ background-color: var(--vf-node-bg);
277
+ border-color: var(--vf-node-color);
278
+ }
279
+ .vue-flow__node-default.selected,
280
+ .vue-flow__node-default.selected:hover,
281
+ .vue-flow__node-input.selected,
282
+ .vue-flow__node-input.selected:hover,
283
+ .vue-flow__node-output.selected,
284
+ .vue-flow__node-output.selected:hover {
285
+ box-shadow: 0 0 0 0.5px var(--vf-box-shadow);
286
+ }
287
+ .vue-flow__node-default.selected,
288
+ .vue-flow__node-default:focus,
289
+ .vue-flow__node-default:focus-visible,
290
+ .vue-flow__node-input.selected,
291
+ .vue-flow__node-input:focus,
292
+ .vue-flow__node-input:focus-visible,
293
+ .vue-flow__node-output.selected,
294
+ .vue-flow__node-output:focus,
295
+ .vue-flow__node-output:focus-visible {
296
+ outline: none;
297
+ border: 1px solid #555;
298
+ }
299
+ .vue-flow__node-default .vue-flow__handle, .vue-flow__node-input .vue-flow__handle, .vue-flow__node-output .vue-flow__handle {
300
+ background: var(--vf-handle);
301
+ }
302
+ .vue-flow__node-default.selectable:hover, .vue-flow__node-input.selectable:hover, .vue-flow__node-output.selectable:hover {
303
+ box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
304
+ }
305
+ .vue-flow__node-input {
306
+ --vf-node-color: var(--vf-node-color, #0041d0);
307
+ --vf-handle: var(--vf-node-color, #0041d0);
308
+ --vf-box-shadow: var(--vf-node-color, #0041d0);
309
+
310
+ background: var(--vf-node-bg);
311
+ border-color: var(--vf-node-color, #0041d0);
312
+ }
313
+ .vue-flow__node-input.selected,
314
+ .vue-flow__node-input:focus,
315
+ .vue-flow__node-input:focus-visible {
316
+ outline: none;
317
+ border: 1px solid var(--vf-node-color, #0041d0);
318
+ }
319
+ .vue-flow__node-default {
320
+ --vf-handle: var(--vf-node-color, #1a192b);
321
+ --vf-box-shadow: var(--vf-node-color, #1a192b);
322
+
323
+ background: var(--vf-node-bg);
324
+ border-color: var(--vf-node-color, #1a192b);
325
+ }
326
+ .vue-flow__node-default.selected,
327
+ .vue-flow__node-default:focus,
328
+ .vue-flow__node-default:focus-visible {
329
+ outline: none;
330
+ border: 1px solid var(--vf-node-color, #1a192b);
331
+ }
332
+ .vue-flow__node-output {
333
+ --vf-handle: var(--vf-node-color, #ff0072);
334
+ --vf-box-shadow: var(--vf-node-color, #ff0072);
335
+
336
+ background: var(--vf-node-bg);
337
+ border-color: var(--vf-node-color, #ff0072);
338
+ }
339
+ .vue-flow__node-output.selected,
340
+ .vue-flow__node-output:focus,
341
+ .vue-flow__node-output:focus-visible {
342
+ outline: none;
343
+ border: 1px solid var(--vf-node-color, #ff0072);
344
+ }
345
+ .vue-flow__nodesselection-rect,
346
+ .vue-flow__selection {
347
+ background: rgba(0, 89, 220, 0.08);
348
+ border: 1px dotted rgba(0, 89, 220, 0.8);
349
+ }
350
+ .vue-flow__nodesselection-rect:focus,
351
+ .vue-flow__nodesselection-rect:focus-visible,
352
+ .vue-flow__selection:focus,
353
+ .vue-flow__selection:focus-visible {
354
+ outline: none;
355
+ }
356
+ .vue-flow__handle {
357
+ width: 6px;
358
+ height: 6px;
359
+ background: var(--vf-handle);
360
+ border: 1px solid #fff;
361
+ border-radius: 100%;
362
+ }
363
+ .chart-controls-left,
364
+ .chart-controls-right {
365
+ height: 1.8em;
366
+ display: flex;
367
+ flex-direction: row;
368
+ align-items: center;
369
+ padding-top: 0.2em;
370
+ }
371
+ .chart-controls-right div {
372
+ margin-left: 5px;
373
+ }
374
+ .chart-controls {
375
+ position: absolute;
376
+ bottom: 0.5rem;
377
+ left: 0.5rem;
378
+ z-index: 10;
379
+ display: flex;
380
+ flex-direction: column;
381
+ align-items: flex-start;
382
+ gap: 0.35rem;
383
+ padding: 0.4rem 0.5rem;
384
+ background: rgba(255, 255, 255, 0.92);
385
+ border: 1px solid #ccc;
386
+ border-radius: 4px;
387
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
388
+ }
389
+ .chart-controls div {
390
+ margin-bottom: 0;
391
+ }
392
+ .defaultContainerClass {
393
+ height: 90vh;
394
+ width: 100%;
395
+ border: 1px solid #ccc;
396
+ }
397
+ .default-input-node.vue-flow__node-input,
398
+ .default-output-node.vue-flow__node-output {
399
+ border-color: #000;
400
+ }
401
+ .default-input-node.vue-flow__node-input .vue-flow__handle,
402
+ .default-output-node.vue-flow__node-output .vue-flow__handle {
403
+ background-color: #000;
404
+ }
405
+ .default-input-node.vue-flow__node-input.selected,
406
+ .default-output-node.vue-flow__node-output.selected {
407
+ box-shadow: 0 0 0 0.5px #000;
408
+ }
409
+ button.button-default {
410
+ background-color: #ffffff;
411
+ padding: 1px 12px;
412
+ border-radius: 3px;
413
+ border: 1px solid #ccc;
414
+ cursor: pointer;
415
+ white-space: nowrap;
416
+ }
417
+ button.button-default:hover {
418
+ background-color: #f2f2f2;
419
+ }
420
+ .vue-flow {
421
+ background-size: 40px 40px;
422
+ background-image:
423
+ linear-gradient(to right, #ccc 1px, transparent 1px), linear-gradient(to bottom, #ccc 1px, transparent 1px);
424
+ }
425
+ input.label-editor {
426
+ position: absolute;
427
+ }
428
+ .node-editor-wrapper {
429
+ position: relative;
430
+ }