@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.
@@ -15419,9 +15419,9 @@ const PageCanvas = react.forwardRef(
15419
15419
  const currentVisible = element.visible !== false;
15420
15420
  const fabricLeft = existingObj.left ?? 0;
15421
15421
  const fabricTop = existingObj.top ?? 0;
15422
- const storePos = pageChildren ? (() => {
15423
- const node = findNodeById(pageChildren, element.id);
15424
- return node ? getAbsoluteBounds(node, pageChildren) : { left: element.left ?? 0, top: element.top ?? 0 };
15422
+ const storePos = pageTree.length ? (() => {
15423
+ const node = findNodeById(pageTree, element.id);
15424
+ return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
15425
15425
  })() : { left: element.left ?? 0, top: element.top ?? 0 };
15426
15426
  const storeLeft = storePos.left;
15427
15427
  const storeTop = storePos.top;
@@ -15435,7 +15435,7 @@ const PageCanvas = react.forwardRef(
15435
15435
  if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
15436
15436
  positionChanged = false;
15437
15437
  }
15438
- 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 };
15438
+ const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
15439
15439
  const fabricText = existingObj.text ?? "";
15440
15440
  const storeText = element.text ?? "";
15441
15441
  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
@@ -16075,7 +16075,7 @@ const PageCanvas = react.forwardRef(
16075
16075
  if (fc && isTransforming(fc)) {
16076
16076
  return;
16077
16077
  }
16078
- const currentPageTree = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
16078
+ 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) ?? [];
16079
16079
  const fabricPos = currentPageTree.length > 0 ? (() => {
16080
16080
  const node = findNodeById(currentPageTree, element.id);
16081
16081
  return node ? getAbsoluteBounds(node, currentPageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
@@ -23653,9 +23653,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23653
23653
  }
23654
23654
  return svgString;
23655
23655
  }
23656
- const resolvedPackageVersion = "0.5.266";
23656
+ const resolvedPackageVersion = "0.5.267";
23657
23657
  const PACKAGE_VERSION = resolvedPackageVersion;
23658
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.266";
23658
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.267";
23659
23659
  const roundParityValue = (value) => {
23660
23660
  if (typeof value !== "number") return value;
23661
23661
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24469,7 +24469,7 @@ class PixldocsRenderer {
24469
24469
  await this.waitForCanvasScene(container, cloned, i);
24470
24470
  }
24471
24471
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24472
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-i1DTwWah.cjs"));
24472
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-vH_Qgwx6.cjs"));
24473
24473
  const prepared = preparePagesForExport(
24474
24474
  cloned.pages,
24475
24475
  canvasWidth,
@@ -26789,7 +26789,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26789
26789
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26790
26790
  sanitizeSvgTreeForPdf(svgToDraw);
26791
26791
  try {
26792
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-i1DTwWah.cjs"));
26792
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-vH_Qgwx6.cjs"));
26793
26793
  try {
26794
26794
  await logTextMeasurementDiagnostic(svgToDraw);
26795
26795
  } catch {
@@ -27186,4 +27186,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27186
27186
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27187
27187
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27188
27188
  exports.warmTemplateFromForm = warmTemplateFromForm;
27189
- //# sourceMappingURL=index-BTlyH7B1.cjs.map
27189
+ //# sourceMappingURL=index-C_tX_wMV.cjs.map