@1771technologies/lytenyte-pro 2.0.0-dev.0 → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/dist/__play__/alpha.play.d.ts +3 -0
  2. package/dist/__play__/alpha.play.js +56 -0
  3. package/dist/__play__/basic-server-data/data.d.ts +10 -0
  4. package/dist/__play__/basic-server-data/data.js +17746 -0
  5. package/dist/__play__/basic-server-data/server.d.ts +36 -0
  6. package/dist/__play__/basic-server-data/server.js +105 -0
  7. package/dist/__play__/buttons.play.d.ts +4 -0
  8. package/dist/__play__/buttons.play.js +7 -0
  9. package/dist/__play__/inputs.play.d.ts +3 -0
  10. package/dist/__play__/inputs.play.js +13 -0
  11. package/dist/__play__/server.play.d.ts +3 -0
  12. package/dist/__play__/server.play.js +66 -0
  13. package/dist/__play__/tree.play.d.ts +3 -0
  14. package/dist/__play__/tree.play.js +47 -0
  15. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
  16. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
  17. package/dist/cell-selection/are-rects-equal.d.ts +2 -0
  18. package/dist/cell-selection/are-rects-equal.js +6 -0
  19. package/dist/cell-selection/bound-selection-rect.d.ts +3 -0
  20. package/dist/cell-selection/bound-selection-rect.js +16 -0
  21. package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
  22. package/dist/cell-selection/cell-selection-containers.js +86 -0
  23. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
  24. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
  25. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
  26. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
  27. package/dist/cell-selection/cell-style-row.d.ts +8 -0
  28. package/dist/cell-selection/cell-style-row.js +79 -0
  29. package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
  30. package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
  31. package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
  32. package/dist/cell-selection/deselect-rect-range.js +43 -0
  33. package/dist/cell-selection/expand-selection-down.d.ts +3 -0
  34. package/dist/cell-selection/expand-selection-down.js +78 -0
  35. package/dist/cell-selection/expand-selection-end.d.ts +3 -0
  36. package/dist/cell-selection/expand-selection-end.js +76 -0
  37. package/dist/cell-selection/expand-selection-start.d.ts +3 -0
  38. package/dist/cell-selection/expand-selection-start.js +73 -0
  39. package/dist/cell-selection/expand-selection-up.d.ts +3 -0
  40. package/dist/cell-selection/expand-selection-up.js +74 -0
  41. package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
  42. package/dist/cell-selection/full-width-start-end-index.js +4 -0
  43. package/dist/cell-selection/get-root-cell.d.ts +3 -0
  44. package/dist/cell-selection/get-root-cell.js +6 -0
  45. package/dist/cell-selection/index.d.ts +13 -0
  46. package/dist/cell-selection/index.js +13 -0
  47. package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
  48. package/dist/cell-selection/is-bottom-rect.js +4 -0
  49. package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
  50. package/dist/cell-selection/is-center-col-rect.js +3 -0
  51. package/dist/cell-selection/is-center-rect.d.ts +2 -0
  52. package/dist/cell-selection/is-center-rect.js +4 -0
  53. package/dist/cell-selection/is-end-rect.d.ts +5 -0
  54. package/dist/cell-selection/is-end-rect.js +3 -0
  55. package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
  56. package/dist/cell-selection/is-fully-within-rect.js +6 -0
  57. package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
  58. package/dist/cell-selection/is-overlapping-rect.js +5 -0
  59. package/dist/cell-selection/is-start-rect.d.ts +5 -0
  60. package/dist/cell-selection/is-start-rect.js +3 -0
  61. package/dist/cell-selection/is-top-rect.d.ts +2 -0
  62. package/dist/cell-selection/is-top-rect.js +3 -0
  63. package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
  64. package/dist/cell-selection/is-within-selection-rect.js +3 -0
  65. package/dist/cell-selection/split-cell-selection-rect.d.ts +47 -0
  66. package/dist/cell-selection/split-cell-selection-rect.js +88 -0
  67. package/dist/cell-selection/split-on-pivot.d.ts +3 -0
  68. package/dist/cell-selection/split-on-pivot.js +50 -0
  69. package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
  70. package/dist/cell-selection/update-additive-cell-selection.js +21 -0
  71. package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
  72. package/dist/cell-selection/use-edge-scroll.js +71 -0
  73. package/dist/components/checkbox/checkbox.d.ts +15 -0
  74. package/dist/components/checkbox/checkbox.js +42 -0
  75. package/dist/components/checkbox/checkbox.play.d.ts +2 -0
  76. package/dist/components/checkbox/checkbox.play.js +6 -0
  77. package/dist/components/column-manager/column-manager.d.ts +13 -0
  78. package/dist/components/column-manager/column-manager.js +47 -0
  79. package/dist/components/external/clsx.d.ts +2 -0
  80. package/dist/components/external/clsx.js +44 -0
  81. package/dist/components/external/floating-ui.d.ts +268 -0
  82. package/dist/components/external/floating-ui.js +1802 -0
  83. package/dist/components/headless/dialog/arrow.d.ts +6 -0
  84. package/dist/components/headless/dialog/arrow.js +16 -0
  85. package/dist/components/headless/dialog/close.d.ts +10 -0
  86. package/dist/components/headless/dialog/close.js +22 -0
  87. package/dist/components/headless/dialog/container.d.ts +5 -0
  88. package/dist/components/headless/dialog/container.js +221 -0
  89. package/dist/components/headless/dialog/context.d.ts +32 -0
  90. package/dist/components/headless/dialog/context.js +3 -0
  91. package/dist/components/headless/dialog/description.d.ts +9 -0
  92. package/dist/components/headless/dialog/description.js +20 -0
  93. package/dist/components/headless/dialog/index.parts.d.ts +30 -0
  94. package/dist/components/headless/dialog/index.parts.js +17 -0
  95. package/dist/components/headless/dialog/root.d.ts +32 -0
  96. package/dist/components/headless/dialog/root.js +75 -0
  97. package/dist/components/headless/dialog/title.d.ts +9 -0
  98. package/dist/components/headless/dialog/title.js +20 -0
  99. package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
  100. package/dist/components/headless/dialog/transform-origin.js +38 -0
  101. package/dist/components/headless/dialog/trigger.d.ts +10 -0
  102. package/dist/components/headless/dialog/trigger.js +24 -0
  103. package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
  104. package/dist/components/headless/dialog/use-dialog.js +12 -0
  105. package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
  106. package/dist/components/headless/menu/checkbox-item.js +42 -0
  107. package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
  108. package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
  109. package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
  110. package/dist/components/headless/menu/combo/combo-context.js +3 -0
  111. package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
  112. package/dist/components/headless/menu/combo/combo-input.js +58 -0
  113. package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
  114. package/dist/components/headless/menu/combo/combo-menu.js +24 -0
  115. package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
  116. package/dist/components/headless/menu/combo/combo-option.js +37 -0
  117. package/dist/components/headless/menu/container.d.ts +5 -0
  118. package/dist/components/headless/menu/container.js +19 -0
  119. package/dist/components/headless/menu/dom.d.ts +4 -0
  120. package/dist/components/headless/menu/dom.js +20 -0
  121. package/dist/components/headless/menu/index.d.ts +54 -0
  122. package/dist/components/headless/menu/index.js +39 -0
  123. package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
  124. package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
  125. package/dist/components/headless/menu/item/item.d.ts +9 -0
  126. package/dist/components/headless/menu/item/item.js +45 -0
  127. package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
  128. package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
  129. package/dist/components/headless/menu/menu-divider.d.ts +5 -0
  130. package/dist/components/headless/menu/menu-divider.js +6 -0
  131. package/dist/components/headless/menu/menu-group.d.ts +5 -0
  132. package/dist/components/headless/menu/menu-group.js +6 -0
  133. package/dist/components/headless/menu/menu-header.d.ts +5 -0
  134. package/dist/components/headless/menu/menu-header.js +6 -0
  135. package/dist/components/headless/menu/popover.d.ts +5 -0
  136. package/dist/components/headless/menu/popover.js +7 -0
  137. package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
  138. package/dist/components/headless/menu/radio-group/context.js +7 -0
  139. package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
  140. package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
  141. package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
  142. package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
  143. package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
  144. package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
  145. package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
  146. package/dist/components/headless/menu/submenu/submenu.js +55 -0
  147. package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
  148. package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
  149. package/dist/components/headless/menu/use-menu.d.ts +1 -0
  150. package/dist/components/headless/menu/use-menu.js +52 -0
  151. package/dist/components/headless/popover/container.d.ts +5 -0
  152. package/dist/components/headless/popover/container.js +7 -0
  153. package/dist/components/headless/popover/context.d.ts +6 -0
  154. package/dist/components/headless/popover/context.js +3 -0
  155. package/dist/components/headless/popover/index.d.ts +30 -0
  156. package/dist/components/headless/popover/index.js +17 -0
  157. package/dist/components/headless/popover/root.d.ts +6 -0
  158. package/dist/components/headless/popover/root.js +8 -0
  159. package/dist/components/headless/popover/trigger.d.ts +7 -0
  160. package/dist/components/headless/popover/trigger.js +11 -0
  161. package/dist/components/pill-manager/container.d.ts +5 -0
  162. package/dist/components/pill-manager/container.js +127 -0
  163. package/dist/components/pill-manager/expander.d.ts +9 -0
  164. package/dist/components/pill-manager/expander.js +21 -0
  165. package/dist/components/pill-manager/icons.d.ts +12 -0
  166. package/dist/components/pill-manager/icons.js +35 -0
  167. package/dist/components/pill-manager/index.d.ts +33 -0
  168. package/dist/components/pill-manager/index.js +13 -0
  169. package/dist/components/pill-manager/item.d.ts +10 -0
  170. package/dist/components/pill-manager/item.js +178 -0
  171. package/dist/components/pill-manager/label.d.ts +10 -0
  172. package/dist/components/pill-manager/label.js +31 -0
  173. package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
  174. package/dist/components/pill-manager/pill-manager.play.js +73 -0
  175. package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
  176. package/dist/components/pill-manager/pill-row.context.js +4 -0
  177. package/dist/components/pill-manager/pill-row.d.ts +12 -0
  178. package/dist/components/pill-manager/pill-row.js +22 -0
  179. package/dist/components/pill-manager/root.context.d.ts +40 -0
  180. package/dist/components/pill-manager/root.context.js +4 -0
  181. package/dist/components/pill-manager/root.d.ts +25 -0
  182. package/dist/components/pill-manager/root.js +33 -0
  183. package/dist/components/pill-manager/row-default.d.ts +3 -0
  184. package/dist/components/pill-manager/row-default.js +14 -0
  185. package/dist/components/pill-manager/types.d.ts +21 -0
  186. package/dist/components/pill-manager/types.js +1 -0
  187. package/dist/components/row-group-cell.d.ts +13 -0
  188. package/dist/components/row-group-cell.js +40 -0
  189. package/dist/components/select-all.d.ts +12 -0
  190. package/dist/components/select-all.js +34 -0
  191. package/dist/components/smart-select/chip-context.d.ts +8 -0
  192. package/dist/components/smart-select/chip-context.js +4 -0
  193. package/dist/components/smart-select/chip-remove.d.ts +1 -0
  194. package/dist/components/smart-select/chip-remove.js +13 -0
  195. package/dist/components/smart-select/chip.d.ts +13 -0
  196. package/dist/components/smart-select/chip.js +79 -0
  197. package/dist/components/smart-select/container.d.ts +1 -0
  198. package/dist/components/smart-select/container.js +13 -0
  199. package/dist/components/smart-select/context.d.ts +31 -0
  200. package/dist/components/smart-select/context.js +4 -0
  201. package/dist/components/smart-select/index.d.ts +30 -0
  202. package/dist/components/smart-select/index.js +19 -0
  203. package/dist/components/smart-select/option.d.ts +8 -0
  204. package/dist/components/smart-select/option.js +36 -0
  205. package/dist/components/smart-select/root.d.ts +17 -0
  206. package/dist/components/smart-select/root.js +165 -0
  207. package/dist/components/smart-select/smart-select.play.d.ts +2 -0
  208. package/dist/components/smart-select/smart-select.play.js +36 -0
  209. package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
  210. package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
  211. package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
  212. package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
  213. package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
  214. package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
  215. package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
  216. package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
  217. package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
  218. package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
  219. package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
  220. package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
  221. package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
  222. package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
  223. package/dist/components/smart-select/type.d.ts +44 -0
  224. package/dist/components/smart-select/type.js +1 -0
  225. package/dist/components/smart-select/use-async-options.d.ts +8 -0
  226. package/dist/components/smart-select/use-async-options.js +42 -0
  227. package/dist/components/tree-view/index.d.ts +4 -0
  228. package/dist/components/tree-view/index.js +2 -0
  229. package/dist/components/tree-view/root.d.ts +37 -0
  230. package/dist/components/tree-view/root.js +139 -0
  231. package/dist/components/tree-view/select-all.d.ts +7 -0
  232. package/dist/components/tree-view/select-all.js +22 -0
  233. package/dist/components/tree-view/tree-children.d.ts +2 -0
  234. package/dist/components/tree-view/tree-children.js +15 -0
  235. package/dist/components/tree-view/types.d.ts +31 -0
  236. package/dist/components/tree-view/types.js +1 -0
  237. package/dist/components/types.d.ts +4 -0
  238. package/dist/components/types.js +1 -0
  239. package/dist/components/virtual-from-coordinates.d.ts +2 -0
  240. package/dist/components/virtual-from-coordinates.js +15 -0
  241. package/dist/components.d.ts +16 -0
  242. package/dist/components.js +11 -0
  243. package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
  244. package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
  245. package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
  246. package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
  247. package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
  248. package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
  249. package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
  250. package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
  251. package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
  252. package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
  253. package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
  254. package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
  255. package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
  256. package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
  257. package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
  258. package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
  259. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
  260. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
  261. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
  262. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
  263. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
  264. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
  265. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
  266. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
  267. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
  268. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
  269. package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
  270. package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
  271. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
  272. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
  273. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
  274. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
  275. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
  276. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
  277. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
  278. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
  279. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
  280. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
  281. package/dist/data-source-client/use-client-data-source.d.ts +91 -0
  282. package/dist/data-source-client/use-client-data-source.js +169 -0
  283. package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
  284. package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
  285. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
  286. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
  287. package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
  288. package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
  289. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
  290. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
  291. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
  292. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
  293. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
  294. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
  295. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
  296. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
  297. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
  298. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
  299. package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
  300. package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
  301. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
  302. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
  303. package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
  304. package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
  305. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
  306. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
  307. package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
  308. package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
  309. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
  310. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
  311. package/dist/data-source-server/async-tree/types.d.ts +70 -0
  312. package/dist/data-source-server/async-tree/types.js +1 -0
  313. package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
  314. package/dist/data-source-server/range-tree/range-tree.js +102 -0
  315. package/dist/data-source-server/server-data.d.ts +73 -0
  316. package/dist/data-source-server/server-data.js +553 -0
  317. package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
  318. package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
  319. package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
  320. package/dist/data-source-server/source/use-on-view-change.js +13 -0
  321. package/dist/data-source-server/source/use-row-add.d.ts +3 -0
  322. package/dist/data-source-server/source/use-row-add.js +36 -0
  323. package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
  324. package/dist/data-source-server/source/use-row-by-id.js +8 -0
  325. package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
  326. package/dist/data-source-server/source/use-row-by-index.js +89 -0
  327. package/dist/data-source-server/source/use-row-children.d.ts +2 -0
  328. package/dist/data-source-server/source/use-row-children.js +16 -0
  329. package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
  330. package/dist/data-source-server/source/use-row-delete.js +39 -0
  331. package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
  332. package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
  333. package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
  334. package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
  335. package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
  336. package/dist/data-source-server/source/use-row-leafs.js +20 -0
  337. package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
  338. package/dist/data-source-server/source/use-row-parents.js +16 -0
  339. package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
  340. package/dist/data-source-server/source/use-row-siblings.js +15 -0
  341. package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
  342. package/dist/data-source-server/source/use-rows-between.js +20 -0
  343. package/dist/data-source-server/source/use-source-state.d.ts +28 -0
  344. package/dist/data-source-server/source/use-source-state.js +47 -0
  345. package/dist/data-source-server/source/use-source.d.ts +5 -0
  346. package/dist/data-source-server/source/use-source.js +66 -0
  347. package/dist/data-source-server/types.d.ts +42 -0
  348. package/dist/data-source-server/types.js +1 -0
  349. package/dist/data-source-server/use-server-data-source.d.ts +51 -0
  350. package/dist/data-source-server/use-server-data-source.js +192 -0
  351. package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
  352. package/dist/data-source-server/utils/get-node-depth.js +9 -0
  353. package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
  354. package/dist/data-source-server/utils/get-node-path.js +9 -0
  355. package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
  356. package/dist/data-source-server/utils/get-request-id.js +6 -0
  357. package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
  358. package/dist/data-source-tree/source/use-controlled-state.js +21 -0
  359. package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
  360. package/dist/data-source-tree/source/use-flattened.js +65 -0
  361. package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
  362. package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
  363. package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
  364. package/dist/data-source-tree/source/use-row-by-id.js +7 -0
  365. package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
  366. package/dist/data-source-tree/source/use-row-children.js +11 -0
  367. package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
  368. package/dist/data-source-tree/source/use-row-leafs.js +20 -0
  369. package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
  370. package/dist/data-source-tree/source/use-row-parents.js +16 -0
  371. package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
  372. package/dist/data-source-tree/source/use-row-siblings.js +12 -0
  373. package/dist/data-source-tree/source/use-tree.d.ts +3 -0
  374. package/dist/data-source-tree/source/use-tree.js +59 -0
  375. package/dist/data-source-tree/types.d.ts +16 -0
  376. package/dist/data-source-tree/types.js +1 -0
  377. package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
  378. package/dist/data-source-tree/use-tree-data-source.js +101 -0
  379. package/dist/data-source-tree/utils/is-object.d.ts +1 -0
  380. package/dist/data-source-tree/utils/is-object.js +3 -0
  381. package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
  382. package/dist/hooks/use-slot/get-element-ref.js +20 -0
  383. package/dist/hooks/use-slot/index.d.ts +3 -0
  384. package/dist/hooks/use-slot/index.js +1 -0
  385. package/dist/hooks/use-slot/merge-props.d.ts +4 -0
  386. package/dist/hooks/use-slot/merge-props.js +27 -0
  387. package/dist/hooks/use-slot/react-version.d.ts +3 -0
  388. package/dist/hooks/use-slot/react-version.js +5 -0
  389. package/dist/hooks/use-slot/types.d.ts +4 -0
  390. package/dist/hooks/use-slot/types.js +1 -0
  391. package/dist/hooks/use-slot/use-slot.d.ts +12 -0
  392. package/dist/hooks/use-slot/use-slot.js +28 -0
  393. package/dist/hooks/use-transitioned-open.d.ts +2 -0
  394. package/dist/hooks/use-transitioned-open.js +50 -0
  395. package/dist/index.d.ts +121 -0
  396. package/dist/index.js +23 -0
  397. package/dist/license/index.d.ts +1 -0
  398. package/dist/license/index.js +1 -0
  399. package/dist/license/license.d.ts +3 -0
  400. package/dist/license/license.js +215 -0
  401. package/dist/license/md5-hash.d.ts +9 -0
  402. package/dist/license/md5-hash.js +167 -0
  403. package/dist/license.d.ts +3 -0
  404. package/dist/license.js +214 -0
  405. package/dist/root/context.d.ts +16 -0
  406. package/dist/root/context.js +4 -0
  407. package/dist/root/hooks/use-pro-api.d.ts +2 -0
  408. package/dist/root/hooks/use-pro-api.js +8 -0
  409. package/dist/root/root.d.ts +15 -0
  410. package/dist/root/root.js +112 -0
  411. package/dist/types/api.d.ts +100 -0
  412. package/dist/types/api.js +1 -0
  413. package/dist/types/column.d.ts +73 -0
  414. package/dist/types/column.js +1 -0
  415. package/dist/types/events.d.ts +56 -0
  416. package/dist/types/events.js +1 -0
  417. package/dist/types/grid.d.ts +47 -0
  418. package/dist/types/grid.js +1 -0
  419. package/dist/types/index.d.ts +7 -0
  420. package/dist/types/index.js +1 -0
  421. package/dist/types/props.d.ts +187 -0
  422. package/dist/types/props.js +1 -0
  423. package/package.json +5 -5
@@ -0,0 +1,18 @@
1
+ const invalidPathRoute = "Invalid path specified. Paths must be built up incrementally.";
2
+ const invalidPathChild = "Invalid path specified. Leaf nodes can have children.";
3
+ export function getParentNodeByPath(tree, path) {
4
+ let target = tree;
5
+ for (let i = 0; i < path.length; i++) {
6
+ const next = target.byPath.get(path[i]);
7
+ if (!next) {
8
+ console.error(invalidPathRoute, path.slice(0, i));
9
+ return null;
10
+ }
11
+ if (next.kind === "leaf") {
12
+ console.error(invalidPathChild, path.slice(0, i));
13
+ return null;
14
+ }
15
+ target = next;
16
+ }
17
+ return target;
18
+ }
@@ -0,0 +1,2 @@
1
+ import type { SetDataAction, TreeParent, TreeRoot } from "./types.js";
2
+ export declare function isSetActionANoOpOnNode(p: SetDataAction, pathNode: TreeParent | TreeRoot): boolean;
@@ -0,0 +1,3 @@
1
+ export function isSetActionANoOpOnNode(p, pathNode) {
2
+ return p.size === pathNode.size && !p.items?.length;
3
+ }
@@ -0,0 +1,2 @@
1
+ import type { TreeRootAndApi } from "./types";
2
+ export declare function makeAsyncTree(): TreeRootAndApi;
@@ -0,0 +1,64 @@
1
+ import { applyDeleteActionToTree } from "./apply-delete-action-to-tree.js";
2
+ import { applySetActionToTree } from "./apply-set-action-to-tree.js";
3
+ import { getParentNodeByPath } from "./get-parent-node-by-path.js";
4
+ export function makeAsyncTree() {
5
+ const tree = {
6
+ kind: "root",
7
+ byIndex: new Map(),
8
+ byPath: new Map(),
9
+ size: 0,
10
+ asOf: Date.now(),
11
+ rowIdToNode: new Map(),
12
+ before: [],
13
+ after: [],
14
+ };
15
+ const api = {
16
+ set: (p) => applySetActionToTree(p, tree),
17
+ delete: (p) => applyDeleteActionToTree(p, tree),
18
+ get: (p) => getParentNodeByPath(tree, p.path),
19
+ addBefore: (leafs) => {
20
+ for (const l of leafs) {
21
+ if (tree.before.find((x) => x.row.id === l.row.id)) {
22
+ console.error(`Attempting to add row with ${l.row.id} but it has already been added.`);
23
+ return;
24
+ }
25
+ if (tree.rowIdToNode.has(l.row.id)) {
26
+ console.error(`Attempt to add row with ${l.row.id} but this row already exists.`);
27
+ return;
28
+ }
29
+ tree.before.push(l);
30
+ tree.rowIdToNode.set(l.row.id, l);
31
+ }
32
+ },
33
+ addAfter: (leafs) => {
34
+ for (const l of leafs) {
35
+ if (tree.after.find((x) => x.row.id === l.row.id)) {
36
+ console.error(`Attempting to add row with ${l.row.id} but it has already been added.`);
37
+ return;
38
+ }
39
+ if (tree.rowIdToNode.has(l.row.id)) {
40
+ console.error(`Attempt to add row with ${l.row.id} but this row already exists.`);
41
+ return;
42
+ }
43
+ tree.after.push(l);
44
+ tree.rowIdToNode.set(l.row.id, l);
45
+ }
46
+ },
47
+ deleteBefore: (leafs) => {
48
+ const found = new Set(leafs.map((l) => tree.before.find((x) => x.row.id === l)).filter((x) => !!x));
49
+ tree.before = tree.before.filter((x) => !found.has(x));
50
+ found.forEach((x) => {
51
+ tree.rowIdToNode.delete(x.row.id);
52
+ });
53
+ },
54
+ deleteAfter: (leafs) => {
55
+ const found = new Set(leafs.map((l) => tree.after.find((x) => x.row.id === l)).filter((x) => !!x));
56
+ tree.after = tree.after.filter((x) => !found.has(x));
57
+ found.forEach((x) => {
58
+ tree.rowIdToNode.delete(x.row.id);
59
+ });
60
+ },
61
+ };
62
+ Object.assign(tree, api);
63
+ return tree;
64
+ }
@@ -0,0 +1,2 @@
1
+ import type { TreeParent, TreeRoot } from "./types.js";
2
+ export declare function maybeApplyParentRemoveSelf(pathNode: TreeParent | TreeRoot): boolean;
@@ -0,0 +1,8 @@
1
+ export function maybeApplyParentRemoveSelf(pathNode) {
2
+ if (!pathNode.size && pathNode.kind === "parent") {
3
+ pathNode.parent.byPath.delete(pathNode.path);
4
+ pathNode.parent.byIndex.delete(pathNode.relIndex);
5
+ return true;
6
+ }
7
+ return false;
8
+ }
@@ -0,0 +1,2 @@
1
+ import type { TreeParent, TreeRoot } from "./types.js";
2
+ export declare function maybeApplyResize(pathNode: TreeParent | TreeRoot, size: number | undefined, asOf: number): boolean;
@@ -0,0 +1,17 @@
1
+ export function maybeApplyResize(pathNode, size, asOf) {
2
+ if (size == null)
3
+ return false;
4
+ if (size === pathNode.size)
5
+ return false;
6
+ if (pathNode.asOf > asOf)
7
+ return false;
8
+ pathNode.size = size;
9
+ // Remove those nodes that are no long within the allowed size
10
+ for (const [number, node] of pathNode.byIndex) {
11
+ if (number >= size) {
12
+ pathNode.byIndex.delete(number);
13
+ pathNode.byPath.delete(node.path);
14
+ }
15
+ }
16
+ return true;
17
+ }
@@ -0,0 +1,2 @@
1
+ import type { SetDataAction, TreeParent, TreeRoot } from "./types.js";
2
+ export declare function maybeApplySetActionItems(p: SetDataAction, pathNode: TreeParent | TreeRoot, root: TreeRoot): boolean;
@@ -0,0 +1,54 @@
1
+ import { ROOT_LEAF_PREFIX } from "./+constants.async-tree.js";
2
+ export function maybeApplySetActionItems(p, pathNode, root) {
3
+ if (!p.items?.length) {
4
+ return false;
5
+ }
6
+ const asOf = p.asOf ?? Date.now();
7
+ for (let i = 0; i < p.items.length; i++) {
8
+ const item = p.items[i];
9
+ const path = item.kind === "leaf" ? `${p.path.at(-1) ?? ROOT_LEAF_PREFIX}#${item.relIndex}` : item.path;
10
+ const existingIndex = pathNode.byIndex.get(item.relIndex);
11
+ if (existingIndex) {
12
+ pathNode.byPath.delete(existingIndex.path);
13
+ pathNode.byIndex.delete(item.relIndex);
14
+ }
15
+ const existingByPath = pathNode.byPath.get(path);
16
+ if (existingByPath) {
17
+ pathNode.byPath.delete(existingByPath.path);
18
+ pathNode.byIndex.delete(existingByPath.relIndex);
19
+ }
20
+ const existing = existingByPath ?? existingIndex;
21
+ // We always replace when making a leaf
22
+ if (item.kind === "leaf") {
23
+ const node = { ...item, parent: pathNode, path: path, asOf };
24
+ const currentI = pathNode.byIndex.get(item.relIndex);
25
+ const currentP = pathNode.byPath.get(path);
26
+ if (!currentI || currentI.asOf < asOf)
27
+ pathNode.byIndex.set(item.relIndex, node);
28
+ if (!currentP || currentP.asOf < asOf)
29
+ pathNode.byPath.set(path, node);
30
+ root.rowIdToNode.set(node.row.id, node);
31
+ }
32
+ else {
33
+ const node = {
34
+ byIndex: existing?.kind === "parent" ? existing.byIndex : new Map(),
35
+ byPath: existing?.kind === "parent" ? existing.byPath : new Map(),
36
+ row: item.row,
37
+ kind: "parent",
38
+ relIndex: item.relIndex,
39
+ parent: pathNode,
40
+ path,
41
+ size: item.size,
42
+ asOf,
43
+ };
44
+ const currentI = pathNode.byIndex.get(item.relIndex);
45
+ const currentP = pathNode.byPath.get(path);
46
+ if (!currentI || currentI.asOf < asOf)
47
+ pathNode.byIndex.set(item.relIndex, node);
48
+ if (!currentP || currentP.asOf < asOf)
49
+ pathNode.byPath.set(path, node);
50
+ root.rowIdToNode.set(node.row.id, node);
51
+ }
52
+ }
53
+ return true;
54
+ }
@@ -0,0 +1,70 @@
1
+ import type { RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
2
+ /**
3
+ * The root of the async tree. This is the entry point of the tree.
4
+ */
5
+ export type TreeRoot = {
6
+ readonly kind: "root";
7
+ readonly byPath: Map<string | null, LeafOrParent>;
8
+ readonly byIndex: Map<number, LeafOrParent>;
9
+ readonly size: number;
10
+ readonly asOf: number;
11
+ readonly rowIdToNode: Map<string, LeafOrParent>;
12
+ before: TreeLeaf[];
13
+ after: TreeLeaf[];
14
+ };
15
+ export type TreeParent = {
16
+ readonly kind: "parent";
17
+ readonly relIndex: number;
18
+ readonly row: RowGroup;
19
+ readonly asOf: number;
20
+ readonly byPath: Map<string | null, LeafOrParent>;
21
+ readonly byIndex: Map<number, LeafOrParent>;
22
+ readonly size: number;
23
+ readonly path: string | null;
24
+ readonly parent: TreeParent | TreeRoot;
25
+ readonly deleted?: boolean;
26
+ };
27
+ export type TreeLeaf = {
28
+ readonly kind: "leaf";
29
+ readonly relIndex: number;
30
+ readonly row: RowLeaf;
31
+ readonly asOf: number;
32
+ readonly parent: TreeParent | TreeRoot;
33
+ readonly path: string;
34
+ readonly deleted?: boolean;
35
+ readonly optimistic?: "start" | "end";
36
+ };
37
+ export type LeafOrParent = TreeLeaf | TreeParent;
38
+ export type TreeRootAndApi = TreeRoot & {
39
+ readonly set: (payload: SetDataAction) => void;
40
+ readonly delete: (path: DeleteDataAction) => void;
41
+ readonly get: (payload: GetDataAction) => TreeRoot | TreeParent | null;
42
+ readonly addBefore: (leafs: TreeLeaf[]) => void;
43
+ readonly addAfter: (leafs: TreeLeaf[]) => void;
44
+ readonly deleteBefore: (ids: string[]) => void;
45
+ readonly deleteAfter: (ids: string[]) => void;
46
+ };
47
+ export interface SetDataAction {
48
+ readonly path: (string | null)[];
49
+ readonly asOf?: number;
50
+ readonly size?: number;
51
+ readonly items?: ({
52
+ kind: "parent";
53
+ path: string | null;
54
+ row: RowGroup;
55
+ relIndex: number;
56
+ size: number;
57
+ } | {
58
+ kind: "leaf";
59
+ row: RowLeaf;
60
+ relIndex: number;
61
+ })[];
62
+ }
63
+ export interface DeleteDataAction {
64
+ readonly path: (string | null)[];
65
+ readonly paths?: string[];
66
+ readonly relIndices?: number[];
67
+ }
68
+ export interface GetDataAction {
69
+ readonly path: (string | null)[];
70
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,66 @@
1
+ import type { TreeParent, TreeRoot } from "../async-tree/types.js";
2
+ /**
3
+ * Represents a flattened range with start/end row indices and an associated path.
4
+ */
5
+ export type FlattenedRange = {
6
+ /** Starting row index (inclusive) */
7
+ rowStart: number;
8
+ /** Ending row index (exclusive) */
9
+ rowEnd: number;
10
+ /** Path identifier for this range */
11
+ parent: TreeParent | TreeRoot;
12
+ };
13
+ /**
14
+ * Represents a node in a range tree, containing a range and its nested child ranges.
15
+ */
16
+ export interface RangeNode {
17
+ /** The range associated with this node */
18
+ range: FlattenedRange;
19
+ /** Child nodes representing nested ranges within this range */
20
+ children: RangeNode[];
21
+ }
22
+ /**
23
+ * A tree structure for efficient nested range operations.
24
+ *
25
+ * Maintains a hierarchical representation of ranges where parent ranges contain their
26
+ * child ranges. Provides methods for querying ranges that contain specific row indices.
27
+ *
28
+ * @remarks
29
+ * The tree is constructed by:
30
+ * 1. Sorting ranges by start index
31
+ * 2. Using the first range as root
32
+ * 3. Inserting subsequent ranges into their appropriate parent nodes
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const ranges = [
37
+ * { rowStart: 0, rowEnd: 100, path: 'root' },
38
+ * { rowStart: 20, rowEnd: 50, path: 'child1' },
39
+ * { rowStart: 30, rowEnd: 40, path: 'grandchild' }
40
+ * ];
41
+ *
42
+ * const tree = new RangeTree(ranges);
43
+ * const rangesAtRow25 = tree.findRangesForRowIndex(25);
44
+ * // Returns [root, child1]
45
+ * ```
46
+ */
47
+ export declare class RangeTree {
48
+ /** Root node of the range tree */
49
+ root: RangeNode;
50
+ /**
51
+ * Creates a new range tree from an array of flattened ranges.
52
+ *
53
+ * @param ranges - Array of ranges to organize into a tree structure
54
+ */
55
+ constructor(ranges: FlattenedRange[]);
56
+ /**
57
+ * Finds all ranges that contain the specified row index.
58
+ *
59
+ * Traverses the tree from root to leaves, collecting all ranges that contain
60
+ * the target index. Returns ranges in order from outermost to innermost.
61
+ *
62
+ * @param index - Row index to search for
63
+ * @returns Array of ranges containing the index, ordered from outer to inner
64
+ */
65
+ findRangesForRowIndex(index: number): FlattenedRange[];
66
+ }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * A tree structure for efficient nested range operations.
3
+ *
4
+ * Maintains a hierarchical representation of ranges where parent ranges contain their
5
+ * child ranges. Provides methods for querying ranges that contain specific row indices.
6
+ *
7
+ * @remarks
8
+ * The tree is constructed by:
9
+ * 1. Sorting ranges by start index
10
+ * 2. Using the first range as root
11
+ * 3. Inserting subsequent ranges into their appropriate parent nodes
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const ranges = [
16
+ * { rowStart: 0, rowEnd: 100, path: 'root' },
17
+ * { rowStart: 20, rowEnd: 50, path: 'child1' },
18
+ * { rowStart: 30, rowEnd: 40, path: 'grandchild' }
19
+ * ];
20
+ *
21
+ * const tree = new RangeTree(ranges);
22
+ * const rangesAtRow25 = tree.findRangesForRowIndex(25);
23
+ * // Returns [root, child1]
24
+ * ```
25
+ */
26
+ export class RangeTree {
27
+ /** Root node of the range tree */
28
+ root;
29
+ /**
30
+ * Creates a new range tree from an array of flattened ranges.
31
+ *
32
+ * @param ranges - Array of ranges to organize into a tree structure
33
+ */
34
+ constructor(ranges) {
35
+ const sortedRanges = ranges.toSorted((left, right) => left.rowStart - right.rowStart);
36
+ const root = { range: sortedRanges[0], children: [] };
37
+ for (let i = 1; i < sortedRanges.length; i++) {
38
+ insert(root, sortedRanges[i]);
39
+ }
40
+ this.root = root;
41
+ }
42
+ /**
43
+ * Finds all ranges that contain the specified row index.
44
+ *
45
+ * Traverses the tree from root to leaves, collecting all ranges that contain
46
+ * the target index. Returns ranges in order from outermost to innermost.
47
+ *
48
+ * @param index - Row index to search for
49
+ * @returns Array of ranges containing the index, ordered from outer to inner
50
+ */
51
+ findRangesForRowIndex(index) {
52
+ const ranges = [];
53
+ let currentNode = this.root;
54
+ while (currentNode) {
55
+ if (index >= currentNode.range.rowStart && index < currentNode.range.rowEnd) {
56
+ ranges.push(currentNode.range);
57
+ currentNode = currentNode.children.find((child) => index >= child.range.rowStart && index < child.range.rowEnd);
58
+ }
59
+ else {
60
+ break;
61
+ }
62
+ }
63
+ return ranges;
64
+ }
65
+ }
66
+ /**
67
+ * Inserts a range into the appropriate position in the range tree.
68
+ *
69
+ * Recursively finds the most deeply nested existing range that contains the new range,
70
+ * then adds the new range as a child of that node.
71
+ *
72
+ * @param node - Current node to check for insertion
73
+ * @param range - Range to insert into the tree
74
+ */
75
+ function insert(node, range) {
76
+ // Check each child to see if it contains this range
77
+ for (const child of node.children) {
78
+ if (containsRange(child.range, range)) {
79
+ insert(child, range);
80
+ return;
81
+ }
82
+ }
83
+ // If we get here, this node is the parent
84
+ node.children.push({
85
+ range,
86
+ children: [],
87
+ });
88
+ }
89
+ /**
90
+ * Determines if one range fully contains another range.
91
+ *
92
+ * A range contains another range if its start index is less than or equal to
93
+ * the inner range's start AND its end index is greater than or equal to
94
+ * the inner range's end.
95
+ *
96
+ * @param outer - The potentially containing range
97
+ * @param inner - The potentially contained range
98
+ * @returns true if outer fully contains inner, false otherwise
99
+ */
100
+ function containsRange(outer, inner) {
101
+ return outer.rowStart <= inner.rowStart && outer.rowEnd >= inner.rowEnd;
102
+ }
@@ -0,0 +1,73 @@
1
+ import { type RowNode } from "@1771technologies/lytenyte-shared";
2
+ import type { LeafOrParent, TreeLeaf, TreeRootAndApi } from "./async-tree/types.js";
3
+ import { RangeTree } from "./range-tree/range-tree.js";
4
+ import type { DataRequest, DataResponse, DataResponsePinned } from "./types.js";
5
+ export type DataFetcher = (req: DataRequest[], expansions: Record<string, boolean | undefined>) => Promise<(DataResponse | DataResponsePinned)[]>;
6
+ export interface FlatView {
7
+ readonly tree: TreeRootAndApi;
8
+ readonly top: number;
9
+ readonly center: number;
10
+ readonly bottom: number;
11
+ readonly rangeTree: RangeTree;
12
+ readonly rowIndexToRow: Map<number, RowNode<any>>;
13
+ readonly rowIdToRow: Map<string, RowNode<any>>;
14
+ readonly rowIdToRowIndex: Map<string, number>;
15
+ readonly rowIdToTreeNode: Map<string, LeafOrParent>;
16
+ readonly loading: Set<number>;
17
+ readonly loadingGroup: Set<number>;
18
+ readonly errored: Map<number, {
19
+ error: unknown;
20
+ request?: DataRequest;
21
+ }>;
22
+ readonly erroredGroup: Map<number, {
23
+ error: unknown;
24
+ request: DataRequest;
25
+ }>;
26
+ readonly maxDepth: number;
27
+ readonly seenRequests: Set<string>;
28
+ }
29
+ export interface ServerDataConstructorParams {
30
+ readonly blocksize: number;
31
+ readonly expansions: Record<string, boolean | undefined>;
32
+ readonly onResetLoadBegin: () => void;
33
+ readonly onResetLoadError: (error: unknown) => void;
34
+ readonly onResetLoadEnd: () => void;
35
+ readonly onFlatten: (r: FlatView) => void;
36
+ readonly onInvalidate: () => void;
37
+ readonly defaultExpansion: boolean | number;
38
+ }
39
+ export declare class ServerData {
40
+ #private;
41
+ tree: TreeRootAndApi;
42
+ flat: FlatView;
43
+ constructor({ blocksize, expansions, onResetLoadBegin, onResetLoadEnd, onResetLoadError, onFlatten, onInvalidate, defaultExpansion, }: ServerDataConstructorParams);
44
+ set dataFetcher(d: DataFetcher);
45
+ set expansions(d: Record<string, boolean | undefined>);
46
+ set defaultExpansion(d: boolean | number);
47
+ set rowViewBounds(viewBounds: [start: number, end: number]);
48
+ reset: () => Promise<void>;
49
+ requestForGroup(i: number): DataRequest | null;
50
+ handleRequests: (requests: DataRequest[], opts?: {
51
+ onError?: (e: unknown) => void;
52
+ onSuccess?: () => void;
53
+ skipState?: boolean;
54
+ }) => Promise<void>;
55
+ handleResponses: (data: (DataResponse | DataResponsePinned)[], beforeOnFlat?: () => void) => void;
56
+ requestForNextSlice(req: DataRequest): {
57
+ id: string;
58
+ path: (string | null)[];
59
+ start: number;
60
+ end: number;
61
+ rowStartIndex: number;
62
+ rowEndIndex: number;
63
+ } | null;
64
+ requestsForView(start?: number, end?: number): DataRequest[];
65
+ handleViewBoundsChange(): Promise<void>;
66
+ retry(): void;
67
+ addBefore(leafs: TreeLeaf[]): void;
68
+ addAfter(leafs: TreeLeaf[]): void;
69
+ deleteBefore(leafs: string[]): void;
70
+ deleteAfter(leafs: string[]): void;
71
+ updateRow(id: string, data: any, asOf?: number): void;
72
+ flatten: () => void;
73
+ }