@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
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-8Dj3s-9A.cjs");
|
|
4
4
|
exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
|
|
5
5
|
exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
|
|
6
6
|
exports.FONT_FALLBACK_SYMBOLS = index.FONT_FALLBACK_SYMBOLS;
|
package/dist/index.d.ts
CHANGED
|
@@ -259,7 +259,7 @@ export declare function normalizeFontFamily(fontStack: string): string;
|
|
|
259
259
|
* Package version banner. Bump alongside package.json so we can confirm
|
|
260
260
|
* (via browser:log) that the deployed bundle matches the expected build.
|
|
261
261
|
*/
|
|
262
|
-
export declare const PACKAGE_VERSION = "0.5.
|
|
262
|
+
export declare const PACKAGE_VERSION = "0.5.126";
|
|
263
263
|
|
|
264
264
|
export declare interface PageSettings {
|
|
265
265
|
backgroundColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { F,
|
|
1
|
+
import { F, o, q, s, P, t, u, v, w, x, y, z, B, C, D, E, G, H, I, J, K, b, L, M, N, O, Q, R, S, U, V, W, X, Y, Z } from "./index-D-lngEWM.js";
|
|
2
2
|
export {
|
|
3
3
|
F as FONT_FALLBACK_DEVANAGARI,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
o as FONT_FALLBACK_MATH,
|
|
5
|
+
q as FONT_FALLBACK_SYMBOLS,
|
|
6
|
+
s as FONT_FILES,
|
|
7
7
|
P as PACKAGE_VERSION,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
t as PixldocsPreview,
|
|
9
|
+
u as PixldocsRenderer,
|
|
10
|
+
v as applyThemeToConfig,
|
|
11
|
+
w as assemblePdfFromSvgs,
|
|
12
|
+
x as awaitFontsForConfig,
|
|
13
|
+
y as collectFontDescriptorsFromConfig,
|
|
14
|
+
z as collectFontsFromConfig,
|
|
15
|
+
B as collectImageUrls,
|
|
16
|
+
C as configHasAutoShrinkText,
|
|
17
|
+
D as dumpSvgTextDiagnostics,
|
|
18
|
+
E as embedFont,
|
|
19
|
+
G as embedFontsForConfig,
|
|
20
|
+
H as embedFontsInPdf,
|
|
21
|
+
I as ensureFontsForResolvedConfig,
|
|
22
|
+
J as extractFontFamiliesFromSvgs,
|
|
23
|
+
K as getEmbeddedJsPDFFontName,
|
|
24
24
|
b as getProxiedImageUrl,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
L as isBundledAssetUrl,
|
|
26
|
+
M as isFontAvailable,
|
|
27
|
+
N as isPrivateUrl,
|
|
28
|
+
O as loadGoogleFontCSS,
|
|
29
|
+
Q as normalizeFontFamily,
|
|
30
|
+
R as resolveFontWeight,
|
|
31
|
+
S as resolveFromForm,
|
|
32
|
+
U as resolveTemplateData,
|
|
33
|
+
V as rewriteSvgFontsForJsPDF,
|
|
34
|
+
W as setAutoShrinkDebug,
|
|
35
|
+
X as setBundledAssetPrefixes,
|
|
36
|
+
Y as warmResolvedTemplateForPreview,
|
|
37
|
+
Z as warmTemplateFromForm
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -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-8Dj3s-9A.cjs");
|
|
7
7
|
const pdfFonts = require("./pdfFonts-BPQ8WSXF.cjs");
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -2041,7 +2041,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2041
2041
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2042
2042
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2043
2043
|
try {
|
|
2044
|
-
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-
|
|
2044
|
+
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-8Dj3s-9A.cjs")).then((n) => n.canvasImageLoader);
|
|
2045
2045
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2046
2046
|
} catch {
|
|
2047
2047
|
return null;
|
|
@@ -2822,7 +2822,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
2822
2822
|
}
|
|
2823
2823
|
let fetchUrl = imageUrl;
|
|
2824
2824
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
2825
|
-
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-
|
|
2825
|
+
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-8Dj3s-9A.cjs")).then((n) => n.canvasImageLoader);
|
|
2826
2826
|
if (isPrivateUrl(imageUrl)) return null;
|
|
2827
2827
|
const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
|
|
2828
2828
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -4575,14 +4575,12 @@ async function exportMultiPagePdf(pages, options) {
|
|
|
4575
4575
|
const liveCanvasForPage = page.pageId ? index.getCanvasForPage(page.pageId) : null;
|
|
4576
4576
|
let allowLiveCanvasFallback = !!liveCanvasForPage;
|
|
4577
4577
|
if (liveCanvasForPage) {
|
|
4578
|
-
let previousSvgViewportTransformation;
|
|
4579
|
-
let previousViewportTransform;
|
|
4580
4578
|
try {
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4579
|
+
const liveSvgString = index.captureFabricCanvasSvgForPdf(
|
|
4580
|
+
liveCanvasForPage,
|
|
4581
|
+
page.width,
|
|
4582
|
+
page.height
|
|
4583
|
+
);
|
|
4586
4584
|
const liveSvgWidth = page.width;
|
|
4587
4585
|
const liveSvgHeight = page.height;
|
|
4588
4586
|
const liveSvg = await prepareLiveCanvasSvgForPdf(
|
|
@@ -4617,11 +4615,6 @@ async function exportMultiPagePdf(pages, options) {
|
|
|
4617
4615
|
} catch (error) {
|
|
4618
4616
|
allowLiveCanvasFallback = false;
|
|
4619
4617
|
console.error(`[client-pdf-export] live SVG export failed for page ${pageIndex + 1}`, error);
|
|
4620
|
-
} finally {
|
|
4621
|
-
liveCanvasForPage.svgViewportTransformation = previousSvgViewportTransformation;
|
|
4622
|
-
if (previousViewportTransform) {
|
|
4623
|
-
liveCanvasForPage.viewportTransform = previousViewportTransform;
|
|
4624
|
-
}
|
|
4625
4618
|
}
|
|
4626
4619
|
}
|
|
4627
4620
|
const matrixByElementId = /* @__PURE__ */ new Map();
|
|
@@ -4803,4 +4796,4 @@ exports.exportFabricCanvasToVectorPdf = exportFabricCanvasToVectorPdf;
|
|
|
4803
4796
|
exports.exportMultiPagePdf = exportMultiPagePdf;
|
|
4804
4797
|
exports.preparePagesForExport = preparePagesForExport;
|
|
4805
4798
|
exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
|
|
4806
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
4799
|
+
//# sourceMappingURL=vectorPdfExport-DSf_ziXM.cjs.map
|