@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.
@@ -12294,7 +12294,23 @@ const PageCanvas = forwardRef(
12294
12294
  }, [selectedIds]);
12295
12295
  useEffect(() => {
12296
12296
  const fc = fabricRef.current;
12297
- if (!fc || !isActive || !currentPage) return;
12297
+ if (!fc || !currentPage) return;
12298
+ if (!isActive) {
12299
+ try {
12300
+ fc.__activeEditingGroupId = null;
12301
+ drilledGroupIdRef.current = null;
12302
+ setDrilledGroupBounds(null);
12303
+ preserveActiveSelectionAfterTransformRef.current = null;
12304
+ recentGroupSelectionRestoreRef.current = null;
12305
+ if (fc.getActiveObject()) {
12306
+ fc.discardActiveObject();
12307
+ }
12308
+ clearCanvasActiveVisuals(fc);
12309
+ fc.requestRenderAll();
12310
+ } catch {
12311
+ }
12312
+ return;
12313
+ }
12298
12314
  const pageChildren2 = currentPage.children ?? [];
12299
12315
  const hasMissingSelection = selectedIds.some((id) => !findNodeById(pageChildren2, id));
12300
12316
  const activeEditingGroupId = fc.__activeEditingGroupId ?? null;
@@ -17120,6 +17136,10 @@ const PageCanvas = forwardRef(
17120
17136
  const innerImg = ct == null ? void 0 : ct._img;
17121
17137
  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) || "";
17122
17138
  const isPlaceholder = !innerSrc || innerSrc === EMPTY_IMAGE_PLACEHOLDER_DATA_URL;
17139
+ const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
17140
+ if (Date.now() - activatedAt < 400) {
17141
+ return;
17142
+ }
17123
17143
  const targetId = getObjectId(target);
17124
17144
  const pageChildrenForCrop = ((_c2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c2.children) ?? [];
17125
17145
  const parentForCrop = targetId ? findParentGroup(pageChildrenForCrop, targetId) : null;
@@ -17136,10 +17156,6 @@ const PageCanvas = forwardRef(
17136
17156
  }
17137
17157
  return;
17138
17158
  }
17139
- const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
17140
- if (Date.now() - activatedAt < 400) {
17141
- return;
17142
- }
17143
17159
  }
17144
17160
  if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
17145
17161
  enterCropMode(target);
@@ -26502,9 +26518,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26502
26518
  }
26503
26519
  return svgString;
26504
26520
  }
26505
- const resolvedPackageVersion = "0.5.492";
26521
+ const resolvedPackageVersion = "0.5.493";
26506
26522
  const PACKAGE_VERSION = resolvedPackageVersion;
26507
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.492";
26523
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.493";
26508
26524
  const roundParityValue = (value) => {
26509
26525
  if (typeof value !== "number") return value;
26510
26526
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27318,7 +27334,7 @@ class PixldocsRenderer {
27318
27334
  await this.waitForCanvasScene(container, cloned, i);
27319
27335
  }
27320
27336
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27321
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-rz4LyyuM.js");
27337
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CouKfyYT.js");
27322
27338
  const prepared = preparePagesForExport(
27323
27339
  cloned.pages,
27324
27340
  canvasWidth,
@@ -29638,7 +29654,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29638
29654
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29639
29655
  sanitizeSvgTreeForPdf(svgToDraw);
29640
29656
  try {
29641
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-rz4LyyuM.js");
29657
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CouKfyYT.js");
29642
29658
  try {
29643
29659
  await logTextMeasurementDiagnostic(svgToDraw);
29644
29660
  } catch {
@@ -29955,4 +29971,4 @@ export {
29955
29971
  buildTeaserBlurFlatKeys as y,
29956
29972
  collectFontDescriptorsFromConfig as z
29957
29973
  };
29958
- //# sourceMappingURL=index-DHzIvJSN.js.map
29974
+ //# sourceMappingURL=index-yWZhNUVq.js.map