@eightshift/ui-components 5.0.1 → 5.0.2
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-wERNNG0T.js → Button-BpwTmkAe.js} +4 -4
- package/dist/{Collection-CKsHTyhc.js → Collection-n5d0zIgb.js} +66 -31
- package/dist/{Color-BhgbJF5x.js → Color-lVhk8V_G.js} +1 -1
- package/dist/{ColorSwatch-Bcn6oRSg.js → ColorSwatch-DntWEAC3.js} +4 -4
- package/dist/{ComboBox-D1LPUwWP.js → ComboBox-BJpTEATT.js} +31 -22
- package/dist/{Dialog-D190gMbE.js → Dialog-O9uw63D7.js} +46 -27
- package/dist/{FieldError-DeUh5Wkw.js → FieldError-DHrSdE_Q.js} +2 -2
- package/dist/{FocusScope-C-plSxbS.js → FocusScope-BEPI2m7u.js} +2 -2
- package/dist/{Group-C5iZpSAM.js → Group-DDPhPPTQ.js} +3 -3
- package/dist/{Heading-D-Pboe4p.js → Heading-ba38ScjJ.js} +1 -1
- package/dist/{Input--mF4XVE1.js → Input-BmDS8Juy.js} +6 -6
- package/dist/{Label-Fp6AwSRn.js → Label-JS_ob-kh.js} +1 -1
- package/dist/{ListBox-4oW9kh3R.js → ListBox-BTxlCGcc.js} +97 -15
- package/dist/{OverlayArrow-BpB9uB_I.js → OverlayArrow-5aDgmImj.js} +3 -3
- package/dist/{Separator-B88tj5YD.js → Separator-CaTBkETC.js} +21 -12
- package/dist/{Slider-CyJzC1bp.js → Slider-C-S1oEH9.js} +10 -10
- package/dist/{Text-DRpwWot2.js → Text-BuJgePCv.js} +1 -1
- package/dist/{VisuallyHidden-DsKYcRQ_.js → VisuallyHidden-BYi0pekx.js} +2 -2
- package/dist/assets/style-admin.css +58 -14
- package/dist/assets/style-editor.css +58 -14
- package/dist/assets/style.css +58 -14
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +29 -10
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/checkbox/checkbox.js +14 -11
- package/dist/components/color-pickers/color-swatch.js +2 -2
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +16 -16
- package/dist/components/draggable/draggable.js +694 -353
- package/dist/components/expandable/expandable.js +6 -6
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/link-input/link-input.js +15 -22
- package/dist/components/menu/menu.js +2 -2
- package/dist/components/modal/modal.js +4 -4
- package/dist/components/number-picker/number-picker.js +9 -9
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/radio.js +16 -13
- package/dist/components/responsive/mini-responsive.js +1 -1
- package/dist/components/select/v2/async-select.js +8 -8
- package/dist/components/select/v2/shared.js +2 -2
- package/dist/components/select/v2/single-select.js +34 -21
- package/dist/components/slider/column-config-slider.js +2 -2
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/tabs/tabs.js +16 -17
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +6 -6
- package/dist/components/tooltip/tooltip.js +3 -3
- package/dist/{context-BYWrbm1z.js → context-BbYZoHvX.js} +1 -1
- package/dist/icons/icons.js +124 -0
- package/dist/{index-wl5606BX.js → index-BljRBEr_.js} +1 -1
- package/dist/{textSelection-CCcyjiRP.js → textSelection-8DpK8fJl.js} +1 -1
- package/dist/{useButton-BOHxkGQF.js → useButton-Bt3BffJm.js} +3 -3
- package/dist/{useEvent-D5o_CqDH.js → useEvent-ICdlokG-.js} +1 -1
- package/dist/{useFocusRing-nMG2uzxS.js → useFocusRing-Bv0UJQl8.js} +1 -1
- package/dist/{useFormReset-DlmRL87g.js → useFormReset-D2YaWRIA.js} +1 -1
- package/dist/{useFormValidation-D0_aaK-e.js → useFormValidation-Dy0PXJg5.js} +2 -2
- package/dist/{useHover-VO5tcIli.js → useHover-C2SkI1Fn.js} +7 -2
- package/dist/{useLabel-BKH4fVA4.js → useLabel-BPCd5c7-.js} +2 -2
- package/dist/{useLabels-ntF3rFY0.js → useLabels-B7-lUnAF.js} +1 -1
- package/dist/{useListState-Cq2Nvr-v.js → useListState-DkyH7elT.js} +10 -3
- package/dist/{useLocalizedStringFormatter-CGzwx1a0.js → useLocalizedStringFormatter-C9GO0IDB.js} +1 -1
- package/dist/{useNumberField-C9dmERhP.js → useNumberField-CU1_u8ze.js} +18 -10
- package/dist/{useNumberFormatter-MrRLgvhj.js → useNumberFormatter-CZ9QUnRt.js} +1 -1
- package/dist/{usePress-DjNo5790.js → usePress-BrJylgPR.js} +21 -10
- package/dist/{useSingleSelectListState--r3AAhRj.js → useSingleSelectListState-C4sorv2p.js} +2 -2
- package/dist/{useToggle-CQaXLe-O.js → useToggle-CDa3YAZI.js} +4 -4
- package/dist/{useToggleState-C3DLdez5.js → useToggleState-ibcBUHnB.js} +1 -1
- package/dist/{utils-B94NDG0v.js → utils-CZt7LCbO.js} +41 -8
- package/package.json +24 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, startTransition, createContext,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useLayoutEffect, useMemo, useState, useCallback, startTransition, createContext, memo, forwardRef, useImperativeHandle, useContext, useId } from "react";
|
|
3
3
|
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
4
4
|
import { DraggableContext } from "./draggable-context.js";
|
|
5
5
|
import { r as reactDomExports } from "../../index-CFozsmNS.js";
|
|
@@ -2401,10 +2401,30 @@ var __typeError$3 = (msg) => {
|
|
|
2401
2401
|
throw TypeError(msg);
|
|
2402
2402
|
};
|
|
2403
2403
|
var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
|
|
2404
|
-
var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"),
|
|
2404
|
+
var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), member.get(obj));
|
|
2405
2405
|
var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2406
2406
|
var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2407
2407
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$3(obj, member, "access private method"), method);
|
|
2408
|
+
function isKeyframeEffect(effect) {
|
|
2409
|
+
if (!effect) return false;
|
|
2410
|
+
if (effect instanceof KeyframeEffect) return true;
|
|
2411
|
+
return "getKeyframes" in effect && typeof effect.getKeyframes === "function";
|
|
2412
|
+
}
|
|
2413
|
+
function getFinalKeyframe(element, match) {
|
|
2414
|
+
const animations2 = element.getAnimations();
|
|
2415
|
+
if (animations2.length > 0) {
|
|
2416
|
+
for (const animation of animations2) {
|
|
2417
|
+
if (animation.playState !== "running") continue;
|
|
2418
|
+
const { effect } = animation;
|
|
2419
|
+
const keyframes = isKeyframeEffect(effect) ? effect.getKeyframes() : [];
|
|
2420
|
+
const matchedKeyframes = keyframes.filter(match);
|
|
2421
|
+
if (matchedKeyframes.length > 0) {
|
|
2422
|
+
return [matchedKeyframes[matchedKeyframes.length - 1], animation];
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
return null;
|
|
2427
|
+
}
|
|
2408
2428
|
function getBoundingRectangle(element) {
|
|
2409
2429
|
const { width, height, top, left, bottom, right } = element.getBoundingClientRect();
|
|
2410
2430
|
return { width, height, top, left, bottom, right };
|
|
@@ -2476,36 +2496,6 @@ function getViewportBoundingRectangle(element) {
|
|
|
2476
2496
|
height
|
|
2477
2497
|
};
|
|
2478
2498
|
}
|
|
2479
|
-
function timeout(callback, duration) {
|
|
2480
|
-
const id = setTimeout(callback, duration);
|
|
2481
|
-
return () => clearTimeout(id);
|
|
2482
|
-
}
|
|
2483
|
-
function throttle(func, limit) {
|
|
2484
|
-
const time = () => performance.now();
|
|
2485
|
-
let cancel;
|
|
2486
|
-
let lastRan;
|
|
2487
|
-
return function(...args) {
|
|
2488
|
-
const context = this;
|
|
2489
|
-
if (!lastRan) {
|
|
2490
|
-
func.apply(context, args);
|
|
2491
|
-
lastRan = time();
|
|
2492
|
-
} else {
|
|
2493
|
-
cancel == null ? void 0 : cancel();
|
|
2494
|
-
cancel = timeout(
|
|
2495
|
-
() => {
|
|
2496
|
-
func.apply(context, args);
|
|
2497
|
-
lastRan = time();
|
|
2498
|
-
},
|
|
2499
|
-
limit - (time() - lastRan)
|
|
2500
|
-
);
|
|
2501
|
-
}
|
|
2502
|
-
};
|
|
2503
|
-
}
|
|
2504
|
-
function isRectEqual(a2, b2) {
|
|
2505
|
-
if (a2 === b2) return true;
|
|
2506
|
-
if (!a2 || !b2) return false;
|
|
2507
|
-
return a2.top == b2.top && a2.left == b2.left && a2.right == b2.right && a2.bottom == b2.bottom;
|
|
2508
|
-
}
|
|
2509
2499
|
function isOverflowVisible(element, style) {
|
|
2510
2500
|
if (isDetailsElement(element) && element.open === false) {
|
|
2511
2501
|
return false;
|
|
@@ -2568,6 +2558,128 @@ function getVisibleBoundingRectangle(element, boundingClientRect = element.getBo
|
|
|
2568
2558
|
}
|
|
2569
2559
|
return rect;
|
|
2570
2560
|
}
|
|
2561
|
+
function isSafari() {
|
|
2562
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
2563
|
+
}
|
|
2564
|
+
function cloneElement(element) {
|
|
2565
|
+
const selector = "input, textarea, select, canvas, [contenteditable]";
|
|
2566
|
+
const clonedElement = element.cloneNode(true);
|
|
2567
|
+
const fields = Array.from(element.querySelectorAll(selector));
|
|
2568
|
+
const clonedFields = Array.from(clonedElement.querySelectorAll(selector));
|
|
2569
|
+
clonedFields.forEach((field, index) => {
|
|
2570
|
+
const originalField = fields[index];
|
|
2571
|
+
if (isField(field) && isField(originalField)) {
|
|
2572
|
+
if (field.type !== "file") {
|
|
2573
|
+
field.value = originalField.value;
|
|
2574
|
+
}
|
|
2575
|
+
if (field.type === "radio" && field.name) {
|
|
2576
|
+
field.name = `Cloned__${field.name}`;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
if (isCanvasElement(field) && isCanvasElement(originalField) && originalField.width > 0 && originalField.height > 0) {
|
|
2580
|
+
const destCtx = field.getContext("2d");
|
|
2581
|
+
destCtx == null ? void 0 : destCtx.drawImage(originalField, 0, 0);
|
|
2582
|
+
}
|
|
2583
|
+
});
|
|
2584
|
+
return clonedElement;
|
|
2585
|
+
}
|
|
2586
|
+
function isField(element) {
|
|
2587
|
+
return "value" in element;
|
|
2588
|
+
}
|
|
2589
|
+
function isCanvasElement(element) {
|
|
2590
|
+
return element.tagName === "CANVAS";
|
|
2591
|
+
}
|
|
2592
|
+
function getElementFromPoint(document2, { x, y: y2 }) {
|
|
2593
|
+
const element = document2.elementFromPoint(x, y2);
|
|
2594
|
+
if (isIFrameElement(element)) {
|
|
2595
|
+
const { contentDocument } = element;
|
|
2596
|
+
if (contentDocument) {
|
|
2597
|
+
const { left, top } = element.getBoundingClientRect();
|
|
2598
|
+
return getElementFromPoint(contentDocument, {
|
|
2599
|
+
x: x - left,
|
|
2600
|
+
y: y2 - top
|
|
2601
|
+
});
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
return element;
|
|
2605
|
+
}
|
|
2606
|
+
function isIFrameElement(element) {
|
|
2607
|
+
return (element == null ? void 0 : element.tagName) === "IFRAME";
|
|
2608
|
+
}
|
|
2609
|
+
var ProxiedElements = /* @__PURE__ */ new WeakMap();
|
|
2610
|
+
var Listeners = class {
|
|
2611
|
+
constructor() {
|
|
2612
|
+
this.entries = /* @__PURE__ */ new Set();
|
|
2613
|
+
this.clear = () => {
|
|
2614
|
+
for (const entry of this.entries) {
|
|
2615
|
+
const [target, { type, listener, options: options2 }] = entry;
|
|
2616
|
+
target.removeEventListener(type, listener, options2);
|
|
2617
|
+
}
|
|
2618
|
+
this.entries.clear();
|
|
2619
|
+
};
|
|
2620
|
+
}
|
|
2621
|
+
bind(target, input) {
|
|
2622
|
+
const listeners = Array.isArray(input) ? input : [input];
|
|
2623
|
+
const entries = [];
|
|
2624
|
+
for (const descriptor2 of listeners) {
|
|
2625
|
+
const { type, listener, options: options2 } = descriptor2;
|
|
2626
|
+
const entry = [target, descriptor2];
|
|
2627
|
+
target.addEventListener(type, listener, options2);
|
|
2628
|
+
this.entries.add(entry);
|
|
2629
|
+
entries.push(entry);
|
|
2630
|
+
}
|
|
2631
|
+
return function cleanup() {
|
|
2632
|
+
for (const [target2, { type, listener, options: options2 }] of entries) {
|
|
2633
|
+
target2.removeEventListener(type, listener, options2);
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
};
|
|
2638
|
+
function getFrameElement(el) {
|
|
2639
|
+
const refWindow = el == null ? void 0 : el.ownerDocument.defaultView;
|
|
2640
|
+
if (refWindow && refWindow.self !== refWindow.parent) {
|
|
2641
|
+
return refWindow.frameElement;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
function getFrameElements(el) {
|
|
2645
|
+
const frames = /* @__PURE__ */ new Set();
|
|
2646
|
+
let frame = getFrameElement(el);
|
|
2647
|
+
while (frame) {
|
|
2648
|
+
frames.add(frame);
|
|
2649
|
+
frame = getFrameElement(frame);
|
|
2650
|
+
}
|
|
2651
|
+
return frames;
|
|
2652
|
+
}
|
|
2653
|
+
function timeout(callback, duration) {
|
|
2654
|
+
const id = setTimeout(callback, duration);
|
|
2655
|
+
return () => clearTimeout(id);
|
|
2656
|
+
}
|
|
2657
|
+
function throttle(func, limit) {
|
|
2658
|
+
const time = () => performance.now();
|
|
2659
|
+
let cancel;
|
|
2660
|
+
let lastRan;
|
|
2661
|
+
return function(...args) {
|
|
2662
|
+
const context = this;
|
|
2663
|
+
if (!lastRan) {
|
|
2664
|
+
func.apply(context, args);
|
|
2665
|
+
lastRan = time();
|
|
2666
|
+
} else {
|
|
2667
|
+
cancel == null ? void 0 : cancel();
|
|
2668
|
+
cancel = timeout(
|
|
2669
|
+
() => {
|
|
2670
|
+
func.apply(context, args);
|
|
2671
|
+
lastRan = time();
|
|
2672
|
+
},
|
|
2673
|
+
limit - (time() - lastRan)
|
|
2674
|
+
);
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
function isRectEqual(a2, b2) {
|
|
2679
|
+
if (a2 === b2) return true;
|
|
2680
|
+
if (!a2 || !b2) return false;
|
|
2681
|
+
return a2.top == b2.top && a2.left == b2.left && a2.right == b2.right && a2.bottom == b2.bottom;
|
|
2682
|
+
}
|
|
2571
2683
|
function isVisible(element, boundingClientRect = element.getBoundingClientRect()) {
|
|
2572
2684
|
const { width, height } = getVisibleBoundingRectangle(
|
|
2573
2685
|
element,
|
|
@@ -2575,14 +2687,47 @@ function isVisible(element, boundingClientRect = element.getBoundingClientRect()
|
|
|
2575
2687
|
);
|
|
2576
2688
|
return width > 0 && height > 0;
|
|
2577
2689
|
}
|
|
2690
|
+
var Observer = canUseDOM$1 ? ResizeObserver : class MockResizeObserver {
|
|
2691
|
+
observe() {
|
|
2692
|
+
}
|
|
2693
|
+
unobserve() {
|
|
2694
|
+
}
|
|
2695
|
+
disconnect() {
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
var _initialized;
|
|
2699
|
+
var ResizeNotifier = class extends Observer {
|
|
2700
|
+
constructor(callback) {
|
|
2701
|
+
super((entries) => {
|
|
2702
|
+
if (!__privateGet$3(this, _initialized)) {
|
|
2703
|
+
__privateSet$3(this, _initialized, true);
|
|
2704
|
+
return;
|
|
2705
|
+
}
|
|
2706
|
+
callback(entries, this);
|
|
2707
|
+
});
|
|
2708
|
+
__privateAdd$3(this, _initialized, false);
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
_initialized = /* @__PURE__ */ new WeakMap();
|
|
2578
2712
|
var threshold = Array.from({ length: 100 }, (_2, index) => index / 100);
|
|
2579
2713
|
var THROTTLE_INTERVAL = 75;
|
|
2580
|
-
var
|
|
2714
|
+
var _visible, _previousBoundingClientRect, _resizeObserver, _positionObserver, _visibilityObserver, _debug, _disconnected, _observePosition, _PositionObserver_instances, notify_fn, updateDebug_fn;
|
|
2581
2715
|
var PositionObserver = class {
|
|
2582
|
-
constructor(element, callback, options2 = {
|
|
2716
|
+
constructor(element, callback, options2 = {
|
|
2717
|
+
debug: false,
|
|
2718
|
+
skipInitial: false
|
|
2719
|
+
}) {
|
|
2583
2720
|
this.element = element;
|
|
2721
|
+
this.callback = callback;
|
|
2584
2722
|
__privateAdd$3(this, _PositionObserver_instances);
|
|
2585
|
-
|
|
2723
|
+
this.disconnect = () => {
|
|
2724
|
+
var _a4, _b2, _c3;
|
|
2725
|
+
__privateSet$3(this, _disconnected, true);
|
|
2726
|
+
(_a4 = __privateGet$3(this, _resizeObserver)) == null ? void 0 : _a4.disconnect();
|
|
2727
|
+
(_b2 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _b2.disconnect();
|
|
2728
|
+
__privateGet$3(this, _visibilityObserver).disconnect();
|
|
2729
|
+
(_c3 = __privateGet$3(this, _debug)) == null ? void 0 : _c3.remove();
|
|
2730
|
+
};
|
|
2586
2731
|
__privateAdd$3(this, _visible, true);
|
|
2587
2732
|
__privateAdd$3(this, _previousBoundingClientRect);
|
|
2588
2733
|
__privateAdd$3(this, _resizeObserver);
|
|
@@ -2612,9 +2757,9 @@ var PositionObserver = class {
|
|
|
2612
2757
|
(entries) => {
|
|
2613
2758
|
const [entry] = entries;
|
|
2614
2759
|
const { intersectionRect } = entry;
|
|
2615
|
-
const intersectionRatio = Rectangle.intersectionRatio(
|
|
2760
|
+
const intersectionRatio = entry.intersectionRatio !== 1 ? entry.intersectionRatio : Rectangle.intersectionRatio(
|
|
2616
2761
|
intersectionRect,
|
|
2617
|
-
|
|
2762
|
+
getVisibleBoundingRectangle(element2)
|
|
2618
2763
|
);
|
|
2619
2764
|
if (intersectionRatio !== 1) {
|
|
2620
2765
|
__privateGet$3(this, _observePosition).call(this);
|
|
@@ -2629,9 +2774,16 @@ var PositionObserver = class {
|
|
|
2629
2774
|
__privateGet$3(this, _positionObserver).observe(element2);
|
|
2630
2775
|
__privateMethod$1(this, _PositionObserver_instances, notify_fn).call(this);
|
|
2631
2776
|
}, THROTTLE_INTERVAL));
|
|
2632
|
-
__privateSet$3(this, _callback, callback);
|
|
2633
2777
|
this.boundingClientRect = element.getBoundingClientRect();
|
|
2634
2778
|
__privateSet$3(this, _visible, isVisible(element, this.boundingClientRect));
|
|
2779
|
+
let initial = true;
|
|
2780
|
+
this.callback = (boundingClientRect) => {
|
|
2781
|
+
if (initial) {
|
|
2782
|
+
initial = false;
|
|
2783
|
+
if (options2.skipInitial) return;
|
|
2784
|
+
}
|
|
2785
|
+
callback(boundingClientRect);
|
|
2786
|
+
};
|
|
2635
2787
|
const root = element.ownerDocument;
|
|
2636
2788
|
if (options2 == null ? void 0 : options2.debug) {
|
|
2637
2789
|
__privateSet$3(this, _debug, document.createElement("div"));
|
|
@@ -2651,7 +2803,7 @@ var PositionObserver = class {
|
|
|
2651
2803
|
if (!width && !height) return;
|
|
2652
2804
|
if (previousVisible && !visible) {
|
|
2653
2805
|
(_a4 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _a4.disconnect();
|
|
2654
|
-
|
|
2806
|
+
this.callback(null);
|
|
2655
2807
|
(_b2 = __privateGet$3(this, _resizeObserver)) == null ? void 0 : _b2.disconnect();
|
|
2656
2808
|
__privateSet$3(this, _resizeObserver, void 0);
|
|
2657
2809
|
if (__privateGet$3(this, _debug)) __privateGet$3(this, _debug).style.visibility = "hidden";
|
|
@@ -2659,7 +2811,7 @@ var PositionObserver = class {
|
|
|
2659
2811
|
__privateGet$3(this, _observePosition).call(this);
|
|
2660
2812
|
}
|
|
2661
2813
|
if (visible && !__privateGet$3(this, _resizeObserver)) {
|
|
2662
|
-
__privateSet$3(this, _resizeObserver, new
|
|
2814
|
+
__privateSet$3(this, _resizeObserver, new ResizeNotifier(__privateGet$3(this, _observePosition)));
|
|
2663
2815
|
__privateGet$3(this, _resizeObserver).observe(element);
|
|
2664
2816
|
}
|
|
2665
2817
|
},
|
|
@@ -2668,21 +2820,12 @@ var PositionObserver = class {
|
|
|
2668
2820
|
root
|
|
2669
2821
|
}
|
|
2670
2822
|
));
|
|
2671
|
-
if (__privateGet$3(this, _visible)) {
|
|
2672
|
-
|
|
2823
|
+
if (__privateGet$3(this, _visible) && !options2.skipInitial) {
|
|
2824
|
+
this.callback(this.boundingClientRect);
|
|
2673
2825
|
}
|
|
2674
2826
|
__privateGet$3(this, _visibilityObserver).observe(element);
|
|
2675
2827
|
}
|
|
2676
|
-
disconnect() {
|
|
2677
|
-
var _a4, _b2, _c3;
|
|
2678
|
-
__privateSet$3(this, _disconnected, true);
|
|
2679
|
-
(_a4 = __privateGet$3(this, _resizeObserver)) == null ? void 0 : _a4.disconnect();
|
|
2680
|
-
(_b2 = __privateGet$3(this, _positionObserver)) == null ? void 0 : _b2.disconnect();
|
|
2681
|
-
__privateGet$3(this, _visibilityObserver).disconnect();
|
|
2682
|
-
(_c3 = __privateGet$3(this, _debug)) == null ? void 0 : _c3.remove();
|
|
2683
|
-
}
|
|
2684
2828
|
};
|
|
2685
|
-
_callback = /* @__PURE__ */ new WeakMap();
|
|
2686
2829
|
_visible = /* @__PURE__ */ new WeakMap();
|
|
2687
2830
|
_previousBoundingClientRect = /* @__PURE__ */ new WeakMap();
|
|
2688
2831
|
_resizeObserver = /* @__PURE__ */ new WeakMap();
|
|
@@ -2697,7 +2840,7 @@ notify_fn = function() {
|
|
|
2697
2840
|
__privateMethod$1(this, _PositionObserver_instances, updateDebug_fn).call(this);
|
|
2698
2841
|
if (isRectEqual(this.boundingClientRect, __privateGet$3(this, _previousBoundingClientRect)))
|
|
2699
2842
|
return;
|
|
2700
|
-
|
|
2843
|
+
this.callback(this.boundingClientRect);
|
|
2701
2844
|
__privateSet$3(this, _previousBoundingClientRect, this.boundingClientRect);
|
|
2702
2845
|
};
|
|
2703
2846
|
updateDebug_fn = function() {
|
|
@@ -2713,89 +2856,116 @@ updateDebug_fn = function() {
|
|
|
2713
2856
|
__privateGet$3(this, _debug).style.height = `${Math.floor(height)}px`;
|
|
2714
2857
|
}
|
|
2715
2858
|
};
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2859
|
+
var framePositionObservers = /* @__PURE__ */ new WeakMap();
|
|
2860
|
+
var scrollListeners = /* @__PURE__ */ new WeakMap();
|
|
2861
|
+
function addFrameListener(frame, callback) {
|
|
2862
|
+
let cached = framePositionObservers.get(frame);
|
|
2863
|
+
if (!cached) {
|
|
2864
|
+
const observer = new PositionObserver(
|
|
2865
|
+
frame,
|
|
2866
|
+
(boundingClientRect) => {
|
|
2867
|
+
const cached2 = framePositionObservers.get(frame);
|
|
2868
|
+
if (!cached2) return;
|
|
2869
|
+
cached2.callbacks.forEach((callback2) => callback2(boundingClientRect));
|
|
2870
|
+
},
|
|
2871
|
+
{ skipInitial: true }
|
|
2872
|
+
);
|
|
2873
|
+
cached = { disconnect: observer.disconnect, callbacks: /* @__PURE__ */ new Set() };
|
|
2874
|
+
}
|
|
2875
|
+
cached.callbacks.add(callback);
|
|
2876
|
+
framePositionObservers.set(frame, cached);
|
|
2877
|
+
return () => {
|
|
2878
|
+
cached.callbacks.delete(callback);
|
|
2879
|
+
if (cached.callbacks.size === 0) {
|
|
2880
|
+
framePositionObservers.delete(frame);
|
|
2881
|
+
cached.disconnect();
|
|
2737
2882
|
}
|
|
2738
|
-
}
|
|
2739
|
-
return clonedElement;
|
|
2740
|
-
}
|
|
2741
|
-
function isField(element) {
|
|
2742
|
-
return "value" in element;
|
|
2743
|
-
}
|
|
2744
|
-
function isCanvasElement(element) {
|
|
2745
|
-
return element.tagName === "CANVAS";
|
|
2883
|
+
};
|
|
2746
2884
|
}
|
|
2747
|
-
function
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
const { left, top } = element.getBoundingClientRect();
|
|
2753
|
-
return getElementFromPoint(contentDocument, {
|
|
2754
|
-
x: x - left,
|
|
2755
|
-
y: y2 - top
|
|
2756
|
-
});
|
|
2757
|
-
}
|
|
2885
|
+
function observeParentFrames(frames, callback) {
|
|
2886
|
+
const cleanup = /* @__PURE__ */ new Set();
|
|
2887
|
+
for (const frame of frames) {
|
|
2888
|
+
const remove = addFrameListener(frame, callback);
|
|
2889
|
+
cleanup.add(remove);
|
|
2758
2890
|
}
|
|
2759
|
-
return
|
|
2760
|
-
}
|
|
2761
|
-
function isIFrameElement(element) {
|
|
2762
|
-
return (element == null ? void 0 : element.tagName) === "IFRAME";
|
|
2891
|
+
return () => cleanup.forEach((remove) => remove());
|
|
2763
2892
|
}
|
|
2764
|
-
|
|
2765
|
-
var
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2893
|
+
function addScrollListener(element, callback) {
|
|
2894
|
+
var _a4;
|
|
2895
|
+
const doc = element.ownerDocument;
|
|
2896
|
+
if (!scrollListeners.has(doc)) {
|
|
2897
|
+
const controller = new AbortController();
|
|
2898
|
+
const listeners2 = /* @__PURE__ */ new Set();
|
|
2899
|
+
document.addEventListener(
|
|
2900
|
+
"scroll",
|
|
2901
|
+
(event) => listeners2.forEach((listener) => listener(event)),
|
|
2902
|
+
{
|
|
2903
|
+
capture: true,
|
|
2904
|
+
passive: true,
|
|
2905
|
+
signal: controller.signal
|
|
2772
2906
|
}
|
|
2773
|
-
|
|
2774
|
-
};
|
|
2907
|
+
);
|
|
2908
|
+
scrollListeners.set(doc, { disconnect: () => controller.abort(), listeners: listeners2 });
|
|
2775
2909
|
}
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2910
|
+
const { listeners, disconnect } = (_a4 = scrollListeners.get(doc)) != null ? _a4 : {};
|
|
2911
|
+
if (!listeners || !disconnect) return () => {
|
|
2912
|
+
};
|
|
2913
|
+
listeners.add(callback);
|
|
2914
|
+
return () => {
|
|
2915
|
+
listeners.delete(callback);
|
|
2916
|
+
if (listeners.size === 0) {
|
|
2917
|
+
disconnect();
|
|
2918
|
+
scrollListeners.delete(doc);
|
|
2785
2919
|
}
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2920
|
+
};
|
|
2921
|
+
}
|
|
2922
|
+
var _elementObserver, _disconnected2, _frames, _handleScroll;
|
|
2923
|
+
var FrameObserver = class {
|
|
2924
|
+
constructor(element, callback, options2) {
|
|
2925
|
+
this.callback = callback;
|
|
2926
|
+
__privateAdd$3(this, _elementObserver);
|
|
2927
|
+
__privateAdd$3(this, _disconnected2, false);
|
|
2928
|
+
__privateAdd$3(this, _frames);
|
|
2929
|
+
__privateAdd$3(this, _handleScroll, throttle((event) => {
|
|
2930
|
+
if (__privateGet$3(this, _disconnected2)) return;
|
|
2931
|
+
if (!event.target) return;
|
|
2932
|
+
if ("contains" in event.target && typeof event.target.contains === "function") {
|
|
2933
|
+
for (const frame of __privateGet$3(this, _frames)) {
|
|
2934
|
+
if (event.target.contains(frame)) {
|
|
2935
|
+
this.callback(__privateGet$3(this, _elementObserver).boundingClientRect);
|
|
2936
|
+
break;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2789
2939
|
}
|
|
2940
|
+
}, THROTTLE_INTERVAL));
|
|
2941
|
+
const frames = getFrameElements(element);
|
|
2942
|
+
const unobserveParentFrames = observeParentFrames(frames, callback);
|
|
2943
|
+
const removeScrollListener = addScrollListener(element, __privateGet$3(this, _handleScroll));
|
|
2944
|
+
__privateSet$3(this, _frames, frames);
|
|
2945
|
+
__privateSet$3(this, _elementObserver, new PositionObserver(element, callback, options2));
|
|
2946
|
+
this.disconnect = () => {
|
|
2947
|
+
if (__privateGet$3(this, _disconnected2)) return;
|
|
2948
|
+
__privateSet$3(this, _disconnected2, true);
|
|
2949
|
+
unobserveParentFrames();
|
|
2950
|
+
removeScrollListener();
|
|
2951
|
+
__privateGet$3(this, _elementObserver).disconnect();
|
|
2790
2952
|
};
|
|
2791
2953
|
}
|
|
2792
2954
|
};
|
|
2955
|
+
_elementObserver = /* @__PURE__ */ new WeakMap();
|
|
2956
|
+
_disconnected2 = /* @__PURE__ */ new WeakMap();
|
|
2957
|
+
_frames = /* @__PURE__ */ new WeakMap();
|
|
2958
|
+
_handleScroll = /* @__PURE__ */ new WeakMap();
|
|
2793
2959
|
function supportsPopover(element) {
|
|
2794
2960
|
return "showPopover" in element && "hidePopover" in element && typeof element.showPopover === "function" && typeof element.hidePopover === "function";
|
|
2795
2961
|
}
|
|
2796
2962
|
function showPopover(element) {
|
|
2797
|
-
|
|
2798
|
-
element.
|
|
2963
|
+
try {
|
|
2964
|
+
if (supportsPopover(element) && element.isConnected && element.hasAttribute("popover") && // This selector can throw an error in browsers that don't support it
|
|
2965
|
+
!element.matches(":popover-open")) {
|
|
2966
|
+
element.showPopover();
|
|
2967
|
+
}
|
|
2968
|
+
} catch (error) {
|
|
2799
2969
|
}
|
|
2800
2970
|
}
|
|
2801
2971
|
function isDocumentScrollingElement(element) {
|
|
@@ -2853,7 +3023,7 @@ function canScroll(scrollableElement, by) {
|
|
|
2853
3023
|
y: top || bottom
|
|
2854
3024
|
};
|
|
2855
3025
|
}
|
|
2856
|
-
var Scheduler = class {
|
|
3026
|
+
var Scheduler$1 = class Scheduler {
|
|
2857
3027
|
constructor(scheduler4) {
|
|
2858
3028
|
this.scheduler = scheduler4;
|
|
2859
3029
|
this.pending = false;
|
|
@@ -2881,10 +3051,14 @@ var Scheduler = class {
|
|
|
2881
3051
|
return new Promise((resolve) => this.resolvers.add(resolve));
|
|
2882
3052
|
}
|
|
2883
3053
|
};
|
|
2884
|
-
var scheduler = new Scheduler(
|
|
2885
|
-
(
|
|
2886
|
-
);
|
|
2887
|
-
|
|
3054
|
+
var scheduler = new Scheduler$1((callback) => {
|
|
3055
|
+
if (typeof requestAnimationFrame === "function") {
|
|
3056
|
+
requestAnimationFrame(callback);
|
|
3057
|
+
} else {
|
|
3058
|
+
callback();
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
var scheduler2 = new Scheduler$1((callback) => setTimeout(callback, 50));
|
|
2888
3062
|
var cachedStyles = /* @__PURE__ */ new Map();
|
|
2889
3063
|
var clear = cachedStyles.clear.bind(cachedStyles);
|
|
2890
3064
|
function getComputedStyles(element, cached = false) {
|
|
@@ -2957,13 +3131,6 @@ function getFirstScrollableAncestor(node) {
|
|
|
2957
3131
|
const [firstScrollableAncestor] = getScrollableAncestors(node, { limit: 1 });
|
|
2958
3132
|
return firstScrollableAncestor != null ? firstScrollableAncestor : null;
|
|
2959
3133
|
}
|
|
2960
|
-
function getFrameElement(el) {
|
|
2961
|
-
const refWindow = el == null ? void 0 : el.ownerDocument.defaultView;
|
|
2962
|
-
if (refWindow && refWindow.self !== refWindow.parent) {
|
|
2963
|
-
return refWindow.frameElement;
|
|
2964
|
-
}
|
|
2965
|
-
return null;
|
|
2966
|
-
}
|
|
2967
3134
|
function getFrameTransform(el, boundary = window.frameElement) {
|
|
2968
3135
|
const transform = {
|
|
2969
3136
|
x: 0,
|
|
@@ -3181,6 +3348,21 @@ function scrollIntoViewIfNeeded(el, centerIfNeeded = false) {
|
|
|
3181
3348
|
el.scrollIntoView(alignWithTop);
|
|
3182
3349
|
}
|
|
3183
3350
|
}
|
|
3351
|
+
function applyTransform(rect, parsedTransform, transformOrigin) {
|
|
3352
|
+
const { scaleX, scaleY, x: translateX, y: translateY } = parsedTransform;
|
|
3353
|
+
const x = rect.left + translateX + (1 - scaleX) * parseFloat(transformOrigin);
|
|
3354
|
+
const y2 = rect.top + translateY + (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ") + 1));
|
|
3355
|
+
const w2 = scaleX ? rect.width * scaleX : rect.width;
|
|
3356
|
+
const h2 = scaleY ? rect.height * scaleY : rect.height;
|
|
3357
|
+
return {
|
|
3358
|
+
width: w2,
|
|
3359
|
+
height: h2,
|
|
3360
|
+
top: y2,
|
|
3361
|
+
right: x + w2,
|
|
3362
|
+
bottom: y2 + h2,
|
|
3363
|
+
left: x
|
|
3364
|
+
};
|
|
3365
|
+
}
|
|
3184
3366
|
function inverseTransform(rect, parsedTransform, transformOrigin) {
|
|
3185
3367
|
const { scaleX, scaleY, x: translateX, y: translateY } = parsedTransform;
|
|
3186
3368
|
const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin);
|
|
@@ -3199,25 +3381,6 @@ function inverseTransform(rect, parsedTransform, transformOrigin) {
|
|
|
3199
3381
|
function animateTransform({ element, keyframes, options: options2 }) {
|
|
3200
3382
|
return element.animate(keyframes, options2).finished;
|
|
3201
3383
|
}
|
|
3202
|
-
function isKeyframeEffect(effect) {
|
|
3203
|
-
if (!effect) return false;
|
|
3204
|
-
if (effect instanceof KeyframeEffect) return true;
|
|
3205
|
-
return "getKeyframes" in effect && typeof effect.getKeyframes === "function";
|
|
3206
|
-
}
|
|
3207
|
-
function getFinalKeyframe(element, match) {
|
|
3208
|
-
const animations2 = element.getAnimations();
|
|
3209
|
-
if (animations2.length > 0) {
|
|
3210
|
-
for (const animation of animations2) {
|
|
3211
|
-
const { effect } = animation;
|
|
3212
|
-
const keyframes = isKeyframeEffect(effect) ? effect.getKeyframes() : [];
|
|
3213
|
-
const matchedKeyframes = keyframes.filter(match);
|
|
3214
|
-
if (matchedKeyframes.length > 0) {
|
|
3215
|
-
return matchedKeyframes[matchedKeyframes.length - 1];
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
}
|
|
3219
|
-
return null;
|
|
3220
|
-
}
|
|
3221
3384
|
function computeTranslate(element, translate = getComputedStyles(element).translate, projected = true) {
|
|
3222
3385
|
if (projected) {
|
|
3223
3386
|
const keyframe = getFinalKeyframe(
|
|
@@ -3225,7 +3388,7 @@ function computeTranslate(element, translate = getComputedStyles(element).transl
|
|
|
3225
3388
|
(keyframe2) => "translate" in keyframe2
|
|
3226
3389
|
);
|
|
3227
3390
|
if (keyframe) {
|
|
3228
|
-
const { translate: translate2 = "" } = keyframe;
|
|
3391
|
+
const { translate: translate2 = "" } = keyframe[0];
|
|
3229
3392
|
if (typeof translate2 === "string") {
|
|
3230
3393
|
const finalTranslate = parseTranslate(translate2);
|
|
3231
3394
|
if (finalTranslate) {
|
|
@@ -3242,6 +3405,51 @@ function computeTranslate(element, translate = getComputedStyles(element).transl
|
|
|
3242
3405
|
}
|
|
3243
3406
|
return { x: 0, y: 0, z: 0 };
|
|
3244
3407
|
}
|
|
3408
|
+
var scheduler3$1 = new Scheduler$1((callback) => setTimeout(callback, 0));
|
|
3409
|
+
var animations = /* @__PURE__ */ new Map();
|
|
3410
|
+
var clear2 = animations.clear.bind(animations);
|
|
3411
|
+
function getDocumentAnimations(element) {
|
|
3412
|
+
const document2 = element.ownerDocument;
|
|
3413
|
+
let documentAnimations = animations.get(document2);
|
|
3414
|
+
if (documentAnimations) return documentAnimations;
|
|
3415
|
+
documentAnimations = document2.getAnimations();
|
|
3416
|
+
animations.set(document2, documentAnimations);
|
|
3417
|
+
scheduler3$1.schedule(clear2);
|
|
3418
|
+
const elementAnimations = documentAnimations.filter(
|
|
3419
|
+
(animation) => isKeyframeEffect(animation.effect) && animation.effect.target === element
|
|
3420
|
+
);
|
|
3421
|
+
animations.set(element, elementAnimations);
|
|
3422
|
+
return documentAnimations;
|
|
3423
|
+
}
|
|
3424
|
+
function forceFinishAnimations(element, options2) {
|
|
3425
|
+
const animations2 = getDocumentAnimations(element).filter((animation) => {
|
|
3426
|
+
var _a4, _b2;
|
|
3427
|
+
if (isKeyframeEffect(animation.effect)) {
|
|
3428
|
+
const { target } = animation.effect;
|
|
3429
|
+
const isValidTarget = (_b2 = target && ((_a4 = options2.isValidTarget) == null ? void 0 : _a4.call(options2, target))) != null ? _b2 : true;
|
|
3430
|
+
if (isValidTarget) {
|
|
3431
|
+
return animation.effect.getKeyframes().some((keyframe) => {
|
|
3432
|
+
for (const property of options2.properties) {
|
|
3433
|
+
if (keyframe[property]) return true;
|
|
3434
|
+
}
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
}).map((animation) => {
|
|
3439
|
+
const { effect, currentTime } = animation;
|
|
3440
|
+
const duration = effect == null ? void 0 : effect.getComputedTiming().duration;
|
|
3441
|
+
if (animation.pending || animation.playState === "finished") return;
|
|
3442
|
+
if (typeof duration == "number" && typeof currentTime == "number" && currentTime < duration) {
|
|
3443
|
+
animation.currentTime = duration;
|
|
3444
|
+
return () => {
|
|
3445
|
+
animation.currentTime = currentTime;
|
|
3446
|
+
};
|
|
3447
|
+
}
|
|
3448
|
+
});
|
|
3449
|
+
if (animations2.length > 0) {
|
|
3450
|
+
return () => animations2.forEach((reset) => reset == null ? void 0 : reset());
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3245
3453
|
var DOMRectangle = class extends Rectangle {
|
|
3246
3454
|
constructor(element, options2 = {}) {
|
|
3247
3455
|
var _a4, _b2, _c3, _d2;
|
|
@@ -3250,7 +3458,10 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3250
3458
|
ignoreTransforms,
|
|
3251
3459
|
getBoundingClientRect = getBoundingRectangle
|
|
3252
3460
|
} = options2;
|
|
3253
|
-
const resetAnimations = forceFinishAnimations(element
|
|
3461
|
+
const resetAnimations = forceFinishAnimations(element, {
|
|
3462
|
+
properties: ["transform", "translate", "scale", "width", "height"],
|
|
3463
|
+
isValidTarget: (target) => (target !== element || isSafari()) && target.contains(element)
|
|
3464
|
+
});
|
|
3254
3465
|
const boundingRectangle = getBoundingClientRect(element);
|
|
3255
3466
|
let { top, left, width, height } = boundingRectangle;
|
|
3256
3467
|
let updated;
|
|
@@ -3260,8 +3471,8 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3260
3471
|
x: (_a4 = parsedTransform == null ? void 0 : parsedTransform.scaleX) != null ? _a4 : 1,
|
|
3261
3472
|
y: (_b2 = parsedTransform == null ? void 0 : parsedTransform.scaleY) != null ? _b2 : 1
|
|
3262
3473
|
};
|
|
3474
|
+
const projectedTransform = getProjectedTransform(element, computedStyles);
|
|
3263
3475
|
resetAnimations == null ? void 0 : resetAnimations();
|
|
3264
|
-
const projectedTransform = getProjectedTransform(element);
|
|
3265
3476
|
if (parsedTransform) {
|
|
3266
3477
|
updated = inverseTransform(
|
|
3267
3478
|
boundingRectangle,
|
|
@@ -3279,11 +3490,16 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3279
3490
|
width: (_c3 = updated == null ? void 0 : updated.width) != null ? _c3 : width,
|
|
3280
3491
|
height: (_d2 = updated == null ? void 0 : updated.height) != null ? _d2 : height
|
|
3281
3492
|
};
|
|
3282
|
-
if (projectedTransform && !ignoreTransforms) {
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3493
|
+
if (projectedTransform && !ignoreTransforms && updated) {
|
|
3494
|
+
const projected = applyTransform(
|
|
3495
|
+
updated,
|
|
3496
|
+
projectedTransform,
|
|
3497
|
+
computedStyles.transformOrigin
|
|
3498
|
+
);
|
|
3499
|
+
top = projected.top;
|
|
3500
|
+
left = projected.left;
|
|
3501
|
+
width = projected.width;
|
|
3502
|
+
height = projected.height;
|
|
3287
3503
|
scale.x = projectedTransform.scaleX;
|
|
3288
3504
|
scale.y = projectedTransform.scaleY;
|
|
3289
3505
|
}
|
|
@@ -3303,21 +3519,22 @@ var DOMRectangle = class extends Rectangle {
|
|
|
3303
3519
|
this.intrinsicHeight = intrinsic.height;
|
|
3304
3520
|
}
|
|
3305
3521
|
};
|
|
3306
|
-
function getProjectedTransform(element) {
|
|
3522
|
+
function getProjectedTransform(element, computedStyles) {
|
|
3307
3523
|
var _a4;
|
|
3308
3524
|
const animations2 = element.getAnimations();
|
|
3309
3525
|
let projectedTransform = null;
|
|
3310
3526
|
if (!animations2.length) return null;
|
|
3311
3527
|
for (const animation of animations2) {
|
|
3528
|
+
if (animation.playState !== "running") continue;
|
|
3312
3529
|
const keyframes = isKeyframeEffect(animation.effect) ? animation.effect.getKeyframes() : [];
|
|
3313
3530
|
const keyframe = keyframes[keyframes.length - 1];
|
|
3314
3531
|
if (!keyframe) continue;
|
|
3315
|
-
const { transform
|
|
3532
|
+
const { transform, translate, scale } = keyframe;
|
|
3316
3533
|
if (transform || translate || scale) {
|
|
3317
3534
|
const parsedTransform = parseTransform({
|
|
3318
|
-
transform: typeof transform === "string" ? transform :
|
|
3319
|
-
translate: typeof translate === "string" ? translate :
|
|
3320
|
-
scale: typeof scale === "string" ? scale :
|
|
3535
|
+
transform: typeof transform === "string" && transform ? transform : computedStyles.transform,
|
|
3536
|
+
translate: typeof translate === "string" && translate ? translate : computedStyles.translate,
|
|
3537
|
+
scale: typeof scale === "string" && scale ? scale : computedStyles.scale
|
|
3321
3538
|
});
|
|
3322
3539
|
if (parsedTransform) {
|
|
3323
3540
|
projectedTransform = projectedTransform ? {
|
|
@@ -3332,49 +3549,6 @@ function getProjectedTransform(element) {
|
|
|
3332
3549
|
}
|
|
3333
3550
|
return projectedTransform;
|
|
3334
3551
|
}
|
|
3335
|
-
var scheduler3 = new Scheduler((callback) => setTimeout(callback, 0));
|
|
3336
|
-
var animations = /* @__PURE__ */ new Map();
|
|
3337
|
-
var clear2 = animations.clear.bind(animations);
|
|
3338
|
-
function getDocumentAnimations(element) {
|
|
3339
|
-
const document2 = element.ownerDocument;
|
|
3340
|
-
let documentAnimations = animations.get(document2);
|
|
3341
|
-
if (documentAnimations) return documentAnimations;
|
|
3342
|
-
documentAnimations = document2.getAnimations();
|
|
3343
|
-
animations.set(document2, documentAnimations);
|
|
3344
|
-
scheduler3.schedule(clear2);
|
|
3345
|
-
const elementAnimations = documentAnimations.filter(
|
|
3346
|
-
(animation) => isKeyframeEffect(animation.effect) && animation.effect.target === element
|
|
3347
|
-
);
|
|
3348
|
-
animations.set(element, elementAnimations);
|
|
3349
|
-
return documentAnimations;
|
|
3350
|
-
}
|
|
3351
|
-
function forceFinishAnimations(element) {
|
|
3352
|
-
const animations2 = getDocumentAnimations(element).filter((animation) => {
|
|
3353
|
-
if (isKeyframeEffect(animation.effect)) {
|
|
3354
|
-
const { target } = animation.effect;
|
|
3355
|
-
const isValidTarget = target && (isSafari() || target !== element);
|
|
3356
|
-
if (isValidTarget && target.contains(element)) {
|
|
3357
|
-
return animation.effect.getKeyframes().some((keyframe) => {
|
|
3358
|
-
const { transform, translate, scale, width, height } = keyframe;
|
|
3359
|
-
return transform || translate || scale || width || height;
|
|
3360
|
-
});
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
}).map((animation) => {
|
|
3364
|
-
const { effect, currentTime } = animation;
|
|
3365
|
-
const duration = effect == null ? void 0 : effect.getComputedTiming().duration;
|
|
3366
|
-
if (animation.pending) return;
|
|
3367
|
-
if (typeof duration == "number" && typeof currentTime == "number" && currentTime < duration) {
|
|
3368
|
-
animation.currentTime = duration;
|
|
3369
|
-
return () => {
|
|
3370
|
-
animation.currentTime = currentTime;
|
|
3371
|
-
};
|
|
3372
|
-
}
|
|
3373
|
-
});
|
|
3374
|
-
if (animations2.length > 0) {
|
|
3375
|
-
return () => animations2.forEach((reset) => reset == null ? void 0 : reset());
|
|
3376
|
-
}
|
|
3377
|
-
}
|
|
3378
3552
|
function supportsStyle(element) {
|
|
3379
3553
|
return "style" in element && typeof element.style === "object" && element.style !== null && "setProperty" in element.style && "removeProperty" in element.style && typeof element.style.setProperty === "function" && typeof element.style.removeProperty === "function";
|
|
3380
3554
|
}
|
|
@@ -3436,6 +3610,14 @@ function isPointerEvent(event) {
|
|
|
3436
3610
|
const { PointerEvent } = getWindow(event.target);
|
|
3437
3611
|
return event instanceof PointerEvent;
|
|
3438
3612
|
}
|
|
3613
|
+
function isTextInput(target) {
|
|
3614
|
+
if (!isElement(target)) return false;
|
|
3615
|
+
const { tagName } = target;
|
|
3616
|
+
return tagName === "INPUT" || tagName === "TEXTAREA" || isContentEditable(target);
|
|
3617
|
+
}
|
|
3618
|
+
function isContentEditable(element) {
|
|
3619
|
+
return element.hasAttribute("contenteditable") && element.getAttribute("contenteditable") !== "false";
|
|
3620
|
+
}
|
|
3439
3621
|
var ids = {};
|
|
3440
3622
|
function generateUniqueId(prefix) {
|
|
3441
3623
|
const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
|
|
@@ -3537,7 +3719,7 @@ var defaultAnnouncements = {
|
|
|
3537
3719
|
return `Picked up draggable item ${source.id}.`;
|
|
3538
3720
|
},
|
|
3539
3721
|
dragover({ operation: { source, target } }) {
|
|
3540
|
-
if (!source) return;
|
|
3722
|
+
if (!source || source.id === (target == null ? void 0 : target.id)) return;
|
|
3541
3723
|
if (target) {
|
|
3542
3724
|
return `Draggable item ${source.id} was moved over droppable target ${target.id}.`;
|
|
3543
3725
|
}
|
|
@@ -3583,6 +3765,7 @@ function createLiveRegion(id) {
|
|
|
3583
3765
|
element.style.setProperty("white-space", "nowrap");
|
|
3584
3766
|
return element;
|
|
3585
3767
|
}
|
|
3768
|
+
var debouncedEvents = ["dragover", "dragmove"];
|
|
3586
3769
|
var Accessibility = class extends Plugin {
|
|
3587
3770
|
constructor(manager, options2) {
|
|
3588
3771
|
super(manager);
|
|
@@ -3593,71 +3776,137 @@ var Accessibility = class extends Plugin {
|
|
|
3593
3776
|
announcement: announcementPrefix = defaultAnnouncementIdPrefix
|
|
3594
3777
|
} = {},
|
|
3595
3778
|
announcements = defaultAnnouncements,
|
|
3596
|
-
screenReaderInstructions = defaultScreenReaderInstructions
|
|
3779
|
+
screenReaderInstructions = defaultScreenReaderInstructions,
|
|
3780
|
+
debounce: debounceMs = 500
|
|
3597
3781
|
} = options2 != null ? options2 : {};
|
|
3598
3782
|
const descriptionId = id ? `${descriptionPrefix}-${id}` : generateUniqueId(descriptionPrefix);
|
|
3599
3783
|
const announcementId = id ? `${announcementPrefix}-${id}` : generateUniqueId(announcementPrefix);
|
|
3600
3784
|
let hiddenTextElement;
|
|
3601
3785
|
let liveRegionElement;
|
|
3786
|
+
let liveRegionTextNode;
|
|
3787
|
+
let latestAnnouncement;
|
|
3788
|
+
const updateAnnouncement = (value = latestAnnouncement) => {
|
|
3789
|
+
if (!liveRegionTextNode || !value) return;
|
|
3790
|
+
if ((liveRegionTextNode == null ? void 0 : liveRegionTextNode.nodeValue) !== value) {
|
|
3791
|
+
liveRegionTextNode.nodeValue = value;
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
const scheduleUpdateAnnouncement = () => scheduler.schedule(updateAnnouncement);
|
|
3795
|
+
const debouncedUpdateAnnouncement = debounce(
|
|
3796
|
+
scheduleUpdateAnnouncement,
|
|
3797
|
+
debounceMs
|
|
3798
|
+
);
|
|
3602
3799
|
const eventListeners = Object.entries(announcements).map(
|
|
3603
3800
|
([eventName, getAnnouncement]) => {
|
|
3604
3801
|
return this.manager.monitor.addEventListener(
|
|
3605
3802
|
eventName,
|
|
3606
3803
|
(event, manager2) => {
|
|
3804
|
+
const element = liveRegionTextNode;
|
|
3805
|
+
if (!element) return;
|
|
3607
3806
|
const announcement = getAnnouncement == null ? void 0 : getAnnouncement(event, manager2);
|
|
3608
|
-
if (announcement &&
|
|
3609
|
-
|
|
3807
|
+
if (announcement && element.nodeValue !== announcement) {
|
|
3808
|
+
latestAnnouncement = announcement;
|
|
3809
|
+
if (debouncedEvents.includes(eventName)) {
|
|
3810
|
+
debouncedUpdateAnnouncement();
|
|
3811
|
+
} else {
|
|
3812
|
+
scheduleUpdateAnnouncement();
|
|
3813
|
+
debouncedUpdateAnnouncement.cancel();
|
|
3814
|
+
}
|
|
3610
3815
|
}
|
|
3611
3816
|
}
|
|
3612
3817
|
);
|
|
3613
3818
|
}
|
|
3614
3819
|
);
|
|
3615
3820
|
const initialize = () => {
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3821
|
+
let elements = [];
|
|
3822
|
+
if (!(hiddenTextElement == null ? void 0 : hiddenTextElement.isConnected)) {
|
|
3823
|
+
hiddenTextElement = createHiddenText(
|
|
3824
|
+
descriptionId,
|
|
3825
|
+
screenReaderInstructions.draggable
|
|
3826
|
+
);
|
|
3827
|
+
elements.push(hiddenTextElement);
|
|
3828
|
+
}
|
|
3829
|
+
if (!(liveRegionElement == null ? void 0 : liveRegionElement.isConnected)) {
|
|
3830
|
+
liveRegionElement = createLiveRegion(announcementId);
|
|
3831
|
+
liveRegionTextNode = document.createTextNode("");
|
|
3832
|
+
liveRegionElement.appendChild(liveRegionTextNode);
|
|
3833
|
+
elements.push(liveRegionElement);
|
|
3834
|
+
}
|
|
3835
|
+
if (elements.length > 0) {
|
|
3836
|
+
document.body.append(...elements);
|
|
3837
|
+
}
|
|
3622
3838
|
};
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3839
|
+
const mutations = /* @__PURE__ */ new Set();
|
|
3840
|
+
function executeMutations() {
|
|
3841
|
+
for (const operation of mutations) {
|
|
3842
|
+
operation();
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
this.registerEffect(() => {
|
|
3846
|
+
var _a4;
|
|
3847
|
+
mutations.clear();
|
|
3848
|
+
for (const draggable of this.manager.registry.draggables.value) {
|
|
3849
|
+
const activator = (_a4 = draggable.handle) != null ? _a4 : draggable.element;
|
|
3627
3850
|
if (activator) {
|
|
3628
3851
|
if (!hiddenTextElement || !liveRegionElement) {
|
|
3629
|
-
initialize
|
|
3852
|
+
mutations.add(initialize);
|
|
3630
3853
|
}
|
|
3631
3854
|
if ((!isFocusable(activator) || isSafari()) && !activator.hasAttribute("tabindex")) {
|
|
3632
|
-
activator.setAttribute("tabindex", "0");
|
|
3855
|
+
mutations.add(() => activator.setAttribute("tabindex", "0"));
|
|
3633
3856
|
}
|
|
3634
3857
|
if (!activator.hasAttribute("role") && !(activator.tagName.toLowerCase() === "button")) {
|
|
3635
|
-
|
|
3858
|
+
mutations.add(
|
|
3859
|
+
() => activator.setAttribute("role", defaultAttributes.role)
|
|
3860
|
+
);
|
|
3636
3861
|
}
|
|
3637
|
-
if (!activator.hasAttribute("
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3862
|
+
if (!activator.hasAttribute("aria-roledescription")) {
|
|
3863
|
+
mutations.add(
|
|
3864
|
+
() => activator.setAttribute(
|
|
3865
|
+
"aria-roledescription",
|
|
3866
|
+
defaultAttributes.roleDescription
|
|
3867
|
+
)
|
|
3641
3868
|
);
|
|
3642
3869
|
}
|
|
3643
3870
|
if (!activator.hasAttribute("aria-describedby")) {
|
|
3644
|
-
|
|
3871
|
+
mutations.add(
|
|
3872
|
+
() => activator.setAttribute("aria-describedby", descriptionId)
|
|
3873
|
+
);
|
|
3645
3874
|
}
|
|
3646
3875
|
for (const key of ["aria-pressed", "aria-grabbed"]) {
|
|
3647
|
-
|
|
3876
|
+
const value = String(draggable.isDragging);
|
|
3877
|
+
if (activator.getAttribute(key) !== value) {
|
|
3878
|
+
mutations.add(() => activator.setAttribute(key, value));
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
const disabled = String(draggable.disabled);
|
|
3882
|
+
if (activator.getAttribute("aria-disabled") !== disabled) {
|
|
3883
|
+
mutations.add(
|
|
3884
|
+
() => activator.setAttribute("aria-disabled", disabled)
|
|
3885
|
+
);
|
|
3648
3886
|
}
|
|
3649
|
-
activator.setAttribute("aria-disabled", String(draggable.disabled));
|
|
3650
3887
|
}
|
|
3651
3888
|
}
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
eventListeners.forEach((unsubscribe) => unsubscribe());
|
|
3656
|
-
cleanupEffects();
|
|
3657
|
-
};
|
|
3889
|
+
if (mutations.size > 0) {
|
|
3890
|
+
scheduler.schedule(executeMutations);
|
|
3891
|
+
}
|
|
3658
3892
|
});
|
|
3893
|
+
this.destroy = () => {
|
|
3894
|
+
super.destroy();
|
|
3895
|
+
hiddenTextElement == null ? void 0 : hiddenTextElement.remove();
|
|
3896
|
+
liveRegionElement == null ? void 0 : liveRegionElement.remove();
|
|
3897
|
+
eventListeners.forEach((unsubscribe) => unsubscribe());
|
|
3898
|
+
};
|
|
3659
3899
|
}
|
|
3660
3900
|
};
|
|
3901
|
+
function debounce(fn, wait) {
|
|
3902
|
+
let timeout2;
|
|
3903
|
+
const debounced = () => {
|
|
3904
|
+
clearTimeout(timeout2);
|
|
3905
|
+
timeout2 = setTimeout(fn, wait);
|
|
3906
|
+
};
|
|
3907
|
+
debounced.cancel = () => clearTimeout(timeout2);
|
|
3908
|
+
return debounced;
|
|
3909
|
+
}
|
|
3661
3910
|
var Cursor = class extends Plugin {
|
|
3662
3911
|
constructor(manager, options2) {
|
|
3663
3912
|
super(manager, options2);
|
|
@@ -3710,7 +3959,6 @@ var CSS_RULES = `
|
|
|
3710
3959
|
max-width: var(${CSS_PREFIX}width, auto);
|
|
3711
3960
|
height: var(${CSS_PREFIX}height, auto);
|
|
3712
3961
|
max-height: var(${CSS_PREFIX}height, auto);
|
|
3713
|
-
box-sizing: border-box;
|
|
3714
3962
|
transition: var(${CSS_PREFIX}transition) !important;
|
|
3715
3963
|
}
|
|
3716
3964
|
|
|
@@ -3752,6 +4000,7 @@ var CSS_RULES = `
|
|
|
3752
4000
|
}
|
|
3753
4001
|
[${ATTRIBUTE}]::backdrop, [${ATTR_PREFIX}overlay]:not([${ATTRIBUTE}]) {
|
|
3754
4002
|
display: none;
|
|
4003
|
+
visibility: hidden;
|
|
3755
4004
|
}
|
|
3756
4005
|
`.replace(/\n+/g, " ").replace(/\s+/g, " ").trim();
|
|
3757
4006
|
function createPlaceholder(source, type = "hidden") {
|
|
@@ -3822,10 +4071,11 @@ function preventPopoverClose(event) {
|
|
|
3822
4071
|
function isTableRow(element) {
|
|
3823
4072
|
return element.tagName === "TR";
|
|
3824
4073
|
}
|
|
4074
|
+
var styleSheetRegistry = /* @__PURE__ */ new Map();
|
|
3825
4075
|
var _overlay_dec, _a$1, _init$2, _overlay, _Feedback_instances, render_fn, injectStyles_fn;
|
|
3826
4076
|
var _Feedback = class _Feedback2 extends (_a$1 = Plugin, _overlay_dec = [reactive], _a$1) {
|
|
3827
4077
|
constructor(manager, options2) {
|
|
3828
|
-
super(manager);
|
|
4078
|
+
super(manager, options2);
|
|
3829
4079
|
__privateAdd$2(this, _Feedback_instances);
|
|
3830
4080
|
__privateAdd$2(this, _overlay, __runInitializers$2(_init$2, 8, this)), __runInitializers$2(_init$2, 11, this);
|
|
3831
4081
|
this.state = {
|
|
@@ -3837,8 +4087,15 @@ var _Feedback = class _Feedback2 extends (_a$1 = Plugin, _overlay_dec = [reactiv
|
|
|
3837
4087
|
}
|
|
3838
4088
|
destroy() {
|
|
3839
4089
|
super.destroy();
|
|
3840
|
-
|
|
3841
|
-
|
|
4090
|
+
for (const [doc, registration] of styleSheetRegistry.entries()) {
|
|
4091
|
+
if (registration.instances.has(this)) {
|
|
4092
|
+
registration.instances.delete(this);
|
|
4093
|
+
if (registration.instances.size === 0) {
|
|
4094
|
+
registration.cleanup();
|
|
4095
|
+
styleSheetRegistry.delete(doc);
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
3842
4099
|
}
|
|
3843
4100
|
};
|
|
3844
4101
|
_init$2 = __decoratorStart$2(_a$1);
|
|
@@ -3881,8 +4138,23 @@ render_fn = function() {
|
|
|
3881
4138
|
let elementMutationObserver;
|
|
3882
4139
|
let documentMutationObserver;
|
|
3883
4140
|
const styles = new Styles(feedbackElement);
|
|
3884
|
-
const {
|
|
4141
|
+
const {
|
|
4142
|
+
transition,
|
|
4143
|
+
translate,
|
|
4144
|
+
boxSizing,
|
|
4145
|
+
paddingBlockStart,
|
|
4146
|
+
paddingBlockEnd,
|
|
4147
|
+
paddingInlineStart,
|
|
4148
|
+
paddingInlineEnd,
|
|
4149
|
+
borderInlineStartWidth,
|
|
4150
|
+
borderInlineEndWidth,
|
|
4151
|
+
borderBlockStartWidth,
|
|
4152
|
+
borderBlockEndWidth
|
|
4153
|
+
} = getComputedStyles(element);
|
|
3885
4154
|
const clone = feedback === "clone";
|
|
4155
|
+
const contentBox = boxSizing === "content-box";
|
|
4156
|
+
const widthOffset = contentBox ? parseInt(paddingInlineStart) + parseInt(paddingInlineEnd) + parseInt(borderInlineStartWidth) + parseInt(borderInlineEndWidth) : 0;
|
|
4157
|
+
const heightOffset = contentBox ? parseInt(paddingBlockStart) + parseInt(paddingBlockEnd) + parseInt(borderBlockStartWidth) + parseInt(borderBlockEndWidth) : 0;
|
|
3886
4158
|
const placeholder = feedback !== "move" && !this.overlay ? createPlaceholder(source, clone ? "clone" : "hidden") : null;
|
|
3887
4159
|
const isKeyboardOperation = n(
|
|
3888
4160
|
() => isKeyboardEvent(manager.dragOperation.activatorEvent)
|
|
@@ -3943,15 +4215,16 @@ render_fn = function() {
|
|
|
3943
4215
|
const tX = transform.x * frameTransform.scaleX + initialTranslate.x;
|
|
3944
4216
|
const tY = transform.y * frameTransform.scaleY + initialTranslate.y;
|
|
3945
4217
|
const translateString = `${tX}px ${tY}px 0`;
|
|
4218
|
+
const transitionString = transition ? `${transition}, translate 0ms linear` : "";
|
|
3946
4219
|
styles.set(
|
|
3947
4220
|
{
|
|
3948
|
-
width,
|
|
3949
|
-
height,
|
|
4221
|
+
width: width - widthOffset,
|
|
4222
|
+
height: height - heightOffset,
|
|
3950
4223
|
top: projected.top,
|
|
3951
4224
|
left: projected.left,
|
|
3952
4225
|
translate: translateString,
|
|
4226
|
+
transition: transitionString,
|
|
3953
4227
|
scale: crossFrame ? `${scaleDelta.x} ${scaleDelta.y}` : "",
|
|
3954
|
-
transition,
|
|
3955
4228
|
"transform-origin": `${transformOrigin.x * 100}% ${transformOrigin.y * 100}%`
|
|
3956
4229
|
},
|
|
3957
4230
|
CSS_PREFIX
|
|
@@ -3981,8 +4254,8 @@ render_fn = function() {
|
|
|
3981
4254
|
const dY = (height - placeholderShape.height) * origin.y + delta.y;
|
|
3982
4255
|
styles.set(
|
|
3983
4256
|
{
|
|
3984
|
-
width: placeholderShape.width,
|
|
3985
|
-
height: placeholderShape.height,
|
|
4257
|
+
width: placeholderShape.width - widthOffset,
|
|
4258
|
+
height: placeholderShape.height - heightOffset,
|
|
3986
4259
|
top: top + dY,
|
|
3987
4260
|
left: left + dX
|
|
3988
4261
|
},
|
|
@@ -3997,9 +4270,17 @@ render_fn = function() {
|
|
|
3997
4270
|
cell.style.width = `${placeholderCell.offsetWidth}px`;
|
|
3998
4271
|
}
|
|
3999
4272
|
}
|
|
4000
|
-
dragOperation.shape = new DOMRectangle(
|
|
4273
|
+
dragOperation.shape = new DOMRectangle(feedbackElement);
|
|
4001
4274
|
});
|
|
4002
|
-
|
|
4275
|
+
const initialShape = new DOMRectangle(feedbackElement);
|
|
4276
|
+
n(() => dragOperation.shape = initialShape);
|
|
4277
|
+
const feedbackWindow = getWindow(feedbackElement);
|
|
4278
|
+
const handleWindowResize = (event) => {
|
|
4279
|
+
this.manager.actions.stop({ event });
|
|
4280
|
+
};
|
|
4281
|
+
if (isKeyboardOperation) {
|
|
4282
|
+
feedbackWindow.addEventListener("resize", handleWindowResize);
|
|
4283
|
+
}
|
|
4003
4284
|
if (n(() => source.status) === "idle") {
|
|
4004
4285
|
requestAnimationFrame(() => source.status = "dragging");
|
|
4005
4286
|
}
|
|
@@ -4085,6 +4366,12 @@ render_fn = function() {
|
|
|
4085
4366
|
x: transform2.x / frameTransform.scaleX + initialTranslate2.x,
|
|
4086
4367
|
y: transform2.y / frameTransform.scaleY + initialTranslate2.y
|
|
4087
4368
|
};
|
|
4369
|
+
const previousTranslate = state.current.translate;
|
|
4370
|
+
const modifiers = n(() => dragOperation.modifiers);
|
|
4371
|
+
const currentShape = n(() => {
|
|
4372
|
+
var _a6;
|
|
4373
|
+
return (_a6 = dragOperation.shape) == null ? void 0 : _a6.current;
|
|
4374
|
+
});
|
|
4088
4375
|
const translateTransition = isKeyboardOperation ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
|
|
4089
4376
|
styles.set(
|
|
4090
4377
|
{
|
|
@@ -4094,17 +4381,15 @@ render_fn = function() {
|
|
|
4094
4381
|
CSS_PREFIX
|
|
4095
4382
|
);
|
|
4096
4383
|
elementMutationObserver == null ? void 0 : elementMutationObserver.takeRecords();
|
|
4097
|
-
|
|
4098
|
-
const modifiers = n(() => dragOperation.modifiers);
|
|
4099
|
-
const currentShape = n(() => {
|
|
4100
|
-
var _a6;
|
|
4101
|
-
return (_a6 = dragOperation.shape) == null ? void 0 : _a6.current;
|
|
4102
|
-
});
|
|
4103
|
-
if (currentShape && previousTranslate && !modifiers.length) {
|
|
4384
|
+
if (currentShape && currentShape !== initialShape && previousTranslate && !modifiers.length) {
|
|
4104
4385
|
const delta2 = Point$1.delta(translate2, previousTranslate);
|
|
4105
4386
|
dragOperation.shape = Rectangle.from(
|
|
4106
4387
|
currentShape.boundingRectangle
|
|
4107
|
-
).translate(
|
|
4388
|
+
).translate(
|
|
4389
|
+
// Need to take into account frame transform when optimistically updating shape
|
|
4390
|
+
delta2.x * frameTransform.scaleX,
|
|
4391
|
+
delta2.y * frameTransform.scaleY
|
|
4392
|
+
);
|
|
4108
4393
|
} else {
|
|
4109
4394
|
dragOperation.shape = new DOMRectangle(feedbackElement);
|
|
4110
4395
|
}
|
|
@@ -4128,6 +4413,7 @@ render_fn = function() {
|
|
|
4128
4413
|
elementMutationObserver == null ? void 0 : elementMutationObserver.disconnect();
|
|
4129
4414
|
documentMutationObserver == null ? void 0 : documentMutationObserver.disconnect();
|
|
4130
4415
|
resizeObserver.disconnect();
|
|
4416
|
+
feedbackWindow.removeEventListener("resize", handleWindowResize);
|
|
4131
4417
|
if (supportsPopover(feedbackElement)) {
|
|
4132
4418
|
feedbackElement.removeEventListener(
|
|
4133
4419
|
"beforetoggle",
|
|
@@ -4164,27 +4450,25 @@ render_fn = function() {
|
|
|
4164
4450
|
return;
|
|
4165
4451
|
}
|
|
4166
4452
|
const dropAnimation = () => {
|
|
4453
|
+
var _a5, _b3;
|
|
4167
4454
|
{
|
|
4168
4455
|
showPopover(feedbackElement);
|
|
4456
|
+
const [, animation] = (_a5 = getFinalKeyframe(
|
|
4457
|
+
feedbackElement,
|
|
4458
|
+
(keyframe) => "translate" in keyframe
|
|
4459
|
+
)) != null ? _a5 : [];
|
|
4460
|
+
animation == null ? void 0 : animation.pause();
|
|
4169
4461
|
const target = placeholder != null ? placeholder : element;
|
|
4170
|
-
const animations2 = feedbackElement.getAnimations();
|
|
4171
|
-
if (animations2.length) {
|
|
4172
|
-
animations2.forEach((animation) => {
|
|
4173
|
-
const { effect: effect9 } = animation;
|
|
4174
|
-
if (isKeyframeEffect(effect9) && effect9.getKeyframes().some((keyframe) => keyframe.translate)) {
|
|
4175
|
-
animation.finish();
|
|
4176
|
-
}
|
|
4177
|
-
});
|
|
4178
|
-
}
|
|
4179
4462
|
const options22 = {
|
|
4180
4463
|
frameTransform: isSameFrame(feedbackElement, target) ? null : void 0
|
|
4181
4464
|
};
|
|
4182
4465
|
const current = new DOMRectangle(feedbackElement, options22);
|
|
4466
|
+
const currentTranslate = (_b3 = parseTranslate(getComputedStyles(feedbackElement).translate)) != null ? _b3 : translate2;
|
|
4183
4467
|
const final = new DOMRectangle(target, options22);
|
|
4184
4468
|
const delta2 = Rectangle.delta(current, final, source.alignment);
|
|
4185
4469
|
const finalTranslate = {
|
|
4186
|
-
x:
|
|
4187
|
-
y:
|
|
4470
|
+
x: currentTranslate.x - delta2.x,
|
|
4471
|
+
y: currentTranslate.y - delta2.y
|
|
4188
4472
|
};
|
|
4189
4473
|
const heightKeyframes = Math.round(current.intrinsicHeight) !== Math.round(final.intrinsicHeight) ? {
|
|
4190
4474
|
minHeight: [
|
|
@@ -4213,7 +4497,7 @@ render_fn = function() {
|
|
|
4213
4497
|
element: feedbackElement,
|
|
4214
4498
|
keyframes: __spreadProps$4(__spreadValues$4(__spreadValues$4({}, heightKeyframes), widthKeyframes), {
|
|
4215
4499
|
translate: [
|
|
4216
|
-
`${
|
|
4500
|
+
`${currentTranslate.x}px ${currentTranslate.y}px 0`,
|
|
4217
4501
|
`${finalTranslate.x}px ${finalTranslate.y}px 0`
|
|
4218
4502
|
]
|
|
4219
4503
|
}),
|
|
@@ -4223,6 +4507,7 @@ render_fn = function() {
|
|
|
4223
4507
|
}
|
|
4224
4508
|
}).then(() => {
|
|
4225
4509
|
feedbackElement.removeAttribute(DROPPING_ATTRIBUTE);
|
|
4510
|
+
animation == null ? void 0 : animation.finish();
|
|
4226
4511
|
onComplete == null ? void 0 : onComplete();
|
|
4227
4512
|
requestAnimationFrame(restoreFocus);
|
|
4228
4513
|
});
|
|
@@ -4236,17 +4521,37 @@ render_fn = function() {
|
|
|
4236
4521
|
injectStyles_fn = function() {
|
|
4237
4522
|
var _a4, _b2;
|
|
4238
4523
|
const { status, source, target } = this.manager.dragOperation;
|
|
4239
|
-
if (status.
|
|
4524
|
+
if (status.initializing) {
|
|
4240
4525
|
const sourceDocument = getDocument((_a4 = source == null ? void 0 : source.element) != null ? _a4 : null);
|
|
4241
4526
|
const targetDocument = getDocument((_b2 = target == null ? void 0 : target.element) != null ? _b2 : null);
|
|
4242
4527
|
const documents = /* @__PURE__ */ new Set([sourceDocument, targetDocument]);
|
|
4243
4528
|
for (const doc of documents) {
|
|
4244
|
-
|
|
4529
|
+
let registration = styleSheetRegistry.get(doc);
|
|
4530
|
+
if (!registration) {
|
|
4245
4531
|
const style = document.createElement("style");
|
|
4246
4532
|
style.textContent = CSS_RULES;
|
|
4247
4533
|
doc.head.prepend(style);
|
|
4248
|
-
|
|
4534
|
+
const mutationObserver = new MutationObserver((entries) => {
|
|
4535
|
+
for (const entry of entries) {
|
|
4536
|
+
if (entry.type === "childList") {
|
|
4537
|
+
const removedNodes = Array.from(entry.removedNodes);
|
|
4538
|
+
if (removedNodes.length > 0 && removedNodes.includes(style)) {
|
|
4539
|
+
doc.head.prepend(style);
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
}
|
|
4543
|
+
});
|
|
4544
|
+
mutationObserver.observe(doc.head, { childList: true });
|
|
4545
|
+
registration = {
|
|
4546
|
+
cleanup: () => {
|
|
4547
|
+
mutationObserver.disconnect();
|
|
4548
|
+
style.remove();
|
|
4549
|
+
},
|
|
4550
|
+
instances: /* @__PURE__ */ new Set()
|
|
4551
|
+
};
|
|
4552
|
+
styleSheetRegistry.set(doc, registration);
|
|
4249
4553
|
}
|
|
4554
|
+
registration.instances.add(this);
|
|
4250
4555
|
}
|
|
4251
4556
|
}
|
|
4252
4557
|
};
|
|
@@ -4254,7 +4559,6 @@ __decorateElement$2(_init$2, 4, "overlay", _overlay_dec, _Feedback, _overlay);
|
|
|
4254
4559
|
__decoratorMetadata$2(_init$2, _Feedback);
|
|
4255
4560
|
_Feedback.configure = configurator(_Feedback);
|
|
4256
4561
|
var Feedback = _Feedback;
|
|
4257
|
-
var injectedStyleTags = /* @__PURE__ */ new Map();
|
|
4258
4562
|
var LOCKED = true;
|
|
4259
4563
|
var UNLOCKED = false;
|
|
4260
4564
|
var _dec, _a2, _dec2, _b, _init2, __b, __a;
|
|
@@ -4488,6 +4792,41 @@ function getScrollIntent(value) {
|
|
|
4488
4792
|
}
|
|
4489
4793
|
return ScrollDirection.Idle;
|
|
4490
4794
|
}
|
|
4795
|
+
var Scheduler2 = class {
|
|
4796
|
+
constructor(scheduler5) {
|
|
4797
|
+
this.scheduler = scheduler5;
|
|
4798
|
+
this.pending = false;
|
|
4799
|
+
this.tasks = /* @__PURE__ */ new Set();
|
|
4800
|
+
this.resolvers = /* @__PURE__ */ new Set();
|
|
4801
|
+
this.flush = () => {
|
|
4802
|
+
const { tasks, resolvers } = this;
|
|
4803
|
+
this.pending = false;
|
|
4804
|
+
this.tasks = /* @__PURE__ */ new Set();
|
|
4805
|
+
this.resolvers = /* @__PURE__ */ new Set();
|
|
4806
|
+
for (const task of tasks) {
|
|
4807
|
+
task();
|
|
4808
|
+
}
|
|
4809
|
+
for (const resolve of resolvers) {
|
|
4810
|
+
resolve();
|
|
4811
|
+
}
|
|
4812
|
+
};
|
|
4813
|
+
}
|
|
4814
|
+
schedule(task) {
|
|
4815
|
+
this.tasks.add(task);
|
|
4816
|
+
if (!this.pending) {
|
|
4817
|
+
this.pending = true;
|
|
4818
|
+
this.scheduler(this.flush);
|
|
4819
|
+
}
|
|
4820
|
+
return new Promise((resolve) => this.resolvers.add(resolve));
|
|
4821
|
+
}
|
|
4822
|
+
};
|
|
4823
|
+
var scheduler3 = new Scheduler2((callback) => {
|
|
4824
|
+
if (typeof requestAnimationFrame === "function") {
|
|
4825
|
+
requestAnimationFrame(callback);
|
|
4826
|
+
} else {
|
|
4827
|
+
callback();
|
|
4828
|
+
}
|
|
4829
|
+
});
|
|
4491
4830
|
var AUTOSCROLL_INTERVAL = 10;
|
|
4492
4831
|
var AutoScroller = class extends Plugin {
|
|
4493
4832
|
constructor(manager, _options) {
|
|
@@ -4505,7 +4844,10 @@ var AutoScroller = class extends Plugin {
|
|
|
4505
4844
|
const canScroll2 = scroller.scroll();
|
|
4506
4845
|
if (canScroll2) {
|
|
4507
4846
|
scroller.autoScrolling = true;
|
|
4508
|
-
const interval = setInterval(
|
|
4847
|
+
const interval = setInterval(
|
|
4848
|
+
() => scheduler3.schedule(scroller.scroll),
|
|
4849
|
+
AUTOSCROLL_INTERVAL
|
|
4850
|
+
);
|
|
4509
4851
|
return () => {
|
|
4510
4852
|
clearInterval(interval);
|
|
4511
4853
|
};
|
|
@@ -4669,7 +5011,6 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
|
|
|
4669
5011
|
if (controller.signal.aborted) return this.cleanup();
|
|
4670
5012
|
this.sideEffects();
|
|
4671
5013
|
const sourceDocument = getDocument(element);
|
|
4672
|
-
const sourceWindow = getWindow(sourceDocument);
|
|
4673
5014
|
const listeners = [
|
|
4674
5015
|
this.listeners.bind(sourceDocument, [
|
|
4675
5016
|
{
|
|
@@ -4677,9 +5018,6 @@ var _KeyboardSensor = class _KeyboardSensor2 extends Sensor {
|
|
|
4677
5018
|
listener: (event2) => this.handleKeyDown(event2, source, options2),
|
|
4678
5019
|
options: { capture: true }
|
|
4679
5020
|
}
|
|
4680
|
-
]),
|
|
4681
|
-
this.listeners.bind(sourceWindow, [
|
|
4682
|
-
{ type: "resize", listener: () => this.handleEnd(event, true) }
|
|
4683
5021
|
])
|
|
4684
5022
|
];
|
|
4685
5023
|
__privateGet$2(this, _cleanupFunctions).push(...listeners);
|
|
@@ -4784,6 +5122,11 @@ var defaults2 = Object.freeze({
|
|
|
4784
5122
|
delay: { value: 250, tolerance: 5 }
|
|
4785
5123
|
};
|
|
4786
5124
|
}
|
|
5125
|
+
if (isTextInput(target) && !event.defaultPrevented) {
|
|
5126
|
+
return {
|
|
5127
|
+
delay: { value: 200, tolerance: 0 }
|
|
5128
|
+
};
|
|
5129
|
+
}
|
|
4787
5130
|
return {
|
|
4788
5131
|
delay: { value: 200, tolerance: 10 },
|
|
4789
5132
|
distance: { value: 5 }
|
|
@@ -5168,7 +5511,7 @@ var Droppable2 = class extends (_c2 = Droppable$1, _element_dec2 = [reactive], _
|
|
|
5168
5511
|
() => {
|
|
5169
5512
|
const { element: element2 } = this;
|
|
5170
5513
|
if (observePosition.value && element2) {
|
|
5171
|
-
const positionObserver = new
|
|
5514
|
+
const positionObserver = new FrameObserver(
|
|
5172
5515
|
element2,
|
|
5173
5516
|
updateShape
|
|
5174
5517
|
);
|
|
@@ -5554,23 +5897,24 @@ var OptimisticSortingPlugin = class extends Plugin {
|
|
|
5554
5897
|
};
|
|
5555
5898
|
const unsubscribe = [
|
|
5556
5899
|
manager.monitor.addEventListener("dragover", (event, manager2) => {
|
|
5900
|
+
if (this.disabled) {
|
|
5901
|
+
return;
|
|
5902
|
+
}
|
|
5903
|
+
const { dragOperation } = manager2;
|
|
5904
|
+
const { source, target } = dragOperation;
|
|
5905
|
+
if (!isSortable(source) || !isSortable(target)) {
|
|
5906
|
+
return;
|
|
5907
|
+
}
|
|
5908
|
+
if (source.sortable === target.sortable) {
|
|
5909
|
+
return;
|
|
5910
|
+
}
|
|
5911
|
+
const instances = getSortableInstances();
|
|
5912
|
+
const sameGroup = source.sortable.group === target.sortable.group;
|
|
5913
|
+
const sourceInstances = instances.get(source.sortable.group);
|
|
5914
|
+
const targetInstances = sameGroup ? sourceInstances : instances.get(target.sortable.group);
|
|
5915
|
+
if (!sourceInstances || !targetInstances) return;
|
|
5557
5916
|
queueMicrotask(() => {
|
|
5558
|
-
if (
|
|
5559
|
-
return;
|
|
5560
|
-
}
|
|
5561
|
-
const { dragOperation } = manager2;
|
|
5562
|
-
const { source, target } = dragOperation;
|
|
5563
|
-
if (!isSortable(source) || !isSortable(target)) {
|
|
5564
|
-
return;
|
|
5565
|
-
}
|
|
5566
|
-
if (source.sortable === target.sortable) {
|
|
5567
|
-
return;
|
|
5568
|
-
}
|
|
5569
|
-
const instances = getSortableInstances();
|
|
5570
|
-
const sameGroup = source.sortable.group === target.sortable.group;
|
|
5571
|
-
const sourceInstances = instances.get(source.sortable.group);
|
|
5572
|
-
const targetInstances = sameGroup ? sourceInstances : instances.get(target.sortable.group);
|
|
5573
|
-
if (!sourceInstances || !targetInstances) return;
|
|
5917
|
+
if (event.defaultPrevented) return;
|
|
5574
5918
|
manager2.renderer.rendering.then(() => {
|
|
5575
5919
|
var _a4, _b2, _c3;
|
|
5576
5920
|
const newInstances = getSortableInstances();
|
|
@@ -6031,13 +6375,6 @@ function currentValue(value) {
|
|
|
6031
6375
|
}
|
|
6032
6376
|
return value;
|
|
6033
6377
|
}
|
|
6034
|
-
function useConstant(initializer) {
|
|
6035
|
-
const ref = useRef(null);
|
|
6036
|
-
if (!ref.current) {
|
|
6037
|
-
ref.current = initializer();
|
|
6038
|
-
}
|
|
6039
|
-
return ref.current;
|
|
6040
|
-
}
|
|
6041
6378
|
var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
6042
6379
|
var useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
|
6043
6380
|
function useForceUpdate() {
|
|
@@ -6133,41 +6470,42 @@ var defaultManager = new DragDropManager2();
|
|
|
6133
6470
|
var DragDropContext = createContext(
|
|
6134
6471
|
defaultManager
|
|
6135
6472
|
);
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6473
|
+
var Renderer = memo(
|
|
6474
|
+
forwardRef(({ children }, ref) => {
|
|
6475
|
+
const [transitionCount, setTransitionCount] = useState(0);
|
|
6476
|
+
const rendering = useRef(null);
|
|
6477
|
+
const resolver = useRef(null);
|
|
6478
|
+
const renderer = useMemo(
|
|
6479
|
+
() => ({
|
|
6480
|
+
renderer: {
|
|
6481
|
+
get rendering() {
|
|
6482
|
+
var _a22;
|
|
6483
|
+
return (_a22 = rendering.current) != null ? _a22 : Promise.resolve();
|
|
6484
|
+
}
|
|
6485
|
+
},
|
|
6486
|
+
trackRendering(callback) {
|
|
6487
|
+
if (!rendering.current) {
|
|
6488
|
+
rendering.current = new Promise((resolve) => {
|
|
6489
|
+
resolver.current = resolve;
|
|
6490
|
+
});
|
|
6491
|
+
}
|
|
6492
|
+
startTransition(() => {
|
|
6493
|
+
callback();
|
|
6494
|
+
setTransitionCount((count) => count + 1);
|
|
6495
|
+
});
|
|
6496
|
+
}
|
|
6497
|
+
}),
|
|
6498
|
+
[]
|
|
6499
|
+
);
|
|
6500
|
+
useIsomorphicLayoutEffect(() => {
|
|
6150
6501
|
var _a22;
|
|
6151
6502
|
(_a22 = resolver.current) == null ? void 0 : _a22.call(resolver);
|
|
6152
6503
|
rendering.current = null;
|
|
6153
|
-
},
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
trackRendering(callback) {
|
|
6159
|
-
if (!rendering.current) {
|
|
6160
|
-
rendering.current = new Promise((resolve) => {
|
|
6161
|
-
resolver.current = resolve;
|
|
6162
|
-
});
|
|
6163
|
-
}
|
|
6164
|
-
startTransition2(() => {
|
|
6165
|
-
callback();
|
|
6166
|
-
setTransitionCount((count) => count + 1);
|
|
6167
|
-
});
|
|
6168
|
-
}
|
|
6169
|
-
};
|
|
6170
|
-
}
|
|
6504
|
+
}, [children, transitionCount]);
|
|
6505
|
+
useImperativeHandle(ref, () => renderer);
|
|
6506
|
+
return null;
|
|
6507
|
+
})
|
|
6508
|
+
);
|
|
6171
6509
|
var options = [void 0, deepEqual];
|
|
6172
6510
|
function DragDropProvider(_a22) {
|
|
6173
6511
|
var _b2 = _a22, {
|
|
@@ -6188,10 +6526,8 @@ function DragDropProvider(_a22) {
|
|
|
6188
6526
|
"onDragEnd"
|
|
6189
6527
|
]);
|
|
6190
6528
|
var _a32;
|
|
6191
|
-
const
|
|
6192
|
-
const [manager, setManager] = useState(
|
|
6193
|
-
(_a32 = input.manager) != null ? _a32 : null
|
|
6194
|
-
);
|
|
6529
|
+
const rendererRef = useRef(null);
|
|
6530
|
+
const [manager, setManager] = useState((_a32 = input.manager) != null ? _a32 : null);
|
|
6195
6531
|
const { plugins, modifiers, sensors } = input;
|
|
6196
6532
|
const handleBeforeDragStart = useLatest(onBeforeDragStart);
|
|
6197
6533
|
const handleDragStart = useLatest(onDragStart);
|
|
@@ -6201,49 +6537,51 @@ function DragDropProvider(_a22) {
|
|
|
6201
6537
|
const handleCollision = useLatest(onCollision);
|
|
6202
6538
|
useEffect(() => {
|
|
6203
6539
|
var _a4;
|
|
6540
|
+
if (!rendererRef.current) throw new Error("Renderer not found");
|
|
6541
|
+
const { renderer, trackRendering } = rendererRef.current;
|
|
6204
6542
|
const manager2 = (_a4 = input.manager) != null ? _a4 : new DragDropManager2(input);
|
|
6205
6543
|
manager2.renderer = renderer;
|
|
6206
|
-
manager2.monitor.addEventListener("beforedragstart", (event
|
|
6544
|
+
manager2.monitor.addEventListener("beforedragstart", (event) => {
|
|
6207
6545
|
const callback = handleBeforeDragStart.current;
|
|
6208
6546
|
if (callback) {
|
|
6209
|
-
trackRendering(() => callback(event,
|
|
6547
|
+
trackRendering(() => callback(event, manager2));
|
|
6210
6548
|
}
|
|
6211
6549
|
});
|
|
6212
6550
|
manager2.monitor.addEventListener(
|
|
6213
6551
|
"dragstart",
|
|
6214
|
-
(event
|
|
6552
|
+
(event) => {
|
|
6215
6553
|
var _a5;
|
|
6216
|
-
return (_a5 = handleDragStart.current) == null ? void 0 : _a5.call(handleDragStart, event,
|
|
6554
|
+
return (_a5 = handleDragStart.current) == null ? void 0 : _a5.call(handleDragStart, event, manager2);
|
|
6217
6555
|
}
|
|
6218
6556
|
);
|
|
6219
|
-
manager2.monitor.addEventListener("dragover", (event
|
|
6557
|
+
manager2.monitor.addEventListener("dragover", (event) => {
|
|
6220
6558
|
const callback = handleDragOver.current;
|
|
6221
6559
|
if (callback) {
|
|
6222
|
-
trackRendering(() => callback(event,
|
|
6560
|
+
trackRendering(() => callback(event, manager2));
|
|
6223
6561
|
}
|
|
6224
6562
|
});
|
|
6225
|
-
manager2.monitor.addEventListener("dragmove", (event
|
|
6563
|
+
manager2.monitor.addEventListener("dragmove", (event) => {
|
|
6226
6564
|
const callback = handleDragMove.current;
|
|
6227
6565
|
if (callback) {
|
|
6228
|
-
trackRendering(() => callback(event,
|
|
6566
|
+
trackRendering(() => callback(event, manager2));
|
|
6229
6567
|
}
|
|
6230
6568
|
});
|
|
6231
|
-
manager2.monitor.addEventListener("dragend", (event
|
|
6569
|
+
manager2.monitor.addEventListener("dragend", (event) => {
|
|
6232
6570
|
const callback = handleDragEnd.current;
|
|
6233
6571
|
if (callback) {
|
|
6234
|
-
trackRendering(() => callback(event,
|
|
6572
|
+
trackRendering(() => callback(event, manager2));
|
|
6235
6573
|
}
|
|
6236
6574
|
});
|
|
6237
6575
|
manager2.monitor.addEventListener(
|
|
6238
6576
|
"collision",
|
|
6239
|
-
(event
|
|
6577
|
+
(event) => {
|
|
6240
6578
|
var _a5;
|
|
6241
|
-
return (_a5 = handleCollision.current) == null ? void 0 : _a5.call(handleCollision, event,
|
|
6579
|
+
return (_a5 = handleCollision.current) == null ? void 0 : _a5.call(handleCollision, event, manager2);
|
|
6242
6580
|
}
|
|
6243
6581
|
);
|
|
6244
6582
|
startTransition(() => setManager(manager2));
|
|
6245
6583
|
return manager2.destroy;
|
|
6246
|
-
}, [
|
|
6584
|
+
}, [input.manager]);
|
|
6247
6585
|
useOnValueChange(
|
|
6248
6586
|
plugins,
|
|
6249
6587
|
() => manager && (manager.plugins = plugins != null ? plugins : defaultPreset.plugins),
|
|
@@ -6259,7 +6597,10 @@ function DragDropProvider(_a22) {
|
|
|
6259
6597
|
() => manager && (manager.modifiers = modifiers != null ? modifiers : defaultPreset.modifiers),
|
|
6260
6598
|
...options
|
|
6261
6599
|
);
|
|
6262
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ jsxs(DragDropContext.Provider, { value: manager, children: [
|
|
6601
|
+
/* @__PURE__ */ jsx(Renderer, { ref: rendererRef, children }),
|
|
6602
|
+
children
|
|
6603
|
+
] });
|
|
6263
6604
|
}
|
|
6264
6605
|
function useDragDropManager() {
|
|
6265
6606
|
return useContext(DragDropContext);
|