@pixldocs/canvas-renderer 0.5.198 → 0.5.199

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-CM6Bzcyx.cjs");
3
+ const index = require("./index-CEUoSPy-.cjs");
4
4
  exports.DEPLOYMENT_VERSION_MARKER = index.DEPLOYMENT_VERSION_MARKER;
5
5
  exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
6
6
  exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, M, b, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5 } from "./index-Cgi6Y_WS.js";
1
+ import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, M, b, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5 } from "./index-CyCjpD2N.js";
2
2
  export {
3
3
  D as DEPLOYMENT_VERSION_MARKER,
4
4
  F as FONT_FALLBACK_DEVANAGARI,
@@ -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-Cgi6Y_WS.js";
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-CyCjpD2N.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;
@@ -100,7 +100,9 @@ async function bakeEdgeFadeIntoDataUrl(dataUrl, element) {
100
100
  return await new Promise((resolve) => {
101
101
  try {
102
102
  const img = new Image();
103
- img.crossOrigin = "anonymous";
103
+ if (!dataUrl.startsWith("data:") && !dataUrl.startsWith("blob:")) {
104
+ img.crossOrigin = "anonymous";
105
+ }
104
106
  img.onload = () => {
105
107
  try {
106
108
  const c = bakeEdgeFade(img, fade);
@@ -2552,7 +2554,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2552
2554
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2553
2555
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2554
2556
  try {
2555
- const { getNormalizedSvgUrl } = await import("./index-Cgi6Y_WS.js").then((n) => n.a6);
2557
+ const { getNormalizedSvgUrl } = await import("./index-CyCjpD2N.js").then((n) => n.a6);
2556
2558
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2557
2559
  } catch {
2558
2560
  return null;
@@ -3343,7 +3345,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3343
3345
  }
3344
3346
  let fetchUrl = imageUrl;
3345
3347
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3346
- const { isPrivateUrl } = await import("./index-Cgi6Y_WS.js").then((n) => n.a6);
3348
+ const { isPrivateUrl } = await import("./index-CyCjpD2N.js").then((n) => n.a6);
3347
3349
  if (isPrivateUrl(imageUrl)) return null;
3348
3350
  const proxyUrl = new URL(`${API_URL}/image-proxy`);
3349
3351
  proxyUrl.searchParams.set("url", imageUrl);
@@ -4961,7 +4963,7 @@ function getExpectedRasterImageIdsForPdfPage(page) {
4961
4963
  }
4962
4964
  async function exportMultiPagePdf(pages, options) {
4963
4965
  var _a, _b, _c, _d, _e;
4964
- const { filename = "document.pdf", title, watermark = false, returnBlob = false, pdfTextMode = "selectable", skipLiveCanvasSvgFastPath = false } = options;
4966
+ const { filename = "document.pdf", title, watermark = false, returnBlob = false, pdfTextMode = "selectable", skipLiveCanvasSvgFastPath = false, useLiveCanvasObjectPdfPath = false } = options;
4965
4967
  resetPdfFontRegistry();
4966
4968
  if (pages.length === 0) {
4967
4969
  throw new Error("No pages to export");
@@ -5105,9 +5107,9 @@ async function exportMultiPagePdf(pages, options) {
5105
5107
  }
5106
5108
  }
5107
5109
  const liveCanvasForPage = page.pageId ? getCanvasForPage(page.pageId) : null;
5108
- let allowLiveCanvasFallback = !!liveCanvasForPage && !skipLiveCanvasSvgFastPath;
5110
+ let allowLiveCanvasFallback = !!liveCanvasForPage && (useLiveCanvasObjectPdfPath || !skipLiveCanvasSvgFastPath);
5109
5111
  const expectedRasterImageIds = getExpectedRasterImageIdsForPdfPage(page);
5110
- if (liveCanvasForPage && !skipLiveCanvasSvgFastPath) {
5112
+ if (liveCanvasForPage && !skipLiveCanvasSvgFastPath && !useLiveCanvasObjectPdfPath) {
5111
5113
  try {
5112
5114
  const liveSvgString = captureFabricCanvasSvgForPdf(
5113
5115
  liveCanvasForPage,
@@ -5352,4 +5354,4 @@ export {
5352
5354
  preparePagesForExport,
5353
5355
  rewriteSvgFontsForJsPDFWithSourceMeta
5354
5356
  };
5355
- //# sourceMappingURL=vectorPdfExport-xj7xRXH7.js.map
5357
+ //# sourceMappingURL=vectorPdfExport-D57BlzeZ.js.map