@pixldocs/canvas-renderer 0.5.260 → 0.5.261

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.
@@ -13505,6 +13505,8 @@ const PageCanvas = react.forwardRef(
13505
13505
  const asSy0 = obj.scaleY ?? 1;
13506
13506
  const asLeft0 = obj.left ?? 0;
13507
13507
  const asTop0 = obj.top ?? 0;
13508
+ const asRect0 = obj.getBoundingRect();
13509
+ let didReflowTextChild = false;
13508
13510
  for (const child of obj.getObjects()) {
13509
13511
  if (!(child instanceof fabric__namespace.Textbox)) continue;
13510
13512
  if (isXSide) {
@@ -13520,7 +13522,9 @@ const PageCanvas = react.forwardRef(
13520
13522
  child.initDimensions();
13521
13523
  } catch {
13522
13524
  }
13525
+ child.setCoords();
13523
13526
  child.dirty = true;
13527
+ didReflowTextChild = true;
13524
13528
  }
13525
13529
  } else {
13526
13530
  if (child.__asLiveOrigH == null) {
@@ -13534,16 +13538,35 @@ const PageCanvas = react.forwardRef(
13534
13538
  child.initDimensions();
13535
13539
  } catch {
13536
13540
  }
13541
+ child.setCoords();
13537
13542
  child.dirty = true;
13543
+ didReflowTextChild = true;
13538
13544
  }
13539
13545
  }
13546
+ if (isXSide && didReflowTextChild && typeof obj.triggerLayout === "function") {
13547
+ try {
13548
+ obj.triggerLayout();
13549
+ } catch {
13550
+ }
13551
+ obj._set("width", asW0);
13552
+ obj._set("scaleX", asSx0);
13553
+ obj._set("scaleY", asSy0);
13554
+ obj.setCoords();
13555
+ const afterRect = obj.getBoundingRect();
13556
+ const fixedLeft = asRect0.left;
13557
+ const fixedRight = asRect0.left + asRect0.width;
13558
+ const nextLeft = corner === "ml" ? (obj.left ?? 0) + (fixedRight - (afterRect.left + afterRect.width)) : (obj.left ?? 0) + (fixedLeft - afterRect.left);
13559
+ obj._set("left", nextLeft);
13560
+ } else {
13561
+ obj._set("height", asH0);
13562
+ obj._set("left", asLeft0);
13563
+ obj._set("top", asTop0);
13564
+ }
13540
13565
  obj._set("width", asW0);
13541
- obj._set("height", asH0);
13542
13566
  obj._set("scaleX", asSx0);
13543
13567
  obj._set("scaleY", asSy0);
13544
- obj._set("left", asLeft0);
13545
- obj._set("top", asTop0);
13546
13568
  obj.setCoords();
13569
+ obj.dirty = true;
13547
13570
  }
13548
13571
  }
13549
13572
  snapDuringScaleCallback(obj, corner);
@@ -23560,9 +23583,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23560
23583
  }
23561
23584
  return svgString;
23562
23585
  }
23563
- const resolvedPackageVersion = "0.5.260";
23586
+ const resolvedPackageVersion = "0.5.261";
23564
23587
  const PACKAGE_VERSION = resolvedPackageVersion;
23565
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.260";
23588
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.261";
23566
23589
  const roundParityValue = (value) => {
23567
23590
  if (typeof value !== "number") return value;
23568
23591
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24376,7 +24399,7 @@ class PixldocsRenderer {
24376
24399
  await this.waitForCanvasScene(container, cloned, i);
24377
24400
  }
24378
24401
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24379
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DuUmVQWJ.cjs"));
24402
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BsjP4JQb.cjs"));
24380
24403
  const prepared = preparePagesForExport(
24381
24404
  cloned.pages,
24382
24405
  canvasWidth,
@@ -26696,7 +26719,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26696
26719
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26697
26720
  sanitizeSvgTreeForPdf(svgToDraw);
26698
26721
  try {
26699
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DuUmVQWJ.cjs"));
26722
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BsjP4JQb.cjs"));
26700
26723
  try {
26701
26724
  await logTextMeasurementDiagnostic(svgToDraw);
26702
26725
  } catch {
@@ -27093,4 +27116,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27093
27116
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27094
27117
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27095
27118
  exports.warmTemplateFromForm = warmTemplateFromForm;
27096
- //# sourceMappingURL=index-iahevkuu.cjs.map
27119
+ //# sourceMappingURL=index-Dfc18rpJ.cjs.map