@pixldocs/canvas-renderer 0.5.217 → 0.5.218

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.
@@ -6901,13 +6901,7 @@ function readShadowStrength(element) {
6901
6901
  return typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.min(100, raw)) : 100;
6902
6902
  }
6903
6903
  function resolveShadowSourceSpread(element) {
6904
- const strength = readShadowStrength(element);
6905
- const blur = Math.max(0, Number(element.textShadowBlur ?? 0) || 0);
6906
- const fontSize = Math.max(1, Number(element.fontSize ?? 16) || 16);
6907
- if (blur <= 2) return 0;
6908
- const blurRamp = Math.min(1, (blur - 2) / 4);
6909
- const t = Math.max(0, (strength - 35) / 65);
6910
- return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t * blurRamp;
6904
+ return 0;
6911
6905
  }
6912
6906
  function resolveShadowAlpha(element) {
6913
6907
  const s = readShadowStrength(element);
@@ -6930,7 +6924,7 @@ function applyTextShadow(textbox, element) {
6930
6924
  }
6931
6925
  obj.__pdShadowAlpha = canonicalShadow ? resolveShadowAlpha(element) : 1;
6932
6926
  obj.__pdShadowBaseColor = canonicalShadow ? String(element.textShadowColor || "") : void 0;
6933
- obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread(element) : 0;
6927
+ obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread() : 0;
6934
6928
  textbox.set("shadow", canonicalShadow ?? null);
6935
6929
  }
6936
6930
  function applyAlphaMultiplier(c, mult) {
@@ -7214,8 +7208,6 @@ function applyTextBackground(obj, cfg) {
7214
7208
  }
7215
7209
  }
7216
7210
  const suppressShadowOnText = bg && bg.shadowAffectsText === false;
7217
- const dropShadowSpread = Math.max(0, Number(this.__pdShadowSourceSpread) || 0);
7218
- const dropShadowActive = dropShadowSpread > 0 && !!this.shadow && !suppressShadowOnText && !blockShadowActive && !lineShadowActive;
7219
7211
  if (suppressShadowOnText) {
7220
7212
  ctx.save();
7221
7213
  ctx.shadowColor = "transparent";
@@ -7224,44 +7216,6 @@ function applyTextBackground(obj, cfg) {
7224
7216
  ctx.shadowOffsetY = 0;
7225
7217
  originalRender(ctx);
7226
7218
  ctx.restore();
7227
- } else if (dropShadowActive) {
7228
- const self = this;
7229
- const shadow = self.shadow;
7230
- const shadowColor = String((shadow == null ? void 0 : shadow.color) || this.__pdShadowBaseColor || "rgba(0,0,0,1)");
7231
- const shadowBlur = Math.max(0, Number((shadow == null ? void 0 : shadow.blur) ?? 0) || 0);
7232
- const shadowOffsetX = Number((shadow == null ? void 0 : shadow.offsetX) ?? 0) || 0;
7233
- const shadowOffsetY = Number((shadow == null ? void 0 : shadow.offsetY) ?? 0) || 0;
7234
- const origFill = self.fill;
7235
- const origStroke = self.stroke;
7236
- const origStrokeWidth = self.strokeWidth;
7237
- const origStyles = self.styles;
7238
- const origShadow = self.shadow;
7239
- try {
7240
- ctx.save();
7241
- self.shadow = null;
7242
- self.fill = shadowColor;
7243
- self.styles = {};
7244
- self.stroke = shadowColor;
7245
- self.strokeWidth = dropShadowSpread;
7246
- ctx.translate(shadowOffsetX, shadowOffsetY);
7247
- if (shadowBlur > 0) ctx.filter = `blur(${shadowBlur / 2}px)`;
7248
- ctx.lineJoin = "round";
7249
- ctx.lineCap = "round";
7250
- originalRender(ctx);
7251
- ctx.restore();
7252
- self.fill = origFill;
7253
- self.stroke = origStroke;
7254
- self.strokeWidth = origStrokeWidth;
7255
- self.styles = origStyles;
7256
- self.shadow = null;
7257
- originalRender(ctx);
7258
- } finally {
7259
- self.fill = origFill;
7260
- self.stroke = origStroke;
7261
- self.strokeWidth = origStrokeWidth;
7262
- self.styles = origStyles;
7263
- self.shadow = origShadow;
7264
- }
7265
7219
  } else {
7266
7220
  originalRender(ctx);
7267
7221
  }
@@ -7343,7 +7297,7 @@ function applyTextBackground(obj, cfg) {
7343
7297
  const oy = Number(shadow.offsetY ?? 0) || 0;
7344
7298
  const blur = Math.max(0, Number(shadow.blur ?? 0));
7345
7299
  const shadowColor = String(shadow.color);
7346
- const sourceSpread = Math.max(0, Number(this.__pdShadowSourceSpread) || 0);
7300
+ const sourceSpread = 0;
7347
7301
  const pad = Math.max(16, Math.ceil((blur + sourceSpread) * 4) + Math.ceil(Math.max(Math.abs(ox), Math.abs(oy))) + 8);
7348
7302
  const shadowBounds = unionBounds([
7349
7303
  ...rects,
@@ -19085,9 +19039,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
19085
19039
  }
19086
19040
  return svgString;
19087
19041
  }
19088
- const resolvedPackageVersion = "0.5.217";
19042
+ const resolvedPackageVersion = "0.5.218";
19089
19043
  const PACKAGE_VERSION = resolvedPackageVersion;
19090
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.217";
19044
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.218";
19091
19045
  const roundParityValue = (value) => {
19092
19046
  if (typeof value !== "number") return value;
19093
19047
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -19779,7 +19733,7 @@ class PixldocsRenderer {
19779
19733
  await this.waitForCanvasScene(container, cloned, i);
19780
19734
  }
19781
19735
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
19782
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DJR9lwsV.js");
19736
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-som_tmDY.js");
19783
19737
  const prepared = preparePagesForExport(
19784
19738
  cloned.pages,
19785
19739
  canvasWidth,
@@ -21721,7 +21675,7 @@ async function rasterizeShadowMarkers(svg) {
21721
21675
  const by = parseFloat(marker.getAttribute("data-by") || "0");
21722
21676
  const bw = parseFloat(marker.getAttribute("data-bw") || "0");
21723
21677
  const bh = parseFloat(marker.getAttribute("data-bh") || "0");
21724
- const spread = parseFloat(marker.getAttribute("data-spread") || "0");
21678
+ const spread = 0;
21725
21679
  const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
21726
21680
  const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
21727
21681
  if (!Number.isFinite(bw) || !Number.isFinite(bh) || bw <= 0 || bh <= 0) {
@@ -21969,7 +21923,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
21969
21923
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
21970
21924
  sanitizeSvgTreeForPdf(svgToDraw);
21971
21925
  try {
21972
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DJR9lwsV.js");
21926
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-som_tmDY.js");
21973
21927
  try {
21974
21928
  await logTextMeasurementDiagnostic(svgToDraw);
21975
21929
  } catch {
@@ -22369,4 +22323,4 @@ export {
22369
22323
  buildTeaserBlurFlatKeys as y,
22370
22324
  collectFontDescriptorsFromConfig as z
22371
22325
  };
22372
- //# sourceMappingURL=index-Ci5YA_Ps.js.map
22326
+ //# sourceMappingURL=index-CZk_GpIL.js.map