@dreamtree-org/twreact-ui 2.0.3 → 2.0.5
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/README.md +17 -6
- package/ai-skills/dreamtree-ui.md +12 -5
- package/dist/ai-schema.json +150 -1
- package/dist/charts/index.d.ts +2 -1
- package/dist/charts/index.js +297 -12
- package/dist/components/charts/ChartFrame.d.ts +1 -0
- package/dist/components/charts/ChartFrame.d.ts.map +1 -1
- package/dist/components/charts/ScatterChart.d.ts +4 -0
- package/dist/components/charts/ScatterChart.d.ts.map +1 -0
- package/dist/components/charts/ScatterTooltip.d.ts +14 -0
- package/dist/components/charts/ScatterTooltip.d.ts.map +1 -0
- package/dist/components/charts/scatterData.d.ts +17 -0
- package/dist/components/charts/scatterData.d.ts.map +1 -0
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +2 -0
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/utility/Sortable.d.ts.map +1 -1
- package/dist/components/utility/SortableGroup.d.ts +15 -0
- package/dist/components/utility/SortableGroup.d.ts.map +1 -0
- package/dist/esm/charts/index.js +1 -0
- package/dist/esm/components/charts/ChartFrame.js +5 -5
- package/dist/esm/components/charts/ScatterChart.js +204 -0
- package/dist/esm/components/charts/ScatterTooltip.js +61 -0
- package/dist/esm/components/charts/scatterData.js +43 -0
- package/dist/esm/components/core/DatePicker.js +4 -1
- package/dist/esm/components/core/DateRangePicker.js +6 -2
- package/dist/esm/components/core/Select.js +6 -2
- package/dist/esm/components/navigation/Navbar.js +23 -6
- package/dist/esm/components/navigation/Sidebar.js +9 -2
- package/dist/esm/components/utility/Sortable.js +70 -48
- package/dist/esm/components/utility/SortableGroup.js +48 -0
- package/dist/esm/hooks/useFocusTrap.js +21 -9
- package/dist/esm/hooks/useSortable.js +96 -30
- package/dist/esm/hooks/useSortableGroup.js +268 -0
- package/dist/esm/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useSortable.d.ts +12 -3
- package/dist/hooks/useSortable.d.ts.map +1 -1
- package/dist/hooks/useSortableGroup.d.ts +43 -0
- package/dist/hooks/useSortableGroup.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +936 -498
- package/dist/index.js +936 -497
- package/dist/types/charts.d.ts +28 -0
- package/dist/types/charts.d.ts.map +1 -1
- package/dist/types/index.d.ts +40 -1
- package/dist/types/index.d.ts.map +1 -1
- package/doc/README.md +2 -0
- package/mcp/catalog.snapshot.json +252 -14
- package/package.json +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { useRef, useState, useMemo, createContext, useContext, useEffect, useLayoutEffect } from 'react';
|
|
4
|
+
import { useLatestRef } from './useLatestRef.js';
|
|
5
|
+
|
|
6
|
+
// Internal (not exported). Cross-list moves for Sortable lists inside a
|
|
7
|
+
// SortableGroup. The group holds one "carry": the item on its way from one list
|
|
8
|
+
// to another, the target `{ listId, index }` and whether `canDrop` allows it.
|
|
9
|
+
// The target list draws a placeholder from it; nothing is committed until the
|
|
10
|
+
// drop, so a refused target is never shown as a success.
|
|
11
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
12
|
+
var SortableGroupContext = /*#__PURE__*/createContext(null);
|
|
13
|
+
var documentOrder = function documentOrder(a, b) {
|
|
14
|
+
return a === b ? 0 : a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
15
|
+
};
|
|
16
|
+
var contains = function contains(rect, point) {
|
|
17
|
+
return point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
|
|
18
|
+
};
|
|
19
|
+
/** Insertion index for `point` among the items of a list (midpoint hit-test). */
|
|
20
|
+
function indexAt(list, point) {
|
|
21
|
+
var index = list.itemKeys.findIndex(function (k) {
|
|
22
|
+
var _list$nodeFor;
|
|
23
|
+
var rect = (_list$nodeFor = list.nodeFor(k)) === null || _list$nodeFor === void 0 ? void 0 : _list$nodeFor.getBoundingClientRect();
|
|
24
|
+
if (!rect) return false;
|
|
25
|
+
return list.orientation === "horizontal" ? point.x < rect.left + rect.width / 2 : point.y < rect.top + rect.height / 2;
|
|
26
|
+
});
|
|
27
|
+
return index === -1 ? list.itemKeys.length : index;
|
|
28
|
+
}
|
|
29
|
+
/** State + stable API behind <SortableGroup>. */
|
|
30
|
+
function useSortableGroupState(_ref) {
|
|
31
|
+
var onMove = _ref.onMove,
|
|
32
|
+
canDrop = _ref.canDrop;
|
|
33
|
+
var lists = useRef(new Map());
|
|
34
|
+
var carryRef = useRef(null);
|
|
35
|
+
var focusRef = useRef(null);
|
|
36
|
+
var _useState = useState(null),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
carry = _useState2[0],
|
|
39
|
+
setCarryState = _useState2[1];
|
|
40
|
+
var latest = useLatestRef({
|
|
41
|
+
onMove: onMove,
|
|
42
|
+
canDrop: canDrop
|
|
43
|
+
});
|
|
44
|
+
var api = useMemo(function () {
|
|
45
|
+
var setCarry = function setCarry(next) {
|
|
46
|
+
carryRef.current = next;
|
|
47
|
+
setCarryState(next);
|
|
48
|
+
return next;
|
|
49
|
+
};
|
|
50
|
+
var read = function read(id) {
|
|
51
|
+
var _lists$current$get;
|
|
52
|
+
return (_lists$current$get = lists.current.get(id)) === null || _lists$current$get === void 0 ? void 0 : _lists$current$get();
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
pendingFocus: function pendingFocus() {
|
|
56
|
+
return focusRef.current;
|
|
57
|
+
},
|
|
58
|
+
clearFocus: function clearFocus() {
|
|
59
|
+
focusRef.current = null;
|
|
60
|
+
},
|
|
61
|
+
read: read,
|
|
62
|
+
current: function current() {
|
|
63
|
+
return carryRef.current;
|
|
64
|
+
},
|
|
65
|
+
register: function register(id, reader) {
|
|
66
|
+
lists.current.set(id, reader);
|
|
67
|
+
return function () {
|
|
68
|
+
if (lists.current.get(id) === reader) lists.current["delete"](id);
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
/** List ids in document order (only lists that are mounted). */
|
|
72
|
+
order: function order() {
|
|
73
|
+
return _toConsumableArray(lists.current.keys()).filter(function (id) {
|
|
74
|
+
var _read;
|
|
75
|
+
return (_read = read(id)) === null || _read === void 0 ? void 0 : _read.node;
|
|
76
|
+
}).sort(function (a, b) {
|
|
77
|
+
return documentOrder(read(a).node, read(b).node);
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
aim: function aim(from, item, target) {
|
|
81
|
+
var c = carryRef.current;
|
|
82
|
+
if (c && c.from.listId === from.listId && c.target.listId === target.listId && c.target.index === target.index) return c;
|
|
83
|
+
var test = latest.current.canDrop;
|
|
84
|
+
return setCarry({
|
|
85
|
+
from: from,
|
|
86
|
+
item: item,
|
|
87
|
+
target: target,
|
|
88
|
+
allowed: test ? Boolean(test(item, target, from)) : true
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
clear: function clear() {
|
|
92
|
+
if (carryRef.current) setCarry(null);
|
|
93
|
+
},
|
|
94
|
+
drop: function drop(c, focus) {
|
|
95
|
+
var _latest$current$onMov, _latest$current;
|
|
96
|
+
setCarry(null);
|
|
97
|
+
focusRef.current = focus || null;
|
|
98
|
+
(_latest$current$onMov = (_latest$current = latest.current).onMove) === null || _latest$current$onMov === void 0 || _latest$current$onMov.call(_latest$current, {
|
|
99
|
+
item: c.item,
|
|
100
|
+
from: c.from,
|
|
101
|
+
to: c.target
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}, [latest]);
|
|
106
|
+
return useMemo(function () {
|
|
107
|
+
return {
|
|
108
|
+
api: api,
|
|
109
|
+
carry: carry
|
|
110
|
+
};
|
|
111
|
+
}, [api, carry]);
|
|
112
|
+
}
|
|
113
|
+
function makeCross(api, latest) {
|
|
114
|
+
var me = function me() {
|
|
115
|
+
return latest.current;
|
|
116
|
+
};
|
|
117
|
+
var origin = function origin(key) {
|
|
118
|
+
var m = me();
|
|
119
|
+
var index = m.itemKeys.indexOf(key);
|
|
120
|
+
return {
|
|
121
|
+
from: {
|
|
122
|
+
listId: m.listId,
|
|
123
|
+
index: index
|
|
124
|
+
},
|
|
125
|
+
item: m.items[index]
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
var say = function say(kind, key) {
|
|
129
|
+
var _me;
|
|
130
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
131
|
+
args[_key - 2] = arguments[_key];
|
|
132
|
+
}
|
|
133
|
+
return (_me = me()).announce.apply(_me, [kind, me().labelFor(key)].concat(args));
|
|
134
|
+
};
|
|
135
|
+
var aimAt = function aimAt(key, target) {
|
|
136
|
+
var _origin = origin(key),
|
|
137
|
+
from = _origin.from,
|
|
138
|
+
item = _origin.item;
|
|
139
|
+
var next = api.aim(from, item, target);
|
|
140
|
+
var list = api.read(target.listId);
|
|
141
|
+
if (next.allowed) say("movedToList", key, list.label, target.index + 1, list.items.length + 1);else say("refused", key, list.label);
|
|
142
|
+
};
|
|
143
|
+
return {
|
|
144
|
+
// Pointer: true while the pointer is over another list of the group.
|
|
145
|
+
over: function over(point, key) {
|
|
146
|
+
var id = api.order().find(function (other) {
|
|
147
|
+
return other !== me().listId && contains(api.read(other).node.getBoundingClientRect(), point);
|
|
148
|
+
});
|
|
149
|
+
if (id === undefined) {
|
|
150
|
+
api.clear();
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
var _origin2 = origin(key),
|
|
154
|
+
from = _origin2.from,
|
|
155
|
+
item = _origin2.item;
|
|
156
|
+
api.aim(from, item, {
|
|
157
|
+
listId: id,
|
|
158
|
+
index: indexAt(api.read(id), point)
|
|
159
|
+
});
|
|
160
|
+
return true;
|
|
161
|
+
},
|
|
162
|
+
// Pointer drop: true when the drop was handled here (moved, or refused and dropped nowhere).
|
|
163
|
+
release: function release() {
|
|
164
|
+
var c = api.current();
|
|
165
|
+
if (!c) return false;
|
|
166
|
+
if (c.allowed) api.drop(c);else api.clear();
|
|
167
|
+
return true;
|
|
168
|
+
},
|
|
169
|
+
// Keyboard: carry the item to the previous (-1) or next (1) list.
|
|
170
|
+
step: function step(key, dir) {
|
|
171
|
+
var m = me();
|
|
172
|
+
var ids = api.order();
|
|
173
|
+
var c = api.current();
|
|
174
|
+
var nextId = ids[ids.indexOf(c ? c.target.listId : m.listId) + dir];
|
|
175
|
+
if (nextId === undefined) return;
|
|
176
|
+
m.setDraft(null);
|
|
177
|
+
if (nextId === m.listId) {
|
|
178
|
+
api.clear();
|
|
179
|
+
say("moved", key, m.itemKeys.indexOf(key) + 1, m.itemKeys.length);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
var index = c ? c.target.index : m.keys.indexOf(key);
|
|
183
|
+
aimAt(key, {
|
|
184
|
+
listId: nextId,
|
|
185
|
+
index: Math.min(index, api.read(nextId).items.length)
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
// Keyboard: move within the target list; false when the item is still in its own list.
|
|
189
|
+
nudge: function nudge(key, delta) {
|
|
190
|
+
var c = api.current();
|
|
191
|
+
if (!c) return false;
|
|
192
|
+
var size = api.read(c.target.listId).items.length;
|
|
193
|
+
var index = Math.max(0, Math.min(size, c.target.index + delta));
|
|
194
|
+
if (index !== c.target.index) aimAt(key, {
|
|
195
|
+
listId: c.target.listId,
|
|
196
|
+
index: index
|
|
197
|
+
});
|
|
198
|
+
return true;
|
|
199
|
+
},
|
|
200
|
+
// Keyboard drop: "dropped", "refused" (keep carrying) or false (in-list drop).
|
|
201
|
+
drop: function drop(key) {
|
|
202
|
+
var c = api.current();
|
|
203
|
+
if (!c) return false;
|
|
204
|
+
var list = api.read(c.target.listId);
|
|
205
|
+
if (!c.allowed) {
|
|
206
|
+
say("refused", key, list.label);
|
|
207
|
+
return "refused";
|
|
208
|
+
}
|
|
209
|
+
api.drop(c, {
|
|
210
|
+
listId: c.target.listId,
|
|
211
|
+
key: list.getKey(c.item, c.target.index)
|
|
212
|
+
});
|
|
213
|
+
say("droppedInList", key, list.label, c.target.index + 1, list.items.length + 1);
|
|
214
|
+
return "dropped";
|
|
215
|
+
},
|
|
216
|
+
cancel: function cancel() {
|
|
217
|
+
return api.clear();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Wires one Sortable into the surrounding SortableGroup (if any). Outside a
|
|
223
|
+
* group, or without an `id`, it returns `{ cross: undefined }` and the list
|
|
224
|
+
* behaves exactly like a standalone Sortable.
|
|
225
|
+
*/
|
|
226
|
+
function useSortableGroupMember(options) {
|
|
227
|
+
var _group$api;
|
|
228
|
+
var group = useContext(SortableGroupContext);
|
|
229
|
+
var latest = useLatestRef(options);
|
|
230
|
+
var listId = options.listId,
|
|
231
|
+
itemKeys = options.itemKeys,
|
|
232
|
+
nodeFor = options.nodeFor;
|
|
233
|
+
var api = listId == null ? null : (_group$api = group === null || group === void 0 ? void 0 : group.api) !== null && _group$api !== void 0 ? _group$api : null;
|
|
234
|
+
useEffect(function () {
|
|
235
|
+
return api ? api.register(listId, function () {
|
|
236
|
+
return _objectSpread2(_objectSpread2({}, latest.current), {}, {
|
|
237
|
+
node: latest.current.listRef.current
|
|
238
|
+
});
|
|
239
|
+
}) : undefined;
|
|
240
|
+
}, [api, listId, latest]);
|
|
241
|
+
var cross = useMemo(function () {
|
|
242
|
+
return api ? makeCross(api, latest) : undefined;
|
|
243
|
+
}, [api, latest]);
|
|
244
|
+
// After a keyboard drop the moved item mounts here; keep focus on it.
|
|
245
|
+
var signature = itemKeys.join("\0");
|
|
246
|
+
useIsomorphicLayoutEffect(function () {
|
|
247
|
+
var pending = api === null || api === void 0 ? void 0 : api.pendingFocus();
|
|
248
|
+
if (!pending || pending.listId !== listId) return;
|
|
249
|
+
var node = nodeFor(pending.key);
|
|
250
|
+
if (node) {
|
|
251
|
+
api.clearFocus();
|
|
252
|
+
node.focus();
|
|
253
|
+
}
|
|
254
|
+
}, [api, listId, signature, nodeFor]);
|
|
255
|
+
var carry = api ? group.carry : null;
|
|
256
|
+
return {
|
|
257
|
+
cross: cross,
|
|
258
|
+
// Where another list's item would land in this list.
|
|
259
|
+
incoming: carry && carry.target.listId === listId ? {
|
|
260
|
+
index: carry.target.index,
|
|
261
|
+
allowed: carry.allowed
|
|
262
|
+
} : null,
|
|
263
|
+
// This list's item currently aimed at another list.
|
|
264
|
+
outgoing: carry && carry.from.listId === listId ? carry : null
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export { SortableGroupContext, indexAt, useSortableGroupMember, useSortableGroupState };
|
package/dist/esm/index.js
CHANGED
|
@@ -57,6 +57,7 @@ export { default as FileUpload } from './components/utility/FileUpload.js';
|
|
|
57
57
|
export { Condition } from './components/utility/Condition.js';
|
|
58
58
|
export { Carousel } from './components/utility/Carousel.js';
|
|
59
59
|
export { default as Sortable } from './components/utility/Sortable.js';
|
|
60
|
+
export { default as SortableGroup } from './components/utility/SortableGroup.js';
|
|
60
61
|
export { default as PullToRefresh } from './components/utility/PullToRefresh.js';
|
|
61
62
|
export { default as AppShell } from './components/blocks/AppShell.js';
|
|
62
63
|
export { default as PageHeader } from './components/blocks/PageHeader.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusTrap.d.ts","sourceRoot":"","sources":["../../src/hooks/useFocusTrap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFocusTrap.d.ts","sourceRoot":"","sources":["../../src/hooks/useFocusTrap.js"],"names":[],"mappings":"AAoEA;;;;GAIG;AACH;;;;;;SAmCC;AAtGD,wCAOY;AAsBL,+CAKC"}
|
|
@@ -1,39 +1,48 @@
|
|
|
1
|
+
export function arrayMove(list: any, from: any, to: any): any;
|
|
1
2
|
export function moveKey(keys: any, key: any, toIndex: any): any;
|
|
2
|
-
export function useSortableKeyboard({ keys, setDraft, commit, announce, labelFor, orientation }: {
|
|
3
|
+
export function useSortableKeyboard({ keys, setDraft, commit, announce, labelFor, orientation, cross }: {
|
|
3
4
|
keys: any;
|
|
4
5
|
setDraft: any;
|
|
5
6
|
commit: any;
|
|
6
7
|
announce: any;
|
|
7
8
|
labelFor: any;
|
|
8
9
|
orientation: any;
|
|
10
|
+
cross: any;
|
|
9
11
|
}): {
|
|
10
12
|
grabbed: null;
|
|
11
|
-
keyDownFor: (key: any) => (e: any) =>
|
|
13
|
+
keyDownFor: (key: any) => (e: any) => any;
|
|
12
14
|
cancel: () => void;
|
|
13
15
|
};
|
|
14
16
|
/** Nearest scrollable ancestor along `axis`, or `null` for the window. */
|
|
15
17
|
export function getScrollParent(node: any, axis: any): any;
|
|
16
18
|
/** Scroll speed (px/frame, signed) for a coordinate near the [start, end] edges. */
|
|
17
19
|
export function edgeSpeed(pos: any, start: any, end: any, edge?: number): number;
|
|
18
|
-
export function useSortablePointer({ keys, setDraft, commit, nodeFor, orientation, disabled }: {
|
|
20
|
+
export function useSortablePointer({ keys, setDraft, commit, nodeFor, orientation, disabled, cross }: {
|
|
19
21
|
keys: any;
|
|
20
22
|
setDraft: any;
|
|
21
23
|
commit: any;
|
|
22
24
|
nodeFor: any;
|
|
23
25
|
orientation: any;
|
|
24
26
|
disabled: any;
|
|
27
|
+
cross: any;
|
|
25
28
|
}): {
|
|
26
29
|
dragging: null;
|
|
27
30
|
startFor: (key: any, { longPress }?: {
|
|
28
31
|
longPress?: boolean | undefined;
|
|
29
32
|
}) => (e: any) => void;
|
|
30
33
|
};
|
|
34
|
+
export function defaultGetKey(item: any, index: any): any;
|
|
35
|
+
export function defaultGetItemLabel(item: any, index: any): any;
|
|
31
36
|
export namespace DEFAULT_SORTABLE_MESSAGES {
|
|
32
37
|
let instructions: string;
|
|
33
38
|
function grabbed(label: any, position: any, total: any): string;
|
|
34
39
|
function moved(label: any, position: any, total: any): string;
|
|
35
40
|
function dropped(label: any, position: any, total: any): string;
|
|
36
41
|
function cancelled(label: any, position: any): string;
|
|
42
|
+
let groupInstructions: string;
|
|
43
|
+
function movedToList(label: any, list: any, position: any, total: any): string;
|
|
44
|
+
function droppedInList(label: any, list: any, position: any, total: any): string;
|
|
45
|
+
function refused(label: any, list: any): string;
|
|
37
46
|
}
|
|
38
47
|
export const DRAG_THRESHOLD: 4;
|
|
39
48
|
export const LONG_PRESS_DELAY: 250;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSortable.d.ts","sourceRoot":"","sources":["../../src/hooks/useSortable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSortable.d.ts","sourceRoot":"","sources":["../../src/hooks/useSortable.js"],"names":[],"mappings":"AAaA,8DAKC;AAED,gEAIC;AA0BD;;;;;;;;;;+BAK+B,MAAC;;EA4C/B;AAqBD,0EAA0E;AAC1E,2DAOC;AAED,oFAAoF;AACpF,iFAIC;AAOD;;;;;;;;;;;;WAwByD,MAAC;EAyGzD;AAtQM,0DAAqE;AACrE,gEACgI;;;IAkB5H,gEAAmF;IACrF,8DAAiF;IAC/E,gEAAmF;IACjF,sDAAoF;;IAGlF,+EAAgG;IAC9F,iFAAoG;IAC1G,gDAAyD;;AAkEpE,6BAA8B,CAAC,CAAC;AAGhC,+BAAgC,GAAG,CAAC;AACpC,mCAAoC,CAAC,CAAC;AAGtC,+BAAgC,EAAE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Insertion index for `point` among the items of a list (midpoint hit-test). */
|
|
2
|
+
export function indexAt(list: any, point: any): any;
|
|
3
|
+
/** State + stable API behind <SortableGroup>. */
|
|
4
|
+
export function useSortableGroupState({ onMove, canDrop }: {
|
|
5
|
+
onMove: any;
|
|
6
|
+
canDrop: any;
|
|
7
|
+
}): {
|
|
8
|
+
api: {
|
|
9
|
+
pendingFocus: () => null;
|
|
10
|
+
clearFocus: () => void;
|
|
11
|
+
read: (id: any) => any;
|
|
12
|
+
current: () => null;
|
|
13
|
+
register(id: any, reader: any): () => void;
|
|
14
|
+
/** List ids in document order (only lists that are mounted). */
|
|
15
|
+
order: () => any[];
|
|
16
|
+
aim(from: any, item: any, target: any): any;
|
|
17
|
+
clear: () => void;
|
|
18
|
+
drop(c: any, focus: any): void;
|
|
19
|
+
};
|
|
20
|
+
carry: null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Wires one Sortable into the surrounding SortableGroup (if any). Outside a
|
|
24
|
+
* group, or without an `id`, it returns `{ cross: undefined }` and the list
|
|
25
|
+
* behaves exactly like a standalone Sortable.
|
|
26
|
+
*/
|
|
27
|
+
export function useSortableGroupMember(options: any): {
|
|
28
|
+
cross: {
|
|
29
|
+
over(point: any, key: any): boolean;
|
|
30
|
+
release(): boolean;
|
|
31
|
+
step(key: any, dir: any): void;
|
|
32
|
+
nudge(key: any, delta: any): boolean;
|
|
33
|
+
drop(key: any): false | "refused" | "dropped";
|
|
34
|
+
cancel: () => any;
|
|
35
|
+
} | undefined;
|
|
36
|
+
incoming: {
|
|
37
|
+
index: any;
|
|
38
|
+
allowed: any;
|
|
39
|
+
} | null;
|
|
40
|
+
outgoing: any;
|
|
41
|
+
};
|
|
42
|
+
export const SortableGroupContext: import("react").Context<null>;
|
|
43
|
+
//# sourceMappingURL=useSortableGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSortableGroup.d.ts","sourceRoot":"","sources":["../../src/hooks/useSortableGroup.js"],"names":[],"mappings":"AAmBA,iFAAiF;AACjF,oDAOC;AAED,iDAAiD;AACjD;;;;;;;;;;QA2BM,gEAAgE;;;;;;;EAqBrE;AAgFD;;;;GAIG;AACH;;;;;;;;;;;;;;EAiCC;AAzLD,iEAAwD"}
|