@react-aria/utils 3.24.1 → 3.25.1
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 +4 -2
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/mergeRefs.main.js +1 -1
- package/dist/mergeRefs.main.js.map +1 -1
- package/dist/mergeRefs.mjs +1 -1
- package/dist/mergeRefs.module.js +1 -1
- package/dist/mergeRefs.module.js.map +1 -1
- package/dist/module.js +4 -2
- package/dist/module.js.map +1 -1
- package/dist/openLink.main.js +12 -0
- package/dist/openLink.main.js.map +1 -1
- package/dist/openLink.mjs +12 -1
- package/dist/openLink.module.js +12 -1
- package/dist/openLink.module.js.map +1 -1
- package/dist/platform.main.js +25 -18
- package/dist/platform.main.js.map +1 -1
- package/dist/platform.mjs +25 -18
- package/dist/platform.module.js +25 -18
- package/dist/platform.module.js.map +1 -1
- package/dist/types.d.ts +43 -16
- package/dist/types.d.ts.map +1 -1
- package/dist/useEvent.main.js.map +1 -1
- package/dist/useEvent.module.js.map +1 -1
- package/dist/useFormReset.main.js.map +1 -1
- package/dist/useFormReset.module.js.map +1 -1
- package/dist/useLoadMore.main.js +72 -0
- package/dist/useLoadMore.main.js.map +1 -0
- package/dist/useLoadMore.mjs +67 -0
- package/dist/useLoadMore.module.js +67 -0
- package/dist/useLoadMore.module.js.map +1 -0
- package/dist/useResizeObserver.main.js +6 -3
- package/dist/useResizeObserver.main.js.map +1 -1
- package/dist/useResizeObserver.mjs +6 -3
- package/dist/useResizeObserver.module.js +6 -3
- package/dist/useResizeObserver.module.js.map +1 -1
- package/dist/useSyncRef.main.js.map +1 -1
- package/dist/useSyncRef.module.js.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +2 -1
- package/src/mergeRefs.ts +2 -2
- package/src/openLink.tsx +13 -0
- package/src/platform.ts +32 -18
- package/src/useEvent.ts +4 -3
- package/src/useFormReset.ts +4 -2
- package/src/useLoadMore.ts +82 -0
- package/src/useResizeObserver.ts +8 -5
- package/src/useSyncRef.ts +3 -2
package/dist/import.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRef
|
|
|
6
6
|
import {filterDOMProps as $65484d02dcb7eb3e$export$457c3d6518dd4c6f} from "./filterDOMProps.mjs";
|
|
7
7
|
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.mjs";
|
|
8
8
|
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.mjs";
|
|
9
|
-
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572} from "./openLink.mjs";
|
|
9
|
+
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, useSyntheticLinkProps as $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6} from "./openLink.mjs";
|
|
10
10
|
import {runAfterTransition as $bbed8b41f857bcc0$export$24490316f764c430} from "./runAfterTransition.mjs";
|
|
11
11
|
import {useDrag1D as $9cc09df9fd7676be$export$7bbed75feba39706} from "./useDrag1D.mjs";
|
|
12
12
|
import {useGlobalListeners as $03deb23ff14920c4$export$4eaf04e54aa8eed6} from "./useGlobalListeners.mjs";
|
|
@@ -29,6 +29,7 @@ import {isVirtualClick as $6a7db85432448f7f$export$60278871457622de, isVirtualPo
|
|
|
29
29
|
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
|
|
30
30
|
import {useDeepMemo as $5a387cc49350e6db$export$722debc0e56fea39} from "./useDeepMemo.mjs";
|
|
31
31
|
import {useFormReset as $99facab73266f662$export$5add1d006293d136} from "./useFormReset.mjs";
|
|
32
|
+
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.mjs";
|
|
32
33
|
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
|
|
33
34
|
|
|
34
35
|
/*
|
|
@@ -75,5 +76,6 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
75
76
|
|
|
76
77
|
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
|
|
80
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $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, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $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, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $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, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
|
|
79
81
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -29,6 +29,7 @@ var $577e795361f19be9$exports = require("./isVirtualEvent.main.js");
|
|
|
29
29
|
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
|
|
30
30
|
var $20e6e72fbf5dc81e$exports = require("./useDeepMemo.main.js");
|
|
31
31
|
var $1f205e845604a423$exports = require("./useFormReset.main.js");
|
|
32
|
+
var $faa6ccd6fb62f877$exports = require("./useLoadMore.main.js");
|
|
32
33
|
var $1Yh1N$reactstatelyutils = require("@react-stately/utils");
|
|
33
34
|
|
|
34
35
|
|
|
@@ -49,6 +50,7 @@ $parcel$export(module.exports, "focusWithoutScrolling", () => $1117b6c0d4c4c164$
|
|
|
49
50
|
$parcel$export(module.exports, "getOffset", () => $16ec41ef3e36c19c$exports.getOffset);
|
|
50
51
|
$parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$exports.openLink);
|
|
51
52
|
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$exports.getSyntheticLinkProps);
|
|
53
|
+
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$exports.useSyntheticLinkProps);
|
|
52
54
|
$parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$exports.RouterProvider);
|
|
53
55
|
$parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$exports.shouldClientNavigate);
|
|
54
56
|
$parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$exports.useRouter);
|
|
@@ -87,6 +89,7 @@ $parcel$export(module.exports, "isVirtualPointerEvent", () => $577e795361f19be9$
|
|
|
87
89
|
$parcel$export(module.exports, "useEffectEvent", () => $1254e5bb94ac8761$exports.useEffectEvent);
|
|
88
90
|
$parcel$export(module.exports, "useDeepMemo", () => $20e6e72fbf5dc81e$exports.useDeepMemo);
|
|
89
91
|
$parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$exports.useFormReset);
|
|
92
|
+
$parcel$export(module.exports, "useLoadMore", () => $faa6ccd6fb62f877$exports.useLoadMore);
|
|
90
93
|
/*
|
|
91
94
|
* Copyright 2020 Adobe. All rights reserved.
|
|
92
95
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -129,6 +132,7 @@ $parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$exports.u
|
|
|
129
132
|
|
|
130
133
|
|
|
131
134
|
|
|
135
|
+
|
|
132
136
|
|
|
133
137
|
|
|
134
138
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {getOwnerDocument, getOwnerWindow} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/mergeRefs.main.js
CHANGED
|
@@ -15,7 +15,7 @@ $parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$export$c9058
|
|
|
15
15
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
16
|
* governing permissions and limitations under the License.
|
|
17
17
|
*/ function $f05dc24eafaeb7e2$export$c9058316764c140e(...refs) {
|
|
18
|
-
if (refs.length === 1) return refs[0];
|
|
18
|
+
if (refs.length === 1 && refs[0]) return refs[0];
|
|
19
19
|
return (value)=>{
|
|
20
20
|
for (let ref of refs){
|
|
21
21
|
if (typeof ref === 'function') ref(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAAqE;IACnG,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,KAAK,IAAI,OAAO,KAAM;YACpB,IAAI,OAAO,QAAQ,YACjB,IAAI;iBACC,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;QAElB;IACF;AACF","sources":["packages/@react-aria/utils/src/mergeRefs.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ForwardedRef, MutableRefObject} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T> | null | undefined>): ForwardedRef<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n for (let ref of refs) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"mergeRefs.main.js.map"}
|
package/dist/mergeRefs.mjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
|
|
12
|
-
if (refs.length === 1) return refs[0];
|
|
12
|
+
if (refs.length === 1 && refs[0]) return refs[0];
|
|
13
13
|
return (value)=>{
|
|
14
14
|
for (let ref of refs){
|
|
15
15
|
if (typeof ref === 'function') ref(value);
|
package/dist/mergeRefs.module.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
|
|
12
|
-
if (refs.length === 1) return refs[0];
|
|
12
|
+
if (refs.length === 1 && refs[0]) return refs[0];
|
|
13
13
|
return (value)=>{
|
|
14
14
|
for (let ref of refs){
|
|
15
15
|
if (typeof ref === 'function') ref(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAAqE;IACnG,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,KAAK,IAAI,OAAO,KAAM;YACpB,IAAI,OAAO,QAAQ,YACjB,IAAI;iBACC,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;QAElB;IACF;AACF","sources":["packages/@react-aria/utils/src/mergeRefs.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ForwardedRef, MutableRefObject} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T> | null | undefined>): ForwardedRef<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n for (let ref of refs) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"mergeRefs.module.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -6,7 +6,7 @@ import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRef
|
|
|
6
6
|
import {filterDOMProps as $65484d02dcb7eb3e$export$457c3d6518dd4c6f} from "./filterDOMProps.module.js";
|
|
7
7
|
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.module.js";
|
|
8
8
|
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.module.js";
|
|
9
|
-
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572} from "./openLink.module.js";
|
|
9
|
+
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, useSyntheticLinkProps as $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6} from "./openLink.module.js";
|
|
10
10
|
import {runAfterTransition as $bbed8b41f857bcc0$export$24490316f764c430} from "./runAfterTransition.module.js";
|
|
11
11
|
import {useDrag1D as $9cc09df9fd7676be$export$7bbed75feba39706} from "./useDrag1D.module.js";
|
|
12
12
|
import {useGlobalListeners as $03deb23ff14920c4$export$4eaf04e54aa8eed6} from "./useGlobalListeners.module.js";
|
|
@@ -29,6 +29,7 @@ import {isVirtualClick as $6a7db85432448f7f$export$60278871457622de, isVirtualPo
|
|
|
29
29
|
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
|
|
30
30
|
import {useDeepMemo as $5a387cc49350e6db$export$722debc0e56fea39} from "./useDeepMemo.module.js";
|
|
31
31
|
import {useFormReset as $99facab73266f662$export$5add1d006293d136} from "./useFormReset.module.js";
|
|
32
|
+
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.module.js";
|
|
32
33
|
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
|
|
33
34
|
|
|
34
35
|
/*
|
|
@@ -75,5 +76,6 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
75
76
|
|
|
76
77
|
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
|
|
80
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $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, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $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, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $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, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
|
|
79
81
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {getOwnerDocument, getOwnerWindow} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/openLink.main.js
CHANGED
|
@@ -15,6 +15,7 @@ $parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$export$
|
|
|
15
15
|
$parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$export$efa8c9099e530235);
|
|
16
16
|
$parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$export$95185d699e05d4d7);
|
|
17
17
|
$parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$export$9a302a45f65d0572);
|
|
18
|
+
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$export$bdc77b0c0a3a85d6);
|
|
18
19
|
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$export$51437d503373d223);
|
|
19
20
|
$parcel$export(module.exports, "useLinkProps", () => $4068a0fae83b6d84$export$7e924b3091a3bd18);
|
|
20
21
|
/*
|
|
@@ -117,6 +118,17 @@ function $4068a0fae83b6d84$var$getSyntheticLink(target, open) {
|
|
|
117
118
|
function $4068a0fae83b6d84$var$openSyntheticLink(target, modifiers) {
|
|
118
119
|
$4068a0fae83b6d84$var$getSyntheticLink(target, (link)=>$4068a0fae83b6d84$export$95185d699e05d4d7(link, modifiers));
|
|
119
120
|
}
|
|
121
|
+
function $4068a0fae83b6d84$export$bdc77b0c0a3a85d6(props) {
|
|
122
|
+
let router = $4068a0fae83b6d84$export$9a302a45f65d0572();
|
|
123
|
+
return {
|
|
124
|
+
'data-href': props.href ? router.useHref(props.href) : undefined,
|
|
125
|
+
'data-target': props.target,
|
|
126
|
+
'data-rel': props.rel,
|
|
127
|
+
'data-download': props.download,
|
|
128
|
+
'data-ping': props.ping,
|
|
129
|
+
'data-referrer-policy': props.referrerPolicy
|
|
130
|
+
};
|
|
131
|
+
}
|
|
120
132
|
function $4068a0fae83b6d84$export$51437d503373d223(props) {
|
|
121
133
|
return {
|
|
122
134
|
'data-href': props.href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaD,MAAM,oDAAgB,CAAA,GAAA,0BAAY,EAAU;IAC1C,UAAU;IACV,MAAM;IACN,SAAS,CAAC,OAAS;AACrB;AAYO,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,YAAE,QAAQ,WAAE,OAAO,EAAC,GAAG;IAEpC,IAAI,MAAM,CAAA,GAAA,oBAAM,EAA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M,GAAG;QACrB,iBAAiB,MAAM,QAAQ;QAC/B,aAAa,MAAM,IAAI;QACvB,wBAAwB,MAAM,cAAc;IAC9C;AACF;AAGO,SAAS,0CAAsB,KAAmB;IACvD,OAAO;QACL,aAAa,MAAM,IAAI;QACvB,eAAe,MAAM,MAAM;QAC3B,YAAY,MAAM,GAAG;QACrB,iBAAiB,MAAM,QAAQ;QAC/B,aAAa,MAAM,IAAI;QACvB,wBAAwB,MAAM,cAAc;IAC9C;AACF;AAEO,SAAS,0CAAa,KAAmB;IAC9C,IAAI,SAAS;IACb,OAAO;QACL,MAAM,CAAA,kBAAA,4BAAA,MAAO,IAAI,IAAG,OAAO,OAAO,CAAC,kBAAA,4BAAA,MAAO,IAAI,IAAI;QAClD,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;QACrB,GAAG,EAAE,kBAAA,4BAAA,MAAO,GAAG;QACf,QAAQ,EAAE,kBAAA,4BAAA,MAAO,QAAQ;QACzB,IAAI,EAAE,kBAAA,4BAAA,MAAO,IAAI;QACjB,cAAc,EAAE,kBAAA,4BAAA,MAAO,cAAc;IACvC;AACF","sources":["packages/@react-aria/utils/src/openLink.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, isMac, isWebKit} from './index';\nimport {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';\nimport {isFirefox, isIPad} from './platform';\nimport React, {createContext, ReactNode, useContext, useMemo} from 'react';\n\ninterface Router {\n isNative: boolean,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,\n useHref: (href: Href) => string\n}\n\nconst RouterContext = createContext<Router>({\n isNative: true,\n open: openSyntheticLink,\n useHref: (href) => href\n});\n\ninterface RouterProviderProps {\n navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,\n useHref?: (href: Href) => string,\n children: ReactNode\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a framework or client side router,\n * and provides it to all nested React Aria links to enable client side navigation.\n */\nexport function RouterProvider(props: RouterProviderProps) {\n let {children, navigate, useHref} = props;\n\n let ctx = useMemo(() => ({\n isNative: false,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {\n getSyntheticLink(target, link => {\n if (shouldClientNavigate(link, modifiers)) {\n navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: useHref || ((href) => href)\n }), [navigate, useHref]);\n\n return (\n <RouterContext.Provider value={ctx}>\n {children}\n </RouterContext.Provider>\n );\n}\n\nexport function useRouter(): Router {\n return useContext(RouterContext);\n}\n\ninterface Modifiers {\n metaKey?: boolean,\n ctrlKey?: boolean,\n altKey?: boolean,\n shiftKey?: boolean\n}\n\nexport function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers) {\n // Use getAttribute here instead of link.target. Firefox will default link.target to \"_parent\" when inside an iframe.\n let target = link.getAttribute('target');\n return (\n (!target || target === '_self') &&\n link.origin === location.origin &&\n !link.hasAttribute('download') &&\n !modifiers.metaKey && // open in new tab (mac)\n !modifiers.ctrlKey && // open in new tab (windows)\n !modifiers.altKey && // download\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true) {\n let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;\n\n // Firefox does not recognize keyboard events as a user action by default, and the popup blocker\n // will prevent links with target=\"_blank\" from opening. However, it does allow the event if the\n // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.\n if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {\n if (isMac()) {\n metaKey = true;\n } else {\n ctrlKey = true;\n }\n }\n\n // WebKit does not support firing click events with modifier keys, but does support keyboard events.\n // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184\n let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'\n // @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects\n ? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})\n : new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, bubbles: true, cancelable: true});\n (openLink as any).isOpening = setOpening;\n focusWithoutScrolling(target);\n target.dispatchEvent(event);\n (openLink as any).isOpening = false;\n}\n// https://github.com/parcel-bundler/parcel/issues/8724\n(openLink as any).isOpening = false;\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n } else if (target.hasAttribute('data-href')) {\n let link = document.createElement('a');\n link.href = target.getAttribute('data-href')!;\n if (target.hasAttribute('data-target')) {\n link.target = target.getAttribute('data-target')!;\n }\n if (target.hasAttribute('data-rel')) {\n link.rel = target.getAttribute('data-rel')!;\n }\n if (target.hasAttribute('data-download')) {\n link.download = target.getAttribute('data-download')!;\n }\n if (target.hasAttribute('data-ping')) {\n link.ping = target.getAttribute('data-ping')!;\n }\n if (target.hasAttribute('data-referrer-policy')) {\n link.referrerPolicy = target.getAttribute('data-referrer-policy')!;\n }\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n }\n}\n\nfunction openSyntheticLink(target: Element, modifiers: Modifiers) {\n getSyntheticLink(target, link => openLink(link, modifiers));\n}\n\nexport function useSyntheticLinkProps(props: LinkDOMProps) {\n let router = useRouter();\n return {\n 'data-href': props.href ? router.useHref(props.href) : undefined,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n };\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps) {\n return {\n 'data-href': props.href,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n };\n}\n\nexport function useLinkProps(props: LinkDOMProps) {\n let router = useRouter();\n return {\n href: props?.href ? router.useHref(props?.href) : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy\n };\n}\n"],"names":[],"version":3,"file":"openLink.main.js.map"}
|
package/dist/openLink.mjs
CHANGED
|
@@ -102,6 +102,17 @@ function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
|
102
102
|
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
103
103
|
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
104
104
|
}
|
|
105
|
+
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
106
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
107
|
+
return {
|
|
108
|
+
'data-href': props.href ? router.useHref(props.href) : undefined,
|
|
109
|
+
'data-target': props.target,
|
|
110
|
+
'data-rel': props.rel,
|
|
111
|
+
'data-download': props.download,
|
|
112
|
+
'data-ping': props.ping,
|
|
113
|
+
'data-referrer-policy': props.referrerPolicy
|
|
114
|
+
};
|
|
115
|
+
}
|
|
105
116
|
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
|
|
106
117
|
return {
|
|
107
118
|
'data-href': props.href,
|
|
@@ -125,5 +136,5 @@ function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
|
|
128
|
-
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
|
|
139
|
+
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
|
|
129
140
|
//# sourceMappingURL=openLink.module.js.map
|
package/dist/openLink.module.js
CHANGED
|
@@ -102,6 +102,17 @@ function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
|
102
102
|
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
103
103
|
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
104
104
|
}
|
|
105
|
+
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
106
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
107
|
+
return {
|
|
108
|
+
'data-href': props.href ? router.useHref(props.href) : undefined,
|
|
109
|
+
'data-target': props.target,
|
|
110
|
+
'data-rel': props.rel,
|
|
111
|
+
'data-download': props.download,
|
|
112
|
+
'data-ping': props.ping,
|
|
113
|
+
'data-referrer-policy': props.referrerPolicy
|
|
114
|
+
};
|
|
115
|
+
}
|
|
105
116
|
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
|
|
106
117
|
return {
|
|
107
118
|
'data-href': props.href,
|
|
@@ -125,5 +136,5 @@ function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
|
|
128
|
-
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
|
|
139
|
+
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
|
|
129
140
|
//# sourceMappingURL=openLink.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaD,MAAM,oDAAgB,CAAA,GAAA,oBAAY,EAAU;IAC1C,UAAU;IACV,MAAM;IACN,SAAS,CAAC,OAAS;AACrB;AAYO,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,YAAE,QAAQ,WAAE,OAAO,EAAC,GAAG;IAEpC,IAAI,MAAM,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;YACvB,UAAU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Ac;IAC9C;AACF;AAEO,SAAS,0CAAa,KAAmB;IAC9C,IAAI,SAAS;IACb,OAAO;QACL,MAAM,CAAA,kBAAA,4BAAA,MAAO,IAAI,IAAG,OAAO,OAAO,CAAC,kBAAA,4BAAA,MAAO,IAAI,IAAI;QAClD,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;QACrB,GAAG,EAAE,kBAAA,4BAAA,MAAO,GAAG;QACf,QAAQ,EAAE,kBAAA,4BAAA,MAAO,QAAQ;QACzB,IAAI,EAAE,kBAAA,4BAAA,MAAO,IAAI;QACjB,cAAc,EAAE,kBAAA,4BAAA,MAAO,cAAc;IACvC;AACF","sources":["packages/@react-aria/utils/src/openLink.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, isMac, isWebKit} from './index';\nimport {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';\nimport {isFirefox, isIPad} from './platform';\nimport React, {createContext, ReactNode, useContext, useMemo} from 'react';\n\ninterface Router {\n isNative: boolean,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,\n useHref: (href: Href) => string\n}\n\nconst RouterContext = createContext<Router>({\n isNative: true,\n open: openSyntheticLink,\n useHref: (href) => href\n});\n\ninterface RouterProviderProps {\n navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,\n useHref?: (href: Href) => string,\n children: ReactNode\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a framework or client side router,\n * and provides it to all nested React Aria links to enable client side navigation.\n */\nexport function RouterProvider(props: RouterProviderProps) {\n let {children, navigate, useHref} = props;\n\n let ctx = useMemo(() => ({\n isNative: false,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {\n getSyntheticLink(target, link => {\n if (shouldClientNavigate(link, modifiers)) {\n navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: useHref || ((href) => href)\n }), [navigate, useHref]);\n\n return (\n <RouterContext.Provider value={ctx}>\n {children}\n </RouterContext.Provider>\n );\n}\n\nexport function useRouter(): Router {\n return useContext(RouterContext);\n}\n\ninterface Modifiers {\n metaKey?: boolean,\n ctrlKey?: boolean,\n altKey?: boolean,\n shiftKey?: boolean\n}\n\nexport function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers) {\n // Use getAttribute here instead of link.target. Firefox will default link.target to \"_parent\" when inside an iframe.\n let target = link.getAttribute('target');\n return (\n (!target || target === '_self') &&\n link.origin === location.origin &&\n !link.hasAttribute('download') &&\n !modifiers.metaKey && // open in new tab (mac)\n !modifiers.ctrlKey && // open in new tab (windows)\n !modifiers.altKey && // download\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true) {\n let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;\n\n // Firefox does not recognize keyboard events as a user action by default, and the popup blocker\n // will prevent links with target=\"_blank\" from opening. However, it does allow the event if the\n // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.\n if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {\n if (isMac()) {\n metaKey = true;\n } else {\n ctrlKey = true;\n }\n }\n\n // WebKit does not support firing click events with modifier keys, but does support keyboard events.\n // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184\n let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'\n // @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects\n ? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})\n : new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, bubbles: true, cancelable: true});\n (openLink as any).isOpening = setOpening;\n focusWithoutScrolling(target);\n target.dispatchEvent(event);\n (openLink as any).isOpening = false;\n}\n// https://github.com/parcel-bundler/parcel/issues/8724\n(openLink as any).isOpening = false;\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n } else if (target.hasAttribute('data-href')) {\n let link = document.createElement('a');\n link.href = target.getAttribute('data-href')!;\n if (target.hasAttribute('data-target')) {\n link.target = target.getAttribute('data-target')!;\n }\n if (target.hasAttribute('data-rel')) {\n link.rel = target.getAttribute('data-rel')!;\n }\n if (target.hasAttribute('data-download')) {\n link.download = target.getAttribute('data-download')!;\n }\n if (target.hasAttribute('data-ping')) {\n link.ping = target.getAttribute('data-ping')!;\n }\n if (target.hasAttribute('data-referrer-policy')) {\n link.referrerPolicy = target.getAttribute('data-referrer-policy')!;\n }\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n }\n}\n\nfunction openSyntheticLink(target: Element, modifiers: Modifiers) {\n getSyntheticLink(target, link => openLink(link, modifiers));\n}\n\nexport function getSyntheticLinkProps(props: LinkDOMProps) {\n return {\n 'data-href': props.href,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n };\n}\n\nexport function useLinkProps(props: LinkDOMProps) {\n let router = useRouter();\n return {\n href: props?.href ? router.useHref(props?.href) : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy\n };\n}\n"],"names":[],"version":3,"file":"openLink.module.js.map"}
|
|
1
|
+
{"mappings":";;;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EA,SAAS,wCAAkB,MAAe,EAAE,SAAoB;IAC9D,uCAAiB,QAAQ,CAAA,OAAQ,0CAAS,MAAM;AAClD;AAEO,SAAS,0CAAsB,KAAmB;IACvD,IAAI,SAAS;IACb,OAAO;QACL,aAAa,MAAM,IAAI,GAAG,OAAO,OAAO,CAAC,MAAM,IAAI,IAAI;QACvD,eAAe,MAAM,MAAM;QAC3B,YAAY,MAAM,GAAG;QACrB,iBAAiB,MAAM,QAAQ;QAC/B,aAAa,MAAM,IAAI;QACvB,wBAAwB,MAAM,cAAc;IAC9C;AACF;AAGO,SAAS,0CAAsB,KAAmB;IACvD,OAAO;QACL,aAAa,MAAM,IAAI;QACvB,eAAe,MAAM,MAAM;QAC3B,YAAY,MAAM,GAAG;QACrB,iBAAiB,MAAM,QAAQ;QAC/B,aAAa,MAAM,IAAI;QACvB,wBAAwB,MAAM,cAAc;IAC9C;AACF;AAEO,SAAS,0CAAa,KAAmB;IAC9C,IAAI,SAAS;IACb,OAAO;QACL,MAAM,CAAA,kBAAA,4BAAA,MAAO,IAAI,IAAG,OAAO,OAAO,CAAC,kBAAA,4BAAA,MAAO,IAAI,IAAI;QAClD,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;QACrB,GAAG,EAAE,kBAAA,4BAAA,MAAO,GAAG;QACf,QAAQ,EAAE,kBAAA,4BAAA,MAAO,QAAQ;QACzB,IAAI,EAAE,kBAAA,4BAAA,MAAO,IAAI;QACjB,cAAc,EAAE,kBAAA,4BAAA,MAAO,cAAc;IACvC;AACF","sources":["packages/@react-aria/utils/src/openLink.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, isMac, isWebKit} from './index';\nimport {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';\nimport {isFirefox, isIPad} from './platform';\nimport React, {createContext, ReactNode, useContext, useMemo} from 'react';\n\ninterface Router {\n isNative: boolean,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,\n useHref: (href: Href) => string\n}\n\nconst RouterContext = createContext<Router>({\n isNative: true,\n open: openSyntheticLink,\n useHref: (href) => href\n});\n\ninterface RouterProviderProps {\n navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,\n useHref?: (href: Href) => string,\n children: ReactNode\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a framework or client side router,\n * and provides it to all nested React Aria links to enable client side navigation.\n */\nexport function RouterProvider(props: RouterProviderProps) {\n let {children, navigate, useHref} = props;\n\n let ctx = useMemo(() => ({\n isNative: false,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {\n getSyntheticLink(target, link => {\n if (shouldClientNavigate(link, modifiers)) {\n navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: useHref || ((href) => href)\n }), [navigate, useHref]);\n\n return (\n <RouterContext.Provider value={ctx}>\n {children}\n </RouterContext.Provider>\n );\n}\n\nexport function useRouter(): Router {\n return useContext(RouterContext);\n}\n\ninterface Modifiers {\n metaKey?: boolean,\n ctrlKey?: boolean,\n altKey?: boolean,\n shiftKey?: boolean\n}\n\nexport function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers) {\n // Use getAttribute here instead of link.target. Firefox will default link.target to \"_parent\" when inside an iframe.\n let target = link.getAttribute('target');\n return (\n (!target || target === '_self') &&\n link.origin === location.origin &&\n !link.hasAttribute('download') &&\n !modifiers.metaKey && // open in new tab (mac)\n !modifiers.ctrlKey && // open in new tab (windows)\n !modifiers.altKey && // download\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true) {\n let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;\n\n // Firefox does not recognize keyboard events as a user action by default, and the popup blocker\n // will prevent links with target=\"_blank\" from opening. However, it does allow the event if the\n // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.\n if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {\n if (isMac()) {\n metaKey = true;\n } else {\n ctrlKey = true;\n }\n }\n\n // WebKit does not support firing click events with modifier keys, but does support keyboard events.\n // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184\n let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'\n // @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects\n ? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})\n : new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, bubbles: true, cancelable: true});\n (openLink as any).isOpening = setOpening;\n focusWithoutScrolling(target);\n target.dispatchEvent(event);\n (openLink as any).isOpening = false;\n}\n// https://github.com/parcel-bundler/parcel/issues/8724\n(openLink as any).isOpening = false;\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n } else if (target.hasAttribute('data-href')) {\n let link = document.createElement('a');\n link.href = target.getAttribute('data-href')!;\n if (target.hasAttribute('data-target')) {\n link.target = target.getAttribute('data-target')!;\n }\n if (target.hasAttribute('data-rel')) {\n link.rel = target.getAttribute('data-rel')!;\n }\n if (target.hasAttribute('data-download')) {\n link.download = target.getAttribute('data-download')!;\n }\n if (target.hasAttribute('data-ping')) {\n link.ping = target.getAttribute('data-ping')!;\n }\n if (target.hasAttribute('data-referrer-policy')) {\n link.referrerPolicy = target.getAttribute('data-referrer-policy')!;\n }\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n }\n}\n\nfunction openSyntheticLink(target: Element, modifiers: Modifiers) {\n getSyntheticLink(target, link => openLink(link, modifiers));\n}\n\nexport function useSyntheticLinkProps(props: LinkDOMProps) {\n let router = useRouter();\n return {\n 'data-href': props.href ? router.useHref(props.href) : undefined,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n };\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps) {\n return {\n 'data-href': props.href,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n };\n}\n\nexport function useLinkProps(props: LinkDOMProps) {\n let router = useRouter();\n return {\n href: props?.href ? router.useHref(props?.href) : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy\n };\n}\n"],"names":[],"version":3,"file":"openLink.module.js.map"}
|
package/dist/platform.main.js
CHANGED
|
@@ -31,34 +31,41 @@ function $9e20cff0af27e8cc$var$testPlatform(re) {
|
|
|
31
31
|
var _window_navigator_userAgentData;
|
|
32
32
|
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
33
33
|
}
|
|
34
|
-
function $9e20cff0af27e8cc$
|
|
35
|
-
|
|
34
|
+
function $9e20cff0af27e8cc$var$cached(fn) {
|
|
35
|
+
let res = null;
|
|
36
|
+
return ()=>{
|
|
37
|
+
if (res == null) res = fn();
|
|
38
|
+
return res;
|
|
39
|
+
};
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
const $9e20cff0af27e8cc$export$9ac100e40613ea10 = $9e20cff0af27e8cc$var$cached(function() {
|
|
42
|
+
return $9e20cff0af27e8cc$var$testPlatform(/^Mac/i);
|
|
43
|
+
});
|
|
44
|
+
const $9e20cff0af27e8cc$export$186c6964ca17d99 = $9e20cff0af27e8cc$var$cached(function() {
|
|
38
45
|
return $9e20cff0af27e8cc$var$testPlatform(/^iPhone/i);
|
|
39
|
-
}
|
|
40
|
-
|
|
46
|
+
});
|
|
47
|
+
const $9e20cff0af27e8cc$export$7bef049ce92e4224 = $9e20cff0af27e8cc$var$cached(function() {
|
|
41
48
|
return $9e20cff0af27e8cc$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
42
49
|
$9e20cff0af27e8cc$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
43
|
-
}
|
|
44
|
-
|
|
50
|
+
});
|
|
51
|
+
const $9e20cff0af27e8cc$export$fedb369cb70207f1 = $9e20cff0af27e8cc$var$cached(function() {
|
|
45
52
|
return $9e20cff0af27e8cc$export$186c6964ca17d99() || $9e20cff0af27e8cc$export$7bef049ce92e4224();
|
|
46
|
-
}
|
|
47
|
-
|
|
53
|
+
});
|
|
54
|
+
const $9e20cff0af27e8cc$export$e1865c3bedcd822b = $9e20cff0af27e8cc$var$cached(function() {
|
|
48
55
|
return $9e20cff0af27e8cc$export$9ac100e40613ea10() || $9e20cff0af27e8cc$export$fedb369cb70207f1();
|
|
49
|
-
}
|
|
50
|
-
|
|
56
|
+
});
|
|
57
|
+
const $9e20cff0af27e8cc$export$78551043582a6a98 = $9e20cff0af27e8cc$var$cached(function() {
|
|
51
58
|
return $9e20cff0af27e8cc$var$testUserAgent(/AppleWebKit/i) && !$9e20cff0af27e8cc$export$6446a186d09e379e();
|
|
52
|
-
}
|
|
53
|
-
|
|
59
|
+
});
|
|
60
|
+
const $9e20cff0af27e8cc$export$6446a186d09e379e = $9e20cff0af27e8cc$var$cached(function() {
|
|
54
61
|
return $9e20cff0af27e8cc$var$testUserAgent(/Chrome/i);
|
|
55
|
-
}
|
|
56
|
-
|
|
62
|
+
});
|
|
63
|
+
const $9e20cff0af27e8cc$export$a11b0059900ceec8 = $9e20cff0af27e8cc$var$cached(function() {
|
|
57
64
|
return $9e20cff0af27e8cc$var$testUserAgent(/Android/i);
|
|
58
|
-
}
|
|
59
|
-
|
|
65
|
+
});
|
|
66
|
+
const $9e20cff0af27e8cc$export$b7d78993b74f766d = $9e20cff0af27e8cc$var$cached(function() {
|
|
60
67
|
return $9e20cff0af27e8cc$var$testUserAgent(/Firefox/i);
|
|
61
|
-
}
|
|
68
|
+
});
|
|
62
69
|
|
|
63
70
|
|
|
64
71
|
//# sourceMappingURL=platform.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,SAAS,oCAAc,EAAU;QAK7B;IAJF,IAAI,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,MACvD,OAAO;IAET,OAAO,EACL,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,MAAM,CAAC,IAAI,CAAC,CAAC,QAA4C,GAAG,IAAI,CAAC,MAAM,KAAK,OAEjH,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,SAAS;AACpC;AAEA,SAAS,mCAAa,EAAU;QAElB;IADZ,OAAO,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,OACxD,GAAG,IAAI,CAAC,EAAA,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,QAAQ,KAAI,OAAO,SAAS,CAAC,QAAQ,IAChF;AACN;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,SAAS,oCAAc,EAAU;QAK7B;IAJF,IAAI,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,MACvD,OAAO;IAET,OAAO,EACL,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,MAAM,CAAC,IAAI,CAAC,CAAC,QAA4C,GAAG,IAAI,CAAC,MAAM,KAAK,OAEjH,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,SAAS;AACpC;AAEA,SAAS,mCAAa,EAAU;QAElB;IADZ,OAAO,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,OACxD,GAAG,IAAI,CAAC,EAAA,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,QAAQ,KAAI,OAAO,SAAS,CAAC,QAAQ,IAChF;AACN;AAEA,SAAS,6BAAO,EAAiB;IAK/B,IAAI,MAAsB;IAC1B,OAAO;QACL,IAAI,OAAO,MACT,MAAM;QAER,OAAO;IACT;AACF;AAEO,MAAM,4CAAQ,6BAAO;IAC1B,OAAO,mCAAa;AACtB;AAEO,MAAM,2CAAW,6BAAO;IAC7B,OAAO,mCAAa;AACtB;AAEO,MAAM,4CAAS,6BAAO;IAC3B,OAAO,mCAAa,aAClB,yFAAyF;IACxF,+CAAW,UAAU,cAAc,GAAG;AAC3C;AAEO,MAAM,4CAAQ,6BAAO;IAC1B,OAAO,8CAAc;AACvB;AAEO,MAAM,4CAAgB,6BAAO;IAClC,OAAO,+CAAW;AACpB;AAEO,MAAM,4CAAW,6BAAO;IAC7B,OAAO,oCAAc,mBAAmB,CAAC;AAC3C;AAEO,MAAM,4CAAW,6BAAO;IAC7B,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAAY,6BAAO;IAC9B,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAAY,6BAAO;IAC9B,OAAO,oCAAc;AACvB","sources":["packages/@react-aria/utils/src/platform.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction testUserAgent(re: RegExp) {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n return (\n window.navigator['userAgentData']?.brands.some((brand: {brand: string, version: string}) => re.test(brand.brand))\n ) ||\n re.test(window.navigator.userAgent);\n}\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)\n : false;\n}\n\nfunction cached(fn: () => boolean) {\n if (process.env.NODE_ENV === 'test') {\n return fn;\n }\n \n let res: boolean | null = null;\n return () => {\n if (res == null) {\n res = fn();\n }\n return res;\n };\n}\n\nexport const isMac = cached(function () {\n return testPlatform(/^Mac/i);\n});\n\nexport const isIPhone = cached(function () {\n return testPlatform(/^iPhone/i);\n});\n\nexport const isIPad = cached(function () {\n return testPlatform(/^iPad/i) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1);\n});\n\nexport const isIOS = cached(function () {\n return isIPhone() || isIPad();\n});\n\nexport const isAppleDevice = cached(function () {\n return isMac() || isIOS();\n});\n\nexport const isWebKit = cached(function () {\n return testUserAgent(/AppleWebKit/i) && !isChrome();\n});\n\nexport const isChrome = cached(function () {\n return testUserAgent(/Chrome/i);\n});\n\nexport const isAndroid = cached(function () {\n return testUserAgent(/Android/i);\n});\n\nexport const isFirefox = cached(function () {\n return testUserAgent(/Firefox/i);\n});\n"],"names":[],"version":3,"file":"platform.main.js.map"}
|
package/dist/platform.mjs
CHANGED
|
@@ -17,34 +17,41 @@ function $c87311424ea30a05$var$testPlatform(re) {
|
|
|
17
17
|
var _window_navigator_userAgentData;
|
|
18
18
|
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
19
19
|
}
|
|
20
|
-
function $c87311424ea30a05$
|
|
20
|
+
function $c87311424ea30a05$var$cached(fn) {
|
|
21
|
+
let res = null;
|
|
22
|
+
return ()=>{
|
|
23
|
+
if (res == null) res = fn();
|
|
24
|
+
return res;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
|
|
21
28
|
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
22
|
-
}
|
|
23
|
-
|
|
29
|
+
});
|
|
30
|
+
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
|
|
24
31
|
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
25
|
-
}
|
|
26
|
-
|
|
32
|
+
});
|
|
33
|
+
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
|
|
27
34
|
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
28
35
|
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
29
|
-
}
|
|
30
|
-
|
|
36
|
+
});
|
|
37
|
+
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
|
|
31
38
|
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
32
|
-
}
|
|
33
|
-
|
|
39
|
+
});
|
|
40
|
+
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
|
|
34
41
|
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
35
|
-
}
|
|
36
|
-
|
|
42
|
+
});
|
|
43
|
+
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
|
|
37
44
|
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
38
|
-
}
|
|
39
|
-
|
|
45
|
+
});
|
|
46
|
+
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
|
|
40
47
|
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
41
|
-
}
|
|
42
|
-
|
|
48
|
+
});
|
|
49
|
+
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
|
|
43
50
|
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
44
|
-
}
|
|
45
|
-
|
|
51
|
+
});
|
|
52
|
+
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
|
|
46
53
|
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
47
|
-
}
|
|
54
|
+
});
|
|
48
55
|
|
|
49
56
|
|
|
50
57
|
export {$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox};
|
package/dist/platform.module.js
CHANGED
|
@@ -17,34 +17,41 @@ function $c87311424ea30a05$var$testPlatform(re) {
|
|
|
17
17
|
var _window_navigator_userAgentData;
|
|
18
18
|
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
19
19
|
}
|
|
20
|
-
function $c87311424ea30a05$
|
|
20
|
+
function $c87311424ea30a05$var$cached(fn) {
|
|
21
|
+
let res = null;
|
|
22
|
+
return ()=>{
|
|
23
|
+
if (res == null) res = fn();
|
|
24
|
+
return res;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
|
|
21
28
|
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
22
|
-
}
|
|
23
|
-
|
|
29
|
+
});
|
|
30
|
+
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
|
|
24
31
|
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
25
|
-
}
|
|
26
|
-
|
|
32
|
+
});
|
|
33
|
+
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
|
|
27
34
|
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
28
35
|
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
29
|
-
}
|
|
30
|
-
|
|
36
|
+
});
|
|
37
|
+
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
|
|
31
38
|
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
32
|
-
}
|
|
33
|
-
|
|
39
|
+
});
|
|
40
|
+
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
|
|
34
41
|
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
35
|
-
}
|
|
36
|
-
|
|
42
|
+
});
|
|
43
|
+
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
|
|
37
44
|
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
38
|
-
}
|
|
39
|
-
|
|
45
|
+
});
|
|
46
|
+
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
|
|
40
47
|
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
41
|
-
}
|
|
42
|
-
|
|
48
|
+
});
|
|
49
|
+
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
|
|
43
50
|
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
44
|
-
}
|
|
45
|
-
|
|
51
|
+
});
|
|
52
|
+
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
|
|
46
53
|
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
47
|
-
}
|
|
54
|
+
});
|
|
48
55
|
|
|
49
56
|
|
|
50
57
|
export {$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox};
|