@bikdotai/bik-component-library 0.0.839 → 0.0.840-beta.0

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.
Files changed (185) hide show
  1. package/dist/cjs/components/SearchFilter/index.js +1 -1
  2. package/dist/cjs/components/SearchFilter/index.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  4. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +51 -39
  6. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js +1 -1
  8. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js +1 -1
  10. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +2 -2
  12. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
  14. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/DiscardModal.js +1 -1
  16. package/dist/cjs/components/agent-builder/components/DiscardModal.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
  18. package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
  19. package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
  20. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/components/MentionPicker.js +22 -22
  22. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  23. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
  24. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  25. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
  26. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  27. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js +1 -1
  28. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  29. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  30. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  31. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  32. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  33. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +3 -1
  34. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  35. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  36. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  37. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  38. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  39. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +5 -3
  40. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  41. package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
  42. package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
  43. package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
  44. package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
  45. package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
  46. package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
  47. package/dist/cjs/components/agent-listing/AgentTableShimmer.js +2 -0
  48. package/dist/cjs/components/agent-listing/AgentTableShimmer.js.map +1 -0
  49. package/dist/cjs/components/agent-listing/DeleteAgentModal.js +1 -1
  50. package/dist/cjs/components/agent-listing/DeleteAgentModal.js.map +1 -1
  51. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
  52. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  53. package/dist/cjs/components/button/Button.styled.js +1 -0
  54. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  55. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
  56. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  57. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  58. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  59. package/dist/cjs/components/input/Input.js +1 -1
  60. package/dist/cjs/components/input/Input.js.map +1 -1
  61. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  62. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  63. package/dist/cjs/components/radioButton/RadioButton.js +1 -1
  64. package/dist/cjs/components/radioButton/RadioButton.js.map +1 -1
  65. package/dist/cjs/components/radioList/RadioList.js +1 -1
  66. package/dist/cjs/components/radioList/RadioList.js.map +1 -1
  67. package/dist/cjs/components/searchBar/searchBar.js +1 -1
  68. package/dist/cjs/components/searchBar/searchBar.js.map +1 -1
  69. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  70. package/dist/cjs/components/side-modal/SideModal.js.map +1 -1
  71. package/dist/cjs/components/star-rating/Star.js +1 -1
  72. package/dist/cjs/components/star-rating/Star.js.map +1 -1
  73. package/dist/cjs/components/star-rating/StarRating.js +2 -2
  74. package/dist/cjs/components/star-rating/StarRating.js.map +1 -1
  75. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  76. package/dist/cjs/components/template-preview/TemplatePreview.js.map +1 -1
  77. package/dist/cjs/components/thumbnail/Thumbnail.js +1 -1
  78. package/dist/cjs/components/thumbnail/Thumbnail.js.map +1 -1
  79. package/dist/cjs/components/zeroState/ZeroState.js +3 -3
  80. package/dist/cjs/components/zeroState/ZeroState.js.map +1 -1
  81. package/dist/cjs/editor/BikEditor.js +1 -1
  82. package/dist/cjs/editor/BikEditor.js.map +1 -1
  83. package/dist/cjs/editor/BikEditor.styles.js +97 -54
  84. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  85. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js +3 -3
  86. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  87. package/dist/esm/components/SearchFilter/index.js +11 -10
  88. package/dist/esm/components/SearchFilter/index.js.map +1 -1
  89. package/dist/esm/components/agent-builder/AgentBuilder.js +106 -102
  90. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  91. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +3 -6
  92. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +118 -106
  93. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  94. package/dist/esm/components/agent-builder/__fixtures__/agentValue.d.ts +11 -0
  95. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js +29 -21
  96. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  97. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js +27 -26
  98. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  99. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +25 -25
  100. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  101. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +24 -23
  102. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  103. package/dist/esm/components/agent-builder/components/DiscardModal.d.ts +3 -1
  104. package/dist/esm/components/agent-builder/components/DiscardModal.js +33 -24
  105. package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
  106. package/dist/esm/components/agent-builder/components/GoLiveModal.js +23 -21
  107. package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
  108. package/dist/esm/components/agent-builder/components/MentionEditor.js +19 -19
  109. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  110. package/dist/esm/components/agent-builder/components/MentionPicker.js +177 -147
  111. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  112. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +2 -0
  113. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +111 -105
  114. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  115. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +13 -4
  116. package/dist/esm/components/agent-builder/components/SelectableListSection.js +173 -148
  117. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  118. package/dist/esm/components/agent-builder/components/StepSectionHeader.js +7 -7
  119. package/dist/esm/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  120. package/dist/esm/components/agent-builder/constants/tools.js +1 -1
  121. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  122. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +104 -103
  123. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  124. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +101 -102
  125. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  126. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +144 -142
  127. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  128. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +23 -79
  129. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  130. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +35 -23
  131. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  132. package/dist/esm/components/agent-listing/AgentListing.js +70 -65
  133. package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
  134. package/dist/esm/components/agent-listing/AgentTable.d.ts +2 -0
  135. package/dist/esm/components/agent-listing/AgentTable.js +16 -15
  136. package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
  137. package/dist/esm/components/agent-listing/AgentTableRow.js +11 -11
  138. package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
  139. package/dist/esm/components/agent-listing/AgentTableShimmer.d.ts +12 -0
  140. package/dist/esm/components/agent-listing/AgentTableShimmer.js +20 -0
  141. package/dist/esm/components/agent-listing/AgentTableShimmer.js.map +1 -0
  142. package/dist/esm/components/agent-listing/DeleteAgentModal.js +8 -8
  143. package/dist/esm/components/agent-listing/DeleteAgentModal.js.map +1 -1
  144. package/dist/esm/components/agent-listing/__fixtures__/agents.d.ts +3 -0
  145. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +11 -10
  146. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  147. package/dist/esm/components/button/Button.styled.js +25 -19
  148. package/dist/esm/components/button/Button.styled.js.map +1 -1
  149. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +28 -21
  150. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  151. package/dist/esm/components/dropdown/Dropdown.js +18 -13
  152. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  153. package/dist/esm/components/input/Input.js +35 -34
  154. package/dist/esm/components/input/Input.js.map +1 -1
  155. package/dist/esm/components/input/Input.model.d.ts +1 -0
  156. package/dist/esm/components/multi-level-dropdown/MenuItem.js +28 -27
  157. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  158. package/dist/esm/components/radioButton/RadioButton.js +10 -9
  159. package/dist/esm/components/radioButton/RadioButton.js.map +1 -1
  160. package/dist/esm/components/radioList/RadioList.js +28 -19
  161. package/dist/esm/components/radioList/RadioList.js.map +1 -1
  162. package/dist/esm/components/searchBar/searchBar.js +11 -10
  163. package/dist/esm/components/searchBar/searchBar.js.map +1 -1
  164. package/dist/esm/components/side-modal/SideModal.js +13 -5
  165. package/dist/esm/components/side-modal/SideModal.js.map +1 -1
  166. package/dist/esm/components/star-rating/Star.d.ts +1 -0
  167. package/dist/esm/components/star-rating/Star.js +32 -27
  168. package/dist/esm/components/star-rating/Star.js.map +1 -1
  169. package/dist/esm/components/star-rating/StarRating.js +17 -16
  170. package/dist/esm/components/star-rating/StarRating.js.map +1 -1
  171. package/dist/esm/components/template-preview/TemplatePreview.js +41 -40
  172. package/dist/esm/components/template-preview/TemplatePreview.js.map +1 -1
  173. package/dist/esm/components/thumbnail/Thumbnail.js +3 -3
  174. package/dist/esm/components/thumbnail/Thumbnail.js.map +1 -1
  175. package/dist/esm/components/zeroState/ZeroState.js +20 -13
  176. package/dist/esm/components/zeroState/ZeroState.js.map +1 -1
  177. package/dist/esm/editor/BikEditor.js +173 -160
  178. package/dist/esm/editor/BikEditor.js.map +1 -1
  179. package/dist/esm/editor/BikEditor.styles.d.ts +20 -3
  180. package/dist/esm/editor/BikEditor.styles.js +102 -57
  181. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  182. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.d.ts +5 -8
  183. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js +87 -68
  184. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  185. package/package.json +1 -1
@@ -1,82 +1,90 @@
1
- import { jsx as o, jsxs as i, Fragment as j } from "react/jsx-runtime";
2
- import ne from "../../../assets/icons/delete.svg.js";
3
- import te from "../../../assets/icons/edit.svg.js";
4
- import F from "../../../assets/icons/plus.svg.js";
5
- import { useState as v, useRef as K, useEffect as le } from "react";
6
- import E from "styled-components";
7
- import { TitleSmall as re, BodyCaption as U, BodySecondary as C } from "../../TypographyStyle.js";
1
+ import { jsx as o, jsxs as i, Fragment as q } from "react/jsx-runtime";
2
+ import ce from "../../../assets/icons/delete.svg.js";
3
+ import ie from "../../../assets/icons/edit.svg.js";
4
+ import U from "../../../assets/icons/plus.svg.js";
5
+ import { useState as f, useRef as J, useEffect as de } from "react";
6
+ import _ from "styled-components";
7
+ import { TitleSmall as se, BodyCaption as v, BodySecondary as ue } from "../../TypographyStyle.js";
8
8
  import { COLORS as d } from "../../../constants/Theme.js";
9
- import { SideSection as ce, SideSectionHeader as ie, AddIconButton as de, SourceButtonRow as se, SourceButton as V, SelectableRow as ae, RowText as ue, RowActions as he, RowMenuButton as q, RowActionDivider as fe } from "../AgentBuilder.styled.js";
10
- import { renderSourceIcon as A, SOURCE_ICONS as pe } from "../utils/sourceIcons.js";
11
- import { MentionPicker as me } from "./MentionPicker.js";
12
- import { Dropdown as J } from "../../dropdown/Dropdown.js";
13
- import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
14
- import { Button as Se } from "../../button/Button.js";
15
- import { DeleteConfirmationModal as we } from "../../states-modal/DeleteConfirmationModal.js";
16
- const Q = "__bik_create_new__", He = ({
17
- title: u,
18
- helper: _,
19
- items: s,
20
- addableOptions: f,
21
- onAdd: g,
22
- onRemove: R,
23
- dataTestPrefix: t,
24
- emptyText: Y,
25
- createOption: n,
26
- onConfigure: D,
27
- sourceGroups: p,
9
+ import { SideSection as ae, SideSectionHeader as he, AddIconButton as pe, SourceButtonRow as fe, SourceButton as P, SelectableRow as me, RowText as Se, RowActions as ge, RowMenuButton as Q, RowActionDivider as we } from "../AgentBuilder.styled.js";
10
+ import { renderSourceIcon as A, SOURCE_ICONS as ye } from "../utils/sourceIcons.js";
11
+ import { MentionPicker as ve } from "./MentionPicker.js";
12
+ import { Dropdown as X } from "../../dropdown/Dropdown.js";
13
+ import { unwrapDropdownValue as Y } from "../../dropdown/utils.js";
14
+ import { Button as $e } from "../../button/Button.js";
15
+ import { DeleteConfirmationModal as be } from "../../states-modal/DeleteConfirmationModal.js";
16
+ import { Tooltip as E } from "../../tooltips/Tooltip.js";
17
+ const Z = "__bik_create_new__", Ke = ({
18
+ title: s,
19
+ helper: D,
20
+ items: a,
21
+ addableOptions: m,
22
+ onAdd: $,
23
+ onRemove: I,
24
+ dataTestPrefix: l,
25
+ emptyText: T,
26
+ createOption: t,
27
+ onConfigure: R,
28
+ sourceGroups: S,
28
29
  mentionItems: B,
29
- actionSources: m,
30
- confirmDelete: h
30
+ actionSources: g,
31
+ confirmDelete: p,
32
+ pickerOpensUp: L
31
33
  }) => {
32
- const [a, c] = v(!1), [I, $] = v(null), [Z, y] = v(null), S = !!p && p.length > 0, b = p?.find((e) => e.source === Z), l = B !== void 0, L = K(null), z = K(null), [w, x] = v(null);
33
- le(() => {
34
- if (!l || !a)
34
+ const [h, r] = f(!1), [z, b] = f(null), [x, H] = f(null), [O, C] = f(null), w = !!S && S.length > 0, k = S?.find((e) => e.source === O), c = B !== void 0, M = J(null), N = J(null), [y, W] = f(null);
35
+ de(() => {
36
+ if (!c || !h)
35
37
  return;
36
- const e = (k) => {
37
- const W = k.target;
38
- !L.current?.contains(W) && !z.current?.contains(W) && c(!1);
39
- }, r = (k) => {
40
- k.key === "Escape" && c(!1);
38
+ const e = (u) => {
39
+ const V = u.target;
40
+ !M.current?.contains(V) && !N.current?.contains(V) && r(!1);
41
+ }, n = (u) => {
42
+ u.key === "Escape" && r(!1);
41
43
  };
42
- return document.addEventListener("mousedown", e), document.addEventListener("keydown", r), () => {
43
- document.removeEventListener("mousedown", e), document.removeEventListener("keydown", r);
44
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", n), () => {
45
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
44
46
  };
45
- }, [l, a]);
46
- const G = S ? l || s.length > 0 : l || f.length > 0 || !!n && s.length > 0, T = s.length === 0 && !!n && !S && !l, H = !!m && m.length > 0, O = (S || H) && s.length === 0, ee = () => {
47
- if (l) {
48
- x(null), c((e) => !e);
47
+ }, [c, h]);
48
+ const ee = w ? c || a.length > 0 : c || m.length > 0 || !!t && a.length > 0, oe = a.length === 0 && !!t && !w && !c, j = !!g && g.length > 0, ne = (w || j) && a.length === 0, te = () => {
49
+ if (c) {
50
+ W(null), r((e) => !e);
49
51
  return;
50
52
  }
51
- if (S) {
52
- y(null), c((e) => !e);
53
+ if (w) {
54
+ C(null), r((e) => !e);
53
55
  return;
54
56
  }
55
- if (f.length === 0 && n) {
56
- n.onSelect();
57
+ if (m.length === 0 && t) {
58
+ t.onSelect();
57
59
  return;
58
60
  }
59
- c((e) => !e);
60
- }, oe = () => s.map((e) => {
61
- const r = e.onConfigure ?? (D ? () => D(e.id) : void 0);
61
+ r((e) => !e);
62
+ }, le = (e, n) => {
63
+ if (x)
64
+ return;
65
+ const u = n();
66
+ u && typeof u.then == "function" && (H(e), u.finally(() => H(null)));
67
+ }, re = () => a.map((e) => {
68
+ const n = e.onConfigure ?? (R ? () => R(e.id) : void 0);
62
69
  return /* @__PURE__ */ i(
63
- ae,
70
+ me,
64
71
  {
65
- "data-test": `${t}-row-${e.id}`,
72
+ "data-test": `${l}-row-${e.id}`,
66
73
  children: [
67
74
  A(e.icon),
68
- /* @__PURE__ */ o(ue, { children: /* @__PURE__ */ o(C, { numberOfLines: 1, color: d.content.primary, children: e.label }) }),
69
- /* @__PURE__ */ i(he, { children: [
70
- r && // Configurable rows (sub-agents, Rest API / email tools) get an
75
+ /* @__PURE__ */ o(E, { body: e.label, placement: "top", children: /* @__PURE__ */ o(Se, { children: /* @__PURE__ */ o(ue, { numberOfLines: 1, color: d.content.primary, children: e.label }) }) }),
76
+ /* @__PURE__ */ i(ge, { children: [
77
+ n && // Configurable rows (sub-agents, Rest API / email tools) get an
71
78
  // always-visible edit icon.
72
- /* @__PURE__ */ o(
73
- q,
79
+ /* @__PURE__ */ o(E, { body: "Edit", placement: "top", children: /* @__PURE__ */ o(
80
+ Q,
74
81
  {
75
- "data-test": `${t}-edit-${e.id}`,
82
+ "data-test": `${l}-edit-${e.id}`,
76
83
  "aria-label": `Edit ${e.label}`,
77
- onClick: r,
84
+ disabled: x !== null,
85
+ onClick: () => le(e.id, n),
78
86
  children: /* @__PURE__ */ o(
79
- te,
87
+ ie,
80
88
  {
81
89
  width: 16,
82
90
  height: 16,
@@ -84,16 +92,16 @@ const Q = "__bik_create_new__", He = ({
84
92
  }
85
93
  )
86
94
  }
87
- ),
88
- r && /* @__PURE__ */ o(fe, { "aria-hidden": !0 }),
89
- /* @__PURE__ */ o(
90
- q,
95
+ ) }),
96
+ n && /* @__PURE__ */ o(we, { "aria-hidden": !0 }),
97
+ /* @__PURE__ */ o(E, { body: "Delete", placement: "top", children: /* @__PURE__ */ o(
98
+ Q,
91
99
  {
92
- "data-test": `${t}-delete-${e.id}`,
100
+ "data-test": `${l}-delete-${e.id}`,
93
101
  "aria-label": `Delete ${e.label}`,
94
- onClick: () => h ? $(e.id) : R(e.id),
102
+ onClick: () => p ? b(e.id) : I(e.id),
95
103
  children: /* @__PURE__ */ o(
96
- ne,
104
+ ce,
97
105
  {
98
106
  width: 16,
99
107
  height: 16,
@@ -101,18 +109,18 @@ const Q = "__bik_create_new__", He = ({
101
109
  }
102
110
  )
103
111
  }
104
- )
112
+ ) })
105
113
  ] })
106
114
  ]
107
115
  },
108
116
  e.id
109
117
  );
110
- }), M = n ? [
111
- ...f,
118
+ }), F = t ? [
119
+ ...m,
112
120
  {
113
- label: n.label,
114
- value: Q,
115
- searchKey: n.label,
121
+ label: t.label,
122
+ value: Z,
123
+ searchKey: t.label,
116
124
  customComponent: /* @__PURE__ */ o(
117
125
  "div",
118
126
  {
@@ -124,163 +132,180 @@ const Q = "__bik_create_new__", He = ({
124
132
  fontSize: 14,
125
133
  fontWeight: 600
126
134
  },
127
- children: n.label
135
+ children: t.label
128
136
  }
129
137
  )
130
138
  }
131
- ] : f, N = l ? /* @__PURE__ */ o(
132
- me,
139
+ ] : m, K = c ? /* @__PURE__ */ o(
140
+ ve,
133
141
  {
134
142
  items: B ?? [],
135
143
  query: "",
136
144
  activeIndex: 0,
137
- initialSource: w ?? void 0,
145
+ initialSource: y ?? void 0,
138
146
  onSelect: (e) => {
139
- c(!1), g(String(e.id));
147
+ r(!1), $(String(e.id));
140
148
  },
141
- onClose: () => c(!1),
142
- onCreateSubAgent: n ? () => {
143
- c(!1), n.onSelect();
149
+ onClose: () => r(!1),
150
+ onCreateSubAgent: t ? () => {
151
+ r(!1), t.onSelect();
144
152
  } : void 0,
145
- toolActions: H ? m?.map((e) => ({
153
+ toolActions: j ? g?.map((e) => ({
146
154
  ...e,
147
155
  onSelect: () => {
148
- c(!1), e.onSelect();
156
+ r(!1), e.onSelect();
149
157
  }
150
158
  })) : void 0
151
159
  },
152
- w ?? "__root__"
160
+ y ?? "__root__"
153
161
  ) : null;
154
- return /* @__PURE__ */ i(ce, { children: [
155
- /* @__PURE__ */ i(ie, { children: [
156
- /* @__PURE__ */ o(re, { color: d.content.primary, children: u }),
157
- G && /* @__PURE__ */ i(ve, { ref: L, children: [
162
+ return /* @__PURE__ */ i(ae, { children: [
163
+ /* @__PURE__ */ i(he, { children: [
164
+ /* @__PURE__ */ o(se, { color: d.content.primary, children: s }),
165
+ ee && /* @__PURE__ */ i(Ce, { ref: M, children: [
158
166
  /* @__PURE__ */ o(
159
- de,
167
+ pe,
160
168
  {
161
- "data-test": `${t}-add`,
162
- onClick: ee,
163
- "aria-label": `Add ${u}`,
164
- children: /* @__PURE__ */ o(F, { width: 20, height: 20, color: d.content.brand })
169
+ "data-test": `${l}-add`,
170
+ onClick: te,
171
+ "aria-label": `Add ${s}`,
172
+ children: /* @__PURE__ */ o(U, { width: 16, height: 16, color: d.content.primary })
165
173
  }
166
174
  ),
167
- l && a && w === null && /* @__PURE__ */ o(X, { "data-test": `${t}-picker`, children: N })
175
+ c && h && y === null && /* @__PURE__ */ o(
176
+ G,
177
+ {
178
+ $up: L,
179
+ "data-test": `${l}-picker`,
180
+ children: K
181
+ }
182
+ )
168
183
  ] })
169
184
  ] }),
170
- _ && /* @__PURE__ */ o(U, { color: d.content.secondary, children: _ }),
171
- O ? /* @__PURE__ */ i(ge, { ref: l ? z : void 0, children: [
172
- /* @__PURE__ */ i(se, { "data-test": `${t}-sources`, children: [
173
- p?.map((e) => /* @__PURE__ */ i(
174
- V,
185
+ D && /* @__PURE__ */ o(v, { color: d.content.secondary, children: D }),
186
+ ne ? /* @__PURE__ */ i(ke, { ref: c ? N : void 0, children: [
187
+ /* @__PURE__ */ i(fe, { "data-test": `${l}-sources`, children: [
188
+ S?.map((e) => /* @__PURE__ */ i(
189
+ P,
175
190
  {
176
191
  type: "button",
177
- "data-test": `${t}-source-${e.source}`,
192
+ "data-test": `${l}-source-${e.source}`,
178
193
  onClick: () => {
179
- if (l) {
180
- x(e.source), c(!0);
194
+ if (c) {
195
+ W(e.source), r(!0);
181
196
  return;
182
197
  }
183
- y(e.source);
198
+ C(e.source);
184
199
  },
185
200
  children: [
186
- A(pe[e.source], -4),
187
- /* @__PURE__ */ o(C, { color: d.content.primary, children: e.label })
201
+ A(ye[e.source], -4),
202
+ /* @__PURE__ */ o(v, { color: d.content.primary, children: e.label })
188
203
  ]
189
204
  },
190
205
  e.source
191
206
  )),
192
- m?.map((e) => /* @__PURE__ */ i(
193
- V,
207
+ g?.map((e) => /* @__PURE__ */ i(
208
+ P,
194
209
  {
195
210
  type: "button",
196
- "data-test": `${t}-action-${e.source}`,
197
- onClick: e.onSelect,
211
+ "data-test": `${l}-action-${e.source}`,
212
+ onClick: () => {
213
+ r(!1), e.onSelect();
214
+ },
198
215
  children: [
199
216
  A(e.icon, -4),
200
- /* @__PURE__ */ o(C, { color: d.content.primary, children: e.label })
217
+ /* @__PURE__ */ o(v, { color: d.content.primary, children: e.label })
201
218
  ]
202
219
  },
203
220
  e.source
204
221
  ))
205
222
  ] }),
206
- l && a && w !== null && /* @__PURE__ */ o(X, { $align: "left", "data-test": `${t}-picker`, children: N }),
207
- !l && b && /* @__PURE__ */ o(
208
- J,
223
+ c && h && y !== null && /* @__PURE__ */ o(
224
+ G,
225
+ {
226
+ $align: "left",
227
+ $up: L,
228
+ "data-test": `${l}-picker`,
229
+ children: K
230
+ }
231
+ ),
232
+ !c && k && /* @__PURE__ */ o(
233
+ X,
209
234
  {
210
- "data-test": `${t}-dropdown`,
235
+ "data-test": `${l}-dropdown`,
211
236
  size: "small",
212
237
  width: "100%",
213
238
  isSearchable: !0,
214
- placeHolder: `Search ${b.label} tools`,
215
- options: b.options,
239
+ placeHolder: `Search ${k.label} tools`,
240
+ options: k.options,
216
241
  onSelect: (e) => {
217
- const r = P(e);
218
- y(null), c(!1), r && g(r);
242
+ const n = Y(e);
243
+ C(null), r(!1), n && $(n);
219
244
  }
220
245
  }
221
246
  )
222
- ] }) : /* @__PURE__ */ i(j, { children: [
223
- !l && a && M.length > 0 && /* @__PURE__ */ o(
224
- J,
247
+ ] }) : /* @__PURE__ */ i(q, { children: [
248
+ !c && h && F.length > 0 && /* @__PURE__ */ o(
249
+ X,
225
250
  {
226
- "data-test": `${t}-dropdown`,
251
+ "data-test": `${l}-dropdown`,
227
252
  size: "small",
228
253
  width: "100%",
229
254
  isSearchable: !0,
230
- placeHolder: `Select ${u.toLowerCase()}`,
231
- options: M,
255
+ placeHolder: `Select ${s.toLowerCase()}`,
256
+ options: F,
232
257
  onSelect: (e) => {
233
- const r = P(e);
234
- c(!1), r && (r === Q ? n?.onSelect() : g(r));
258
+ const n = Y(e);
259
+ r(!1), n && (n === Z ? t?.onSelect() : $(n));
235
260
  }
236
261
  }
237
262
  ),
238
- s.length === 0 && !a ? /* @__PURE__ */ i(j, { children: [
239
- /* @__PURE__ */ o(U, { color: d.content.placeholder, children: Y }),
240
- T && n && /* @__PURE__ */ o(
241
- Se,
263
+ a.length === 0 && !h ? /* @__PURE__ */ i(q, { children: [
264
+ /* @__PURE__ */ o(v, { color: d.content.placeholder, children: T }),
265
+ oe && t && /* @__PURE__ */ o(
266
+ $e,
242
267
  {
243
- "data-test": `${t}-create`,
268
+ "data-test": `${l}-create`,
244
269
  buttonType: "secondary",
245
270
  size: "small",
246
271
  matchParentWidth: !0,
247
- LeadingIcon: F,
248
- buttonText: n.label,
249
- onClick: n.onSelect
272
+ LeadingIcon: U,
273
+ buttonText: t.label,
274
+ onClick: t.onSelect
250
275
  }
251
276
  )
252
- ] }) : oe()
277
+ ] }) : re()
253
278
  ] }),
254
- h && I && /* @__PURE__ */ o(
255
- we,
279
+ p && z && /* @__PURE__ */ o(
280
+ be,
256
281
  {
257
- "data-test": `${t}-delete-confirm`,
258
- header: `Delete this ${h.noun}?`,
259
- subHeader: `Deleting this ${h.noun} will also remove it from your instructions, wherever it's referenced.`,
282
+ "data-test": `${l}-delete-confirm`,
283
+ header: `Delete this ${p.noun}?`,
284
+ subHeader: `Deleting this ${p.noun} will also remove it from your instructions, wherever it's referenced.`,
260
285
  confirmationText: "Delete",
261
- zIndex: h.zIndex,
286
+ zIndex: p.zIndex,
262
287
  onDeleteConfirmed: () => {
263
- R(I), $(null);
288
+ I(z), b(null);
264
289
  },
265
- onCancelClicked: () => $(null)
290
+ onCancelClicked: () => b(null)
266
291
  }
267
292
  )
268
293
  ] });
269
- }, ve = E.div`
294
+ }, Ce = _.div`
270
295
  position: relative;
271
296
  display: flex;
272
- `, ge = E.div`
297
+ `, ke = _.div`
273
298
  position: relative;
274
299
  display: flex;
275
300
  flex-direction: column;
276
301
  gap: 8px;
277
- `, X = E.div`
302
+ `, G = _.div`
278
303
  position: absolute;
279
- top: calc(100% + 4px);
280
- ${(u) => u.$align === "left" ? "left: 0;" : "right: 0;"}
304
+ ${(s) => s.$up ? "bottom: calc(100% + 4px);" : "top: calc(100% + 4px);"}
305
+ ${(s) => s.$align === "left" ? "left: 0;" : "right: 0;"}
281
306
  z-index: 30;
282
307
  `;
283
308
  export {
284
- He as SelectableListSection
309
+ Ke as SelectableListSection
285
310
  };
286
311
  //# sourceMappingURL=SelectableListSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectableListSection.js","sources":["../../../../../src/components/agent-builder/components/SelectableListSection.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { MentionItem } from '@src/editor';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { DeleteConfirmationModal } from '@src/components/states-modal';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAddIconButton,\n\tRowActionDivider,\n\tRowActions,\n\tRowMenuButton,\n\tRowText,\n\tSelectableRow,\n\tSideSection,\n\tSideSectionHeader,\n\tSourceButton,\n\tSourceButtonRow,\n} from '../AgentBuilder.styled';\nimport { ToolAction } from '../constants/tools';\nimport {\n\trenderSourceIcon,\n\tSOURCE_ICONS,\n\tSourceIcon,\n} from '../utils/sourceIcons';\nimport { MentionPicker } from './MentionPicker';\n\nexport interface SelectableItem {\n\tid: string;\n\tlabel: string;\n\t/** Leading brand glyph (e.g. a tool's source icon). */\n\ticon?: SourceIcon;\n\t/**\n\t * When set, this row shows an edit (Configure) icon that calls this instead of\n\t * the section-level `onConfigure`. Use for rows that open their own drawer\n\t * (e.g. a configured Rest API / email-handover tool).\n\t */\n\tonConfigure?: () => void;\n}\n\n/** A tool source for the empty-state picker (Tools): a button → its searchable list. */\nexport interface SourceGroup {\n\tsource: string;\n\tlabel: string;\n\toptions: SingleOption[];\n}\n\n/** Sentinel value for the \"create new\" entry in the add dropdown. */\nconst CREATE_OPTION_VALUE = '__bik_create_new__';\n\ninterface SelectableListSectionProps {\n\ttitle: string;\n\thelper?: string;\n\titems: SelectableItem[];\n\t/**\n\t * Options shown in the add dropdown. Pass ALL items (not just unselected\n\t * ones) when re-picking an already-added item is allowed (e.g. to insert its\n\t * mention again) — the chip list still shows each item only once.\n\t */\n\taddableOptions: SingleOption[];\n\tonAdd: (id: string) => void;\n\tonRemove: (id: string) => void;\n\tdataTestPrefix: string;\n\temptyText: string;\n\t/**\n\t * Adds a \"create new\" entry at the top of the add dropdown (e.g. \"Create\n\t * sub-agent\"). Selecting it calls `onSelect` instead of `onAdd`.\n\t */\n\tcreateOption?: { label: string; onSelect: () => void };\n\t/**\n\t * When provided, each row shows an edit (Configure) icon next to Delete.\n\t * Omit for tools (Delete only).\n\t */\n\tonConfigure?: (id: string) => void;\n\t/**\n\t * Tool sources (e.g. Manifest / Shopify). When set, the empty state shows a\n\t * button per source; clicking one reveals a searchable dropdown of just that\n\t * source's options. Selecting calls `onAdd`. Takes precedence over the plain\n\t * `addableOptions` dropdown.\n\t */\n\tsourceGroups?: SourceGroup[];\n\t/**\n\t * When provided, the header \"+\" opens the same `@` reference picker used in the\n\t * Instructions editor (a {@link MentionPicker} popover) instead of the inline\n\t * select dropdown. Pass the items for THIS section only (tools OR sub-agents) —\n\t * the picker auto-drills into the single category. Selecting a row calls\n\t * `onAdd(id)`; the picker's \"Create new\" row (sub-agents) calls\n\t * `createOption.onSelect`.\n\t */\n\tmentionItems?: MentionItem[];\n\t/**\n\t * Built-in \"action\" tools (e.g. Rest API / Handover to email) that open a\n\t * config drawer via `onSelect` instead of adding a mention. Shown as\n\t * empty-state source buttons (only while no items exist, alongside\n\t * `sourceGroups`) AND as rows inside the `@` picker's Tools view.\n\t */\n\tactionSources?: ToolAction[];\n\t/**\n\t * When set, the row Delete icon opens a confirmation modal (instead of\n\t * removing immediately); `onRemove` runs only on confirm. `noun` fills the one\n\t * shared message template (\"Delete this <noun>?\" …); `zIndex` raises the modal\n\t * above a parent drawer. Omit to delete directly.\n\t */\n\tconfirmDelete?: { noun: string; zIndex?: number };\n}\n\nexport const SelectableListSection: React.FC<SelectableListSectionProps> = ({\n\ttitle,\n\thelper,\n\titems,\n\taddableOptions,\n\tonAdd,\n\tonRemove,\n\tdataTestPrefix,\n\temptyText,\n\tcreateOption,\n\tonConfigure,\n\tsourceGroups,\n\tmentionItems,\n\tactionSources,\n\tconfirmDelete,\n}) => {\n\tconst [adding, setAdding] = useState(false);\n\t// Row id awaiting delete confirmation (null = modal closed).\n\tconst [pendingDeleteId, setPendingDeleteId] = useState<string | null>(null);\n\t// Tools: which source's searchable list is open (null = just show the buttons).\n\tconst [activeSource, setActiveSource] = useState<string | null>(null);\n\tconst hasSourceGroups = !!sourceGroups && sourceGroups.length > 0;\n\tconst activeGroup = sourceGroups?.find((g) => g.source === activeSource);\n\t// When set, \"+\" opens the `@` MentionPicker popover instead of a select input.\n\tconst usePicker = mentionItems !== undefined;\n\t// Separate anchors for the header \"+\" popover and the empty-state source-button\n\t// popover — when empty both render at once, so a shared ref would misfire the\n\t// outside-click check (closing the header picker when a source row is clicked).\n\tconst headerPickerRef = useRef<HTMLDivElement>(null);\n\tconst sourcePickerRef = useRef<HTMLDivElement>(null);\n\t// Source (Shopify / Manifest) the empty-state button opened the picker into;\n\t// null when \"+\" opened it at the root source list.\n\tconst [pickerSource, setPickerSource] = useState<string | null>(null);\n\n\t// Dismiss the picker popover on outside click / Escape.\n\tuseEffect(() => {\n\t\tif (!usePicker || !adding) {\n\t\t\treturn;\n\t\t}\n\t\tconst onDocMouseDown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as Node;\n\t\t\tif (\n\t\t\t\t!headerPickerRef.current?.contains(target) &&\n\t\t\t\t!sourcePickerRef.current?.contains(target)\n\t\t\t) {\n\t\t\t\tsetAdding(false);\n\t\t\t}\n\t\t};\n\t\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\t\tif (e.key === 'Escape') {\n\t\t\t\tsetAdding(false);\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener('mousedown', onDocMouseDown);\n\t\tdocument.addEventListener('keydown', onKeyDown);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', onDocMouseDown);\n\t\t\tdocument.removeEventListener('keydown', onKeyDown);\n\t\t};\n\t}, [usePicker, adding]);\n\n\t// Header \"+\" picks an EXISTING item (and, once some exist, re-creates via the\n\t// dropdown's footer row). With an empty list + a createOption the body shows a\n\t// dedicated \"Create new\" button instead, so the header \"+\" would be redundant.\n\t// In picker mode the \"+\" always shows (even empty) — for tools it sits next to\n\t// the empty-state source buttons; the create flow lives inside the picker.\n\tconst showAddButton = hasSourceGroups\n\t\t? usePicker || items.length > 0\n\t\t: usePicker ||\n\t\t addableOptions.length > 0 ||\n\t\t (!!createOption && items.length > 0);\n\t// Empty state offers a one-click \"Create new\" (sub-agents) rather than burying\n\t// it behind a single-item dropdown. In picker mode the \"+\" opens the picker\n\t// (with its own \"Create new\" row) instead, so skip the standalone button.\n\tconst showEmptyCreate =\n\t\titems.length === 0 && !!createOption && !hasSourceGroups && !usePicker;\n\tconst hasActionSources = !!actionSources && actionSources.length > 0;\n\t// Source buttons ONLY while no item is added — the tool sources (Manifest /\n\t// Shopify …) plus the built-in action tools (Rest API / Handover to email).\n\t// Once an item exists, adding more uses the header \"+\" → picker (the buttons\n\t// never come back); the action tools still live inside that picker.\n\tconst showSourceButtons =\n\t\t(hasSourceGroups || hasActionSources) && items.length === 0;\n\t// Nothing existing to pick → skip the 1-item dropdown and create directly.\n\tconst handleAddClick = () => {\n\t\tif (usePicker) {\n\t\t\t// Toggle the `@` reference-picker popover (rendered under the \"+\"), opened\n\t\t\t// at the root source list (no pre-drilled source).\n\t\t\tsetPickerSource(null);\n\t\t\tsetAdding((v) => !v);\n\t\t\treturn;\n\t\t}\n\t\tif (hasSourceGroups) {\n\t\t\tsetActiveSource(null);\n\t\t\tsetAdding((v) => !v);\n\t\t\treturn;\n\t\t}\n\t\tif (addableOptions.length === 0 && createOption) {\n\t\t\tcreateOption.onSelect();\n\t\t\treturn;\n\t\t}\n\t\tsetAdding((v) => !v);\n\t};\n\n\tconst renderChipRows = () =>\n\t\titems.map((item) => {\n\t\t\t// Per-item configure wins; otherwise fall back to the section-level one.\n\t\t\tconst configure =\n\t\t\t\titem.onConfigure ??\n\t\t\t\t(onConfigure ? () => onConfigure(item.id) : undefined);\n\t\t\treturn (\n\t\t\t\t<SelectableRow\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tdata-test={`${dataTestPrefix}-row-${item.id}`}\n\t\t\t\t>\n\t\t\t\t\t{renderSourceIcon(item.icon)}\n\t\t\t\t\t<RowText>\n\t\t\t\t\t\t<BodySecondary numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t</RowText>\n\t\t\t\t\t<RowActions>\n\t\t\t\t\t\t{configure && (\n\t\t\t\t\t\t\t// Configurable rows (sub-agents, Rest API / email tools) get an\n\t\t\t\t\t\t\t// always-visible edit icon.\n\t\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-edit-${item.id}`}\n\t\t\t\t\t\t\t\taria-label={`Edit ${item.label}`}\n\t\t\t\t\t\t\t\tonClick={configure}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EditIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{configure && <RowActionDivider aria-hidden />}\n\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-${item.id}`}\n\t\t\t\t\t\t\taria-label={`Delete ${item.label}`}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\tconfirmDelete ? setPendingDeleteId(item.id) : onRemove(item.id)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t</RowActions>\n\t\t\t\t</SelectableRow>\n\t\t\t);\n\t\t});\n\t// \"Create new\" is a brand-coloured footer row at the BOTTOM of the dropdown,\n\t// separated from the selectable items by a divider.\n\tconst dropdownOptions: SingleOption[] = createOption\n\t\t? [\n\t\t\t\t...addableOptions,\n\t\t\t\t{\n\t\t\t\t\tlabel: createOption.label,\n\t\t\t\t\tvalue: CREATE_OPTION_VALUE,\n\t\t\t\t\tsearchKey: createOption.label,\n\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\tcolor: COLORS.content.brand,\n\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{createOption.label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t ]\n\t\t: addableOptions;\n\n\t// One picker instance reused by the header \"+\" and the empty-state source\n\t// buttons. `key` remounts it so a source button re-drills into its own tools\n\t// (the initial drill-in level is read once, on mount).\n\tconst pickerNode = usePicker ? (\n\t\t<MentionPicker\n\t\t\tkey={pickerSource ?? '__root__'}\n\t\t\titems={mentionItems ?? []}\n\t\t\tquery=\"\"\n\t\t\tactiveIndex={0}\n\t\t\tinitialSource={pickerSource ?? undefined}\n\t\t\tonSelect={(item) => {\n\t\t\t\tsetAdding(false);\n\t\t\t\tonAdd(String(item.id));\n\t\t\t}}\n\t\t\tonClose={() => setAdding(false)}\n\t\t\tonCreateSubAgent={\n\t\t\t\tcreateOption\n\t\t\t\t\t? () => {\n\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\tcreateOption.onSelect();\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\ttoolActions={\n\t\t\t\thasActionSources\n\t\t\t\t\t? actionSources?.map((a) => ({\n\t\t\t\t\t\t\t...a,\n\t\t\t\t\t\t\tonSelect: () => {\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\ta.onSelect();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }))\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t) : null;\n\n\treturn (\n\t\t<SideSection>\n\t\t\t<SideSectionHeader>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>{title}</TitleSmall>\n\t\t\t\t{showAddButton && (\n\t\t\t\t\t<AddButtonWrap ref={headerPickerRef}>\n\t\t\t\t\t\t<AddIconButton\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-add`}\n\t\t\t\t\t\t\tonClick={handleAddClick}\n\t\t\t\t\t\t\taria-label={`Add ${title}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PlusIcon width={20} height={20} color={COLORS.content.brand} />\n\t\t\t\t\t\t</AddIconButton>\n\t\t\t\t\t\t{usePicker && adding && pickerSource === null && (\n\t\t\t\t\t\t\t<PickerPopover data-test={`${dataTestPrefix}-picker`}>\n\t\t\t\t\t\t\t\t{pickerNode}\n\t\t\t\t\t\t\t</PickerPopover>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</AddButtonWrap>\n\t\t\t\t)}\n\t\t\t</SideSectionHeader>\n\n\t\t\t{helper && (\n\t\t\t\t<BodyCaption color={COLORS.content.secondary}>{helper}</BodyCaption>\n\t\t\t)}\n\n\t\t\t{showSourceButtons ? (\n\t\t\t\t<SourcePickerAnchor ref={usePicker ? sourcePickerRef : undefined}>\n\t\t\t\t\t{/* No tools yet: one button per source (never shown once a tool exists). */}\n\t\t\t\t\t<SourceButtonRow data-test={`${dataTestPrefix}-sources`}>\n\t\t\t\t\t\t{sourceGroups?.map((g) => (\n\t\t\t\t\t\t\t<SourceButton\n\t\t\t\t\t\t\t\tkey={g.source}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-source-${g.source}`}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tif (usePicker) {\n\t\t\t\t\t\t\t\t\t\t// Open the `@` picker drilled straight into this source's tools.\n\t\t\t\t\t\t\t\t\t\tsetPickerSource(g.source);\n\t\t\t\t\t\t\t\t\t\tsetAdding(true);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tsetActiveSource(g.source);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderSourceIcon(SOURCE_ICONS[g.source], -4)}\n\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{g.label}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t</SourceButton>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{/* Built-in action tools (Rest API / Handover to email) open a drawer. */}\n\t\t\t\t\t\t{actionSources?.map((a) => (\n\t\t\t\t\t\t\t<SourceButton\n\t\t\t\t\t\t\t\tkey={a.source}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-action-${a.source}`}\n\t\t\t\t\t\t\t\tonClick={a.onSelect}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderSourceIcon(a.icon, -4)}\n\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{a.label}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t</SourceButton>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</SourceButtonRow>\n\n\t\t\t\t\t{/* Picker mode: clicking a source opens its tools in the `@` picker. */}\n\t\t\t\t\t{usePicker && adding && pickerSource !== null && (\n\t\t\t\t\t\t<PickerPopover $align=\"left\" data-test={`${dataTestPrefix}-picker`}>\n\t\t\t\t\t\t\t{pickerNode}\n\t\t\t\t\t\t</PickerPopover>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Legacy (non-picker) mode: chosen source → its searchable tool list. */}\n\t\t\t\t\t{!usePicker && activeGroup && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Search ${activeGroup.label} tools`}\n\t\t\t\t\t\t\toptions={activeGroup.options}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\tsetActiveSource(null);\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</SourcePickerAnchor>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{!usePicker && adding && dropdownOptions.length > 0 && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Select ${title.toLowerCase()}`}\n\t\t\t\t\t\t\toptions={dropdownOptions}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (!v) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v === CREATE_OPTION_VALUE) {\n\t\t\t\t\t\t\t\t\tcreateOption?.onSelect();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{items.length === 0 && !adding ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t\t{emptyText}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{showEmptyCreate && createOption && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-create`}\n\t\t\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\tbuttonText={createOption.label}\n\t\t\t\t\t\t\t\t\tonClick={createOption.onSelect}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\trenderChipRows()\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{confirmDelete && pendingDeleteId && (\n\t\t\t\t<DeleteConfirmationModal\n\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-confirm`}\n\t\t\t\t\theader={`Delete this ${confirmDelete.noun}?`}\n\t\t\t\t\tsubHeader={`Deleting this ${confirmDelete.noun} will also remove it from your instructions, wherever it's referenced.`}\n\t\t\t\t\tconfirmationText=\"Delete\"\n\t\t\t\t\tzIndex={confirmDelete.zIndex}\n\t\t\t\t\tonDeleteConfirmed={() => {\n\t\t\t\t\t\tonRemove(pendingDeleteId);\n\t\t\t\t\t\tsetPendingDeleteId(null);\n\t\t\t\t\t}}\n\t\t\t\t\tonCancelClicked={() => setPendingDeleteId(null)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</SideSection>\n\t);\n};\n\n// Anchors the `@`-picker popover to the header \"+\" button.\nconst AddButtonWrap = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n`;\n\n// Anchors the `@`-picker popover to the empty-state source buttons.\nconst SourcePickerAnchor = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\n// Floating card under the trigger. Aligns to the \"+\" (right) or the source\n// buttons (left) so it stays inside the side panel.\nconst PickerPopover = styled.div<{ $align?: 'left' | 'right' }>`\n\tposition: absolute;\n\ttop: calc(100% + 4px);\n\t${(p) => (p.$align === 'left' ? 'left: 0;' : 'right: 0;')}\n\tz-index: 30;\n`;\n"],"names":["CREATE_OPTION_VALUE","SelectableListSection","title","helper","items","addableOptions","onAdd","onRemove","dataTestPrefix","emptyText","createOption","onConfigure","sourceGroups","mentionItems","actionSources","confirmDelete","adding","setAdding","useState","pendingDeleteId","setPendingDeleteId","activeSource","setActiveSource","hasSourceGroups","activeGroup","g","usePicker","headerPickerRef","useRef","sourcePickerRef","pickerSource","setPickerSource","useEffect","onDocMouseDown","e","target","onKeyDown","showAddButton","showEmptyCreate","hasActionSources","showSourceButtons","handleAddClick","v","renderChipRows","item","configure","jsxs","SelectableRow","renderSourceIcon","jsx","RowText","BodySecondary","COLORS","RowActions","RowMenuButton","EditIcon","RowActionDivider","DeleteIcon","dropdownOptions","pickerNode","MentionPicker","a","SideSection","SideSectionHeader","TitleSmall","AddButtonWrap","AddIconButton","PlusIcon","PickerPopover","BodyCaption","SourcePickerAnchor","SourceButtonRow","SourceButton","SOURCE_ICONS","Dropdown","opt","unwrapDropdownValue","Fragment","Button","DeleteConfirmationModal","styled","p"],"mappings":";;;;;;;;;;;;;;;AAyDA,MAAMA,IAAsB,sBA0DfC,KAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,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iBI,KACjB,gBAAA8B;AAAA,MAAC8B;AAAA,MAAA;AAAA,QACA,aAAW,GAAGvE,CAAc;AAAA,QAC5B,QAAQ,eAAeO,EAAc,IAAI;AAAA,QACzC,WAAW,iBAAiBA,EAAc,IAAI;AAAA,QAC9C,kBAAiB;AAAA,QACjB,QAAQA,EAAc;AAAA,QACtB,mBAAmB,MAAM;AACxB,UAAAR,EAASY,CAAe,GACxBC,EAAmB,IAAI;AAAA,QACxB;AAAA,QACA,iBAAiB,MAAMA,EAAmB,IAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAC/C,GAEF;AAEF,GAGM6C,KAAgBe,EAAO;AAAA;AAAA;AAAA,GAMvBV,KAAqBU,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAS5BZ,IAAgBY,EAAO;AAAA;AAAA;AAAA,GAG1B,CAACC,MAAOA,EAAE,WAAW,SAAS,aAAa,WAAY;AAAA;AAAA;"}
1
+ {"version":3,"file":"SelectableListSection.js","sources":["../../../../../src/components/agent-builder/components/SelectableListSection.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { MentionItem } from '@src/editor';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { DeleteConfirmationModal } from '@src/components/states-modal';\nimport { Tooltip } from '@src/components/tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAddIconButton,\n\tRowActionDivider,\n\tRowActions,\n\tRowMenuButton,\n\tRowText,\n\tSelectableRow,\n\tSideSection,\n\tSideSectionHeader,\n\tSourceButton,\n\tSourceButtonRow,\n} from '../AgentBuilder.styled';\nimport { ToolAction } from '../constants/tools';\nimport {\n\trenderSourceIcon,\n\tSOURCE_ICONS,\n\tSourceIcon,\n} from '../utils/sourceIcons';\nimport { MentionPicker } from './MentionPicker';\n\nexport interface SelectableItem {\n\tid: string;\n\tlabel: string;\n\t/** Leading brand glyph (e.g. a tool's source icon). */\n\ticon?: SourceIcon;\n\t/**\n\t * When set, this row shows an edit (Configure) icon that calls this instead of\n\t * the section-level `onConfigure`. Use for rows that open their own drawer\n\t * (e.g. a configured Rest API / email-handover tool). A pending promise\n\t * disables the row's edit button until it settles (e.g. while the consumer\n\t * fetches the sub-agent's data before opening its drawer).\n\t */\n\tonConfigure?: () => void | Promise<void>;\n}\n\n/** A tool source for the empty-state picker (Tools): a button → its searchable list. */\nexport interface SourceGroup {\n\tsource: string;\n\tlabel: string;\n\toptions: SingleOption[];\n}\n\n/** Sentinel value for the \"create new\" entry in the add dropdown. */\nconst CREATE_OPTION_VALUE = '__bik_create_new__';\n\ninterface SelectableListSectionProps {\n\ttitle: string;\n\thelper?: string;\n\titems: SelectableItem[];\n\t/**\n\t * Options shown in the add dropdown. Pass ALL items (not just unselected\n\t * ones) when re-picking an already-added item is allowed (e.g. to insert its\n\t * mention again) — the chip list still shows each item only once.\n\t */\n\taddableOptions: SingleOption[];\n\tonAdd: (id: string) => void;\n\tonRemove: (id: string) => void;\n\tdataTestPrefix: string;\n\temptyText: string;\n\t/**\n\t * Adds a \"create new\" entry at the top of the add dropdown (e.g. \"Create\n\t * sub-agent\"). Selecting it calls `onSelect` instead of `onAdd`.\n\t */\n\tcreateOption?: { label: string; onSelect: () => void };\n\t/**\n\t * When provided, each row shows an edit (Configure) icon next to Delete.\n\t * Omit for tools (Delete only). A pending promise disables the edit buttons\n\t * until it settles.\n\t */\n\tonConfigure?: (id: string) => void | Promise<void>;\n\t/**\n\t * Tool sources (e.g. Manifest / Shopify). When set, the empty state shows a\n\t * button per source; clicking one reveals a searchable dropdown of just that\n\t * source's options. Selecting calls `onAdd`. Takes precedence over the plain\n\t * `addableOptions` dropdown.\n\t */\n\tsourceGroups?: SourceGroup[];\n\t/**\n\t * When provided, the header \"+\" opens the same `@` reference picker used in the\n\t * Instructions editor (a {@link MentionPicker} popover) instead of the inline\n\t * select dropdown. Pass the items for THIS section only (tools OR sub-agents) —\n\t * the picker auto-drills into the single category. Selecting a row calls\n\t * `onAdd(id)`; the picker's \"Create new\" row (sub-agents) calls\n\t * `createOption.onSelect`.\n\t */\n\tmentionItems?: MentionItem[];\n\t/**\n\t * Built-in \"action\" tools (e.g. Rest API / Handover to email) that open a\n\t * config drawer via `onSelect` instead of adding a mention. Shown as\n\t * empty-state source buttons (only while no items exist, alongside\n\t * `sourceGroups`) AND as rows inside the `@` picker's Tools view.\n\t */\n\tactionSources?: ToolAction[];\n\t/**\n\t * When set, the row Delete icon opens a confirmation modal (instead of\n\t * removing immediately); `onRemove` runs only on confirm. `noun` fills the one\n\t * shared message template (\"Delete this <noun>?\" …); `zIndex` raises the modal\n\t * above a parent drawer. Omit to delete directly.\n\t */\n\tconfirmDelete?: { noun: string; zIndex?: number };\n\t/**\n\t * Open the `@` picker popover above the trigger instead of below. Use inside\n\t * a drawer where the section sits near the bottom — opening downward\n\t * stretches the drawer and leaves a gap.\n\t */\n\tpickerOpensUp?: boolean;\n}\n\nexport const SelectableListSection: React.FC<SelectableListSectionProps> = ({\n\ttitle,\n\thelper,\n\titems,\n\taddableOptions,\n\tonAdd,\n\tonRemove,\n\tdataTestPrefix,\n\temptyText,\n\tcreateOption,\n\tonConfigure,\n\tsourceGroups,\n\tmentionItems,\n\tactionSources,\n\tconfirmDelete,\n\tpickerOpensUp,\n}) => {\n\tconst [adding, setAdding] = useState(false);\n\t// Row id awaiting delete confirmation (null = modal closed).\n\tconst [pendingDeleteId, setPendingDeleteId] = useState<string | null>(null);\n\t// Row id whose configure handler is in flight (async fetch before its drawer\n\t// opens) — all edit buttons are disabled meanwhile so the UI isn't\n\t// unresponsive to double clicks.\n\tconst [configuringId, setConfiguringId] = useState<string | null>(null);\n\t// Tools: which source's searchable list is open (null = just show the buttons).\n\tconst [activeSource, setActiveSource] = useState<string | null>(null);\n\tconst hasSourceGroups = !!sourceGroups && sourceGroups.length > 0;\n\tconst activeGroup = sourceGroups?.find((g) => g.source === activeSource);\n\t// When set, \"+\" opens the `@` MentionPicker popover instead of a select input.\n\tconst usePicker = mentionItems !== undefined;\n\t// Separate anchors for the header \"+\" popover and the empty-state source-button\n\t// popover — when empty both render at once, so a shared ref would misfire the\n\t// outside-click check (closing the header picker when a source row is clicked).\n\tconst headerPickerRef = useRef<HTMLDivElement>(null);\n\tconst sourcePickerRef = useRef<HTMLDivElement>(null);\n\t// Source (Shopify / Manifest) the empty-state button opened the picker into;\n\t// null when \"+\" opened it at the root source list.\n\tconst [pickerSource, setPickerSource] = useState<string | null>(null);\n\n\t// Dismiss the picker popover on outside click / Escape.\n\tuseEffect(() => {\n\t\tif (!usePicker || !adding) {\n\t\t\treturn;\n\t\t}\n\t\tconst onDocMouseDown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as Node;\n\t\t\tif (\n\t\t\t\t!headerPickerRef.current?.contains(target) &&\n\t\t\t\t!sourcePickerRef.current?.contains(target)\n\t\t\t) {\n\t\t\t\tsetAdding(false);\n\t\t\t}\n\t\t};\n\t\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\t\tif (e.key === 'Escape') {\n\t\t\t\tsetAdding(false);\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener('mousedown', onDocMouseDown);\n\t\tdocument.addEventListener('keydown', onKeyDown);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', onDocMouseDown);\n\t\t\tdocument.removeEventListener('keydown', onKeyDown);\n\t\t};\n\t}, [usePicker, adding]);\n\n\t// Header \"+\" picks an EXISTING item (and, once some exist, re-creates via the\n\t// dropdown's footer row). With an empty list + a createOption the body shows a\n\t// dedicated \"Create new\" button instead, so the header \"+\" would be redundant.\n\t// In picker mode the \"+\" always shows (even empty) — for tools it sits next to\n\t// the empty-state source buttons; the create flow lives inside the picker.\n\tconst showAddButton = hasSourceGroups\n\t\t? usePicker || items.length > 0\n\t\t: usePicker ||\n\t\t addableOptions.length > 0 ||\n\t\t (!!createOption && items.length > 0);\n\t// Empty state offers a one-click \"Create new\" (sub-agents) rather than burying\n\t// it behind a single-item dropdown. In picker mode the \"+\" opens the picker\n\t// (with its own \"Create new\" row) instead, so skip the standalone button.\n\tconst showEmptyCreate =\n\t\titems.length === 0 && !!createOption && !hasSourceGroups && !usePicker;\n\tconst hasActionSources = !!actionSources && actionSources.length > 0;\n\t// Source buttons ONLY while no item is added — the tool sources (Manifest /\n\t// Shopify …) plus the built-in action tools (Rest API / Handover to email).\n\t// Once an item exists, adding more uses the header \"+\" → picker (the buttons\n\t// never come back); the action tools still live inside that picker.\n\tconst showSourceButtons =\n\t\t(hasSourceGroups || hasActionSources) && items.length === 0;\n\t// Nothing existing to pick → skip the 1-item dropdown and create directly.\n\tconst handleAddClick = () => {\n\t\tif (usePicker) {\n\t\t\t// Toggle the `@` reference-picker popover (rendered under the \"+\"), opened\n\t\t\t// at the root source list (no pre-drilled source).\n\t\t\tsetPickerSource(null);\n\t\t\tsetAdding((v) => !v);\n\t\t\treturn;\n\t\t}\n\t\tif (hasSourceGroups) {\n\t\t\tsetActiveSource(null);\n\t\t\tsetAdding((v) => !v);\n\t\t\treturn;\n\t\t}\n\t\tif (addableOptions.length === 0 && createOption) {\n\t\t\tcreateOption.onSelect();\n\t\t\treturn;\n\t\t}\n\t\tsetAdding((v) => !v);\n\t};\n\n\t// Run a row's configure handler; a returned promise disables the edit\n\t// buttons until it settles (same promise-sniff as the drawer Save buttons).\n\tconst handleConfigureClick = (\n\t\tid: string,\n\t\tconfigure: () => void | Promise<void>,\n\t) => {\n\t\tif (configuringId) {\n\t\t\treturn;\n\t\t}\n\t\tconst result = configure();\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetConfiguringId(id);\n\t\t\tvoid (result as Promise<void>).finally(() => setConfiguringId(null));\n\t\t}\n\t};\n\n\tconst renderChipRows = () =>\n\t\titems.map((item) => {\n\t\t\t// Per-item configure wins; otherwise fall back to the section-level one.\n\t\t\tconst configure =\n\t\t\t\titem.onConfigure ??\n\t\t\t\t(onConfigure ? () => onConfigure(item.id) : undefined);\n\t\t\treturn (\n\t\t\t\t<SelectableRow\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tdata-test={`${dataTestPrefix}-row-${item.id}`}\n\t\t\t\t>\n\t\t\t\t\t{renderSourceIcon(item.icon)}\n\t\t\t\t\t{/* Row label truncates to one line; tooltip surfaces the full name. */}\n\t\t\t\t\t<Tooltip body={item.label} placement=\"top\">\n\t\t\t\t\t\t<RowText>\n\t\t\t\t\t\t\t<BodySecondary numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t</RowText>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t\t<RowActions>\n\t\t\t\t\t\t{configure && (\n\t\t\t\t\t\t\t// Configurable rows (sub-agents, Rest API / email tools) get an\n\t\t\t\t\t\t\t// always-visible edit icon.\n\t\t\t\t\t\t\t<Tooltip body=\"Edit\" placement=\"top\">\n\t\t\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-edit-${item.id}`}\n\t\t\t\t\t\t\t\t\taria-label={`Edit ${item.label}`}\n\t\t\t\t\t\t\t\t\tdisabled={configuringId !== null}\n\t\t\t\t\t\t\t\t\tonClick={() => handleConfigureClick(item.id, configure)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EditIcon\n\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{configure && <RowActionDivider aria-hidden />}\n\t\t\t\t\t\t<Tooltip body=\"Delete\" placement=\"top\">\n\t\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-${item.id}`}\n\t\t\t\t\t\t\t\taria-label={`Delete ${item.label}`}\n\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\tconfirmDelete\n\t\t\t\t\t\t\t\t\t\t? setPendingDeleteId(item.id)\n\t\t\t\t\t\t\t\t\t\t: onRemove(item.id)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t</RowActions>\n\t\t\t\t</SelectableRow>\n\t\t\t);\n\t\t});\n\t// \"Create new\" is a brand-coloured footer row at the BOTTOM of the dropdown,\n\t// separated from the selectable items by a divider.\n\tconst dropdownOptions: SingleOption[] = createOption\n\t\t? [\n\t\t\t\t...addableOptions,\n\t\t\t\t{\n\t\t\t\t\tlabel: createOption.label,\n\t\t\t\t\tvalue: CREATE_OPTION_VALUE,\n\t\t\t\t\tsearchKey: createOption.label,\n\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\tcolor: COLORS.content.brand,\n\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{createOption.label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t ]\n\t\t: addableOptions;\n\n\t// One picker instance reused by the header \"+\" and the empty-state source\n\t// buttons. `key` remounts it so a source button re-drills into its own tools\n\t// (the initial drill-in level is read once, on mount).\n\tconst pickerNode = usePicker ? (\n\t\t<MentionPicker\n\t\t\tkey={pickerSource ?? '__root__'}\n\t\t\titems={mentionItems ?? []}\n\t\t\tquery=\"\"\n\t\t\tactiveIndex={0}\n\t\t\tinitialSource={pickerSource ?? undefined}\n\t\t\tonSelect={(item) => {\n\t\t\t\tsetAdding(false);\n\t\t\t\tonAdd(String(item.id));\n\t\t\t}}\n\t\t\tonClose={() => setAdding(false)}\n\t\t\tonCreateSubAgent={\n\t\t\t\tcreateOption\n\t\t\t\t\t? () => {\n\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\tcreateOption.onSelect();\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\ttoolActions={\n\t\t\t\thasActionSources\n\t\t\t\t\t? actionSources?.map((a) => ({\n\t\t\t\t\t\t\t...a,\n\t\t\t\t\t\t\tonSelect: () => {\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\ta.onSelect();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }))\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t) : null;\n\n\treturn (\n\t\t<SideSection>\n\t\t\t<SideSectionHeader>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>{title}</TitleSmall>\n\t\t\t\t{showAddButton && (\n\t\t\t\t\t<AddButtonWrap ref={headerPickerRef}>\n\t\t\t\t\t\t<AddIconButton\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-add`}\n\t\t\t\t\t\t\tonClick={handleAddClick}\n\t\t\t\t\t\t\taria-label={`Add ${title}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PlusIcon width={16} height={16} color={COLORS.content.primary} />\n\t\t\t\t\t\t</AddIconButton>\n\t\t\t\t\t\t{usePicker && adding && pickerSource === null && (\n\t\t\t\t\t\t\t<PickerPopover\n\t\t\t\t\t\t\t\t$up={pickerOpensUp}\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-picker`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{pickerNode}\n\t\t\t\t\t\t\t</PickerPopover>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</AddButtonWrap>\n\t\t\t\t)}\n\t\t\t</SideSectionHeader>\n\n\t\t\t{helper && (\n\t\t\t\t<BodyCaption color={COLORS.content.secondary}>{helper}</BodyCaption>\n\t\t\t)}\n\n\t\t\t{showSourceButtons ? (\n\t\t\t\t<SourcePickerAnchor ref={usePicker ? sourcePickerRef : undefined}>\n\t\t\t\t\t{/* No tools yet: one button per source (never shown once a tool exists). */}\n\t\t\t\t\t<SourceButtonRow data-test={`${dataTestPrefix}-sources`}>\n\t\t\t\t\t\t{sourceGroups?.map((g) => (\n\t\t\t\t\t\t\t<SourceButton\n\t\t\t\t\t\t\t\tkey={g.source}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-source-${g.source}`}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tif (usePicker) {\n\t\t\t\t\t\t\t\t\t\t// Open the `@` picker drilled straight into this source's tools.\n\t\t\t\t\t\t\t\t\t\tsetPickerSource(g.source);\n\t\t\t\t\t\t\t\t\t\tsetAdding(true);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tsetActiveSource(g.source);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderSourceIcon(SOURCE_ICONS[g.source], -4)}\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{g.label}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</SourceButton>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{actionSources?.map((a) => (\n\t\t\t\t\t\t\t<SourceButton\n\t\t\t\t\t\t\t\tkey={a.source}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-action-${a.source}`}\n\t\t\t\t\t\t\t\t// Close any open source picker before this opens its drawer,\n\t\t\t\t\t\t\t\t// otherwise the previous source's popup lingers behind it.\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\t\ta.onSelect();\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderSourceIcon(a.icon, -4)}\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{a.label}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</SourceButton>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</SourceButtonRow>\n\n\t\t\t\t\t{/* Picker mode: clicking a source opens its tools in the `@` picker. */}\n\t\t\t\t\t{usePicker && adding && pickerSource !== null && (\n\t\t\t\t\t\t<PickerPopover\n\t\t\t\t\t\t\t$align=\"left\"\n\t\t\t\t\t\t\t$up={pickerOpensUp}\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-picker`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{pickerNode}\n\t\t\t\t\t\t</PickerPopover>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Legacy (non-picker) mode: chosen source → its searchable tool list. */}\n\t\t\t\t\t{!usePicker && activeGroup && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Search ${activeGroup.label} tools`}\n\t\t\t\t\t\t\toptions={activeGroup.options}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\tsetActiveSource(null);\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</SourcePickerAnchor>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{!usePicker && adding && dropdownOptions.length > 0 && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Select ${title.toLowerCase()}`}\n\t\t\t\t\t\t\toptions={dropdownOptions}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (!v) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v === CREATE_OPTION_VALUE) {\n\t\t\t\t\t\t\t\t\tcreateOption?.onSelect();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{items.length === 0 && !adding ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t\t{emptyText}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{showEmptyCreate && createOption && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-create`}\n\t\t\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\tbuttonText={createOption.label}\n\t\t\t\t\t\t\t\t\tonClick={createOption.onSelect}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\trenderChipRows()\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{confirmDelete && pendingDeleteId && (\n\t\t\t\t<DeleteConfirmationModal\n\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-confirm`}\n\t\t\t\t\theader={`Delete this ${confirmDelete.noun}?`}\n\t\t\t\t\tsubHeader={`Deleting this ${confirmDelete.noun} will also remove it from your instructions, wherever it's referenced.`}\n\t\t\t\t\tconfirmationText=\"Delete\"\n\t\t\t\t\tzIndex={confirmDelete.zIndex}\n\t\t\t\t\tonDeleteConfirmed={() => {\n\t\t\t\t\t\tonRemove(pendingDeleteId);\n\t\t\t\t\t\tsetPendingDeleteId(null);\n\t\t\t\t\t}}\n\t\t\t\t\tonCancelClicked={() => setPendingDeleteId(null)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</SideSection>\n\t);\n};\n\n// Anchors the `@`-picker popover to the header \"+\" button.\nconst AddButtonWrap = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n`;\n\n// Anchors the `@`-picker popover to the empty-state source buttons.\nconst SourcePickerAnchor = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\n// Floating card under the trigger. Aligns to the \"+\" (right) or the source\n// buttons (left) so it stays inside the side panel.\nconst PickerPopover = styled.div<{ $align?: 'left' | 'right'; $up?: boolean }>`\n\tposition: absolute;\n\t${(p) => (p.$up ? 'bottom: calc(100% + 4px);' : 'top: calc(100% + 4px);')}\n\t${(p) => (p.$align === 'left' ? 'left: 0;' : 'right: 0;')}\n\tz-index: 30;\n`;\n"],"names":["CREATE_OPTION_VALUE","SelectableListSection","title","helper","items","addableOptions","onAdd","onRemove","dataTestPrefix","emptyText","createOption","onConfigure","sourceGroups","mentionItems","actionSources","confirmDelete","pickerOpensUp","adding","setAdding","useState","pendingDeleteId","setPendingDeleteId","configuringId","setConfiguringId","activeSource","setActiveSource","hasSourceGroups","activeGroup","g","usePicker","headerPickerRef","useRef","sourcePickerRef","pickerSource","setPickerSource","useEffect","onDocMouseDown","e","target","onKeyDown","showAddButton","showEmptyCreate","hasActionSources","showSourceButtons","handleAddClick","v","handleConfigureClick","id","configure","result","renderChipRows","item","jsxs","SelectableRow","renderSourceIcon","jsx","Tooltip","RowText","BodySecondary","COLORS","RowActions","RowMenuButton","EditIcon","RowActionDivider","DeleteIcon","dropdownOptions","pickerNode","MentionPicker","a","SideSection","SideSectionHeader","TitleSmall","AddButtonWrap","AddIconButton","PlusIcon","PickerPopover","BodyCaption","SourcePickerAnchor","SourceButtonRow","SourceButton","SOURCE_ICONS","Dropdown","opt","unwrapDropdownValue","Fragment","Button","DeleteConfirmationModal","styled","p"],"mappings":";;;;;;;;;;;;;;;;AA4DA,MAAMA,IAAsB,sBAiEfC,KAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;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AA;AAAA;"}
@@ -1,13 +1,13 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { TitleRegular as n, BodySecondary as i } from "../../TypographyStyle.js";
3
- import { COLORS as e } from "../../../constants/Theme.js";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { TitleRegular as n, BodyCaption as c } from "../../TypographyStyle.js";
3
+ import { COLORS as t } from "../../../constants/Theme.js";
4
4
  import { SectionHeaderWrap as m } from "../AgentBuilder.styled.js";
5
5
  const s = ({
6
- title: t,
6
+ title: e,
7
7
  helper: o
8
- }) => /* @__PURE__ */ c(m, { children: [
9
- /* @__PURE__ */ r(n, { color: e.content.primary, children: t }),
10
- o && /* @__PURE__ */ r(i, { color: e.content.secondary, children: o })
8
+ }) => /* @__PURE__ */ i(m, { children: [
9
+ /* @__PURE__ */ r(n, { color: t.content.primary, children: e }),
10
+ o && /* @__PURE__ */ r(c, { color: t.content.secondary, children: o })
11
11
  ] });
12
12
  export {
13
13
  s as StepSectionHeader