@pixldocs/canvas-renderer 0.5.125 → 0.5.126
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-CNN2CRQh.cjs → index-8Dj3s-9A.cjs} +127 -83
- package/dist/index-8Dj3s-9A.cjs.map +1 -0
- package/dist/{index-D7cGwzxX.js → index-D-lngEWM.js} +166 -122
- package/dist/index-D-lngEWM.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -33
- package/dist/{vectorPdfExport-DVISwrvS.cjs → vectorPdfExport-DSf_ziXM.cjs} +9 -16
- package/dist/vectorPdfExport-DSf_ziXM.cjs.map +1 -0
- package/dist/{vectorPdfExport-BBV3abJi.js → vectorPdfExport-ix7Z1pGO.js} +9 -16
- package/dist/vectorPdfExport-ix7Z1pGO.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-CNN2CRQh.cjs.map +0 -1
- package/dist/index-D7cGwzxX.js.map +0 -1
- package/dist/vectorPdfExport-BBV3abJi.js.map +0 -1
- package/dist/vectorPdfExport-DVISwrvS.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, f as findNodeById, a as getAbsoluteBounds, p as parseTextMarkdown, r as renderSmartElementToSvg, n as normalizeShapeType, h as hasEdgeFade, b as getProxiedImageUrl,
|
|
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-D-lngEWM.js";
|
|
5
5
|
import { r as resetPdfFontRegistry, F as FONT_FALLBACK_SYMBOLS, a as FONT_FALLBACK_MATH, b as FONT_FALLBACK_DEVANAGARI, e as embedFontWithGoogleFallback, g as getEmbeddedVariantsList, i as isFontAvailable, c as isFamilyEmbedded, d as resolveBestRegisteredVariant, f as getEmbeddedJsPDFFontName, h as resolveFontWeight, j as doesVariantSupportChar } from "./pdfFonts-CZpNVjX9.js";
|
|
6
6
|
async function bakeEdgeFadeIntoDataUrl(dataUrl, element) {
|
|
7
7
|
const fade = element;
|
|
@@ -2022,7 +2022,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2022
2022
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2023
2023
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2024
2024
|
try {
|
|
2025
|
-
const { getNormalizedSvgUrl } = await import("./index-
|
|
2025
|
+
const { getNormalizedSvgUrl } = await import("./index-D-lngEWM.js").then((n) => n._);
|
|
2026
2026
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2027
2027
|
} catch {
|
|
2028
2028
|
return null;
|
|
@@ -2803,7 +2803,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
let fetchUrl = imageUrl;
|
|
2805
2805
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
2806
|
-
const { isPrivateUrl } = await import("./index-
|
|
2806
|
+
const { isPrivateUrl } = await import("./index-D-lngEWM.js").then((n) => n._);
|
|
2807
2807
|
if (isPrivateUrl(imageUrl)) return null;
|
|
2808
2808
|
const proxyUrl = new URL(`${API_URL}/image-proxy`);
|
|
2809
2809
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -4556,14 +4556,12 @@ async function exportMultiPagePdf(pages, options) {
|
|
|
4556
4556
|
const liveCanvasForPage = page.pageId ? getCanvasForPage(page.pageId) : null;
|
|
4557
4557
|
let allowLiveCanvasFallback = !!liveCanvasForPage;
|
|
4558
4558
|
if (liveCanvasForPage) {
|
|
4559
|
-
let previousSvgViewportTransformation;
|
|
4560
|
-
let previousViewportTransform;
|
|
4561
4559
|
try {
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4560
|
+
const liveSvgString = captureFabricCanvasSvgForPdf(
|
|
4561
|
+
liveCanvasForPage,
|
|
4562
|
+
page.width,
|
|
4563
|
+
page.height
|
|
4564
|
+
);
|
|
4567
4565
|
const liveSvgWidth = page.width;
|
|
4568
4566
|
const liveSvgHeight = page.height;
|
|
4569
4567
|
const liveSvg = await prepareLiveCanvasSvgForPdf(
|
|
@@ -4598,11 +4596,6 @@ async function exportMultiPagePdf(pages, options) {
|
|
|
4598
4596
|
} catch (error) {
|
|
4599
4597
|
allowLiveCanvasFallback = false;
|
|
4600
4598
|
console.error(`[client-pdf-export] live SVG export failed for page ${pageIndex + 1}`, error);
|
|
4601
|
-
} finally {
|
|
4602
|
-
liveCanvasForPage.svgViewportTransformation = previousSvgViewportTransformation;
|
|
4603
|
-
if (previousViewportTransform) {
|
|
4604
|
-
liveCanvasForPage.viewportTransform = previousViewportTransform;
|
|
4605
|
-
}
|
|
4606
4599
|
}
|
|
4607
4600
|
}
|
|
4608
4601
|
const matrixByElementId = /* @__PURE__ */ new Map();
|
|
@@ -4786,4 +4779,4 @@ export {
|
|
|
4786
4779
|
preparePagesForExport,
|
|
4787
4780
|
rewriteSvgFontsForJsPDFWithSourceMeta
|
|
4788
4781
|
};
|
|
4789
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
4782
|
+
//# sourceMappingURL=vectorPdfExport-ix7Z1pGO.js.map
|