@statelyai/flow-react 0.9.3 → 0.9.4

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/dist/esm/index.js CHANGED
@@ -551,7 +551,7 @@ function stringArraysEqual(a, b) {
551
551
  }
552
552
  function nodePaintEntriesEqual(a, b) {
553
553
  if (a.length !== b.length) return false;
554
- for (let index = 0; index < a.length; index++) if (a[index]?.id !== b[index]?.id || a[index]?.orderIndex !== b[index]?.orderIndex) return false;
554
+ for (let index = 0; index < a.length; index++) if (a[index]?.id !== b[index]?.id || a[index]?.zIndex !== b[index]?.zIndex) return false;
555
555
  return true;
556
556
  }
557
557
  function classNames$1(...values) {
@@ -1409,13 +1409,12 @@ function NodeLayer(props) {
1409
1409
  const instance = useFlowInstance();
1410
1410
  const renderableIds = useRenderableIds(instance, props.onlyRenderVisible);
1411
1411
  const nodePaintEntries = useDragStableFlowSelector((context) => {
1412
- const paintOrder = new Map(getOrderedEntities(instance, { elevateSelected: false }).nodes.map((node, orderIndex) => [node.id, orderIndex]));
1413
- const selectedBoost = paintOrder.size;
1412
+ const paintZIndices = instance.internals.engine.getPaintZIndices().nodes;
1414
1413
  return context.graph.nodes.flatMap((node) => {
1415
- const orderIndex = paintOrder.get(node.id);
1416
- return orderIndex === void 0 ? [] : [{
1414
+ const zIndex = paintZIndices.get(node.id);
1415
+ return zIndex === void 0 ? [] : [{
1417
1416
  id: node.id,
1418
- orderIndex: orderIndex + (context.selection.has(node.id) ? selectedBoost : 0)
1417
+ zIndex
1419
1418
  }];
1420
1419
  });
1421
1420
  }, nodePaintEntriesEqual);
@@ -1431,13 +1430,13 @@ function NodeLayer(props) {
1431
1430
  transformOrigin: "0 0",
1432
1431
  pointerEvents: "none"
1433
1432
  },
1434
- children: nodePaintEntries.map(({ id, orderIndex }) => {
1433
+ children: nodePaintEntries.map(({ id, zIndex }) => {
1435
1434
  if (renderableIds && !renderableIds.nodeIds.has(id)) return null;
1436
1435
  return /* @__PURE__ */ jsx(NodeView, {
1437
1436
  flow: instance,
1438
1437
  geometryObserver: props.geometryObserver,
1439
1438
  id,
1440
- orderIndex,
1439
+ zIndex,
1441
1440
  observer,
1442
1441
  projections: props.projections,
1443
1442
  renderNode: props.renderNode
@@ -1569,7 +1568,7 @@ const NodeView = memo(function NodeView(props) {
1569
1568
  cursor: dragging ? "grabbing" : "grab",
1570
1569
  pointerEvents: node.group?.type === "derived" || node.group && groupHasInteractiveContent ? "none" : "auto",
1571
1570
  userSelect: "none",
1572
- zIndex: props.orderIndex,
1571
+ zIndex: props.zIndex,
1573
1572
  opacity: attrs.opacity
1574
1573
  },
1575
1574
  children: props.renderNode ? /* @__PURE__ */ jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/flow-react",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Thin React adapter for @statelyai/flow with core and DOM re-exports.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,8 +34,8 @@
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
36
  "use-sync-external-store": "^1.6.0",
37
- "@statelyai/flow": "0.9.0",
38
- "@statelyai/flow-dom": "3.4.3"
37
+ "@statelyai/flow": "0.9.1",
38
+ "@statelyai/flow-dom": "3.4.4"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "^18.2.0 || ^19.0.0",