@namroodinc/liquid-editorial 0.13.5 → 0.14.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 (226) hide show
  1. package/README.md +1 -1
  2. package/UPGRADING.md +47 -0
  3. package/dist/chunks/{Avatar-UjhjcHh5.js → Avatar-BToMaTdL.js} +2 -2
  4. package/dist/chunks/{Avatar-UjhjcHh5.js.map → Avatar-BToMaTdL.js.map} +1 -1
  5. package/dist/chunks/{Avatar-BY0dAItT.cjs → Avatar-Dw7EWd_-.cjs} +2 -2
  6. package/dist/chunks/{Avatar-BY0dAItT.cjs.map → Avatar-Dw7EWd_-.cjs.map} +1 -1
  7. package/dist/chunks/{Board-CQ1GTuRB.cjs → Board-DeXtaWNO.cjs} +2 -2
  8. package/dist/chunks/{Board-CQ1GTuRB.cjs.map → Board-DeXtaWNO.cjs.map} +1 -1
  9. package/dist/chunks/{Board-DUX76d2R.js → Board-XeDG9nWP.js} +2 -2
  10. package/dist/chunks/{Board-DUX76d2R.js.map → Board-XeDG9nWP.js.map} +1 -1
  11. package/dist/chunks/{CollectionView-JRNdXHti.js → CollectionView-C0_bTO2v.js} +2 -2
  12. package/dist/chunks/{CollectionView-JRNdXHti.js.map → CollectionView-C0_bTO2v.js.map} +1 -1
  13. package/dist/chunks/{CollectionView-CIJdNwcq.cjs → CollectionView-Dbg4d_tA.cjs} +2 -2
  14. package/dist/chunks/{CollectionView-CIJdNwcq.cjs.map → CollectionView-Dbg4d_tA.cjs.map} +1 -1
  15. package/dist/chunks/{ColourField-BG5oGj9f.js → ColourField-Bb8H87fg.js} +3 -3
  16. package/dist/chunks/{ColourField-BG5oGj9f.js.map → ColourField-Bb8H87fg.js.map} +1 -1
  17. package/dist/chunks/{ColourField-DFvRASVe.cjs → ColourField-DAFzOIOq.cjs} +2 -2
  18. package/dist/chunks/{ColourField-DFvRASVe.cjs.map → ColourField-DAFzOIOq.cjs.map} +1 -1
  19. package/dist/chunks/{DatePicker-LqaePc57.js → DatePicker-COm1giw8.js} +3 -3
  20. package/dist/chunks/{DatePicker-LqaePc57.js.map → DatePicker-COm1giw8.js.map} +1 -1
  21. package/dist/chunks/{DatePicker-ClOqS6oH.cjs → DatePicker-DOg3iQYy.cjs} +2 -2
  22. package/dist/chunks/{DatePicker-ClOqS6oH.cjs.map → DatePicker-DOg3iQYy.cjs.map} +1 -1
  23. package/dist/chunks/{Drawer-DdIH9jpe.cjs → Drawer-B2dcTh5l.cjs} +2 -2
  24. package/dist/chunks/{Drawer-DdIH9jpe.cjs.map → Drawer-B2dcTh5l.cjs.map} +1 -1
  25. package/dist/chunks/{Drawer-Ck5XKT_V.js → Drawer-nUTJtwX_.js} +3 -3
  26. package/dist/chunks/{Drawer-Ck5XKT_V.js.map → Drawer-nUTJtwX_.js.map} +1 -1
  27. package/dist/chunks/EntryPicker-BwEYRtQl.cjs +2 -0
  28. package/dist/chunks/EntryPicker-BwEYRtQl.cjs.map +1 -0
  29. package/dist/chunks/{use-picker-session-BSpOwnQ-.js → EntryPicker-Ie9T47hA.js} +367 -202
  30. package/dist/chunks/EntryPicker-Ie9T47hA.js.map +1 -0
  31. package/dist/chunks/FormEditor-D1HUnjMI.cjs +2 -0
  32. package/dist/chunks/FormEditor-D1HUnjMI.cjs.map +1 -0
  33. package/dist/chunks/FormEditor-DgDV5aeR.js +30 -0
  34. package/dist/chunks/FormEditor-DgDV5aeR.js.map +1 -0
  35. package/dist/chunks/Icon-Bxvp1-td.js +102 -0
  36. package/dist/chunks/Icon-Bxvp1-td.js.map +1 -0
  37. package/dist/chunks/{Icon-3ucBRgrd.cjs → Icon-CnnTrtNb.cjs} +2 -2
  38. package/dist/chunks/Icon-CnnTrtNb.cjs.map +1 -0
  39. package/dist/chunks/{Message-yhdaBpaz.cjs → Message-B0A5bz8V.cjs} +2 -2
  40. package/dist/chunks/{Message-yhdaBpaz.cjs.map → Message-B0A5bz8V.cjs.map} +1 -1
  41. package/dist/chunks/{Message-d6lqiMQ6.js → Message-VJTPhId7.js} +2 -2
  42. package/dist/chunks/{Message-d6lqiMQ6.js.map → Message-VJTPhId7.js.map} +1 -1
  43. package/dist/chunks/RichTextEditor-DPhEkDxi.js +2108 -0
  44. package/dist/chunks/RichTextEditor-DPhEkDxi.js.map +1 -0
  45. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs +2 -0
  46. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs.map +1 -0
  47. package/dist/chunks/{dialogLabel-DT7rCr3_.js → dialogLabel-C153NosD.js} +2 -2
  48. package/dist/chunks/{dialogLabel-DT7rCr3_.js.map → dialogLabel-C153NosD.js.map} +1 -1
  49. package/dist/chunks/{dialogLabel-_-MTckE_.cjs → dialogLabel-CNNQbtob.cjs} +2 -2
  50. package/dist/chunks/{dialogLabel-_-MTckE_.cjs.map → dialogLabel-CNNQbtob.cjs.map} +1 -1
  51. package/dist/chunks/overlayLayer-CtOTt1xB.cjs +2 -0
  52. package/dist/chunks/overlayLayer-CtOTt1xB.cjs.map +1 -0
  53. package/dist/chunks/{overlayLayer-lU4iWSjO.js → overlayLayer-Og07sIyl.js} +21 -3
  54. package/dist/chunks/overlayLayer-Og07sIyl.js.map +1 -0
  55. package/dist/chunks/{useTooltip-DnJEFBLg.js → useTooltip-Du8PutGX.js} +2 -2
  56. package/dist/chunks/{useTooltip-DnJEFBLg.js.map → useTooltip-Du8PutGX.js.map} +1 -1
  57. package/dist/chunks/{useTooltip-C7ON4nkV.cjs → useTooltip-ekdwMJFz.cjs} +2 -2
  58. package/dist/chunks/{useTooltip-C7ON4nkV.cjs.map → useTooltip-ekdwMJFz.cjs.map} +1 -1
  59. package/dist/components/AppShell/index.cjs +1 -1
  60. package/dist/components/AppShell/index.js +1 -1
  61. package/dist/components/AssetCard/index.cjs +1 -1
  62. package/dist/components/AssetCard/index.js +1 -1
  63. package/dist/components/AssetGrid/index.cjs +1 -1
  64. package/dist/components/AssetGrid/index.js +1 -1
  65. package/dist/components/Avatar/index.cjs +1 -1
  66. package/dist/components/Avatar/index.js +1 -1
  67. package/dist/components/Banner/index.cjs +1 -1
  68. package/dist/components/Banner/index.js +1 -1
  69. package/dist/components/Board/index.cjs +1 -1
  70. package/dist/components/Board/index.js +1 -1
  71. package/dist/components/Button/index.cjs +1 -1
  72. package/dist/components/Button/index.js +1 -1
  73. package/dist/components/Choice/index.cjs +1 -1
  74. package/dist/components/Choice/index.cjs.map +1 -1
  75. package/dist/components/Choice/index.js +5 -5
  76. package/dist/components/CollectionView/index.cjs +1 -1
  77. package/dist/components/CollectionView/index.js +1 -1
  78. package/dist/components/ColourField/index.cjs +1 -1
  79. package/dist/components/ColourField/index.js +1 -1
  80. package/dist/components/DatePicker/index.cjs +1 -1
  81. package/dist/components/DatePicker/index.js +1 -1
  82. package/dist/components/Drawer/index.cjs +1 -1
  83. package/dist/components/Drawer/index.js +1 -1
  84. package/dist/components/EditLayout/index.cjs +1 -1
  85. package/dist/components/EditLayout/index.js +4 -4
  86. package/dist/components/EntryPicker/dialog.d.cts +11 -1
  87. package/dist/components/EntryPicker/dialog.d.cts.map +1 -1
  88. package/dist/components/EntryPicker/dialog.d.ts +11 -1
  89. package/dist/components/EntryPicker/dialog.d.ts.map +1 -1
  90. package/dist/components/EntryPicker/index.cjs +1 -1
  91. package/dist/components/EntryPicker/index.js +1 -1
  92. package/dist/components/EntryPicker/use-picker-data.d.cts +1 -1
  93. package/dist/components/EntryPicker/use-picker-data.d.cts.map +1 -1
  94. package/dist/components/EntryPicker/use-picker-data.d.ts +1 -1
  95. package/dist/components/EntryPicker/use-picker-data.d.ts.map +1 -1
  96. package/dist/components/EntryPicker/use-picker-session.d.cts +4 -1
  97. package/dist/components/EntryPicker/use-picker-session.d.cts.map +1 -1
  98. package/dist/components/EntryPicker/use-picker-session.d.ts +4 -1
  99. package/dist/components/EntryPicker/use-picker-session.d.ts.map +1 -1
  100. package/dist/components/EntryPicker/use-selected-items.d.cts +2 -0
  101. package/dist/components/EntryPicker/use-selected-items.d.cts.map +1 -1
  102. package/dist/components/EntryPicker/use-selected-items.d.ts +2 -0
  103. package/dist/components/EntryPicker/use-selected-items.d.ts.map +1 -1
  104. package/dist/components/FormEditor/README.md +155 -24
  105. package/dist/components/FormEditor/control.d.cts +11 -2
  106. package/dist/components/FormEditor/control.d.cts.map +1 -1
  107. package/dist/components/FormEditor/control.d.ts +11 -2
  108. package/dist/components/FormEditor/control.d.ts.map +1 -1
  109. package/dist/components/FormEditor/form.d.cts +33 -0
  110. package/dist/components/FormEditor/form.d.cts.map +1 -0
  111. package/dist/components/FormEditor/form.d.ts +33 -0
  112. package/dist/components/FormEditor/form.d.ts.map +1 -0
  113. package/dist/components/FormEditor/index.cjs +1 -1
  114. package/dist/components/FormEditor/index.d.cts +3 -27
  115. package/dist/components/FormEditor/index.d.cts.map +1 -1
  116. package/dist/components/FormEditor/index.d.ts +3 -27
  117. package/dist/components/FormEditor/index.d.ts.map +1 -1
  118. package/dist/components/FormEditor/index.js +3 -3
  119. package/dist/components/FormEditor/model.d.cts +2 -0
  120. package/dist/components/FormEditor/model.d.cts.map +1 -1
  121. package/dist/components/FormEditor/model.d.ts +2 -0
  122. package/dist/components/FormEditor/model.d.ts.map +1 -1
  123. package/dist/components/FormEditor/rich-text-control.d.cts +4 -0
  124. package/dist/components/FormEditor/rich-text-control.d.cts.map +1 -0
  125. package/dist/components/FormEditor/rich-text-control.d.ts +4 -0
  126. package/dist/components/FormEditor/rich-text-control.d.ts.map +1 -0
  127. package/dist/components/Icon/icons.d.cts +11 -0
  128. package/dist/components/Icon/icons.d.cts.map +1 -1
  129. package/dist/components/Icon/icons.d.ts +11 -0
  130. package/dist/components/Icon/icons.d.ts.map +1 -1
  131. package/dist/components/Icon/index.cjs +1 -1
  132. package/dist/components/Icon/index.js +1 -1
  133. package/dist/components/ImageCropper/index.cjs +1 -1
  134. package/dist/components/ImageCropper/index.cjs.map +1 -1
  135. package/dist/components/ImageCropper/index.js +6 -6
  136. package/dist/components/Menu/index.cjs +1 -1
  137. package/dist/components/Menu/index.cjs.map +1 -1
  138. package/dist/components/Menu/index.d.cts +3 -2
  139. package/dist/components/Menu/index.d.cts.map +1 -1
  140. package/dist/components/Menu/index.d.ts +3 -2
  141. package/dist/components/Menu/index.d.ts.map +1 -1
  142. package/dist/components/Menu/index.js +64 -51
  143. package/dist/components/Menu/index.js.map +1 -1
  144. package/dist/components/Modal/index.cjs +1 -1
  145. package/dist/components/Modal/index.js +2 -2
  146. package/dist/components/Popover/index.cjs +1 -1
  147. package/dist/components/Popover/index.js +1 -1
  148. package/dist/components/RichTextEditor/document.d.cts +6 -2
  149. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  150. package/dist/components/RichTextEditor/document.d.ts +6 -2
  151. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  152. package/dist/components/RichTextEditor/embed-context.d.cts +5 -0
  153. package/dist/components/RichTextEditor/embed-context.d.cts.map +1 -1
  154. package/dist/components/RichTextEditor/embed-context.d.ts +5 -0
  155. package/dist/components/RichTextEditor/embed-context.d.ts.map +1 -1
  156. package/dist/components/RichTextEditor/embed-types.d.cts +6 -4
  157. package/dist/components/RichTextEditor/embed-types.d.cts.map +1 -1
  158. package/dist/components/RichTextEditor/embed-types.d.ts +6 -4
  159. package/dist/components/RichTextEditor/embed-types.d.ts.map +1 -1
  160. package/dist/components/RichTextEditor/index.cjs +1 -1
  161. package/dist/components/RichTextEditor/index.d.cts +8 -0
  162. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  163. package/dist/components/RichTextEditor/index.d.ts +8 -0
  164. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  165. package/dist/components/RichTextEditor/index.js +1 -2
  166. package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -1
  167. package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -1
  168. package/dist/components/RichTextEditor/style.css +44 -46
  169. package/dist/components/RichTextEditor/tables.d.cts +7 -0
  170. package/dist/components/RichTextEditor/tables.d.cts.map +1 -0
  171. package/dist/components/RichTextEditor/tables.d.ts +7 -0
  172. package/dist/components/RichTextEditor/tables.d.ts.map +1 -0
  173. package/dist/components/RichTextEditor/use-embeds.d.cts.map +1 -1
  174. package/dist/components/RichTextEditor/use-embeds.d.ts.map +1 -1
  175. package/dist/components/SearchField/index.cjs +1 -1
  176. package/dist/components/SearchField/index.js +1 -1
  177. package/dist/components/Select/index.cjs +1 -1
  178. package/dist/components/Select/index.js +2 -2
  179. package/dist/components/SelectionCard/index.cjs +1 -1
  180. package/dist/components/SelectionCard/index.cjs.map +1 -1
  181. package/dist/components/SelectionCard/index.js +4 -4
  182. package/dist/components/SelectionCard/index.js.map +1 -1
  183. package/dist/components/SideNav/index.cjs +1 -1
  184. package/dist/components/SideNav/index.js +1 -1
  185. package/dist/components/SortableList/index.cjs +1 -1
  186. package/dist/components/SortableList/index.js +1 -1
  187. package/dist/components/Stepper/index.cjs +1 -1
  188. package/dist/components/Stepper/index.js +1 -1
  189. package/dist/components/SubNav/index.cjs +1 -1
  190. package/dist/components/SubNav/index.js +1 -1
  191. package/dist/components/Table/index.cjs +1 -1
  192. package/dist/components/Table/index.js +1 -1
  193. package/dist/components/Time/index.cjs +1 -1
  194. package/dist/components/Time/index.js +1 -1
  195. package/dist/components/Toast/index.cjs +1 -1
  196. package/dist/components/Toast/index.js +1 -1
  197. package/dist/components/TopNav/index.cjs +1 -1
  198. package/dist/components/TopNav/index.js +1 -1
  199. package/dist/index.cjs +1 -1
  200. package/dist/index.js +28 -28
  201. package/dist/internal/dialogFocus.d.cts +6 -1
  202. package/dist/internal/dialogFocus.d.cts.map +1 -1
  203. package/dist/internal/dialogFocus.d.ts +6 -1
  204. package/dist/internal/dialogFocus.d.ts.map +1 -1
  205. package/package.json +8 -6
  206. package/dist/chunks/EntryPicker-B4dAsObz.cjs +0 -2
  207. package/dist/chunks/EntryPicker-B4dAsObz.cjs.map +0 -1
  208. package/dist/chunks/EntryPicker-DDXHytMN.js +0 -160
  209. package/dist/chunks/EntryPicker-DDXHytMN.js.map +0 -1
  210. package/dist/chunks/FormEditor-BGzE-rqk.cjs +0 -2
  211. package/dist/chunks/FormEditor-BGzE-rqk.cjs.map +0 -1
  212. package/dist/chunks/FormEditor-ChH4e5sB.js +0 -693
  213. package/dist/chunks/FormEditor-ChH4e5sB.js.map +0 -1
  214. package/dist/chunks/Icon-3ucBRgrd.cjs.map +0 -1
  215. package/dist/chunks/Icon-dPXyBYe5.js +0 -91
  216. package/dist/chunks/Icon-dPXyBYe5.js.map +0 -1
  217. package/dist/chunks/RichTextEditor-BFblqw8m.js +0 -1144
  218. package/dist/chunks/RichTextEditor-BFblqw8m.js.map +0 -1
  219. package/dist/chunks/RichTextEditor-DU9CVeRD.cjs +0 -2
  220. package/dist/chunks/RichTextEditor-DU9CVeRD.cjs.map +0 -1
  221. package/dist/chunks/overlayLayer-iGhuAByk.cjs +0 -2
  222. package/dist/chunks/overlayLayer-iGhuAByk.cjs.map +0 -1
  223. package/dist/chunks/overlayLayer-lU4iWSjO.js.map +0 -1
  224. package/dist/chunks/use-picker-session-BSpOwnQ-.js.map +0 -1
  225. package/dist/chunks/use-picker-session-ouqHBmVA.cjs +0 -2
  226. package/dist/chunks/use-picker-session-ouqHBmVA.cjs.map +0 -1
@@ -1,86 +1,89 @@
1
- import { t as e } from "./Icon-dPXyBYe5.js";
1
+ import { t as e } from "./Icon-Bxvp1-td.js";
2
2
  import { Button as t } from "../components/Button/index.js";
3
- import { d as n, g as r, u as i } from "./overlayLayer-lU4iWSjO.js";
3
+ import { d as n, g as r, u as i } from "./overlayLayer-Og07sIyl.js";
4
4
  import { Badge as a } from "../components/Badge/index.js";
5
5
  import { r as o } from "./limit-s9zfxIMC.js";
6
6
  import { LimitReading as s } from "../components/LimitReading/index.js";
7
7
  import { Modal as c } from "../components/Modal/index.js";
8
8
  import { n as l, r as u, t as d } from "./LoadState-B056EPu7.js";
9
- import { SearchField as f } from "../components/SearchField/index.js";
10
- import { Checkbox as p } from "../components/Choice/index.js";
11
- import { useEffect as m, useId as h, useMemo as g, useRef as _, useState as v } from "react";
12
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
9
+ import { Stack as f } from "../components/Grid/index.js";
10
+ import { SearchField as p } from "../components/SearchField/index.js";
11
+ import { t as m } from "./style-7Z_xRlQx.js";
12
+ import { Checkbox as h } from "../components/Choice/index.js";
13
+ import { SortableList as g, SortableListItem as _ } from "../components/SortableList/index.js";
14
+ import { useEffect as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
15
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
13
16
  //#region src/components/EntryPicker/item.tsx
14
- function S(e) {
17
+ function E(e) {
15
18
  return e.isDisabled ? e.disabledReason : void 0;
16
19
  }
17
- function C(e) {
20
+ function D(e) {
18
21
  return e.tone === "removed";
19
22
  }
20
- function w(e) {
21
- return C(e) ? void 0 : S(e);
23
+ function O(e) {
24
+ return D(e) ? void 0 : E(e);
22
25
  }
23
- function T({ item: t, reasonId: n }) {
24
- let r = S(t);
25
- return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
26
+ function k({ item: t, reasonId: n }) {
27
+ let r = E(t);
28
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", {
26
29
  className: "ds-entry__thumb",
27
- children: t.imageUrl ? /* @__PURE__ */ b("img", {
30
+ children: t.imageUrl ? /* @__PURE__ */ w("img", {
28
31
  src: t.imageUrl,
29
32
  alt: "",
30
33
  loading: "lazy"
31
- }) : /* @__PURE__ */ b(e, {
34
+ }) : /* @__PURE__ */ w(e, {
32
35
  name: "file-text",
33
36
  size: 20
34
37
  })
35
- }), /* @__PURE__ */ x("span", {
38
+ }), /* @__PURE__ */ T("span", {
36
39
  className: "ds-entry__body",
37
40
  children: [
38
- /* @__PURE__ */ b("span", {
41
+ /* @__PURE__ */ w("span", {
39
42
  className: "ds-entry__title",
40
43
  "data-unavailable": t.isUnavailable || void 0,
41
44
  children: t.title
42
45
  }),
43
- t.metadata != null && /* @__PURE__ */ b("span", {
46
+ t.metadata != null && /* @__PURE__ */ w("span", {
44
47
  className: "ds-entry__meta",
45
48
  children: t.metadata
46
49
  }),
47
- r && /* @__PURE__ */ x("span", {
50
+ r && /* @__PURE__ */ T("span", {
48
51
  id: n,
49
52
  className: "ds-entry__reason",
50
53
  children: [
51
- /* @__PURE__ */ b(a, {
54
+ /* @__PURE__ */ w(a, {
52
55
  shape: "tag",
53
56
  size: "sm",
54
57
  children: r.label
55
58
  }),
56
59
  " ",
57
- /* @__PURE__ */ b("span", { children: r.description })
60
+ /* @__PURE__ */ w("span", { children: r.description })
58
61
  ]
59
62
  })
60
63
  ]
61
64
  })] });
62
65
  }
63
- function E({ item: e, reasonId: t }) {
64
- return C(e) ? /* @__PURE__ */ x("span", {
66
+ function A({ item: e, reasonId: t }) {
67
+ return D(e) ? /* @__PURE__ */ T("span", {
65
68
  className: "ds-entry__removed",
66
69
  children: [
67
- /* @__PURE__ */ b("strong", { children: e.title }),
70
+ /* @__PURE__ */ w("strong", { children: e.title }),
68
71
  " ",
69
- e.metadata ?? /* @__PURE__ */ b("code", { children: e.id })
72
+ e.metadata ?? /* @__PURE__ */ w("code", { children: e.id })
70
73
  ]
71
- }) : /* @__PURE__ */ b(T, {
74
+ }) : /* @__PURE__ */ w(k, {
72
75
  item: e,
73
76
  reasonId: t
74
77
  });
75
78
  }
76
- function D({ item: e }) {
77
- return C(e) ? /* @__PURE__ */ b(a, {
79
+ function j({ item: e }) {
80
+ return D(e) ? /* @__PURE__ */ w(a, {
78
81
  shape: "tag",
79
82
  children: e.removedLabel ?? "Removed on save"
80
83
  }) : null;
81
84
  }
82
- function O({ item: e, onEdit: n, isDisabled: r }) {
83
- return !n || e.isUnavailable || e.isDisabled ? null : /* @__PURE__ */ b(t, {
85
+ function M({ item: e, onEdit: n, isDisabled: r }) {
86
+ return !n || e.isUnavailable || e.isDisabled ? null : /* @__PURE__ */ w(t, {
84
87
  variant: "simple",
85
88
  size: "sm",
86
89
  isIconOnly: !0,
@@ -92,7 +95,7 @@ function O({ item: e, onEdit: n, isDisabled: r }) {
92
95
  }
93
96
  //#endregion
94
97
  //#region src/components/EntryPicker/chosen.ts
95
- function k(e, t, n) {
98
+ function N(e, t, n) {
96
99
  return {
97
100
  id: e,
98
101
  title: t,
@@ -100,25 +103,25 @@ function k(e, t, n) {
100
103
  isUnavailable: !0
101
104
  };
102
105
  }
103
- function A({ selected: e, items: t, pageItems: n, known: r, failures: i, hasResolver: a, itemLabel: o }) {
106
+ function P({ selected: e, items: t, pageItems: n, known: r, failures: i, hasResolver: a, itemLabel: o }) {
104
107
  let s = new Map(t.map((e) => [e.id, e])), c = new Map(n.map((e) => [e.id, e]));
105
- return e.map((e) => (s.get(e) ?? (r.has(e) ? r.get(e) : c.get(e))) || (r.has(e) ? k(e, `${`${o.charAt(0).toUpperCase()}${o.slice(1)}`} no longer available`, "Replace or clear this selection.") : a ? k(e, i.has(e) ? `Couldn't load ${o}` : "Loading…") : {
108
+ return e.map((e) => (s.get(e) ?? (r.has(e) ? r.get(e) : c.get(e))) || (r.has(e) ? N(e, `${`${o.charAt(0).toUpperCase()}${o.slice(1)}`} no longer available`, "Replace or clear this selection.") : a ? N(e, i.has(e) ? `Couldn't load ${o}` : "Loading…") : {
106
109
  id: e,
107
110
  title: e
108
111
  }));
109
112
  }
110
113
  //#endregion
111
114
  //#region src/components/EntryPicker/use-selected-items.ts
112
- function j(e) {
115
+ function F(e) {
113
116
  return e instanceof Error ? e : null;
114
117
  }
115
- function M(e, t) {
118
+ function I(e, t) {
116
119
  if (!t.some((t) => e.has(t))) return e;
117
120
  let n = new Map(e);
118
121
  for (let e of t) n.delete(e);
119
122
  return n;
120
123
  }
121
- function N(e, t, n) {
124
+ function L(e, t, n) {
122
125
  let r = n ? t.flatMap((t) => {
123
126
  let r = n(t);
124
127
  return r?.item.id === t && e.seeds.get(t) !== r ? [r] : [];
@@ -130,13 +133,13 @@ function N(e, t, n) {
130
133
  seeds: new Map([...e.seeds, ...r.map((e) => [e.item.id, e])]),
131
134
  known: i.length ? new Map([...e.known, ...o(i)]) : e.known,
132
135
  stale: a.length ? new Map([...e.stale, ...o(a)]) : e.stale,
133
- failures: M(e.failures, i.map((e) => e.item.id))
136
+ failures: I(e.failures, i.map((e) => e.item.id))
134
137
  };
135
138
  }
136
- function P(e, t) {
139
+ function R(e, t) {
137
140
  return e !== t && (e.length !== t.length || t.some((t) => !e.includes(t)));
138
141
  }
139
- function F(e, t, n, r) {
142
+ function z(e, t, n, r) {
140
143
  let i = e;
141
144
  if (Object.is(i.refreshKey, n) || (i = {
142
145
  ...i,
@@ -144,30 +147,30 @@ function F(e, t, n, r) {
144
147
  known: /* @__PURE__ */ new Map(),
145
148
  stale: new Map([...i.stale, ...i.known]),
146
149
  failures: /* @__PURE__ */ new Map()
147
- }), P(i.selected, t)) {
150
+ }), R(i.selected, t)) {
148
151
  let e = i.selected.filter((e) => !t.includes(e));
149
152
  i = {
150
153
  ...i,
151
154
  selected: t,
152
- known: M(i.known, e),
153
- stale: M(i.stale, e),
154
- failures: M(i.failures, e),
155
- seeds: M(i.seeds, e)
155
+ known: I(i.known, e),
156
+ stale: I(i.stale, e),
157
+ failures: I(i.failures, e),
158
+ seeds: I(i.seeds, e)
156
159
  };
157
160
  }
158
- return N(i, t, r);
161
+ return L(i, t, r);
159
162
  }
160
- function I(e, t, n, r, a) {
161
- let o = i(n), s = i(e), [c, l] = v(() => N({
163
+ function B(e, t, n, r, a) {
164
+ let o = i(n), s = i(e), [c, l] = S(() => L({
162
165
  refreshKey: r,
163
166
  selected: e,
164
167
  known: /* @__PURE__ */ new Map(),
165
168
  stale: /* @__PURE__ */ new Map(),
166
169
  failures: /* @__PURE__ */ new Map(),
167
170
  seeds: /* @__PURE__ */ new Map()
168
- }, e, a)), u = F(c, e, r, a);
171
+ }, e, a)), u = z(c, e, r, a);
169
172
  u !== c && l(u);
170
- let { known: d, stale: f, failures: p } = u, h = g(() => f.size === 0 ? d : new Map([...f, ...d]), [f, d]), y = (e, t, n = s.current) => {
173
+ let { known: d, stale: f, failures: p } = u, m = b(() => f.size === 0 ? d : new Map([...f, ...d]), [f, d]), h = (e, t, n = s.current) => {
171
174
  let r = e.filter((e) => e !== void 0 && n.includes(e.id)).map((e) => [e.id, e]);
172
175
  r.length !== 0 && l((e) => {
173
176
  if (Object.is(e.refreshKey, t)) return {
@@ -180,14 +183,14 @@ function I(e, t, n, r, a) {
180
183
  stale: new Map([...e.stale, ...n])
181
184
  };
182
185
  });
183
- }, b = new Set(t.map((e) => e.id)), x = n ? e.filter((e) => !b.has(e) && !d.has(e) && !p.has(e)) : [], S = JSON.stringify(x), C = _({
186
+ }, g = new Set(t.map((e) => e.id)), _ = n ? e.filter((e) => !g.has(e) && !d.has(e) && !p.has(e)) : [], y = JSON.stringify(_), C = x({
184
187
  refreshKey: r,
185
188
  tokens: /* @__PURE__ */ new Map()
186
189
  });
187
- m(() => {
190
+ v(() => {
188
191
  let e = o.current;
189
192
  if (!e) return;
190
- let t = JSON.parse(S);
193
+ let t = JSON.parse(y);
191
194
  Object.is(C.current.refreshKey, r) || (C.current = {
192
195
  refreshKey: r,
193
196
  tokens: /* @__PURE__ */ new Map()
@@ -205,57 +208,58 @@ function I(e, t, n, r, a) {
205
208
  known: new Map(t.known).set(i, e ?? null)
206
209
  }), (e) => a((t) => ({
207
210
  ...t,
208
- failures: new Map(t.failures).set(i, j(e))
211
+ failures: new Map(t.failures).set(i, F(e))
209
212
  })));
210
213
  }
211
214
  }, [
212
- S,
215
+ y,
213
216
  r,
214
217
  o
215
218
  ]);
216
219
  let w = e.filter((e) => p.has(e) && !d.has(e));
217
220
  return {
218
- known: h,
221
+ known: m,
222
+ current: d,
219
223
  failures: p,
220
- remember: y,
221
- status: x.length > 0 ? "loading" : w.length > 0 ? "error" : "ready",
224
+ remember: h,
225
+ status: _.length > 0 ? "loading" : w.length > 0 ? "error" : "ready",
222
226
  error: w.length > 0 ? p.get(w[0]) ?? null : null,
223
227
  retry: () => l((e) => ({
224
228
  ...e,
225
- failures: M(e.failures, w)
229
+ failures: I(e.failures, w)
226
230
  }))
227
231
  };
228
232
  }
229
233
  //#endregion
230
234
  //#region src/components/EntryPicker/feedback.tsx
231
- function L(e, t, n, r) {
235
+ function V(e, t, n, r) {
232
236
  let i = l(t, n, r);
233
- return t !== "error" && i.state !== "pending" ? null : /* @__PURE__ */ b(u, {
237
+ return t !== "error" && i.state !== "pending" ? null : /* @__PURE__ */ w(u, {
234
238
  title: e,
235
239
  error: i.error,
236
240
  onRetry: i.retry,
237
241
  retryState: i.state
238
242
  });
239
243
  }
240
- function R({ query: e, itemLabel: t, itemsLabel: n, canCreate: r }) {
244
+ function H({ query: e, itemLabel: t, itemsLabel: n, canCreate: r }) {
241
245
  let i = e.trim();
242
- return /* @__PURE__ */ x("div", {
246
+ return /* @__PURE__ */ T("div", {
243
247
  className: "ds-entry-picker__no-results",
244
- children: [/* @__PURE__ */ b("p", { children: i ? `No ${n} match “${i}”` : `No ${n} yet` }), i && /* @__PURE__ */ x("p", { children: ["Try a different search.", r ? ` Or create the ${t} you need.` : ""] })]
248
+ children: [/* @__PURE__ */ w("p", { children: i ? `No ${n} match “${i}”` : `No ${n} yet` }), i && /* @__PURE__ */ T("p", { children: ["Try a different search.", r ? ` Or create the ${t} you need.` : ""] })]
245
249
  });
246
250
  }
247
- function z(e, t) {
251
+ function U(e, t) {
248
252
  let n = e.closest(".ds-entry-picker__scroll") ?? e.parentElement, i = Array.from(n?.querySelectorAll(".ds-entry-picker__result") ?? []);
249
253
  for (let e of [...i.slice(t), ...i.slice(0, t).reverse()]) {
250
254
  let t = r(e)[0];
251
255
  if (t) return t;
252
256
  }
253
257
  }
254
- function B(e) {
255
- let t = _(null), i = _(null), { more: a, offset: o } = e;
256
- return m(() => {
258
+ function W(e) {
259
+ let t = x(null), i = x(null), { more: a, offset: o } = e;
260
+ return v(() => {
257
261
  let e = i.current, o = t.current;
258
- e !== null && a.status !== "loading" && (i.current = null, o && n(document.activeElement) && (a.status === "error" ? r(o)[0] : z(o, e))?.focus());
262
+ e !== null && a.status !== "loading" && (i.current = null, o && n(document.activeElement) && (a.status === "error" ? r(o)[0] : U(o, e))?.focus());
259
263
  }, [a.status, o]), {
260
264
  pagingRef: t,
261
265
  load: () => {
@@ -263,21 +267,21 @@ function B(e) {
263
267
  }
264
268
  };
265
269
  }
266
- function V(e, t) {
267
- let i = _(t);
268
- m(() => {
270
+ function G(e, t) {
271
+ let i = x(t);
272
+ v(() => {
269
273
  if (i.current === t) return;
270
274
  i.current = t;
271
275
  let a = e.current;
272
- a && n(document.activeElement) && (r(a)[0] ?? z(a, Infinity))?.focus();
276
+ a && n(document.activeElement) && (r(a)[0] ?? U(a, Infinity))?.focus();
273
277
  }, [e, t]);
274
278
  }
275
- function H({ count: e, total: n, isRemote: r, pageSize: i, remote: a, itemsLabel: o }) {
276
- let { more: s } = a, { pagingRef: c, load: l } = B(a), u = L(`Couldn't load more ${o}`, s.status, s.error, l);
277
- return V(c, u ? "failure" : r && a.hasMore ? "more" : "none"), n === 0 ? null : /* @__PURE__ */ x("div", {
279
+ function K({ count: e, total: n, isRemote: r, pageSize: i, remote: a, itemsLabel: o }) {
280
+ let { more: s } = a, { pagingRef: c, load: l } = W(a), u = V(`Couldn't load more ${o}`, s.status, s.error, l);
281
+ return G(c, u ? "failure" : r && a.hasMore ? "more" : "none"), n === 0 ? null : /* @__PURE__ */ T("div", {
278
282
  ref: c,
279
283
  className: "ds-entry-picker__paging",
280
- children: [u ?? (r && a.hasMore && /* @__PURE__ */ x(t, {
284
+ children: [u ?? (r && a.hasMore && /* @__PURE__ */ T(t, {
281
285
  isPending: s.status === "loading",
282
286
  isFocusableWhenDisabled: !0,
283
287
  isDisabled: !s.isAvailable,
@@ -287,30 +291,30 @@ function H({ count: e, total: n, isRemote: r, pageSize: i, remote: a, itemsLabel
287
291
  Math.min(i, n - a.offset),
288
292
  " more"
289
293
  ]
290
- })), /* @__PURE__ */ b("span", { children: e < n ? `Showing ${e} of ${n}` : `All ${e} shown` })]
294
+ })), /* @__PURE__ */ w("span", { children: e < n ? `Showing ${e} of ${n}` : `All ${e} shown` })]
291
295
  });
292
296
  }
293
297
  //#endregion
294
298
  //#region src/components/EntryPicker/blocked.ts
295
- function U(e, t, { isDisabled: n, searching: r, atMax: i }) {
299
+ function q(e, t, { isDisabled: n, searching: r, atMax: i }) {
296
300
  if (n || r) return "inactive";
297
301
  if (e.isDisabled) return "restricted";
298
302
  if (!t && i) return "full";
299
303
  }
300
304
  //#endregion
301
305
  //#region src/components/EntryPicker/results.tsx
302
- function W({ items: e, selected: t, block: n, onToggle: r, onEdit: i }) {
303
- let a = h(), o = `${a}-full`;
304
- return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
306
+ function J({ items: e, selected: t, block: n, onToggle: r, onEdit: i }) {
307
+ let a = y(), o = `${a}-full`;
308
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", {
305
309
  id: o,
306
310
  hidden: !0,
307
311
  children: "The selection is full. Remove one to choose another."
308
- }), /* @__PURE__ */ b("ul", {
312
+ }), /* @__PURE__ */ w("ul", {
309
313
  className: "ds-entry-picker__results",
310
314
  "data-searching": n.searching || void 0,
311
315
  children: e.map((e, s) => {
312
- let c = t.includes(e.id), l = U(e, c, n), u = S(e) ? `${a}-reason-${s}` : void 0;
313
- return /* @__PURE__ */ x("li", {
316
+ let c = t.includes(e.id), l = q(e, c, n), u = E(e) ? `${a}-reason-${s}` : void 0;
317
+ return /* @__PURE__ */ T("li", {
314
318
  className: "ds-entry-picker__result ds-field-surface",
315
319
  "data-selected": c || void 0,
316
320
  "data-blocked": l ? !0 : void 0,
@@ -319,7 +323,7 @@ function W({ items: e, selected: t, block: n, onToggle: r, onEdit: i }) {
319
323
  (!n || !t.currentTarget.contains(n)) && r(e.id);
320
324
  },
321
325
  children: [
322
- /* @__PURE__ */ b(p, {
326
+ /* @__PURE__ */ w(h, {
323
327
  checked: c,
324
328
  "aria-checked": c,
325
329
  "aria-label": `Select ${e.title}`,
@@ -328,14 +332,14 @@ function W({ items: e, selected: t, block: n, onToggle: r, onEdit: i }) {
328
332
  isFocusableWhenDisabled: l !== "inactive",
329
333
  onChange: () => r(e.id)
330
334
  }),
331
- /* @__PURE__ */ b("span", {
335
+ /* @__PURE__ */ w("span", {
332
336
  className: "ds-entry",
333
- children: /* @__PURE__ */ b(T, {
337
+ children: /* @__PURE__ */ w(k, {
334
338
  item: e,
335
339
  reasonId: u
336
340
  })
337
341
  }),
338
- /* @__PURE__ */ b(O, {
342
+ /* @__PURE__ */ w(M, {
339
343
  item: e,
340
344
  onEdit: i,
341
345
  isDisabled: l === "inactive"
@@ -347,8 +351,8 @@ function W({ items: e, selected: t, block: n, onToggle: r, onEdit: i }) {
347
351
  }
348
352
  //#endregion
349
353
  //#region src/components/EntryPicker/use-picker-scroll.ts
350
- function G() {
351
- let e = _(null), [t, n] = v(!1);
354
+ function Y() {
355
+ let e = x(null), [t, n] = S(!1);
352
356
  return {
353
357
  ref: e,
354
358
  scrolled: t,
@@ -362,97 +366,104 @@ function G() {
362
366
  }
363
367
  //#endregion
364
368
  //#region src/components/EntryPicker/dialog.tsx
365
- function K({ isOpen: e, onClose: n, query: r, onQuery: i, selected: a, results: o, cap: l, block: u, isRemote: f, pageSize: p, remote: m, onToggle: h, onEdit: g, itemLabel: _, itemsLabel: v, addLabel: S, onCreate: C, isCreating: w, dialogTitle: T, dialogDescription: E, isDialogHidden: D }) {
366
- let O = L(`Couldn't refresh ${v}`, m.refresh.status, m.refresh.error, m.refresh.retry);
367
- return /* @__PURE__ */ b(c, {
369
+ function X(e, t) {
370
+ return e && t ? /* @__PURE__ */ T(f, {
371
+ gap: "sm",
372
+ children: [e, t]
373
+ }) : e || t;
374
+ }
375
+ function Z({ isOpen: e, onClose: n, query: r, onQuery: i, selected: a, results: o, cap: l, block: u, isRemote: f, pageSize: p, remote: m, onToggle: h, onEdit: g, confirm: _, selectionNotice: v, selectionFailure: y, isCreateDisabled: b, itemLabel: x, itemsLabel: S, addLabel: E, onCreate: D, isCreating: O, dialogTitle: k, dialogDescription: A, isDialogHidden: j }) {
376
+ let M = V(`Couldn't refresh ${S}`, m.refresh.status, m.refresh.error, m.refresh.retry);
377
+ return /* @__PURE__ */ w(c, {
368
378
  isOpen: e,
369
- isHidden: D,
379
+ isHidden: j,
370
380
  onClose: n,
371
- title: T ?? S,
372
- description: E ?? l.description,
381
+ title: k ?? E,
382
+ description: A ?? l.description,
373
383
  className: "ds-entry-picker__dialog",
374
- footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
384
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T("span", {
375
385
  className: "ds-entry-picker__selection",
376
386
  role: "status",
377
- children: l.reading ? /* @__PURE__ */ b(s, {
387
+ children: [l.reading ? /* @__PURE__ */ w(s, {
378
388
  ...l.reading,
379
389
  size: "lg"
380
- }) : `${a.length} selected`
381
- }), /* @__PURE__ */ b(t, {
390
+ }) : `${a.length} selected`, v && `. ${v}`]
391
+ }), /* @__PURE__ */ w(t, {
382
392
  variant: "primary",
383
- onClick: n,
384
- children: "Done"
393
+ isDisabled: _?.isDisabled,
394
+ onClick: _?.onClick ?? n,
395
+ children: _?.label ?? "Done"
385
396
  })] }),
386
- children: /* @__PURE__ */ b(q, {
397
+ children: /* @__PURE__ */ w(ee, {
387
398
  query: r,
388
399
  onQuery: i,
389
- itemsLabel: v,
400
+ itemsLabel: S,
390
401
  isSearching: m.loading,
391
- action: C && /* @__PURE__ */ b(t, {
402
+ action: D && /* @__PURE__ */ w(t, {
392
403
  variant: "primary",
393
- isPending: w,
404
+ isPending: O,
394
405
  isFocusableWhenDisabled: !0,
395
406
  iconStart: "plus",
396
- isDisabled: u.isDisabled || l.atMax,
397
- onClick: C,
398
- children: `New ${_}`
407
+ isDisabled: u.isDisabled || l.atMax || b,
408
+ onClick: D,
409
+ children: `New ${x}`
399
410
  }),
400
- banner: O,
411
+ banner: X(M, y),
401
412
  isBusy: m.loading || m.more.status === "loading" || m.refresh.status === "loading",
402
- children: /* @__PURE__ */ x(d, {
413
+ children: /* @__PURE__ */ T(d, {
403
414
  status: m.status,
404
- errorTitle: `Couldn't load ${v}`,
415
+ errorTitle: `Couldn't load ${S}`,
405
416
  error: m.error,
406
417
  onRetry: m.retry,
407
418
  children: [
408
- /* @__PURE__ */ b(W, {
419
+ /* @__PURE__ */ w(J, {
409
420
  items: o,
410
421
  selected: a,
411
422
  block: u,
412
423
  onToggle: h,
413
424
  onEdit: g
414
425
  }),
415
- !m.searching && o.length === 0 && /* @__PURE__ */ b(R, {
426
+ !m.searching && o.length === 0 && /* @__PURE__ */ w(H, {
416
427
  query: r,
417
- itemLabel: _,
418
- itemsLabel: v,
419
- canCreate: !!C
428
+ itemLabel: x,
429
+ itemsLabel: S,
430
+ canCreate: !!D
420
431
  }),
421
- /* @__PURE__ */ b(H, {
432
+ /* @__PURE__ */ w(K, {
422
433
  count: o.length,
423
434
  total: f ? m.total : o.length,
424
435
  isRemote: f,
425
436
  pageSize: p,
426
437
  remote: m,
427
- itemsLabel: v
438
+ itemsLabel: S
428
439
  })
429
440
  ]
430
441
  })
431
442
  })
432
443
  });
433
444
  }
434
- function q({ query: e, onQuery: t, itemsLabel: n, isSearching: r, action: i, banner: a, isBusy: o, children: s }) {
435
- let { ref: c, scrolled: l, onScroll: u, toTop: d } = G(), p = (e) => {
445
+ function ee({ query: e, onQuery: t, itemsLabel: n, isSearching: r, action: i, banner: a, isBusy: o, children: s }) {
446
+ let { ref: c, scrolled: l, onScroll: u, toTop: d } = Y(), f = (e) => {
436
447
  d(), t(e);
437
448
  };
438
- return /* @__PURE__ */ x(y, { children: [
439
- /* @__PURE__ */ x("div", {
449
+ return /* @__PURE__ */ T(C, { children: [
450
+ /* @__PURE__ */ T("div", {
440
451
  className: "ds-entry-picker__search ds-field-surface",
441
452
  "data-scrolled": l || void 0,
442
- children: [/* @__PURE__ */ b(f, {
453
+ children: [/* @__PURE__ */ w(p, {
443
454
  "aria-label": `Search ${n}`,
444
455
  value: e,
445
456
  isBusy: r,
446
457
  placeholder: `Search ${n}`,
447
- onChange: (e) => p(e.target.value),
448
- onClear: () => p("")
458
+ onChange: (e) => f(e.target.value),
459
+ onClear: () => f("")
449
460
  }), i]
450
461
  }),
451
- a && /* @__PURE__ */ b("div", {
462
+ a && /* @__PURE__ */ w("div", {
452
463
  className: "ds-entry-picker__refresh",
453
464
  children: a
454
465
  }),
455
- /* @__PURE__ */ b("div", {
466
+ /* @__PURE__ */ w("div", {
456
467
  className: "ds-entry-picker__scroll",
457
468
  ref: c,
458
469
  onScroll: u,
@@ -463,11 +474,11 @@ function q({ query: e, onQuery: t, itemsLabel: n, isSearching: r, action: i, ban
463
474
  }
464
475
  //#endregion
465
476
  //#region src/components/EntryPicker/limit.ts
466
- function J(e, t) {
477
+ function te(e, t) {
467
478
  return e === "single" || t === 1;
468
479
  }
469
- function Y(e, t, n) {
470
- return J(e, n) ? {
480
+ function ne(e, t, n) {
481
+ return te(e, n) ? {
471
482
  count: t,
472
483
  max: 1,
473
484
  tone: "neutral"
@@ -476,11 +487,11 @@ function Y(e, t, n) {
476
487
  max: n
477
488
  } : void 0;
478
489
  }
479
- function X(e, t, n) {
480
- return J(e, n) ? void 0 : t;
490
+ function re(e, t, n) {
491
+ return te(e, n) ? void 0 : t;
481
492
  }
482
- function ee(e, t, n, { itemLabel: r, itemsLabel: i }) {
483
- let a = Y(e, t, n), s = e === "multiple" && a && Number.isFinite(a.max) ? a.max : void 0, c = `Choose as many ${i} as you need.`;
493
+ function ie(e, t, n, { itemLabel: r, itemsLabel: i }) {
494
+ let a = ne(e, t, n), s = e === "multiple" && a && Number.isFinite(a.max) ? a.max : void 0, c = `Choose as many ${i} as you need.`;
484
495
  return e === "single" || s === 1 ? c = `Choose one ${r}.` : s !== void 0 && (c = `Choose up to ${s} ${i}.`), {
485
496
  limit: a,
486
497
  atMax: s !== void 0 && t >= s,
@@ -490,22 +501,22 @@ function ee(e, t, n, { itemLabel: r, itemsLabel: i }) {
490
501
  }
491
502
  //#endregion
492
503
  //#region src/components/EntryPicker/use-picker-data.ts
493
- var te = 250;
494
- function ne(e) {
504
+ var ae = 250;
505
+ function oe(e) {
495
506
  return Array.from(new Map(e.map((e) => [e.id, e])).values());
496
507
  }
497
- var Z = {
508
+ var se = {
498
509
  items: [],
499
510
  offset: 0,
500
511
  total: 0
501
512
  }, Q = {
502
- ...Z,
513
+ ...se,
503
514
  key: null,
504
515
  revision: void 0,
505
516
  status: "ready",
506
517
  error: null
507
518
  };
508
- function re(e, t) {
519
+ function ce(e, t) {
509
520
  let n = e?.status === "error" && t;
510
521
  return {
511
522
  status: e?.status === "loading" ? "loading" : n ? "error" : "ready",
@@ -515,22 +526,22 @@ function re(e, t) {
515
526
  }
516
527
  function $(e, t) {
517
528
  return {
518
- items: ne([...e.items, ...t.items]),
529
+ items: oe([...e.items, ...t.items]),
519
530
  offset: e.offset + t.items.length,
520
531
  total: t.items.length === 0 ? Math.min(t.total, e.offset) : t.total
521
532
  };
522
533
  }
523
- function ie(e, t, n, r) {
534
+ function le(e, t, n, r) {
524
535
  return e.key !== t || e.offset !== n ? e : {
525
536
  ...e,
526
537
  ...$(e, r)
527
538
  };
528
539
  }
529
- async function ae(e, t, n, r, i) {
540
+ async function ue(e, t, n, r, i) {
530
541
  let a = Math.max(1, Math.ceil(r / n)), o = await Promise.all(Array.from({ length: a }, (r, i) => e({
531
542
  offset: i * n,
532
543
  limit: n
533
- }, { query: t }))), s = Z;
544
+ }, { query: t }))), s = se;
534
545
  for (let [e, t] of o.entries()) {
535
546
  if (s.offset !== e * n) break;
536
547
  s = $(s, t);
@@ -541,7 +552,7 @@ async function ae(e, t, n, r, i) {
541
552
  }, { query: t }));
542
553
  return s;
543
554
  }
544
- function oe(e, t, n, r) {
555
+ function de(e, t, n, r) {
545
556
  let i = e !== null && t.key === e, a = i && Object.is(t.revision, n), o = e !== null && !a && (!i || t.status === "error"), s = o && t.key !== null && t.status === "ready", c = o && !s ? "loading" : t.status === "error" ? "error" : "ready", l = t.status === "ready" && t.offset < t.total, u = i && !a && t.status === "ready", d = u && r?.key === e && Object.is(r.revision, n);
546
557
  return {
547
558
  loading: o,
@@ -552,40 +563,40 @@ function oe(e, t, n, r) {
552
563
  refreshFailed: d
553
564
  };
554
565
  }
555
- function se(e, t, n, r, a, o) {
556
- let s = i(e), c = i(a), l = i(o), [u, d] = v(0), [f, p] = v(Q), [h, g] = v(null), [y, b] = v(null), [x, S] = v(r);
557
- x !== r && (S(r), r || (p(Q), g(null), b(null), d((e) => e + 1)));
566
+ function fe(e, t, n, r, a, o) {
567
+ let s = i(e), c = i(a), l = i(o), [u, d] = S(0), [f, p] = S(Q), [m, h] = S(null), [g, _] = S(null), [y, b] = S(r);
568
+ y !== r && (b(r), r || (p(Q), h(null), _(null), d((e) => e + 1)));
558
569
  let C = n.trim(), w = e && r ? JSON.stringify([
559
570
  C,
560
571
  t,
561
572
  u
562
- ]) : null, T = i(f), E = _(null), D = _(C), { loading: O, searching: k, status: A, hasMore: M, refresh: N, refreshFailed: P } = oe(w, f, o, y), F = !O && N === "ready", I = O ? "load" : N === "loading" ? "refresh" : null;
563
- m(() => {
573
+ ]) : null, T = i(f), E = x(null), D = x(C), { loading: O, searching: k, status: A, hasMore: j, refresh: M, refreshFailed: N } = de(w, f, o, g), P = !O && M === "ready", I = O ? "load" : M === "loading" ? "refresh" : null;
574
+ v(() => {
564
575
  if (w === null) return;
565
- let e = I === "load" && C !== D.current ? te : 0;
576
+ let e = I === "load" && C !== D.current ? ae : 0;
566
577
  if (D.current = C, I === null) return;
567
578
  let n = I === "refresh" ? T.current.offset + (E.current ? t : 0) : 0, r = !0, i = window.setTimeout(() => {
568
579
  let e = s.current;
569
- e && ae(e, C, t, n, () => r).then((e) => {
580
+ e && ue(e, C, t, n, () => r).then((e) => {
570
581
  r && (E.current = null, p({
571
582
  ...e,
572
583
  key: w,
573
584
  revision: o,
574
585
  status: "ready",
575
586
  error: null
576
- }), g(null), b(null), c.current(e.items, o));
587
+ }), h(null), _(null), c.current?.(e.items, o));
577
588
  }, (e) => {
578
- r && (I === "refresh" ? b({
589
+ r && (I === "refresh" ? _({
579
590
  key: w,
580
591
  revision: o,
581
- error: j(e)
592
+ error: F(e)
582
593
  }) : (E.current = null, p({
583
594
  ...Q,
584
595
  key: w,
585
596
  revision: o,
586
597
  status: "error",
587
- error: j(e)
588
- }), g(null)));
598
+ error: F(e)
599
+ }), h(null)));
589
600
  });
590
601
  }, e);
591
602
  return () => {
@@ -603,32 +614,32 @@ function se(e, t, n, r, a, o) {
603
614
  ]);
604
615
  let L = () => {
605
616
  let e = s.current, n = f.key, { offset: r } = f;
606
- if (!e || n === null || !F || !M || E.current) return;
617
+ if (!e || n === null || !P || !j || E.current) return;
607
618
  let i = Symbol("load more"), a = o;
608
- E.current = i, g({
619
+ E.current = i, h({
609
620
  token: i,
610
621
  status: "loading",
611
622
  error: null
612
623
  });
613
624
  let u = () => E.current === i && T.current.key === n && T.current.offset === r && Object.is(l.current, a), d = (e) => {
614
- E.current === i && (E.current = null), g((t) => t?.token === i ? e : t);
625
+ E.current === i && (E.current = null), h((t) => t?.token === i ? e : t);
615
626
  };
616
627
  Promise.resolve().then(() => e({
617
628
  offset: r,
618
629
  limit: t
619
630
  }, { query: C })).then((e) => {
620
- u() && (p((t) => ie(t, n, r, e)), c.current(e.items, a)), d(null);
631
+ u() && (p((t) => le(t, n, r, e)), c.current?.(e.items, a)), d(null);
621
632
  }, (e) => d(u() ? {
622
633
  token: i,
623
634
  status: "error",
624
- error: j(e)
635
+ error: F(e)
625
636
  } : null));
626
637
  };
627
638
  return {
628
639
  items: f.items,
629
640
  total: f.total,
630
641
  offset: f.offset,
631
- hasMore: M,
642
+ hasMore: j,
632
643
  pageRevision: f.revision,
633
644
  loading: O,
634
645
  searching: k,
@@ -636,20 +647,23 @@ function se(e, t, n, r, a, o) {
636
647
  error: f.error,
637
648
  retry: () => d((e) => e + 1),
638
649
  more: {
639
- ...re(h, F),
650
+ ...ce(m, P),
640
651
  load: L
641
652
  },
642
653
  refresh: {
643
- status: N,
644
- error: P ? y?.error ?? null : null,
645
- retry: () => b(null)
654
+ status: M,
655
+ error: N ? g?.error ?? null : null,
656
+ retry: () => _(null)
646
657
  }
647
658
  };
648
659
  }
649
660
  //#endregion
650
661
  //#region src/components/EntryPicker/use-picker-session.ts
651
- var ce = [];
652
- function le(e, t) {
662
+ var pe = [];
663
+ function me(e, t) {
664
+ return !!(e.isDisabled || t?.(e));
665
+ }
666
+ function he(e, t) {
653
667
  return t ? e.map((e) => {
654
668
  let n = e.isDisabled ? void 0 : t(e);
655
669
  return n ? {
@@ -659,54 +673,205 @@ function le(e, t) {
659
673
  } : e;
660
674
  }) : e;
661
675
  }
662
- function ue(e, t, n, { isOpen: r, isDisabled: i, itemLabel: a, itemsLabel: o, close: s, restrict: c }) {
663
- let [l, u] = v(""), { resolveItem: d, refreshKey: f, loadPage: p, pageSize: m = 10, mode: h = "multiple", max: _, onEditItem: y } = n, b = I(e, t, d, f), x = se(p, m, l, r, b.remember, f), S = !!p, C = g(() => {
664
- let e = l.trim().toLowerCase();
665
- return S ? ce : t.filter((t) => !e || [t.title, ...t.keywords ?? []].join(" ").toLowerCase().includes(e));
676
+ function ge(e, t, n, { isOpen: r, isDisabled: i, itemLabel: a, itemsLabel: o, close: s, recheckSelection: c, restrict: l }) {
677
+ let [u, d] = S(""), { resolveItem: f, refreshKey: p, loadPage: m, pageSize: h = 10, mode: g = "multiple", max: _, onEditItem: v } = n, y = !!m, x = c && y && !!f, C = B(e, x ? pe : t, f, p), w = fe(m, h, u, r, x ? (e, t) => C.remember(e.filter((e) => me(e, l)), t) : C.remember, p), T = b(() => {
678
+ let e = u.trim().toLowerCase();
679
+ return y ? pe : t.filter((t) => !e || [t.title, ...t.keywords ?? []].join(" ").toLowerCase().includes(e));
666
680
  }, [
667
- S,
681
+ y,
668
682
  t,
669
- l
670
- ]), w = S ? x.items : C, T = g(() => le(w, c), [w, c]), E = ee(h, e.length, _, {
683
+ u
684
+ ]), E = y ? w.items : T, D = b(() => he(E, l), [E, l]), O = ie(g, e.length, _, {
671
685
  itemLabel: a,
672
686
  itemsLabel: o
673
- }), D = {
687
+ }), k = {
674
688
  isDisabled: i,
675
- searching: x.searching,
676
- atMax: E.atMax
677
- }, O = y ? (e) => {
678
- y(e) === !1 && s();
689
+ searching: w.searching,
690
+ atMax: O.atMax
691
+ }, A = v ? (e) => {
692
+ v(e) === !1 && s();
679
693
  } : void 0;
680
694
  return {
681
- selection: b,
682
- remote: x,
683
- isRemote: S,
684
- results: T,
685
- cap: E,
686
- block: D,
687
- editItem: O,
688
- revision: S ? x.pageRevision : f,
695
+ selection: C,
696
+ remote: w,
697
+ isRemote: y,
698
+ results: D,
699
+ cap: O,
700
+ block: k,
701
+ editItem: A,
702
+ revision: y ? w.pageRevision : p,
689
703
  choice: (t) => {
690
- let n = T.find((e) => e.id === t);
691
- return n && !U(n, e.includes(t), D) ? n : void 0;
704
+ let n = D.find((e) => e.id === t);
705
+ return n && !q(n, e.includes(t), k) ? n : void 0;
692
706
  },
693
707
  dialog: {
694
- query: l,
695
- onQuery: u,
708
+ query: u,
709
+ onQuery: d,
696
710
  selected: e,
697
- results: T,
698
- cap: E,
699
- block: D,
700
- isRemote: S,
701
- pageSize: m,
702
- remote: x,
703
- onEdit: O,
711
+ results: D,
712
+ cap: O,
713
+ block: k,
714
+ isRemote: y,
715
+ pageSize: h,
716
+ remote: w,
717
+ onEdit: A,
704
718
  itemLabel: a,
705
719
  itemsLabel: o
706
720
  }
707
721
  };
708
722
  }
709
723
  //#endregion
710
- export { L as a, O as c, E as d, w as f, K as i, T as l, X as n, I as o, Y as r, A as s, ue as t, D as u };
724
+ //#region src/components/EntryPicker/selected-items.tsx
725
+ function _e({ items: e, selected: n, onChange: r, onEdit: i, isDisabled: a, canReorder: o, emptyLabel: s }) {
726
+ let c = y(), l = (e, t) => O(e) ? `${c}-reason-${t}` : void 0, u = (e, o) => /* @__PURE__ */ T("span", {
727
+ className: "ds-entry-picker__item-actions",
728
+ children: [
729
+ /* @__PURE__ */ w(j, { item: e }),
730
+ /* @__PURE__ */ w(M, {
731
+ item: e,
732
+ onEdit: e.tone === "removed" ? void 0 : i,
733
+ isDisabled: a
734
+ }),
735
+ /* @__PURE__ */ w(t, {
736
+ variant: "simple",
737
+ size: "sm",
738
+ isIconOnly: !0,
739
+ iconStart: "x",
740
+ "aria-label": `Remove ${e.title}`,
741
+ "aria-describedby": o,
742
+ isDisabled: a,
743
+ onClick: () => r(n.filter((t) => t !== e.id))
744
+ })
745
+ ]
746
+ });
747
+ return e.length === 0 ? /* @__PURE__ */ w("p", {
748
+ className: "ds-entry-picker__empty",
749
+ children: s
750
+ }) : o ? /* @__PURE__ */ w(g, {
751
+ items: n,
752
+ onReorder: r,
753
+ isDisabled: a,
754
+ children: e.map((e, t) => /* @__PURE__ */ w(_, {
755
+ id: e.id,
756
+ label: e.title,
757
+ "data-tone": e.tone,
758
+ handleDescribedBy: l(e, t),
759
+ action: u(e, l(e, t)),
760
+ children: /* @__PURE__ */ w("div", {
761
+ className: "ds-entry",
762
+ children: /* @__PURE__ */ w(A, {
763
+ item: e,
764
+ reasonId: l(e, t)
765
+ })
766
+ })
767
+ }, e.id))
768
+ }) : /* @__PURE__ */ w("ul", {
769
+ className: "ds-entry-picker__list",
770
+ children: e.map((e, t) => /* @__PURE__ */ T("li", {
771
+ className: "ds-entry-picker__row ds-field-surface",
772
+ "data-tone": e.tone,
773
+ children: [/* @__PURE__ */ w("div", {
774
+ className: "ds-entry",
775
+ children: /* @__PURE__ */ w(A, {
776
+ item: e,
777
+ reasonId: l(e, t)
778
+ })
779
+ }), u(e, l(e, t))]
780
+ }, e.id))
781
+ });
782
+ }
783
+ //#endregion
784
+ //#region src/components/EntryPicker/index.tsx
785
+ var ve = [];
786
+ function ye({ items: e = ve, value: n, defaultValue: r = [], onValueChange: i, mode: a = "multiple", max: o, label: s = "Entries", emptyLabel: c = "Nothing selected yet.", addLabel: l = "Choose entries", itemLabel: u = "entry", itemsLabel: d = "entries", isReorderable: f = !0, isDisabled: p = !1, loadPage: h, pageSize: g = 10, resolveItem: _, onEditItem: v, onCreate: y, isCreating: x = !1, refreshKey: C, dialogTitle: E, dialogDescription: D, isDialogHidden: O = !1, className: k, ...A }) {
787
+ let [j, M] = S(r), N = n ?? j, [F, I] = S(!1), L = ge(N, e, {
788
+ resolveItem: _,
789
+ refreshKey: C,
790
+ loadPage: h,
791
+ pageSize: g,
792
+ mode: a,
793
+ max: o,
794
+ onEditItem: v
795
+ }, {
796
+ isOpen: F,
797
+ isDisabled: p,
798
+ itemLabel: u,
799
+ itemsLabel: d,
800
+ close: () => I(!1)
801
+ }), { selection: R, remote: z, cap: B, editItem: H } = L, U = V(`Couldn't load selected ${d}`, R.status, R.error, R.retry), W = (e) => {
802
+ p || (n === void 0 && M(e), i?.(e));
803
+ }, G = (e, t) => {
804
+ R.remember([t], L.revision, e), W(e);
805
+ }, K = (e) => {
806
+ let t = L.choice(e);
807
+ t && (a === "single" ? (G(N[0] === e ? [] : [e], t), I(!1)) : N.includes(e) ? W(N.filter((t) => t !== e)) : G([...N, e], t));
808
+ }, { known: q, failures: J } = R, Y = !!_, X = b(() => P({
809
+ selected: N,
810
+ items: e,
811
+ pageItems: z.items,
812
+ known: q,
813
+ failures: J,
814
+ hasResolver: Y,
815
+ itemLabel: u
816
+ }), [
817
+ N,
818
+ e,
819
+ z.items,
820
+ q,
821
+ J,
822
+ Y,
823
+ u
824
+ ]);
825
+ return /* @__PURE__ */ T(m, {
826
+ ...A,
827
+ className: ["ds-entry-picker", k].filter(Boolean).join(" "),
828
+ label: s,
829
+ count: re(a, N.length, o),
830
+ limit: A.limit === void 0 ? B.limit : A.limit,
831
+ children: [
832
+ /* @__PURE__ */ w(_e, {
833
+ items: X,
834
+ selected: N,
835
+ onChange: W,
836
+ onEdit: H,
837
+ isDisabled: p,
838
+ canReorder: f && a === "multiple" && X.length > 1,
839
+ emptyLabel: c
840
+ }),
841
+ U,
842
+ /* @__PURE__ */ T("div", {
843
+ className: "ds-entry-picker__actions",
844
+ children: [/* @__PURE__ */ w(t, {
845
+ variant: "neutral",
846
+ size: "sm",
847
+ iconStart: "plus",
848
+ isDisabled: p,
849
+ onClick: () => I(!0),
850
+ children: l
851
+ }), N.length > 0 && /* @__PURE__ */ w(t, {
852
+ variant: "simple",
853
+ size: "sm",
854
+ isDisabled: p,
855
+ onClick: () => W([]),
856
+ children: "Clear"
857
+ })]
858
+ }),
859
+ /* @__PURE__ */ w(Z, {
860
+ ...L.dialog,
861
+ isOpen: F,
862
+ onClose: () => I(!1),
863
+ onToggle: K,
864
+ addLabel: l,
865
+ onCreate: y,
866
+ isCreating: x,
867
+ dialogTitle: E,
868
+ dialogDescription: D,
869
+ isDialogHidden: O
870
+ })
871
+ ]
872
+ });
873
+ }
874
+ //#endregion
875
+ export { Z as a, P as c, ne as i, k as l, ge as n, V as o, re as r, B as s, ye as t };
711
876
 
712
- //# sourceMappingURL=use-picker-session-BSpOwnQ-.js.map
877
+ //# sourceMappingURL=EntryPicker-Ie9T47hA.js.map