@luzmo/analytics-components-kit 1.0.1-alpha.39 → 1.0.1-alpha.40

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.
Files changed (57) hide show
  1. package/components/bliss-DQej6Odb.cjs +20 -0
  2. package/components/bliss-Da17RL_E.js +80 -0
  3. package/components/classic-CW66MgMj.cjs +20 -0
  4. package/components/classic-DSp70wnP.js +86 -0
  5. package/components/classic-dark-DCtf8kpl.cjs +20 -0
  6. package/components/classic-dark-o89nk6Bo.js +77 -0
  7. package/components/default-DBxqR7y5.js +84 -0
  8. package/components/default-DcRD5JRU.cjs +20 -0
  9. package/components/default-dark-1299UcUs.cjs +20 -0
  10. package/components/default-dark-IedybpaJ.js +84 -0
  11. package/components/draggable-data-item-level/index.cjs +1 -1
  12. package/components/draggable-data-item-level/index.js +1 -1
  13. package/components/droppable-slot/index.cjs +1 -1
  14. package/components/droppable-slot/index.js +1 -1
  15. package/components/filter-item/index.cjs +1 -1
  16. package/components/filter-item/index.js +1 -1
  17. package/components/filter-value-picker-hierarchy/index.cjs +1 -1
  18. package/components/filter-value-picker-hierarchy/index.js +1 -2
  19. package/components/filter-value-picker-numeric/index.cjs +1 -1
  20. package/components/filter-value-picker-numeric/index.js +1 -1
  21. package/components/grid/grid.d.ts +5 -1
  22. package/components/grid/index.cjs +46 -45
  23. package/components/grid/index.js +1217 -1193
  24. package/components/index.cjs +1 -1
  25. package/components/index.js +7 -6
  26. package/components/orion-CfUR1e5D.cjs +20 -0
  27. package/components/orion-DiAhsMdg.js +74 -0
  28. package/components/pinky-Cb0md2xU.js +72 -0
  29. package/components/pinky-DptTgIM4.cjs +20 -0
  30. package/components/radiant-C6fqp6jv.js +75 -0
  31. package/components/radiant-Dv7GVveL.cjs +20 -0
  32. package/components/royale-CmXiODck.js +66 -0
  33. package/components/royale-Ooq8M7Ef.cjs +20 -0
  34. package/components/seasonal-9pbLR3XJ.js +80 -0
  35. package/components/seasonal-OSKpFyta.cjs +20 -0
  36. package/components/slot-menu-list/index.cjs +1 -1
  37. package/components/slot-menu-list/index.js +3 -3
  38. package/components/urban-BLQl5Oye.cjs +20 -0
  39. package/components/urban-CZ4PAlar.js +77 -0
  40. package/components/utils-B1rr30GZ.js +60 -0
  41. package/components/utils-CvCeHVBQ.cjs +20 -0
  42. package/components/utils.cjs +1 -1
  43. package/components/utils.js +9 -8
  44. package/components/vivid-B-cgSae_.js +76 -0
  45. package/components/vivid-BpRn83MR.cjs +20 -0
  46. package/item-definitions/marker-map/marker-map-options.config.d.ts +1 -1
  47. package/package.json +1 -1
  48. package/utils/index.d.ts +1 -1
  49. package/utils/themes/index.d.ts +3 -508
  50. package/utils/themes/utils.d.ts +1 -0
  51. package/components/get-css-variable-BEYG097C.js +0 -1446
  52. package/components/get-css-variable-BZxY4IOa.cjs +0 -35
  53. package/components/grid/default-actions.d.ts +0 -14
  54. package/components/index-CcLRp9ao.js +0 -1685
  55. package/components/index-CpGRysX_.js +0 -691
  56. package/components/index-DFHExzGq.cjs +0 -20
  57. package/components/index-GgkqKtE6.cjs +0 -20
@@ -1,1446 +0,0 @@
1
- /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
- *
3
- * Copyright © 2025 Luzmo
4
- * All rights reserved.
5
- * Luzmo web components (“Luzmo Web Components”)
6
- * must be used according to the Luzmo Terms of Service.
7
- * This license allows users with a current active Luzmo account
8
- * to use the Luzmo Web Components. This license terminates
9
- * automatically if a user no longer has an active Luzmo account.
10
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
11
- *
12
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
- * SOFTWARE.
19
- * */
20
- function Pe(e) {
21
- if (Array.isArray(e)) return e;
22
- }
23
- function je(e, r) {
24
- var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
25
- if (t != null) {
26
- var n, o, a, i, l = [], u = !0, c = !1;
27
- try {
28
- if (a = (t = t.call(e)).next, r !== 0) for (; !(u = (n = a.call(t)).done) && (l.push(n.value), l.length !== r); u = !0) ;
29
- } catch (f) {
30
- c = !0, o = f;
31
- } finally {
32
- try {
33
- if (!u && t.return != null && (i = t.return(), Object(i) !== i)) return;
34
- } finally {
35
- if (c) throw o;
36
- }
37
- }
38
- return l;
39
- }
40
- }
41
- function V(e, r) {
42
- (r == null || r > e.length) && (r = e.length);
43
- for (var t = 0, n = Array(r); t < r; t++) n[t] = e[t];
44
- return n;
45
- }
46
- function be(e, r) {
47
- if (e) {
48
- if (typeof e == "string") return V(e, r);
49
- var t = {}.toString.call(e).slice(8, -1);
50
- 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) ? V(e, r) : void 0;
51
- }
52
- }
53
- function Ie() {
54
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
55
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
56
- }
57
- function he(e, r) {
58
- return Pe(e) || je(e, r) || be(e, r) || Ie();
59
- }
60
- var B = {}, k = {}, ne;
61
- function we() {
62
- if (ne) return k;
63
- ne = 1, Object.defineProperty(k, "__esModule", { value: !0 }), k.bind = void 0;
64
- function e(r, t) {
65
- var n = t.type, o = t.listener, a = t.options;
66
- return r.addEventListener(n, o, a), function() {
67
- r.removeEventListener(n, o, a);
68
- };
69
- }
70
- return k.bind = e, k;
71
- }
72
- var F = {}, ae;
73
- function xe() {
74
- if (ae) return F;
75
- ae = 1;
76
- var e = F && F.__assign || function() {
77
- return e = Object.assign || function(a) {
78
- for (var i, l = 1, u = arguments.length; l < u; l++) {
79
- i = arguments[l];
80
- for (var c in i) Object.prototype.hasOwnProperty.call(i, c) && (a[c] = i[c]);
81
- }
82
- return a;
83
- }, e.apply(this, arguments);
84
- };
85
- Object.defineProperty(F, "__esModule", { value: !0 }), F.bindAll = void 0;
86
- var r = /* @__PURE__ */ we();
87
- function t(a) {
88
- if (!(typeof a > "u"))
89
- return typeof a == "boolean" ? {
90
- capture: a
91
- } : a;
92
- }
93
- function n(a, i) {
94
- if (i == null)
95
- return a;
96
- var l = e(e({}, a), { options: e(e({}, t(i)), t(a.options)) });
97
- return l;
98
- }
99
- function o(a, i, l) {
100
- var u = i.map(function(c) {
101
- var f = n(c, l);
102
- return (0, r.bind)(a, f);
103
- });
104
- return function() {
105
- u.forEach(function(f) {
106
- return f();
107
- });
108
- };
109
- }
110
- return F.bindAll = o, F;
111
- }
112
- var oe;
113
- function Ce() {
114
- return oe || (oe = 1, function(e) {
115
- Object.defineProperty(e, "__esModule", { value: !0 }), e.bindAll = e.bind = void 0;
116
- var r = /* @__PURE__ */ we();
117
- Object.defineProperty(e, "bind", { enumerable: !0, get: function() {
118
- return r.bind;
119
- } });
120
- var t = /* @__PURE__ */ xe();
121
- Object.defineProperty(e, "bindAll", { enumerable: !0, get: function() {
122
- return t.bindAll;
123
- } });
124
- }(B)), B;
125
- }
126
- var K = /* @__PURE__ */ Ce();
127
- function N(e) {
128
- "@babel/helpers - typeof";
129
- return N = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
130
- return typeof r;
131
- } : function(r) {
132
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
133
- }, N(e);
134
- }
135
- function He(e, r) {
136
- if (N(e) != "object" || !e) return e;
137
- var t = e[Symbol.toPrimitive];
138
- if (t !== void 0) {
139
- var n = t.call(e, r);
140
- if (N(n) != "object") return n;
141
- throw new TypeError("@@toPrimitive must return a primitive value.");
142
- }
143
- return (r === "string" ? String : Number)(e);
144
- }
145
- function Fe(e) {
146
- var r = He(e, "string");
147
- return N(r) == "symbol" ? r : r + "";
148
- }
149
- function _(e, r, t) {
150
- return (r = Fe(r)) in e ? Object.defineProperty(e, r, {
151
- value: t,
152
- enumerable: !0,
153
- configurable: !0,
154
- writable: !0
155
- }) : e[r] = t, e;
156
- }
157
- var De = 2147483647, Oe = "data-pdnd-honey-pot";
158
- function ie(e, r) {
159
- var t = Object.keys(e);
160
- if (Object.getOwnPropertySymbols) {
161
- var n = Object.getOwnPropertySymbols(e);
162
- r && (n = n.filter(function(o) {
163
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
164
- })), t.push.apply(t, n);
165
- }
166
- return t;
167
- }
168
- function ue(e) {
169
- for (var r = 1; r < arguments.length; r++) {
170
- var t = arguments[r] != null ? arguments[r] : {};
171
- r % 2 ? ie(Object(t), !0).forEach(function(n) {
172
- _(e, n, t[n]);
173
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ie(Object(t)).forEach(function(n) {
174
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
175
- });
176
- }
177
- return e;
178
- }
179
- var $ = 2, le = $ / 2;
180
- function Me(e) {
181
- return {
182
- x: Math.floor(e.x),
183
- y: Math.floor(e.y)
184
- };
185
- }
186
- function Ke(e) {
187
- return {
188
- x: e.x - le,
189
- y: e.y - le
190
- };
191
- }
192
- function Re(e) {
193
- return {
194
- x: Math.max(e.x, 0),
195
- y: Math.max(e.y, 0)
196
- };
197
- }
198
- function We(e) {
199
- return {
200
- x: Math.min(e.x, window.innerWidth - $),
201
- y: Math.min(e.y, window.innerHeight - $)
202
- };
203
- }
204
- function ce(e) {
205
- var r = e.client, t = We(Re(Ke(Me(r))));
206
- return DOMRect.fromRect({
207
- x: t.x,
208
- y: t.y,
209
- width: $,
210
- height: $
211
- });
212
- }
213
- function de(e) {
214
- var r = e.clientRect;
215
- return {
216
- left: "".concat(r.left, "px"),
217
- top: "".concat(r.top, "px"),
218
- width: "".concat(r.width, "px"),
219
- height: "".concat(r.height, "px")
220
- };
221
- }
222
- function ke(e) {
223
- var r = e.client, t = e.clientRect;
224
- return (
225
- // is within horizontal bounds
226
- r.x >= t.x && r.x <= t.x + t.width && // is within vertical bounds
227
- r.y >= t.y && r.y <= t.y + t.height
228
- );
229
- }
230
- function Le(e) {
231
- var r = e.initial, t = document.createElement("div");
232
- t.setAttribute(Oe, "true");
233
- var n = ce({
234
- client: r
235
- });
236
- Object.assign(t.style, ue(ue({
237
- // Setting a background color explicitly to avoid any inherited styles.
238
- // Looks like this could be `opacity: 0`, but worried that _might_
239
- // cause the element to be ignored on some platforms.
240
- // When debugging, set backgroundColor to something like "red".
241
- backgroundColor: "transparent",
242
- position: "fixed",
243
- // Being explicit to avoid inheriting styles
244
- padding: 0,
245
- margin: 0,
246
- boxSizing: "border-box"
247
- }, de({
248
- clientRect: n
249
- })), {}, {
250
- // We want this element to absorb pointer events,
251
- // it's kind of the whole point 😉
252
- pointerEvents: "auto",
253
- // Want to make sure the honey pot is top of everything else.
254
- // Don't need to worry about native drag previews, as they will
255
- // have been rendered (and removed) before the honey pot is rendered
256
- zIndex: De
257
- })), document.body.appendChild(t);
258
- var o = K.bind(window, {
259
- type: "pointermove",
260
- listener: function(i) {
261
- var l = {
262
- x: i.clientX,
263
- y: i.clientY
264
- };
265
- n = ce({
266
- client: l
267
- }), Object.assign(t.style, de({
268
- clientRect: n
269
- }));
270
- },
271
- // using capture so we are less likely to be impacted by event stopping
272
- options: {
273
- capture: !0
274
- }
275
- });
276
- return function(i) {
277
- var l = i.current;
278
- if (o(), ke({
279
- client: l,
280
- clientRect: n
281
- })) {
282
- t.remove();
283
- return;
284
- }
285
- function u() {
286
- c(), t.remove();
287
- }
288
- var c = K.bindAll(window, [
289
- {
290
- type: "pointerdown",
291
- listener: u
292
- },
293
- {
294
- type: "pointermove",
295
- listener: u
296
- },
297
- {
298
- type: "focusin",
299
- listener: u
300
- },
301
- {
302
- type: "focusout",
303
- listener: u
304
- },
305
- // a 'pointerdown' should happen before 'dragstart', but just being super safe
306
- {
307
- type: "dragstart",
308
- listener: u
309
- },
310
- // if the user has dragged something out of the window
311
- // and then is dragging something back into the window
312
- // the first events we will see are "dragenter" (and then "dragover").
313
- // So if we see any of these we need to clear the post drag fix.
314
- {
315
- type: "dragenter",
316
- listener: u
317
- },
318
- {
319
- type: "dragover",
320
- listener: u
321
- }
322
- // Not adding a "wheel" event listener, as "wheel" by itself does not
323
- // resolve the bug.
324
- ], {
325
- // Using `capture` so less likely to be impacted by other code stopping events
326
- capture: !0
327
- });
328
- };
329
- }
330
- function Ne() {
331
- var e = null;
332
- function r() {
333
- return e = null, K.bind(window, {
334
- type: "pointermove",
335
- listener: function(o) {
336
- e = {
337
- x: o.clientX,
338
- y: o.clientY
339
- };
340
- },
341
- // listening for pointer move in capture phase
342
- // so we are less likely to be impacted by events being stopped.
343
- options: {
344
- capture: !0
345
- }
346
- });
347
- }
348
- function t() {
349
- var n = null;
350
- return function(a) {
351
- var i = a.eventName, l = a.payload;
352
- if (i === "onDragStart") {
353
- var u, c = l.location.initial.input, f = (u = e) !== null && u !== void 0 ? u : {
354
- x: c.clientX,
355
- y: c.clientY
356
- };
357
- n = Le({
358
- initial: f
359
- });
360
- }
361
- if (i === "onDrop") {
362
- var v, p = l.location.current.input;
363
- (v = n) === null || v === void 0 || v({
364
- current: {
365
- x: p.clientX,
366
- y: p.clientY
367
- }
368
- }), n = null, e = null;
369
- }
370
- };
371
- }
372
- return {
373
- bindEvents: r,
374
- getOnPostDispatch: t
375
- };
376
- }
377
- function $e(e) {
378
- if (Array.isArray(e)) return V(e);
379
- }
380
- function Ue(e) {
381
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
382
- }
383
- function Ye() {
384
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
385
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
386
- }
387
- function Te(e) {
388
- return $e(e) || Ue(e) || be(e) || Ye();
389
- }
390
- function Se(e) {
391
- return e instanceof Element && e.hasAttribute(Oe);
392
- }
393
- function Be(e) {
394
- var r = document.elementsFromPoint(e.x, e.y), t = he(r, 2), n = t[0], o = t[1];
395
- return n ? Se(n) ? o ?? null : n : null;
396
- }
397
- function ee(e) {
398
- var r = null;
399
- return function() {
400
- if (!r) {
401
- for (var n = arguments.length, o = new Array(n), a = 0; a < n; a++)
402
- o[a] = arguments[a];
403
- var i = e.apply(this, o);
404
- r = {
405
- result: i
406
- };
407
- }
408
- return r.result;
409
- };
410
- }
411
- var Xe = ee(function() {
412
- return navigator.userAgent.includes("Firefox");
413
- }), Y = ee(function() {
414
- var r = navigator, t = r.userAgent;
415
- return t.includes("AppleWebKit") && !t.includes("Chrome");
416
- }), Z = {
417
- isLeavingWindow: Symbol("leaving"),
418
- isEnteringWindow: Symbol("entering")
419
- };
420
- function qe(e) {
421
- var r = e.dragLeave;
422
- return Y() ? r.hasOwnProperty(Z.isLeavingWindow) : !1;
423
- }
424
- (function() {
425
- if (typeof window > "u" || !Y())
426
- return;
427
- function r() {
428
- return {
429
- enterCount: 0,
430
- isOverWindow: !1
431
- };
432
- }
433
- var t = r();
434
- function n() {
435
- t = r();
436
- }
437
- K.bindAll(
438
- window,
439
- [{
440
- type: "dragstart",
441
- listener: function() {
442
- t.enterCount = 0, t.isOverWindow = !0;
443
- }
444
- }, {
445
- type: "drop",
446
- listener: n
447
- }, {
448
- type: "dragend",
449
- listener: n
450
- }, {
451
- type: "dragenter",
452
- listener: function(a) {
453
- !t.isOverWindow && t.enterCount === 0 && (a[Z.isEnteringWindow] = !0), t.isOverWindow = !0, t.enterCount++;
454
- }
455
- }, {
456
- type: "dragleave",
457
- listener: function(a) {
458
- t.enterCount--, t.isOverWindow && t.enterCount === 0 && (a[Z.isLeavingWindow] = !0, t.isOverWindow = !1);
459
- }
460
- }],
461
- // using `capture: true` so that adding event listeners
462
- // in bubble phase will have the correct symbols
463
- {
464
- capture: !0
465
- }
466
- );
467
- })();
468
- function ze(e) {
469
- return "nodeName" in e;
470
- }
471
- function Ge(e) {
472
- return ze(e) && e.ownerDocument !== document;
473
- }
474
- function Ve(e) {
475
- var r = e.dragLeave, t = r.type, n = r.relatedTarget;
476
- return t !== "dragleave" ? !1 : Y() ? qe({
477
- dragLeave: r
478
- }) : n == null ? !0 : Xe() ? Ge(n) : n instanceof HTMLIFrameElement;
479
- }
480
- function Ze(e) {
481
- var r = e.onDragEnd;
482
- return [
483
- // ## Detecting drag ending for removed draggables
484
- //
485
- // If a draggable element is removed during a drag and the user drops:
486
- // 1. if over a valid drop target: we get a "drop" event to know the drag is finished
487
- // 2. if not over a valid drop target (or cancelled): we get nothing
488
- // The "dragend" event will not fire on the source draggable if it has been
489
- // removed from the DOM.
490
- // So we need to figure out if a drag operation has finished by looking at other events
491
- // We can do this by looking at other events
492
- // ### First detection: "pointermove" events
493
- // 1. "pointermove" events cannot fire during a drag and drop operation
494
- // according to the spec. So if we get a "pointermove" it means that
495
- // the drag and drop operations has finished. So if we get a "pointermove"
496
- // we know that the drag is over
497
- // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
498
- // other pointer events. However, firefox will allow a few
499
- // pointer event to get through after a drag starts.
500
- // The most I've seen is 3
501
- {
502
- type: "pointermove",
503
- listener: /* @__PURE__ */ function() {
504
- var t = 0;
505
- return function() {
506
- if (t < 20) {
507
- t++;
508
- return;
509
- }
510
- r();
511
- };
512
- }()
513
- },
514
- // ### Second detection: "pointerdown" events
515
- // If we receive this event then we know that a drag operation has finished
516
- // and potentially another one is about to start.
517
- // Note: `pointerdown` fires on all browsers / platforms before "dragstart"
518
- {
519
- type: "pointerdown",
520
- listener: r
521
- }
522
- ];
523
- }
524
- function L(e) {
525
- return {
526
- altKey: e.altKey,
527
- button: e.button,
528
- buttons: e.buttons,
529
- ctrlKey: e.ctrlKey,
530
- metaKey: e.metaKey,
531
- shiftKey: e.shiftKey,
532
- clientX: e.clientX,
533
- clientY: e.clientY,
534
- pageX: e.pageX,
535
- pageY: e.pageY
536
- };
537
- }
538
- var Je = function(r) {
539
- var t = [], n = null, o = function() {
540
- for (var i = arguments.length, l = new Array(i), u = 0; u < i; u++)
541
- l[u] = arguments[u];
542
- t = l, !n && (n = requestAnimationFrame(function() {
543
- n = null, r.apply(void 0, t);
544
- }));
545
- };
546
- return o.cancel = function() {
547
- n && (cancelAnimationFrame(n), n = null);
548
- }, o;
549
- }, X = Je(function(e) {
550
- return e();
551
- }), U = /* @__PURE__ */ function() {
552
- var e = null;
553
- function r(n) {
554
- var o = requestAnimationFrame(function() {
555
- e = null, n();
556
- });
557
- e = {
558
- frameId: o,
559
- fn: n
560
- };
561
- }
562
- function t() {
563
- e && (cancelAnimationFrame(e.frameId), e.fn(), e = null);
564
- }
565
- return {
566
- schedule: r,
567
- flush: t
568
- };
569
- }();
570
- function Qe(e) {
571
- var r = e.source, t = e.initial, n = e.dispatchEvent, o = {
572
- dropTargets: []
573
- };
574
- function a(l) {
575
- n(l), o = {
576
- dropTargets: l.payload.location.current.dropTargets
577
- };
578
- }
579
- var i = {
580
- start: function(u) {
581
- var c = u.nativeSetDragImage, f = {
582
- current: t,
583
- previous: o,
584
- initial: t
585
- };
586
- a({
587
- eventName: "onGenerateDragPreview",
588
- payload: {
589
- source: r,
590
- location: f,
591
- nativeSetDragImage: c
592
- }
593
- }), U.schedule(function() {
594
- a({
595
- eventName: "onDragStart",
596
- payload: {
597
- source: r,
598
- location: f
599
- }
600
- });
601
- });
602
- },
603
- dragUpdate: function(u) {
604
- var c = u.current;
605
- U.flush(), X.cancel(), a({
606
- eventName: "onDropTargetChange",
607
- payload: {
608
- source: r,
609
- location: {
610
- initial: t,
611
- previous: o,
612
- current: c
613
- }
614
- }
615
- });
616
- },
617
- drag: function(u) {
618
- var c = u.current;
619
- X(function() {
620
- U.flush();
621
- var f = {
622
- initial: t,
623
- previous: o,
624
- current: c
625
- };
626
- a({
627
- eventName: "onDrag",
628
- payload: {
629
- source: r,
630
- location: f
631
- }
632
- });
633
- });
634
- },
635
- drop: function(u) {
636
- var c = u.current, f = u.updatedSourcePayload;
637
- U.flush(), X.cancel(), a({
638
- eventName: "onDrop",
639
- payload: {
640
- source: f ?? r,
641
- location: {
642
- current: c,
643
- previous: o,
644
- initial: t
645
- }
646
- }
647
- });
648
- }
649
- };
650
- return i;
651
- }
652
- var J = {
653
- isActive: !1
654
- };
655
- function Ae() {
656
- return !J.isActive;
657
- }
658
- function _e(e) {
659
- return e.dataTransfer ? e.dataTransfer.setDragImage.bind(e.dataTransfer) : null;
660
- }
661
- function et(e) {
662
- var r = e.current, t = e.next;
663
- if (r.length !== t.length)
664
- return !0;
665
- for (var n = 0; n < r.length; n++)
666
- if (r[n].element !== t[n].element)
667
- return !0;
668
- return !1;
669
- }
670
- function tt(e) {
671
- var r = e.event, t = e.dragType, n = e.getDropTargetsOver, o = e.dispatchEvent;
672
- if (!Ae())
673
- return;
674
- var a = rt({
675
- event: r,
676
- dragType: t,
677
- getDropTargetsOver: n
678
- });
679
- J.isActive = !0;
680
- var i = {
681
- current: a
682
- };
683
- q({
684
- event: r,
685
- current: a.dropTargets
686
- });
687
- var l = Qe({
688
- source: t.payload,
689
- dispatchEvent: o,
690
- initial: a
691
- });
692
- function u(d) {
693
- var s = et({
694
- current: i.current.dropTargets,
695
- next: d.dropTargets
696
- });
697
- i.current = d, s && l.dragUpdate({
698
- current: i.current
699
- });
700
- }
701
- function c(d) {
702
- var s = L(d), g = Se(d.target) ? Be({
703
- x: s.clientX,
704
- y: s.clientY
705
- }) : d.target, y = n({
706
- target: g,
707
- event: d,
708
- input: s,
709
- source: t.payload,
710
- current: i.current.dropTargets
711
- });
712
- y.length && (d.preventDefault(), q({
713
- event: d,
714
- current: y
715
- })), u({
716
- dropTargets: y,
717
- input: s
718
- });
719
- }
720
- function f() {
721
- i.current.dropTargets.length && u({
722
- dropTargets: [],
723
- input: i.current.input
724
- }), l.drop({
725
- current: i.current,
726
- updatedSourcePayload: null
727
- }), v();
728
- }
729
- function v() {
730
- J.isActive = !1, p();
731
- }
732
- var p = K.bindAll(
733
- window,
734
- [{
735
- // 👋 Note: we are repurposing the `dragover` event as our `drag` event
736
- // this is because firefox does not publish pointer coordinates during
737
- // a `drag` event, but does for every other type of drag event
738
- // `dragover` fires on all elements that are being dragged over
739
- // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
740
- // 🦊😤
741
- type: "dragover",
742
- listener: function(s) {
743
- c(s), l.drag({
744
- current: i.current
745
- });
746
- }
747
- }, {
748
- type: "dragenter",
749
- listener: c
750
- }, {
751
- type: "dragleave",
752
- listener: function(s) {
753
- Ve({
754
- dragLeave: s
755
- }) && (u({
756
- input: i.current.input,
757
- dropTargets: []
758
- }), t.startedFrom === "external" && f());
759
- }
760
- }, {
761
- // A "drop" can only happen if the browser allowed the drop
762
- type: "drop",
763
- listener: function(s) {
764
- if (i.current = {
765
- dropTargets: i.current.dropTargets,
766
- input: L(s)
767
- }, !i.current.dropTargets.length) {
768
- f();
769
- return;
770
- }
771
- s.preventDefault(), q({
772
- event: s,
773
- current: i.current.dropTargets
774
- }), l.drop({
775
- current: i.current,
776
- // When dropping something native, we need to extract the latest
777
- // `.items` from the "drop" event as it is now accessible
778
- updatedSourcePayload: t.type === "external" ? t.getDropPayload(s) : null
779
- }), v();
780
- }
781
- }, {
782
- // "dragend" fires when on the drag source (eg a draggable element)
783
- // when the drag is finished.
784
- // "dragend" will fire after "drop" (if there was a successful drop)
785
- // "dragend" does not fire if the draggable source has been removed during the drag
786
- // or for external drag sources (eg files)
787
- // This "dragend" listener will not fire if there was a successful drop
788
- // as we will have already removed the event listener
789
- type: "dragend",
790
- listener: function(s) {
791
- i.current = {
792
- dropTargets: i.current.dropTargets,
793
- input: L(s)
794
- }, f();
795
- }
796
- }].concat(Te(Ze({
797
- onDragEnd: f
798
- }))),
799
- // Once we have started a managed drag operation it is important that we see / own all drag events
800
- // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
801
- // all "drop" events in the bubble phase on the `document.body`.
802
- // This meant that we never saw the "drop" event.
803
- {
804
- capture: !0
805
- }
806
- );
807
- l.start({
808
- nativeSetDragImage: _e(r)
809
- });
810
- }
811
- function q(e) {
812
- var r, t = e.event, n = e.current, o = (r = n[0]) === null || r === void 0 ? void 0 : r.dropEffect;
813
- o != null && t.dataTransfer && (t.dataTransfer.dropEffect = o);
814
- }
815
- function rt(e) {
816
- var r = e.event, t = e.dragType, n = e.getDropTargetsOver, o = L(r);
817
- if (t.startedFrom === "external")
818
- return {
819
- input: o,
820
- dropTargets: []
821
- };
822
- var a = n({
823
- input: o,
824
- source: t.payload,
825
- target: r.target,
826
- event: r,
827
- current: []
828
- });
829
- return {
830
- input: o,
831
- dropTargets: a
832
- };
833
- }
834
- var se = {
835
- canStart: Ae,
836
- start: tt
837
- }, Q = /* @__PURE__ */ new Map();
838
- function nt(e) {
839
- var r = e.typeKey, t = e.mount, n = Q.get(r);
840
- if (n)
841
- return n.usageCount++, n;
842
- var o = {
843
- typeKey: r,
844
- unmount: t(),
845
- usageCount: 1
846
- };
847
- return Q.set(r, o), o;
848
- }
849
- function at(e) {
850
- var r = nt(e);
851
- return function() {
852
- r.usageCount--, !(r.usageCount > 0) && (r.unmount(), Q.delete(e.typeKey));
853
- };
854
- }
855
- function te() {
856
- for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++)
857
- r[t] = arguments[t];
858
- return function() {
859
- r.forEach(function(o) {
860
- return o();
861
- });
862
- };
863
- }
864
- function Ee(e, r) {
865
- var t = r.attribute, n = r.value;
866
- return e.setAttribute(t, n), function() {
867
- return e.removeAttribute(t);
868
- };
869
- }
870
- function fe(e, r) {
871
- var t = Object.keys(e);
872
- if (Object.getOwnPropertySymbols) {
873
- var n = Object.getOwnPropertySymbols(e);
874
- r && (n = n.filter(function(o) {
875
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
876
- })), t.push.apply(t, n);
877
- }
878
- return t;
879
- }
880
- function H(e) {
881
- for (var r = 1; r < arguments.length; r++) {
882
- var t = arguments[r] != null ? arguments[r] : {};
883
- r % 2 ? fe(Object(t), !0).forEach(function(n) {
884
- _(e, n, t[n]);
885
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : fe(Object(t)).forEach(function(n) {
886
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
887
- });
888
- }
889
- return e;
890
- }
891
- function z(e, r) {
892
- var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
893
- if (!t) {
894
- if (Array.isArray(e) || (t = ot(e)) || r) {
895
- t && (e = t);
896
- var n = 0, o = function() {
897
- };
898
- return { s: o, n: function() {
899
- return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
900
- }, e: function(c) {
901
- throw c;
902
- }, f: o };
903
- }
904
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
905
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
906
- }
907
- var a, i = !0, l = !1;
908
- return { s: function() {
909
- t = t.call(e);
910
- }, n: function() {
911
- var c = t.next();
912
- return i = c.done, c;
913
- }, e: function(c) {
914
- l = !0, a = c;
915
- }, f: function() {
916
- try {
917
- i || t.return == null || t.return();
918
- } finally {
919
- if (l) throw a;
920
- }
921
- } };
922
- }
923
- function ot(e, r) {
924
- if (e) {
925
- if (typeof e == "string") return pe(e, r);
926
- var t = {}.toString.call(e).slice(8, -1);
927
- 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) ? pe(e, r) : void 0;
928
- }
929
- }
930
- function pe(e, r) {
931
- (r == null || r > e.length) && (r = e.length);
932
- for (var t = 0, n = Array(r); t < r; t++) n[t] = e[t];
933
- return n;
934
- }
935
- function G(e) {
936
- return e.slice(0).reverse();
937
- }
938
- function it(e) {
939
- var r = e.typeKey, t = e.defaultDropEffect, n = /* @__PURE__ */ new WeakMap(), o = "data-drop-target-for-".concat(r), a = "[".concat(o, "]");
940
- function i(d) {
941
- return n.set(d.element, d), function() {
942
- return n.delete(d.element);
943
- };
944
- }
945
- function l(d) {
946
- {
947
- var s = n.get(d.element);
948
- s && console.warn("You have already registered a [".concat(r, "] dropTarget on the same element"), {
949
- existing: s,
950
- proposed: d
951
- }), d.element instanceof HTMLIFrameElement && console.warn(`
952
- We recommend not registering <iframe> elements as drop targets
953
- as it can result in some strange browser event ordering.
954
- `.replace(/\s{2,}/g, " ").trim());
955
- }
956
- return te(Ee(d.element, {
957
- attribute: o,
958
- value: "true"
959
- }), i(d));
960
- }
961
- function u(d) {
962
- var s, g, y, T, w = d.source, D = d.target, m = d.input, S = d.event, b = d.result, h = b === void 0 ? [] : b;
963
- if (S === void 0)
964
- return h;
965
- const E = S.composedPath();
966
- if (D = E.find((R) => R instanceof Element ? R.hasAttribute("data-drop-target-for-element") : !1), D = D ?? E[0], !(D instanceof Element))
967
- return D instanceof Node ? u({
968
- source: w,
969
- target: D.parentElement,
970
- input: m,
971
- result: h
972
- }) : h;
973
- var j = D.closest(a);
974
- if (j == null)
975
- return h;
976
- var O = n.get(j);
977
- if (O == null)
978
- return h;
979
- var P = {
980
- input: m,
981
- source: w,
982
- element: O.element
983
- };
984
- if (O.canDrop && !O.canDrop(P))
985
- return u({
986
- source: w,
987
- target: O.element.parentElement,
988
- input: m,
989
- result: h
990
- });
991
- var I = (s = (g = O.getData) === null || g === void 0 ? void 0 : g.call(O, P)) !== null && s !== void 0 ? s : {}, A = (y = (T = O.getDropEffect) === null || T === void 0 ? void 0 : T.call(O, P)) !== null && y !== void 0 ? y : t, x = {
992
- data: I,
993
- element: O.element,
994
- dropEffect: A,
995
- // we are collecting _actual_ drop targets, so these are
996
- // being applied _not_ due to stickiness
997
- isActiveDueToStickiness: !1
998
- };
999
- return u({
1000
- source: w,
1001
- target: O.element.parentElement,
1002
- input: m,
1003
- // Using bubble ordering. Same ordering as `event.getPath()`
1004
- result: [].concat(Te(h), [x])
1005
- });
1006
- }
1007
- function c(d) {
1008
- var s = d.eventName, g = d.payload, y = z(g.location.current.dropTargets), T;
1009
- try {
1010
- for (y.s(); !(T = y.n()).done; ) {
1011
- var w, D = T.value, m = n.get(D.element), S = H(H({}, g), {}, {
1012
- self: D
1013
- });
1014
- m == null || (w = m[s]) === null || w === void 0 || w.call(
1015
- m,
1016
- // I cannot seem to get the types right here.
1017
- // TS doesn't seem to like that one event can need `nativeSetDragImage`
1018
- // @ts-expect-error
1019
- S
1020
- );
1021
- }
1022
- } catch (b) {
1023
- y.e(b);
1024
- } finally {
1025
- y.f();
1026
- }
1027
- }
1028
- var f = {
1029
- onGenerateDragPreview: c,
1030
- onDrag: c,
1031
- onDragStart: c,
1032
- onDrop: c,
1033
- onDropTargetChange: function(s) {
1034
- var g = s.payload, y = new Set(g.location.current.dropTargets.map(function(W) {
1035
- return W.element;
1036
- })), T = /* @__PURE__ */ new Set(), w = z(g.location.previous.dropTargets), D;
1037
- try {
1038
- for (w.s(); !(D = w.n()).done; ) {
1039
- var m, S = D.value;
1040
- T.add(S.element);
1041
- var b = n.get(S.element), h = y.has(S.element), E = H(H({}, g), {}, {
1042
- self: S
1043
- });
1044
- if (b == null || (m = b.onDropTargetChange) === null || m === void 0 || m.call(b, E), !h) {
1045
- var j;
1046
- b == null || (j = b.onDragLeave) === null || j === void 0 || j.call(b, E);
1047
- }
1048
- }
1049
- } catch (W) {
1050
- w.e(W);
1051
- } finally {
1052
- w.f();
1053
- }
1054
- var O = z(g.location.current.dropTargets), P;
1055
- try {
1056
- for (O.s(); !(P = O.n()).done; ) {
1057
- var I, A, x = P.value;
1058
- if (!T.has(x.element)) {
1059
- var R = H(H({}, g), {}, {
1060
- self: x
1061
- }), C = n.get(x.element);
1062
- C == null || (I = C.onDropTargetChange) === null || I === void 0 || I.call(C, R), C == null || (A = C.onDragEnter) === null || A === void 0 || A.call(C, R);
1063
- }
1064
- }
1065
- } catch (W) {
1066
- O.e(W);
1067
- } finally {
1068
- O.f();
1069
- }
1070
- }
1071
- };
1072
- function v(d) {
1073
- f[d.eventName](d);
1074
- }
1075
- function p(d) {
1076
- var s = d.source, g = d.target, y = d.input, T = d.event, w = d.current, D = u({
1077
- source: s,
1078
- target: g,
1079
- event: T,
1080
- input: y
1081
- });
1082
- if (D.length >= w.length)
1083
- return D;
1084
- for (var m = G(w), S = G(D), b = [], h = 0; h < m.length; h++) {
1085
- var E, j = m[h], O = S[h];
1086
- if (O != null) {
1087
- b.push(O);
1088
- continue;
1089
- }
1090
- var P = b[h - 1], I = m[h - 1];
1091
- if ((P == null ? void 0 : P.element) !== (I == null ? void 0 : I.element))
1092
- break;
1093
- var A = n.get(j.element);
1094
- if (!A)
1095
- break;
1096
- var x = {
1097
- input: y,
1098
- source: s,
1099
- element: A.element
1100
- };
1101
- if (A.canDrop && !A.canDrop(x) || !((E = A.getIsSticky) !== null && E !== void 0 && E.call(A, x)))
1102
- break;
1103
- b.push(H(H({}, j), {}, {
1104
- // making it clear to consumers this drop target is active due to stickiness
1105
- isActiveDueToStickiness: !0
1106
- }));
1107
- }
1108
- return G(b);
1109
- }
1110
- return {
1111
- dropTargetForConsumers: l,
1112
- getIsOver: p,
1113
- dispatchEvent: v
1114
- };
1115
- }
1116
- function ut(e, r) {
1117
- var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1118
- if (!t) {
1119
- if (Array.isArray(e) || (t = lt(e)) || r) {
1120
- t && (e = t);
1121
- var n = 0, o = function() {
1122
- };
1123
- return { s: o, n: function() {
1124
- return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
1125
- }, e: function(c) {
1126
- throw c;
1127
- }, f: o };
1128
- }
1129
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1130
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1131
- }
1132
- var a, i = !0, l = !1;
1133
- return { s: function() {
1134
- t = t.call(e);
1135
- }, n: function() {
1136
- var c = t.next();
1137
- return i = c.done, c;
1138
- }, e: function(c) {
1139
- l = !0, a = c;
1140
- }, f: function() {
1141
- try {
1142
- i || t.return == null || t.return();
1143
- } finally {
1144
- if (l) throw a;
1145
- }
1146
- } };
1147
- }
1148
- function lt(e, r) {
1149
- if (e) {
1150
- if (typeof e == "string") return ve(e, r);
1151
- var t = {}.toString.call(e).slice(8, -1);
1152
- 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) ? ve(e, r) : void 0;
1153
- }
1154
- }
1155
- function ve(e, r) {
1156
- (r == null || r > e.length) && (r = e.length);
1157
- for (var t = 0, n = Array(r); t < r; t++) n[t] = e[t];
1158
- return n;
1159
- }
1160
- function ge(e, r) {
1161
- var t = Object.keys(e);
1162
- if (Object.getOwnPropertySymbols) {
1163
- var n = Object.getOwnPropertySymbols(e);
1164
- r && (n = n.filter(function(o) {
1165
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
1166
- })), t.push.apply(t, n);
1167
- }
1168
- return t;
1169
- }
1170
- function ct(e) {
1171
- for (var r = 1; r < arguments.length; r++) {
1172
- var t = arguments[r] != null ? arguments[r] : {};
1173
- r % 2 ? ge(Object(t), !0).forEach(function(n) {
1174
- _(e, n, t[n]);
1175
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ge(Object(t)).forEach(function(n) {
1176
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
1177
- });
1178
- }
1179
- return e;
1180
- }
1181
- function dt() {
1182
- var e = /* @__PURE__ */ new Set(), r = null;
1183
- function t(a) {
1184
- r && (!a.canMonitor || a.canMonitor(r.canMonitorArgs)) && r.active.add(a);
1185
- }
1186
- function n(a) {
1187
- var i = ct({}, a);
1188
- return e.add(i), t(i), function() {
1189
- e.delete(i), r && r.active.delete(i);
1190
- };
1191
- }
1192
- function o(a) {
1193
- var i = a.eventName, l = a.payload;
1194
- if (i === "onGenerateDragPreview") {
1195
- r = {
1196
- canMonitorArgs: {
1197
- initial: l.location.initial,
1198
- source: l.source
1199
- },
1200
- active: /* @__PURE__ */ new Set()
1201
- };
1202
- var u = ut(e), c;
1203
- try {
1204
- for (u.s(); !(c = u.n()).done; ) {
1205
- var f = c.value;
1206
- t(f);
1207
- }
1208
- } catch (y) {
1209
- u.e(y);
1210
- } finally {
1211
- u.f();
1212
- }
1213
- }
1214
- if (r) {
1215
- for (var v = Array.from(r.active), p = 0, d = v; p < d.length; p++) {
1216
- var s = d[p];
1217
- if (r.active.has(s)) {
1218
- var g;
1219
- (g = s[i]) === null || g === void 0 || g.call(s, l);
1220
- }
1221
- }
1222
- i === "onDrop" && (r.active.clear(), r = null);
1223
- }
1224
- }
1225
- return {
1226
- dispatchEvent: o,
1227
- monitorForConsumers: n
1228
- };
1229
- }
1230
- function st(e) {
1231
- var r = e.typeKey, t = e.mount, n = e.dispatchEventToSource, o = e.onPostDispatch, a = e.defaultDropEffect, i = dt(), l = it({
1232
- typeKey: r,
1233
- defaultDropEffect: a
1234
- });
1235
- function u(v) {
1236
- n == null || n(v), l.dispatchEvent(v), i.dispatchEvent(v), o == null || o(v);
1237
- }
1238
- function c(v) {
1239
- var p = v.event, d = v.dragType;
1240
- se.start({
1241
- event: p,
1242
- dragType: d,
1243
- getDropTargetsOver: l.getIsOver,
1244
- dispatchEvent: u
1245
- });
1246
- }
1247
- function f() {
1248
- function v() {
1249
- var p = {
1250
- canStart: se.canStart,
1251
- start: c
1252
- };
1253
- return t(p);
1254
- }
1255
- return at({
1256
- typeKey: r,
1257
- mount: v
1258
- });
1259
- }
1260
- return {
1261
- registerUsage: f,
1262
- dropTarget: l.dropTargetForConsumers,
1263
- monitor: i.monitorForConsumers
1264
- };
1265
- }
1266
- var ft = ee(function() {
1267
- return navigator.userAgent.toLocaleLowerCase().includes("android");
1268
- }), pt = "pdnd:android-fallback", ye = "text/plain", vt = "text/uri-list", gt = "application/vnd.pdnd", M = /* @__PURE__ */ new WeakMap();
1269
- function yt(e) {
1270
- return M.set(e.element, e), function() {
1271
- M.delete(e.element);
1272
- };
1273
- }
1274
- var me = Ne(), re = st({
1275
- typeKey: "element",
1276
- defaultDropEffect: "move",
1277
- mount: function(r) {
1278
- return te(me.bindEvents(), K.bind(document, {
1279
- type: "dragstart",
1280
- listener: function(n) {
1281
- var o, a, i, l, u, c;
1282
- if (!r.canStart(n) || n.defaultPrevented)
1283
- return;
1284
- if (!n.dataTransfer) {
1285
- console.warn(`
1286
- It appears as though you have are not testing DragEvents correctly.
1287
-
1288
- - If you are unit testing, ensure you have polyfilled DragEvent.
1289
- - If you are browser testing, ensure you are dispatching drag events correctly.
1290
-
1291
- Please see our testing guides for more information:
1292
- https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
1293
- `.replace(/ {2}/g, ""));
1294
- return;
1295
- }
1296
- const v = n.composedPath().find((h) => h instanceof HTMLElement && M.has(h));
1297
- if (!v)
1298
- return null;
1299
- const p = M.get(v);
1300
- if (!p)
1301
- return null;
1302
- var d = L(n), s = {
1303
- element: p.element,
1304
- dragHandle: (o = p.dragHandle) !== null && o !== void 0 ? o : null,
1305
- input: d
1306
- };
1307
- if (p.canDrag && !p.canDrag(s))
1308
- return n.preventDefault(), null;
1309
- if (p.dragHandle) {
1310
- const E = (v.shadowRoot || document).elementFromPoint(d.clientX, d.clientY);
1311
- if (!p.dragHandle.contains(E))
1312
- return n.preventDefault(), null;
1313
- }
1314
- var g = (a = (i = p.getInitialDataForExternal) === null || i === void 0 ? void 0 : i.call(p, s)) !== null && a !== void 0 ? a : null;
1315
- if (g)
1316
- for (var y = 0, T = Object.entries(g); y < T.length; y++) {
1317
- var w = he(T[y], 2), D = w[0], m = w[1];
1318
- n.dataTransfer.setData(D, m ?? "");
1319
- }
1320
- ft() && !n.dataTransfer.types.includes(ye) && !n.dataTransfer.types.includes(vt) && n.dataTransfer.setData(ye, pt), n.dataTransfer.setData(gt, "");
1321
- var S = {
1322
- element: p.element,
1323
- dragHandle: (l = p.dragHandle) !== null && l !== void 0 ? l : null,
1324
- data: (u = (c = p.getInitialData) === null || c === void 0 ? void 0 : c.call(p, s)) !== null && u !== void 0 ? u : {}
1325
- }, b = {
1326
- type: "element",
1327
- payload: S,
1328
- startedFrom: "internal"
1329
- };
1330
- r.start({
1331
- event: n,
1332
- dragType: b
1333
- });
1334
- }
1335
- }));
1336
- },
1337
- dispatchEventToSource: function(r) {
1338
- var t, n, o = r.eventName, a = r.payload;
1339
- (t = M.get(a.source.element)) === null || t === void 0 || (n = t[o]) === null || n === void 0 || n.call(
1340
- t,
1341
- // I cannot seem to get the types right here.
1342
- // TS doesn't seem to like that one event can need `nativeSetDragImage`
1343
- // @ts-expect-error
1344
- a
1345
- );
1346
- },
1347
- onPostDispatch: me.getOnPostDispatch()
1348
- }), ht = re.dropTarget, mt = re.monitor;
1349
- function wt(e) {
1350
- e.dragHandle && !e.element.contains(e.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
1351
- element: e.element,
1352
- dragHandle: e.dragHandle
1353
- });
1354
- {
1355
- var r = M.get(e.element);
1356
- r && console.warn("You have already registered a `draggable` on the same element", {
1357
- existing: r,
1358
- proposed: e
1359
- });
1360
- }
1361
- return te(
1362
- // making the draggable register the adapter rather than drop targets
1363
- // this is because you *must* have a draggable element to start a drag
1364
- // but you _might_ not have any drop targets immediately
1365
- // (You might create drop targets async)
1366
- re.registerUsage(),
1367
- yt(e),
1368
- Ee(e.element, {
1369
- attribute: "draggable",
1370
- value: "true"
1371
- })
1372
- );
1373
- }
1374
- function bt() {
1375
- return {
1376
- x: 0,
1377
- y: 0
1378
- };
1379
- }
1380
- function Dt(e) {
1381
- var r = e.render, t = e.nativeSetDragImage, n = e.getOffset, o = n === void 0 ? bt : n, a = document.createElement("div");
1382
- Object.assign(a.style, {
1383
- // Ensuring we don't cause reflow when adding the element to the page
1384
- // Using `position:fixed` rather than `position:absolute` so we are
1385
- // positioned on the current viewport.
1386
- // `position:fixed` also creates a new stacking context, so we don't need to do that here
1387
- position: "fixed",
1388
- // According to `mdn`, the element can be offscreen:
1389
- // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage#imgelement
1390
- //
1391
- // However, that information does not appear in the specs:
1392
- // https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage-dev
1393
- //
1394
- // If the element is _completely_ offscreen, Safari@17.1 will cancel the drag
1395
- top: 0,
1396
- left: 0,
1397
- // Using maximum possible z-index so that this element will always be on top
1398
- // https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index
1399
- // Did not use `layers` in `@atlaskit/theme` because:
1400
- // 1. This element is not a 'layer' in the conventional sense, as this element
1401
- // is only created for a single frame for the browser to take a photo of it,
1402
- // and then it is destroyed
1403
- // 2. Did not want to add a dependency onto `@atlaskit/theme`
1404
- // 3. Want to always be on top of product UI which might have higher z-index's
1405
- zIndex: De,
1406
- // Avoiding any additional events caused by the new element (being super safe)
1407
- pointerEvents: "none"
1408
- }), document.body.append(a);
1409
- var i = r({
1410
- container: a
1411
- });
1412
- queueMicrotask(function() {
1413
- var c = o({
1414
- container: a
1415
- });
1416
- if (Y()) {
1417
- var f = a.getBoundingClientRect();
1418
- if (f.width === 0)
1419
- return;
1420
- a.style.left = "-".concat(f.width - 1e-4, "px");
1421
- }
1422
- t == null || t(a, c.x, c.y);
1423
- });
1424
- function l() {
1425
- u(), i == null || i(), document.body.removeChild(a);
1426
- }
1427
- var u = mt({
1428
- // Remove portal in the dragstart event so that the user will never see it
1429
- onDragStart: l,
1430
- // Backup: remove portal when the drop finishes (this would be an error case)
1431
- onDrop: l
1432
- });
1433
- }
1434
- const Ot = (e, r) => {
1435
- let t = getComputedStyle(e).getPropertyValue(r);
1436
- for (; !t && e.parentElement; )
1437
- e = e.parentElement, t = getComputedStyle(e).getPropertyValue(r);
1438
- return t.trim();
1439
- };
1440
- export {
1441
- _,
1442
- ht as a,
1443
- wt as d,
1444
- Ot as g,
1445
- Dt as s
1446
- };