canvu-react 0.3.27 → 0.3.29

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/react.js CHANGED
@@ -3644,6 +3644,10 @@ var TOOLBAR_TOOLTIP_CSS = `
3644
3644
  opacity: 1;
3645
3645
  visibility: visible;
3646
3646
  }
3647
+ [data-slot="vector-canvas-toolbar"][data-position^="top-"] .vector-toolbar-tip {
3648
+ top: calc(100% + 8px);
3649
+ bottom: auto;
3650
+ }
3647
3651
  `;
3648
3652
  var OVERFLOW_MENU_CSS = `
3649
3653
  .vector-toolbar-overflow-panel {
@@ -3726,6 +3730,10 @@ var OVERFLOW_MENU_CSS = `
3726
3730
  opacity: 1;
3727
3731
  visibility: visible;
3728
3732
  }
3733
+ [data-slot="vector-canvas-toolbar"][data-position^="top-"] .vector-toolbar-overflow-tip {
3734
+ top: calc(100% + 8px);
3735
+ bottom: auto;
3736
+ }
3729
3737
  .vector-toolbar-overflow-cell > button {
3730
3738
  background: rgba(24,24,27,0.05);
3731
3739
  }
@@ -7463,7 +7471,14 @@ var VectorViewport = forwardRef(
7463
7471
  onPlacementPreviewChangeRef.current = onPlacementPreviewChange;
7464
7472
  const directRemoteStrokePreviewRef = useRef(false);
7465
7473
  const remoteStrokePreviewFrameRef = useRef(null);
7474
+ const remoteStrokePreviewClearTimerRef = useRef(null);
7466
7475
  const pendingRemoteStrokePreviewRef = useRef(null);
7476
+ const cancelPendingRemoteStrokePreviewClear = useCallback(() => {
7477
+ if (remoteStrokePreviewClearTimerRef.current != null) {
7478
+ clearTimeout(remoteStrokePreviewClearTimerRef.current);
7479
+ remoteStrokePreviewClearTimerRef.current = null;
7480
+ }
7481
+ }, []);
7467
7482
  const flushRemoteStrokePreviewWithStyle = useCallback(() => {
7468
7483
  remoteStrokePreviewFrameRef.current = null;
7469
7484
  const pending = pendingRemoteStrokePreviewRef.current;
@@ -7478,6 +7493,7 @@ var VectorViewport = forwardRef(
7478
7493
  const emitRemoteStrokePreview = useCallback(
7479
7494
  (tool, points) => {
7480
7495
  if (tool === "laser") return;
7496
+ cancelPendingRemoteStrokePreviewClear();
7481
7497
  directRemoteStrokePreviewRef.current = true;
7482
7498
  pendingRemoteStrokePreviewRef.current = { tool, points };
7483
7499
  if (remoteStrokePreviewFrameRef.current != null) return;
@@ -7485,17 +7501,22 @@ var VectorViewport = forwardRef(
7485
7501
  flushRemoteStrokePreviewWithStyle
7486
7502
  );
7487
7503
  },
7488
- [flushRemoteStrokePreviewWithStyle]
7504
+ [cancelPendingRemoteStrokePreviewClear, flushRemoteStrokePreviewWithStyle]
7489
7505
  );
7506
+ const REMOTE_STROKE_PREVIEW_HOLD_MS = 350;
7490
7507
  const emitRemoteStrokePreviewClear = useCallback(() => {
7491
7508
  if (remoteStrokePreviewFrameRef.current != null) {
7492
7509
  cancelAnimationFrame(remoteStrokePreviewFrameRef.current);
7493
7510
  remoteStrokePreviewFrameRef.current = null;
7494
7511
  }
7495
- pendingRemoteStrokePreviewRef.current = null;
7496
- directRemoteStrokePreviewRef.current = false;
7497
- onPlacementPreviewChangeRef.current?.(null);
7498
- }, []);
7512
+ cancelPendingRemoteStrokePreviewClear();
7513
+ remoteStrokePreviewClearTimerRef.current = window.setTimeout(() => {
7514
+ remoteStrokePreviewClearTimerRef.current = null;
7515
+ pendingRemoteStrokePreviewRef.current = null;
7516
+ directRemoteStrokePreviewRef.current = false;
7517
+ onPlacementPreviewChangeRef.current?.(null);
7518
+ }, REMOTE_STROKE_PREVIEW_HOLD_MS);
7519
+ }, [cancelPendingRemoteStrokePreviewClear]);
7499
7520
  const overlayCameraTickRef = useRef(false);
7500
7521
  overlayCameraTickRef.current = interactive || remotePresence != null && remotePresence.length > 0 || presenceOverlay != null;
7501
7522
  const pruneEraserTrail = useCallback(
@@ -7748,6 +7769,9 @@ var VectorViewport = forwardRef(
7748
7769
  if (remoteStrokePreviewFrameRef.current != null) {
7749
7770
  cancelAnimationFrame(remoteStrokePreviewFrameRef.current);
7750
7771
  }
7772
+ if (remoteStrokePreviewClearTimerRef.current != null) {
7773
+ clearTimeout(remoteStrokePreviewClearTimerRef.current);
7774
+ }
7751
7775
  };
7752
7776
  }, []);
7753
7777
  useEffect(() => {