@pixldocs/canvas-renderer 0.5.156 → 0.5.157

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-DJQnrBbh.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-xn-L7QHB.js";
5
5
  import { r as resetPdfFontRegistry, F as FONT_FALLBACK_SYMBOLS, a as FONT_FALLBACK_MATH, b as FONT_FALLBACK_DEVANAGARI, e as embedFontWithGoogleFallback, g as getEmbeddedVariantsList, i as isFontAvailable, c as isFamilyEmbedded, d as resolveBestRegisteredVariant, f as getEmbeddedJsPDFFontName, h as convertAllTextToPath, j as resolveFontWeight, k as doesVariantSupportChar } from "./svgTextToPath-V1vC0SQt.js";
6
6
  async function embedFontsForSvg(pdf, svgStr) {
7
7
  var _a;
@@ -1319,6 +1319,7 @@ function appendInvisibleSelectableTextLayer(svg) {
1319
1319
  layer.setAttribute("data-pd-selectable-layer", "1");
1320
1320
  layer.setAttribute("fill", "none");
1321
1321
  layer.setAttribute("stroke", "none");
1322
+ layer.setAttribute("style", "fill: none; stroke: none;");
1322
1323
  let cloned = 0;
1323
1324
  for (const text of texts) {
1324
1325
  if ((_a = text.closest) == null ? void 0 : _a.call(text, '[data-pd-selectable-layer="1"]')) continue;
@@ -1326,9 +1327,18 @@ function appendInvisibleSelectableTextLayer(svg) {
1326
1327
  const clone = text.cloneNode(true);
1327
1328
  clone.setAttribute("fill", "none");
1328
1329
  clone.setAttribute("stroke", "none");
1330
+ clone.setAttribute("style", "fill: none; stroke: none;");
1329
1331
  clone.removeAttribute("opacity");
1330
1332
  clone.removeAttribute("fill-opacity");
1331
1333
  clone.removeAttribute("stroke-opacity");
1334
+ for (const child of Array.from(clone.querySelectorAll("*"))) {
1335
+ child.setAttribute("fill", "none");
1336
+ child.setAttribute("stroke", "none");
1337
+ child.setAttribute("style", "fill: none; stroke: none;");
1338
+ child.removeAttribute("opacity");
1339
+ child.removeAttribute("fill-opacity");
1340
+ child.removeAttribute("stroke-opacity");
1341
+ }
1332
1342
  layer.appendChild(clone);
1333
1343
  cloned++;
1334
1344
  }
@@ -1905,7 +1915,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
1905
1915
  appendInvisibleSelectableTextLayer(svgToDraw);
1906
1916
  await rasterizeShadowMarkers(svgToDraw);
1907
1917
  await convertTextDecorationsToLines(svgToDraw);
1908
- const outlined = await convertAllTextToPath(new XMLSerializer().serializeToString(svgToDraw), void 0, { mode: "shadow-bound" });
1918
+ const outlined = await convertAllTextToPath(new XMLSerializer().serializeToString(svgToDraw), void 0, { mode: "all" });
1909
1919
  const outlinedDoc = parser.parseFromString(outlined, "image/svg+xml");
1910
1920
  if (!outlinedDoc.querySelector("parsererror") && ((_a = outlinedDoc.documentElement) == null ? void 0 : _a.tagName.toLowerCase()) === "svg") {
1911
1921
  svgToDraw = outlinedDoc.documentElement;
@@ -2494,7 +2504,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2494
2504
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2495
2505
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2496
2506
  try {
2497
- const { getNormalizedSvgUrl } = await import("./index-DJQnrBbh.js").then((n) => n.$);
2507
+ const { getNormalizedSvgUrl } = await import("./index-xn-L7QHB.js").then((n) => n.$);
2498
2508
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2499
2509
  } catch {
2500
2510
  return null;
@@ -3275,7 +3285,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3275
3285
  }
3276
3286
  let fetchUrl = imageUrl;
3277
3287
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3278
- const { isPrivateUrl } = await import("./index-DJQnrBbh.js").then((n) => n.$);
3288
+ const { isPrivateUrl } = await import("./index-xn-L7QHB.js").then((n) => n.$);
3279
3289
  if (isPrivateUrl(imageUrl)) return null;
3280
3290
  const proxyUrl = new URL(`${API_URL}/image-proxy`);
3281
3291
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5260,4 +5270,4 @@ export {
5260
5270
  preparePagesForExport,
5261
5271
  rewriteSvgFontsForJsPDFWithSourceMeta
5262
5272
  };
5263
- //# sourceMappingURL=vectorPdfExport-DSTA9YWG.js.map
5273
+ //# sourceMappingURL=vectorPdfExport-CZyyQbwm.js.map