@pixldocs/canvas-renderer 0.5.266 → 0.5.267

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.
@@ -15401,9 +15401,9 @@ const PageCanvas = forwardRef(
15401
15401
  const currentVisible = element.visible !== false;
15402
15402
  const fabricLeft = existingObj.left ?? 0;
15403
15403
  const fabricTop = existingObj.top ?? 0;
15404
- const storePos = pageChildren ? (() => {
15405
- const node = findNodeById(pageChildren, element.id);
15406
- return node ? getAbsoluteBounds(node, pageChildren) : { left: element.left ?? 0, top: element.top ?? 0 };
15404
+ const storePos = pageTree.length ? (() => {
15405
+ const node = findNodeById(pageTree, element.id);
15406
+ return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
15407
15407
  })() : { left: element.left ?? 0, top: element.top ?? 0 };
15408
15408
  const storeLeft = storePos.left;
15409
15409
  const storeTop = storePos.top;
@@ -15417,7 +15417,7 @@ const PageCanvas = forwardRef(
15417
15417
  if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
15418
15418
  positionChanged = false;
15419
15419
  }
15420
- const resolvedSizeForCompare = (pageChildren == null ? void 0 : pageChildren.length) ? getNodeBounds(element, pageChildren) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
15420
+ const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
15421
15421
  const fabricText = existingObj.text ?? "";
15422
15422
  const storeText = element.text ?? "";
15423
15423
  const otherPropsChanged = Math.abs((existingObj.width ?? 0) - resolvedSizeForCompare.width) > 0.1 || Math.abs((existingObj.height ?? 0) - resolvedSizeForCompare.height) > 0.1 || Math.abs((existingObj.angle ?? 0) - (element.angle ?? 0)) > 0.1 || Math.abs((existingObj.scaleX ?? 1) - (element.scaleX ?? 1)) > 0.01 || Math.abs((existingObj.scaleY ?? 1) - (element.scaleY ?? 1)) > 0.01 || (existingObj.flipX ?? false) !== (element.flipX ?? false) || (existingObj.flipY ?? false) !== (element.flipY ?? false) || fabricText !== storeText || existingObj.fill !== (element.fill ?? "") || existingObj.stroke !== (element.stroke ?? "") || Math.abs((existingObj.strokeWidth ?? 0) - (element.strokeWidth ?? 0)) > 0.01 || Math.abs((existingObj.opacity ?? 1) - (element.opacity ?? 1)) > 0.01 || (existingObj.fontSize ?? 0) !== (element.fontSize ?? 0) || (existingObj.fontFamily ?? "") !== (element.fontFamily ?? "") || // Vertical alignment & min box height: panel-driven changes must trigger a re-apply
@@ -16057,7 +16057,7 @@ const PageCanvas = forwardRef(
16057
16057
  if (fc && isTransforming(fc)) {
16058
16058
  return;
16059
16059
  }
16060
- const currentPageTree = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
16060
+ const currentPageTree = (isPreviewMode && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
16061
16061
  const fabricPos = currentPageTree.length > 0 ? (() => {
16062
16062
  const node = findNodeById(currentPageTree, element.id);
16063
16063
  return node ? getAbsoluteBounds(node, currentPageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
@@ -23635,9 +23635,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23635
23635
  }
23636
23636
  return svgString;
23637
23637
  }
23638
- const resolvedPackageVersion = "0.5.266";
23638
+ const resolvedPackageVersion = "0.5.267";
23639
23639
  const PACKAGE_VERSION = resolvedPackageVersion;
23640
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.266";
23640
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.267";
23641
23641
  const roundParityValue = (value) => {
23642
23642
  if (typeof value !== "number") return value;
23643
23643
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24451,7 +24451,7 @@ class PixldocsRenderer {
24451
24451
  await this.waitForCanvasScene(container, cloned, i);
24452
24452
  }
24453
24453
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24454
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CO8Kr9ha.js");
24454
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-ByDlpq77.js");
24455
24455
  const prepared = preparePagesForExport(
24456
24456
  cloned.pages,
24457
24457
  canvasWidth,
@@ -26771,7 +26771,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26771
26771
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26772
26772
  sanitizeSvgTreeForPdf(svgToDraw);
26773
26773
  try {
26774
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CO8Kr9ha.js");
26774
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-ByDlpq77.js");
26775
26775
  try {
26776
26776
  await logTextMeasurementDiagnostic(svgToDraw);
26777
26777
  } catch {
@@ -27171,4 +27171,4 @@ export {
27171
27171
  buildTeaserBlurFlatKeys as y,
27172
27172
  collectFontDescriptorsFromConfig as z
27173
27173
  };
27174
- //# sourceMappingURL=index-Dno8Fb1D.js.map
27174
+ //# sourceMappingURL=index-BDPFvAqK.js.map