Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "scrollToItemStatic", {
enumerable: true,
get: function() {
return scrollToItemStatic;
}
});
const scrollToItemStatic = (params)=>{
const { index, itemSize, totalItems, scrollViewRef, axis = 'vertical', reversed = false, behavior = 'auto' } = params;
if (axis === 'horizontal') {
if (reversed) {
var _scrollViewRef_current;
(_scrollViewRef_current = scrollViewRef.current) === null || _scrollViewRef_current === void 0 ? void 0 : _scrollViewRef_current.scrollTo({
left: totalItems * itemSize - itemSize * index,
behavior
});
} else {
var _scrollViewRef_current1;
(_scrollViewRef_current1 = scrollViewRef.current) === null || _scrollViewRef_current1 === void 0 ? void 0 : _scrollViewRef_current1.scrollTo({
left: itemSize * index,
behavior
});
}
} else {
if (reversed) {
var _scrollViewRef_current2;
(_scrollViewRef_current2 = scrollViewRef.current) === null || _scrollViewRef_current2 === void 0 ? void 0 : _scrollViewRef_current2.scrollTo({
top: totalItems * itemSize - itemSize * index,
behavior
});
} else {
var _scrollViewRef_current3;
(_scrollViewRef_current3 = scrollViewRef.current) === null || _scrollViewRef_current3 === void 0 ? void 0 : _scrollViewRef_current3.scrollTo({
top: itemSize * index,
behavior
});
}
}
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrolling.ts"],"sourcesContent":["import { ScrollToItemStaticParams } from './imperativeScrolling.types';\n\nexport const scrollToItemStatic = (params: ScrollToItemStaticParams) => {\n const { index, itemSize, totalItems, scrollViewRef, axis = 'vertical', reversed = false, behavior = 'auto' } = params;\n\n if (axis === 'horizontal') {\n if (reversed) {\n scrollViewRef.current?.scrollTo({\n left: totalItems * itemSize - itemSize * index,\n behavior,\n });\n } else {\n scrollViewRef.current?.scrollTo({\n left: itemSize * index,\n behavior,\n });\n }\n } else {\n if (reversed) {\n scrollViewRef.current?.scrollTo({\n top: totalItems * itemSize - itemSize * index,\n behavior,\n });\n } else {\n scrollViewRef.current?.scrollTo({\n top: itemSize * index,\n behavior,\n });\n }\n }\n};\n"],"names":["scrollToItemStatic","params","index","itemSize","totalItems","scrollViewRef","axis","reversed","behavior","current","scrollTo","left","top"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,qBAAqB,CAACC;IACjC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,aAAa,EAAEC,OAAO,UAAU,EAAEC,WAAW,KAAK,EAAEC,WAAW,MAAM,EAAE,GAAGP;IAE/G,IAAIK,SAAS,cAAc;QACzB,IAAIC,UAAU;gBACZF;YAAAA,CAAAA,yBAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAuBK,QAAQ,CAAC;gBAC9BC,MAAMP,aAAaD,WAAWA,WAAWD;gBACzCM;YACF;QACF,OAAO;gBACLH;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BC,MAAMR,WAAWD;gBACjBM;YACF;QACF;IACF,OAAO;QACL,IAAID,UAAU;gBACZF;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BE,KAAKR,aAAaD,WAAWA,WAAWD;gBACxCM;YACF;QACF,OAAO;gBACLH;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BE,KAAKT,WAAWD;gBAChBM;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrolling.types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type ScrollToItemStaticParams = {\n index: number;\n itemSize: number;\n totalItems: number;\n scrollViewRef: React.RefObject<HTMLDivElement>;\n axis?: 'horizontal' | 'vertical';\n reversed?: boolean;\n behavior?: ScrollBehavior;\n};\n\nexport type ScrollToItemDynamicParams = {\n index: number;\n itemSizes: React.RefObject<number[]>;\n totalSize: number;\n scrollViewRef: React.RefObject<HTMLDivElement>;\n axis?: 'horizontal' | 'vertical';\n reversed?: boolean;\n behavior?: ScrollBehavior;\n};\n\nexport type ScrollToInterface = {\n scrollTo: (index: number, behavior?: ScrollBehavior, callback?: (index: number) => void) => void;\n virtualizerLength: React.RefObject<number>;\n currentIndex: React.RefObject<number> | undefined;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "scrollToItemDynamic", {
enumerable: true,
get: function() {
return scrollToItemDynamic;
}
});
const scrollToItemDynamic = (params)=>{
const { index, itemSizes, totalSize, scrollViewRef, axis = 'vertical', reversed = false, behavior = 'auto' } = params;
if (!itemSizes.current) {
return;
}
if (itemSizes.current === null || itemSizes.current.length < index) {
// null check - abort
return;
}
let itemDepth = 0;
for(let i = 0; i < index; i++){
if (i < index) {
itemDepth += itemSizes.current[i];
}
}
if (axis === 'horizontal') {
if (reversed) {
var _scrollViewRef_current;
(_scrollViewRef_current = scrollViewRef.current) === null || _scrollViewRef_current === void 0 ? void 0 : _scrollViewRef_current.scrollTo({
left: totalSize - itemDepth,
behavior
});
} else {
var _scrollViewRef_current1;
(_scrollViewRef_current1 = scrollViewRef.current) === null || _scrollViewRef_current1 === void 0 ? void 0 : _scrollViewRef_current1.scrollTo({
left: itemDepth,
behavior
});
}
} else {
if (reversed) {
var _scrollViewRef_current2;
(_scrollViewRef_current2 = scrollViewRef.current) === null || _scrollViewRef_current2 === void 0 ? void 0 : _scrollViewRef_current2.scrollTo({
top: totalSize - itemDepth,
behavior
});
} else {
var _scrollViewRef_current3;
(_scrollViewRef_current3 = scrollViewRef.current) === null || _scrollViewRef_current3 === void 0 ? void 0 : _scrollViewRef_current3.scrollTo({
top: itemDepth,
behavior
});
}
}
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrollingDynamic.ts"],"sourcesContent":["import { ScrollToItemDynamicParams } from './imperativeScrolling.types';\n\nexport const scrollToItemDynamic = (params: ScrollToItemDynamicParams) => {\n const { index, itemSizes, totalSize, scrollViewRef, axis = 'vertical', reversed = false, behavior = 'auto' } = params;\n if (!itemSizes.current) {\n return;\n }\n\n if (itemSizes.current === null || itemSizes.current.length < index) {\n // null check - abort\n return;\n }\n\n let itemDepth = 0;\n for (let i = 0; i < index; i++) {\n if (i < index) {\n itemDepth += itemSizes.current[i];\n }\n }\n\n if (axis === 'horizontal') {\n if (reversed) {\n scrollViewRef.current?.scrollTo({\n left: totalSize - itemDepth,\n behavior,\n });\n } else {\n scrollViewRef.current?.scrollTo({\n left: itemDepth,\n behavior,\n });\n }\n } else {\n if (reversed) {\n scrollViewRef.current?.scrollTo({\n top: totalSize - itemDepth,\n behavior,\n });\n } else {\n scrollViewRef.current?.scrollTo({\n top: itemDepth,\n behavior,\n });\n }\n }\n};\n"],"names":["scrollToItemDynamic","params","index","itemSizes","totalSize","scrollViewRef","axis","reversed","behavior","current","length","itemDepth","i","scrollTo","left","top"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,sBAAsB,CAACC;IAClC,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,SAAS,EAAEC,aAAa,EAAEC,OAAO,UAAU,EAAEC,WAAW,KAAK,EAAEC,WAAW,MAAM,EAAE,GAAGP;IAC/G,IAAI,CAACE,UAAUM,OAAO,EAAE;QACtB;IACF;IAEA,IAAIN,UAAUM,OAAO,KAAK,QAAQN,UAAUM,OAAO,CAACC,MAAM,GAAGR,OAAO;QAClE,qBAAqB;QACrB;IACF;IAEA,IAAIS,YAAY;IAChB,IAAK,IAAIC,IAAI,GAAGA,IAAIV,OAAOU,IAAK;QAC9B,IAAIA,IAAIV,OAAO;YACbS,aAAaR,UAAUM,OAAO,CAACG,EAAE;QACnC;IACF;IAEA,IAAIN,SAAS,cAAc;QACzB,IAAIC,UAAU;gBACZF;YAAAA,CAAAA,yBAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAuBQ,QAAQ,CAAC;gBAC9BC,MAAMV,YAAYO;gBAClBH;YACF;QACF,OAAO;gBACLH;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BC,MAAMH;gBACNH;YACF;QACF;IACF,OAAO;QACL,IAAID,UAAU;gBACZF;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BE,KAAKX,YAAYO;gBACjBH;YACF;QACF,OAAO;gBACLH;YAAAA,CAAAA,0BAAAA,cAAcI,OAAO,AAAPA,MAAO,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BE,KAAKJ;gBACLH;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
scrollToItemDynamic: function() {
return _imperativeScrollingDynamic.scrollToItemDynamic;
},
scrollToItemStatic: function() {
return _imperativeScrolling.scrollToItemStatic;
}
});
const _imperativeScrolling = require("./imperativeScrolling");
const _imperativeScrollingDynamic = require("./imperativeScrollingDynamic");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/ImperativeScrolling/index.ts"],"sourcesContent":["export { scrollToItemStatic } from './imperativeScrolling';\nexport type {\n ScrollToInterface,\n ScrollToItemDynamicParams,\n ScrollToItemStaticParams,\n} from './imperativeScrolling.types';\nexport { scrollToItemDynamic } from './imperativeScrollingDynamic';\n"],"names":["scrollToItemDynamic","scrollToItemStatic"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMSA,mBAAmB;eAAnBA,+CAAmB;;IANnBC,kBAAkB;eAAlBA,uCAAkB;;;qCAAQ;4CAMC"}
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
VirtualizerContextProvider: function() {
return VirtualizerContextProvider;
},
useVirtualizerContextState_unstable: function() {
return useVirtualizerContextState_unstable;
},
useVirtualizerContext_unstable: function() {
return useVirtualizerContext_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const VirtualizerContext = /*#__PURE__*/ _react.createContext(undefined);
const VirtualizerContextProvider = VirtualizerContext.Provider;
const useVirtualizerContext_unstable = ()=>{
return _react.useContext(VirtualizerContext);
};
const useVirtualizerContextState_unstable = (passedContext)=>{
const virtualizerContext = useVirtualizerContext_unstable();
const [_contextIndex, _setContextIndex] = _react.useState(-1);
const childProgressiveSizes = _react.useRef([]);
/* We respect any wrapped providers while also ensuring defaults or passed through
* Order of usage -> Passed Prop -> Provider Context -> Internal State default
*/ const context = _react.useMemo(()=>{
var _passedContext_contextIndex, _ref, _passedContext_setContextIndex, _ref1;
return {
contextIndex: (_ref = (_passedContext_contextIndex = passedContext === null || passedContext === void 0 ? void 0 : passedContext.contextIndex) !== null && _passedContext_contextIndex !== void 0 ? _passedContext_contextIndex : virtualizerContext === null || virtualizerContext === void 0 ? void 0 : virtualizerContext.contextIndex) !== null && _ref !== void 0 ? _ref : _contextIndex,
setContextIndex: (_ref1 = (_passedContext_setContextIndex = passedContext === null || passedContext === void 0 ? void 0 : passedContext.setContextIndex) !== null && _passedContext_setContextIndex !== void 0 ? _passedContext_setContextIndex : virtualizerContext === null || virtualizerContext === void 0 ? void 0 : virtualizerContext.setContextIndex) !== null && _ref1 !== void 0 ? _ref1 : _setContextIndex,
childProgressiveSizes
};
}, [
_contextIndex,
passedContext,
virtualizerContext
]);
return context;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/VirtualizerContext/VirtualizerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './types';\n\nconst VirtualizerContext = React.createContext<VirtualizerContextProps | undefined>(\n undefined,\n) as React.Context<VirtualizerContextProps>;\n\nexport const VirtualizerContextProvider = VirtualizerContext.Provider;\n\nexport const useVirtualizerContext_unstable = () => {\n return React.useContext(VirtualizerContext);\n};\n\nexport const useVirtualizerContextState_unstable = (\n passedContext?: VirtualizerContextProps,\n): DynamicVirtualizerContextProps => {\n const virtualizerContext = useVirtualizerContext_unstable();\n const [_contextIndex, _setContextIndex] = React.useState<number>(-1);\n const childProgressiveSizes = React.useRef<number[]>([]);\n\n /* We respect any wrapped providers while also ensuring defaults or passed through\n * Order of usage -> Passed Prop -> Provider Context -> Internal State default\n */\n const context = React.useMemo(\n () => ({\n contextIndex: passedContext?.contextIndex ?? virtualizerContext?.contextIndex ?? _contextIndex,\n setContextIndex: passedContext?.setContextIndex ?? virtualizerContext?.setContextIndex ?? _setContextIndex,\n childProgressiveSizes,\n }),\n [_contextIndex, passedContext, virtualizerContext],\n );\n\n return context;\n};\n"],"names":["VirtualizerContextProvider","useVirtualizerContextState_unstable","useVirtualizerContext_unstable","VirtualizerContext","React","createContext","undefined","Provider","useContext","passedContext","virtualizerContext","_contextIndex","_setContextIndex","useState","childProgressiveSizes","useRef","context","useMemo","contextIndex","setContextIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,0BAAAA;eAAAA;;IAMAC,mCAAAA;eAAAA;;IAJAC,8BAAAA;eAAAA;;;;iEATU;AAGvB,MAAMC,mCAAqBC,OAAMC,aAAa,CAC5CC;AAGK,MAAMN,6BAA6BG,mBAAmBI,QAAQ;AAE9D,MAAML,iCAAiC;IAC5C,OAAOE,OAAMI,UAAU,CAACL;AAC1B;AAEO,MAAMF,sCAAsC,CACjDQ;IAEA,MAAMC,qBAAqBR;IAC3B,MAAM,CAACS,eAAeC,iBAAiB,GAAGR,OAAMS,QAAQ,CAAS,CAAC;IAClE,MAAMC,wBAAwBV,OAAMW,MAAM,CAAW,EAAE;IAEvD;;GAEC,GACD,MAAMC,UAAUZ,OAAMa,OAAO,CAC3B;YACgBR,6BAAAA,MACGA,gCAAAA;eAFZ;YACLS,cAAcT,CAAAA,OAAAA,CAAAA,8BAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeS,YAAY,AAAZA,MAAY,QAA3BT,gCAAAA,KAAAA,IAAAA,8BAA+BC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBQ,YAAY,AAAZA,MAAY,QAA/DT,SAAAA,KAAAA,IAAAA,OAAmEE;YACjFQ,iBAAiBV,CAAAA,QAAAA,CAAAA,iCAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeU,eAAe,AAAfA,MAAe,QAA9BV,mCAAAA,KAAAA,IAAAA,iCAAkCC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBS,eAAe,AAAfA,MAAe,QAArEV,UAAAA,KAAAA,IAAAA,QAAyEG;YAC1FE;QACF;IAAA,GACA;QAACH;QAAeF;QAAeC;KAAmB;IAGpD,OAAOM;AACT"}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
VirtualizerContextProvider: function() {
return _VirtualizerContext.VirtualizerContextProvider;
},
useVirtualizerContextState_unstable: function() {
return _VirtualizerContext.useVirtualizerContextState_unstable;
},
useVirtualizerContext_unstable: function() {
return _VirtualizerContext.useVirtualizerContext_unstable;
}
});
const _VirtualizerContext = require("./VirtualizerContext");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/VirtualizerContext/index.ts"],"sourcesContent":["export {\n VirtualizerContextProvider,\n useVirtualizerContextState_unstable,\n useVirtualizerContext_unstable,\n} from './VirtualizerContext';\nexport type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './types';\n"],"names":["VirtualizerContextProvider","useVirtualizerContextState_unstable","useVirtualizerContext_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,0BAA0B;eAA1BA,8CAA0B;;IAC1BC,mCAAmC;eAAnCA,uDAAmC;;IACnCC,8BAA8B;eAA9BA,kDAA8B;;;oCACzB"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/VirtualizerContext/types.ts"],"sourcesContent":["import * as React from 'react';\n/**\n * {@docCategory Virtualizer}\n */\nexport type VirtualizerContextProps = {\n contextIndex: number;\n setContextIndex: (index: number) => void;\n /*\n * These optional props are used in dynamic virtualizer\n */\n childProgressiveSizes?: React.MutableRefObject<number[]>;\n};\n\n/**\n * Some props are optional on static virtualizer, but required for dynamic.\n */\nexport type DynamicVirtualizerContextProps = Required<VirtualizerContextProps>;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,23 @@
/**
* FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar
* A utility method that creates a ResizeObserver from a target document
* @param targetDocument - document to use to create the ResizeObserver
* @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback
* @returns a ResizeObserver instance or null if the global does not exist on the document
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createResizeObserverFromDocument", {
enumerable: true,
get: function() {
return createResizeObserverFromDocument;
}
});
function createResizeObserverFromDocument(targetDocument, callback) {
var _targetDocument_defaultView;
if (!(targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.ResizeObserver)) {
return null;
}
return new targetDocument.defaultView.ResizeObserver(callback);
}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/createResizeObserverFromDocument.ts"],"sourcesContent":["/**\n * FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar\n * A utility method that creates a ResizeObserver from a target document\n * @param targetDocument - document to use to create the ResizeObserver\n * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback\n * @returns a ResizeObserver instance or null if the global does not exist on the document\n */\nexport function createResizeObserverFromDocument(\n targetDocument: Document | null | undefined,\n callback: ResizeObserverCallback,\n) {\n if (!targetDocument?.defaultView?.ResizeObserver) {\n return null;\n }\n\n return new targetDocument.defaultView.ResizeObserver(callback);\n}\n"],"names":["createResizeObserverFromDocument","targetDocument","callback","defaultView","ResizeObserver"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;CAMC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,iCACdC,cAA2C,EAC3CC,QAAgC;QAE3BD;IAAL,IAAI,CAACA,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,CAAAA,8BAAAA,eAAgBE,WAAW,AAAXA,MAAW,QAA3BF,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA6BG,cAAc,AAAdA,GAAgB;QAChD,OAAO;IACT;IAEA,OAAO,IAAIH,eAAeE,WAAW,CAACC,cAAc,CAACF;AACvD"}
@@ -0,0 +1,29 @@
/**
* Microtask debouncer
* https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
* @param fn - Function to debounce
* @returns debounced function
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "debounce", {
enumerable: true,
get: function() {
return debounce;
}
});
function debounce(fn) {
let pending;
return ()=>{
if (!pending) {
pending = true;
queueMicrotask(()=>{
// Need to set pending to `false` before the debounced function is run.
// React can actually interrupt the function while it's running!
pending = false;
fn();
});
}
};
}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","queueMicrotask"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAY;IACnC,IAAIC;IACJ,OAAO;QACL,IAAI,CAACA,SAAS;YACZA,UAAU;YACVC,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChED,UAAU;gBACVD;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
VirtualizerContextProvider: function() {
return _VirtualizerContext.VirtualizerContextProvider;
},
scrollToItemDynamic: function() {
return _ImperativeScrolling.scrollToItemDynamic;
},
scrollToItemStatic: function() {
return _ImperativeScrolling.scrollToItemStatic;
},
useVirtualizerContextState_unstable: function() {
return _VirtualizerContext.useVirtualizerContextState_unstable;
},
useVirtualizerContext_unstable: function() {
return _VirtualizerContext.useVirtualizerContext_unstable;
}
});
const _VirtualizerContext = require("./VirtualizerContext");
const _ImperativeScrolling = require("./ImperativeScrolling");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utilities/index.ts"],"sourcesContent":["export type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './VirtualizerContext';\nexport {\n VirtualizerContextProvider,\n useVirtualizerContextState_unstable,\n useVirtualizerContext_unstable,\n} from './VirtualizerContext';\nexport type { ScrollToInterface, ScrollToItemDynamicParams, ScrollToItemStaticParams } from './ImperativeScrolling';\nexport { scrollToItemDynamic, scrollToItemStatic } from './ImperativeScrolling';\n"],"names":["VirtualizerContextProvider","scrollToItemDynamic","scrollToItemStatic","useVirtualizerContextState_unstable","useVirtualizerContext_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,0BAA0B;eAA1BA,8CAA0B;;IAKnBC,mBAAmB;eAAnBA,wCAAmB;;IAAEC,kBAAkB;eAAlBA,uCAAkB;;IAJ9CC,mCAAmC;eAAnCA,uDAAmC;;IACnCC,8BAA8B;eAA9BA,kDAA8B;;;oCACzB;qCAEiD"}