@pixldocs/canvas-renderer 0.5.153 → 0.5.154
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-Bp0cz5Mq.cjs → index-Cl1_1tTg.cjs} +5 -5
- package/dist/{index-Bp0cz5Mq.cjs.map → index-Cl1_1tTg.cjs.map} +1 -1
- package/dist/{index-CAH9akzI.js → index-CoH2Xntr.js} +5 -5
- package/dist/{index-CAH9akzI.js.map → index-CoH2Xntr.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-YSo453Ul.cjs → vectorPdfExport-BHADcvGH.cjs} +6 -23
- package/dist/vectorPdfExport-BHADcvGH.cjs.map +1 -0
- package/dist/{vectorPdfExport-DTssH1-U.js → vectorPdfExport-Db9b2C3K.js} +6 -23
- package/dist/vectorPdfExport-Db9b2C3K.js.map +1 -0
- package/package.json +1 -1
- package/dist/vectorPdfExport-DTssH1-U.js.map +0 -1
- package/dist/vectorPdfExport-YSo453Ul.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 { g as getCanvasForPage, c as captureFabricCanvasSvgForPdf, f as findNodeById, a as getAbsoluteBounds, p as parseTextMarkdown, r as renderSmartElementToSvg, n as normalizeShapeType, h as hasEdgeFade, b as getProxiedImageUrl, d as bakeEdgeFade, i as isElement, e as isGroup, j as buildRoundedTrianglePath, A as API_URL, k as getImageProxyFetchOptions, l as getRoundedRectRadii, T as TRIANGLE_STROKE_MITER_LIMIT, m as getTrianglePoints } from "./index-
|
|
4
|
+
import { g as getCanvasForPage, c as captureFabricCanvasSvgForPdf, f as findNodeById, a as getAbsoluteBounds, p as parseTextMarkdown, r as renderSmartElementToSvg, n as normalizeShapeType, h as hasEdgeFade, b as getProxiedImageUrl, d as bakeEdgeFade, i as isElement, e as isGroup, j as buildRoundedTrianglePath, A as API_URL, k as getImageProxyFetchOptions, l as getRoundedRectRadii, T as TRIANGLE_STROKE_MITER_LIMIT, m as getTrianglePoints } from "./index-CoH2Xntr.js";
|
|
5
5
|
import { resetPdfFontRegistry, FONT_FALLBACK_SYMBOLS, FONT_FALLBACK_MATH, FONT_FALLBACK_DEVANAGARI, embedFontWithGoogleFallback, getEmbeddedVariantsList, isFontAvailable, isFamilyEmbedded, resolveBestRegisteredVariant, getEmbeddedJsPDFFontName, resolveFontWeight, doesVariantSupportChar } from "./pdfFonts-b3_bv7F0.js";
|
|
6
6
|
async function embedFontsForSvg(pdf, svgStr) {
|
|
7
7
|
var _a;
|
|
@@ -1836,7 +1836,7 @@ async function collectInlinedFontFaceCss() {
|
|
|
1836
1836
|
return cachedInlinedFontFaceCss;
|
|
1837
1837
|
}
|
|
1838
1838
|
async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey, options) {
|
|
1839
|
-
var _a
|
|
1839
|
+
var _a;
|
|
1840
1840
|
try {
|
|
1841
1841
|
const parser = new DOMParser();
|
|
1842
1842
|
const processedSvg = inlineNestedSvgImageDataUris(rawSvg, parser);
|
|
@@ -1874,27 +1874,10 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
1874
1874
|
console.warn("[Vector PDF] anchor-bake pass failed (continuing):", e);
|
|
1875
1875
|
}
|
|
1876
1876
|
await rasterizeShadowMarkers(svgToDraw);
|
|
1877
|
-
try {
|
|
1878
|
-
if (svgToDraw.querySelector("g[data-pd-shadow-blur] text, g[data-pd-text-bg] text")) {
|
|
1879
|
-
const { convertAllTextToPath } = await import("./svgTextToPath-BXAzwaaR.js");
|
|
1880
|
-
const outlined = await convertAllTextToPath(
|
|
1881
|
-
new XMLSerializer().serializeToString(svgToDraw),
|
|
1882
|
-
void 0,
|
|
1883
|
-
{ mode: "shadow-bound" }
|
|
1884
|
-
);
|
|
1885
|
-
const outlinedDoc = parser.parseFromString(outlined, "image/svg+xml");
|
|
1886
|
-
if (!outlinedDoc.querySelector("parsererror") && ((_a = outlinedDoc.documentElement) == null ? void 0 : _a.tagName.toLowerCase()) === "svg") {
|
|
1887
|
-
svgToDraw = outlinedDoc.documentElement;
|
|
1888
|
-
console.log("[Vector PDF][parity] decorated text outlined for headless alignment");
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1891
|
-
} catch (outlineErr) {
|
|
1892
|
-
console.warn("[Vector PDF] shadow-bound text outline failed (continuing):", outlineErr);
|
|
1893
|
-
}
|
|
1894
1877
|
await convertTextDecorationsToLines(svgToDraw);
|
|
1895
1878
|
const rewritten = rewriteSvgFontsForJsPDFWithSourceMeta(new XMLSerializer().serializeToString(svgToDraw));
|
|
1896
1879
|
const rewrittenDoc = parser.parseFromString(rewritten, "image/svg+xml");
|
|
1897
|
-
if (!rewrittenDoc.querySelector("parsererror") && ((
|
|
1880
|
+
if (!rewrittenDoc.querySelector("parsererror") && ((_a = rewrittenDoc.documentElement) == null ? void 0 : _a.tagName.toLowerCase()) === "svg") {
|
|
1898
1881
|
return rewrittenDoc.documentElement;
|
|
1899
1882
|
}
|
|
1900
1883
|
return svgToDraw;
|
|
@@ -2476,7 +2459,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2476
2459
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2477
2460
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2478
2461
|
try {
|
|
2479
|
-
const { getNormalizedSvgUrl } = await import("./index-
|
|
2462
|
+
const { getNormalizedSvgUrl } = await import("./index-CoH2Xntr.js").then((n) => n.$);
|
|
2480
2463
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2481
2464
|
} catch {
|
|
2482
2465
|
return null;
|
|
@@ -3257,7 +3240,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3257
3240
|
}
|
|
3258
3241
|
let fetchUrl = imageUrl;
|
|
3259
3242
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3260
|
-
const { isPrivateUrl } = await import("./index-
|
|
3243
|
+
const { isPrivateUrl } = await import("./index-CoH2Xntr.js").then((n) => n.$);
|
|
3261
3244
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3262
3245
|
const proxyUrl = new URL(`${API_URL}/image-proxy`);
|
|
3263
3246
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -5241,4 +5224,4 @@ export {
|
|
|
5241
5224
|
preparePagesForExport,
|
|
5242
5225
|
rewriteSvgFontsForJsPDFWithSourceMeta
|
|
5243
5226
|
};
|
|
5244
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5227
|
+
//# sourceMappingURL=vectorPdfExport-Db9b2C3K.js.map
|