@pixldocs/canvas-renderer 0.5.454 → 0.5.455

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 ?? "");
@@ -26030,9 +26036,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26030
26036
  }
26031
26037
  return svgString;
26032
26038
  }
26033
- const resolvedPackageVersion = "0.5.454";
26039
+ const resolvedPackageVersion = "0.5.455";
26034
26040
  const PACKAGE_VERSION = resolvedPackageVersion;
26035
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.454";
26041
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.455";
26036
26042
  const roundParityValue = (value) => {
26037
26043
  if (typeof value !== "number") return value;
26038
26044
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26846,7 +26852,7 @@ class PixldocsRenderer {
26846
26852
  await this.waitForCanvasScene(container, cloned, i);
26847
26853
  }
26848
26854
  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");
26855
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Dl1_fD7e.js");
26850
26856
  const prepared = preparePagesForExport(
26851
26857
  cloned.pages,
26852
26858
  canvasWidth,
@@ -29166,7 +29172,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29166
29172
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29167
29173
  sanitizeSvgTreeForPdf(svgToDraw);
29168
29174
  try {
29169
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-xz20N_5g.js");
29175
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Dl1_fD7e.js");
29170
29176
  try {
29171
29177
  await logTextMeasurementDiagnostic(svgToDraw);
29172
29178
  } catch {
@@ -29566,4 +29572,4 @@ export {
29566
29572
  buildTeaserBlurFlatKeys as y,
29567
29573
  collectFontDescriptorsFromConfig as z
29568
29574
  };
29569
- //# sourceMappingURL=index-CeVp5eqp.js.map
29575
+ //# sourceMappingURL=index-Bs4oHgQ2.js.map