@proveanything/smartlinks-utils-ui 0.6.0 → 0.6.2

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.
@@ -4147,7 +4147,12 @@ function RecordsAdminShell(props) {
4147
4147
  }, [activeScope]);
4148
4148
  const editingScope = useMemo(() => {
4149
4149
  if (activeScope === "rule" || activeScope === "collection") {
4150
- if (selectedRecordId === null) return null;
4150
+ if (selectedRecordId === null) {
4151
+ if (activeScope === "collection" && cardinality === "collection") {
4152
+ return parseRef("");
4153
+ }
4154
+ return null;
4155
+ }
4151
4156
  if (selectedRecordId === DRAFT_ID) {
4152
4157
  return parseRef("");
4153
4158
  }
@@ -4165,7 +4170,7 @@ function RecordsAdminShell(props) {
4165
4170
  return parseRef(buildRef({ productId: selectedProductId, batchId: selectedBatchId }));
4166
4171
  }
4167
4172
  return parseRef(buildRef({ productId: selectedProductId }));
4168
- }, [activeScope, selectedRecordId, recordList.items, selectedProductId, drillTab, selectedVariantId, selectedBatchId]);
4173
+ }, [activeScope, cardinality, selectedRecordId, recordList.items, selectedProductId, drillTab, selectedVariantId, selectedBatchId]);
4169
4174
  const isCollection = cardinality === "collection";
4170
4175
  const editingTargetScope = editingScope;
4171
4176
  const skipNextItemResetRef = useRef(false);
@@ -4233,7 +4238,14 @@ function RecordsAdminShell(props) {
4233
4238
  // inheritance chain and load that exact row. Drafts (`DRAFT_ID`) and
4234
4239
  // pinned-anchor tabs (Products) leave `recordId` undefined so the
4235
4240
  // resolver runs `match()` against the anchors above.
4236
- recordId: selectedRecordId && selectedRecordId !== DRAFT_ID ? selectedRecordId : void 0,
4241
+ //
4242
+ // In collection-cardinality mode the per-item UUID lives in
4243
+ // `selectedItemId` (set by the right-pane item list onOpen handler),
4244
+ // not `selectedRecordId`. Without this branch the resolver would
4245
+ // fall back to anchor-based `match()` at the collection root and the
4246
+ // editor would mount against `null` data — surfacing as the host's
4247
+ // "Select a {noun} from the list to edit" placeholder.
4248
+ recordId: isCollection && selectedItemId && selectedItemId !== DRAFT_ID ? selectedItemId : selectedRecordId && selectedRecordId !== DRAFT_ID ? selectedRecordId : void 0,
4237
4249
  supportedScopes: supportedForResolution,
4238
4250
  enabled: !!editingTargetScope
4239
4251
  });