@pixldocs/canvas-renderer 0.5.441 → 0.5.442

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.
@@ -11875,6 +11875,7 @@ const PageCanvas = react.forwardRef(
11875
11875
  const selectAllTextOnEditingEnterRef = react.useRef(null);
11876
11876
  const suppressedTextEditObjectsRef = react.useRef([]);
11877
11877
  const suppressTextDoubleClickUntilRef = react.useRef(0);
11878
+ const cropGroupActivatedAtRef = react.useRef(/* @__PURE__ */ new WeakMap());
11878
11879
  const syncLockedRef = react.useRef(false);
11879
11880
  const editLockRef = react.useRef(false);
11880
11881
  const editLockCountRef = react.useRef(0);
@@ -16833,6 +16834,14 @@ const PageCanvas = react.forwardRef(
16833
16834
  obj.setCoords();
16834
16835
  }
16835
16836
  });
16837
+ const recordCropGroupActivation = () => {
16838
+ const active = fabricCanvas.getActiveObject();
16839
+ if (active && active instanceof fabric__namespace.Group && active.__cropGroup) {
16840
+ cropGroupActivatedAtRef.current.set(active, Date.now());
16841
+ }
16842
+ };
16843
+ fabricCanvas.on("selection:created", recordCropGroupActivation);
16844
+ fabricCanvas.on("selection:updated", recordCropGroupActivation);
16836
16845
  fabricCanvas.on("mouse:dblclick", (e) => {
16837
16846
  var _a2, _b2, _c2;
16838
16847
  if (!isActiveRef.current || !allowEditing) return;
@@ -16862,6 +16871,10 @@ const PageCanvas = react.forwardRef(
16862
16871
  }
16863
16872
  return;
16864
16873
  }
16874
+ const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
16875
+ if (Date.now() - activatedAt < 400) {
16876
+ return;
16877
+ }
16865
16878
  }
16866
16879
  if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
16867
16880
  enterCropMode(target);
@@ -25889,9 +25902,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25889
25902
  }
25890
25903
  return svgString;
25891
25904
  }
25892
- const resolvedPackageVersion = "0.5.441";
25905
+ const resolvedPackageVersion = "0.5.442";
25893
25906
  const PACKAGE_VERSION = resolvedPackageVersion;
25894
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.441";
25907
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.442";
25895
25908
  const roundParityValue = (value) => {
25896
25909
  if (typeof value !== "number") return value;
25897
25910
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26705,7 +26718,7 @@ class PixldocsRenderer {
26705
26718
  await this.waitForCanvasScene(container, cloned, i);
26706
26719
  }
26707
26720
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26708
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BKPFy7-t.cjs"));
26721
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-m9l318xa.cjs"));
26709
26722
  const prepared = preparePagesForExport(
26710
26723
  cloned.pages,
26711
26724
  canvasWidth,
@@ -29025,7 +29038,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29025
29038
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29026
29039
  sanitizeSvgTreeForPdf(svgToDraw);
29027
29040
  try {
29028
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BKPFy7-t.cjs"));
29041
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-m9l318xa.cjs"));
29029
29042
  try {
29030
29043
  await logTextMeasurementDiagnostic(svgToDraw);
29031
29044
  } catch {
@@ -29422,4 +29435,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29422
29435
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29423
29436
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29424
29437
  exports.warmTemplateFromForm = warmTemplateFromForm;
29425
- //# sourceMappingURL=index-BPlFxSU1.cjs.map
29438
+ //# sourceMappingURL=index-SGFlXODe.cjs.map