@pixldocs/canvas-renderer 0.5.200 → 0.5.202

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
  }
@@ -16939,9 +16943,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
16939
16943
  }
16940
16944
  return svgString;
16941
16945
  }
16942
- const resolvedPackageVersion = "0.5.200";
16946
+ const resolvedPackageVersion = "0.5.202";
16943
16947
  const PACKAGE_VERSION = resolvedPackageVersion;
16944
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.200";
16948
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.202";
16945
16949
  const roundParityValue = (value) => {
16946
16950
  if (typeof value !== "number") return value;
16947
16951
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -17620,7 +17624,7 @@ class PixldocsRenderer {
17620
17624
  await this.waitForCanvasScene(container, cloned, i);
17621
17625
  }
17622
17626
  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-CV6GxECJ.cjs"));
17627
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DCyVRj7e.cjs"));
17624
17628
  const prepared = preparePagesForExport(
17625
17629
  cloned.pages,
17626
17630
  canvasWidth,
@@ -19804,7 +19808,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
19804
19808
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
19805
19809
  sanitizeSvgTreeForPdf(svgToDraw);
19806
19810
  try {
19807
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CV6GxECJ.cjs"));
19811
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DCyVRj7e.cjs"));
19808
19812
  try {
19809
19813
  await logTextMeasurementDiagnostic(svgToDraw);
19810
19814
  } catch {
@@ -20201,4 +20205,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
20201
20205
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
20202
20206
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
20203
20207
  exports.warmTemplateFromForm = warmTemplateFromForm;
20204
- //# sourceMappingURL=index-B0b3u83I.cjs.map
20208
+ //# sourceMappingURL=index-BfMO-VrX.cjs.map