@eightshift/ui-components 6.0.6 → 6.0.9
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-BXjXzdW_.js → Button-JRIu2BnS.js} +8 -8
- package/dist/{Dialog-D8bjn-nh.js → Dialog-Dd1yqNus.js} +31 -27
- package/dist/{FieldError-DwBG6m1U.js → FieldError-DmVwL6Dj.js} +2 -2
- package/dist/{FocusScope-BMk5oZCk.js → FocusScope-Dri1oBcH.js} +2 -2
- package/dist/{Heading-BmRX4BRL.js → Heading-eA6LXIKB.js} +1 -1
- package/dist/{Input-CNNksOWg.js → Input-Cuw9UbNb.js} +14 -24
- package/dist/{Label-D8a3eYb-.js → Label-DPWyf-gp.js} +1 -1
- package/dist/{List-BGHOoFf0.js → List-CWheI3JH.js} +1 -1
- package/dist/{ListBox-Dd37zMvs.js → ListBox-DT1sFY3e.js} +17 -16
- package/dist/{OverlayArrow-DokC40S3.js → OverlayArrow-DVJTTfZM.js} +67 -123
- package/dist/{RadioGroup-BVFvITWO.js → RadioGroup-Cp5cdBI_.js} +14 -14
- package/dist/{SearchField-CHYnN-jt.js → SearchField-CLhr5PGZ.js} +44 -37
- package/dist/{SelectionManager-N8X7T_4D.js → SelectionManager-DbBiF5M8.js} +41 -68
- package/dist/{SharedElementTransition-BDT84GtD.js → SharedElementTransition-B_vnQ1uR.js} +1 -1
- package/dist/{Slider-CL5CM9S8.js → Slider-CZV3HhHY.js} +119 -83
- package/dist/{Text-ztX6G1zR.js → Text-Dae33gHp.js} +1 -1
- package/dist/{VisuallyHidden-DTUuKFiI.js → VisuallyHidden-eaCBtXhE.js} +2 -2
- package/dist/animation-DY7CNkr6.js +67 -0
- package/dist/assets/style-admin.css +38 -45
- package/dist/assets/style-editor.css +38 -45
- package/dist/assets/style.css +38 -45
- package/dist/assets/wp-overrides/allow-full-width-blocks.css +1 -1
- package/dist/assets/wp-overrides/fix-label-text-case.css +1 -1
- package/dist/assets/wp-overrides/increase-sidebar-width.css +1 -1
- package/dist/assets/wp-overrides/make-block-messages-nicer.css +1 -1
- package/dist/assets/wp-overrides/replace-fonts.css +1 -1
- package/dist/assets/wp-overrides/restyle-tooltips.css +1 -1
- package/dist/assets/wp-overrides/round-corners.css +1 -1
- package/dist/assets/wp-overrides/unify-button-sizes.css +1 -1
- package/dist/{color-swatch-BEBLRxTy.js → color-swatch-CZj0jHZd.js} +4 -4
- package/dist/components/animated-visibility/animated-visibility.js +2 -2
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/checkbox/checkbox.js +10 -10
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +17 -17
- package/dist/components/draggable/draggable.js +43 -44
- package/dist/components/draggable-list/draggable-list.js +11 -16
- package/dist/components/expandable/expandable.js +13 -12
- package/dist/components/index.js +1 -1
- package/dist/components/input-field/input-field.js +8 -8
- package/dist/components/link-input/link-input.js +25 -25
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/modal/modal.js +19 -12
- 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 +5 -5
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/repeater/repeater-item.js +3 -2
- package/dist/components/repeater/repeater.js +23 -23
- package/dist/components/responsive/mini-responsive.js +1 -1
- package/dist/components/select/async-multi-select.js +10 -10
- package/dist/components/select/async-select.js +10 -10
- package/dist/components/select/multi-select.js +10 -10
- package/dist/components/select/shared.js +3 -3
- package/dist/components/select/single-select.js +10 -10
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/smart-image/smart-image.js +1 -1
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/tabs/tabs.js +36 -17
- package/dist/components/toggle/switch.js +7 -7
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +6 -6
- package/dist/components/tooltip/tooltip.js +10 -8
- package/dist/{context-BQvmiUqb.js → context-DYYO3Ns3.js} +9 -6
- package/dist/{filterDOMProps-D2C6R0DK.js → filterDOMProps-eGTqWSTd.js} +1 -1
- package/dist/{general-ChNQK6O9.js → general-C8Q0dvEx.js} +15 -14
- package/dist/{index-oFgxU4zs.js → index-sSixe2j_.js} +20 -20
- package/dist/index.js +1 -1
- package/dist/{proxy-DkQpcQgI.js → proxy-Bj4KTTJt.js} +190 -119
- package/dist/{shared-DOxXagm0.js → shared-Bg9lx3pE.js} +20 -20
- package/dist/{textSelection-CwHUtNVX.js → textSelection-Cq_Br7RW.js} +1 -1
- package/dist/{useAsyncList-D52mQcrH.js → useAsyncList-DsZvQXls.js} +5 -2
- package/dist/{useButton-DdZrS1Kz.js → useButton-CeuyDay5.js} +4 -4
- package/dist/{useEvent-BD7Olibq.js → useEvent-DoWvho2u.js} +2 -3
- package/dist/{useFilter-bhxeEDg8.js → useFilter-DYtfYPua.js} +1 -1
- package/dist/{useFocusRing-D3b7Kh4P.js → useFocusRing-WEswknAY.js} +1 -1
- package/dist/{useFormReset-WUv2PdFO.js → useFormReset-BDF1K4E4.js} +2 -3
- package/dist/{useFormValidation-DQeXkyLm.js → useFormValidation-Dqzjv4jX.js} +2 -5
- package/dist/{useHover-Bycb7BsD.js → useHover-CG39Ci3A.js} +164 -66
- package/dist/{useLabel-Bnv4-T24.js → useLabel--3fT2XKM.js} +2 -2
- package/dist/{useLabels-B49ptFDX.js → useLabels-vzdDMGCX.js} +1 -1
- package/dist/{useListState-ZKhRO8ML.js → useListState-Bya9g7W8.js} +1 -1
- package/dist/{useLocalizedStringFormatter-NETP-8H8.js → useLocalizedStringFormatter-M3L6Ge2c.js} +3 -3
- package/dist/{useNumberField-D2fUHql3.js → useNumberField-D6lsi3Vu.js} +91 -24
- package/dist/{useNumberFormatter-DGvuRCn7.js → useNumberFormatter-BWOyCamK.js} +1 -1
- package/dist/{usePress-B8OteQMu.js → usePress-B9w0X4Ur.js} +168 -180
- package/dist/{useSingleSelectListState-BBTu4shO.js → useSingleSelectListState-D9SqGLJ0.js} +2 -2
- package/dist/{useToggle-BZhaYwZl.js → useToggle-Deq2xxQV.js} +5 -5
- package/dist/{useToggleState-VkXJjsru.js → useToggleState-j3o1PvdS.js} +1 -1
- package/dist/utilities/general.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/{utils-DGpXyJOJ.js → utils-HC9_3Crc.js} +20 -31
- package/dist/workers/image-analysis.worker.js +1 -1
- package/package.json +19 -19
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import $dbSRa$react__default, { useRef, useState, useEffect, useMemo, cloneElement, forwardRef, useContext, createContext, useCallback, isValidElement } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { $ as $
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { $ as $
|
|
2
|
+
import { D as $c87311424ea30a05$export$9ac100e40613ea10, f as $03deb23ff14920c4$export$4eaf04e54aa8eed6, d as $431fbd86ca7dc216$export$b204af158042fbac, A as $7215afc6de606d6b$export$de79e2c695e052f3, h as $d4ee10de306f2510$export$cd4e5573fbe2b576, K as $c87311424ea30a05$export$e1865c3bedcd822b, L as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, s as $3ad3f6e1647bc98d$export$80f3e147d781571c, v as $507fabe10e71c6fb$export$630ff653c5ada6a9, q as $b4b717babfbb907b$export$bebd5a1431fec25d, J as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, M as $f645667febf57a63$export$f9762fab77588ecb, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-CG39Ci3A.js";
|
|
3
|
+
import { b as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $3ef42575df84b30b$export$9d1611c77c2fe928, c as $bdb11010cef70236$export$f680877a34711e37, n as $ff5963eb1fccf552$export$e08e3b67e392101e, l as $b5e257d569688ac6$export$535bd6ca7f90a273 } from "./utils-HC9_3Crc.js";
|
|
4
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-DoWvho2u.js";
|
|
5
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-Dri1oBcH.js";
|
|
6
|
+
import { r as reactDomExports } from "./index-sSixe2j_.js";
|
|
7
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-DYYO3Ns3.js";
|
|
8
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-B9w0X4Ur.js";
|
|
9
9
|
import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-Rfj-STx7.js";
|
|
10
10
|
function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
|
|
11
11
|
const isInitialMount = useRef(true);
|
|
@@ -98,7 +98,6 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
98
98
|
let x = scrollView.scrollLeft;
|
|
99
99
|
let y = scrollView.scrollTop;
|
|
100
100
|
let { borderTopWidth, borderLeftWidth, scrollPaddingTop, scrollPaddingRight, scrollPaddingBottom, scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
101
|
-
let { scrollMarginTop, scrollMarginRight, scrollMarginBottom, scrollMarginLeft } = getComputedStyle(element);
|
|
102
101
|
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
103
102
|
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
104
103
|
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
@@ -107,35 +106,12 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
107
106
|
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
108
107
|
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
109
108
|
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
let targetTop = offsetY - scrollMarginTopNumber;
|
|
117
|
-
let targetBottom = offsetY + height + scrollMarginBottomNumber;
|
|
118
|
-
let scrollPortLeft = x + parseInt(borderLeftWidth, 10) + scrollPaddingLeftNumber;
|
|
119
|
-
let scrollPortRight = maxX - scrollPaddingRightNumber;
|
|
120
|
-
let scrollPortTop = y + parseInt(borderTopWidth, 10) + scrollPaddingTopNumber;
|
|
121
|
-
let scrollPortBottom = maxY - scrollPaddingBottomNumber;
|
|
122
|
-
if (targetLeft > scrollPortLeft || targetRight < scrollPortRight) {
|
|
123
|
-
if (targetLeft <= x + scrollPaddingLeftNumber) x = targetLeft - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
124
|
-
else if (targetRight > maxX - scrollPaddingRightNumber) x += targetRight - maxX + scrollPaddingRightNumber;
|
|
125
|
-
}
|
|
126
|
-
if (targetTop > scrollPortTop || targetBottom < scrollPortBottom) {
|
|
127
|
-
if (targetTop <= borderAdjustedY + scrollPaddingTopNumber) y = targetTop - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
128
|
-
else if (targetBottom > maxY - scrollPaddingBottomNumber) y += targetBottom - maxY + scrollPaddingBottomNumber;
|
|
129
|
-
}
|
|
130
|
-
if (process.env.NODE_ENV === "test") {
|
|
131
|
-
scrollView.scrollLeft = x;
|
|
132
|
-
scrollView.scrollTop = y;
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
scrollView.scrollTo({
|
|
136
|
-
left: x,
|
|
137
|
-
top: y
|
|
138
|
-
});
|
|
109
|
+
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
110
|
+
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
|
|
111
|
+
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
112
|
+
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
|
|
113
|
+
scrollView.scrollLeft = x;
|
|
114
|
+
scrollView.scrollTop = y;
|
|
139
115
|
}
|
|
140
116
|
function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
141
117
|
const prop = axis === "left" ? "offsetLeft" : "offsetTop";
|
|
@@ -155,7 +131,7 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
155
131
|
if (targetElement && document.contains(targetElement)) {
|
|
156
132
|
let root = document.scrollingElement || document.documentElement;
|
|
157
133
|
let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
|
|
158
|
-
if (!isScrollPrevented
|
|
134
|
+
if (!isScrollPrevented) {
|
|
159
135
|
var _targetElement_scrollIntoView;
|
|
160
136
|
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
161
137
|
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
@@ -174,6 +150,7 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
174
150
|
}
|
|
175
151
|
} else {
|
|
176
152
|
let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
|
|
153
|
+
if (!isScrollPrevented) scrollParents.push(root);
|
|
177
154
|
for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
178
155
|
}
|
|
179
156
|
}
|
|
@@ -463,7 +440,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
463
440
|
last = walker.lastChild();
|
|
464
441
|
if (last) next = last;
|
|
465
442
|
} while (last);
|
|
466
|
-
if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
|
|
443
|
+
if (next && (!next.contains(document.activeElement) || document.activeElement && !$b4b717babfbb907b$export$bebd5a1431fec25d(document.activeElement))) $7215afc6de606d6b$export$de79e2c695e052f3(next);
|
|
467
444
|
}
|
|
468
445
|
break;
|
|
469
446
|
}
|
|
@@ -525,34 +502,28 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
525
502
|
manager.setFocused(true);
|
|
526
503
|
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === "first") shouldVirtualFocusFirst.current = true;
|
|
527
504
|
});
|
|
528
|
-
let updateActiveDescendant = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
529
|
-
var _delegate_getFirstKey;
|
|
530
|
-
var _delegate_getFirstKey1;
|
|
531
|
-
let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
532
|
-
if (keyToFocus == null) {
|
|
533
|
-
let previousActiveElement = $d4ee10de306f2510$export$cd4e5573fbe2b576();
|
|
534
|
-
$55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
|
|
535
|
-
$55f9b1ae81f22853$export$2b35b76d2e30e129(previousActiveElement, null);
|
|
536
|
-
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
537
|
-
} else {
|
|
538
|
-
manager.setFocusedKey(keyToFocus);
|
|
539
|
-
shouldVirtualFocusFirst.current = false;
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
505
|
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
543
|
-
if (shouldVirtualFocusFirst.current)
|
|
506
|
+
if (shouldVirtualFocusFirst.current) {
|
|
507
|
+
var _delegate_getFirstKey;
|
|
508
|
+
var _delegate_getFirstKey1;
|
|
509
|
+
let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
510
|
+
if (keyToFocus == null) {
|
|
511
|
+
let previousActiveElement = $d4ee10de306f2510$export$cd4e5573fbe2b576();
|
|
512
|
+
$55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
|
|
513
|
+
$55f9b1ae81f22853$export$2b35b76d2e30e129(previousActiveElement, null);
|
|
514
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
515
|
+
} else {
|
|
516
|
+
manager.setFocusedKey(keyToFocus);
|
|
517
|
+
shouldVirtualFocusFirst.current = false;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
544
520
|
}, [
|
|
545
|
-
manager.collection
|
|
546
|
-
updateActiveDescendant
|
|
521
|
+
manager.collection
|
|
547
522
|
]);
|
|
548
|
-
let resetFocusFirstFlag = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
549
|
-
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
550
|
-
});
|
|
551
523
|
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
552
|
-
|
|
524
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
553
525
|
}, [
|
|
554
|
-
manager.focusedKey
|
|
555
|
-
resetFocusFirstFlag
|
|
526
|
+
manager.focusedKey
|
|
556
527
|
]);
|
|
557
528
|
$e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
|
|
558
529
|
var _e_detail;
|
|
@@ -1524,6 +1495,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
1524
1495
|
node.rendered = rendered;
|
|
1525
1496
|
node.render = render;
|
|
1526
1497
|
node.value = value1;
|
|
1498
|
+
if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
|
|
1527
1499
|
node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
|
|
1528
1500
|
if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
|
|
1529
1501
|
if (props.colSpan != null) node.colSpan = props.colSpan;
|
|
@@ -1656,7 +1628,7 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
1656
1628
|
var _rendered_props_id, _ref;
|
|
1657
1629
|
let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
|
|
1658
1630
|
if (key == null) throw new Error("Could not determine key for item");
|
|
1659
|
-
if (idScope) key = idScope + ":" + key;
|
|
1631
|
+
if (idScope != null) key = idScope + ":" + key;
|
|
1660
1632
|
rendered = cloneElement(rendered, addIdAndValue ? {
|
|
1661
1633
|
key,
|
|
1662
1634
|
id: key,
|
|
@@ -1956,7 +1928,8 @@ const $e1995378a142960e$var$CollectionContext = /* @__PURE__ */ createContext(nu
|
|
|
1956
1928
|
function $e1995378a142960e$export$fb8073518f34e6ec(props) {
|
|
1957
1929
|
let ctx = useContext($e1995378a142960e$var$CollectionContext);
|
|
1958
1930
|
let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
|
|
1959
|
-
|
|
1931
|
+
var _props_idScope;
|
|
1932
|
+
let idScope = (_props_idScope = props.idScope) !== null && _props_idScope !== void 0 ? _props_idScope : ctx === null || ctx === void 0 ? void 0 : ctx.idScope;
|
|
1960
1933
|
let children = $e1995378a142960e$var$useCollectionChildren({
|
|
1961
1934
|
...props,
|
|
1962
1935
|
idScope,
|
|
@@ -2027,7 +2000,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
|
|
|
2027
2000
|
let afterIndicators = [];
|
|
2028
2001
|
if (nextItemInSameLevel == null) {
|
|
2029
2002
|
let current = node;
|
|
2030
|
-
while (current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
|
|
2003
|
+
while ((current === null || current === void 0 ? void 0 : current.type) === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
|
|
2031
2004
|
let indicator = renderDropIndicator({
|
|
2032
2005
|
type: "item",
|
|
2033
2006
|
key: current.key,
|
|
@@ -2465,9 +2438,9 @@ export {
|
|
|
2465
2438
|
$7135fc7d473fd974$export$d40e14dec8b060a8 as k,
|
|
2466
2439
|
$23b9f4fcf0fe224b$export$8258a0665a675899 as l,
|
|
2467
2440
|
$ae20dd8cbca75726$export$d6daf82dcd84e87c as m,
|
|
2468
|
-
$
|
|
2469
|
-
$
|
|
2470
|
-
$7135fc7d473fd974$export$
|
|
2441
|
+
$23b9f4fcf0fe224b$export$d68d59712b04d9d1 as n,
|
|
2442
|
+
$7135fc7d473fd974$export$90e00781bc59d8f9 as o,
|
|
2443
|
+
$7135fc7d473fd974$export$a164736487e3f0ae as p,
|
|
2471
2444
|
$c5a24bc478652b5f$export$1005530eda016c13 as q,
|
|
2472
2445
|
$55f9b1ae81f22853$export$2b35b76d2e30e129 as r,
|
|
2473
2446
|
$fb3050f43d946246$export$e32c88dfddc6e1d8 as s,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-sSixe2j_.js";
|
|
2
2
|
import $dbSRa$react__default, { useRef, createContext } from "react";
|
|
3
3
|
const $c8a5a149f625efcf$var$SharedElementContext = /* @__PURE__ */ createContext(null);
|
|
4
4
|
function $c8a5a149f625efcf$export$758399f318e6385a(props) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-
|
|
3
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-
|
|
4
|
-
import $dbSRa$react__default, { useRef,
|
|
5
|
-
import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-
|
|
6
|
-
import {
|
|
1
|
+
import { b as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, e as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$4d86445c2cf5e3, h as $64fa3d84918910a7$export$2881499e37b75b9a, d as $64fa3d84918910a7$export$fabf2dc03a41866e } from "./utils-HC9_3Crc.js";
|
|
2
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-DPWyf-gp.js";
|
|
3
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-eGTqWSTd.js";
|
|
4
|
+
import $dbSRa$react__default, { useRef, useCallback, useState, useMemo, useEffect, forwardRef, createContext, useContext } from "react";
|
|
5
|
+
import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-BWOyCamK.js";
|
|
6
|
+
import { f as $03deb23ff14920c4$export$4eaf04e54aa8eed6, b as $8ae05eaa5c114e9c$export$7f54fc3180508a52, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715, w as $507fabe10e71c6fb$export$8397ddfc504fdb9a, A as $7215afc6de606d6b$export$de79e2c695e052f3, B as $46d819fcbaf35654$export$8f71654801c2f7cd, $ as $f645667febf57a63$export$4c014de7c8940b4c, x as $6179b936705e76d3$export$ae780daf29e6d456 } from "./useHover-CG39Ci3A.js";
|
|
7
7
|
import { a as $9446cca9a3875146$export$cb6e0bb50bc19463, $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-7sOvrqo0.js";
|
|
8
|
-
import { $ as $14c0b72509d70225$export$b0d6fa1ab32e3295, a as $14c0b72509d70225$export$16a4697467175487 } from "./textSelection-
|
|
9
|
-
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel
|
|
10
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
11
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-
|
|
12
|
-
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-
|
|
13
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-
|
|
8
|
+
import { $ as $14c0b72509d70225$export$b0d6fa1ab32e3295, a as $14c0b72509d70225$export$16a4697467175487 } from "./textSelection-Cq_Br7RW.js";
|
|
9
|
+
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel--3fT2XKM.js";
|
|
10
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-DYYO3Ns3.js";
|
|
11
|
+
import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-BDF1K4E4.js";
|
|
12
|
+
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-WEswknAY.js";
|
|
13
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-eaCBtXhE.js";
|
|
14
14
|
function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
15
15
|
let { onMoveStart, onMove, onMoveEnd } = props;
|
|
16
16
|
let state = useRef({
|
|
@@ -19,7 +19,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
19
19
|
id: null
|
|
20
20
|
});
|
|
21
21
|
let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
22
|
-
let move =
|
|
22
|
+
let move = useCallback((originalEvent, pointerType, deltaX, deltaY) => {
|
|
23
23
|
if (deltaX === 0 && deltaY === 0) return;
|
|
24
24
|
if (!state.current.didMove) {
|
|
25
25
|
state.current.didMove = true;
|
|
@@ -42,8 +42,13 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
42
42
|
ctrlKey: originalEvent.ctrlKey,
|
|
43
43
|
altKey: originalEvent.altKey
|
|
44
44
|
});
|
|
45
|
-
}
|
|
46
|
-
|
|
45
|
+
}, [
|
|
46
|
+
onMoveStart,
|
|
47
|
+
onMove,
|
|
48
|
+
state
|
|
49
|
+
]);
|
|
50
|
+
let moveEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(move);
|
|
51
|
+
let end = useCallback((originalEvent, pointerType) => {
|
|
47
52
|
$14c0b72509d70225$export$b0d6fa1ab32e3295();
|
|
48
53
|
if (state.current.didMove) onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd({
|
|
49
54
|
type: "moveend",
|
|
@@ -53,45 +58,72 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
53
58
|
ctrlKey: originalEvent.ctrlKey,
|
|
54
59
|
altKey: originalEvent.altKey
|
|
55
60
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
let
|
|
65
|
-
if (e.
|
|
61
|
+
}, [
|
|
62
|
+
onMoveEnd,
|
|
63
|
+
state
|
|
64
|
+
]);
|
|
65
|
+
let endEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(end);
|
|
66
|
+
let [pointerDown, setPointerDown] = useState(null);
|
|
67
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
68
|
+
if (pointerDown === "pointer") {
|
|
69
|
+
let onPointerMove = (e) => {
|
|
70
|
+
if (e.pointerId === state.current.id) {
|
|
66
71
|
var _state_current_lastPosition, _state_current_lastPosition1;
|
|
72
|
+
let pointerType = e.pointerType || "mouse";
|
|
67
73
|
var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
|
|
68
|
-
|
|
74
|
+
moveEvent(e, pointerType, e.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
|
|
69
75
|
state.current.lastPosition = {
|
|
70
76
|
pageX: e.pageX,
|
|
71
77
|
pageY: e.pageY
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
80
|
};
|
|
75
|
-
let
|
|
76
|
-
if (e.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
let onPointerUp = (e) => {
|
|
82
|
+
if (e.pointerId === state.current.id) {
|
|
83
|
+
let pointerType = e.pointerType || "mouse";
|
|
84
|
+
endEvent(e, pointerType);
|
|
85
|
+
state.current.id = null;
|
|
86
|
+
removeGlobalListener(window, "pointermove", onPointerMove, false);
|
|
87
|
+
removeGlobalListener(window, "pointerup", onPointerUp, false);
|
|
88
|
+
removeGlobalListener(window, "pointercancel", onPointerUp, false);
|
|
89
|
+
setPointerDown(null);
|
|
80
90
|
}
|
|
81
91
|
};
|
|
82
|
-
|
|
92
|
+
addGlobalListener(window, "pointermove", onPointerMove, false);
|
|
93
|
+
addGlobalListener(window, "pointerup", onPointerUp, false);
|
|
94
|
+
addGlobalListener(window, "pointercancel", onPointerUp, false);
|
|
95
|
+
return () => {
|
|
96
|
+
removeGlobalListener(window, "pointermove", onPointerMove, false);
|
|
97
|
+
removeGlobalListener(window, "pointerup", onPointerUp, false);
|
|
98
|
+
removeGlobalListener(window, "pointercancel", onPointerUp, false);
|
|
99
|
+
};
|
|
100
|
+
} else if (pointerDown === "mouse" && process.env.NODE_ENV === "test") {
|
|
101
|
+
let onMouseMove = (e) => {
|
|
83
102
|
if (e.button === 0) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
e.
|
|
103
|
+
var _state_current_lastPosition, _state_current_lastPosition1;
|
|
104
|
+
var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
|
|
105
|
+
moveEvent(e, "mouse", e.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
|
|
87
106
|
state.current.lastPosition = {
|
|
88
107
|
pageX: e.pageX,
|
|
89
108
|
pageY: e.pageY
|
|
90
109
|
};
|
|
91
|
-
addGlobalListener(window, "mousemove", onMouseMove, false);
|
|
92
|
-
addGlobalListener(window, "mouseup", onMouseUp, false);
|
|
93
110
|
}
|
|
94
111
|
};
|
|
112
|
+
let onMouseUp = (e) => {
|
|
113
|
+
if (e.button === 0) {
|
|
114
|
+
endEvent(e, "mouse");
|
|
115
|
+
removeGlobalListener(window, "mousemove", onMouseMove, false);
|
|
116
|
+
removeGlobalListener(window, "mouseup", onMouseUp, false);
|
|
117
|
+
setPointerDown(null);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
addGlobalListener(window, "mousemove", onMouseMove, false);
|
|
121
|
+
addGlobalListener(window, "mouseup", onMouseUp, false);
|
|
122
|
+
return () => {
|
|
123
|
+
removeGlobalListener(window, "mousemove", onMouseMove, false);
|
|
124
|
+
removeGlobalListener(window, "mouseup", onMouseUp, false);
|
|
125
|
+
};
|
|
126
|
+
} else if (pointerDown === "touch" && process.env.NODE_ENV === "test") {
|
|
95
127
|
let onTouchMove = (e) => {
|
|
96
128
|
let touch = [
|
|
97
129
|
...e.changedTouches
|
|
@@ -100,7 +132,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
100
132
|
var _state_current_lastPosition, _state_current_lastPosition1;
|
|
101
133
|
let { pageX, pageY } = e.changedTouches[touch];
|
|
102
134
|
var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
|
|
103
|
-
|
|
135
|
+
moveEvent(e, "touch", pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
|
|
104
136
|
state.current.lastPosition = {
|
|
105
137
|
pageX,
|
|
106
138
|
pageY
|
|
@@ -112,11 +144,45 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
112
144
|
...e.changedTouches
|
|
113
145
|
].findIndex(({ identifier }) => identifier === state.current.id);
|
|
114
146
|
if (touch >= 0) {
|
|
115
|
-
|
|
147
|
+
endEvent(e, "touch");
|
|
116
148
|
state.current.id = null;
|
|
117
149
|
removeGlobalListener(window, "touchmove", onTouchMove);
|
|
118
150
|
removeGlobalListener(window, "touchend", onTouchEnd);
|
|
119
151
|
removeGlobalListener(window, "touchcancel", onTouchEnd);
|
|
152
|
+
setPointerDown(null);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
addGlobalListener(window, "touchmove", onTouchMove, false);
|
|
156
|
+
addGlobalListener(window, "touchend", onTouchEnd, false);
|
|
157
|
+
addGlobalListener(window, "touchcancel", onTouchEnd, false);
|
|
158
|
+
return () => {
|
|
159
|
+
removeGlobalListener(window, "touchmove", onTouchMove, false);
|
|
160
|
+
removeGlobalListener(window, "touchend", onTouchEnd, false);
|
|
161
|
+
removeGlobalListener(window, "touchcancel", onTouchEnd, false);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}, [
|
|
165
|
+
pointerDown,
|
|
166
|
+
addGlobalListener,
|
|
167
|
+
removeGlobalListener
|
|
168
|
+
]);
|
|
169
|
+
let moveProps = useMemo(() => {
|
|
170
|
+
let moveProps2 = {};
|
|
171
|
+
let start = () => {
|
|
172
|
+
$14c0b72509d70225$export$16a4697467175487();
|
|
173
|
+
state.current.didMove = false;
|
|
174
|
+
};
|
|
175
|
+
if (typeof PointerEvent === "undefined" && process.env.NODE_ENV === "test") {
|
|
176
|
+
moveProps2.onMouseDown = (e) => {
|
|
177
|
+
if (e.button === 0) {
|
|
178
|
+
start();
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
state.current.lastPosition = {
|
|
182
|
+
pageX: e.pageX,
|
|
183
|
+
pageY: e.pageY
|
|
184
|
+
};
|
|
185
|
+
setPointerDown("mouse");
|
|
120
186
|
}
|
|
121
187
|
};
|
|
122
188
|
moveProps2.onTouchStart = (e) => {
|
|
@@ -130,49 +196,21 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
130
196
|
pageY
|
|
131
197
|
};
|
|
132
198
|
state.current.id = identifier;
|
|
133
|
-
|
|
134
|
-
addGlobalListener(window, "touchend", onTouchEnd, false);
|
|
135
|
-
addGlobalListener(window, "touchcancel", onTouchEnd, false);
|
|
136
|
-
};
|
|
137
|
-
} else {
|
|
138
|
-
let onPointerMove = (e) => {
|
|
139
|
-
if (e.pointerId === state.current.id) {
|
|
140
|
-
var _state_current_lastPosition, _state_current_lastPosition1;
|
|
141
|
-
let pointerType = e.pointerType || "mouse";
|
|
142
|
-
var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
|
|
143
|
-
move(e, pointerType, e.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
|
|
144
|
-
state.current.lastPosition = {
|
|
145
|
-
pageX: e.pageX,
|
|
146
|
-
pageY: e.pageY
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
let onPointerUp = (e) => {
|
|
151
|
-
if (e.pointerId === state.current.id) {
|
|
152
|
-
let pointerType = e.pointerType || "mouse";
|
|
153
|
-
end(e, pointerType);
|
|
154
|
-
state.current.id = null;
|
|
155
|
-
removeGlobalListener(window, "pointermove", onPointerMove, false);
|
|
156
|
-
removeGlobalListener(window, "pointerup", onPointerUp, false);
|
|
157
|
-
removeGlobalListener(window, "pointercancel", onPointerUp, false);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
moveProps2.onPointerDown = (e) => {
|
|
161
|
-
if (e.button === 0 && state.current.id == null) {
|
|
162
|
-
start();
|
|
163
|
-
e.stopPropagation();
|
|
164
|
-
e.preventDefault();
|
|
165
|
-
state.current.lastPosition = {
|
|
166
|
-
pageX: e.pageX,
|
|
167
|
-
pageY: e.pageY
|
|
168
|
-
};
|
|
169
|
-
state.current.id = e.pointerId;
|
|
170
|
-
addGlobalListener(window, "pointermove", onPointerMove, false);
|
|
171
|
-
addGlobalListener(window, "pointerup", onPointerUp, false);
|
|
172
|
-
addGlobalListener(window, "pointercancel", onPointerUp, false);
|
|
173
|
-
}
|
|
199
|
+
setPointerDown("touch");
|
|
174
200
|
};
|
|
175
|
-
}
|
|
201
|
+
} else moveProps2.onPointerDown = (e) => {
|
|
202
|
+
if (e.button === 0 && state.current.id == null) {
|
|
203
|
+
start();
|
|
204
|
+
e.stopPropagation();
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
state.current.lastPosition = {
|
|
207
|
+
pageX: e.pageX,
|
|
208
|
+
pageY: e.pageY
|
|
209
|
+
};
|
|
210
|
+
state.current.id = e.pointerId;
|
|
211
|
+
setPointerDown("pointer");
|
|
212
|
+
}
|
|
213
|
+
};
|
|
176
214
|
let triggerKeyboardMove = (e, deltaX, deltaY) => {
|
|
177
215
|
start();
|
|
178
216
|
move(e, "keyboard", deltaX, deltaY);
|
|
@@ -209,8 +247,6 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
209
247
|
return moveProps2;
|
|
210
248
|
}, [
|
|
211
249
|
state,
|
|
212
|
-
addGlobalListener,
|
|
213
|
-
removeGlobalListener,
|
|
214
250
|
move,
|
|
215
251
|
end
|
|
216
252
|
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-
|
|
1
|
+
import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-HC9_3Crc.js";
|
|
2
2
|
import $dbSRa$react__default, { forwardRef, createContext } from "react";
|
|
3
3
|
const $514c0188e459b4c0$export$9afb8bc826b033ea = /* @__PURE__ */ createContext({});
|
|
4
4
|
const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /* @__PURE__ */ forwardRef(function Text(props, ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
1
|
+
import { a as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-HC9_3Crc.js";
|
|
2
2
|
import $dbSRa$react__default, { useState, useMemo } from "react";
|
|
3
|
-
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-
|
|
3
|
+
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-WEswknAY.js";
|
|
4
4
|
const $5c3e21d68f1c4674$var$styles = {
|
|
5
5
|
border: 0,
|
|
6
6
|
clip: "rect(0 0 0 0)",
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { b as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "./utils-HC9_3Crc.js";
|
|
2
|
+
import { r as reactDomExports } from "./index-sSixe2j_.js";
|
|
3
|
+
import { useState, useCallback } from "react";
|
|
4
|
+
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
|
|
5
|
+
let [isEntering, setEntering] = useState(true);
|
|
6
|
+
let isAnimationReady = isEntering && isReady;
|
|
7
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
8
|
+
if (isAnimationReady && ref.current && "getAnimations" in ref.current) {
|
|
9
|
+
for (let animation of ref.current.getAnimations()) if (animation instanceof CSSTransition) animation.cancel();
|
|
10
|
+
}
|
|
11
|
+
}, [
|
|
12
|
+
ref,
|
|
13
|
+
isAnimationReady
|
|
14
|
+
]);
|
|
15
|
+
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));
|
|
16
|
+
return isAnimationReady;
|
|
17
|
+
}
|
|
18
|
+
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
|
|
19
|
+
let [exitState, setExitState] = useState(isOpen ? "open" : "closed");
|
|
20
|
+
switch (exitState) {
|
|
21
|
+
case "open":
|
|
22
|
+
if (!isOpen) setExitState("exiting");
|
|
23
|
+
break;
|
|
24
|
+
case "closed":
|
|
25
|
+
case "exiting":
|
|
26
|
+
if (isOpen) setExitState("open");
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
let isExiting = exitState === "exiting";
|
|
30
|
+
$d3f049242431219c$var$useAnimation(ref, isExiting, useCallback(() => {
|
|
31
|
+
setExitState((state) => state === "exiting" ? "closed" : state);
|
|
32
|
+
}, []));
|
|
33
|
+
return isExiting;
|
|
34
|
+
}
|
|
35
|
+
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
|
|
36
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
37
|
+
if (isActive && ref.current) {
|
|
38
|
+
if (!("getAnimations" in ref.current)) {
|
|
39
|
+
onEnd();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let animations = ref.current.getAnimations();
|
|
43
|
+
if (animations.length === 0) {
|
|
44
|
+
onEnd();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let canceled = false;
|
|
48
|
+
Promise.all(animations.map((a) => a.finished)).then(() => {
|
|
49
|
+
if (!canceled) reactDomExports.flushSync(() => {
|
|
50
|
+
onEnd();
|
|
51
|
+
});
|
|
52
|
+
}).catch(() => {
|
|
53
|
+
});
|
|
54
|
+
return () => {
|
|
55
|
+
canceled = true;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}, [
|
|
59
|
+
ref,
|
|
60
|
+
isActive,
|
|
61
|
+
onEnd
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
$d3f049242431219c$export$45fda7c47f93fd48 as $,
|
|
66
|
+
$d3f049242431219c$export$6d3443f2c48bfc20 as a
|
|
67
|
+
};
|