@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.
@@ -6919,11 +6919,7 @@ function readShadowStrength(element) {
6919
6919
  return typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.min(100, raw)) : 100;
6920
6920
  }
6921
6921
  function resolveShadowSourceSpread(element) {
6922
- const strength = readShadowStrength(element);
6923
- const blur = Math.max(0, Number(element.textShadowBlur ?? 0) || 0);
6924
- const fontSize = Math.max(1, Number(element.fontSize ?? 16) || 16);
6925
- const t = Math.max(0, (strength - 35) / 65);
6926
- return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t;
6922
+ return 0;
6927
6923
  }
6928
6924
  function resolveShadowAlpha(element) {
6929
6925
  const s = readShadowStrength(element);
@@ -6946,7 +6942,7 @@ function applyTextShadow(textbox, element) {
6946
6942
  }
6947
6943
  obj.__pdShadowAlpha = canonicalShadow ? resolveShadowAlpha(element) : 1;
6948
6944
  obj.__pdShadowBaseColor = canonicalShadow ? String(element.textShadowColor || "") : void 0;
6949
- obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread(element) : 0;
6945
+ obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread() : 0;
6950
6946
  textbox.set("shadow", canonicalShadow ?? null);
6951
6947
  }
6952
6948
  function applyAlphaMultiplier(c, mult) {
@@ -7230,8 +7226,6 @@ function applyTextBackground(obj, cfg) {
7230
7226
  }
7231
7227
  }
7232
7228
  const suppressShadowOnText = bg && bg.shadowAffectsText === false;
7233
- const dropShadowSpread = Math.max(0, Number(this.__pdShadowSourceSpread) || 0);
7234
- const dropShadowActive = dropShadowSpread > 0 && !!this.shadow && !suppressShadowOnText && !blockShadowActive && !lineShadowActive;
7235
7229
  if (suppressShadowOnText) {
7236
7230
  ctx.save();
7237
7231
  ctx.shadowColor = "transparent";
@@ -7240,44 +7234,6 @@ function applyTextBackground(obj, cfg) {
7240
7234
  ctx.shadowOffsetY = 0;
7241
7235
  originalRender(ctx);
7242
7236
  ctx.restore();
7243
- } else if (dropShadowActive) {
7244
- const self = this;
7245
- const shadow = self.shadow;
7246
- const shadowColor = String((shadow == null ? void 0 : shadow.color) || this.__pdShadowBaseColor || "rgba(0,0,0,1)");
7247
- const shadowBlur = Math.max(0, Number((shadow == null ? void 0 : shadow.blur) ?? 0) || 0);
7248
- const shadowOffsetX = Number((shadow == null ? void 0 : shadow.offsetX) ?? 0) || 0;
7249
- const shadowOffsetY = Number((shadow == null ? void 0 : shadow.offsetY) ?? 0) || 0;
7250
- const origFill = self.fill;
7251
- const origStroke = self.stroke;
7252
- const origStrokeWidth = self.strokeWidth;
7253
- const origStyles = self.styles;
7254
- const origShadow = self.shadow;
7255
- try {
7256
- ctx.save();
7257
- self.shadow = null;
7258
- self.fill = shadowColor;
7259
- self.styles = {};
7260
- self.stroke = shadowColor;
7261
- self.strokeWidth = dropShadowSpread;
7262
- ctx.translate(shadowOffsetX, shadowOffsetY);
7263
- if (shadowBlur > 0) ctx.filter = `blur(${shadowBlur / 2}px)`;
7264
- ctx.lineJoin = "round";
7265
- ctx.lineCap = "round";
7266
- originalRender(ctx);
7267
- ctx.restore();
7268
- self.fill = origFill;
7269
- self.stroke = origStroke;
7270
- self.strokeWidth = origStrokeWidth;
7271
- self.styles = origStyles;
7272
- self.shadow = null;
7273
- originalRender(ctx);
7274
- } finally {
7275
- self.fill = origFill;
7276
- self.stroke = origStroke;
7277
- self.strokeWidth = origStrokeWidth;
7278
- self.styles = origStyles;
7279
- self.shadow = origShadow;
7280
- }
7281
7237
  } else {
7282
7238
  originalRender(ctx);
7283
7239
  }
@@ -7359,7 +7315,7 @@ function applyTextBackground(obj, cfg) {
7359
7315
  const oy = Number(shadow.offsetY ?? 0) || 0;
7360
7316
  const blur = Math.max(0, Number(shadow.blur ?? 0));
7361
7317
  const shadowColor = String(shadow.color);
7362
- const sourceSpread = Math.max(0, Number(this.__pdShadowSourceSpread) || 0);
7318
+ const sourceSpread = 0;
7363
7319
  const pad = Math.max(16, Math.ceil((blur + sourceSpread) * 4) + Math.ceil(Math.max(Math.abs(ox), Math.abs(oy))) + 8);
7364
7320
  const shadowBounds = unionBounds([
7365
7321
  ...rects,
@@ -19101,9 +19057,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
19101
19057
  }
19102
19058
  return svgString;
19103
19059
  }
19104
- const resolvedPackageVersion = "0.5.216";
19060
+ const resolvedPackageVersion = "0.5.218";
19105
19061
  const PACKAGE_VERSION = resolvedPackageVersion;
19106
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.216";
19062
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.218";
19107
19063
  const roundParityValue = (value) => {
19108
19064
  if (typeof value !== "number") return value;
19109
19065
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -19795,7 +19751,7 @@ class PixldocsRenderer {
19795
19751
  await this.waitForCanvasScene(container, cloned, i);
19796
19752
  }
19797
19753
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
19798
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-K3LAdOXU.cjs"));
19754
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CoZ-RUqL.cjs"));
19799
19755
  const prepared = preparePagesForExport(
19800
19756
  cloned.pages,
19801
19757
  canvasWidth,
@@ -21737,7 +21693,7 @@ async function rasterizeShadowMarkers(svg) {
21737
21693
  const by = parseFloat(marker.getAttribute("data-by") || "0");
21738
21694
  const bw = parseFloat(marker.getAttribute("data-bw") || "0");
21739
21695
  const bh = parseFloat(marker.getAttribute("data-bh") || "0");
21740
- const spread = parseFloat(marker.getAttribute("data-spread") || "0");
21696
+ const spread = 0;
21741
21697
  const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
21742
21698
  const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
21743
21699
  if (!Number.isFinite(bw) || !Number.isFinite(bh) || bw <= 0 || bh <= 0) {
@@ -21985,7 +21941,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
21985
21941
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
21986
21942
  sanitizeSvgTreeForPdf(svgToDraw);
21987
21943
  try {
21988
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-K3LAdOXU.cjs"));
21944
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CoZ-RUqL.cjs"));
21989
21945
  try {
21990
21946
  await logTextMeasurementDiagnostic(svgToDraw);
21991
21947
  } catch {
@@ -22382,4 +22338,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
22382
22338
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
22383
22339
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
22384
22340
  exports.warmTemplateFromForm = warmTemplateFromForm;
22385
- //# sourceMappingURL=index-C5McWFUS.cjs.map
22341
+ //# sourceMappingURL=index-D3NJNdX_.cjs.map