@boxcustodia/library 0.0.7 → 0.0.8
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/dist/index.d.ts +6 -1
- package/dist/index.es100.js +4 -4
- package/dist/index.es101.js +4 -14
- package/dist/index.es102.js +3 -4
- package/dist/index.es103.js +14 -57
- package/dist/index.es104.js +5 -29
- package/dist/index.es105.js +57 -12
- package/dist/index.es106.js +29 -11
- package/dist/index.es111.js +243 -1046
- package/dist/index.es112.js +12 -4
- package/dist/index.es113.js +11 -4
- package/dist/index.es114.js +7 -7
- package/dist/index.es117.js +14 -14
- package/dist/index.es118.js +813 -55
- package/dist/index.es119.js +9 -822
- package/dist/index.es120.js +5 -3
- package/dist/index.es121.js +64 -11
- package/dist/index.es122.js +88 -11
- package/dist/index.es123.js +11 -88
- package/dist/index.es124.js +4 -216
- package/dist/index.es127.js +5 -5
- package/dist/index.es128.js +216 -4
- package/dist/index.es129.js +2 -2
- package/dist/index.es134.js +1 -1
- package/dist/index.es137.js +20 -11
- package/dist/index.es138.js +37 -205
- package/dist/index.es139.js +10 -10
- package/dist/index.es140.js +11 -20
- package/dist/index.es141.js +205 -37
- package/dist/index.es142.js +10 -10
- package/dist/index.es143.js +5 -6
- package/dist/index.es144.js +2 -65
- package/dist/index.es145.js +44 -11
- package/dist/index.es146.js +5 -123
- package/dist/index.es147.js +58 -128
- package/dist/index.es148.js +11 -14
- package/dist/index.es149.js +122 -30
- package/dist/index.es150.js +134 -14
- package/dist/index.es151.js +12 -7
- package/dist/index.es152.js +32 -49
- package/dist/index.es153.js +14 -5
- package/dist/index.es154.js +9 -2
- package/dist/index.es155.js +48 -648
- package/dist/index.es156.js +5 -5
- package/dist/index.es157.js +649 -3
- package/dist/index.es158.js +4 -4
- package/dist/index.es159.js +3 -45
- package/dist/index.es160.js +45 -7
- package/dist/index.es161.js +7 -5
- package/dist/index.es162.js +6 -28
- package/dist/index.es163.js +27 -43
- package/dist/index.es164.js +3 -3
- package/dist/index.es166.js +5 -5
- package/dist/index.es168.js +2 -2
- package/dist/index.es179.js +1 -1
- package/dist/index.es180.js +1 -1
- package/dist/index.es181.js +2 -2
- package/dist/index.es182.js +1 -1
- package/dist/index.es184.js +1 -1
- package/dist/index.es207.js +1 -1
- package/dist/index.es240.js +1 -1
- package/dist/index.es241.js +24 -177
- package/dist/index.es242.js +5 -5
- package/dist/index.es243.js +2 -2
- package/dist/index.es246.js +1 -1
- package/dist/index.es247.js +1 -1
- package/dist/index.es248.js +3 -3
- package/dist/index.es249.js +178 -2
- package/dist/index.es250.js +25 -397
- package/dist/index.es251.js +4 -722
- package/dist/index.es252.js +7 -282
- package/dist/index.es253.js +13 -60
- package/dist/index.es254.js +13 -9
- package/dist/index.es255.js +134 -28
- package/dist/index.es256.js +32 -199
- package/dist/index.es257.js +462 -25
- package/dist/index.es258.js +131 -4
- package/dist/index.es259.js +27 -8
- package/dist/index.es260.js +4 -13
- package/dist/index.es261.js +26 -13
- package/dist/index.es262.js +7 -134
- package/dist/index.es263.js +11 -31
- package/dist/index.es264.js +26 -460
- package/dist/index.es265.js +47 -130
- package/dist/index.es266.js +31 -27
- package/dist/index.es267.js +43 -4
- package/dist/index.es268.js +158 -26
- package/dist/index.es269.js +32 -6
- package/dist/index.es27.js +1 -1
- package/dist/index.es270.js +2 -12
- package/dist/index.es271.js +77 -26
- package/dist/index.es272.js +18 -48
- package/dist/index.es273.js +2 -31
- package/dist/index.es274.js +397 -43
- package/dist/index.es275.js +715 -151
- package/dist/index.es276.js +278 -29
- package/dist/index.es277.js +61 -2
- package/dist/index.es278.js +8 -78
- package/dist/index.es279.js +28 -18
- package/dist/index.es28.js +3 -3
- package/dist/index.es280.js +199 -25
- package/dist/index.es281.js +15 -16
- package/dist/index.es282.js +3 -8
- package/dist/index.es283.js +16 -4
- package/dist/index.es284.js +8 -14
- package/dist/index.es285.js +4 -15
- package/dist/index.es286.js +14 -15
- package/dist/index.es287.js +15 -3
- package/dist/index.es29.js +6 -6
- package/dist/index.es31.js +2 -2
- package/dist/index.es32.js +2 -2
- package/dist/index.es322.js +3 -3
- package/dist/index.es323.js +3 -3
- package/dist/index.es325.js +1 -1
- package/dist/index.es326.js +5 -5
- package/dist/index.es327.js +1 -1
- package/dist/index.es336.js +6 -2
- package/dist/index.es337.js +34 -2
- package/dist/index.es338.js +26 -6
- package/dist/index.es339.js +18 -34
- package/dist/index.es34.js +5 -5
- package/dist/index.es340.js +4 -25
- package/dist/index.es341.js +231 -18
- package/dist/index.es342.js +100 -5
- package/dist/index.es343.js +26 -229
- package/dist/index.es344.js +35 -80
- package/dist/index.es345.js +2 -28
- package/dist/index.es346.js +2 -55
- package/dist/index.es347.js +334 -2
- package/dist/index.es348.js +31 -106
- package/dist/index.es349.js +16 -75
- package/dist/index.es35.js +2 -2
- package/dist/index.es350.js +29 -35
- package/dist/index.es351.js +3 -64
- package/dist/index.es352.js +107 -34
- package/dist/index.es353.js +71 -60
- package/dist/index.es354.js +34 -111
- package/dist/index.es355.js +60 -90
- package/dist/index.es356.js +32 -41
- package/dist/index.es357.js +66 -3
- package/dist/index.es358.js +113 -3
- package/dist/index.es359.js +94 -3
- package/dist/index.es360.js +43 -3
- package/dist/index.es361.js +2 -2
- package/dist/index.es362.js +2 -2
- package/dist/index.es363.js +2 -2
- package/dist/index.es364.js +2 -2
- package/dist/index.es365.js +2 -2
- package/dist/index.es366.js +4 -241
- package/dist/index.es367.js +4 -384
- package/dist/index.es368.js +4 -169
- package/dist/index.es369.js +4 -153
- package/dist/index.es370.js +187 -88
- package/dist/index.es371.js +384 -4
- package/dist/index.es372.js +169 -4
- package/dist/index.es373.js +153 -4
- package/dist/index.es374.js +142 -4
- package/dist/index.es375.js +2 -2
- package/dist/index.es376.js +2 -2
- package/dist/index.es377.js +2 -334
- package/dist/index.es378.js +2 -31
- package/dist/index.es379.js +2 -17
- package/dist/index.es38.js +51 -46
- package/dist/index.es380.js +2 -29
- package/dist/index.es381.js +2 -2
- package/dist/index.es382.js +1 -1
- package/dist/index.es384.js +1 -1
- package/dist/index.es385.js +1 -1
- package/dist/index.es39.js +2 -2
- package/dist/index.es394.js +68 -5
- package/dist/index.es395.js +31 -3
- package/dist/index.es396.js +16 -24
- package/dist/index.es397.js +141 -110
- package/dist/index.es398.js +113 -15
- package/dist/index.es399.js +5 -6
- package/dist/index.es40.js +3 -3
- package/dist/index.es400.js +3 -2
- package/dist/index.es401.js +23 -7
- package/dist/index.es402.js +108 -325
- package/dist/index.es403.js +15 -49
- package/dist/index.es404.js +518 -3
- package/dist/index.es405.js +113 -505
- package/dist/index.es406.js +120 -121
- package/dist/index.es407.js +5 -125
- package/dist/index.es408.js +2 -68
- package/dist/index.es409.js +8 -31
- package/dist/index.es41.js +1 -1
- package/dist/index.es410.js +327 -16
- package/dist/index.es411.js +48 -139
- package/dist/index.es412.js +4 -114
- package/dist/index.es416.js +1 -1
- package/dist/index.es418.js +1 -1
- package/dist/index.es419.js +4 -4
- package/dist/index.es42.js +1 -1
- package/dist/index.es437.js +21 -271
- package/dist/index.es438.js +10 -79
- package/dist/index.es439.js +31 -164
- package/dist/index.es44.js +1 -1
- package/dist/index.es440.js +29 -24
- package/dist/index.es441.js +11 -10
- package/dist/index.es442.js +274 -32
- package/dist/index.es443.js +79 -29
- package/dist/index.es444.js +165 -11
- package/dist/index.es448.js +2 -2
- package/dist/index.es45.js +1 -1
- package/dist/index.es454.js +1 -1
- package/dist/index.es455.js +1 -1
- package/dist/index.es461.js +1 -1
- package/dist/index.es476.js +1 -1
- package/dist/index.es477.js +1 -1
- package/dist/index.es50.js +2 -2
- package/dist/index.es51.js +1 -1
- package/dist/index.es52.js +4 -4
- package/dist/index.es55.js +1 -1
- package/dist/index.es56.js +1 -1
- package/dist/index.es57.js +2 -2
- package/dist/index.es59.js +2 -2
- package/dist/index.es62.js +1 -1
- package/dist/index.es63.js +1 -1
- package/dist/index.es65.js +2 -2
- package/dist/index.es66.js +2 -2
- package/dist/index.es754.js +13 -21
- package/dist/index.es755.js +18 -79
- package/dist/index.es756.js +82 -13
- package/dist/index.es757.js +14 -2
- package/dist/index.es758.js +60 -2
- package/dist/index.es759.js +2 -14
- package/dist/index.es760.js +2 -60
- package/dist/index.es768.js +2 -5
- package/dist/index.es769.js +2 -17
- package/dist/index.es770.js +5 -2
- package/dist/index.es771.js +17 -2
- package/dist/index.es772.js +1 -1
- package/dist/index.es773.js +2 -2
- package/dist/index.es78.js +1 -1
- package/dist/index.es781.js +1 -1
- package/dist/index.es784.js +1 -1
- package/dist/index.es787.js +56 -26
- package/dist/index.es788.js +10 -3
- package/dist/index.es789.js +14 -57
- package/dist/index.es79.js +1 -1
- package/dist/index.es790.js +3 -6
- package/dist/index.es791.js +28 -15
- package/dist/index.es792.js +3 -7
- package/dist/index.es808.js +1 -1
- package/dist/index.es811.js +5 -5
- package/dist/index.es812.js +2 -2
- package/dist/index.es813.js +1 -1
- package/dist/index.es815.js +2 -2
- package/dist/index.es827.js +64 -15
- package/dist/index.es828.js +11 -7
- package/dist/index.es829.js +38 -61
- package/dist/index.es830.js +54 -7
- package/dist/index.es831.js +16 -40
- package/dist/index.es832.js +17 -57
- package/dist/index.es833.js +7 -20
- package/dist/index.es834.js +1 -1
- package/dist/index.es86.js +55 -33
- package/dist/index.es87.js +53 -44
- package/dist/index.es88.js +89 -29
- package/dist/index.es89.js +37 -30
- package/dist/index.es90.js +24 -9
- package/dist/index.es91.js +30 -55
- package/dist/index.es92.js +31 -53
- package/dist/index.es93.js +46 -90
- package/dist/index.es94.js +29 -36
- package/dist/index.es95.js +29 -23
- package/dist/index.es96.js +9 -30
- package/dist/index.es97.js +12 -259
- package/dist/index.es98.js +1062 -12
- package/dist/index.es99.js +2 -2
- package/package.json +1 -1
package/dist/index.es249.js
CHANGED
|
@@ -1,4 +1,180 @@
|
|
|
1
|
-
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "./index.es146.js";
|
|
3
|
+
import { createCollection as H } from "./index.es160.js";
|
|
4
|
+
import { useComposedRefs as V } from "./index.es140.js";
|
|
5
|
+
import { createContextScope as z } from "./index.es147.js";
|
|
6
|
+
import { useId as q } from "./index.es148.js";
|
|
7
|
+
import { Primitive as P } from "./index.es152.js";
|
|
8
|
+
import { useCallbackRef as J } from "./index.es142.js";
|
|
9
|
+
import { useControllableState as Q } from "./index.es95.js";
|
|
10
|
+
import { useDirection as W } from "./index.es161.js";
|
|
11
|
+
import { j as d } from "./index.es82.js";
|
|
12
|
+
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [h, G, Z] = H(b), [$, Fe] = z(
|
|
13
|
+
b,
|
|
14
|
+
[Z]
|
|
15
|
+
), [ee, oe] = $(b), N = s.forwardRef(
|
|
16
|
+
(e, r) => /* @__PURE__ */ d.jsx(h.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(h.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(te, { ...e, ref: r }) }) })
|
|
17
|
+
);
|
|
18
|
+
N.displayName = b;
|
|
19
|
+
var te = s.forwardRef((e, r) => {
|
|
20
|
+
const {
|
|
21
|
+
__scopeRovingFocusGroup: c,
|
|
22
|
+
orientation: o,
|
|
23
|
+
loop: F = !1,
|
|
24
|
+
dir: g,
|
|
25
|
+
currentTabStopId: R,
|
|
26
|
+
defaultCurrentTabStopId: E,
|
|
27
|
+
onCurrentTabStopIdChange: m,
|
|
28
|
+
onEntryFocus: u,
|
|
29
|
+
preventScrollOnEntryFocus: w = !1,
|
|
30
|
+
...C
|
|
31
|
+
} = e, v = s.useRef(null), I = V(r, v), t = W(g), [f = null, T] = Q({
|
|
32
|
+
prop: R,
|
|
33
|
+
defaultProp: E,
|
|
34
|
+
onChange: m
|
|
35
|
+
}), [a, i] = s.useState(!1), S = J(u), M = G(c), x = s.useRef(!1), [k, y] = s.useState(0);
|
|
36
|
+
return s.useEffect(() => {
|
|
37
|
+
const n = v.current;
|
|
38
|
+
if (n)
|
|
39
|
+
return n.addEventListener(_, S), () => n.removeEventListener(_, S);
|
|
40
|
+
}, [S]), /* @__PURE__ */ d.jsx(
|
|
41
|
+
ee,
|
|
42
|
+
{
|
|
43
|
+
scope: c,
|
|
44
|
+
orientation: o,
|
|
45
|
+
dir: t,
|
|
46
|
+
loop: F,
|
|
47
|
+
currentTabStopId: f,
|
|
48
|
+
onItemFocus: s.useCallback(
|
|
49
|
+
(n) => T(n),
|
|
50
|
+
[T]
|
|
51
|
+
),
|
|
52
|
+
onItemShiftTab: s.useCallback(() => i(!0), []),
|
|
53
|
+
onFocusableItemAdd: s.useCallback(
|
|
54
|
+
() => y((n) => n + 1),
|
|
55
|
+
[]
|
|
56
|
+
),
|
|
57
|
+
onFocusableItemRemove: s.useCallback(
|
|
58
|
+
() => y((n) => n - 1),
|
|
59
|
+
[]
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ d.jsx(
|
|
62
|
+
P.div,
|
|
63
|
+
{
|
|
64
|
+
tabIndex: a || k === 0 ? -1 : 0,
|
|
65
|
+
"data-orientation": o,
|
|
66
|
+
...C,
|
|
67
|
+
ref: I,
|
|
68
|
+
style: { outline: "none", ...e.style },
|
|
69
|
+
onMouseDown: p(e.onMouseDown, () => {
|
|
70
|
+
x.current = !0;
|
|
71
|
+
}),
|
|
72
|
+
onFocus: p(e.onFocus, (n) => {
|
|
73
|
+
const L = !x.current;
|
|
74
|
+
if (n.target === n.currentTarget && L && !a) {
|
|
75
|
+
const D = new CustomEvent(_, X);
|
|
76
|
+
if (n.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
77
|
+
const A = M().filter((l) => l.focusable), U = A.find((l) => l.active), B = A.find((l) => l.id === f), Y = [U, B, ...A].filter(
|
|
78
|
+
Boolean
|
|
79
|
+
).map((l) => l.ref.current);
|
|
80
|
+
j(Y, w);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
x.current = !1;
|
|
84
|
+
}),
|
|
85
|
+
onBlur: p(e.onBlur, () => i(!1))
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}), O = "RovingFocusGroupItem", K = s.forwardRef(
|
|
91
|
+
(e, r) => {
|
|
92
|
+
const {
|
|
93
|
+
__scopeRovingFocusGroup: c,
|
|
94
|
+
focusable: o = !0,
|
|
95
|
+
active: F = !1,
|
|
96
|
+
tabStopId: g,
|
|
97
|
+
...R
|
|
98
|
+
} = e, E = q(), m = g || E, u = oe(O, c), w = u.currentTabStopId === m, C = G(c), { onFocusableItemAdd: v, onFocusableItemRemove: I } = u;
|
|
99
|
+
return s.useEffect(() => {
|
|
100
|
+
if (o)
|
|
101
|
+
return v(), () => I();
|
|
102
|
+
}, [o, v, I]), /* @__PURE__ */ d.jsx(
|
|
103
|
+
h.ItemSlot,
|
|
104
|
+
{
|
|
105
|
+
scope: c,
|
|
106
|
+
id: m,
|
|
107
|
+
focusable: o,
|
|
108
|
+
active: F,
|
|
109
|
+
children: /* @__PURE__ */ d.jsx(
|
|
110
|
+
P.span,
|
|
111
|
+
{
|
|
112
|
+
tabIndex: w ? 0 : -1,
|
|
113
|
+
"data-orientation": u.orientation,
|
|
114
|
+
...R,
|
|
115
|
+
ref: r,
|
|
116
|
+
onMouseDown: p(e.onMouseDown, (t) => {
|
|
117
|
+
o ? u.onItemFocus(m) : t.preventDefault();
|
|
118
|
+
}),
|
|
119
|
+
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
|
120
|
+
onKeyDown: p(e.onKeyDown, (t) => {
|
|
121
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
122
|
+
u.onItemShiftTab();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (t.target !== t.currentTarget) return;
|
|
126
|
+
const f = se(t, u.orientation, u.dir);
|
|
127
|
+
if (f !== void 0) {
|
|
128
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
129
|
+
t.preventDefault();
|
|
130
|
+
let a = C().filter((i) => i.focusable).map((i) => i.ref.current);
|
|
131
|
+
if (f === "last") a.reverse();
|
|
132
|
+
else if (f === "prev" || f === "next") {
|
|
133
|
+
f === "prev" && a.reverse();
|
|
134
|
+
const i = a.indexOf(t.currentTarget);
|
|
135
|
+
a = u.loop ? ce(a, i + 1) : a.slice(i + 1);
|
|
136
|
+
}
|
|
137
|
+
setTimeout(() => j(a));
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
K.displayName = O;
|
|
147
|
+
var re = {
|
|
148
|
+
ArrowLeft: "prev",
|
|
149
|
+
ArrowUp: "prev",
|
|
150
|
+
ArrowRight: "next",
|
|
151
|
+
ArrowDown: "next",
|
|
152
|
+
PageUp: "first",
|
|
153
|
+
Home: "first",
|
|
154
|
+
PageDown: "last",
|
|
155
|
+
End: "last"
|
|
156
|
+
};
|
|
157
|
+
function ne(e, r) {
|
|
158
|
+
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
159
|
+
}
|
|
160
|
+
function se(e, r, c) {
|
|
161
|
+
const o = ne(e.key, c);
|
|
162
|
+
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
163
|
+
return re[o];
|
|
164
|
+
}
|
|
165
|
+
function j(e, r = !1) {
|
|
166
|
+
const c = document.activeElement;
|
|
167
|
+
for (const o of e)
|
|
168
|
+
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
|
169
|
+
}
|
|
170
|
+
function ce(e, r) {
|
|
171
|
+
return e.map((c, o) => e[(r + o) % e.length]);
|
|
172
|
+
}
|
|
173
|
+
var ge = N, Re = K;
|
|
2
174
|
export {
|
|
3
|
-
|
|
175
|
+
Re as Item,
|
|
176
|
+
ge as Root,
|
|
177
|
+
N as RovingFocusGroup,
|
|
178
|
+
K as RovingFocusGroupItem,
|
|
179
|
+
Fe as createRovingFocusGroupScope
|
|
4
180
|
};
|
package/dist/index.es250.js
CHANGED
|
@@ -1,400 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
while (e);
|
|
26
|
-
}
|
|
27
|
-
return n.tag === 3 ? t : null;
|
|
28
|
-
}
|
|
29
|
-
function L(e) {
|
|
30
|
-
if (N(e) !== e) throw Error("Unable to find node on an unmounted component.");
|
|
31
|
-
}
|
|
32
|
-
function q(e) {
|
|
33
|
-
var n = e.alternate;
|
|
34
|
-
if (!n) {
|
|
35
|
-
if (n = N(e), n === null) throw Error("Unable to find node on an unmounted component.");
|
|
36
|
-
return n !== e ? null : e;
|
|
37
|
-
}
|
|
38
|
-
for (var t = e, r = n; ; ) {
|
|
39
|
-
var i = t.return;
|
|
40
|
-
if (i === null) break;
|
|
41
|
-
var a = i.alternate;
|
|
42
|
-
if (a === null) {
|
|
43
|
-
if (r = i.return, r !== null) {
|
|
44
|
-
t = r;
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
if (i.child === a.child) {
|
|
50
|
-
for (a = i.child; a; ) {
|
|
51
|
-
if (a === t) return L(i), e;
|
|
52
|
-
if (a === r) return L(i), n;
|
|
53
|
-
a = a.sibling;
|
|
54
|
-
}
|
|
55
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
56
|
-
}
|
|
57
|
-
if (t.return !== r.return) t = i, r = a;
|
|
58
|
-
else {
|
|
59
|
-
for (var o = !1, s = i.child; s; ) {
|
|
60
|
-
if (s === t) {
|
|
61
|
-
o = !0, t = i, r = a;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
if (s === r) {
|
|
65
|
-
o = !0, r = i, t = a;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
s = s.sibling;
|
|
69
|
-
}
|
|
70
|
-
if (!o) {
|
|
71
|
-
for (s = a.child; s; ) {
|
|
72
|
-
if (s === t) {
|
|
73
|
-
o = !0, t = a, r = i;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
if (s === r) {
|
|
77
|
-
o = !0, r = a, t = i;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
s = s.sibling;
|
|
81
|
-
}
|
|
82
|
-
if (!o) throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (t.alternate !== r) throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
|
|
86
|
-
}
|
|
87
|
-
if (t.tag !== 3) throw Error("Unable to find node on an unmounted component.");
|
|
88
|
-
return t.stateNode.current === t ? e : n;
|
|
89
|
-
}
|
|
90
|
-
var l = Object.assign;
|
|
91
|
-
function M(e) {
|
|
92
|
-
var n = e.keyCode;
|
|
93
|
-
return "charCode" in e ? (e = e.charCode, e === 0 && n === 13 && (e = 13)) : e = n, e === 10 && (e = 13), 32 <= e || e === 13 ? e : 0;
|
|
94
|
-
}
|
|
95
|
-
function C() {
|
|
96
|
-
return !0;
|
|
97
|
-
}
|
|
98
|
-
function A() {
|
|
99
|
-
return !1;
|
|
100
|
-
}
|
|
101
|
-
function c(e) {
|
|
102
|
-
function n(t, r, i, a, o) {
|
|
103
|
-
this._reactName = t, this._targetInst = i, this.type = r, this.nativeEvent = a, this.target = o, this.currentTarget = null;
|
|
104
|
-
for (var s in e) e.hasOwnProperty(s) && (t = e[s], this[s] = t ? t(a) : a[s]);
|
|
105
|
-
return this.isDefaultPrevented = (a.defaultPrevented != null ? a.defaultPrevented : a.returnValue === !1) ? C : A, this.isPropagationStopped = A, this;
|
|
106
|
-
}
|
|
107
|
-
return l(n.prototype, { preventDefault: function() {
|
|
108
|
-
this.defaultPrevented = !0;
|
|
109
|
-
var t = this.nativeEvent;
|
|
110
|
-
t && (t.preventDefault ? t.preventDefault() : typeof t.returnValue != "unknown" && (t.returnValue = !1), this.isDefaultPrevented = C);
|
|
111
|
-
}, stopPropagation: function() {
|
|
112
|
-
var t = this.nativeEvent;
|
|
113
|
-
t && (t.stopPropagation ? t.stopPropagation() : typeof t.cancelBubble != "unknown" && (t.cancelBubble = !0), this.isPropagationStopped = C);
|
|
114
|
-
}, persist: function() {
|
|
115
|
-
}, isPersistent: C }), n;
|
|
116
|
-
}
|
|
117
|
-
var h = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(e) {
|
|
118
|
-
return e.timeStamp || Date.now();
|
|
119
|
-
}, defaultPrevented: 0, isTrusted: 0 }, z = c(h), m = l({}, h, { view: 0, detail: 0 });
|
|
120
|
-
c(m);
|
|
121
|
-
var O, P, y, E = l({}, m, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: R, button: 0, buttons: 0, relatedTarget: function(e) {
|
|
122
|
-
return e.relatedTarget === void 0 ? e.fromElement === e.srcElement ? e.toElement : e.fromElement : e.relatedTarget;
|
|
123
|
-
}, movementX: function(e) {
|
|
124
|
-
return "movementX" in e ? e.movementX : (e !== y && (y && e.type === "mousemove" ? (O = e.screenX - y.screenX, P = e.screenY - y.screenY) : P = O = 0, y = e), O);
|
|
125
|
-
}, movementY: function(e) {
|
|
126
|
-
return "movementY" in e ? e.movementY : P;
|
|
127
|
-
} });
|
|
128
|
-
c(E);
|
|
129
|
-
var H = l({}, E, { dataTransfer: 0 });
|
|
130
|
-
c(H);
|
|
131
|
-
var Z = l({}, m, { relatedTarget: 0 });
|
|
132
|
-
c(Z);
|
|
133
|
-
var G = l({}, h, { animationName: 0, elapsedTime: 0, pseudoElement: 0 });
|
|
134
|
-
c(G);
|
|
135
|
-
var J = l({}, h, { clipboardData: function(e) {
|
|
136
|
-
return "clipboardData" in e ? e.clipboardData : window.clipboardData;
|
|
137
|
-
} });
|
|
138
|
-
c(J);
|
|
139
|
-
var Q = l({}, h, { data: 0 });
|
|
140
|
-
c(Q);
|
|
141
|
-
var $ = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }, ee = {
|
|
142
|
-
8: "Backspace",
|
|
143
|
-
9: "Tab",
|
|
144
|
-
12: "Clear",
|
|
145
|
-
13: "Enter",
|
|
146
|
-
16: "Shift",
|
|
147
|
-
17: "Control",
|
|
148
|
-
18: "Alt",
|
|
149
|
-
19: "Pause",
|
|
150
|
-
20: "CapsLock",
|
|
151
|
-
27: "Escape",
|
|
152
|
-
32: " ",
|
|
153
|
-
33: "PageUp",
|
|
154
|
-
34: "PageDown",
|
|
155
|
-
35: "End",
|
|
156
|
-
36: "Home",
|
|
157
|
-
37: "ArrowLeft",
|
|
158
|
-
38: "ArrowUp",
|
|
159
|
-
39: "ArrowRight",
|
|
160
|
-
40: "ArrowDown",
|
|
161
|
-
45: "Insert",
|
|
162
|
-
46: "Delete",
|
|
163
|
-
112: "F1",
|
|
164
|
-
113: "F2",
|
|
165
|
-
114: "F3",
|
|
166
|
-
115: "F4",
|
|
167
|
-
116: "F5",
|
|
168
|
-
117: "F6",
|
|
169
|
-
118: "F7",
|
|
170
|
-
119: "F8",
|
|
171
|
-
120: "F9",
|
|
172
|
-
121: "F10",
|
|
173
|
-
122: "F11",
|
|
174
|
-
123: "F12",
|
|
175
|
-
144: "NumLock",
|
|
176
|
-
145: "ScrollLock",
|
|
177
|
-
224: "Meta"
|
|
178
|
-
}, te = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
|
|
179
|
-
function ne(e) {
|
|
180
|
-
var n = this.nativeEvent;
|
|
181
|
-
return n.getModifierState ? n.getModifierState(e) : (e = te[e]) ? !!n[e] : !1;
|
|
182
|
-
}
|
|
183
|
-
function R() {
|
|
184
|
-
return ne;
|
|
185
|
-
}
|
|
186
|
-
var re = l({}, m, { key: function(e) {
|
|
187
|
-
if (e.key) {
|
|
188
|
-
var n = $[e.key] || e.key;
|
|
189
|
-
if (n !== "Unidentified") return n;
|
|
190
|
-
}
|
|
191
|
-
return e.type === "keypress" ? (e = M(e), e === 13 ? "Enter" : String.fromCharCode(e)) : e.type === "keydown" || e.type === "keyup" ? ee[e.keyCode] || "Unidentified" : "";
|
|
192
|
-
}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: R, charCode: function(e) {
|
|
193
|
-
return e.type === "keypress" ? M(e) : 0;
|
|
194
|
-
}, keyCode: function(e) {
|
|
195
|
-
return e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0;
|
|
196
|
-
}, which: function(e) {
|
|
197
|
-
return e.type === "keypress" ? M(e) : e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0;
|
|
198
|
-
} });
|
|
199
|
-
c(re);
|
|
200
|
-
var oe = l({}, E, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 });
|
|
201
|
-
c(oe);
|
|
202
|
-
var ie = l({}, m, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: R });
|
|
203
|
-
c(ie);
|
|
204
|
-
var ae = l({}, h, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 });
|
|
205
|
-
c(ae);
|
|
206
|
-
var se = l({}, E, { deltaX: function(e) {
|
|
207
|
-
return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0;
|
|
208
|
-
}, deltaY: function(e) {
|
|
209
|
-
return "deltaY" in e ? e.deltaY : "wheelDeltaY" in e ? -e.wheelDeltaY : "wheelDelta" in e ? -e.wheelDelta : 0;
|
|
210
|
-
}, deltaZ: 0, deltaMode: 0 });
|
|
211
|
-
c(se);
|
|
212
|
-
function ue(e, n, t, r, i, a, o, s, w) {
|
|
213
|
-
var d = Array.prototype.slice.call(arguments, 3);
|
|
214
|
-
try {
|
|
215
|
-
n.apply(t, d);
|
|
216
|
-
} catch (ke) {
|
|
217
|
-
this.onError(ke);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
var v = !1, D = null, b = !1, S = null, le = { onError: function(e) {
|
|
221
|
-
v = !0, D = e;
|
|
222
|
-
} };
|
|
223
|
-
function ce(e, n, t, r, i, a, o, s, w) {
|
|
224
|
-
v = !1, D = null, ue.apply(le, arguments);
|
|
225
|
-
}
|
|
226
|
-
function de(e, n, t, r, i, a, o, s, w) {
|
|
227
|
-
if (ce.apply(this, arguments), v) {
|
|
228
|
-
if (v) {
|
|
229
|
-
var d = D;
|
|
230
|
-
v = !1, D = null;
|
|
231
|
-
} else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
|
|
232
|
-
b || (b = !0, S = d);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
var U = Array.isArray, g = T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, pe = g[0], fe = g[1], he = g[2], me = g[3], ye = g[4], ve = f.unstable_act;
|
|
236
|
-
function ge() {
|
|
237
|
-
}
|
|
238
|
-
function we(e, n) {
|
|
239
|
-
if (!e) return [];
|
|
240
|
-
if (e = q(e), !e) return [];
|
|
241
|
-
for (var t = e, r = []; ; ) {
|
|
242
|
-
if (t.tag === 5 || t.tag === 6 || t.tag === 1 || t.tag === 0) {
|
|
243
|
-
var i = t.stateNode;
|
|
244
|
-
n(i) && r.push(i);
|
|
245
|
-
}
|
|
246
|
-
if (t.child) t.child.return = t, t = t.child;
|
|
247
|
-
else {
|
|
248
|
-
if (t === e) return r;
|
|
249
|
-
for (; !t.sibling; ) {
|
|
250
|
-
if (!t.return || t.return === e) return r;
|
|
251
|
-
t = t.return;
|
|
252
|
-
}
|
|
253
|
-
t.sibling.return = t.return, t = t.sibling;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
function p(e, n) {
|
|
258
|
-
if (e && !e._reactInternals) {
|
|
259
|
-
var t = String(e);
|
|
260
|
-
throw e = U(e) ? "an array" : e && e.nodeType === 1 && e.tagName ? "a DOM node" : t === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : t, Error(n + "(...): the first argument must be a React class instance. Instead received: " + (e + "."));
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
function k(e) {
|
|
264
|
-
return !(!e || e.nodeType !== 1 || !e.tagName);
|
|
265
|
-
}
|
|
266
|
-
function I(e) {
|
|
267
|
-
return k(e) ? !1 : e != null && typeof e.render == "function" && typeof e.setState == "function";
|
|
268
|
-
}
|
|
269
|
-
function x(e, n) {
|
|
270
|
-
return I(e) ? e._reactInternals.type === n : !1;
|
|
271
|
-
}
|
|
272
|
-
function _(e, n) {
|
|
273
|
-
return p(e, "findAllInRenderedTree"), e ? we(e._reactInternals, n) : [];
|
|
274
|
-
}
|
|
275
|
-
function K(e, n) {
|
|
276
|
-
return p(e, "scryRenderedDOMComponentsWithClass"), _(e, function(t) {
|
|
277
|
-
if (k(t)) {
|
|
278
|
-
var r = t.className;
|
|
279
|
-
typeof r != "string" && (r = t.getAttribute("class") || "");
|
|
280
|
-
var i = r.split(/\s+/);
|
|
281
|
-
if (!U(n)) {
|
|
282
|
-
if (n === void 0) throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");
|
|
283
|
-
n = n.split(/\s+/);
|
|
284
|
-
}
|
|
285
|
-
return n.every(function(a) {
|
|
286
|
-
return i.indexOf(a) !== -1;
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
return !1;
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
function W(e, n) {
|
|
293
|
-
return p(e, "scryRenderedDOMComponentsWithTag"), _(e, function(t) {
|
|
294
|
-
return k(t) && t.tagName.toUpperCase() === n.toUpperCase();
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function Y(e, n) {
|
|
298
|
-
return p(e, "scryRenderedComponentsWithType"), _(e, function(t) {
|
|
299
|
-
return x(t, n);
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
function X(e, n, t) {
|
|
303
|
-
var r = e.type || "unknown-event";
|
|
304
|
-
e.currentTarget = fe(t), de(r, n, void 0, e), e.currentTarget = null;
|
|
305
|
-
}
|
|
306
|
-
function F(e, n, t) {
|
|
307
|
-
for (var r = []; e; ) {
|
|
308
|
-
r.push(e);
|
|
309
|
-
do
|
|
310
|
-
e = e.return;
|
|
311
|
-
while (e && e.tag !== 5);
|
|
312
|
-
e = e || null;
|
|
313
|
-
}
|
|
314
|
-
for (e = r.length; 0 < e--; ) n(r[e], "captured", t);
|
|
315
|
-
for (e = 0; e < r.length; e++) n(r[e], "bubbled", t);
|
|
316
|
-
}
|
|
317
|
-
function V(e, n) {
|
|
318
|
-
var t = e.stateNode;
|
|
319
|
-
if (!t) return null;
|
|
320
|
-
var r = he(t);
|
|
321
|
-
if (!r) return null;
|
|
322
|
-
t = r[n];
|
|
323
|
-
e: switch (n) {
|
|
324
|
-
case "onClick":
|
|
325
|
-
case "onClickCapture":
|
|
326
|
-
case "onDoubleClick":
|
|
327
|
-
case "onDoubleClickCapture":
|
|
328
|
-
case "onMouseDown":
|
|
329
|
-
case "onMouseDownCapture":
|
|
330
|
-
case "onMouseMove":
|
|
331
|
-
case "onMouseMoveCapture":
|
|
332
|
-
case "onMouseUp":
|
|
333
|
-
case "onMouseUpCapture":
|
|
334
|
-
case "onMouseEnter":
|
|
335
|
-
(r = !r.disabled) || (e = e.type, r = !(e === "button" || e === "input" || e === "select" || e === "textarea")), e = !r;
|
|
336
|
-
break e;
|
|
337
|
-
default:
|
|
338
|
-
e = !1;
|
|
339
|
-
}
|
|
340
|
-
if (e) return null;
|
|
341
|
-
if (t && typeof t != "function") throw Error("Expected `" + n + "` listener to be a function, instead got a value of `" + typeof t + "` type.");
|
|
342
|
-
return t;
|
|
343
|
-
}
|
|
344
|
-
function Ce(e, n, t) {
|
|
345
|
-
e && t && t._reactName && (n = V(e, t._reactName)) && (t._dispatchListeners == null && (t._dispatchListeners = []), t._dispatchInstances == null && (t._dispatchInstances = []), t._dispatchListeners.push(n), t._dispatchInstances.push(e));
|
|
346
|
-
}
|
|
347
|
-
function Ee(e, n, t) {
|
|
348
|
-
var r = t._reactName;
|
|
349
|
-
n === "captured" && (r += "Capture"), (n = V(e, r)) && (t._dispatchListeners == null && (t._dispatchListeners = []), t._dispatchInstances == null && (t._dispatchInstances = []), t._dispatchListeners.push(n), t._dispatchInstances.push(e));
|
|
350
|
-
}
|
|
351
|
-
var j = {}, De = /* @__PURE__ */ new Set(["mouseEnter", "mouseLeave", "pointerEnter", "pointerLeave"]);
|
|
352
|
-
function be(e) {
|
|
353
|
-
return function(n, t) {
|
|
354
|
-
if (f.isValidElement(n)) throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.");
|
|
355
|
-
if (I(n)) throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");
|
|
356
|
-
var r = "on" + e[0].toUpperCase() + e.slice(1), i = new ge();
|
|
357
|
-
i.target = n, i.type = e.toLowerCase();
|
|
358
|
-
var a = pe(n), o = new z(r, i.type, a, i, n);
|
|
359
|
-
o.persist(), l(o, t), De.has(e) ? o && o._reactName && Ce(o._targetInst, null, o) : o && o._reactName && F(o._targetInst, Ee, o), T.unstable_batchedUpdates(function() {
|
|
360
|
-
if (me(n), o) {
|
|
361
|
-
var s = o._dispatchListeners, w = o._dispatchInstances;
|
|
362
|
-
if (U(s)) for (var d = 0; d < s.length && !o.isPropagationStopped(); d++) X(o, s[d], w[d]);
|
|
363
|
-
else s && X(o, s, w);
|
|
364
|
-
o._dispatchListeners = null, o._dispatchInstances = null, o.isPersistent() || o.constructor.release(o);
|
|
365
|
-
}
|
|
366
|
-
if (b) throw s = S, b = !1, S = null, s;
|
|
367
|
-
}), ye();
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
return "blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" ").forEach(function(e) {
|
|
371
|
-
j[e] = be(e);
|
|
372
|
-
}), u.Simulate = j, u.act = ve, u.findAllInRenderedTree = _, u.findRenderedComponentWithType = function(e, n) {
|
|
373
|
-
if (p(e, "findRenderedComponentWithType"), e = Y(e, n), e.length !== 1) throw Error("Did not find exactly one match (found: " + e.length + ") for componentType:" + n);
|
|
374
|
-
return e[0];
|
|
375
|
-
}, u.findRenderedDOMComponentWithClass = function(e, n) {
|
|
376
|
-
if (p(e, "findRenderedDOMComponentWithClass"), e = K(e, n), e.length !== 1) throw Error("Did not find exactly one match (found: " + e.length + ") for class:" + n);
|
|
377
|
-
return e[0];
|
|
378
|
-
}, u.findRenderedDOMComponentWithTag = function(e, n) {
|
|
379
|
-
if (p(e, "findRenderedDOMComponentWithTag"), e = W(e, n), e.length !== 1) throw Error("Did not find exactly one match (found: " + e.length + ") for tag:" + n);
|
|
380
|
-
return e[0];
|
|
381
|
-
}, u.isCompositeComponent = I, u.isCompositeComponentWithType = x, u.isDOMComponent = k, u.isDOMComponentElement = function(e) {
|
|
382
|
-
return !!(e && f.isValidElement(e) && e.tagName);
|
|
383
|
-
}, u.isElement = function(e) {
|
|
384
|
-
return f.isValidElement(e);
|
|
385
|
-
}, u.isElementOfType = function(e, n) {
|
|
386
|
-
return f.isValidElement(e) && e.type === n;
|
|
387
|
-
}, u.mockComponent = function(e, n) {
|
|
388
|
-
return n = n || e.mockTagName || "div", e.prototype.render.mockImplementation(function() {
|
|
389
|
-
return f.createElement(n, null, this.props.children);
|
|
390
|
-
}), this;
|
|
391
|
-
}, u.nativeTouchData = function(e, n) {
|
|
392
|
-
return { touches: [{ pageX: e, pageY: n }] };
|
|
393
|
-
}, u.renderIntoDocument = function(e) {
|
|
394
|
-
var n = document.createElement("div");
|
|
395
|
-
return T.render(e, n);
|
|
396
|
-
}, u.scryRenderedComponentsWithType = Y, u.scryRenderedDOMComponentsWithClass = K, u.scryRenderedDOMComponentsWithTag = W, u.traverseTwoPhase = F, u;
|
|
1
|
+
import { j as t } from "./index.es82.js";
|
|
2
|
+
import { useRef as n, useMemo as c, useImperativeHandle as f, useEffect as a } from "react";
|
|
3
|
+
import { s as x } from "./index.es336.js";
|
|
4
|
+
import { TreeApiContext as v, DataUpdatesContext as E, NodesContext as h, DndContext as j } from "./index.es337.js";
|
|
5
|
+
import { TreeApi as T } from "./index.es257.js";
|
|
6
|
+
import { initialState as d } from "./index.es338.js";
|
|
7
|
+
import { rootReducer as S } from "./index.es339.js";
|
|
8
|
+
import { HTML5Backend as R } from "./index.es340.js";
|
|
9
|
+
import { createStore as b } from "./index.es341.js";
|
|
10
|
+
import { actions as g } from "./index.es264.js";
|
|
11
|
+
import { DndProvider as C } from "./index.es342.js";
|
|
12
|
+
const A = d();
|
|
13
|
+
function P({ treeProps: r, imperativeHandle: l, children: m }) {
|
|
14
|
+
const p = n(null), u = n(null), o = n(
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
b(S, d(r))
|
|
17
|
+
), s = x.useSyncExternalStore(o.current.subscribe, o.current.getState, () => A), e = c(() => new T(o.current, r, p, u), []), i = n(0);
|
|
18
|
+
return c(() => {
|
|
19
|
+
i.current += 1, e.update(r);
|
|
20
|
+
}, [...Object.values(r), s.nodes.open]), f(l, () => e), a(() => {
|
|
21
|
+
e.props.selection ? e.select(e.props.selection, { focus: !1 }) : e.deselectAll();
|
|
22
|
+
}, [e.props.selection]), a(() => {
|
|
23
|
+
e.props.searchTerm || o.current.dispatch(g.clear(!0));
|
|
24
|
+
}, [e.props.searchTerm]), t.jsx(v.Provider, { value: e, children: t.jsx(E.Provider, { value: i.current, children: t.jsx(h.Provider, { value: s.nodes, children: t.jsx(j.Provider, { value: s.dnd, children: t.jsx(C, Object.assign({ backend: R, options: { rootElement: e.props.dndRootElement || void 0 } }, r.dndManager && { manager: r.dndManager }, { children: m })) }) }) }) });
|
|
397
25
|
}
|
|
398
26
|
export {
|
|
399
|
-
|
|
27
|
+
P as TreeProvider
|
|
400
28
|
};
|