@pixldocs/canvas-renderer 0.5.193 → 0.5.195

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.
@@ -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-CDoyeKa8.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-BggTMIGH.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;
@@ -499,9 +499,12 @@ async function preloadSvgImagesForPdf(svg, options) {
499
499
  const present = new Set(images.map((image) => image.getAttribute("data-pixldocs-image-id") || "").filter(Boolean));
500
500
  const missing = [...required].filter((id) => !present.has(id));
501
501
  if (missing.length || failedRequired.length) {
502
- throw new Error(`[client-pdf-export] expected image(s) not ready for SVG PDF${(options == null ? void 0 : options.context) ? ` (${options.context})` : ""}: missing=${missing.join(",") || "none"} failed=${failedRequired.join(",") || "none"}`);
502
+ console.warn(
503
+ `[client-pdf-export] expected image(s) not ready for SVG PDF${(options == null ? void 0 : options.context) ? ` (${options.context})` : ""}: missing=${missing.join(",") || "none"} failed=${failedRequired.join(",") || "none"}`
504
+ );
505
+ } else {
506
+ console.log("[client-pdf-export] SVG image ids ready", { context: options == null ? void 0 : options.context, count: required.size, ids: [...required] });
503
507
  }
504
- console.log("[client-pdf-export] SVG image ids ready", { context: options == null ? void 0 : options.context, count: required.size, ids: [...required] });
505
508
  }
506
509
  }
507
510
  function resetPdfColorState(pdf, label) {
@@ -2549,7 +2552,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2549
2552
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2550
2553
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2551
2554
  try {
2552
- const { getNormalizedSvgUrl } = await import("./index-CDoyeKa8.js").then((n) => n.a6);
2555
+ const { getNormalizedSvgUrl } = await import("./index-BggTMIGH.js").then((n) => n.a6);
2553
2556
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2554
2557
  } catch {
2555
2558
  return null;
@@ -3340,7 +3343,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3340
3343
  }
3341
3344
  let fetchUrl = imageUrl;
3342
3345
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3343
- const { isPrivateUrl } = await import("./index-CDoyeKa8.js").then((n) => n.a6);
3346
+ const { isPrivateUrl } = await import("./index-BggTMIGH.js").then((n) => n.a6);
3344
3347
  if (isPrivateUrl(imageUrl)) return null;
3345
3348
  const proxyUrl = new URL(`${API_URL}/image-proxy`);
3346
3349
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5161,9 +5164,6 @@ async function exportMultiPagePdf(pages, options) {
5161
5164
  svgLength: (liveSvgString == null ? void 0 : liveSvgString.length) ?? 0
5162
5165
  });
5163
5166
  } catch (error) {
5164
- if (error instanceof Error && /expected image\(s\) not ready for SVG PDF/i.test(error.message)) {
5165
- throw error;
5166
- }
5167
5167
  allowLiveCanvasFallback = false;
5168
5168
  console.error(`[client-pdf-export] live SVG export failed for page ${pageIndex + 1}`, error);
5169
5169
  }
@@ -5352,4 +5352,4 @@ export {
5352
5352
  preparePagesForExport,
5353
5353
  rewriteSvgFontsForJsPDFWithSourceMeta
5354
5354
  };
5355
- //# sourceMappingURL=vectorPdfExport-Cd--tBky.js.map
5355
+ //# sourceMappingURL=vectorPdfExport-eV507wxX.js.map