@pixldocs/canvas-renderer 0.5.59 → 0.5.61

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.d.ts CHANGED
@@ -254,7 +254,7 @@ export declare function normalizeFontFamily(fontStack: string): string;
254
254
  * Package version banner. Bump alongside package.json so we can confirm
255
255
  * (via browser:log) that the deployed bundle matches the expected build.
256
256
  */
257
- export declare const PACKAGE_VERSION = "0.5.59";
257
+ export declare const PACKAGE_VERSION = "0.5.61";
258
258
 
259
259
  export declare interface PageSettings {
260
260
  backgroundColor?: string;
package/dist/index.js CHANGED
@@ -286,14 +286,13 @@ function getTextboxWidthFitMetrics(textbox, targetWidth) {
286
286
  const dynamicMinWidth = Number(textbox.dynamicMinWidth ?? 0);
287
287
  const lineWidths = getCanvasMeasuredTextboxLineWidths(textbox);
288
288
  const maxLineWidth = lineWidths.length > 0 ? Math.max(...lineWidths) : 0;
289
- const grownWidth = Math.max(actualTextboxWidth, dynamicMinWidth);
290
- const widthDidGrow = grownWidth > targetWidth + 0.5;
289
+ const widthDidGrow = actualTextboxWidth > targetWidth + 0.5;
291
290
  return {
292
291
  actualTextboxWidth,
293
292
  dynamicMinWidth,
294
293
  maxLineWidth,
295
294
  widthDidGrow,
296
- fitsWidth: !widthDidGrow && maxLineWidth <= targetWidth + 1
295
+ fitsWidth: maxLineWidth <= targetWidth + 1
297
296
  };
298
297
  }
299
298
  function getCacheKey(element) {
@@ -12543,7 +12542,7 @@ function PixldocsPreview(props) {
12543
12542
  !canvasSettled && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
12544
12543
  ] });
12545
12544
  }
12546
- const PACKAGE_VERSION = "0.5.59";
12545
+ const PACKAGE_VERSION = "0.5.61";
12547
12546
  let __underlineFixInstalled = false;
12548
12547
  function installUnderlineFix(fab) {
12549
12548
  var _a;
@@ -15576,13 +15575,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
15576
15575
  const hasGradient = !!((_b = (_a = page.backgroundGradient) == null ? void 0 : _a.stops) == null ? void 0 : _b.length);
15577
15576
  drawPageBackground(pdf, i, page.width, page.height, page.backgroundColor, page.backgroundGradient);
15578
15577
  const shouldStripBg = stripPageBackground ?? hasGradient;
15579
- let pageSvg = page.svg;
15580
- try {
15581
- const mod = await import("./svgTextToPath-BP0Kppla.js");
15582
- pageSvg = await mod.convertAllTextToPath(pageSvg, fontBaseUrl);
15583
- } catch (outlineErr) {
15584
- console.warn(`[canvas-renderer pdf] page ${i + 1}: text outliner unavailable, continuing with text-as-text`, outlineErr);
15585
- }
15578
+ const pageSvg = page.svg;
15586
15579
  let processedSvg = await prepareLiveCanvasSvgForPdf(pageSvg, page.width, page.height, `page-${i + 1}`, {
15587
15580
  stripPageBackground: shouldStripBg
15588
15581
  });