@pixldocs/canvas-renderer 0.5.201 → 0.5.203

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.
@@ -15581,6 +15581,8 @@ function buildRepeatablePagesInputForApply(schema, sectionState) {
15581
15581
  let entryCount;
15582
15582
  if (Array.isArray(entries)) {
15583
15583
  entryCount = minEntries === 0 ? entries.length : Math.max(1, entries.length);
15584
+ } else {
15585
+ entryCount = minEntries === 0 ? 0 : minEntries;
15584
15586
  }
15585
15587
  return {
15586
15588
  pageId: page.id,
@@ -15625,7 +15627,7 @@ function deriveRepeatablePagesFromTemplate(config, inlineFormSchema, formData) {
15625
15627
  };
15626
15628
  const inferEntryCount = (prefix, minEntries) => {
15627
15629
  const normalizedPrefix = normalizeTemplateKeyPrefix(prefix);
15628
- if (!normalizedPrefix) return minEntries === 0 ? 0 : void 0;
15630
+ if (!normalizedPrefix) return minEntries === 0 ? 0 : minEntries ?? void 0;
15629
15631
  let maxIndex = 0;
15630
15632
  const keyPrefix = `field_${normalizedPrefix}_`;
15631
15633
  for (const key of Object.keys(formData ?? {})) {
@@ -15635,7 +15637,7 @@ function deriveRepeatablePagesFromTemplate(config, inlineFormSchema, formData) {
15635
15637
  if (match) maxIndex = Math.max(maxIndex, parseInt(match[1], 10));
15636
15638
  }
15637
15639
  if (maxIndex > 0) return maxIndex;
15638
- return minEntries === 0 ? 0 : void 0;
15640
+ return minEntries ?? 0;
15639
15641
  };
15640
15642
  const collectIds = (nodes, out2) => {
15641
15643
  for (const n of nodes ?? []) {
@@ -15650,9 +15652,11 @@ function deriveRepeatablePagesFromTemplate(config, inlineFormSchema, formData) {
15650
15652
  if (!boundId) continue;
15651
15653
  let templateKeyPrefix;
15652
15654
  let entryCount;
15655
+ let foundMinEntries;
15653
15656
  if (Array.isArray(schemaPages)) {
15654
15657
  const found = schemaPages.find((rp) => (rp == null ? void 0 : rp.id) === boundId || (rp == null ? void 0 : rp.id) === page.id);
15655
15658
  templateKeyPrefix = normalizeTemplateKeyPrefix(found == null ? void 0 : found.templateKeyPrefix);
15659
+ foundMinEntries = found == null ? void 0 : found.minEntries;
15656
15660
  entryCount = inferEntryCount(templateKeyPrefix ?? (found == null ? void 0 : found.templateKeyPrefix) ?? "", found == null ? void 0 : found.minEntries);
15657
15661
  }
15658
15662
  if (!templateKeyPrefix && Array.isArray(dynamicFields) && dynamicFields.length > 0) {
@@ -15684,7 +15688,7 @@ function deriveRepeatablePagesFromTemplate(config, inlineFormSchema, formData) {
15684
15688
  out.push({
15685
15689
  pageId: boundId,
15686
15690
  templateKeyPrefix,
15687
- entryCount: entryCount ?? inferEntryCount(templateKeyPrefix)
15691
+ entryCount: entryCount ?? inferEntryCount(templateKeyPrefix, foundMinEntries)
15688
15692
  });
15689
15693
  }
15690
15694
  }
@@ -16092,6 +16096,12 @@ function paintRepeatableSections(config, repeatableSections) {
16092
16096
  function setRepeatable(nodes, nodeId, payload) {
16093
16097
  for (const node of nodes) {
16094
16098
  const id = node.id;
16099
+ if (node.repeatableSection) {
16100
+ if (Array.isArray(node.children) && setRepeatable(node.children, nodeId, payload)) {
16101
+ return true;
16102
+ }
16103
+ continue;
16104
+ }
16095
16105
  if (id && (id === nodeId || baseId(id) === baseId(nodeId))) {
16096
16106
  node.repeatableSection = payload;
16097
16107
  return true;
@@ -16939,9 +16949,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
16939
16949
  }
16940
16950
  return svgString;
16941
16951
  }
16942
- const resolvedPackageVersion = "0.5.201";
16952
+ const resolvedPackageVersion = "0.5.203";
16943
16953
  const PACKAGE_VERSION = resolvedPackageVersion;
16944
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.201";
16954
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.203";
16945
16955
  const roundParityValue = (value) => {
16946
16956
  if (typeof value !== "number") return value;
16947
16957
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -17620,7 +17630,7 @@ class PixldocsRenderer {
17620
17630
  await this.waitForCanvasScene(container, cloned, i);
17621
17631
  }
17622
17632
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
17623
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DQjvPb1v.cjs"));
17633
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-xsu5ahea.cjs"));
17624
17634
  const prepared = preparePagesForExport(
17625
17635
  cloned.pages,
17626
17636
  canvasWidth,
@@ -19804,7 +19814,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
19804
19814
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
19805
19815
  sanitizeSvgTreeForPdf(svgToDraw);
19806
19816
  try {
19807
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DQjvPb1v.cjs"));
19817
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-xsu5ahea.cjs"));
19808
19818
  try {
19809
19819
  await logTextMeasurementDiagnostic(svgToDraw);
19810
19820
  } catch {
@@ -20201,4 +20211,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
20201
20211
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
20202
20212
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
20203
20213
  exports.warmTemplateFromForm = warmTemplateFromForm;
20204
- //# sourceMappingURL=index-RcI43b-V.cjs.map
20214
+ //# sourceMappingURL=index-CZ28FLrz.cjs.map