@pixldocs/canvas-renderer 0.5.488 → 0.5.490
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-0K5eJY1O.cjs → index-C47g5w5y.cjs} +9 -6
- package/dist/index-C47g5w5y.cjs.map +1 -0
- package/dist/{index-D0tFaSTn.js → index-xazc-CdA.js} +9 -6
- package/dist/index-xazc-CdA.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-jRSKADbv.js → vectorPdfExport-f828EcQ6.js} +8 -11
- package/dist/{vectorPdfExport-jRSKADbv.js.map → vectorPdfExport-f828EcQ6.js.map} +1 -1
- package/dist/{vectorPdfExport-CoHsXSrT.cjs → vectorPdfExport-mxgjzQsw.cjs} +8 -11
- package/dist/{vectorPdfExport-CoHsXSrT.cjs.map → vectorPdfExport-mxgjzQsw.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-0K5eJY1O.cjs.map +0 -1
- package/dist/index-D0tFaSTn.js.map +0 -1
|
@@ -552,6 +552,7 @@ function measureTextHeight(element) {
|
|
|
552
552
|
if (overflowPolicy === "auto-shrink") {
|
|
553
553
|
const minBoxH = Math.max(0, Number(element.minBoxHeight) || 0);
|
|
554
554
|
const baseHeight = typeof element.height === "number" ? Math.max(element.height, minBoxH) : minBoxH > 0 ? minBoxH : element.height;
|
|
555
|
+
const explicitLineCount = Math.max(1, textToMeasure.split("\n").length);
|
|
555
556
|
while (fontSize > 1) {
|
|
556
557
|
const testTb = new fabric.Textbox(textToMeasure, {
|
|
557
558
|
width: measureWidth,
|
|
@@ -644,6 +645,7 @@ function computeAutoShrinkFontSize(element) {
|
|
|
644
645
|
if (!height) return baseFontSize;
|
|
645
646
|
let fontSize = baseFontSize;
|
|
646
647
|
try {
|
|
648
|
+
const explicitLineCount = Math.max(1, text.split("\n").length);
|
|
647
649
|
while (fontSize > 1) {
|
|
648
650
|
const testTb = new fabric.Textbox(text, {
|
|
649
651
|
width,
|
|
@@ -18970,6 +18972,7 @@ const PageCanvas = forwardRef(
|
|
|
18970
18972
|
const minBoxHForShrink = Math.max(0, Number(element.minBoxHeight) || 0);
|
|
18971
18973
|
const elementHeight = typeof element.height === "number" ? element.height : 0;
|
|
18972
18974
|
const heightBound = Math.max(elementHeight, minBoxHForShrink);
|
|
18975
|
+
Math.max(1, text.split("\n").length);
|
|
18973
18976
|
while (fontSize > 1) {
|
|
18974
18977
|
const testTextbox = new fabric.Textbox(text, {
|
|
18975
18978
|
width: fixedWidth,
|
|
@@ -18979,7 +18982,7 @@ const PageCanvas = forwardRef(
|
|
|
18979
18982
|
fontStyle: element.fontStyle || "normal",
|
|
18980
18983
|
lineHeight: element.lineHeight || 1.2,
|
|
18981
18984
|
charSpacing: element.charSpacing || 0,
|
|
18982
|
-
splitByGrapheme:
|
|
18985
|
+
splitByGrapheme: false
|
|
18983
18986
|
});
|
|
18984
18987
|
testTextbox.initDimensions();
|
|
18985
18988
|
const textHeight = testTextbox.height || 0;
|
|
@@ -26423,9 +26426,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26423
26426
|
}
|
|
26424
26427
|
return svgString;
|
|
26425
26428
|
}
|
|
26426
|
-
const resolvedPackageVersion = "0.5.
|
|
26429
|
+
const resolvedPackageVersion = "0.5.490";
|
|
26427
26430
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26428
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26431
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.490";
|
|
26429
26432
|
const roundParityValue = (value) => {
|
|
26430
26433
|
if (typeof value !== "number") return value;
|
|
26431
26434
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27239,7 +27242,7 @@ class PixldocsRenderer {
|
|
|
27239
27242
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27240
27243
|
}
|
|
27241
27244
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27242
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
27245
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-f828EcQ6.js");
|
|
27243
27246
|
const prepared = preparePagesForExport(
|
|
27244
27247
|
cloned.pages,
|
|
27245
27248
|
canvasWidth,
|
|
@@ -29559,7 +29562,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29559
29562
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29560
29563
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29561
29564
|
try {
|
|
29562
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
29565
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-f828EcQ6.js");
|
|
29563
29566
|
try {
|
|
29564
29567
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29565
29568
|
} catch {
|
|
@@ -29876,4 +29879,4 @@ export {
|
|
|
29876
29879
|
buildTeaserBlurFlatKeys as y,
|
|
29877
29880
|
collectFontDescriptorsFromConfig as z
|
|
29878
29881
|
};
|
|
29879
|
-
//# sourceMappingURL=index-
|
|
29882
|
+
//# sourceMappingURL=index-xazc-CdA.js.map
|