@pixldocs/canvas-renderer 0.5.213 → 0.5.214

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-zkVpb-YL.cjs");
3
+ const index = require("./index-Cy2_ElDZ.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-XZf4TDQ-.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-CDdfs3IB.js";
2
2
  export {
3
3
  D as DEPLOYMENT_VERSION_MARKER,
4
4
  F as FONT_FALLBACK_DEVANAGARI,
@@ -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-zkVpb-YL.cjs");
6
+ const index = require("./index-Cy2_ElDZ.cjs");
7
7
  const pdfFonts = require("./pdfFonts-BTj2f465.cjs");
8
8
  function _interopNamespaceDefault(e) {
9
9
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2079,7 +2079,7 @@ async function convertSvgTextDecorationsToLinesString(svgStr) {
2079
2079
  }
2080
2080
  }
2081
2081
  async function rasterizeShadowMarkers(svg) {
2082
- var _a, _b, _c, _d, _e, _f, _g;
2082
+ var _a, _b, _c, _d, _e, _f;
2083
2083
  if (typeof window === "undefined" || typeof document === "undefined") return;
2084
2084
  const markers = Array.from(svg.querySelectorAll("g.__pdShadowRaster"));
2085
2085
  if (markers.length === 0) return;
@@ -2134,29 +2134,17 @@ async function rasterizeShadowMarkers(svg) {
2134
2134
  img.setAttribute("y", String(by));
2135
2135
  img.setAttribute("width", String(bw));
2136
2136
  img.setAttribute("height", String(bh));
2137
- img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION));
2138
2137
  img.setAttribute("preserveAspectRatio", "none");
2139
2138
  img.setAttributeNS(XLINK_NS, "xlink:href", dataUrl);
2140
2139
  img.setAttribute("href", dataUrl);
2141
- const passes = Math.max(1, Math.min(8, parseInt(marker.getAttribute("data-passes") || "1", 10) || 1));
2142
- const lastAlphaRaw = parseFloat(marker.getAttribute("data-last-alpha") || "1");
2143
- const lastAlpha = Number.isFinite(lastAlphaRaw) ? Math.max(0, Math.min(1, lastAlphaRaw)) : 1;
2144
- const baseOpacity = Number(img.getAttribute("opacity") || "1") || 1;
2140
+ const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
2141
+ const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
2142
+ img.setAttribute("opacity", String(SHADOW_RASTER_ALPHA_COMPENSATION * shadowAlpha));
2145
2143
  (_e = marker.parentNode) == null ? void 0 : _e.replaceChild(img, marker);
2146
- for (let i = 1; i < passes; i++) {
2147
- const extra = img.cloneNode(true);
2148
- if (i === passes - 1 && lastAlpha < 1) {
2149
- extra.setAttribute("opacity", String(baseOpacity * lastAlpha));
2150
- }
2151
- (_f = img.parentNode) == null ? void 0 : _f.insertBefore(extra, img.nextSibling);
2152
- }
2153
- if (passes === 1 && lastAlpha < 1) {
2154
- img.setAttribute("opacity", String(baseOpacity * lastAlpha));
2155
- }
2156
2144
  } catch (error) {
2157
2145
  console.warn("[Vector PDF] text shadow rasterization failed for one marker:", error);
2158
2146
  try {
2159
- (_g = marker.parentNode) == null ? void 0 : _g.removeChild(marker);
2147
+ (_f = marker.parentNode) == null ? void 0 : _f.removeChild(marker);
2160
2148
  } catch {
2161
2149
  }
2162
2150
  }
@@ -2984,7 +2972,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2984
2972
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2985
2973
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2986
2974
  try {
2987
- const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-zkVpb-YL.cjs")).then((n) => n.canvasImageLoader);
2975
+ const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-Cy2_ElDZ.cjs")).then((n) => n.canvasImageLoader);
2988
2976
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2989
2977
  } catch {
2990
2978
  return null;
@@ -3793,7 +3781,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3793
3781
  }
3794
3782
  let fetchUrl = imageUrl;
3795
3783
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3796
- const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-zkVpb-YL.cjs")).then((n) => n.canvasImageLoader);
3784
+ const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-Cy2_ElDZ.cjs")).then((n) => n.canvasImageLoader);
3797
3785
  if (isPrivateUrl(imageUrl)) return null;
3798
3786
  const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
3799
3787
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5892,4 +5880,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
5892
5880
  exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
5893
5881
  exports.preparePagesForExport = preparePagesForExport;
5894
5882
  exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
5895
- //# sourceMappingURL=vectorPdfExport-krI8SwbX.cjs.map
5883
+ //# sourceMappingURL=vectorPdfExport-BBG0QRse.cjs.map