@pixldocs/canvas-renderer 0.5.88 → 0.5.90

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
@@ -12453,8 +12453,9 @@ async function resolveFromForm(options) {
12453
12453
  const repeatableNodeMap = /* @__PURE__ */ new Map();
12454
12454
  if (repeatableFromSchema) {
12455
12455
  for (const r of repeatableFromSchema) {
12456
- repeatableNodeMap.set(r.label, r.nodeId);
12457
- repeatableNodeMap.set(r.label.trim().toLowerCase(), r.nodeId);
12456
+ if (!repeatableNodeMap.has(r.label)) repeatableNodeMap.set(r.label, r.nodeId);
12457
+ const labelKey = r.label.trim().toLowerCase();
12458
+ if (!repeatableNodeMap.has(labelKey)) repeatableNodeMap.set(labelKey, r.nodeId);
12458
12459
  }
12459
12460
  }
12460
12461
  let inferredSections;
@@ -12511,18 +12512,21 @@ async function resolveFromForm(options) {
12511
12512
  const nodeId = s.treeNodeId ?? s.id;
12512
12513
  const schemaRepeatable = repeatableFromSchemaByBase.get(baseId(nodeId));
12513
12514
  const parentId = s.parentId;
12515
+ const parentSection = inferredSections.find((ps) => ps.id === parentId);
12516
+ const parentNodeId = parentSection ? parentSection.treeNodeId ?? parentSection.id : parentId;
12514
12517
  const parentEntries = mergedSectionState[parentId] ?? [];
12518
+ const nestedEntryMeta = {};
12515
12519
  const merged = [];
12516
12520
  for (let pi = 0; pi < parentEntries.length; pi++) {
12517
12521
  const childEntries = mergedSectionState[`${parentId}_${pi}_${s.id}`] ?? [];
12518
- for (const e of childEntries) {
12519
- merged.push({
12520
- id: typeof (e == null ? void 0 : e.__entryId) === "string" ? e.__entryId : void 0,
12521
- name: typeof (e == null ? void 0 : e.__entryName) === "string" ? e.__entryName : void 0
12522
- });
12523
- }
12522
+ const meta = childEntries.map((e) => ({
12523
+ id: typeof (e == null ? void 0 : e.__entryId) === "string" ? e.__entryId : void 0,
12524
+ name: typeof (e == null ? void 0 : e.__entryName) === "string" ? e.__entryName : void 0
12525
+ }));
12526
+ nestedEntryMeta[`${baseId(parentNodeId)}_${pi + 1}_${baseId(nodeId)}`] = meta;
12527
+ merged.push(...meta);
12524
12528
  }
12525
- return { nodeId, label: s.label, entryFilter: schemaRepeatable == null ? void 0 : schemaRepeatable.entryFilter, entryMeta: merged };
12529
+ return { nodeId, label: s.label, entryFilter: schemaRepeatable == null ? void 0 : schemaRepeatable.entryFilter, entryMeta: merged, nestedEntryMeta };
12526
12530
  });
12527
12531
  const inferredRepeatableList = [...topLevelRepeatables, ...nestedRepeatables];
12528
12532
  const entryCountForLabel = (label) => {