@pixldocs/canvas-renderer 0.5.215 → 0.5.217
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-CzwZcfGF.cjs → index-CDrMSTDa.cjs} +14 -8
- package/dist/index-CDrMSTDa.cjs.map +1 -0
- package/dist/{index-BV_MP9XQ.js → index-Ci5YA_Ps.js} +14 -8
- package/dist/index-Ci5YA_Ps.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DUohXw5V.cjs → vectorPdfExport-B8uqWQoW.cjs} +10 -6
- package/dist/vectorPdfExport-B8uqWQoW.cjs.map +1 -0
- package/dist/{vectorPdfExport-CN1fcrfR.js → vectorPdfExport-DJR9lwsV.js} +10 -6
- package/dist/vectorPdfExport-DJR9lwsV.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-BV_MP9XQ.js.map +0 -1
- package/dist/index-CzwZcfGF.cjs.map +0 -1
- package/dist/vectorPdfExport-CN1fcrfR.js.map +0 -1
- package/dist/vectorPdfExport-DUohXw5V.cjs.map +0 -1
|
@@ -6922,8 +6922,10 @@ function resolveShadowSourceSpread(element) {
|
|
|
6922
6922
|
const strength = readShadowStrength(element);
|
|
6923
6923
|
const blur = Math.max(0, Number(element.textShadowBlur ?? 0) || 0);
|
|
6924
6924
|
const fontSize = Math.max(1, Number(element.fontSize ?? 16) || 16);
|
|
6925
|
+
if (blur <= 2) return 0;
|
|
6926
|
+
const blurRamp = Math.min(1, (blur - 2) / 4);
|
|
6925
6927
|
const t = Math.max(0, (strength - 35) / 65);
|
|
6926
|
-
return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t;
|
|
6928
|
+
return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t * blurRamp;
|
|
6927
6929
|
}
|
|
6928
6930
|
function resolveShadowAlpha(element) {
|
|
6929
6931
|
const s = readShadowStrength(element);
|
|
@@ -19101,9 +19103,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
19101
19103
|
}
|
|
19102
19104
|
return svgString;
|
|
19103
19105
|
}
|
|
19104
|
-
const resolvedPackageVersion = "0.5.
|
|
19106
|
+
const resolvedPackageVersion = "0.5.217";
|
|
19105
19107
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
19106
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
19108
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.217";
|
|
19107
19109
|
const roundParityValue = (value) => {
|
|
19108
19110
|
if (typeof value !== "number") return value;
|
|
19109
19111
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19795,7 +19797,7 @@ class PixldocsRenderer {
|
|
|
19795
19797
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19796
19798
|
}
|
|
19797
19799
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
19798
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
19800
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-B8uqWQoW.cjs"));
|
|
19799
19801
|
const prepared = preparePagesForExport(
|
|
19800
19802
|
cloned.pages,
|
|
19801
19803
|
canvasWidth,
|
|
@@ -21737,6 +21739,9 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21737
21739
|
const by = parseFloat(marker.getAttribute("data-by") || "0");
|
|
21738
21740
|
const bw = parseFloat(marker.getAttribute("data-bw") || "0");
|
|
21739
21741
|
const bh = parseFloat(marker.getAttribute("data-bh") || "0");
|
|
21742
|
+
const spread = parseFloat(marker.getAttribute("data-spread") || "0");
|
|
21743
|
+
const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
|
|
21744
|
+
const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
|
|
21740
21745
|
if (!Number.isFinite(bw) || !Number.isFinite(bh) || bw <= 0 || bh <= 0) {
|
|
21741
21746
|
(_b = marker.parentNode) == null ? void 0 : _b.removeChild(marker);
|
|
21742
21747
|
continue;
|
|
@@ -21760,7 +21765,8 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21760
21765
|
const pxH = Math.min(4096, Math.max(8, Math.ceil(bh * scale)));
|
|
21761
21766
|
const stdDev = Math.max(0, blur / 2);
|
|
21762
21767
|
const filterId = `pdShadowBlur_${Math.random().toString(36).slice(2, 9)}`;
|
|
21763
|
-
const
|
|
21768
|
+
const spreadCss = spread > 0 ? `text,tspan,path{paint-order:stroke fill;stroke:currentColor;stroke-width:${spread.toFixed(3)}px;stroke-linejoin:round;stroke-linecap:round;}` : "";
|
|
21769
|
+
const styleBlock = fontFaceCss || spreadCss ? `<style>${fontFaceCss}${spreadCss}</style>` : "";
|
|
21764
21770
|
const miniSvg = `<svg xmlns="${SVG_NS}" xmlns:xlink="${XLINK_NS}" width="${pxW}" height="${pxH}" viewBox="${bx} ${by} ${bw} ${bh}">${styleBlock}<defs><filter id="${filterId}" filterUnits="userSpaceOnUse" x="${bx}" y="${by}" width="${bw}" height="${bh}" color-interpolation-filters="sRGB"><feOffset dx="${ox}" dy="${oy}" result="offsetShadow" /><feGaussianBlur in="offsetShadow" stdDeviation="${stdDev}" /></filter></defs><g filter="url(#${filterId})">${innerXml}</g></svg>`;
|
|
21765
21771
|
const dataUrl = await rasterSvgToPngDataUrl(miniSvg, pxW, pxH);
|
|
21766
21772
|
if (!dataUrl) {
|
|
@@ -21775,7 +21781,7 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21775
21781
|
img.setAttribute("preserveAspectRatio", "none");
|
|
21776
21782
|
img.setAttributeNS(XLINK_NS, "xlink:href", dataUrl);
|
|
21777
21783
|
img.setAttribute("href", dataUrl);
|
|
21778
|
-
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION));
|
|
21784
|
+
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION * shadowAlpha));
|
|
21779
21785
|
(_e = marker.parentNode) == null ? void 0 : _e.replaceChild(img, marker);
|
|
21780
21786
|
} catch (e) {
|
|
21781
21787
|
console.warn("[pdf-export] rasterizeShadowMarkers failed for one marker:", e);
|
|
@@ -21981,7 +21987,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
21981
21987
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
21982
21988
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
21983
21989
|
try {
|
|
21984
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
21990
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-B8uqWQoW.cjs"));
|
|
21985
21991
|
try {
|
|
21986
21992
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
21987
21993
|
} catch {
|
|
@@ -22378,4 +22384,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
22378
22384
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
22379
22385
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
22380
22386
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
22381
|
-
//# sourceMappingURL=index-
|
|
22387
|
+
//# sourceMappingURL=index-CDrMSTDa.cjs.map
|