@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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-CNN2CRQh.cjs");
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.125";
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, m, o, q, P, s, t, u, v, w, x, y, z, B, C, D, E, G, H, I, J, b, K, L, M, N, O, Q, R, S, U, V, W, X, Y } from "./index-D7cGwzxX.js";
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
- m as FONT_FALLBACK_MATH,
5
- o as FONT_FALLBACK_SYMBOLS,
6
- q as FONT_FILES,
4
+ o as FONT_FALLBACK_MATH,
5
+ q as FONT_FALLBACK_SYMBOLS,
6
+ s as FONT_FILES,
7
7
  P as PACKAGE_VERSION,
8
- s as PixldocsPreview,
9
- t as PixldocsRenderer,
10
- u as applyThemeToConfig,
11
- v as assemblePdfFromSvgs,
12
- w as awaitFontsForConfig,
13
- x as collectFontDescriptorsFromConfig,
14
- y as collectFontsFromConfig,
15
- z as collectImageUrls,
16
- B as configHasAutoShrinkText,
17
- C as dumpSvgTextDiagnostics,
18
- D as embedFont,
19
- E as embedFontsForConfig,
20
- G as embedFontsInPdf,
21
- H as ensureFontsForResolvedConfig,
22
- I as extractFontFamiliesFromSvgs,
23
- J as getEmbeddedJsPDFFontName,
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
- K as isBundledAssetUrl,
26
- L as isFontAvailable,
27
- M as isPrivateUrl,
28
- N as loadGoogleFontCSS,
29
- O as normalizeFontFamily,
30
- Q as resolveFontWeight,
31
- R as resolveFromForm,
32
- S as resolveTemplateData,
33
- U as rewriteSvgFontsForJsPDF,
34
- V as setAutoShrinkDebug,
35
- W as setBundledAssetPrefixes,
36
- X as warmResolvedTemplateForPreview,
37
- Y as warmTemplateFromForm
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-CNN2CRQh.cjs");
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-CNN2CRQh.cjs")).then((n) => n.canvasImageLoader);
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-CNN2CRQh.cjs")).then((n) => n.canvasImageLoader);
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
- previousSvgViewportTransformation = liveCanvasForPage.svgViewportTransformation;
4582
- previousViewportTransform = liveCanvasForPage.viewportTransform ? [...liveCanvasForPage.viewportTransform] : void 0;
4583
- liveCanvasForPage.viewportTransform = [1, 0, 0, 1, 0, 0];
4584
- liveCanvasForPage.svgViewportTransformation = true;
4585
- const liveSvgString = liveCanvasForPage.toSVG();
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-DVISwrvS.cjs.map
4799
+ //# sourceMappingURL=vectorPdfExport-DSf_ziXM.cjs.map