@proyecto-viviana/solid-stately 0.1.5 → 0.2.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/{src → dist}/autocomplete/createAutocompleteState.d.ts +0 -1
- package/{src → dist}/autocomplete/index.d.ts +0 -1
- package/{src → dist}/calendar/createCalendarState.d.ts +0 -1
- package/{src → dist}/calendar/createDateFieldState.d.ts +0 -1
- package/{src → dist}/calendar/createRangeCalendarState.d.ts +0 -1
- package/{src → dist}/calendar/createTimeFieldState.d.ts +0 -1
- package/{src → dist}/calendar/index.d.ts +0 -1
- package/{src → dist}/checkbox/createCheckboxGroupState.d.ts +0 -1
- package/{src → dist}/checkbox/index.d.ts +0 -1
- package/{src → dist}/collections/ListCollection.d.ts +0 -1
- package/{src → dist}/collections/createListState.d.ts +0 -1
- package/{src → dist}/collections/createMenuState.d.ts +0 -1
- package/{src → dist}/collections/createSelectionState.d.ts +0 -1
- package/{src → dist}/collections/index.d.ts +0 -1
- package/{src → dist}/collections/types.d.ts +0 -1
- package/{src → dist}/color/Color.d.ts +0 -1
- package/{src → dist}/color/createColorAreaState.d.ts +0 -1
- package/{src → dist}/color/createColorFieldState.d.ts +0 -1
- package/{src → dist}/color/createColorSliderState.d.ts +0 -1
- package/{src → dist}/color/createColorWheelState.d.ts +0 -1
- package/{src → dist}/color/index.d.ts +0 -1
- package/{src → dist}/color/types.d.ts +0 -1
- package/{src → dist}/combobox/createComboBoxState.d.ts +0 -1
- package/{src → dist}/combobox/index.d.ts +0 -1
- package/{src → dist}/disclosure/createDisclosureState.d.ts +0 -1
- package/{src → dist}/disclosure/index.d.ts +0 -1
- package/{src → dist}/dnd/createDragState.d.ts +0 -1
- package/{src → dist}/dnd/createDraggableCollectionState.d.ts +0 -1
- package/{src → dist}/dnd/createDropState.d.ts +0 -1
- package/{src → dist}/dnd/createDroppableCollectionState.d.ts +0 -1
- package/{src → dist}/dnd/index.d.ts +0 -1
- package/{src → dist}/dnd/types.d.ts +0 -1
- package/{src → dist}/form/createFormValidationState.d.ts +0 -1
- package/{src → dist}/form/index.d.ts +0 -1
- package/{src → dist}/grid/createGridState.d.ts +0 -1
- package/{src → dist}/grid/index.d.ts +0 -1
- package/{src → dist}/grid/types.d.ts +0 -1
- package/dist/index.d.ts +25 -3363
- package/dist/index.js +2 -2
- package/dist/index.js.map +7 -1
- package/{src → dist}/numberfield/createNumberFieldState.d.ts +0 -1
- package/{src → dist}/numberfield/index.d.ts +0 -1
- package/{src → dist}/overlays/createOverlayTriggerState.d.ts +0 -1
- package/{src → dist}/overlays/index.d.ts +0 -1
- package/{src → dist}/radio/createRadioGroupState.d.ts +0 -1
- package/{src → dist}/radio/index.d.ts +0 -1
- package/{src → dist}/searchfield/createSearchFieldState.d.ts +0 -1
- package/{src → dist}/searchfield/index.d.ts +0 -1
- package/{src → dist}/select/createSelectState.d.ts +0 -1
- package/{src → dist}/select/index.d.ts +0 -1
- package/{src → dist}/slider/createSliderState.d.ts +0 -1
- package/{src → dist}/slider/index.d.ts +0 -1
- package/{src → dist}/ssr/index.d.ts +0 -1
- package/{src → dist}/table/TableCollection.d.ts +0 -1
- package/{src → dist}/table/createTableState.d.ts +0 -1
- package/{src → dist}/table/index.d.ts +0 -1
- package/{src → dist}/table/types.d.ts +0 -1
- package/{src → dist}/tabs/createTabListState.d.ts +0 -1
- package/{src → dist}/tabs/index.d.ts +0 -1
- package/{src → dist}/textfield/createTextFieldState.d.ts +0 -1
- package/{src → dist}/textfield/index.d.ts +0 -1
- package/{src → dist}/toast/createToastState.d.ts +0 -1
- package/{src → dist}/toast/index.d.ts +0 -1
- package/{src → dist}/toggle/createToggleState.d.ts +0 -1
- package/{src → dist}/toggle/index.d.ts +0 -1
- package/{src → dist}/tooltip/createTooltipTriggerState.d.ts +0 -1
- package/{src → dist}/tooltip/index.d.ts +0 -1
- package/{src → dist}/tree/TreeCollection.d.ts +0 -1
- package/{src → dist}/tree/createTreeState.d.ts +0 -1
- package/{src → dist}/tree/index.d.ts +0 -1
- package/{src → dist}/tree/types.d.ts +0 -1
- package/{src → dist}/utils/reactivity.d.ts +0 -1
- package/package.json +5 -7
- package/src/autocomplete/createAutocompleteState.d.ts.map +0 -1
- package/src/autocomplete/createAutocompleteState.ts +0 -90
- package/src/autocomplete/index.d.ts.map +0 -1
- package/src/autocomplete/index.ts +0 -5
- package/src/calendar/createCalendarState.d.ts.map +0 -1
- package/src/calendar/createCalendarState.ts +0 -461
- package/src/calendar/createDateFieldState.d.ts.map +0 -1
- package/src/calendar/createDateFieldState.ts +0 -562
- package/src/calendar/createRangeCalendarState.d.ts.map +0 -1
- package/src/calendar/createRangeCalendarState.ts +0 -535
- package/src/calendar/createTimeFieldState.d.ts.map +0 -1
- package/src/calendar/createTimeFieldState.ts +0 -483
- package/src/calendar/index.d.ts.map +0 -1
- package/src/calendar/index.ts +0 -81
- package/src/checkbox/createCheckboxGroupState.d.ts.map +0 -1
- package/src/checkbox/createCheckboxGroupState.ts +0 -193
- package/src/checkbox/index.d.ts.map +0 -1
- package/src/checkbox/index.ts +0 -5
- package/src/collections/ListCollection.d.ts.map +0 -1
- package/src/collections/ListCollection.ts +0 -146
- package/src/collections/createListState.d.ts.map +0 -1
- package/src/collections/createListState.ts +0 -264
- package/src/collections/createMenuState.d.ts.map +0 -1
- package/src/collections/createMenuState.ts +0 -106
- package/src/collections/createSelectionState.d.ts.map +0 -1
- package/src/collections/createSelectionState.ts +0 -336
- package/src/collections/index.d.ts.map +0 -1
- package/src/collections/index.ts +0 -46
- package/src/collections/types.d.ts.map +0 -1
- package/src/collections/types.ts +0 -169
- package/src/color/Color.d.ts.map +0 -1
- package/src/color/Color.ts +0 -951
- package/src/color/createColorAreaState.d.ts.map +0 -1
- package/src/color/createColorAreaState.ts +0 -293
- package/src/color/createColorFieldState.d.ts.map +0 -1
- package/src/color/createColorFieldState.ts +0 -292
- package/src/color/createColorSliderState.d.ts.map +0 -1
- package/src/color/createColorSliderState.ts +0 -241
- package/src/color/createColorWheelState.d.ts.map +0 -1
- package/src/color/createColorWheelState.ts +0 -211
- package/src/color/index.d.ts.map +0 -1
- package/src/color/index.ts +0 -47
- package/src/color/types.d.ts.map +0 -1
- package/src/color/types.ts +0 -127
- package/src/combobox/createComboBoxState.d.ts.map +0 -1
- package/src/combobox/createComboBoxState.ts +0 -703
- package/src/combobox/index.d.ts.map +0 -1
- package/src/combobox/index.ts +0 -13
- package/src/disclosure/createDisclosureState.d.ts.map +0 -1
- package/src/disclosure/createDisclosureState.ts +0 -193
- package/src/disclosure/index.d.ts.map +0 -1
- package/src/disclosure/index.ts +0 -9
- package/src/dnd/createDragState.d.ts.map +0 -1
- package/src/dnd/createDragState.ts +0 -153
- package/src/dnd/createDraggableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDraggableCollectionState.ts +0 -165
- package/src/dnd/createDropState.d.ts.map +0 -1
- package/src/dnd/createDropState.ts +0 -212
- package/src/dnd/createDroppableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDroppableCollectionState.ts +0 -357
- package/src/dnd/index.d.ts.map +0 -1
- package/src/dnd/index.ts +0 -76
- package/src/dnd/types.d.ts.map +0 -1
- package/src/dnd/types.ts +0 -317
- package/src/form/createFormValidationState.d.ts.map +0 -1
- package/src/form/createFormValidationState.ts +0 -389
- package/src/form/index.d.ts.map +0 -1
- package/src/form/index.ts +0 -15
- package/src/grid/createGridState.d.ts.map +0 -1
- package/src/grid/createGridState.ts +0 -327
- package/src/grid/index.d.ts.map +0 -1
- package/src/grid/index.ts +0 -13
- package/src/grid/types.d.ts.map +0 -1
- package/src/grid/types.ts +0 -179
- package/src/index.d.ts +0 -26
- package/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -383
- package/src/numberfield/createNumberFieldState.d.ts.map +0 -1
- package/src/numberfield/createNumberFieldState.ts +0 -383
- package/src/numberfield/index.d.ts.map +0 -1
- package/src/numberfield/index.ts +0 -5
- package/src/overlays/createOverlayTriggerState.d.ts.map +0 -1
- package/src/overlays/createOverlayTriggerState.ts +0 -67
- package/src/overlays/index.d.ts.map +0 -1
- package/src/overlays/index.ts +0 -5
- package/src/radio/createRadioGroupState.d.ts.map +0 -1
- package/src/radio/createRadioGroupState.ts +0 -201
- package/src/radio/index.d.ts.map +0 -1
- package/src/radio/index.ts +0 -6
- package/src/searchfield/createSearchFieldState.d.ts.map +0 -1
- package/src/searchfield/createSearchFieldState.ts +0 -62
- package/src/searchfield/index.d.ts.map +0 -1
- package/src/searchfield/index.ts +0 -5
- package/src/select/createSelectState.d.ts.map +0 -1
- package/src/select/createSelectState.ts +0 -181
- package/src/select/index.d.ts.map +0 -1
- package/src/select/index.ts +0 -5
- package/src/slider/createSliderState.d.ts.map +0 -1
- package/src/slider/createSliderState.ts +0 -211
- package/src/slider/index.d.ts.map +0 -1
- package/src/slider/index.ts +0 -6
- package/src/ssr/index.d.ts.map +0 -1
- package/src/ssr/index.ts +0 -41
- package/src/table/TableCollection.d.ts.map +0 -1
- package/src/table/TableCollection.ts +0 -388
- package/src/table/createTableState.d.ts.map +0 -1
- package/src/table/createTableState.ts +0 -127
- package/src/table/index.d.ts.map +0 -1
- package/src/table/index.ts +0 -18
- package/src/table/types.d.ts.map +0 -1
- package/src/table/types.ts +0 -150
- package/src/tabs/createTabListState.d.ts.map +0 -1
- package/src/tabs/createTabListState.ts +0 -240
- package/src/tabs/index.d.ts.map +0 -1
- package/src/tabs/index.ts +0 -7
- package/src/textfield/createTextFieldState.d.ts.map +0 -1
- package/src/textfield/createTextFieldState.ts +0 -75
- package/src/textfield/index.d.ts.map +0 -1
- package/src/textfield/index.ts +0 -5
- package/src/toast/createToastState.d.ts.map +0 -1
- package/src/toast/createToastState.ts +0 -316
- package/src/toast/index.d.ts.map +0 -1
- package/src/toast/index.ts +0 -11
- package/src/toggle/createToggleState.d.ts.map +0 -1
- package/src/toggle/createToggleState.ts +0 -94
- package/src/toggle/index.d.ts.map +0 -1
- package/src/toggle/index.ts +0 -5
- package/src/tooltip/createTooltipTriggerState.d.ts.map +0 -1
- package/src/tooltip/createTooltipTriggerState.ts +0 -183
- package/src/tooltip/index.d.ts.map +0 -1
- package/src/tooltip/index.ts +0 -6
- package/src/tree/TreeCollection.d.ts.map +0 -1
- package/src/tree/TreeCollection.ts +0 -175
- package/src/tree/createTreeState.d.ts.map +0 -1
- package/src/tree/createTreeState.ts +0 -392
- package/src/tree/index.d.ts.map +0 -1
- package/src/tree/index.ts +0 -13
- package/src/tree/types.d.ts.map +0 -1
- package/src/tree/types.ts +0 -174
- package/src/utils/index.d.ts +0 -2
- package/src/utils/index.d.ts.map +0 -1
- package/src/utils/reactivity.d.ts.map +0 -1
- package/src/utils/reactivity.ts +0 -36
- /package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -0
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drop state management for solid-stately.
|
|
3
|
-
*
|
|
4
|
-
* Provides reactive state for drop target operations.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { createSignal, createMemo, type Accessor } from 'solid-js';
|
|
8
|
-
import type {
|
|
9
|
-
DropItem,
|
|
10
|
-
DropEnterEvent,
|
|
11
|
-
DropMoveEvent,
|
|
12
|
-
DropExitEvent,
|
|
13
|
-
DropActivateEvent,
|
|
14
|
-
DropEvent,
|
|
15
|
-
DropOperation,
|
|
16
|
-
DragTypes,
|
|
17
|
-
} from './types';
|
|
18
|
-
|
|
19
|
-
export interface DropStateOptions {
|
|
20
|
-
/**
|
|
21
|
-
* A function returning the drop operation to be performed.
|
|
22
|
-
*/
|
|
23
|
-
getDropOperation?: (
|
|
24
|
-
types: DragTypes,
|
|
25
|
-
allowedOperations: DropOperation[]
|
|
26
|
-
) => DropOperation;
|
|
27
|
-
/**
|
|
28
|
-
* A function returning the drop operation for a specific point.
|
|
29
|
-
*/
|
|
30
|
-
getDropOperationForPoint?: (
|
|
31
|
-
types: DragTypes,
|
|
32
|
-
allowedOperations: DropOperation[],
|
|
33
|
-
x: number,
|
|
34
|
-
y: number
|
|
35
|
-
) => DropOperation;
|
|
36
|
-
/** Handler that is called when a valid drag enters the drop target. */
|
|
37
|
-
onDropEnter?: (e: DropEnterEvent) => void;
|
|
38
|
-
/** Handler that is called when a valid drag is moved within the drop target. */
|
|
39
|
-
onDropMove?: (e: DropMoveEvent) => void;
|
|
40
|
-
/** Handler that is called after a valid drag is held over the drop target. */
|
|
41
|
-
onDropActivate?: (e: DropActivateEvent) => void;
|
|
42
|
-
/** Handler that is called when a valid drag exits the drop target. */
|
|
43
|
-
onDropExit?: (e: DropExitEvent) => void;
|
|
44
|
-
/** Handler that is called when a valid drag is dropped on the drop target. */
|
|
45
|
-
onDrop?: (e: DropEvent) => void;
|
|
46
|
-
/** Whether there is a separate drop button affordance. */
|
|
47
|
-
hasDropButton?: boolean;
|
|
48
|
-
/** Whether the drop target is disabled. */
|
|
49
|
-
isDisabled?: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface DropState {
|
|
53
|
-
/** Whether the drop target is currently being hovered or focused. */
|
|
54
|
-
readonly isDropTarget: boolean;
|
|
55
|
-
/** Whether the drop target is disabled. */
|
|
56
|
-
readonly isDisabled: boolean;
|
|
57
|
-
/** Whether there is a drop button. */
|
|
58
|
-
readonly hasDropButton: boolean;
|
|
59
|
-
/** Enter the drop target. */
|
|
60
|
-
enterTarget(x: number, y: number): void;
|
|
61
|
-
/** Move within the drop target. */
|
|
62
|
-
moveInTarget(x: number, y: number): void;
|
|
63
|
-
/** Exit the drop target. */
|
|
64
|
-
exitTarget(x: number, y: number): void;
|
|
65
|
-
/** Activate the drop target (after holding). */
|
|
66
|
-
activateTarget(x: number, y: number): void;
|
|
67
|
-
/** Perform a drop on the target. */
|
|
68
|
-
drop(x: number, y: number, items: DropItem[], dropOperation: DropOperation): void;
|
|
69
|
-
/** Get the drop operation for given types. */
|
|
70
|
-
getDropOperation(types: DragTypes, allowedOperations: DropOperation[]): DropOperation;
|
|
71
|
-
/** Get the drop operation for a specific point. */
|
|
72
|
-
getDropOperationForPoint(
|
|
73
|
-
types: DragTypes,
|
|
74
|
-
allowedOperations: DropOperation[],
|
|
75
|
-
x: number,
|
|
76
|
-
y: number
|
|
77
|
-
): DropOperation;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Creates drop state for managing drop target operations.
|
|
82
|
-
*
|
|
83
|
-
* @param props - Accessor returning drop state options
|
|
84
|
-
* @returns Drop state object
|
|
85
|
-
*/
|
|
86
|
-
export function createDropState(
|
|
87
|
-
props: Accessor<DropStateOptions>
|
|
88
|
-
): DropState {
|
|
89
|
-
const getProps = createMemo(() => props());
|
|
90
|
-
|
|
91
|
-
const [isDropTarget, setIsDropTarget] = createSignal(false);
|
|
92
|
-
|
|
93
|
-
const enterTarget = (x: number, y: number) => {
|
|
94
|
-
const p = getProps();
|
|
95
|
-
if (p.isDisabled) return;
|
|
96
|
-
|
|
97
|
-
setIsDropTarget(true);
|
|
98
|
-
|
|
99
|
-
if (typeof p.onDropEnter === 'function') {
|
|
100
|
-
p.onDropEnter({
|
|
101
|
-
type: 'dropenter',
|
|
102
|
-
x,
|
|
103
|
-
y,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const moveInTarget = (x: number, y: number) => {
|
|
109
|
-
const p = getProps();
|
|
110
|
-
if (!isDropTarget() || p.isDisabled) return;
|
|
111
|
-
|
|
112
|
-
if (typeof p.onDropMove === 'function') {
|
|
113
|
-
p.onDropMove({
|
|
114
|
-
type: 'dropmove',
|
|
115
|
-
x,
|
|
116
|
-
y,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const exitTarget = (x: number, y: number) => {
|
|
122
|
-
const p = getProps();
|
|
123
|
-
|
|
124
|
-
setIsDropTarget(false);
|
|
125
|
-
|
|
126
|
-
if (typeof p.onDropExit === 'function') {
|
|
127
|
-
p.onDropExit({
|
|
128
|
-
type: 'dropexit',
|
|
129
|
-
x,
|
|
130
|
-
y,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const activateTarget = (x: number, y: number) => {
|
|
136
|
-
const p = getProps();
|
|
137
|
-
if (p.isDisabled) return;
|
|
138
|
-
|
|
139
|
-
if (typeof p.onDropActivate === 'function') {
|
|
140
|
-
p.onDropActivate({
|
|
141
|
-
type: 'dropactivate',
|
|
142
|
-
x,
|
|
143
|
-
y,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const drop = (
|
|
149
|
-
x: number,
|
|
150
|
-
y: number,
|
|
151
|
-
items: DropItem[],
|
|
152
|
-
dropOperation: DropOperation
|
|
153
|
-
) => {
|
|
154
|
-
const p = getProps();
|
|
155
|
-
if (p.isDisabled) return;
|
|
156
|
-
|
|
157
|
-
setIsDropTarget(false);
|
|
158
|
-
|
|
159
|
-
if (typeof p.onDrop === 'function') {
|
|
160
|
-
p.onDrop({
|
|
161
|
-
type: 'drop',
|
|
162
|
-
x,
|
|
163
|
-
y,
|
|
164
|
-
items,
|
|
165
|
-
dropOperation,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const getDropOperation = (
|
|
171
|
-
types: DragTypes,
|
|
172
|
-
allowedOperations: DropOperation[]
|
|
173
|
-
): DropOperation => {
|
|
174
|
-
const p = getProps();
|
|
175
|
-
if (typeof p.getDropOperation === 'function') {
|
|
176
|
-
return p.getDropOperation(types, allowedOperations);
|
|
177
|
-
}
|
|
178
|
-
return allowedOperations[0] ?? 'cancel';
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const getDropOperationForPoint = (
|
|
182
|
-
types: DragTypes,
|
|
183
|
-
allowedOperations: DropOperation[],
|
|
184
|
-
x: number,
|
|
185
|
-
y: number
|
|
186
|
-
): DropOperation => {
|
|
187
|
-
const p = getProps();
|
|
188
|
-
if (typeof p.getDropOperationForPoint === 'function') {
|
|
189
|
-
return p.getDropOperationForPoint(types, allowedOperations, x, y);
|
|
190
|
-
}
|
|
191
|
-
return getDropOperation(types, allowedOperations);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
get isDropTarget() {
|
|
196
|
-
return isDropTarget();
|
|
197
|
-
},
|
|
198
|
-
get isDisabled() {
|
|
199
|
-
return getProps().isDisabled ?? false;
|
|
200
|
-
},
|
|
201
|
-
get hasDropButton() {
|
|
202
|
-
return getProps().hasDropButton ?? false;
|
|
203
|
-
},
|
|
204
|
-
enterTarget,
|
|
205
|
-
moveInTarget,
|
|
206
|
-
exitTarget,
|
|
207
|
-
activateTarget,
|
|
208
|
-
drop,
|
|
209
|
-
getDropOperation,
|
|
210
|
-
getDropOperationForPoint,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDroppableCollectionState.d.ts","sourceRoot":"","sources":["createDroppableCollectionState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,EACT,6BAA6B,EAE7B,gCAAgC,EAChC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,+BAA+B,EAC/B,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACnD;;OAEG;IACH,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,aAAa,EAAE,KAC/B,aAAa,CAAC;IACnB,qEAAqE;IACrE,WAAW,CAAC,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AAS,GAAG,OAAO,CAAC;IACtC,+CAA+C;IAC/C,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5D,kDAAkD;IAClD,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7D,2BAA2B;IAC3B,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,mCAAmC;IACnC,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,wCAAwC;IACxC,IAAI,CACF,KAAK,EAAE,QAAQ,EAAE,EACjB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,OAAO,EACnB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAClC,IAAI,CAAC;IACR,2CAA2C;IAC3C,gBAAgB,CACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,aAAa,EAAE,GACjC,aAAa,CAAC;IACjB,gDAAgD;IAChD,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;CACzE;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAA4B,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,QAAQ,CAAC,+BAA+B,CAAC,GAC/C,wBAAwB,CAyO1B"}
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Droppable collection state management for solid-stately.
|
|
3
|
-
*
|
|
4
|
-
* Provides reactive state for accepting drops onto a collection.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { createSignal, createMemo, type Accessor } from 'solid-js';
|
|
8
|
-
import type {
|
|
9
|
-
DropItem,
|
|
10
|
-
DropTarget,
|
|
11
|
-
DropOperation,
|
|
12
|
-
DragTypes,
|
|
13
|
-
DroppableCollectionEnterEvent,
|
|
14
|
-
DroppableCollectionMoveEvent,
|
|
15
|
-
DroppableCollectionActivateEvent,
|
|
16
|
-
DroppableCollectionExitEvent,
|
|
17
|
-
DroppableCollectionDropEvent,
|
|
18
|
-
DroppableCollectionInsertDropEvent,
|
|
19
|
-
DroppableCollectionRootDropEvent,
|
|
20
|
-
DroppableCollectionOnItemDropEvent,
|
|
21
|
-
DroppableCollectionReorderEvent,
|
|
22
|
-
ItemDropTarget,
|
|
23
|
-
} from './types';
|
|
24
|
-
|
|
25
|
-
export interface DroppableCollectionStateOptions {
|
|
26
|
-
/**
|
|
27
|
-
* The drag types that the droppable collection accepts.
|
|
28
|
-
* @default 'all'
|
|
29
|
-
*/
|
|
30
|
-
acceptedDragTypes?: 'all' | Array<string | symbol>;
|
|
31
|
-
/**
|
|
32
|
-
* A function returning the drop operation to be performed.
|
|
33
|
-
*/
|
|
34
|
-
getDropOperation?: (
|
|
35
|
-
target: DropTarget,
|
|
36
|
-
types: DragTypes,
|
|
37
|
-
allowedOperations: DropOperation[]
|
|
38
|
-
) => DropOperation;
|
|
39
|
-
/** Handler that is called when a valid drag enters a drop target. */
|
|
40
|
-
onDropEnter?: (e: DroppableCollectionEnterEvent) => void;
|
|
41
|
-
/** Handler that is called after a valid drag is held over a drop target. */
|
|
42
|
-
onDropActivate?: (e: DroppableCollectionActivateEvent) => void;
|
|
43
|
-
/** Handler that is called when a valid drag exits a drop target. */
|
|
44
|
-
onDropExit?: (e: DroppableCollectionExitEvent) => void;
|
|
45
|
-
/** Handler that is called when a valid drag is dropped. */
|
|
46
|
-
onDrop?: (e: DroppableCollectionDropEvent) => void;
|
|
47
|
-
/** Handler that is called when external items are dropped "between" items. */
|
|
48
|
-
onInsert?: (e: DroppableCollectionInsertDropEvent) => void;
|
|
49
|
-
/** Handler that is called when external items are dropped on the collection's root. */
|
|
50
|
-
onRootDrop?: (e: DroppableCollectionRootDropEvent) => void;
|
|
51
|
-
/** Handler that is called when items are dropped "on" an item. */
|
|
52
|
-
onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;
|
|
53
|
-
/** Handler that is called when items are reordered within the collection. */
|
|
54
|
-
onReorder?: (e: DroppableCollectionReorderEvent) => void;
|
|
55
|
-
/** Handler that is called when items are moved within the source collection. */
|
|
56
|
-
onMove?: (e: DroppableCollectionReorderEvent) => void;
|
|
57
|
-
/** A function returning whether a given target is a valid "on" drop target. */
|
|
58
|
-
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean;
|
|
59
|
-
/** Whether the droppable collection is disabled. */
|
|
60
|
-
isDisabled?: boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface DroppableCollectionState {
|
|
64
|
-
/** Whether a drag is currently over the collection. */
|
|
65
|
-
readonly isDropTarget: boolean;
|
|
66
|
-
/** The current drop target within the collection. */
|
|
67
|
-
readonly target: DropTarget | null;
|
|
68
|
-
/** Whether the collection is disabled for drops. */
|
|
69
|
-
readonly isDisabled: boolean;
|
|
70
|
-
/** Set the current drop target. */
|
|
71
|
-
setTarget(target: DropTarget | null): void;
|
|
72
|
-
/** Check if a drag type is accepted. */
|
|
73
|
-
isAccepted(types: DragTypes): boolean;
|
|
74
|
-
/** Enter the collection with a drop target. */
|
|
75
|
-
enterTarget(target: DropTarget, x: number, y: number): void;
|
|
76
|
-
/** Move to a new target within the collection. */
|
|
77
|
-
moveToTarget(target: DropTarget, x: number, y: number): void;
|
|
78
|
-
/** Exit the collection. */
|
|
79
|
-
exitTarget(x: number, y: number): void;
|
|
80
|
-
/** Activate the current target. */
|
|
81
|
-
activateTarget(x: number, y: number): void;
|
|
82
|
-
/** Perform a drop on the collection. */
|
|
83
|
-
drop(
|
|
84
|
-
items: DropItem[],
|
|
85
|
-
dropOperation: DropOperation,
|
|
86
|
-
isInternal: boolean,
|
|
87
|
-
draggingKeys?: Set<string | number>
|
|
88
|
-
): void;
|
|
89
|
-
/** Get the drop operation for a target. */
|
|
90
|
-
getDropOperation(
|
|
91
|
-
target: DropTarget,
|
|
92
|
-
types: DragTypes,
|
|
93
|
-
allowedOperations: DropOperation[]
|
|
94
|
-
): DropOperation;
|
|
95
|
-
/** Check if an item drop should be accepted. */
|
|
96
|
-
shouldAcceptItemDrop(target: ItemDropTarget, types: DragTypes): boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Symbol for directory drag type.
|
|
101
|
-
*/
|
|
102
|
-
export const DIRECTORY_DRAG_TYPE: symbol = Symbol('directory');
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Creates state for accepting drops onto a collection.
|
|
106
|
-
*
|
|
107
|
-
* @param props - Accessor returning droppable collection options
|
|
108
|
-
* @returns Droppable collection state object
|
|
109
|
-
*/
|
|
110
|
-
export function createDroppableCollectionState(
|
|
111
|
-
props: Accessor<DroppableCollectionStateOptions>
|
|
112
|
-
): DroppableCollectionState {
|
|
113
|
-
const getProps = createMemo(() => props());
|
|
114
|
-
|
|
115
|
-
const [isDropTarget, setIsDropTarget] = createSignal(false);
|
|
116
|
-
const [target, setTarget] = createSignal<DropTarget | null>(null);
|
|
117
|
-
|
|
118
|
-
const isAccepted = (types: DragTypes): boolean => {
|
|
119
|
-
const p = getProps();
|
|
120
|
-
const acceptedTypes = p.acceptedDragTypes ?? 'all';
|
|
121
|
-
|
|
122
|
-
if (acceptedTypes === 'all') {
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
for (const type of acceptedTypes) {
|
|
127
|
-
if (types.has(type)) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return false;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const enterTarget = (dropTarget: DropTarget, x: number, y: number) => {
|
|
136
|
-
const p = getProps();
|
|
137
|
-
if (p.isDisabled) return;
|
|
138
|
-
|
|
139
|
-
setIsDropTarget(true);
|
|
140
|
-
setTarget(dropTarget);
|
|
141
|
-
|
|
142
|
-
if (typeof p.onDropEnter === 'function') {
|
|
143
|
-
p.onDropEnter({
|
|
144
|
-
type: 'dropenter',
|
|
145
|
-
x,
|
|
146
|
-
y,
|
|
147
|
-
target: dropTarget,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const moveToTarget = (dropTarget: DropTarget, x: number, y: number) => {
|
|
153
|
-
const p = getProps();
|
|
154
|
-
if (p.isDisabled) return;
|
|
155
|
-
|
|
156
|
-
const prevTarget = target();
|
|
157
|
-
setTarget(dropTarget);
|
|
158
|
-
|
|
159
|
-
// Fire exit/enter events if target changed
|
|
160
|
-
if (prevTarget && !targetsEqual(prevTarget, dropTarget)) {
|
|
161
|
-
if (typeof p.onDropExit === 'function') {
|
|
162
|
-
p.onDropExit({
|
|
163
|
-
type: 'dropexit',
|
|
164
|
-
x,
|
|
165
|
-
y,
|
|
166
|
-
target: prevTarget,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (typeof p.onDropEnter === 'function') {
|
|
171
|
-
p.onDropEnter({
|
|
172
|
-
type: 'dropenter',
|
|
173
|
-
x,
|
|
174
|
-
y,
|
|
175
|
-
target: dropTarget,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const exitTarget = (x: number, y: number) => {
|
|
182
|
-
const p = getProps();
|
|
183
|
-
const currentTarget = target();
|
|
184
|
-
|
|
185
|
-
setIsDropTarget(false);
|
|
186
|
-
setTarget(null);
|
|
187
|
-
|
|
188
|
-
if (currentTarget && typeof p.onDropExit === 'function') {
|
|
189
|
-
p.onDropExit({
|
|
190
|
-
type: 'dropexit',
|
|
191
|
-
x,
|
|
192
|
-
y,
|
|
193
|
-
target: currentTarget,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const activateTarget = (x: number, y: number) => {
|
|
199
|
-
const p = getProps();
|
|
200
|
-
const currentTarget = target();
|
|
201
|
-
if (p.isDisabled || !currentTarget) return;
|
|
202
|
-
|
|
203
|
-
if (typeof p.onDropActivate === 'function') {
|
|
204
|
-
p.onDropActivate({
|
|
205
|
-
type: 'dropactivate',
|
|
206
|
-
x,
|
|
207
|
-
y,
|
|
208
|
-
target: currentTarget,
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const drop = (
|
|
214
|
-
items: DropItem[],
|
|
215
|
-
dropOperation: DropOperation,
|
|
216
|
-
isInternal: boolean,
|
|
217
|
-
draggingKeys?: Set<string | number>
|
|
218
|
-
) => {
|
|
219
|
-
const p = getProps();
|
|
220
|
-
const currentTarget = target();
|
|
221
|
-
if (p.isDisabled || !currentTarget) return;
|
|
222
|
-
|
|
223
|
-
setIsDropTarget(false);
|
|
224
|
-
setTarget(null);
|
|
225
|
-
|
|
226
|
-
// Call the generic onDrop handler
|
|
227
|
-
if (typeof p.onDrop === 'function') {
|
|
228
|
-
p.onDrop({
|
|
229
|
-
type: 'drop',
|
|
230
|
-
x: 0,
|
|
231
|
-
y: 0,
|
|
232
|
-
items,
|
|
233
|
-
dropOperation,
|
|
234
|
-
target: currentTarget,
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Call specific handlers based on the drop type
|
|
239
|
-
if (currentTarget.type === 'root') {
|
|
240
|
-
if (typeof p.onRootDrop === 'function') {
|
|
241
|
-
p.onRootDrop({
|
|
242
|
-
items,
|
|
243
|
-
dropOperation,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
} else if (currentTarget.type === 'item') {
|
|
247
|
-
if (isInternal && draggingKeys) {
|
|
248
|
-
// Reorder or move within the same collection
|
|
249
|
-
if (currentTarget.dropPosition === 'on') {
|
|
250
|
-
if (typeof p.onMove === 'function') {
|
|
251
|
-
p.onMove({
|
|
252
|
-
keys: draggingKeys,
|
|
253
|
-
dropOperation,
|
|
254
|
-
target: currentTarget,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
} else {
|
|
258
|
-
if (typeof p.onReorder === 'function') {
|
|
259
|
-
p.onReorder({
|
|
260
|
-
keys: draggingKeys,
|
|
261
|
-
dropOperation,
|
|
262
|
-
target: currentTarget,
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
} else {
|
|
267
|
-
// External drop
|
|
268
|
-
if (currentTarget.dropPosition === 'on') {
|
|
269
|
-
if (typeof p.onItemDrop === 'function') {
|
|
270
|
-
p.onItemDrop({
|
|
271
|
-
items,
|
|
272
|
-
dropOperation,
|
|
273
|
-
isInternal,
|
|
274
|
-
target: currentTarget,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
} else {
|
|
278
|
-
if (typeof p.onInsert === 'function') {
|
|
279
|
-
p.onInsert({
|
|
280
|
-
items,
|
|
281
|
-
dropOperation,
|
|
282
|
-
target: currentTarget,
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
const getDropOperation = (
|
|
291
|
-
dropTarget: DropTarget,
|
|
292
|
-
types: DragTypes,
|
|
293
|
-
allowedOperations: DropOperation[]
|
|
294
|
-
): DropOperation => {
|
|
295
|
-
const p = getProps();
|
|
296
|
-
|
|
297
|
-
if (!isAccepted(types)) {
|
|
298
|
-
return 'cancel';
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (typeof p.getDropOperation === 'function') {
|
|
302
|
-
return p.getDropOperation(dropTarget, types, allowedOperations);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return allowedOperations[0] ?? 'cancel';
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
const shouldAcceptItemDrop = (
|
|
309
|
-
dropTarget: ItemDropTarget,
|
|
310
|
-
types: DragTypes
|
|
311
|
-
): boolean => {
|
|
312
|
-
const p = getProps();
|
|
313
|
-
|
|
314
|
-
if (!isAccepted(types)) {
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
if (typeof p.shouldAcceptItemDrop === 'function') {
|
|
319
|
-
return p.shouldAcceptItemDrop(dropTarget, types);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
return true;
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
return {
|
|
326
|
-
get isDropTarget() {
|
|
327
|
-
return isDropTarget();
|
|
328
|
-
},
|
|
329
|
-
get target() {
|
|
330
|
-
return target();
|
|
331
|
-
},
|
|
332
|
-
get isDisabled() {
|
|
333
|
-
return getProps().isDisabled ?? false;
|
|
334
|
-
},
|
|
335
|
-
setTarget,
|
|
336
|
-
isAccepted,
|
|
337
|
-
enterTarget,
|
|
338
|
-
moveToTarget,
|
|
339
|
-
exitTarget,
|
|
340
|
-
activateTarget,
|
|
341
|
-
drop,
|
|
342
|
-
getDropOperation,
|
|
343
|
-
shouldAcceptItemDrop,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Check if two drop targets are equal.
|
|
349
|
-
*/
|
|
350
|
-
function targetsEqual(a: DropTarget, b: DropTarget): boolean {
|
|
351
|
-
if (a.type !== b.type) return false;
|
|
352
|
-
if (a.type === 'root' && b.type === 'root') return true;
|
|
353
|
-
if (a.type === 'item' && b.type === 'item') {
|
|
354
|
-
return a.key === b.key && a.dropPosition === b.dropPosition;
|
|
355
|
-
}
|
|
356
|
-
return false;
|
|
357
|
-
}
|
package/src/dnd/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,+BAA+B,EAC/B,SAAS,EACT,kBAAkB,EAClB,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,mBAAmB,EACnB,iCAAiC,EACjC,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,GAC9B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,GAC9B,MAAM,kCAAkC,CAAC"}
|
package/src/dnd/index.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drag and Drop state management for solid-stately.
|
|
3
|
-
*
|
|
4
|
-
* Exports for DnD functionality.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Types
|
|
8
|
-
export type {
|
|
9
|
-
DropOperation,
|
|
10
|
-
DragItem,
|
|
11
|
-
DragDropEvent,
|
|
12
|
-
DragStartEvent,
|
|
13
|
-
DragMoveEvent,
|
|
14
|
-
DragEndEvent,
|
|
15
|
-
DropEnterEvent,
|
|
16
|
-
DropMoveEvent,
|
|
17
|
-
DropActivateEvent,
|
|
18
|
-
DropExitEvent,
|
|
19
|
-
TextDropItem,
|
|
20
|
-
FileDropItem,
|
|
21
|
-
DirectoryDropItem,
|
|
22
|
-
DropItem,
|
|
23
|
-
DropEvent,
|
|
24
|
-
DropPosition,
|
|
25
|
-
RootDropTarget,
|
|
26
|
-
ItemDropTarget,
|
|
27
|
-
DropTarget,
|
|
28
|
-
DroppableCollectionEnterEvent,
|
|
29
|
-
DroppableCollectionMoveEvent,
|
|
30
|
-
DroppableCollectionActivateEvent,
|
|
31
|
-
DroppableCollectionExitEvent,
|
|
32
|
-
DroppableCollectionDropEvent,
|
|
33
|
-
DroppableCollectionInsertDropEvent,
|
|
34
|
-
DroppableCollectionRootDropEvent,
|
|
35
|
-
DroppableCollectionOnItemDropEvent,
|
|
36
|
-
DroppableCollectionReorderEvent,
|
|
37
|
-
DragTypes,
|
|
38
|
-
DropTargetDelegate,
|
|
39
|
-
DraggableCollectionStartEvent,
|
|
40
|
-
DraggableCollectionMoveEvent,
|
|
41
|
-
DraggableCollectionEndEvent,
|
|
42
|
-
DragPreviewRenderer,
|
|
43
|
-
DroppableCollectionUtilityOptions,
|
|
44
|
-
DroppableCollectionBaseProps,
|
|
45
|
-
DroppableCollectionProps,
|
|
46
|
-
DraggableCollectionProps,
|
|
47
|
-
} from './types';
|
|
48
|
-
|
|
49
|
-
// Drag state
|
|
50
|
-
export {
|
|
51
|
-
createDragState,
|
|
52
|
-
type DragStateOptions,
|
|
53
|
-
type DragState,
|
|
54
|
-
} from './createDragState';
|
|
55
|
-
|
|
56
|
-
// Drop state
|
|
57
|
-
export {
|
|
58
|
-
createDropState,
|
|
59
|
-
type DropStateOptions,
|
|
60
|
-
type DropState,
|
|
61
|
-
} from './createDropState';
|
|
62
|
-
|
|
63
|
-
// Draggable collection state
|
|
64
|
-
export {
|
|
65
|
-
createDraggableCollectionState,
|
|
66
|
-
type DraggableCollectionStateOptions,
|
|
67
|
-
type DraggableCollectionState,
|
|
68
|
-
} from './createDraggableCollectionState';
|
|
69
|
-
|
|
70
|
-
// Droppable collection state
|
|
71
|
-
export {
|
|
72
|
-
createDroppableCollectionState,
|
|
73
|
-
DIRECTORY_DRAG_TYPE,
|
|
74
|
-
type DroppableCollectionStateOptions,
|
|
75
|
-
type DroppableCollectionState,
|
|
76
|
-
} from './createDroppableCollectionState';
|
package/src/dnd/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6CAA6C;AAC7C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,mFAAmF;AACnF,MAAM,WAAW,QAAQ;IACvB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;IACV,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;CACX;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,sBAAsB;IACtB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,sBAAsB;IACtB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,8CAA8C;AAC9C,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,sBAAsB;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,wCAAwC;IACxC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,oDAAoD;AACpD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,sBAAsB;IACtB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,wDAAwD;AACxD,MAAM,WAAW,aAAc,SAAQ,a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