@react-aria/utils 3.30.1 → 3.32.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/filterDOMProps.main.js +1 -1
- package/dist/filterDOMProps.main.js.map +1 -1
- package/dist/filterDOMProps.mjs +1 -1
- package/dist/filterDOMProps.module.js +1 -1
- package/dist/filterDOMProps.module.js.map +1 -1
- package/dist/import.mjs +2 -2
- package/dist/isElementVisible.main.js +3 -1
- package/dist/isElementVisible.main.js.map +1 -1
- package/dist/isElementVisible.mjs +3 -1
- package/dist/isElementVisible.module.js +3 -1
- package/dist/isElementVisible.module.js.map +1 -1
- package/dist/keyboard.main.js +16 -0
- package/dist/keyboard.main.js.map +1 -1
- package/dist/keyboard.mjs +16 -1
- package/dist/keyboard.module.js +16 -1
- package/dist/keyboard.module.js.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/mergeProps.main.js.map +1 -1
- package/dist/mergeProps.module.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/openLink.main.js +1 -0
- package/dist/openLink.main.js.map +1 -1
- package/dist/openLink.mjs +1 -0
- package/dist/openLink.module.js +1 -0
- package/dist/openLink.module.js.map +1 -1
- package/dist/scrollIntoView.main.js +1 -0
- package/dist/scrollIntoView.main.js.map +1 -1
- package/dist/scrollIntoView.mjs +1 -0
- package/dist/scrollIntoView.module.js +1 -0
- package/dist/scrollIntoView.module.js.map +1 -1
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/useEvent.main.js +1 -2
- package/dist/useEvent.main.js.map +1 -1
- package/dist/useEvent.mjs +1 -2
- package/dist/useEvent.module.js +1 -2
- package/dist/useEvent.module.js.map +1 -1
- package/dist/useFormReset.main.js +1 -2
- package/dist/useFormReset.main.js.map +1 -1
- package/dist/useFormReset.mjs +1 -2
- package/dist/useFormReset.module.js +1 -2
- package/dist/useFormReset.module.js.map +1 -1
- package/dist/useLoadMoreSentinel.main.js +0 -1
- package/dist/useLoadMoreSentinel.main.js.map +1 -1
- package/dist/useLoadMoreSentinel.mjs +0 -1
- package/dist/useLoadMoreSentinel.module.js +0 -1
- package/dist/useLoadMoreSentinel.module.js.map +1 -1
- package/dist/useResizeObserver.main.js +8 -4
- package/dist/useResizeObserver.main.js.map +1 -1
- package/dist/useResizeObserver.mjs +8 -4
- package/dist/useResizeObserver.module.js +8 -4
- package/dist/useResizeObserver.module.js.map +1 -1
- package/dist/useUpdateEffect.main.js +5 -2
- package/dist/useUpdateEffect.main.js.map +1 -1
- package/dist/useUpdateEffect.mjs +5 -2
- package/dist/useUpdateEffect.module.js +5 -2
- package/dist/useUpdateEffect.module.js.map +1 -1
- package/dist/useValueEffect.main.js +13 -8
- package/dist/useValueEffect.main.js.map +1 -1
- package/dist/useValueEffect.mjs +14 -9
- package/dist/useValueEffect.module.js +14 -9
- package/dist/useValueEffect.module.js.map +1 -1
- package/dist/useViewportSize.main.js +27 -2
- package/dist/useViewportSize.main.js.map +1 -1
- package/dist/useViewportSize.mjs +27 -2
- package/dist/useViewportSize.module.js +27 -2
- package/dist/useViewportSize.module.js.map +1 -1
- package/package.json +4 -4
- package/src/filterDOMProps.ts +1 -1
- package/src/index.ts +1 -1
- package/src/isElementVisible.ts +1 -1
- package/src/keyboard.tsx +21 -0
- package/src/mergeProps.ts +1 -2
- package/src/openLink.tsx +1 -1
- package/src/scrollIntoView.ts +3 -0
- package/src/useEvent.ts +1 -1
- package/src/useFormReset.ts +1 -1
- package/src/useLoadMoreSentinel.ts +1 -1
- package/src/useResizeObserver.ts +8 -4
- package/src/useUpdateEffect.ts +5 -3
- package/src/useValueEffect.ts +15 -11
- package/src/useViewportSize.ts +37 -2
|
@@ -80,7 +80,7 @@ const $8d15d0e1797d4238$var$propRe = /^(data-.*)$/;
|
|
|
80
80
|
function $8d15d0e1797d4238$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
81
81
|
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
|
|
82
82
|
let filteredProps = {};
|
|
83
|
-
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($8d15d0e1797d4238$var$DOMPropNames.has(prop) || labelable && $8d15d0e1797d4238$var$labelablePropNames.has(prop) || isLink && $8d15d0e1797d4238$var$linkPropNames.has(prop) || global && $8d15d0e1797d4238$var$globalAttrs.has(prop) || events && $8d15d0e1797d4238$var$globalEvents.has(prop) || prop.endsWith('Capture') && $8d15d0e1797d4238$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
83
|
+
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($8d15d0e1797d4238$var$DOMPropNames.has(prop) || labelable && $8d15d0e1797d4238$var$labelablePropNames.has(prop) || isLink && $8d15d0e1797d4238$var$linkPropNames.has(prop) || global && $8d15d0e1797d4238$var$globalAttrs.has(prop) || events && ($8d15d0e1797d4238$var$globalEvents.has(prop) || prop.endsWith('Capture') && $8d15d0e1797d4238$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
84
84
|
return filteredProps;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,UAAW,CAAA,mCAAa,GAAG,CAAC,SAAU,KAAK,QAAQ,CAAC,cAAc,mCAAa,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,IAAI,MACtG,sBAAA,gCAAA,UAAW,GAAG,CAAC,UACf,6BAAO,IAAI,CAAC,KAAI,GAGlB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;IAIrC,OAAO;AACT","sources":["packages/@react-aria/utils/src/filterDOMProps.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 {AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps} from '@react-types/shared';\n\nconst DOMPropNames = new Set([\n 'id'\n]);\n\nconst labelablePropNames = new Set([\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-details'\n]);\n\n// See LinkDOMProps in dom.d.ts.\nconst linkPropNames = new Set([\n 'href',\n 'hrefLang',\n 'target',\n 'rel',\n 'download',\n 'ping',\n 'referrerPolicy'\n]);\n\nconst globalAttrs = new Set([\n 'dir',\n 'lang',\n 'hidden',\n 'inert',\n 'translate'\n]);\n\nconst globalEvents = new Set([\n 'onClick',\n 'onAuxClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onScroll',\n 'onWheel',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionCancel',\n 'onTransitionEnd',\n 'onTransitionRun',\n 'onTransitionStart'\n]);\n\ninterface Options {\n /**\n * If labelling associated aria properties should be included in the filter.\n */\n labelable?: boolean,\n /** Whether the element is a link and should include DOM props for <a> elements. */\n isLink?: boolean,\n /** Whether to include global DOM attributes. */\n global?: boolean,\n /** Whether to include DOM events. */\n events?: boolean,\n /**\n * A Set of other property names that should be included in the filter.\n */\n propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts: Options = {}): DOMProps & AriaLabelingProps & GlobalDOMAttributes {\n let {labelable, isLink, global, events = global, propNames} = opts;\n let filteredProps = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) && (\n DOMPropNames.has(prop) ||\n (labelable && labelablePropNames.has(prop)) ||\n (isLink && linkPropNames.has(prop)) ||\n (global && globalAttrs.has(prop)) ||\n (events && (globalEvents.has(prop) || (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||\n propNames?.has(prop) ||\n propRe.test(prop)\n )\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n"],"names":[],"version":3,"file":"filterDOMProps.main.js.map"}
|
package/dist/filterDOMProps.mjs
CHANGED
|
@@ -74,7 +74,7 @@ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
|
|
|
74
74
|
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
75
75
|
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
|
|
76
76
|
let filteredProps = {};
|
|
77
|
-
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
77
|
+
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
78
78
|
return filteredProps;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -74,7 +74,7 @@ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
|
|
|
74
74
|
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
75
75
|
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
|
|
76
76
|
let filteredProps = {};
|
|
77
|
-
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
77
|
+
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
78
78
|
return filteredProps;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,UAAW,CAAA,mCAAa,GAAG,CAAC,SAAU,KAAK,QAAQ,CAAC,cAAc,mCAAa,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,IAAI,MACtG,sBAAA,gCAAA,UAAW,GAAG,CAAC,UACf,6BAAO,IAAI,CAAC,KAAI,GAGlB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;IAIrC,OAAO;AACT","sources":["packages/@react-aria/utils/src/filterDOMProps.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 {AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps} from '@react-types/shared';\n\nconst DOMPropNames = new Set([\n 'id'\n]);\n\nconst labelablePropNames = new Set([\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-details'\n]);\n\n// See LinkDOMProps in dom.d.ts.\nconst linkPropNames = new Set([\n 'href',\n 'hrefLang',\n 'target',\n 'rel',\n 'download',\n 'ping',\n 'referrerPolicy'\n]);\n\nconst globalAttrs = new Set([\n 'dir',\n 'lang',\n 'hidden',\n 'inert',\n 'translate'\n]);\n\nconst globalEvents = new Set([\n 'onClick',\n 'onAuxClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onScroll',\n 'onWheel',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionCancel',\n 'onTransitionEnd',\n 'onTransitionRun',\n 'onTransitionStart'\n]);\n\ninterface Options {\n /**\n * If labelling associated aria properties should be included in the filter.\n */\n labelable?: boolean,\n /** Whether the element is a link and should include DOM props for <a> elements. */\n isLink?: boolean,\n /** Whether to include global DOM attributes. */\n global?: boolean,\n /** Whether to include DOM events. */\n events?: boolean,\n /**\n * A Set of other property names that should be included in the filter.\n */\n propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts: Options = {}): DOMProps & AriaLabelingProps & GlobalDOMAttributes {\n let {labelable, isLink, global, events = global, propNames} = opts;\n let filteredProps = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) && (\n DOMPropNames.has(prop) ||\n (labelable && labelablePropNames.has(prop)) ||\n (isLink && linkPropNames.has(prop)) ||\n (global && globalAttrs.has(prop)) ||\n (events && (globalEvents.has(prop) || (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||\n propNames?.has(prop) ||\n propRe.test(prop)\n )\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n"],"names":[],"version":3,"file":"filterDOMProps.module.js.map"}
|
package/dist/import.mjs
CHANGED
|
@@ -36,7 +36,7 @@ import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoa
|
|
|
36
36
|
import {useLoadMoreSentinel as $a5fa973c1850dd36$export$ccaea96c28e8b9e7} from "./useLoadMoreSentinel.mjs";
|
|
37
37
|
import {inertValue as $cdc5a6778b766db2$export$a9d04c5684123369} from "./inertValue.mjs";
|
|
38
38
|
import {CLEAR_FOCUS_EVENT as $5671b20cf9b562b2$export$447a38995de2c711, FOCUS_EVENT as $5671b20cf9b562b2$export$831c820ad60f9d12} from "./constants.mjs";
|
|
39
|
-
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3} from "./keyboard.mjs";
|
|
39
|
+
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3, willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.mjs";
|
|
40
40
|
import {useEnterAnimation as $d3f049242431219c$export$6d3443f2c48bfc20, useExitAnimation as $d3f049242431219c$export$45fda7c47f93fd48} from "./animation.mjs";
|
|
41
41
|
import {isFocusable as $b4b717babfbb907b$export$4c063cf1350e6fed, isTabbable as $b4b717babfbb907b$export$bebd5a1431fec25d} from "./isFocusable.mjs";
|
|
42
42
|
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
|
|
@@ -95,5 +95,5 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $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, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
98
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $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, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
99
99
|
//# sourceMappingURL=module.js.map
|
|
@@ -35,7 +35,9 @@ function $a333d78d58ab4731$var$isAttributeVisible(element, childElement) {
|
|
|
35
35
|
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
36
36
|
}
|
|
37
37
|
function $a333d78d58ab4731$export$e989c0fffaa6b27a(element, childElement) {
|
|
38
|
-
if ($a333d78d58ab4731$var$supportsCheckVisibility) return element.checkVisibility(
|
|
38
|
+
if ($a333d78d58ab4731$var$supportsCheckVisibility) return element.checkVisibility({
|
|
39
|
+
visibilityProperty: true
|
|
40
|
+
}) && !element.closest('[data-react-aria-prevent-focus]');
|
|
39
41
|
return element.nodeName !== '#comment' && $a333d78d58ab4731$var$isStyleVisible(element) && $a333d78d58ab4731$var$isAttributeVisible(element, childElement) && (!element.parentElement || $a333d78d58ab4731$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,MAAM,gDAA0B,OAAO,YAAY,eAAe,qBAAqB,QAAQ,SAAS;AAExG,SAAS,qCAAe,OAAgB;IACtC,MAAM,eAAe,CAAA,GAAA,wCAAa,EAAE;IACpC,IAAI,CAAE,CAAA,mBAAmB,aAAa,WAAW,AAAD,KAAM,CAAE,CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,MAAM,CAAC,QAAQ,OAAO,CAAC;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,MAAM,gDAA0B,OAAO,YAAY,eAAe,qBAAqB,QAAQ,SAAS;AAExG,SAAS,qCAAe,OAAgB;IACtC,MAAM,eAAe,CAAA,GAAA,wCAAa,EAAE;IACpC,IAAI,CAAE,CAAA,mBAAmB,aAAa,WAAW,AAAD,KAAM,CAAE,CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,CAAC;QAAC,oBAAoB;IAAI,MAAM,CAAC,QAAQ,OAAO,CAAC;IAGjF,OACE,QAAQ,QAAQ,KAAK,cACrB,qCAAe,YACf,yCAAmB,SAAS,iBAC3B,CAAA,CAAC,QAAQ,aAAa,IAAI,0CAAiB,QAAQ,aAAa,EAAE,QAAO;AAE9E","sources":["packages/@react-aria/utils/src/isElementVisible.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {getOwnerWindow} from './domHelpers';\n\nconst supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n // Ignore HiddenSelect when tree walking.\n !element.hasAttribute('data-react-aria-prevent-focus') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(element: Element, childElement?: Element): boolean {\n if (supportsCheckVisibility) {\n return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');\n }\n\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n"],"names":[],"version":3,"file":"isElementVisible.main.js.map"}
|
|
@@ -29,7 +29,9 @@ function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
|
|
|
29
29
|
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
30
30
|
}
|
|
31
31
|
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
|
|
32
|
-
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility(
|
|
32
|
+
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
|
|
33
|
+
visibilityProperty: true
|
|
34
|
+
}) && !element.closest('[data-react-aria-prevent-focus]');
|
|
33
35
|
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -29,7 +29,9 @@ function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
|
|
|
29
29
|
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
30
30
|
}
|
|
31
31
|
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
|
|
32
|
-
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility(
|
|
32
|
+
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
|
|
33
|
+
visibilityProperty: true
|
|
34
|
+
}) && !element.closest('[data-react-aria-prevent-focus]');
|
|
33
35
|
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
34
36
|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CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,CAAC;QAAC,oBAAoB;IAAI,MAAM,CAAC,QAAQ,OAAO,CAAC;IAGjF,OACE,QAAQ,QAAQ,KAAK,cACrB,qCAAe,YACf,yCAAmB,SAAS,iBAC3B,CAAA,CAAC,QAAQ,aAAa,IAAI,0CAAiB,QAAQ,aAAa,EAAE,QAAO;AAE9E","sources":["packages/@react-aria/utils/src/isElementVisible.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {getOwnerWindow} from './domHelpers';\n\nconst supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n // Ignore HiddenSelect when tree walking.\n !element.hasAttribute('data-react-aria-prevent-focus') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(element: Element, childElement?: Element): boolean {\n if (supportsCheckVisibility) {\n return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');\n }\n\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n"],"names":[],"version":3,"file":"isElementVisible.module.js.map"}
|
package/dist/keyboard.main.js
CHANGED
|
@@ -6,6 +6,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
$parcel$export(module.exports, "isCtrlKeyPressed", () => $2308dc377e184bb0$export$16792effe837dba3);
|
|
9
|
+
$parcel$export(module.exports, "willOpenKeyboard", () => $2308dc377e184bb0$export$c57958e35f31ed73);
|
|
9
10
|
/*
|
|
10
11
|
* Copyright 2024 Adobe. All rights reserved.
|
|
11
12
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -21,6 +22,21 @@ function $2308dc377e184bb0$export$16792effe837dba3(e) {
|
|
|
21
22
|
if ((0, $9e20cff0af27e8cc$exports.isMac)()) return e.metaKey;
|
|
22
23
|
return e.ctrlKey;
|
|
23
24
|
}
|
|
25
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
26
|
+
const $2308dc377e184bb0$var$nonTextInputTypes = new Set([
|
|
27
|
+
'checkbox',
|
|
28
|
+
'radio',
|
|
29
|
+
'range',
|
|
30
|
+
'color',
|
|
31
|
+
'file',
|
|
32
|
+
'image',
|
|
33
|
+
'button',
|
|
34
|
+
'submit',
|
|
35
|
+
'reset'
|
|
36
|
+
]);
|
|
37
|
+
function $2308dc377e184bb0$export$c57958e35f31ed73(target) {
|
|
38
|
+
return target instanceof HTMLInputElement && !$2308dc377e184bb0$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
39
|
+
}
|
|
24
40
|
|
|
25
41
|
|
|
26
42
|
//# sourceMappingURL=keyboard.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,+BAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.main.js.map"}
|
package/dist/keyboard.mjs
CHANGED
|
@@ -15,7 +15,22 @@ function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
|
15
15
|
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
16
16
|
return e.ctrlKey;
|
|
17
17
|
}
|
|
18
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
19
|
+
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
|
|
20
|
+
'checkbox',
|
|
21
|
+
'radio',
|
|
22
|
+
'range',
|
|
23
|
+
'color',
|
|
24
|
+
'file',
|
|
25
|
+
'image',
|
|
26
|
+
'button',
|
|
27
|
+
'submit',
|
|
28
|
+
'reset'
|
|
29
|
+
]);
|
|
30
|
+
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
|
|
31
|
+
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
32
|
+
}
|
|
18
33
|
|
|
19
34
|
|
|
20
|
-
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed};
|
|
35
|
+
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
|
|
21
36
|
//# sourceMappingURL=keyboard.module.js.map
|
package/dist/keyboard.module.js
CHANGED
|
@@ -15,7 +15,22 @@ function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
|
15
15
|
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
16
16
|
return e.ctrlKey;
|
|
17
17
|
}
|
|
18
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
19
|
+
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
|
|
20
|
+
'checkbox',
|
|
21
|
+
'radio',
|
|
22
|
+
'range',
|
|
23
|
+
'color',
|
|
24
|
+
'file',
|
|
25
|
+
'image',
|
|
26
|
+
'button',
|
|
27
|
+
'submit',
|
|
28
|
+
'reset'
|
|
29
|
+
]);
|
|
30
|
+
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
|
|
31
|
+
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
32
|
+
}
|
|
18
33
|
|
|
19
34
|
|
|
20
|
-
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed};
|
|
35
|
+
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
|
|
21
36
|
//# sourceMappingURL=keyboard.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,yCAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n"],"names":[],"version":3,"file":"keyboard.module.js.map"}
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,yCAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.module.js.map"}
|
package/dist/main.js
CHANGED
|
@@ -113,6 +113,7 @@ $parcel$export(module.exports, "inertValue", () => $13915169b1e4142c$exports.ine
|
|
|
113
113
|
$parcel$export(module.exports, "CLEAR_FOCUS_EVENT", () => $a0850d0add29d276$exports.CLEAR_FOCUS_EVENT);
|
|
114
114
|
$parcel$export(module.exports, "FOCUS_EVENT", () => $a0850d0add29d276$exports.FOCUS_EVENT);
|
|
115
115
|
$parcel$export(module.exports, "isCtrlKeyPressed", () => $2308dc377e184bb0$exports.isCtrlKeyPressed);
|
|
116
|
+
$parcel$export(module.exports, "willOpenKeyboard", () => $2308dc377e184bb0$exports.willOpenKeyboard);
|
|
116
117
|
$parcel$export(module.exports, "useEnterAnimation", () => $5bd06107f98811f5$exports.useEnterAnimation);
|
|
117
118
|
$parcel$export(module.exports, "useExitAnimation", () => $5bd06107f98811f5$exports.useExitAnimation);
|
|
118
119
|
$parcel$export(module.exports, "isFocusable", () => $506b33fd893eab7d$exports.isFocusable);
|
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 {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} 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, handleLinkClick} 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 {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\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';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,+BAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,qCAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.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 {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,yCAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,WAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,yCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.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 {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.module.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -36,7 +36,7 @@ import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoa
|
|
|
36
36
|
import {useLoadMoreSentinel as $a5fa973c1850dd36$export$ccaea96c28e8b9e7} from "./useLoadMoreSentinel.module.js";
|
|
37
37
|
import {inertValue as $cdc5a6778b766db2$export$a9d04c5684123369} from "./inertValue.module.js";
|
|
38
38
|
import {CLEAR_FOCUS_EVENT as $5671b20cf9b562b2$export$447a38995de2c711, FOCUS_EVENT as $5671b20cf9b562b2$export$831c820ad60f9d12} from "./constants.module.js";
|
|
39
|
-
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3} from "./keyboard.module.js";
|
|
39
|
+
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3, willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.module.js";
|
|
40
40
|
import {useEnterAnimation as $d3f049242431219c$export$6d3443f2c48bfc20, useExitAnimation as $d3f049242431219c$export$45fda7c47f93fd48} from "./animation.module.js";
|
|
41
41
|
import {isFocusable as $b4b717babfbb907b$export$4c063cf1350e6fed, isTabbable as $b4b717babfbb907b$export$bebd5a1431fec25d} from "./isFocusable.module.js";
|
|
42
42
|
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
|
|
@@ -95,5 +95,5 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $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, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
98
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $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, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
99
99
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} 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, handleLinkClick} 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 {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\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';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
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 {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} 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, handleLinkClick} 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 {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\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';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/openLink.main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,EAAE,IAAO,CAAA;YACvB,UAAU;YACV,MAAM,CAAC,QAAiB,WAAsB,MAAY;gBACxD,uCAAiB,QAAQ,CAAA;oBACvB,IAAI,0CAAqB,MAAM,YAC7B,SAAS,MAAM;yBAEf,0CAAS,MAAM;gBAEnB;YACF;YACA,SAAS,WAAY,CAAA,CAAC,OAAS,IAAG;QACpC,CAAA,GAAI;QAAC;QAA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AAM,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,KAAoB;IAC/C,IAAI,SAAS;QACe;IAA5B,MAAM,OAAO,OAAO,OAAO,CAAC,CAAA,cAAA,kBAAA,4BAAA,MAAO,IAAI,cAAX,yBAAA,cAAe;IAC3C,OAAO;QACL,MAAM,CAAA,kBAAA,4BAAA,MAAO,IAAI,IAAG,OAAO;QAC3B,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;AAEO,SAAS,0CAAgB,CAAkB,EAAE,MAAc,EAAE,IAAsB,EAAE,aAAwC;IAClI,mGAAmG;IACnG,IACE,CAAC,OAAO,QAAQ,IAChB,EAAE,aAAa,YAAY,qBAC3B,EAAE,aAAa,CAAC,IAAI,IACpB,0FAA0F;IAC1F,CAAC,EAAE,kBAAkB,MACrB,0CAAqB,EAAE,aAAa,EAAE,MACtC,MACA;QACA,EAAE,cAAc;QAChB,OAAO,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM;IACxC;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, DOMAttributes, JSX, MouseEvent as ReactMouseEvent, 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): JSX.Element {\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): boolean {\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): void {\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): DOMAttributes<HTMLElement> {\n let router = useRouter();\n const href = router.useHref(props.href ?? '');\n return {\n 'data-href': props.href ? 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 } as DOMAttributes<HTMLElement>;\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\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 } as DOMAttributes<HTMLElement>;\n}\n\nexport function useLinkProps(props?: LinkDOMProps): LinkDOMProps {\n let router = useRouter();\n const href = router.useHref(props?.href ?? '');\n return {\n href: props?.href ? 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\nexport function handleLinkClick(e: ReactMouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void {\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, href, routerOptions);\n }\n}\n"],"names":[],"version":3,"file":"openLink.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;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AY,qBAC3B,EAAE,aAAa,CAAC,IAAI,IACpB,0FAA0F;IAC1F,CAAC,EAAE,kBAAkB,MACrB,0CAAqB,EAAE,aAAa,EAAE,MACtC,MACA;QACA,EAAE,cAAc;QAChB,OAAO,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM;IACxC;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, DOMAttributes, JSX, MouseEvent as ReactMouseEvent, 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): JSX.Element {\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): boolean {\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): void {\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, detail: 1, 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): DOMAttributes<HTMLElement> {\n let router = useRouter();\n const href = router.useHref(props.href ?? '');\n return {\n 'data-href': props.href ? 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 } as DOMAttributes<HTMLElement>;\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\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 } as DOMAttributes<HTMLElement>;\n}\n\nexport function useLinkProps(props?: LinkDOMProps): LinkDOMProps {\n let router = useRouter();\n const href = router.useHref(props?.href ?? '');\n return {\n href: props?.href ? 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\nexport function handleLinkClick(e: ReactMouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void {\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, href, routerOptions);\n }\n}\n"],"names":[],"version":3,"file":"openLink.main.js.map"}
|
package/dist/openLink.mjs
CHANGED