@ztwoint/z-ui 0.1.61 → 0.1.63
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/_virtual/bind-all.js +4 -0
- package/dist/_virtual/bind.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/components/assets/icons/drag-handle.js +18 -0
- package/dist/components/assets/icons/minus.js +28 -0
- package/dist/components/column-reorder/column-reorder.hook.js +47 -0
- package/dist/components/column-reorder/column-reorder.js +26 -0
- package/dist/components/column-reorder/components/column-item/column-item.hook.js +78 -0
- package/dist/components/column-reorder/components/column-item/column-item.js +79 -0
- package/dist/components/column-reorder/components/column-item/column-item.util.js +12 -0
- package/dist/components/select/z2-select.js +52 -52
- package/dist/components/table/components/cell/avatar-cell.js +9 -6
- package/dist/components/table/table-provider.js +3 -0
- package/dist/components/table-card/table-card.js +32 -29
- package/dist/index.d.ts +1 -0
- package/dist/index.js +37 -35
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js +127 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +7 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js +226 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +107 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +195 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +21 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +43 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +253 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +121 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +12 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/center-under-pointer.js +10 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/pointer-outside-of-preview.js +31 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.js +66 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +17 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/reorder.js +11 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +8 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +57 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +13 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +47 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +17 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +7 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari-on-ios.js +8 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +10 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-flourish/dist/esm/trigger-post-move-flash.js +20 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-flourish/node_modules/@atlaskit/motion/dist/esm/utils/durations.js +6 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/closest-edge.js +58 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/get-reorder-destination-index.js +12 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/reorder-with-edge.js +18 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +24 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
- package/dist/node_modules/bind-event-listener/dist/bind-all.js +45 -0
- package/dist/node_modules/bind-event-listener/dist/bind.js +16 -0
- package/dist/node_modules/bind-event-listener/dist/index.js +20 -0
- package/dist/node_modules/raf-schd/dist/raf-schd.esm.js +15 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import U from "../../../../../@babel/runtime/helpers/esm/defineProperty.js";
|
|
2
|
+
import V from "../../../../../@babel/runtime/helpers/esm/toConsumableArray.js";
|
|
3
|
+
import { combine as Y } from "../public-utils/combine.js";
|
|
4
|
+
import { once as q } from "../public-utils/once.js";
|
|
5
|
+
import { addAttribute as z } from "../util/add-attribute.js";
|
|
6
|
+
function M(e, o) {
|
|
7
|
+
var t = Object.keys(e);
|
|
8
|
+
if (Object.getOwnPropertySymbols) {
|
|
9
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
10
|
+
o && (a = a.filter(function(T) {
|
|
11
|
+
return Object.getOwnPropertyDescriptor(e, T).enumerable;
|
|
12
|
+
})), t.push.apply(t, a);
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function E(e) {
|
|
17
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
18
|
+
var t = arguments[o] != null ? arguments[o] : {};
|
|
19
|
+
o % 2 ? M(Object(t), !0).forEach(function(a) {
|
|
20
|
+
U(e, a, t[a]);
|
|
21
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : M(Object(t)).forEach(function(a) {
|
|
22
|
+
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(t, a));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function I(e, o) {
|
|
28
|
+
var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
29
|
+
if (!t) {
|
|
30
|
+
if (Array.isArray(e) || (t = B(e)) || o) {
|
|
31
|
+
t && (e = t);
|
|
32
|
+
var a = 0, T = function() {
|
|
33
|
+
};
|
|
34
|
+
return { s: T, n: function() {
|
|
35
|
+
return a >= e.length ? { done: !0 } : { done: !1, value: e[a++] };
|
|
36
|
+
}, e: function(b) {
|
|
37
|
+
throw b;
|
|
38
|
+
}, f: T };
|
|
39
|
+
}
|
|
40
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
42
|
+
}
|
|
43
|
+
var S, k = !0, C = !1;
|
|
44
|
+
return { s: function() {
|
|
45
|
+
t = t.call(e);
|
|
46
|
+
}, n: function() {
|
|
47
|
+
var b = t.next();
|
|
48
|
+
return k = b.done, b;
|
|
49
|
+
}, e: function(b) {
|
|
50
|
+
C = !0, S = b;
|
|
51
|
+
}, f: function() {
|
|
52
|
+
try {
|
|
53
|
+
k || t.return == null || t.return();
|
|
54
|
+
} finally {
|
|
55
|
+
if (C) throw S;
|
|
56
|
+
}
|
|
57
|
+
} };
|
|
58
|
+
}
|
|
59
|
+
function B(e, o) {
|
|
60
|
+
if (e) {
|
|
61
|
+
if (typeof e == "string") return H(e, o);
|
|
62
|
+
var t = {}.toString.call(e).slice(8, -1);
|
|
63
|
+
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? H(e, o) : void 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function H(e, o) {
|
|
67
|
+
(o == null || o > e.length) && (o = e.length);
|
|
68
|
+
for (var t = 0, a = Array(o); t < o; t++) a[t] = e[t];
|
|
69
|
+
return a;
|
|
70
|
+
}
|
|
71
|
+
function N(e) {
|
|
72
|
+
return e.slice(0).reverse();
|
|
73
|
+
}
|
|
74
|
+
function F(e) {
|
|
75
|
+
var o = e.typeKey, t = e.defaultDropEffect, a = /* @__PURE__ */ new WeakMap(), T = "data-drop-target-for-".concat(o), S = "[".concat(T, "]");
|
|
76
|
+
function k(r) {
|
|
77
|
+
return a.set(r.element, r), function() {
|
|
78
|
+
return a.delete(r.element);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function C(r) {
|
|
82
|
+
if (process.env.NODE_ENV !== "production") {
|
|
83
|
+
var p = a.get(r.element);
|
|
84
|
+
p && console.warn("You have already registered a [".concat(o, "] dropTarget on the same element"), {
|
|
85
|
+
existing: p,
|
|
86
|
+
proposed: r
|
|
87
|
+
}), r.element instanceof HTMLIFrameElement && console.warn(`
|
|
88
|
+
We recommend not registering <iframe> elements as drop targets
|
|
89
|
+
as it can result in some strange browser event ordering.
|
|
90
|
+
`.replace(/\s{2,}/g, " ").trim());
|
|
91
|
+
}
|
|
92
|
+
var i = Y(z(r.element, {
|
|
93
|
+
attribute: T,
|
|
94
|
+
value: "true"
|
|
95
|
+
}), k(r));
|
|
96
|
+
return q(i);
|
|
97
|
+
}
|
|
98
|
+
function g(r) {
|
|
99
|
+
var p, i, s, d, l = r.source, c = r.target, v = r.input, f = r.result, n = f === void 0 ? [] : f;
|
|
100
|
+
if (c == null)
|
|
101
|
+
return n;
|
|
102
|
+
if (!(c instanceof Element))
|
|
103
|
+
return c instanceof Node ? g({
|
|
104
|
+
source: l,
|
|
105
|
+
target: c.parentElement,
|
|
106
|
+
input: v,
|
|
107
|
+
result: n
|
|
108
|
+
}) : n;
|
|
109
|
+
var y = c.closest(S);
|
|
110
|
+
if (y == null)
|
|
111
|
+
return n;
|
|
112
|
+
var u = a.get(y);
|
|
113
|
+
if (u == null)
|
|
114
|
+
return n;
|
|
115
|
+
var h = {
|
|
116
|
+
input: v,
|
|
117
|
+
source: l,
|
|
118
|
+
element: u.element
|
|
119
|
+
};
|
|
120
|
+
if (u.canDrop && !u.canDrop(h))
|
|
121
|
+
return g({
|
|
122
|
+
source: l,
|
|
123
|
+
target: u.element.parentElement,
|
|
124
|
+
input: v,
|
|
125
|
+
result: n
|
|
126
|
+
});
|
|
127
|
+
var O = (p = (i = u.getData) === null || i === void 0 ? void 0 : i.call(u, h)) !== null && p !== void 0 ? p : {}, D = (s = (d = u.getDropEffect) === null || d === void 0 ? void 0 : d.call(u, h)) !== null && s !== void 0 ? s : t, m = {
|
|
128
|
+
data: O,
|
|
129
|
+
element: u.element,
|
|
130
|
+
dropEffect: D,
|
|
131
|
+
// we are collecting _actual_ drop targets, so these are
|
|
132
|
+
// being applied _not_ due to stickiness
|
|
133
|
+
isActiveDueToStickiness: !1
|
|
134
|
+
};
|
|
135
|
+
return g({
|
|
136
|
+
source: l,
|
|
137
|
+
target: u.element.parentElement,
|
|
138
|
+
input: v,
|
|
139
|
+
// Using bubble ordering. Same ordering as `event.getPath()`
|
|
140
|
+
result: [].concat(V(n), [m])
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function b(r) {
|
|
144
|
+
var p = r.eventName, i = r.payload, s = I(i.location.current.dropTargets), d;
|
|
145
|
+
try {
|
|
146
|
+
for (s.s(); !(d = s.n()).done; ) {
|
|
147
|
+
var l, c = d.value, v = a.get(c.element), f = E(E({}, i), {}, {
|
|
148
|
+
self: c
|
|
149
|
+
});
|
|
150
|
+
v == null || (l = v[p]) === null || l === void 0 || l.call(
|
|
151
|
+
v,
|
|
152
|
+
// I cannot seem to get the types right here.
|
|
153
|
+
// TS doesn't seem to like that one event can need `nativeSetDragImage`
|
|
154
|
+
// @ts-expect-error
|
|
155
|
+
f
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
} catch (n) {
|
|
159
|
+
s.e(n);
|
|
160
|
+
} finally {
|
|
161
|
+
s.f();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var R = {
|
|
165
|
+
onGenerateDragPreview: b,
|
|
166
|
+
onDrag: b,
|
|
167
|
+
onDragStart: b,
|
|
168
|
+
onDrop: b,
|
|
169
|
+
onDropTargetChange: function(p) {
|
|
170
|
+
var i = p.payload, s = new Set(i.location.current.dropTargets.map(function(A) {
|
|
171
|
+
return A.element;
|
|
172
|
+
})), d = /* @__PURE__ */ new Set(), l = I(i.location.previous.dropTargets), c;
|
|
173
|
+
try {
|
|
174
|
+
for (l.s(); !(c = l.n()).done; ) {
|
|
175
|
+
var v, f = c.value;
|
|
176
|
+
d.add(f.element);
|
|
177
|
+
var n = a.get(f.element), y = s.has(f.element), u = E(E({}, i), {}, {
|
|
178
|
+
self: f
|
|
179
|
+
});
|
|
180
|
+
if (n == null || (v = n.onDropTargetChange) === null || v === void 0 || v.call(n, u), !y) {
|
|
181
|
+
var h;
|
|
182
|
+
n == null || (h = n.onDragLeave) === null || h === void 0 || h.call(n, u);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch (A) {
|
|
186
|
+
l.e(A);
|
|
187
|
+
} finally {
|
|
188
|
+
l.f();
|
|
189
|
+
}
|
|
190
|
+
var O = I(i.location.current.dropTargets), D;
|
|
191
|
+
try {
|
|
192
|
+
for (O.s(); !(D = O.n()).done; ) {
|
|
193
|
+
var m, j, P = D.value;
|
|
194
|
+
if (!d.has(P.element)) {
|
|
195
|
+
var K = E(E({}, i), {}, {
|
|
196
|
+
self: P
|
|
197
|
+
}), w = a.get(P.element);
|
|
198
|
+
w == null || (m = w.onDropTargetChange) === null || m === void 0 || m.call(w, K), w == null || (j = w.onDragEnter) === null || j === void 0 || j.call(w, K);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} catch (A) {
|
|
202
|
+
O.e(A);
|
|
203
|
+
} finally {
|
|
204
|
+
O.f();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
function W(r) {
|
|
209
|
+
R[r.eventName](r);
|
|
210
|
+
}
|
|
211
|
+
function G(r) {
|
|
212
|
+
var p = r.source, i = r.target, s = r.input, d = r.current, l = g({
|
|
213
|
+
source: p,
|
|
214
|
+
target: i,
|
|
215
|
+
input: s
|
|
216
|
+
});
|
|
217
|
+
if (l.length >= d.length)
|
|
218
|
+
return l;
|
|
219
|
+
for (var c = N(d), v = N(l), f = [], n = 0; n < c.length; n++) {
|
|
220
|
+
var y, u = c[n], h = v[n];
|
|
221
|
+
if (h != null) {
|
|
222
|
+
f.push(h);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
var O = f[n - 1], D = c[n - 1];
|
|
226
|
+
if ((O == null ? void 0 : O.element) !== (D == null ? void 0 : D.element))
|
|
227
|
+
break;
|
|
228
|
+
var m = a.get(u.element);
|
|
229
|
+
if (!m)
|
|
230
|
+
break;
|
|
231
|
+
var j = {
|
|
232
|
+
input: s,
|
|
233
|
+
source: p,
|
|
234
|
+
element: m.element
|
|
235
|
+
};
|
|
236
|
+
if (m.canDrop && !m.canDrop(j) || !((y = m.getIsSticky) !== null && y !== void 0 && y.call(m, j)))
|
|
237
|
+
break;
|
|
238
|
+
f.push(E(E({}, u), {}, {
|
|
239
|
+
// making it clear to consumers this drop target is active due to stickiness
|
|
240
|
+
isActiveDueToStickiness: !0
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
return N(f);
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
dropTargetForConsumers: C,
|
|
247
|
+
getIsOver: G,
|
|
248
|
+
dispatchEvent: W
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
export {
|
|
252
|
+
F as makeDropTarget
|
|
253
|
+
};
|
package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import O from "../../../../../@babel/runtime/helpers/esm/defineProperty.js";
|
|
2
|
+
import { once as h } from "../public-utils/once.js";
|
|
3
|
+
function j(e, t) {
|
|
4
|
+
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
5
|
+
if (!r) {
|
|
6
|
+
if (Array.isArray(e) || (r = w(e)) || t) {
|
|
7
|
+
r && (e = r);
|
|
8
|
+
var n = 0, f = function() {
|
|
9
|
+
};
|
|
10
|
+
return { s: f, n: function() {
|
|
11
|
+
return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
|
|
12
|
+
}, e: function(c) {
|
|
13
|
+
throw c;
|
|
14
|
+
}, f };
|
|
15
|
+
}
|
|
16
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
18
|
+
}
|
|
19
|
+
var o, a = !0, u = !1;
|
|
20
|
+
return { s: function() {
|
|
21
|
+
r = r.call(e);
|
|
22
|
+
}, n: function() {
|
|
23
|
+
var c = r.next();
|
|
24
|
+
return a = c.done, c;
|
|
25
|
+
}, e: function(c) {
|
|
26
|
+
u = !0, o = c;
|
|
27
|
+
}, f: function() {
|
|
28
|
+
try {
|
|
29
|
+
a || r.return == null || r.return();
|
|
30
|
+
} finally {
|
|
31
|
+
if (u) throw o;
|
|
32
|
+
}
|
|
33
|
+
} };
|
|
34
|
+
}
|
|
35
|
+
function w(e, t) {
|
|
36
|
+
if (e) {
|
|
37
|
+
if (typeof e == "string") return p(e, t);
|
|
38
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
39
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? p(e, t) : void 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function p(e, t) {
|
|
43
|
+
(t == null || t > e.length) && (t = e.length);
|
|
44
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
45
|
+
return n;
|
|
46
|
+
}
|
|
47
|
+
function d(e, t) {
|
|
48
|
+
var r = Object.keys(e);
|
|
49
|
+
if (Object.getOwnPropertySymbols) {
|
|
50
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
51
|
+
t && (n = n.filter(function(f) {
|
|
52
|
+
return Object.getOwnPropertyDescriptor(e, f).enumerable;
|
|
53
|
+
})), r.push.apply(r, n);
|
|
54
|
+
}
|
|
55
|
+
return r;
|
|
56
|
+
}
|
|
57
|
+
function A(e) {
|
|
58
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
59
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
60
|
+
t % 2 ? d(Object(r), !0).forEach(function(n) {
|
|
61
|
+
O(e, n, r[n]);
|
|
62
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : d(Object(r)).forEach(function(n) {
|
|
63
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return e;
|
|
67
|
+
}
|
|
68
|
+
function D() {
|
|
69
|
+
var e = /* @__PURE__ */ new Set(), t = null;
|
|
70
|
+
function r(o) {
|
|
71
|
+
t && (!o.canMonitor || o.canMonitor(t.canMonitorArgs)) && t.active.add(o);
|
|
72
|
+
}
|
|
73
|
+
function n(o) {
|
|
74
|
+
var a = A({}, o);
|
|
75
|
+
e.add(a), r(a);
|
|
76
|
+
function u() {
|
|
77
|
+
e.delete(a), t && t.active.delete(a);
|
|
78
|
+
}
|
|
79
|
+
return h(u);
|
|
80
|
+
}
|
|
81
|
+
function f(o) {
|
|
82
|
+
var a = o.eventName, u = o.payload;
|
|
83
|
+
if (a === "onGenerateDragPreview") {
|
|
84
|
+
t = {
|
|
85
|
+
canMonitorArgs: {
|
|
86
|
+
initial: u.location.initial,
|
|
87
|
+
source: u.source
|
|
88
|
+
},
|
|
89
|
+
active: /* @__PURE__ */ new Set()
|
|
90
|
+
};
|
|
91
|
+
var i = j(e), c;
|
|
92
|
+
try {
|
|
93
|
+
for (i.s(); !(c = i.n()).done; ) {
|
|
94
|
+
var b = c.value;
|
|
95
|
+
r(b);
|
|
96
|
+
}
|
|
97
|
+
} catch (m) {
|
|
98
|
+
i.e(m);
|
|
99
|
+
} finally {
|
|
100
|
+
i.f();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (t) {
|
|
104
|
+
for (var g = Array.from(t.active), l = 0, v = g; l < v.length; l++) {
|
|
105
|
+
var s = v[l];
|
|
106
|
+
if (t.active.has(s)) {
|
|
107
|
+
var y;
|
|
108
|
+
(y = s[a]) === null || y === void 0 || y.call(s, u);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
a === "onDrop" && (t.active.clear(), t = null);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
dispatchEvent: f,
|
|
116
|
+
monitorForConsumers: n
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
D as makeMonitor
|
|
121
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isAndroid as o } from "../../../util/android.js";
|
|
2
|
+
import { isSafariOnIOS as a } from "../../../util/is-safari-on-ios.js";
|
|
3
|
+
import { centerUnderPointer as c } from "./center-under-pointer.js";
|
|
4
|
+
function p(t) {
|
|
5
|
+
return function(e) {
|
|
6
|
+
var r = e.container;
|
|
7
|
+
if (a() || o())
|
|
8
|
+
return c({
|
|
9
|
+
container: r
|
|
10
|
+
});
|
|
11
|
+
Object.assign(r.style, {
|
|
12
|
+
borderInlineStart: "".concat(t.x, " solid transparent"),
|
|
13
|
+
borderTop: "".concat(t.y, " solid transparent")
|
|
14
|
+
});
|
|
15
|
+
var n = window.getComputedStyle(r);
|
|
16
|
+
if (n.direction === "rtl") {
|
|
17
|
+
var i = r.getBoundingClientRect();
|
|
18
|
+
return {
|
|
19
|
+
x: i.width,
|
|
20
|
+
y: 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
x: 0,
|
|
25
|
+
y: 0
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
p as pointerOutsideOfPreview
|
|
31
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { monitorForElements as v } from "../../../adapter/element-adapter.js";
|
|
2
|
+
import { isSafari as c } from "../../../util/is-safari.js";
|
|
3
|
+
import { maxZIndex as s } from "../../../util/max-z-index.js";
|
|
4
|
+
function l() {
|
|
5
|
+
return {
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function y(t) {
|
|
11
|
+
var d = t.render, n = t.nativeSetDragImage, r = t.getOffset, u = r === void 0 ? l : r, e = document.createElement("div");
|
|
12
|
+
Object.assign(e.style, {
|
|
13
|
+
// Ensuring we don't cause reflow when adding the element to the page
|
|
14
|
+
// Using `position:fixed` rather than `position:absolute` so we are
|
|
15
|
+
// positioned on the current viewport.
|
|
16
|
+
// `position:fixed` also creates a new stacking context, so we don't need to do that here
|
|
17
|
+
position: "fixed",
|
|
18
|
+
// According to `mdn`, the element can be offscreen:
|
|
19
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage#imgelement
|
|
20
|
+
//
|
|
21
|
+
// However, that information does not appear in the specs:
|
|
22
|
+
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage-dev
|
|
23
|
+
//
|
|
24
|
+
// If the element is _completely_ offscreen, Safari@17.1 will cancel the drag
|
|
25
|
+
top: 0,
|
|
26
|
+
left: 0,
|
|
27
|
+
// Using maximum possible z-index so that this element will always be on top
|
|
28
|
+
// https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index
|
|
29
|
+
// Did not use `layers` in `@atlaskit/theme` because:
|
|
30
|
+
// 1. This element is not a 'layer' in the conventional sense, as this element
|
|
31
|
+
// is only created for a single frame for the browser to take a photo of it,
|
|
32
|
+
// and then it is destroyed
|
|
33
|
+
// 2. Did not want to add a dependency onto `@atlaskit/theme`
|
|
34
|
+
// 3. Want to always be on top of product UI which might have higher z-index's
|
|
35
|
+
zIndex: s,
|
|
36
|
+
// Avoiding any additional events caused by the new element (being super safe)
|
|
37
|
+
pointerEvents: "none"
|
|
38
|
+
}), document.body.append(e);
|
|
39
|
+
var o = d({
|
|
40
|
+
container: e
|
|
41
|
+
});
|
|
42
|
+
queueMicrotask(function() {
|
|
43
|
+
var a = u({
|
|
44
|
+
container: e
|
|
45
|
+
});
|
|
46
|
+
if (c()) {
|
|
47
|
+
var f = e.getBoundingClientRect();
|
|
48
|
+
if (f.width === 0)
|
|
49
|
+
return;
|
|
50
|
+
e.style.left = "-".concat(f.width - 1e-4, "px");
|
|
51
|
+
}
|
|
52
|
+
n == null || n(e, a.x, a.y);
|
|
53
|
+
});
|
|
54
|
+
function i() {
|
|
55
|
+
m(), o == null || o(), document.body.removeChild(e);
|
|
56
|
+
}
|
|
57
|
+
var m = v({
|
|
58
|
+
// Remove portal in the dragstart event so that the user will never see it
|
|
59
|
+
onDragStart: i,
|
|
60
|
+
// Backup: remove portal when the drop finishes (this would be an error case)
|
|
61
|
+
onDrop: i
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
y as setCustomNativeDragPreview
|
|
66
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function l(a) {
|
|
2
|
+
var n = null;
|
|
3
|
+
return function() {
|
|
4
|
+
if (!n) {
|
|
5
|
+
for (var t = arguments.length, u = new Array(t), r = 0; r < t; r++)
|
|
6
|
+
u[r] = arguments[r];
|
|
7
|
+
var e = a.apply(this, u);
|
|
8
|
+
n = {
|
|
9
|
+
result: e
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return n.result;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
l as once
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import a from "../../../../../@babel/runtime/helpers/esm/slicedToArray.js";
|
|
2
|
+
function c(r) {
|
|
3
|
+
var i = r.list, s = r.startIndex, t = r.finishIndex;
|
|
4
|
+
if (s === -1 || t === -1)
|
|
5
|
+
return Array.from(i);
|
|
6
|
+
var e = Array.from(i), l = e.splice(s, 1), n = a(l, 1), o = n[0];
|
|
7
|
+
return e.splice(t, 0, o), e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
c as reorder
|
|
11
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { d } from "../../../../../../../_virtual/index.js";
|
|
2
|
+
import { isSafari as a } from "../is-safari.js";
|
|
3
|
+
var i = {
|
|
4
|
+
isLeavingWindow: Symbol("leaving"),
|
|
5
|
+
isEnteringWindow: Symbol("entering")
|
|
6
|
+
};
|
|
7
|
+
function l(r) {
|
|
8
|
+
var n = r.dragLeave;
|
|
9
|
+
return a() ? n.hasOwnProperty(i.isLeavingWindow) : !1;
|
|
10
|
+
}
|
|
11
|
+
(function() {
|
|
12
|
+
if (typeof window > "u" || process.env.NODE_ENV === "test" || !a())
|
|
13
|
+
return;
|
|
14
|
+
function n() {
|
|
15
|
+
return {
|
|
16
|
+
enterCount: 0,
|
|
17
|
+
isOverWindow: !1
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var e = n();
|
|
21
|
+
function o() {
|
|
22
|
+
e = n();
|
|
23
|
+
}
|
|
24
|
+
d.bindAll(
|
|
25
|
+
window,
|
|
26
|
+
[{
|
|
27
|
+
type: "dragstart",
|
|
28
|
+
listener: function() {
|
|
29
|
+
e.enterCount = 0, e.isOverWindow = !0;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
type: "drop",
|
|
33
|
+
listener: o
|
|
34
|
+
}, {
|
|
35
|
+
type: "dragend",
|
|
36
|
+
listener: o
|
|
37
|
+
}, {
|
|
38
|
+
type: "dragenter",
|
|
39
|
+
listener: function(t) {
|
|
40
|
+
!e.isOverWindow && e.enterCount === 0 && (t[i.isEnteringWindow] = !0), e.isOverWindow = !0, e.enterCount++;
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
type: "dragleave",
|
|
44
|
+
listener: function(t) {
|
|
45
|
+
e.enterCount--, e.isOverWindow && e.enterCount === 0 && (t[i.isLeavingWindow] = !0, e.isOverWindow = !1);
|
|
46
|
+
}
|
|
47
|
+
}],
|
|
48
|
+
// using `capture: true` so that adding event listeners
|
|
49
|
+
// in bubble phase will have the correct symbols
|
|
50
|
+
{
|
|
51
|
+
capture: !0
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
})();
|
|
55
|
+
export {
|
|
56
|
+
l as isLeavingWindowInSafari
|
|
57
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isFirefox as t } from "../is-firefox.js";
|
|
2
|
+
import { isSafari as n } from "../is-safari.js";
|
|
3
|
+
import { isLeavingWindowInSafari as o } from "./count-events-for-safari.js";
|
|
4
|
+
import { isFromAnotherWindow as f } from "./is-from-another-window.js";
|
|
5
|
+
function v(a) {
|
|
6
|
+
var r = a.dragLeave, i = r.type, e = r.relatedTarget;
|
|
7
|
+
return i !== "dragleave" ? !1 : n() ? o({
|
|
8
|
+
dragLeave: r
|
|
9
|
+
}) : e == null ? !0 : t() ? f(e) : e instanceof HTMLIFrameElement;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
v as isLeavingWindow
|
|
13
|
+
};
|
package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
var n = e.onDragEnd;
|
|
3
|
+
return [
|
|
4
|
+
// ## Detecting drag ending for removed draggables
|
|
5
|
+
//
|
|
6
|
+
// If a draggable element is removed during a drag and the user drops:
|
|
7
|
+
// 1. if over a valid drop target: we get a "drop" event to know the drag is finished
|
|
8
|
+
// 2. if not over a valid drop target (or cancelled): we get nothing
|
|
9
|
+
// The "dragend" event will not fire on the source draggable if it has been
|
|
10
|
+
// removed from the DOM.
|
|
11
|
+
// So we need to figure out if a drag operation has finished by looking at other events
|
|
12
|
+
// We can do this by looking at other events
|
|
13
|
+
// ### First detection: "pointermove" events
|
|
14
|
+
// 1. "pointermove" events cannot fire during a drag and drop operation
|
|
15
|
+
// according to the spec. So if we get a "pointermove" it means that
|
|
16
|
+
// the drag and drop operations has finished. So if we get a "pointermove"
|
|
17
|
+
// we know that the drag is over
|
|
18
|
+
// 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
|
|
19
|
+
// other pointer events. However, firefox will allow a few
|
|
20
|
+
// pointer event to get through after a drag starts.
|
|
21
|
+
// The most I've seen is 3
|
|
22
|
+
{
|
|
23
|
+
type: "pointermove",
|
|
24
|
+
listener: /* @__PURE__ */ function() {
|
|
25
|
+
var r = 0;
|
|
26
|
+
return function() {
|
|
27
|
+
if (r < 20) {
|
|
28
|
+
r++;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
n();
|
|
32
|
+
};
|
|
33
|
+
}()
|
|
34
|
+
},
|
|
35
|
+
// ### Second detection: "pointerdown" events
|
|
36
|
+
// If we receive this event then we know that a drag operation has finished
|
|
37
|
+
// and potentially another one is about to start.
|
|
38
|
+
// Note: `pointerdown` fires on all browsers / platforms before "dragstart"
|
|
39
|
+
{
|
|
40
|
+
type: "pointerdown",
|
|
41
|
+
listener: n
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
o as getBindingsForBrokenDrags
|
|
47
|
+
};
|