@reforma/components 0.5.0 → 0.6.1
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/SortableList/SortableList.d.ts +9 -3
- package/dist/SortableList/SortableList.d.ts.map +1 -1
- package/dist/SortableList/SortableList.js +178 -163
- package/dist/SortableList/SortableList.js.map +1 -1
- package/dist/chat/ComposerBanner/ComposerBanner.d.ts +1 -1
- package/dist/chat/ComposerBanner/ComposerBanner.d.ts.map +1 -1
- package/dist/chat/ComposerBanner/ComposerBanner.js.map +1 -1
- package/dist/chat/ComposerBanner/ComposerBanner.module.css +1 -1
- package/dist/chat/ComposerBanner/ComposerBanner.module.css.js +5 -5
- package/dist/chat/Message/segments/MessagePhaseSection.module.css +1 -1
- package/dist/chat/Message/turn/MessageAssistantBody.d.ts +2 -1
- package/dist/chat/Message/turn/MessageAssistantBody.d.ts.map +1 -1
- package/dist/chat/Message/turn/MessageAssistantBody.js +62 -58
- package/dist/chat/Message/turn/MessageAssistantBody.js.map +1 -1
- package/dist/chat/Message/turn/workedCollapse.d.ts +6 -2
- package/dist/chat/Message/turn/workedCollapse.d.ts.map +1 -1
- package/dist/chat/Message/turn/workedCollapse.js +24 -18
- package/dist/chat/Message/turn/workedCollapse.js.map +1 -1
- package/dist/chat/Tool/agent/AgentTool.js +5 -5
- package/dist/chat/Tool/agent/AgentTool.js.map +1 -1
- package/dist/chat/Tool/bash/BashTool.d.ts.map +1 -1
- package/dist/chat/Tool/bash/BashTool.js +50 -57
- package/dist/chat/Tool/bash/BashTool.js.map +1 -1
- package/dist/chat/Tool/bash/BashTool.module.css +1 -1
- package/dist/chat/Tool/bash/BashTool.module.css.js +4 -8
- package/dist/chat/Tool/bash/BashTool.module.css.js.map +1 -1
- package/dist/chat/Tool/image-asset/ImageAssetTool.js +1 -1
- package/dist/chat/Tool/image-asset/ImageAssetTool.js.map +1 -1
- package/dist/chat/Tool/shell/ToolShell.js +1 -1
- package/dist/chat/Tool/shell/ToolShell.js.map +1 -1
- package/dist/chat/Tool/shell/ToolShellCard.js +7 -7
- package/dist/chat/Tool/shell/ToolShellCard.js.map +1 -1
- package/dist/openui/functions/index.d.ts +59 -59
- package/dist/openui/functions/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -35,13 +35,19 @@ interface SortableListBaseProps<T> {
|
|
|
35
35
|
items: readonly T[];
|
|
36
36
|
getKey?: (item: T, path: readonly number[]) => string;
|
|
37
37
|
getTextValue: (item: T) => string;
|
|
38
|
-
|
|
38
|
+
/** `move` is the dragged item and its index among its new siblings. */
|
|
39
|
+
onChange: (items: T[], move: {
|
|
40
|
+
item: T;
|
|
41
|
+
index: number;
|
|
42
|
+
}) => void;
|
|
39
43
|
children: (item: T, props: SortableListItemRenderProps<T>) => ReactNode;
|
|
40
44
|
canDrop?: (context: SortableListDropContext<T>) => boolean;
|
|
41
45
|
getDragHandleOptions?: (item: T, context: SortableListItemContext<T>) => SortableListDragHandleOptions;
|
|
42
46
|
className?: string;
|
|
43
47
|
gap?: 'sm' | 'md';
|
|
44
48
|
nestedGap?: 'sm' | 'md';
|
|
49
|
+
/** `false` drops the grip: the whole item starts a drag. Default `true`. */
|
|
50
|
+
handle?: boolean;
|
|
45
51
|
'aria-label': string;
|
|
46
52
|
}
|
|
47
53
|
interface FlatSortableListProps {
|
|
@@ -56,12 +62,12 @@ interface NestedSortableListProps<T> {
|
|
|
56
62
|
}
|
|
57
63
|
export type SortableListProps<T> = SortableListBaseProps<T> & (FlatSortableListProps | NestedSortableListProps<T>);
|
|
58
64
|
/**
|
|
59
|
-
* Sortable collection with a
|
|
65
|
+
* Sortable collection with a pointer handle (or whole-item drag) and optional child groups.
|
|
60
66
|
*
|
|
61
67
|
* The rendered item is the complete draggable surface. Child collections can
|
|
62
68
|
* accept moves when the caller's drop rules allow it.
|
|
63
69
|
*/
|
|
64
|
-
export declare function SortableList<T>({ items, getKey: getItemKey, getTextValue, getChildren, setChildren, canHaveChildren, onChange, children, canDrop, getDragHandleOptions, className, gap, nestedGap, 'aria-label': ariaLabel, }: SortableListProps<T>): import("react").JSX.Element;
|
|
70
|
+
export declare function SortableList<T>({ items, getKey: getItemKey, getTextValue, getChildren, setChildren, canHaveChildren, onChange, children, canDrop, getDragHandleOptions, className, gap, nestedGap, handle, 'aria-label': ariaLabel, }: SortableListProps<T>): import("react").JSX.Element;
|
|
65
71
|
export declare namespace SortableList {
|
|
66
72
|
var displayName: string;
|
|
67
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableList.d.ts","sourceRoot":"","sources":["../../src/SortableList/SortableList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortableList.d.ts","sourceRoot":"","sources":["../../src/SortableList/SortableList.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,192 +1,203 @@
|
|
|
1
|
-
import { DragDropProvider as
|
|
2
|
-
import { isSortable as _, useSortable as
|
|
3
|
-
import { DotsDrag as
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
import { For as
|
|
1
|
+
import { DragDropProvider as ee, PointerSensor as ne, DragOverlay as te, useDroppable as re } from "@dnd-kit/react";
|
|
2
|
+
import { isSortable as _, useSortable as ie } from "@dnd-kit/react/sortable";
|
|
3
|
+
import { DotsDrag as oe } from "@reforma/icons/14";
|
|
4
|
+
import { cn as ae } from "@reforma/lib";
|
|
5
|
+
import { useCallback as le, useMemo as se, useState as de } from "react";
|
|
6
|
+
import { For as j } from "../For/For.js";
|
|
7
|
+
import { Show as ce } from "../Show/Show.js";
|
|
7
8
|
import f from "./SortableList.module.css.js";
|
|
8
|
-
import { buildSortableTree as
|
|
9
|
-
import { jsxs as
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
import { buildSortableTree as ue, moveSortableTreeNodeToIndex as fe, restoreSortableTree as me, findSortableTreeNode as $ } from "./sortableTree.js";
|
|
10
|
+
import { jsxs as A, jsx as o } from "react/jsx-runtime";
|
|
11
|
+
const H = "reforma-sortable:root", D = "reforma-sortable:children:", ve = "reforma-sortable:item", pe = "reforma-sortable:collection", ge = [ne], he = "sortable:primitive:", w = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
let F = 0;
|
|
13
|
+
function be({
|
|
12
14
|
items: e,
|
|
13
15
|
getKey: n,
|
|
14
16
|
getTextValue: t,
|
|
15
17
|
getChildren: r,
|
|
16
18
|
setChildren: i,
|
|
17
19
|
canHaveChildren: a,
|
|
18
|
-
onChange:
|
|
19
|
-
children:
|
|
20
|
-
canDrop:
|
|
20
|
+
onChange: c,
|
|
21
|
+
children: m,
|
|
22
|
+
canDrop: v,
|
|
21
23
|
getDragHandleOptions: x,
|
|
22
24
|
className: P,
|
|
23
|
-
gap:
|
|
24
|
-
nestedGap:
|
|
25
|
-
|
|
25
|
+
gap: b = "md",
|
|
26
|
+
nestedGap: S = b,
|
|
27
|
+
handle: u = !0,
|
|
28
|
+
"aria-label": I
|
|
26
29
|
}) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (typeof c != "object" || c == null)
|
|
35
|
-
return `${me}${v.join(".")}`;
|
|
36
|
-
const d = g.current.objectKeys.get(c);
|
|
30
|
+
const y = le((s, g) => {
|
|
31
|
+
const E = n?.(s, g);
|
|
32
|
+
if (E != null)
|
|
33
|
+
return E;
|
|
34
|
+
if (typeof s != "object" || s == null)
|
|
35
|
+
return `${he}${g.join(".")}`;
|
|
36
|
+
const d = w.get(s);
|
|
37
37
|
if (d)
|
|
38
38
|
return d;
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
}, [n]), p =
|
|
42
|
-
getKey:
|
|
39
|
+
const h = `sortable:item:${F}`;
|
|
40
|
+
return F += 1, w.set(s, h), h;
|
|
41
|
+
}, [n]), p = se(() => ue(e, {
|
|
42
|
+
getKey: y,
|
|
43
43
|
getTextValue: t,
|
|
44
44
|
getChildren: r,
|
|
45
45
|
canHaveChildren: a
|
|
46
|
-
}), [a, r,
|
|
46
|
+
}), [a, r, y, t, e]), [N, Q] = de({
|
|
47
47
|
items: e,
|
|
48
48
|
revision: 0
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
N.items !== e && Q({
|
|
51
51
|
items: e,
|
|
52
|
-
revision:
|
|
52
|
+
revision: N.revision + 1
|
|
53
53
|
});
|
|
54
|
-
function
|
|
54
|
+
function U(s) {
|
|
55
55
|
const {
|
|
56
|
-
canceled:
|
|
57
|
-
operation:
|
|
58
|
-
} =
|
|
56
|
+
canceled: g,
|
|
57
|
+
operation: E
|
|
58
|
+
} = s, {
|
|
59
59
|
source: d,
|
|
60
|
-
target:
|
|
61
|
-
} =
|
|
62
|
-
if (
|
|
60
|
+
target: h
|
|
61
|
+
} = E;
|
|
62
|
+
if (g || !d || !_(d))
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
64
|
+
const T = O(d)?.node;
|
|
65
|
+
if (!T)
|
|
66
66
|
return;
|
|
67
|
-
const
|
|
67
|
+
const C = J(h), L = C?.kind === "node" ? C.node : null;
|
|
68
68
|
let l;
|
|
69
|
-
if (
|
|
70
|
-
parentNode:
|
|
71
|
-
index:
|
|
69
|
+
if (C?.kind === "collection" ? l = {
|
|
70
|
+
parentNode: C.parentNode,
|
|
71
|
+
index: C.parentNode?.children.length ?? p.length,
|
|
72
72
|
dropPosition: "end"
|
|
73
|
-
} : L &&
|
|
73
|
+
} : L && h && _(h) ? l = xe(p, h.group, d.index, L) : l = null, !l)
|
|
74
74
|
return;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
75
|
+
const Z = X(T, l.parentNode, L, l.dropPosition);
|
|
76
|
+
if (!z(T, l.parentNode) || v && !v(Z))
|
|
77
77
|
return;
|
|
78
|
-
const K =
|
|
78
|
+
const K = q(d.initialGroup), R = l.parentNode?.id ?? null;
|
|
79
79
|
if (K !== void 0 && K === R && d.initialIndex === l.index)
|
|
80
80
|
return;
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const G = fe(p, T.id, R, l.index);
|
|
82
|
+
c(me(G, i), {
|
|
83
|
+
item: T.value,
|
|
84
|
+
index: l.index
|
|
85
|
+
});
|
|
83
86
|
}
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
87
|
+
return /* @__PURE__ */ A(
|
|
88
|
+
ee,
|
|
89
|
+
{
|
|
90
|
+
sensors: ge,
|
|
91
|
+
onDragEnd: U,
|
|
92
|
+
children: [/* @__PURE__ */ o(M, {
|
|
93
|
+
nodes: p,
|
|
94
|
+
rootNodes: p,
|
|
95
|
+
parentNode: null,
|
|
96
|
+
renderItem: m,
|
|
97
|
+
canDrop: v,
|
|
98
|
+
getDragHandleOptions: x,
|
|
99
|
+
className: P,
|
|
100
|
+
gap: b,
|
|
101
|
+
nestedGap: S,
|
|
102
|
+
handle: u,
|
|
103
|
+
ariaLabel: I
|
|
104
|
+
}), /* @__PURE__ */ o(te, {
|
|
105
|
+
className: f.dragOverlay,
|
|
106
|
+
dropAnimation: {
|
|
107
|
+
duration: 160,
|
|
108
|
+
easing: "cubic-bezier(0.25, 1, 0.5, 1)"
|
|
109
|
+
},
|
|
110
|
+
children: (s) => {
|
|
111
|
+
const g = O(s)?.node;
|
|
112
|
+
return g ? /* @__PURE__ */ o(Y, {
|
|
113
|
+
node: g,
|
|
114
|
+
renderItem: m,
|
|
115
|
+
nestedGap: S
|
|
116
|
+
}) : null;
|
|
117
|
+
}
|
|
118
|
+
})]
|
|
119
|
+
},
|
|
120
|
+
r ? N.revision : void 0
|
|
121
|
+
);
|
|
114
122
|
}
|
|
115
|
-
function
|
|
123
|
+
function M({
|
|
116
124
|
nodes: e,
|
|
117
125
|
rootNodes: n,
|
|
118
126
|
parentNode: t,
|
|
119
127
|
renderItem: r,
|
|
120
128
|
canDrop: i,
|
|
121
129
|
getDragHandleOptions: a,
|
|
122
|
-
className:
|
|
123
|
-
gap:
|
|
124
|
-
nestedGap:
|
|
125
|
-
|
|
130
|
+
className: c,
|
|
131
|
+
gap: m,
|
|
132
|
+
nestedGap: v,
|
|
133
|
+
handle: x,
|
|
134
|
+
ariaLabel: P
|
|
126
135
|
}) {
|
|
127
136
|
const {
|
|
128
|
-
ref:
|
|
129
|
-
isDropTarget:
|
|
130
|
-
} =
|
|
131
|
-
id:
|
|
132
|
-
type:
|
|
137
|
+
ref: b,
|
|
138
|
+
isDropTarget: S
|
|
139
|
+
} = re({
|
|
140
|
+
id: Pe(t),
|
|
141
|
+
type: pe,
|
|
133
142
|
data: {
|
|
134
143
|
kind: "collection",
|
|
135
144
|
parentNode: t
|
|
136
145
|
},
|
|
137
146
|
disabled: e.length > 0,
|
|
138
147
|
collisionPriority: 1,
|
|
139
|
-
accept: (
|
|
148
|
+
accept: (u) => W(u, t, null, "end", i)
|
|
140
149
|
});
|
|
141
150
|
return /* @__PURE__ */ o("div", {
|
|
142
|
-
ref:
|
|
151
|
+
ref: b,
|
|
143
152
|
role: "list",
|
|
144
|
-
className:
|
|
145
|
-
"data-gap":
|
|
146
|
-
"data-drop-target":
|
|
147
|
-
"aria-label":
|
|
148
|
-
children: /* @__PURE__ */ o(
|
|
153
|
+
className: ae(f.list, c),
|
|
154
|
+
"data-gap": m,
|
|
155
|
+
"data-drop-target": S || void 0,
|
|
156
|
+
"aria-label": P,
|
|
157
|
+
children: /* @__PURE__ */ o(j, {
|
|
149
158
|
each: e,
|
|
150
|
-
children: (
|
|
151
|
-
node:
|
|
159
|
+
children: (u) => /* @__PURE__ */ o(Se, {
|
|
160
|
+
node: u,
|
|
152
161
|
rootNodes: n,
|
|
153
162
|
renderItem: r,
|
|
154
163
|
canDrop: i,
|
|
155
164
|
getDragHandleOptions: a,
|
|
156
|
-
nestedGap:
|
|
157
|
-
|
|
165
|
+
nestedGap: v,
|
|
166
|
+
handle: x
|
|
167
|
+
}, u.id)
|
|
158
168
|
})
|
|
159
169
|
});
|
|
160
170
|
}
|
|
161
|
-
function
|
|
171
|
+
function Se({
|
|
162
172
|
node: e,
|
|
163
173
|
rootNodes: n,
|
|
164
174
|
renderItem: t,
|
|
165
175
|
canDrop: r,
|
|
166
176
|
getDragHandleOptions: i,
|
|
167
|
-
nestedGap: a
|
|
177
|
+
nestedGap: a,
|
|
178
|
+
handle: c
|
|
168
179
|
}) {
|
|
169
|
-
const
|
|
170
|
-
alignment:
|
|
171
|
-
edgeOffset:
|
|
172
|
-
variant:
|
|
173
|
-
} = i?.(e.value,
|
|
174
|
-
handleRef:
|
|
175
|
-
ref:
|
|
176
|
-
targetRef:
|
|
177
|
-
isDragging:
|
|
178
|
-
isDropTarget:
|
|
179
|
-
} =
|
|
180
|
+
const m = B(e), {
|
|
181
|
+
alignment: v = "center",
|
|
182
|
+
edgeOffset: x = "none",
|
|
183
|
+
variant: P = "plain"
|
|
184
|
+
} = i?.(e.value, m) ?? {}, {
|
|
185
|
+
handleRef: b,
|
|
186
|
+
ref: S,
|
|
187
|
+
targetRef: u,
|
|
188
|
+
isDragging: I,
|
|
189
|
+
isDropTarget: y
|
|
190
|
+
} = ie({
|
|
180
191
|
id: e.id,
|
|
181
192
|
index: e.index,
|
|
182
|
-
group:
|
|
183
|
-
type:
|
|
193
|
+
group: V(ye(n, e)),
|
|
194
|
+
type: ve,
|
|
184
195
|
data: {
|
|
185
196
|
kind: "node",
|
|
186
197
|
node: e
|
|
187
198
|
},
|
|
188
|
-
accept: (
|
|
189
|
-
}),
|
|
199
|
+
accept: (N) => W(N, e.parent == null ? null : k(n, e), e, "before", r)
|
|
200
|
+
}), p = e.canHaveChildren ? /* @__PURE__ */ o(M, {
|
|
190
201
|
nodes: e.children,
|
|
191
202
|
rootNodes: n,
|
|
192
203
|
parentNode: e,
|
|
@@ -195,44 +206,48 @@ function pe({
|
|
|
195
206
|
getDragHandleOptions: i,
|
|
196
207
|
gap: a,
|
|
197
208
|
nestedGap: a,
|
|
209
|
+
handle: c,
|
|
198
210
|
ariaLabel: `${e.textValue} items`
|
|
199
211
|
}) : null;
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
ref:
|
|
212
|
+
return /* @__PURE__ */ A("div", {
|
|
213
|
+
ref: S,
|
|
202
214
|
role: "listitem",
|
|
203
215
|
className: f.item,
|
|
204
216
|
"data-level": e.level,
|
|
205
|
-
"data-dragging":
|
|
206
|
-
"data-drop-target":
|
|
217
|
+
"data-dragging": I || void 0,
|
|
218
|
+
"data-drop-target": y || void 0,
|
|
207
219
|
children: [/* @__PURE__ */ o("div", {
|
|
208
|
-
ref:
|
|
220
|
+
ref: u,
|
|
209
221
|
className: f.dropTarget,
|
|
210
222
|
"data-container": e.canHaveChildren || void 0,
|
|
211
223
|
"aria-hidden": !0
|
|
212
|
-
}), /* @__PURE__ */ o(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
}), /* @__PURE__ */ o(ce, {
|
|
225
|
+
when: c,
|
|
226
|
+
children: /* @__PURE__ */ o("span", {
|
|
227
|
+
ref: b,
|
|
228
|
+
className: f.dragHandle,
|
|
229
|
+
"data-alignment": v,
|
|
230
|
+
"data-edge-offset": x,
|
|
231
|
+
"data-variant": P,
|
|
220
232
|
"aria-hidden": !0,
|
|
221
|
-
|
|
222
|
-
|
|
233
|
+
children: /* @__PURE__ */ o(oe, {
|
|
234
|
+
"aria-hidden": !0,
|
|
235
|
+
width: 14,
|
|
236
|
+
height: 14
|
|
237
|
+
})
|
|
223
238
|
})
|
|
224
239
|
}), /* @__PURE__ */ o("div", {
|
|
225
240
|
className: f.content,
|
|
226
241
|
children: t(e.value, {
|
|
227
|
-
...
|
|
228
|
-
nestedItems:
|
|
229
|
-
isDragging:
|
|
230
|
-
isDropTarget:
|
|
242
|
+
...m,
|
|
243
|
+
nestedItems: p,
|
|
244
|
+
isDragging: I,
|
|
245
|
+
isDropTarget: y
|
|
231
246
|
})
|
|
232
247
|
})]
|
|
233
248
|
});
|
|
234
249
|
}
|
|
235
|
-
function
|
|
250
|
+
function Y({
|
|
236
251
|
node: e,
|
|
237
252
|
renderItem: n,
|
|
238
253
|
nestedGap: t
|
|
@@ -240,9 +255,9 @@ function M({
|
|
|
240
255
|
const r = e.canHaveChildren ? /* @__PURE__ */ o("div", {
|
|
241
256
|
className: f.previewList,
|
|
242
257
|
"data-gap": t,
|
|
243
|
-
children: /* @__PURE__ */ o(
|
|
258
|
+
children: /* @__PURE__ */ o(j, {
|
|
244
259
|
each: e.children,
|
|
245
|
-
children: (i) => /* @__PURE__ */ o(
|
|
260
|
+
children: (i) => /* @__PURE__ */ o(Y, {
|
|
246
261
|
node: i,
|
|
247
262
|
renderItem: n,
|
|
248
263
|
nestedGap: t
|
|
@@ -252,14 +267,14 @@ function M({
|
|
|
252
267
|
return /* @__PURE__ */ o("div", {
|
|
253
268
|
className: f.dragPreviewItem,
|
|
254
269
|
children: n(e.value, {
|
|
255
|
-
...
|
|
270
|
+
...B(e),
|
|
256
271
|
nestedItems: r,
|
|
257
272
|
isDragging: !1,
|
|
258
273
|
isDropTarget: !1
|
|
259
274
|
})
|
|
260
275
|
});
|
|
261
276
|
}
|
|
262
|
-
function
|
|
277
|
+
function B(e) {
|
|
263
278
|
return {
|
|
264
279
|
level: e.level,
|
|
265
280
|
parent: e.parent,
|
|
@@ -271,11 +286,11 @@ function Y(e) {
|
|
|
271
286
|
canHaveChildren: e.canHaveChildren
|
|
272
287
|
};
|
|
273
288
|
}
|
|
274
|
-
function
|
|
289
|
+
function W(e, n, t, r, i) {
|
|
275
290
|
const a = O(e)?.node;
|
|
276
|
-
return !a || !
|
|
291
|
+
return !a || !z(a, n) ? !1 : i?.(X(a, n, t, r)) ?? !0;
|
|
277
292
|
}
|
|
278
|
-
function
|
|
293
|
+
function X(e, n, t, r) {
|
|
279
294
|
return {
|
|
280
295
|
items: [e.value],
|
|
281
296
|
target: t?.value ?? null,
|
|
@@ -286,36 +301,36 @@ function W(e, n, t, r) {
|
|
|
286
301
|
dropPosition: r
|
|
287
302
|
};
|
|
288
303
|
}
|
|
289
|
-
function
|
|
304
|
+
function z(e, n) {
|
|
290
305
|
return n == null || n.id !== e.id && $(e.children, n.id) == null;
|
|
291
306
|
}
|
|
292
|
-
function
|
|
293
|
-
const i =
|
|
307
|
+
function xe(e, n, t, r) {
|
|
308
|
+
const i = q(n);
|
|
294
309
|
if (i === void 0)
|
|
295
310
|
return null;
|
|
296
311
|
const a = i == null ? null : $(e, i);
|
|
297
312
|
if (i != null && !a)
|
|
298
313
|
return null;
|
|
299
|
-
const
|
|
314
|
+
const c = r != null && t > r.index;
|
|
300
315
|
return {
|
|
301
316
|
parentNode: a,
|
|
302
317
|
index: t,
|
|
303
|
-
dropPosition:
|
|
318
|
+
dropPosition: c ? "after" : "before"
|
|
304
319
|
};
|
|
305
320
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
308
|
-
}
|
|
309
|
-
function z(e) {
|
|
310
|
-
return e == null ? A : `${D}${e}`;
|
|
321
|
+
function Pe(e) {
|
|
322
|
+
return V(e?.id ?? null);
|
|
311
323
|
}
|
|
312
324
|
function V(e) {
|
|
313
|
-
|
|
325
|
+
return e == null ? H : `${D}${e}`;
|
|
326
|
+
}
|
|
327
|
+
function q(e) {
|
|
328
|
+
if (e === H)
|
|
314
329
|
return null;
|
|
315
330
|
if (typeof e == "string" && e.startsWith(D))
|
|
316
331
|
return e.slice(D.length);
|
|
317
332
|
}
|
|
318
|
-
function
|
|
333
|
+
function ye(e, n) {
|
|
319
334
|
return k(e, n)?.id ?? null;
|
|
320
335
|
}
|
|
321
336
|
function k(e, n) {
|
|
@@ -328,7 +343,7 @@ function k(e, n) {
|
|
|
328
343
|
}
|
|
329
344
|
return null;
|
|
330
345
|
}
|
|
331
|
-
function
|
|
346
|
+
function J(e) {
|
|
332
347
|
const n = e?.data;
|
|
333
348
|
return n?.kind === "node" && "node" in n ? {
|
|
334
349
|
kind: "node",
|
|
@@ -339,11 +354,11 @@ function q(e) {
|
|
|
339
354
|
} : null;
|
|
340
355
|
}
|
|
341
356
|
function O(e) {
|
|
342
|
-
const n =
|
|
357
|
+
const n = J(e);
|
|
343
358
|
return n?.kind === "node" ? n : null;
|
|
344
359
|
}
|
|
345
|
-
|
|
360
|
+
be.displayName = "SortableList";
|
|
346
361
|
export {
|
|
347
|
-
|
|
362
|
+
be as SortableList
|
|
348
363
|
};
|
|
349
364
|
//# sourceMappingURL=SortableList.js.map
|