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