@eightshift/ui-components 6.0.13 → 6.1.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/{Button-JRIu2BnS.js → Button-CFnNdpNZ.js} +9 -9
- package/dist/{Dialog-Dd1yqNus.js → Dialog-D0jMcN-a.js} +79 -60
- package/dist/{FieldError-DmVwL6Dj.js → FieldError-BPG0hKfB.js} +2 -2
- package/dist/{FocusScope-Dri1oBcH.js → FocusScope-BJhC1-1e.js} +6 -7
- package/dist/{Heading-eA6LXIKB.js → Heading-CY-_gt-U.js} +2 -2
- package/dist/{Input-Cuw9UbNb.js → Input-B4X6-x6r.js} +8 -8
- package/dist/{Label-DPWyf-gp.js → Label-BDlf9vIY.js} +3 -2
- package/dist/{List-CWheI3JH.js → List-CQFXnN4w.js} +1 -1
- package/dist/{ListBox-DT1sFY3e.js → ListBox-BaN0n5h3.js} +30 -28
- package/dist/{OverlayArrow-DVJTTfZM.js → OverlayArrow-Dy0qw7WL.js} +7 -7
- package/dist/{PortalProvider-CHPnqDSH.js → PortalProvider-BQ1X8vGX.js} +1 -1
- package/dist/{RadioGroup-Cp5cdBI_.js → RadioGroup-CjCAbUr4.js} +15 -15
- package/dist/{SearchField-CLhr5PGZ.js → SearchField-CafsA525.js} +12 -12
- package/dist/{SelectionManager-DbBiF5M8.js → SelectionManager-oojq6MOy.js} +38 -34
- package/dist/{SharedElementTransition-B_vnQ1uR.js → SharedElementTransition-CtoWSaF0.js} +1 -1
- package/dist/{Slider-CZV3HhHY.js → Slider-BIbaMdUE.js} +17 -16
- package/dist/{Text-Dae33gHp.js → Text-CjFEHSfr.js} +3 -2
- package/dist/{VisuallyHidden-eaCBtXhE.js → VisuallyHidden-CqnizvzQ.js} +2 -2
- package/dist/{animation-DY7CNkr6.js → animation-Dfl8uEb3.js} +2 -2
- package/dist/assets/style-admin.css +38 -54
- package/dist/assets/style-editor.css +38 -54
- package/dist/assets/style.css +38 -54
- package/dist/{color-swatch-CZj0jHZd.js → color-swatch-bUFkK7ox.js} +6 -6
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +9 -9
- package/dist/components/checkbox/checkbox.js +10 -10
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +27 -23
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +841 -633
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +1 -1
- package/dist/components/expandable/expandable.js +10 -10
- package/dist/components/index.js +4 -2
- package/dist/components/input-field/input-field.js +10 -10
- package/dist/components/link-input/link-input.js +24 -23
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/modal/modal.js +21 -22
- package/dist/components/number-picker/number-picker.js +11 -11
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-picker-shell.js +49 -44
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/portal-provider/portal-provider.js +1 -1
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/repeater/repeater.js +1 -1
- package/dist/components/responsive/mini-responsive.js +1 -1
- package/dist/components/select/async-multi-select.js +53 -32
- package/dist/components/select/async-select.js +8 -8
- package/dist/components/select/multi-select.js +9 -9
- package/dist/components/select/shared.js +4 -4
- package/dist/components/select/single-select.js +9 -9
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/smart-image/image-analysis-worker-next.js +144 -0
- package/dist/components/smart-image/smart-image-next.js +294 -0
- package/dist/components/smart-image/smart-image.js +2 -2
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/tabs/tabs.js +17 -16
- package/dist/components/toggle/switch.js +7 -7
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +10 -7
- package/dist/components/tooltip/tooltip.js +8 -8
- package/dist/{context-DYYO3Ns3.js → context-iUFQCK8m.js} +1 -1
- package/dist/{general-C8Q0dvEx.js → general-BfKmjm56.js} +3 -4
- package/dist/icons/icons.js +2 -2
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/{index-sSixe2j_.js → index-BL5gdWX4.js} +52 -52
- package/dist/index.js +3 -1
- package/dist/{proxy-B_RaYTfe.js → proxy-DFlYXk07.js} +320 -82
- package/dist/{react-jsx-parser.min-B_hvYYa1.js → react-jsx-parser.min-DAh4myol.js} +35 -35
- package/dist/{shared-Bg9lx3pE.js → shared-CMLCUova.js} +29 -26
- package/dist/{textSelection-Cq_Br7RW.js → textSelection-CeoEP4rL.js} +1 -1
- package/dist/{useButton-CeuyDay5.js → useButton-5YL_nmpZ.js} +3 -3
- package/dist/{useEvent-DoWvho2u.js → useEvent-Zze2g7CX.js} +1 -1
- package/dist/{useFilter-DYtfYPua.js → useFilter-8S94U4xM.js} +1 -1
- package/dist/{useFocusRing-WEswknAY.js → useFocusRing-rUOwLdTK.js} +10 -5
- package/dist/{useFormReset-BDF1K4E4.js → useFormReset-BxtOoO5Q.js} +1 -1
- package/dist/{useFormValidation-Dqzjv4jX.js → useFormValidation-DTmPrTD8.js} +3 -3
- package/dist/{useHover-CG39Ci3A.js → useHover-CmyvqeWX.js} +18 -17
- package/dist/{useLabel--3fT2XKM.js → useLabel-DzXzKZZZ.js} +2 -2
- package/dist/{useLabels-vzdDMGCX.js → useLabels-D8O3gOdV.js} +1 -1
- package/dist/{useListState-Bya9g7W8.js → useListState-B22CApJO.js} +1 -1
- package/dist/{useLocalizedStringFormatter-M3L6Ge2c.js → useLocalizedStringFormatter-CEDs0LsA.js} +1 -1
- package/dist/{useNumberField-D6lsi3Vu.js → useNumberField-CTkI-U9a.js} +50 -40
- package/dist/{useNumberFormatter-BWOyCamK.js → useNumberFormatter-CG_IQXp9.js} +1 -1
- package/dist/{usePress-B9w0X4Ur.js → usePress-CNefMs8d.js} +14 -8
- package/dist/{useSingleSelectListState-D9SqGLJ0.js → useSingleSelectListState-CDZGQDLC.js} +2 -2
- package/dist/{useToggle-Deq2xxQV.js → useToggle-CFFOmZWi.js} +4 -4
- package/dist/{useToggleState-j3o1PvdS.js → useToggleState-BWrKKisg.js} +1 -1
- package/dist/utilities/general.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/{utils-HC9_3Crc.js → utils-Cr3pLd9c.js} +77 -38
- package/dist/workers/image-analysis.worker.js +1 -1
- package/package.json +17 -17
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, createContext, memo,
|
|
2
|
+
import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, useInsertionEffect, createContext, memo, forwardRef, startTransition, useImperativeHandle, useContext } from "react";
|
|
3
3
|
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
4
4
|
import { DraggableContext } from "./draggable-context.js";
|
|
5
|
-
import { r as reactDomExports } from "../../index-
|
|
5
|
+
import { r as reactDomExports } from "../../index-BL5gdWX4.js";
|
|
6
6
|
var i = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
7
7
|
function t() {
|
|
8
8
|
if (!(s > 1)) {
|
|
9
9
|
var i2, t2 = false;
|
|
10
10
|
while (void 0 !== h) {
|
|
11
|
-
var
|
|
11
|
+
var n2 = h;
|
|
12
12
|
h = void 0;
|
|
13
|
-
|
|
14
|
-
while (void 0 !==
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!(8 &
|
|
19
|
-
|
|
20
|
-
} catch (
|
|
13
|
+
v++;
|
|
14
|
+
while (void 0 !== n2) {
|
|
15
|
+
var r2 = n2.o;
|
|
16
|
+
n2.o = void 0;
|
|
17
|
+
n2.f &= -3;
|
|
18
|
+
if (!(8 & n2.f) && a(n2)) try {
|
|
19
|
+
n2.c();
|
|
20
|
+
} catch (n3) {
|
|
21
21
|
if (!t2) {
|
|
22
|
-
i2 =
|
|
22
|
+
i2 = n3;
|
|
23
23
|
t2 = true;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
n2 = r2;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
v = 0;
|
|
30
30
|
s--;
|
|
31
31
|
if (t2) throw i2;
|
|
32
32
|
} else s--;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function n(i2) {
|
|
35
35
|
if (s > 0) return i2();
|
|
36
36
|
s++;
|
|
37
37
|
try {
|
|
@@ -40,42 +40,42 @@ function r(i2) {
|
|
|
40
40
|
t();
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
var t2 =
|
|
46
|
-
|
|
43
|
+
var r = void 0;
|
|
44
|
+
function o(i2) {
|
|
45
|
+
var t2 = r;
|
|
46
|
+
r = void 0;
|
|
47
47
|
try {
|
|
48
48
|
return i2();
|
|
49
49
|
} finally {
|
|
50
|
-
|
|
50
|
+
r = t2;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var h = void 0, s = 0,
|
|
53
|
+
var h = void 0, s = 0, v = 0, u = 0;
|
|
54
54
|
function e(i2) {
|
|
55
|
-
if (void 0 !==
|
|
55
|
+
if (void 0 !== r) {
|
|
56
56
|
var t2 = i2.n;
|
|
57
|
-
if (void 0 === t2 || t2.t !==
|
|
58
|
-
t2 = { i: 0, S: i2, p:
|
|
59
|
-
if (void 0 !==
|
|
60
|
-
|
|
57
|
+
if (void 0 === t2 || t2.t !== r) {
|
|
58
|
+
t2 = { i: 0, S: i2, p: r.s, n: void 0, t: r, e: void 0, x: void 0, r: t2 };
|
|
59
|
+
if (void 0 !== r.s) r.s.n = t2;
|
|
60
|
+
r.s = t2;
|
|
61
61
|
i2.n = t2;
|
|
62
|
-
if (32 &
|
|
62
|
+
if (32 & r.f) i2.S(t2);
|
|
63
63
|
return t2;
|
|
64
64
|
} else if (-1 === t2.i) {
|
|
65
65
|
t2.i = 0;
|
|
66
66
|
if (void 0 !== t2.n) {
|
|
67
67
|
t2.n.p = t2.p;
|
|
68
68
|
if (void 0 !== t2.p) t2.p.n = t2.n;
|
|
69
|
-
t2.p =
|
|
69
|
+
t2.p = r.s;
|
|
70
70
|
t2.n = void 0;
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
r.s.n = t2;
|
|
72
|
+
r.s = t2;
|
|
73
73
|
}
|
|
74
74
|
return t2;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function d(i2, t2) {
|
|
79
79
|
this.v = i2;
|
|
80
80
|
this.i = 0;
|
|
81
81
|
this.n = void 0;
|
|
@@ -84,102 +84,102 @@ function u(i2, t2) {
|
|
|
84
84
|
this.Z = null == t2 ? void 0 : t2.unwatched;
|
|
85
85
|
this.name = null == t2 ? void 0 : t2.name;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
d.prototype.brand = i;
|
|
88
|
+
d.prototype.h = function() {
|
|
89
89
|
return true;
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
var t2 = this,
|
|
93
|
-
if (
|
|
94
|
-
i2.x =
|
|
91
|
+
d.prototype.S = function(i2) {
|
|
92
|
+
var t2 = this, n2 = this.t;
|
|
93
|
+
if (n2 !== i2 && void 0 === i2.e) {
|
|
94
|
+
i2.x = n2;
|
|
95
95
|
this.t = i2;
|
|
96
|
-
if (void 0 !==
|
|
97
|
-
else
|
|
96
|
+
if (void 0 !== n2) n2.e = i2;
|
|
97
|
+
else o(function() {
|
|
98
98
|
var i3;
|
|
99
99
|
null == (i3 = t2.W) || i3.call(t2);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
d.prototype.U = function(i2) {
|
|
104
104
|
var t2 = this;
|
|
105
105
|
if (void 0 !== this.t) {
|
|
106
|
-
var
|
|
107
|
-
if (void 0 !==
|
|
108
|
-
|
|
106
|
+
var n2 = i2.e, r2 = i2.x;
|
|
107
|
+
if (void 0 !== n2) {
|
|
108
|
+
n2.x = r2;
|
|
109
109
|
i2.e = void 0;
|
|
110
110
|
}
|
|
111
|
-
if (void 0 !==
|
|
112
|
-
|
|
111
|
+
if (void 0 !== r2) {
|
|
112
|
+
r2.e = n2;
|
|
113
113
|
i2.x = void 0;
|
|
114
114
|
}
|
|
115
115
|
if (i2 === this.t) {
|
|
116
|
-
this.t =
|
|
117
|
-
if (void 0 ===
|
|
116
|
+
this.t = r2;
|
|
117
|
+
if (void 0 === r2) o(function() {
|
|
118
118
|
var i3;
|
|
119
119
|
null == (i3 = t2.Z) || i3.call(t2);
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
|
|
124
|
+
d.prototype.subscribe = function(i2) {
|
|
125
125
|
var t2 = this;
|
|
126
|
-
return
|
|
127
|
-
var
|
|
128
|
-
|
|
126
|
+
return m(function() {
|
|
127
|
+
var n2 = t2.value, o2 = r;
|
|
128
|
+
r = void 0;
|
|
129
129
|
try {
|
|
130
|
-
i2(
|
|
130
|
+
i2(n2);
|
|
131
131
|
} finally {
|
|
132
|
-
|
|
132
|
+
r = o2;
|
|
133
133
|
}
|
|
134
134
|
}, { name: "sub" });
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
d.prototype.valueOf = function() {
|
|
137
137
|
return this.value;
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
d.prototype.toString = function() {
|
|
140
140
|
return this.value + "";
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
d.prototype.toJSON = function() {
|
|
143
143
|
return this.value;
|
|
144
144
|
};
|
|
145
|
-
|
|
146
|
-
var i2 =
|
|
147
|
-
|
|
145
|
+
d.prototype.peek = function() {
|
|
146
|
+
var i2 = r;
|
|
147
|
+
r = void 0;
|
|
148
148
|
try {
|
|
149
149
|
return this.value;
|
|
150
150
|
} finally {
|
|
151
|
-
|
|
151
|
+
r = i2;
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
Object.defineProperty(
|
|
154
|
+
Object.defineProperty(d.prototype, "value", { get: function() {
|
|
155
155
|
var i2 = e(this);
|
|
156
156
|
if (void 0 !== i2) i2.i = this.i;
|
|
157
157
|
return this.v;
|
|
158
158
|
}, set: function(i2) {
|
|
159
159
|
if (i2 !== this.v) {
|
|
160
|
-
if (
|
|
160
|
+
if (v > 100) throw new Error("Cycle detected");
|
|
161
161
|
this.v = i2;
|
|
162
162
|
this.i++;
|
|
163
|
-
|
|
163
|
+
u++;
|
|
164
164
|
s++;
|
|
165
165
|
try {
|
|
166
|
-
for (var
|
|
166
|
+
for (var n2 = this.t; void 0 !== n2; n2 = n2.x) n2.t.N();
|
|
167
167
|
} finally {
|
|
168
168
|
t();
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
} });
|
|
172
|
-
function
|
|
173
|
-
return new
|
|
172
|
+
function c(i2, t2) {
|
|
173
|
+
return new d(i2, t2);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function a(i2) {
|
|
176
176
|
for (var t2 = i2.s; void 0 !== t2; t2 = t2.n) if (t2.S.i !== t2.i || !t2.S.h() || t2.S.i !== t2.i) return true;
|
|
177
177
|
return false;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function l(i2) {
|
|
180
180
|
for (var t2 = i2.s; void 0 !== t2; t2 = t2.n) {
|
|
181
|
-
var
|
|
182
|
-
if (void 0 !==
|
|
181
|
+
var n2 = t2.S.n;
|
|
182
|
+
if (void 0 !== n2) t2.r = n2;
|
|
183
183
|
t2.S.n = t2;
|
|
184
184
|
t2.i = -1;
|
|
185
185
|
if (void 0 === t2.n) {
|
|
@@ -188,48 +188,48 @@ function a(i2) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
var t2 = i2.s,
|
|
191
|
+
function y(i2) {
|
|
192
|
+
var t2 = i2.s, n2 = void 0;
|
|
193
193
|
while (void 0 !== t2) {
|
|
194
|
-
var
|
|
194
|
+
var r2 = t2.p;
|
|
195
195
|
if (-1 === t2.i) {
|
|
196
196
|
t2.S.U(t2);
|
|
197
|
-
if (void 0 !==
|
|
198
|
-
if (void 0 !== t2.n) t2.n.p =
|
|
199
|
-
} else
|
|
197
|
+
if (void 0 !== r2) r2.n = t2.n;
|
|
198
|
+
if (void 0 !== t2.n) t2.n.p = r2;
|
|
199
|
+
} else n2 = t2;
|
|
200
200
|
t2.S.n = t2.r;
|
|
201
201
|
if (void 0 !== t2.r) t2.r = void 0;
|
|
202
|
-
t2 =
|
|
202
|
+
t2 = r2;
|
|
203
203
|
}
|
|
204
|
-
i2.s =
|
|
204
|
+
i2.s = n2;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
206
|
+
function w(i2, t2) {
|
|
207
|
+
d.call(this, void 0);
|
|
208
208
|
this.x = i2;
|
|
209
209
|
this.s = void 0;
|
|
210
|
-
this.g =
|
|
210
|
+
this.g = u - 1;
|
|
211
211
|
this.f = 4;
|
|
212
212
|
this.W = null == t2 ? void 0 : t2.watched;
|
|
213
213
|
this.Z = null == t2 ? void 0 : t2.unwatched;
|
|
214
214
|
this.name = null == t2 ? void 0 : t2.name;
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
w.prototype = new d();
|
|
217
|
+
w.prototype.h = function() {
|
|
218
218
|
this.f &= -3;
|
|
219
219
|
if (1 & this.f) return false;
|
|
220
220
|
if (32 == (36 & this.f)) return true;
|
|
221
221
|
this.f &= -5;
|
|
222
|
-
if (this.g ===
|
|
223
|
-
this.g =
|
|
222
|
+
if (this.g === u) return true;
|
|
223
|
+
this.g = u;
|
|
224
224
|
this.f |= 1;
|
|
225
|
-
if (this.i > 0 && !
|
|
225
|
+
if (this.i > 0 && !a(this)) {
|
|
226
226
|
this.f &= -2;
|
|
227
227
|
return true;
|
|
228
228
|
}
|
|
229
|
-
var i2 =
|
|
229
|
+
var i2 = r;
|
|
230
230
|
try {
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
l(this);
|
|
232
|
+
r = this;
|
|
233
233
|
var t2 = this.x();
|
|
234
234
|
if (16 & this.f || this.v !== t2 || 0 === this.i) {
|
|
235
235
|
this.v = t2;
|
|
@@ -241,34 +241,34 @@ y.prototype.h = function() {
|
|
|
241
241
|
this.f |= 16;
|
|
242
242
|
this.i++;
|
|
243
243
|
}
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
r = i2;
|
|
245
|
+
y(this);
|
|
246
246
|
this.f &= -2;
|
|
247
247
|
return true;
|
|
248
248
|
};
|
|
249
|
-
|
|
249
|
+
w.prototype.S = function(i2) {
|
|
250
250
|
if (void 0 === this.t) {
|
|
251
251
|
this.f |= 36;
|
|
252
252
|
for (var t2 = this.s; void 0 !== t2; t2 = t2.n) t2.S.S(t2);
|
|
253
253
|
}
|
|
254
|
-
|
|
254
|
+
d.prototype.S.call(this, i2);
|
|
255
255
|
};
|
|
256
|
-
|
|
256
|
+
w.prototype.U = function(i2) {
|
|
257
257
|
if (void 0 !== this.t) {
|
|
258
|
-
|
|
258
|
+
d.prototype.U.call(this, i2);
|
|
259
259
|
if (void 0 === this.t) {
|
|
260
260
|
this.f &= -33;
|
|
261
261
|
for (var t2 = this.s; void 0 !== t2; t2 = t2.n) t2.S.U(t2);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
|
|
265
|
+
w.prototype.N = function() {
|
|
266
266
|
if (!(2 & this.f)) {
|
|
267
267
|
this.f |= 6;
|
|
268
268
|
for (var i2 = this.t; void 0 !== i2; i2 = i2.x) i2.t.N();
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
|
-
Object.defineProperty(
|
|
271
|
+
Object.defineProperty(w.prototype, "value", { get: function() {
|
|
272
272
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
273
273
|
var i2 = e(this);
|
|
274
274
|
this.h();
|
|
@@ -276,44 +276,44 @@ Object.defineProperty(y.prototype, "value", { get: function() {
|
|
|
276
276
|
if (16 & this.f) throw this.v;
|
|
277
277
|
return this.v;
|
|
278
278
|
} });
|
|
279
|
-
function
|
|
280
|
-
return new
|
|
279
|
+
function b(i2, t2) {
|
|
280
|
+
return new w(i2, t2);
|
|
281
281
|
}
|
|
282
282
|
function _(i2) {
|
|
283
|
-
var
|
|
283
|
+
var n2 = i2.u;
|
|
284
284
|
i2.u = void 0;
|
|
285
|
-
if ("function" == typeof
|
|
285
|
+
if ("function" == typeof n2) {
|
|
286
286
|
s++;
|
|
287
|
-
var
|
|
288
|
-
|
|
287
|
+
var o2 = r;
|
|
288
|
+
r = void 0;
|
|
289
289
|
try {
|
|
290
|
-
|
|
290
|
+
n2();
|
|
291
291
|
} catch (t2) {
|
|
292
292
|
i2.f &= -2;
|
|
293
293
|
i2.f |= 8;
|
|
294
|
-
|
|
294
|
+
p(i2);
|
|
295
295
|
throw t2;
|
|
296
296
|
} finally {
|
|
297
|
-
|
|
297
|
+
r = o2;
|
|
298
298
|
t();
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function p(i2) {
|
|
303
303
|
for (var t2 = i2.s; void 0 !== t2; t2 = t2.n) t2.S.U(t2);
|
|
304
304
|
i2.x = void 0;
|
|
305
305
|
i2.s = void 0;
|
|
306
306
|
_(i2);
|
|
307
307
|
}
|
|
308
308
|
function g(i2) {
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
if (r !== this) throw new Error("Out-of-order effect");
|
|
310
|
+
y(this);
|
|
311
|
+
r = i2;
|
|
312
312
|
this.f &= -2;
|
|
313
|
-
if (8 & this.f)
|
|
313
|
+
if (8 & this.f) p(this);
|
|
314
314
|
t();
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function S(i2, t2) {
|
|
317
317
|
this.x = i2;
|
|
318
318
|
this.u = void 0;
|
|
319
319
|
this.s = void 0;
|
|
@@ -321,7 +321,7 @@ function p(i2, t2) {
|
|
|
321
321
|
this.f = 32;
|
|
322
322
|
this.name = null == t2 ? void 0 : t2.name;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
S.prototype.c = function() {
|
|
325
325
|
var i2 = this.S();
|
|
326
326
|
try {
|
|
327
327
|
if (8 & this.f) return;
|
|
@@ -332,42 +332,42 @@ p.prototype.c = function() {
|
|
|
332
332
|
i2();
|
|
333
333
|
}
|
|
334
334
|
};
|
|
335
|
-
|
|
335
|
+
S.prototype.S = function() {
|
|
336
336
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
337
337
|
this.f |= 1;
|
|
338
338
|
this.f &= -9;
|
|
339
339
|
_(this);
|
|
340
|
-
|
|
340
|
+
l(this);
|
|
341
341
|
s++;
|
|
342
|
-
var i2 =
|
|
343
|
-
|
|
342
|
+
var i2 = r;
|
|
343
|
+
r = this;
|
|
344
344
|
return g.bind(this, i2);
|
|
345
345
|
};
|
|
346
|
-
|
|
346
|
+
S.prototype.N = function() {
|
|
347
347
|
if (!(2 & this.f)) {
|
|
348
348
|
this.f |= 2;
|
|
349
349
|
this.o = h;
|
|
350
350
|
h = this;
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
S.prototype.d = function() {
|
|
354
354
|
this.f |= 8;
|
|
355
|
-
if (!(1 & this.f))
|
|
355
|
+
if (!(1 & this.f)) p(this);
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
S.prototype.dispose = function() {
|
|
358
358
|
this.d();
|
|
359
359
|
};
|
|
360
|
-
function
|
|
361
|
-
var
|
|
360
|
+
function m(i2, t2) {
|
|
361
|
+
var n2 = new S(i2, t2);
|
|
362
362
|
try {
|
|
363
|
-
|
|
363
|
+
n2.c();
|
|
364
364
|
} catch (i3) {
|
|
365
|
-
|
|
365
|
+
n2.d();
|
|
366
366
|
throw i3;
|
|
367
367
|
}
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
return
|
|
368
|
+
var r2 = n2.d.bind(n2);
|
|
369
|
+
r2[Symbol.dispose] = r2;
|
|
370
|
+
return r2;
|
|
371
371
|
}
|
|
372
372
|
var __create$5 = Object.create;
|
|
373
373
|
var __defProp$6 = Object.defineProperty;
|
|
@@ -440,7 +440,7 @@ var __privateMethod$3 = (obj, member, method) => (__accessCheck$6(obj, member, "
|
|
|
440
440
|
function computed(compute, comparator) {
|
|
441
441
|
if (comparator) {
|
|
442
442
|
let previousValue;
|
|
443
|
-
return
|
|
443
|
+
return b(() => {
|
|
444
444
|
const value = compute();
|
|
445
445
|
if (value && previousValue && comparator(previousValue, value)) {
|
|
446
446
|
return previousValue;
|
|
@@ -449,7 +449,7 @@ function computed(compute, comparator) {
|
|
|
449
449
|
return value;
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
-
return
|
|
452
|
+
return b(compute);
|
|
453
453
|
}
|
|
454
454
|
function deepEqual(a2, b2) {
|
|
455
455
|
if (Object.is(a2, b2)) {
|
|
@@ -493,7 +493,7 @@ function deepEqual(a2, b2) {
|
|
|
493
493
|
function reactive({ get }, _2) {
|
|
494
494
|
return {
|
|
495
495
|
init(value) {
|
|
496
|
-
return
|
|
496
|
+
return c(value);
|
|
497
497
|
},
|
|
498
498
|
get() {
|
|
499
499
|
const current = get.call(this);
|
|
@@ -531,7 +531,7 @@ function enumerable(enumerable2 = true) {
|
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
function effects(...entries) {
|
|
534
|
-
const effects2 = entries.map((fn) =>
|
|
534
|
+
const effects2 = entries.map((fn) => m(fn));
|
|
535
535
|
return () => effects2.forEach((cleanup) => cleanup());
|
|
536
536
|
}
|
|
537
537
|
var _previous_dec, _initial_dec, _current_dec$1, _current_dec2, _previous_dec2, _initial_dec2, _init$5, _initial, _a$3, initial_get, initial_set, _ValueHistory_instances, _previous, _b$1, previous_get, previous_set, _current, _c$2, current_get, current_set;
|
|
@@ -559,11 +559,11 @@ var ValueHistory = class {
|
|
|
559
559
|
}
|
|
560
560
|
/** Set the current value */
|
|
561
561
|
set current(value) {
|
|
562
|
-
const current =
|
|
562
|
+
const current = o(() => __privateGet$6(this, _ValueHistory_instances, current_get));
|
|
563
563
|
if (value && current && this.equals(current, value)) {
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
|
|
566
|
+
n(() => {
|
|
567
567
|
if (!__privateGet$6(this, _ValueHistory_instances, initial_get)) {
|
|
568
568
|
__privateSet$6(this, _ValueHistory_instances, value, initial_set);
|
|
569
569
|
}
|
|
@@ -573,7 +573,7 @@ var ValueHistory = class {
|
|
|
573
573
|
}
|
|
574
574
|
/** Reset the state to the initial value */
|
|
575
575
|
reset(value = this.defaultValue) {
|
|
576
|
-
|
|
576
|
+
n(() => {
|
|
577
577
|
__privateSet$6(this, _ValueHistory_instances, void 0, previous_set);
|
|
578
578
|
__privateSet$6(this, _ValueHistory_instances, value, initial_set);
|
|
579
579
|
__privateSet$6(this, _ValueHistory_instances, value, current_set);
|
|
@@ -593,7 +593,7 @@ __decorateElement$5(_init$5, 2, "initial", _initial_dec, ValueHistory);
|
|
|
593
593
|
__decorateElement$5(_init$5, 2, "previous", _previous_dec, ValueHistory);
|
|
594
594
|
__decoratorMetadata$5(_init$5, ValueHistory);
|
|
595
595
|
function snapshot(value) {
|
|
596
|
-
return
|
|
596
|
+
return o(() => {
|
|
597
597
|
const output = {};
|
|
598
598
|
for (const key in value) {
|
|
599
599
|
output[key] = value[key];
|
|
@@ -869,7 +869,7 @@ var Position$1 = class Position extends (_a$2 = ValueHistory, _delta_dec$1 = [de
|
|
|
869
869
|
const timestamp = Date.now();
|
|
870
870
|
const timeDelta = timestamp - __privateGet$5(this, _timestamp$1);
|
|
871
871
|
const velocity = (delta2) => Math.round(delta2 / timeDelta * 100);
|
|
872
|
-
|
|
872
|
+
n(() => {
|
|
873
873
|
__privateSet$5(this, _timestamp$1, timestamp);
|
|
874
874
|
this.velocity = {
|
|
875
875
|
x: velocity(delta.x),
|
|
@@ -950,8 +950,8 @@ var __objRest$3 = (source, exclude) => {
|
|
|
950
950
|
return target;
|
|
951
951
|
};
|
|
952
952
|
var __decoratorStart$3 = (base) => {
|
|
953
|
-
var
|
|
954
|
-
return [, , , __create$3((
|
|
953
|
+
var _a5;
|
|
954
|
+
return [, , , __create$3((_a5 = base == null ? void 0 : base[__knownSymbol$3("metadata")]) != null ? _a5 : null)];
|
|
955
955
|
};
|
|
956
956
|
var __decoratorStrings$3 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
957
957
|
var __expectFn$3 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$4("Function expected") : fn;
|
|
@@ -1052,7 +1052,7 @@ var Plugin = class {
|
|
|
1052
1052
|
* This method does not trigger effects when accessed.
|
|
1053
1053
|
*/
|
|
1054
1054
|
isDisabled() {
|
|
1055
|
-
return
|
|
1055
|
+
return o(() => {
|
|
1056
1056
|
return this.disabled;
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
@@ -1071,7 +1071,7 @@ var Plugin = class {
|
|
|
1071
1071
|
* @returns A function to dispose of the effect
|
|
1072
1072
|
*/
|
|
1073
1073
|
registerEffect(callback) {
|
|
1074
|
-
const dispose =
|
|
1074
|
+
const dispose = m(callback.bind(this));
|
|
1075
1075
|
__privateGet$4(this, _cleanupFunctions$1).add(dispose);
|
|
1076
1076
|
return dispose;
|
|
1077
1077
|
}
|
|
@@ -1244,11 +1244,11 @@ var CollisionObserver = class extends Plugin {
|
|
|
1244
1244
|
__privateAdd$4(this, _previousCoordinates);
|
|
1245
1245
|
__privateAdd$4(this, _collisions);
|
|
1246
1246
|
this.computeCollisions = this.computeCollisions.bind(this);
|
|
1247
|
-
__privateSet$4(this, _collisions,
|
|
1247
|
+
__privateSet$4(this, _collisions, c(DEFAULT_VALUE));
|
|
1248
1248
|
this.destroy = effects(
|
|
1249
1249
|
() => {
|
|
1250
1250
|
const collisions = this.computeCollisions();
|
|
1251
|
-
const coordinates =
|
|
1251
|
+
const coordinates = o(
|
|
1252
1252
|
() => this.manager.dragOperation.position.current
|
|
1253
1253
|
);
|
|
1254
1254
|
if (collisions !== DEFAULT_VALUE) {
|
|
@@ -1276,7 +1276,7 @@ var CollisionObserver = class extends Plugin {
|
|
|
1276
1276
|
* @param immediate - If true, updates collisions immediately. If false, resets previous coordinates.
|
|
1277
1277
|
*/
|
|
1278
1278
|
forceUpdate(immediate = true) {
|
|
1279
|
-
|
|
1279
|
+
o(() => {
|
|
1280
1280
|
if (immediate) {
|
|
1281
1281
|
__privateGet$4(this, _collisions).value = this.computeCollisions();
|
|
1282
1282
|
} else {
|
|
@@ -1312,7 +1312,7 @@ var CollisionObserver = class extends Plugin {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
potentialTargets.push(entry);
|
|
1314
1314
|
void entry.shape;
|
|
1315
|
-
const collision =
|
|
1315
|
+
const collision = o(
|
|
1316
1316
|
() => detectCollision({
|
|
1317
1317
|
droppable: entry,
|
|
1318
1318
|
dragOperation
|
|
@@ -1455,9 +1455,9 @@ var CollisionNotifier = class extends CorePlugin {
|
|
|
1455
1455
|
previousCollisions = collisions;
|
|
1456
1456
|
}
|
|
1457
1457
|
const [firstCollision] = collisions;
|
|
1458
|
-
|
|
1459
|
-
var
|
|
1460
|
-
if ((firstCollision == null ? void 0 : firstCollision.id) !== ((
|
|
1458
|
+
o(() => {
|
|
1459
|
+
var _a5;
|
|
1460
|
+
if ((firstCollision == null ? void 0 : firstCollision.id) !== ((_a5 = manager.dragOperation.target) == null ? void 0 : _a5.id)) {
|
|
1461
1461
|
collisionObserver.disable();
|
|
1462
1462
|
manager.actions.setDropTarget(firstCollision == null ? void 0 : firstCollision.id).then(() => {
|
|
1463
1463
|
collisionObserver.enable();
|
|
@@ -1558,7 +1558,7 @@ var DragActions = class {
|
|
|
1558
1558
|
* @returns A promise that resolves to true if the drop was prevented
|
|
1559
1559
|
*/
|
|
1560
1560
|
setDropTarget(identifier) {
|
|
1561
|
-
return
|
|
1561
|
+
return o(() => {
|
|
1562
1562
|
const { dragOperation } = this.manager;
|
|
1563
1563
|
const id = identifier != null ? identifier : null;
|
|
1564
1564
|
if (dragOperation.targetIdentifier === id) {
|
|
@@ -1585,7 +1585,7 @@ var DragActions = class {
|
|
|
1585
1585
|
* @throws {Error} If there is no drag source or another operation is active
|
|
1586
1586
|
*/
|
|
1587
1587
|
start(args) {
|
|
1588
|
-
return
|
|
1588
|
+
return o(() => {
|
|
1589
1589
|
const { dragOperation } = this.manager;
|
|
1590
1590
|
if (args.source != null) {
|
|
1591
1591
|
this.setDragSource(args.source);
|
|
@@ -1601,7 +1601,7 @@ var DragActions = class {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
const controller = new AbortController();
|
|
1603
1603
|
const { event: nativeEvent, coordinates } = args;
|
|
1604
|
-
|
|
1604
|
+
n(() => {
|
|
1605
1605
|
dragOperation.status.set(
|
|
1606
1606
|
"initialization-pending"
|
|
1607
1607
|
/* InitializationPending */
|
|
@@ -1653,8 +1653,8 @@ var DragActions = class {
|
|
|
1653
1653
|
* @param args.propagate - Whether to dispatch dragmove events
|
|
1654
1654
|
*/
|
|
1655
1655
|
move(args) {
|
|
1656
|
-
return
|
|
1657
|
-
var
|
|
1656
|
+
return o(() => {
|
|
1657
|
+
var _a5, _b2;
|
|
1658
1658
|
const { dragOperation } = this.manager;
|
|
1659
1659
|
const { status, controller } = dragOperation;
|
|
1660
1660
|
if (!status.dragging || !controller || controller.signal.aborted) {
|
|
@@ -1667,7 +1667,7 @@ var DragActions = class {
|
|
|
1667
1667
|
by: args.by,
|
|
1668
1668
|
to: args.to
|
|
1669
1669
|
},
|
|
1670
|
-
(
|
|
1670
|
+
(_a5 = args.cancelable) != null ? _a5 : true
|
|
1671
1671
|
);
|
|
1672
1672
|
if ((_b2 = args.propagate) != null ? _b2 : true) {
|
|
1673
1673
|
this.manager.monitor.dispatch("dragmove", event);
|
|
@@ -1698,8 +1698,8 @@ var DragActions = class {
|
|
|
1698
1698
|
* - Handles cleanup of the operation state
|
|
1699
1699
|
*/
|
|
1700
1700
|
stop(args = {}) {
|
|
1701
|
-
return
|
|
1702
|
-
var
|
|
1701
|
+
return o(() => {
|
|
1702
|
+
var _a5, _b2;
|
|
1703
1703
|
const { dragOperation } = this.manager;
|
|
1704
1704
|
const { controller } = dragOperation;
|
|
1705
1705
|
if (!controller || controller.signal.aborted) return;
|
|
@@ -1724,7 +1724,7 @@ var DragActions = class {
|
|
|
1724
1724
|
"dropped"
|
|
1725
1725
|
/* Dropped */
|
|
1726
1726
|
);
|
|
1727
|
-
const dropping =
|
|
1727
|
+
const dropping = o(
|
|
1728
1728
|
() => {
|
|
1729
1729
|
var _a22;
|
|
1730
1730
|
return ((_a22 = dragOperation.source) == null ? void 0 : _a22.status) === "dropping";
|
|
@@ -1738,7 +1738,7 @@ var DragActions = class {
|
|
|
1738
1738
|
};
|
|
1739
1739
|
if (dropping) {
|
|
1740
1740
|
const { source } = dragOperation;
|
|
1741
|
-
const dispose =
|
|
1741
|
+
const dispose = m(() => {
|
|
1742
1742
|
if ((source == null ? void 0 : source.status) === "idle") {
|
|
1743
1743
|
dispose();
|
|
1744
1744
|
cleanup();
|
|
@@ -1749,7 +1749,7 @@ var DragActions = class {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
});
|
|
1751
1751
|
};
|
|
1752
|
-
dragOperation.canceled = (
|
|
1752
|
+
dragOperation.canceled = (_a5 = args.canceled) != null ? _a5 : false;
|
|
1753
1753
|
this.manager.monitor.dispatch("dragend", {
|
|
1754
1754
|
nativeEvent: args.event,
|
|
1755
1755
|
operation: dragOperation.snapshot(),
|
|
@@ -1785,7 +1785,7 @@ var Entity = class {
|
|
|
1785
1785
|
this.data = data;
|
|
1786
1786
|
this.disabled = disabled;
|
|
1787
1787
|
this.effects = () => {
|
|
1788
|
-
var
|
|
1788
|
+
var _a5;
|
|
1789
1789
|
return [
|
|
1790
1790
|
() => {
|
|
1791
1791
|
const { id: id2, manager: manager2 } = this;
|
|
@@ -1795,7 +1795,7 @@ var Entity = class {
|
|
|
1795
1795
|
manager2 == null ? void 0 : manager2.registry.register(this);
|
|
1796
1796
|
return () => manager2 == null ? void 0 : manager2.registry.unregister(this);
|
|
1797
1797
|
},
|
|
1798
|
-
...(
|
|
1798
|
+
...(_a5 = effects6 == null ? void 0 : effects6()) != null ? _a5 : []
|
|
1799
1799
|
];
|
|
1800
1800
|
};
|
|
1801
1801
|
this.register = this.register.bind(this);
|
|
@@ -1810,24 +1810,24 @@ var Entity = class {
|
|
|
1810
1810
|
* @returns CleanupFunction | void
|
|
1811
1811
|
*/
|
|
1812
1812
|
register() {
|
|
1813
|
-
var
|
|
1814
|
-
return (
|
|
1813
|
+
var _a5;
|
|
1814
|
+
return (_a5 = this.manager) == null ? void 0 : _a5.registry.register(this);
|
|
1815
1815
|
}
|
|
1816
1816
|
/**
|
|
1817
1817
|
* A method that unregisters the entity from the manager.
|
|
1818
1818
|
* @returns void
|
|
1819
1819
|
*/
|
|
1820
1820
|
unregister() {
|
|
1821
|
-
var
|
|
1822
|
-
(
|
|
1821
|
+
var _a5;
|
|
1822
|
+
(_a5 = this.manager) == null ? void 0 : _a5.registry.unregister(this);
|
|
1823
1823
|
}
|
|
1824
1824
|
/**
|
|
1825
1825
|
* A method that cleans up the entity when it is no longer needed.
|
|
1826
1826
|
* @returns void
|
|
1827
1827
|
*/
|
|
1828
1828
|
destroy() {
|
|
1829
|
-
var
|
|
1830
|
-
(
|
|
1829
|
+
var _a5;
|
|
1830
|
+
(_a5 = this.manager) == null ? void 0 : _a5.registry.unregister(this);
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
1833
|
_init3$1 = __decoratorStart$3(null);
|
|
@@ -1842,7 +1842,7 @@ __decorateElement$3(_init3$1, 4, "disabled", _disabled_dec2, Entity, _disabled2)
|
|
|
1842
1842
|
__decoratorMetadata$3(_init3$1, Entity);
|
|
1843
1843
|
var EntityRegistry = class {
|
|
1844
1844
|
constructor() {
|
|
1845
|
-
this.map =
|
|
1845
|
+
this.map = c(/* @__PURE__ */ new Map());
|
|
1846
1846
|
this.cleanupFunctions = /* @__PURE__ */ new WeakMap();
|
|
1847
1847
|
this.register = (key, value) => {
|
|
1848
1848
|
const current = this.map.peek();
|
|
@@ -1914,8 +1914,8 @@ var EntityRegistry = class {
|
|
|
1914
1914
|
};
|
|
1915
1915
|
var _isDragSource_dec, _isDragging_dec, _isDropping_dec, _status_dec, _modifiers_dec, _type_dec, _c$1, _init4$1, _type, _modifiers, _status;
|
|
1916
1916
|
var Draggable$2 = class Draggable extends (_c$1 = Entity, _type_dec = [reactive], _modifiers_dec = [reactive], _status_dec = [reactive], _isDropping_dec = [derived], _isDragging_dec = [derived], _isDragSource_dec = [derived], _c$1) {
|
|
1917
|
-
constructor(
|
|
1918
|
-
var _b2 =
|
|
1917
|
+
constructor(_a5, manager) {
|
|
1918
|
+
var _b2 = _a5, { modifiers, type, sensors } = _b2, input = __objRest$3(_b2, ["modifiers", "type", "sensors"]);
|
|
1919
1919
|
super(input, manager);
|
|
1920
1920
|
__runInitializers$3(_init4$1, 5, this);
|
|
1921
1921
|
__privateAdd$4(this, _type, __runInitializers$3(_init4$1, 8, this)), __runInitializers$3(_init4$1, 11, this);
|
|
@@ -1933,8 +1933,8 @@ var Draggable$2 = class Draggable extends (_c$1 = Entity, _type_dec = [reactive]
|
|
|
1933
1933
|
return this.status === "dragging" && this.isDragSource;
|
|
1934
1934
|
}
|
|
1935
1935
|
get isDragSource() {
|
|
1936
|
-
var
|
|
1937
|
-
return ((_b2 = (
|
|
1936
|
+
var _a5, _b2;
|
|
1937
|
+
return ((_b2 = (_a5 = this.manager) == null ? void 0 : _a5.dragOperation.source) == null ? void 0 : _b2.id) === this.id;
|
|
1938
1938
|
}
|
|
1939
1939
|
};
|
|
1940
1940
|
_init4$1 = __decoratorStart$3(_c$1);
|
|
@@ -1950,8 +1950,8 @@ __decorateElement$3(_init4$1, 2, "isDragSource", _isDragSource_dec, Draggable$2)
|
|
|
1950
1950
|
__decoratorMetadata$3(_init4$1, Draggable$2);
|
|
1951
1951
|
var _isDropTarget_dec, _shape_dec, _collisionPriority_dec, _collisionDetector_dec, _type_dec2, _accept_dec, _c2$1, _init5$1, _accept, _type2, _collisionDetector, _collisionPriority, _shape;
|
|
1952
1952
|
var Droppable$1 = class Droppable extends (_c2$1 = Entity, _accept_dec = [reactive], _type_dec2 = [reactive], _collisionDetector_dec = [reactive], _collisionPriority_dec = [reactive], _shape_dec = [reactive], _isDropTarget_dec = [derived], _c2$1) {
|
|
1953
|
-
constructor(
|
|
1954
|
-
var _b2 =
|
|
1953
|
+
constructor(_a5, manager) {
|
|
1954
|
+
var _b2 = _a5, { accept, collisionDetector, collisionPriority, type } = _b2, input = __objRest$3(_b2, ["accept", "collisionDetector", "collisionPriority", "type"]);
|
|
1955
1955
|
super(input, manager);
|
|
1956
1956
|
__runInitializers$3(_init5$1, 5, this);
|
|
1957
1957
|
__privateAdd$4(this, _accept, __runInitializers$3(_init5$1, 8, this)), __runInitializers$3(_init5$1, 11, this);
|
|
@@ -1987,8 +1987,8 @@ var Droppable$1 = class Droppable extends (_c2$1 = Entity, _accept_dec = [reacti
|
|
|
1987
1987
|
return draggable.type === accept;
|
|
1988
1988
|
}
|
|
1989
1989
|
get isDropTarget() {
|
|
1990
|
-
var
|
|
1991
|
-
return ((_b2 = (
|
|
1990
|
+
var _a5, _b2;
|
|
1991
|
+
return ((_b2 = (_a5 = this.manager) == null ? void 0 : _a5.dragOperation.target) == null ? void 0 : _b2.id) === this.id;
|
|
1992
1992
|
}
|
|
1993
1993
|
};
|
|
1994
1994
|
_init5$1 = __decoratorStart$3(_c2$1);
|
|
@@ -2028,9 +2028,9 @@ var ActivationController = class extends AbortController {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
2030
|
onEvent(event) {
|
|
2031
|
-
var
|
|
2031
|
+
var _a5;
|
|
2032
2032
|
if (this.activated) return;
|
|
2033
|
-
if ((
|
|
2033
|
+
if ((_a5 = this.constraints) == null ? void 0 : _a5.length) {
|
|
2034
2034
|
for (const constraint of this.constraints) {
|
|
2035
2035
|
constraint.onEvent(event);
|
|
2036
2036
|
}
|
|
@@ -2062,8 +2062,8 @@ var ActivationConstraint = class {
|
|
|
2062
2062
|
* Called when the activation is triggered.
|
|
2063
2063
|
*/
|
|
2064
2064
|
activate(event) {
|
|
2065
|
-
var
|
|
2066
|
-
(
|
|
2065
|
+
var _a5;
|
|
2066
|
+
(_a5 = __privateGet$4(this, _controller)) == null ? void 0 : _a5.activate(event);
|
|
2067
2067
|
}
|
|
2068
2068
|
};
|
|
2069
2069
|
_controller = /* @__PURE__ */ new WeakMap();
|
|
@@ -2163,7 +2163,7 @@ var DragDropRegistry = class {
|
|
|
2163
2163
|
this.modifiers.destroy();
|
|
2164
2164
|
}
|
|
2165
2165
|
};
|
|
2166
|
-
var _transform_dec, _target_dec, _source_dec, _modifiers_dec2, _targetIdentifier_dec, _sourceIdentifier_dec, _activatorEvent_dec, _canceled_dec, _shape_dec2, _manager2, _previousSource, _shape2, _init6, _canceled, _activatorEvent, _sourceIdentifier, _targetIdentifier, _modifiers2, _transform;
|
|
2166
|
+
var _transform_dec, _target_dec, _source_dec, _modifiers_dec2, _targetIdentifier_dec, _sourceIdentifier_dec, _activatorEvent_dec, _canceled_dec, _shape_dec2, _manager2, _previousSource, _shape2, _init6$1, _canceled, _activatorEvent, _sourceIdentifier, _targetIdentifier, _modifiers2, _transform;
|
|
2167
2167
|
_shape_dec2 = [derived], _canceled_dec = [reactive], _activatorEvent_dec = [reactive], _sourceIdentifier_dec = [reactive], _targetIdentifier_dec = [reactive], _modifiers_dec2 = [reactive], _source_dec = [derived], _target_dec = [derived], _transform_dec = [derived];
|
|
2168
2168
|
var DragOperation = class {
|
|
2169
2169
|
/**
|
|
@@ -2172,7 +2172,7 @@ var DragOperation = class {
|
|
|
2172
2172
|
* @param manager - The drag and drop manager that owns this operation
|
|
2173
2173
|
*/
|
|
2174
2174
|
constructor(manager) {
|
|
2175
|
-
__runInitializers$3(_init6, 5, this);
|
|
2175
|
+
__runInitializers$3(_init6$1, 5, this);
|
|
2176
2176
|
__privateAdd$4(this, _manager2);
|
|
2177
2177
|
__privateAdd$4(this, _previousSource);
|
|
2178
2178
|
__privateAdd$4(this, _shape2, new ValueHistory(
|
|
@@ -2180,11 +2180,11 @@ var DragOperation = class {
|
|
|
2180
2180
|
(a2, b2) => a2 && b2 ? a2.equals(b2) : a2 === b2
|
|
2181
2181
|
));
|
|
2182
2182
|
this.status = new Status();
|
|
2183
|
-
__privateAdd$4(this, _canceled, __runInitializers$3(_init6, 8, this, false)), __runInitializers$3(_init6, 11, this);
|
|
2184
|
-
__privateAdd$4(this, _activatorEvent, __runInitializers$3(_init6, 12, this, null)), __runInitializers$3(_init6, 15, this);
|
|
2185
|
-
__privateAdd$4(this, _sourceIdentifier, __runInitializers$3(_init6, 16, this, null)), __runInitializers$3(_init6, 19, this);
|
|
2186
|
-
__privateAdd$4(this, _targetIdentifier, __runInitializers$3(_init6, 20, this, null)), __runInitializers$3(_init6, 23, this);
|
|
2187
|
-
__privateAdd$4(this, _modifiers2, __runInitializers$3(_init6, 24, this, [])), __runInitializers$3(_init6, 27, this);
|
|
2183
|
+
__privateAdd$4(this, _canceled, __runInitializers$3(_init6$1, 8, this, false)), __runInitializers$3(_init6$1, 11, this);
|
|
2184
|
+
__privateAdd$4(this, _activatorEvent, __runInitializers$3(_init6$1, 12, this, null)), __runInitializers$3(_init6$1, 15, this);
|
|
2185
|
+
__privateAdd$4(this, _sourceIdentifier, __runInitializers$3(_init6$1, 16, this, null)), __runInitializers$3(_init6$1, 19, this);
|
|
2186
|
+
__privateAdd$4(this, _targetIdentifier, __runInitializers$3(_init6$1, 20, this, null)), __runInitializers$3(_init6$1, 23, this);
|
|
2187
|
+
__privateAdd$4(this, _modifiers2, __runInitializers$3(_init6$1, 24, this, [])), __runInitializers$3(_init6$1, 27, this);
|
|
2188
2188
|
this.position = new Position$1({ x: 0, y: 0 });
|
|
2189
2189
|
__privateAdd$4(this, _transform, { x: 0, y: 0 });
|
|
2190
2190
|
__privateSet$4(this, _manager2, manager);
|
|
@@ -2209,19 +2209,19 @@ var DragOperation = class {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
}
|
|
2211
2211
|
get source() {
|
|
2212
|
-
var
|
|
2212
|
+
var _a5;
|
|
2213
2213
|
const identifier = this.sourceIdentifier;
|
|
2214
2214
|
if (identifier == null) return null;
|
|
2215
2215
|
const value = __privateGet$4(this, _manager2).registry.draggables.get(identifier);
|
|
2216
2216
|
if (value) {
|
|
2217
2217
|
__privateSet$4(this, _previousSource, value);
|
|
2218
2218
|
}
|
|
2219
|
-
return (
|
|
2219
|
+
return (_a5 = value != null ? value : __privateGet$4(this, _previousSource)) != null ? _a5 : null;
|
|
2220
2220
|
}
|
|
2221
2221
|
get target() {
|
|
2222
|
-
var
|
|
2222
|
+
var _a5;
|
|
2223
2223
|
const identifier = this.targetIdentifier;
|
|
2224
|
-
return identifier != null ? (
|
|
2224
|
+
return identifier != null ? (_a5 = __privateGet$4(this, _manager2).registry.droppables.get(identifier)) != null ? _a5 : null : null;
|
|
2225
2225
|
}
|
|
2226
2226
|
get transform() {
|
|
2227
2227
|
const { x, y: y2 } = this.position.delta;
|
|
@@ -2240,7 +2240,7 @@ var DragOperation = class {
|
|
|
2240
2240
|
* @returns An immutable snapshot of the current operation state
|
|
2241
2241
|
*/
|
|
2242
2242
|
snapshot() {
|
|
2243
|
-
return
|
|
2243
|
+
return o(() => ({
|
|
2244
2244
|
source: this.source,
|
|
2245
2245
|
target: this.target,
|
|
2246
2246
|
activatorEvent: this.activatorEvent,
|
|
@@ -2263,7 +2263,7 @@ var DragOperation = class {
|
|
|
2263
2263
|
* - Clears modifiers
|
|
2264
2264
|
*/
|
|
2265
2265
|
reset() {
|
|
2266
|
-
|
|
2266
|
+
n(() => {
|
|
2267
2267
|
this.status.set(
|
|
2268
2268
|
"idle"
|
|
2269
2269
|
/* Idle */
|
|
@@ -2277,7 +2277,7 @@ var DragOperation = class {
|
|
|
2277
2277
|
});
|
|
2278
2278
|
}
|
|
2279
2279
|
};
|
|
2280
|
-
_init6 = __decoratorStart$3(null);
|
|
2280
|
+
_init6$1 = __decoratorStart$3(null);
|
|
2281
2281
|
_manager2 = /* @__PURE__ */ new WeakMap();
|
|
2282
2282
|
_previousSource = /* @__PURE__ */ new WeakMap();
|
|
2283
2283
|
_shape2 = /* @__PURE__ */ new WeakMap();
|
|
@@ -2287,16 +2287,16 @@ _sourceIdentifier = /* @__PURE__ */ new WeakMap();
|
|
|
2287
2287
|
_targetIdentifier = /* @__PURE__ */ new WeakMap();
|
|
2288
2288
|
_modifiers2 = /* @__PURE__ */ new WeakMap();
|
|
2289
2289
|
_transform = /* @__PURE__ */ new WeakMap();
|
|
2290
|
-
__decorateElement$3(_init6, 2, "shape", _shape_dec2, DragOperation);
|
|
2291
|
-
__decorateElement$3(_init6, 4, "canceled", _canceled_dec, DragOperation, _canceled);
|
|
2292
|
-
__decorateElement$3(_init6, 4, "activatorEvent", _activatorEvent_dec, DragOperation, _activatorEvent);
|
|
2293
|
-
__decorateElement$3(_init6, 4, "sourceIdentifier", _sourceIdentifier_dec, DragOperation, _sourceIdentifier);
|
|
2294
|
-
__decorateElement$3(_init6, 4, "targetIdentifier", _targetIdentifier_dec, DragOperation, _targetIdentifier);
|
|
2295
|
-
__decorateElement$3(_init6, 4, "modifiers", _modifiers_dec2, DragOperation, _modifiers2);
|
|
2296
|
-
__decorateElement$3(_init6, 2, "source", _source_dec, DragOperation);
|
|
2297
|
-
__decorateElement$3(_init6, 2, "target", _target_dec, DragOperation);
|
|
2298
|
-
__decorateElement$3(_init6, 2, "transform", _transform_dec, DragOperation);
|
|
2299
|
-
__decoratorMetadata$3(_init6, DragOperation);
|
|
2290
|
+
__decorateElement$3(_init6$1, 2, "shape", _shape_dec2, DragOperation);
|
|
2291
|
+
__decorateElement$3(_init6$1, 4, "canceled", _canceled_dec, DragOperation, _canceled);
|
|
2292
|
+
__decorateElement$3(_init6$1, 4, "activatorEvent", _activatorEvent_dec, DragOperation, _activatorEvent);
|
|
2293
|
+
__decorateElement$3(_init6$1, 4, "sourceIdentifier", _sourceIdentifier_dec, DragOperation, _sourceIdentifier);
|
|
2294
|
+
__decorateElement$3(_init6$1, 4, "targetIdentifier", _targetIdentifier_dec, DragOperation, _targetIdentifier);
|
|
2295
|
+
__decorateElement$3(_init6$1, 4, "modifiers", _modifiers_dec2, DragOperation, _modifiers2);
|
|
2296
|
+
__decorateElement$3(_init6$1, 2, "source", _source_dec, DragOperation);
|
|
2297
|
+
__decorateElement$3(_init6$1, 2, "target", _target_dec, DragOperation);
|
|
2298
|
+
__decorateElement$3(_init6$1, 2, "transform", _transform_dec, DragOperation);
|
|
2299
|
+
__decoratorMetadata$3(_init6$1, DragOperation);
|
|
2300
2300
|
var defaultRenderer = {
|
|
2301
2301
|
get rendering() {
|
|
2302
2302
|
return Promise.resolve();
|
|
@@ -2336,13 +2336,13 @@ var DragDropManager$1 = class DragDropManager {
|
|
|
2336
2336
|
this.sensors = sensors;
|
|
2337
2337
|
const { destroy } = this;
|
|
2338
2338
|
const cleanup = effects(() => {
|
|
2339
|
-
var
|
|
2340
|
-
const currentModifiers =
|
|
2339
|
+
var _a5, _b2, _c3;
|
|
2340
|
+
const currentModifiers = o(() => this.dragOperation.modifiers);
|
|
2341
2341
|
const managerModifiers = this.modifiers;
|
|
2342
2342
|
if (currentModifiers !== managerModifiers) {
|
|
2343
2343
|
currentModifiers.forEach((modifier) => modifier.destroy());
|
|
2344
2344
|
}
|
|
2345
|
-
this.dragOperation.modifiers = (_c3 = (_b2 = (
|
|
2345
|
+
this.dragOperation.modifiers = (_c3 = (_b2 = (_a5 = this.dragOperation.source) == null ? void 0 : _a5.modifiers) == null ? void 0 : _b2.map((modifier) => {
|
|
2346
2346
|
const { plugin, options: options2 } = descriptor(modifier);
|
|
2347
2347
|
return new plugin(this, options2);
|
|
2348
2348
|
})) != null ? _c3 : managerModifiers;
|
|
@@ -2448,8 +2448,8 @@ var shapeIntersection = ({
|
|
|
2448
2448
|
return null;
|
|
2449
2449
|
};
|
|
2450
2450
|
var defaultCollisionDetection = (args) => {
|
|
2451
|
-
var
|
|
2452
|
-
return (
|
|
2451
|
+
var _a5;
|
|
2452
|
+
return (_a5 = pointerIntersection(args)) != null ? _a5 : shapeIntersection(args);
|
|
2453
2453
|
};
|
|
2454
2454
|
var closestCorners = (input) => {
|
|
2455
2455
|
const { dragOperation, droppable } = input;
|
|
@@ -2462,10 +2462,10 @@ var closestCorners = (input) => {
|
|
|
2462
2462
|
droppable.shape.boundingRectangle
|
|
2463
2463
|
).corners.reduce(
|
|
2464
2464
|
(acc, corner, index) => {
|
|
2465
|
-
var
|
|
2465
|
+
var _a5;
|
|
2466
2466
|
return acc + Point$1.distance(
|
|
2467
2467
|
Point$1.from(corner),
|
|
2468
|
-
(
|
|
2468
|
+
(_a5 = shapeCorners == null ? void 0 : shapeCorners[index]) != null ? _a5 : position.current
|
|
2469
2469
|
);
|
|
2470
2470
|
},
|
|
2471
2471
|
0
|
|
@@ -2519,7 +2519,7 @@ function isNode(node) {
|
|
|
2519
2519
|
return "nodeType" in node;
|
|
2520
2520
|
}
|
|
2521
2521
|
function getWindow(target) {
|
|
2522
|
-
var
|
|
2522
|
+
var _a5, _b2, _c3;
|
|
2523
2523
|
if (!target) {
|
|
2524
2524
|
return window;
|
|
2525
2525
|
}
|
|
@@ -2530,13 +2530,13 @@ function getWindow(target) {
|
|
|
2530
2530
|
return window;
|
|
2531
2531
|
}
|
|
2532
2532
|
if ("defaultView" in target) {
|
|
2533
|
-
return (
|
|
2533
|
+
return (_a5 = target.defaultView) != null ? _a5 : window;
|
|
2534
2534
|
}
|
|
2535
2535
|
return (_c3 = (_b2 = target.ownerDocument) == null ? void 0 : _b2.defaultView) != null ? _c3 : window;
|
|
2536
2536
|
}
|
|
2537
2537
|
function isDocument(node) {
|
|
2538
|
-
const { Document } = getWindow(node);
|
|
2539
|
-
return node instanceof
|
|
2538
|
+
const { Document: Document2 } = getWindow(node);
|
|
2539
|
+
return node instanceof Document2 || "nodeType" in node && node.nodeType === Node.DOCUMENT_NODE;
|
|
2540
2540
|
}
|
|
2541
2541
|
function isHTMLElement(node) {
|
|
2542
2542
|
if (!node || isWindow(node)) return false;
|
|
@@ -2587,10 +2587,10 @@ function isDetailsElement(element) {
|
|
|
2587
2587
|
return element.tagName === "DETAILS";
|
|
2588
2588
|
}
|
|
2589
2589
|
function getVisibleBoundingRectangle(element, boundingClientRect = element.getBoundingClientRect(), margin = 0) {
|
|
2590
|
-
var
|
|
2590
|
+
var _a5;
|
|
2591
2591
|
let rect = boundingClientRect;
|
|
2592
2592
|
const { ownerDocument } = element;
|
|
2593
|
-
const ownerWindow = (
|
|
2593
|
+
const ownerWindow = (_a5 = ownerDocument.defaultView) != null ? _a5 : window;
|
|
2594
2594
|
let ancestor = element.parentElement;
|
|
2595
2595
|
while (ancestor && ancestor !== ownerDocument.documentElement) {
|
|
2596
2596
|
if (!isOverflowVisible(ancestor)) {
|
|
@@ -2675,6 +2675,24 @@ function getDocuments(rootDoc = document, seen = /* @__PURE__ */ new Set()) {
|
|
|
2675
2675
|
function isSafari() {
|
|
2676
2676
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
2677
2677
|
}
|
|
2678
|
+
function isShadowRoot(target) {
|
|
2679
|
+
if (!target || !isNode(target)) return false;
|
|
2680
|
+
return target instanceof getWindow(target).ShadowRoot;
|
|
2681
|
+
}
|
|
2682
|
+
function getRoot(target) {
|
|
2683
|
+
if (target && isNode(target)) {
|
|
2684
|
+
let root = target.getRootNode();
|
|
2685
|
+
if (isShadowRoot(root)) {
|
|
2686
|
+
return root;
|
|
2687
|
+
} else if (root instanceof Document) {
|
|
2688
|
+
return root;
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
return getDocument(target);
|
|
2692
|
+
}
|
|
2693
|
+
function prefersReducedMotion(window2) {
|
|
2694
|
+
return window2.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2695
|
+
}
|
|
2678
2696
|
function cloneElement(element) {
|
|
2679
2697
|
const selector = "input, textarea, select, canvas, [contenteditable]";
|
|
2680
2698
|
const clonedElement = element.cloneNode(true);
|
|
@@ -2703,8 +2721,8 @@ function isField(element) {
|
|
|
2703
2721
|
function isCanvasElement(element) {
|
|
2704
2722
|
return element.tagName === "CANVAS";
|
|
2705
2723
|
}
|
|
2706
|
-
function getElementFromPoint(
|
|
2707
|
-
const element =
|
|
2724
|
+
function getElementFromPoint(root, { x, y: y2 }) {
|
|
2725
|
+
const element = root.elementFromPoint(x, y2);
|
|
2708
2726
|
if (isIFrameElement(element)) {
|
|
2709
2727
|
const { contentDocument } = element;
|
|
2710
2728
|
if (contentDocument) {
|
|
@@ -2850,9 +2868,9 @@ var PositionObserver = class {
|
|
|
2850
2868
|
this.callback = callback;
|
|
2851
2869
|
__privateAdd$3(this, _PositionObserver_instances);
|
|
2852
2870
|
this.disconnect = () => {
|
|
2853
|
-
var
|
|
2871
|
+
var _a5, _b2, _c3;
|
|
2854
2872
|
__privateSet$3(this, _disconnected, true);
|
|
2855
|
-
(
|
|
2873
|
+
(_a5 = __privateGet$3(this, _resizeObserver)) == null ? void 0 : _a5.disconnect();
|
|
2856
2874
|
(_b2 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _b2.disconnect();
|
|
2857
2875
|
__privateGet$3(this, _visibilityObserver).disconnect();
|
|
2858
2876
|
(_c3 = __privateGet$3(this, _debug)) == null ? void 0 : _c3.remove();
|
|
@@ -2865,9 +2883,9 @@ var PositionObserver = class {
|
|
|
2865
2883
|
__privateAdd$3(this, _debug);
|
|
2866
2884
|
__privateAdd$3(this, _disconnected, false);
|
|
2867
2885
|
__privateAdd$3(this, _observePosition, throttle(() => {
|
|
2868
|
-
var
|
|
2886
|
+
var _a5, _b2, _c3;
|
|
2869
2887
|
const { element: element2 } = this;
|
|
2870
|
-
(
|
|
2888
|
+
(_a5 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _a5.disconnect();
|
|
2871
2889
|
if (__privateGet$3(this, _disconnected) || !__privateGet$3(this, _visible) || !element2.isConnected) {
|
|
2872
2890
|
return;
|
|
2873
2891
|
}
|
|
@@ -2923,7 +2941,7 @@ var PositionObserver = class {
|
|
|
2923
2941
|
}
|
|
2924
2942
|
__privateSet$3(this, _visibilityObserver, new IntersectionObserver(
|
|
2925
2943
|
(entries) => {
|
|
2926
|
-
var
|
|
2944
|
+
var _a5, _b2;
|
|
2927
2945
|
const entry = entries[entries.length - 1];
|
|
2928
2946
|
const { boundingClientRect, isIntersecting: visible } = entry;
|
|
2929
2947
|
const { width, height } = boundingClientRect;
|
|
@@ -2931,7 +2949,7 @@ var PositionObserver = class {
|
|
|
2931
2949
|
__privateSet$3(this, _visible, visible);
|
|
2932
2950
|
if (!width && !height) return;
|
|
2933
2951
|
if (previousVisible && !visible) {
|
|
2934
|
-
(
|
|
2952
|
+
(_a5 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _a5.disconnect();
|
|
2935
2953
|
this.callback(null);
|
|
2936
2954
|
(_b2 = __privateGet$3(this, _resizeObserver)) == null ? void 0 : _b2.disconnect();
|
|
2937
2955
|
__privateSet$3(this, _resizeObserver, void 0);
|
|
@@ -3020,7 +3038,7 @@ function observeParentFrames(frames, callback) {
|
|
|
3020
3038
|
return () => cleanup.forEach((remove) => remove());
|
|
3021
3039
|
}
|
|
3022
3040
|
function addScrollListener(element, callback) {
|
|
3023
|
-
var
|
|
3041
|
+
var _a5;
|
|
3024
3042
|
const doc = element.ownerDocument;
|
|
3025
3043
|
if (!scrollListeners.has(doc)) {
|
|
3026
3044
|
const controller = new AbortController();
|
|
@@ -3036,7 +3054,7 @@ function addScrollListener(element, callback) {
|
|
|
3036
3054
|
);
|
|
3037
3055
|
scrollListeners.set(doc, { disconnect: () => controller.abort(), listeners: listeners2 });
|
|
3038
3056
|
}
|
|
3039
|
-
const { listeners, disconnect } = (
|
|
3057
|
+
const { listeners, disconnect } = (_a5 = scrollListeners.get(doc)) != null ? _a5 : {};
|
|
3040
3058
|
if (!listeners || !disconnect) return () => {
|
|
3041
3059
|
};
|
|
3042
3060
|
listeners.add(callback);
|
|
@@ -3214,10 +3232,11 @@ function isScrollable(element, computedStyle = getComputedStyles(element, true))
|
|
|
3214
3232
|
});
|
|
3215
3233
|
}
|
|
3216
3234
|
var defaultOptions = {
|
|
3217
|
-
excludeElement: true
|
|
3235
|
+
excludeElement: true,
|
|
3236
|
+
escapeShadowDOM: true
|
|
3218
3237
|
};
|
|
3219
3238
|
function getScrollableAncestors(element, options2 = defaultOptions) {
|
|
3220
|
-
const { limit, excludeElement } = options2;
|
|
3239
|
+
const { limit, excludeElement, escapeShadowDOM } = options2;
|
|
3221
3240
|
const scrollParents = /* @__PURE__ */ new Set();
|
|
3222
3241
|
function findScrollableAncestors(node) {
|
|
3223
3242
|
if (limit != null && scrollParents.size >= limit) {
|
|
@@ -3230,6 +3249,9 @@ function getScrollableAncestors(element, options2 = defaultOptions) {
|
|
|
3230
3249
|
scrollParents.add(node.scrollingElement);
|
|
3231
3250
|
return scrollParents;
|
|
3232
3251
|
}
|
|
3252
|
+
if (escapeShadowDOM && isShadowRoot(node)) {
|
|
3253
|
+
return findScrollableAncestors(node.host);
|
|
3254
|
+
}
|
|
3233
3255
|
if (!isHTMLElement(node)) {
|
|
3234
3256
|
if (isSVGElement(node)) {
|
|
3235
3257
|
return findScrollableAncestors(node.parentElement);
|
|
@@ -3329,7 +3351,7 @@ function parseTranslate(translate) {
|
|
|
3329
3351
|
};
|
|
3330
3352
|
}
|
|
3331
3353
|
function parseTransform(computedStyles) {
|
|
3332
|
-
var
|
|
3354
|
+
var _a5, _b2, _c3, _d2, _e, _f, _g, _h, _i;
|
|
3333
3355
|
const { scale, transform, translate } = computedStyles;
|
|
3334
3356
|
const parsedScale = parseScale(scale);
|
|
3335
3357
|
const parsedTranslate = parseTranslate(translate);
|
|
@@ -3338,7 +3360,7 @@ function parseTransform(computedStyles) {
|
|
|
3338
3360
|
return null;
|
|
3339
3361
|
}
|
|
3340
3362
|
const normalizedScale = {
|
|
3341
|
-
x: (
|
|
3363
|
+
x: (_a5 = parsedScale == null ? void 0 : parsedScale.x) != null ? _a5 : 1,
|
|
3342
3364
|
y: (_b2 = parsedScale == null ? void 0 : parsedScale.y) != null ? _b2 : 1
|
|
3343
3365
|
};
|
|
3344
3366
|
const normalizedTranslate = {
|
|
@@ -3552,10 +3574,10 @@ function getDocumentAnimations(element) {
|
|
|
3552
3574
|
}
|
|
3553
3575
|
function forceFinishAnimations(element, options2) {
|
|
3554
3576
|
const animations2 = getDocumentAnimations(element).filter((animation) => {
|
|
3555
|
-
var
|
|
3577
|
+
var _a5, _b2;
|
|
3556
3578
|
if (isKeyframeEffect(animation.effect)) {
|
|
3557
3579
|
const { target } = animation.effect;
|
|
3558
|
-
const isValidTarget = (_b2 = target && ((
|
|
3580
|
+
const isValidTarget = (_b2 = target && ((_a5 = options2.isValidTarget) == null ? void 0 : _a5.call(options2, target))) != null ? _b2 : true;
|
|
3559
3581
|
if (isValidTarget) {
|
|
3560
3582
|
return animation.effect.getKeyframes().some((keyframe) => {
|
|
3561
3583
|
for (const property of options2.properties) {
|
|
@@ -3581,7 +3603,7 @@ function forceFinishAnimations(element, options2) {
|
|
|
3581
3603
|
}
|
|
3582
3604
|
var DOMRectangle = class extends Rectangle {
|
|
3583
3605
|
constructor(element, options2 = {}) {
|
|
3584
|
-
var
|
|
3606
|
+
var _a5, _b2, _c3, _d2;
|
|
3585
3607
|
const {
|
|
3586
3608
|
frameTransform = getFrameTransform(element),
|
|
3587
3609
|
ignoreTransforms,
|
|
@@ -3597,7 +3619,7 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3597
3619
|
const computedStyles = getComputedStyles(element);
|
|
3598
3620
|
const parsedTransform = parseTransform(computedStyles);
|
|
3599
3621
|
const scale = {
|
|
3600
|
-
x: (
|
|
3622
|
+
x: (_a5 = parsedTransform == null ? void 0 : parsedTransform.scaleX) != null ? _a5 : 1,
|
|
3601
3623
|
y: (_b2 = parsedTransform == null ? void 0 : parsedTransform.scaleY) != null ? _b2 : 1
|
|
3602
3624
|
};
|
|
3603
3625
|
const projectedTransform = getProjectedTransform(element, computedStyles);
|
|
@@ -3649,7 +3671,7 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3649
3671
|
}
|
|
3650
3672
|
};
|
|
3651
3673
|
function getProjectedTransform(element, computedStyles) {
|
|
3652
|
-
var
|
|
3674
|
+
var _a5;
|
|
3653
3675
|
const animations2 = element.getAnimations();
|
|
3654
3676
|
let projectedTransform = null;
|
|
3655
3677
|
if (!animations2.length) return null;
|
|
@@ -3669,7 +3691,7 @@ function getProjectedTransform(element, computedStyles) {
|
|
|
3669
3691
|
projectedTransform = projectedTransform ? {
|
|
3670
3692
|
x: projectedTransform.x + parsedTransform.x,
|
|
3671
3693
|
y: projectedTransform.y + parsedTransform.y,
|
|
3672
|
-
z: (
|
|
3694
|
+
z: (_a5 = projectedTransform.z) != null ? _a5 : parsedTransform.z,
|
|
3673
3695
|
scaleX: projectedTransform.scaleX * parsedTransform.scaleX,
|
|
3674
3696
|
scaleY: projectedTransform.scaleY * parsedTransform.scaleY
|
|
3675
3697
|
} : parsedTransform;
|
|
@@ -3792,8 +3814,8 @@ var __objRest$2 = (source, exclude) => {
|
|
|
3792
3814
|
return target;
|
|
3793
3815
|
};
|
|
3794
3816
|
var __decoratorStart$2 = (base) => {
|
|
3795
|
-
var
|
|
3796
|
-
return [, , , __create$2((
|
|
3817
|
+
var _a5;
|
|
3818
|
+
return [, , , __create$2((_a5 = base == null ? void 0 : base[__knownSymbol$2("metadata")]) != null ? _a5 : null)];
|
|
3797
3819
|
};
|
|
3798
3820
|
var __decoratorStrings$2 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3799
3821
|
var __expectFn$2 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$2("Function expected") : fn;
|
|
@@ -3972,10 +3994,10 @@ var Accessibility = class extends Plugin {
|
|
|
3972
3994
|
}
|
|
3973
3995
|
}
|
|
3974
3996
|
this.registerEffect(() => {
|
|
3975
|
-
var
|
|
3997
|
+
var _a5;
|
|
3976
3998
|
mutations.clear();
|
|
3977
3999
|
for (const draggable of this.manager.registry.draggables.value) {
|
|
3978
|
-
const activator = (
|
|
4000
|
+
const activator = (_a5 = draggable.handle) != null ? _a5 : draggable.element;
|
|
3979
4001
|
if (activator) {
|
|
3980
4002
|
if (!hiddenTextElement || !liveRegionElement) {
|
|
3981
4003
|
mutations.add(initialize);
|
|
@@ -4042,14 +4064,14 @@ var Cursor = class extends Plugin {
|
|
|
4042
4064
|
this.manager = manager;
|
|
4043
4065
|
const doc = computed(
|
|
4044
4066
|
() => {
|
|
4045
|
-
var
|
|
4046
|
-
return getDocument((
|
|
4067
|
+
var _a5;
|
|
4068
|
+
return getDocument((_a5 = this.manager.dragOperation.source) == null ? void 0 : _a5.element);
|
|
4047
4069
|
}
|
|
4048
4070
|
);
|
|
4049
|
-
this.destroy =
|
|
4050
|
-
var
|
|
4071
|
+
this.destroy = m(() => {
|
|
4072
|
+
var _a5;
|
|
4051
4073
|
const { dragOperation } = this.manager;
|
|
4052
|
-
const { cursor = "grabbing", nonce } = (
|
|
4074
|
+
const { cursor = "grabbing", nonce } = (_a5 = this.options) != null ? _a5 : {};
|
|
4053
4075
|
if (dragOperation.status.initialized) {
|
|
4054
4076
|
const document2 = doc.value;
|
|
4055
4077
|
const style = document2.createElement("style");
|
|
@@ -4063,6 +4085,149 @@ var Cursor = class extends Plugin {
|
|
|
4063
4085
|
});
|
|
4064
4086
|
}
|
|
4065
4087
|
};
|
|
4088
|
+
var sheetRegistry = /* @__PURE__ */ new Map();
|
|
4089
|
+
var _roots_dec, _targetRoot_dec, _sourceRoot_dec, _additionalRoots_dec, _a$1, _registeredRules, _init$2, _additionalRoots, _StyleSheetManager_instances, syncStyles_fn, inject_fn;
|
|
4090
|
+
var StyleSheetManager = class extends (_a$1 = CorePlugin, _additionalRoots_dec = [reactive], _sourceRoot_dec = [derived], _targetRoot_dec = [derived], _roots_dec = [derived], _a$1) {
|
|
4091
|
+
constructor(manager) {
|
|
4092
|
+
super(manager);
|
|
4093
|
+
__runInitializers$2(_init$2, 5, this);
|
|
4094
|
+
__privateAdd$2(this, _StyleSheetManager_instances);
|
|
4095
|
+
__privateAdd$2(this, _registeredRules, /* @__PURE__ */ new Set());
|
|
4096
|
+
__privateAdd$2(this, _additionalRoots, __runInitializers$2(_init$2, 8, this, /* @__PURE__ */ new Set())), __runInitializers$2(_init$2, 11, this);
|
|
4097
|
+
this.registerEffect(__privateMethod(this, _StyleSheetManager_instances, syncStyles_fn));
|
|
4098
|
+
}
|
|
4099
|
+
/**
|
|
4100
|
+
* Registers CSS rules to be injected into the active drag operation's
|
|
4101
|
+
* document and shadow roots. The StyleSheetManager handles tracking
|
|
4102
|
+
* which roots need the styles and cleaning up when they're no longer needed.
|
|
4103
|
+
*
|
|
4104
|
+
* Returns a cleanup function that unregisters the rules.
|
|
4105
|
+
*/
|
|
4106
|
+
register(cssRules) {
|
|
4107
|
+
__privateGet$2(this, _registeredRules).add(cssRules);
|
|
4108
|
+
return () => {
|
|
4109
|
+
__privateGet$2(this, _registeredRules).delete(cssRules);
|
|
4110
|
+
};
|
|
4111
|
+
}
|
|
4112
|
+
/**
|
|
4113
|
+
* Adds an additional root to track for style injection.
|
|
4114
|
+
* Returns a cleanup function that removes the root.
|
|
4115
|
+
*/
|
|
4116
|
+
addRoot(root) {
|
|
4117
|
+
o(() => {
|
|
4118
|
+
const roots = new Set(this.additionalRoots);
|
|
4119
|
+
roots.add(root);
|
|
4120
|
+
this.additionalRoots = roots;
|
|
4121
|
+
});
|
|
4122
|
+
return () => {
|
|
4123
|
+
o(() => {
|
|
4124
|
+
const roots = new Set(this.additionalRoots);
|
|
4125
|
+
roots.delete(root);
|
|
4126
|
+
this.additionalRoots = roots;
|
|
4127
|
+
});
|
|
4128
|
+
};
|
|
4129
|
+
}
|
|
4130
|
+
get sourceRoot() {
|
|
4131
|
+
var _a5;
|
|
4132
|
+
const { source } = this.manager.dragOperation;
|
|
4133
|
+
return getRoot((_a5 = source == null ? void 0 : source.element) != null ? _a5 : null);
|
|
4134
|
+
}
|
|
4135
|
+
get targetRoot() {
|
|
4136
|
+
var _a5;
|
|
4137
|
+
const { target } = this.manager.dragOperation;
|
|
4138
|
+
return getRoot((_a5 = target == null ? void 0 : target.element) != null ? _a5 : null);
|
|
4139
|
+
}
|
|
4140
|
+
get roots() {
|
|
4141
|
+
const { status } = this.manager.dragOperation;
|
|
4142
|
+
if (status.initializing || status.initialized) {
|
|
4143
|
+
const roots = [this.sourceRoot, this.targetRoot].filter(
|
|
4144
|
+
(root) => root != null
|
|
4145
|
+
);
|
|
4146
|
+
return /* @__PURE__ */ new Set([...roots, ...this.additionalRoots]);
|
|
4147
|
+
}
|
|
4148
|
+
return /* @__PURE__ */ new Set();
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
4151
|
+
_init$2 = __decoratorStart$2(_a$1);
|
|
4152
|
+
_registeredRules = /* @__PURE__ */ new WeakMap();
|
|
4153
|
+
_additionalRoots = /* @__PURE__ */ new WeakMap();
|
|
4154
|
+
_StyleSheetManager_instances = /* @__PURE__ */ new WeakSet();
|
|
4155
|
+
syncStyles_fn = function() {
|
|
4156
|
+
const { roots } = this;
|
|
4157
|
+
const cleanups = [];
|
|
4158
|
+
for (const root of roots) {
|
|
4159
|
+
for (const cssRules of __privateGet$2(this, _registeredRules)) {
|
|
4160
|
+
cleanups.push(__privateMethod(this, _StyleSheetManager_instances, inject_fn).call(this, root, cssRules));
|
|
4161
|
+
}
|
|
4162
|
+
}
|
|
4163
|
+
return () => {
|
|
4164
|
+
for (const cleanup of cleanups) {
|
|
4165
|
+
cleanup();
|
|
4166
|
+
}
|
|
4167
|
+
};
|
|
4168
|
+
};
|
|
4169
|
+
inject_fn = function(root, cssRules) {
|
|
4170
|
+
let rootSheets = sheetRegistry.get(root);
|
|
4171
|
+
if (!rootSheets) {
|
|
4172
|
+
rootSheets = /* @__PURE__ */ new Map();
|
|
4173
|
+
sheetRegistry.set(root, rootSheets);
|
|
4174
|
+
}
|
|
4175
|
+
let registration = rootSheets.get(cssRules);
|
|
4176
|
+
if (!registration) {
|
|
4177
|
+
if (!("adoptedStyleSheets" in root && Array.isArray(root.adoptedStyleSheets)) && process.env.NODE_ENV !== "production") {
|
|
4178
|
+
console.error(
|
|
4179
|
+
"Cannot inject styles: This browser doesn't support adoptedStyleSheets"
|
|
4180
|
+
);
|
|
4181
|
+
}
|
|
4182
|
+
const targetWindow = isDocument(root) ? root.defaultView : root.ownerDocument.defaultView;
|
|
4183
|
+
const { CSSStyleSheet } = targetWindow != null ? targetWindow : {};
|
|
4184
|
+
if (!CSSStyleSheet) {
|
|
4185
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4186
|
+
console.error(
|
|
4187
|
+
"Cannot inject styles: CSSStyleSheet constructor not available"
|
|
4188
|
+
);
|
|
4189
|
+
}
|
|
4190
|
+
return () => {
|
|
4191
|
+
};
|
|
4192
|
+
}
|
|
4193
|
+
const sheet = new CSSStyleSheet();
|
|
4194
|
+
sheet.replaceSync(cssRules);
|
|
4195
|
+
root.adoptedStyleSheets.push(sheet);
|
|
4196
|
+
registration = {
|
|
4197
|
+
sheet,
|
|
4198
|
+
refCount: 0,
|
|
4199
|
+
cleanup: () => {
|
|
4200
|
+
var _a5;
|
|
4201
|
+
if (isDocument(root) || isShadowRoot(root) && ((_a5 = root.host) == null ? void 0 : _a5.isConnected)) {
|
|
4202
|
+
const index = root.adoptedStyleSheets.indexOf(sheet);
|
|
4203
|
+
if (index !== -1) {
|
|
4204
|
+
root.adoptedStyleSheets.splice(index, 1);
|
|
4205
|
+
}
|
|
4206
|
+
}
|
|
4207
|
+
rootSheets.delete(cssRules);
|
|
4208
|
+
if (rootSheets.size === 0) {
|
|
4209
|
+
sheetRegistry.delete(root);
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
};
|
|
4213
|
+
rootSheets.set(cssRules, registration);
|
|
4214
|
+
}
|
|
4215
|
+
registration.refCount++;
|
|
4216
|
+
let disposed = false;
|
|
4217
|
+
return () => {
|
|
4218
|
+
if (disposed) return;
|
|
4219
|
+
disposed = true;
|
|
4220
|
+
registration.refCount--;
|
|
4221
|
+
if (registration.refCount === 0) {
|
|
4222
|
+
registration.cleanup();
|
|
4223
|
+
}
|
|
4224
|
+
};
|
|
4225
|
+
};
|
|
4226
|
+
__decorateElement$2(_init$2, 4, "additionalRoots", _additionalRoots_dec, StyleSheetManager, _additionalRoots);
|
|
4227
|
+
__decorateElement$2(_init$2, 2, "sourceRoot", _sourceRoot_dec, StyleSheetManager);
|
|
4228
|
+
__decorateElement$2(_init$2, 2, "targetRoot", _targetRoot_dec, StyleSheetManager);
|
|
4229
|
+
__decorateElement$2(_init$2, 2, "roots", _roots_dec, StyleSheetManager);
|
|
4230
|
+
__decoratorMetadata$2(_init$2, StyleSheetManager);
|
|
4066
4231
|
var ATTR_PREFIX = "data-dnd-";
|
|
4067
4232
|
var DROPPING_ATTRIBUTE = `${ATTR_PREFIX}dropping`;
|
|
4068
4233
|
var CSS_PREFIX = "--dnd-";
|
|
@@ -4077,7 +4242,7 @@ var IGNORED_ATTRIBUTES = [
|
|
|
4077
4242
|
];
|
|
4078
4243
|
var IGNORED_STYLES = ["view-transition-name"];
|
|
4079
4244
|
var CSS_RULES = `
|
|
4080
|
-
:root [${ATTRIBUTE}] {
|
|
4245
|
+
:is(:root,:host) [${ATTRIBUTE}] {
|
|
4081
4246
|
position: fixed !important;
|
|
4082
4247
|
pointer-events: none !important;
|
|
4083
4248
|
touch-action: none;
|
|
@@ -4094,11 +4259,11 @@ var CSS_RULES = `
|
|
|
4094
4259
|
transition: var(${CSS_PREFIX}transition) !important;
|
|
4095
4260
|
}
|
|
4096
4261
|
|
|
4097
|
-
:root [${PLACEHOLDER_ATTRIBUTE}] {
|
|
4262
|
+
:is(:root,:host) [${PLACEHOLDER_ATTRIBUTE}] {
|
|
4098
4263
|
transition: none;
|
|
4099
4264
|
}
|
|
4100
4265
|
|
|
4101
|
-
:root [${PLACEHOLDER_ATTRIBUTE}='hidden'] {
|
|
4266
|
+
:is(:root,:host) [${PLACEHOLDER_ATTRIBUTE}='hidden'] {
|
|
4102
4267
|
visibility: hidden;
|
|
4103
4268
|
}
|
|
4104
4269
|
|
|
@@ -4136,7 +4301,7 @@ var CSS_RULES = `
|
|
|
4136
4301
|
}
|
|
4137
4302
|
`.replace(/\n+/g, " ").replace(/\s+/g, " ").trim();
|
|
4138
4303
|
function createPlaceholder(source, type = "hidden") {
|
|
4139
|
-
return
|
|
4304
|
+
return o(() => {
|
|
4140
4305
|
const { element, manager } = source;
|
|
4141
4306
|
if (!element || !manager) return;
|
|
4142
4307
|
const containedDroppables = findContainedDroppables(
|
|
@@ -4203,38 +4368,233 @@ function preventPopoverClose(event) {
|
|
|
4203
4368
|
function isTableRow(element) {
|
|
4204
4369
|
return element.tagName === "TR";
|
|
4205
4370
|
}
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4371
|
+
function createElementMutationObserver(element, placeholder, clone) {
|
|
4372
|
+
const observer = new MutationObserver((mutations) => {
|
|
4373
|
+
let hasChildrenMutations = false;
|
|
4374
|
+
for (const mutation of mutations) {
|
|
4375
|
+
if (mutation.target !== element) {
|
|
4376
|
+
hasChildrenMutations = true;
|
|
4377
|
+
continue;
|
|
4378
|
+
}
|
|
4379
|
+
if (mutation.type !== "attributes") {
|
|
4380
|
+
continue;
|
|
4381
|
+
}
|
|
4382
|
+
const attributeName = mutation.attributeName;
|
|
4383
|
+
if (attributeName.startsWith("aria-") || IGNORED_ATTRIBUTES.includes(attributeName)) {
|
|
4384
|
+
continue;
|
|
4385
|
+
}
|
|
4386
|
+
const attributeValue = element.getAttribute(attributeName);
|
|
4387
|
+
if (attributeName === "style") {
|
|
4388
|
+
if (supportsStyle(element) && supportsStyle(placeholder)) {
|
|
4389
|
+
const styles = element.style;
|
|
4390
|
+
for (const key of Array.from(placeholder.style)) {
|
|
4391
|
+
if (styles.getPropertyValue(key) === "") {
|
|
4392
|
+
placeholder.style.removeProperty(key);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
for (const key of Array.from(styles)) {
|
|
4396
|
+
if (IGNORED_STYLES.includes(key) || key.startsWith(CSS_PREFIX)) {
|
|
4397
|
+
continue;
|
|
4398
|
+
}
|
|
4399
|
+
const value = styles.getPropertyValue(key);
|
|
4400
|
+
placeholder.style.setProperty(key, value);
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
} else if (attributeValue !== null) {
|
|
4404
|
+
placeholder.setAttribute(attributeName, attributeValue);
|
|
4405
|
+
} else {
|
|
4406
|
+
placeholder.removeAttribute(attributeName);
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
if (hasChildrenMutations && clone) {
|
|
4410
|
+
placeholder.innerHTML = element.innerHTML;
|
|
4411
|
+
}
|
|
4412
|
+
});
|
|
4413
|
+
observer.observe(element, {
|
|
4414
|
+
attributes: true,
|
|
4415
|
+
subtree: true,
|
|
4416
|
+
childList: true
|
|
4417
|
+
});
|
|
4418
|
+
return observer;
|
|
4419
|
+
}
|
|
4420
|
+
function createDocumentMutationObserver(element, placeholder, feedbackElement) {
|
|
4421
|
+
const observer = new MutationObserver((entries) => {
|
|
4422
|
+
for (const entry of entries) {
|
|
4423
|
+
if (entry.addedNodes.length === 0) continue;
|
|
4424
|
+
for (const node of Array.from(entry.addedNodes)) {
|
|
4425
|
+
if (node.contains(element) && element.nextElementSibling !== placeholder) {
|
|
4426
|
+
element.insertAdjacentElement("afterend", placeholder);
|
|
4427
|
+
showPopover(feedbackElement);
|
|
4428
|
+
return;
|
|
4429
|
+
}
|
|
4430
|
+
if (node.contains(placeholder) && placeholder.previousElementSibling !== element) {
|
|
4431
|
+
placeholder.insertAdjacentElement("beforebegin", element);
|
|
4432
|
+
showPopover(feedbackElement);
|
|
4433
|
+
return;
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
});
|
|
4438
|
+
observer.observe(element.ownerDocument.body, {
|
|
4439
|
+
childList: true,
|
|
4440
|
+
subtree: true
|
|
4441
|
+
});
|
|
4442
|
+
return observer;
|
|
4443
|
+
}
|
|
4444
|
+
function createResizeObserver(ctx) {
|
|
4445
|
+
return new ResizeObserver(() => {
|
|
4446
|
+
var _a5, _b2;
|
|
4447
|
+
const placeholderShape = new DOMRectangle(ctx.placeholder, {
|
|
4448
|
+
frameTransform: ctx.frameTransform,
|
|
4449
|
+
ignoreTransforms: true
|
|
4450
|
+
});
|
|
4451
|
+
const origin = (_a5 = ctx.transformOrigin) != null ? _a5 : { x: 1, y: 1 };
|
|
4452
|
+
const dX = (ctx.width - placeholderShape.width) * origin.x + ctx.delta.x;
|
|
4453
|
+
const dY = (ctx.height - placeholderShape.height) * origin.y + ctx.delta.y;
|
|
4454
|
+
ctx.styles.set(
|
|
4455
|
+
{
|
|
4456
|
+
width: placeholderShape.width - ctx.widthOffset,
|
|
4457
|
+
height: placeholderShape.height - ctx.heightOffset,
|
|
4458
|
+
top: ctx.top + dY,
|
|
4459
|
+
left: ctx.left + dX
|
|
4460
|
+
},
|
|
4461
|
+
CSS_PREFIX
|
|
4462
|
+
);
|
|
4463
|
+
(_b2 = ctx.getElementMutationObserver()) == null ? void 0 : _b2.takeRecords();
|
|
4464
|
+
if (isTableRow(ctx.element) && isTableRow(ctx.placeholder)) {
|
|
4465
|
+
const cells = Array.from(ctx.element.cells);
|
|
4466
|
+
const placeholderCells = Array.from(ctx.placeholder.cells);
|
|
4467
|
+
if (!ctx.getSavedCellWidths()) {
|
|
4468
|
+
ctx.setSavedCellWidths(cells.map((cell) => cell.style.width));
|
|
4469
|
+
}
|
|
4470
|
+
for (const [index, cell] of cells.entries()) {
|
|
4471
|
+
const placeholderCell = placeholderCells[index];
|
|
4472
|
+
cell.style.width = `${placeholderCell.getBoundingClientRect().width}px`;
|
|
4473
|
+
}
|
|
4474
|
+
}
|
|
4475
|
+
ctx.dragOperation.shape = new DOMRectangle(ctx.feedbackElement);
|
|
4476
|
+
});
|
|
4477
|
+
}
|
|
4478
|
+
var DEFAULT_DURATION = 250;
|
|
4479
|
+
var DEFAULT_EASING = "ease";
|
|
4480
|
+
function runDropAnimation(ctx) {
|
|
4481
|
+
var _a5, _b2, _c3, _d2;
|
|
4482
|
+
const { animation } = ctx;
|
|
4483
|
+
if (typeof animation === "function") {
|
|
4484
|
+
const result = animation({
|
|
4485
|
+
element: ctx.element,
|
|
4486
|
+
feedbackElement: ctx.feedbackElement,
|
|
4487
|
+
placeholder: ctx.placeholder,
|
|
4488
|
+
translate: ctx.translate,
|
|
4489
|
+
moved: ctx.moved
|
|
4490
|
+
});
|
|
4491
|
+
Promise.resolve(result).then(() => {
|
|
4492
|
+
ctx.cleanup();
|
|
4493
|
+
requestAnimationFrame(ctx.restoreFocus);
|
|
4494
|
+
});
|
|
4495
|
+
return;
|
|
4496
|
+
}
|
|
4497
|
+
const {
|
|
4498
|
+
duration = DEFAULT_DURATION,
|
|
4499
|
+
easing = DEFAULT_EASING
|
|
4500
|
+
} = animation != null ? animation : {};
|
|
4501
|
+
showPopover(ctx.feedbackElement);
|
|
4502
|
+
const [, runningAnimation] = (_a5 = getFinalKeyframe(
|
|
4503
|
+
ctx.feedbackElement,
|
|
4504
|
+
(keyframe) => "translate" in keyframe
|
|
4505
|
+
)) != null ? _a5 : [];
|
|
4506
|
+
runningAnimation == null ? void 0 : runningAnimation.pause();
|
|
4507
|
+
const target = (_b2 = ctx.placeholder) != null ? _b2 : ctx.element;
|
|
4508
|
+
const options2 = {
|
|
4509
|
+
frameTransform: isSameFrame(ctx.feedbackElement, target) ? null : void 0
|
|
4510
|
+
};
|
|
4511
|
+
const current = new DOMRectangle(ctx.feedbackElement, options2);
|
|
4512
|
+
const currentTranslate = (_c3 = parseTranslate(getComputedStyles(ctx.feedbackElement).translate)) != null ? _c3 : ctx.translate;
|
|
4513
|
+
const final = new DOMRectangle(target, options2);
|
|
4514
|
+
const delta = Rectangle.delta(current, final, ctx.alignment);
|
|
4515
|
+
const finalTranslate = {
|
|
4516
|
+
x: currentTranslate.x - delta.x,
|
|
4517
|
+
y: currentTranslate.y - delta.y
|
|
4518
|
+
};
|
|
4519
|
+
const heightKeyframes = Math.round(current.intrinsicHeight) !== Math.round(final.intrinsicHeight) ? {
|
|
4520
|
+
minHeight: [
|
|
4521
|
+
`${current.intrinsicHeight}px`,
|
|
4522
|
+
`${final.intrinsicHeight}px`
|
|
4523
|
+
],
|
|
4524
|
+
maxHeight: [
|
|
4525
|
+
`${current.intrinsicHeight}px`,
|
|
4526
|
+
`${final.intrinsicHeight}px`
|
|
4527
|
+
]
|
|
4528
|
+
} : {};
|
|
4529
|
+
const widthKeyframes = Math.round(current.intrinsicWidth) !== Math.round(final.intrinsicWidth) ? {
|
|
4530
|
+
minWidth: [
|
|
4531
|
+
`${current.intrinsicWidth}px`,
|
|
4532
|
+
`${final.intrinsicWidth}px`
|
|
4533
|
+
],
|
|
4534
|
+
maxWidth: [
|
|
4535
|
+
`${current.intrinsicWidth}px`,
|
|
4536
|
+
`${final.intrinsicWidth}px`
|
|
4537
|
+
]
|
|
4538
|
+
} : {};
|
|
4539
|
+
ctx.styles.set({ transition: ctx.transition }, CSS_PREFIX);
|
|
4540
|
+
ctx.feedbackElement.setAttribute(DROPPING_ATTRIBUTE, "");
|
|
4541
|
+
(_d2 = ctx.getElementMutationObserver()) == null ? void 0 : _d2.takeRecords();
|
|
4542
|
+
animateTransform({
|
|
4543
|
+
element: ctx.feedbackElement,
|
|
4544
|
+
keyframes: __spreadProps$3(__spreadValues$3(__spreadValues$3({}, heightKeyframes), widthKeyframes), {
|
|
4545
|
+
translate: [
|
|
4546
|
+
`${currentTranslate.x}px ${currentTranslate.y}px 0`,
|
|
4547
|
+
`${finalTranslate.x}px ${finalTranslate.y}px 0`
|
|
4548
|
+
]
|
|
4549
|
+
}),
|
|
4550
|
+
options: {
|
|
4551
|
+
duration: prefersReducedMotion(getWindow(ctx.feedbackElement)) ? 0 : ctx.moved || ctx.feedbackElement !== ctx.element ? duration : 0,
|
|
4552
|
+
easing
|
|
4553
|
+
}
|
|
4554
|
+
}).then(() => {
|
|
4555
|
+
ctx.feedbackElement.removeAttribute(DROPPING_ATTRIBUTE);
|
|
4556
|
+
runningAnimation == null ? void 0 : runningAnimation.finish();
|
|
4557
|
+
ctx.cleanup();
|
|
4558
|
+
requestAnimationFrame(ctx.restoreFocus);
|
|
4559
|
+
});
|
|
4560
|
+
}
|
|
4561
|
+
var _overlay_dec, _a2, _init2, _overlay, _Feedback_instances, trackOverlayRoot_fn, render_fn;
|
|
4562
|
+
var _Feedback = class _Feedback2 extends (_a2 = Plugin, _overlay_dec = [reactive], _a2) {
|
|
4209
4563
|
constructor(manager, options2) {
|
|
4210
4564
|
super(manager, options2);
|
|
4211
4565
|
__privateAdd$2(this, _Feedback_instances);
|
|
4212
|
-
__privateAdd$2(this, _overlay, __runInitializers$2(
|
|
4566
|
+
__privateAdd$2(this, _overlay, __runInitializers$2(_init2, 8, this)), __runInitializers$2(_init2, 11, this);
|
|
4213
4567
|
this.state = {
|
|
4214
4568
|
initial: {},
|
|
4215
4569
|
current: {}
|
|
4216
4570
|
};
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
styleSheetRegistry.delete(doc);
|
|
4228
|
-
}
|
|
4229
|
-
}
|
|
4571
|
+
const styleSheetManager = manager.registry.plugins.get(
|
|
4572
|
+
StyleSheetManager
|
|
4573
|
+
);
|
|
4574
|
+
const unregisterStyles = styleSheetManager == null ? void 0 : styleSheetManager.register(CSS_RULES);
|
|
4575
|
+
if (unregisterStyles) {
|
|
4576
|
+
const originalDestroy = this.destroy.bind(this);
|
|
4577
|
+
this.destroy = () => {
|
|
4578
|
+
unregisterStyles();
|
|
4579
|
+
originalDestroy();
|
|
4580
|
+
};
|
|
4230
4581
|
}
|
|
4582
|
+
this.registerEffect(__privateMethod(this, _Feedback_instances, trackOverlayRoot_fn).bind(this, styleSheetManager));
|
|
4583
|
+
this.registerEffect(__privateMethod(this, _Feedback_instances, render_fn));
|
|
4231
4584
|
}
|
|
4232
4585
|
};
|
|
4233
|
-
|
|
4586
|
+
_init2 = __decoratorStart$2(_a2);
|
|
4234
4587
|
_overlay = /* @__PURE__ */ new WeakMap();
|
|
4235
4588
|
_Feedback_instances = /* @__PURE__ */ new WeakSet();
|
|
4589
|
+
trackOverlayRoot_fn = function(styleSheetManager) {
|
|
4590
|
+
const { overlay } = this;
|
|
4591
|
+
if (!overlay || !styleSheetManager) return;
|
|
4592
|
+
const root = getRoot(overlay);
|
|
4593
|
+
if (!root) return;
|
|
4594
|
+
return styleSheetManager.addRoot(root);
|
|
4595
|
+
};
|
|
4236
4596
|
render_fn = function() {
|
|
4237
|
-
var
|
|
4597
|
+
var _a5, _b2, _c3;
|
|
4238
4598
|
const { state, manager, options: options2 } = this;
|
|
4239
4599
|
const { dragOperation } = manager;
|
|
4240
4600
|
const { position, source, status } = dragOperation;
|
|
@@ -4249,7 +4609,7 @@ render_fn = function() {
|
|
|
4249
4609
|
return;
|
|
4250
4610
|
}
|
|
4251
4611
|
const { initial } = state;
|
|
4252
|
-
const feedbackElement = (
|
|
4612
|
+
const feedbackElement = (_a5 = this.overlay) != null ? _a5 : element;
|
|
4253
4613
|
const frameTransform = getFrameTransform(feedbackElement);
|
|
4254
4614
|
const elementFrameTransform = getFrameTransform(element);
|
|
4255
4615
|
const crossFrame = !isSameFrame(element, feedbackElement);
|
|
@@ -4266,8 +4626,6 @@ render_fn = function() {
|
|
|
4266
4626
|
width = width / scaleDelta.x;
|
|
4267
4627
|
height = height / scaleDelta.y;
|
|
4268
4628
|
}
|
|
4269
|
-
let elementMutationObserver;
|
|
4270
|
-
let documentMutationObserver;
|
|
4271
4629
|
const styles = new Styles(feedbackElement);
|
|
4272
4630
|
const {
|
|
4273
4631
|
transition,
|
|
@@ -4287,7 +4645,7 @@ render_fn = function() {
|
|
|
4287
4645
|
const widthOffset = contentBox ? parseInt(paddingInlineStart) + parseInt(paddingInlineEnd) + parseInt(borderInlineStartWidth) + parseInt(borderInlineEndWidth) : 0;
|
|
4288
4646
|
const heightOffset = contentBox ? parseInt(paddingBlockStart) + parseInt(paddingBlockEnd) + parseInt(borderBlockStartWidth) + parseInt(borderBlockEndWidth) : 0;
|
|
4289
4647
|
const placeholder = feedback !== "move" && !this.overlay ? createPlaceholder(source, clone ? "clone" : "hidden") : null;
|
|
4290
|
-
const isKeyboardOperation =
|
|
4648
|
+
const isKeyboardOperation = o(
|
|
4291
4649
|
() => isKeyboardEvent(manager.dragOperation.activatorEvent)
|
|
4292
4650
|
);
|
|
4293
4651
|
if (translate !== "none") {
|
|
@@ -4297,7 +4655,7 @@ render_fn = function() {
|
|
|
4297
4655
|
}
|
|
4298
4656
|
}
|
|
4299
4657
|
if (!initial.transformOrigin) {
|
|
4300
|
-
const current =
|
|
4658
|
+
const current = o(() => position.current);
|
|
4301
4659
|
initial.transformOrigin = {
|
|
4302
4660
|
x: (current.x - left * frameTransform.scaleX - frameTransform.x) / (width * frameTransform.scaleX),
|
|
4303
4661
|
y: (current.y - top * frameTransform.scaleY - frameTransform.y) / (height * frameTransform.scaleY)
|
|
@@ -4341,20 +4699,18 @@ render_fn = function() {
|
|
|
4341
4699
|
top: top + delta.y
|
|
4342
4700
|
};
|
|
4343
4701
|
feedbackElement.setAttribute(ATTRIBUTE, "true");
|
|
4344
|
-
const transform =
|
|
4702
|
+
const transform = o(() => dragOperation.transform);
|
|
4345
4703
|
const initialTranslate = (_b2 = initial.translate) != null ? _b2 : { x: 0, y: 0 };
|
|
4346
4704
|
const tX = transform.x * frameTransform.scaleX + initialTranslate.x;
|
|
4347
4705
|
const tY = transform.y * frameTransform.scaleY + initialTranslate.y;
|
|
4348
|
-
const translateString = `${tX}px ${tY}px 0`;
|
|
4349
|
-
const transitionString = transition ? `${transition}, translate 0ms linear` : "";
|
|
4350
4706
|
styles.set(
|
|
4351
4707
|
{
|
|
4352
4708
|
width: width - widthOffset,
|
|
4353
4709
|
height: height - heightOffset,
|
|
4354
4710
|
top: projected.top,
|
|
4355
4711
|
left: projected.left,
|
|
4356
|
-
translate:
|
|
4357
|
-
transition:
|
|
4712
|
+
translate: `${tX}px ${tY}px 0`,
|
|
4713
|
+
transition: transition ? `${transition}, translate 0ms linear` : "",
|
|
4358
4714
|
scale: crossFrame ? `${scaleDelta.x} ${scaleDelta.y}` : "",
|
|
4359
4715
|
"transform-origin": `${transformOrigin.x * 100}% ${transformOrigin.y * 100}%`
|
|
4360
4716
|
},
|
|
@@ -4374,130 +4730,68 @@ render_fn = function() {
|
|
|
4374
4730
|
showPopover(feedbackElement);
|
|
4375
4731
|
feedbackElement.addEventListener("beforetoggle", preventPopoverClose);
|
|
4376
4732
|
}
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
for (const [index, cell] of cells.entries()) {
|
|
4400
|
-
const placeholderCell = placeholderCells[index];
|
|
4401
|
-
cell.style.width = `${placeholderCell.offsetWidth}px`;
|
|
4402
|
-
}
|
|
4733
|
+
let elementMutationObserver;
|
|
4734
|
+
let documentMutationObserver;
|
|
4735
|
+
let savedCellWidths;
|
|
4736
|
+
const resizeObserver = createResizeObserver({
|
|
4737
|
+
placeholder,
|
|
4738
|
+
element,
|
|
4739
|
+
feedbackElement,
|
|
4740
|
+
frameTransform,
|
|
4741
|
+
transformOrigin,
|
|
4742
|
+
width,
|
|
4743
|
+
height,
|
|
4744
|
+
top,
|
|
4745
|
+
left,
|
|
4746
|
+
widthOffset,
|
|
4747
|
+
heightOffset,
|
|
4748
|
+
delta,
|
|
4749
|
+
styles,
|
|
4750
|
+
dragOperation,
|
|
4751
|
+
getElementMutationObserver: () => elementMutationObserver,
|
|
4752
|
+
getSavedCellWidths: () => savedCellWidths,
|
|
4753
|
+
setSavedCellWidths: (widths) => {
|
|
4754
|
+
savedCellWidths = widths;
|
|
4403
4755
|
}
|
|
4404
|
-
dragOperation.shape = new DOMRectangle(feedbackElement);
|
|
4405
4756
|
});
|
|
4406
4757
|
const initialShape = new DOMRectangle(feedbackElement);
|
|
4407
|
-
|
|
4758
|
+
o(() => dragOperation.shape = initialShape);
|
|
4408
4759
|
const feedbackWindow = getWindow(feedbackElement);
|
|
4409
4760
|
const handleWindowResize = (event) => {
|
|
4410
4761
|
this.manager.actions.stop({ event });
|
|
4411
4762
|
};
|
|
4763
|
+
const reducedMotion = prefersReducedMotion(feedbackWindow);
|
|
4412
4764
|
if (isKeyboardOperation) {
|
|
4413
4765
|
feedbackWindow.addEventListener("resize", handleWindowResize);
|
|
4414
4766
|
}
|
|
4415
|
-
if (
|
|
4767
|
+
if (o(() => source.status) === "idle") {
|
|
4416
4768
|
requestAnimationFrame(() => source.status = "dragging");
|
|
4417
4769
|
}
|
|
4418
4770
|
if (placeholder) {
|
|
4419
4771
|
resizeObserver.observe(placeholder);
|
|
4420
|
-
elementMutationObserver =
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
const attributeName = mutation.attributeName;
|
|
4431
|
-
if (attributeName.startsWith("aria-") || IGNORED_ATTRIBUTES.includes(attributeName)) {
|
|
4432
|
-
continue;
|
|
4433
|
-
}
|
|
4434
|
-
const attributeValue = element.getAttribute(attributeName);
|
|
4435
|
-
if (attributeName === "style") {
|
|
4436
|
-
if (supportsStyle(element) && supportsStyle(placeholder)) {
|
|
4437
|
-
const styles2 = element.style;
|
|
4438
|
-
for (const key of Array.from(placeholder.style)) {
|
|
4439
|
-
if (styles2.getPropertyValue(key) === "") {
|
|
4440
|
-
placeholder.style.removeProperty(key);
|
|
4441
|
-
}
|
|
4442
|
-
}
|
|
4443
|
-
for (const key of Array.from(styles2)) {
|
|
4444
|
-
if (IGNORED_STYLES.includes(key) || key.startsWith(CSS_PREFIX)) {
|
|
4445
|
-
continue;
|
|
4446
|
-
}
|
|
4447
|
-
const value = styles2.getPropertyValue(key);
|
|
4448
|
-
placeholder.style.setProperty(key, value);
|
|
4449
|
-
}
|
|
4450
|
-
}
|
|
4451
|
-
} else if (attributeValue !== null) {
|
|
4452
|
-
placeholder.setAttribute(attributeName, attributeValue);
|
|
4453
|
-
} else {
|
|
4454
|
-
placeholder.removeAttribute(attributeName);
|
|
4455
|
-
}
|
|
4456
|
-
}
|
|
4457
|
-
if (hasChildrenMutations && clone) {
|
|
4458
|
-
placeholder.innerHTML = element.innerHTML;
|
|
4459
|
-
}
|
|
4460
|
-
});
|
|
4461
|
-
elementMutationObserver.observe(element, {
|
|
4462
|
-
attributes: true,
|
|
4463
|
-
subtree: true,
|
|
4464
|
-
childList: true
|
|
4465
|
-
});
|
|
4466
|
-
documentMutationObserver = new MutationObserver((entries) => {
|
|
4467
|
-
for (const entry of entries) {
|
|
4468
|
-
if (entry.addedNodes.length === 0) continue;
|
|
4469
|
-
for (const node of Array.from(entry.addedNodes)) {
|
|
4470
|
-
if (node.contains(element) && element.nextElementSibling !== placeholder) {
|
|
4471
|
-
element.insertAdjacentElement("afterend", placeholder);
|
|
4472
|
-
showPopover(feedbackElement);
|
|
4473
|
-
return;
|
|
4474
|
-
}
|
|
4475
|
-
if (node.contains(placeholder) && placeholder.previousElementSibling !== element) {
|
|
4476
|
-
placeholder.insertAdjacentElement("beforebegin", element);
|
|
4477
|
-
showPopover(feedbackElement);
|
|
4478
|
-
return;
|
|
4479
|
-
}
|
|
4480
|
-
}
|
|
4481
|
-
}
|
|
4482
|
-
});
|
|
4483
|
-
documentMutationObserver.observe(element.ownerDocument.body, {
|
|
4484
|
-
childList: true,
|
|
4485
|
-
subtree: true
|
|
4486
|
-
});
|
|
4772
|
+
elementMutationObserver = createElementMutationObserver(
|
|
4773
|
+
element,
|
|
4774
|
+
placeholder,
|
|
4775
|
+
clone
|
|
4776
|
+
);
|
|
4777
|
+
documentMutationObserver = createDocumentMutationObserver(
|
|
4778
|
+
element,
|
|
4779
|
+
placeholder,
|
|
4780
|
+
feedbackElement
|
|
4781
|
+
);
|
|
4487
4782
|
}
|
|
4488
4783
|
const id = (_c3 = manager.dragOperation.source) == null ? void 0 : _c3.id;
|
|
4489
4784
|
const restoreFocus = () => {
|
|
4490
|
-
var
|
|
4491
|
-
if (!isKeyboardOperation || id == null)
|
|
4492
|
-
return;
|
|
4493
|
-
}
|
|
4785
|
+
var _a6;
|
|
4786
|
+
if (!isKeyboardOperation || id == null) return;
|
|
4494
4787
|
const draggable = manager.registry.draggables.get(id);
|
|
4495
|
-
const
|
|
4496
|
-
if (isHTMLElement(
|
|
4497
|
-
|
|
4788
|
+
const focusTarget = (_a6 = draggable == null ? void 0 : draggable.handle) != null ? _a6 : draggable == null ? void 0 : draggable.element;
|
|
4789
|
+
if (isHTMLElement(focusTarget)) {
|
|
4790
|
+
focusTarget.focus();
|
|
4498
4791
|
}
|
|
4499
4792
|
};
|
|
4500
4793
|
const cleanup = () => {
|
|
4794
|
+
var _a6;
|
|
4501
4795
|
elementMutationObserver == null ? void 0 : elementMutationObserver.disconnect();
|
|
4502
4796
|
documentMutationObserver == null ? void 0 : documentMutationObserver.disconnect();
|
|
4503
4797
|
resizeObserver.disconnect();
|
|
@@ -4511,6 +4805,12 @@ render_fn = function() {
|
|
|
4511
4805
|
}
|
|
4512
4806
|
feedbackElement.removeAttribute(ATTRIBUTE);
|
|
4513
4807
|
styles.reset();
|
|
4808
|
+
if (savedCellWidths && isTableRow(element)) {
|
|
4809
|
+
const cells = Array.from(element.cells);
|
|
4810
|
+
for (const [index, cell] of cells.entries()) {
|
|
4811
|
+
cell.style.width = (_a6 = savedCellWidths[index]) != null ? _a6 : "";
|
|
4812
|
+
}
|
|
4813
|
+
}
|
|
4514
4814
|
source.status = "idle";
|
|
4515
4815
|
const moved = state.current.translate != null;
|
|
4516
4816
|
if (placeholder && (moved || placeholder.parentElement !== feedbackElement.parentElement) && feedbackElement.isConnected) {
|
|
@@ -4518,27 +4818,28 @@ render_fn = function() {
|
|
|
4518
4818
|
}
|
|
4519
4819
|
placeholder == null ? void 0 : placeholder.remove();
|
|
4520
4820
|
};
|
|
4821
|
+
const dropAnimationConfig = options2 == null ? void 0 : options2.dropAnimation;
|
|
4521
4822
|
const cleanupEffects = effects(
|
|
4522
4823
|
// Update transform on move
|
|
4523
4824
|
() => {
|
|
4524
|
-
var
|
|
4825
|
+
var _a6;
|
|
4525
4826
|
const { transform: transform2, status: status2 } = dragOperation;
|
|
4526
4827
|
if (!transform2.x && !transform2.y && !state.current.translate) {
|
|
4527
4828
|
return;
|
|
4528
4829
|
}
|
|
4529
4830
|
if (status2.dragging) {
|
|
4530
|
-
const initialTranslate2 = (
|
|
4831
|
+
const initialTranslate2 = (_a6 = initial.translate) != null ? _a6 : { x: 0, y: 0 };
|
|
4531
4832
|
const translate2 = {
|
|
4532
4833
|
x: transform2.x / frameTransform.scaleX + initialTranslate2.x,
|
|
4533
4834
|
y: transform2.y / frameTransform.scaleY + initialTranslate2.y
|
|
4534
4835
|
};
|
|
4535
4836
|
const previousTranslate = state.current.translate;
|
|
4536
|
-
const modifiers =
|
|
4537
|
-
const currentShape =
|
|
4538
|
-
var
|
|
4539
|
-
return (
|
|
4837
|
+
const modifiers = o(() => dragOperation.modifiers);
|
|
4838
|
+
const currentShape = o(() => {
|
|
4839
|
+
var _a7;
|
|
4840
|
+
return (_a7 = dragOperation.shape) == null ? void 0 : _a7.current;
|
|
4540
4841
|
});
|
|
4541
|
-
const translateTransition = isKeyboardOperation ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
|
|
4842
|
+
const translateTransition = isKeyboardOperation && !reducedMotion ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
|
|
4542
4843
|
styles.set(
|
|
4543
4844
|
{
|
|
4544
4845
|
transition: `${transition}, translate ${translateTransition}`,
|
|
@@ -4552,7 +4853,6 @@ render_fn = function() {
|
|
|
4552
4853
|
dragOperation.shape = Rectangle.from(
|
|
4553
4854
|
currentShape.boundingRectangle
|
|
4554
4855
|
).translate(
|
|
4555
|
-
// Need to take into account frame transform when optimistically updating shape
|
|
4556
4856
|
delta2.x * frameTransform.scaleX,
|
|
4557
4857
|
delta2.y * frameTransform.scaleY
|
|
4558
4858
|
);
|
|
@@ -4570,80 +4870,28 @@ render_fn = function() {
|
|
|
4570
4870
|
let translate2 = state.current.translate;
|
|
4571
4871
|
const moved = translate2 != null;
|
|
4572
4872
|
if (!translate2 && element !== feedbackElement) {
|
|
4573
|
-
translate2 = {
|
|
4574
|
-
x: 0,
|
|
4575
|
-
y: 0
|
|
4576
|
-
};
|
|
4873
|
+
translate2 = { x: 0, y: 0 };
|
|
4577
4874
|
}
|
|
4578
|
-
if (!translate2) {
|
|
4875
|
+
if (!translate2 || dropAnimationConfig === null) {
|
|
4579
4876
|
cleanup();
|
|
4580
4877
|
return;
|
|
4581
4878
|
}
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
const delta2 = Rectangle.delta(current, final, source.alignment);
|
|
4599
|
-
const finalTranslate = {
|
|
4600
|
-
x: currentTranslate.x - delta2.x,
|
|
4601
|
-
y: currentTranslate.y - delta2.y
|
|
4602
|
-
};
|
|
4603
|
-
const heightKeyframes = Math.round(current.intrinsicHeight) !== Math.round(final.intrinsicHeight) ? {
|
|
4604
|
-
minHeight: [
|
|
4605
|
-
`${current.intrinsicHeight}px`,
|
|
4606
|
-
`${final.intrinsicHeight}px`
|
|
4607
|
-
],
|
|
4608
|
-
maxHeight: [
|
|
4609
|
-
`${current.intrinsicHeight}px`,
|
|
4610
|
-
`${final.intrinsicHeight}px`
|
|
4611
|
-
]
|
|
4612
|
-
} : {};
|
|
4613
|
-
const widthKeyframes = Math.round(current.intrinsicWidth) !== Math.round(final.intrinsicWidth) ? {
|
|
4614
|
-
minWidth: [
|
|
4615
|
-
`${current.intrinsicWidth}px`,
|
|
4616
|
-
`${final.intrinsicWidth}px`
|
|
4617
|
-
],
|
|
4618
|
-
maxWidth: [
|
|
4619
|
-
`${current.intrinsicWidth}px`,
|
|
4620
|
-
`${final.intrinsicWidth}px`
|
|
4621
|
-
]
|
|
4622
|
-
} : {};
|
|
4623
|
-
styles.set({ transition }, CSS_PREFIX);
|
|
4624
|
-
feedbackElement.setAttribute(DROPPING_ATTRIBUTE, "");
|
|
4625
|
-
elementMutationObserver == null ? void 0 : elementMutationObserver.takeRecords();
|
|
4626
|
-
animateTransform({
|
|
4627
|
-
element: feedbackElement,
|
|
4628
|
-
keyframes: __spreadProps$3(__spreadValues$3(__spreadValues$3({}, heightKeyframes), widthKeyframes), {
|
|
4629
|
-
translate: [
|
|
4630
|
-
`${currentTranslate.x}px ${currentTranslate.y}px 0`,
|
|
4631
|
-
`${finalTranslate.x}px ${finalTranslate.y}px 0`
|
|
4632
|
-
]
|
|
4633
|
-
}),
|
|
4634
|
-
options: {
|
|
4635
|
-
duration: moved || feedbackElement !== element ? 250 : 0,
|
|
4636
|
-
easing: "ease"
|
|
4637
|
-
}
|
|
4638
|
-
}).then(() => {
|
|
4639
|
-
feedbackElement.removeAttribute(DROPPING_ATTRIBUTE);
|
|
4640
|
-
animation == null ? void 0 : animation.finish();
|
|
4641
|
-
cleanup();
|
|
4642
|
-
requestAnimationFrame(restoreFocus);
|
|
4643
|
-
});
|
|
4644
|
-
}
|
|
4645
|
-
};
|
|
4646
|
-
manager.renderer.rendering.then(dropAnimation);
|
|
4879
|
+
manager.renderer.rendering.then(() => {
|
|
4880
|
+
runDropAnimation({
|
|
4881
|
+
element,
|
|
4882
|
+
feedbackElement,
|
|
4883
|
+
placeholder,
|
|
4884
|
+
translate: translate2,
|
|
4885
|
+
moved,
|
|
4886
|
+
transition,
|
|
4887
|
+
alignment: source.alignment,
|
|
4888
|
+
styles,
|
|
4889
|
+
animation: dropAnimationConfig != null ? dropAnimationConfig : void 0,
|
|
4890
|
+
getElementMutationObserver: () => elementMutationObserver,
|
|
4891
|
+
cleanup,
|
|
4892
|
+
restoreFocus
|
|
4893
|
+
});
|
|
4894
|
+
});
|
|
4647
4895
|
}
|
|
4648
4896
|
}
|
|
4649
4897
|
);
|
|
@@ -4652,59 +4900,18 @@ render_fn = function() {
|
|
|
4652
4900
|
cleanupEffects();
|
|
4653
4901
|
};
|
|
4654
4902
|
};
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
const { status, source, target } = this.manager.dragOperation;
|
|
4658
|
-
const { nonce } = (_a4 = this.options) != null ? _a4 : {};
|
|
4659
|
-
if (status.initializing) {
|
|
4660
|
-
const sourceDocument = getDocument((_b2 = source == null ? void 0 : source.element) != null ? _b2 : null);
|
|
4661
|
-
const targetDocument = getDocument((_c3 = target == null ? void 0 : target.element) != null ? _c3 : null);
|
|
4662
|
-
const documents = /* @__PURE__ */ new Set([sourceDocument, targetDocument]);
|
|
4663
|
-
for (const doc of documents) {
|
|
4664
|
-
let registration = styleSheetRegistry.get(doc);
|
|
4665
|
-
if (!registration) {
|
|
4666
|
-
const style = document.createElement("style");
|
|
4667
|
-
style.textContent = CSS_RULES;
|
|
4668
|
-
if (nonce) {
|
|
4669
|
-
style.setAttribute("nonce", nonce);
|
|
4670
|
-
}
|
|
4671
|
-
doc.head.prepend(style);
|
|
4672
|
-
const mutationObserver = new MutationObserver((entries) => {
|
|
4673
|
-
for (const entry of entries) {
|
|
4674
|
-
if (entry.type === "childList") {
|
|
4675
|
-
const removedNodes = Array.from(entry.removedNodes);
|
|
4676
|
-
if (removedNodes.length > 0 && removedNodes.includes(style)) {
|
|
4677
|
-
doc.head.prepend(style);
|
|
4678
|
-
}
|
|
4679
|
-
}
|
|
4680
|
-
}
|
|
4681
|
-
});
|
|
4682
|
-
mutationObserver.observe(doc.head, { childList: true });
|
|
4683
|
-
registration = {
|
|
4684
|
-
cleanup: () => {
|
|
4685
|
-
mutationObserver.disconnect();
|
|
4686
|
-
style.remove();
|
|
4687
|
-
},
|
|
4688
|
-
instances: /* @__PURE__ */ new Set()
|
|
4689
|
-
};
|
|
4690
|
-
styleSheetRegistry.set(doc, registration);
|
|
4691
|
-
}
|
|
4692
|
-
registration.instances.add(this);
|
|
4693
|
-
}
|
|
4694
|
-
}
|
|
4695
|
-
};
|
|
4696
|
-
__decorateElement$2(_init$2, 4, "overlay", _overlay_dec, _Feedback, _overlay);
|
|
4697
|
-
__decoratorMetadata$2(_init$2, _Feedback);
|
|
4903
|
+
__decorateElement$2(_init2, 4, "overlay", _overlay_dec, _Feedback, _overlay);
|
|
4904
|
+
__decoratorMetadata$2(_init2, _Feedback);
|
|
4698
4905
|
_Feedback.configure = configurator(_Feedback);
|
|
4699
4906
|
var Feedback = _Feedback;
|
|
4700
4907
|
var LOCKED = true;
|
|
4701
4908
|
var UNLOCKED = false;
|
|
4702
|
-
var _dec,
|
|
4703
|
-
_b = (_dec2 = [reactive], ScrollDirection.Forward),
|
|
4909
|
+
var _dec, _a3, _dec2, _b, _init3, __b, __a;
|
|
4910
|
+
_b = (_dec2 = [reactive], ScrollDirection.Forward), _a3 = (_dec = [reactive], ScrollDirection.Reverse);
|
|
4704
4911
|
var ScrollLock = class {
|
|
4705
4912
|
constructor() {
|
|
4706
|
-
__privateAdd$2(this, __b, __runInitializers$2(
|
|
4707
|
-
__privateAdd$2(this, __a, __runInitializers$2(
|
|
4913
|
+
__privateAdd$2(this, __b, __runInitializers$2(_init3, 8, this, LOCKED)), __runInitializers$2(_init3, 11, this);
|
|
4914
|
+
__privateAdd$2(this, __a, __runInitializers$2(_init3, 12, this, LOCKED)), __runInitializers$2(_init3, 15, this);
|
|
4708
4915
|
}
|
|
4709
4916
|
isLocked(direction) {
|
|
4710
4917
|
if (direction === ScrollDirection.Idle) {
|
|
@@ -4722,12 +4929,12 @@ var ScrollLock = class {
|
|
|
4722
4929
|
this[direction] = UNLOCKED;
|
|
4723
4930
|
}
|
|
4724
4931
|
};
|
|
4725
|
-
|
|
4932
|
+
_init3 = __decoratorStart$2(null);
|
|
4726
4933
|
__b = /* @__PURE__ */ new WeakMap();
|
|
4727
4934
|
__a = /* @__PURE__ */ new WeakMap();
|
|
4728
|
-
__decorateElement$2(
|
|
4729
|
-
__decorateElement$2(
|
|
4730
|
-
__decoratorMetadata$2(
|
|
4935
|
+
__decorateElement$2(_init3, 4, _b, _dec2, ScrollLock, __b);
|
|
4936
|
+
__decorateElement$2(_init3, 4, _a3, _dec, ScrollLock, __a);
|
|
4937
|
+
__decoratorMetadata$2(_init3, ScrollLock);
|
|
4731
4938
|
var DIRECTIONS = [ScrollDirection.Forward, ScrollDirection.Reverse];
|
|
4732
4939
|
var ScrollIntent = class {
|
|
4733
4940
|
constructor() {
|
|
@@ -4741,10 +4948,10 @@ var ScrollIntent = class {
|
|
|
4741
4948
|
var ScrollIntentTracker = class extends Plugin {
|
|
4742
4949
|
constructor(manager) {
|
|
4743
4950
|
super(manager);
|
|
4744
|
-
const scrollIntent =
|
|
4951
|
+
const scrollIntent = c(new ScrollIntent());
|
|
4745
4952
|
let previousDelta = null;
|
|
4746
4953
|
this.signal = scrollIntent;
|
|
4747
|
-
|
|
4954
|
+
m(() => {
|
|
4748
4955
|
const { status } = manager.dragOperation;
|
|
4749
4956
|
if (!status.initialized) {
|
|
4750
4957
|
previousDelta = null;
|
|
@@ -4758,7 +4965,7 @@ var ScrollIntentTracker = class extends Plugin {
|
|
|
4758
4965
|
y: getDirection$1(delta.y, previousDelta.y)
|
|
4759
4966
|
};
|
|
4760
4967
|
const intent = scrollIntent.peek();
|
|
4761
|
-
|
|
4968
|
+
n(() => {
|
|
4762
4969
|
for (const axis of Axes) {
|
|
4763
4970
|
for (const direction of DIRECTIONS) {
|
|
4764
4971
|
if (directions[axis] === direction) {
|
|
@@ -4779,11 +4986,11 @@ var ScrollIntentTracker = class extends Plugin {
|
|
|
4779
4986
|
function getDirection$1(a2, b2) {
|
|
4780
4987
|
return Math.sign(a2 - b2);
|
|
4781
4988
|
}
|
|
4782
|
-
var _autoScrolling_dec,
|
|
4783
|
-
var Scroller = class extends (
|
|
4989
|
+
var _autoScrolling_dec, _a4, _init4, _autoScrolling, _meta, _scroll;
|
|
4990
|
+
var Scroller = class extends (_a4 = CorePlugin, _autoScrolling_dec = [reactive], _a4) {
|
|
4784
4991
|
constructor(manager) {
|
|
4785
4992
|
super(manager);
|
|
4786
|
-
__privateAdd$2(this, _autoScrolling, __runInitializers$2(
|
|
4993
|
+
__privateAdd$2(this, _autoScrolling, __runInitializers$2(_init4, 8, this, false)), __runInitializers$2(_init4, 11, this);
|
|
4787
4994
|
__privateAdd$2(this, _meta);
|
|
4788
4995
|
__privateAdd$2(this, _scroll, () => {
|
|
4789
4996
|
if (!__privateGet$2(this, _meta)) {
|
|
@@ -4794,7 +5001,7 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
|
|
|
4794
5001
|
if (by.x) element.scrollLeft += by.x;
|
|
4795
5002
|
});
|
|
4796
5003
|
this.scroll = (options2) => {
|
|
4797
|
-
var
|
|
5004
|
+
var _a5;
|
|
4798
5005
|
if (this.disabled) {
|
|
4799
5006
|
return false;
|
|
4800
5007
|
}
|
|
@@ -4836,7 +5043,7 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
|
|
|
4836
5043
|
const scrollLeftBy = x * speed.x;
|
|
4837
5044
|
const scrollTopBy = y2 * speed.y;
|
|
4838
5045
|
if (scrollLeftBy || scrollTopBy) {
|
|
4839
|
-
const previousScrollBy = (
|
|
5046
|
+
const previousScrollBy = (_a5 = __privateGet$2(this, _meta)) == null ? void 0 : _a5.by;
|
|
4840
5047
|
if (this.autoScrolling && previousScrollBy) {
|
|
4841
5048
|
const scrollIntentMismatch = previousScrollBy.x && !scrollLeftBy || previousScrollBy.y && !scrollTopBy;
|
|
4842
5049
|
if (scrollIntentMismatch) continue;
|
|
@@ -4866,7 +5073,7 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
|
|
|
4866
5073
|
return null;
|
|
4867
5074
|
}
|
|
4868
5075
|
const element = getElementFromPoint(
|
|
4869
|
-
|
|
5076
|
+
getRoot(source == null ? void 0 : source.element),
|
|
4870
5077
|
position.current
|
|
4871
5078
|
);
|
|
4872
5079
|
if (element) {
|
|
@@ -4915,12 +5122,12 @@ var Scroller = class extends (_a3 = CorePlugin, _autoScrolling_dec = [reactive],
|
|
|
4915
5122
|
});
|
|
4916
5123
|
}
|
|
4917
5124
|
};
|
|
4918
|
-
|
|
5125
|
+
_init4 = __decoratorStart$2(_a4);
|
|
4919
5126
|
_autoScrolling = /* @__PURE__ */ new WeakMap();
|
|
4920
5127
|
_meta = /* @__PURE__ */ new WeakMap();
|
|
4921
5128
|
_scroll = /* @__PURE__ */ new WeakMap();
|
|
4922
|
-
__decorateElement$2(
|
|
4923
|
-
__decoratorMetadata$2(
|
|
5129
|
+
__decorateElement$2(_init4, 4, "autoScrolling", _autoScrolling_dec, Scroller, _autoScrolling);
|
|
5130
|
+
__decoratorMetadata$2(_init4, Scroller);
|
|
4924
5131
|
function getScrollIntent(value) {
|
|
4925
5132
|
if (value > 0) {
|
|
4926
5133
|
return ScrollDirection.Forward;
|
|
@@ -4973,7 +5180,7 @@ var AutoScroller = class extends Plugin {
|
|
|
4973
5180
|
if (!scroller) {
|
|
4974
5181
|
throw new Error("AutoScroller plugin depends on Scroller plugin");
|
|
4975
5182
|
}
|
|
4976
|
-
this.destroy =
|
|
5183
|
+
this.destroy = m(() => {
|
|
4977
5184
|
if (this.disabled) {
|
|
4978
5185
|
return;
|
|
4979
5186
|
}
|
|
@@ -5014,11 +5221,11 @@ var ScrollListener = class extends CorePlugin {
|
|
|
5014
5221
|
}
|
|
5015
5222
|
};
|
|
5016
5223
|
const { dragOperation } = this.manager;
|
|
5017
|
-
this.destroy =
|
|
5018
|
-
var
|
|
5224
|
+
this.destroy = m(() => {
|
|
5225
|
+
var _a5, _b2, _c3;
|
|
5019
5226
|
const enabled = dragOperation.status.dragging;
|
|
5020
5227
|
if (enabled) {
|
|
5021
|
-
const root = (_c3 = (_b2 = (
|
|
5228
|
+
const root = (_c3 = (_b2 = (_a5 = dragOperation.source) == null ? void 0 : _a5.element) == null ? void 0 : _b2.ownerDocument) != null ? _c3 : document;
|
|
5022
5229
|
root.addEventListener("scroll", this.handleScroll, listenerOptions);
|
|
5023
5230
|
return () => {
|
|
5024
5231
|
root.removeEventListener(
|
|
@@ -5036,10 +5243,10 @@ var PreventSelection = class extends Plugin {
|
|
|
5036
5243
|
constructor(manager, options2) {
|
|
5037
5244
|
super(manager, options2);
|
|
5038
5245
|
this.manager = manager;
|
|
5039
|
-
this.destroy =
|
|
5040
|
-
var
|
|
5246
|
+
this.destroy = m(() => {
|
|
5247
|
+
var _a5;
|
|
5041
5248
|
const { dragOperation } = this.manager;
|
|
5042
|
-
const { nonce } = (
|
|
5249
|
+
const { nonce } = (_a5 = this.options) != null ? _a5 : {};
|
|
5043
5250
|
if (dragOperation.status.initialized) {
|
|
5044
5251
|
const style = document.createElement("style");
|
|
5045
5252
|
if (nonce) {
|
|
@@ -5062,8 +5269,8 @@ var PreventSelection = class extends Plugin {
|
|
|
5062
5269
|
}
|
|
5063
5270
|
};
|
|
5064
5271
|
function removeSelection() {
|
|
5065
|
-
var
|
|
5066
|
-
(
|
|
5272
|
+
var _a5;
|
|
5273
|
+
(_a5 = document.getSelection()) == null ? void 0 : _a5.removeAllRanges();
|
|
5067
5274
|
}
|
|
5068
5275
|
var defaults = Object.freeze({
|
|
5069
5276
|
offset: 10,
|
|
@@ -5077,8 +5284,8 @@ var defaults = Object.freeze({
|
|
|
5077
5284
|
right: ["ArrowRight"]
|
|
5078
5285
|
},
|
|
5079
5286
|
preventActivation(event, source) {
|
|
5080
|
-
var
|
|
5081
|
-
const target = (
|
|
5287
|
+
var _a5;
|
|
5288
|
+
const target = (_a5 = source.handle) != null ? _a5 : source.element;
|
|
5082
5289
|
return event.target !== target;
|
|
5083
5290
|
}
|
|
5084
5291
|
});
|
|
@@ -5115,9 +5322,9 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
|
|
|
5115
5322
|
};
|
|
5116
5323
|
}
|
|
5117
5324
|
bind(source, options2 = this.options) {
|
|
5118
|
-
const unbind =
|
|
5119
|
-
var
|
|
5120
|
-
const target = (
|
|
5325
|
+
const unbind = m(() => {
|
|
5326
|
+
var _a5;
|
|
5327
|
+
const target = (_a5 = source.handle) != null ? _a5 : source.element;
|
|
5121
5328
|
const listener = (event) => {
|
|
5122
5329
|
if (isKeyboardEvent(event)) {
|
|
5123
5330
|
this.handleSourceKeyDown(event, source, options2);
|
|
@@ -5190,14 +5397,14 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
|
|
|
5190
5397
|
this.cleanup();
|
|
5191
5398
|
}
|
|
5192
5399
|
handleMove(direction, event) {
|
|
5193
|
-
var
|
|
5400
|
+
var _a5, _b2;
|
|
5194
5401
|
const { shape } = this.manager.dragOperation;
|
|
5195
5402
|
const factor = event.shiftKey ? 5 : 1;
|
|
5196
5403
|
let by = {
|
|
5197
5404
|
x: 0,
|
|
5198
5405
|
y: 0
|
|
5199
5406
|
};
|
|
5200
|
-
let offset = (_b2 = (
|
|
5407
|
+
let offset = (_b2 = (_a5 = this.options) == null ? void 0 : _a5.offset) != null ? _b2 : defaults.offset;
|
|
5201
5408
|
if (typeof offset === "number") {
|
|
5202
5409
|
offset = { x: offset, y: offset };
|
|
5203
5410
|
}
|
|
@@ -5336,9 +5543,9 @@ PointerActivationConstraints.Delay = DelayConstraint;
|
|
|
5336
5543
|
PointerActivationConstraints.Distance = DistanceConstraint;
|
|
5337
5544
|
var defaults2 = Object.freeze({
|
|
5338
5545
|
activationConstraints(event, source) {
|
|
5339
|
-
var
|
|
5546
|
+
var _a5;
|
|
5340
5547
|
const { pointerType, target } = event;
|
|
5341
|
-
if (pointerType === "mouse" && isElement(target) && (source.handle === target || ((
|
|
5548
|
+
if (pointerType === "mouse" && isElement(target) && (source.handle === target || ((_a5 = source.handle) == null ? void 0 : _a5.contains(target)))) {
|
|
5342
5549
|
return void 0;
|
|
5343
5550
|
}
|
|
5344
5551
|
if (pointerType === "touch") {
|
|
@@ -5357,12 +5564,12 @@ var defaults2 = Object.freeze({
|
|
|
5357
5564
|
];
|
|
5358
5565
|
},
|
|
5359
5566
|
preventActivation(event, source) {
|
|
5360
|
-
var
|
|
5567
|
+
var _a5;
|
|
5361
5568
|
const { target } = event;
|
|
5362
5569
|
if (target === source.element) return false;
|
|
5363
5570
|
if (target === source.handle) return false;
|
|
5364
5571
|
if (!isElement(target)) return false;
|
|
5365
|
-
if ((
|
|
5572
|
+
if ((_a5 = source.handle) == null ? void 0 : _a5.contains(target)) return false;
|
|
5366
5573
|
return isInteractiveElement(target);
|
|
5367
5574
|
}
|
|
5368
5575
|
});
|
|
@@ -5395,8 +5602,8 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
|
|
|
5395
5602
|
return constraints;
|
|
5396
5603
|
}
|
|
5397
5604
|
bind(source, options2 = this.options) {
|
|
5398
|
-
const unbind =
|
|
5399
|
-
var
|
|
5605
|
+
const unbind = m(() => {
|
|
5606
|
+
var _a5;
|
|
5400
5607
|
const controller = new AbortController();
|
|
5401
5608
|
const { signal: signal3 } = controller;
|
|
5402
5609
|
const listener = (event) => {
|
|
@@ -5404,7 +5611,7 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
|
|
|
5404
5611
|
this.handlePointerDown(event, source, options2);
|
|
5405
5612
|
}
|
|
5406
5613
|
};
|
|
5407
|
-
let targets = [(
|
|
5614
|
+
let targets = [(_a5 = source.handle) != null ? _a5 : source.element];
|
|
5408
5615
|
if (options2 == null ? void 0 : options2.activatorElements) {
|
|
5409
5616
|
if (Array.isArray(options2.activatorElements)) {
|
|
5410
5617
|
targets = options2.activatorElements;
|
|
@@ -5475,8 +5682,8 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
|
|
|
5475
5682
|
__privateGet$2(this, _cleanup).add(cleanup);
|
|
5476
5683
|
}
|
|
5477
5684
|
handlePointerMove(event, source) {
|
|
5478
|
-
var
|
|
5479
|
-
if (((
|
|
5685
|
+
var _a5, _b2;
|
|
5686
|
+
if (((_a5 = this.controller) == null ? void 0 : _a5.activated) === false) {
|
|
5480
5687
|
(_b2 = this.controller) == null ? void 0 : _b2.onEvent(event);
|
|
5481
5688
|
return;
|
|
5482
5689
|
}
|
|
@@ -5526,7 +5733,7 @@ var _PointerSensor = class _PointerSensor2 extends Sensor {
|
|
|
5526
5733
|
const ownerDocument = getDocument(event.target);
|
|
5527
5734
|
const pointerCaptureTarget = ownerDocument.body;
|
|
5528
5735
|
pointerCaptureTarget.setPointerCapture(event.pointerId);
|
|
5529
|
-
const listenerTargets = isElement(event.target) ? [event.target,
|
|
5736
|
+
const listenerTargets = isElement(event.target) ? [event.target, pointerCaptureTarget] : pointerCaptureTarget;
|
|
5530
5737
|
const unbind = this.listeners.bind(listenerTargets, [
|
|
5531
5738
|
{
|
|
5532
5739
|
// Prevent scrolling on touch devices
|
|
@@ -5608,16 +5815,16 @@ var DragDropManager2 = class extends DragDropManager$1 {
|
|
|
5608
5815
|
modifiers = []
|
|
5609
5816
|
} = input;
|
|
5610
5817
|
super(__spreadProps$3(__spreadValues$3({}, input), {
|
|
5611
|
-
plugins: [ScrollListener, Scroller, ...plugins],
|
|
5818
|
+
plugins: [ScrollListener, Scroller, StyleSheetManager, ...plugins],
|
|
5612
5819
|
sensors,
|
|
5613
5820
|
modifiers
|
|
5614
5821
|
}));
|
|
5615
5822
|
}
|
|
5616
5823
|
};
|
|
5617
|
-
var _feedback_dec, _element_dec, _handle_dec, _c,
|
|
5824
|
+
var _feedback_dec, _element_dec, _handle_dec, _c, _init5, _handle, _element$1, _feedback;
|
|
5618
5825
|
var Draggable$1 = class Draggable2 extends (_c = Draggable$2, _handle_dec = [reactive], _element_dec = [reactive], _feedback_dec = [reactive], _c) {
|
|
5619
|
-
constructor(
|
|
5620
|
-
var _b2 =
|
|
5826
|
+
constructor(_a5, manager) {
|
|
5827
|
+
var _b2 = _a5, {
|
|
5621
5828
|
element,
|
|
5622
5829
|
effects: effects2 = () => [],
|
|
5623
5830
|
handle,
|
|
@@ -5633,10 +5840,10 @@ var Draggable$1 = class Draggable2 extends (_c = Draggable$2, _handle_dec = [rea
|
|
|
5633
5840
|
effects: () => [
|
|
5634
5841
|
...effects2(),
|
|
5635
5842
|
() => {
|
|
5636
|
-
var
|
|
5843
|
+
var _a6, _b3;
|
|
5637
5844
|
const { manager: manager2 } = this;
|
|
5638
5845
|
if (!manager2) return;
|
|
5639
|
-
const sensors = (_b3 = (
|
|
5846
|
+
const sensors = (_b3 = (_a6 = this.sensors) == null ? void 0 : _a6.map(descriptor)) != null ? _b3 : [
|
|
5640
5847
|
...manager2.sensors
|
|
5641
5848
|
];
|
|
5642
5849
|
const unbindFunctions = sensors.map((entry) => {
|
|
@@ -5653,26 +5860,26 @@ var Draggable$1 = class Draggable2 extends (_c = Draggable$2, _handle_dec = [rea
|
|
|
5653
5860
|
}, input),
|
|
5654
5861
|
manager
|
|
5655
5862
|
);
|
|
5656
|
-
__privateAdd$2(this, _handle, __runInitializers$2(
|
|
5657
|
-
__privateAdd$2(this, _element$1, __runInitializers$2(
|
|
5658
|
-
__privateAdd$2(this, _feedback, __runInitializers$2(
|
|
5863
|
+
__privateAdd$2(this, _handle, __runInitializers$2(_init5, 8, this)), __runInitializers$2(_init5, 11, this);
|
|
5864
|
+
__privateAdd$2(this, _element$1, __runInitializers$2(_init5, 12, this)), __runInitializers$2(_init5, 15, this);
|
|
5865
|
+
__privateAdd$2(this, _feedback, __runInitializers$2(_init5, 16, this)), __runInitializers$2(_init5, 19, this);
|
|
5659
5866
|
this.element = element;
|
|
5660
5867
|
this.handle = handle;
|
|
5661
5868
|
this.feedback = feedback;
|
|
5662
5869
|
}
|
|
5663
5870
|
};
|
|
5664
|
-
|
|
5871
|
+
_init5 = __decoratorStart$2(_c);
|
|
5665
5872
|
_handle = /* @__PURE__ */ new WeakMap();
|
|
5666
5873
|
_element$1 = /* @__PURE__ */ new WeakMap();
|
|
5667
5874
|
_feedback = /* @__PURE__ */ new WeakMap();
|
|
5668
|
-
__decorateElement$2(
|
|
5669
|
-
__decorateElement$2(
|
|
5670
|
-
__decorateElement$2(
|
|
5671
|
-
__decoratorMetadata$2(
|
|
5672
|
-
var _proxy_dec, _element_dec2, _c2,
|
|
5875
|
+
__decorateElement$2(_init5, 4, "handle", _handle_dec, Draggable$1, _handle);
|
|
5876
|
+
__decorateElement$2(_init5, 4, "element", _element_dec, Draggable$1, _element$1);
|
|
5877
|
+
__decorateElement$2(_init5, 4, "feedback", _feedback_dec, Draggable$1, _feedback);
|
|
5878
|
+
__decoratorMetadata$2(_init5, Draggable$1);
|
|
5879
|
+
var _proxy_dec, _element_dec2, _c2, _init6, _element2, _d, element_get, element_set, _Droppable_instances, _proxy;
|
|
5673
5880
|
var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _proxy_dec = [reactive], _c2) {
|
|
5674
|
-
constructor(
|
|
5675
|
-
var _b2 =
|
|
5881
|
+
constructor(_a5, manager) {
|
|
5882
|
+
var _b2 = _a5, { element, effects: effects2 = () => [] } = _b2, input = __objRest$2(_b2, ["element", "effects"]);
|
|
5676
5883
|
const { collisionDetector = defaultCollisionDetection } = input;
|
|
5677
5884
|
const updateShape = (boundingClientRect) => {
|
|
5678
5885
|
const { manager: manager2, element: element2 } = this;
|
|
@@ -5682,14 +5889,14 @@ var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _
|
|
|
5682
5889
|
}
|
|
5683
5890
|
if (!manager2) return;
|
|
5684
5891
|
const updatedShape = new DOMRectangle(element2);
|
|
5685
|
-
const shape =
|
|
5892
|
+
const shape = o(() => this.shape);
|
|
5686
5893
|
if (updatedShape && (shape == null ? void 0 : shape.equals(updatedShape))) {
|
|
5687
5894
|
return shape;
|
|
5688
5895
|
}
|
|
5689
5896
|
this.shape = updatedShape;
|
|
5690
5897
|
return updatedShape;
|
|
5691
5898
|
};
|
|
5692
|
-
const observePosition =
|
|
5899
|
+
const observePosition = c(false);
|
|
5693
5900
|
super(
|
|
5694
5901
|
__spreadProps$3(__spreadValues$3({}, input), {
|
|
5695
5902
|
collisionDetector,
|
|
@@ -5718,8 +5925,8 @@ var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _
|
|
|
5718
5925
|
}
|
|
5719
5926
|
},
|
|
5720
5927
|
() => {
|
|
5721
|
-
var
|
|
5722
|
-
if ((
|
|
5928
|
+
var _a6;
|
|
5929
|
+
if ((_a6 = this.manager) == null ? void 0 : _a6.dragOperation.status.initialized) {
|
|
5723
5930
|
return () => {
|
|
5724
5931
|
this.shape = void 0;
|
|
5725
5932
|
};
|
|
@@ -5730,8 +5937,8 @@ var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _
|
|
|
5730
5937
|
manager
|
|
5731
5938
|
);
|
|
5732
5939
|
__privateAdd$2(this, _Droppable_instances);
|
|
5733
|
-
__privateAdd$2(this, _element2, __runInitializers$2(
|
|
5734
|
-
__privateAdd$2(this, _proxy, __runInitializers$2(
|
|
5940
|
+
__privateAdd$2(this, _element2, __runInitializers$2(_init6, 8, this)), __runInitializers$2(_init6, 11, this);
|
|
5941
|
+
__privateAdd$2(this, _proxy, __runInitializers$2(_init6, 12, this)), __runInitializers$2(_init6, 15, this);
|
|
5735
5942
|
this.element = element;
|
|
5736
5943
|
this.refreshShape = () => updateShape();
|
|
5737
5944
|
}
|
|
@@ -5739,17 +5946,17 @@ var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _
|
|
|
5739
5946
|
__privateSet$2(this, _Droppable_instances, element, element_set);
|
|
5740
5947
|
}
|
|
5741
5948
|
get element() {
|
|
5742
|
-
var
|
|
5743
|
-
return (
|
|
5949
|
+
var _a5;
|
|
5950
|
+
return (_a5 = this.proxy) != null ? _a5 : __privateGet$2(this, _Droppable_instances, element_get);
|
|
5744
5951
|
}
|
|
5745
5952
|
};
|
|
5746
|
-
|
|
5953
|
+
_init6 = __decoratorStart$2(_c2);
|
|
5747
5954
|
_element2 = /* @__PURE__ */ new WeakMap();
|
|
5748
5955
|
_Droppable_instances = /* @__PURE__ */ new WeakSet();
|
|
5749
5956
|
_proxy = /* @__PURE__ */ new WeakMap();
|
|
5750
|
-
_d = __decorateElement$2(
|
|
5751
|
-
__decorateElement$2(
|
|
5752
|
-
__decoratorMetadata$2(
|
|
5957
|
+
_d = __decorateElement$2(_init6, 20, "#element", _element_dec2, _Droppable_instances, _element2), element_get = _d.get, element_set = _d.set;
|
|
5958
|
+
__decorateElement$2(_init6, 4, "proxy", _proxy_dec, Droppable2, _proxy);
|
|
5959
|
+
__decoratorMetadata$2(_init6, Droppable2);
|
|
5753
5960
|
var __create$1 = Object.create;
|
|
5754
5961
|
var __defProp$2 = Object.defineProperty;
|
|
5755
5962
|
var __defProps$2 = Object.defineProperties;
|
|
@@ -5788,8 +5995,8 @@ var __objRest$1 = (source, exclude) => {
|
|
|
5788
5995
|
return target;
|
|
5789
5996
|
};
|
|
5790
5997
|
var __decoratorStart$1 = (base) => {
|
|
5791
|
-
var
|
|
5792
|
-
return [, , , __create$1((
|
|
5998
|
+
var _a5;
|
|
5999
|
+
return [, , , __create$1((_a5 = void 0) != null ? _a5 : null)];
|
|
5793
6000
|
};
|
|
5794
6001
|
var __decoratorStrings$1 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
5795
6002
|
var __expectFn$1 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$1("Function expected") : fn;
|
|
@@ -5833,7 +6040,7 @@ var TOLERANCE = 10;
|
|
|
5833
6040
|
var SortableKeyboardPlugin = class extends Plugin {
|
|
5834
6041
|
constructor(manager) {
|
|
5835
6042
|
super(manager);
|
|
5836
|
-
const cleanupEffect =
|
|
6043
|
+
const cleanupEffect = m(() => {
|
|
5837
6044
|
const { dragOperation } = manager;
|
|
5838
6045
|
if (!isKeyboardEvent(dragOperation.activatorEvent)) {
|
|
5839
6046
|
return;
|
|
@@ -5876,7 +6083,7 @@ var SortableKeyboardPlugin = class extends Plugin {
|
|
|
5876
6083
|
const { center } = dragOperation.shape.current;
|
|
5877
6084
|
const potentialTargets = [];
|
|
5878
6085
|
const cleanup = [];
|
|
5879
|
-
|
|
6086
|
+
n(() => {
|
|
5880
6087
|
for (const droppable of registry.droppables) {
|
|
5881
6088
|
const { id: id2 } = droppable;
|
|
5882
6089
|
if (!droppable.accepts(source) || id2 === (target == null ? void 0 : target.id) && isSortable(droppable) || !droppable.element) {
|
|
@@ -5900,7 +6107,7 @@ var SortableKeyboardPlugin = class extends Plugin {
|
|
|
5900
6107
|
potentialTargets,
|
|
5901
6108
|
closestCorners
|
|
5902
6109
|
);
|
|
5903
|
-
|
|
6110
|
+
n(() => cleanup.forEach((clean) => clean()));
|
|
5904
6111
|
const [firstCollision] = collisions;
|
|
5905
6112
|
if (!firstCollision) {
|
|
5906
6113
|
return;
|
|
@@ -5988,7 +6195,7 @@ function arrayMove$1(array, from, to) {
|
|
|
5988
6195
|
return newArray;
|
|
5989
6196
|
}
|
|
5990
6197
|
function mutate(items, event, mutation) {
|
|
5991
|
-
var
|
|
6198
|
+
var _a5, _b2;
|
|
5992
6199
|
const { source, target, canceled } = event.operation;
|
|
5993
6200
|
if (!source || !target || canceled) {
|
|
5994
6201
|
if ("preventDefault" in event) event.preventDefault();
|
|
@@ -6033,7 +6240,7 @@ function mutate(items, event, mutation) {
|
|
|
6033
6240
|
}
|
|
6034
6241
|
if (!source.manager) return items;
|
|
6035
6242
|
const { dragOperation } = source.manager;
|
|
6036
|
-
const position = (_b2 = (
|
|
6243
|
+
const position = (_b2 = (_a5 = dragOperation.shape) == null ? void 0 : _a5.current.center) != null ? _b2 : dragOperation.position.current;
|
|
6037
6244
|
if (targetParent == null) {
|
|
6038
6245
|
if (target.id in items) {
|
|
6039
6246
|
const insertionIndex = target.shape && position.y > target.shape.center.y ? items[target.id].length : 0;
|
|
@@ -6112,12 +6319,12 @@ var OptimisticSortingPlugin = class extends Plugin {
|
|
|
6112
6319
|
queueMicrotask(() => {
|
|
6113
6320
|
if (event.defaultPrevented) return;
|
|
6114
6321
|
manager2.renderer.rendering.then(() => {
|
|
6115
|
-
var
|
|
6322
|
+
var _a5, _b2, _c3;
|
|
6116
6323
|
const newInstances = getSortableInstances();
|
|
6117
6324
|
for (const [group, sortableInstances] of instances.entries()) {
|
|
6118
6325
|
const entries = Array.from(sortableInstances).entries();
|
|
6119
6326
|
for (const [index, sortable] of entries) {
|
|
6120
|
-
if (sortable.index !== index || sortable.group !== group || !((
|
|
6327
|
+
if (sortable.index !== index || sortable.group !== group || !((_a5 = newInstances.get(group)) == null ? void 0 : _a5.has(sortable))) {
|
|
6121
6328
|
return;
|
|
6122
6329
|
}
|
|
6123
6330
|
}
|
|
@@ -6144,7 +6351,7 @@ var OptimisticSortingPlugin = class extends Plugin {
|
|
|
6144
6351
|
const targetIndex = newState[targetGroup].indexOf(target.sortable);
|
|
6145
6352
|
manager2.collisionObserver.disable();
|
|
6146
6353
|
reorder(sourceElement, sourceIndex, targetElement, targetIndex);
|
|
6147
|
-
|
|
6354
|
+
n(() => {
|
|
6148
6355
|
for (const [index, sortable] of newState[sourceGroup].entries()) {
|
|
6149
6356
|
sortable.index = index;
|
|
6150
6357
|
}
|
|
@@ -6194,7 +6401,7 @@ var OptimisticSortingPlugin = class extends Plugin {
|
|
|
6194
6401
|
return;
|
|
6195
6402
|
}
|
|
6196
6403
|
reorder(sourceElement, target.index, targetElement, source.index);
|
|
6197
|
-
|
|
6404
|
+
n(() => {
|
|
6198
6405
|
for (const [_2, sortableInstances] of instances.entries()) {
|
|
6199
6406
|
const entries = Array.from(sortableInstances).values();
|
|
6200
6407
|
for (const sortable of entries) {
|
|
@@ -6237,34 +6444,34 @@ var store = new WeakStore();
|
|
|
6237
6444
|
var _group_dec, _index_dec, _init$1, _index, _previousGroup, _previousIndex, _group, _element;
|
|
6238
6445
|
_index_dec = [reactive], _group_dec = [reactive];
|
|
6239
6446
|
var Sortable2 = class {
|
|
6240
|
-
constructor(
|
|
6447
|
+
constructor(_a5, manager) {
|
|
6241
6448
|
__privateAdd$1(this, _index, __runInitializers$1(_init$1, 8, this)), __runInitializers$1(_init$1, 11, this);
|
|
6242
6449
|
__privateAdd$1(this, _previousGroup);
|
|
6243
6450
|
__privateAdd$1(this, _previousIndex);
|
|
6244
6451
|
__privateAdd$1(this, _group, __runInitializers$1(_init$1, 12, this)), __runInitializers$1(_init$1, 15, this);
|
|
6245
6452
|
__privateAdd$1(this, _element);
|
|
6246
6453
|
this.register = () => {
|
|
6247
|
-
|
|
6248
|
-
var
|
|
6249
|
-
(
|
|
6454
|
+
n(() => {
|
|
6455
|
+
var _a6, _b3;
|
|
6456
|
+
(_a6 = this.manager) == null ? void 0 : _a6.registry.register(this.droppable);
|
|
6250
6457
|
(_b3 = this.manager) == null ? void 0 : _b3.registry.register(this.draggable);
|
|
6251
6458
|
});
|
|
6252
6459
|
return () => this.unregister();
|
|
6253
6460
|
};
|
|
6254
6461
|
this.unregister = () => {
|
|
6255
|
-
|
|
6256
|
-
var
|
|
6257
|
-
(
|
|
6462
|
+
n(() => {
|
|
6463
|
+
var _a6, _b3;
|
|
6464
|
+
(_a6 = this.manager) == null ? void 0 : _a6.registry.unregister(this.droppable);
|
|
6258
6465
|
(_b3 = this.manager) == null ? void 0 : _b3.registry.unregister(this.draggable);
|
|
6259
6466
|
});
|
|
6260
6467
|
};
|
|
6261
6468
|
this.destroy = () => {
|
|
6262
|
-
|
|
6469
|
+
n(() => {
|
|
6263
6470
|
this.droppable.destroy();
|
|
6264
6471
|
this.draggable.destroy();
|
|
6265
6472
|
});
|
|
6266
6473
|
};
|
|
6267
|
-
var _b2 =
|
|
6474
|
+
var _b2 = _a5, {
|
|
6268
6475
|
effects: inputEffects = () => [],
|
|
6269
6476
|
group,
|
|
6270
6477
|
index,
|
|
@@ -6295,7 +6502,7 @@ var Sortable2 = class {
|
|
|
6295
6502
|
store.set(
|
|
6296
6503
|
this.manager,
|
|
6297
6504
|
this.id,
|
|
6298
|
-
|
|
6505
|
+
o(() => ({
|
|
6299
6506
|
initialIndex: this.index,
|
|
6300
6507
|
initialGroup: this.group
|
|
6301
6508
|
}))
|
|
@@ -6343,15 +6550,15 @@ var Sortable2 = class {
|
|
|
6343
6550
|
this.transition = transition;
|
|
6344
6551
|
}
|
|
6345
6552
|
get initialIndex() {
|
|
6346
|
-
var
|
|
6347
|
-
return (_b2 = (
|
|
6553
|
+
var _a5, _b2;
|
|
6554
|
+
return (_b2 = (_a5 = store.get(this.manager, this.id)) == null ? void 0 : _a5.initialIndex) != null ? _b2 : this.index;
|
|
6348
6555
|
}
|
|
6349
6556
|
get initialGroup() {
|
|
6350
|
-
var
|
|
6351
|
-
return (_b2 = (
|
|
6557
|
+
var _a5, _b2;
|
|
6558
|
+
return (_b2 = (_a5 = store.get(this.manager, this.id)) == null ? void 0 : _a5.initialGroup) != null ? _b2 : this.group;
|
|
6352
6559
|
}
|
|
6353
6560
|
animate() {
|
|
6354
|
-
|
|
6561
|
+
o(() => {
|
|
6355
6562
|
const { manager, transition } = this;
|
|
6356
6563
|
const { shape } = this.droppable;
|
|
6357
6564
|
if (!manager) return;
|
|
@@ -6376,6 +6583,7 @@ var Sortable2 = class {
|
|
|
6376
6583
|
const currentTranslate = computeTranslate(element, translate, false);
|
|
6377
6584
|
const finalTranslate = computeTranslate(element, translate);
|
|
6378
6585
|
if (delta.x || delta.y) {
|
|
6586
|
+
const resolvedTransition = prefersReducedMotion(getWindow(element)) ? __spreadProps$2(__spreadValues$2({}, transition), { duration: 0 }) : transition;
|
|
6379
6587
|
animateTransform({
|
|
6380
6588
|
element,
|
|
6381
6589
|
keyframes: {
|
|
@@ -6384,7 +6592,7 @@ var Sortable2 = class {
|
|
|
6384
6592
|
`${finalTranslate.x}px ${finalTranslate.y}px ${finalTranslate.z}`
|
|
6385
6593
|
]
|
|
6386
6594
|
},
|
|
6387
|
-
options:
|
|
6595
|
+
options: resolvedTransition
|
|
6388
6596
|
}).then(() => {
|
|
6389
6597
|
if (!manager.dragOperation.status.dragging) {
|
|
6390
6598
|
this.droppable.shape = void 0;
|
|
@@ -6398,13 +6606,13 @@ var Sortable2 = class {
|
|
|
6398
6606
|
return this.draggable.manager;
|
|
6399
6607
|
}
|
|
6400
6608
|
set manager(manager) {
|
|
6401
|
-
|
|
6609
|
+
n(() => {
|
|
6402
6610
|
this.draggable.manager = manager;
|
|
6403
6611
|
this.droppable.manager = manager;
|
|
6404
6612
|
});
|
|
6405
6613
|
}
|
|
6406
6614
|
set element(element) {
|
|
6407
|
-
|
|
6615
|
+
n(() => {
|
|
6408
6616
|
const previousElement = __privateGet$1(this, _element);
|
|
6409
6617
|
const droppableElement = this.droppable.element;
|
|
6410
6618
|
const draggableElement = this.draggable.element;
|
|
@@ -6418,10 +6626,10 @@ var Sortable2 = class {
|
|
|
6418
6626
|
});
|
|
6419
6627
|
}
|
|
6420
6628
|
get element() {
|
|
6421
|
-
var
|
|
6629
|
+
var _a5, _b2;
|
|
6422
6630
|
const element = __privateGet$1(this, _element);
|
|
6423
6631
|
if (!element) return;
|
|
6424
|
-
return (_b2 = (
|
|
6632
|
+
return (_b2 = (_a5 = ProxiedElements.get(element)) != null ? _a5 : element) != null ? _b2 : this.droppable.element;
|
|
6425
6633
|
}
|
|
6426
6634
|
set target(target) {
|
|
6427
6635
|
this.droppable.element = target;
|
|
@@ -6442,13 +6650,13 @@ var Sortable2 = class {
|
|
|
6442
6650
|
this.draggable.feedback = value;
|
|
6443
6651
|
}
|
|
6444
6652
|
set disabled(value) {
|
|
6445
|
-
|
|
6653
|
+
n(() => {
|
|
6446
6654
|
this.droppable.disabled = value;
|
|
6447
6655
|
this.draggable.disabled = value;
|
|
6448
6656
|
});
|
|
6449
6657
|
}
|
|
6450
6658
|
set data(data) {
|
|
6451
|
-
|
|
6659
|
+
n(() => {
|
|
6452
6660
|
this.droppable.data = data;
|
|
6453
6661
|
this.draggable.data = data;
|
|
6454
6662
|
});
|
|
@@ -6457,7 +6665,7 @@ var Sortable2 = class {
|
|
|
6457
6665
|
this.draggable.handle = handle;
|
|
6458
6666
|
}
|
|
6459
6667
|
set id(id) {
|
|
6460
|
-
|
|
6668
|
+
n(() => {
|
|
6461
6669
|
this.droppable.id = id;
|
|
6462
6670
|
this.draggable.id = id;
|
|
6463
6671
|
});
|
|
@@ -6484,7 +6692,7 @@ var Sortable2 = class {
|
|
|
6484
6692
|
return this.draggable.alignment;
|
|
6485
6693
|
}
|
|
6486
6694
|
set type(type) {
|
|
6487
|
-
|
|
6695
|
+
n(() => {
|
|
6488
6696
|
this.droppable.type = type;
|
|
6489
6697
|
this.draggable.type = type;
|
|
6490
6698
|
});
|
|
@@ -6557,12 +6765,12 @@ function isRef(value) {
|
|
|
6557
6765
|
return value != null && typeof value === "object" && "current" in value;
|
|
6558
6766
|
}
|
|
6559
6767
|
function currentValue(value) {
|
|
6560
|
-
var
|
|
6768
|
+
var _a5;
|
|
6561
6769
|
if (value == null) {
|
|
6562
6770
|
return void 0;
|
|
6563
6771
|
}
|
|
6564
6772
|
if (isRef(value)) {
|
|
6565
|
-
return (
|
|
6773
|
+
return (_a5 = value.current) != null ? _a5 : void 0;
|
|
6566
6774
|
}
|
|
6567
6775
|
return value;
|
|
6568
6776
|
}
|
|
@@ -6582,18 +6790,18 @@ function useDeepSignal(target, synchronous) {
|
|
|
6582
6790
|
tracked.current.clear();
|
|
6583
6791
|
return;
|
|
6584
6792
|
}
|
|
6585
|
-
return
|
|
6586
|
-
var
|
|
6793
|
+
return m(() => {
|
|
6794
|
+
var _a5;
|
|
6587
6795
|
let stale = false;
|
|
6588
6796
|
let sync = false;
|
|
6589
6797
|
for (const entry of tracked.current) {
|
|
6590
6798
|
const [key] = entry;
|
|
6591
|
-
const value =
|
|
6799
|
+
const value = o(() => entry[1]);
|
|
6592
6800
|
const latestValue = target[key];
|
|
6593
6801
|
if (value !== latestValue) {
|
|
6594
6802
|
stale = true;
|
|
6595
6803
|
tracked.current.set(key, latestValue);
|
|
6596
|
-
sync = (
|
|
6804
|
+
sync = (_a5 = synchronous == null ? void 0 : synchronous(key, value, latestValue)) != null ? _a5 : false;
|
|
6597
6805
|
}
|
|
6598
6806
|
}
|
|
6599
6807
|
if (stale) {
|
|
@@ -6945,7 +7153,7 @@ var Position2 = class extends (_a = ValueHistory, _delta_dec = [derived], _direc
|
|
|
6945
7153
|
const timestamp = Date.now();
|
|
6946
7154
|
const timeDelta = timestamp - __privateGet(this, _timestamp);
|
|
6947
7155
|
const velocity = (delta2) => Math.round(delta2 / timeDelta * 100);
|
|
6948
|
-
|
|
7156
|
+
n(() => {
|
|
6949
7157
|
__privateSet(this, _timestamp, timestamp);
|
|
6950
7158
|
this.velocity = {
|
|
6951
7159
|
x: velocity(delta.x),
|
|
@@ -7024,7 +7232,7 @@ function useSortable(input) {
|
|
|
7024
7232
|
const trackedSortable = useDeepSignal(sortable, shouldUpdateSynchronously);
|
|
7025
7233
|
useOnValueChange(id, () => sortable.id = id);
|
|
7026
7234
|
useIsomorphicLayoutEffect(() => {
|
|
7027
|
-
|
|
7235
|
+
n(() => {
|
|
7028
7236
|
sortable.group = group;
|
|
7029
7237
|
sortable.index = index;
|
|
7030
7238
|
});
|
|
@@ -7040,8 +7248,8 @@ function useSortable(input) {
|
|
|
7040
7248
|
useOnValueChange(
|
|
7041
7249
|
index,
|
|
7042
7250
|
() => {
|
|
7043
|
-
var
|
|
7044
|
-
if (((
|
|
7251
|
+
var _a5;
|
|
7252
|
+
if (((_a5 = sortable.manager) == null ? void 0 : _a5.dragOperation.status.idle) && (transition == null ? void 0 : transition.idle)) {
|
|
7045
7253
|
sortable.refreshShape();
|
|
7046
7254
|
}
|
|
7047
7255
|
},
|
|
@@ -7099,8 +7307,8 @@ function useSortable(input) {
|
|
|
7099
7307
|
),
|
|
7100
7308
|
ref: useCallback(
|
|
7101
7309
|
(element2) => {
|
|
7102
|
-
var
|
|
7103
|
-
if (!element2 && ((
|
|
7310
|
+
var _a5, _b2;
|
|
7311
|
+
if (!element2 && ((_a5 = sortable.element) == null ? void 0 : _a5.isConnected) && !((_b2 = sortable.manager) == null ? void 0 : _b2.dragOperation.status.idle)) {
|
|
7104
7312
|
return;
|
|
7105
7313
|
}
|
|
7106
7314
|
sortable.element = element2 != null ? element2 : void 0;
|
|
@@ -7109,8 +7317,8 @@ function useSortable(input) {
|
|
|
7109
7317
|
),
|
|
7110
7318
|
sourceRef: useCallback(
|
|
7111
7319
|
(element2) => {
|
|
7112
|
-
var
|
|
7113
|
-
if (!element2 && ((
|
|
7320
|
+
var _a5, _b2;
|
|
7321
|
+
if (!element2 && ((_a5 = sortable.source) == null ? void 0 : _a5.isConnected) && !((_b2 = sortable.manager) == null ? void 0 : _b2.dragOperation.status.idle)) {
|
|
7114
7322
|
return;
|
|
7115
7323
|
}
|
|
7116
7324
|
sortable.source = element2 != null ? element2 : void 0;
|
|
@@ -7119,8 +7327,8 @@ function useSortable(input) {
|
|
|
7119
7327
|
),
|
|
7120
7328
|
targetRef: useCallback(
|
|
7121
7329
|
(element2) => {
|
|
7122
|
-
var
|
|
7123
|
-
if (!element2 && ((
|
|
7330
|
+
var _a5, _b2;
|
|
7331
|
+
if (!element2 && ((_a5 = sortable.target) == null ? void 0 : _a5.isConnected) && !((_b2 = sortable.manager) == null ? void 0 : _b2.dragOperation.status.idle)) {
|
|
7124
7332
|
return;
|
|
7125
7333
|
}
|
|
7126
7334
|
sortable.target = element2 != null ? element2 : void 0;
|
|
@@ -7201,8 +7409,8 @@ var _SnapModifier = class _SnapModifier2 extends Modifier {
|
|
|
7201
7409
|
* @returns The modified transform with coordinates snapped to the grid
|
|
7202
7410
|
*/
|
|
7203
7411
|
apply({ transform }) {
|
|
7204
|
-
var
|
|
7205
|
-
const { size = 20 } = (
|
|
7412
|
+
var _a5;
|
|
7413
|
+
const { size = 20 } = (_a5 = this.options) != null ? _a5 : {};
|
|
7206
7414
|
const x = typeof size === "number" ? size : size.x;
|
|
7207
7415
|
const y2 = typeof size === "number" ? size : size.y;
|
|
7208
7416
|
return __spreadProps(__spreadValues({}, transform), {
|
|
@@ -7215,8 +7423,8 @@ _SnapModifier.configure = configurator(_SnapModifier);
|
|
|
7215
7423
|
var _RestrictToElement = class _RestrictToElement2 extends Modifier {
|
|
7216
7424
|
constructor(manager, options2) {
|
|
7217
7425
|
super(manager, options2);
|
|
7218
|
-
this.boundingRectangle =
|
|
7219
|
-
this.destroy =
|
|
7426
|
+
this.boundingRectangle = c(null);
|
|
7427
|
+
this.destroy = m(() => {
|
|
7220
7428
|
if (!this.options) {
|
|
7221
7429
|
return;
|
|
7222
7430
|
}
|