@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.
- package/dist/__play__/alpha.play.d.ts +3 -0
- package/dist/__play__/alpha.play.js +56 -0
- package/dist/__play__/basic-server-data/data.d.ts +10 -0
- package/dist/__play__/basic-server-data/data.js +17746 -0
- package/dist/__play__/basic-server-data/server.d.ts +36 -0
- package/dist/__play__/basic-server-data/server.js +105 -0
- package/dist/__play__/buttons.play.d.ts +4 -0
- package/dist/__play__/buttons.play.js +7 -0
- package/dist/__play__/inputs.play.d.ts +3 -0
- package/dist/__play__/inputs.play.js +13 -0
- package/dist/__play__/server.play.d.ts +3 -0
- package/dist/__play__/server.play.js +66 -0
- package/dist/__play__/tree.play.d.ts +3 -0
- package/dist/__play__/tree.play.js +47 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
- package/dist/cell-selection/are-rects-equal.d.ts +2 -0
- package/dist/cell-selection/are-rects-equal.js +6 -0
- package/dist/cell-selection/bound-selection-rect.d.ts +3 -0
- package/dist/cell-selection/bound-selection-rect.js +16 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +86 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +79 -0
- package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
- package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
- package/dist/cell-selection/deselect-rect-range.js +43 -0
- package/dist/cell-selection/expand-selection-down.d.ts +3 -0
- package/dist/cell-selection/expand-selection-down.js +78 -0
- package/dist/cell-selection/expand-selection-end.d.ts +3 -0
- package/dist/cell-selection/expand-selection-end.js +76 -0
- package/dist/cell-selection/expand-selection-start.d.ts +3 -0
- package/dist/cell-selection/expand-selection-start.js +73 -0
- package/dist/cell-selection/expand-selection-up.d.ts +3 -0
- package/dist/cell-selection/expand-selection-up.js +74 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +4 -0
- package/dist/cell-selection/get-root-cell.d.ts +3 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +13 -0
- package/dist/cell-selection/index.js +13 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +4 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +3 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +4 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +3 -0
- package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
- package/dist/cell-selection/is-fully-within-rect.js +6 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +5 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +3 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +3 -0
- package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
- package/dist/cell-selection/is-within-selection-rect.js +3 -0
- package/dist/cell-selection/split-cell-selection-rect.d.ts +47 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
- package/dist/cell-selection/update-additive-cell-selection.js +21 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
- package/dist/cell-selection/use-edge-scroll.js +71 -0
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.js +42 -0
- package/dist/components/checkbox/checkbox.play.d.ts +2 -0
- package/dist/components/checkbox/checkbox.play.js +6 -0
- package/dist/components/column-manager/column-manager.d.ts +13 -0
- package/dist/components/column-manager/column-manager.js +47 -0
- package/dist/components/external/clsx.d.ts +2 -0
- package/dist/components/external/clsx.js +44 -0
- package/dist/components/external/floating-ui.d.ts +268 -0
- package/dist/components/external/floating-ui.js +1802 -0
- package/dist/components/headless/dialog/arrow.d.ts +6 -0
- package/dist/components/headless/dialog/arrow.js +16 -0
- package/dist/components/headless/dialog/close.d.ts +10 -0
- package/dist/components/headless/dialog/close.js +22 -0
- package/dist/components/headless/dialog/container.d.ts +5 -0
- package/dist/components/headless/dialog/container.js +221 -0
- package/dist/components/headless/dialog/context.d.ts +32 -0
- package/dist/components/headless/dialog/context.js +3 -0
- package/dist/components/headless/dialog/description.d.ts +9 -0
- package/dist/components/headless/dialog/description.js +20 -0
- package/dist/components/headless/dialog/index.parts.d.ts +30 -0
- package/dist/components/headless/dialog/index.parts.js +17 -0
- package/dist/components/headless/dialog/root.d.ts +32 -0
- package/dist/components/headless/dialog/root.js +75 -0
- package/dist/components/headless/dialog/title.d.ts +9 -0
- package/dist/components/headless/dialog/title.js +20 -0
- package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
- package/dist/components/headless/dialog/transform-origin.js +38 -0
- package/dist/components/headless/dialog/trigger.d.ts +10 -0
- package/dist/components/headless/dialog/trigger.js +24 -0
- package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
- package/dist/components/headless/dialog/use-dialog.js +12 -0
- package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
- package/dist/components/headless/menu/checkbox-item.js +42 -0
- package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
- package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
- package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-context.js +3 -0
- package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
- package/dist/components/headless/menu/combo/combo-input.js +58 -0
- package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
- package/dist/components/headless/menu/combo/combo-menu.js +24 -0
- package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-option.js +37 -0
- package/dist/components/headless/menu/container.d.ts +5 -0
- package/dist/components/headless/menu/container.js +19 -0
- package/dist/components/headless/menu/dom.d.ts +4 -0
- package/dist/components/headless/menu/dom.js +20 -0
- package/dist/components/headless/menu/index.d.ts +54 -0
- package/dist/components/headless/menu/index.js +39 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
- package/dist/components/headless/menu/item/item.d.ts +9 -0
- package/dist/components/headless/menu/item/item.js +45 -0
- package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
- package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
- package/dist/components/headless/menu/menu-divider.d.ts +5 -0
- package/dist/components/headless/menu/menu-divider.js +6 -0
- package/dist/components/headless/menu/menu-group.d.ts +5 -0
- package/dist/components/headless/menu/menu-group.js +6 -0
- package/dist/components/headless/menu/menu-header.d.ts +5 -0
- package/dist/components/headless/menu/menu-header.js +6 -0
- package/dist/components/headless/menu/popover.d.ts +5 -0
- package/dist/components/headless/menu/popover.js +7 -0
- package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
- package/dist/components/headless/menu/radio-group/context.js +7 -0
- package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
- package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
- package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
- package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
- package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
- package/dist/components/headless/menu/submenu/submenu.js +55 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
- package/dist/components/headless/menu/use-menu.d.ts +1 -0
- package/dist/components/headless/menu/use-menu.js +52 -0
- package/dist/components/headless/popover/container.d.ts +5 -0
- package/dist/components/headless/popover/container.js +7 -0
- package/dist/components/headless/popover/context.d.ts +6 -0
- package/dist/components/headless/popover/context.js +3 -0
- package/dist/components/headless/popover/index.d.ts +30 -0
- package/dist/components/headless/popover/index.js +17 -0
- package/dist/components/headless/popover/root.d.ts +6 -0
- package/dist/components/headless/popover/root.js +8 -0
- package/dist/components/headless/popover/trigger.d.ts +7 -0
- package/dist/components/headless/popover/trigger.js +11 -0
- package/dist/components/pill-manager/container.d.ts +5 -0
- package/dist/components/pill-manager/container.js +127 -0
- package/dist/components/pill-manager/expander.d.ts +9 -0
- package/dist/components/pill-manager/expander.js +21 -0
- package/dist/components/pill-manager/icons.d.ts +12 -0
- package/dist/components/pill-manager/icons.js +35 -0
- package/dist/components/pill-manager/index.d.ts +33 -0
- package/dist/components/pill-manager/index.js +13 -0
- package/dist/components/pill-manager/item.d.ts +10 -0
- package/dist/components/pill-manager/item.js +178 -0
- package/dist/components/pill-manager/label.d.ts +10 -0
- package/dist/components/pill-manager/label.js +31 -0
- package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
- package/dist/components/pill-manager/pill-manager.play.js +73 -0
- package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
- package/dist/components/pill-manager/pill-row.context.js +4 -0
- package/dist/components/pill-manager/pill-row.d.ts +12 -0
- package/dist/components/pill-manager/pill-row.js +22 -0
- package/dist/components/pill-manager/root.context.d.ts +40 -0
- package/dist/components/pill-manager/root.context.js +4 -0
- package/dist/components/pill-manager/root.d.ts +25 -0
- package/dist/components/pill-manager/root.js +33 -0
- package/dist/components/pill-manager/row-default.d.ts +3 -0
- package/dist/components/pill-manager/row-default.js +14 -0
- package/dist/components/pill-manager/types.d.ts +21 -0
- package/dist/components/pill-manager/types.js +1 -0
- package/dist/components/row-group-cell.d.ts +13 -0
- package/dist/components/row-group-cell.js +40 -0
- package/dist/components/select-all.d.ts +12 -0
- package/dist/components/select-all.js +34 -0
- package/dist/components/smart-select/chip-context.d.ts +8 -0
- package/dist/components/smart-select/chip-context.js +4 -0
- package/dist/components/smart-select/chip-remove.d.ts +1 -0
- package/dist/components/smart-select/chip-remove.js +13 -0
- package/dist/components/smart-select/chip.d.ts +13 -0
- package/dist/components/smart-select/chip.js +79 -0
- package/dist/components/smart-select/container.d.ts +1 -0
- package/dist/components/smart-select/container.js +13 -0
- package/dist/components/smart-select/context.d.ts +31 -0
- package/dist/components/smart-select/context.js +4 -0
- package/dist/components/smart-select/index.d.ts +30 -0
- package/dist/components/smart-select/index.js +19 -0
- package/dist/components/smart-select/option.d.ts +8 -0
- package/dist/components/smart-select/option.js +36 -0
- package/dist/components/smart-select/root.d.ts +17 -0
- package/dist/components/smart-select/root.js +165 -0
- package/dist/components/smart-select/smart-select.play.d.ts +2 -0
- package/dist/components/smart-select/smart-select.play.js +36 -0
- package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
- package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
- package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
- package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
- package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
- package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
- package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
- package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
- package/dist/components/smart-select/type.d.ts +44 -0
- package/dist/components/smart-select/type.js +1 -0
- package/dist/components/smart-select/use-async-options.d.ts +8 -0
- package/dist/components/smart-select/use-async-options.js +42 -0
- package/dist/components/tree-view/index.d.ts +4 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/root.d.ts +37 -0
- package/dist/components/tree-view/root.js +139 -0
- package/dist/components/tree-view/select-all.d.ts +7 -0
- package/dist/components/tree-view/select-all.js +22 -0
- package/dist/components/tree-view/tree-children.d.ts +2 -0
- package/dist/components/tree-view/tree-children.js +15 -0
- package/dist/components/tree-view/types.d.ts +31 -0
- package/dist/components/tree-view/types.js +1 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/components/types.js +1 -0
- package/dist/components/virtual-from-coordinates.d.ts +2 -0
- package/dist/components/virtual-from-coordinates.js +15 -0
- package/dist/components.d.ts +16 -0
- package/dist/components.js +11 -0
- package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
- package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
- package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
- package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
- package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
- package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
- package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
- package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
- package/dist/data-source-client/use-client-data-source.d.ts +91 -0
- package/dist/data-source-client/use-client-data-source.js +169 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
- package/dist/data-source-server/async-tree/types.d.ts +70 -0
- package/dist/data-source-server/async-tree/types.js +1 -0
- package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/data-source-server/range-tree/range-tree.js +102 -0
- package/dist/data-source-server/server-data.d.ts +73 -0
- package/dist/data-source-server/server-data.js +553 -0
- package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
- package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
- package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
- package/dist/data-source-server/source/use-on-view-change.js +13 -0
- package/dist/data-source-server/source/use-row-add.d.ts +3 -0
- package/dist/data-source-server/source/use-row-add.js +36 -0
- package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-by-id.js +8 -0
- package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
- package/dist/data-source-server/source/use-row-by-index.js +89 -0
- package/dist/data-source-server/source/use-row-children.d.ts +2 -0
- package/dist/data-source-server/source/use-row-children.js +16 -0
- package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
- package/dist/data-source-server/source/use-row-delete.js +39 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
- package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-server/source/use-row-leafs.js +20 -0
- package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-server/source/use-row-parents.js +16 -0
- package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-server/source/use-row-siblings.js +15 -0
- package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
- package/dist/data-source-server/source/use-rows-between.js +20 -0
- package/dist/data-source-server/source/use-source-state.d.ts +28 -0
- package/dist/data-source-server/source/use-source-state.js +47 -0
- package/dist/data-source-server/source/use-source.d.ts +5 -0
- package/dist/data-source-server/source/use-source.js +66 -0
- package/dist/data-source-server/types.d.ts +42 -0
- package/dist/data-source-server/types.js +1 -0
- package/dist/data-source-server/use-server-data-source.d.ts +51 -0
- package/dist/data-source-server/use-server-data-source.js +192 -0
- package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-depth.js +9 -0
- package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-path.js +9 -0
- package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/data-source-server/utils/get-request-id.js +6 -0
- package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
- package/dist/data-source-tree/source/use-controlled-state.js +21 -0
- package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
- package/dist/data-source-tree/source/use-flattened.js +65 -0
- package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
- package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
- package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-by-id.js +7 -0
- package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-children.js +11 -0
- package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-leafs.js +20 -0
- package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-parents.js +16 -0
- package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-siblings.js +12 -0
- package/dist/data-source-tree/source/use-tree.d.ts +3 -0
- package/dist/data-source-tree/source/use-tree.js +59 -0
- package/dist/data-source-tree/types.d.ts +16 -0
- package/dist/data-source-tree/types.js +1 -0
- package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
- package/dist/data-source-tree/use-tree-data-source.js +101 -0
- package/dist/data-source-tree/utils/is-object.d.ts +1 -0
- package/dist/data-source-tree/utils/is-object.js +3 -0
- package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
- package/dist/hooks/use-slot/get-element-ref.js +20 -0
- package/dist/hooks/use-slot/index.d.ts +3 -0
- package/dist/hooks/use-slot/index.js +1 -0
- package/dist/hooks/use-slot/merge-props.d.ts +4 -0
- package/dist/hooks/use-slot/merge-props.js +27 -0
- package/dist/hooks/use-slot/react-version.d.ts +3 -0
- package/dist/hooks/use-slot/react-version.js +5 -0
- package/dist/hooks/use-slot/types.d.ts +4 -0
- package/dist/hooks/use-slot/types.js +1 -0
- package/dist/hooks/use-slot/use-slot.d.ts +12 -0
- package/dist/hooks/use-slot/use-slot.js +28 -0
- package/dist/hooks/use-transitioned-open.d.ts +2 -0
- package/dist/hooks/use-transitioned-open.js +50 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +23 -0
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/root/context.d.ts +16 -0
- package/dist/root/context.js +4 -0
- package/dist/root/hooks/use-pro-api.d.ts +2 -0
- package/dist/root/hooks/use-pro-api.js +8 -0
- package/dist/root/root.d.ts +15 -0
- package/dist/root/root.js +112 -0
- package/dist/types/api.d.ts +100 -0
- package/dist/types/api.js +1 -0
- package/dist/types/column.d.ts +73 -0
- package/dist/types/column.js +1 -0
- package/dist/types/events.d.ts +56 -0
- package/dist/types/events.js +1 -0
- package/dist/types/grid.d.ts +47 -0
- package/dist/types/grid.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +1 -0
- package/dist/types/props.d.ts +187 -0
- package/dist/types/props.js +1 -0
- 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,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,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,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
|
+
}
|