@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
|
@@ -6904,8 +6904,10 @@ function resolveShadowSourceSpread(element) {
|
|
|
6904
6904
|
const strength = readShadowStrength(element);
|
|
6905
6905
|
const blur = Math.max(0, Number(element.textShadowBlur ?? 0) || 0);
|
|
6906
6906
|
const fontSize = Math.max(1, Number(element.fontSize ?? 16) || 16);
|
|
6907
|
+
if (blur <= 2) return 0;
|
|
6908
|
+
const blurRamp = Math.min(1, (blur - 2) / 4);
|
|
6907
6909
|
const t = Math.max(0, (strength - 35) / 65);
|
|
6908
|
-
return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t;
|
|
6910
|
+
return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t * blurRamp;
|
|
6909
6911
|
}
|
|
6910
6912
|
function resolveShadowAlpha(element) {
|
|
6911
6913
|
const s = readShadowStrength(element);
|
|
@@ -19083,9 +19085,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
19083
19085
|
}
|
|
19084
19086
|
return svgString;
|
|
19085
19087
|
}
|
|
19086
|
-
const resolvedPackageVersion = "0.5.
|
|
19088
|
+
const resolvedPackageVersion = "0.5.217";
|
|
19087
19089
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
19088
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
19090
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.217";
|
|
19089
19091
|
const roundParityValue = (value) => {
|
|
19090
19092
|
if (typeof value !== "number") return value;
|
|
19091
19093
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19777,7 +19779,7 @@ class PixldocsRenderer {
|
|
|
19777
19779
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19778
19780
|
}
|
|
19779
19781
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
19780
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
19782
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DJR9lwsV.js");
|
|
19781
19783
|
const prepared = preparePagesForExport(
|
|
19782
19784
|
cloned.pages,
|
|
19783
19785
|
canvasWidth,
|
|
@@ -21719,6 +21721,9 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21719
21721
|
const by = parseFloat(marker.getAttribute("data-by") || "0");
|
|
21720
21722
|
const bw = parseFloat(marker.getAttribute("data-bw") || "0");
|
|
21721
21723
|
const bh = parseFloat(marker.getAttribute("data-bh") || "0");
|
|
21724
|
+
const spread = parseFloat(marker.getAttribute("data-spread") || "0");
|
|
21725
|
+
const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
|
|
21726
|
+
const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
|
|
21722
21727
|
if (!Number.isFinite(bw) || !Number.isFinite(bh) || bw <= 0 || bh <= 0) {
|
|
21723
21728
|
(_b = marker.parentNode) == null ? void 0 : _b.removeChild(marker);
|
|
21724
21729
|
continue;
|
|
@@ -21742,7 +21747,8 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21742
21747
|
const pxH = Math.min(4096, Math.max(8, Math.ceil(bh * scale)));
|
|
21743
21748
|
const stdDev = Math.max(0, blur / 2);
|
|
21744
21749
|
const filterId = `pdShadowBlur_${Math.random().toString(36).slice(2, 9)}`;
|
|
21745
|
-
const
|
|
21750
|
+
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;}` : "";
|
|
21751
|
+
const styleBlock = fontFaceCss || spreadCss ? `<style>${fontFaceCss}${spreadCss}</style>` : "";
|
|
21746
21752
|
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>`;
|
|
21747
21753
|
const dataUrl = await rasterSvgToPngDataUrl(miniSvg, pxW, pxH);
|
|
21748
21754
|
if (!dataUrl) {
|
|
@@ -21757,7 +21763,7 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21757
21763
|
img.setAttribute("preserveAspectRatio", "none");
|
|
21758
21764
|
img.setAttributeNS(XLINK_NS, "xlink:href", dataUrl);
|
|
21759
21765
|
img.setAttribute("href", dataUrl);
|
|
21760
|
-
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION));
|
|
21766
|
+
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION * shadowAlpha));
|
|
21761
21767
|
(_e = marker.parentNode) == null ? void 0 : _e.replaceChild(img, marker);
|
|
21762
21768
|
} catch (e) {
|
|
21763
21769
|
console.warn("[pdf-export] rasterizeShadowMarkers failed for one marker:", e);
|
|
@@ -21963,7 +21969,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
21963
21969
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
21964
21970
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
21965
21971
|
try {
|
|
21966
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
21972
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DJR9lwsV.js");
|
|
21967
21973
|
try {
|
|
21968
21974
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
21969
21975
|
} catch {
|
|
@@ -22363,4 +22369,4 @@ export {
|
|
|
22363
22369
|
buildTeaserBlurFlatKeys as y,
|
|
22364
22370
|
collectFontDescriptorsFromConfig as z
|
|
22365
22371
|
};
|
|
22366
|
-
//# sourceMappingURL=index-
|
|
22372
|
+
//# sourceMappingURL=index-Ci5YA_Ps.js.map
|