@midas-ds/components 1.0.2 → 1.1.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.
- package/Button-DL6nqUco.js +182 -0
- package/CHANGELOG.md +15 -0
- package/Checkbox-q0dugR2t.js +402 -0
- package/{Collection-B3xUVWPF.js → Collection-KMFfVuzU.js} +179 -152
- package/Dialog-D6Bqrpn-.js +1952 -0
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/DragAndDrop-B0T3WgjL.js +40 -0
- package/FocusScope-B7CkxXNC.js +513 -0
- package/{Form-DXLoQL91.js → Form-BWBjJC6v.js} +79 -81
- package/Group-D7_8007y.js +42 -0
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-BQWDvze4.js → Hidden-CVlUgUJM.js} +1 -1
- package/Link-BnQvB-hH.js +75 -0
- package/ListBox-DBBiqvcR.js +474 -0
- package/ListKeyboardDelegate-gCXy-Xnn.js +172 -0
- package/PressResponder-B4g56kDz.js +31 -0
- package/README.md +21 -3
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/SelectionManager-BfXUE1qg.js +1031 -0
- package/Separator-BBX9m2O2.js +49 -0
- package/Tag-DWt0koFj.js +728 -0
- package/Text-BCF0xvqL.js +15 -0
- package/TextField-CX4eOQf6.js +225 -0
- package/TextField.module-DdICj682.js +143 -0
- package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-Dhr5caPC.js} +1 -1
- package/accordion/Accordion.d.ts +8 -8
- package/accordion/AccordionItem.d.ts +11 -3
- package/accordion/index.d.ts +0 -3
- package/{context-ScOIq_Gu.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index-B-jHjTDC.js +120 -0
- package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
- package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
- package/index.d.ts +1 -0
- package/index.js +105 -112
- package/index10.js +1 -1
- package/index11.js +1 -1
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +2 -2
- package/index16.js +2 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +2 -2
- package/index2.js +1 -1
- package/index20.js +2 -2
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +2 -2
- package/index26.js +2 -2
- package/index27.js +2 -2
- package/index28.js +1 -1
- package/index29.js +2 -8
- package/index3.js +2 -4
- package/index30.js +17 -16
- package/index31.js +3 -3
- package/index32.js +3 -3
- package/index33.js +2 -2
- package/index34.js +3 -3
- package/index35.js +1 -1
- package/index36.js +2 -2
- package/index37.js +2 -2
- package/index38.js +2 -2
- package/index39.js +2 -2
- package/index4.js +1 -1
- package/index40.js +19 -12
- package/index41.js +61 -14
- package/index42.js +44 -22
- package/index43.js +13 -11
- package/index44.js +25 -4
- package/index45.js +16 -51
- package/index46.js +19 -16
- package/index47.js +49 -27
- package/index48.js +5 -18
- package/index49.js +25 -21
- package/index5.js +1 -1
- package/index50.js +16 -47
- package/index51.js +7 -3
- package/index52.js +18 -18
- package/index53.js +16 -16
- package/index54.js +6 -4
- package/index55.js +8 -21
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +6 -9
- package/index59.js +17 -13
- package/index6.js +1 -1
- package/index60.js +20 -7
- package/index61.js +59 -7
- package/index62.js +13 -17
- package/index63.js +9 -20
- package/index64.js +40 -48
- package/index65.js +85 -15
- package/index66.js +74 -11
- package/index67.js +23 -62
- package/index68.js +64 -80
- package/index69.js +68 -62
- package/index7.js +1 -1
- package/index70.js +138 -22
- package/index71.js +66 -65
- package/index72.js +40 -78
- package/index73.js +75 -133
- package/index74.js +69 -68
- package/index75.js +96 -34
- package/index76.js +258 -65
- package/index77.js +715 -63
- package/index78.js +478 -93
- package/index79.js +303 -263
- package/index8.js +1 -1
- package/index80.js +343 -678
- package/index81.js +242 -481
- package/index82.js +1329 -282
- package/index83.js +968 -350
- package/index84.js +343 -211
- package/index85.js +2025 -1288
- package/index86.js +2313 -954
- package/index87.js +6782 -339
- package/index88.js +15 -2103
- package/index89.js +12 -2369
- package/index9.js +1 -1
- package/index90.js +4 -6832
- package/index91.js +7 -15
- package/link/Link.d.ts +2 -2
- package/link-button/LinkButton.d.ts +1 -1
- package/package.json +7 -1
- package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
- package/textfield/index.d.ts +0 -2
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-D4_zk_sA.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/useField-DMzJIIN4.js +67 -0
- package/{useFilter-BnJDBCkt.js → useFilter-Bt9dbV1U.js} +1 -1
- package/useFocusRing-9PXyKy2A.js +1297 -0
- package/{useFocusable-C-N9wcwm.js → useFocusable-CcEBZe40.js} +11 -8
- package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/useHasTabbableChild-D6DwR81L.js +34 -0
- package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-WYAbP4No.js} +19 -19
- package/useLabels-9zaZ9oa0.js +17 -0
- package/useListState-BfTeKTk5.js +119 -0
- package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-BlCbn-hX.js} +29 -29
- package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-DPkaL0la.js} +5 -5
- package/Button-CCevm2s3.js +0 -183
- package/Checkbox-CllWDBxF.js +0 -405
- package/Dialog-CLTyYwkS.js +0 -1889
- package/DragAndDrop-OTN7La7U.js +0 -42
- package/FocusScope-BR0SJ-cZ.js +0 -512
- package/Group-DPMuN3h8.js +0 -44
- package/Label-C18A_4Z5.js +0 -69
- package/Link-BU1h3K2a.js +0 -77
- package/ListBox-D21tdwTs.js +0 -463
- package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
- package/PressResponder-DP8ZDNGy.js +0 -31
- package/SelectionManager-D4WtKtey.js +0 -988
- package/Separator-DLUHK9vv.js +0 -48
- package/Tag-CEd6WWSc.js +0 -725
- package/Text-DGLaY3HR.js +0 -17
- package/TextField-C_hq9WeT.js +0 -226
- package/TextField.module-Cwq1FAm7.js +0 -141
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-CEg5vZQH.js +0 -132
- package/index-CgfokhRq.js +0 -674
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-S_TYcV_c.js +0 -45
- package/useFocusRing-D97-G3fT.js +0 -1324
- package/useHasTabbableChild-DeuCnGGv.js +0 -34
- package/useListState-DSOTbsL3.js +0 -119
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import u, { useMemo as
|
|
4
|
-
import { g as w, l as T } from "./useFocusRing-
|
|
5
|
-
import { s as
|
|
6
|
-
class
|
|
1
|
+
import { a as P } from "./Hidden-CVlUgUJM.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, l as T } from "./useFocusRing-9PXyKy2A.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
|
|
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
|
|
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
|
|
35
|
-
for (;
|
|
36
|
-
yield
|
|
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
|
|
46
|
-
return (
|
|
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,
|
|
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 = !
|
|
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
|
|
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
|
|
144
|
-
for (;
|
|
145
|
-
|
|
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
|
|
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
|
|
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,
|
|
176
|
-
let
|
|
177
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
188
|
-
let
|
|
189
|
-
if (
|
|
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
|
-
|
|
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
|
|
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
|
|
237
|
+
class B extends N {
|
|
211
238
|
get isConnected() {
|
|
212
239
|
return this.isMounted;
|
|
213
240
|
}
|
|
214
241
|
createElement(e) {
|
|
215
|
-
return new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
258
|
-
for (let s of this.mutatedNodes) s.isConnected &&
|
|
259
|
-
var
|
|
260
|
-
|
|
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(
|
|
279
|
-
let { children: e, items: t, idScope:
|
|
280
|
-
return
|
|
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
|
|
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
|
|
288
|
-
let f = (
|
|
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
|
-
|
|
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
|
-
|
|
325
|
+
a.push(h);
|
|
299
326
|
}
|
|
300
|
-
return
|
|
327
|
+
return a;
|
|
301
328
|
} else if (typeof e != "function") return e;
|
|
302
329
|
}, [
|
|
303
330
|
e,
|
|
304
331
|
t,
|
|
305
332
|
s,
|
|
306
|
-
|
|
307
|
-
|
|
333
|
+
n,
|
|
334
|
+
l
|
|
308
335
|
]);
|
|
309
336
|
}
|
|
310
|
-
const M = /* @__PURE__ */
|
|
311
|
-
function X(
|
|
312
|
-
if (
|
|
313
|
-
return
|
|
314
|
-
let { collection: t, document:
|
|
315
|
-
return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(
|
|
316
|
-
value:
|
|
317
|
-
},
|
|
318
|
-
render:
|
|
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:
|
|
323
|
-
return e(
|
|
349
|
+
function q({ collection: r, render: e }) {
|
|
350
|
+
return e(r);
|
|
324
351
|
}
|
|
325
|
-
function
|
|
326
|
-
let
|
|
327
|
-
|
|
328
|
-
let
|
|
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
|
|
359
|
+
return V.useSyncExternalStore(r, i);
|
|
333
360
|
}
|
|
334
|
-
const
|
|
335
|
-
function L(
|
|
336
|
-
let [e] =
|
|
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
|
-
]),
|
|
365
|
+
]), n = m(() => {
|
|
339
366
|
let s = e.getCollection();
|
|
340
367
|
return e.isSSR && e.resetAfterSSR(), s;
|
|
341
368
|
}, [
|
|
342
369
|
e
|
|
343
|
-
]),
|
|
370
|
+
]), l = m(() => (e.isSSR = !0, e.getCollection()), [
|
|
344
371
|
e
|
|
345
|
-
]),
|
|
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:
|
|
378
|
+
collection: i,
|
|
352
379
|
document: e
|
|
353
380
|
};
|
|
354
381
|
}
|
|
355
|
-
const
|
|
356
|
-
function
|
|
357
|
-
let s =
|
|
358
|
-
|
|
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
|
-
|
|
363
|
-
|
|
364
|
-
]),
|
|
365
|
-
if (
|
|
366
|
-
let
|
|
367
|
-
return
|
|
368
|
-
value:
|
|
369
|
-
},
|
|
370
|
-
}
|
|
371
|
-
return /* @__PURE__ */ u.createElement(
|
|
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
|
-
},
|
|
400
|
+
}, l);
|
|
374
401
|
}
|
|
375
|
-
function Y(
|
|
376
|
-
let t = ({ node:
|
|
377
|
-
if (!
|
|
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(
|
|
406
|
+
return e(l, i);
|
|
380
407
|
}
|
|
381
|
-
return
|
|
382
|
-
node:
|
|
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
|
|
412
|
+
return n.displayName = e.name, n;
|
|
386
413
|
}
|
|
387
|
-
function Z(
|
|
388
|
-
let
|
|
389
|
-
let
|
|
390
|
-
var
|
|
391
|
-
return (
|
|
392
|
-
node:
|
|
393
|
-
}))) !== 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
|
|
422
|
+
return l.displayName = e.name, l;
|
|
396
423
|
}
|
|
397
|
-
function
|
|
424
|
+
function R(r) {
|
|
398
425
|
return D({
|
|
399
|
-
...
|
|
426
|
+
...r,
|
|
400
427
|
addIdAndValue: !0
|
|
401
428
|
});
|
|
402
429
|
}
|
|
403
|
-
const
|
|
404
|
-
function ee(
|
|
405
|
-
let e =
|
|
406
|
-
...
|
|
407
|
-
idScope:
|
|
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
|
|
437
|
+
return y(g) && (l = /* @__PURE__ */ u.createElement(W, null, l)), e = S(() => ({
|
|
411
438
|
dependencies: t,
|
|
412
|
-
idScope:
|
|
439
|
+
idScope: n
|
|
413
440
|
}), [
|
|
414
|
-
|
|
441
|
+
n,
|
|
415
442
|
...t
|
|
416
|
-
]), /* @__PURE__ */ u.createElement(
|
|
443
|
+
]), /* @__PURE__ */ u.createElement(K.Provider, {
|
|
417
444
|
value: e
|
|
418
|
-
},
|
|
445
|
+
}, l);
|
|
419
446
|
}
|
|
420
|
-
function W({ children:
|
|
421
|
-
let e =
|
|
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
|
-
},
|
|
426
|
-
|
|
452
|
+
}, r)), [
|
|
453
|
+
r
|
|
427
454
|
]);
|
|
428
|
-
return w() ? /* @__PURE__ */ u.createElement(
|
|
455
|
+
return w() ? /* @__PURE__ */ u.createElement(v.Provider, {
|
|
429
456
|
value: e
|
|
430
|
-
}, t) : /* @__PURE__ */
|
|
457
|
+
}, t) : /* @__PURE__ */ _(t, e);
|
|
431
458
|
}
|
|
432
|
-
const te = /* @__PURE__ */
|
|
433
|
-
CollectionRoot({ collection:
|
|
434
|
-
return
|
|
459
|
+
const te = /* @__PURE__ */ p(null), j = {
|
|
460
|
+
CollectionRoot({ collection: r, renderDropIndicator: e }) {
|
|
461
|
+
return k(r, null, e);
|
|
435
462
|
},
|
|
436
|
-
CollectionBranch({ collection:
|
|
437
|
-
return
|
|
463
|
+
CollectionBranch({ collection: r, parent: e, renderDropIndicator: t }) {
|
|
464
|
+
return k(r, e, t);
|
|
438
465
|
}
|
|
439
466
|
};
|
|
440
|
-
function
|
|
467
|
+
function k(r, e, t) {
|
|
441
468
|
return D({
|
|
442
|
-
items: e ?
|
|
469
|
+
items: e ? r.getChildren(e.key) : r,
|
|
443
470
|
dependencies: [
|
|
444
471
|
t
|
|
445
472
|
],
|
|
446
|
-
children(
|
|
447
|
-
var
|
|
448
|
-
let
|
|
449
|
-
if (!t ||
|
|
450
|
-
let 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
|
-
}),
|
|
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
|
|
464
|
-
function
|
|
465
|
-
return
|
|
466
|
-
|
|
490
|
+
const ne = /* @__PURE__ */ p(j);
|
|
491
|
+
function ie(r) {
|
|
492
|
+
return S(() => r != null ? /* @__PURE__ */ new Set([
|
|
493
|
+
r
|
|
467
494
|
]) : null, [
|
|
468
|
-
|
|
495
|
+
r
|
|
469
496
|
]);
|
|
470
497
|
}
|
|
471
498
|
export {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
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
|
-
|
|
505
|
+
ie as f,
|
|
479
506
|
Z as g,
|
|
480
507
|
D as h,
|
|
481
|
-
|
|
482
|
-
|
|
508
|
+
b as i,
|
|
509
|
+
x as j
|
|
483
510
|
};
|