@pixldocs/canvas-renderer 0.5.4 → 0.5.5
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.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10328,6 +10328,10 @@ function getRenderableFormSections(schema) {
|
|
|
10328
10328
|
function buildRepeatablePagesInputForApply(schema, sectionState) {
|
|
10329
10329
|
var _a;
|
|
10330
10330
|
if (!((_a = schema == null ? void 0 : schema.repeatablePages) == null ? void 0 : _a.length)) return [];
|
|
10331
|
+
const normalizeTemplateKeyPrefix = (prefix) => {
|
|
10332
|
+
if (!prefix || typeof prefix !== "string") return "";
|
|
10333
|
+
return prefix.replace(/^field_/, "");
|
|
10334
|
+
};
|
|
10331
10335
|
return schema.repeatablePages.map((page) => {
|
|
10332
10336
|
const entries = sectionState == null ? void 0 : sectionState[page.id];
|
|
10333
10337
|
const minEntries = page.minEntries != null ? Math.max(0, page.minEntries) : 1;
|
|
@@ -10335,7 +10339,11 @@ function buildRepeatablePagesInputForApply(schema, sectionState) {
|
|
|
10335
10339
|
if (Array.isArray(entries)) {
|
|
10336
10340
|
entryCount = minEntries === 0 ? entries.length : Math.max(1, entries.length);
|
|
10337
10341
|
}
|
|
10338
|
-
return {
|
|
10342
|
+
return {
|
|
10343
|
+
pageId: page.id,
|
|
10344
|
+
templateKeyPrefix: normalizeTemplateKeyPrefix(page.templateKeyPrefix),
|
|
10345
|
+
entryCount
|
|
10346
|
+
};
|
|
10339
10347
|
});
|
|
10340
10348
|
}
|
|
10341
10349
|
async function fetchRow(supabaseUrl, anonKey, table, id) {
|