@bemedev/mind-flow 0.0.1 → 0.1.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/README.md +95 -0
- package/lib/helpers/createContext.d.ts +5 -8
- package/lib/helpers/createContext.d.ts.map +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +240 -235
- package/lib/server.cjs.js +148 -117
- package/lib/server.es.js +148 -117
- package/lib/services/main.machine.d.ts +7 -9
- package/lib/services/main.machine.d.ts.map +1 -1
- package/lib/services/main.typings.d.ts +2 -2
- package/lib/ui/Flow.d.ts +2 -2
- package/lib/ui/Flow.d.ts.map +1 -1
- package/lib/ui/components/Bounds.d.ts +4 -4
- package/lib/ui/components/Bounds.d.ts.map +1 -1
- package/lib/ui/components/EdgeComponent.d.ts +2 -2
- package/lib/ui/components/EdgeComponent.d.ts.map +1 -1
- package/lib/ui/components/EdgesBoard.d.ts +2 -2
- package/lib/ui/components/EdgesBoard.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.context.d.ts +10 -18
- package/lib/ui/components/FlowChart.context.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.d.ts +4 -10
- package/lib/ui/components/FlowChart.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.data.d.ts +6 -10
- package/lib/ui/components/FlowChart.data.d.ts.map +1 -1
- package/lib/ui/components/NodeComponent.d.ts +2 -2
- package/lib/ui/components/NodeComponent.d.ts.map +1 -1
- package/lib/ui/components/NodesBoard.d.ts +2 -2
- package/lib/ui/components/NodesBoard.d.ts.map +1 -1
- package/lib/ui/components/classes.d.ts +2 -2
- package/package.json +2 -2
- package/src/README.md +2 -2
- package/src/helpers/createContext.ts +5 -8
- package/src/services/main.machine.ts +18 -46
- package/src/services/main.typings.ts +2 -2
- package/src/ui/Flow.tsx +3 -2
- package/src/ui/components/Bounds.tsx +35 -44
- package/src/ui/components/EdgeComponent.tsx +7 -8
- package/src/ui/components/EdgesBoard.tsx +3 -2
- package/src/ui/components/FlowChart.context.ts +56 -82
- package/src/ui/components/FlowChart.data.ts +8 -14
- package/src/ui/components/FlowChart.tsx +6 -11
- package/src/ui/components/NodeComponent.tsx +13 -25
- package/src/ui/components/NodesBoard.tsx +109 -111
- package/src/ui/components/classes.ts +2 -2
package/lib/server.es.js
CHANGED
|
@@ -10,8 +10,8 @@ import { DragDropProvider, DragDropSensors, DragOverlay, createDraggable, useDra
|
|
|
10
10
|
import { dequal as dequal$1 } from "dequal";
|
|
11
11
|
//#region src/ui/components/classes.ts
|
|
12
12
|
/**
|
|
13
|
-
* List of Tailwind CSS class names used across flowchart UI components to
|
|
14
|
-
*
|
|
13
|
+
* List of Tailwind CSS class names used across flowchart UI components to ensure
|
|
14
|
+
* compilation safelist.
|
|
15
15
|
*/
|
|
16
16
|
var CLASSES = [
|
|
17
17
|
"fill-transparent",
|
|
@@ -97,19 +97,16 @@ var CLASSES = [
|
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/helpers/createContext.ts
|
|
99
99
|
/**
|
|
100
|
-
* Creates a Solid context provider component and a custom hook to consume
|
|
101
|
-
* it.
|
|
100
|
+
* Creates a Solid context provider component and a custom hook to consume it.
|
|
102
101
|
*
|
|
103
102
|
* @template T - The type of the context value.
|
|
104
103
|
*
|
|
105
|
-
* @param context - Factory function returning a non-nullable context value
|
|
106
|
-
*
|
|
107
|
-
* @param options - Optional context configuration of type
|
|
108
|
-
* {@linkcode Options}.
|
|
104
|
+
* @param context - Factory function returning a non-nullable context value of type
|
|
105
|
+
* `NonNullable<T>`.
|
|
106
|
+
* @param options - Optional context configuration of type {@linkcode Options}.
|
|
109
107
|
*
|
|
110
108
|
* @returns A tuple containing the Provider component of type
|
|
111
|
-
* {@linkcode ParentComponent}, the accessor hook, and the Solid context
|
|
112
|
-
* object.
|
|
109
|
+
* {@linkcode ParentComponent}, the accessor hook, and the Solid context object.
|
|
113
110
|
*/
|
|
114
111
|
var createContext$1 = (context, options) => {
|
|
115
112
|
const _context = createContext(context(), options);
|
|
@@ -167,8 +164,7 @@ type({
|
|
|
167
164
|
//#endregion
|
|
168
165
|
//#region src/services/main.machine.ts
|
|
169
166
|
/**
|
|
170
|
-
* Constructs a unique edge identifier string from source and destination
|
|
171
|
-
* node IDs.
|
|
167
|
+
* Constructs a unique edge identifier string from source and destination node IDs.
|
|
172
168
|
*
|
|
173
169
|
* @param out - The source node ID string.
|
|
174
170
|
* @param _in - The destination node ID string.
|
|
@@ -189,8 +185,8 @@ var buildNodeID = (generated) => {
|
|
|
189
185
|
return `node-${generated}`;
|
|
190
186
|
};
|
|
191
187
|
/**
|
|
192
|
-
* State machine managing flowchart state transitions, nodes, edges,
|
|
193
|
-
*
|
|
188
|
+
* State machine managing flowchart state transitions, nodes, edges, selection, and
|
|
189
|
+
* layout actions.
|
|
194
190
|
*/
|
|
195
191
|
var machine = createMachine({
|
|
196
192
|
initial: "idle",
|
|
@@ -207,15 +203,10 @@ var machine = createMachine({
|
|
|
207
203
|
target: "/working"
|
|
208
204
|
} },
|
|
209
205
|
working: { on: {
|
|
210
|
-
MOVE: {
|
|
211
|
-
actions: ["moveNode", "buildUI"],
|
|
212
|
-
target: "/construction"
|
|
213
|
-
},
|
|
214
206
|
MOVE_IMMEDIATE: { actions: [{
|
|
215
207
|
name: "buildImmediateUI",
|
|
216
208
|
description: "Must be in the ui"
|
|
217
209
|
}] },
|
|
218
|
-
UPDATE_UI: "/construction",
|
|
219
210
|
ADD_CHILD: {
|
|
220
211
|
actions: [
|
|
221
212
|
"generateID",
|
|
@@ -249,6 +240,10 @@ var machine = createMachine({
|
|
|
249
240
|
],
|
|
250
241
|
target: "/construction"
|
|
251
242
|
},
|
|
243
|
+
MOVE: {
|
|
244
|
+
actions: ["moveNode", "buildUI"],
|
|
245
|
+
target: "/construction"
|
|
246
|
+
},
|
|
252
247
|
ADD_EDGE: {
|
|
253
248
|
actions: ["addEdge"],
|
|
254
249
|
target: "/construction"
|
|
@@ -286,6 +281,7 @@ var machine = createMachine({
|
|
|
286
281
|
DESELECT: "never",
|
|
287
282
|
ADD_EDGE: use(extremities)
|
|
288
283
|
})),
|
|
284
|
+
sync: true,
|
|
289
285
|
pContext: type(({ union }) => ({ generatedId: union("string", "null") })),
|
|
290
286
|
context: type(({ optional, use, array }) => ({
|
|
291
287
|
data: optional({
|
|
@@ -300,8 +296,7 @@ var machine = createMachine({
|
|
|
300
296
|
}),
|
|
301
297
|
selected: optional("string"),
|
|
302
298
|
updatingUI: optional("boolean")
|
|
303
|
-
}))
|
|
304
|
-
sync: true
|
|
299
|
+
}))
|
|
305
300
|
}).provideOptions(({ assign, batch, erase }) => ({ actions: {
|
|
306
301
|
configure: batch(assign("context.data", () => ({
|
|
307
302
|
nodes: [],
|
|
@@ -385,12 +380,12 @@ var getDefaultOutputOffset = (width = 0) => ({
|
|
|
385
380
|
y: 18
|
|
386
381
|
});
|
|
387
382
|
/**
|
|
388
|
-
* Boundary padding constraints for node dragging and positioning within
|
|
389
|
-
*
|
|
383
|
+
* Boundary padding constraints for node dragging and positioning within the
|
|
384
|
+
* viewport.
|
|
390
385
|
*/
|
|
391
386
|
var BOUNDS_CONSTRAINTS = {
|
|
392
|
-
horizontal:
|
|
393
|
-
vertical:
|
|
387
|
+
horizontal: 55,
|
|
388
|
+
vertical: 40
|
|
394
389
|
};
|
|
395
390
|
/** Default node items provided when no initial configuration is given. */
|
|
396
391
|
var DEFAULT_NODES = [{
|
|
@@ -408,18 +403,18 @@ var DEFAULT_NODES = [{
|
|
|
408
403
|
//#endregion
|
|
409
404
|
//#region src/ui/components/FlowChart.context.ts
|
|
410
405
|
/**
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*/
|
|
414
|
-
var service = interpret(machine, {
|
|
415
|
-
context: {},
|
|
416
|
-
pContext: { generatedId: null }
|
|
417
|
-
});
|
|
418
|
-
/**
|
|
419
|
-
* Solid Context Provider component and hook for accessing flowchart board
|
|
420
|
-
* state, services, and zoom.
|
|
406
|
+
* Solid Context Provider component and hook for accessing flowchart board state,
|
|
407
|
+
* services, and zoom.
|
|
421
408
|
*/
|
|
422
409
|
var [Provider, useFlow] = createContext$1(() => {
|
|
410
|
+
/**
|
|
411
|
+
* Shared state machine interpreter service instance for flowchart state
|
|
412
|
+
* management.
|
|
413
|
+
*/
|
|
414
|
+
const service = interpret(machine, {
|
|
415
|
+
context: {},
|
|
416
|
+
pContext: { generatedId: null }
|
|
417
|
+
});
|
|
423
418
|
const zoom = createSignal(1);
|
|
424
419
|
const newEdge = createSignal();
|
|
425
420
|
const [boardRef, setBoardRef] = createSignal();
|
|
@@ -433,8 +428,8 @@ var [Provider, useFlow] = createContext$1(() => {
|
|
|
433
428
|
const rect = el.getBoundingClientRect();
|
|
434
429
|
const currentZoom = zoom[0]();
|
|
435
430
|
return {
|
|
436
|
-
x:
|
|
437
|
-
y:
|
|
431
|
+
x: clientX - rect.left / currentZoom,
|
|
432
|
+
y: clientY - rect.top / currentZoom
|
|
438
433
|
};
|
|
439
434
|
};
|
|
440
435
|
const [edgesPositions, setEdgesPositions] = createSignal({}, { equals: false });
|
|
@@ -517,9 +512,7 @@ var [Provider, useFlow] = createContext$1(() => {
|
|
|
517
512
|
buildUI: batch(voidAction(({ context: { data } }) => {
|
|
518
513
|
const edges = data?.edges ?? [];
|
|
519
514
|
setEdgesPositions((data) => {
|
|
520
|
-
const array = Object.entries({ ...data }).filter(([id]) =>
|
|
521
|
-
return edges?.some((edge) => edge.id === id);
|
|
522
|
-
});
|
|
515
|
+
const array = Object.entries({ ...data }).filter(([id]) => edges.some((edge) => edge.id === id));
|
|
523
516
|
return Object.fromEntries(array);
|
|
524
517
|
});
|
|
525
518
|
}), voidAction({
|
|
@@ -638,17 +631,18 @@ var [Provider, useFlow] = createContext$1(() => {
|
|
|
638
631
|
getBoardPoint,
|
|
639
632
|
edgesPositions: [edgesPositions, setEdgesPositions],
|
|
640
633
|
service,
|
|
641
|
-
zoom
|
|
634
|
+
zoom,
|
|
635
|
+
clampPosition
|
|
642
636
|
};
|
|
643
637
|
}, { name: "FlowContext" });
|
|
644
638
|
//#endregion
|
|
645
639
|
//#region src/ui/components/Bounds.tsx
|
|
646
640
|
/**
|
|
647
|
-
* Drag boundary transformer component that clamps draggable nodes within
|
|
648
|
-
*
|
|
641
|
+
* Drag boundary transformer component that clamps draggable nodes within container
|
|
642
|
+
* scroll bounds.
|
|
649
643
|
*
|
|
650
|
-
* @returns `null` as this component performs side-effect transformer
|
|
651
|
-
*
|
|
644
|
+
* @returns `null` as this component performs side-effect transformer registrations
|
|
645
|
+
* only.
|
|
652
646
|
*/
|
|
653
647
|
var DragBounds = () => {
|
|
654
648
|
const { board: [ref], zoom: [zoom] } = useFlow();
|
|
@@ -657,23 +651,23 @@ var DragBounds = () => {
|
|
|
657
651
|
id: "clamp-to-container",
|
|
658
652
|
order: 100,
|
|
659
653
|
callback: (transform) => {
|
|
660
|
-
const container = ref()
|
|
654
|
+
const container = ref();
|
|
661
655
|
const activeDraggable = state.active.draggable;
|
|
662
656
|
if (!container || !activeDraggable) return transform;
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
const innerLeft = containerRect.left + container.clientLeft;
|
|
666
|
-
const innerTop = containerRect.top + container.clientTop;
|
|
667
|
-
const innerRight = innerLeft + container.clientWidth;
|
|
668
|
-
const innerBottom = innerTop + container.clientHeight;
|
|
657
|
+
const node = activeDraggable.node;
|
|
658
|
+
if (!node) return transform;
|
|
669
659
|
const currentZoom = zoom();
|
|
670
|
-
const
|
|
671
|
-
const
|
|
672
|
-
const
|
|
673
|
-
const
|
|
660
|
+
const minBoardX = BOUNDS_CONSTRAINTS.horizontal;
|
|
661
|
+
const maxBoardX = Math.max(minBoardX, container.clientWidth / currentZoom - node.offsetWidth - BOUNDS_CONSTRAINTS.horizontal);
|
|
662
|
+
const minBoardY = BOUNDS_CONSTRAINTS.vertical;
|
|
663
|
+
const maxBoardY = Math.max(minBoardY, container.clientHeight / currentZoom - node.offsetHeight - BOUNDS_CONSTRAINTS.vertical);
|
|
664
|
+
const minTransformX = (minBoardX - node.offsetLeft) * currentZoom;
|
|
665
|
+
const maxTransformX = (maxBoardX - node.offsetLeft) * currentZoom;
|
|
666
|
+
const minTransformY = (minBoardY - node.offsetTop) * currentZoom;
|
|
667
|
+
const maxTransformY = (maxBoardY - node.offsetTop) * currentZoom;
|
|
674
668
|
return {
|
|
675
|
-
x: Math.min(Math.max(transform.x,
|
|
676
|
-
y: Math.min(Math.max(transform.y,
|
|
669
|
+
x: Math.min(Math.max(transform.x, minTransformX), maxTransformX),
|
|
670
|
+
y: Math.min(Math.max(transform.y, minTransformY), maxTransformY)
|
|
677
671
|
};
|
|
678
672
|
}
|
|
679
673
|
};
|
|
@@ -694,7 +688,7 @@ var _tmpl$$4 = [
|
|
|
694
688
|
"\"",
|
|
695
689
|
"></path>"
|
|
696
690
|
];
|
|
697
|
-
var _tmpl$2$
|
|
691
|
+
var _tmpl$2$2 = [
|
|
698
692
|
"<g",
|
|
699
693
|
" cursor=\"pointer\" transform=\"",
|
|
700
694
|
"\" style=\"",
|
|
@@ -709,8 +703,8 @@ var _tmpl$2$1 = [
|
|
|
709
703
|
*/
|
|
710
704
|
var calculateOffset = (value) => value * 100 / 200;
|
|
711
705
|
/**
|
|
712
|
-
* Generates an SVG cubic bezier path `d` string between coordinates `(x0,
|
|
713
|
-
*
|
|
706
|
+
* Generates an SVG cubic bezier path `d` string between coordinates `(x0, y0)` and
|
|
707
|
+
* `(x1, y1)`.
|
|
714
708
|
*
|
|
715
709
|
* @param vector - Vector coordinates of type {@linkcode Vector}.
|
|
716
710
|
*
|
|
@@ -720,8 +714,8 @@ var draw = ({ x0, y0, x1, y1 }) => {
|
|
|
720
714
|
return `M ${x0} ${y0} C ${x0 + calculateOffset(Math.abs(x1 - x0))} ${y0}, ${x1 - calculateOffset(Math.abs(x1 - x0))} ${y1}, ${x1} ${y1}`;
|
|
721
715
|
};
|
|
722
716
|
/**
|
|
723
|
-
* SVG edge component rendering bezier curves and delete interaction
|
|
724
|
-
*
|
|
717
|
+
* SVG edge component rendering bezier curves and delete interaction handles for node
|
|
718
|
+
* connections.
|
|
725
719
|
*
|
|
726
720
|
* @param props - Edge properties of type {@linkcode Props}.
|
|
727
721
|
*
|
|
@@ -747,7 +741,7 @@ var EdgeComponent = (props) => {
|
|
|
747
741
|
return selected();
|
|
748
742
|
},
|
|
749
743
|
get children() {
|
|
750
|
-
return ssr(_tmpl$2$
|
|
744
|
+
return ssr(_tmpl$2$2, ssrHydrationKey(), `translate(${escape(middlePoint().x, true)}, ${escape(middlePoint().y, true)})`, ssrStyleProperty("pointer-events:", "all") + ssrStyleProperty(";z-index:", "30"));
|
|
751
745
|
}
|
|
752
746
|
})];
|
|
753
747
|
};
|
|
@@ -760,8 +754,8 @@ var _tmpl$$3 = [
|
|
|
760
754
|
"<!--/--></svg>"
|
|
761
755
|
];
|
|
762
756
|
/**
|
|
763
|
-
* SVG board overlay component that renders all active connecting edges and
|
|
764
|
-
*
|
|
757
|
+
* SVG board overlay component that renders all active connecting edges and ongoing
|
|
758
|
+
* edge creation previews.
|
|
765
759
|
*
|
|
766
760
|
* @returns The rendered SVG JSX element.
|
|
767
761
|
*/
|
|
@@ -811,13 +805,13 @@ var _tmpl$$2 = [
|
|
|
811
805
|
" class=\"cursor-pointer overflow-visible rounded-full bg-green-500 p-0.5 text-center font-bold hover:bg-green-600\" style=\"",
|
|
812
806
|
"\" viewBox=\"0 0 1024 1024\" preserveAspectRatio=\"xMaxYMax\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"white\"><g id=\"background\"><path d=\"M467.40667,277.66696c-0.05948,-14.53055 5.75527,-22.95613 -8.62044,-20.90487c-112.55699,16.0607 -222.1609,112.14558 -245.06161,239.85765c-46.52056,259.43466 231.33083,443.06705 449.51209,316.97506c117.31668,-67.80002 160.95215,-190.43324 151.34416,-288.29849c-5.92276,-60.32819 -27.80273,-107.95668 -53.44246,-144.25469l59.39269,-42.05363c111.72214,156.309 73.11535,351.55635 -25.06953,459.45565c-184.18877,202.4124 -470.46624,145.52064 -592.95027,-32.92123c-156.18269,-227.53604 -27.15324,-543.64371 261.18883,-582.44416c5.0579,-0.68061 3.56556,-7.04079 3.56442,-8.58985c-0.05594,-76.3354 -0.11021,-76.7687 1.10909,-77.24589c2.06886,-0.80969 151.41433,118.4561 151.92482,118.95524c4.65592,4.55233 -0.99548,7.829 -29.07828,30.50907c-120.49369,97.31245 -120.4977,98.55675 -123.0691,97.87586c-0.43639,-0.11555 -0.80698,-0.31322 -0.74442,-66.91571Z\"></path><path d=\"M316.61562,611.03414c0.11517,-90.16257 -0.25516,-99.92912 0.64739,-101.78856c1.56486,-3.22393 131.99102,0.91032 134.6959,-1.89763c2.21336,-2.2977 -0.59362,-129.97807 1.1376,-132.37034c0.7253,-1.00225 11.10552,-0.99175 12.07474,-0.99077c104.50336,0.10564 104.90098,-0.37811 105.967,0.85765c1.56461,1.81373 0.25596,114.18436 0.67852,129.81412c0.1322,4.88975 3.22386,3.28152 99.72028,3.4563c33.0841,0.05992 36.14259,-1.40368 36.21852,4.50462c0.11713,9.11348 1.41954,110.45369 -0.40274,113.92715c-1.81106,3.45208 -130.39967,-0.42618 -134.48289,1.62075c-2.29035,1.14816 -0.36989,101.12392 -1.11542,130.51904c-0.09548,3.76459 -2.13506,3.20617 -47.84854,3.17365c-69.30253,-0.0493 -69.31099,-0.25627 -69.65762,-0.42191c-3.77927,-1.80595 0.16287,-129.33555 -2.24266,-132.58994c-1.79931,-2.43424 -124.06108,-0.29118 -132.80252,-0.97392c-3.81102,-0.29766 -2.58229,-14.8847 -2.58758,-16.8402Z\"></path></g></svg>"
|
|
813
807
|
];
|
|
814
|
-
var _tmpl$2 = [
|
|
808
|
+
var _tmpl$2$1 = [
|
|
815
809
|
"<div",
|
|
816
810
|
" id=\"outputs\" class=\"pointer-events-none absolute top-0 z-10 flex cursor-default flex-col\" style=\"",
|
|
817
811
|
"\"><div class=\"cursor-default rounded-full bg-[#e38b29] shadow-md\" style=\"",
|
|
818
812
|
"\"></div></div>"
|
|
819
813
|
];
|
|
820
|
-
var _tmpl$3 = [
|
|
814
|
+
var _tmpl$3$1 = [
|
|
821
815
|
"<div",
|
|
822
816
|
" class=\"",
|
|
823
817
|
"\" style=\"",
|
|
@@ -843,8 +837,8 @@ var _tmpl$5 = [
|
|
|
843
837
|
"</div>"
|
|
844
838
|
];
|
|
845
839
|
/**
|
|
846
|
-
* Interactive flowchart node component supporting dragging, selection,
|
|
847
|
-
*
|
|
840
|
+
* Interactive flowchart node component supporting dragging, selection, handle
|
|
841
|
+
* connections, and child/sibling creation.
|
|
848
842
|
*
|
|
849
843
|
* @param props - Node rendering properties of type {@linkcode Props}.
|
|
850
844
|
*
|
|
@@ -854,17 +848,17 @@ var NodeComponent = (props) => {
|
|
|
854
848
|
const [ref, setRef] = createSignal();
|
|
855
849
|
const { dimensions: [dimensions, setDimensions], newEdge: [newEdge, setNewEdge], getBoardPoint, service, zoom: [zoom] } = useFlow();
|
|
856
850
|
const selected = useState(service, { selector: (s) => s.context.selected === props.id });
|
|
857
|
-
|
|
851
|
+
onMount(() => {
|
|
858
852
|
ref();
|
|
859
853
|
zoom();
|
|
860
854
|
});
|
|
861
855
|
const hasParent = useState(service, { selector: ({ context: { data } }) => {
|
|
862
856
|
const edges = data?.edges;
|
|
863
857
|
if (!edges) return false;
|
|
864
|
-
return
|
|
858
|
+
return edges.some(({ to }) => to === props.id);
|
|
865
859
|
} });
|
|
866
860
|
createDraggable(props.id);
|
|
867
|
-
return ssr(_tmpl$3, ssrHydrationKey() + ssrAttribute("id", escape(props.id, true), false), `flex flex-col absolute cursor-grab bg-white rounded-md shadow-md select-none transition-[border,box-shadow] duration-200 ease-in-out hover:shadow-lg draggable ${selected() ? "border border-[#e38c29] z-[100]" : ""} ${!selected() ? "border border-[#e6d4be] z-[1]" : ""} min-w-48`, ssrStyleProperty("top:", `${escape(props.y, true)}px`) + ssrStyleProperty(";left:", `${escape(props.x, true)}px`), `pointer-events-none absolute flex items-center justify-end -top-7.5 right-0 transition-all duration-200 ease-in-out space-x-2 ${selected() ? "w-full opacity-100" : ""} ${!selected() ? "w-0 -right-3 opacity-0 overflow-hidden" : ""}`, ssrStyleProperty("overflow:", "visible") + ssrStyleProperty(";pointer-events:", "all") + ssrStyleProperty(";width:", `${escape(12, true) * 2}px`) + ssrStyleProperty(";height:", `${escape(12, true) * 2}px`), escape(createComponent(Show, {
|
|
861
|
+
return ssr(_tmpl$3$1, ssrHydrationKey() + ssrAttribute("id", escape(props.id, true), false), `flex flex-col absolute cursor-grab bg-white rounded-md shadow-md select-none transition-[border,box-shadow] duration-200 ease-in-out hover:shadow-lg draggable ${selected() ? "border border-[#e38c29] z-[100]" : ""} ${!selected() ? "border border-[#e6d4be] z-[1]" : ""} min-w-48`, ssrStyleProperty("top:", `${escape(props.y, true)}px`) + ssrStyleProperty(";left:", `${escape(props.x, true)}px`), `pointer-events-none absolute flex items-center justify-end -top-7.5 right-0 transition-all duration-200 ease-in-out space-x-2 ${selected() ? "w-full opacity-100" : ""} ${!selected() ? "w-0 -right-3 opacity-0 overflow-hidden" : ""}`, ssrStyleProperty("overflow:", "visible") + ssrStyleProperty(";pointer-events:", "all") + ssrStyleProperty(";width:", `${escape(12, true) * 2}px`) + ssrStyleProperty(";height:", `${escape(12, true) * 2}px`), escape(createComponent(Show, {
|
|
868
862
|
get when() {
|
|
869
863
|
return hasParent();
|
|
870
864
|
},
|
|
@@ -888,7 +882,7 @@ var NodeComponent = (props) => {
|
|
|
888
882
|
return props.input || hasParent();
|
|
889
883
|
},
|
|
890
884
|
get children() {
|
|
891
|
-
return ssr(_tmpl$2, ssrHydrationKey(), ssrStyleProperty("left:", `-${escape(18, true)}px`), ssrStyleProperty("width:", `${escape(12, true)}px`) + ssrStyleProperty(";height:", `${escape(12, true)}px`) + ssrStyleProperty(";margin-top:", `${escape(12, true)}px`) + ssrStyleProperty(";pointer-events:", "all"));
|
|
885
|
+
return ssr(_tmpl$2$1, ssrHydrationKey(), ssrStyleProperty("left:", `-${escape(18, true)}px`), ssrStyleProperty("width:", `${escape(12, true)}px`) + ssrStyleProperty(";height:", `${escape(12, true)}px`) + ssrStyleProperty(";margin-top:", `${escape(12, true)}px`) + ssrStyleProperty(";pointer-events:", "all"));
|
|
892
886
|
}
|
|
893
887
|
})), ssrStyleProperty("right:", `-${escape(18, true)}px`), ssrStyleProperty("width:", `${escape(12, true)}px`) + ssrStyleProperty(";height:", `${escape(12, true)}px`) + ssrStyleProperty(";margin-top:", `${escape(12, true)}px`) + ssrStyleProperty(";pointer-events:", "all"));
|
|
894
888
|
};
|
|
@@ -896,22 +890,33 @@ var NodeComponent = (props) => {
|
|
|
896
890
|
//#region src/ui/components/NodesBoard.tsx
|
|
897
891
|
var _tmpl$$1 = [
|
|
898
892
|
"<div",
|
|
899
|
-
" class=\"relative
|
|
900
|
-
"<!--/--><!--$-->",
|
|
893
|
+
" class=\"relative h-full w-full overflow-scroll rounded-lg border-2 border-gray-600\"><!--$-->",
|
|
901
894
|
"<!--/--><div class=\"",
|
|
902
895
|
"\" style=\"",
|
|
896
|
+
"\"><div class=\"relative h-full w-full\" style=\"",
|
|
903
897
|
"\"><!--$-->",
|
|
904
898
|
"<!--/--><!--$-->",
|
|
905
|
-
"
|
|
906
|
-
"
|
|
899
|
+
"<!--/--><!--$-->",
|
|
900
|
+
"<!--/--></div></div></div>"
|
|
901
|
+
];
|
|
902
|
+
var _tmpl$2 = [
|
|
903
|
+
"<div",
|
|
904
|
+
" class=\"absolute right-4 bottom-4 z-50 flex items-center gap-2 rounded-xl border border-gray-200 bg-white/90 p-2 shadow-lg backdrop-blur-md\"><button type=\"button\" class=\"flex size-9 cursor-pointer items-center justify-center rounded-lg bg-gray-100 text-lg font-bold text-gray-700 shadow-sm transition-all duration-150 hover:bg-gray-200 active:scale-95\" title=\"Zoom out\" aria-label=\"Zoom out\">-</button><button type=\"button\" class=\"h-9 cursor-pointer rounded-lg px-2 text-xs font-semibold text-gray-700 transition-colors hover:bg-gray-100\" title=\"Reset zoom\" aria-label=\"Reset zoom\"><!--$-->",
|
|
905
|
+
"<!--/-->%</button><button type=\"button\" class=\"flex size-9 cursor-pointer items-center justify-center rounded-lg bg-gray-100 text-lg font-bold text-gray-700 shadow-sm transition-all duration-150 hover:bg-gray-200 active:scale-95\" title=\"Zoom in\" aria-label=\"Zoom in\">+</button><div class=\"h-5 w-px bg-gray-300\"></div><button type=\"button\" class=\"flex size-9 cursor-pointer items-center justify-center rounded-lg bg-blue-600 text-white shadow transition-all duration-150 hover:bg-blue-700 active:scale-95\" title=\"Add parent node\" aria-label=\"Add parent node\"><svg class=\"size-5\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"></path></svg></button></div>"
|
|
906
|
+
];
|
|
907
|
+
var _tmpl$3 = [
|
|
908
|
+
"<div",
|
|
909
|
+
" class=\"relative mx-auto h-[calc(100vh-64px)] w-[calc(100vw-32px)] overflow-hidden\">",
|
|
910
|
+
"</div>"
|
|
907
911
|
];
|
|
908
912
|
/**
|
|
909
|
-
* Interactive board component containing the drag-drop viewport, zoom
|
|
910
|
-
*
|
|
913
|
+
* Interactive board component containing the drag-drop viewport, zoom controls,
|
|
914
|
+
* panning gestures, and rendered nodes/edges.
|
|
911
915
|
*
|
|
912
916
|
* @returns The rendered Solid component.
|
|
913
917
|
*/
|
|
914
918
|
var NodesBoard = () => {
|
|
919
|
+
let containerRef;
|
|
915
920
|
const [isPanning, setIsPanning] = createSignal(false);
|
|
916
921
|
const [transform, setTransform] = createSignal({
|
|
917
922
|
x: 0,
|
|
@@ -919,10 +924,15 @@ var NodesBoard = () => {
|
|
|
919
924
|
});
|
|
920
925
|
const [id, setId] = createSignal("");
|
|
921
926
|
const [previousZoom, setPreviousZoom] = createSignal();
|
|
922
|
-
let
|
|
923
|
-
|
|
927
|
+
let percentX = 0;
|
|
928
|
+
let percentY = 0;
|
|
924
929
|
const { board: [, setRef], service, newEdge: [newEdge], zoom: [zoom, setZoom] } = useFlow();
|
|
925
|
-
createEffect(on(zoom, () => {
|
|
930
|
+
createEffect(on(zoom, () => {
|
|
931
|
+
const maxScrollX = containerRef.scrollWidth - containerRef.clientWidth;
|
|
932
|
+
const maxScrollY = containerRef.scrollHeight - containerRef.clientHeight;
|
|
933
|
+
if (maxScrollX > 0) containerRef.scrollLeft = percentX * maxScrollX;
|
|
934
|
+
if (maxScrollY > 0) containerRef.scrollTop = percentY * maxScrollY;
|
|
935
|
+
}, { defer: true }));
|
|
926
936
|
const selectedId = useState(service, { selector: (s) => s.context?.selected });
|
|
927
937
|
const selected = (id) => selectedId() === id;
|
|
928
938
|
const nodes = useState(service, {
|
|
@@ -938,21 +948,27 @@ var NodesBoard = () => {
|
|
|
938
948
|
},
|
|
939
949
|
equals: dequal$1
|
|
940
950
|
});
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
return createComponent(DragDropProvider, {
|
|
947
|
-
onDragMove: ({ draggable: { transform: _transform, node, id }
|
|
951
|
+
const CANVAS_SIZE = 500;
|
|
952
|
+
const MARGIN_X = 265;
|
|
953
|
+
const MARGIN_Y = 425;
|
|
954
|
+
const cWidth = () => `calc((${CANVAS_SIZE}vw - ${MARGIN_X}px) * ${zoom()})`;
|
|
955
|
+
const cHeight = () => `calc((${CANVAS_SIZE}vh - ${MARGIN_Y}px) * ${zoom()})`;
|
|
956
|
+
return ssr(_tmpl$3, ssrHydrationKey(), escape(createComponent(DragDropProvider, {
|
|
957
|
+
onDragMove: ({ draggable: { transform: _transform, node, id } }) => {
|
|
948
958
|
setId(id);
|
|
949
959
|
if (selected(id)) {
|
|
950
|
-
const
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
const
|
|
960
|
+
const grandParent = node.parentElement?.parentElement;
|
|
961
|
+
const currentZoom = zoom();
|
|
962
|
+
const minX = 0;
|
|
963
|
+
const maxX = grandParent ? Math.max(0, grandParent.clientWidth / currentZoom - node.offsetWidth) : Infinity;
|
|
964
|
+
const minY = 0;
|
|
965
|
+
const maxY = grandParent ? Math.max(0, grandParent.clientHeight / currentZoom - node.offsetHeight) : Infinity;
|
|
966
|
+
const targetX = node.offsetLeft + _transform.x / currentZoom;
|
|
967
|
+
const targetY = node.offsetTop + _transform.y / currentZoom;
|
|
968
|
+
const x = Math.min(Math.max(targetX, minX), maxX);
|
|
969
|
+
const y = Math.min(Math.max(targetY, minY), maxY);
|
|
970
|
+
const deltaX = x - node.offsetLeft;
|
|
971
|
+
const deltaY = y - node.offsetTop;
|
|
956
972
|
node.style.setProperty("transform", `translate3d(${deltaX}px, ${deltaY}px, 0)`);
|
|
957
973
|
service.send({
|
|
958
974
|
type: "MOVE_IMMEDIATE",
|
|
@@ -962,13 +978,24 @@ var NodesBoard = () => {
|
|
|
962
978
|
y
|
|
963
979
|
}
|
|
964
980
|
});
|
|
965
|
-
setTransform({
|
|
981
|
+
setTransform({
|
|
982
|
+
x: deltaX * currentZoom,
|
|
983
|
+
y: deltaY * currentZoom
|
|
984
|
+
});
|
|
966
985
|
}
|
|
967
986
|
},
|
|
968
987
|
onDragEnd: ({ draggable: { node, id } }) => {
|
|
969
988
|
if (!selected(id)) return;
|
|
970
|
-
const
|
|
971
|
-
const
|
|
989
|
+
const grandParent = node.parentElement?.parentElement;
|
|
990
|
+
const currentZoom = zoom();
|
|
991
|
+
const minX = 0;
|
|
992
|
+
const maxX = grandParent ? Math.max(0, grandParent.clientWidth / currentZoom - node.offsetWidth) : Infinity;
|
|
993
|
+
const minY = 0;
|
|
994
|
+
const maxY = grandParent ? Math.max(0, grandParent.clientHeight / currentZoom - node.offsetHeight) : Infinity;
|
|
995
|
+
const rawX = node.offsetLeft + transform().x / currentZoom;
|
|
996
|
+
const rawY = node.offsetTop + transform().y / currentZoom;
|
|
997
|
+
const X = Math.min(Math.max(rawX, minX), maxX);
|
|
998
|
+
const Y = Math.min(Math.max(rawY, minY), maxY);
|
|
972
999
|
node.style.setProperty("top", Y + "px");
|
|
973
1000
|
node.style.setProperty("left", X + "px");
|
|
974
1001
|
node.style.removeProperty("transform");
|
|
@@ -988,21 +1015,25 @@ var NodesBoard = () => {
|
|
|
988
1015
|
}, 0);
|
|
989
1016
|
},
|
|
990
1017
|
get children() {
|
|
991
|
-
return [
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1018
|
+
return [
|
|
1019
|
+
ssr(_tmpl$$1, ssrHydrationKey(), escape(createComponent(DragDropSensors, {})), `relative cursor-crosshair overflow-hidden ${isPanning() ? "cursor-grabbing" : ""}`, ssrStyleProperty("height:", escape(cHeight(), true)) + ssrStyleProperty(";width:", escape(cWidth(), true)), ssrStyleProperty("scale:", escape(zoom(), true)) + ssrStyleProperty(";transform-origin:", "top left"), escape(createComponent(DragBounds, {})), escape(createComponent(EdgesBoard, {})), escape(createComponent(For, {
|
|
1020
|
+
get each() {
|
|
1021
|
+
return nodes();
|
|
1022
|
+
},
|
|
1023
|
+
children: NodeComponent
|
|
1024
|
+
}))),
|
|
1025
|
+
ssr(_tmpl$2, ssrHydrationKey(), escape(Math.round(zoom() * 100))),
|
|
1026
|
+
createComponent(Show, {
|
|
1027
|
+
get when() {
|
|
1028
|
+
return !id() || !selected(id());
|
|
1029
|
+
},
|
|
1030
|
+
get children() {
|
|
1031
|
+
return createComponent(DragOverlay, { children: "" });
|
|
1032
|
+
}
|
|
1033
|
+
})
|
|
1034
|
+
];
|
|
1004
1035
|
}
|
|
1005
|
-
});
|
|
1036
|
+
})));
|
|
1006
1037
|
};
|
|
1007
1038
|
//#endregion
|
|
1008
1039
|
//#region src/ui/components/FlowChart.tsx
|
|
@@ -1013,8 +1044,8 @@ var _tmpl$ = [
|
|
|
1013
1044
|
"</div></div>"
|
|
1014
1045
|
];
|
|
1015
1046
|
/**
|
|
1016
|
-
* Flowchart board canvas component that renders interactive nodes, edges,
|
|
1017
|
-
*
|
|
1047
|
+
* Flowchart board canvas component that renders interactive nodes, edges, pan/zoom,
|
|
1048
|
+
* and toolbar controls.
|
|
1018
1049
|
*
|
|
1019
1050
|
* @param props - Flowchart configuration and event handlers of type
|
|
1020
1051
|
* {@linkcode FlowProps}.
|
|
@@ -1041,8 +1072,8 @@ var FlowChart = (props) => {
|
|
|
1041
1072
|
//#endregion
|
|
1042
1073
|
//#region src/ui/Flow.tsx
|
|
1043
1074
|
/**
|
|
1044
|
-
* Root Flow component wrapping the {@linkcode FlowChart} inside the flow
|
|
1045
|
-
*
|
|
1075
|
+
* Root Flow component wrapping the {@linkcode FlowChart} inside the flow context
|
|
1076
|
+
* provider.
|
|
1046
1077
|
*
|
|
1047
1078
|
* @param props - Flow chart configuration and callbacks of type
|
|
1048
1079
|
* {@linkcode FlowProps}.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Constructs a unique edge identifier string from source and destination
|
|
3
|
-
* node IDs.
|
|
2
|
+
* Constructs a unique edge identifier string from source and destination node IDs.
|
|
4
3
|
*
|
|
5
4
|
* @param out - The source node ID string.
|
|
6
5
|
* @param _in - The destination node ID string.
|
|
@@ -17,8 +16,8 @@ export declare const buildEdgeId: (out: string, _in: string) => string;
|
|
|
17
16
|
*/
|
|
18
17
|
export declare const buildNodeID: (generated?: string | null) => string;
|
|
19
18
|
/**
|
|
20
|
-
* State machine managing flowchart state transitions, nodes, edges,
|
|
21
|
-
*
|
|
19
|
+
* State machine managing flowchart state transitions, nodes, edges, selection, and
|
|
20
|
+
* layout actions.
|
|
22
21
|
*/
|
|
23
22
|
export declare const machine: import('@bemedev/app').SyncMachine<{
|
|
24
23
|
readonly initial: "idle";
|
|
@@ -40,17 +39,12 @@ export declare const machine: import('@bemedev/app').SyncMachine<{
|
|
|
40
39
|
};
|
|
41
40
|
readonly working: {
|
|
42
41
|
readonly on: {
|
|
43
|
-
readonly MOVE: {
|
|
44
|
-
readonly actions: readonly ["moveNode", "buildUI"];
|
|
45
|
-
readonly target: "/construction";
|
|
46
|
-
};
|
|
47
42
|
readonly MOVE_IMMEDIATE: {
|
|
48
43
|
readonly actions: readonly [{
|
|
49
44
|
readonly name: "buildImmediateUI";
|
|
50
45
|
readonly description: "Must be in the ui";
|
|
51
46
|
}];
|
|
52
47
|
};
|
|
53
|
-
readonly UPDATE_UI: "/construction";
|
|
54
48
|
readonly ADD_CHILD: {
|
|
55
49
|
readonly actions: readonly ["generateID", {
|
|
56
50
|
readonly name: "placeChild";
|
|
@@ -72,6 +66,10 @@ export declare const machine: import('@bemedev/app').SyncMachine<{
|
|
|
72
66
|
}, "linkSibling"];
|
|
73
67
|
readonly target: "/construction";
|
|
74
68
|
};
|
|
69
|
+
readonly MOVE: {
|
|
70
|
+
readonly actions: readonly ["moveNode", "buildUI"];
|
|
71
|
+
readonly target: "/construction";
|
|
72
|
+
};
|
|
75
73
|
readonly ADD_EDGE: {
|
|
76
74
|
readonly actions: readonly ["addEdge"];
|
|
77
75
|
readonly target: "/construction";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.machine.d.ts","sourceRoot":"","sources":["../../src/services/main.machine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.machine.d.ts","sourceRoot":"","sources":["../../src/services/main.machine.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,WAEnD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,GAAG,IAAI,WAEpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyLjB,CAAC"}
|
|
@@ -54,8 +54,8 @@ export declare const dimensions: import('@bemedev/typings').inferSh<{
|
|
|
54
54
|
}>;
|
|
55
55
|
}>;
|
|
56
56
|
/**
|
|
57
|
-
* Schema definition for a 2D line vector representing edge coordinates
|
|
58
|
-
* `(
|
|
57
|
+
* Schema definition for a 2D line vector representing edge coordinates `(x0, y0)` to
|
|
58
|
+
* `(x1, y1)`.
|
|
59
59
|
*/
|
|
60
60
|
export declare const vector: import('@bemedev/typings').inferSh<{
|
|
61
61
|
x0: "number";
|
package/lib/ui/Flow.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component } from 'solid-js';
|
|
2
2
|
import { FlowProps } from './components/FlowChart';
|
|
3
3
|
/**
|
|
4
|
-
* Root Flow component wrapping the {@linkcode FlowChart} inside the flow
|
|
5
|
-
*
|
|
4
|
+
* Root Flow component wrapping the {@linkcode FlowChart} inside the flow context
|
|
5
|
+
* provider.
|
|
6
6
|
*
|
|
7
7
|
* @param props - Flow chart configuration and callbacks of type
|
|
8
8
|
* {@linkcode FlowProps}.
|
package/lib/ui/Flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["../../src/ui/Flow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["../../src/ui/Flow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,EAAE,SAAS,CAAC,SAAS,CAIrC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Component } from 'solid-js';
|
|
2
2
|
/**
|
|
3
|
-
* Drag boundary transformer component that clamps draggable nodes within
|
|
4
|
-
*
|
|
3
|
+
* Drag boundary transformer component that clamps draggable nodes within container
|
|
4
|
+
* scroll bounds.
|
|
5
5
|
*
|
|
6
|
-
* @returns `null` as this component performs side-effect transformer
|
|
7
|
-
*
|
|
6
|
+
* @returns `null` as this component performs side-effect transformer registrations
|
|
7
|
+
* only.
|
|
8
8
|
*/
|
|
9
9
|
export declare const DragBounds: Component;
|
|
10
10
|
//# sourceMappingURL=Bounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bounds.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Bounds.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Bounds.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Bounds.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,SAgExB,CAAC"}
|
|
@@ -8,8 +8,8 @@ type Props = {
|
|
|
8
8
|
isNew?: boolean;
|
|
9
9
|
} & Vector;
|
|
10
10
|
/**
|
|
11
|
-
* SVG edge component rendering bezier curves and delete interaction
|
|
12
|
-
*
|
|
11
|
+
* SVG edge component rendering bezier curves and delete interaction handles for node
|
|
12
|
+
* connections.
|
|
13
13
|
*
|
|
14
14
|
* @param props - Edge properties of type {@linkcode Props}.
|
|
15
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeComponent.d.ts","sourceRoot":"","sources":["../../../src/ui/components/EdgeComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAoC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"EdgeComponent.d.ts","sourceRoot":"","sources":["../../../src/ui/components/EdgeComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAoC,MAAM,UAAU,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAG1D,0EAA0E;AAC1E,KAAK,KAAK,GAAG;IACX,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAAC;AAuBX;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,KAAK,CA6D1C,CAAC"}
|