@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.cjs +4 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/svgTextToPath-BP0Kppla.js +0 -1083
- package/dist/svgTextToPath-BP0Kppla.js.map +0 -1
- package/dist/svgTextToPath-BTHnqJpM.cjs +0 -1105
- package/dist/svgTextToPath-BTHnqJpM.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -305,14 +305,13 @@ function getTextboxWidthFitMetrics(textbox, targetWidth) {
|
|
|
305
305
|
const dynamicMinWidth = Number(textbox.dynamicMinWidth ?? 0);
|
|
306
306
|
const lineWidths = getCanvasMeasuredTextboxLineWidths(textbox);
|
|
307
307
|
const maxLineWidth = lineWidths.length > 0 ? Math.max(...lineWidths) : 0;
|
|
308
|
-
const
|
|
309
|
-
const widthDidGrow = grownWidth > targetWidth + 0.5;
|
|
308
|
+
const widthDidGrow = actualTextboxWidth > targetWidth + 0.5;
|
|
310
309
|
return {
|
|
311
310
|
actualTextboxWidth,
|
|
312
311
|
dynamicMinWidth,
|
|
313
312
|
maxLineWidth,
|
|
314
313
|
widthDidGrow,
|
|
315
|
-
fitsWidth:
|
|
314
|
+
fitsWidth: maxLineWidth <= targetWidth + 1
|
|
316
315
|
};
|
|
317
316
|
}
|
|
318
317
|
function getCacheKey(element) {
|
|
@@ -12562,7 +12561,7 @@ function PixldocsPreview(props) {
|
|
|
12562
12561
|
!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..." }) })
|
|
12563
12562
|
] });
|
|
12564
12563
|
}
|
|
12565
|
-
const PACKAGE_VERSION = "0.5.
|
|
12564
|
+
const PACKAGE_VERSION = "0.5.61";
|
|
12566
12565
|
let __underlineFixInstalled = false;
|
|
12567
12566
|
function installUnderlineFix(fab) {
|
|
12568
12567
|
var _a;
|
|
@@ -15595,13 +15594,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
|
|
|
15595
15594
|
const hasGradient = !!((_b = (_a = page.backgroundGradient) == null ? void 0 : _a.stops) == null ? void 0 : _b.length);
|
|
15596
15595
|
drawPageBackground(pdf, i, page.width, page.height, page.backgroundColor, page.backgroundGradient);
|
|
15597
15596
|
const shouldStripBg = stripPageBackground ?? hasGradient;
|
|
15598
|
-
|
|
15599
|
-
try {
|
|
15600
|
-
const mod = await Promise.resolve().then(() => require("./svgTextToPath-BTHnqJpM.cjs"));
|
|
15601
|
-
pageSvg = await mod.convertAllTextToPath(pageSvg, fontBaseUrl);
|
|
15602
|
-
} catch (outlineErr) {
|
|
15603
|
-
console.warn(`[canvas-renderer pdf] page ${i + 1}: text outliner unavailable, continuing with text-as-text`, outlineErr);
|
|
15604
|
-
}
|
|
15597
|
+
const pageSvg = page.svg;
|
|
15605
15598
|
let processedSvg = await prepareLiveCanvasSvgForPdf(pageSvg, page.width, page.height, `page-${i + 1}`, {
|
|
15606
15599
|
stripPageBackground: shouldStripBg
|
|
15607
15600
|
});
|