@pixldocs/canvas-renderer 0.5.137 → 0.5.138

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.
@@ -15939,7 +15939,7 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
15939
15939
  }
15940
15940
  return svgString;
15941
15941
  }
15942
- const PACKAGE_VERSION = "0.5.136";
15942
+ const PACKAGE_VERSION = "0.5.138";
15943
15943
  const roundParityValue = (value) => {
15944
15944
  if (typeof value !== "number") return value;
15945
15945
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -15960,6 +15960,12 @@ function logJsonLine(tag, payload) {
15960
15960
  console.log(tag, payload);
15961
15961
  }
15962
15962
  }
15963
+ function isFabricTextboxLike(obj) {
15964
+ return !!obj && (obj instanceof fabric.Textbox || obj.type === "textbox" || obj.type === "text" || typeof obj.getLineWidth === "function" && Array.isArray(obj._textLines));
15965
+ }
15966
+ function isFabricGroupLike(obj) {
15967
+ return !!obj && (obj instanceof fabric.Group || obj.type === "group" || Array.isArray(obj._objects) && typeof obj.getObjects === "function");
15968
+ }
15963
15969
  let __underlineFixInstalled = false;
15964
15970
  function installUnderlineFix(fab) {
15965
15971
  var _a;
@@ -16358,7 +16364,7 @@ class PixldocsRenderer {
16358
16364
  await this.waitForCanvasScene(container, cloned, i);
16359
16365
  }
16360
16366
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
16361
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CP-0GqFj.js");
16367
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BGqNP_R0.js");
16362
16368
  const prepared = preparePagesForExport(
16363
16369
  cloned.pages,
16364
16370
  canvasWidth,
@@ -16934,7 +16940,7 @@ class PixldocsRenderer {
16934
16940
  const visit = (obj, groupPath = "") => {
16935
16941
  var _a2;
16936
16942
  if (!obj) return;
16937
- if (obj instanceof fabric.Textbox) {
16943
+ if (isFabricTextboxLike(obj)) {
16938
16944
  const lineWidths = getCanvasMeasuredTextboxLineWidths(obj);
16939
16945
  sample.push({
16940
16946
  id: getObjectId(obj),
@@ -16993,7 +16999,7 @@ class PixldocsRenderer {
16993
16999
  obj.dirty = true;
16994
17000
  return;
16995
17001
  }
16996
- if (obj instanceof fabric.Group) {
17002
+ if (isFabricGroupLike(obj)) {
16997
17003
  obj.getObjects().forEach(primeCharBounds);
16998
17004
  obj.dirty = true;
16999
17005
  }
@@ -18456,7 +18462,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
18456
18462
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
18457
18463
  sanitizeSvgTreeForPdf(svgToDraw);
18458
18464
  try {
18459
- const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-CP-0GqFj.js");
18465
+ const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-BGqNP_R0.js");
18460
18466
  await bakeTextAnchorPositionsFromLiveSvg(svgToDraw);
18461
18467
  } catch (e) {
18462
18468
  console.warn("[canvas-renderer][pdf-export] anchor-bake pass failed (continuing):", e);
@@ -18801,4 +18807,4 @@ export {
18801
18807
  collectFontDescriptorsFromConfig as y,
18802
18808
  collectFontsFromConfig as z
18803
18809
  };
18804
- //# sourceMappingURL=index-Dr5P178V.js.map
18810
+ //# sourceMappingURL=index-D-I6bYGU.js.map