@pixldocs/canvas-renderer 0.5.212 → 0.5.214
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-B1QDVK5k.js → index-CDdfs3IB.js} +31 -25
- package/dist/index-CDdfs3IB.js.map +1 -0
- package/dist/{index-DB8j0PV0.cjs → index-Cy2_ElDZ.cjs} +31 -25
- package/dist/index-Cy2_ElDZ.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-zGrrm-iT.cjs → vectorPdfExport-BBG0QRse.cjs} +7 -5
- package/dist/vectorPdfExport-BBG0QRse.cjs.map +1 -0
- package/dist/{vectorPdfExport-CN-N0DE8.js → vectorPdfExport-CjIUU8on.js} +7 -5
- package/dist/vectorPdfExport-CjIUU8on.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-B1QDVK5k.js.map +0 -1
- package/dist/index-DB8j0PV0.cjs.map +0 -1
- package/dist/vectorPdfExport-CN-N0DE8.js.map +0 -1
- package/dist/vectorPdfExport-zGrrm-iT.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsPDF, ShadingPattern } from "jspdf";
|
|
2
2
|
import { svg2pdf } from "svg2pdf.js";
|
|
3
3
|
import * as fabric from "fabric";
|
|
4
|
-
import { p as parseTextMarkdown, r as renderSmartElementToSvg, g as getCanvasForPage, c as captureFabricCanvasSvgForPdf, f as findNodeById, a as getAbsoluteBounds, b as getProxiedImageUrl, d as getImageProxyFetchOptions, A as API_URL, n as normalizeShapeType, i as isElement, e as isGroup, h as buildRoundedTrianglePath, j as hasEdgeFade, k as bakeEdgeFade, l as getRoundedRectRadii, T as TRIANGLE_STROKE_MITER_LIMIT, m as getTrianglePoints } from "./index-
|
|
4
|
+
import { p as parseTextMarkdown, r as renderSmartElementToSvg, g as getCanvasForPage, c as captureFabricCanvasSvgForPdf, f as findNodeById, a as getAbsoluteBounds, b as getProxiedImageUrl, d as getImageProxyFetchOptions, A as API_URL, n as normalizeShapeType, i as isElement, e as isGroup, h as buildRoundedTrianglePath, j as hasEdgeFade, k as bakeEdgeFade, l as getRoundedRectRadii, T as TRIANGLE_STROKE_MITER_LIMIT, m as getTrianglePoints } from "./index-CDdfs3IB.js";
|
|
5
5
|
import { resetPdfFontRegistry, FONT_FALLBACK_SYMBOLS, FONT_FALLBACK_MATH, FONT_FALLBACK_DEVANAGARI, embedFontWithGoogleFallback, getEmbeddedVariantsList, isFontAvailable, isFamilyEmbedded, resolveBestRegisteredVariant, getEmbeddedJsPDFFontName, resolveFontWeight, doesVariantSupportChar } from "./pdfFonts-DhEaMTZl.js";
|
|
6
6
|
async function embedFontsForSvg(pdf, svgStr) {
|
|
7
7
|
var _a;
|
|
@@ -2115,10 +2115,12 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
2115
2115
|
img.setAttribute("y", String(by));
|
|
2116
2116
|
img.setAttribute("width", String(bw));
|
|
2117
2117
|
img.setAttribute("height", String(bh));
|
|
2118
|
-
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION));
|
|
2119
2118
|
img.setAttribute("preserveAspectRatio", "none");
|
|
2120
2119
|
img.setAttributeNS(XLINK_NS, "xlink:href", dataUrl);
|
|
2121
2120
|
img.setAttribute("href", dataUrl);
|
|
2121
|
+
const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
|
|
2122
|
+
const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
|
|
2123
|
+
img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION * shadowAlpha));
|
|
2122
2124
|
(_e = marker.parentNode) == null ? void 0 : _e.replaceChild(img, marker);
|
|
2123
2125
|
} catch (error) {
|
|
2124
2126
|
console.warn("[Vector PDF] text shadow rasterization failed for one marker:", error);
|
|
@@ -2951,7 +2953,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2951
2953
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2952
2954
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2953
2955
|
try {
|
|
2954
|
-
const { getNormalizedSvgUrl } = await import("./index-
|
|
2956
|
+
const { getNormalizedSvgUrl } = await import("./index-CDdfs3IB.js").then((n) => n.a6);
|
|
2955
2957
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2956
2958
|
} catch {
|
|
2957
2959
|
return null;
|
|
@@ -3760,7 +3762,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3760
3762
|
}
|
|
3761
3763
|
let fetchUrl = imageUrl;
|
|
3762
3764
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3763
|
-
const { isPrivateUrl } = await import("./index-
|
|
3765
|
+
const { isPrivateUrl } = await import("./index-CDdfs3IB.js").then((n) => n.a6);
|
|
3764
3766
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3765
3767
|
const proxyUrl = new URL(`${API_URL}/image-proxy`);
|
|
3766
3768
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -5861,4 +5863,4 @@ export {
|
|
|
5861
5863
|
preparePagesForExport,
|
|
5862
5864
|
rewriteSvgFontsForJsPDFWithSourceMeta
|
|
5863
5865
|
};
|
|
5864
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5866
|
+
//# sourceMappingURL=vectorPdfExport-CjIUU8on.js.map
|