@pixldocs/canvas-renderer 0.5.492 → 0.5.493

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.
@@ -12312,7 +12312,23 @@ const PageCanvas = react.forwardRef(
12312
12312
  }, [selectedIds]);
12313
12313
  react.useEffect(() => {
12314
12314
  const fc = fabricRef.current;
12315
- if (!fc || !isActive || !currentPage) return;
12315
+ if (!fc || !currentPage) return;
12316
+ if (!isActive) {
12317
+ try {
12318
+ fc.__activeEditingGroupId = null;
12319
+ drilledGroupIdRef.current = null;
12320
+ setDrilledGroupBounds(null);
12321
+ preserveActiveSelectionAfterTransformRef.current = null;
12322
+ recentGroupSelectionRestoreRef.current = null;
12323
+ if (fc.getActiveObject()) {
12324
+ fc.discardActiveObject();
12325
+ }
12326
+ clearCanvasActiveVisuals(fc);
12327
+ fc.requestRenderAll();
12328
+ } catch {
12329
+ }
12330
+ return;
12331
+ }
12316
12332
  const pageChildren2 = currentPage.children ?? [];
12317
12333
  const hasMissingSelection = selectedIds.some((id) => !findNodeById(pageChildren2, id));
12318
12334
  const activeEditingGroupId = fc.__activeEditingGroupId ?? null;
@@ -17138,6 +17154,10 @@ const PageCanvas = react.forwardRef(
17138
17154
  const innerImg = ct == null ? void 0 : ct._img;
17139
17155
  const innerSrc = ((_a2 = innerImg == null ? void 0 : innerImg.getSrc) == null ? void 0 : _a2.call(innerImg)) || ((_b2 = innerImg == null ? void 0 : innerImg._originalElement) == null ? void 0 : _b2.src) || (innerImg == null ? void 0 : innerImg.src) || "";
17140
17156
  const isPlaceholder = !innerSrc || innerSrc === EMPTY_IMAGE_PLACEHOLDER_DATA_URL;
17157
+ const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
17158
+ if (Date.now() - activatedAt < 400) {
17159
+ return;
17160
+ }
17141
17161
  const targetId = getObjectId(target);
17142
17162
  const pageChildrenForCrop = ((_c2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c2.children) ?? [];
17143
17163
  const parentForCrop = targetId ? findParentGroup(pageChildrenForCrop, targetId) : null;
@@ -17154,10 +17174,6 @@ const PageCanvas = react.forwardRef(
17154
17174
  }
17155
17175
  return;
17156
17176
  }
17157
- const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
17158
- if (Date.now() - activatedAt < 400) {
17159
- return;
17160
- }
17161
17177
  }
17162
17178
  if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
17163
17179
  enterCropMode(target);
@@ -26520,9 +26536,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26520
26536
  }
26521
26537
  return svgString;
26522
26538
  }
26523
- const resolvedPackageVersion = "0.5.492";
26539
+ const resolvedPackageVersion = "0.5.493";
26524
26540
  const PACKAGE_VERSION = resolvedPackageVersion;
26525
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.492";
26541
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.493";
26526
26542
  const roundParityValue = (value) => {
26527
26543
  if (typeof value !== "number") return value;
26528
26544
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27336,7 +27352,7 @@ class PixldocsRenderer {
27336
27352
  await this.waitForCanvasScene(container, cloned, i);
27337
27353
  }
27338
27354
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27339
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-PMQQ8BkR.cjs"));
27355
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-obFAiUhx.cjs"));
27340
27356
  const prepared = preparePagesForExport(
27341
27357
  cloned.pages,
27342
27358
  canvasWidth,
@@ -29656,7 +29672,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29656
29672
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29657
29673
  sanitizeSvgTreeForPdf(svgToDraw);
29658
29674
  try {
29659
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-PMQQ8BkR.cjs"));
29675
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-obFAiUhx.cjs"));
29660
29676
  try {
29661
29677
  await logTextMeasurementDiagnostic(svgToDraw);
29662
29678
  } catch {
@@ -29970,4 +29986,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29970
29986
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29971
29987
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29972
29988
  exports.warmTemplateFromForm = warmTemplateFromForm;
29973
- //# sourceMappingURL=index-CoJw0tIl.cjs.map
29989
+ //# sourceMappingURL=index-CapZsm7x.cjs.map