@pixldocs/canvas-renderer 0.5.206 → 0.5.209
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-CyxNh5Y9.js → index-DOIdbh-Q.js} +42 -20
- package/dist/index-DOIdbh-Q.js.map +1 -0
- package/dist/{index-B1kaODSZ.cjs → index-DQF_on2h.cjs} +38 -16
- package/dist/index-DQF_on2h.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-C0s166DN.cjs → vectorPdfExport-B04JIcJr.cjs} +214 -34
- package/dist/vectorPdfExport-B04JIcJr.cjs.map +1 -0
- package/dist/{vectorPdfExport-CyNCzRhQ.js → vectorPdfExport-C0GsER0C.js} +214 -34
- package/dist/vectorPdfExport-C0GsER0C.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-B1kaODSZ.cjs.map +0 -1
- package/dist/index-CyxNh5Y9.js.map +0 -1
- package/dist/vectorPdfExport-C0s166DN.cjs.map +0 -1
- package/dist/vectorPdfExport-CyNCzRhQ.js.map +0 -1
|
@@ -6986,6 +6986,18 @@ function applyTextBackground(obj, cfg) {
|
|
|
6986
6986
|
bg.rxBR ?? 0,
|
|
6987
6987
|
bg.rxBL ?? 0
|
|
6988
6988
|
) : null;
|
|
6989
|
+
let shearTransform = null;
|
|
6990
|
+
if (isShear) {
|
|
6991
|
+
const fs = this.fontSize || 16;
|
|
6992
|
+
const ep = tpAny.endpoints;
|
|
6993
|
+
const dL = fs * 1.5;
|
|
6994
|
+
const dR = fs * 0.5;
|
|
6995
|
+
const lY = ep && Number.isFinite(ep.leftY) ? ep.leftY : dL;
|
|
6996
|
+
const rY = ep && Number.isFinite(ep.rightY) ? ep.rightY : dR;
|
|
6997
|
+
const slope = w > 0 ? (rY - lY) / w : 0;
|
|
6998
|
+
const dy = (lY + rY) / 2 - h / 2;
|
|
6999
|
+
shearTransform = { slope, dy };
|
|
7000
|
+
}
|
|
6989
7001
|
let bgBounds;
|
|
6990
7002
|
let bgRectsForFill = null;
|
|
6991
7003
|
if (ribbonD) {
|
|
@@ -6996,6 +7008,9 @@ function applyTextBackground(obj, cfg) {
|
|
|
6996
7008
|
}
|
|
6997
7009
|
if (blockShadowActive && bg.shadowAffectsBg !== false) {
|
|
6998
7010
|
ctx.save();
|
|
7011
|
+
if (shearTransform) {
|
|
7012
|
+
ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
|
|
7013
|
+
}
|
|
6999
7014
|
ctx.fillStyle = bg.shadowColor;
|
|
7000
7015
|
for (let i = blockSteps; i >= 1; i--) {
|
|
7001
7016
|
ctx.save();
|
|
@@ -7028,6 +7043,9 @@ function applyTextBackground(obj, cfg) {
|
|
|
7028
7043
|
}
|
|
7029
7044
|
if (lineShadowActive && bg.shadowAffectsBg !== false) {
|
|
7030
7045
|
ctx.save();
|
|
7046
|
+
if (shearTransform) {
|
|
7047
|
+
ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
|
|
7048
|
+
}
|
|
7031
7049
|
ctx.translate(extOX, extOY);
|
|
7032
7050
|
ctx.strokeStyle = bg.shadowColor;
|
|
7033
7051
|
ctx.lineWidth = 1;
|
|
@@ -7064,16 +7082,8 @@ function applyTextBackground(obj, cfg) {
|
|
|
7064
7082
|
} catch {
|
|
7065
7083
|
}
|
|
7066
7084
|
} else {
|
|
7067
|
-
if (
|
|
7068
|
-
|
|
7069
|
-
const ep = tpAny.endpoints;
|
|
7070
|
-
const dL = fs * 1.5;
|
|
7071
|
-
const dR = fs * 0.5;
|
|
7072
|
-
const lY = ep && Number.isFinite(ep.leftY) ? ep.leftY : dL;
|
|
7073
|
-
const rY = ep && Number.isFinite(ep.rightY) ? ep.rightY : dR;
|
|
7074
|
-
const slope = w > 0 ? (rY - lY) / w : 0;
|
|
7075
|
-
const dy = (lY + rY) / 2 - h / 2;
|
|
7076
|
-
ctx.transform(1, slope, 0, 1, 0, dy);
|
|
7085
|
+
if (shearTransform) {
|
|
7086
|
+
ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
|
|
7077
7087
|
}
|
|
7078
7088
|
const rects = bgRectsForFill;
|
|
7079
7089
|
for (const r of rects) {
|
|
@@ -10767,7 +10777,12 @@ const PageCanvas = react.forwardRef(
|
|
|
10767
10777
|
top: 0,
|
|
10768
10778
|
width: canvasWidth,
|
|
10769
10779
|
height: canvasHeight,
|
|
10770
|
-
absolutePositioned: true
|
|
10780
|
+
absolutePositioned: true,
|
|
10781
|
+
// Rect defaults to strokeWidth:1, which makes the clip region inset
|
|
10782
|
+
// by ~0.5px on top/left and bleed ~0.5px on bottom/right after the
|
|
10783
|
+
// viewport-transform multiply — visible as a 1px page-bg sliver
|
|
10784
|
+
// along the top/left edges of the canvas at any zoom level.
|
|
10785
|
+
strokeWidth: 0
|
|
10771
10786
|
});
|
|
10772
10787
|
fc.requestRenderAll();
|
|
10773
10788
|
}, [canvasWidth, canvasHeight]);
|
|
@@ -18544,6 +18559,13 @@ function warpTextboxSvgAlongPath(svg, obj) {
|
|
|
18544
18559
|
const existing = bgEl.getAttribute("transform");
|
|
18545
18560
|
bgEl.setAttribute("transform", existing ? `${matrix} ${existing}` : matrix);
|
|
18546
18561
|
}
|
|
18562
|
+
const bgShadowPaths = Array.from(doc2.querySelectorAll(
|
|
18563
|
+
"g.__pdBgShadowClone > path, g.__pdShadowRaster > path"
|
|
18564
|
+
));
|
|
18565
|
+
for (const p of bgShadowPaths) {
|
|
18566
|
+
const existing = p.getAttribute("transform");
|
|
18567
|
+
p.setAttribute("transform", existing ? `${matrix} ${existing}` : matrix);
|
|
18568
|
+
}
|
|
18547
18569
|
return new XMLSerializer().serializeToString(doc2.documentElement);
|
|
18548
18570
|
}
|
|
18549
18571
|
const resolved = resolveTextPath(tp, Number(obj.width) || 0, Number(obj.fontSize) || 16);
|
|
@@ -18942,9 +18964,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
18942
18964
|
}
|
|
18943
18965
|
return svgString;
|
|
18944
18966
|
}
|
|
18945
|
-
const resolvedPackageVersion = "0.5.
|
|
18967
|
+
const resolvedPackageVersion = "0.5.209";
|
|
18946
18968
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
18947
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
18969
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.209";
|
|
18948
18970
|
const roundParityValue = (value) => {
|
|
18949
18971
|
if (typeof value !== "number") return value;
|
|
18950
18972
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19623,7 +19645,7 @@ class PixldocsRenderer {
|
|
|
19623
19645
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19624
19646
|
}
|
|
19625
19647
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
19626
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
19648
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-B04JIcJr.cjs"));
|
|
19627
19649
|
const prepared = preparePagesForExport(
|
|
19628
19650
|
cloned.pages,
|
|
19629
19651
|
canvasWidth,
|
|
@@ -21807,7 +21829,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
21807
21829
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
21808
21830
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
21809
21831
|
try {
|
|
21810
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
21832
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-B04JIcJr.cjs"));
|
|
21811
21833
|
try {
|
|
21812
21834
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
21813
21835
|
} catch {
|
|
@@ -22204,4 +22226,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
22204
22226
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
22205
22227
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
22206
22228
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
22207
|
-
//# sourceMappingURL=index-
|
|
22229
|
+
//# sourceMappingURL=index-DQF_on2h.cjs.map
|