@react-aria/utils 3.28.2 → 3.29.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.
@@ -1 +1 @@
1
- {"mappings":";;AAiBA,OAAO,MAAM,6CAED,CAAC;ACgBb;;;GAGG;AACH,sBAAsB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA4ChD;AAED;;;GAGG;AACH,yBAAyB,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED;;;;GAIG;AACH,0BAA0B,QAAQ,GAAE,aAAa,CAAC,GAAG,CAAM,GAAG,MAAM,CAcnE;ACpHD;;GAEG;AACH,sBAAsB,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAQnE;ACvBD,OAAO,MAAM,uBAAwB,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,QAEjE,CAAC;AAEF,OAAO,MAAM,qBACP,CAAC,MAAM,GAAG,OAAO,MAAM,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,KACxD,MAAM,GAAG,OAAO,MAOlB,CAAC;AAWF;;;GAGG;AACH,6BAA6B,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,UAAU,CAIlE;AC3BD;;GAEG;AACH,6BACE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAC7B,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GACjC,OAAO,CA6BT;AAED;;GAEG;AACH,OAAO,MAAM,yBAAyB,QAAQ,KAAc,OAAO,GAAG,IAYrE,CAAC;AAEF;;GAEG;AACH,+BAA+B,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAOjE;AChED,6BAA8B,YAAW,UAAU;IACjD,SAAgB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1C,SAAgB,IAAI,EA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,IAAI,CA+C1F;AC/ED,2BAA2B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAQxE;ACGD,OAAO,MAAM,4CAA4C,CAAC;AAC1D,OAAO,MAAM,gCAAgC,CAAC;ACA9C;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,iCAAiC,CAAC,EAAE,KAAK,GAAG,OAAO,CAMlD;ACVD,kCAAkC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,GAAE,OAAc,GAAG,OAAO,CAsBtG;AAED,iCAAiC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CA+B7F;AClDD,4BAA4B,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,2BAA2B,OAAO,EAAE,OAAO,GAAG,OAAO,CAEpD;ACcD,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/domHelpers.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/openLink.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isScrollable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParents.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useFormReset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMore.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/inertValue.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/constants.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/keyboard.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/animation.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isFocusable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/index.ts","packages/@react-aria/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\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} 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 {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"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiBA,OAAO,MAAM,6CAED,CAAC;ACgBb;;;GAGG;AACH,sBAAsB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA4ChD;AAED;;;GAGG;AACH,yBAAyB,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED;;;;GAIG;AACH,0BAA0B,QAAQ,GAAE,aAAa,CAAC,GAAG,CAAM,GAAG,MAAM,CAcnE;ACpHD;;GAEG;AACH,sBAAsB,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAQnE;ACvBD,OAAO,MAAM,mBAAoB,IAAI,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,QAEjE,CAAC;AAEF,OAAO,MAAM,iBACX,IAAI,CAAC,MAAM,GAAG,OAAO,MAAM,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,KACxD,MAAM,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,GAAG,OAAO,CAsBtG;AAED,iCAAiC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CA+B7F;AClDD,4BAA4B,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,2BAA2B,OAAO,EAAE,OAAO,GAAG,OAAO,CAEpD;ACcD,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/domHelpers.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/openLink.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isScrollable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParents.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useFormReset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMore.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMoreSentinel.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/inertValue.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/constants.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/keyboard.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/animation.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isFocusable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/index.ts","packages/@react-aria/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\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} 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 {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":"types.d.ts.map"}
@@ -0,0 +1,59 @@
1
+ var $d796e7157ac96470$exports = require("./getScrollParent.main.js");
2
+ var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
3
+ var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
4
+ var $8Ncyo$react = require("react");
5
+
6
+
7
+ function $parcel$export(e, n, v, s) {
8
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
+ }
10
+
11
+ $parcel$export(module.exports, "UNSTABLE_useLoadMoreSentinel", () => $f6a4874a7c582761$export$90a12e6abf95cbe0);
12
+ /*
13
+ * Copyright 2024 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+ function $f6a4874a7c582761$export$90a12e6abf95cbe0(props, ref) {
27
+ let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
28
+ let sentinelObserver = (0, $8Ncyo$react.useRef)(null);
29
+ let triggerLoadMore = (0, $1254e5bb94ac8761$exports.useEffectEvent)((entries)=>{
30
+ // Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
31
+ // a intersection ratio of 0 can be reported when isIntersecting is actually true
32
+ for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
33
+ // Up to user discretion as to how to handle these multiple onLoadMore calls
34
+ if (entry.isIntersecting && onLoadMore) onLoadMore();
35
+ });
36
+ (0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
37
+ if (ref.current) {
38
+ // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
39
+ // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
40
+ // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
41
+ sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
42
+ root: (0, $d796e7157ac96470$exports.getScrollParent)(ref === null || ref === void 0 ? void 0 : ref.current),
43
+ rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
44
+ });
45
+ sentinelObserver.current.observe(ref.current);
46
+ }
47
+ return ()=>{
48
+ if (sentinelObserver.current) sentinelObserver.current.disconnect();
49
+ };
50
+ }, [
51
+ collection,
52
+ triggerLoadMore,
53
+ ref,
54
+ scrollOffset
55
+ ]);
56
+ }
57
+
58
+
59
+ //# sourceMappingURL=useLoadMoreSentinel.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAoBM,SAAS,0CAA6B,KAA4B,EAAE,GAAkC;IAC3G,IAAI,cAAC,UAAU,cAAE,UAAU,gBAAE,eAAe,GAAE,GAAG;IAEjD,IAAI,mBAAmB,CAAA,GAAA,mBAAK,EAAwB;IAEpD,IAAI,kBAAkB,CAAA,GAAA,wCAAa,EAAE,CAAC;QACpC,4FAA4F;QAC5F,iFAAiF;QACjF,KAAK,IAAI,SAAS,QAChB,yHAAyH;QACzH,4EAA4E;QAC5E,IAAI,MAAM,cAAc,IAAI,YAC1B;IAGN;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI,OAAO,EAAE;YACf,mKAAmK;YACnK,0MAA0M;YAC1M,yFAAyF;YACzF,iBAAiB,OAAO,GAAG,IAAI,qBAAqB,iBAAiB;gBAAC,MAAM,CAAA,GAAA,yCAAc,EAAE,gBAAA,0BAAA,IAAK,OAAO;gBAAkB,YAAY,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,CAAC,CAAC;YAAA;YAChN,iBAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO;QAC9C;QAEA,OAAO;YACL,IAAI,iBAAiB,OAAO,EAC1B,iBAAiB,OAAO,CAAC,UAAU;QAEvC;IACF,GAAG;QAAC;QAAY;QAAiB;QAAK;KAAa;AACrD","sources":["packages/@react-aria/utils/src/useLoadMoreSentinel.ts"],"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 type {AsyncLoadable, Collection, Node} from '@react-types/shared';\nimport {getScrollParent} from './getScrollParent';\nimport {RefObject, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {\n collection: Collection<Node<unknown>>,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number\n}\n\nexport function UNSTABLE_useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {\n let {collection, onLoadMore, scrollOffset = 1} = props;\n\n let sentinelObserver = useRef<IntersectionObserver>(null);\n\n let triggerLoadMore = useEffectEvent((entries: IntersectionObserverEntry[]) => {\n // Use \"isIntersecting\" over an equality check of 0 since it seems like there is cases where\n // a intersection ratio of 0 can be reported when isIntersecting is actually true\n for (let entry of entries) {\n // Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.\n // Up to user discretion as to how to handle these multiple onLoadMore calls\n if (entry.isIntersecting && onLoadMore) {\n onLoadMore();\n }\n }\n });\n\n useLayoutEffect(() => {\n if (ref.current) {\n // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items\n // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed\n // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21\n sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {root: getScrollParent(ref?.current) as HTMLElement, rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`});\n sentinelObserver.current.observe(ref.current);\n }\n\n return () => {\n if (sentinelObserver.current) {\n sentinelObserver.current.disconnect();\n }\n };\n }, [collection, triggerLoadMore, ref, scrollOffset]);\n}\n"],"names":[],"version":3,"file":"useLoadMoreSentinel.main.js.map"}
@@ -0,0 +1,54 @@
1
+ import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.mjs";
2
+ import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
3
+ import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
4
+ import {useRef as $7FoZl$useRef} from "react";
5
+
6
+ /*
7
+ * Copyright 2024 Adobe. All rights reserved.
8
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License. You may obtain a copy
10
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software distributed under
13
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ * OF ANY KIND, either express or implied. See the License for the specific language
15
+ * governing permissions and limitations under the License.
16
+ */
17
+
18
+
19
+
20
+ function $a5fa973c1850dd36$export$90a12e6abf95cbe0(props, ref) {
21
+ let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
22
+ let sentinelObserver = (0, $7FoZl$useRef)(null);
23
+ let triggerLoadMore = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((entries)=>{
24
+ // Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
25
+ // a intersection ratio of 0 can be reported when isIntersecting is actually true
26
+ for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
27
+ // Up to user discretion as to how to handle these multiple onLoadMore calls
28
+ if (entry.isIntersecting && onLoadMore) onLoadMore();
29
+ });
30
+ (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
31
+ if (ref.current) {
32
+ // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
33
+ // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
34
+ // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
35
+ sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
36
+ root: (0, $62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref === void 0 ? void 0 : ref.current),
37
+ rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
38
+ });
39
+ sentinelObserver.current.observe(ref.current);
40
+ }
41
+ return ()=>{
42
+ if (sentinelObserver.current) sentinelObserver.current.disconnect();
43
+ };
44
+ }, [
45
+ collection,
46
+ triggerLoadMore,
47
+ ref,
48
+ scrollOffset
49
+ ]);
50
+ }
51
+
52
+
53
+ export {$a5fa973c1850dd36$export$90a12e6abf95cbe0 as UNSTABLE_useLoadMoreSentinel};
54
+ //# sourceMappingURL=useLoadMoreSentinel.module.js.map
@@ -0,0 +1,54 @@
1
+ import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.module.js";
2
+ import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
3
+ import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
4
+ import {useRef as $7FoZl$useRef} from "react";
5
+
6
+ /*
7
+ * Copyright 2024 Adobe. All rights reserved.
8
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License. You may obtain a copy
10
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software distributed under
13
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ * OF ANY KIND, either express or implied. See the License for the specific language
15
+ * governing permissions and limitations under the License.
16
+ */
17
+
18
+
19
+
20
+ function $a5fa973c1850dd36$export$90a12e6abf95cbe0(props, ref) {
21
+ let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
22
+ let sentinelObserver = (0, $7FoZl$useRef)(null);
23
+ let triggerLoadMore = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((entries)=>{
24
+ // Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
25
+ // a intersection ratio of 0 can be reported when isIntersecting is actually true
26
+ for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
27
+ // Up to user discretion as to how to handle these multiple onLoadMore calls
28
+ if (entry.isIntersecting && onLoadMore) onLoadMore();
29
+ });
30
+ (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
31
+ if (ref.current) {
32
+ // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
33
+ // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
34
+ // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
35
+ sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
36
+ root: (0, $62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref === void 0 ? void 0 : ref.current),
37
+ rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
38
+ });
39
+ sentinelObserver.current.observe(ref.current);
40
+ }
41
+ return ()=>{
42
+ if (sentinelObserver.current) sentinelObserver.current.disconnect();
43
+ };
44
+ }, [
45
+ collection,
46
+ triggerLoadMore,
47
+ ref,
48
+ scrollOffset
49
+ ]);
50
+ }
51
+
52
+
53
+ export {$a5fa973c1850dd36$export$90a12e6abf95cbe0 as UNSTABLE_useLoadMoreSentinel};
54
+ //# sourceMappingURL=useLoadMoreSentinel.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAoBM,SAAS,0CAA6B,KAA4B,EAAE,GAAkC;IAC3G,IAAI,cAAC,UAAU,cAAE,UAAU,gBAAE,eAAe,GAAE,GAAG;IAEjD,IAAI,mBAAmB,CAAA,GAAA,aAAK,EAAwB;IAEpD,IAAI,kBAAkB,CAAA,GAAA,yCAAa,EAAE,CAAC;QACpC,4FAA4F;QAC5F,iFAAiF;QACjF,KAAK,IAAI,SAAS,QAChB,yHAAyH;QACzH,4EAA4E;QAC5E,IAAI,MAAM,cAAc,IAAI,YAC1B;IAGN;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI,OAAO,EAAE;YACf,mKAAmK;YACnK,0MAA0M;YAC1M,yFAAyF;YACzF,iBAAiB,OAAO,GAAG,IAAI,qBAAqB,iBAAiB;gBAAC,MAAM,CAAA,GAAA,yCAAc,EAAE,gBAAA,0BAAA,IAAK,OAAO;gBAAkB,YAAY,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,CAAC,CAAC;YAAA;YAChN,iBAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO;QAC9C;QAEA,OAAO;YACL,IAAI,iBAAiB,OAAO,EAC1B,iBAAiB,OAAO,CAAC,UAAU;QAEvC;IACF,GAAG;QAAC;QAAY;QAAiB;QAAK;KAAa;AACrD","sources":["packages/@react-aria/utils/src/useLoadMoreSentinel.ts"],"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 type {AsyncLoadable, Collection, Node} from '@react-types/shared';\nimport {getScrollParent} from './getScrollParent';\nimport {RefObject, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {\n collection: Collection<Node<unknown>>,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number\n}\n\nexport function UNSTABLE_useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {\n let {collection, onLoadMore, scrollOffset = 1} = props;\n\n let sentinelObserver = useRef<IntersectionObserver>(null);\n\n let triggerLoadMore = useEffectEvent((entries: IntersectionObserverEntry[]) => {\n // Use \"isIntersecting\" over an equality check of 0 since it seems like there is cases where\n // a intersection ratio of 0 can be reported when isIntersecting is actually true\n for (let entry of entries) {\n // Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.\n // Up to user discretion as to how to handle these multiple onLoadMore calls\n if (entry.isIntersecting && onLoadMore) {\n onLoadMore();\n }\n }\n });\n\n useLayoutEffect(() => {\n if (ref.current) {\n // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items\n // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed\n // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21\n sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {root: getScrollParent(ref?.current) as HTMLElement, rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`});\n sentinelObserver.current.observe(ref.current);\n }\n\n return () => {\n if (sentinelObserver.current) {\n sentinelObserver.current.disconnect();\n }\n };\n }, [collection, triggerLoadMore, ref, scrollOffset]);\n}\n"],"names":[],"version":3,"file":"useLoadMoreSentinel.module.js.map"}
@@ -17,19 +17,40 @@ $parcel$export(module.exports, "useObjectRef", () => $475b35fe72ba49b3$export$43
17
17
  * OF ANY KIND, either express or implied. See the License for the specific language
18
18
  * governing permissions and limitations under the License.
19
19
  */
20
- function $475b35fe72ba49b3$export$4338b53315abf666(forwardedRef) {
20
+ function $475b35fe72ba49b3$export$4338b53315abf666(ref) {
21
21
  const objRef = (0, $eMoU1$react.useRef)(null);
22
+ const cleanupRef = (0, $eMoU1$react.useRef)(undefined);
23
+ const refEffect = (0, $eMoU1$react.useCallback)((instance)=>{
24
+ if (typeof ref === 'function') {
25
+ const refCallback = ref;
26
+ const refCleanup = refCallback(instance);
27
+ return ()=>{
28
+ if (typeof refCleanup === 'function') refCleanup();
29
+ else refCallback(null);
30
+ };
31
+ } else if (ref) {
32
+ ref.current = instance;
33
+ return ()=>{
34
+ ref.current = null;
35
+ };
36
+ }
37
+ }, [
38
+ ref
39
+ ]);
22
40
  return (0, $eMoU1$react.useMemo)(()=>({
23
41
  get current () {
24
42
  return objRef.current;
25
43
  },
26
44
  set current (value){
27
45
  objRef.current = value;
28
- if (typeof forwardedRef === 'function') forwardedRef(value);
29
- else if (forwardedRef) forwardedRef.current = value;
46
+ if (cleanupRef.current) {
47
+ cleanupRef.current();
48
+ cleanupRef.current = undefined;
49
+ }
50
+ if (value != null) cleanupRef.current = refEffect(value);
30
51
  }
31
52
  }), [
32
- forwardedRef
53
+ refEffect
33
54
  ]);
34
55
  }
35
56
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,YAAiF;IAC/G,MAAM,SAAqC,CAAA,GAAA,mBAAK,EAAK;IACrD,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;YACpB,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,OAAO,iBAAiB,YAC1B,aAAa;qBACR,IAAI,cACT,aAAa,OAAO,GAAG;YAE3B;QACF,CAAA,GAAI;QAAC;KAAa;AACpB","sources":["packages/@react-aria/utils/src/useObjectRef.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 {MutableRefObject, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param forwardedRef The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://reactjs.org/docs/forwarding-refs.html\n */\nexport function useObjectRef<T>(forwardedRef?: ((instance: T | null) => void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n return useMemo(() => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (typeof forwardedRef === 'function') {\n forwardedRef(value);\n } else if (forwardedRef) {\n forwardedRef.current = value;\n }\n }\n }), [forwardedRef]);\n}\n"],"names":[],"version":3,"file":"useObjectRef.main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,GAAuF;IACrH,MAAM,SAAqC,CAAA,GAAA,mBAAK,EAAK;IACrD,MAAM,aAAoD,CAAA,GAAA,mBAAK,EAAE;IAEjE,MAAM,YAAY,CAAA,GAAA,wBAAU,EAC1B,CAAC;QACC,IAAI,OAAO,QAAQ,YAAY;YAC7B,MAAM,cAAc;YACpB,MAAM,aAAa,YAAY;YAC/B,OAAO;gBACL,IAAI,OAAO,eAAe,YACxB;qBAEA,YAAY;YAEhB;QACF,OAAO,IAAI,KAAK;YACd,IAAI,OAAO,GAAG;YACd,OAAO;gBACL,IAAI,OAAO,GAAG;YAChB;QACF;IACF,GACA;QAAC;KAAI;IAGP,OAAO,CAAA,GAAA,oBAAM,EACX,IAAO,CAAA;YACL,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,WAAW,OAAO,EAAE;oBACtB,WAAW,OAAO;oBAClB,WAAW,OAAO,GAAG;gBACvB;gBAEA,IAAI,SAAS,MACX,WAAW,OAAO,GAAG,UAAU;YAEnC;QACF,CAAA,GACA;QAAC;KAAU;AAEf","sources":["packages/@react-aria/utils/src/useObjectRef.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 {MutableRefObject, useCallback, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param ref The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://react.dev/reference/react/forwardRef\n */\nexport function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);\n\n const refEffect = useCallback(\n (instance: T | null) => {\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return () => {\n if (typeof refCleanup === 'function') {\n refCleanup();\n } else {\n refCallback(null);\n }\n };\n } else if (ref) {\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n }\n },\n [ref]\n );\n\n return useMemo(\n () => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n }\n }),\n [refEffect]\n );\n}\n"],"names":[],"version":3,"file":"useObjectRef.main.js.map"}
@@ -1,4 +1,4 @@
1
- import {useRef as $gbmns$useRef, useMemo as $gbmns$useMemo} from "react";
1
+ import {useRef as $gbmns$useRef, useCallback as $gbmns$useCallback, useMemo as $gbmns$useMemo} from "react";
2
2
 
3
3
  /*
4
4
  * Copyright 2021 Adobe. All rights reserved.
@@ -11,19 +11,40 @@ import {useRef as $gbmns$useRef, useMemo as $gbmns$useMemo} from "react";
11
11
  * OF ANY KIND, either express or implied. See the License for the specific language
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
- function $df56164dff5785e2$export$4338b53315abf666(forwardedRef) {
14
+ function $df56164dff5785e2$export$4338b53315abf666(ref) {
15
15
  const objRef = (0, $gbmns$useRef)(null);
16
+ const cleanupRef = (0, $gbmns$useRef)(undefined);
17
+ const refEffect = (0, $gbmns$useCallback)((instance)=>{
18
+ if (typeof ref === 'function') {
19
+ const refCallback = ref;
20
+ const refCleanup = refCallback(instance);
21
+ return ()=>{
22
+ if (typeof refCleanup === 'function') refCleanup();
23
+ else refCallback(null);
24
+ };
25
+ } else if (ref) {
26
+ ref.current = instance;
27
+ return ()=>{
28
+ ref.current = null;
29
+ };
30
+ }
31
+ }, [
32
+ ref
33
+ ]);
16
34
  return (0, $gbmns$useMemo)(()=>({
17
35
  get current () {
18
36
  return objRef.current;
19
37
  },
20
38
  set current (value){
21
39
  objRef.current = value;
22
- if (typeof forwardedRef === 'function') forwardedRef(value);
23
- else if (forwardedRef) forwardedRef.current = value;
40
+ if (cleanupRef.current) {
41
+ cleanupRef.current();
42
+ cleanupRef.current = undefined;
43
+ }
44
+ if (value != null) cleanupRef.current = refEffect(value);
24
45
  }
25
46
  }), [
26
- forwardedRef
47
+ refEffect
27
48
  ]);
28
49
  }
29
50
 
@@ -1,4 +1,4 @@
1
- import {useRef as $gbmns$useRef, useMemo as $gbmns$useMemo} from "react";
1
+ import {useRef as $gbmns$useRef, useCallback as $gbmns$useCallback, useMemo as $gbmns$useMemo} from "react";
2
2
 
3
3
  /*
4
4
  * Copyright 2021 Adobe. All rights reserved.
@@ -11,19 +11,40 @@ import {useRef as $gbmns$useRef, useMemo as $gbmns$useMemo} from "react";
11
11
  * OF ANY KIND, either express or implied. See the License for the specific language
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
- function $df56164dff5785e2$export$4338b53315abf666(forwardedRef) {
14
+ function $df56164dff5785e2$export$4338b53315abf666(ref) {
15
15
  const objRef = (0, $gbmns$useRef)(null);
16
+ const cleanupRef = (0, $gbmns$useRef)(undefined);
17
+ const refEffect = (0, $gbmns$useCallback)((instance)=>{
18
+ if (typeof ref === 'function') {
19
+ const refCallback = ref;
20
+ const refCleanup = refCallback(instance);
21
+ return ()=>{
22
+ if (typeof refCleanup === 'function') refCleanup();
23
+ else refCallback(null);
24
+ };
25
+ } else if (ref) {
26
+ ref.current = instance;
27
+ return ()=>{
28
+ ref.current = null;
29
+ };
30
+ }
31
+ }, [
32
+ ref
33
+ ]);
16
34
  return (0, $gbmns$useMemo)(()=>({
17
35
  get current () {
18
36
  return objRef.current;
19
37
  },
20
38
  set current (value){
21
39
  objRef.current = value;
22
- if (typeof forwardedRef === 'function') forwardedRef(value);
23
- else if (forwardedRef) forwardedRef.current = value;
40
+ if (cleanupRef.current) {
41
+ cleanupRef.current();
42
+ cleanupRef.current = undefined;
43
+ }
44
+ if (value != null) cleanupRef.current = refEffect(value);
24
45
  }
25
46
  }), [
26
- forwardedRef
47
+ refEffect
27
48
  ]);
28
49
  }
29
50
 
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,YAAiF;IAC/G,MAAM,SAAqC,CAAA,GAAA,aAAK,EAAK;IACrD,OAAO,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;YACpB,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,OAAO,iBAAiB,YAC1B,aAAa;qBACR,IAAI,cACT,aAAa,OAAO,GAAG;YAE3B;QACF,CAAA,GAAI;QAAC;KAAa;AACpB","sources":["packages/@react-aria/utils/src/useObjectRef.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 {MutableRefObject, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param forwardedRef The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://reactjs.org/docs/forwarding-refs.html\n */\nexport function useObjectRef<T>(forwardedRef?: ((instance: T | null) => void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n return useMemo(() => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (typeof forwardedRef === 'function') {\n forwardedRef(value);\n } else if (forwardedRef) {\n forwardedRef.current = value;\n }\n }\n }), [forwardedRef]);\n}\n"],"names":[],"version":3,"file":"useObjectRef.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,GAAuF;IACrH,MAAM,SAAqC,CAAA,GAAA,aAAK,EAAK;IACrD,MAAM,aAAoD,CAAA,GAAA,aAAK,EAAE;IAEjE,MAAM,YAAY,CAAA,GAAA,kBAAU,EAC1B,CAAC;QACC,IAAI,OAAO,QAAQ,YAAY;YAC7B,MAAM,cAAc;YACpB,MAAM,aAAa,YAAY;YAC/B,OAAO;gBACL,IAAI,OAAO,eAAe,YACxB;qBAEA,YAAY;YAEhB;QACF,OAAO,IAAI,KAAK;YACd,IAAI,OAAO,GAAG;YACd,OAAO;gBACL,IAAI,OAAO,GAAG;YAChB;QACF;IACF,GACA;QAAC;KAAI;IAGP,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;YACL,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,WAAW,OAAO,EAAE;oBACtB,WAAW,OAAO;oBAClB,WAAW,OAAO,GAAG;gBACvB;gBAEA,IAAI,SAAS,MACX,WAAW,OAAO,GAAG,UAAU;YAEnC;QACF,CAAA,GACA;QAAC;KAAU;AAEf","sources":["packages/@react-aria/utils/src/useObjectRef.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 {MutableRefObject, useCallback, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param ref The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://react.dev/reference/react/forwardRef\n */\nexport function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);\n\n const refEffect = useCallback(\n (instance: T | null) => {\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return () => {\n if (typeof refCleanup === 'function') {\n refCleanup();\n } else {\n refCallback(null);\n }\n };\n } else if (ref) {\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n }\n },\n [ref]\n );\n\n return useMemo(\n () => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n }\n }),\n [refEffect]\n );\n}\n"],"names":[],"version":3,"file":"useObjectRef.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/utils",
3
- "version": "3.28.2",
3
+ "version": "3.29.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -25,7 +25,7 @@
25
25
  "@react-aria/ssr": "^3.9.8",
26
26
  "@react-stately/flags": "^3.1.1",
27
27
  "@react-stately/utils": "^3.10.6",
28
- "@react-types/shared": "^3.29.0",
28
+ "@react-types/shared": "^3.29.1",
29
29
  "@swc/helpers": "^0.5.0",
30
30
  "clsx": "^2.0.0"
31
31
  },
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
39
+ "gitHead": "9c77d4e8267ed39469c65f65da94ece7be509874"
40
40
  }
package/src/index.ts CHANGED
@@ -45,8 +45,11 @@ export {useEffectEvent} from './useEffectEvent';
45
45
  export {useDeepMemo} from './useDeepMemo';
46
46
  export {useFormReset} from './useFormReset';
47
47
  export {useLoadMore} from './useLoadMore';
48
+ export {UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';
48
49
  export {inertValue} from './inertValue';
49
50
  export {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';
50
51
  export {isCtrlKeyPressed} from './keyboard';
51
52
  export {useEnterAnimation, useExitAnimation} from './animation';
52
53
  export {isFocusable, isTabbable} from './isFocusable';
54
+
55
+ export type {LoadMoreSentinelProps} from './useLoadMoreSentinel';
package/src/mergeRefs.ts CHANGED
@@ -10,23 +10,43 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {ForwardedRef, MutableRefObject} from 'react';
13
+ import {MutableRefObject, Ref} from 'react';
14
14
 
15
15
  /**
16
16
  * Merges multiple refs into one. Works with either callback or object refs.
17
17
  */
18
- export function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T> | null | undefined>): ForwardedRef<T> {
18
+ export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {
19
19
  if (refs.length === 1 && refs[0]) {
20
20
  return refs[0];
21
21
  }
22
22
 
23
23
  return (value: T | null) => {
24
- for (let ref of refs) {
25
- if (typeof ref === 'function') {
26
- ref(value);
27
- } else if (ref != null) {
28
- ref.current = value;
29
- }
24
+ let hasCleanup = false;
25
+
26
+ const cleanups = refs.map(ref => {
27
+ const cleanup = setRef(ref, value);
28
+ hasCleanup ||= typeof cleanup == 'function';
29
+ return cleanup;
30
+ });
31
+
32
+ if (hasCleanup) {
33
+ return () => {
34
+ cleanups.forEach((cleanup, i) => {
35
+ if (typeof cleanup === 'function') {
36
+ cleanup();
37
+ } else {
38
+ setRef(refs[i], null);
39
+ }
40
+ });
41
+ };
30
42
  }
31
43
  };
32
44
  }
45
+
46
+ function setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {
47
+ if (typeof ref === 'function') {
48
+ return ref(value);
49
+ } else if (ref != null) {
50
+ ref.current = value;
51
+ }
52
+ }
package/src/openLink.tsx CHANGED
@@ -13,7 +13,7 @@
13
13
  import {focusWithoutScrolling, isMac, isWebKit} from './index';
14
14
  import {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';
15
15
  import {isFirefox, isIPad} from './platform';
16
- import React, {createContext, DOMAttributes, ReactNode, useContext, useMemo} from 'react';
16
+ import React, {createContext, DOMAttributes, JSX, ReactNode, useContext, useMemo} from 'react';
17
17
 
18
18
  interface Router {
19
19
  isNative: boolean,
@@ -37,7 +37,7 @@ interface RouterProviderProps {
37
37
  * A RouterProvider accepts a `navigate` function from a framework or client side router,
38
38
  * and provides it to all nested React Aria links to enable client side navigation.
39
39
  */
40
- export function RouterProvider(props: RouterProviderProps): ReactNode {
40
+ export function RouterProvider(props: RouterProviderProps): JSX.Element {
41
41
  let {children, navigate, useHref} = props;
42
42
 
43
43
  let ctx = useMemo(() => ({
@@ -91,9 +91,25 @@ if (typeof document !== 'undefined') {
91
91
  }
92
92
  }
93
93
 
94
+ /**
95
+ * Cleans up any elements that are no longer in the document.
96
+ * This is necessary because we can't rely on transitionend events to fire
97
+ * for elements that are removed from the document while transitioning.
98
+ */
99
+ function cleanupDetachedElements() {
100
+ for (const [eventTarget] of transitionsByElement) {
101
+ // Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
102
+ // the explicit instanceof check, since it may be different in different contexts.
103
+ if ('isConnected' in eventTarget && !eventTarget.isConnected) {
104
+ transitionsByElement.delete(eventTarget);
105
+ }
106
+ }
107
+ }
108
+
94
109
  export function runAfterTransition(fn: () => void): void {
95
110
  // Wait one frame to see if an animation starts, e.g. a transition on mount.
96
111
  requestAnimationFrame(() => {
112
+ cleanupDetachedElements();
97
113
  // If no transitions are running, call the function immediately.
98
114
  // Otherwise, add it to a list of callbacks to run at the end of the animation.
99
115
  if (transitionsByElement.size === 0) {