@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
|
@@ -570,6 +570,7 @@ function measureTextHeight(element) {
|
|
|
570
570
|
if (overflowPolicy === "auto-shrink") {
|
|
571
571
|
const minBoxH = Math.max(0, Number(element.minBoxHeight) || 0);
|
|
572
572
|
const baseHeight = typeof element.height === "number" ? Math.max(element.height, minBoxH) : minBoxH > 0 ? minBoxH : element.height;
|
|
573
|
+
const explicitLineCount = Math.max(1, textToMeasure.split("\n").length);
|
|
573
574
|
while (fontSize > 1) {
|
|
574
575
|
const testTb = new fabric__namespace.Textbox(textToMeasure, {
|
|
575
576
|
width: measureWidth,
|
|
@@ -662,6 +663,7 @@ function computeAutoShrinkFontSize(element) {
|
|
|
662
663
|
if (!height) return baseFontSize;
|
|
663
664
|
let fontSize = baseFontSize;
|
|
664
665
|
try {
|
|
666
|
+
const explicitLineCount = Math.max(1, text.split("\n").length);
|
|
665
667
|
while (fontSize > 1) {
|
|
666
668
|
const testTb = new fabric__namespace.Textbox(text, {
|
|
667
669
|
width,
|
|
@@ -18988,6 +18990,7 @@ const PageCanvas = react.forwardRef(
|
|
|
18988
18990
|
const minBoxHForShrink = Math.max(0, Number(element.minBoxHeight) || 0);
|
|
18989
18991
|
const elementHeight = typeof element.height === "number" ? element.height : 0;
|
|
18990
18992
|
const heightBound = Math.max(elementHeight, minBoxHForShrink);
|
|
18993
|
+
Math.max(1, text.split("\n").length);
|
|
18991
18994
|
while (fontSize > 1) {
|
|
18992
18995
|
const testTextbox = new fabric__namespace.Textbox(text, {
|
|
18993
18996
|
width: fixedWidth,
|
|
@@ -18997,7 +19000,7 @@ const PageCanvas = react.forwardRef(
|
|
|
18997
19000
|
fontStyle: element.fontStyle || "normal",
|
|
18998
19001
|
lineHeight: element.lineHeight || 1.2,
|
|
18999
19002
|
charSpacing: element.charSpacing || 0,
|
|
19000
|
-
splitByGrapheme:
|
|
19003
|
+
splitByGrapheme: false
|
|
19001
19004
|
});
|
|
19002
19005
|
testTextbox.initDimensions();
|
|
19003
19006
|
const textHeight = testTextbox.height || 0;
|
|
@@ -26441,9 +26444,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26441
26444
|
}
|
|
26442
26445
|
return svgString;
|
|
26443
26446
|
}
|
|
26444
|
-
const resolvedPackageVersion = "0.5.
|
|
26447
|
+
const resolvedPackageVersion = "0.5.490";
|
|
26445
26448
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26446
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26449
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.490";
|
|
26447
26450
|
const roundParityValue = (value) => {
|
|
26448
26451
|
if (typeof value !== "number") return value;
|
|
26449
26452
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27257,7 +27260,7 @@ class PixldocsRenderer {
|
|
|
27257
27260
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27258
27261
|
}
|
|
27259
27262
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27260
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27263
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-mxgjzQsw.cjs"));
|
|
27261
27264
|
const prepared = preparePagesForExport(
|
|
27262
27265
|
cloned.pages,
|
|
27263
27266
|
canvasWidth,
|
|
@@ -29577,7 +29580,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29577
29580
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29578
29581
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29579
29582
|
try {
|
|
29580
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29583
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-mxgjzQsw.cjs"));
|
|
29581
29584
|
try {
|
|
29582
29585
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29583
29586
|
} catch {
|
|
@@ -29891,4 +29894,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29891
29894
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29892
29895
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29893
29896
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29894
|
-
//# sourceMappingURL=index-
|
|
29897
|
+
//# sourceMappingURL=index-C47g5w5y.cjs.map
|