@pixldocs/canvas-renderer 0.5.211 → 0.5.213
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-C0tTvSFQ.js → index-XZf4TDQ-.js} +133 -14
- package/dist/index-XZf4TDQ-.js.map +1 -0
- package/dist/{index-d8U2oDzI.cjs → index-zkVpb-YL.cjs} +133 -14
- package/dist/index-zkVpb-YL.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-QzySzFJJ.cjs → vectorPdfExport-krI8SwbX.cjs} +20 -6
- package/dist/vectorPdfExport-krI8SwbX.cjs.map +1 -0
- package/dist/{vectorPdfExport-BEGl71uB.js → vectorPdfExport-ox1nl4G9.js} +20 -6
- package/dist/vectorPdfExport-ox1nl4G9.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-C0tTvSFQ.js.map +0 -1
- package/dist/index-d8U2oDzI.cjs.map +0 -1
- package/dist/vectorPdfExport-BEGl71uB.js.map +0 -1
- package/dist/vectorPdfExport-QzySzFJJ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-zkVpb-YL.cjs");
|
|
4
4
|
exports.DEPLOYMENT_VERSION_MARKER = index.DEPLOYMENT_VERSION_MARKER;
|
|
5
5
|
exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
|
|
6
6
|
exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, M, b, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5 } from "./index-
|
|
1
|
+
import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, M, b, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5 } from "./index-XZf4TDQ-.js";
|
|
2
2
|
export {
|
|
3
3
|
D as DEPLOYMENT_VERSION_MARKER,
|
|
4
4
|
F as FONT_FALLBACK_DEVANAGARI,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jspdf = require("jspdf");
|
|
4
4
|
const svg2pdf_js = require("svg2pdf.js");
|
|
5
5
|
const fabric = require("fabric");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-zkVpb-YL.cjs");
|
|
7
7
|
const pdfFonts = require("./pdfFonts-BTj2f465.cjs");
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -2079,7 +2079,7 @@ async function convertSvgTextDecorationsToLinesString(svgStr) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
2081
|
async function rasterizeShadowMarkers(svg) {
|
|
2082
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2082
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2083
2083
|
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
2084
2084
|
const markers = Array.from(svg.querySelectorAll("g.__pdShadowRaster"));
|
|
2085
2085
|
if (markers.length === 0) return;
|
|
@@ -2138,11 +2138,25 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
2138
2138
|
img.setAttribute("preserveAspectRatio", "none");
|
|
2139
2139
|
img.setAttributeNS(XLINK_NS, "xlink:href", dataUrl);
|
|
2140
2140
|
img.setAttribute("href", dataUrl);
|
|
2141
|
+
const passes = Math.max(1, Math.min(8, parseInt(marker.getAttribute("data-passes") || "1", 10) || 1));
|
|
2142
|
+
const lastAlphaRaw = parseFloat(marker.getAttribute("data-last-alpha") || "1");
|
|
2143
|
+
const lastAlpha = Number.isFinite(lastAlphaRaw) ? Math.max(0, Math.min(1, lastAlphaRaw)) : 1;
|
|
2144
|
+
const baseOpacity = Number(img.getAttribute("opacity") || "1") || 1;
|
|
2141
2145
|
(_e = marker.parentNode) == null ? void 0 : _e.replaceChild(img, marker);
|
|
2146
|
+
for (let i = 1; i < passes; i++) {
|
|
2147
|
+
const extra = img.cloneNode(true);
|
|
2148
|
+
if (i === passes - 1 && lastAlpha < 1) {
|
|
2149
|
+
extra.setAttribute("opacity", String(baseOpacity * lastAlpha));
|
|
2150
|
+
}
|
|
2151
|
+
(_f = img.parentNode) == null ? void 0 : _f.insertBefore(extra, img.nextSibling);
|
|
2152
|
+
}
|
|
2153
|
+
if (passes === 1 && lastAlpha < 1) {
|
|
2154
|
+
img.setAttribute("opacity", String(baseOpacity * lastAlpha));
|
|
2155
|
+
}
|
|
2142
2156
|
} catch (error) {
|
|
2143
2157
|
console.warn("[Vector PDF] text shadow rasterization failed for one marker:", error);
|
|
2144
2158
|
try {
|
|
2145
|
-
(
|
|
2159
|
+
(_g = marker.parentNode) == null ? void 0 : _g.removeChild(marker);
|
|
2146
2160
|
} catch {
|
|
2147
2161
|
}
|
|
2148
2162
|
}
|
|
@@ -2970,7 +2984,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2970
2984
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2971
2985
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2972
2986
|
try {
|
|
2973
|
-
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-
|
|
2987
|
+
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-zkVpb-YL.cjs")).then((n) => n.canvasImageLoader);
|
|
2974
2988
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2975
2989
|
} catch {
|
|
2976
2990
|
return null;
|
|
@@ -3779,7 +3793,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3779
3793
|
}
|
|
3780
3794
|
let fetchUrl = imageUrl;
|
|
3781
3795
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3782
|
-
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-
|
|
3796
|
+
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-zkVpb-YL.cjs")).then((n) => n.canvasImageLoader);
|
|
3783
3797
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3784
3798
|
const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
|
|
3785
3799
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -5878,4 +5892,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
|
|
|
5878
5892
|
exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
|
|
5879
5893
|
exports.preparePagesForExport = preparePagesForExport;
|
|
5880
5894
|
exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
|
|
5881
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5895
|
+
//# sourceMappingURL=vectorPdfExport-krI8SwbX.cjs.map
|