@midas-ds/components 1.0.2 → 1.0.3

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 (125) hide show
  1. package/Button-B4vMZbC6.js +182 -0
  2. package/CHANGELOG.md +10 -0
  3. package/Checkbox-DnKWanep.js +402 -0
  4. package/{Collection-B3xUVWPF.js → Collection-COLWgm24.js} +179 -152
  5. package/Dialog-Cb6toyXO.js +1951 -0
  6. package/DragAndDrop-B0T3WgjL.js +40 -0
  7. package/FocusScope-C8i7CH6y.js +513 -0
  8. package/Form-BQQs3jUk.js +238 -0
  9. package/Group-CdwXhx8Q.js +42 -0
  10. package/{Hidden-BQWDvze4.js → Hidden-DngIphiL.js} +1 -1
  11. package/Link-iAZLB3RI.js +75 -0
  12. package/ListBox-BKWkIIm6.js +474 -0
  13. package/ListKeyboardDelegate-BH-K5hyq.js +172 -0
  14. package/{PressResponder-DP8ZDNGy.js → PressResponder-Cz-TRBHO.js} +10 -10
  15. package/README.md +21 -3
  16. package/SelectionManager-8o40f7mx.js +1047 -0
  17. package/Separator-BlvmQjwz.js +49 -0
  18. package/Tag--W5TgxmK.js +728 -0
  19. package/Text-CQPW6xs7.js +15 -0
  20. package/TextField-DeK_yiK-.js +225 -0
  21. package/TextField.module-0-u4LVPp.js +143 -0
  22. package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-CFx06Bae.js} +1 -1
  23. package/{context-ScOIq_Gu.js → context-Bnqknrce.js} +1 -1
  24. package/index-B-jHjTDC.js +120 -0
  25. package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
  26. package/index-DK9ZACEc.js +642 -0
  27. package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
  28. package/index.js +45 -47
  29. package/index15.js +1 -1
  30. package/index16.js +1 -1
  31. package/index25.js +1 -1
  32. package/index26.js +1 -1
  33. package/index3.js +2 -4
  34. package/index31.js +3 -3
  35. package/index32.js +2 -2
  36. package/index33.js +2 -2
  37. package/index34.js +1 -1
  38. package/index35.js +1 -1
  39. package/index36.js +1 -1
  40. package/index37.js +1 -1
  41. package/index38.js +1 -1
  42. package/index39.js +1 -1
  43. package/index40.js +1 -1
  44. package/index41.js +1 -1
  45. package/index42.js +1 -1
  46. package/index43.js +1 -1
  47. package/index45.js +3 -3
  48. package/index5.js +1 -1
  49. package/index50.js +1 -1
  50. package/index52.js +3 -3
  51. package/index53.js +3 -3
  52. package/index54.js +1 -1
  53. package/index55.js +4 -4
  54. package/index56.js +1 -1
  55. package/index57.js +1 -1
  56. package/index58.js +1 -1
  57. package/index59.js +3 -3
  58. package/index60.js +1 -1
  59. package/index61.js +1 -1
  60. package/index62.js +1 -1
  61. package/index63.js +4 -4
  62. package/index64.js +3 -3
  63. package/index65.js +3 -3
  64. package/index66.js +1 -1
  65. package/index67.js +3 -3
  66. package/index68.js +2 -2
  67. package/index69.js +1 -1
  68. package/index71.js +1 -1
  69. package/index76.js +5 -5
  70. package/index77.js +2 -2
  71. package/index78.js +2 -2
  72. package/index79.js +1 -1
  73. package/index80.js +226 -227
  74. package/index81.js +197 -199
  75. package/index82.js +192 -195
  76. package/index83.js +181 -183
  77. package/index84.js +52 -54
  78. package/index85.js +261 -262
  79. package/index86.js +262 -262
  80. package/index87.js +209 -211
  81. package/index88.js +436 -440
  82. package/index89.js +962 -964
  83. package/index90.js +2401 -2399
  84. package/index92.js +5 -5
  85. package/index93.js +1 -1
  86. package/index94.js +1 -1
  87. package/link/Link.d.ts +2 -2
  88. package/link-button/LinkButton.d.ts +1 -1
  89. package/package.json +7 -1
  90. package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
  91. package/textfield/index.d.ts +0 -2
  92. package/{useControlledState-S_TYcV_c.js → useControlledState-DrAoodI6.js} +1 -1
  93. package/{useDescription-D4_zk_sA.js → useDescription-BPs7eRff.js} +1 -1
  94. package/useField-Dz62UHCP.js +67 -0
  95. package/{useFilter-BnJDBCkt.js → useFilter-ViwzkzZe.js} +1 -1
  96. package/useFocusRing-BKGhL91C.js +1297 -0
  97. package/{useFocusable-C-N9wcwm.js → useFocusable-CRSmYEQc.js} +11 -8
  98. package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-CVEvUCJL.js} +3 -3
  99. package/useHasTabbableChild-C8y4fwiY.js +34 -0
  100. package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-CD74uzLh.js} +19 -19
  101. package/useListState-DKnP5TB5.js +119 -0
  102. package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-DsZ-ZWSk.js} +29 -29
  103. package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-BHTLh8Ob.js} +5 -5
  104. package/Button-CCevm2s3.js +0 -183
  105. package/Checkbox-CllWDBxF.js +0 -405
  106. package/Dialog-CLTyYwkS.js +0 -1889
  107. package/DragAndDrop-OTN7La7U.js +0 -42
  108. package/FocusScope-BR0SJ-cZ.js +0 -512
  109. package/Form-DXLoQL91.js +0 -240
  110. package/Group-DPMuN3h8.js +0 -44
  111. package/Label-C18A_4Z5.js +0 -69
  112. package/Link-BU1h3K2a.js +0 -77
  113. package/ListBox-D21tdwTs.js +0 -463
  114. package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
  115. package/SelectionManager-D4WtKtey.js +0 -988
  116. package/Separator-DLUHK9vv.js +0 -48
  117. package/Tag-CEd6WWSc.js +0 -725
  118. package/Text-DGLaY3HR.js +0 -17
  119. package/TextField-C_hq9WeT.js +0 -226
  120. package/TextField.module-Cwq1FAm7.js +0 -141
  121. package/index-CEg5vZQH.js +0 -132
  122. package/index-CgfokhRq.js +0 -674
  123. package/useFocusRing-D97-G3fT.js +0 -1324
  124. package/useHasTabbableChild-DeuCnGGv.js +0 -34
  125. package/useListState-DSOTbsL3.js +0 -119
@@ -1,21 +1,21 @@
1
- import { a as R } from "./Hidden-BQWDvze4.js";
2
- import { createPortal as P } from "react-dom";
3
- import u, { useMemo as m, cloneElement as _, forwardRef as k, useContext as p, createContext as y, useRef as z, useCallback as v, useState as A } from "react";
4
- import { g as w, l as T } from "./useFocusRing-D97-G3fT.js";
5
- import { s as I } from "./index-CEg5vZQH.js";
6
- class b {
1
+ import { a as P } from "./Hidden-DngIphiL.js";
2
+ import { createPortal as _ } from "react-dom";
3
+ import u, { useMemo as S, cloneElement as z, forwardRef as $, useContext as y, createContext as p, useRef as A, useCallback as m, useState as I } from "react";
4
+ import { g as w, k as T } from "./useFocusRing-BKGhL91C.js";
5
+ import { s as V } from "./index-B-jHjTDC.js";
6
+ class x {
7
7
  get childNodes() {
8
8
  throw new Error("childNodes is not supported");
9
9
  }
10
10
  clone() {
11
- let e = new b(this.type, this.key);
11
+ let e = new x(this.type, this.key);
12
12
  return e.value = this.value, e.level = this.level, e.hasChildNodes = this.hasChildNodes, e.rendered = this.rendered, e.textValue = this.textValue, e["aria-label"] = this["aria-label"], e.index = this.index, e.parentKey = this.parentKey, e.prevKey = this.prevKey, e.nextKey = this.nextKey, e.firstChildKey = this.firstChildKey, e.lastChildKey = this.lastChildKey, e.props = this.props, e.render = this.render, e;
13
13
  }
14
14
  constructor(e, t) {
15
15
  this.value = null, this.level = 0, this.hasChildNodes = !1, this.rendered = null, this.textValue = "", this["aria-label"] = void 0, this.index = 0, this.parentKey = null, this.prevKey = null, this.nextKey = null, this.firstChildKey = null, this.lastChildKey = null, this.props = {}, this.type = e, this.key = t;
16
16
  }
17
17
  }
18
- class V {
18
+ class b {
19
19
  get size() {
20
20
  return this.keyMap.size;
21
21
  }
@@ -31,9 +31,9 @@ class V {
31
31
  let t = this.keyMap;
32
32
  return {
33
33
  *[Symbol.iterator]() {
34
- let i = t.get(e), n = (i == null ? void 0 : i.firstChildKey) != null ? t.get(i.firstChildKey) : null;
35
- for (; n; )
36
- yield n, n = n.nextKey != null ? t.get(n.nextKey) : void 0;
34
+ let n = t.get(e), l = (n == null ? void 0 : n.firstChildKey) != null ? t.get(n.firstChildKey) : null;
35
+ for (; l; )
36
+ yield l, l = l.nextKey != null ? t.get(l.nextKey) : void 0;
37
37
  }
38
38
  };
39
39
  }
@@ -42,8 +42,8 @@ class V {
42
42
  if (!t) return null;
43
43
  if (t.prevKey != null) {
44
44
  for (t = this.keyMap.get(t.prevKey); t && t.type !== "item" && t.lastChildKey != null; ) t = this.keyMap.get(t.lastChildKey);
45
- var i;
46
- return (i = t == null ? void 0 : t.key) !== null && i !== void 0 ? i : null;
45
+ var n;
46
+ return (n = t == null ? void 0 : t.key) !== null && n !== void 0 ? n : null;
47
47
  }
48
48
  return t.parentKey;
49
49
  }
@@ -86,15 +86,42 @@ class V {
86
86
  if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
87
87
  this.keyMap.delete(e);
88
88
  }
89
- commit(e, t, i = !1) {
89
+ commit(e, t, n = !1) {
90
90
  if (this.frozen) throw new Error("Cannot commit a frozen collection");
91
- this.firstKey = e, this.lastKey = t, this.frozen = !i;
91
+ this.firstKey = e, this.lastKey = t, this.frozen = !n;
92
+ }
93
+ // TODO: this is pretty specific to menu, will need to check if it is generic enough
94
+ // Will need to handle varying levels I assume but will revisit after I get searchable menu working for base menu
95
+ // TODO: an alternative is to simply walk the collection and add all item nodes that match the filter and any sections/separators we encounter
96
+ // to an array, then walk that new array and fix all the next/Prev keys while adding them to the new collection
97
+ filter(e) {
98
+ let t = new b(), n = null;
99
+ for (let l of this)
100
+ if (l.type === "section" && l.hasChildNodes) {
101
+ let i = l.clone(), s = null;
102
+ for (let d of this.getChildren(l.key)) if (e(d.textValue) || d.type === "header") {
103
+ let o = d.clone();
104
+ s == null && (i.firstChildKey = o.key), t.firstKey == null && (t.firstKey = i.key), s && s.parentKey === o.parentKey ? (s.nextKey = o.key, o.prevKey = s.key) : o.prevKey = null, o.nextKey = null, t.addNode(o), s = o;
105
+ }
106
+ s && (s.type !== "header" ? (i.lastChildKey = s.key, n == null ? i.prevKey = null : (n.type === "section" || n.type === "separator") && (n.nextKey = i.key, i.prevKey = n.key), i.nextKey = null, n = i, t.addNode(i)) : (t.firstKey === i.key && (t.firstKey = null), t.removeNode(s.key)));
107
+ } else if (l.type === "separator") {
108
+ let i = l.clone();
109
+ i.nextKey = null, (n == null ? void 0 : n.type) === "section" && (n.nextKey = i.key, i.prevKey = n.key, n = i, t.addNode(i));
110
+ } else if (e(l.textValue)) {
111
+ let i = l.clone();
112
+ t.firstKey == null && (t.firstKey = i.key), n != null && n.type !== "section" && n.type !== "separator" && n.parentKey === i.parentKey ? (n.nextKey = i.key, i.prevKey = n.key) : i.prevKey = null, i.nextKey = null, t.addNode(i), n = i;
113
+ }
114
+ if ((n == null ? void 0 : n.type) === "separator" && n.nextKey === null) {
115
+ let l;
116
+ n.prevKey != null && (l = t.getItem(n.prevKey), l.nextKey = null), t.removeNode(n.key), n = l;
117
+ }
118
+ return t.lastKey = (n == null ? void 0 : n.key) || null, t;
92
119
  }
93
120
  constructor() {
94
121
  this.keyMap = /* @__PURE__ */ new Map(), this.firstKey = null, this.lastKey = null, this.frozen = !1;
95
122
  }
96
123
  }
97
- class K {
124
+ class N {
98
125
  *[Symbol.iterator]() {
99
126
  let e = this.firstChild;
100
127
  for (; e; )
@@ -140,9 +167,9 @@ class K {
140
167
  insertBefore(e, t) {
141
168
  if (t == null) return this.appendChild(e);
142
169
  this.ownerDocument.startTransaction(), e.parentNode && e.parentNode.removeChild(e), e.nextSibling = t, e.previousSibling = t.previousSibling, e.index = t.index, this.firstChild === t ? this.firstChild = e : t.previousSibling && (t.previousSibling.nextSibling = e), t.previousSibling = e, e.parentNode = t.parentNode;
143
- let i = t;
144
- for (; i; )
145
- i.index++, i = i.nextSibling;
170
+ let n = t;
171
+ for (; n; )
172
+ n.index++, n = n.nextSibling;
146
173
  e.hasSetProps && this.ownerDocument.addNode(e), this.ownerDocument.endTransaction(), this.ownerDocument.queueUpdate();
147
174
  }
148
175
  removeChild(e) {
@@ -161,7 +188,7 @@ class K {
161
188
  this._firstChild = null, this._lastChild = null, this._previousSibling = null, this._nextSibling = null, this._parentNode = null, this.ownerDocument = e;
162
189
  }
163
190
  }
164
- class S extends K {
191
+ class C extends N {
165
192
  get index() {
166
193
  return this._index;
167
194
  }
@@ -169,26 +196,26 @@ class S extends K {
169
196
  this._index = e, this.ownerDocument.markDirty(this);
170
197
  }
171
198
  get level() {
172
- return this.parentNode instanceof S ? this.parentNode.level + (this.node.type === "item" ? 1 : 0) : 0;
199
+ return this.parentNode instanceof C ? this.parentNode.level + (this.node.type === "item" ? 1 : 0) : 0;
173
200
  }
174
201
  updateNode() {
175
- var e, t, i, n;
176
- let l = this.ownerDocument.getMutableNode(this);
177
- l.index = this.index, l.level = this.level, l.parentKey = this.parentNode instanceof S ? this.parentNode.node.key : null;
202
+ var e, t, n, l;
203
+ let i = this.ownerDocument.getMutableNode(this);
204
+ i.index = this.index, i.level = this.level, i.parentKey = this.parentNode instanceof C ? this.parentNode.node.key : null;
178
205
  var s;
179
- l.prevKey = (s = (e = this.previousSibling) === null || e === void 0 ? void 0 : e.node.key) !== null && s !== void 0 ? s : null;
180
- var a;
181
- l.nextKey = (a = (t = this.nextSibling) === null || t === void 0 ? void 0 : t.node.key) !== null && a !== void 0 ? a : null, l.hasChildNodes = !!this.firstChild;
182
- var r;
183
- l.firstChildKey = (r = (i = this.firstChild) === null || i === void 0 ? void 0 : i.node.key) !== null && r !== void 0 ? r : null;
206
+ i.prevKey = (s = (e = this.previousSibling) === null || e === void 0 ? void 0 : e.node.key) !== null && s !== void 0 ? s : null;
184
207
  var d;
185
- l.lastChildKey = (d = (n = this.lastChild) === null || n === void 0 ? void 0 : n.node.key) !== null && d !== void 0 ? d : null;
208
+ i.nextKey = (d = (t = this.nextSibling) === null || t === void 0 ? void 0 : t.node.key) !== null && d !== void 0 ? d : null, i.hasChildNodes = !!this.firstChild;
209
+ var o;
210
+ i.firstChildKey = (o = (n = this.firstChild) === null || n === void 0 ? void 0 : n.node.key) !== null && o !== void 0 ? o : null;
211
+ var a;
212
+ i.lastChildKey = (a = (l = this.lastChild) === null || l === void 0 ? void 0 : l.node.key) !== null && a !== void 0 ? a : null;
186
213
  }
187
- setProps(e, t, i, n) {
188
- let l = this.ownerDocument.getMutableNode(this), { value: s, textValue: a, id: r, ...d } = e;
189
- if (d.ref = t, l.props = d, l.rendered = i, l.render = n, l.value = s, l.textValue = a || (typeof d.children == "string" ? d.children : "") || e["aria-label"] || "", r != null && r !== l.key) {
214
+ setProps(e, t, n, l) {
215
+ let i = this.ownerDocument.getMutableNode(this), { value: s, textValue: d, id: o, ...a } = e;
216
+ if (a.ref = t, i.props = a, i.rendered = n, i.render = l, i.value = s, i.textValue = d || (typeof a.children == "string" ? a.children : "") || e["aria-label"] || "", o != null && o !== i.key) {
190
217
  if (this.hasSetProps) throw new Error("Cannot change the id of an item");
191
- l.key = r;
218
+ i.key = o;
192
219
  }
193
220
  this.hasSetProps || (this.ownerDocument.addNode(this), this.ownerDocument.endTransaction(), this.hasSetProps = !0), this.ownerDocument.queueUpdate();
194
221
  }
@@ -204,15 +231,15 @@ class S extends K {
204
231
  removeAttribute() {
205
232
  }
206
233
  constructor(e, t) {
207
- super(t), this.nodeType = 8, this._index = 0, this.hasSetProps = !1, this.node = new b(e, `react-aria-${++t.nodeId}`), this.ownerDocument.startTransaction();
234
+ super(t), this.nodeType = 8, this._index = 0, this.hasSetProps = !1, this.node = new x(e, `react-aria-${++t.nodeId}`), this.ownerDocument.startTransaction();
208
235
  }
209
236
  }
210
- class B extends K {
237
+ class B extends N {
211
238
  get isConnected() {
212
239
  return this.isMounted;
213
240
  }
214
241
  createElement(e) {
215
- return new S(e, this);
242
+ return new C(e, this);
216
243
  }
217
244
  /**
218
245
  * Lazily gets a mutable instance of a Node. If the node has already
@@ -238,12 +265,12 @@ class B extends K {
238
265
  let t = this.getMutableCollection();
239
266
  if (!t.getItem(e.node.key)) {
240
267
  t.addNode(e.node);
241
- for (let i of e) this.addNode(i);
268
+ for (let n of e) this.addNode(n);
242
269
  }
243
270
  this.markDirty(e);
244
271
  }
245
272
  removeNode(e) {
246
- for (let i of e) this.removeNode(i);
273
+ for (let n of e) this.removeNode(n);
247
274
  this.getMutableCollection().removeNode(e.node.key), this.markDirty(e);
248
275
  }
249
276
  /** Finalizes the collection update, updating all nodes and freezing the collection. */
@@ -251,13 +278,13 @@ class B extends K {
251
278
  return this.transactionCount > 0 ? this.collection : (this.updateCollection(), this.collection);
252
279
  }
253
280
  updateCollection() {
254
- for (let l of this.dirtyNodes) l instanceof S && l.isConnected && l.updateNode();
281
+ for (let i of this.dirtyNodes) i instanceof C && i.isConnected && i.updateNode();
255
282
  if (this.dirtyNodes.clear(), this.mutatedNodes.size || this.collectionMutated) {
256
283
  var e, t;
257
- let l = this.getMutableCollection();
258
- for (let s of this.mutatedNodes) s.isConnected && l.addNode(s.node);
259
- var i, n;
260
- l.commit((i = (e = this.firstChild) === null || e === void 0 ? void 0 : e.node.key) !== null && i !== void 0 ? i : null, (n = (t = this.lastChild) === null || t === void 0 ? void 0 : t.node.key) !== null && n !== void 0 ? n : null, this.isSSR), this.mutatedNodes.clear();
284
+ let i = this.getMutableCollection();
285
+ for (let s of this.mutatedNodes) s.isConnected && i.addNode(s.node);
286
+ var n, l;
287
+ i.commit((n = (e = this.firstChild) === null || e === void 0 ? void 0 : e.node.key) !== null && n !== void 0 ? n : null, (l = (t = this.lastChild) === null || t === void 0 ? void 0 : t.node.key) !== null && l !== void 0 ? l : null, this.isSSR), this.mutatedNodes.clear();
261
288
  }
262
289
  this.collectionMutated = !1;
263
290
  }
@@ -275,19 +302,19 @@ class B extends K {
275
302
  super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = /* @__PURE__ */ new Set(), this.isSSR = !1, this.nodeId = 0, this.nodesByProps = /* @__PURE__ */ new WeakMap(), this.isMounted = !0, this.mutatedNodes = /* @__PURE__ */ new Set(), this.subscriptions = /* @__PURE__ */ new Set(), this.transactionCount = 0, this.collection = e, this.collectionMutated = !0;
276
303
  }
277
304
  }
278
- function D(o) {
279
- let { children: e, items: t, idScope: i, addIdAndValue: n, dependencies: l = [] } = o, s = m(() => /* @__PURE__ */ new WeakMap(), l);
280
- return m(() => {
305
+ function D(r) {
306
+ let { children: e, items: t, idScope: n, addIdAndValue: l, dependencies: i = [] } = r, s = S(() => /* @__PURE__ */ new WeakMap(), i);
307
+ return S(() => {
281
308
  if (t && typeof e == "function") {
282
- let d = [];
309
+ let a = [];
283
310
  for (let c of t) {
284
311
  let h = s.get(c);
285
312
  if (!h) {
286
313
  h = e(c);
287
- var a, r;
288
- let f = (r = (a = h.props.id) !== null && a !== void 0 ? a : c.key) !== null && r !== void 0 ? r : c.id;
314
+ var d, o;
315
+ let f = (o = (d = h.props.id) !== null && d !== void 0 ? d : c.key) !== null && o !== void 0 ? o : c.id;
289
316
  if (f == null) throw new Error("Could not determine key for item");
290
- i && (f = i + ":" + f), h = _(h, n ? {
317
+ n && (f = n + ":" + f), h = z(h, l ? {
291
318
  key: f,
292
319
  id: f,
293
320
  value: c
@@ -295,164 +322,164 @@ function D(o) {
295
322
  key: f
296
323
  }), s.set(c, h);
297
324
  }
298
- d.push(h);
325
+ a.push(h);
299
326
  }
300
- return d;
327
+ return a;
301
328
  } else if (typeof e != "function") return e;
302
329
  }, [
303
330
  e,
304
331
  t,
305
332
  s,
306
- i,
307
- n
333
+ n,
334
+ l
308
335
  ]);
309
336
  }
310
- const M = /* @__PURE__ */ y(!1), g = /* @__PURE__ */ y(null);
311
- function X(o) {
312
- if (p(g))
313
- return o.content;
314
- let { collection: t, document: i } = L(o.createCollection);
315
- return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(R, null, /* @__PURE__ */ u.createElement(g.Provider, {
316
- value: i
317
- }, o.content)), /* @__PURE__ */ u.createElement(q, {
318
- render: o.children,
337
+ const M = /* @__PURE__ */ p(!1), g = /* @__PURE__ */ p(null);
338
+ function X(r) {
339
+ if (y(g))
340
+ return r.content;
341
+ let { collection: t, document: n } = L(r.createCollection);
342
+ return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(P, null, /* @__PURE__ */ u.createElement(g.Provider, {
343
+ value: n
344
+ }, r.content)), /* @__PURE__ */ u.createElement(q, {
345
+ render: r.children,
319
346
  collection: t
320
347
  }));
321
348
  }
322
- function q({ collection: o, render: e }) {
323
- return e(o);
349
+ function q({ collection: r, render: e }) {
350
+ return e(r);
324
351
  }
325
- function F(o, e, t) {
326
- let i = w(), n = z(i);
327
- n.current = i;
328
- let l = v(() => n.current ? t() : e(), [
352
+ function U(r, e, t) {
353
+ let n = w(), l = A(n);
354
+ l.current = n;
355
+ let i = m(() => l.current ? t() : e(), [
329
356
  e,
330
357
  t
331
358
  ]);
332
- return I.useSyncExternalStore(o, l);
359
+ return V.useSyncExternalStore(r, i);
333
360
  }
334
- const U = typeof u.useSyncExternalStore == "function" ? u.useSyncExternalStore : F;
335
- function L(o) {
336
- let [e] = A(() => new B((o == null ? void 0 : o()) || new V())), t = v((s) => e.subscribe(s), [
361
+ const F = typeof u.useSyncExternalStore == "function" ? u.useSyncExternalStore : U;
362
+ function L(r) {
363
+ let [e] = I(() => new B((r == null ? void 0 : r()) || new b())), t = m((s) => e.subscribe(s), [
337
364
  e
338
- ]), i = v(() => {
365
+ ]), n = m(() => {
339
366
  let s = e.getCollection();
340
367
  return e.isSSR && e.resetAfterSSR(), s;
341
368
  }, [
342
369
  e
343
- ]), n = v(() => (e.isSSR = !0, e.getCollection()), [
370
+ ]), l = m(() => (e.isSSR = !0, e.getCollection()), [
344
371
  e
345
- ]), l = U(t, i, n);
372
+ ]), i = F(t, n, l);
346
373
  return T(() => (e.isMounted = !0, () => {
347
374
  e.isMounted = !1;
348
375
  }), [
349
376
  e
350
377
  ]), {
351
- collection: l,
378
+ collection: i,
352
379
  document: e
353
380
  };
354
381
  }
355
- const C = /* @__PURE__ */ y(null);
356
- function N(o, e, t, i, n, l) {
357
- let s = v((r) => {
358
- r == null || r.setProps(e, t, i, l);
382
+ const v = /* @__PURE__ */ p(null);
383
+ function E(r, e, t, n, l, i) {
384
+ let s = m((o) => {
385
+ o == null || o.setProps(e, t, n, i);
359
386
  }, [
360
387
  e,
361
388
  t,
362
- i,
363
- l
364
- ]), a = p(C);
365
- if (a) {
366
- let r = a.ownerDocument.nodesByProps.get(e);
367
- return r || (r = a.ownerDocument.createElement(o), r.setProps(e, t, i, l), a.appendChild(r), a.ownerDocument.updateCollection(), a.ownerDocument.nodesByProps.set(e, r)), n ? /* @__PURE__ */ u.createElement(C.Provider, {
368
- value: r
369
- }, n) : null;
370
- }
371
- return /* @__PURE__ */ u.createElement(o, {
389
+ n,
390
+ i
391
+ ]), d = y(v);
392
+ if (d) {
393
+ let o = d.ownerDocument.nodesByProps.get(e);
394
+ return o || (o = d.ownerDocument.createElement(r), o.setProps(e, t, n, i), d.appendChild(o), d.ownerDocument.updateCollection(), d.ownerDocument.nodesByProps.set(e, o)), l ? /* @__PURE__ */ u.createElement(v.Provider, {
395
+ value: o
396
+ }, l) : null;
397
+ }
398
+ return /* @__PURE__ */ u.createElement(r, {
372
399
  ref: s
373
- }, n);
400
+ }, l);
374
401
  }
375
- function Y(o, e) {
376
- let t = ({ node: n }) => e(n.props, n.props.ref, n), i = k((n, l) => {
377
- if (!p(M)) {
402
+ function Y(r, e) {
403
+ let t = ({ node: l }) => e(l.props, l.props.ref, l), n = $((l, i) => {
404
+ if (!y(M)) {
378
405
  if (e.length >= 3) throw new Error(e.name + " cannot be rendered outside a collection.");
379
- return e(n, l);
406
+ return e(l, i);
380
407
  }
381
- return N(o, n, l, "children" in n ? n.children : null, null, (a) => /* @__PURE__ */ u.createElement(t, {
382
- node: a
408
+ return E(r, l, i, "children" in l ? l.children : null, null, (d) => /* @__PURE__ */ u.createElement(t, {
409
+ node: d
383
410
  }));
384
411
  });
385
- return i.displayName = e.name, i;
412
+ return n.displayName = e.name, n;
386
413
  }
387
- function Z(o, e, t = E) {
388
- let i = ({ node: l }) => e(l.props, l.props.ref, l), n = k((l, s) => {
389
- let a = t(l);
390
- var r;
391
- return (r = N(o, l, s, null, a, (d) => /* @__PURE__ */ u.createElement(i, {
392
- node: d
393
- }))) !== null && r !== void 0 ? r : /* @__PURE__ */ u.createElement(u.Fragment, null);
414
+ function Z(r, e, t = R) {
415
+ let n = ({ node: i }) => e(i.props, i.props.ref, i), l = $((i, s) => {
416
+ let d = t(i);
417
+ var o;
418
+ return (o = E(r, i, s, null, d, (a) => /* @__PURE__ */ u.createElement(n, {
419
+ node: a
420
+ }))) !== null && o !== void 0 ? o : /* @__PURE__ */ u.createElement(u.Fragment, null);
394
421
  });
395
- return n.displayName = e.name, n;
422
+ return l.displayName = e.name, l;
396
423
  }
397
- function E(o) {
424
+ function R(r) {
398
425
  return D({
399
- ...o,
426
+ ...r,
400
427
  addIdAndValue: !0
401
428
  });
402
429
  }
403
- const x = /* @__PURE__ */ y(null);
404
- function ee(o) {
405
- let e = p(x), t = ((e == null ? void 0 : e.dependencies) || []).concat(o.dependencies), i = o.idScope || (e == null ? void 0 : e.idScope), n = E({
406
- ...o,
407
- idScope: i,
430
+ const K = /* @__PURE__ */ p(null);
431
+ function ee(r) {
432
+ let e = y(K), t = ((e == null ? void 0 : e.dependencies) || []).concat(r.dependencies), n = r.idScope || (e == null ? void 0 : e.idScope), l = R({
433
+ ...r,
434
+ idScope: n,
408
435
  dependencies: t
409
436
  });
410
- return p(g) && (n = /* @__PURE__ */ u.createElement(W, null, n)), e = m(() => ({
437
+ return y(g) && (l = /* @__PURE__ */ u.createElement(W, null, l)), e = S(() => ({
411
438
  dependencies: t,
412
- idScope: i
439
+ idScope: n
413
440
  }), [
414
- i,
441
+ n,
415
442
  ...t
416
- ]), /* @__PURE__ */ u.createElement(x.Provider, {
443
+ ]), /* @__PURE__ */ u.createElement(K.Provider, {
417
444
  value: e
418
- }, n);
445
+ }, l);
419
446
  }
420
- function W({ children: o }) {
421
- let e = p(g), t = m(() => /* @__PURE__ */ u.createElement(g.Provider, {
447
+ function W({ children: r }) {
448
+ let e = y(g), t = S(() => /* @__PURE__ */ u.createElement(g.Provider, {
422
449
  value: null
423
450
  }, /* @__PURE__ */ u.createElement(M.Provider, {
424
451
  value: !0
425
- }, o)), [
426
- o
452
+ }, r)), [
453
+ r
427
454
  ]);
428
- return w() ? /* @__PURE__ */ u.createElement(C.Provider, {
455
+ return w() ? /* @__PURE__ */ u.createElement(v.Provider, {
429
456
  value: e
430
- }, t) : /* @__PURE__ */ P(t, e);
457
+ }, t) : /* @__PURE__ */ _(t, e);
431
458
  }
432
- const te = /* @__PURE__ */ y(null), j = {
433
- CollectionRoot({ collection: o, renderDropIndicator: e }) {
434
- return $(o, null, e);
459
+ const te = /* @__PURE__ */ p(null), j = {
460
+ CollectionRoot({ collection: r, renderDropIndicator: e }) {
461
+ return k(r, null, e);
435
462
  },
436
- CollectionBranch({ collection: o, parent: e, renderDropIndicator: t }) {
437
- return $(o, e, t);
463
+ CollectionBranch({ collection: r, parent: e, renderDropIndicator: t }) {
464
+ return k(r, e, t);
438
465
  }
439
466
  };
440
- function $(o, e, t) {
467
+ function k(r, e, t) {
441
468
  return D({
442
- items: e ? o.getChildren(e.key) : o,
469
+ items: e ? r.getChildren(e.key) : r,
443
470
  dependencies: [
444
471
  t
445
472
  ],
446
- children(i) {
447
- var n;
448
- let l = i.render(i);
449
- if (!t || i.type !== "item") return l;
450
- let s = i.key, a = o.getKeyAfter(s);
473
+ children(n) {
474
+ var l;
475
+ let i = n.render(n);
476
+ if (!t || n.type !== "item") return i;
477
+ let s = n.key, d = r.getKeyAfter(s);
451
478
  return /* @__PURE__ */ u.createElement(u.Fragment, null, t({
452
479
  type: "item",
453
480
  key: s,
454
481
  dropPosition: "before"
455
- }), l, (a == null || ((n = o.getItem(a)) === null || n === void 0 ? void 0 : n.type) !== "item") && t({
482
+ }), i, (d == null || ((l = r.getItem(d)) === null || l === void 0 ? void 0 : l.type) !== "item") && t({
456
483
  type: "item",
457
484
  key: s,
458
485
  dropPosition: "after"
@@ -460,24 +487,24 @@ function $(o, e, t) {
460
487
  }
461
488
  });
462
489
  }
463
- const ie = /* @__PURE__ */ y(j);
464
- function ne(o) {
465
- return m(() => o != null ? /* @__PURE__ */ new Set([
466
- o
490
+ const ne = /* @__PURE__ */ p(j);
491
+ function ie(r) {
492
+ return S(() => r != null ? /* @__PURE__ */ new Set([
493
+ r
467
494
  ]) : null, [
468
- o
495
+ r
469
496
  ]);
470
497
  }
471
498
  export {
472
- Y as $,
473
- ie as a,
474
- j as b,
475
- X as c,
476
- ee as d,
499
+ X as $,
500
+ ee as a,
501
+ ne as b,
502
+ Y as c,
503
+ j as d,
477
504
  te as e,
478
- ne as f,
505
+ ie as f,
479
506
  Z as g,
480
507
  D as h,
481
- V as i,
482
- b as j
508
+ b as i,
509
+ x as j
483
510
  };