@astral/ui 4.105.0 → 4.107.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 (333) hide show
  1. package/components/ActionCellBase/ActionCellBase.js +10 -1
  2. package/components/ActionCellBase/MainAction/MainAction.js +6 -0
  3. package/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  4. package/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  5. package/components/ActionCellBase/MainAction/MainIconButton/constants.js +4 -0
  6. package/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  7. package/components/ActionCellBase/MainAction/MainIconButton/styles.js +9 -0
  8. package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  9. package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +17 -0
  10. package/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  11. package/components/ActionCellBase/MainAction/MobileMainButton/index.js +1 -0
  12. package/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  13. package/components/ActionCellBase/MainAction/MobileMainButton/styles.js +7 -0
  14. package/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  15. package/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  16. package/components/ActionCellBase/SecondaryAction/styles.js +9 -0
  17. package/components/ActionCellBase/constants.d.ts +4 -0
  18. package/components/ActionCellBase/constants.js +5 -0
  19. package/components/ActionCellBase/styles.js +11 -0
  20. package/components/ActionCellBase/types.d.ts +25 -0
  21. package/components/Autocomplete/Autocomplete.js +2 -3
  22. package/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  23. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  24. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  25. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  26. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  27. package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  28. package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +7 -4
  29. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  30. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  31. package/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  32. package/components/InfiniteTreeList/InfiniteTreeListItem/index.js +1 -0
  33. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  34. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +66 -2
  35. package/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  36. package/components/InfiniteTreeList/LevelHeader/LevelHeader.js +17 -0
  37. package/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  38. package/components/InfiniteTreeList/LevelHeader/constants.js +3 -0
  39. package/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  40. package/components/InfiniteTreeList/LevelHeader/index.js +2 -0
  41. package/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  42. package/components/InfiniteTreeList/LevelHeader/styles.js +51 -0
  43. package/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  44. package/components/InfiniteTreeList/LevelHeader/types.js +1 -0
  45. package/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  46. package/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  47. package/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  48. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  49. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  50. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  51. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  52. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +11 -0
  53. package/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  54. package/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  55. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  56. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +5 -4
  57. package/components/InfiniteTreeList/constants.d.ts +21 -0
  58. package/components/InfiniteTreeList/constants.js +21 -0
  59. package/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  60. package/components/InfiniteTreeList/hooks/index.js +2 -0
  61. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  62. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +2 -0
  63. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  64. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +1 -0
  65. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  66. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +48 -0
  67. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  68. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +3 -0
  69. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  70. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +2 -0
  71. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  72. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +1 -0
  73. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  74. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +42 -0
  75. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  76. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +2 -0
  77. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  78. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +1 -0
  79. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  80. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +27 -0
  81. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  82. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +2 -0
  83. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  84. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +1 -0
  85. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  86. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +39 -0
  87. package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  88. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  89. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +192 -28
  90. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  91. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +6 -0
  92. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  93. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +1 -0
  94. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  95. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +1 -0
  96. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  97. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +2 -0
  98. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  99. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +1 -0
  100. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  101. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +18 -0
  102. package/components/InfiniteTreeList/styles.d.ts +5 -0
  103. package/components/InfiniteTreeList/styles.js +41 -0
  104. package/components/InfiniteTreeList/types.d.ts +4 -0
  105. package/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  106. package/components/InfiniteTreeList/useLogic/useLogic.js +165 -27
  107. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  108. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +4 -0
  109. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  110. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +1 -0
  111. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  112. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +5 -0
  113. package/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  114. package/components/InfiniteTreeList/utils/checkHasNested/index.js +1 -0
  115. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  116. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  117. package/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  118. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  119. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +5 -0
  120. package/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  121. package/components/InfiniteTreeList/utils/getLevelKey/index.js +1 -0
  122. package/components/InfiniteTreeList/utils/index.d.ts +3 -0
  123. package/components/InfiniteTreeList/utils/index.js +3 -0
  124. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  125. package/components/Select/Select.js +4 -3
  126. package/components/Select/useLogic/useLogic.d.ts +11 -2
  127. package/components/Select/useLogic/useLogic.js +4 -1
  128. package/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
  129. package/components/TagsList/PopoverTags/PopoverTags.js +8 -0
  130. package/components/TagsList/PopoverTags/index.d.ts +2 -0
  131. package/components/TagsList/PopoverTags/index.js +2 -0
  132. package/components/TagsList/PopoverTags/styles.d.ts +8 -0
  133. package/components/TagsList/PopoverTags/styles.js +15 -0
  134. package/components/TagsList/PopoverTags/types.d.ts +24 -0
  135. package/components/TagsList/PopoverTags/types.js +1 -0
  136. package/components/TagsList/Tag/Tag.d.ts +9 -1
  137. package/components/TagsList/Tag/Tag.js +4 -3
  138. package/components/TagsList/TagsList.js +11 -5
  139. package/components/TagsList/constants.d.ts +35 -0
  140. package/components/TagsList/constants.js +35 -0
  141. package/components/TagsList/styles.d.ts +9 -1
  142. package/components/TagsList/styles.js +20 -1
  143. package/components/TagsList/types.d.ts +4 -0
  144. package/components/TagsList/useLogic/hooks/index.d.ts +1 -0
  145. package/components/TagsList/useLogic/hooks/index.js +1 -0
  146. package/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
  147. package/components/TagsList/useLogic/hooks/useHoverDelay/index.js +1 -0
  148. package/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
  149. package/components/TagsList/useLogic/hooks/useHoverDelay/types.js +1 -0
  150. package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
  151. package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +27 -0
  152. package/components/TagsList/useLogic/useLogic.d.ts +14 -2
  153. package/components/TagsList/useLogic/useLogic.js +84 -4
  154. package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
  155. package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +22 -0
  156. package/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
  157. package/components/TagsList/utils/calculatePopoverWidth/index.js +1 -0
  158. package/components/TagsList/utils/index.d.ts +1 -0
  159. package/components/TagsList/utils/index.js +1 -0
  160. package/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
  161. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
  162. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
  163. package/components/TreeLikeAutocomplete/Input/Input.js +2 -2
  164. package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
  165. package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
  166. package/components/useScrollManagement/useScrollManagement.js +7 -6
  167. package/node/components/ActionCellBase/ActionCellBase.js +10 -1
  168. package/node/components/ActionCellBase/MainAction/MainAction.js +6 -0
  169. package/node/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  170. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  171. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.js +7 -0
  172. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  173. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.js +12 -0
  174. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  175. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +21 -0
  176. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  177. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.js +17 -0
  178. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  179. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.js +10 -0
  180. package/node/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  181. package/node/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  182. package/node/components/ActionCellBase/SecondaryAction/styles.js +12 -0
  183. package/node/components/ActionCellBase/constants.d.ts +4 -0
  184. package/node/components/ActionCellBase/constants.js +8 -0
  185. package/node/components/ActionCellBase/styles.js +11 -0
  186. package/node/components/ActionCellBase/types.d.ts +25 -0
  187. package/node/components/Autocomplete/Autocomplete.js +2 -3
  188. package/node/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  189. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  190. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  191. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  192. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  193. package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  194. package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +6 -3
  195. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  196. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  197. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  198. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.js +3 -0
  199. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  200. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +67 -3
  201. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  202. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.js +21 -0
  203. package/node/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  204. package/node/components/InfiniteTreeList/LevelHeader/constants.js +6 -0
  205. package/node/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  206. package/node/components/InfiniteTreeList/LevelHeader/index.js +18 -0
  207. package/node/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  208. package/node/components/InfiniteTreeList/LevelHeader/styles.js +54 -0
  209. package/node/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  210. package/node/components/InfiniteTreeList/LevelHeader/types.js +2 -0
  211. package/node/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  212. package/node/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  213. package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  214. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  215. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  216. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  217. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  218. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +14 -0
  219. package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  220. package/node/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  221. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  222. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +4 -3
  223. package/node/components/InfiniteTreeList/constants.d.ts +21 -0
  224. package/node/components/InfiniteTreeList/constants.js +22 -1
  225. package/node/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  226. package/node/components/InfiniteTreeList/hooks/index.js +2 -0
  227. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  228. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +18 -0
  229. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  230. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +2 -0
  231. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  232. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +52 -0
  233. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  234. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +19 -0
  235. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  236. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +18 -0
  237. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  238. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +2 -0
  239. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  240. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +46 -0
  241. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  242. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +18 -0
  243. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  244. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +2 -0
  245. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  246. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +31 -0
  247. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  248. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +18 -0
  249. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  250. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +2 -0
  251. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  252. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +43 -0
  253. package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  254. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  255. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +190 -26
  256. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  257. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +10 -0
  258. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  259. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +17 -0
  260. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  261. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +17 -0
  262. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  263. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +18 -0
  264. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  265. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +2 -0
  266. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  267. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +22 -0
  268. package/node/components/InfiniteTreeList/styles.d.ts +5 -0
  269. package/node/components/InfiniteTreeList/styles.js +44 -0
  270. package/node/components/InfiniteTreeList/types.d.ts +4 -0
  271. package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  272. package/node/components/InfiniteTreeList/useLogic/useLogic.js +162 -24
  273. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  274. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +8 -0
  275. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  276. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +17 -0
  277. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  278. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +9 -0
  279. package/node/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  280. package/node/components/InfiniteTreeList/utils/checkHasNested/index.js +17 -0
  281. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  282. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  283. package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  284. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  285. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +9 -0
  286. package/node/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  287. package/node/components/InfiniteTreeList/utils/getLevelKey/index.js +17 -0
  288. package/node/components/InfiniteTreeList/utils/index.d.ts +3 -0
  289. package/node/components/InfiniteTreeList/utils/index.js +3 -0
  290. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  291. package/node/components/Select/Select.js +4 -3
  292. package/node/components/Select/useLogic/useLogic.d.ts +11 -2
  293. package/node/components/Select/useLogic/useLogic.js +4 -1
  294. package/node/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
  295. package/node/components/TagsList/PopoverTags/PopoverTags.js +12 -0
  296. package/node/components/TagsList/PopoverTags/index.d.ts +2 -0
  297. package/node/components/TagsList/PopoverTags/index.js +18 -0
  298. package/node/components/TagsList/PopoverTags/styles.d.ts +8 -0
  299. package/node/components/TagsList/PopoverTags/styles.js +18 -0
  300. package/node/components/TagsList/PopoverTags/types.d.ts +24 -0
  301. package/node/components/TagsList/PopoverTags/types.js +2 -0
  302. package/node/components/TagsList/Tag/Tag.d.ts +9 -1
  303. package/node/components/TagsList/Tag/Tag.js +4 -4
  304. package/node/components/TagsList/TagsList.js +10 -4
  305. package/node/components/TagsList/constants.d.ts +35 -0
  306. package/node/components/TagsList/constants.js +36 -1
  307. package/node/components/TagsList/styles.d.ts +9 -1
  308. package/node/components/TagsList/styles.js +20 -1
  309. package/node/components/TagsList/types.d.ts +4 -0
  310. package/node/components/TagsList/useLogic/hooks/index.d.ts +1 -0
  311. package/node/components/TagsList/useLogic/hooks/index.js +17 -0
  312. package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
  313. package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.js +17 -0
  314. package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
  315. package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.js +2 -0
  316. package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
  317. package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +31 -0
  318. package/node/components/TagsList/useLogic/useLogic.d.ts +14 -2
  319. package/node/components/TagsList/useLogic/useLogic.js +81 -1
  320. package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
  321. package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +26 -0
  322. package/node/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
  323. package/node/components/TagsList/utils/calculatePopoverWidth/index.js +17 -0
  324. package/node/components/TagsList/utils/index.d.ts +1 -0
  325. package/node/components/TagsList/utils/index.js +3 -1
  326. package/node/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
  327. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
  328. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
  329. package/node/components/TreeLikeAutocomplete/Input/Input.js +2 -2
  330. package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
  331. package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
  332. package/node/components/useScrollManagement/useScrollManagement.js +6 -5
  333. package/package.json +1 -1
@@ -18,6 +18,9 @@ const treeItemCva = (0, cva_1.cva)(constants_1.infiniteTreeListClassnames.row, {
18
18
  hasAddAnimation: {
19
19
  true: constants_1.infiniteTreeListClassnames.rowAddAnimation,
20
20
  },
21
+ isLastRow: {
22
+ true: constants_1.infiniteTreeListClassnames.rowLast,
23
+ },
21
24
  },
22
25
  });
23
26
  /**
@@ -25,15 +28,15 @@ const treeItemCva = (0, cva_1.cva)(constants_1.infiniteTreeListClassnames.row, {
25
28
  * Ставит контекст строки, css-переменные уровня и каскада, classname анимации
26
29
  */
27
30
  const TreeItem = ({ children, ...props }) => {
28
- const { item, renderItem, onToggle, memoizedItemProps, cssVars, isSpinner, hasAddAnimation, } = (0, useLogic_1.useLogic)(props);
31
+ const { item, renderItem, onToggle, itemProps, cssVars, isSpinner, hasAddAnimation, isLastRow, } = (0, useLogic_1.useLogic)(props);
29
32
  const { nodeId, isChildrenAsync } = item.meta;
30
33
  // Строку узла с подгружаемыми дочерними элементами рисует не список,
31
34
  // а постоянный слой: сюда она приезжает готовым DOM-узлом. Иначе store,
32
35
  // заведённый потребителем внутри renderParent, умирал бы на каждом уходе
33
36
  // строки со скролла
34
37
  if (isChildrenAsync && !item.placeholderKind) {
35
- return ((0, jsx_runtime_1.jsx)("div", { ...memoizedItemProps, children: (0, jsx_runtime_1.jsx)(ParentSlot_1.ParentSlot, { itemId: item.id }) }));
38
+ return ((0, jsx_runtime_1.jsx)("div", { ...itemProps, children: (0, jsx_runtime_1.jsx)(ParentSlot_1.ParentSlot, { itemId: item.id }) }));
36
39
  }
37
- return ((0, jsx_runtime_1.jsx)("div", { ...memoizedItemProps, children: (0, jsx_runtime_1.jsx)(InfiniteTreeListItem_1.TreeListItemContextProvider, { item: item, onToggle: onToggle, children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { id: nodeId, className: treeItemCva({ isSpinner, hasAddAnimation }), style: cssVars, children: item.placeholderKind ? ((0, jsx_runtime_1.jsx)(ChildrenPlaceholder_1.ChildrenPlaceholder, { item: item })) : ((0, jsx_runtime_1.jsx)(CustomItemWrapper_1.CustomItemWrapper, { item: item, renderItem: renderItem })) }) }) }));
40
+ return ((0, jsx_runtime_1.jsx)("div", { ...itemProps, children: (0, jsx_runtime_1.jsx)(InfiniteTreeListItem_1.TreeListItemContextProvider, { item: item, onToggle: onToggle, children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { id: nodeId, className: treeItemCva({ isSpinner, hasAddAnimation, isLastRow }), style: cssVars, children: item.placeholderKind ? ((0, jsx_runtime_1.jsx)(ChildrenPlaceholder_1.ChildrenPlaceholder, { item: item })) : ((0, jsx_runtime_1.jsx)(CustomItemWrapper_1.CustomItemWrapper, { item: item, renderItem: renderItem })) }) }) }));
38
41
  };
39
42
  exports.TreeItem = TreeItem;
@@ -77,4 +77,23 @@ exports.Wrapper = styled_1.styled.div `
77
77
  & > .${Tooltip_1.tooltipClassnames.contentWrapper} {
78
78
  width: 100%;
79
79
  }
80
+
81
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
82
+ margin-top: 0;
83
+ margin-left: 0;
84
+
85
+ border: none;
86
+ border-bottom: 1px solid
87
+ ${({ theme }) => theme.palette.components.border.default};
88
+ border-radius: 0;
89
+
90
+ &.${constants_1.infiniteTreeListClassnames.rowSpinner} {
91
+ border-bottom: none;
92
+ }
93
+
94
+ /* Выключаем border-bottom у последней строки, чтобы избежать накладывания на border списка */
95
+ &.${constants_1.infiniteTreeListClassnames.rowLast} {
96
+ border-bottom: none;
97
+ }
98
+ }
80
99
  `;
@@ -17,7 +17,7 @@ export declare const useLogic: ({ item, context, ...itemProps }: UseLogicParams)
17
17
  item: import("../../types").FlattenTree<import("../../types").InfiniteTreeListData>;
18
18
  renderItem: (item: import("../../types").FlattenTree<import("../../types").InfiniteTreeListData>) => import("react").ReactNode;
19
19
  onToggle: (item: import("../../types").InfiniteTreeListData) => void;
20
- memoizedItemProps: {
20
+ itemProps: {
21
21
  style?: CSSProperties | undefined;
22
22
  'data-index': number;
23
23
  'data-item-group-index'?: number | undefined;
@@ -27,5 +27,6 @@ export declare const useLogic: ({ item, context, ...itemProps }: UseLogicParams)
27
27
  cssVars: CSSProperties;
28
28
  isSpinner: boolean;
29
29
  hasAddAnimation: boolean;
30
+ isLastRow: boolean;
30
31
  };
31
32
  export {};
@@ -17,8 +17,7 @@ const InfiniteTreeListContext_1 = require("../../InfiniteTreeListContext");
17
17
  * этого нет
18
18
  */
19
19
  const useLogic = ({ item, context, ...itemProps }) => {
20
- const { renderItem, onToggle, nodePaginationMap, onLoadMore, enterAnimation, tailRegistry, } = (0, react_1.useContext)(InfiniteTreeListContext_1.InfiniteTreeListContext);
21
- const memoizedItemProps = (0, react_1.useMemo)(() => itemProps, [itemProps.style]);
20
+ const { renderItem, onToggle, nodePaginationMap, onLoadMore, enterAnimation, tailRegistry, lastRowId, } = (0, react_1.useContext)(InfiniteTreeListContext_1.InfiniteTreeListContext);
22
21
  const { parentId, siblingIndex, level } = item.meta;
23
22
  const parentPagination = parentId ? nodePaginationMap[parentId] : undefined;
24
23
  const isLastChild = parentPagination?.lastChildId === item.id;
@@ -51,6 +50,7 @@ const useLogic = ({ item, context, ...itemProps }) => {
51
50
  };
52
51
  }, [shouldRegister, parentId, item.id, tailRegistry, onLoadMore]);
53
52
  const isSpinner = item.placeholderKind === 'spinner';
53
+ const isLastRow = item.id === lastRowId;
54
54
  // Уровень вложенности и индекс каскада — динамические значения, поэтому
55
55
  // передаются в стили через css vars, а не через styled props
56
56
  const cssVars = {
@@ -61,10 +61,11 @@ const useLogic = ({ item, context, ...itemProps }) => {
61
61
  item,
62
62
  renderItem,
63
63
  onToggle,
64
- memoizedItemProps,
64
+ itemProps,
65
65
  cssVars,
66
66
  isSpinner,
67
67
  hasAddAnimation: !isSpinner && shouldAnimate,
68
+ isLastRow,
68
69
  };
69
70
  };
70
71
  exports.useLogic = useLogic;
@@ -6,13 +6,34 @@ export declare const OVERSCAN = 30;
6
6
  * data, поэтому `useLayoutEffect` снимает метку слишком рано
7
7
  */
8
8
  export declare const ENTER_ANIMATION_MOUNT_WINDOW_MS = 100;
9
+ /**
10
+ * Предел, после которого переход между уровнями открывает список принудительно.
11
+ */
12
+ export declare const LEVEL_TRANSITION_TIMEOUT_MS = 200;
9
13
  export declare const CHILDREN_SKELETON_COUNT = 3;
10
14
  export declare const CHILDREN_NO_DATA_MSG = "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445";
15
+ /**
16
+ * Ключ корневого уровня в снимках позиции скролла: у корня нет id узла
17
+ */
18
+ export declare const ROOT_LEVEL_KEY = "root";
19
+ /**
20
+ * Префикс ключа уровня узла: отделяет id узлов от ключа корневого уровня
21
+ */
22
+ export declare const NODE_LEVEL_KEY_PREFIX = "node:";
11
23
  export declare const infiniteTreeListClassnames: {
24
+ root: string;
25
+ loading: string;
26
+ noData: string;
27
+ error: string;
28
+ levelHeader: string;
29
+ levelHeaderWithBackButton: string;
30
+ levelHeaderBackButton: string;
31
+ levelTransition: string;
12
32
  row: string;
13
33
  rowAddAnimation: string;
14
34
  rowRemoveAnimation: string;
15
35
  rowSpinner: string;
36
+ rowLast: string;
16
37
  scrollToTopButton: string;
17
38
  visibleScrollToTopButton: string;
18
39
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.infiniteTreeListClassnames = exports.CHILDREN_NO_DATA_MSG = exports.CHILDREN_SKELETON_COUNT = exports.ENTER_ANIMATION_MOUNT_WINDOW_MS = exports.OVERSCAN = exports.VIRTUOSO_CONTAINER_ID = void 0;
3
+ exports.infiniteTreeListClassnames = exports.NODE_LEVEL_KEY_PREFIX = exports.ROOT_LEVEL_KEY = exports.CHILDREN_NO_DATA_MSG = exports.CHILDREN_SKELETON_COUNT = exports.LEVEL_TRANSITION_TIMEOUT_MS = exports.ENTER_ANIMATION_MOUNT_WINDOW_MS = exports.OVERSCAN = exports.VIRTUOSO_CONTAINER_ID = void 0;
4
4
  const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
5
  exports.VIRTUOSO_CONTAINER_ID = 'virtuoso-container';
6
6
  exports.OVERSCAN = 30;
@@ -10,13 +10,34 @@ exports.OVERSCAN = 30;
10
10
  * data, поэтому `useLayoutEffect` снимает метку слишком рано
11
11
  */
12
12
  exports.ENTER_ANIMATION_MOUNT_WINDOW_MS = 100;
13
+ /**
14
+ * Предел, после которого переход между уровнями открывает список принудительно.
15
+ */
16
+ exports.LEVEL_TRANSITION_TIMEOUT_MS = 200;
13
17
  exports.CHILDREN_SKELETON_COUNT = 3;
14
18
  exports.CHILDREN_NO_DATA_MSG = 'Нет данных';
19
+ /**
20
+ * Ключ корневого уровня в снимках позиции скролла: у корня нет id узла
21
+ */
22
+ exports.ROOT_LEVEL_KEY = 'root';
23
+ /**
24
+ * Префикс ключа уровня узла: отделяет id узлов от ключа корневого уровня
25
+ */
26
+ exports.NODE_LEVEL_KEY_PREFIX = 'node:';
15
27
  exports.infiniteTreeListClassnames = {
28
+ root: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list'),
29
+ loading: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list_loading'),
30
+ noData: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list_no-data'),
31
+ error: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list_error'),
32
+ levelHeader: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__level-header'),
33
+ levelHeaderWithBackButton: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__level-header_with-back-button'),
34
+ levelHeaderBackButton: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__level-header-back-button'),
35
+ levelTransition: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list_level-transition'),
16
36
  row: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__row'),
17
37
  rowAddAnimation: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__row_add-animation'),
18
38
  rowRemoveAnimation: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__row_remove-animation'),
19
39
  rowSpinner: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__row_spinner'),
40
+ rowLast: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__row_last'),
20
41
  scrollToTopButton: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__scroll-to-top-button'),
21
42
  visibleScrollToTopButton: (0, createUIKitClassname_1.createUIKitClassname)('infinite-tree-list__scroll-to-top-button_visible'),
22
43
  };
@@ -2,4 +2,6 @@ export * from './useChildrenState';
2
2
  export * from './useEnterAnimation';
3
3
  export * from './useExpandNotifier';
4
4
  export * from './useFlatTree';
5
+ export * from './useLevelNavigation';
5
6
  export * from './useListScroll';
7
+ export * from './useNodeTitleValidation';
@@ -18,4 +18,6 @@ __exportStar(require("./useChildrenState"), exports);
18
18
  __exportStar(require("./useEnterAnimation"), exports);
19
19
  __exportStar(require("./useExpandNotifier"), exports);
20
20
  __exportStar(require("./useFlatTree"), exports);
21
+ __exportStar(require("./useLevelNavigation"), exports);
21
22
  __exportStar(require("./useListScroll"), exports);
23
+ __exportStar(require("./useNodeTitleValidation"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './useLevelNavigation';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./useLevelNavigation"), exports);
@@ -0,0 +1,15 @@
1
+ import type { InfiniteTreeListData } from '../../types';
2
+ export type UseLevelNavigationParams<TData extends InfiniteTreeListData<TData>> = {
3
+ /**
4
+ * Список элементов дерева: из него выводится базовый уровень
5
+ */
6
+ items: TData[];
7
+ /**
8
+ * Флаг мобильного отображения
9
+ */
10
+ isMobile: boolean;
11
+ /**
12
+ * Функция проверки узла в списке
13
+ */
14
+ checkNodeExists: (nodeId: string) => boolean;
15
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import type { InfiniteTreeListData } from '../../types';
2
+ import type { UseLevelNavigationParams } from './types';
3
+ /**
4
+ * Уровень, который список отображает на мобильной ширине: id текущего узла
5
+ * и стек пройденных узлов.
6
+ */
7
+ export declare const useLevelNavigation: <TData extends InfiniteTreeListData<TData>>({ items, isMobile, checkNodeExists, }: UseLevelNavigationParams<TData>) => {
8
+ currentNodeId: string;
9
+ baseNodeId: string | undefined;
10
+ activeLevelKeys: string[];
11
+ hasUpperLevel: boolean;
12
+ isRootLevel: boolean;
13
+ enterNode: (itemId: string) => void;
14
+ leaveNode: () => void;
15
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLevelNavigation = void 0;
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../../utils");
6
+ /**
7
+ * Уровень, который список отображает на мобильной ширине: id текущего узла
8
+ * и стек пройденных узлов.
9
+ */
10
+ const useLevelNavigation = ({ items, isMobile, checkNodeExists, }) => {
11
+ const [enteredIds, setEnteredIds] = (0, react_1.useState)([]);
12
+ const baseNodeId = (0, react_1.useMemo)(() => {
13
+ if (items.length !== 1) {
14
+ return undefined;
15
+ }
16
+ const [rootItem] = items;
17
+ return (0, utils_1.checkHasNested)(rootItem) ? rootItem.id : undefined;
18
+ }, [items]);
19
+ // Смена ширины в обе стороны возвращает список на базовый уровень
20
+ (0, react_1.useEffect)(() => {
21
+ setEnteredIds([]);
22
+ }, [isMobile]);
23
+ // Узел мог уйти из данных: показывать его уровень и всё, что ниже, нечем
24
+ (0, react_1.useEffect)(() => {
25
+ const lostIndex = enteredIds.findIndex((itemId) => !checkNodeExists(itemId));
26
+ if (lostIndex === -1) {
27
+ return;
28
+ }
29
+ setEnteredIds(enteredIds.slice(0, lostIndex));
30
+ }, [enteredIds, checkNodeExists]);
31
+ const enterNode = (0, react_1.useCallback)((itemId) => {
32
+ setEnteredIds((prev) => [...prev, itemId]);
33
+ }, []);
34
+ const leaveNode = (0, react_1.useCallback)(() => {
35
+ setEnteredIds((prev) => prev.slice(0, -1));
36
+ }, []);
37
+ // Уровни, до которых доберётся возврат
38
+ const activeLevelKeys = (0, react_1.useMemo)(() => [
39
+ (0, utils_1.getLevelKey)(isMobile ? baseNodeId : undefined),
40
+ ...enteredIds.map((itemId) => (0, utils_1.getLevelKey)(itemId)),
41
+ ], [isMobile, baseNodeId, enteredIds]);
42
+ return {
43
+ currentNodeId: enteredIds[enteredIds.length - 1] ?? baseNodeId,
44
+ baseNodeId,
45
+ activeLevelKeys,
46
+ hasUpperLevel: enteredIds.length > 0,
47
+ isRootLevel: !isMobile || (enteredIds.length === 0 && baseNodeId === undefined),
48
+ enterNode,
49
+ leaveNode,
50
+ };
51
+ };
52
+ exports.useLevelNavigation = useLevelNavigation;
@@ -0,0 +1,3 @@
1
+ export * from './useLevelSnapshots';
2
+ export * from './useScrollToTopButton';
3
+ export * from './useTailWatcher';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useLevelSnapshots"), exports);
18
+ __exportStar(require("./useScrollToTopButton"), exports);
19
+ __exportStar(require("./useTailWatcher"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './useLevelSnapshots';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./useLevelSnapshots"), exports);
@@ -0,0 +1,16 @@
1
+ import type { RefObject } from 'react';
2
+ import type { VirtuosoHandle } from 'react-virtuoso';
3
+ export type UseLevelSnapshotsParams = {
4
+ /**
5
+ * Ключ отображаемого уровня
6
+ */
7
+ levelKey: string;
8
+ /**
9
+ * Ключи уровней, до которых доберётся возврат: снимки остальных не нужны
10
+ */
11
+ activeLevelKeys: string[];
12
+ /**
13
+ * Ref на список: с него снимаются измеренные высоты строк
14
+ */
15
+ virtuosoRef: RefObject<VirtuosoHandle | null>;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import type { StateSnapshot } from 'react-virtuoso';
2
+ import type { UseLevelSnapshotsParams } from './types';
3
+ /**
4
+ * Память уровней: куда был прокручен уровень и какими он намерил свои строки.
5
+ * Снимки живут, пока до уровня может добраться возврат
6
+ */
7
+ export declare const useLevelSnapshots: ({ levelKey, activeLevelKeys, virtuosoRef, }: UseLevelSnapshotsParams) => {
8
+ rememberLevel: (offset: number) => void;
9
+ forgetLevel: (targetLevelKey: string) => void;
10
+ getLevelPosition: (targetLevelKey: string) => number | undefined;
11
+ levelState: StateSnapshot | undefined;
12
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLevelSnapshots = void 0;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Память уровней: куда был прокручен уровень и какими он намерил свои строки.
7
+ * Снимки живут, пока до уровня может добраться возврат
8
+ */
9
+ const useLevelSnapshots = ({ levelKey, activeLevelKeys, virtuosoRef, }) => {
10
+ // Позиция уровня запоминается смещением скролла внутри списка
11
+ const levelPositionsRef = (0, react_1.useRef)(new Map());
12
+ // Кеш измеренных высот у `Virtuoso` привязан к индексу строки, а не к её id,
13
+ // поэтому уровни затирают замеры друг друга. Снимок уровня возвращает его
14
+ // собственные высоты: иначе после возврата список ниже настоящего, и каждая
15
+ // строка, домеренная при прокрутке вверх, толкает позицию обратно вниз
16
+ const levelStatesRef = (0, react_1.useRef)(new Map());
17
+ const rememberLevel = (0, react_1.useCallback)((offset) => {
18
+ levelPositionsRef.current.set(levelKey, offset);
19
+ virtuosoRef.current?.getState((state) => {
20
+ levelStatesRef.current.set(levelKey, state);
21
+ });
22
+ }, [levelKey, virtuosoRef]);
23
+ const forgetLevel = (0, react_1.useCallback)((targetLevelKey) => {
24
+ levelPositionsRef.current.delete(targetLevelKey);
25
+ levelStatesRef.current.delete(targetLevelKey);
26
+ }, []);
27
+ const getLevelPosition = (0, react_1.useCallback)((targetLevelKey) => levelPositionsRef.current.get(targetLevelKey), []);
28
+ // Уровни вне текущего пути возврату недоступны, и их снимки только копятся
29
+ (0, react_1.useEffect)(() => {
30
+ const keptKeys = new Set(activeLevelKeys);
31
+ levelPositionsRef.current.forEach((_, key) => {
32
+ if (keptKeys.has(key)) {
33
+ return;
34
+ }
35
+ levelPositionsRef.current.delete(key);
36
+ levelStatesRef.current.delete(key);
37
+ });
38
+ }, [activeLevelKeys]);
39
+ return {
40
+ rememberLevel,
41
+ forgetLevel,
42
+ getLevelPosition,
43
+ levelState: levelStatesRef.current.get(levelKey),
44
+ };
45
+ };
46
+ exports.useLevelSnapshots = useLevelSnapshots;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './useScrollToTopButton';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./useScrollToTopButton"), exports);
@@ -0,0 +1,12 @@
1
+ import type { RefObject } from 'react';
2
+ import type { VirtuosoHandle } from 'react-virtuoso';
3
+ export type UseScrollToTopButtonParams = {
4
+ /**
5
+ * Ref на контейнер, в котором должен быть скролл
6
+ */
7
+ scrollRef: RefObject<HTMLElement | null>;
8
+ /**
9
+ * Ref на список: кнопка возвращает его к первой строке
10
+ */
11
+ virtuosoRef: RefObject<VirtuosoHandle | null>;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { ListRange } from 'react-virtuoso';
3
+ import type { UseScrollToTopButtonParams } from './types';
4
+ /**
5
+ * Кнопка «наверх»: показывается, когда список ушёл от начала, и возвращает
6
+ * его к первой строке
7
+ */
8
+ export declare const useScrollToTopButton: ({ scrollRef, virtuosoRef, }: UseScrollToTopButtonParams) => {
9
+ updateVisibility: (range: ListRange) => void;
10
+ onTopButtonProps: {
11
+ buttonRef: import("react").RefObject<HTMLButtonElement | null>;
12
+ handleScrollToTop: () => void;
13
+ scrollRef: import("react").RefObject<HTMLElement | null>;
14
+ };
15
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScrollToTopButton = void 0;
4
+ const react_1 = require("react");
5
+ const constants_1 = require("../../../../constants");
6
+ /**
7
+ * Кнопка «наверх»: показывается, когда список ушёл от начала, и возвращает
8
+ * его к первой строке
9
+ */
10
+ const useScrollToTopButton = ({ scrollRef, virtuosoRef, }) => {
11
+ const buttonRef = (0, react_1.useRef)(null);
12
+ // Класс переключается мимо рендера: кнопка меняется на каждом кадре скролла
13
+ const updateVisibility = (0, react_1.useCallback)((range) => {
14
+ buttonRef.current?.classList.toggle(constants_1.infiniteTreeListClassnames.visibleScrollToTopButton, range.startIndex > 2);
15
+ }, []);
16
+ const handleScrollToTop = (0, react_1.useCallback)(() => {
17
+ if (scrollRef.current) {
18
+ scrollRef.current.style.scrollBehavior = 'auto';
19
+ }
20
+ virtuosoRef.current?.scrollToIndex(0);
21
+ }, [scrollRef, virtuosoRef]);
22
+ return {
23
+ updateVisibility,
24
+ onTopButtonProps: {
25
+ buttonRef,
26
+ handleScrollToTop,
27
+ scrollRef,
28
+ },
29
+ };
30
+ };
31
+ exports.useScrollToTopButton = useScrollToTopButton;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './useTailWatcher';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./useTailWatcher"), exports);
@@ -0,0 +1,11 @@
1
+ import type { FlattenTree, InfiniteTreeListData } from '../../../../types';
2
+ export type UseTailWatcherParams<TData extends InfiniteTreeListData<TData>> = {
3
+ /**
4
+ * Строки, отданные `Virtuoso`
5
+ */
6
+ displayedList: FlattenTree<TData>[];
7
+ /**
8
+ * Ключ отображаемого уровня
9
+ */
10
+ levelKey: string;
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import type { ListRange } from 'react-virtuoso';
2
+ import type { InfiniteTreeListData } from '../../../../types';
3
+ import { type TailRegistry } from '../../../../utils';
4
+ import type { UseTailWatcherParams } from './types';
5
+ /**
6
+ * Хвосты вложенных веток: строки регистрируют себя сами, хук создаёт реестр
7
+ * и на смене видимого диапазона проверяет, попал ли хвост в кадр
8
+ */
9
+ export declare const useTailWatcher: <TData extends InfiniteTreeListData<TData>>({ displayedList, levelKey, }: UseTailWatcherParams<TData>) => {
10
+ tailRegistry: TailRegistry;
11
+ trackRange: (range: ListRange) => void;
12
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTailWatcher = void 0;
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../../../../utils");
6
+ /**
7
+ * Хвосты вложенных веток: строки регистрируют себя сами, хук создаёт реестр
8
+ * и на смене видимого диапазона проверяет, попал ли хвост в кадр
9
+ */
10
+ const useTailWatcher = ({ displayedList, levelKey, }) => {
11
+ const tailRegistryRef = (0, react_1.useRef)(null);
12
+ if (!tailRegistryRef.current) {
13
+ tailRegistryRef.current = (0, utils_1.createTailRegistry)();
14
+ }
15
+ const tailRegistry = tailRegistryRef.current;
16
+ const displayedListRef = (0, react_1.useRef)(displayedList);
17
+ const lastRangeRef = (0, react_1.useRef)(null);
18
+ const checkTails = (0, react_1.useCallback)(() => {
19
+ const range = lastRangeRef.current;
20
+ if (!range) {
21
+ return;
22
+ }
23
+ tailRegistry.checkRange(range.endIndex, (itemId) => displayedListRef.current.findIndex((item) => item.id === itemId));
24
+ }, [tailRegistry]);
25
+ // Диапазон прежнего уровня к новому набору строк не относится
26
+ (0, react_1.useEffect)(() => {
27
+ lastRangeRef.current = null;
28
+ tailRegistry.forgetRange();
29
+ }, [levelKey, tailRegistry]);
30
+ (0, react_1.useEffect)(() => {
31
+ displayedListRef.current = displayedList;
32
+ checkTails();
33
+ }, [displayedList, checkTails]);
34
+ const trackRange = (0, react_1.useCallback)((range) => {
35
+ lastRangeRef.current = range;
36
+ checkTails();
37
+ }, [checkTails]);
38
+ return {
39
+ tailRegistry,
40
+ trackRange,
41
+ };
42
+ };
43
+ exports.useTailWatcher = useTailWatcher;