@synnaxlabs/pluto 0.21.9 → 0.21.10

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/index.js CHANGED
@@ -16,8 +16,8 @@ import { A, V as VARIANTS$1, o as specZ, v as variantZ, h as usePurePassthrough,
16
16
  import { K, O, M, N, U, J as J2 } from "./aggregator-B8fg7W2s.js";
17
17
  import { S as Space, P as Pack } from "./Center-BK9Rcaa0.js";
18
18
  import { G } from "./Center-BK9Rcaa0.js";
19
- import { I as Canvas$2, J as canvasStateZ, K as useStore, M as shallow$1, N as cc, A as LinePlot$2, B as linePlotStateZ, O as filterGridEntries, P as Line$5, Q as stateZ, X as XAxis$2, Y as YAxis$2, S as coreAxisStateZ, T as parseAutoBounds, U as withinSizeThreshold, V as Tooltip$3, W as tooltipStateZ, Z as Measure$2, _ as measureStateZ, $ as Rule$2, a0 as ruleStateZ, a1 as Annotation$1, a2 as annotationStateZ, a3 as Provider$7, a4 as providerStateZ, a5 as streamChannelData, a6 as channelData, a7 as ZERO_CONTEXT_VALUE, a8 as Provider$8, a9 as Eraser$1, aa as eraserStateZ, ab as useReactFlow, ac as BaseEdge, ad as Diagram$1, ae as diagramStateZ, af as translateViewportBackward, ag as useOnViewportChange, ah as translateEdgesForward, ai as translateNodesForward, aj as nodeConverter, ak as edgeConverter, al as ReactFlow, am as translateViewportForward, an as ConnectionMode, ao as SelectionMode, ap as ReactFlowProvider, aq as applyNodeChanges, ar as applyEdgeChanges, as as updateEdge, at as addEdge, au as Value$2, av as Controller$1, aw as controllerStateZ, ax as StateProvider$1, ay as stateProviderStateZ, az as Indicator$1, aA as indicatorStateZ, aB as Chip$1, aC as chipStateZ, aD as Legend$2, aE as legendStateZ, aF as Button$6, aG as buttonStateZ, aH as Position, aI as useUpdateNodeInternals, aJ as Handle$1, aK as Toggle$1, aL as toggleStateZ, aM as useInitialViewport, aN as sourcePipelinePropsZ, aO as sinkPipelinePropsZ, aP as streamChannelValuePropsZ, aQ as setChannelValuePropsZ, aR as stringifyNumberProps, aS as rollingAverageProps, aT as sourcePipeline, aU as streamChannelValue, aV as withinBounds, aW as sinkPipeline, aX as setChannelValue, aY as setpoint, aZ as stringifyNumber, a_ as rollingAverage, a$ as authoritySource, b0 as acquireChannelControl, b1 as Provider$a, b2 as providerStateZ$1, b3 as BaseProvider, b4 as providerStateZ$2 } from "./LinePlot-KYwy1D7H.js";
20
- import { v } from "./LinePlot-KYwy1D7H.js";
19
+ import { I as Canvas$2, J as canvasStateZ, K as useStore, M as shallow$1, N as cc, A as LinePlot$2, B as linePlotStateZ, O as filterGridEntries, P as Line$5, Q as stateZ, X as XAxis$2, Y as YAxis$2, S as coreAxisStateZ, T as parseAutoBounds, U as withinSizeThreshold, V as Tooltip$3, W as tooltipStateZ, Z as Measure$2, _ as measureStateZ, $ as Rule$2, a0 as ruleStateZ, a1 as Annotation$1, a2 as annotationStateZ, a3 as Provider$7, a4 as providerStateZ, a5 as streamChannelData, a6 as channelData, a7 as ZERO_CONTEXT_VALUE, a8 as Provider$8, a9 as Eraser$1, aa as eraserStateZ, ab as useReactFlow, ac as BaseEdge, ad as Diagram$1, ae as diagramStateZ, af as translateViewportBackward, ag as useOnViewportChange, ah as translateEdgesForward, ai as translateNodesForward, aj as nodeConverter, ak as edgeConverter, al as ReactFlow, am as translateViewportForward, an as ConnectionMode, ao as SelectionMode, ap as ReactFlowProvider, aq as applyNodeChanges, ar as applyEdgeChanges, as as updateEdge, at as addEdge, au as Value$2, av as Controller$1, aw as controllerStateZ, ax as StateProvider$1, ay as stateProviderStateZ, az as Indicator$1, aA as indicatorStateZ, aB as Chip$1, aC as chipStateZ, aD as Legend$2, aE as legendStateZ, aF as Button$6, aG as buttonStateZ, aH as Position, aI as useUpdateNodeInternals, aJ as Handle$1, aK as Toggle$1, aL as toggleStateZ, aM as useInitialViewport, aN as sourcePipelinePropsZ, aO as sinkPipelinePropsZ, aP as streamChannelValuePropsZ, aQ as setChannelValuePropsZ, aR as stringifyNumberProps, aS as rollingAverageProps, aT as sourcePipeline, aU as streamChannelValue, aV as withinBounds, aW as sinkPipeline, aX as setChannelValue, aY as setpoint, aZ as stringifyNumber, a_ as rollingAverage, a$ as authoritySource, b0 as acquireChannelControl, b1 as Provider$a, b2 as providerStateZ$1, b3 as BaseProvider, b4 as providerStateZ$2 } from "./LinePlot-BeWCHNq-.js";
20
+ import { v } from "./LinePlot-BeWCHNq-.js";
21
21
  import { S as Swatch } from "./external-DNHMAfGi.js";
22
22
  import { e as e2 } from "./external-DNHMAfGi.js";
23
23
  import { u as useDrag, T as Text$3 } from "./external-BM82B8W2.js";
@@ -1165,6 +1165,7 @@ const Mask = forwardRef(
1165
1165
  );
1166
1166
  Mask.displayName = "ZoomPanMask";
1167
1167
  const TRUNC_PRECISION = 6;
1168
+ const CURSOR_TRANSLATION_THRESHOLD = 2;
1168
1169
  const TRIGGER_MODES = ["zoom", "pan", "select", "zoomReset"];
1169
1170
  const MODES = [...TRIGGER_MODES, "click"];
1170
1171
  const MASK_MODES = ["zoom", "select"];
@@ -1222,9 +1223,10 @@ const use$a = ({
1222
1223
  const [maskBox, setMaskBox] = useState(To.ZERO);
1223
1224
  const [maskMode, setMaskMode] = useState(defaultMode);
1224
1225
  const [stateRef, setStateRef] = useStateRef(initial);
1226
+ const prevCursorRef = useRef(q.ZERO);
1225
1227
  const canvasRef = useRef(null);
1226
1228
  const threshold = _$1.construct(threshold_);
1227
- useEffect(() => setStateRef(() => To.truncate(initial, 3)), [initial]);
1229
+ useEffect(() => setStateRef(() => To.truncate(initial, TRUNC_PRECISION)), [initial]);
1228
1230
  useEffect(() => setMaskMode(defaultMode), [defaultMode]);
1229
1231
  const [triggerConfig, reducedTriggerConfig, purgedTriggers, reducedPurgedTriggers] = useMemoCompare(
1230
1232
  () => {
@@ -1267,7 +1269,7 @@ const use$a = ({
1267
1269
  return setStateRef((prev) => {
1268
1270
  if (mode === "pan") {
1269
1271
  const next3 = handlePan(box_, prev, canvas);
1270
- if (next3 === null)
1272
+ if (next3 === null || To.equals(next3, prev))
1271
1273
  return prev;
1272
1274
  onChange == null ? void 0 : onChange({ box: next3, mode, stage, cursor });
1273
1275
  return next3;
@@ -1291,15 +1293,11 @@ const use$a = ({
1291
1293
  );
1292
1294
  }
1293
1295
  setMaskBox((prev) => !To.areaIsZero(prev) ? To.ZERO : prev);
1294
- const next = handlePan(box_, stateRef.current, canvas);
1295
- if (To.equals(next, stateRef.current))
1296
+ if (q.distance(cursor, prevCursorRef.current) < CURSOR_TRANSLATION_THRESHOLD)
1296
1297
  return;
1297
- onChange == null ? void 0 : onChange({
1298
- box: next,
1299
- mode,
1300
- stage,
1301
- cursor
1302
- });
1298
+ prevCursorRef.current = cursor;
1299
+ const next = handlePan(box_, stateRef.current, canvas);
1300
+ onChange == null ? void 0 : onChange({ box: next, mode, stage, cursor });
1303
1301
  },
1304
1302
  [
1305
1303
  setMaskBox,