@fluentui/react-virtualizer 9.0.0-alpha.99 → 9.74.3-experimental.esm.20260709-49ee7a20cf.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.
Files changed (228) hide show
  1. package/CHANGELOG.md +171 -2
  2. package/README.md +2 -0
  3. package/dist/index.d.cts +556 -0
  4. package/dist/index.d.ts +101 -11
  5. package/lib/Hooks.js +1 -1
  6. package/lib/Hooks.js.map +1 -1
  7. package/lib/Utilities.js +1 -1
  8. package/lib/Utilities.js.map +1 -1
  9. package/lib/Virtualizer.js +1 -1
  10. package/lib/Virtualizer.js.map +1 -1
  11. package/lib/VirtualizerScrollView.js +1 -1
  12. package/lib/VirtualizerScrollView.js.map +1 -1
  13. package/lib/VirtualizerScrollViewDynamic.js +1 -1
  14. package/lib/VirtualizerScrollViewDynamic.js.map +1 -1
  15. package/lib/components/Virtualizer/Virtualizer.js +6 -5
  16. package/lib/components/Virtualizer/Virtualizer.js.map +1 -1
  17. package/lib/components/Virtualizer/Virtualizer.types.js +3 -1
  18. package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
  19. package/lib/components/Virtualizer/index.js +4 -4
  20. package/lib/components/Virtualizer/index.js.map +1 -1
  21. package/lib/components/Virtualizer/renderVirtualizer.js +8 -4
  22. package/lib/components/Virtualizer/renderVirtualizer.js.map +1 -1
  23. package/lib/components/Virtualizer/useVirtualizer.js +24 -11
  24. package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
  25. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js +15 -3
  26. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -1
  27. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js +110 -0
  28. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js.map +1 -0
  29. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js +6 -5
  30. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -1
  31. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js +3 -1
  32. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -1
  33. package/lib/components/VirtualizerScrollView/index.js +4 -4
  34. package/lib/components/VirtualizerScrollView/index.js.map +1 -1
  35. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js +5 -3
  36. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -1
  37. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +12 -8
  38. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
  39. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +9 -4
  40. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -1
  41. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js +46 -0
  42. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js.map +1 -0
  43. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +9 -6
  44. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -1
  45. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +1 -1
  46. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
  47. package/lib/components/VirtualizerScrollViewDynamic/index.js +4 -4
  48. package/lib/components/VirtualizerScrollViewDynamic/index.js.map +1 -1
  49. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +5 -3
  50. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -1
  51. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +18 -11
  52. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
  53. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +9 -4
  54. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -1
  55. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js +46 -0
  56. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js.map +1 -0
  57. package/lib/hooks/hooks.types.js +5 -1
  58. package/lib/hooks/hooks.types.js.map +1 -1
  59. package/lib/hooks/index.js +5 -5
  60. package/lib/hooks/index.js.map +1 -1
  61. package/lib/hooks/useDynamicPagination.js +7 -4
  62. package/lib/hooks/useDynamicPagination.js.map +1 -1
  63. package/lib/hooks/useDynamicVirtualizerMeasure.js +6 -5
  64. package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
  65. package/lib/hooks/useIntersectionObserver.js +10 -7
  66. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  67. package/lib/hooks/useMeasureList.js +6 -2
  68. package/lib/hooks/useMeasureList.js.map +1 -1
  69. package/lib/hooks/useMutationObserver.js +8 -6
  70. package/lib/hooks/useMutationObserver.js.map +1 -1
  71. package/lib/hooks/useResizeObserverRef.js +8 -6
  72. package/lib/hooks/useResizeObserverRef.js.map +1 -1
  73. package/lib/hooks/useStaticPagination.js +8 -5
  74. package/lib/hooks/useStaticPagination.js.map +1 -1
  75. package/lib/hooks/useVirtualizerMeasure.js +5 -4
  76. package/lib/hooks/useVirtualizerMeasure.js.map +1 -1
  77. package/lib/index.js +5 -5
  78. package/lib/index.js.map +1 -1
  79. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -1
  80. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js +1 -1
  81. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -1
  82. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -1
  83. package/lib/utilities/ImperativeScrolling/index.js +2 -2
  84. package/lib/utilities/ImperativeScrolling/index.js.map +1 -1
  85. package/lib/utilities/VirtualizerContext/VirtualizerContext.js +11 -4
  86. package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
  87. package/lib/utilities/VirtualizerContext/index.js +1 -1
  88. package/lib/utilities/VirtualizerContext/index.js.map +1 -1
  89. package/lib/utilities/VirtualizerContext/types.js +4 -1
  90. package/lib/utilities/VirtualizerContext/types.js.map +1 -1
  91. package/lib/utilities/createResizeObserverFromDocument.js +1 -0
  92. package/lib/utilities/createResizeObserverFromDocument.js.map +1 -1
  93. package/lib/utilities/debounce.js +1 -0
  94. package/lib/utilities/debounce.js.map +1 -1
  95. package/lib/utilities/index.js +2 -2
  96. package/lib/utilities/index.js.map +1 -1
  97. package/lib-commonjs/{Hooks.js → Hooks.cjs} +1 -1
  98. package/lib-commonjs/{Hooks.js.map → Hooks.cjs.map} +1 -1
  99. package/lib-commonjs/{Utilities.js → Utilities.cjs} +1 -1
  100. package/lib-commonjs/{Utilities.js.map → Utilities.cjs.map} +1 -1
  101. package/lib-commonjs/{Virtualizer.js → Virtualizer.cjs} +1 -1
  102. package/lib-commonjs/{Virtualizer.js.map → Virtualizer.cjs.map} +1 -1
  103. package/lib-commonjs/{VirtualizerScrollView.js → VirtualizerScrollView.cjs} +1 -1
  104. package/lib-commonjs/{VirtualizerScrollView.js.map → VirtualizerScrollView.cjs.map} +1 -1
  105. package/lib-commonjs/{VirtualizerScrollViewDynamic.js → VirtualizerScrollViewDynamic.cjs} +1 -1
  106. package/lib-commonjs/{VirtualizerScrollViewDynamic.js.map → VirtualizerScrollViewDynamic.cjs.map} +1 -1
  107. package/lib-commonjs/components/Virtualizer/{Virtualizer.js → Virtualizer.cjs} +4 -5
  108. package/lib-commonjs/components/Virtualizer/Virtualizer.cjs.map +1 -0
  109. package/lib-commonjs/components/Virtualizer/Virtualizer.types.cjs +6 -0
  110. package/lib-commonjs/components/Virtualizer/Virtualizer.types.cjs.map +1 -0
  111. package/lib-commonjs/components/Virtualizer/{index.js → index.cjs} +4 -4
  112. package/lib-commonjs/components/Virtualizer/{index.js.map → index.cjs.map} +1 -1
  113. package/lib-commonjs/components/Virtualizer/renderVirtualizer.cjs.map +1 -0
  114. package/lib-commonjs/components/Virtualizer/{useVirtualizer.js → useVirtualizer.cjs} +19 -8
  115. package/lib-commonjs/components/Virtualizer/useVirtualizer.cjs.map +1 -0
  116. package/lib-commonjs/components/Virtualizer/{useVirtualizerStyles.styles.js → useVirtualizerStyles.styles.cjs} +9 -1
  117. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.cjs.map +1 -0
  118. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.cjs +123 -0
  119. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.cjs.map +1 -0
  120. package/lib-commonjs/components/VirtualizerScrollView/{VirtualizerScrollView.js → VirtualizerScrollView.cjs} +4 -5
  121. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.cjs.map +1 -0
  122. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.cjs +6 -0
  123. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.cjs.map +1 -0
  124. package/lib-commonjs/components/VirtualizerScrollView/{index.js → index.cjs} +4 -4
  125. package/lib-commonjs/components/VirtualizerScrollView/{index.js.map → index.cjs.map} +1 -1
  126. package/lib-commonjs/components/VirtualizerScrollView/{renderVirtualizerScrollView.js → renderVirtualizerScrollView.cjs} +1 -1
  127. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.cjs.map +1 -0
  128. package/lib-commonjs/components/VirtualizerScrollView/{useVirtualizerScrollView.js → useVirtualizerScrollView.cjs} +7 -5
  129. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.cjs.map +1 -0
  130. package/lib-commonjs/components/VirtualizerScrollView/{useVirtualizerScrollViewStyles.styles.js → useVirtualizerScrollViewStyles.styles.cjs} +3 -2
  131. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.cjs.map +1 -0
  132. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.cjs +59 -0
  133. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.cjs.map +1 -0
  134. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{VirtualizerScrollViewDynamic.js → VirtualizerScrollViewDynamic.cjs} +6 -6
  135. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.cjs.map +1 -0
  136. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.cjs +4 -0
  137. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.cjs.map +1 -0
  138. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{index.js → index.cjs} +4 -4
  139. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{index.js.map → index.cjs.map} +1 -1
  140. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{renderVirtualizerScrollViewDynamic.js → renderVirtualizerScrollViewDynamic.cjs} +1 -1
  141. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.cjs.map +1 -0
  142. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{useVirtualizerScrollViewDynamic.js → useVirtualizerScrollViewDynamic.cjs} +11 -7
  143. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.cjs.map +1 -0
  144. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{useVirtualizerScrollViewDynamicStyles.styles.js → useVirtualizerScrollViewDynamicStyles.styles.cjs} +3 -2
  145. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.cjs.map +1 -0
  146. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.cjs +59 -0
  147. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.cjs.map +1 -0
  148. package/lib-commonjs/hooks/hooks.types.cjs +8 -0
  149. package/lib-commonjs/hooks/hooks.types.cjs.map +1 -0
  150. package/lib-commonjs/hooks/{index.js → index.cjs} +5 -5
  151. package/lib-commonjs/hooks/{index.js.map → index.cjs.map} +1 -1
  152. package/lib-commonjs/hooks/{useDynamicPagination.js → useDynamicPagination.cjs} +4 -2
  153. package/lib-commonjs/hooks/useDynamicPagination.cjs.map +1 -0
  154. package/lib-commonjs/hooks/{useDynamicVirtualizerMeasure.js → useDynamicVirtualizerMeasure.cjs} +3 -3
  155. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.cjs.map +1 -0
  156. package/lib-commonjs/hooks/{useIntersectionObserver.js → useIntersectionObserver.cjs} +5 -4
  157. package/lib-commonjs/hooks/useIntersectionObserver.cjs.map +1 -0
  158. package/lib-commonjs/hooks/{useMeasureList.js → useMeasureList.cjs} +2 -0
  159. package/lib-commonjs/hooks/useMeasureList.cjs.map +1 -0
  160. package/lib-commonjs/hooks/{useMutationObserver.js → useMutationObserver.cjs} +3 -3
  161. package/lib-commonjs/hooks/useMutationObserver.cjs.map +1 -0
  162. package/lib-commonjs/hooks/{useResizeObserverRef.js → useResizeObserverRef.cjs} +5 -4
  163. package/lib-commonjs/hooks/useResizeObserverRef.cjs.map +1 -0
  164. package/lib-commonjs/hooks/{useStaticPagination.js → useStaticPagination.cjs} +4 -2
  165. package/lib-commonjs/hooks/useStaticPagination.cjs.map +1 -0
  166. package/lib-commonjs/hooks/{useVirtualizerMeasure.js → useVirtualizerMeasure.cjs} +3 -3
  167. package/lib-commonjs/hooks/useVirtualizerMeasure.cjs.map +1 -0
  168. package/lib-commonjs/{index.js → index.cjs} +5 -5
  169. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  170. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.cjs.map +1 -0
  171. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.cjs +4 -0
  172. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.cjs.map +1 -0
  173. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.cjs.map +1 -0
  174. package/lib-commonjs/utilities/ImperativeScrolling/{index.js → index.cjs} +2 -2
  175. package/lib-commonjs/utilities/ImperativeScrolling/{index.js.map → index.cjs.map} +1 -1
  176. package/lib-commonjs/utilities/VirtualizerContext/{VirtualizerContext.js → VirtualizerContext.cjs} +1 -0
  177. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.cjs.map +1 -0
  178. package/lib-commonjs/utilities/VirtualizerContext/{index.js → index.cjs} +1 -1
  179. package/lib-commonjs/utilities/VirtualizerContext/{index.js.map → index.cjs.map} +1 -1
  180. package/lib-commonjs/utilities/VirtualizerContext/types.cjs +7 -0
  181. package/lib-commonjs/utilities/VirtualizerContext/types.cjs.map +1 -0
  182. package/lib-commonjs/utilities/{createResizeObserverFromDocument.js → createResizeObserverFromDocument.cjs} +1 -0
  183. package/lib-commonjs/utilities/createResizeObserverFromDocument.cjs.map +1 -0
  184. package/lib-commonjs/utilities/{debounce.js → debounce.cjs} +1 -0
  185. package/lib-commonjs/utilities/debounce.cjs.map +1 -0
  186. package/lib-commonjs/utilities/{index.js → index.cjs} +7 -7
  187. package/lib-commonjs/utilities/{index.js.map → index.cjs.map} +1 -1
  188. package/package.json +22 -28
  189. package/lib-commonjs/components/Virtualizer/Virtualizer.js.map +0 -1
  190. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js +0 -6
  191. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +0 -1
  192. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js.map +0 -1
  193. package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +0 -1
  194. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js.map +0 -1
  195. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +0 -1
  196. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js +0 -6
  197. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +0 -1
  198. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +0 -1
  199. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +0 -1
  200. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +0 -1
  201. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +0 -1
  202. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +0 -6
  203. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +0 -1
  204. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +0 -1
  205. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +0 -1
  206. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +0 -1
  207. package/lib-commonjs/hooks/hooks.types.js +0 -6
  208. package/lib-commonjs/hooks/hooks.types.js.map +0 -1
  209. package/lib-commonjs/hooks/useDynamicPagination.js.map +0 -1
  210. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +0 -1
  211. package/lib-commonjs/hooks/useIntersectionObserver.js.map +0 -1
  212. package/lib-commonjs/hooks/useMeasureList.js.map +0 -1
  213. package/lib-commonjs/hooks/useMutationObserver.js.map +0 -1
  214. package/lib-commonjs/hooks/useResizeObserverRef.js.map +0 -1
  215. package/lib-commonjs/hooks/useStaticPagination.js.map +0 -1
  216. package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +0 -1
  217. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js.map +0 -1
  218. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js +0 -6
  219. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +0 -1
  220. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +0 -1
  221. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +0 -1
  222. package/lib-commonjs/utilities/VirtualizerContext/types.js +0 -6
  223. package/lib-commonjs/utilities/VirtualizerContext/types.js.map +0 -1
  224. package/lib-commonjs/utilities/createResizeObserverFromDocument.js.map +0 -1
  225. package/lib-commonjs/utilities/debounce.js.map +0 -1
  226. /package/lib-commonjs/components/Virtualizer/{renderVirtualizer.js → renderVirtualizer.cjs} +0 -0
  227. /package/lib-commonjs/utilities/ImperativeScrolling/{imperativeScrolling.js → imperativeScrolling.cjs} +0 -0
  228. /package/lib-commonjs/utilities/ImperativeScrolling/{imperativeScrollingDynamic.js → imperativeScrollingDynamic.cjs} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useResizeObserverRef.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { debounce } from '../utilities/debounce';\nimport { createResizeObserverFromDocument } from '../utilities/createResizeObserverFromDocument';\nimport type { ResizeCallbackWithRef } from './hooks.types';\n\n/**\n * useResizeObserverRef_unstable simplifies resize observer connection and ensures debounce/cleanup\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const useResizeObserverRef_unstable = (\n resizeCallback: ResizeCallbackWithRef,\n): ((instance: HTMLElement | HTMLDivElement | null) => void) => {\n const { targetDocument } = useFluent();\n const container = React.useRef<HTMLElement | null>(null);\n const containerHeightRef = React.useRef<number>(0);\n const containerWidthRef = React.useRef<number>(0);\n // the handler for resize observer\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n\n // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring\n const handleResize = debounce((entries: ResizeObserverEntry[], observer: ResizeObserver) => {\n const containerHeight = container.current?.clientHeight;\n const containerWidth = container.current?.clientWidth;\n // Our resize observer will fire on scroll resize, let index change handle that instead.\n if (containerHeightRef.current !== containerHeight || containerWidth !== containerWidthRef.current) {\n containerWidthRef.current = containerWidth ?? 0;\n containerHeightRef.current = containerHeight ?? 0;\n resizeCallback(entries, observer, container);\n }\n });\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver, setResizeObserver] = React.useState(() =>\n createResizeObserverFromDocument(targetDocument, handleResize),\n );\n\n React.useEffect(() => {\n // Update our state when resizeCallback changes\n container.current = null;\n resizeObserver?.disconnect();\n // eslint-disable-next-line react-hooks/set-state-in-effect -- deprecated package, not worth refactoring\n setResizeObserver(() => createResizeObserverFromDocument(targetDocument, handleResize));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [resizeCallback, targetDocument]);\n\n React.useEffect(() => {\n return () => {\n container.current = null;\n resizeObserver?.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const scrollRef = React.useCallback(\n (instance: HTMLElement | HTMLDivElement | null) => {\n if (container.current !== instance) {\n if (container.current) {\n resizeObserver?.unobserve(container.current);\n }\n\n container.current = instance;\n if (container.current) {\n resizeObserver?.observe(container.current);\n }\n }\n },\n [resizeObserver],\n );\n\n return scrollRef;\n};\n"],"names":["React","useFluent_unstable","useFluent","debounce","createResizeObserverFromDocument","useResizeObserverRef_unstable","resizeCallback","targetDocument","container","useRef","containerHeightRef","containerWidthRef","handleResize","entries","observer","containerHeight","current","clientHeight","containerWidth","clientWidth","resizeObserver","setResizeObserver","useState","useEffect","disconnect","scrollRef","useCallback","instance","unobserve","observe"],"mappings":"AAAA;;;;;+BAYaK;;;;;;;iEAVU,QAAQ;qCACiB,kCAAkC;0BACzD,2BAAwB;kDACA,mDAAgD;AAO1F,sCAAsC,CAC3CC;IAEA,MAAM,EAAEC,cAAc,EAAE,OAAGL,uCAAAA;IAC3B,MAAMM,YAAYR,OA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IAAAA,KAAAA,IAAAA,eAAgBI,UAAU;QAC5B;IACA,uDAAuD;IACzD,GAAG,EAAE;IAEL,MAAMC,YAAYzB,OAAM0B,WAAW,CACjC,CAACC;QACC,IAAInB,UAAUQ,OAAO,KAAKW,UAAU;YAClC,IAAInB,UAAUQ,OAAO,EAAE;gBACrBI,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBQ,SAAS,CAACpB,UAAUQ,OAAO;YAC7C;YAEAR,UAAUQ,OAAO,GAAGW;YACpB,IAAInB,UAAUQ,OAAO,EAAE;gBACrBI,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBS,OAAO,CAACrB,UAAUQ,OAAO;YAC3C;QACF;IACF,GACA;QAACI;KAAe;IAGlB,OAAOK;AACT,EAAE"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -12,7 +13,6 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
14
  const _reactutilities = require("@fluentui/react-utilities");
14
15
  const useStaticVirtualizerPagination = (virtualizerProps, paginationEnabled = true)=>{
15
- 'use no memo';
16
16
  const { itemSize, axis = 'vertical' } = virtualizerProps;
17
17
  const [setScrollTimer, clearScrollTimer] = (0, _reactutilities.useTimeout)();
18
18
  const lastScrollPos = _react.useRef(0);
@@ -20,6 +20,7 @@ const useStaticVirtualizerPagination = (virtualizerProps, paginationEnabled = tr
20
20
  const scrollContainer = _react.useRef(null);
21
21
  const clearListeners = ()=>{
22
22
  if (scrollContainer.current) {
23
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
23
24
  scrollContainer.current.removeEventListener('scroll', onScroll);
24
25
  scrollContainer.current = null;
25
26
  clearScrollTimer();
@@ -74,7 +75,8 @@ const useStaticVirtualizerPagination = (virtualizerProps, paginationEnabled = tr
74
75
  ]);
75
76
  /**
76
77
  * On scroll timer that will continuously delay callback until scrolling stops
77
- */ const onScroll = _react.useCallback(()=>{
78
+ */ // eslint-disable-next-line react-hooks/preserve-manual-memoization -- deprecated package, not worth refactoring
79
+ const onScroll = _react.useCallback(()=>{
78
80
  clearScrollTimer();
79
81
  setScrollTimer(onScrollEnd, 100);
80
82
  }, [
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useStaticPagination.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { VirtualizerStaticPaginationProps } from './hooks.types';\nimport { useTimeout } from '@fluentui/react-utilities';\n\n/**\n * Optional hook that will enable pagination on the virtualizer so that it 'autoscrolls' to an items exact position\n * Sizes are uniform/static, we round to the nearest item on long scrolls\n * On short scrolls, we will go at minimum to the next/previous item so that arrow pagination works\n * All VirtualizerStaticPaginationProps can be grabbed from Virtualizer hooks externally and passed in/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const useStaticVirtualizerPagination = (\n virtualizerProps: VirtualizerStaticPaginationProps,\n paginationEnabled: Boolean = true,\n): ((instance: HTMLElement | HTMLDivElement | null) => void) => {\n const { itemSize, axis = 'vertical' } = virtualizerProps;\n\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const lastScrollPos = React.useRef<number>(0);\n const lastIndexScrolled = React.useRef<number>(0);\n\n const scrollContainer = React.useRef<HTMLElement | null>(null);\n\n const clearListeners = () => {\n if (scrollContainer.current) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n scrollContainer.current.removeEventListener('scroll', onScroll);\n\n scrollContainer.current = null;\n clearScrollTimer();\n }\n };\n\n React.useEffect(() => {\n return () => {\n clearListeners();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /**\n * Handle scroll stop event and paginate to the closest item\n * If the closest item is the same as the previous scroll end\n * we paginate to the next/previous one based on direction\n */\n const onScrollEnd = React.useCallback(() => {\n if (!scrollContainer.current || !paginationEnabled) {\n // No container found\n return;\n }\n\n const currentScrollPos = Math.round(\n axis === 'vertical' ? scrollContainer.current.scrollTop : scrollContainer.current.scrollLeft,\n );\n const closestItem = Math.round(currentScrollPos / itemSize);\n\n let nextItem = 0;\n if (Math.round(closestItem - lastIndexScrolled.current) === 0) {\n // Special case for go to next/previous with minimum amount of scroll needed\n const nextTarget = lastScrollPos.current < currentScrollPos ? 1 : -1;\n const isSecondaryScroll = lastScrollPos.current === currentScrollPos;\n const posMod = isSecondaryScroll ? 0 : nextTarget;\n\n nextItem = closestItem + posMod;\n } else {\n // Pagination for anything else can just jump to the closest!\n nextItem = closestItem;\n }\n\n const nextItemPos = nextItem * itemSize;\n\n if (axis === 'vertical') {\n scrollContainer.current.scrollTo({ top: nextItemPos, behavior: 'smooth' });\n } else {\n scrollContainer.current.scrollTo({ left: nextItemPos, behavior: 'smooth' });\n }\n lastScrollPos.current = nextItemPos;\n lastIndexScrolled.current = nextItem;\n }, [paginationEnabled, axis, itemSize]);\n\n /**\n * On scroll timer that will continuously delay callback until scrolling stops\n */\n // eslint-disable-next-line react-hooks/preserve-manual-memoization -- deprecated package, not worth refactoring\n const onScroll = React.useCallback(() => {\n clearScrollTimer();\n setScrollTimer(onScrollEnd, 100);\n }, [onScrollEnd, clearScrollTimer, setScrollTimer]);\n\n /**\n * Pagination ref will ensure we attach listeners to containers on change\n * It is returned from hook and merged into the scroll container externally\n */\n const paginationRef = React.useCallback(\n (instance: HTMLElement | HTMLDivElement | null) => {\n if (!paginationEnabled) {\n clearListeners();\n scrollContainer.current = null;\n return;\n }\n if (scrollContainer.current !== instance) {\n clearListeners();\n\n scrollContainer.current = instance;\n if (scrollContainer.current) {\n scrollContainer.current.addEventListener('scroll', onScroll);\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [onScroll, onScrollEnd, paginationEnabled],\n );\n\n return paginationRef;\n};\n"],"names":["React","useTimeout","useStaticVirtualizerPagination","virtualizerProps","paginationEnabled","itemSize","axis","setScrollTimer","clearScrollTimer","lastScrollPos","useRef","lastIndexScrolled","scrollContainer","clearListeners","current","removeEventListener","onScroll","useEffect","onScrollEnd","useCallback","currentScrollPos","Math","round","scrollTop","scrollLeft","closestItem","nextItem","nextTarget","isSecondaryScroll","posMod","nextItemPos","scrollTo","top","behavior","left","paginationRef","instance","addEventListener"],"mappings":"AAAA;;;;;+BAaaE;;;;;;;iEAXU,QAAQ;gCAEJ,4BAA4B;AAShD,uCAAuC,CAC5CC,kBACAC,oBAA6B,IAAI;IAEjC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,UAAU,EAAE,GAAGH;IAExC,MAAM,CAACI,gBAAgBC,iBAAiB,GAAGP,8BAAAA;IAC3C,MAAMQ,gBAAgBT,OAAMU,MAAM,CAAS;IAC3C,MAAMC,oBAAoBX,OAAMU,MAAM,CAAS;IAE/C,MAAME,kBAAkBZ,OAAMU,MAAM,CAAqB;IAEzD,MAAMG,iBAAiB;QACrB,IAAID,gBAAgBE,OAAO,EAAE;YAC3B,iGAAiG;YACjGF,gBAAgBE,OAAO,CAACC,mBAAmB,CAAC,UAAUC;YAEtDJ,gBAAgBE,OAAO,GAAG;YAC1BN;QACF;IACF;IAEAR,OAAMiB,SAAS,CAAC;QACd,OAAO;YACLJ;QACF;IACA,uDAAuD;IACzD,GAAG,EAAE;IAEL;;;;GAIC,GACD,MAAMK,cAAclB,OAAMmB,WAAW,CAAC;QACpC,IAAI,CAACP,gBAAgBE,OAAO,IAAI,CAACV,mBAAmB;YAClD,qBAAqB;YACrB;QACF;QAEA,MAAMgB,mBAAmBC,KAAKC,KAAK,CACjChB,SAAS,aAAaM,gBAAgBE,OAAO,CAACS,SAAS,GAAGX,gBAAgBE,OAAO,CAACU,UAAU;QAE9F,MAAMC,cAAcJ,KAAKC,KAAK,CAACF,mBAAmBf;QAElD,IAAIqB,WAAW;QACf,IAAIL,KAAKC,KAAK,CAACG,cAAcd,kBAAkBG,OAAO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perty(exports, "useStaticVirtualizerMeasure", {
10
11
  });
11
12
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- const _useResizeObserverRef = require("./useResizeObserverRef");
14
+ const _useResizeObserverRef = require("./useResizeObserverRef.cjs");
14
15
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
15
16
  const useStaticVirtualizerMeasure = (virtualizerProps)=>{
16
17
  const { defaultItemSize, direction = 'vertical', bufferItems, bufferSize } = virtualizerProps;
@@ -22,8 +23,7 @@ const useStaticVirtualizerMeasure = (virtualizerProps)=>{
22
23
  const containerSizeRef = _react.useRef(0);
23
24
  const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
24
25
  const { virtualizerLength, _bufferItems, _bufferSize } = state;
25
- const resizeCallback = _react.useCallback((_entries, // eslint-disable-next-line no-restricted-globals
26
- _observer, scrollRef)=>{
26
+ const resizeCallback = _react.useCallback((_entries, _observer, scrollRef)=>{
27
27
  if (!(scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
28
28
  return;
29
29
  }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useVirtualizerMeasure.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { VirtualizerMeasureProps } from './hooks.types';\nimport { useResizeObserverRef_unstable } from './useResizeObserverRef';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * React hook that measures virtualized space based on a static size to ensure optimized virtualization length.\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const useStaticVirtualizerMeasure = <TElement extends HTMLElement>(\n virtualizerProps: VirtualizerMeasureProps,\n): {\n virtualizerLength: number;\n bufferItems: number;\n bufferSize: number;\n scrollRef: (instance: TElement | null) => void;\n\n containerSizeRef: React.MutableRefObject<number>;\n} => {\n const { defaultItemSize, direction = 'vertical', bufferItems, bufferSize } = virtualizerProps;\n\n const [state, setState] = React.useState({\n virtualizerLength: 0,\n _bufferSize: 0,\n _bufferItems: 0,\n });\n\n const containerSizeRef = React.useRef<number>(0);\n const { targetDocument } = useFluent();\n\n const { virtualizerLength, _bufferItems, _bufferSize } = state;\n\n const resizeCallback = React.useCallback(\n (\n _entries: ResizeObserverEntry[],\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n\n _observer: ResizeObserver,\n\n scrollRef?: React.MutableRefObject<HTMLElement | null>,\n ) => {\n if (!scrollRef?.current) {\n return;\n }\n\n if (scrollRef.current !== targetDocument?.body) {\n // We have a local scroll container\n containerSizeRef.current =\n direction === 'vertical'\n ? scrollRef?.current.getBoundingClientRect().height\n : scrollRef?.current.getBoundingClientRect().width;\n } else if (targetDocument?.defaultView) {\n // If our scroll ref is the document body, we should check window height\n containerSizeRef.current =\n direction === 'vertical' ? targetDocument?.defaultView?.innerHeight : targetDocument?.defaultView?.innerWidth;\n }\n /*\n * Number of items required to cover viewport.\n */\n const length = Math.ceil(containerSizeRef.current / defaultItemSize + 1);\n\n /*\n * Number of items to append at each end, i.e. 'preload' each side before entering view.\n * Minimum: 1\n */\n const newBufferItems = bufferItems ?? Math.max(Math.ceil(length / 4), 1);\n\n /*\n * This is how far we deviate into the bufferItems to detect a redraw.\n */\n const newBufferSize = bufferSize ?? Math.max(defaultItemSize / 2.0, 1);\n\n const totalLength = length + newBufferItems * 2;\n\n setState({\n virtualizerLength: totalLength,\n _bufferItems: newBufferItems,\n _bufferSize: newBufferSize,\n });\n },\n [bufferItems, bufferSize, defaultItemSize, direction, targetDocument?.body, targetDocument?.defaultView],\n );\n\n const scrollRef = useResizeObserverRef_unstable(resizeCallback);\n\n return {\n virtualizerLength,\n bufferItems: _bufferItems,\n bufferSize: _bufferSize,\n scrollRef,\n containerSizeRef,\n };\n};\n"],"names":["React","useResizeObserverRef_unstable","useFluent_unstable","useFluent","useStaticVirtualizerMeasure","virtualizerProps","defaultItemSize","direction","bufferItems","bufferSize","state","setState","useState","virtualizerLength","_bufferSize","_bufferItems","containerSizeRef","useRef","targetDocument","resizeCallback","useCallback","_entries","_observer","scrollRef","current","body","getBoundingClientRect","height","width","defaultView","innerHeight","innerWidth","length","Math","ceil","newBufferItems","max","newBufferSize","totalLength"],"mappings":"AAAA;;;;;+BAWaI;;;;;;;iEATU,QAAQ;sCAEe,4BAAyB;qCACvB,kCAAkC;AAM3E,oCAAoC,CACzCC;IASA,MAAM,EAAEC,eAAe,EAAEC,YAAY,UAAU,EAAEC,WAAW,EAAEC,UAAU,EAAE,GAAGJ;IAE7E,MAAM,CAACK,OAAOC,SAAS,GAAGX,OAAMY,QAAQ,CAAC;QACvCC,mBAAmB;QACnBC,aAAa;QACbC,cAAc;IAChB;IAEA,MAAMC,mBAAmBhB,OAAMiB,MAAM,CAAS;IAC9C,MAAM,EAAEC,cAAc,EAAE,OAAGf,uCAAAA;IAE3B,MAAM,EAAEU,iBAAiB,EAAEE,YAAY,EAAED,WAAW,EAAE,GAAGJ;IAEzD,MAAMS,iBAAiBnB,OAAMoB,WAAW,CACtC,CACEC,UACA,AAEAC,WAEAC,mFAJ8F;QAM9F,IAAI,EAACA,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAWC,OAAAA,AAAO,GAAE;YACvB;QACF;QAEA,IAAID,UAAUC,OAAO,MAAKN,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBO,IAAAA,AAAI,GAAE;YAC9C,mCAAmC;YACnCT,iBAAiBQ,OAAO,GACtBjB,cAAc,aACVgB,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAWC,OAAO,CAACE,qBAAqB,GAAGC,MAAM,GACjDJ,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAWC,OAAO,CAACE,qBAAqB,GAAGE,KAAK;QACxD,OAAO,IAAIV,mBAAAA,QAAAA,mBAAAA,KAAAA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export(exports, {
82
82
  return _VirtualizerScrollViewDynamic.virtualizerScrollViewDynamicClassNames;
83
83
  }
84
84
  });
85
- const _Virtualizer = require("./Virtualizer");
86
- const _Hooks = require("./Hooks");
87
- const _Utilities = require("./Utilities");
88
- const _VirtualizerScrollView = require("./VirtualizerScrollView");
89
- const _VirtualizerScrollViewDynamic = require("./VirtualizerScrollViewDynamic");
85
+ const _Virtualizer = require("./Virtualizer.cjs");
86
+ const _Hooks = require("./Hooks.cjs");
87
+ const _Utilities = require("./Utilities.cjs");
88
+ const _VirtualizerScrollView = require("./VirtualizerScrollView.cjs");
89
+ const _VirtualizerScrollViewDynamic = require("./VirtualizerScrollViewDynamic.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Virtualizer,\n virtualizerClassNames,\n useVirtualizer_unstable,\n renderVirtualizer_unstable,\n useVirtualizerStyles_unstable,\n} from './Virtualizer';\n\nexport type {\n VirtualizerProps,\n VirtualizerState,\n VirtualizerSlots,\n VirtualizerChildRenderFunction,\n VirtualizerDataRef,\n} from './Virtualizer';\n\nexport {\n useIntersectionObserver,\n useStaticVirtualizerMeasure,\n useDynamicVirtualizerMeasure,\n useResizeObserverRef_unstable,\n useMeasureList,\n} from './Hooks';\n\nexport type {\n ResizeCallbackWithRef,\n VirtualizerMeasureDynamicProps,\n VirtualizerMeasureProps,\n IndexedResizeCallbackElement,\n} from './Hooks';\n\nexport type { ScrollToItemDynamicParams, ScrollToItemStaticParams, ScrollToInterface } from './Utilities';\n\nexport {\n VirtualizerContextProvider,\n useVirtualizerContext_unstable,\n scrollToItemStatic,\n scrollToItemDynamic,\n} from './Utilities';\n\nexport type { VirtualizerContextProps, DynamicVirtualizerContextProps } from './Utilities';\n\nexport {\n VirtualizerScrollView,\n virtualizerScrollViewClassNames,\n useVirtualizerScrollView_unstable,\n renderVirtualizerScrollView_unstable,\n useVirtualizerScrollViewStyles_unstable,\n} from './VirtualizerScrollView';\n\nexport type {\n VirtualizerScrollViewProps,\n VirtualizerScrollViewState,\n VirtualizerScrollViewSlots,\n} from './VirtualizerScrollView';\n\nexport {\n VirtualizerScrollViewDynamic,\n virtualizerScrollViewDynamicClassNames,\n useVirtualizerScrollViewDynamic_unstable,\n renderVirtualizerScrollViewDynamic_unstable,\n useVirtualizerScrollViewDynamicStyles_unstable,\n} from './VirtualizerScrollViewDynamic';\n\nexport type {\n VirtualizerScrollViewDynamicProps,\n VirtualizerScrollViewDynamicState,\n VirtualizerScrollViewDynamicSlots,\n} from './VirtualizerScrollViewDynamic';\n"],"names":["Virtualizer","VirtualizerContextProvider","VirtualizerScrollView","VirtualizerScrollViewDynamic","renderVirtualizerScrollViewDynamic_unstable","renderVirtualizerScrollView_unstable","renderVirtualizer_unstable","scrollToItemDynamic","scrollToItemStatic","useDynamicVirtualizerMeasure","useIntersectionObserver","useMeasureList","useResizeObserverRef_unstable","useStaticVirtualizerMeasure","useVirtualizerContext_unstable","useVirtualizerScrollViewDynamicStyles_unstable","useVirtualizerScrollViewDynamic_unstable","useVirtualizerScrollViewStyles_unstable","useVirtualizerScrollView_unstable","useVirtualizerStyles_unstable","useVirtualizer_unstable","virtualizerClassNames","virtualizerScrollViewClassNames","virtualizerScrollViewDynamicClassNames"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,WAAW;eAAXA,wBAAW;;IAiCXC,0BAA0B;eAA1BA,qCAA0B;;IAS1BC,qBAAqB;eAArBA,4CAAqB;;IAcrBC,4BAA4B;eAA5BA,0DAA4B;;IAG5BC,2CAA2C;eAA3CA,yEAA2C;;IAd3CC,oCAAoC;eAApCA,2DAAoC;;IA1CpCC,0BAA0B;eAA1BA,uCAA0B;;IAiC1BC,mBAAmB;eAAnBA,8BAAmB;;IADnBC,kBAAkB;eAAlBA,6BAAkB;;IAjBlBC,4BAA4B;eAA5BA,mCAA4B;;IAF5BC,uBAAuB;eAAvBA,8BAAuB;;IAIvBC,cAAc;eAAdA,qBAAc;;IADdC,6BAA6B;eAA7BA,oCAA6B;;IAF7BC,2BAA2B;eAA3BA,kCAA2B;;IAiB3BC,8BAA8B;eAA9BA,yCAA8B;;IA0B9BC,8CAA8C;eAA9CA,4EAA8C;;IAF9CC,wCAAwC;eAAxCA,sEAAwC;;IAZxCC,uCAAuC;eAAvCA,8DAAuC;;IAFvCC,iCAAiC;eAAjCA,wDAAiC;;IAxCjCC,6BAA6B;eAA7BA,0CAA6B;;IAF7BC,uBAAuB;eAAvBA,oCAAuB;;IADvBC,qBAAqB;eAArBA,kCAAqB;;IA0CrBC,+BAA+B;eAA/BA,sDAA+B;;IAc/BC,sCAAsC;eAAtCA,oEAAsC;;;6BApDjC;uBAgBA;2BAgBA;uCAUA;8CAcA"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Virtualizer,\n virtualizerClassNames,\n useVirtualizer_unstable,\n renderVirtualizer_unstable,\n useVirtualizerStyles_unstable,\n} from './Virtualizer';\n\nexport type {\n VirtualizerProps,\n VirtualizerState,\n VirtualizerSlots,\n VirtualizerChildRenderFunction,\n VirtualizerDataRef,\n} from './Virtualizer';\n\nexport {\n useIntersectionObserver,\n useStaticVirtualizerMeasure,\n useDynamicVirtualizerMeasure,\n useResizeObserverRef_unstable,\n useMeasureList,\n} from './Hooks';\n\nexport type {\n ResizeCallbackWithRef,\n VirtualizerMeasureDynamicProps,\n VirtualizerMeasureProps,\n IndexedResizeCallbackElement,\n} from './Hooks';\n\nexport type { ScrollToItemDynamicParams, ScrollToItemStaticParams, ScrollToInterface } from './Utilities';\n\nexport {\n VirtualizerContextProvider,\n useVirtualizerContext_unstable,\n scrollToItemStatic,\n scrollToItemDynamic,\n} from './Utilities';\n\nexport type { VirtualizerContextProps, DynamicVirtualizerContextProps } from './Utilities';\n\nexport {\n VirtualizerScrollView,\n virtualizerScrollViewClassNames,\n useVirtualizerScrollView_unstable,\n renderVirtualizerScrollView_unstable,\n useVirtualizerScrollViewStyles_unstable,\n} from './VirtualizerScrollView';\n\nexport type {\n VirtualizerScrollViewProps,\n VirtualizerScrollViewState,\n VirtualizerScrollViewSlots,\n} from './VirtualizerScrollView';\n\nexport {\n VirtualizerScrollViewDynamic,\n virtualizerScrollViewDynamicClassNames,\n useVirtualizerScrollViewDynamic_unstable,\n renderVirtualizerScrollViewDynamic_unstable,\n useVirtualizerScrollViewDynamicStyles_unstable,\n} from './VirtualizerScrollViewDynamic';\n\nexport type {\n VirtualizerScrollViewDynamicProps,\n VirtualizerScrollViewDynamicState,\n VirtualizerScrollViewDynamicSlots,\n} from './VirtualizerScrollViewDynamic';\n"],"names":["Virtualizer","virtualizerClassNames","useVirtualizer_unstable","renderVirtualizer_unstable","useVirtualizerStyles_unstable","useIntersectionObserver","useStaticVirtualizerMeasure","useDynamicVirtualizerMeasure","useResizeObserverRef_unstable","useMeasureList","VirtualizerContextProvider","useVirtualizerContext_unstable","scrollToItemStatic","scrollToItemDynamic","VirtualizerScrollView","virtualizerScrollViewClassNames","useVirtualizerScrollView_unstable","renderVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","VirtualizerScrollViewDynamic","virtualizerScrollViewDynamicClassNames","useVirtualizerScrollViewDynamic_unstable","renderVirtualizerScrollViewDynamic_unstable","useVirtualizerScrollViewDynamicStyles_unstable"],"mappings":";;;;;;;;;;;IACEA,WAAW;;;;eAiCXU,qCAA0B;;;eAS1BI,4CAAqB;;;eAcrBK,0DAA4B;;IAG5BG;wFAA2C;;;eAd3CL,2DAAoC;;;eA1CpCd,uCAA0B;;;eAiC1BU,8BAAmB;;;eADnBD,6BAAkB;;gCAjBU;eAA5BL;;;eAFAF,8BAAuB;;;eAIvBI,qBAAc;;;eADdD,oCAA6B;;;eAF7BF,kCAA2B;;;eAiB3BK,yCAA8B;;;eA0B9BY,4EAA8C;;IAF9CF,wCAAwC;;;IAZxCH;6EAAuC;;IAFvCF;uEAAiC;;;eAxCjCZ,0CAA6B;;2BAFN;eAAvBF;;;eADAD,kCAAqB;;;eA0CrBc,sDAA+B;;;eAc/BK,oEAAsC;;;6BApDjC,mBAAgB;uBAgBhB,aAAU;2BAgBV,iBAAc;uCAUd,6BAA0B;8CAc1B,oCAAiC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrolling.ts"],"sourcesContent":["import type { ScrollToItemStaticParams } from './imperativeScrolling.types';\n\nexport const scrollToItemStatic = (params: ScrollToItemStaticParams): void => {\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"],"mappings":";;;;+BAEaA;;;;;;AAAN,2BAA2B,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;aAAAA,yBAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAuBK,QAAQ,CAAC;gBAC9BC,MAAMP,aAAaD,WAAWA,WAAWD;gBACzCM;YACF;QACF,OAAO;gBACLH;aAAAA,0BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BC,MAAMR,WAAWD;gBACjBM;YACF;QACF;IACF,OAAO;QACL,IAAID,UAAU;gBACZF;aAAAA,0BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BE,KAAKR,aAAaD,WAAWA,WAAWD;gBACxCM;YACF;QACF,OAAO;gBACLH;aAAAA,0BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBK,QAAQ,CAAC;gBAC9BE,KAAKT,WAAWD;gBAChBM;YACF;QACF;IACF;AACF,EAAE"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrolling.types.ts"],"sourcesContent":["import type * 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":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/ImperativeScrolling/imperativeScrollingDynamic.ts"],"sourcesContent":["import type { ScrollToItemDynamicParams } from './imperativeScrolling.types';\n\nexport const scrollToItemDynamic = (params: ScrollToItemDynamicParams): void => {\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"],"mappings":";;;;+BAEaA;;;;;;AAAN,4BAA4B,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;aAAAA,yBAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAuBQ,QAAQ,CAAC;gBAC9BC,MAAMV,YAAYO;gBAClBH;YACF;QACF,OAAO;gBACLH;aAAAA,0BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BC,MAAMH;gBACNH;YACF;QACF;IACF,OAAO;QACL,IAAID,UAAU;gBACZF;aAAAA,0BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BE,KAAKX,YAAYO;gBACjBH;YACF;QACF,OAAO;gBACLH;YAAAA,2BAAAA,cAAcI,OAAAA,AAAO,MAAA,QAArBJ,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAuBQ,QAAQ,CAAC;gBAC9BE,KAAKJ;gBACLH;YACF;QACF;IACF;AACF,EAAE"}
@@ -16,5 +16,5 @@ _export(exports, {
16
16
  return _imperativeScrolling.scrollToItemStatic;
17
17
  }
18
18
  });
19
- const _imperativeScrolling = require("./imperativeScrolling");
20
- const _imperativeScrollingDynamic = require("./imperativeScrollingDynamic");
19
+ const _imperativeScrolling = require("./imperativeScrolling.cjs");
20
+ const _imperativeScrollingDynamic = require("./imperativeScrollingDynamic.cjs");
@@ -1 +1 @@
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"}
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":["scrollToItemStatic","scrollToItemDynamic"],"mappings":";;;;;;;;;;;;eAMSC,+CAAmB;;;eANnBD,uCAAkB;;;qCAAQ,2BAAwB;4CAMvB,kCAA+B"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/VirtualizerContext/VirtualizerContext.ts"],"sourcesContent":["'use client';\n\nimport * 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\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const VirtualizerContextProvider = VirtualizerContext.Provider;\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const useVirtualizerContext_unstable = (): VirtualizerContextProps => {\n return React.useContext(VirtualizerContext);\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\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":["React","VirtualizerContext","createContext","undefined","VirtualizerContextProvider","Provider","useVirtualizerContext_unstable","useContext","useVirtualizerContextState_unstable","passedContext","virtualizerContext","_contextIndex","_setContextIndex","useState","childProgressiveSizes","useRef","context","useMemo","contextIndex","setContextIndex"],"mappings":"AAAA;;;;;;;;;;;;IAYaI,0BAAAA;;;IAYAI,mCAAAA;;;kCAPAF;;;;;iEAfU,QAAQ;AAG/B,MAAML,mCAAqBD,OAAME,aAAa,CAC5CC;AAMK,mCAAmCF,mBAAmBI,QAAQ,CAAC;AAK/D,MAAMC,iCAAiC;IAC5C,OAAON,OAAMO,UAAU,CAACN;AAC1B,EAAE;AAKK,4CAA4C,CACjDQ;IAEA,MAAMC,qBAAqBJ;IAC3B,MAAM,CAACK,eAAeC,iBAAiB,GAAGZ,OAAMa,QAAQ,CAAS,CAAC;IAClE,MAAMC,wBAAwBd,OAAMe,MAAM,CAAW,EAAE;IAEvD;;GAEC,GACD,MAAMC,UAAUhB,OAAMiB,OAAO,CAC3B;YACgBR,6BAAAA,MACGA,gCAAAA;eAFZ;YACLS,cAAcT,CAAAA,OAAAA,CAAAA,8BAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeS,YAAAA,AAAY,MAAA,QAA3BT,gCAAAA,KAAAA,IAAAA,8BAA+BC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBQ,YAAAA,AAAY,MAAA,QAA/DT,SAAAA,KAAAA,IAAAA,OAAmEE;YACjFQ,iBAAiBV,CAAAA,QAAAA,CAAAA,iCAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeU,eAAAA,AAAe,MAAA,QAA9BV,mCAAAA,KAAAA,IAAAA,iCAAkCC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBS,eAAAA,AAAe,MAAA,QAArEV,UAAAA,KAAAA,IAAAA,QAAyEG;YAC1FE;QACF;OACA;QAACH;QAAeF;QAAeC;KAAmB;IAGpD,OAAOM;AACT,EAAE"}
@@ -19,4 +19,4 @@ _export(exports, {
19
19
  return _VirtualizerContext.useVirtualizerContext_unstable;
20
20
  }
21
21
  });
22
- const _VirtualizerContext = require("./VirtualizerContext");
22
+ const _VirtualizerContext = require("./VirtualizerContext.cjs");
@@ -1 +1 @@
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"}
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"],"mappings":";;;;;;;;;;;;eACEA,8CAA0B;;;eAC1BC,uDAAmC;;;eACnCC,kDAA8B;;;oCACzB,0BAAuB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Some props are optional on static virtualizer, but required for dynamic.
3
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/VirtualizerContext/types.ts"],"sourcesContent":["import type * as React from 'react';\n/**\n * {@docCategory Virtualizer}\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerContextProps = {\n contextIndex: number;\n setContextIndex: (index: number) => void;\n /*\n * These optional props are used in dynamic virtualizer\n */\n\n childProgressiveSizes?: React.MutableRefObject<number[]>;\n};\n\n/**\n * Some props are optional on static virtualizer, but required for dynamic.\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type DynamicVirtualizerContextProps = Required<VirtualizerContextProps>;\n"],"names":[],"mappings":"AAeA;;;CAGC,GACD,WAA+E"}
@@ -4,6 +4,7 @@
4
4
  * @param targetDocument - document to use to create the ResizeObserver
5
5
  * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback
6
6
  * @returns a ResizeObserver instance or null if the global does not exist on the document
7
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
7
8
  */ "use strict";
8
9
  Object.defineProperty(exports, "__esModule", {
9
10
  value: true
@@ -0,0 +1 @@
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 * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport function createResizeObserverFromDocument(\n targetDocument: Document | null | undefined,\n callback: ResizeObserverCallback,\n): ResizeObserver | null {\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"],"mappings":"AAAA;;;;;;;CAOC,GACD;;;;;;;;;;AAAO,SAASA,iCACdC,cAA2C,EAC3CC,QAAgC;QAE3BD;IAAL,IAAI,EAACA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,+BAAAA,eAAgBE,WAAAA,AAAW,MAAA,QAA3BF,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA6BG,cAAAA,AAAc,GAAE;QAChD,OAAO;IACT;IAEA,OAAO,IAAIH,eAAeE,WAAW,CAACC,cAAc,CAACF;AACvD"}
@@ -3,6 +3,7 @@
3
3
  * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
4
4
  * @param fn - Function to debounce
5
5
  * @returns debounced function
6
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
6
7
  */ "use strict";
7
8
  Object.defineProperty(exports, "__esModule", {
8
9
  value: true
@@ -0,0 +1 @@
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 * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n return (): void => {\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"],"mappings":"AAAA;;;;;;CAMC,GACD;;;;;;;;;;AAAO,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"}
@@ -10,20 +10,20 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  VirtualizerContextProvider: function() {
13
- return _VirtualizerContext.VirtualizerContextProvider;
13
+ return _index.VirtualizerContextProvider;
14
14
  },
15
15
  scrollToItemDynamic: function() {
16
- return _ImperativeScrolling.scrollToItemDynamic;
16
+ return _index1.scrollToItemDynamic;
17
17
  },
18
18
  scrollToItemStatic: function() {
19
- return _ImperativeScrolling.scrollToItemStatic;
19
+ return _index1.scrollToItemStatic;
20
20
  },
21
21
  useVirtualizerContextState_unstable: function() {
22
- return _VirtualizerContext.useVirtualizerContextState_unstable;
22
+ return _index.useVirtualizerContextState_unstable;
23
23
  },
24
24
  useVirtualizerContext_unstable: function() {
25
- return _VirtualizerContext.useVirtualizerContext_unstable;
25
+ return _index.useVirtualizerContext_unstable;
26
26
  }
27
27
  });
28
- const _VirtualizerContext = require("./VirtualizerContext");
29
- const _ImperativeScrolling = require("./ImperativeScrolling");
28
+ const _index = require("./VirtualizerContext/index.cjs");
29
+ const _index1 = require("./ImperativeScrolling/index.cjs");
@@ -1 +1 @@
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"}
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","useVirtualizerContextState_unstable","useVirtualizerContext_unstable","scrollToItemDynamic","scrollToItemStatic"],"mappings":";;;;;;;;;;;;eAEEA,iCAA0B;;;eAKnBG,2BAAmB;;;eAAEC,0BAAkB;;;eAJ9CH,0CAAmC;;;eACnCC,qCAA8B;;;uBACzB,gCAAuB;wBAE0B,iCAAwB"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fluentui/react-virtualizer",
3
- "version": "9.0.0-alpha.99",
3
+ "version": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
4
4
  "description": "Generic and composable virtualizer framework built on browser intersection observer",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
@@ -11,45 +11,39 @@
11
11
  "url": "https://github.com/microsoft/fluentui"
12
12
  },
13
13
  "license": "MIT",
14
- "devDependencies": {
15
- "@fluentui/eslint-plugin": "*",
16
- "@fluentui/react-conformance": "*",
17
- "@fluentui/react-conformance-griffel": "*",
18
- "@fluentui/scripts-api-extractor": "*"
19
- },
20
14
  "dependencies": {
21
- "@fluentui/react-jsx-runtime": "^9.1.1",
22
- "@fluentui/react-utilities": "^9.21.1",
23
- "@fluentui/react-shared-contexts": "^9.24.0",
24
- "@griffel/react": "^1.5.22",
15
+ "@fluentui/react-jsx-runtime": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
16
+ "@fluentui/react-utilities": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
17
+ "@fluentui/react-shared-contexts": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
18
+ "@griffel/react": "^1.5.32",
25
19
  "@swc/helpers": "^0.5.1"
26
20
  },
27
21
  "peerDependencies": {
28
- "@types/react": ">=16.14.0 <19.0.0",
29
- "@types/react-dom": ">=16.9.0 <19.0.0",
30
- "react": ">=16.14.0 <19.0.0",
31
- "react-dom": ">=16.14.0 <19.0.0"
32
- },
33
- "beachball": {
34
- "disallowedChangeTypes": [
35
- "major",
36
- "minor",
37
- "patch"
38
- ]
22
+ "@types/react": ">=16.14.0 <20.0.0",
23
+ "@types/react-dom": ">=16.9.0 <20.0.0",
24
+ "react": ">=16.14.0 <20.0.0",
25
+ "react-dom": ">=16.14.0 <20.0.0"
39
26
  },
27
+ "beachball": {},
40
28
  "exports": {
41
29
  ".": {
42
- "types": "./dist/index.d.ts",
43
- "node": "./lib-commonjs/index.js",
44
- "import": "./lib/index.js",
45
- "require": "./lib-commonjs/index.js"
30
+ "import": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./lib/index.js"
33
+ },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./lib-commonjs/index.cjs"
37
+ }
46
38
  },
47
39
  "./package.json": "./package.json"
48
40
  },
49
41
  "files": [
50
42
  "*.md",
51
43
  "dist/*.d.ts",
44
+ "dist/*.d.cts",
52
45
  "lib",
53
46
  "lib-commonjs"
54
- ]
47
+ ],
48
+ "type": "module"
55
49
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Virtualizer/Virtualizer.ts"],"sourcesContent":["import * as React from 'react';\nimport type { VirtualizerProps } from './Virtualizer.types';\nimport { useVirtualizerStyles_unstable } from './useVirtualizerStyles.styles';\nimport { useVirtualizer_unstable } from './useVirtualizer';\nimport { renderVirtualizer_unstable } from './renderVirtualizer';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Virtualizer pseudo-component, this functional wrapper\n * provides a simple interface for reducing the total number\n * of elements rendered at one time in large lists.\n */\nexport const Virtualizer: React.FC<VirtualizerProps> = (props: VirtualizerProps) => {\n const state = useVirtualizer_unstable(props);\n useVirtualizerStyles_unstable(state);\n useCustomStyleHook_unstable('useVirtualizerStyles_unstable')(state);\n\n return renderVirtualizer_unstable(state);\n};\n\nVirtualizer.displayName = 'Virtualizer';\n"],"names":["Virtualizer","props","state","useVirtualizer_unstable","useVirtualizerStyles_unstable","useCustomStyleHook_unstable","renderVirtualizer_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;4CAEuB;gCACN;mCACG;qCACC;AAOrC,MAAMA,cAA0C,CAACC;IACtD,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBF;IACtCG,IAAAA,yDAAAA,EAA8BF;IAC9BG,IAAAA,gDAAAA,EAA4B,iCAAiCH;IAE7D,OAAOI,IAAAA,6CAAAA,EAA2BJ;AACpC;AAEAF,YAAYO,WAAW,GAAG"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Virtualizer/Virtualizer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { VirtualizerContextProps } from '../../Utilities';\n\nexport type VirtualizerSlots = {\n /**\n * The intersection observed 'before' element will detect when scrolling towards the beginning.\n */\n before: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace at the beginning of current DOM children.\n */\n beforeContainer: NonNullable<Slot<'div', 'tr'>>;\n /**\n * The intersection observed 'after' element will detect when scrolling towards the end.\n */\n after: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace after the end of current DOM children.\n */\n afterContainer: NonNullable<Slot<'div', 'tr'>>;\n};\n\nexport type VirtualizerConfigState = {\n /**\n * The current virtualized array of children to show in the DOM.\n */\n virtualizedChildren: React.ReactNode[];\n /**\n * The current start index for the virtualizer, all previous index's will be removed from DOM.\n */\n virtualizerStartIndex: number;\n /**\n * Current buffer height required at beginning of array.\n */\n afterBufferHeight: number;\n /**\n * Current buffer height required at end of array.\n */\n beforeBufferHeight: number;\n /**\n * The total current height of the scrollView/child content.\n */\n totalVirtualizerHeight: number;\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n */\n reversed?: boolean;\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n /**\n * Pixel size of intersection observers and how much they 'cross over' into the bufferItems index.\n * Minimum 1px.\n */\n bufferSize: number;\n /**\n * Ref for access to internal size knowledge, can be used to measure updates\n */\n childSizes: React.MutableRefObject<number[]>;\n /**\n * Ref for access to internal progressive size knowledge, can be used to measure updates\n */\n childProgressiveSizes: React.MutableRefObject<number[]>;\n};\n\nexport type VirtualizerState = ComponentState<VirtualizerSlots> & VirtualizerConfigState;\n\n/**\n * The main child render method of Virtualization\n * isScrolling will only be enabled when enableScrollLoad is set to true.\n */\nexport type VirtualizerChildRenderFunction = (index: number, isScrolling: boolean) => React.ReactNode;\n\nexport type VirtualizerDataRef = {\n progressiveSizes: React.RefObject<number[]>;\n nodeSizes: React.RefObject<number[]>;\n setFlaggedIndex: (index: number | null) => void;\n currentIndex: React.RefObject<number>;\n};\n\nexport type VirtualizerConfigProps = {\n /**\n * Child render function.\n * Iteratively called to return current virtualizer DOM children.\n * Will act as a row or column indexer depending on Virtualizer settings.\n * Can be used dynamically.\n */\n children: VirtualizerChildRenderFunction;\n\n /**\n * Default cell size to use if no custom callback provided.\n * If implementing `getItemSize` this should be the initial and ideally minimum cell size.\n */\n itemSize: number;\n\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\n\n /**\n * Number of children to render in the DOM during virtualization.\n * Constraints:\n * - Large enough that the items rendered in DOM cover the viewport\n * and intersection observer buffers (buffersize) at both ends.\n */\n virtualizerLength: number;\n\n /**\n * Defaults to 1/4th (or 1/3rd for dynamic items) of virtualizerLength.\n * RECOMMEND: Override this with a consistent value if using a dynamic virtualizer.\n *\n * Controls the number of elements rendered before the current index entering the virtualized viewport.\n * Constraints:\n * - Large enough to cover bufferSize (prevents buffers intersecting into the viewport during rest state).\n * - Small enough that the virtualizer only renders a few items outside of view.\n */\n bufferItems?: number;\n\n /**\n * Defaults to half of bufferItems * itemSize size (in pixels).\n * RECOMMEND: Override this with a consistent minimum item size value if using a dynamic virtualizer.\n * The length (in pixels) before the end/start DOM index where the virtualizer recalculation will be triggered.\n * Increasing this reduces whitespace on ultra-fast scroll, as additional elements\n * are buffered to appear while virtualization recalculates.\n * Constraints:\n * - At least 1px - although this will only trigger the recalculation after bookends (whitespace) enter viewport.\n * - BufferSize must be smaller than bufferItems pixel size, as it prevents bookends entering viewport at rest.\n */\n bufferSize?: number;\n\n /**\n * Enables users to override the intersectionObserverRoot.\n * We recommend passing this in for accurate distance assessment in IO\n */\n scrollViewRef?: React.MutableRefObject<HTMLElement | null>;\n\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n * This value should be flipped in RTL implementation (TBD whether automate RTL).\n */\n reversed?: boolean;\n\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n\n /**\n * Callback for acquiring size of individual items\n * @param index - the index of the requested size's child\n */\n getItemSize?: (index: number) => number;\n\n /**\n * Virtualizer context can be passed as a prop for extended class use\n */\n virtualizerContext?: VirtualizerContextProps;\n\n /**\n * Callback for notifying when a flagged index has been rendered\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onRenderedFlaggedIndex?: (index: number) => void;\n\n /*\n * Callback for notifying when a flagged index has been rendered\n */\n flaggedIndex?: React.MutableRefObject<number | null>;\n\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeVirtualizerRef?: React.RefObject<VirtualizerDataRef>;\n\n /**\n * A ref that provides the size of container (vertical - height, horizontal - width), set by a resize observer.\n * Virtualizer Measure hooks provide a suitable reference.\n */\n containerSizeRef: React.RefObject<number>;\n\n /**\n * A callback that enables updating scroll position for calculating required dynamic lengths,\n * this should be passed in from useDynamicVirtualizerMeasure\n */\n updateScrollPosition?: (position: number) => void;\n\n /**\n * Spacing between rendered children for calculation, should match the container's gap CSS value.\n */\n gap?: number;\n};\n\nexport type VirtualizerProps = ComponentProps<Partial<VirtualizerSlots>> & VirtualizerConfigProps;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Virtualizer/renderVirtualizer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport type { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\n\nimport { assertSlots } from '@fluentui/react-utilities';\n\nexport const renderVirtualizer_unstable = (state: VirtualizerState) => {\n assertSlots<VirtualizerSlots>(state);\n return (\n <React.Fragment>\n {/* The 'before' bookend to hold items in place and detect scroll previous */}\n <state.beforeContainer>\n <state.before />\n </state.beforeContainer>\n {/* The reduced list of non-virtualized children to be rendered */}\n {state.virtualizedChildren}\n {/* The 'after' bookend to hold items in place and detect scroll next */}\n <state.afterContainer>\n <state.after />\n </state.afterContainer>\n </React.Fragment>\n );\n};\n\nexport const renderVirtualizerChildPlaceholder = (child: React.ReactNode, index: number) => {\n return (\n <React.Suspense key={`fui-virtualizer-placeholder-${index}`} fallback={null}>\n {child}\n </React.Suspense>\n );\n};\n"],"names":["renderVirtualizerChildPlaceholder","renderVirtualizer_unstable","state","assertSlots","_jsxs","React","Fragment","_jsx","beforeContainer","before","virtualizedChildren","afterContainer","after","child","index","Suspense","fallback"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA0BaA,iCAAAA;eAAAA;;IAlBAC,0BAAAA;eAAAA;;;;4BAPb;iEAEuB;gCAGK;AAErB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAC9B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACC,OAAMC,QAAQ,EAAA;;0BAEbC,IAAAA,eAAA,EAACL,MAAMM,eAAe,EAAA;0BACpB,WAAA,GAAAD,IAAAA,eAAA,EAACL,MAAMO,MAAM,EAAA,CAAA;;YAGdP,MAAMQ,mBAAmB;0BAE1BH,IAAAA,eAAA,EAACL,MAAMS,cAAc,EAAA;0BACnB,WAAA,GAAAJ,IAAAA,eAAA,EAACL,MAAMU,KAAK,EAAA,CAAA;;;;AAIpB;AAEO,MAAMZ,oCAAoC,CAACa,OAAwBC;IACxE,OAAA,WAAA,GACEP,IAAAA,eAAA,EAACF,OAAMU,QAAQ,EAAA;QAA8CC,UAAU;kBACpEH;OADkB,CAAC,4BAA4B,EAAEC,MAAM,CAAC;AAI/D"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Virtualizer/useVirtualizer.ts"],"sourcesContent":["import * as React from 'react';\nimport type { VirtualizerProps, VirtualizerState } from './Virtualizer.types';\n\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { useVirtualizerContextState_unstable } from '../../Utilities';\nimport { slot, useTimeout } from '@fluentui/react-utilities';\nimport { flushSync } from 'react-dom';\n\nexport function useVirtualizer_unstable(props: VirtualizerProps): VirtualizerState {\n 'use no memo';\n\n const {\n itemSize,\n numItems,\n virtualizerLength,\n children: renderChild,\n getItemSize,\n bufferItems = Math.round(virtualizerLength / 4.0),\n bufferSize = Math.floor(bufferItems / 2.0) * itemSize,\n axis = 'vertical',\n reversed = false,\n virtualizerContext,\n onRenderedFlaggedIndex,\n imperativeVirtualizerRef,\n containerSizeRef,\n scrollViewRef,\n enableScrollLoad,\n updateScrollPosition,\n gap = 0,\n } = props;\n\n /* The context is optional, it's useful for injecting additional index logic, or performing uniform state updates*/\n const _virtualizerContext = useVirtualizerContextState_unstable(virtualizerContext);\n\n // We use this ref as a constant source to access the virtualizer's state imperatively\n const actualIndexRef = React.useRef<number>(_virtualizerContext.contextIndex);\n\n const flaggedIndex = React.useRef<number | null>(null);\n const actualIndex = _virtualizerContext.contextIndex;\n\n // Just in case our ref gets out of date vs the context during a re-render\n if (_virtualizerContext.contextIndex !== actualIndexRef.current) {\n actualIndexRef.current = _virtualizerContext.contextIndex;\n }\n const setActualIndex = React.useCallback(\n (index: number) => {\n actualIndexRef.current = index;\n _virtualizerContext.setContextIndex(index);\n },\n [_virtualizerContext],\n );\n\n // Store ref to before padding element\n const beforeElementRef = React.useRef<HTMLElement | null>(null);\n\n // Store ref to before padding element\n const afterElementRef = React.useRef<HTMLElement | null>(null);\n\n // We need to store an array to track dynamic sizes, we can use this to incrementally update changes\n const childSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n\n /* We keep track of the progressive sizing/placement down the list,\n this helps us skip re-calculations unless children/size changes */\n const childProgressiveSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n if (virtualizerContext?.childProgressiveSizes) {\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n\n // The internal tracking REF for child array (updates often).\n const childArray = React.useRef<React.ReactNode[]>(new Array(virtualizerLength));\n\n const populateSizeArrays = () => {\n if (!getItemSize) {\n // Static sizes, never mind!\n return;\n }\n\n if (numItems !== childSizes.current.length) {\n childSizes.current = new Array<number>(numItems);\n }\n\n if (numItems !== childProgressiveSizes.current.length) {\n childProgressiveSizes.current = new Array<number>(numItems);\n if (virtualizerContext?.childProgressiveSizes) {\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n }\n\n for (let index = 0; index < numItems; index++) {\n const _gap = index < numItems - 1 ? gap : 0;\n childSizes.current[index] = getItemSize(index) + _gap;\n if (index === 0) {\n childProgressiveSizes.current[index] = childSizes.current[index];\n } else {\n childProgressiveSizes.current[index] = childProgressiveSizes.current[index - 1] + childSizes.current[index];\n }\n }\n };\n\n const [isScrolling, setIsScrolling] = React.useState<boolean>(false);\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const scrollCounter = React.useRef<number>(0);\n\n const initializeScrollingTimer = React.useCallback(() => {\n if (!enableScrollLoad) {\n // Disabled by default for reduction of render callbacks\n setIsScrolling(false);\n clearScrollTimer();\n return;\n }\n /*\n * This can be considered the 'velocity' required to start 'isScrolling'\n * INIT_SCROLL_FLAG_REQ: Number of renders required to activate isScrolling\n * INIT_SCROLL_FLAG_DELAY: Amount of time (ms) before current number of renders is reset\n * - Maybe we should let users customize these in the future.\n */\n const INIT_SCROLL_FLAG_REQ = 10;\n const INIT_SCROLL_FLAG_DELAY = 100;\n\n scrollCounter.current++;\n if (scrollCounter.current >= INIT_SCROLL_FLAG_REQ) {\n setIsScrolling(true);\n }\n clearScrollTimer();\n setScrollTimer(() => {\n setIsScrolling(false);\n scrollCounter.current = 0;\n }, INIT_SCROLL_FLAG_DELAY);\n }, [clearScrollTimer, setScrollTimer, enableScrollLoad]);\n\n React.useEffect(() => {\n initializeScrollingTimer();\n }, [actualIndex, initializeScrollingTimer]);\n\n const updateChildRows = React.useCallback(\n (newIndex: number) => {\n if (numItems === 0) {\n /* Nothing to virtualize */\n return;\n }\n\n /*\n We reset the array every time to ensure children are re-rendered\n This function should only be called when update is nessecary\n */\n childArray.current = new Array(virtualizerLength);\n const _actualIndex = Math.max(newIndex, 0);\n const end = Math.min(_actualIndex + virtualizerLength, numItems);\n for (let i = _actualIndex; i < end; i++) {\n childArray.current[i - _actualIndex] = renderChild(i, isScrolling);\n }\n },\n [isScrolling, numItems, renderChild, virtualizerLength],\n );\n\n const updateCurrentItemSizes = React.useCallback(\n (newIndex: number) => {\n if (!getItemSize) {\n // Static sizes, not required.\n return;\n }\n // We should always call our size function on index change (only for the items that will be rendered)\n // This ensures we request the latest data for incoming items in case sizing has changed.\n const endIndex = Math.min(newIndex + virtualizerLength, numItems);\n const startIndex = Math.max(newIndex, 0);\n\n let didUpdate = false;\n for (let i = startIndex; i < endIndex; i++) {\n const _gap = i < numItems - 1 ? gap : 0;\n const newSize = getItemSize(i) + _gap;\n if (newSize !== childSizes.current[i]) {\n childSizes.current[i] = newSize;\n didUpdate = true;\n }\n }\n\n if (didUpdate) {\n // Update our progressive size array\n for (let i = startIndex; i < numItems; i++) {\n const prevSize = i > 0 ? childProgressiveSizes.current[i - 1] : 0;\n childProgressiveSizes.current[i] = prevSize + childSizes.current[i];\n }\n }\n },\n [getItemSize, numItems, virtualizerLength, gap],\n );\n\n const batchUpdateNewIndex = React.useCallback(\n (index: number) => {\n // Local updates\n updateChildRows(index);\n updateCurrentItemSizes(index);\n\n // State setters\n setActualIndex(index);\n },\n [setActualIndex, updateChildRows, updateCurrentItemSizes],\n );\n\n const findIndexRecursive = React.useCallback(\n (scrollPos: number, lowIndex: number, highIndex: number): number => {\n if (lowIndex > highIndex) {\n // We shouldn't get here - but no-op the index if we do.\n return actualIndex;\n }\n const midpoint = Math.floor((lowIndex + highIndex) / 2);\n const iBefore = Math.max(midpoint - 1, 0);\n const iAfter = Math.min(midpoint + 1, childProgressiveSizes.current.length - 1);\n const indexValue = childProgressiveSizes.current[midpoint];\n const afterIndexValue = childProgressiveSizes.current[iAfter];\n const beforeIndexValue = childProgressiveSizes.current[iBefore];\n if (scrollPos <= afterIndexValue && scrollPos >= beforeIndexValue) {\n /* We've found our index - if we are exactly matching before/after index that's ok,\n better to reduce checks if it's right on the boundary. */\n return midpoint;\n }\n\n if (indexValue > scrollPos) {\n return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);\n } else {\n return findIndexRecursive(scrollPos, midpoint + 1, highIndex);\n }\n },\n [actualIndex],\n );\n\n const getIndexFromSizeArray = React.useCallback(\n (scrollPos: number): number => {\n /* Quick searches our progressive height array */\n if (\n scrollPos === 0 ||\n childProgressiveSizes.current.length === 0 ||\n scrollPos <= childProgressiveSizes.current[0]\n ) {\n // Check start\n return 0;\n }\n\n if (scrollPos >= childProgressiveSizes.current[childProgressiveSizes.current.length - 1]) {\n // Check end\n return childProgressiveSizes.current.length - 1;\n }\n\n return findIndexRecursive(scrollPos, 0, childProgressiveSizes.current.length - 1);\n },\n [findIndexRecursive],\n );\n const getIndexFromScrollPosition = React.useCallback(\n (scrollPos: number) => {\n if (!getItemSize) {\n return Math.round(scrollPos / (itemSize + gap));\n }\n\n return getIndexFromSizeArray(scrollPos);\n },\n [getIndexFromSizeArray, getItemSize, itemSize, gap],\n );\n\n const calculateTotalSize = React.useCallback(() => {\n if (!getItemSize) {\n return (itemSize + gap) * numItems;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1];\n }, [getItemSize, itemSize, numItems, gap]);\n\n const calculateBefore = React.useCallback(() => {\n const currentIndex = Math.min(actualIndex, numItems - 1);\n\n if (!getItemSize) {\n // The missing items from before virtualization starts height\n return currentIndex * (itemSize + gap);\n }\n\n if (currentIndex <= 0) {\n return 0;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[currentIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, gap]);\n\n const calculateAfter = React.useCallback(() => {\n if (numItems === 0 || actualIndex + virtualizerLength >= numItems) {\n return 0;\n }\n\n const lastItemIndex = Math.min(actualIndex + virtualizerLength, numItems);\n if (!getItemSize) {\n // The missing items from after virtualization ends height\n const remainingItems = numItems - lastItemIndex;\n return remainingItems * (itemSize + gap) - gap;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, virtualizerLength, gap]);\n\n // Observe intersections of virtualized components\n const { setObserverList } = useIntersectionObserver(\n React.useCallback(\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n /* Sanity check - do we even need virtualization? */\n if (virtualizerLength > numItems) {\n if (actualIndex !== 0) {\n batchUpdateNewIndex(0);\n }\n // No-op\n return;\n }\n\n if (entries.length === 0) {\n // No entries found, return.\n return;\n }\n // Find the latest entry that is intersecting\n const sortedEntries = entries.sort((entry1, entry2) => entry2.time - entry1.time);\n const latestEntry = sortedEntries.find(entry => {\n return entry.isIntersecting;\n });\n\n if (!latestEntry) {\n return;\n }\n\n // We have to be sure our item sizes are up to date with current indexed ref before calculation\n // Check if we still need\n updateCurrentItemSizes(actualIndexRef.current);\n\n const calculateOverBuffer = (): number => {\n /**\n * We avoid using the scroll ref scrollTop, it may be incorrect\n * as virtualization may exist within a scroll view with other elements\n * The benefit of using IO is that we can detect relative scrolls,\n * so any items can be placed around the virtualizer in the scroll view\n */\n let measurementPos = 0;\n if (latestEntry.target === afterElementRef.current) {\n // Get after buffers position\n measurementPos = calculateTotalSize() - calculateAfter();\n\n // Get exact intersection position based on overflow size (how far into IO did we scroll?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n // Add to original after position\n measurementPos += overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos -= bufferSize;\n // we hit the after buffer and detected the end of view, we need to find the start index.\n measurementPos -= containerSizeRef.current ?? 0;\n\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const hOverflowReversed = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const wOverflow = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const wOverflowReversed = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n } else if (latestEntry.target === beforeElementRef.current) {\n // Get before buffers position\n measurementPos = calculateBefore();\n\n // Get exact intersection position based on overflow size (how far into window did we scroll IO?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n\n // Minus from original before position\n measurementPos -= overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos += bufferSize;\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const hOverflowReversed = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const wOverflow = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const wOverflowReversed = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n }\n\n return measurementPos;\n };\n\n // Get exact relative 'scrollTop' via IO values\n const measurementPos = calculateOverBuffer();\n\n const maxIndex = Math.max(numItems - virtualizerLength, 0);\n\n const startIndex = getIndexFromScrollPosition(measurementPos) - bufferItems;\n\n // Safety limits\n const newStartIndex = Math.min(Math.max(startIndex, 0), maxIndex);\n flushSync(() => {\n // Callback to allow measure functions to check virtualizer length\n if (newStartIndex + virtualizerLength >= numItems && actualIndex + virtualizerLength >= numItems) {\n // We've already hit the end, no need to update state.\n return;\n }\n updateScrollPosition?.(measurementPos);\n if (actualIndex !== newStartIndex) {\n batchUpdateNewIndex(newStartIndex);\n }\n });\n },\n [\n actualIndex,\n virtualizerLength,\n axis,\n reversed,\n numItems,\n bufferSize,\n bufferItems,\n containerSizeRef,\n updateScrollPosition,\n batchUpdateNewIndex,\n calculateAfter,\n calculateBefore,\n calculateTotalSize,\n getIndexFromScrollPosition,\n updateCurrentItemSizes,\n ],\n ),\n {\n root: scrollViewRef ? scrollViewRef?.current : null,\n rootMargin: '0px',\n threshold: 0,\n },\n );\n\n const setBeforeRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || beforeElementRef.current === element) {\n return;\n }\n beforeElementRef.current = element;\n const newList = [];\n\n newList.push(beforeElementRef.current);\n\n if (afterElementRef.current) {\n newList.push(afterElementRef.current);\n }\n\n // Ensure we update array if before element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n const setAfterRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || afterElementRef.current === element) {\n return;\n }\n afterElementRef.current = element;\n const newList = [];\n\n if (beforeElementRef.current) {\n newList.push(beforeElementRef.current);\n }\n\n newList.push(afterElementRef.current);\n\n // Ensure we update array if after element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n // Initialize the size array before first render.\n const hasInitialized = React.useRef<boolean>(false);\n const initializeSizeArray = () => {\n if (hasInitialized.current === false) {\n hasInitialized.current = true;\n populateSizeArrays();\n }\n };\n\n React.useImperativeHandle(\n imperativeVirtualizerRef,\n () => {\n return {\n progressiveSizes: childProgressiveSizes,\n nodeSizes: childSizes,\n setFlaggedIndex: (index: number | null) => (flaggedIndex.current = index),\n currentIndex: actualIndexRef,\n };\n },\n [childProgressiveSizes, childSizes],\n );\n\n // Initialization on mount - update array index to 0 (ready state).\n // Only fire on mount (no deps).\n React.useEffect(() => {\n if (actualIndex < 0) {\n batchUpdateNewIndex(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /*\n * forceUpdate:\n * We only want to trigger this when child render or scroll loading changes,\n * it will force re-render all children elements\n */\n const forceUpdate = React.useReducer(() => ({}), {})[1];\n // If the user passes in an updated renderChild function - update current children\n React.useEffect(() => {\n if (actualIndex >= 0) {\n updateChildRows(actualIndex);\n forceUpdate();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [renderChild, isScrolling]);\n\n React.useEffect(() => {\n // Ensure we repopulate if getItemSize callback changes\n populateSizeArrays();\n\n // We only run this effect on getItemSize change (recalc dynamic sizes)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getItemSize, gap]);\n\n // Effect to check flag index on updates\n React.useEffect(() => {\n if (!onRenderedFlaggedIndex || flaggedIndex.current === null) {\n return;\n }\n if (actualIndex <= flaggedIndex.current && actualIndex + virtualizerLength >= flaggedIndex.current) {\n onRenderedFlaggedIndex(flaggedIndex.current);\n flaggedIndex.current = null;\n }\n }, [actualIndex, onRenderedFlaggedIndex, virtualizerLength]);\n\n // Ensure we have run through and updated the whole size list array at least once.\n initializeSizeArray();\n\n if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {\n // Child length mismatch, repopulate size arrays.\n populateSizeArrays();\n }\n\n // Ensure we recalc if virtualizer length changes\n const maxCompare = Math.min(virtualizerLength, numItems);\n if (childArray.current.length !== maxCompare && actualIndex + childArray.current.length < numItems) {\n updateChildRows(actualIndex);\n }\n\n const isFullyInitialized = hasInitialized.current && actualIndex >= 0;\n return {\n components: {\n before: 'div',\n after: 'div',\n beforeContainer: 'div',\n afterContainer: 'div',\n },\n virtualizedChildren: childArray.current,\n before: slot.always(props.before, {\n defaultProps: {\n ref: setBeforeRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n after: slot.always(props.after, {\n defaultProps: {\n ref: setAfterRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeContainer: slot.always(props.beforeContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n afterContainer: slot.always(props.afterContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeBufferHeight: isFullyInitialized ? calculateBefore() : 0,\n afterBufferHeight: isFullyInitialized ? calculateAfter() : 0,\n totalVirtualizerHeight: isFullyInitialized ? calculateTotalSize() : virtualizerLength * itemSize,\n virtualizerStartIndex: actualIndex,\n axis,\n bufferSize,\n reversed,\n childSizes,\n childProgressiveSizes,\n };\n}\n"],"names":["useVirtualizer_unstable","props","itemSize","numItems","virtualizerLength","children","renderChild","getItemSize","bufferItems","Math","round","bufferSize","floor","axis","reversed","virtualizerContext","onRenderedFlaggedIndex","imperativeVirtualizerRef","containerSizeRef","scrollViewRef","enableScrollLoad","updateScrollPosition","gap","_virtualizerContext","useVirtualizerContextState_unstable","actualIndexRef","React","useRef","contextIndex","flaggedIndex","actualIndex","current","setActualIndex","useCallback","index","setContextIndex","beforeElementRef","afterElementRef","childSizes","Array","childProgressiveSizes","childArray","populateSizeArrays","length","_gap","isScrolling","setIsScrolling","useState","setScrollTimer","clearScrollTimer","useTimeout","scrollCounter","initializeScrollingTimer","INIT_SCROLL_FLAG_REQ","INIT_SCROLL_FLAG_DELAY","useEffect","updateChildRows","newIndex","_actualIndex","max","end","min","i","updateCurrentItemSizes","endIndex","startIndex","didUpdate","newSize","prevSize","batchUpdateNewIndex","findIndexRecursive","scrollPos","lowIndex","highIndex","midpoint","iBefore","iAfter","indexValue","afterIndexValue","beforeIndexValue","getIndexFromSizeArray","getIndexFromScrollPosition","calculateTotalSize","calculateBefore","currentIndex","calculateAfter","lastItemIndex","remainingItems","setObserverList","useIntersectionObserver","entries","observer","sortedEntries","sort","entry1","entry2","time","latestEntry","find","entry","isIntersecting","calculateOverBuffer","measurementPos","target","overflowAmount","intersectionRect","height","width","hOverflow","boundingClientRect","top","hOverflowReversed","bottom","wOverflow","left","wOverflowReversed","right","widthOverflow","heightOverflow","additionalOverflow","maxIndex","newStartIndex","flushSync","root","rootMargin","threshold","setBeforeRef","element","newList","push","setAfterRef","hasInitialized","initializeSizeArray","useImperativeHandle","progressiveSizes","nodeSizes","setFlaggedIndex","forceUpdate","useReducer","maxCompare","isFullyInitialized","components","before","after","beforeContainer","afterContainer","virtualizedChildren","slot","always","defaultProps","ref","role","elementType","beforeBufferHeight","afterBufferHeight","totalVirtualizerHeight","virtualizerStartIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;yCAGiB;2BACY;gCACnB;0BACP;AAEnB,SAASA,wBAAwBC,KAAuB;IAC7D;IAEA,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACRC,iBAAiB,EACjBC,UAAUC,WAAW,EACrBC,WAAW,EACXC,cAAcC,KAAKC,KAAK,CAACN,oBAAoB,IAAI,EACjDO,aAAaF,KAAKG,KAAK,CAACJ,cAAc,OAAON,QAAQ,EACrDW,OAAO,U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gB;QAClB;QACAC,qBAAqBzG,WAAWV,OAAO;QACvC+G,QAAQK,oBAAAA,CAAKC,MAAM,CAACnJ,MAAM6I,MAAM,EAAE;YAChCO,cAAc;gBACZC,KAAKxB;gBACLyB,MAAM;YACR;YACAC,aAAa;QACf;QACAT,OAAOI,oBAAAA,CAAKC,MAAM,CAACnJ,MAAM8I,KAAK,EAAE;YAC9BM,cAAc;gBACZC,KAAKpB;gBACLqB,MAAM;YACR;YACAC,aAAa;QACf;QACAR,iBAAiBG,oBAAAA,CAAKC,MAAM,CAACnJ,MAAM+I,eAAe,EAAE;YAClDK,cAAc;gBACZE,MAAM;YACR;YACAC,aAAa;QACf;QACAP,gBAAgBE,oBAAAA,CAAKC,MAAM,CAACnJ,MAAMgJ,cAAc,EAAE;YAChDI,cAAc;gBACZE,MAAM;YACR;YACAC,aAAa;QACf;QACAC,oBAAoBb,qBAAqBzD,oBAAoB;QAC7DuE,mBAAmBd,qBAAqBvD,mBAAmB;QAC3DsE,wBAAwBf,qBAAqB1D,uBAAuB9E,oBAAoBF;QACxF0J,uBAAuB9H;QACvBjB;QACAF;QACAG;QACAwB;QACAE;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useVirtualizerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nconst virtualizerClassName = 'fui-Virtualizer';\nexport const virtualizerClassNames = {\n before: `${virtualizerClassName}__before`,\n beforeContainer: `${virtualizerClassName}__beforeContainer`,\n after: `${virtualizerClassName}__after`,\n afterContainer: `${virtualizerClassName}__afterContainer`\n};\nconst useStyles = makeStyles({\n base: {\n display: 'block',\n pointerEvents: 'none'\n },\n relative: {\n position: 'relative'\n },\n horizontal: {\n minHeight: '100%'\n },\n vertical: {\n minWidth: '100%'\n }\n});\n/**\n * Apply styling to the Virtualizer states\n */ export const useVirtualizerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const { reversed, axis, beforeBufferHeight, afterBufferHeight, bufferSize } = state;\n const horizontal = axis === 'horizontal';\n state.before.className = mergeClasses(virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);\n state.after.className = mergeClasses(virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);\n state.beforeContainer.className = mergeClasses(virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);\n state.afterContainer.className = mergeClasses(virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);\n const beforeHeightPx = beforeBufferHeight + 'px';\n const afterHeightPx = afterBufferHeight + 'px';\n const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';\n const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';\n const bufferPx = bufferSize + 'px';\n const beforeBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginRight: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n }\n };\n const afterBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginRight: `-${bufferPx}`\n }\n };\n state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style\n };\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style\n };\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style\n };\n state.afterContainer.style = {\n height: horizontal ? 'auto' : afterHeightPx,\n width: horizontal ? afterHeightPx : 'auto',\n ...state.afterContainer.style\n };\n return state;\n};\n"],"names":["useVirtualizerStyles_unstable","virtualizerClassNames","virtualizerClassName","before","beforeContainer","after","afterContainer","useStyles","__styles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","mergeClasses","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAyBiBA,6BAA6B;eAA7BA;;IAvBJC,qBAAqB;eAArBA;;;uBAF4B;AACzC,MAAMC,uBAAuB;AACtB,MAAMD,wBAAwB;IACjCE,QAAQ,CAAA,EAAGD,qBAAoB,QAAA,CAAU;IACzCE,iBAAiB,CAAA,EAAGF,qBAAoB,iBAAA,CAAmB;IAC3DG,OAAO,CAAA,EAAGH,qBAAoB,OAAA,CAAS;IACvCI,gBAAgB,CAAA,EAAGJ,qBAAoB,gBAAA,CAAA;AAC3C;AACA,MAAMK,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,MAAA;QAAAC,QAAA;QAAAC,SAAA;IAAA;IAAAC,UAAA;QAAAC,QAAA;IAAA;IAAAC,YAAA;QAAAC,QAAA;IAAA;IAAAC,UAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAiBP,MAAMlB,gCAAiCmB,CAAAA;I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IACApB,MAAMb,cAAc,CAACiC,KAAK,GAAG;QACzBC,QAAQ1B,aAAa,SAASe;QAC9BY,OAAO3B,aAAae,gBAAgB;QACpC,GAAGV,MAAMb,cAAc,CAACiC,KAAAA;IAC5B;IACA,OAAOpB;AACX"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.ts"],"sourcesContent":["import type { VirtualizerScrollViewProps } from './VirtualizerScrollView.types';\nimport { useVirtualizerScrollView_unstable } from './useVirtualizerScrollView';\nimport { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';\nimport { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles.styles';\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Virtualizer ScrollView\n */\n\nexport const VirtualizerScrollView: React.FC<VirtualizerScrollViewProps> = (props: VirtualizerScrollViewProps) => {\n const state = useVirtualizerScrollView_unstable(props);\n\n useVirtualizerScrollViewStyles_unstable(state);\n useCustomStyleHook_unstable('useVirtualizerScrollViewStyles_unstable')(state);\n\n return renderVirtualizerScrollView_unstable(state);\n};\n\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n"],"names":["VirtualizerScrollView","props","state","useVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","useCustomStyleHook_unstable","renderVirtualizerScrollView_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;0CAVqC;6CACG;sDACG;iEACjC;qCACqB;AAMrC,MAAMA,wBAA8D,CAACC;IAC1E,MAAMC,QAAQC,IAAAA,2DAAAA,EAAkCF;IAEhDG,IAAAA,6EAAAA,EAAwCF;IACxCG,IAAAA,gDAAAA,EAA4B,2CAA2CH;IAEvE,OAAOI,IAAAA,iEAAAA,EAAqCJ;AAC9C;AAEAF,sBAAsBO,WAAW,GAAG"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type {\n VirtualizerSlots,\n VirtualizerConfigProps,\n VirtualizerConfigState,\n VirtualizerChildRenderFunction,\n} from '../Virtualizer/Virtualizer.types';\nimport type { ScrollToInterface } from '../../Utilities';\n\nexport type VirtualizerScrollViewSlots = VirtualizerSlots & {\n /**\n * The root container that provides embedded scrolling.\n */\n container: NonNullable<Slot<'div'>>;\n};\n\nexport type VirtualizerScrollViewProps = ComponentProps<Partial<VirtualizerScrollViewSlots>> &\n Partial<\n Omit<\n VirtualizerConfigProps,\n 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex' | 'imperativeVirtualizerRef'\n >\n > & {\n /**\n * Virtualizer item size in pixels - static.\n * Axis: 'vertical' = Height\n * Axis: 'horizontal' = Width\n */\n itemSize: number;\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\n /**\n * Child render function.\n * Iteratively called to return current virtualizer DOM children.\n * Will act as a row or column indexer depending on Virtualizer settings.\n */\n children: VirtualizerChildRenderFunction;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeRef?: React.RefObject<ScrollToInterface>;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n enablePagination?: boolean;\n };\n\nexport type VirtualizerScrollViewState = ComponentState<VirtualizerScrollViewSlots> & VirtualizerConfigState;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/renderVirtualizerScrollView.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport type { VirtualizerScrollViewSlots, VirtualizerScrollViewState } from './VirtualizerScrollView.types';\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\n\nexport const renderVirtualizerScrollView_unstable = (state: VirtualizerScrollViewState) => {\n assertSlots<VirtualizerScrollViewSlots>(state);\n\n return <state.container>{renderVirtualizer_unstable(state)}</state.container>;\n};\n"],"names":["renderVirtualizerScrollView_unstable","state","assertSlots","_jsx","container","renderVirtualizer_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAI4B;mCACe;AAEpC,MAAMA,uCAAuC,CAACC;IACnDC,IAAAA,2BAAAA,EAAwCD;IAExC,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,SAAS,EAAA;kBAAEC,IAAAA,6CAAAA,EAA2BJ;;AACtD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/useVirtualizerScrollView.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport type { VirtualizerScrollViewProps, VirtualizerScrollViewState } from './VirtualizerScrollView.types';\nimport { useStaticVirtualizerMeasure } from '../../Hooks';\nimport { scrollToItemStatic } from '../../Utilities';\nimport type { VirtualizerDataRef } from '../Virtualizer/Virtualizer.types';\nimport { useStaticVirtualizerPagination } from '../../hooks/useStaticPagination';\n\nexport function useVirtualizerScrollView_unstable(props: VirtualizerScrollViewProps): VirtualizerScrollViewState {\n const { imperativeRef, itemSize, numItems, axis = 'vertical', reversed, enablePagination = false } = props;\n const { virtualizerLength, bufferItems, bufferSize, scrollRef, containerSizeRef } = useStaticVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: props.axis ?? 'vertical',\n });\n\n // Store the virtualizer length as a ref for imperative ref access\n const virtualizerLengthRef = React.useRef<number>(virtualizerLength);\n if (virtualizerLengthRef.current !== virtualizerLength) {\n virtualizerLengthRef.current = virtualizerLength;\n }\n\n const paginationRef = useStaticVirtualizerPagination({ axis, itemSize }, enablePagination);\n const scrollViewRef = useMergedRefs(props.scrollViewRef, scrollRef, paginationRef) as React.RefObject<HTMLDivElement>;\n const imperativeVirtualizerRef = React.useRef<VirtualizerDataRef | null>(null);\n const scrollCallbackRef = React.useRef<null | ((index: number) => void)>(null);\n\n React.useImperativeHandle(\n imperativeRef,\n () => {\n return {\n scrollTo(index: number, behavior = 'auto', callback: ((index: number) => void) | undefined) {\n scrollCallbackRef.current = callback ?? null;\n imperativeVirtualizerRef.current?.setFlaggedIndex(index);\n scrollToItemStatic({\n index,\n itemSize,\n totalItems: numItems,\n scrollViewRef,\n axis,\n reversed,\n behavior,\n });\n },\n currentIndex: imperativeVirtualizerRef.current?.currentIndex,\n virtualizerLength: virtualizerLengthRef,\n };\n },\n [axis, scrollViewRef, itemSize, numItems, reversed],\n );\n\n const handleRenderedIndex = (index: number) => {\n if (scrollCallbackRef.current) {\n scrollCallbackRef.current(index);\n }\n };\n\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n virtualizerLength,\n bufferItems,\n bufferSize,\n onRenderedFlaggedIndex: handleRenderedIndex,\n imperativeVirtualizerRef,\n containerSizeRef,\n });\n\n return {\n ...virtualizerState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...virtualizerState.components,\n container: 'div',\n },\n container: slot.always(props.container, {\n defaultProps: {\n ref: scrollViewRef as React.RefObject<HTMLDivElement>,\n },\n elementType: 'div',\n }),\n };\n}\n"],"names":["useVirtualizerScrollView_unstable","props","imperativeRef","itemSize","numItems","axis","reversed","enablePagination","virtualizerLength","bufferItems","bufferSize","scrollRef","containerSizeRef","useStaticVirtualizerMeasure","defaultItemSize","direction","virtualizerLengthRef","React","useRef","current","paginationRef","useStaticVirtualizerPagination","scrollViewRef","useMergedRefs","imperativeVirtualizerRef","scrollCallbackRef","useImperativeHandle","scrollTo","index","behavior","callback","setFlaggedIndex","scrollToItemStatic","totalItems","currentIndex","handleRenderedIndex","virtualizerState","useVirtualizer_unstable","onRenderedFlaggedIndex","components","container","slot","always","defaultProps","ref","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;;iEATO;gCACa;gCACI;uBAEI;2BACT;qCAEY;AAExC,SAASA,kCAAkCC,KAAiC;IACjF,MAAM,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,UAAU,EAAEC,QAAQ,EAAEC,mBAAmB,KAAK,EAAE,GAAGN;QAGxFA;IAFb,MAAM,EAAEO,iBAAiB,EAAEC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,gBAAgB,EAAE,GAAGC,IAAAA,kCAAAA,EAA4B;QAC9GC,iBAAiBb,MAAME,QAAQ;QAC/BY,WAAWd,CAAAA,cAAAA,MAAMI,IAAI,AAAJA,MAAI,QAAVJ,gBAAAA,KAAAA,IAAAA,cAAc;IAC3B;IAEA,kEAAkE;IAClE,MAAMe,uBAAuBC,OAAMC,MAAM,CAASV;IAClD,IAAIQ,qBAAqBG,OAAO,KAAKX,mBAAmB;QACtDQ,qBAAqBG,OAAO,GAAGX;IACjC;IAEA,MAAMY,gBAAgBC,IAAAA,mDAAAA,EAA+B;QAAEhB;QAAMF;IAAS,GAAGI;IACzE,MAAMe,gBAAgBC,IAAAA,6BAAAA,EAActB,MAAMqB,aAAa,EAAEX,WAAWS;IACpE,MAAMI,2BAA2BP,OAAMC,MAAM,CAA4B;IACzE,MAAMO,oBAAoBR,OAAMC,MAAM,CAAmC;IAEzED,OAAMS,mBAAmB,CACvBxB,eACA;YAekBsB;QAdhB,OAAO;YACLG,UAASC,KAA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