@pixldocs/canvas-renderer 0.5.160 → 0.5.162

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-CtUEIsYl.cjs");
3
+ const index = require("./index-D96xE7-z.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, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _ } from "./index-CmhkyT2o.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, _ } from "./index-C6rEqM4R.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-CmhkyT2o.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-C6rEqM4R.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;
@@ -1247,9 +1247,19 @@ async function bakeTextAnchorPositionsFromLiveSvg(svg) {
1247
1247
  return NaN;
1248
1248
  };
1249
1249
  const bakeNode = (srcNode, liveNode, anchorOverride, refXOverride) => {
1250
- if (srcNode.getAttribute("data-pd-line-anchor") === "1") return;
1251
1250
  const anchor = (anchorOverride || _resolveAnchor(srcNode)).trim().toLowerCase();
1252
1251
  if (anchor !== "middle" && anchor !== "end") return;
1252
+ const stampedWidth = parseFloat(srcNode.getAttribute("data-pd-line-width") || "");
1253
+ const stampedStart = parseFloat(srcNode.getAttribute("data-pd-line-start") || "");
1254
+ if (Number.isFinite(stampedWidth) && stampedWidth > 0 && Number.isFinite(stampedStart)) {
1255
+ srcNode.setAttribute("x", String(stampedStart));
1256
+ srcNode.setAttribute("text-anchor", "start");
1257
+ srcNode.setAttribute("textLength", String(stampedWidth));
1258
+ srcNode.setAttribute("lengthAdjust", "spacing");
1259
+ stripTextAnchorStyle(srcNode);
1260
+ baked++;
1261
+ return;
1262
+ }
1253
1263
  try {
1254
1264
  const content = srcNode.textContent || "";
1255
1265
  if (content.length > 0) {
@@ -2459,7 +2469,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2459
2469
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2460
2470
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2461
2471
  try {
2462
- const { getNormalizedSvgUrl } = await import("./index-CmhkyT2o.js").then((n) => n.$);
2472
+ const { getNormalizedSvgUrl } = await import("./index-C6rEqM4R.js").then((n) => n.$);
2463
2473
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2464
2474
  } catch {
2465
2475
  return null;
@@ -3240,7 +3250,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3240
3250
  }
3241
3251
  let fetchUrl = imageUrl;
3242
3252
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3243
- const { isPrivateUrl } = await import("./index-CmhkyT2o.js").then((n) => n.$);
3253
+ const { isPrivateUrl } = await import("./index-C6rEqM4R.js").then((n) => n.$);
3244
3254
  if (isPrivateUrl(imageUrl)) return null;
3245
3255
  const proxyUrl = new URL(`${API_URL}/image-proxy`);
3246
3256
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5224,4 +5234,4 @@ export {
5224
5234
  preparePagesForExport,
5225
5235
  rewriteSvgFontsForJsPDFWithSourceMeta
5226
5236
  };
5227
- //# sourceMappingURL=vectorPdfExport-2NNilLNC.js.map
5237
+ //# sourceMappingURL=vectorPdfExport-C5vnOg8Q.js.map