@tanstack/lit-virtual 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present Tanner Linsley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const virtualCore = require("@tanstack/virtual-core");
4
+ class VirtualizerControllerBase {
5
+ constructor(host, options) {
6
+ this.cleanup = () => {
7
+ };
8
+ (this.host = host).addController(this);
9
+ const resolvedOptions = {
10
+ ...options,
11
+ onChange: (instance, sync) => {
12
+ var _a;
13
+ this.host.updateComplete.then(() => this.host.requestUpdate());
14
+ (_a = options.onChange) == null ? void 0 : _a.call(options, instance, sync);
15
+ }
16
+ };
17
+ this.virtualizer = new virtualCore.Virtualizer(resolvedOptions);
18
+ }
19
+ getVirtualizer() {
20
+ return this.virtualizer;
21
+ }
22
+ async hostConnected() {
23
+ this.cleanup = this.virtualizer._didMount();
24
+ }
25
+ hostUpdated() {
26
+ this.virtualizer._willUpdate();
27
+ }
28
+ hostDisconnected() {
29
+ this.cleanup();
30
+ }
31
+ }
32
+ class VirtualizerController extends VirtualizerControllerBase {
33
+ constructor(host, options) {
34
+ super(host, {
35
+ observeElementRect: virtualCore.observeElementRect,
36
+ observeElementOffset: virtualCore.observeElementOffset,
37
+ scrollToFn: virtualCore.elementScroll,
38
+ ...options
39
+ });
40
+ }
41
+ }
42
+ class WindowVirtualizerController extends VirtualizerControllerBase {
43
+ constructor(host, options) {
44
+ super(host, {
45
+ getScrollElement: () => typeof document !== "undefined" ? window : null,
46
+ observeElementRect: virtualCore.observeWindowRect,
47
+ observeElementOffset: virtualCore.observeWindowOffset,
48
+ scrollToFn: virtualCore.windowScroll,
49
+ initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0,
50
+ ...options
51
+ });
52
+ }
53
+ }
54
+ exports.VirtualizerController = VirtualizerController;
55
+ exports.WindowVirtualizerController = WindowVirtualizerController;
56
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController\n{\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n ;(this.host = host).addController(this)\n\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n async hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":["Virtualizer","observeElementRect","observeElementOffset","elementScroll","observeWindowRect","observeWindowOffset","windowScroll"],"mappings":";;;AAYA,MAAM,0BAIN;AAAA,EAOE,YACE,MACA,SACA;AALF,SAAQ,UAAsB,MAAM;AAAA,IAAA;AAMjC,KAAC,KAAK,OAAO,MAAM,cAAc,IAAI;AAEtC,UAAM,kBAAoE;AAAA,MACxE,GAAG;AAAA,MACH,UAAU,CAAC,UAAU,SAAS;;AAC5B,aAAK,KAAK,eAAe,KAAK,MAAM,KAAK,KAAK,eAAe;AACrD,sBAAA,aAAA,iCAAW,UAAU;AAAA,MAC/B;AAAA,IAAA;AAEG,SAAA,cAAc,IAAIA,YAAA,YAAY,eAAe;AAAA,EACpD;AAAA,EAEO,iBAAiB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,gBAAgB;AACf,SAAA,UAAU,KAAK,YAAY,UAAU;AAAA,EAC5C;AAAA,EAEA,cAAc;AACZ,SAAK,YAAY;EACnB;AAAA,EAEA,mBAAmB;AACjB,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,MAAM,8BAGH,0BAAwD;AAAA,EAChE,YACE,MACA,SAIA;AACA,UAAM,MAAM;AAAA,MAAA,oBACVC,YAAA;AAAA,MAAA,sBACAC,YAAA;AAAA,MACA,YAAYC,YAAA;AAAA,MACZ,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;AAEO,MAAM,oCAEH,0BAAgD;AAAA,EACxD,YACE,MACA,SAOA;AACA,UAAM,MAAM;AAAA,MACV,kBAAkB,MAAO,OAAO,aAAa,cAAc,SAAS;AAAA,MACpE,oBAAoBC,YAAA;AAAA,MACpB,sBAAsBC,YAAA;AAAA,MACtB,YAAYC,YAAA;AAAA,MACZ,eAAe,MACb,OAAO,aAAa,cAAc,OAAO,UAAU;AAAA,MACrD,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;;;"}
@@ -0,0 +1,20 @@
1
+ import { Virtualizer, PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core';
2
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
3
+
4
+ declare class VirtualizerControllerBase<TScrollElement extends Element | Window, TItemElement extends Element> implements ReactiveController {
5
+ host: ReactiveControllerHost;
6
+ private readonly virtualizer;
7
+ private cleanup;
8
+ constructor(host: ReactiveControllerHost, options: VirtualizerOptions<TScrollElement, TItemElement>);
9
+ getVirtualizer(): Virtualizer<TScrollElement, TItemElement>;
10
+ hostConnected(): Promise<void>;
11
+ hostUpdated(): void;
12
+ hostDisconnected(): void;
13
+ }
14
+ export declare class VirtualizerController<TScrollElement extends Element, TItemElement extends Element> extends VirtualizerControllerBase<TScrollElement, TItemElement> {
15
+ constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<TScrollElement, TItemElement>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
16
+ }
17
+ export declare class WindowVirtualizerController<TItemElement extends Element> extends VirtualizerControllerBase<Window, TItemElement> {
18
+ constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<Window, TItemElement>, 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
19
+ }
20
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Virtualizer, PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core';
2
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
3
+
4
+ declare class VirtualizerControllerBase<TScrollElement extends Element | Window, TItemElement extends Element> implements ReactiveController {
5
+ host: ReactiveControllerHost;
6
+ private readonly virtualizer;
7
+ private cleanup;
8
+ constructor(host: ReactiveControllerHost, options: VirtualizerOptions<TScrollElement, TItemElement>);
9
+ getVirtualizer(): Virtualizer<TScrollElement, TItemElement>;
10
+ hostConnected(): Promise<void>;
11
+ hostUpdated(): void;
12
+ hostDisconnected(): void;
13
+ }
14
+ export declare class VirtualizerController<TScrollElement extends Element, TItemElement extends Element> extends VirtualizerControllerBase<TScrollElement, TItemElement> {
15
+ constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<TScrollElement, TItemElement>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
16
+ }
17
+ export declare class WindowVirtualizerController<TItemElement extends Element> extends VirtualizerControllerBase<Window, TItemElement> {
18
+ constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<Window, TItemElement>, 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
19
+ }
20
+ export {};
@@ -0,0 +1,56 @@
1
+ import { observeElementRect, observeElementOffset, elementScroll, observeWindowRect, observeWindowOffset, windowScroll, Virtualizer } from "@tanstack/virtual-core";
2
+ class VirtualizerControllerBase {
3
+ constructor(host, options) {
4
+ this.cleanup = () => {
5
+ };
6
+ (this.host = host).addController(this);
7
+ const resolvedOptions = {
8
+ ...options,
9
+ onChange: (instance, sync) => {
10
+ var _a;
11
+ this.host.updateComplete.then(() => this.host.requestUpdate());
12
+ (_a = options.onChange) == null ? void 0 : _a.call(options, instance, sync);
13
+ }
14
+ };
15
+ this.virtualizer = new Virtualizer(resolvedOptions);
16
+ }
17
+ getVirtualizer() {
18
+ return this.virtualizer;
19
+ }
20
+ async hostConnected() {
21
+ this.cleanup = this.virtualizer._didMount();
22
+ }
23
+ hostUpdated() {
24
+ this.virtualizer._willUpdate();
25
+ }
26
+ hostDisconnected() {
27
+ this.cleanup();
28
+ }
29
+ }
30
+ class VirtualizerController extends VirtualizerControllerBase {
31
+ constructor(host, options) {
32
+ super(host, {
33
+ observeElementRect,
34
+ observeElementOffset,
35
+ scrollToFn: elementScroll,
36
+ ...options
37
+ });
38
+ }
39
+ }
40
+ class WindowVirtualizerController extends VirtualizerControllerBase {
41
+ constructor(host, options) {
42
+ super(host, {
43
+ getScrollElement: () => typeof document !== "undefined" ? window : null,
44
+ observeElementRect: observeWindowRect,
45
+ observeElementOffset: observeWindowOffset,
46
+ scrollToFn: windowScroll,
47
+ initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0,
48
+ ...options
49
+ });
50
+ }
51
+ }
52
+ export {
53
+ VirtualizerController,
54
+ WindowVirtualizerController
55
+ };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController\n{\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n ;(this.host = host).addController(this)\n\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n async hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":[],"mappings":";AAYA,MAAM,0BAIN;AAAA,EAOE,YACE,MACA,SACA;AALF,SAAQ,UAAsB,MAAM;AAAA,IAAA;AAMjC,KAAC,KAAK,OAAO,MAAM,cAAc,IAAI;AAEtC,UAAM,kBAAoE;AAAA,MACxE,GAAG;AAAA,MACH,UAAU,CAAC,UAAU,SAAS;;AAC5B,aAAK,KAAK,eAAe,KAAK,MAAM,KAAK,KAAK,eAAe;AACrD,sBAAA,aAAA,iCAAW,UAAU;AAAA,MAC/B;AAAA,IAAA;AAEG,SAAA,cAAc,IAAI,YAAY,eAAe;AAAA,EACpD;AAAA,EAEO,iBAAiB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,gBAAgB;AACf,SAAA,UAAU,KAAK,YAAY,UAAU;AAAA,EAC5C;AAAA,EAEA,cAAc;AACZ,SAAK,YAAY;EACnB;AAAA,EAEA,mBAAmB;AACjB,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,MAAM,8BAGH,0BAAwD;AAAA,EAChE,YACE,MACA,SAIA;AACA,UAAM,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;AAEO,MAAM,oCAEH,0BAAgD;AAAA,EACxD,YACE,MACA,SAOA;AACA,UAAM,MAAM;AAAA,MACV,kBAAkB,MAAO,OAAO,aAAa,cAAc,SAAS;AAAA,MACpE,oBAAoB;AAAA,MACpB,sBAAsB;AAAA,MACtB,YAAY;AAAA,MACZ,eAAe,MACb,OAAO,aAAa,cAAc,OAAO,UAAU;AAAA,MACrD,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@tanstack/lit-virtual",
3
+ "version": "3.8.1",
4
+ "description": "Headless UI for virtualizing scrollable elements in Lit",
5
+ "author": "Tanner Linsley",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/tanstack/virtual.git"
10
+ },
11
+ "homepage": "https://github.com/tanstack/virtual#readme",
12
+ "funding": {
13
+ "type": "github",
14
+ "url": "https://github.com/sponsors/tannerlinsley"
15
+ },
16
+ "type": "module",
17
+ "types": "dist/esm/index.d.ts",
18
+ "main": "dist/cjs/index.cjs",
19
+ "module": "dist/esm/index.js",
20
+ "exports": {
21
+ ".": {
22
+ "import": {
23
+ "types": "./dist/esm/index.d.ts",
24
+ "default": "./dist/esm/index.js"
25
+ },
26
+ "require": {
27
+ "types": "./dist/cjs/index.d.cts",
28
+ "default": "./dist/cjs/index.cjs"
29
+ }
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "sideEffects": false,
34
+ "keywords": [
35
+ "lit",
36
+ "virtual",
37
+ "virtual-core",
38
+ "datagrid"
39
+ ],
40
+ "files": [
41
+ "dist",
42
+ "src"
43
+ ],
44
+ "dependencies": {
45
+ "@tanstack/virtual-core": "3.8.1"
46
+ },
47
+ "devDependencies": {
48
+ "@open-wc/testing": "^4.0.0",
49
+ "lit": "^3.1.3"
50
+ },
51
+ "peerDependencies": {
52
+ "lit": "^3.1.3"
53
+ },
54
+ "scripts": {}
55
+ }
package/src/index.ts ADDED
@@ -0,0 +1,100 @@
1
+ import {
2
+ Virtualizer,
3
+ elementScroll,
4
+ observeElementOffset,
5
+ observeElementRect,
6
+ observeWindowOffset,
7
+ observeWindowRect,
8
+ windowScroll,
9
+ } from '@tanstack/virtual-core'
10
+ import type { ReactiveController, ReactiveControllerHost } from 'lit'
11
+ import type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'
12
+
13
+ class VirtualizerControllerBase<
14
+ TScrollElement extends Element | Window,
15
+ TItemElement extends Element,
16
+ > implements ReactiveController
17
+ {
18
+ host: ReactiveControllerHost
19
+
20
+ private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>
21
+
22
+ private cleanup: () => void = () => {}
23
+
24
+ constructor(
25
+ host: ReactiveControllerHost,
26
+ options: VirtualizerOptions<TScrollElement, TItemElement>,
27
+ ) {
28
+ ;(this.host = host).addController(this)
29
+
30
+ const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {
31
+ ...options,
32
+ onChange: (instance, sync) => {
33
+ this.host.updateComplete.then(() => this.host.requestUpdate())
34
+ options.onChange?.(instance, sync)
35
+ },
36
+ }
37
+ this.virtualizer = new Virtualizer(resolvedOptions)
38
+ }
39
+
40
+ public getVirtualizer() {
41
+ return this.virtualizer
42
+ }
43
+
44
+ async hostConnected() {
45
+ this.cleanup = this.virtualizer._didMount()
46
+ }
47
+
48
+ hostUpdated() {
49
+ this.virtualizer._willUpdate()
50
+ }
51
+
52
+ hostDisconnected() {
53
+ this.cleanup()
54
+ }
55
+ }
56
+
57
+ export class VirtualizerController<
58
+ TScrollElement extends Element,
59
+ TItemElement extends Element,
60
+ > extends VirtualizerControllerBase<TScrollElement, TItemElement> {
61
+ constructor(
62
+ host: ReactiveControllerHost,
63
+ options: PartialKeys<
64
+ VirtualizerOptions<TScrollElement, TItemElement>,
65
+ 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'
66
+ >,
67
+ ) {
68
+ super(host, {
69
+ observeElementRect: observeElementRect,
70
+ observeElementOffset: observeElementOffset,
71
+ scrollToFn: elementScroll,
72
+ ...options,
73
+ })
74
+ }
75
+ }
76
+
77
+ export class WindowVirtualizerController<
78
+ TItemElement extends Element,
79
+ > extends VirtualizerControllerBase<Window, TItemElement> {
80
+ constructor(
81
+ host: ReactiveControllerHost,
82
+ options: PartialKeys<
83
+ VirtualizerOptions<Window, TItemElement>,
84
+ | 'getScrollElement'
85
+ | 'observeElementRect'
86
+ | 'observeElementOffset'
87
+ | 'scrollToFn'
88
+ >,
89
+ ) {
90
+ super(host, {
91
+ getScrollElement: () => (typeof document !== 'undefined' ? window : null),
92
+ observeElementRect: observeWindowRect,
93
+ observeElementOffset: observeWindowOffset,
94
+ scrollToFn: windowScroll,
95
+ initialOffset: () =>
96
+ typeof document !== 'undefined' ? window.scrollY : 0,
97
+ ...options,
98
+ })
99
+ }
100
+ }