@pixldocs/canvas-renderer 0.5.103 → 0.5.104

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.103";
259
+ export declare const PACKAGE_VERSION = "0.5.104";
260
260
 
261
261
  export declare interface PageSettings {
262
262
  backgroundColor?: string;
package/dist/index.js CHANGED
@@ -6250,7 +6250,6 @@ function bakeEdgeFade(source, fade) {
6250
6250
  let x = 0, y = 0, rectW = mask.width, rectH = mask.height;
6251
6251
  const STOPS = 64;
6252
6252
  const gamma = 1 / hardness;
6253
- const seamGuardPx = 2;
6254
6253
  const innerAlpha = (t) => {
6255
6254
  const keepProgress = Math.pow(t, gamma);
6256
6255
  const erase = (1 - amount) * (1 - keepProgress);
@@ -6288,16 +6287,6 @@ function bakeEdgeFade(source, fade) {
6288
6287
  }
6289
6288
  mctx.fillStyle = g;
6290
6289
  mctx.fillRect(x, y, rectW, rectH);
6291
- {
6292
- const edgePx = Math.min(seamGuardPx, side === "top" || side === "bottom" ? rectH : rectW);
6293
- mctx.fillStyle = "rgba(0,0,0,0)";
6294
- mctx.globalCompositeOperation = "copy";
6295
- if (side === "top") mctx.fillRect(0, 0, mask.width, edgePx);
6296
- if (side === "bottom") mctx.fillRect(0, mask.height - edgePx, mask.width, edgePx);
6297
- if (side === "left") mctx.fillRect(0, 0, edgePx, mask.height);
6298
- if (side === "right") mctx.fillRect(mask.width - edgePx, 0, edgePx, mask.height);
6299
- mctx.globalCompositeOperation = "source-over";
6300
- }
6301
6290
  ctx.globalCompositeOperation = "destination-in";
6302
6291
  ctx.drawImage(mask, 0, 0);
6303
6292
  ctx.globalCompositeOperation = "source-over";
@@ -9714,7 +9703,6 @@ const PageCanvas = forwardRef(
9714
9703
  const eraseAtEdge = 1 - amount;
9715
9704
  const STOPS = 64;
9716
9705
  const gamma = 1 / hardness;
9717
- const seamGuardPx = 2;
9718
9706
  const addStops = (g) => {
9719
9707
  for (let i = 0; i <= STOPS; i++) {
9720
9708
  const t = i / STOPS;
@@ -9729,32 +9717,24 @@ const PageCanvas = forwardRef(
9729
9717
  addStops(gradient);
9730
9718
  ctx.fillStyle = gradient;
9731
9719
  ctx.fillRect(x, y, w, band);
9732
- ctx.fillStyle = "rgba(0,0,0,1)";
9733
- ctx.fillRect(x, y, w, Math.min(seamGuardPx, band));
9734
9720
  } else if (side === "bottom") {
9735
9721
  const band = Math.max(1, h * size);
9736
9722
  gradient = ctx.createLinearGradient(0, y + h, 0, y + h - band);
9737
9723
  addStops(gradient);
9738
9724
  ctx.fillStyle = gradient;
9739
9725
  ctx.fillRect(x, y + h - band, w, band);
9740
- ctx.fillStyle = "rgba(0,0,0,1)";
9741
- ctx.fillRect(x, y + h - Math.min(seamGuardPx, band), w, Math.min(seamGuardPx, band));
9742
9726
  } else if (side === "left") {
9743
9727
  const band = Math.max(1, w * size);
9744
9728
  gradient = ctx.createLinearGradient(x, 0, x + band, 0);
9745
9729
  addStops(gradient);
9746
9730
  ctx.fillStyle = gradient;
9747
9731
  ctx.fillRect(x, y, band, h);
9748
- ctx.fillStyle = "rgba(0,0,0,1)";
9749
- ctx.fillRect(x, y, Math.min(seamGuardPx, band), h);
9750
9732
  } else {
9751
9733
  const band = Math.max(1, w * size);
9752
9734
  gradient = ctx.createLinearGradient(x + w, 0, x + w - band, 0);
9753
9735
  addStops(gradient);
9754
9736
  ctx.fillStyle = gradient;
9755
9737
  ctx.fillRect(x + w - band, y, band, h);
9756
- ctx.fillStyle = "rgba(0,0,0,1)";
9757
- ctx.fillRect(x + w - Math.min(seamGuardPx, band), y, Math.min(seamGuardPx, band), h);
9758
9738
  }
9759
9739
  ctx.restore();
9760
9740
  };
@@ -13424,7 +13404,7 @@ function PixldocsPreview(props) {
13424
13404
  !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..." }) })
13425
13405
  ] });
13426
13406
  }
13427
- const PACKAGE_VERSION = "0.5.103";
13407
+ const PACKAGE_VERSION = "0.5.104";
13428
13408
  const roundParityValue = (value) => {
13429
13409
  if (typeof value !== "number") return value;
13430
13410
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;