@pixldocs/canvas-renderer 0.5.80 → 0.5.81

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.d.ts CHANGED
@@ -256,7 +256,7 @@ export declare function normalizeFontFamily(fontStack: string): string;
256
256
  * Package version banner. Bump alongside package.json so we can confirm
257
257
  * (via browser:log) that the deployed bundle matches the expected build.
258
258
  */
259
- export declare const PACKAGE_VERSION = "0.5.80";
259
+ export declare const PACKAGE_VERSION = "0.5.81";
260
260
 
261
261
  export declare interface PageSettings {
262
262
  backgroundColor?: string;
package/dist/index.js CHANGED
@@ -12590,7 +12590,7 @@ function PixldocsPreview(props) {
12590
12590
  !canvasSettled && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
12591
12591
  ] });
12592
12592
  }
12593
- const PACKAGE_VERSION = "0.5.80";
12593
+ const PACKAGE_VERSION = "0.5.81";
12594
12594
  const roundParityValue = (value) => {
12595
12595
  if (typeof value !== "number") return value;
12596
12596
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -15435,7 +15435,9 @@ async function convertTextDecorationsToLines(svg) {
15435
15435
  const fontFamily = tspan.getAttribute("data-source-font-family") || textEl.getAttribute("data-source-font-family") || resolveInheritedSvgValue(tspan, "font-family") || "sans-serif";
15436
15436
  const fontWeight = tspan.getAttribute("data-source-font-weight") || textEl.getAttribute("data-source-font-weight") || resolveInheritedSvgValue(tspan, "font-weight") || "normal";
15437
15437
  const fontStyle = tspan.getAttribute("data-source-font-style") || textEl.getAttribute("data-source-font-style") || resolveInheritedSvgValue(tspan, "font-style") || "normal";
15438
- const fill = tspan.getAttribute("fill") || textEl.getAttribute("fill") || "#000000";
15438
+ const resolvedFill = tspan.getAttribute("fill") || getInlineStyleValue(tspan, "fill") || resolveInheritedSvgValue(tspan, "fill") || textEl.getAttribute("fill") || getInlineStyleValue(textEl, "fill") || "#000000";
15439
+ const fill = resolvedFill;
15440
+ const fillOpacity = tspan.getAttribute("fill-opacity") || getInlineStyleValue(tspan, "fill-opacity") || resolveInheritedSvgValue(tspan, "fill-opacity") || textEl.getAttribute("fill-opacity") || getInlineStyleValue(textEl, "fill-opacity") || null;
15439
15441
  let textWidth = content.length * fontSize * 0.6;
15440
15442
  if (ctx) {
15441
15443
  ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily.replace(/'/g, "")}`;
@@ -15486,6 +15488,7 @@ async function convertTextDecorationsToLines(svg) {
15486
15488
  line.setAttribute("stroke-width", String(thickness));
15487
15489
  line.setAttribute("stroke-linecap", "butt");
15488
15490
  line.setAttribute("fill", "none");
15491
+ if (fillOpacity) line.setAttribute("stroke-opacity", fillOpacity);
15489
15492
  if (textEl.parentElement) {
15490
15493
  textEl.parentElement.insertBefore(line, textEl.nextSibling);
15491
15494
  }