@pyreon/flow 0.9.0 → 0.11.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/lib/analysis/index.js.html +1 -1
- package/lib/{elk.bundled-B9dPTHTZ.js → elk.bundled-wgxWJMYd.js} +2 -2
- package/lib/elk.bundled-wgxWJMYd.js.map +1 -0
- package/lib/index.js +13 -13
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +13 -13
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +14 -7
- package/src/components/background.tsx +9 -14
- package/src/components/controls.tsx +11 -18
- package/src/components/flow-component.tsx +67 -117
- package/src/components/handle.tsx +8 -8
- package/src/components/minimap.tsx +10 -27
- package/src/components/node-resizer.tsx +28 -28
- package/src/components/node-toolbar.tsx +12 -21
- package/src/components/panel.tsx +9 -9
- package/src/edges.ts +16 -47
- package/src/flow.ts +32 -88
- package/src/index.ts +17 -17
- package/src/layout.ts +23 -31
- package/src/tests/flow-advanced.test.ts +191 -200
- package/src/tests/flow.test.ts +418 -468
- package/src/types.ts +28 -42
- package/lib/elk.bundled-B9dPTHTZ.js.map +0 -1
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as __toESM } from "./chunk-C8JhGJ3N.js";
|
|
2
2
|
import { batch, computed, signal } from "@pyreon/reactivity";
|
|
3
3
|
|
|
4
|
-
//#region ../../
|
|
4
|
+
//#region ../../core/core/lib/jsx-runtime.js
|
|
5
5
|
/** Marker for fragment nodes — renders children without a wrapper element */
|
|
6
6
|
const Fragment = Symbol("Pyreon.Fragment");
|
|
7
7
|
/**
|
|
@@ -738,11 +738,11 @@ function NodeLayer(props) {
|
|
|
738
738
|
instance.selectNode(node.id, e.shiftKey);
|
|
739
739
|
instance._emit.nodeClick(node);
|
|
740
740
|
},
|
|
741
|
-
|
|
741
|
+
onDblClick: (e) => {
|
|
742
742
|
e.stopPropagation();
|
|
743
743
|
instance._emit.nodeDoubleClick(node);
|
|
744
744
|
},
|
|
745
|
-
|
|
745
|
+
onPointerDown: (e) => {
|
|
746
746
|
const handle = e.target.closest(".pyreon-flow-handle");
|
|
747
747
|
if (handle) {
|
|
748
748
|
const hType = handle.getAttribute("data-handletype") ?? "source";
|
|
@@ -1111,12 +1111,12 @@ function Flow(props) {
|
|
|
1111
1111
|
style: containerStyle,
|
|
1112
1112
|
tabIndex: 0,
|
|
1113
1113
|
onWheel: handleWheel,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1114
|
+
onPointerDown: handlePointerDown,
|
|
1115
|
+
onPointerMove: handlePointerMove,
|
|
1116
|
+
onPointerUp: handlePointerUp,
|
|
1117
|
+
onTouchStart: handleTouchStart,
|
|
1118
|
+
onTouchMove: handleTouchMove,
|
|
1119
|
+
onKeyDown: handleKeyDown,
|
|
1120
1120
|
children: [children, () => {
|
|
1121
1121
|
const vp = instance.viewport();
|
|
1122
1122
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1438,9 +1438,9 @@ function NodeResizer(props) {
|
|
|
1438
1438
|
return /* @__PURE__ */ jsx("div", {
|
|
1439
1439
|
class: `pyreon-flow-resizer pyreon-flow-resizer-${dir}`,
|
|
1440
1440
|
style: `${baseStyle} ${directionPositions[dir]} cursor: ${directionCursors[dir]};`,
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1441
|
+
onPointerDown: handler.onPointerDown,
|
|
1442
|
+
onPointerMove: handler.onPointerMove,
|
|
1443
|
+
onPointerUp: handler.onPointerUp
|
|
1444
1444
|
}, dir);
|
|
1445
1445
|
}) });
|
|
1446
1446
|
}
|
|
@@ -1535,7 +1535,7 @@ let elkPromise = null;
|
|
|
1535
1535
|
async function getELK() {
|
|
1536
1536
|
if (elkInstance) return elkInstance;
|
|
1537
1537
|
if (elkPromise) return elkPromise;
|
|
1538
|
-
elkPromise = import("./elk.bundled-
|
|
1538
|
+
elkPromise = import("./elk.bundled-wgxWJMYd.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then((mod) => {
|
|
1539
1539
|
elkInstance = new (mod.default || mod)();
|
|
1540
1540
|
return elkInstance;
|
|
1541
1541
|
});
|