@proveanything/smartlinks-utils-ui 0.11.10 → 0.11.11

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.
@@ -9126,6 +9126,10 @@ function RecordsAdminShellInner(props) {
9126
9126
  return;
9127
9127
  }
9128
9128
  if (isProductTab) {
9129
+ if (item.scope.productId !== selectedProductId) {
9130
+ setSelectedRecordId(null);
9131
+ setDraftKind(null);
9132
+ }
9129
9133
  setSelectedProductId(item.scope.productId);
9130
9134
  setSelectedVariantId(void 0);
9131
9135
  setSelectedBatchId(void 0);
@@ -9660,17 +9664,20 @@ function RecordsAdminShellInner(props) {
9660
9664
  )
9661
9665
  }
9662
9666
  ),
9663
- ruleWizardStep === null && isProductTab && selectedProductId && !isCollection && editingTargetScope && resolved.source !== "self" && selectedRecordId !== DRAFT_ID3 ? /* @__PURE__ */ jsx(
9664
- CreateRecordChooser,
9665
- {
9666
- title: "No record set for this product",
9667
- body: `Choose whether to create a fresh ${itemNoun} for this product or start from the global default.`,
9668
- primaryLabel: "Start blank",
9669
- onPrimary: () => onCreateProductRecord("blank"),
9670
- secondaryLabel: singletonGlobalSeedAvailable ? "Copy from global" : void 0,
9671
- onSecondary: singletonGlobalSeedAvailable ? () => onCreateProductRecord("global") : void 0
9672
- }
9673
- ) : null,
9667
+ ruleWizardStep === null && isProductTab && selectedProductId && !isCollection && editingTargetScope && resolved.source !== "self" && selectedRecordId !== DRAFT_ID3 ? (() => {
9668
+ const productName = productLookupItems.find((p) => p.id === selectedProductId)?.name ?? selectedProductId;
9669
+ return /* @__PURE__ */ jsx(
9670
+ CreateRecordChooser,
9671
+ {
9672
+ title: `No ${itemNoun} set for product: ${productName}`,
9673
+ body: `Choose whether to create a fresh ${itemNoun} for this product or start from the global default.`,
9674
+ primaryLabel: "Start blank",
9675
+ onPrimary: () => onCreateProductRecord("blank"),
9676
+ secondaryLabel: singletonGlobalSeedAvailable ? "Copy from global" : void 0,
9677
+ onSecondary: singletonGlobalSeedAvailable ? () => onCreateProductRecord("global") : void 0
9678
+ }
9679
+ );
9680
+ })() : null,
9674
9681
  ruleWizardStep === null && !isProductTab && editingTargetScope && (!isCollection || selectedItemId) && renderEditorWithPreview()
9675
9682
  ] })
9676
9683
  ]