@react-stately/virtualizer 3.6.9-nightly.4555 → 3.6.9-nightly.4560

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.
Files changed (66) hide show
  1. package/dist/Layout.main.js +75 -0
  2. package/dist/Layout.main.js.map +1 -0
  3. package/dist/Layout.mjs +70 -0
  4. package/dist/Layout.module.js +70 -0
  5. package/dist/Layout.module.js.map +1 -0
  6. package/dist/LayoutInfo.main.js +51 -0
  7. package/dist/LayoutInfo.main.js.map +1 -0
  8. package/dist/LayoutInfo.mjs +46 -0
  9. package/dist/LayoutInfo.module.js +46 -0
  10. package/dist/LayoutInfo.module.js.map +1 -0
  11. package/dist/OverscanManager.main.js +87 -0
  12. package/dist/OverscanManager.main.js.map +1 -0
  13. package/dist/OverscanManager.mjs +82 -0
  14. package/dist/OverscanManager.module.js +82 -0
  15. package/dist/OverscanManager.module.js.map +1 -0
  16. package/dist/Point.main.js +40 -0
  17. package/dist/Point.main.js.map +1 -0
  18. package/dist/Point.mjs +35 -0
  19. package/dist/Point.module.js +35 -0
  20. package/dist/Point.module.js.map +1 -0
  21. package/dist/Rect.main.js +130 -0
  22. package/dist/Rect.main.js.map +1 -0
  23. package/dist/Rect.mjs +125 -0
  24. package/dist/Rect.module.js +125 -0
  25. package/dist/Rect.module.js.map +1 -0
  26. package/dist/ReusableView.main.js +33 -0
  27. package/dist/ReusableView.main.js.map +1 -0
  28. package/dist/ReusableView.mjs +28 -0
  29. package/dist/ReusableView.module.js +28 -0
  30. package/dist/ReusableView.module.js.map +1 -0
  31. package/dist/Size.main.js +40 -0
  32. package/dist/Size.main.js.map +1 -0
  33. package/dist/Size.mjs +35 -0
  34. package/dist/Size.module.js +35 -0
  35. package/dist/Size.module.js.map +1 -0
  36. package/dist/Transaction.main.js +32 -0
  37. package/dist/Transaction.main.js.map +1 -0
  38. package/dist/Transaction.mjs +27 -0
  39. package/dist/Transaction.module.js +27 -0
  40. package/dist/Transaction.module.js.map +1 -0
  41. package/dist/Virtualizer.main.js +813 -0
  42. package/dist/Virtualizer.main.js.map +1 -0
  43. package/dist/Virtualizer.mjs +808 -0
  44. package/dist/Virtualizer.module.js +808 -0
  45. package/dist/Virtualizer.module.js.map +1 -0
  46. package/dist/import.mjs +7 -1399
  47. package/dist/main.js +14 -1406
  48. package/dist/main.js.map +1 -1
  49. package/dist/module.js +7 -1399
  50. package/dist/module.js.map +1 -1
  51. package/dist/tween.main.js +67 -0
  52. package/dist/tween.main.js.map +1 -0
  53. package/dist/tween.mjs +61 -0
  54. package/dist/tween.module.js +61 -0
  55. package/dist/tween.module.js.map +1 -0
  56. package/dist/useVirtualizerState.main.js +96 -0
  57. package/dist/useVirtualizerState.main.js.map +1 -0
  58. package/dist/useVirtualizerState.mjs +91 -0
  59. package/dist/useVirtualizerState.module.js +91 -0
  60. package/dist/useVirtualizerState.module.js.map +1 -0
  61. package/dist/utils.main.js +53 -0
  62. package/dist/utils.main.js.map +1 -0
  63. package/dist/utils.mjs +46 -0
  64. package/dist/utils.module.js +46 -0
  65. package/dist/utils.module.js.map +1 -0
  66. package/package.json +4 -4
@@ -0,0 +1,91 @@
1
+ import {Size as $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec} from "./Size.mjs";
2
+ import {Virtualizer as $38b9490c1cca8fc4$export$89be5a243e59c4b2} from "./Virtualizer.mjs";
3
+ import {useState as $3Fik3$useState, useMemo as $3Fik3$useMemo, useEffect as $3Fik3$useEffect, useCallback as $3Fik3$useCallback} from "react";
4
+ import {useLayoutEffect as $3Fik3$useLayoutEffect} from "@react-aria/utils";
5
+
6
+ /*
7
+ * Copyright 2020 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 $fc0b13b484ac1194$export$1505db82fe357e65(opts) {
21
+ let [visibleViews, setVisibleViews] = (0, $3Fik3$useState)([]);
22
+ let [contentSize, setContentSize] = (0, $3Fik3$useState)(new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)());
23
+ let [isAnimating, setAnimating] = (0, $3Fik3$useState)(false);
24
+ let [isScrolling, setScrolling] = (0, $3Fik3$useState)(false);
25
+ let virtualizer = (0, $3Fik3$useMemo)(()=>new (0, $38b9490c1cca8fc4$export$89be5a243e59c4b2)(), []);
26
+ virtualizer.delegate = {
27
+ setVisibleViews: setVisibleViews,
28
+ setVisibleRect (rect) {
29
+ virtualizer.visibleRect = rect;
30
+ opts.onVisibleRectChange(rect);
31
+ },
32
+ setContentSize: setContentSize,
33
+ renderView: opts.renderView,
34
+ renderWrapper: opts.renderWrapper,
35
+ beginAnimations: ()=>setAnimating(true),
36
+ endAnimations: ()=>setAnimating(false),
37
+ getScrollAnchor: opts.getScrollAnchor
38
+ };
39
+ virtualizer.layout = opts.layout;
40
+ virtualizer.collection = opts.collection;
41
+ virtualizer.transitionDuration = opts.transitionDuration;
42
+ (0, $3Fik3$useLayoutEffect)(()=>{
43
+ virtualizer.afterRender();
44
+ });
45
+ // eslint-disable-next-line arrow-body-style
46
+ (0, $3Fik3$useEffect)(()=>{
47
+ return ()=>virtualizer.willUnmount();
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ }, []);
50
+ let setVisibleRect = (0, $3Fik3$useCallback)((rect)=>{
51
+ virtualizer.visibleRect = rect;
52
+ }, [
53
+ virtualizer
54
+ ]);
55
+ let startScrolling = (0, $3Fik3$useCallback)(()=>{
56
+ virtualizer.startScrolling();
57
+ setScrolling(true);
58
+ }, [
59
+ virtualizer
60
+ ]);
61
+ let endScrolling = (0, $3Fik3$useCallback)(()=>{
62
+ virtualizer.endScrolling();
63
+ setScrolling(false);
64
+ }, [
65
+ virtualizer
66
+ ]);
67
+ let state = (0, $3Fik3$useMemo)(()=>({
68
+ virtualizer: virtualizer,
69
+ visibleViews: visibleViews,
70
+ setVisibleRect: setVisibleRect,
71
+ contentSize: contentSize,
72
+ isAnimating: isAnimating,
73
+ isScrolling: isScrolling,
74
+ startScrolling: startScrolling,
75
+ endScrolling: endScrolling
76
+ }), [
77
+ virtualizer,
78
+ visibleViews,
79
+ setVisibleRect,
80
+ contentSize,
81
+ isAnimating,
82
+ isScrolling,
83
+ startScrolling,
84
+ endScrolling
85
+ ]);
86
+ return state;
87
+ }
88
+
89
+
90
+ export {$fc0b13b484ac1194$export$1505db82fe357e65 as useVirtualizerState};
91
+ //# sourceMappingURL=useVirtualizerState.mjs.map
@@ -0,0 +1,91 @@
1
+ import {Size as $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec} from "./Size.module.js";
2
+ import {Virtualizer as $38b9490c1cca8fc4$export$89be5a243e59c4b2} from "./Virtualizer.module.js";
3
+ import {useState as $3Fik3$useState, useMemo as $3Fik3$useMemo, useEffect as $3Fik3$useEffect, useCallback as $3Fik3$useCallback} from "react";
4
+ import {useLayoutEffect as $3Fik3$useLayoutEffect} from "@react-aria/utils";
5
+
6
+ /*
7
+ * Copyright 2020 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 $fc0b13b484ac1194$export$1505db82fe357e65(opts) {
21
+ let [visibleViews, setVisibleViews] = (0, $3Fik3$useState)([]);
22
+ let [contentSize, setContentSize] = (0, $3Fik3$useState)(new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)());
23
+ let [isAnimating, setAnimating] = (0, $3Fik3$useState)(false);
24
+ let [isScrolling, setScrolling] = (0, $3Fik3$useState)(false);
25
+ let virtualizer = (0, $3Fik3$useMemo)(()=>new (0, $38b9490c1cca8fc4$export$89be5a243e59c4b2)(), []);
26
+ virtualizer.delegate = {
27
+ setVisibleViews: setVisibleViews,
28
+ setVisibleRect (rect) {
29
+ virtualizer.visibleRect = rect;
30
+ opts.onVisibleRectChange(rect);
31
+ },
32
+ setContentSize: setContentSize,
33
+ renderView: opts.renderView,
34
+ renderWrapper: opts.renderWrapper,
35
+ beginAnimations: ()=>setAnimating(true),
36
+ endAnimations: ()=>setAnimating(false),
37
+ getScrollAnchor: opts.getScrollAnchor
38
+ };
39
+ virtualizer.layout = opts.layout;
40
+ virtualizer.collection = opts.collection;
41
+ virtualizer.transitionDuration = opts.transitionDuration;
42
+ (0, $3Fik3$useLayoutEffect)(()=>{
43
+ virtualizer.afterRender();
44
+ });
45
+ // eslint-disable-next-line arrow-body-style
46
+ (0, $3Fik3$useEffect)(()=>{
47
+ return ()=>virtualizer.willUnmount();
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ }, []);
50
+ let setVisibleRect = (0, $3Fik3$useCallback)((rect)=>{
51
+ virtualizer.visibleRect = rect;
52
+ }, [
53
+ virtualizer
54
+ ]);
55
+ let startScrolling = (0, $3Fik3$useCallback)(()=>{
56
+ virtualizer.startScrolling();
57
+ setScrolling(true);
58
+ }, [
59
+ virtualizer
60
+ ]);
61
+ let endScrolling = (0, $3Fik3$useCallback)(()=>{
62
+ virtualizer.endScrolling();
63
+ setScrolling(false);
64
+ }, [
65
+ virtualizer
66
+ ]);
67
+ let state = (0, $3Fik3$useMemo)(()=>({
68
+ virtualizer: virtualizer,
69
+ visibleViews: visibleViews,
70
+ setVisibleRect: setVisibleRect,
71
+ contentSize: contentSize,
72
+ isAnimating: isAnimating,
73
+ isScrolling: isScrolling,
74
+ startScrolling: startScrolling,
75
+ endScrolling: endScrolling
76
+ }), [
77
+ virtualizer,
78
+ visibleViews,
79
+ setVisibleRect,
80
+ contentSize,
81
+ isAnimating,
82
+ isScrolling,
83
+ startScrolling,
84
+ endScrolling
85
+ ]);
86
+ return state;
87
+ }
88
+
89
+
90
+ export {$fc0b13b484ac1194$export$1505db82fe357e65 as useVirtualizerState};
91
+ //# sourceMappingURL=useVirtualizerState.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,SAAS,0CAA4C,IAA+B;IACzF,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,eAAO,EAAO,EAAE;IACtD,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,eAAO,EAAE,IAAI,CAAA,GAAA,yCAAG;IACpD,IAAI,CAAC,aAAa,aAAa,GAAG,CAAA,GAAA,eAAO,EAAE;IAC3C,IAAI,CAAC,aAAa,aAAa,GAAG,CAAA,GAAA,eAAO,EAAE;IAC3C,IAAI,cAAc,CAAA,GAAA,cAAM,EAAE,IAAM,IAAI,CAAA,GAAA,yCAAU,KAAc,EAAE;IAE9D,YAAY,QAAQ,GAAG;yBACrB;QACA,gBAAe,IAAI;YACjB,YAAY,WAAW,GAAG;YAC1B,KAAK,mBAAmB,CAAC;QAC3B;wBACA;QACA,YAAY,KAAK,UAAU;QAC3B,eAAe,KAAK,aAAa;QACjC,iBAAiB,IAAM,aAAa;QACpC,eAAe,IAAM,aAAa;QAClC,iBAAiB,KAAK,eAAe;IACvC;IAEA,YAAY,MAAM,GAAG,KAAK,MAAM;IAChC,YAAY,UAAU,GAAG,KAAK,UAAU;IACxC,YAAY,kBAAkB,GAAG,KAAK,kBAAkB;IAExD,CAAA,GAAA,sBAAc,EAAE;QACd,YAAY,WAAW;IACzB;IAEA,4CAA4C;IAC5C,CAAA,GAAA,gBAAQ,EAAE;QACR,OAAO,IAAM,YAAY,WAAW;IACtC,uDAAuD;IACvD,GAAG,EAAE;IAEL,IAAI,iBAAiB,CAAA,GAAA,kBAAU,EAAE,CAAC;QAChC,YAAY,WAAW,GAAG;IAC5B,GAAG;QAAC;KAAY;IAChB,IAAI,iBAAiB,CAAA,GAAA,kBAAU,EAAE;QAC/B,YAAY,cAAc;QAC1B,aAAa;IACf,GAAG;QAAC;KAAY;IAChB,IAAI,eAAe,CAAA,GAAA,kBAAU,EAAE;QAC7B,YAAY,YAAY;QACxB,aAAa;IACf,GAAG;QAAC;KAAY;IAEhB,IAAI,QAAQ,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;yBACzB;0BACA;4BACA;yBACA;yBACA;yBACA;4BACA;0BACA;QACF,CAAA,GAAI;QACF;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,OAAO;AACT","sources":["packages/@react-stately/virtualizer/src/useVirtualizerState.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 {Collection, Key} from '@react-types/shared';\nimport {Layout} from './Layout';\nimport {Rect} from './Rect';\nimport {ReusableView} from './ReusableView';\nimport {Size} from './Size';\nimport {useCallback, useEffect, useMemo, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {Virtualizer} from './Virtualizer';\n\ninterface VirtualizerProps<T extends object, V, W> {\n renderView(type: string, content: T): V,\n renderWrapper(\n parent: ReusableView<T, V> | null,\n reusableView: ReusableView<T, V>,\n children: ReusableView<T, V>[],\n renderChildren: (views: ReusableView<T, V>[]) => W[]\n ): W,\n layout: Layout<T>,\n collection: Collection<T>,\n onVisibleRectChange(rect: Rect): void,\n getScrollAnchor?(rect: Rect): Key,\n transitionDuration?: number\n}\n\nexport interface VirtualizerState<T extends object, V, W> {\n visibleViews: W[],\n setVisibleRect: (rect: Rect) => void,\n contentSize: Size,\n isAnimating: boolean,\n virtualizer: Virtualizer<T, V, W>,\n isScrolling: boolean,\n startScrolling: () => void,\n endScrolling: () => void\n}\n\nexport function useVirtualizerState<T extends object, V, W>(opts: VirtualizerProps<T, V, W>): VirtualizerState<T, V, W> {\n let [visibleViews, setVisibleViews] = useState<W[]>([]);\n let [contentSize, setContentSize] = useState(new Size());\n let [isAnimating, setAnimating] = useState(false);\n let [isScrolling, setScrolling] = useState(false);\n let virtualizer = useMemo(() => new Virtualizer<T, V, W>(), []);\n\n virtualizer.delegate = {\n setVisibleViews,\n setVisibleRect(rect) {\n virtualizer.visibleRect = rect;\n opts.onVisibleRectChange(rect);\n },\n setContentSize,\n renderView: opts.renderView,\n renderWrapper: opts.renderWrapper,\n beginAnimations: () => setAnimating(true),\n endAnimations: () => setAnimating(false),\n getScrollAnchor: opts.getScrollAnchor\n };\n\n virtualizer.layout = opts.layout;\n virtualizer.collection = opts.collection;\n virtualizer.transitionDuration = opts.transitionDuration;\n\n useLayoutEffect(() => {\n virtualizer.afterRender();\n });\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => virtualizer.willUnmount();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let setVisibleRect = useCallback((rect) => {\n virtualizer.visibleRect = rect;\n }, [virtualizer]);\n let startScrolling = useCallback(() => {\n virtualizer.startScrolling();\n setScrolling(true);\n }, [virtualizer]);\n let endScrolling = useCallback(() => {\n virtualizer.endScrolling();\n setScrolling(false);\n }, [virtualizer]);\n\n let state = useMemo(() => ({\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n }), [\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n ]);\n\n return state;\n}\n"],"names":[],"version":3,"file":"useVirtualizerState.module.js.map"}
@@ -0,0 +1,53 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+
6
+ $parcel$export(module.exports, "difference", () => $abed55ea619a7a17$export$acaf96a27438246b);
7
+ $parcel$export(module.exports, "concatIterators", () => $abed55ea619a7a17$export$cfc14088dfefce5f);
8
+ $parcel$export(module.exports, "isSetEqual", () => $abed55ea619a7a17$export$a8d0d0c8d1c5df64);
9
+ /*
10
+ * Copyright 2020 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */ function $abed55ea619a7a17$export$37a26b283fd7740e(a, b) {
20
+ let res = new Set();
21
+ for (let key of a.keys())if (!b.has(key)) res.add(key);
22
+ return res;
23
+ }
24
+ function $abed55ea619a7a17$export$acaf96a27438246b(a, b) {
25
+ let toRemove = $abed55ea619a7a17$export$37a26b283fd7740e(a, b);
26
+ let toAdd = $abed55ea619a7a17$export$37a26b283fd7740e(b, a);
27
+ let toUpdate = new Set;
28
+ for (let key of a.keys())if (b.has(key)) toUpdate.add(key);
29
+ return {
30
+ toRemove: toRemove,
31
+ toAdd: toAdd,
32
+ toUpdate: toUpdate
33
+ };
34
+ }
35
+ function* $abed55ea619a7a17$export$cfc14088dfefce5f(...iterators) {
36
+ for (let iterator of iterators)yield* iterator;
37
+ }
38
+ function $abed55ea619a7a17$export$6897c284b6f9f4dc(object) {
39
+ let res = {};
40
+ for(let key in object)res[object[key]] = key;
41
+ return res;
42
+ }
43
+ function $abed55ea619a7a17$export$a8d0d0c8d1c5df64(a, b) {
44
+ if (a === b) return true;
45
+ if (a.size !== b.size) return false;
46
+ for (let key of a){
47
+ if (!b.has(key)) return false;
48
+ }
49
+ return true;
50
+ }
51
+
52
+
53
+ //# sourceMappingURL=utils.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAW,CAAc,EAAE,CAAc;IACvD,IAAI,MAAM,IAAI;IAEd,KAAK,IAAI,OAAO,EAAE,IAAI,GACpB,IAAI,CAAC,EAAE,GAAG,CAAC,MACT,IAAI,GAAG,CAAC;IAIZ,OAAO;AACT;AAOO,SAAS,0CAAc,CAAc,EAAE,CAAc;IAC1D,IAAI,WAAW,0CAAQ,GAAG;IAC1B,IAAI,QAAQ,0CAAQ,GAAG;IACvB,IAAI,WAAW,IAAI;IACnB,KAAK,IAAI,OAAO,EAAE,IAAI,GACpB,IAAI,EAAE,GAAG,CAAC,MACR,SAAS,GAAG,CAAC;IAGjB,OAAO;kBAAC;eAAU;kBAAO;IAAQ;AACnC;AAMO,UAAU,0CAAmB,GAAG,SAAwB;IAC7D,KAAK,IAAI,YAAY,UACnB,OAAO;AAEX;AAMO,SAAS,0CAAO,MAAM;IAC3B,IAAI,MAAM,CAAC;IACX,IAAK,IAAI,OAAO,OACd,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG;IAGrB,OAAO;AACT;AAGO,SAAS,0CAAc,CAAS,EAAE,CAAS;IAChD,IAAI,MAAM,GACR,OAAO;IAGT,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI,EACnB,OAAO;IAGT,KAAK,IAAI,OAAO,EAAG;QACjB,IAAI,CAAC,EAAE,GAAG,CAAC,MACT,OAAO;IAEX;IAEA,OAAO;AACT","sources":["packages/@react-stately/virtualizer/src/utils.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\nexport function keyDiff<T>(a: Map<T, any>, b: Map<T, any>): Set<T> {\n let res = new Set<T>();\n\n for (let key of a.keys()) {\n if (!b.has(key)) {\n res.add(key);\n }\n }\n\n return res;\n}\n\n/**\n * Returns the key difference between two maps. Returns a set of\n * keys to add to and remove from a to make it equal to b.\n * @private\n */\nexport function difference<T>(a: Map<T, any>, b: Map<T, any>) {\n let toRemove = keyDiff(a, b);\n let toAdd = keyDiff(b, a);\n let toUpdate = new Set;\n for (let key of a.keys()) {\n if (b.has(key)) {\n toUpdate.add(key);\n }\n }\n return {toRemove, toAdd, toUpdate};\n}\n\n/**\n * Returns an iterator that yields the items in all of the given iterators.\n * @private\n */\nexport function* concatIterators<T>(...iterators: Iterable<T>[]) {\n for (let iterator of iterators) {\n yield* iterator;\n }\n}\n\n/**\n * Inverts the keys and values of an object.\n * @private\n */\nexport function invert(object) {\n let res = {};\n for (let key in object) {\n res[object[key]] = key;\n }\n\n return res;\n}\n\n/** Returns whether two sets are equal. */\nexport function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {\n if (a === b) {\n return true;\n }\n\n if (a.size !== b.size) {\n return false;\n }\n\n for (let key of a) {\n if (!b.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
package/dist/utils.mjs ADDED
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */ function $fc36f9a046a9ce79$export$37a26b283fd7740e(a, b) {
12
+ let res = new Set();
13
+ for (let key of a.keys())if (!b.has(key)) res.add(key);
14
+ return res;
15
+ }
16
+ function $fc36f9a046a9ce79$export$acaf96a27438246b(a, b) {
17
+ let toRemove = $fc36f9a046a9ce79$export$37a26b283fd7740e(a, b);
18
+ let toAdd = $fc36f9a046a9ce79$export$37a26b283fd7740e(b, a);
19
+ let toUpdate = new Set;
20
+ for (let key of a.keys())if (b.has(key)) toUpdate.add(key);
21
+ return {
22
+ toRemove: toRemove,
23
+ toAdd: toAdd,
24
+ toUpdate: toUpdate
25
+ };
26
+ }
27
+ function* $fc36f9a046a9ce79$export$cfc14088dfefce5f(...iterators) {
28
+ for (let iterator of iterators)yield* iterator;
29
+ }
30
+ function $fc36f9a046a9ce79$export$6897c284b6f9f4dc(object) {
31
+ let res = {};
32
+ for(let key in object)res[object[key]] = key;
33
+ return res;
34
+ }
35
+ function $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64(a, b) {
36
+ if (a === b) return true;
37
+ if (a.size !== b.size) return false;
38
+ for (let key of a){
39
+ if (!b.has(key)) return false;
40
+ }
41
+ return true;
42
+ }
43
+
44
+
45
+ export {$fc36f9a046a9ce79$export$37a26b283fd7740e as keyDiff, $fc36f9a046a9ce79$export$acaf96a27438246b as difference, $fc36f9a046a9ce79$export$cfc14088dfefce5f as concatIterators, $fc36f9a046a9ce79$export$6897c284b6f9f4dc as invert, $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64 as isSetEqual};
46
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */ function $fc36f9a046a9ce79$export$37a26b283fd7740e(a, b) {
12
+ let res = new Set();
13
+ for (let key of a.keys())if (!b.has(key)) res.add(key);
14
+ return res;
15
+ }
16
+ function $fc36f9a046a9ce79$export$acaf96a27438246b(a, b) {
17
+ let toRemove = $fc36f9a046a9ce79$export$37a26b283fd7740e(a, b);
18
+ let toAdd = $fc36f9a046a9ce79$export$37a26b283fd7740e(b, a);
19
+ let toUpdate = new Set;
20
+ for (let key of a.keys())if (b.has(key)) toUpdate.add(key);
21
+ return {
22
+ toRemove: toRemove,
23
+ toAdd: toAdd,
24
+ toUpdate: toUpdate
25
+ };
26
+ }
27
+ function* $fc36f9a046a9ce79$export$cfc14088dfefce5f(...iterators) {
28
+ for (let iterator of iterators)yield* iterator;
29
+ }
30
+ function $fc36f9a046a9ce79$export$6897c284b6f9f4dc(object) {
31
+ let res = {};
32
+ for(let key in object)res[object[key]] = key;
33
+ return res;
34
+ }
35
+ function $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64(a, b) {
36
+ if (a === b) return true;
37
+ if (a.size !== b.size) return false;
38
+ for (let key of a){
39
+ if (!b.has(key)) return false;
40
+ }
41
+ return true;
42
+ }
43
+
44
+
45
+ export {$fc36f9a046a9ce79$export$37a26b283fd7740e as keyDiff, $fc36f9a046a9ce79$export$acaf96a27438246b as difference, $fc36f9a046a9ce79$export$cfc14088dfefce5f as concatIterators, $fc36f9a046a9ce79$export$6897c284b6f9f4dc as invert, $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64 as isSetEqual};
46
+ //# sourceMappingURL=utils.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAW,CAAc,EAAE,CAAc;IACvD,IAAI,MAAM,IAAI;IAEd,KAAK,IAAI,OAAO,EAAE,IAAI,GACpB,IAAI,CAAC,EAAE,GAAG,CAAC,MACT,IAAI,GAAG,CAAC;IAIZ,OAAO;AACT;AAOO,SAAS,0CAAc,CAAc,EAAE,CAAc;IAC1D,IAAI,WAAW,0CAAQ,GAAG;IAC1B,IAAI,QAAQ,0CAAQ,GAAG;IACvB,IAAI,WAAW,IAAI;IACnB,KAAK,IAAI,OAAO,EAAE,IAAI,GACpB,IAAI,EAAE,GAAG,CAAC,MACR,SAAS,GAAG,CAAC;IAGjB,OAAO;kBAAC;eAAU;kBAAO;IAAQ;AACnC;AAMO,UAAU,0CAAmB,GAAG,SAAwB;IAC7D,KAAK,IAAI,YAAY,UACnB,OAAO;AAEX;AAMO,SAAS,0CAAO,MAAM;IAC3B,IAAI,MAAM,CAAC;IACX,IAAK,IAAI,OAAO,OACd,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG;IAGrB,OAAO;AACT;AAGO,SAAS,0CAAc,CAAS,EAAE,CAAS;IAChD,IAAI,MAAM,GACR,OAAO;IAGT,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI,EACnB,OAAO;IAGT,KAAK,IAAI,OAAO,EAAG;QACjB,IAAI,CAAC,EAAE,GAAG,CAAC,MACT,OAAO;IAEX;IAEA,OAAO;AACT","sources":["packages/@react-stately/virtualizer/src/utils.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\nexport function keyDiff<T>(a: Map<T, any>, b: Map<T, any>): Set<T> {\n let res = new Set<T>();\n\n for (let key of a.keys()) {\n if (!b.has(key)) {\n res.add(key);\n }\n }\n\n return res;\n}\n\n/**\n * Returns the key difference between two maps. Returns a set of\n * keys to add to and remove from a to make it equal to b.\n * @private\n */\nexport function difference<T>(a: Map<T, any>, b: Map<T, any>) {\n let toRemove = keyDiff(a, b);\n let toAdd = keyDiff(b, a);\n let toUpdate = new Set;\n for (let key of a.keys()) {\n if (b.has(key)) {\n toUpdate.add(key);\n }\n }\n return {toRemove, toAdd, toUpdate};\n}\n\n/**\n * Returns an iterator that yields the items in all of the given iterators.\n * @private\n */\nexport function* concatIterators<T>(...iterators: Iterable<T>[]) {\n for (let iterator of iterators) {\n yield* iterator;\n }\n}\n\n/**\n * Inverts the keys and values of an object.\n * @private\n */\nexport function invert(object) {\n let res = {};\n for (let key in object) {\n res[object[key]] = key;\n }\n\n return res;\n}\n\n/** Returns whether two sets are equal. */\nexport function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {\n if (a === b) {\n return true;\n }\n\n if (a.size !== b.size) {\n return false;\n }\n\n for (let key of a) {\n if (!b.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/virtualizer",
3
- "version": "3.6.9-nightly.4555+81162ea39",
3
+ "version": "3.6.9-nightly.4560+72775d272",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,8 +22,8 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/utils": "3.0.0-nightly.2843+81162ea39",
26
- "@react-types/shared": "3.0.0-nightly.2843+81162ea39",
25
+ "@react-aria/utils": "3.0.0-nightly.2848+72775d272",
26
+ "@react-types/shared": "3.0.0-nightly.2848+72775d272",
27
27
  "@swc/helpers": "^0.5.0"
28
28
  },
29
29
  "peerDependencies": {
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "81162ea392926d06ec3d25c228e6f9b6b5479d59"
35
+ "gitHead": "72775d272be04cfa32d26ec821bc68513d92a72b"
36
36
  }