@pixldocs/canvas-renderer 0.5.108 → 0.5.110

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.
package/dist/index.cjs CHANGED
@@ -14017,7 +14017,7 @@ function PixldocsPreview(props) {
14017
14017
  !canvasSettled && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
14018
14018
  ] });
14019
14019
  }
14020
- const PACKAGE_VERSION = "0.5.105";
14020
+ const PACKAGE_VERSION = "0.5.110";
14021
14021
  const roundParityValue = (value) => {
14022
14022
  if (typeof value !== "number") return value;
14023
14023
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -14304,7 +14304,7 @@ class PixldocsRenderer {
14304
14304
  async renderPdf(templateConfig, options) {
14305
14305
  const svgs = await this.renderAllPageSvgs(templateConfig);
14306
14306
  const { assemblePdfFromSvgs: assemblePdfFromSvgs2 } = await Promise.resolve().then(() => pdfExport);
14307
- return assemblePdfFromSvgs2(svgs, { title: options == null ? void 0 : options.title, fontBaseUrl: options == null ? void 0 : options.fontBaseUrl, textMode: (options == null ? void 0 : options.textMode) ?? templateConfig.pdfTextMode ?? "selectable" });
14307
+ return assemblePdfFromSvgs2(svgs, { title: options == null ? void 0 : options.title, fontBaseUrl: options == null ? void 0 : options.fontBaseUrl, textMode: (options == null ? void 0 : options.textMode) ?? "pixel-perfect" });
14308
14308
  }
14309
14309
  /**
14310
14310
  * Resolve from V2 sectionState and render a vector PDF.
@@ -14329,7 +14329,7 @@ class PixldocsRenderer {
14329
14329
  }
14330
14330
  const svgs = await this.renderAllPageSvgs(configToRender);
14331
14331
  const { assemblePdfFromSvgs: assemblePdfFromSvgs2 } = await Promise.resolve().then(() => pdfExport);
14332
- return assemblePdfFromSvgs2(svgs, { title: title ?? resolved.config.name, fontBaseUrl, textMode: options.textMode ?? configToRender.pdfTextMode ?? "selectable" });
14332
+ return assemblePdfFromSvgs2(svgs, { title: title ?? resolved.config.name, fontBaseUrl, textMode: options.textMode ?? "pixel-perfect" });
14333
14333
  }
14334
14334
  async renderById(templateId, formData, options) {
14335
14335
  const resolved = await resolveTemplateData({
@@ -17672,7 +17672,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
17672
17672
  const hasGradient = !!((_b = (_a = page.backgroundGradient) == null ? void 0 : _a.stops) == null ? void 0 : _b.length);
17673
17673
  drawPageBackground(pdf, i, page.width, page.height, page.backgroundColor, page.backgroundGradient);
17674
17674
  const shouldStripBg = stripPageBackground ?? hasGradient;
17675
- const textMode = options.textMode ?? (options.outlineText === false ? "selectable" : "selectable");
17675
+ const textMode = options.textMode ?? (options.outlineText === false ? "selectable" : "pixel-perfect");
17676
17676
  const shouldOutlineText = textMode === "pixel-perfect" || textMode === "auto";
17677
17677
  const outlineSubMode = textMode === "auto" ? "complex-only" : "all";
17678
17678
  let pageSvg = page.svg;
@@ -17686,7 +17686,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
17686
17686
  }
17687
17687
  if (shouldOutlineText) {
17688
17688
  try {
17689
- const { convertAllTextToPath } = await Promise.resolve().then(() => require("./svgTextToPath-DTKsddnS.cjs"));
17689
+ const { convertAllTextToPath } = await Promise.resolve().then(() => require("./svgTextToPath-4Y_THSBg.cjs"));
17690
17690
  pageSvg = await convertAllTextToPath(pageSvg, fontBaseUrl, { mode: outlineSubMode });
17691
17691
  try {
17692
17692
  dumpSvgTextDiagnostics(pageSvg, i, PARITY_TAG, "STAGE-1b-after-text-to-path-raw");