@pixldocs/canvas-renderer 0.5.365 → 0.5.367

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.
@@ -11552,6 +11552,7 @@ const PageCanvas = react.forwardRef(
11552
11552
  }, [restoreSuppressedGroupMemberVisuals]);
11553
11553
  const skipSelectionClearOnDiscardRef = react.useRef(false);
11554
11554
  const skipActiveSelectionBakeOnClearRef = react.useRef(false);
11555
+ const suppressObjectModifiedDuringInternalReselectRef = react.useRef(false);
11555
11556
  const preserveEditingScopeOnSelectionClearRef = react.useRef(false);
11556
11557
  const preserveActiveSelectionAfterTransformRef = react.useRef(null);
11557
11558
  const recentGroupSelectionRestoreRef = react.useRef(null);
@@ -12839,6 +12840,7 @@ const PageCanvas = react.forwardRef(
12839
12840
  };
12840
12841
  fabricCanvas.on("selection:created", () => {
12841
12842
  var _a2;
12843
+ if (suppressObjectModifiedDuringInternalReselectRef.current) return;
12842
12844
  syncSelectionToStore();
12843
12845
  const activeObj = fabricCanvas.getActiveObject();
12844
12846
  if (activeObj instanceof fabric__namespace.ActiveSelection) applyWarpAwareSelectionBorders(activeObj);
@@ -12851,6 +12853,7 @@ const PageCanvas = react.forwardRef(
12851
12853
  });
12852
12854
  fabricCanvas.on("selection:updated", () => {
12853
12855
  var _a2;
12856
+ if (suppressObjectModifiedDuringInternalReselectRef.current) return;
12854
12857
  const next = fabricCanvas.getActiveObject();
12855
12858
  const isLogicalGroupSel = next instanceof fabric__namespace.ActiveSelection && (next.__pixldocsGroupSelection || Array.isArray(next.__pixldocsLogicalGroupIds));
12856
12859
  if (!isLogicalGroupSel) restoreSuppressedGroupBorders();
@@ -14538,6 +14541,7 @@ const PageCanvas = react.forwardRef(
14538
14541
  fabricCanvas.on("object:modified", (e) => {
14539
14542
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
14540
14543
  try {
14544
+ if (suppressObjectModifiedDuringInternalReselectRef.current) return;
14541
14545
  dragStarted = false;
14542
14546
  setGuides([]);
14543
14547
  setGroupOverlayLiveBoundsRef.current(null);
@@ -15514,6 +15518,7 @@ const PageCanvas = react.forwardRef(
15514
15518
  });
15515
15519
  const prevRenderOnAddRemove = fabricCanvas.renderOnAddRemove;
15516
15520
  fabricCanvas.renderOnAddRemove = false;
15521
+ suppressObjectModifiedDuringInternalReselectRef.current = true;
15517
15522
  skipSelectionClearOnDiscardRef.current = true;
15518
15523
  skipActiveSelectionBakeOnClearRef.current = true;
15519
15524
  try {
@@ -15565,13 +15570,15 @@ const PageCanvas = react.forwardRef(
15565
15570
  }
15566
15571
  skipSelectionClearOnDiscardRef.current = false;
15567
15572
  fabricCanvas.renderOnAddRemove = prevRenderOnAddRemove;
15573
+ suppressObjectModifiedDuringInternalReselectRef.current = false;
15568
15574
  if (wasGroupSel) {
15569
15575
  const resizeRestoreSnapshot = {
15570
15576
  memberIds: membersToReselect.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
15571
15577
  groupSelectionId: wasGroupSel,
15572
15578
  expiresAt: Date.now() + 1200
15573
15579
  };
15574
- recentGroupSelectionRestoreRef.current = resizeRestoreSnapshot;
15580
+ preserveActiveSelectionAfterTransformRef.current = null;
15581
+ recentGroupSelectionRestoreRef.current = null;
15575
15582
  }
15576
15583
  fabricCanvas.requestRenderAll();
15577
15584
  }
@@ -15582,6 +15589,9 @@ const PageCanvas = react.forwardRef(
15582
15589
  commitHistory();
15583
15590
  unlockEditsSoon();
15584
15591
  } catch (e2) {
15592
+ suppressObjectModifiedDuringInternalReselectRef.current = false;
15593
+ skipSelectionClearOnDiscardRef.current = false;
15594
+ skipActiveSelectionBakeOnClearRef.current = false;
15585
15595
  unlockEditsSoon();
15586
15596
  }
15587
15597
  });
@@ -24617,9 +24627,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24617
24627
  }
24618
24628
  return svgString;
24619
24629
  }
24620
- const resolvedPackageVersion = "0.5.365";
24630
+ const resolvedPackageVersion = "0.5.367";
24621
24631
  const PACKAGE_VERSION = resolvedPackageVersion;
24622
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.365";
24632
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.367";
24623
24633
  const roundParityValue = (value) => {
24624
24634
  if (typeof value !== "number") return value;
24625
24635
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25433,7 +25443,7 @@ class PixldocsRenderer {
25433
25443
  await this.waitForCanvasScene(container, cloned, i);
25434
25444
  }
25435
25445
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25436
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CJdDOe5F.cjs"));
25446
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-IZ_tpeyw.cjs"));
25437
25447
  const prepared = preparePagesForExport(
25438
25448
  cloned.pages,
25439
25449
  canvasWidth,
@@ -27753,7 +27763,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27753
27763
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27754
27764
  sanitizeSvgTreeForPdf(svgToDraw);
27755
27765
  try {
27756
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CJdDOe5F.cjs"));
27766
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-IZ_tpeyw.cjs"));
27757
27767
  try {
27758
27768
  await logTextMeasurementDiagnostic(svgToDraw);
27759
27769
  } catch {
@@ -28150,4 +28160,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
28150
28160
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
28151
28161
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
28152
28162
  exports.warmTemplateFromForm = warmTemplateFromForm;
28153
- //# sourceMappingURL=index-BbKn-5c5.cjs.map
28163
+ //# sourceMappingURL=index-CG1dGppw.cjs.map