@pixldocs/canvas-renderer 0.5.454 → 0.5.456

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.
@@ -21059,6 +21059,9 @@ function applyTextCase(text, textCase) {
21059
21059
  return text;
21060
21060
  }
21061
21061
  }
21062
+ function hasInlineFormattingMarkers(value) {
21063
+ return /\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|==[\s\S]+?==|\[(?:c|bg)=[^\]]+\][\s\S]+?\[\/(?:c|bg)\]|(^|[^*])\*[^*\n]+?\*/i.test(value);
21064
+ }
21062
21065
  function setInTree(nodes, elementId, targetProperty, value) {
21063
21066
  for (const node of nodes) {
21064
21067
  if (node.id === elementId) {
@@ -21073,6 +21076,9 @@ function setInTree(nodes, elementId, targetProperty, value) {
21073
21076
  } else if (targetProperty === "text" && node.type === "text" && typeof value === "string") {
21074
21077
  const textVal = value === "" ? " " : value;
21075
21078
  node[targetProperty] = applyTextCase(textVal, node.textCase);
21079
+ if (hasInlineFormattingMarkers(textVal)) {
21080
+ node.formattingEnabled = true;
21081
+ }
21076
21082
  } else if ((targetProperty === "src" || targetProperty === "imageUrl") && node.type === "image") {
21077
21083
  const previousSrc = String(node.src || node.imageUrl || "");
21078
21084
  const nextSrc = String(value ?? "");
@@ -21748,13 +21754,14 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
21748
21754
  const applyValue = (elementId, targetProperty, value, fieldKey) => {
21749
21755
  var _a3;
21750
21756
  const isTextLike = targetProperty === "text" || targetProperty === "content";
21757
+ const isImageLike = targetProperty === "src" || targetProperty === "imageUrl";
21751
21758
  if (value === void 0 || value === null) {
21752
21759
  return false;
21753
21760
  }
21754
- if (value === "" && !isTextLike) {
21761
+ if (value === "" && !isTextLike && !isImageLike) {
21755
21762
  return false;
21756
21763
  }
21757
- let effectiveValue = (value === void 0 || value === null || value === "") && isTextLike && fieldKey ? fieldLabelByKey.get(fieldKey) ?? value : value;
21764
+ let effectiveValue = value;
21758
21765
  if (effectiveValue === void 0) return false;
21759
21766
  if (isTextLike && typeof effectiveValue === "string" && effectiveValue !== "") {
21760
21767
  const fType = resolveDisplayFormat(fieldKey);
@@ -26030,9 +26037,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26030
26037
  }
26031
26038
  return svgString;
26032
26039
  }
26033
- const resolvedPackageVersion = "0.5.454";
26040
+ const resolvedPackageVersion = "0.5.456";
26034
26041
  const PACKAGE_VERSION = resolvedPackageVersion;
26035
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.454";
26042
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.456";
26036
26043
  const roundParityValue = (value) => {
26037
26044
  if (typeof value !== "number") return value;
26038
26045
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26846,7 +26853,7 @@ class PixldocsRenderer {
26846
26853
  await this.waitForCanvasScene(container, cloned, i);
26847
26854
  }
26848
26855
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26849
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-xz20N_5g.js");
26856
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CAeuEsjr.js");
26850
26857
  const prepared = preparePagesForExport(
26851
26858
  cloned.pages,
26852
26859
  canvasWidth,
@@ -29166,7 +29173,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29166
29173
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29167
29174
  sanitizeSvgTreeForPdf(svgToDraw);
29168
29175
  try {
29169
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-xz20N_5g.js");
29176
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CAeuEsjr.js");
29170
29177
  try {
29171
29178
  await logTextMeasurementDiagnostic(svgToDraw);
29172
29179
  } catch {
@@ -29566,4 +29573,4 @@ export {
29566
29573
  buildTeaserBlurFlatKeys as y,
29567
29574
  collectFontDescriptorsFromConfig as z
29568
29575
  };
29569
- //# sourceMappingURL=index-CeVp5eqp.js.map
29576
+ //# sourceMappingURL=index-DbfhlD78.js.map