@pixldocs/canvas-renderer 0.5.4 → 0.5.6

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.
package/dist/index.js CHANGED
@@ -10309,6 +10309,10 @@ function getRenderableFormSections(schema) {
10309
10309
  function buildRepeatablePagesInputForApply(schema, sectionState) {
10310
10310
  var _a;
10311
10311
  if (!((_a = schema == null ? void 0 : schema.repeatablePages) == null ? void 0 : _a.length)) return [];
10312
+ const normalizeTemplateKeyPrefix = (prefix) => {
10313
+ if (!prefix || typeof prefix !== "string") return "";
10314
+ return prefix.replace(/^field_/, "");
10315
+ };
10312
10316
  return schema.repeatablePages.map((page) => {
10313
10317
  const entries = sectionState == null ? void 0 : sectionState[page.id];
10314
10318
  const minEntries = page.minEntries != null ? Math.max(0, page.minEntries) : 1;
@@ -10316,7 +10320,11 @@ function buildRepeatablePagesInputForApply(schema, sectionState) {
10316
10320
  if (Array.isArray(entries)) {
10317
10321
  entryCount = minEntries === 0 ? entries.length : Math.max(1, entries.length);
10318
10322
  }
10319
- return { pageId: page.id, templateKeyPrefix: page.templateKeyPrefix, entryCount };
10323
+ return {
10324
+ pageId: page.id,
10325
+ templateKeyPrefix: normalizeTemplateKeyPrefix(page.templateKeyPrefix),
10326
+ entryCount
10327
+ };
10320
10328
  });
10321
10329
  }
10322
10330
  async function fetchRow(supabaseUrl, anonKey, table, id) {