@react-aria/utils 3.18.0 → 3.20.0
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/import.mjs +74 -60
- package/dist/main.js +74 -59
- package/dist/main.js.map +1 -1
- package/dist/module.js +74 -60
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -0
- package/src/isVirtualEvent.ts +1 -1
- package/src/useFormReset.ts +34 -0
- package/src/useLayoutEffect.ts +1 -1
- package/src/useValueEffect.ts +20 -27
- package/src/useViewportSize.ts +1 -1
package/dist/import.mjs
CHANGED
|
@@ -35,7 +35,7 @@ import $12uGp$clsx from "clsx";
|
|
|
35
35
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
36
36
|
* governing permissions and limitations under the License.
|
|
37
37
|
*/
|
|
38
|
-
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof
|
|
38
|
+
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (0, $12uGp$react).useLayoutEffect : ()=>{};
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -50,51 +50,59 @@ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof window !== "undefined"
|
|
|
50
50
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
51
51
|
* governing permissions and limitations under the License.
|
|
52
52
|
*/
|
|
53
|
+
/*
|
|
54
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
55
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
56
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
57
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
58
|
+
*
|
|
59
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
60
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
61
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
62
|
+
* governing permissions and limitations under the License.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
66
|
+
const ref = (0, $12uGp$useRef)(null);
|
|
67
|
+
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
68
|
+
ref.current = fn;
|
|
69
|
+
}, [
|
|
70
|
+
fn
|
|
71
|
+
]);
|
|
72
|
+
return (0, $12uGp$useCallback)((...args)=>{
|
|
73
|
+
const f = ref.current;
|
|
74
|
+
return f(...args);
|
|
75
|
+
}, []);
|
|
76
|
+
}
|
|
77
|
+
|
|
53
78
|
|
|
54
79
|
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
55
80
|
let [value, setValue] = (0, $12uGp$useState)(defaultValue);
|
|
56
|
-
let valueRef = (0, $12uGp$useRef)(value);
|
|
57
81
|
let effect = (0, $12uGp$useRef)(null);
|
|
58
|
-
//
|
|
59
|
-
|
|
82
|
+
// Store the function in a ref so we can always access the current version
|
|
83
|
+
// which has the proper `value` in scope.
|
|
84
|
+
let nextRef = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
60
85
|
// Run the generator to the next yield.
|
|
61
86
|
let newValue = effect.current.next();
|
|
62
|
-
while(!newValue.done && valueRef.current === newValue.value)// If the value is the same as the current value,
|
|
63
|
-
// then continue to the next yield. Otherwise,
|
|
64
|
-
// set the value in state and wait for the next layout effect.
|
|
65
|
-
newValue = effect.current.next();
|
|
66
87
|
// If the generator is done, reset the effect.
|
|
67
88
|
if (newValue.done) {
|
|
68
89
|
effect.current = null;
|
|
69
90
|
return;
|
|
70
91
|
}
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
setValue(newValue.value);
|
|
76
|
-
|
|
77
|
-
// this list of dependencies is stable, setState and refs never change after first render.
|
|
78
|
-
}, [
|
|
79
|
-
setValue,
|
|
80
|
-
valueRef,
|
|
81
|
-
effect
|
|
82
|
-
]);
|
|
92
|
+
// If the value is the same as the current value,
|
|
93
|
+
// then continue to the next yield. Otherwise,
|
|
94
|
+
// set the value in state and wait for the next layout effect.
|
|
95
|
+
if (value === newValue.value) nextRef();
|
|
96
|
+
else setValue(newValue.value);
|
|
97
|
+
});
|
|
83
98
|
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
84
99
|
// If there is an effect currently running, continue to the next yield.
|
|
85
|
-
if (effect.current)
|
|
100
|
+
if (effect.current) nextRef();
|
|
101
|
+
});
|
|
102
|
+
let queue = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((fn)=>{
|
|
103
|
+
effect.current = fn(value);
|
|
104
|
+
nextRef();
|
|
86
105
|
});
|
|
87
|
-
// queue must be a stable function, much like setState.
|
|
88
|
-
let queue = (0, $12uGp$useCallback)((fn)=>{
|
|
89
|
-
effect.current = fn(valueRef.current);
|
|
90
|
-
nextIter();
|
|
91
|
-
// this list of dependencies is stable, setState and refs never change after first render.
|
|
92
|
-
// in addition, nextIter is stable as outlined above
|
|
93
|
-
}, [
|
|
94
|
-
nextIter,
|
|
95
|
-
effect,
|
|
96
|
-
valueRef
|
|
97
|
-
]);
|
|
98
106
|
return [
|
|
99
107
|
value,
|
|
100
108
|
queue
|
|
@@ -785,7 +793,7 @@ function $62d8ded9296f3872$export$2bb74740c4e19def(node) {
|
|
|
785
793
|
* governing permissions and limitations under the License.
|
|
786
794
|
*/
|
|
787
795
|
// @ts-ignore
|
|
788
|
-
let $5df64b3807dc15ee$var$visualViewport = typeof
|
|
796
|
+
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
789
797
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
790
798
|
let [size, setSize] = (0, $12uGp$useState)(()=>$5df64b3807dc15ee$var$getViewportSize());
|
|
791
799
|
(0, $12uGp$useEffect)(()=>{
|
|
@@ -920,31 +928,6 @@ function $c87311424ea30a05$export$a11b0059900ceec8() {
|
|
|
920
928
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
921
929
|
* governing permissions and limitations under the License.
|
|
922
930
|
*/
|
|
923
|
-
/*
|
|
924
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
925
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
926
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
927
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
928
|
-
*
|
|
929
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
930
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
931
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
932
|
-
* governing permissions and limitations under the License.
|
|
933
|
-
*/
|
|
934
|
-
|
|
935
|
-
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
936
|
-
const ref = (0, $12uGp$useRef)(null);
|
|
937
|
-
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
938
|
-
ref.current = fn;
|
|
939
|
-
}, [
|
|
940
|
-
fn
|
|
941
|
-
]);
|
|
942
|
-
return (0, $12uGp$useCallback)((...args)=>{
|
|
943
|
-
const f = ref.current;
|
|
944
|
-
return f(...args);
|
|
945
|
-
}, []);
|
|
946
|
-
}
|
|
947
|
-
|
|
948
931
|
|
|
949
932
|
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
|
|
950
933
|
let handleEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler);
|
|
@@ -1085,7 +1068,7 @@ function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
|
|
|
1085
1068
|
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
|
|
1086
1069
|
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
|
|
1087
1070
|
// Talkback double tap from Windows Firefox touch screen press
|
|
1088
|
-
return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
|
|
1071
|
+
return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
|
|
1089
1072
|
}
|
|
1090
1073
|
|
|
1091
1074
|
|
|
@@ -1111,7 +1094,38 @@ function $5a387cc49350e6db$export$722debc0e56fea39(value, isEqual) {
|
|
|
1111
1094
|
}
|
|
1112
1095
|
|
|
1113
1096
|
|
|
1097
|
+
/*
|
|
1098
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
1099
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1100
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1101
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1102
|
+
*
|
|
1103
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1104
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1105
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1106
|
+
* governing permissions and limitations under the License.
|
|
1107
|
+
*/
|
|
1108
|
+
|
|
1109
|
+
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
1110
|
+
let resetValue = (0, $12uGp$useRef)(initialValue);
|
|
1111
|
+
let handleReset = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
1112
|
+
if (onReset) onReset(resetValue.current);
|
|
1113
|
+
});
|
|
1114
|
+
(0, $12uGp$useEffect)(()=>{
|
|
1115
|
+
var _ref_current;
|
|
1116
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
1117
|
+
form === null || form === void 0 ? void 0 : form.addEventListener("reset", handleReset);
|
|
1118
|
+
return ()=>{
|
|
1119
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener("reset", handleReset);
|
|
1120
|
+
};
|
|
1121
|
+
}, [
|
|
1122
|
+
ref,
|
|
1123
|
+
handleReset
|
|
1124
|
+
]);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
|
|
1114
1128
|
|
|
1115
1129
|
|
|
1116
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $62d8ded9296f3872$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo};
|
|
1130
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $62d8ded9296f3872$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset};
|
|
1117
1131
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -50,6 +50,7 @@ $parcel$export(module.exports, "isVirtualClick", () => $577e795361f19be9$export$
|
|
|
50
50
|
$parcel$export(module.exports, "isVirtualPointerEvent", () => $577e795361f19be9$export$29bf1b5f2c56cf63);
|
|
51
51
|
$parcel$export(module.exports, "useEffectEvent", () => $1254e5bb94ac8761$export$7f54fc3180508a52);
|
|
52
52
|
$parcel$export(module.exports, "useDeepMemo", () => $20e6e72fbf5dc81e$export$722debc0e56fea39);
|
|
53
|
+
$parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$export$5add1d006293d136);
|
|
53
54
|
/*
|
|
54
55
|
* Copyright 2020 Adobe. All rights reserved.
|
|
55
56
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -82,7 +83,7 @@ $parcel$export(module.exports, "useDeepMemo", () => $20e6e72fbf5dc81e$export$722
|
|
|
82
83
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
83
84
|
* governing permissions and limitations under the License.
|
|
84
85
|
*/
|
|
85
|
-
const $78605a5d7424e31b$export$e5c5a5f917a5871c = typeof
|
|
86
|
+
const $78605a5d7424e31b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (0, ($parcel$interopDefault($1Yh1N$react))).useLayoutEffect : ()=>{};
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
|
|
@@ -97,51 +98,59 @@ const $78605a5d7424e31b$export$e5c5a5f917a5871c = typeof window !== "undefined"
|
|
|
97
98
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
98
99
|
* governing permissions and limitations under the License.
|
|
99
100
|
*/
|
|
101
|
+
/*
|
|
102
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
103
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
104
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
105
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
106
|
+
*
|
|
107
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
108
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
109
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
110
|
+
* governing permissions and limitations under the License.
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
function $1254e5bb94ac8761$export$7f54fc3180508a52(fn) {
|
|
114
|
+
const ref = (0, $1Yh1N$react.useRef)(null);
|
|
115
|
+
(0, $78605a5d7424e31b$export$e5c5a5f917a5871c)(()=>{
|
|
116
|
+
ref.current = fn;
|
|
117
|
+
}, [
|
|
118
|
+
fn
|
|
119
|
+
]);
|
|
120
|
+
return (0, $1Yh1N$react.useCallback)((...args)=>{
|
|
121
|
+
const f = ref.current;
|
|
122
|
+
return f(...args);
|
|
123
|
+
}, []);
|
|
124
|
+
}
|
|
125
|
+
|
|
100
126
|
|
|
101
127
|
function $19a2307bfabafaf1$export$14d238f342723f25(defaultValue) {
|
|
102
128
|
let [value, setValue] = (0, $1Yh1N$react.useState)(defaultValue);
|
|
103
|
-
let valueRef = (0, $1Yh1N$react.useRef)(value);
|
|
104
129
|
let effect = (0, $1Yh1N$react.useRef)(null);
|
|
105
|
-
//
|
|
106
|
-
|
|
130
|
+
// Store the function in a ref so we can always access the current version
|
|
131
|
+
// which has the proper `value` in scope.
|
|
132
|
+
let nextRef = (0, $1254e5bb94ac8761$export$7f54fc3180508a52)(()=>{
|
|
107
133
|
// Run the generator to the next yield.
|
|
108
134
|
let newValue = effect.current.next();
|
|
109
|
-
while(!newValue.done && valueRef.current === newValue.value)// If the value is the same as the current value,
|
|
110
|
-
// then continue to the next yield. Otherwise,
|
|
111
|
-
// set the value in state and wait for the next layout effect.
|
|
112
|
-
newValue = effect.current.next();
|
|
113
135
|
// If the generator is done, reset the effect.
|
|
114
136
|
if (newValue.done) {
|
|
115
137
|
effect.current = null;
|
|
116
138
|
return;
|
|
117
139
|
}
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
setValue(newValue.value);
|
|
123
|
-
|
|
124
|
-
// this list of dependencies is stable, setState and refs never change after first render.
|
|
125
|
-
}, [
|
|
126
|
-
setValue,
|
|
127
|
-
valueRef,
|
|
128
|
-
effect
|
|
129
|
-
]);
|
|
140
|
+
// If the value is the same as the current value,
|
|
141
|
+
// then continue to the next yield. Otherwise,
|
|
142
|
+
// set the value in state and wait for the next layout effect.
|
|
143
|
+
if (value === newValue.value) nextRef();
|
|
144
|
+
else setValue(newValue.value);
|
|
145
|
+
});
|
|
130
146
|
(0, $78605a5d7424e31b$export$e5c5a5f917a5871c)(()=>{
|
|
131
147
|
// If there is an effect currently running, continue to the next yield.
|
|
132
|
-
if (effect.current)
|
|
148
|
+
if (effect.current) nextRef();
|
|
149
|
+
});
|
|
150
|
+
let queue = (0, $1254e5bb94ac8761$export$7f54fc3180508a52)((fn)=>{
|
|
151
|
+
effect.current = fn(value);
|
|
152
|
+
nextRef();
|
|
133
153
|
});
|
|
134
|
-
// queue must be a stable function, much like setState.
|
|
135
|
-
let queue = (0, $1Yh1N$react.useCallback)((fn)=>{
|
|
136
|
-
effect.current = fn(valueRef.current);
|
|
137
|
-
nextIter();
|
|
138
|
-
// this list of dependencies is stable, setState and refs never change after first render.
|
|
139
|
-
// in addition, nextIter is stable as outlined above
|
|
140
|
-
}, [
|
|
141
|
-
nextIter,
|
|
142
|
-
effect,
|
|
143
|
-
valueRef
|
|
144
|
-
]);
|
|
145
154
|
return [
|
|
146
155
|
value,
|
|
147
156
|
queue
|
|
@@ -832,7 +841,7 @@ function $d796e7157ac96470$export$2bb74740c4e19def(node) {
|
|
|
832
841
|
* governing permissions and limitations under the License.
|
|
833
842
|
*/
|
|
834
843
|
// @ts-ignore
|
|
835
|
-
let $8b24bab62f5c65ad$var$visualViewport = typeof
|
|
844
|
+
let $8b24bab62f5c65ad$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
836
845
|
function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
|
|
837
846
|
let [size, setSize] = (0, $1Yh1N$react.useState)(()=>$8b24bab62f5c65ad$var$getViewportSize());
|
|
838
847
|
(0, $1Yh1N$react.useEffect)(()=>{
|
|
@@ -967,31 +976,6 @@ function $9e20cff0af27e8cc$export$a11b0059900ceec8() {
|
|
|
967
976
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
968
977
|
* governing permissions and limitations under the License.
|
|
969
978
|
*/
|
|
970
|
-
/*
|
|
971
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
972
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
973
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
974
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
975
|
-
*
|
|
976
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
977
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
978
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
979
|
-
* governing permissions and limitations under the License.
|
|
980
|
-
*/
|
|
981
|
-
|
|
982
|
-
function $1254e5bb94ac8761$export$7f54fc3180508a52(fn) {
|
|
983
|
-
const ref = (0, $1Yh1N$react.useRef)(null);
|
|
984
|
-
(0, $78605a5d7424e31b$export$e5c5a5f917a5871c)(()=>{
|
|
985
|
-
ref.current = fn;
|
|
986
|
-
}, [
|
|
987
|
-
fn
|
|
988
|
-
]);
|
|
989
|
-
return (0, $1Yh1N$react.useCallback)((...args)=>{
|
|
990
|
-
const f = ref.current;
|
|
991
|
-
return f(...args);
|
|
992
|
-
}, []);
|
|
993
|
-
}
|
|
994
|
-
|
|
995
979
|
|
|
996
980
|
function $2a8c0bb1629926c8$export$90fc3a17d93f704c(ref, event, handler, options) {
|
|
997
981
|
let handleEvent = (0, $1254e5bb94ac8761$export$7f54fc3180508a52)(handler);
|
|
@@ -1132,7 +1116,7 @@ function $577e795361f19be9$export$29bf1b5f2c56cf63(event) {
|
|
|
1132
1116
|
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
|
|
1133
1117
|
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
|
|
1134
1118
|
// Talkback double tap from Windows Firefox touch screen press
|
|
1135
|
-
return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
|
|
1119
|
+
return !(0, $9e20cff0af27e8cc$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
|
|
1136
1120
|
}
|
|
1137
1121
|
|
|
1138
1122
|
|
|
@@ -1158,6 +1142,37 @@ function $20e6e72fbf5dc81e$export$722debc0e56fea39(value, isEqual) {
|
|
|
1158
1142
|
}
|
|
1159
1143
|
|
|
1160
1144
|
|
|
1145
|
+
/*
|
|
1146
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
1147
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1148
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1149
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1150
|
+
*
|
|
1151
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1152
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1153
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1154
|
+
* governing permissions and limitations under the License.
|
|
1155
|
+
*/
|
|
1156
|
+
|
|
1157
|
+
function $1f205e845604a423$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
1158
|
+
let resetValue = (0, $1Yh1N$react.useRef)(initialValue);
|
|
1159
|
+
let handleReset = (0, $1254e5bb94ac8761$export$7f54fc3180508a52)(()=>{
|
|
1160
|
+
if (onReset) onReset(resetValue.current);
|
|
1161
|
+
});
|
|
1162
|
+
(0, $1Yh1N$react.useEffect)(()=>{
|
|
1163
|
+
var _ref_current;
|
|
1164
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
1165
|
+
form === null || form === void 0 ? void 0 : form.addEventListener("reset", handleReset);
|
|
1166
|
+
return ()=>{
|
|
1167
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener("reset", handleReset);
|
|
1168
|
+
};
|
|
1169
|
+
}, [
|
|
1170
|
+
ref,
|
|
1171
|
+
handleReset
|
|
1172
|
+
]);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
|
|
1161
1176
|
|
|
1162
1177
|
|
|
1163
1178
|
//# sourceMappingURL=main.js.map
|