@pixldocs/canvas-renderer 0.5.169 → 0.5.171

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-Bg1FRZ3d.cjs");
3
+ const index = require("./index-BgOzEKmN.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.d.ts CHANGED
@@ -481,6 +481,13 @@ export declare class PixldocsRenderer {
481
481
  */
482
482
  private renderPdfViaClientExport;
483
483
  private getExpectedImageCount;
484
+ /**
485
+ * Collects ids of nodes that the renderer expects to produce a renderable
486
+ * fabric image. Excludes SVG sources because those are loaded as Groups,
487
+ * not HTMLImageElement-backed Images, and would otherwise inflate the
488
+ * `expected` counter forever.
489
+ */
490
+ private getExpectedImageIds;
484
491
  private waitForCanvasImages;
485
492
  private waitForCanvasScene;
486
493
  private waitForRelevantFonts;
@@ -547,6 +554,19 @@ export declare interface RendererConfig {
547
554
  imageProxyUrl?: string;
548
555
  /** Optional: pixel ratio for high-DPI rendering (default: 2) */
549
556
  pixelRatio?: number;
557
+ /**
558
+ * Maximum time (ms) to wait for canvas image assets before bailing out.
559
+ * Default: 15000. Lower this (e.g. 3000) for thumbnail/preview use-cases.
560
+ */
561
+ assetWaitTimeoutMs?: number;
562
+ /**
563
+ * Once the scene is settled (fabric+dom+canvas ready) and no new asset
564
+ * progress has been seen for this many ms, resolve early even if the
565
+ * expected counter hasn't matched. Default: 1500.
566
+ */
567
+ assetWaitEarlyExitMs?: number;
568
+ /** Verbose asset-wait diagnostics. Default: false. */
569
+ debug?: boolean;
550
570
  }
551
571
 
552
572
  /** Options for renderFromForm — matches the server API payload */
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, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0 } from "./index-qJRuErt-.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, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0 } from "./index-Cq9sQGri.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-qJRuErt-.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-Cq9sQGri.js";
5
5
  import { resetPdfFontRegistry, FONT_FALLBACK_SYMBOLS, FONT_FALLBACK_MATH, FONT_FALLBACK_DEVANAGARI, embedFontWithGoogleFallback, getEmbeddedVariantsList, isFontAvailable, isFamilyEmbedded, resolveBestRegisteredVariant, getEmbeddedJsPDFFontName, resolveFontWeight, doesVariantSupportChar } from "./pdfFonts-b3_bv7F0.js";
6
6
  async function embedFontsForSvg(pdf, svgStr) {
7
7
  var _a;
@@ -2500,7 +2500,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2500
2500
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2501
2501
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2502
2502
  try {
2503
- const { getNormalizedSvgUrl } = await import("./index-qJRuErt-.js").then((n) => n.a1);
2503
+ const { getNormalizedSvgUrl } = await import("./index-Cq9sQGri.js").then((n) => n.a1);
2504
2504
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2505
2505
  } catch {
2506
2506
  return null;
@@ -3281,7 +3281,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3281
3281
  }
3282
3282
  let fetchUrl = imageUrl;
3283
3283
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3284
- const { isPrivateUrl } = await import("./index-qJRuErt-.js").then((n) => n.a1);
3284
+ const { isPrivateUrl } = await import("./index-Cq9sQGri.js").then((n) => n.a1);
3285
3285
  if (isPrivateUrl(imageUrl)) return null;
3286
3286
  const proxyUrl = new URL(`${API_URL}/image-proxy`);
3287
3287
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5265,4 +5265,4 @@ export {
5265
5265
  preparePagesForExport,
5266
5266
  rewriteSvgFontsForJsPDFWithSourceMeta
5267
5267
  };
5268
- //# sourceMappingURL=vectorPdfExport-C2jE125-.js.map
5268
+ //# sourceMappingURL=vectorPdfExport--EtCdnlG.js.map