@pixldocs/canvas-renderer 0.5.453 → 0.5.454

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.
@@ -20973,6 +20973,20 @@ function flattenSectionStateToFormData(sectionState, sections) {
20973
20973
  }
20974
20974
  return flat;
20975
20975
  }
20976
+ function gradientSiblingForTarget(targetProperty) {
20977
+ switch (targetProperty) {
20978
+ case "fill":
20979
+ return "fillGradient";
20980
+ case "stroke":
20981
+ return "strokeGradient";
20982
+ case "textBgColor":
20983
+ return "textBgGradient";
20984
+ case "backgroundColor":
20985
+ return "backgroundGradient";
20986
+ default:
20987
+ return null;
20988
+ }
20989
+ }
20976
20990
  const CLONE_SUFFIX = /_\d+$/;
20977
20991
  function baseId(id) {
20978
20992
  let s = id;
@@ -21073,7 +21087,18 @@ function setInTree(nodes, elementId, targetProperty, value) {
21073
21087
  delete node.cropZoom;
21074
21088
  }
21075
21089
  } else {
21076
- node[targetProperty] = value;
21090
+ const gradSibling = gradientSiblingForTarget(targetProperty);
21091
+ if (gradSibling) {
21092
+ if (isGradientConfig(value)) {
21093
+ node[gradSibling] = value;
21094
+ node[targetProperty] = targetProperty === "textBgColor" ? "transparent" : "";
21095
+ } else {
21096
+ if (gradSibling in node) delete node[gradSibling];
21097
+ node[targetProperty] = value;
21098
+ }
21099
+ } else {
21100
+ node[targetProperty] = value;
21101
+ }
21077
21102
  }
21078
21103
  if (targetProperty === "text" && node.type === "text") {
21079
21104
  const overflowPolicy = String(node.overflowPolicy ?? "grow-and-push");
@@ -21745,10 +21770,19 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
21745
21770
  effectiveValue = formatTimeForDisplay(effectiveValue);
21746
21771
  }
21747
21772
  }
21748
- if (elementId === PAGE_BACKGROUND_ELEMENT_ID && targetProperty === "backgroundColor" && typeof effectiveValue === "string") {
21773
+ if (elementId === PAGE_BACKGROUND_ELEMENT_ID && targetProperty === "backgroundColor") {
21749
21774
  if ((_a3 = pages[0]) == null ? void 0 : _a3.settings) {
21750
- pages[0].settings.backgroundColor = effectiveValue;
21751
- return true;
21775
+ const settings = pages[0].settings;
21776
+ if (isGradientConfig(effectiveValue)) {
21777
+ settings.backgroundGradient = effectiveValue;
21778
+ settings.backgroundColor = "";
21779
+ return true;
21780
+ }
21781
+ if (typeof effectiveValue === "string") {
21782
+ if ("backgroundGradient" in settings) delete settings.backgroundGradient;
21783
+ settings.backgroundColor = effectiveValue;
21784
+ return true;
21785
+ }
21752
21786
  }
21753
21787
  }
21754
21788
  for (const page of pages) {
@@ -25996,9 +26030,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25996
26030
  }
25997
26031
  return svgString;
25998
26032
  }
25999
- const resolvedPackageVersion = "0.5.453";
26033
+ const resolvedPackageVersion = "0.5.454";
26000
26034
  const PACKAGE_VERSION = resolvedPackageVersion;
26001
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.453";
26035
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.454";
26002
26036
  const roundParityValue = (value) => {
26003
26037
  if (typeof value !== "number") return value;
26004
26038
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26812,7 +26846,7 @@ class PixldocsRenderer {
26812
26846
  await this.waitForCanvasScene(container, cloned, i);
26813
26847
  }
26814
26848
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26815
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DA8kyWb1.js");
26849
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-xz20N_5g.js");
26816
26850
  const prepared = preparePagesForExport(
26817
26851
  cloned.pages,
26818
26852
  canvasWidth,
@@ -29132,7 +29166,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29132
29166
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29133
29167
  sanitizeSvgTreeForPdf(svgToDraw);
29134
29168
  try {
29135
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DA8kyWb1.js");
29169
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-xz20N_5g.js");
29136
29170
  try {
29137
29171
  await logTextMeasurementDiagnostic(svgToDraw);
29138
29172
  } catch {
@@ -29532,4 +29566,4 @@ export {
29532
29566
  buildTeaserBlurFlatKeys as y,
29533
29567
  collectFontDescriptorsFromConfig as z
29534
29568
  };
29535
- //# sourceMappingURL=index-B4ZctiMj.js.map
29569
+ //# sourceMappingURL=index-CeVp5eqp.js.map