@pixldocs/canvas-renderer 0.5.178 → 0.5.179

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.
@@ -16360,9 +16360,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
16360
16360
  }
16361
16361
  return svgString;
16362
16362
  }
16363
- const resolvedPackageVersion = "0.5.178";
16363
+ const resolvedPackageVersion = "0.5.179";
16364
16364
  const PACKAGE_VERSION = resolvedPackageVersion;
16365
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.178";
16365
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.179";
16366
16366
  const roundParityValue = (value) => {
16367
16367
  if (typeof value !== "number") return value;
16368
16368
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -16864,7 +16864,7 @@ class PixldocsRenderer {
16864
16864
  await this.waitForCanvasScene(container, cloned, i);
16865
16865
  }
16866
16866
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
16867
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Qffqnh7w.cjs"));
16867
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Be8MJ_2c.cjs"));
16868
16868
  const prepared = preparePagesForExport(
16869
16869
  cloned.pages,
16870
16870
  canvasWidth,
@@ -18065,7 +18065,7 @@ function normalizeSvgExplicitColors(svg) {
18065
18065
  function bakeGroupOpacityIntoChildren(svg) {
18066
18066
  const DRAWABLE = /* @__PURE__ */ new Set(["path", "rect", "circle", "ellipse", "polygon", "polyline", "line", "text", "tspan"]);
18067
18067
  function walkAndBake(el, inheritedOpacity) {
18068
- var _a, _b, _c;
18068
+ var _a, _b, _c, _d;
18069
18069
  if (isInSvgDefinitionSubtree(el)) {
18070
18070
  for (let i = 0; i < el.children.length; i++) walkAndBake(el.children[i], 1);
18071
18071
  return;
@@ -18075,7 +18075,7 @@ function bakeGroupOpacityIntoChildren(svg) {
18075
18075
  const styleOpacity = parseSvgOpacity(((_b = el.style) == null ? void 0 : _b.getPropertyValue("opacity")) || null);
18076
18076
  const ownOpacity = opacityAttr ?? styleOpacity ?? 1;
18077
18077
  const combinedOpacity = inheritedOpacity * ownOpacity;
18078
- if (ownOpacity < 0.999) {
18078
+ if (ownOpacity < 0.999 && tag !== "image") {
18079
18079
  el.removeAttribute("opacity");
18080
18080
  if ((_c = el.style) == null ? void 0 : _c.opacity) el.style.removeProperty("opacity");
18081
18081
  }
@@ -18083,6 +18083,10 @@ function bakeGroupOpacityIntoChildren(svg) {
18083
18083
  multiplySvgOpacityAttr(el, "fill-opacity", combinedOpacity);
18084
18084
  multiplySvgOpacityAttr(el, "stroke-opacity", combinedOpacity);
18085
18085
  }
18086
+ if (tag === "image" && combinedOpacity < 0.999) {
18087
+ el.setAttribute("opacity", String(Number(combinedOpacity.toFixed(4))));
18088
+ if ((_d = el.style) == null ? void 0 : _d.opacity) el.style.removeProperty("opacity");
18089
+ }
18086
18090
  if (tag === "stop" && ownOpacity < 0.999) {
18087
18091
  multiplySvgOpacityAttr(el, "stop-opacity", ownOpacity);
18088
18092
  }
@@ -19005,7 +19009,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
19005
19009
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
19006
19010
  sanitizeSvgTreeForPdf(svgToDraw);
19007
19011
  try {
19008
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Qffqnh7w.cjs"));
19012
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Be8MJ_2c.cjs"));
19009
19013
  try {
19010
19014
  await logTextMeasurementDiagnostic(svgToDraw);
19011
19015
  } catch {
@@ -19398,4 +19402,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
19398
19402
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
19399
19403
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
19400
19404
  exports.warmTemplateFromForm = warmTemplateFromForm;
19401
- //# sourceMappingURL=index-DTcFAvP2.cjs.map
19405
+ //# sourceMappingURL=index-BBOaToIA.cjs.map