@pixldocs/canvas-renderer 0.5.489 → 0.5.491
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-DFPaf9mH.js → index-Cr96RvlZ.js} +14 -24
- package/dist/index-Cr96RvlZ.js.map +1 -0
- package/dist/{index-SOZMTq-v.cjs → index-sfUNqu61.cjs} +14 -24
- package/dist/index-sfUNqu61.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-zW2ceM2y.js → vectorPdfExport-7V15HkWe.js} +8 -11
- package/dist/{vectorPdfExport-zW2ceM2y.js.map → vectorPdfExport-7V15HkWe.js.map} +1 -1
- package/dist/{vectorPdfExport-c8OVQAkW.cjs → vectorPdfExport-BWUlBEaK.cjs} +8 -11
- package/dist/{vectorPdfExport-c8OVQAkW.cjs.map → vectorPdfExport-BWUlBEaK.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DFPaf9mH.js.map +0 -1
- package/dist/index-SOZMTq-v.cjs.map +0 -1
|
@@ -534,7 +534,6 @@ function getCacheKey(element) {
|
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
function measureTextHeight(element) {
|
|
537
|
-
var _a2;
|
|
538
537
|
if (element.type !== "text") {
|
|
539
538
|
return element.height || 20;
|
|
540
539
|
}
|
|
@@ -567,11 +566,9 @@ function measureTextHeight(element) {
|
|
|
567
566
|
});
|
|
568
567
|
testTb.initDimensions();
|
|
569
568
|
const textHeight = testTb.height || 0;
|
|
570
|
-
const renderedLineCount = ((_a2 = testTb.textLines) == null ? void 0 : _a2.length) || 1;
|
|
571
|
-
const hasNoImplicitWrap = renderedLineCount <= explicitLineCount;
|
|
572
569
|
const fitsHeight = !baseHeight || textHeight <= baseHeight;
|
|
573
570
|
const { fitsWidth } = getTextboxWidthFitMetrics(testTb, measureWidth);
|
|
574
|
-
if (
|
|
571
|
+
if (fitsHeight && fitsWidth) break;
|
|
575
572
|
fontSize--;
|
|
576
573
|
}
|
|
577
574
|
const finalTb = new fabric.Textbox(textToMeasure, {
|
|
@@ -639,7 +636,6 @@ function clearMeasurementCache() {
|
|
|
639
636
|
heightCache.clear();
|
|
640
637
|
}
|
|
641
638
|
function computeAutoShrinkFontSize(element) {
|
|
642
|
-
var _a2;
|
|
643
639
|
const baseFontSize = element.fontSize || 16;
|
|
644
640
|
if (element.overflowPolicy !== "auto-shrink") return baseFontSize;
|
|
645
641
|
const text = element.text || element.content || "";
|
|
@@ -663,13 +659,11 @@ function computeAutoShrinkFontSize(element) {
|
|
|
663
659
|
});
|
|
664
660
|
testTb.initDimensions();
|
|
665
661
|
const textHeight = testTb.height || 0;
|
|
666
|
-
const renderedLineCount = ((_a2 = testTb.textLines) == null ? void 0 : _a2.length) || 1;
|
|
667
|
-
const hasNoImplicitWrap = renderedLineCount <= explicitLineCount;
|
|
668
662
|
const fitsHeight = textHeight <= height;
|
|
669
663
|
const lineWidths = testTb.__lineWidths;
|
|
670
664
|
const maxLineWidth = lineWidths && lineWidths.length > 0 ? Math.max(...lineWidths) : 0;
|
|
671
665
|
const fitsWidth = maxLineWidth <= width + 1;
|
|
672
|
-
if (
|
|
666
|
+
if (fitsHeight && fitsWidth) break;
|
|
673
667
|
fontSize--;
|
|
674
668
|
}
|
|
675
669
|
} catch (e) {
|
|
@@ -9879,7 +9873,7 @@ function createText(element) {
|
|
|
9879
9873
|
iterationSamples.push(lastIter);
|
|
9880
9874
|
}
|
|
9881
9875
|
}
|
|
9882
|
-
if (
|
|
9876
|
+
if (fitsHeight && fitsWidth) {
|
|
9883
9877
|
breakReason = "fits";
|
|
9884
9878
|
break;
|
|
9885
9879
|
}
|
|
@@ -17239,15 +17233,13 @@ const PageCanvas = forwardRef(
|
|
|
17239
17233
|
}
|
|
17240
17234
|
updateElement(elementId, {
|
|
17241
17235
|
text: newText,
|
|
17242
|
-
...typeof nextHeight === "number" && nextHeight > 0 && { height: nextHeight }
|
|
17243
|
-
...target.styles && Object.keys(target.styles).length > 0 ? { styles: JSON.parse(JSON.stringify(target.styles)) } : {}
|
|
17236
|
+
...typeof nextHeight === "number" && nextHeight > 0 && { height: nextHeight }
|
|
17244
17237
|
});
|
|
17245
17238
|
} else {
|
|
17246
17239
|
updateElement(elementId, {
|
|
17247
17240
|
text: newText,
|
|
17248
17241
|
...fabricHeight > 0 && { height: fabricHeight },
|
|
17249
|
-
...fabricWidth > 0 && { width: fabricWidth }
|
|
17250
|
-
...target.styles && Object.keys(target.styles).length > 0 ? { styles: JSON.parse(JSON.stringify(target.styles)) } : {}
|
|
17242
|
+
...fabricWidth > 0 && { width: fabricWidth }
|
|
17251
17243
|
});
|
|
17252
17244
|
}
|
|
17253
17245
|
commitHistory2();
|
|
@@ -18594,7 +18586,7 @@ const PageCanvas = forwardRef(
|
|
|
18594
18586
|
return unsub;
|
|
18595
18587
|
}, []);
|
|
18596
18588
|
const updateFabricObject = (obj, element, skipPositionUpdate = false) => {
|
|
18597
|
-
var _a2, _b2, _c2
|
|
18589
|
+
var _a2, _b2, _c2;
|
|
18598
18590
|
const fc = fabricRef.current;
|
|
18599
18591
|
if (fc && isTransforming(fc)) {
|
|
18600
18592
|
return;
|
|
@@ -18978,7 +18970,7 @@ const PageCanvas = forwardRef(
|
|
|
18978
18970
|
const minBoxHForShrink = Math.max(0, Number(element.minBoxHeight) || 0);
|
|
18979
18971
|
const elementHeight = typeof element.height === "number" ? element.height : 0;
|
|
18980
18972
|
const heightBound = Math.max(elementHeight, minBoxHForShrink);
|
|
18981
|
-
|
|
18973
|
+
Math.max(1, text.split("\n").length);
|
|
18982
18974
|
while (fontSize > 1) {
|
|
18983
18975
|
const testTextbox = new fabric.Textbox(text, {
|
|
18984
18976
|
width: fixedWidth,
|
|
@@ -18992,11 +18984,9 @@ const PageCanvas = forwardRef(
|
|
|
18992
18984
|
});
|
|
18993
18985
|
testTextbox.initDimensions();
|
|
18994
18986
|
const textHeight = testTextbox.height || 0;
|
|
18995
|
-
const renderedLineCount = ((_c2 = testTextbox.textLines) == null ? void 0 : _c2.length) || 1;
|
|
18996
|
-
const hasNoImplicitWrap = renderedLineCount <= explicitLineCount;
|
|
18997
18987
|
const fitsHeight = heightBound <= 0 || textHeight <= heightBound;
|
|
18998
18988
|
const { fitsWidth } = getTextboxWidthFitMetrics(testTextbox, fixedWidth);
|
|
18999
|
-
if (
|
|
18989
|
+
if (fitsHeight && fitsWidth) {
|
|
19000
18990
|
break;
|
|
19001
18991
|
}
|
|
19002
18992
|
fontSize--;
|
|
@@ -19117,7 +19107,7 @@ const PageCanvas = forwardRef(
|
|
|
19117
19107
|
} catch {
|
|
19118
19108
|
}
|
|
19119
19109
|
obj.dirty = true;
|
|
19120
|
-
(
|
|
19110
|
+
(_c2 = obj.setCoords) == null ? void 0 : _c2.call(obj);
|
|
19121
19111
|
obj.__lastTextBgShadowJson = JSON.stringify({
|
|
19122
19112
|
c: element.textBgColor ?? null,
|
|
19123
19113
|
g: element.textBgGradient ?? null,
|
|
@@ -26434,9 +26424,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26434
26424
|
}
|
|
26435
26425
|
return svgString;
|
|
26436
26426
|
}
|
|
26437
|
-
const resolvedPackageVersion = "0.5.
|
|
26427
|
+
const resolvedPackageVersion = "0.5.491";
|
|
26438
26428
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26439
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26429
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.491";
|
|
26440
26430
|
const roundParityValue = (value) => {
|
|
26441
26431
|
if (typeof value !== "number") return value;
|
|
26442
26432
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27250,7 +27240,7 @@ class PixldocsRenderer {
|
|
|
27250
27240
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27251
27241
|
}
|
|
27252
27242
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27253
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
27243
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-7V15HkWe.js");
|
|
27254
27244
|
const prepared = preparePagesForExport(
|
|
27255
27245
|
cloned.pages,
|
|
27256
27246
|
canvasWidth,
|
|
@@ -29570,7 +29560,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29570
29560
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29571
29561
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29572
29562
|
try {
|
|
29573
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
29563
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-7V15HkWe.js");
|
|
29574
29564
|
try {
|
|
29575
29565
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29576
29566
|
} catch {
|
|
@@ -29887,4 +29877,4 @@ export {
|
|
|
29887
29877
|
buildTeaserBlurFlatKeys as y,
|
|
29888
29878
|
collectFontDescriptorsFromConfig as z
|
|
29889
29879
|
};
|
|
29890
|
-
//# sourceMappingURL=index-
|
|
29880
|
+
//# sourceMappingURL=index-Cr96RvlZ.js.map
|