@pixldocs/canvas-renderer 0.5.235 → 0.5.237

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.
@@ -7323,6 +7323,7 @@ function extractTextBgConfig(element) {
7323
7323
  shadowAffectsBg: element.textShadowAffectsBg !== false,
7324
7324
  shadowAffectsText: element.textShadowAffectsText !== false,
7325
7325
  fitToText: element.textBgFitToText === true,
7326
+ lineFullWidth: element.textBgPerLineFullWidth === true,
7326
7327
  shadowType: element.textShadowType,
7327
7328
  shadowColor: element.textShadowColor,
7328
7329
  shadowOffsetX: Number(element.textShadowOffsetX ?? 0) || 0,
@@ -7520,7 +7521,7 @@ function applyTextBackground(obj, cfg) {
7520
7521
  if (ribbonD) {
7521
7522
  bgBounds = computeRibbonBoundsFor(this, pT, pR, pB, pL);
7522
7523
  } else {
7523
- bgRectsForFill = computeBgRects(this, w, h, pT, pR, pB, pL, !!bg.fitToText);
7524
+ bgRectsForFill = computeBgRects(this, w, h, pT, pR, pB, pL, !!bg.fitToText, !!bg.lineFullWidth);
7524
7525
  bgBounds = unionBounds(bgRectsForFill);
7525
7526
  }
7526
7527
  if (blockShadowActive && bg.shadowAffectsBg !== false) {
@@ -7712,7 +7713,8 @@ function applyTextBackground(obj, cfg) {
7712
7713
  const pB = Math.max(0, Number((bg == null ? void 0 : bg.padBottom) ?? 0));
7713
7714
  const pL = Math.max(0, Number((bg == null ? void 0 : bg.padLeft) ?? 0));
7714
7715
  const fit = !!(bg == null ? void 0 : bg.fitToText);
7715
- const rects = computeBgRects(this, w, h, pT, pR, pB, pL, fit);
7716
+ const lineFull = !!(bg == null ? void 0 : bg.lineFullWidth);
7717
+ const rects = computeBgRects(this, w, h, pT, pR, pB, pL, fit, lineFull);
7716
7718
  const ribbonD = buildWarpRibbonD(
7717
7719
  this,
7718
7720
  pT,
@@ -7984,9 +7986,9 @@ function computeTextVisualBounds(obj, w, h) {
7984
7986
  }
7985
7987
  return unionBounds(rects.length > 0 ? rects : [{ x: -w / 2, y: -h / 2, w, h }]);
7986
7988
  }
7987
- function computeBgRects(obj, w, h, pT, pR, pB, pL, fit) {
7989
+ function computeBgRects(obj, w, h, pT, pR, pB, pL, fit, lineFullWidth = false) {
7988
7990
  var _a2;
7989
- if (!fit) {
7991
+ if (!fit && !lineFullWidth) {
7990
7992
  return [{
7991
7993
  x: -w / 2 - pL,
7992
7994
  y: -h / 2 - pT,
@@ -8048,14 +8050,16 @@ function computeBgRects(obj, w, h, pT, pR, pB, pL, fit) {
8048
8050
  const usedH = cursorY + halfH;
8049
8051
  const remaining = h - usedH;
8050
8052
  const slotH = Math.max(0, Math.min(rawSlotH, remaining));
8051
- if (lineW <= 0 || slotH <= 0) {
8053
+ const effectiveW = lineFullWidth ? w : lineW;
8054
+ const effectiveLeft = lineFullWidth ? 0 : lineLeft;
8055
+ if (effectiveW <= 0 || slotH <= 0) {
8052
8056
  cursorY += slotH;
8053
8057
  continue;
8054
8058
  }
8055
8059
  rects.push({
8056
- x: -halfW + lineLeft - pL,
8060
+ x: -halfW + effectiveLeft - pL,
8057
8061
  y: cursorY - pT,
8058
- w: lineW + pL + pR,
8062
+ w: effectiveW + pL + pR,
8059
8063
  h: slotH + pT + pB
8060
8064
  });
8061
8065
  cursorY += slotH;
@@ -13088,6 +13092,7 @@ const PageCanvas = forwardRef(
13088
13092
  br: element.textBgRxBR ?? 0,
13089
13093
  bl: element.textBgRxBL ?? 0,
13090
13094
  ft: element.textBgFitToText === true,
13095
+ lf: element.textBgPerLineFullWidth === true,
13091
13096
  bo: element.textBgOpacity ?? 1,
13092
13097
  sc: element.textShadowColor ?? null,
13093
13098
  sb: element.textShadowBlur ?? 0,
@@ -14226,6 +14231,7 @@ const PageCanvas = forwardRef(
14226
14231
  br: element.textBgRxBR ?? 0,
14227
14232
  bl: element.textBgRxBL ?? 0,
14228
14233
  ft: element.textBgFitToText === true,
14234
+ lf: element.textBgPerLineFullWidth === true,
14229
14235
  bo: element.textBgOpacity ?? 1,
14230
14236
  sc: element.textShadowColor ?? null,
14231
14237
  sb: element.textShadowBlur ?? 0,
@@ -21115,9 +21121,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
21115
21121
  }
21116
21122
  return svgString;
21117
21123
  }
21118
- const resolvedPackageVersion = "0.5.235";
21124
+ const resolvedPackageVersion = "0.5.237";
21119
21125
  const PACKAGE_VERSION = resolvedPackageVersion;
21120
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.235";
21126
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.237";
21121
21127
  const roundParityValue = (value) => {
21122
21128
  if (typeof value !== "number") return value;
21123
21129
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -21861,7 +21867,7 @@ class PixldocsRenderer {
21861
21867
  await this.waitForCanvasScene(container, cloned, i);
21862
21868
  }
21863
21869
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
21864
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DzgUFIK9.js");
21870
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CgEH8Ggz.js");
21865
21871
  const prepared = preparePagesForExport(
21866
21872
  cloned.pages,
21867
21873
  canvasWidth,
@@ -24181,7 +24187,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
24181
24187
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
24182
24188
  sanitizeSvgTreeForPdf(svgToDraw);
24183
24189
  try {
24184
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DzgUFIK9.js");
24190
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CgEH8Ggz.js");
24185
24191
  try {
24186
24192
  await logTextMeasurementDiagnostic(svgToDraw);
24187
24193
  } catch {
@@ -24581,4 +24587,4 @@ export {
24581
24587
  buildTeaserBlurFlatKeys as y,
24582
24588
  collectFontDescriptorsFromConfig as z
24583
24589
  };
24584
- //# sourceMappingURL=index-B8RvBKaU.js.map
24590
+ //# sourceMappingURL=index-DHRpTjzC.js.map