@proveanything/smartlinks-utils-ui 0.11.4 → 0.11.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.
@@ -993,90 +993,7 @@ var useProductChildren = (args) => {
993
993
  };
994
994
  };
995
995
  var EMPTY_RULE_FILTERS = { facetKeys: [], minClauses: null };
996
- var COMPLEXITY_THRESHOLDS = [3, 5, 10];
997
996
  var ruleOf = (r) => r.facetRule ?? null;
998
- function RuleFilterChips({ source, value, onChange }) {
999
- const facetKeyEntries = useMemo(() => {
1000
- const counts = /* @__PURE__ */ new Map();
1001
- for (const r of source) {
1002
- const rule = ruleOf(r);
1003
- if (!rule) continue;
1004
- for (const c of rule.all ?? []) {
1005
- counts.set(c.facetKey, (counts.get(c.facetKey) ?? 0) + 1);
1006
- }
1007
- }
1008
- return Array.from(counts.entries()).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
1009
- }, [source]);
1010
- const maxClauses = useMemo(() => {
1011
- let max = 0;
1012
- for (const r of source) {
1013
- const rule = ruleOf(r);
1014
- if (!rule) continue;
1015
- max = Math.max(max, rule.all?.length ?? 0);
1016
- }
1017
- return max;
1018
- }, [source]);
1019
- if (facetKeyEntries.length === 0 && maxClauses < 2) return null;
1020
- const toggleKey = (key) => {
1021
- const has = value.facetKeys.includes(key);
1022
- const next = has ? value.facetKeys.filter((k) => k !== key) : [...value.facetKeys, key];
1023
- onChange({ ...value, facetKeys: next });
1024
- };
1025
- const setMin = (n) => onChange({ ...value, minClauses: n });
1026
- const hasAny = value.facetKeys.length > 0 || value.minClauses != null;
1027
- return /* @__PURE__ */ jsxs("div", { className: "ra-rule-filters", children: [
1028
- /* @__PURE__ */ jsx("div", { className: "ra-rule-filters-row", role: "group", "aria-label": "Filter rules by facet", children: facetKeyEntries.map(([key, count]) => {
1029
- const active = value.facetKeys.includes(key);
1030
- return /* @__PURE__ */ jsxs(
1031
- "button",
1032
- {
1033
- type: "button",
1034
- onClick: () => toggleKey(key),
1035
- className: "ra-rule-filter-chip",
1036
- "data-active": active ? "true" : "false",
1037
- "aria-pressed": active,
1038
- title: `Show rules using ${key}`,
1039
- children: [
1040
- /* @__PURE__ */ jsx("span", { className: "ra-rule-filter-chip-label", children: key }),
1041
- /* @__PURE__ */ jsx("span", { className: "ra-rule-filter-chip-count", children: count })
1042
- ]
1043
- },
1044
- key
1045
- );
1046
- }) }),
1047
- maxClauses >= 2 && /* @__PURE__ */ jsx("div", { className: "ra-rule-filters-row", role: "group", "aria-label": "Filter by clause count", children: COMPLEXITY_THRESHOLDS.filter((n) => maxClauses >= n).map((n) => {
1048
- const active = value.minClauses === n;
1049
- return /* @__PURE__ */ jsxs(
1050
- "button",
1051
- {
1052
- type: "button",
1053
- onClick: () => setMin(active ? null : n),
1054
- className: "ra-rule-filter-chip",
1055
- "data-tone": "complexity",
1056
- "data-active": active ? "true" : "false",
1057
- "aria-pressed": active,
1058
- title: `Only rules with \u2265 ${n} facets`,
1059
- children: [
1060
- "\u2265 ",
1061
- n,
1062
- " facets"
1063
- ]
1064
- },
1065
- n
1066
- );
1067
- }) }),
1068
- hasAny && /* @__PURE__ */ jsx(
1069
- "button",
1070
- {
1071
- type: "button",
1072
- onClick: () => onChange(EMPTY_RULE_FILTERS),
1073
- className: "ra-rule-filter-clear",
1074
- "aria-label": "Clear rule filters",
1075
- children: "Clear filters"
1076
- }
1077
- )
1078
- ] });
1079
- }
1080
997
  function applyRuleFilters(items, filters) {
1081
998
  if (filters.facetKeys.length === 0 && filters.minClauses == null) return items;
1082
999
  return items.filter((r) => {
@@ -3480,7 +3397,7 @@ var RowContextMenu = ({
3480
3397
  onCopy();
3481
3398
  },
3482
3399
  children: [
3483
- /* @__PURE__ */ jsx(Copy, { className: "w-3 h-3", "aria-hidden": "true" }),
3400
+ /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5 opacity-70", "aria-hidden": "true" }),
3484
3401
  /* @__PURE__ */ jsx("span", { children: i18n.copy })
3485
3402
  ]
3486
3403
  }
@@ -3497,7 +3414,7 @@ var RowContextMenu = ({
3497
3414
  onDuplicate();
3498
3415
  },
3499
3416
  children: [
3500
- /* @__PURE__ */ jsx(CopyPlus, { className: "w-3 h-3", "aria-hidden": "true" }),
3417
+ /* @__PURE__ */ jsx(CopyPlus, { className: "w-3.5 h-3.5 opacity-70", "aria-hidden": "true" }),
3501
3418
  /* @__PURE__ */ jsx("span", { children: i18n.duplicateAction })
3502
3419
  ]
3503
3420
  }
@@ -3521,7 +3438,7 @@ var RowContextMenu = ({
3521
3438
  void action.onAction();
3522
3439
  },
3523
3440
  children: [
3524
- Icon && /* @__PURE__ */ jsx(Icon, { className: "w-3 h-3" }),
3441
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5 opacity-70" }),
3525
3442
  /* @__PURE__ */ jsx("span", { children: action.label })
3526
3443
  ]
3527
3444
  },
@@ -6677,12 +6594,15 @@ function NewRuleWizard({
6677
6594
  canChooseSeed = false,
6678
6595
  seedMode = null,
6679
6596
  onSeedModeChange,
6597
+ pasteSourceLabel,
6680
6598
  facets,
6681
6599
  children,
6682
- itemNoun = "record"
6600
+ itemNoun = "record",
6601
+ seedPromptMode = "inline"
6683
6602
  }) {
6684
6603
  const preview = useRulePreview({ SL, collectionId, appId, rule });
6685
6604
  const canProceed = isFacetRuleValid(rule);
6605
+ const showSeedPicker = (canChooseSeed || pasteSourceLabel) && seedPromptMode === "inline";
6686
6606
  if (step === 1) {
6687
6607
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
6688
6608
  /* @__PURE__ */ jsx(
@@ -6707,7 +6627,7 @@ function NewRuleWizard({
6707
6627
  description: "The new rule will apply to every product whose facets match every clause below."
6708
6628
  }
6709
6629
  ),
6710
- canChooseSeed && /* @__PURE__ */ jsxs(
6630
+ showSeedPicker && /* @__PURE__ */ jsxs(
6711
6631
  "div",
6712
6632
  {
6713
6633
  className: "mt-4 rounded-lg border p-3",
@@ -6718,7 +6638,7 @@ function NewRuleWizard({
6718
6638
  children: [
6719
6639
  /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
6720
6640
  /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", style: { color: "hsl(var(--ra-text))" }, children: "Start from" }),
6721
- /* @__PURE__ */ jsx("div", { className: "text-xs", style: { color: "hsl(var(--ra-muted-text))" }, children: "Choose whether the new rule starts empty or copies the current global record." })
6641
+ /* @__PURE__ */ jsx("div", { className: "text-xs", style: { color: "hsl(var(--ra-muted-text))" }, children: "Choose whether the new rule starts empty, copies the current global record, or pastes from your clipboard." })
6722
6642
  ] }),
6723
6643
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
6724
6644
  /* @__PURE__ */ jsx(
@@ -6726,12 +6646,12 @@ function NewRuleWizard({
6726
6646
  {
6727
6647
  type: "button",
6728
6648
  className: "ra-btn",
6729
- "data-variant": seedMode !== "global" ? "primary" : "ghost",
6649
+ "data-variant": seedMode === "blank" || seedMode == null ? "primary" : "ghost",
6730
6650
  onClick: () => onSeedModeChange?.("blank"),
6731
6651
  children: "Start blank"
6732
6652
  }
6733
6653
  ),
6734
- /* @__PURE__ */ jsx(
6654
+ canChooseSeed && /* @__PURE__ */ jsx(
6735
6655
  "button",
6736
6656
  {
6737
6657
  type: "button",
@@ -6740,6 +6660,17 @@ function NewRuleWizard({
6740
6660
  onClick: () => onSeedModeChange?.("global"),
6741
6661
  children: "Copy from global"
6742
6662
  }
6663
+ ),
6664
+ pasteSourceLabel && /* @__PURE__ */ jsx(
6665
+ "button",
6666
+ {
6667
+ type: "button",
6668
+ className: "ra-btn",
6669
+ "data-variant": seedMode === "paste" ? "primary" : "ghost",
6670
+ onClick: () => onSeedModeChange?.("paste"),
6671
+ title: `Paste from ${pasteSourceLabel}`,
6672
+ children: "Paste from clipboard"
6673
+ }
6743
6674
  )
6744
6675
  ] })
6745
6676
  ]
@@ -8037,7 +7968,6 @@ function RecordsAdminShellInner(props) {
8037
7968
  filter,
8038
7969
  setFilter,
8039
7970
  ruleFilters,
8040
- setRuleFilters,
8041
7971
  facetBrowseFilter,
8042
7972
  setFacetBrowseFilter,
8043
7973
  productBrowse,
@@ -8051,6 +7981,11 @@ function RecordsAdminShellInner(props) {
8051
7981
  scopeKind: "rule",
8052
7982
  enabled: true
8053
7983
  });
7984
+ const globalScopedList = useRecordList({
7985
+ ctx,
7986
+ scopeKind: "collection",
7987
+ enabled: cardinality === "singleton"
7988
+ });
8054
7989
  const pinnedProduct = useSingleProduct({
8055
7990
  SL,
8056
7991
  collectionId,
@@ -8211,21 +8146,60 @@ function RecordsAdminShellInner(props) {
8211
8146
  enabled: !!editingTargetScope
8212
8147
  });
8213
8148
  const globalSourceRecord = useMemo(
8214
- () => recordList.items.find((it) => !it.scope.productId && !it.scope.facetId && !it.scope.variantId && !it.scope.batchId && !it.scope.proofId && !it.facetRule),
8215
- [recordList.items]
8149
+ () => {
8150
+ const pool = globalScopedList.items.length ? globalScopedList.items : recordList.items;
8151
+ return pool.find((it) => !it.scope.productId && !it.scope.facetId && !it.scope.variantId && !it.scope.batchId && !it.scope.proofId && !it.facetRule);
8152
+ },
8153
+ [globalScopedList.items, recordList.items]
8216
8154
  );
8155
+ const resolvedGlobalSeed = useResolvedRecord({
8156
+ SL,
8157
+ appId,
8158
+ recordType,
8159
+ collectionId,
8160
+ supportedScopes: ["collection"],
8161
+ enabled: cardinality === "singleton" && activeScope === "rule" && ruleWizardStep !== null
8162
+ });
8163
+ const directGlobalSeedQuery = useQuery({
8164
+ queryKey: ["records-admin", "global-seed", collectionId, appId, recordType ?? null],
8165
+ enabled: cardinality === "singleton" && activeScope === "rule" && ruleWizardStep !== null,
8166
+ staleTime: 15e3,
8167
+ queryFn: async () => {
8168
+ const res = await listRecords({ SL, collectionId, appId, recordType }, { limit: 200, offset: 0 });
8169
+ return res.data.find((rec) => !rec.productId && !rec.variantId && !rec.batchId && !rec.proofId && !rec.facetRule) ?? null;
8170
+ }
8171
+ });
8172
+ const directGlobalSeedData = directGlobalSeedQuery.data?.data;
8173
+ const singletonGlobalSeedAvailable = !!(globalSourceRecord?.data ?? directGlobalSeedData ?? ((resolvedGlobalSeed.source === "self" || resolvedGlobalSeed.source === "inherited") && resolvedGlobalSeed.data));
8174
+ const wizardClipboard = useRecordClipboard({
8175
+ appId,
8176
+ recordType: recordType ?? "__default"
8177
+ });
8217
8178
  const ruleWizardInitialData = useMemo(() => {
8218
- if (ruleWizardSeedMode !== "global") return void 0;
8219
- if (!globalSourceRecord?.data) return defaultData?.();
8220
- if (onCopyOverride) {
8221
- return onCopyOverride({ value: globalSourceRecord.data, scope: globalSourceRecord.scope });
8179
+ if (ruleWizardSeedMode === "global") {
8180
+ const globalSeedSource = globalSourceRecord?.data ?? directGlobalSeedData ?? resolvedGlobalSeed.data;
8181
+ if (!globalSeedSource) return defaultData?.();
8182
+ const globalSeedScope = globalSourceRecord?.scope ?? parseRef("");
8183
+ if (onCopyOverride) {
8184
+ return onCopyOverride({ value: globalSeedSource, scope: globalSeedScope });
8185
+ }
8186
+ try {
8187
+ return structuredClone(globalSeedSource);
8188
+ } catch {
8189
+ return JSON.parse(JSON.stringify(globalSeedSource));
8190
+ }
8222
8191
  }
8223
- try {
8224
- return structuredClone(globalSourceRecord.data);
8225
- } catch {
8226
- return JSON.parse(JSON.stringify(globalSourceRecord.data));
8192
+ if (ruleWizardSeedMode === "paste") {
8193
+ const entry = wizardClipboard.entry;
8194
+ if (!entry) return defaultData?.();
8195
+ try {
8196
+ return structuredClone(entry.value);
8197
+ } catch {
8198
+ return JSON.parse(JSON.stringify(entry.value));
8199
+ }
8227
8200
  }
8228
- }, [ruleWizardSeedMode, globalSourceRecord, onCopyOverride, defaultData]);
8201
+ return void 0;
8202
+ }, [ruleWizardSeedMode, globalSourceRecord, directGlobalSeedData, resolvedGlobalSeed.data, onCopyOverride, defaultData, wizardClipboard.entry]);
8229
8203
  const refetchAll = useCallback(async () => {
8230
8204
  await Promise.all([
8231
8205
  recordList.refetch(),
@@ -8718,9 +8692,13 @@ function RecordsAdminShellInner(props) {
8718
8692
  if (!isRuleTab) return void 0;
8719
8693
  if (isCollection) return void 0;
8720
8694
  return (record) => {
8721
- const hash = ruleHash(record.facetRule);
8722
- if (!hash) return null;
8723
- return { key: `rule:${hash}`, label: summariseRule(record.facetRule, ruleLabelLookup) };
8695
+ const rule = record.facetRule;
8696
+ if (!rule || !Array.isArray(rule.all) || rule.all.length === 0) return null;
8697
+ const keys = rule.all.map((c) => c.facetKey).filter((k) => !!k).slice().sort();
8698
+ if (keys.length === 0) return null;
8699
+ const key = `facets:${keys.join("|")}`;
8700
+ const label2 = keys.map((k) => ruleLabelLookup?.facetLabel?.(k) ?? k).join(" \xB7 ");
8701
+ return { key, label: label2 };
8724
8702
  };
8725
8703
  }, [groupBy, isRuleTab, isAllTab, isCollection, ruleLabelLookup]);
8726
8704
  const [bulkRuleEditTarget, setBulkRuleEditTarget] = useState(null);
@@ -8762,6 +8740,7 @@ function RecordsAdminShellInner(props) {
8762
8740
  const renderRuleGroupActions = useCallback(
8763
8741
  (group) => {
8764
8742
  if (!isRuleTab || groupBy) return null;
8743
+ if (!isCollection) return null;
8765
8744
  const ids = group.items.map((it) => it.id).filter((id) => !!id);
8766
8745
  if (ids.length < 2) return null;
8767
8746
  const rule = group.items.find((it) => it.facetRule)?.facetRule ?? null;
@@ -8780,15 +8759,15 @@ function RecordsAdminShellInner(props) {
8780
8759
  }
8781
8760
  );
8782
8761
  },
8783
- [isRuleTab, groupBy]
8762
+ [isRuleTab, groupBy, isCollection]
8784
8763
  );
8785
- const onCreateRule = useCallback(() => {
8764
+ const onCreateRule = useCallback((seed) => {
8786
8765
  void runWithGuard(() => {
8787
8766
  if (activeScope !== "rule") setActiveScope("rule");
8788
8767
  setSelectedRecordId(null);
8789
8768
  setSelectedItemId(null);
8790
8769
  setDraftKind("rule");
8791
- setRuleWizardSeedMode("blank");
8770
+ setRuleWizardSeedMode(seed ?? "blank");
8792
8771
  setRuleWizardDraftKey(null);
8793
8772
  setRuleWizardRule({ all: [] });
8794
8773
  setRuleWizardStep(1);
@@ -8808,10 +8787,13 @@ function RecordsAdminShellInner(props) {
8808
8787
  setRuleWizardStep(2);
8809
8788
  } else {
8810
8789
  setRuleWizardStep(2);
8790
+ if (ruleWizardSeedMode == null) {
8791
+ setRuleWizardSeedMode(singletonGlobalSeedAvailable ? "global" : "blank");
8792
+ }
8811
8793
  setRuleWizardDraftKey(mintRuleWizardDraftKey());
8812
8794
  setSelectedRecordId(DRAFT_ID3);
8813
8795
  }
8814
- }, [cardinality, mintRuleWizardDraftKey]);
8796
+ }, [cardinality, mintRuleWizardDraftKey, ruleWizardSeedMode, singletonGlobalSeedAvailable, setRuleWizardSeedMode]);
8815
8797
  const onRuleWizardBack = useCallback(() => {
8816
8798
  setRuleWizardStep(1);
8817
8799
  setRuleWizardDraftKey(null);
@@ -9257,20 +9239,37 @@ function RecordsAdminShellInner(props) {
9257
9239
  }
9258
9240
  ) }),
9259
9241
  /* @__PURE__ */ jsxs("div", { className: "p-3 space-y-2.5 border-b", style: { borderColor: "hsl(var(--ra-border))" }, children: [
9260
- isRuleTab && /* @__PURE__ */ jsxs(
9261
- "button",
9262
- {
9263
- type: "button",
9264
- onClick: onCreateRule,
9265
- className: "ra-btn w-full",
9266
- "data-variant": "primary",
9267
- "aria-label": "New rule",
9268
- children: [
9269
- /* @__PURE__ */ jsx(Plus, { className: "w-3.5 h-3.5", "aria-hidden": "true" }),
9270
- /* @__PURE__ */ jsx("span", { children: "New rule" })
9271
- ]
9272
- }
9273
- ),
9242
+ isRuleTab && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
9243
+ /* @__PURE__ */ jsxs(
9244
+ "button",
9245
+ {
9246
+ type: "button",
9247
+ onClick: () => onCreateRule(),
9248
+ className: "ra-btn w-full",
9249
+ "data-variant": "primary",
9250
+ "aria-label": "New rule",
9251
+ children: [
9252
+ /* @__PURE__ */ jsx(Plus, { className: "w-3.5 h-3.5", "aria-hidden": "true" }),
9253
+ /* @__PURE__ */ jsx("span", { children: "New rule" })
9254
+ ]
9255
+ }
9256
+ ),
9257
+ wizardClipboard.entry && /* @__PURE__ */ jsxs(
9258
+ "button",
9259
+ {
9260
+ type: "button",
9261
+ onClick: () => onCreateRule("paste"),
9262
+ className: "ra-btn w-full",
9263
+ "data-variant": "ghost",
9264
+ "aria-label": "Paste as new rule",
9265
+ title: wizardClipboard.entry.sourceLabel ? `Paste from ${wizardClipboard.entry.sourceLabel}` : "Paste from clipboard",
9266
+ children: [
9267
+ /* @__PURE__ */ jsx(ClipboardPaste, { className: "w-3.5 h-3.5", "aria-hidden": "true" }),
9268
+ /* @__PURE__ */ jsx("span", { children: "Paste as new rule" })
9269
+ ]
9270
+ }
9271
+ )
9272
+ ] }),
9274
9273
  showCreateGlobal && /* @__PURE__ */ jsxs(
9275
9274
  "button",
9276
9275
  {
@@ -9332,14 +9331,6 @@ function RecordsAdminShellInner(props) {
9332
9331
  }
9333
9332
  );
9334
9333
  })(),
9335
- isRuleTab && /* @__PURE__ */ jsx(
9336
- RuleFilterChips,
9337
- {
9338
- source: recordList.items,
9339
- value: ruleFilters,
9340
- onChange: setRuleFilters
9341
- }
9342
- ),
9343
9334
  isRuleTab && /* @__PURE__ */ jsx(
9344
9335
  FacetBrowseFilter,
9345
9336
  {
@@ -9428,13 +9419,72 @@ function RecordsAdminShellInner(props) {
9428
9419
  onCancel: onCancelRuleWizard,
9429
9420
  onNext: onRuleWizardNext,
9430
9421
  onBack: onRuleWizardBack,
9431
- canChooseSeed: !isCollection && !!globalSourceRecord,
9422
+ canChooseSeed: !isCollection && singletonGlobalSeedAvailable,
9432
9423
  seedMode: ruleWizardSeedMode,
9433
9424
  onSeedModeChange: setRuleWizardSeedMode,
9425
+ pasteSourceLabel: wizardClipboard.entry?.sourceLabel ?? (wizardClipboard.entry ? "clipboard" : void 0),
9434
9426
  facets: ruleWizardFacets,
9435
9427
  itemNoun,
9428
+ seedPromptMode: !isCollection ? "after-next" : "inline",
9436
9429
  children: [
9437
- ruleWizardStep === 2 && !isCollection && editingTargetScope && renderEditorWithPreview(),
9430
+ ruleWizardStep === 2 && !isCollection && /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
9431
+ /* @__PURE__ */ jsxs(
9432
+ "div",
9433
+ {
9434
+ className: "border-b px-5 py-3",
9435
+ style: { borderColor: "hsl(var(--ra-border))", background: "hsl(var(--ra-surface))" },
9436
+ children: [
9437
+ /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
9438
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", style: { color: "hsl(var(--ra-text))" }, children: "Start from" }),
9439
+ /* @__PURE__ */ jsx("div", { className: "text-xs", style: { color: "hsl(var(--ra-muted-text))" }, children: "Choose whether the new rule starts empty, copies the current global record, or pastes from your clipboard." })
9440
+ ] }),
9441
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
9442
+ /* @__PURE__ */ jsx(
9443
+ "button",
9444
+ {
9445
+ type: "button",
9446
+ className: "ra-btn",
9447
+ "data-variant": ruleWizardSeedMode === "blank" || ruleWizardSeedMode == null ? "primary" : "ghost",
9448
+ onClick: () => {
9449
+ setRuleWizardSeedMode("blank");
9450
+ setRuleWizardDraftKey(mintRuleWizardDraftKey());
9451
+ },
9452
+ children: "Start blank"
9453
+ }
9454
+ ),
9455
+ singletonGlobalSeedAvailable && /* @__PURE__ */ jsx(
9456
+ "button",
9457
+ {
9458
+ type: "button",
9459
+ className: "ra-btn",
9460
+ "data-variant": ruleWizardSeedMode === "global" ? "primary" : "ghost",
9461
+ onClick: () => {
9462
+ setRuleWizardSeedMode("global");
9463
+ setRuleWizardDraftKey(mintRuleWizardDraftKey());
9464
+ },
9465
+ children: "Copy from global"
9466
+ }
9467
+ ),
9468
+ wizardClipboard.entry && /* @__PURE__ */ jsx(
9469
+ "button",
9470
+ {
9471
+ type: "button",
9472
+ className: "ra-btn",
9473
+ "data-variant": ruleWizardSeedMode === "paste" ? "primary" : "ghost",
9474
+ onClick: () => {
9475
+ setRuleWizardSeedMode("paste");
9476
+ setRuleWizardDraftKey(mintRuleWizardDraftKey());
9477
+ },
9478
+ title: wizardClipboard.entry.sourceLabel ? `Paste from ${wizardClipboard.entry.sourceLabel}` : "Paste from clipboard",
9479
+ children: "Paste from clipboard"
9480
+ }
9481
+ )
9482
+ ] })
9483
+ ]
9484
+ }
9485
+ ),
9486
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: editingTargetScope && renderEditorWithPreview() })
9487
+ ] }),
9438
9488
  ruleWizardStep === 2 && isCollection && !selectedItemId && /* @__PURE__ */ jsx("div", { className: "h-full flex items-center justify-center px-6 py-10", children: /* @__PURE__ */ jsxs("div", { className: "max-w-sm text-center space-y-3", children: [
9439
9489
  /* @__PURE__ */ jsxs(
9440
9490
  "h3",