@pixldocs/canvas-renderer 0.5.169 → 0.5.170

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.
@@ -15752,6 +15752,20 @@ function paintRepeatableSections(config, repeatableSections) {
15752
15752
  }
15753
15753
  }
15754
15754
  const PREVIEW_DEBUG_PREFIX = "[canvas-renderer][preview-debug]";
15755
+ function computeFontSignature(config) {
15756
+ var _a;
15757
+ if (!((_a = config == null ? void 0 : config.pages) == null ? void 0 : _a.length)) return "";
15758
+ const fams = /* @__PURE__ */ new Set();
15759
+ const walk = (nodes) => {
15760
+ var _a2;
15761
+ for (const node of nodes || []) {
15762
+ if (node == null ? void 0 : node.fontFamily) fams.add(String(node.fontFamily));
15763
+ if ((_a2 = node == null ? void 0 : node.children) == null ? void 0 : _a2.length) walk(node.children);
15764
+ }
15765
+ };
15766
+ for (const page of config.pages) walk(page.children || []);
15767
+ return Array.from(fams).sort().join("|");
15768
+ }
15755
15769
  function countUnderlinedNodes(config) {
15756
15770
  var _a;
15757
15771
  if (!((_a = config == null ? void 0 : config.pages) == null ? void 0 : _a.length)) return 0;
@@ -15870,6 +15884,7 @@ function PixldocsPreview(props) {
15870
15884
  ]);
15871
15885
  const config = isResolveMode ? resolvedConfig : props.config;
15872
15886
  const previewKey = useMemo(() => `${pageIndex}`, [pageIndex]);
15887
+ const fontSignature = useMemo(() => computeFontSignature(config), [config]);
15873
15888
  useEffect(() => {
15874
15889
  if (isResolveMode) return;
15875
15890
  if (!config) {
@@ -15899,7 +15914,7 @@ function PixldocsPreview(props) {
15899
15914
  return () => {
15900
15915
  cancelled = true;
15901
15916
  };
15902
- }, [isResolveMode, config]);
15917
+ }, [isResolveMode, fontSignature]);
15903
15918
  const handleCanvasReady = useCallback(() => {
15904
15919
  console.log(PREVIEW_DEBUG_PREFIX, "canvas-ready", { pageIndex, action: "settled" });
15905
15920
  setCanvasSettled(true);
@@ -16102,9 +16117,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
16102
16117
  }
16103
16118
  return svgString;
16104
16119
  }
16105
- const resolvedPackageVersion = "0.5.169";
16120
+ const resolvedPackageVersion = "0.5.170";
16106
16121
  const PACKAGE_VERSION = resolvedPackageVersion;
16107
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.169";
16122
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.170";
16108
16123
  const roundParityValue = (value) => {
16109
16124
  if (typeof value !== "number") return value;
16110
16125
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -16602,7 +16617,7 @@ class PixldocsRenderer {
16602
16617
  await this.waitForCanvasScene(container, cloned, i);
16603
16618
  }
16604
16619
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
16605
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C2jE125-.js");
16620
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BD0zlq42.js");
16606
16621
  const prepared = preparePagesForExport(
16607
16622
  cloned.pages,
16608
16623
  canvasWidth,
@@ -18704,7 +18719,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
18704
18719
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
18705
18720
  sanitizeSvgTreeForPdf(svgToDraw);
18706
18721
  try {
18707
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C2jE125-.js");
18722
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BD0zlq42.js");
18708
18723
  try {
18709
18724
  await logTextMeasurementDiagnostic(svgToDraw);
18710
18725
  } catch {
@@ -19106,4 +19121,4 @@ export {
19106
19121
  collectFontDescriptorsFromConfig as y,
19107
19122
  collectFontsFromConfig as z
19108
19123
  };
19109
- //# sourceMappingURL=index-qJRuErt-.js.map
19124
+ //# sourceMappingURL=index-BvYxWljO.js.map