system-canvas-standalone 0.2.44 → 0.2.45

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.
@@ -16533,8 +16533,10 @@ var SystemCanvas = (() => {
16533
16533
  function useZoomNavigation(options) {
16534
16534
  const { enabled, config, nodes, currentCanvas, parentFrame, canvases, onResolveCanvas, onSeedCanvas, theme, getViewportSize, getCursorScreenPos, onEnter, onExit } = options;
16535
16535
  const committingRef = (0, import_react10.useRef)(false);
16536
+ const pendingNavRefRef = (0, import_react10.useRef)(null);
16536
16537
  (0, import_react10.useEffect)(() => {
16537
16538
  committingRef.current = false;
16539
+ pendingNavRefRef.current = null;
16538
16540
  }, [currentCanvas]);
16539
16541
  const exitArmedRef = (0, import_react10.useRef)(false);
16540
16542
  (0, import_react10.useEffect)(() => {
@@ -16629,7 +16631,7 @@ var SystemCanvas = (() => {
16629
16631
  }
16630
16632
  }
16631
16633
  }
16632
- if (bestCandidate) {
16634
+ if (bestCandidate && !(pendingNavRefRef.current !== null && bestCandidate.node.ref !== pendingNavRefRef.current)) {
16633
16635
  const n = bestCandidate.node;
16634
16636
  const screen = bestCandidate.screen;
16635
16637
  const ref = n.ref;
@@ -16700,8 +16702,12 @@ var SystemCanvas = (() => {
16700
16702
  ]);
16701
16703
  const clearCommitting = (0, import_react10.useCallback)(() => {
16702
16704
  committingRef.current = false;
16705
+ pendingNavRefRef.current = null;
16703
16706
  }, []);
16704
- return { handleViewportChange, clearCommitting };
16707
+ const setPendingNavRef = (0, import_react10.useCallback)((ref) => {
16708
+ pendingNavRefRef.current = ref;
16709
+ }, []);
16710
+ return { handleViewportChange, clearCommitting, setPendingNavRef };
16705
16711
  }
16706
16712
 
16707
16713
  // ../react/dist/components/Viewport.js
@@ -23394,6 +23400,7 @@ var SystemCanvas = (() => {
23394
23400
  }
23395
23401
  const handle = viewportHandleRef.current;
23396
23402
  if (handle) {
23403
+ setZoomNavPendingRef(node.ref ?? null);
23397
23404
  handle.zoomToNode(node, () => {
23398
23405
  const finalVp = viewportStateRef.current;
23399
23406
  if (finalVp)
@@ -23424,7 +23431,7 @@ var SystemCanvas = (() => {
23424
23431
  navigateToBreadcrumb(breadcrumbs.length - 2);
23425
23432
  }, [navigateToBreadcrumb, breadcrumbs.length]);
23426
23433
  const currentParentFrame = parentFrames[parentFrames.length - 1] ?? null;
23427
- const { handleViewportChange: handleZoomNavViewportChange, clearCommitting: clearZoomNavCommitting } = useZoomNavigation({
23434
+ const { handleViewportChange: handleZoomNavViewportChange, clearCommitting: clearZoomNavCommitting, setPendingNavRef: setZoomNavPendingRef } = useZoomNavigation({
23428
23435
  enabled: zoomNavConfig.enabled,
23429
23436
  config: zoomNavConfig,
23430
23437
  nodes,