tuiuiu.js 0.1.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/LICENSE +21 -0
- package/README.md +324 -0
- package/dist/app/index.d.ts +9 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +12 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/render-loop.d.ts +51 -0
- package/dist/app/render-loop.d.ts.map +1 -0
- package/dist/app/render-loop.js +263 -0
- package/dist/app/render-loop.js.map +1 -0
- package/dist/atoms/button.d.ts +109 -0
- package/dist/atoms/button.d.ts.map +1 -0
- package/dist/atoms/button.js +173 -0
- package/dist/atoms/button.js.map +1 -0
- package/dist/atoms/index.d.ts +29 -0
- package/dist/atoms/index.d.ts.map +1 -0
- package/dist/atoms/index.js +53 -0
- package/dist/atoms/index.js.map +1 -0
- package/dist/atoms/progress-bar.d.ts +96 -0
- package/dist/atoms/progress-bar.d.ts.map +1 -0
- package/dist/atoms/progress-bar.js +443 -0
- package/dist/atoms/progress-bar.js.map +1 -0
- package/dist/atoms/slider.d.ts +137 -0
- package/dist/atoms/slider.d.ts.map +1 -0
- package/dist/atoms/slider.js +317 -0
- package/dist/atoms/slider.js.map +1 -0
- package/dist/atoms/spinner.d.ts +91 -0
- package/dist/atoms/spinner.d.ts.map +1 -0
- package/dist/atoms/spinner.js +650 -0
- package/dist/atoms/spinner.js.map +1 -0
- package/dist/atoms/switch.d.ts +102 -0
- package/dist/atoms/switch.d.ts.map +1 -0
- package/dist/atoms/switch.js +176 -0
- package/dist/atoms/switch.js.map +1 -0
- package/dist/atoms/text-input.d.ts +82 -0
- package/dist/atoms/text-input.d.ts.map +1 -0
- package/dist/atoms/text-input.js +347 -0
- package/dist/atoms/text-input.js.map +1 -0
- package/dist/atoms/timer.d.ts +178 -0
- package/dist/atoms/timer.d.ts.map +1 -0
- package/dist/atoms/timer.js +355 -0
- package/dist/atoms/timer.js.map +1 -0
- package/dist/atoms/tooltip.d.ts +191 -0
- package/dist/atoms/tooltip.d.ts.map +1 -0
- package/dist/atoms/tooltip.js +279 -0
- package/dist/atoms/tooltip.js.map +1 -0
- package/dist/components/canvas.d.ts +322 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +833 -0
- package/dist/components/canvas.js.map +1 -0
- package/dist/components/code-block.d.ts +75 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +322 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/components.d.ts +122 -0
- package/dist/components/components.d.ts.map +1 -0
- package/dist/components/components.js +151 -0
- package/dist/components/components.js.map +1 -0
- package/dist/components/data-viz/bar-chart.d.ts +167 -0
- package/dist/components/data-viz/bar-chart.d.ts.map +1 -0
- package/dist/components/data-viz/bar-chart.js +375 -0
- package/dist/components/data-viz/bar-chart.js.map +1 -0
- package/dist/components/data-viz/gauge.d.ts +163 -0
- package/dist/components/data-viz/gauge.d.ts.map +1 -0
- package/dist/components/data-viz/gauge.js +451 -0
- package/dist/components/data-viz/gauge.js.map +1 -0
- package/dist/components/data-viz/heatmap.d.ts +154 -0
- package/dist/components/data-viz/heatmap.d.ts.map +1 -0
- package/dist/components/data-viz/heatmap.js +458 -0
- package/dist/components/data-viz/heatmap.js.map +1 -0
- package/dist/components/data-viz/index.d.ts +16 -0
- package/dist/components/data-viz/index.d.ts.map +1 -0
- package/dist/components/data-viz/index.js +16 -0
- package/dist/components/data-viz/index.js.map +1 -0
- package/dist/components/data-viz/line-chart.d.ts +157 -0
- package/dist/components/data-viz/line-chart.d.ts.map +1 -0
- package/dist/components/data-viz/line-chart.js +578 -0
- package/dist/components/data-viz/line-chart.js.map +1 -0
- package/dist/components/data-viz/sparkline.d.ts +156 -0
- package/dist/components/data-viz/sparkline.d.ts.map +1 -0
- package/dist/components/data-viz/sparkline.js +325 -0
- package/dist/components/data-viz/sparkline.js.map +1 -0
- package/dist/components/grid.d.ts +234 -0
- package/dist/components/grid.d.ts.map +1 -0
- package/dist/components/grid.js +719 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +69 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/markdown.d.ts +52 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +341 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/modal.d.ts +237 -0
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/modal.js +396 -0
- package/dist/components/modal.js.map +1 -0
- package/dist/components/progress-bar.d.ts +89 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar.js +288 -0
- package/dist/components/progress-bar.js.map +1 -0
- package/dist/components/select.d.ts +114 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +415 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/spinner.d.ts +71 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +300 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/split-panel.d.ts +175 -0
- package/dist/components/split-panel.d.ts.map +1 -0
- package/dist/components/split-panel.js +322 -0
- package/dist/components/split-panel.js.map +1 -0
- package/dist/components/table.d.ts +103 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +359 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/text-input.d.ts +79 -0
- package/dist/components/text-input.d.ts.map +1 -0
- package/dist/components/text-input.js +332 -0
- package/dist/components/text-input.js.map +1 -0
- package/dist/core/animation.d.ts +262 -0
- package/dist/core/animation.d.ts.map +1 -0
- package/dist/core/animation.js +626 -0
- package/dist/core/animation.js.map +1 -0
- package/dist/core/buffer.d.ts +179 -0
- package/dist/core/buffer.d.ts.map +1 -0
- package/dist/core/buffer.js +549 -0
- package/dist/core/buffer.js.map +1 -0
- package/dist/core/capabilities.d.ts +184 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +393 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/colors.d.ts +111 -0
- package/dist/core/colors.d.ts.map +1 -0
- package/dist/core/colors.js +417 -0
- package/dist/core/colors.js.map +1 -0
- package/dist/core/command-palette.d.ts +220 -0
- package/dist/core/command-palette.d.ts.map +1 -0
- package/dist/core/command-palette.js +564 -0
- package/dist/core/command-palette.js.map +1 -0
- package/dist/core/constraint.d.ts +315 -0
- package/dist/core/constraint.d.ts.map +1 -0
- package/dist/core/constraint.js +651 -0
- package/dist/core/constraint.js.map +1 -0
- package/dist/core/delta-render.d.ts +64 -0
- package/dist/core/delta-render.d.ts.map +1 -0
- package/dist/core/delta-render.js +367 -0
- package/dist/core/delta-render.js.map +1 -0
- package/dist/core/dirty.d.ts +181 -0
- package/dist/core/dirty.d.ts.map +1 -0
- package/dist/core/dirty.js +335 -0
- package/dist/core/dirty.js.map +1 -0
- package/dist/core/error-boundary.d.ts +79 -0
- package/dist/core/error-boundary.d.ts.map +1 -0
- package/dist/core/error-boundary.js +258 -0
- package/dist/core/error-boundary.js.map +1 -0
- package/dist/core/events.d.ts +206 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +411 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/focus.d.ts +294 -0
- package/dist/core/focus.d.ts.map +1 -0
- package/dist/core/focus.js +589 -0
- package/dist/core/focus.js.map +1 -0
- package/dist/core/graphics.d.ts +146 -0
- package/dist/core/graphics.d.ts.map +1 -0
- package/dist/core/graphics.js +561 -0
- package/dist/core/graphics.js.map +1 -0
- package/dist/core/highlighter.d.ts +148 -0
- package/dist/core/highlighter.d.ts.map +1 -0
- package/dist/core/highlighter.js +2726 -0
- package/dist/core/highlighter.js.map +1 -0
- package/dist/core/hit-test.d.ts +126 -0
- package/dist/core/hit-test.d.ts.map +1 -0
- package/dist/core/hit-test.js +336 -0
- package/dist/core/hit-test.js.map +1 -0
- package/dist/core/index.d.ts +58 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +254 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input.d.ts +241 -0
- package/dist/core/input.d.ts.map +1 -0
- package/dist/core/input.js +768 -0
- package/dist/core/input.js.map +1 -0
- package/dist/core/keybindings.d.ts +256 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +532 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/layout.d.ts +30 -0
- package/dist/core/layout.d.ts.map +1 -0
- package/dist/core/layout.js +347 -0
- package/dist/core/layout.js.map +1 -0
- package/dist/core/overlay.d.ts +318 -0
- package/dist/core/overlay.d.ts.map +1 -0
- package/dist/core/overlay.js +794 -0
- package/dist/core/overlay.js.map +1 -0
- package/dist/core/query.d.ts +155 -0
- package/dist/core/query.d.ts.map +1 -0
- package/dist/core/query.js +616 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/renderer.d.ts +28 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/core/renderer.js +403 -0
- package/dist/core/renderer.js.map +1 -0
- package/dist/core/router.d.ts +401 -0
- package/dist/core/router.d.ts.map +1 -0
- package/dist/core/router.js +766 -0
- package/dist/core/router.js.map +1 -0
- package/dist/core/screen.d.ts +302 -0
- package/dist/core/screen.d.ts.map +1 -0
- package/dist/core/screen.js +537 -0
- package/dist/core/screen.js.map +1 -0
- package/dist/core/signal.d.ts +136 -0
- package/dist/core/signal.d.ts.map +1 -0
- package/dist/core/signal.js +336 -0
- package/dist/core/signal.js.map +1 -0
- package/dist/core/theme.d.ts +220 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/theme.js +499 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/tick.d.ts +107 -0
- package/dist/core/tick.d.ts.map +1 -0
- package/dist/core/tick.js +174 -0
- package/dist/core/tick.js.map +1 -0
- package/dist/core/transitions.d.ts +335 -0
- package/dist/core/transitions.d.ts.map +1 -0
- package/dist/core/transitions.js +650 -0
- package/dist/core/transitions.js.map +1 -0
- package/dist/core/virtual-scroll.d.ts +241 -0
- package/dist/core/virtual-scroll.d.ts.map +1 -0
- package/dist/core/virtual-scroll.js +476 -0
- package/dist/core/virtual-scroll.js.map +1 -0
- package/dist/core/visualization.d.ts +248 -0
- package/dist/core/visualization.d.ts.map +1 -0
- package/dist/core/visualization.js +709 -0
- package/dist/core/visualization.js.map +1 -0
- package/dist/design-system/core/index.d.ts +6 -0
- package/dist/design-system/core/index.d.ts.map +1 -0
- package/dist/design-system/core/index.js +6 -0
- package/dist/design-system/core/index.js.map +1 -0
- package/dist/design-system/core/layout.d.ts +30 -0
- package/dist/design-system/core/layout.d.ts.map +1 -0
- package/dist/design-system/core/layout.js +344 -0
- package/dist/design-system/core/layout.js.map +1 -0
- package/dist/design-system/core/renderer.d.ts +28 -0
- package/dist/design-system/core/renderer.d.ts.map +1 -0
- package/dist/design-system/core/renderer.js +418 -0
- package/dist/design-system/core/renderer.js.map +1 -0
- package/dist/design-system/data-display/calendar.d.ts +141 -0
- package/dist/design-system/data-display/calendar.d.ts.map +1 -0
- package/dist/design-system/data-display/calendar.js +524 -0
- package/dist/design-system/data-display/calendar.js.map +1 -0
- package/dist/design-system/data-display/code-block.d.ts +75 -0
- package/dist/design-system/data-display/code-block.d.ts.map +1 -0
- package/dist/design-system/data-display/code-block.js +311 -0
- package/dist/design-system/data-display/code-block.js.map +1 -0
- package/dist/design-system/data-display/data-table.d.ts +173 -0
- package/dist/design-system/data-display/data-table.d.ts.map +1 -0
- package/dist/design-system/data-display/data-table.js +428 -0
- package/dist/design-system/data-display/data-table.js.map +1 -0
- package/dist/design-system/data-display/index.d.ts +10 -0
- package/dist/design-system/data-display/index.d.ts.map +1 -0
- package/dist/design-system/data-display/index.js +16 -0
- package/dist/design-system/data-display/index.js.map +1 -0
- package/dist/design-system/data-display/markdown.d.ts +52 -0
- package/dist/design-system/data-display/markdown.d.ts.map +1 -0
- package/dist/design-system/data-display/markdown.js +341 -0
- package/dist/design-system/data-display/markdown.js.map +1 -0
- package/dist/design-system/data-display/table.d.ts +103 -0
- package/dist/design-system/data-display/table.d.ts.map +1 -0
- package/dist/design-system/data-display/table.js +342 -0
- package/dist/design-system/data-display/table.js.map +1 -0
- package/dist/design-system/data-display/tree.d.ts +166 -0
- package/dist/design-system/data-display/tree.d.ts.map +1 -0
- package/dist/design-system/data-display/tree.js +428 -0
- package/dist/design-system/data-display/tree.js.map +1 -0
- package/dist/design-system/feedback/badge.d.ts +21 -0
- package/dist/design-system/feedback/badge.d.ts.map +1 -0
- package/dist/design-system/feedback/badge.js +9 -0
- package/dist/design-system/feedback/badge.js.map +1 -0
- package/dist/design-system/feedback/index.d.ts +8 -0
- package/dist/design-system/feedback/index.d.ts.map +1 -0
- package/dist/design-system/feedback/index.js +12 -0
- package/dist/design-system/feedback/index.js.map +1 -0
- package/dist/design-system/feedback/progress-bar.d.ts +93 -0
- package/dist/design-system/feedback/progress-bar.d.ts.map +1 -0
- package/dist/design-system/feedback/progress-bar.js +440 -0
- package/dist/design-system/feedback/progress-bar.js.map +1 -0
- package/dist/design-system/feedback/spinner.d.ts +88 -0
- package/dist/design-system/feedback/spinner.d.ts.map +1 -0
- package/dist/design-system/feedback/spinner.js +679 -0
- package/dist/design-system/feedback/spinner.js.map +1 -0
- package/dist/design-system/feedback/timer.d.ts +175 -0
- package/dist/design-system/feedback/timer.d.ts.map +1 -0
- package/dist/design-system/feedback/timer.js +352 -0
- package/dist/design-system/feedback/timer.js.map +1 -0
- package/dist/design-system/forms/autocomplete.d.ts +163 -0
- package/dist/design-system/forms/autocomplete.d.ts.map +1 -0
- package/dist/design-system/forms/autocomplete.js +455 -0
- package/dist/design-system/forms/autocomplete.js.map +1 -0
- package/dist/design-system/forms/button.d.ts +106 -0
- package/dist/design-system/forms/button.d.ts.map +1 -0
- package/dist/design-system/forms/button.js +170 -0
- package/dist/design-system/forms/button.js.map +1 -0
- package/dist/design-system/forms/index.d.ts +12 -0
- package/dist/design-system/forms/index.d.ts.map +1 -0
- package/dist/design-system/forms/index.js +20 -0
- package/dist/design-system/forms/index.js.map +1 -0
- package/dist/design-system/forms/multi-select.d.ts +102 -0
- package/dist/design-system/forms/multi-select.d.ts.map +1 -0
- package/dist/design-system/forms/multi-select.js +309 -0
- package/dist/design-system/forms/multi-select.js.map +1 -0
- package/dist/design-system/forms/radio-group.d.ts +88 -0
- package/dist/design-system/forms/radio-group.d.ts.map +1 -0
- package/dist/design-system/forms/radio-group.js +145 -0
- package/dist/design-system/forms/radio-group.js.map +1 -0
- package/dist/design-system/forms/select.d.ts +116 -0
- package/dist/design-system/forms/select.d.ts.map +1 -0
- package/dist/design-system/forms/select.js +441 -0
- package/dist/design-system/forms/select.js.map +1 -0
- package/dist/design-system/forms/slider.d.ts +134 -0
- package/dist/design-system/forms/slider.d.ts.map +1 -0
- package/dist/design-system/forms/slider.js +314 -0
- package/dist/design-system/forms/slider.js.map +1 -0
- package/dist/design-system/forms/switch.d.ts +99 -0
- package/dist/design-system/forms/switch.d.ts.map +1 -0
- package/dist/design-system/forms/switch.js +173 -0
- package/dist/design-system/forms/switch.js.map +1 -0
- package/dist/design-system/forms/text-input.d.ts +79 -0
- package/dist/design-system/forms/text-input.d.ts.map +1 -0
- package/dist/design-system/forms/text-input.js +344 -0
- package/dist/design-system/forms/text-input.js.map +1 -0
- package/dist/design-system/index.d.ts +23 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +74 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/layout/app.d.ts +205 -0
- package/dist/design-system/layout/app.d.ts.map +1 -0
- package/dist/design-system/layout/app.js +286 -0
- package/dist/design-system/layout/app.js.map +1 -0
- package/dist/design-system/layout/collapsible.d.ts +166 -0
- package/dist/design-system/layout/collapsible.d.ts.map +1 -0
- package/dist/design-system/layout/collapsible.js +286 -0
- package/dist/design-system/layout/collapsible.js.map +1 -0
- package/dist/design-system/layout/grid.d.ts +232 -0
- package/dist/design-system/layout/grid.d.ts.map +1 -0
- package/dist/design-system/layout/grid.js +333 -0
- package/dist/design-system/layout/grid.js.map +1 -0
- package/dist/design-system/layout/index.d.ts +27 -0
- package/dist/design-system/layout/index.d.ts.map +1 -0
- package/dist/design-system/layout/index.js +34 -0
- package/dist/design-system/layout/index.js.map +1 -0
- package/dist/design-system/layout/scroll-area.d.ts +188 -0
- package/dist/design-system/layout/scroll-area.d.ts.map +1 -0
- package/dist/design-system/layout/scroll-area.js +348 -0
- package/dist/design-system/layout/scroll-area.js.map +1 -0
- package/dist/design-system/layout/split-panel.d.ts +183 -0
- package/dist/design-system/layout/split-panel.d.ts.map +1 -0
- package/dist/design-system/layout/split-panel.js +323 -0
- package/dist/design-system/layout/split-panel.js.map +1 -0
- package/dist/design-system/layout/stack.d.ts +189 -0
- package/dist/design-system/layout/stack.d.ts.map +1 -0
- package/dist/design-system/layout/stack.js +170 -0
- package/dist/design-system/layout/stack.js.map +1 -0
- package/dist/design-system/layout/tabs.d.ts +129 -0
- package/dist/design-system/layout/tabs.d.ts.map +1 -0
- package/dist/design-system/layout/tabs.js +373 -0
- package/dist/design-system/layout/tabs.js.map +1 -0
- package/dist/design-system/media/index.d.ts +13 -0
- package/dist/design-system/media/index.d.ts.map +1 -0
- package/dist/design-system/media/index.js +23 -0
- package/dist/design-system/media/index.js.map +1 -0
- package/dist/design-system/media/picture.d.ts +304 -0
- package/dist/design-system/media/picture.d.ts.map +1 -0
- package/dist/design-system/media/picture.js +681 -0
- package/dist/design-system/media/picture.js.map +1 -0
- package/dist/design-system/navigation/file-manager.d.ts +492 -0
- package/dist/design-system/navigation/file-manager.d.ts.map +1 -0
- package/dist/design-system/navigation/file-manager.js +807 -0
- package/dist/design-system/navigation/file-manager.js.map +1 -0
- package/dist/design-system/navigation/index.d.ts +13 -0
- package/dist/design-system/navigation/index.d.ts.map +1 -0
- package/dist/design-system/navigation/index.js +19 -0
- package/dist/design-system/navigation/index.js.map +1 -0
- package/dist/design-system/overlays/command-palette.d.ts +217 -0
- package/dist/design-system/overlays/command-palette.d.ts.map +1 -0
- package/dist/design-system/overlays/command-palette.js +443 -0
- package/dist/design-system/overlays/command-palette.js.map +1 -0
- package/dist/design-system/overlays/index.d.ts +7 -0
- package/dist/design-system/overlays/index.d.ts.map +1 -0
- package/dist/design-system/overlays/index.js +10 -0
- package/dist/design-system/overlays/index.js.map +1 -0
- package/dist/design-system/overlays/modal.d.ts +251 -0
- package/dist/design-system/overlays/modal.d.ts.map +1 -0
- package/dist/design-system/overlays/modal.js +461 -0
- package/dist/design-system/overlays/modal.js.map +1 -0
- package/dist/design-system/overlays/overlay-stack.d.ts +200 -0
- package/dist/design-system/overlays/overlay-stack.d.ts.map +1 -0
- package/dist/design-system/overlays/overlay-stack.js +341 -0
- package/dist/design-system/overlays/overlay-stack.js.map +1 -0
- package/dist/design-system/primitives/box.d.ts +16 -0
- package/dist/design-system/primitives/box.d.ts.map +1 -0
- package/dist/design-system/primitives/box.js +23 -0
- package/dist/design-system/primitives/box.js.map +1 -0
- package/dist/design-system/primitives/divider.d.ts +52 -0
- package/dist/design-system/primitives/divider.d.ts.map +1 -0
- package/dist/design-system/primitives/divider.js +72 -0
- package/dist/design-system/primitives/divider.js.map +1 -0
- package/dist/design-system/primitives/helpers.d.ts +10 -0
- package/dist/design-system/primitives/helpers.d.ts.map +1 -0
- package/dist/design-system/primitives/helpers.js +27 -0
- package/dist/design-system/primitives/helpers.js.map +1 -0
- package/dist/design-system/primitives/index.d.ts +11 -0
- package/dist/design-system/primitives/index.d.ts.map +1 -0
- package/dist/design-system/primitives/index.js +14 -0
- package/dist/design-system/primitives/index.js.map +1 -0
- package/dist/design-system/primitives/slot.d.ts +35 -0
- package/dist/design-system/primitives/slot.d.ts.map +1 -0
- package/dist/design-system/primitives/slot.js +17 -0
- package/dist/design-system/primitives/slot.js.map +1 -0
- package/dist/design-system/primitives/spacer.d.ts +34 -0
- package/dist/design-system/primitives/spacer.d.ts.map +1 -0
- package/dist/design-system/primitives/spacer.js +53 -0
- package/dist/design-system/primitives/spacer.js.map +1 -0
- package/dist/design-system/primitives/text.d.ts +12 -0
- package/dist/design-system/primitives/text.d.ts.map +1 -0
- package/dist/design-system/primitives/text.js +25 -0
- package/dist/design-system/primitives/text.js.map +1 -0
- package/dist/design-system/primitives/utilities.d.ts +70 -0
- package/dist/design-system/primitives/utilities.d.ts.map +1 -0
- package/dist/design-system/primitives/utilities.js +56 -0
- package/dist/design-system/primitives/utilities.js.map +1 -0
- package/dist/design-system/visual/big-text.d.ts +151 -0
- package/dist/design-system/visual/big-text.d.ts.map +1 -0
- package/dist/design-system/visual/big-text.js +578 -0
- package/dist/design-system/visual/big-text.js.map +1 -0
- package/dist/design-system/visual/digits.d.ts +159 -0
- package/dist/design-system/visual/digits.d.ts.map +1 -0
- package/dist/design-system/visual/digits.js +287 -0
- package/dist/design-system/visual/digits.js.map +1 -0
- package/dist/design-system/visual/index.d.ts +20 -0
- package/dist/design-system/visual/index.d.ts.map +1 -0
- package/dist/design-system/visual/index.js +23 -0
- package/dist/design-system/visual/index.js.map +1 -0
- package/dist/design-system/visual/splash-screen.d.ts +93 -0
- package/dist/design-system/visual/splash-screen.d.ts.map +1 -0
- package/dist/design-system/visual/splash-screen.js +219 -0
- package/dist/design-system/visual/splash-screen.js.map +1 -0
- package/dist/design-system/visual/tooltip.d.ts +188 -0
- package/dist/design-system/visual/tooltip.d.ts.map +1 -0
- package/dist/design-system/visual/tooltip.js +276 -0
- package/dist/design-system/visual/tooltip.js.map +1 -0
- package/dist/dev-tools/debugger.d.ts +223 -0
- package/dist/dev-tools/debugger.d.ts.map +1 -0
- package/dist/dev-tools/debugger.js +489 -0
- package/dist/dev-tools/debugger.js.map +1 -0
- package/dist/dev-tools/index.d.ts +22 -0
- package/dist/dev-tools/index.d.ts.map +1 -0
- package/dist/dev-tools/index.js +63 -0
- package/dist/dev-tools/index.js.map +1 -0
- package/dist/dev-tools/mouse-simulator.d.ts +155 -0
- package/dist/dev-tools/mouse-simulator.d.ts.map +1 -0
- package/dist/dev-tools/mouse-simulator.js +314 -0
- package/dist/dev-tools/mouse-simulator.js.map +1 -0
- package/dist/dev-tools/testing.d.ts +262 -0
- package/dist/dev-tools/testing.d.ts.map +1 -0
- package/dist/dev-tools/testing.js +858 -0
- package/dist/dev-tools/testing.js.map +1 -0
- package/dist/hooks/context.d.ts +47 -0
- package/dist/hooks/context.d.ts.map +1 -0
- package/dist/hooks/context.js +108 -0
- package/dist/hooks/context.js.map +1 -0
- package/dist/hooks/focus-context.d.ts +65 -0
- package/dist/hooks/focus-context.d.ts.map +1 -0
- package/dist/hooks/focus-context.js +79 -0
- package/dist/hooks/focus-context.js.map +1 -0
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.d.ts +76 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +5 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/hooks/use-app.d.ts +27 -0
- package/dist/hooks/use-app.d.ts.map +1 -0
- package/dist/hooks/use-app.js +179 -0
- package/dist/hooks/use-app.js.map +1 -0
- package/dist/hooks/use-effect.d.ts +20 -0
- package/dist/hooks/use-effect.d.ts.map +1 -0
- package/dist/hooks/use-effect.js +55 -0
- package/dist/hooks/use-effect.js.map +1 -0
- package/dist/hooks/use-focus.d.ts +48 -0
- package/dist/hooks/use-focus.d.ts.map +1 -0
- package/dist/hooks/use-focus.js +152 -0
- package/dist/hooks/use-focus.js.map +1 -0
- package/dist/hooks/use-input.d.ts +35 -0
- package/dist/hooks/use-input.d.ts.map +1 -0
- package/dist/hooks/use-input.js +352 -0
- package/dist/hooks/use-input.js.map +1 -0
- package/dist/hooks/use-mouse.d.ts +82 -0
- package/dist/hooks/use-mouse.d.ts.map +1 -0
- package/dist/hooks/use-mouse.js +328 -0
- package/dist/hooks/use-mouse.js.map +1 -0
- package/dist/hooks/use-navigation.d.ts +206 -0
- package/dist/hooks/use-navigation.d.ts.map +1 -0
- package/dist/hooks/use-navigation.js +319 -0
- package/dist/hooks/use-navigation.js.map +1 -0
- package/dist/hooks/use-state.d.ts +15 -0
- package/dist/hooks/use-state.d.ts.map +1 -0
- package/dist/hooks/use-state.js +29 -0
- package/dist/hooks/use-state.js.map +1 -0
- package/dist/hooks/use-terminal-size.d.ts +12 -0
- package/dist/hooks/use-terminal-size.d.ts.map +1 -0
- package/dist/hooks/use-terminal-size.js +20 -0
- package/dist/hooks/use-terminal-size.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/molecules/autocomplete.d.ts +166 -0
- package/dist/molecules/autocomplete.d.ts.map +1 -0
- package/dist/molecules/autocomplete.js +458 -0
- package/dist/molecules/autocomplete.js.map +1 -0
- package/dist/molecules/calendar.d.ts +144 -0
- package/dist/molecules/calendar.d.ts.map +1 -0
- package/dist/molecules/calendar.js +527 -0
- package/dist/molecules/calendar.js.map +1 -0
- package/dist/molecules/code-block.d.ts +88 -0
- package/dist/molecules/code-block.d.ts.map +1 -0
- package/dist/molecules/code-block.js +324 -0
- package/dist/molecules/code-block.js.map +1 -0
- package/dist/molecules/collapsible.d.ts +169 -0
- package/dist/molecules/collapsible.d.ts.map +1 -0
- package/dist/molecules/collapsible.js +289 -0
- package/dist/molecules/collapsible.js.map +1 -0
- package/dist/molecules/data-viz/bar-chart.d.ts +167 -0
- package/dist/molecules/data-viz/bar-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/bar-chart.js +375 -0
- package/dist/molecules/data-viz/bar-chart.js.map +1 -0
- package/dist/molecules/data-viz/gauge.d.ts +163 -0
- package/dist/molecules/data-viz/gauge.d.ts.map +1 -0
- package/dist/molecules/data-viz/gauge.js +451 -0
- package/dist/molecules/data-viz/gauge.js.map +1 -0
- package/dist/molecules/data-viz/heatmap.d.ts +154 -0
- package/dist/molecules/data-viz/heatmap.d.ts.map +1 -0
- package/dist/molecules/data-viz/heatmap.js +458 -0
- package/dist/molecules/data-viz/heatmap.js.map +1 -0
- package/dist/molecules/data-viz/index.d.ts +16 -0
- package/dist/molecules/data-viz/index.d.ts.map +1 -0
- package/dist/molecules/data-viz/index.js +16 -0
- package/dist/molecules/data-viz/index.js.map +1 -0
- package/dist/molecules/data-viz/line-chart.d.ts +157 -0
- package/dist/molecules/data-viz/line-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/line-chart.js +578 -0
- package/dist/molecules/data-viz/line-chart.js.map +1 -0
- package/dist/molecules/data-viz/sparkline.d.ts +156 -0
- package/dist/molecules/data-viz/sparkline.d.ts.map +1 -0
- package/dist/molecules/data-viz/sparkline.js +325 -0
- package/dist/molecules/data-viz/sparkline.js.map +1 -0
- package/dist/molecules/index.d.ts +22 -0
- package/dist/molecules/index.d.ts.map +1 -0
- package/dist/molecules/index.js +26 -0
- package/dist/molecules/index.js.map +1 -0
- package/dist/molecules/markdown.d.ts +61 -0
- package/dist/molecules/markdown.d.ts.map +1 -0
- package/dist/molecules/markdown.js +350 -0
- package/dist/molecules/markdown.js.map +1 -0
- package/dist/molecules/multi-select.d.ts +105 -0
- package/dist/molecules/multi-select.d.ts.map +1 -0
- package/dist/molecules/multi-select.js +312 -0
- package/dist/molecules/multi-select.js.map +1 -0
- package/dist/molecules/radio-group.d.ts +91 -0
- package/dist/molecules/radio-group.d.ts.map +1 -0
- package/dist/molecules/radio-group.js +148 -0
- package/dist/molecules/radio-group.js.map +1 -0
- package/dist/molecules/select.d.ts +119 -0
- package/dist/molecules/select.d.ts.map +1 -0
- package/dist/molecules/select.js +444 -0
- package/dist/molecules/select.js.map +1 -0
- package/dist/molecules/table.d.ts +106 -0
- package/dist/molecules/table.d.ts.map +1 -0
- package/dist/molecules/table.js +345 -0
- package/dist/molecules/table.js.map +1 -0
- package/dist/molecules/tabs.d.ts +132 -0
- package/dist/molecules/tabs.d.ts.map +1 -0
- package/dist/molecules/tabs.js +376 -0
- package/dist/molecules/tabs.js.map +1 -0
- package/dist/molecules/tree.d.ts +169 -0
- package/dist/molecules/tree.d.ts.map +1 -0
- package/dist/molecules/tree.js +431 -0
- package/dist/molecules/tree.js.map +1 -0
- package/dist/organisms/command-palette.d.ts +217 -0
- package/dist/organisms/command-palette.d.ts.map +1 -0
- package/dist/organisms/command-palette.js +443 -0
- package/dist/organisms/command-palette.js.map +1 -0
- package/dist/organisms/data-table.d.ts +173 -0
- package/dist/organisms/data-table.d.ts.map +1 -0
- package/dist/organisms/data-table.js +428 -0
- package/dist/organisms/data-table.js.map +1 -0
- package/dist/organisms/file-browser.d.ts +492 -0
- package/dist/organisms/file-browser.d.ts.map +1 -0
- package/dist/organisms/file-browser.js +807 -0
- package/dist/organisms/file-browser.js.map +1 -0
- package/dist/organisms/grid.d.ts +234 -0
- package/dist/organisms/grid.d.ts.map +1 -0
- package/dist/organisms/grid.js +719 -0
- package/dist/organisms/grid.js.map +1 -0
- package/dist/organisms/index.d.ts +30 -0
- package/dist/organisms/index.d.ts.map +1 -0
- package/dist/organisms/index.js +92 -0
- package/dist/organisms/index.js.map +1 -0
- package/dist/organisms/modal.d.ts +251 -0
- package/dist/organisms/modal.d.ts.map +1 -0
- package/dist/organisms/modal.js +461 -0
- package/dist/organisms/modal.js.map +1 -0
- package/dist/organisms/overlay-stack.d.ts +200 -0
- package/dist/organisms/overlay-stack.d.ts.map +1 -0
- package/dist/organisms/overlay-stack.js +341 -0
- package/dist/organisms/overlay-stack.js.map +1 -0
- package/dist/organisms/scroll-area.d.ts +188 -0
- package/dist/organisms/scroll-area.d.ts.map +1 -0
- package/dist/organisms/scroll-area.js +348 -0
- package/dist/organisms/scroll-area.js.map +1 -0
- package/dist/organisms/split-panel.d.ts +183 -0
- package/dist/organisms/split-panel.d.ts.map +1 -0
- package/dist/organisms/split-panel.js +323 -0
- package/dist/organisms/split-panel.js.map +1 -0
- package/dist/primitives/canvas.d.ts +322 -0
- package/dist/primitives/canvas.d.ts.map +1 -0
- package/dist/primitives/canvas.js +833 -0
- package/dist/primitives/canvas.js.map +1 -0
- package/dist/primitives/context.d.ts +83 -0
- package/dist/primitives/context.d.ts.map +1 -0
- package/dist/primitives/context.js +101 -0
- package/dist/primitives/context.js.map +1 -0
- package/dist/primitives/divider.d.ts +52 -0
- package/dist/primitives/divider.d.ts.map +1 -0
- package/dist/primitives/divider.js +71 -0
- package/dist/primitives/divider.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +10 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/nodes.d.ts +152 -0
- package/dist/primitives/nodes.d.ts.map +1 -0
- package/dist/primitives/nodes.js +164 -0
- package/dist/primitives/nodes.js.map +1 -0
- package/dist/primitives/signal.d.ts +136 -0
- package/dist/primitives/signal.d.ts.map +1 -0
- package/dist/primitives/signal.js +338 -0
- package/dist/primitives/signal.js.map +1 -0
- package/dist/primitives/store.d.ts +86 -0
- package/dist/primitives/store.d.ts.map +1 -0
- package/dist/primitives/store.js +147 -0
- package/dist/primitives/store.js.map +1 -0
- package/dist/storybook/app.d.ts +16 -0
- package/dist/storybook/app.d.ts.map +1 -0
- package/dist/storybook/app.js +697 -0
- package/dist/storybook/app.js.map +1 -0
- package/dist/storybook/cli.d.ts +10 -0
- package/dist/storybook/cli.d.ts.map +1 -0
- package/dist/storybook/cli.js +14 -0
- package/dist/storybook/cli.js.map +1 -0
- package/dist/storybook/components/compare-view.d.ts +46 -0
- package/dist/storybook/components/compare-view.d.ts.map +1 -0
- package/dist/storybook/components/compare-view.js +235 -0
- package/dist/storybook/components/compare-view.js.map +1 -0
- package/dist/storybook/components/index.d.ts +7 -0
- package/dist/storybook/components/index.d.ts.map +1 -0
- package/dist/storybook/components/index.js +7 -0
- package/dist/storybook/components/index.js.map +1 -0
- package/dist/storybook/components/log-viewer.d.ts +9 -0
- package/dist/storybook/components/log-viewer.d.ts.map +1 -0
- package/dist/storybook/components/log-viewer.js +46 -0
- package/dist/storybook/components/log-viewer.js.map +1 -0
- package/dist/storybook/components/preview.d.ts +28 -0
- package/dist/storybook/components/preview.d.ts.map +1 -0
- package/dist/storybook/components/preview.js +248 -0
- package/dist/storybook/components/preview.js.map +1 -0
- package/dist/storybook/components/sidebar.d.ts +29 -0
- package/dist/storybook/components/sidebar.d.ts.map +1 -0
- package/dist/storybook/components/sidebar.js +176 -0
- package/dist/storybook/components/sidebar.js.map +1 -0
- package/dist/storybook/core/comparatives.d.ts +94 -0
- package/dist/storybook/core/comparatives.d.ts.map +1 -0
- package/dist/storybook/core/comparatives.js +301 -0
- package/dist/storybook/core/comparatives.js.map +1 -0
- package/dist/storybook/core/index.d.ts +8 -0
- package/dist/storybook/core/index.d.ts.map +1 -0
- package/dist/storybook/core/index.js +8 -0
- package/dist/storybook/core/index.js.map +1 -0
- package/dist/storybook/core/navigator.d.ts +64 -0
- package/dist/storybook/core/navigator.d.ts.map +1 -0
- package/dist/storybook/core/navigator.js +279 -0
- package/dist/storybook/core/navigator.js.map +1 -0
- package/dist/storybook/core/playground.d.ts +73 -0
- package/dist/storybook/core/playground.d.ts.map +1 -0
- package/dist/storybook/core/playground.js +338 -0
- package/dist/storybook/core/playground.js.map +1 -0
- package/dist/storybook/core/registry.d.ts +87 -0
- package/dist/storybook/core/registry.d.ts.map +1 -0
- package/dist/storybook/core/registry.js +222 -0
- package/dist/storybook/core/registry.js.map +1 -0
- package/dist/storybook/data/ascii-art.d.ts +18 -0
- package/dist/storybook/data/ascii-art.d.ts.map +1 -0
- package/dist/storybook/data/ascii-art.js +62 -0
- package/dist/storybook/data/ascii-art.js.map +1 -0
- package/dist/storybook/data/tuiuiu-bird-colored.d.ts +13 -0
- package/dist/storybook/data/tuiuiu-bird-colored.d.ts.map +1 -0
- package/dist/storybook/data/tuiuiu-bird-colored.js +12 -0
- package/dist/storybook/data/tuiuiu-bird-colored.js.map +1 -0
- package/dist/storybook/index.d.ts +33 -0
- package/dist/storybook/index.d.ts.map +1 -0
- package/dist/storybook/index.js +44 -0
- package/dist/storybook/index.js.map +1 -0
- package/dist/storybook/store.d.ts +39 -0
- package/dist/storybook/store.d.ts.map +1 -0
- package/dist/storybook/store.js +91 -0
- package/dist/storybook/store.js.map +1 -0
- package/dist/storybook/stories/apps/index.d.ts +24 -0
- package/dist/storybook/stories/apps/index.d.ts.map +1 -0
- package/dist/storybook/stories/apps/index.js +434 -0
- package/dist/storybook/stories/apps/index.js.map +1 -0
- package/dist/storybook/stories/atoms/index.d.ts +40 -0
- package/dist/storybook/stories/atoms/index.d.ts.map +1 -0
- package/dist/storybook/stories/atoms/index.js +462 -0
- package/dist/storybook/stories/atoms/index.js.map +1 -0
- package/dist/storybook/stories/index.d.ts +37 -0
- package/dist/storybook/stories/index.d.ts.map +1 -0
- package/dist/storybook/stories/index.js +56 -0
- package/dist/storybook/stories/index.js.map +1 -0
- package/dist/storybook/stories/molecules/index.d.ts +68 -0
- package/dist/storybook/stories/molecules/index.d.ts.map +1 -0
- package/dist/storybook/stories/molecules/index.js +587 -0
- package/dist/storybook/stories/molecules/index.js.map +1 -0
- package/dist/storybook/stories/organisms/index.d.ts +29 -0
- package/dist/storybook/stories/organisms/index.d.ts.map +1 -0
- package/dist/storybook/stories/organisms/index.js +677 -0
- package/dist/storybook/stories/organisms/index.js.map +1 -0
- package/dist/storybook/types.d.ts +40 -0
- package/dist/storybook/types.d.ts.map +1 -0
- package/dist/storybook/types.js +5 -0
- package/dist/storybook/types.js.map +1 -0
- package/dist/styling/index.d.ts +12 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +24 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/parser.d.ts +217 -0
- package/dist/styling/parser.d.ts.map +1 -0
- package/dist/styling/parser.js +901 -0
- package/dist/styling/parser.js.map +1 -0
- package/dist/styling/resolver.d.ts +217 -0
- package/dist/styling/resolver.d.ts.map +1 -0
- package/dist/styling/resolver.js +628 -0
- package/dist/styling/resolver.js.map +1 -0
- package/dist/styling/tokenizer.d.ts +121 -0
- package/dist/styling/tokenizer.d.ts.map +1 -0
- package/dist/styling/tokenizer.js +553 -0
- package/dist/styling/tokenizer.js.map +1 -0
- package/dist/templates/app.d.ts +205 -0
- package/dist/templates/app.d.ts.map +1 -0
- package/dist/templates/app.js +286 -0
- package/dist/templates/app.js.map +1 -0
- package/dist/templates/index.d.ts +30 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +40 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/stack.d.ts +189 -0
- package/dist/templates/stack.d.ts.map +1 -0
- package/dist/templates/stack.js +170 -0
- package/dist/templates/stack.js.map +1 -0
- package/dist/utils/batcher.d.ts +88 -0
- package/dist/utils/batcher.d.ts.map +1 -0
- package/dist/utils/batcher.js +172 -0
- package/dist/utils/batcher.js.map +1 -0
- package/dist/utils/cursor.d.ts +28 -0
- package/dist/utils/cursor.d.ts.map +1 -0
- package/dist/utils/cursor.js +86 -0
- package/dist/utils/cursor.js.map +1 -0
- package/dist/utils/fs-storage.d.ts +23 -0
- package/dist/utils/fs-storage.d.ts.map +1 -0
- package/dist/utils/fs-storage.js +34 -0
- package/dist/utils/fs-storage.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/log-update.d.ts +31 -0
- package/dist/utils/log-update.d.ts.map +1 -0
- package/dist/utils/log-update.js +147 -0
- package/dist/utils/log-update.js.map +1 -0
- package/dist/utils/text-utils.d.ts +151 -0
- package/dist/utils/text-utils.d.ts.map +1 -0
- package/dist/utils/text-utils.js +699 -0
- package/dist/utils/text-utils.js.map +1 -0
- package/dist/utils/types.d.ts +205 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +430 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +142 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tetis.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🐦 Tuiuiu
|
|
4
|
+
|
|
5
|
+
### Terminal UI Framework for the Modern Era
|
|
6
|
+
|
|
7
|
+
Build beautiful, reactive terminal apps with a familiar component API.
|
|
8
|
+
<br>
|
|
9
|
+
**Zero dependencies** • **Signals-based** • **Flexbox layout** • **Full mouse support**
|
|
10
|
+
<br>
|
|
11
|
+
50+ components. Pure Node.js. No C++ bindings.
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/tuiuiu.js)
|
|
14
|
+
[](https://www.npmjs.com/package/tuiuiu.js)
|
|
15
|
+
[](https://www.typescriptlang.org/)
|
|
16
|
+
[](https://nodejs.org/)
|
|
17
|
+
[](https://github.com/forattini-dev/tuiuiu.js/blob/main/LICENSE)
|
|
18
|
+
[](https://www.npmjs.com/package/tuiuiu.js)
|
|
19
|
+
|
|
20
|
+
[📖 Documentation](https://forattini-dev.github.io/tuiuiu.js) · [🚀 Quick Start](#quick-start) · [🎨 Storybook](#storybook)
|
|
21
|
+
|
|
22
|
+
<img src="docs/assets/demo-dashboard.gif" alt="Tuiuiu Demo" width="600">
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install tuiuiu.js
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { render, Box, Text, useState, useInput, useApp } from 'tuiuiu.js';
|
|
36
|
+
|
|
37
|
+
function Counter() {
|
|
38
|
+
const [count, setCount] = useState(0);
|
|
39
|
+
const { exit } = useApp();
|
|
40
|
+
|
|
41
|
+
useInput((char, key) => {
|
|
42
|
+
if (key.upArrow) setCount(c => c + 1);
|
|
43
|
+
if (key.downArrow) setCount(c => c - 1);
|
|
44
|
+
if (key.escape) exit();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return Box({ flexDirection: 'column', padding: 1, borderStyle: 'round' },
|
|
48
|
+
Text({ color: 'cyan', bold: true }, '🐦 Tuiuiu Counter'),
|
|
49
|
+
Text({ color: 'yellow', marginTop: 1 }, `Count: ${count()}`),
|
|
50
|
+
Text({ color: 'gray', dim: true }, '↑/↓: change • Esc: exit')
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const { waitUntilExit } = render(Counter);
|
|
55
|
+
await waitUntilExit();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## What's Inside
|
|
59
|
+
|
|
60
|
+
| Category | Features |
|
|
61
|
+
|:---------|:---------|
|
|
62
|
+
| **Core** | Signal-based reactivity, Flexbox layout engine, Focus management, Event system |
|
|
63
|
+
| **Primitives** | Box, Text, Spacer, Newline, Fragment, Divider, Canvas |
|
|
64
|
+
| **Atoms** | Button, TextInput, Switch, Slider, Spinner, ProgressBar, Timer, Tooltip |
|
|
65
|
+
| **Molecules** | Select, MultiSelect, RadioGroup, Autocomplete, Table, Tabs, Tree, Calendar, CodeBlock, Markdown |
|
|
66
|
+
| **Organisms** | Modal, CommandPalette, DataTable, FileManager, SplitPanel, ScrollArea, Grid, OverlayStack |
|
|
67
|
+
| **Templates** | AppShell, Page, Header, StatusBar, VStack, HStack, Center, FullScreen |
|
|
68
|
+
| **Data Viz** | BarChart, LineChart, Sparkline, Heatmap, Gauge, BigText, Digits |
|
|
69
|
+
| **DevTools** | Layout Inspector, Event Logger, Performance Metrics, Component Storybook |
|
|
70
|
+
|
|
71
|
+
## Highlights
|
|
72
|
+
|
|
73
|
+
### ⚡ Signal-based Reactivity
|
|
74
|
+
|
|
75
|
+
Fine-grained reactivity without Virtual DOM overhead. Only what changes gets updated.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { createSignal, createEffect } from 'tuiuiu.js';
|
|
79
|
+
|
|
80
|
+
const [count, setCount] = createSignal(0);
|
|
81
|
+
const doubled = () => count() * 2;
|
|
82
|
+
|
|
83
|
+
createEffect(() => console.log(`Count: ${count()}, Doubled: ${doubled()}`));
|
|
84
|
+
|
|
85
|
+
setCount(5); // → "Count: 5, Doubled: 10"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 📦 Flexbox Layout
|
|
89
|
+
|
|
90
|
+
Build complex layouts with the CSS Flexbox model you already know.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
Box({
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
justifyContent: 'space-between',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
gap: 2,
|
|
98
|
+
padding: 1
|
|
99
|
+
},
|
|
100
|
+
Text({ color: 'blue' }, 'Left'),
|
|
101
|
+
Box({ flexGrow: 1 }),
|
|
102
|
+
Text({ color: 'red' }, 'Right')
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 🎨 50+ Ready-to-Use Components
|
|
107
|
+
|
|
108
|
+
From simple buttons to complex data tables, everything is included.
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import { Select, Modal, DataTable, CommandPalette } from 'tuiuiu.js';
|
|
112
|
+
|
|
113
|
+
// Dropdown select
|
|
114
|
+
Select({
|
|
115
|
+
items: [
|
|
116
|
+
{ label: 'Option A', value: 'a' },
|
|
117
|
+
{ label: 'Option B', value: 'b' },
|
|
118
|
+
],
|
|
119
|
+
onSelect: (item) => console.log(item)
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Command palette (⌘K style)
|
|
123
|
+
CommandPalette({
|
|
124
|
+
commands: [
|
|
125
|
+
{ id: 'new', label: 'New File', shortcut: 'Ctrl+N' },
|
|
126
|
+
{ id: 'open', label: 'Open File', shortcut: 'Ctrl+O' },
|
|
127
|
+
],
|
|
128
|
+
onSelect: (cmd) => handleCommand(cmd)
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 🖱️ Full Mouse Support
|
|
133
|
+
|
|
134
|
+
Click, hover, scroll, drag — all mouse events work out of the box.
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
Box({
|
|
138
|
+
borderStyle: 'round',
|
|
139
|
+
onClick: () => console.log('Clicked!'),
|
|
140
|
+
onMouseEnter: () => setHover(true),
|
|
141
|
+
onMouseLeave: () => setHover(false),
|
|
142
|
+
onScroll: (delta) => scrollBy(delta),
|
|
143
|
+
},
|
|
144
|
+
Text({}, hover() ? '🔥 Hovering!' : 'Hover me')
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 📊 Data Visualization
|
|
149
|
+
|
|
150
|
+
Render charts and graphs directly in the terminal.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import { BarChart, Sparkline, Gauge } from 'tuiuiu.js';
|
|
154
|
+
|
|
155
|
+
BarChart({
|
|
156
|
+
data: [
|
|
157
|
+
{ label: 'Mon', value: 10 },
|
|
158
|
+
{ label: 'Tue', value: 25 },
|
|
159
|
+
{ label: 'Wed', value: 15 },
|
|
160
|
+
],
|
|
161
|
+
color: 'cyan',
|
|
162
|
+
showValues: true
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
Sparkline({ data: [1, 5, 2, 8, 3, 9], width: 20, style: 'braille' });
|
|
166
|
+
|
|
167
|
+
Gauge({ value: 75, max: 100, label: 'CPU', color: 'green' });
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 🏗️ Atomic Design + Tree Shaking
|
|
171
|
+
|
|
172
|
+
Components organized in a clear hierarchy. Import only what you need — unused code is automatically removed from your bundle.
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// Import everything (convenient for development)
|
|
176
|
+
import { Box, Button, Modal } from 'tuiuiu.js';
|
|
177
|
+
|
|
178
|
+
// Import by layer (optimized bundles)
|
|
179
|
+
import { Box, Text } from 'tuiuiu.js/primitives';
|
|
180
|
+
import { Button, Spinner } from 'tuiuiu.js/atoms';
|
|
181
|
+
import { Select, Table } from 'tuiuiu.js/molecules';
|
|
182
|
+
import { Modal, DataTable } from 'tuiuiu.js/organisms';
|
|
183
|
+
import { AppShell, Page } from 'tuiuiu.js/templates';
|
|
184
|
+
|
|
185
|
+
// Core systems
|
|
186
|
+
import { createSignal, createEffect } from 'tuiuiu.js/core';
|
|
187
|
+
import { useState, useInput, useMouse } from 'tuiuiu.js/hooks';
|
|
188
|
+
import { render, renderOnce } from 'tuiuiu.js/app';
|
|
189
|
+
|
|
190
|
+
// Utilities & extras
|
|
191
|
+
import { measureText, getVisibleWidth } from 'tuiuiu.js/utils';
|
|
192
|
+
import { BarChart, Gauge } from 'tuiuiu.js/design-system';
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
<details>
|
|
196
|
+
<summary>All subpath imports</summary>
|
|
197
|
+
|
|
198
|
+
| Import | Contents |
|
|
199
|
+
|:-------|:---------|
|
|
200
|
+
| `tuiuiu.js` | Everything (main entry) |
|
|
201
|
+
| `tuiuiu.js/primitives` | Box, Text, Spacer, Fragment, Divider, Canvas |
|
|
202
|
+
| `tuiuiu.js/atoms` | Button, TextInput, Switch, Slider, Spinner, ProgressBar, Timer |
|
|
203
|
+
| `tuiuiu.js/molecules` | Select, MultiSelect, Table, Tabs, Tree, Calendar, CodeBlock |
|
|
204
|
+
| `tuiuiu.js/organisms` | Modal, CommandPalette, DataTable, FileManager, SplitPanel |
|
|
205
|
+
| `tuiuiu.js/templates` | AppShell, Page, VStack, HStack, StatusBar |
|
|
206
|
+
| `tuiuiu.js/core` | createSignal, createEffect, batch, calculateLayout |
|
|
207
|
+
| `tuiuiu.js/hooks` | useState, useEffect, useInput, useMouse, useFocus |
|
|
208
|
+
| `tuiuiu.js/app` | render, renderOnce, useApp |
|
|
209
|
+
| `tuiuiu.js/utils` | Text measurement, ANSI utilities |
|
|
210
|
+
| `tuiuiu.js/design-system` | Full design system (charts, forms, navigation) |
|
|
211
|
+
| `tuiuiu.js/storybook` | Component explorer utilities |
|
|
212
|
+
|
|
213
|
+
</details>
|
|
214
|
+
|
|
215
|
+
### 🔄 Redux-like Store
|
|
216
|
+
|
|
217
|
+
Built-in state management for complex applications.
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { createStore } from 'tuiuiu.js';
|
|
221
|
+
|
|
222
|
+
const reducer = (state = { count: 0 }, action) => {
|
|
223
|
+
switch (action.type) {
|
|
224
|
+
case 'INCREMENT': return { count: state.count + 1 };
|
|
225
|
+
case 'DECREMENT': return { count: state.count - 1 };
|
|
226
|
+
default: return state;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const store = createStore(reducer, { count: 0 });
|
|
231
|
+
|
|
232
|
+
store.subscribe(() => console.log(store.state()));
|
|
233
|
+
store.dispatch({ type: 'INCREMENT' });
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Storybook
|
|
237
|
+
|
|
238
|
+
Tuiuiu includes a built-in component storybook for exploring all components:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# Run the storybook
|
|
242
|
+
npx tuiuiu
|
|
243
|
+
|
|
244
|
+
# Or if installed locally
|
|
245
|
+
pnpm storybook
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Navigate through categories, see live previews, and copy code examples.
|
|
249
|
+
|
|
250
|
+
## Examples
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Clone and explore
|
|
254
|
+
git clone https://github.com/forattini-dev/tuiuiu.js
|
|
255
|
+
cd tuiuiu.js
|
|
256
|
+
pnpm install
|
|
257
|
+
|
|
258
|
+
# Run examples
|
|
259
|
+
pnpm example:01 # Basic counter
|
|
260
|
+
pnpm example:04 # Forms showcase
|
|
261
|
+
pnpm example:06 # Dashboard
|
|
262
|
+
pnpm example:chat # Chat application
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
<details>
|
|
266
|
+
<summary>All 20+ examples</summary>
|
|
267
|
+
|
|
268
|
+
| Example | Description |
|
|
269
|
+
|:--------|:------------|
|
|
270
|
+
| `01-basic-counter` | useState, useInput basics |
|
|
271
|
+
| `02-async-loading` | Async operations with spinners |
|
|
272
|
+
| `03-global-state` | Shared state across components |
|
|
273
|
+
| `04-forms` | Form inputs and validation |
|
|
274
|
+
| `05-multi-component` | Component composition |
|
|
275
|
+
| `06-dashboard` | Real-time dashboard layout |
|
|
276
|
+
| `07-advanced-forms` | Complex form patterns |
|
|
277
|
+
| `08-layout-components` | Flexbox layouts |
|
|
278
|
+
| `09-visual-components` | Charts and visualizations |
|
|
279
|
+
| `10-theme-context` | Theming system |
|
|
280
|
+
| `11-static-logs` | Log viewer pattern |
|
|
281
|
+
| `12-animation-system` | Animations and transitions |
|
|
282
|
+
| `13-virtual-scroll` | Large list virtualization |
|
|
283
|
+
| `14-focus-management` | Focus navigation |
|
|
284
|
+
| `15-constraint-layout` | Advanced constraints |
|
|
285
|
+
| `16-graphics-braille` | Braille graphics |
|
|
286
|
+
| `17-event-system` | Event handling patterns |
|
|
287
|
+
| `chat` | Full chat application |
|
|
288
|
+
| `realtime-dashboard` | Live updating dashboard |
|
|
289
|
+
|
|
290
|
+
</details>
|
|
291
|
+
|
|
292
|
+
## Documentation
|
|
293
|
+
|
|
294
|
+
| Topic | Link |
|
|
295
|
+
|:------|:-----|
|
|
296
|
+
| Quick Start | [→ Getting Started](https://forattini-dev.github.io/tuiuiu.js/#/getting-started/quick-start) |
|
|
297
|
+
| Components | [→ Component Reference](https://forattini-dev.github.io/tuiuiu.js/#/components/overview) |
|
|
298
|
+
| Hooks | [→ Hooks API](https://forattini-dev.github.io/tuiuiu.js/#/hooks/use-input) |
|
|
299
|
+
| Signals | [→ Reactive State](https://forattini-dev.github.io/tuiuiu.js/#/core/signals) |
|
|
300
|
+
| Layout | [→ Flexbox Guide](https://forattini-dev.github.io/tuiuiu.js/#/core/layout) |
|
|
301
|
+
| Theming | [→ Theme System](https://forattini-dev.github.io/tuiuiu.js/#/core/theming) |
|
|
302
|
+
| Storybook | [→ Component Explorer](https://forattini-dev.github.io/tuiuiu.js/#/core/storybook) |
|
|
303
|
+
|
|
304
|
+
## Numbers
|
|
305
|
+
|
|
306
|
+
| Metric | Value |
|
|
307
|
+
|:-------|:------|
|
|
308
|
+
| Components | 50+ |
|
|
309
|
+
| Dependencies | 0 |
|
|
310
|
+
| Subpath Imports | 12 |
|
|
311
|
+
| Hooks | 10 |
|
|
312
|
+
| Examples | 20+ |
|
|
313
|
+
| Border Styles | 9 |
|
|
314
|
+
| Named Colors | 18 |
|
|
315
|
+
| Tests | 3500+ |
|
|
316
|
+
| Tree Shakeable | ✅ |
|
|
317
|
+
|
|
318
|
+
## Why "Tuiuiu"?
|
|
319
|
+
|
|
320
|
+
The [Tuiuiu](https://en.wikipedia.org/wiki/Jabiru) (Jabiru mycteria) is a majestic Brazilian bird — the tallest flying bird in South America. Just like this bird stands out in its environment, Tuiuiu stands out in the terminal UI landscape: elegant, powerful, and distinctly Brazilian.
|
|
321
|
+
|
|
322
|
+
## License
|
|
323
|
+
|
|
324
|
+
MIT © [Tetis.io](https://tetis.io)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Layer - Application lifecycle and rendering
|
|
3
|
+
*
|
|
4
|
+
* This module provides the main entry point for Reck applications.
|
|
5
|
+
*/
|
|
6
|
+
export { render, renderOnce, type RenderOptions, type ReckInstance, } from './render-loop.js';
|
|
7
|
+
export { initializeApp, cleanupApp, useApp, type AppContext, } from '../hooks/index.js';
|
|
8
|
+
export { useFocusManager, createFocusManager, type FocusManager, } from '../hooks/index.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,aAAa,EACb,UAAU,EACV,MAAM,EACN,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Layer - Application lifecycle and rendering
|
|
3
|
+
*
|
|
4
|
+
* This module provides the main entry point for Reck applications.
|
|
5
|
+
*/
|
|
6
|
+
// Render loop
|
|
7
|
+
export { render, renderOnce, } from './render-loop.js';
|
|
8
|
+
// Re-export lifecycle functions from hooks for convenience
|
|
9
|
+
export { initializeApp, cleanupApp, useApp, } from '../hooks/index.js';
|
|
10
|
+
// Re-export focus management for app-level control
|
|
11
|
+
export { useFocusManager, createFocusManager, } from '../hooks/index.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc;AACd,OAAO,EACL,MAAM,EACN,UAAU,GAGX,MAAM,kBAAkB,CAAC;AAE1B,2DAA2D;AAC3D,OAAO,EACL,aAAa,EACb,UAAU,EACV,MAAM,GAEP,MAAM,mBAAmB,CAAC;AAE3B,mDAAmD;AACnD,OAAO,EACL,eAAe,EACf,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reck App - Main render loop and app lifecycle
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for Reck applications
|
|
5
|
+
*/
|
|
6
|
+
import type { VNode } from '../utils/types.js';
|
|
7
|
+
export interface RenderOptions {
|
|
8
|
+
/** Output stream (default: process.stdout) */
|
|
9
|
+
stdout?: NodeJS.WriteStream;
|
|
10
|
+
/** Input stream (default: process.stdin) */
|
|
11
|
+
stdin?: NodeJS.ReadStream;
|
|
12
|
+
/** Enable debug mode - prints each render as separate output */
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
/** Exit on Ctrl+C (default: true) */
|
|
15
|
+
exitOnCtrlC?: boolean;
|
|
16
|
+
/** Maximum FPS for render throttling (default: 30) */
|
|
17
|
+
maxFps?: number;
|
|
18
|
+
/** Clear screen on start (default: true) */
|
|
19
|
+
clearOnStart?: boolean;
|
|
20
|
+
/** Show cursor (default: false during render) */
|
|
21
|
+
showCursor?: boolean;
|
|
22
|
+
/** Enable automatic Tab/Shift+Tab navigation (default: true) */
|
|
23
|
+
autoTabNavigation?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ReckInstance {
|
|
26
|
+
/** Re-render with a new component */
|
|
27
|
+
rerender: (node: VNode) => void;
|
|
28
|
+
/** Unmount the app */
|
|
29
|
+
unmount: () => void;
|
|
30
|
+
/** Wait for the app to exit */
|
|
31
|
+
waitUntilExit: () => Promise<void>;
|
|
32
|
+
/** Clear the output */
|
|
33
|
+
clear: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render a Reck app to the terminal
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const { waitUntilExit } = render(() => App());
|
|
40
|
+
* await waitUntilExit();
|
|
41
|
+
*/
|
|
42
|
+
export declare function render(nodeOrFn: VNode | (() => VNode), options?: RenderOptions): ReckInstance;
|
|
43
|
+
/**
|
|
44
|
+
* Render once and return the string (no interactivity)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* const output = renderOnce(MyComponent());
|
|
48
|
+
* console.log(output);
|
|
49
|
+
*/
|
|
50
|
+
export declare function renderOnce(node: VNode, width?: number): string;
|
|
51
|
+
//# sourceMappingURL=render-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-loop.d.ts","sourceRoot":"","sources":["../../src/app/render-loop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAwB,MAAM,mBAAmB,CAAC;AAsErE,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IAC5B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC1B,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,sBAAsB;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,uBAAuB;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,GAAE,aAAkB,GAAG,YAAY,CAiOjG;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reck App - Main render loop and app lifecycle
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for Reck applications
|
|
5
|
+
*/
|
|
6
|
+
import { renderToString } from '../design-system/core/renderer.js';
|
|
7
|
+
import { calculateLayout } from '../design-system/core/layout.js';
|
|
8
|
+
import { createEffect } from '../primitives/signal.js';
|
|
9
|
+
import { initializeApp, cleanupApp, enableMouseTracking, disableMouseTracking } from '../hooks/index.js';
|
|
10
|
+
import { beginRender, endRender, resetHookState } from '../hooks/context.js';
|
|
11
|
+
import { createLogUpdate } from '../utils/log-update.js';
|
|
12
|
+
import { getHitTestRegistry, registerHitTestFromLayout } from '../core/hit-test.js';
|
|
13
|
+
/**
|
|
14
|
+
* Check if a VNode is marked as static
|
|
15
|
+
*/
|
|
16
|
+
function isStaticNode(node) {
|
|
17
|
+
return !!node.props.__static;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Generate a stable ID for a static node
|
|
21
|
+
* Uses content hash if no explicit ID provided
|
|
22
|
+
*/
|
|
23
|
+
function getStaticNodeId(node, index) {
|
|
24
|
+
const props = node.props;
|
|
25
|
+
if (props.__staticId)
|
|
26
|
+
return props.__staticId;
|
|
27
|
+
// Generate an ID based on position and content
|
|
28
|
+
return `static-${index}-${JSON.stringify(node.children?.slice(0, 2) ?? []).slice(0, 50)}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Extract static nodes from a VNode tree
|
|
32
|
+
* Returns { staticNodes, interactiveNode }
|
|
33
|
+
*/
|
|
34
|
+
function separateStaticNodes(node) {
|
|
35
|
+
const staticNodes = [];
|
|
36
|
+
// Helper to recursively find and remove static nodes
|
|
37
|
+
function processNode(n) {
|
|
38
|
+
if (isStaticNode(n)) {
|
|
39
|
+
staticNodes.push(n);
|
|
40
|
+
return null; // Remove from tree
|
|
41
|
+
}
|
|
42
|
+
// Process children
|
|
43
|
+
if (n.children && n.children.length > 0) {
|
|
44
|
+
const newChildren = n.children
|
|
45
|
+
.map(child => (child && typeof child === 'object' && 'type' in child) ? processNode(child) : child)
|
|
46
|
+
.filter((child) => child !== null);
|
|
47
|
+
return {
|
|
48
|
+
...n,
|
|
49
|
+
children: newChildren,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
}
|
|
54
|
+
const interactiveNode = processNode(node) ?? {
|
|
55
|
+
type: 'fragment',
|
|
56
|
+
props: {},
|
|
57
|
+
children: [],
|
|
58
|
+
};
|
|
59
|
+
return { staticNodes, interactiveNode };
|
|
60
|
+
}
|
|
61
|
+
/** ANSI escape sequences */
|
|
62
|
+
const ansi = {
|
|
63
|
+
clearTerminal: '\x1b[2J\x1b[3J\x1b[H',
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Render a Reck app to the terminal
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* const { waitUntilExit } = render(() => App());
|
|
70
|
+
* await waitUntilExit();
|
|
71
|
+
*/
|
|
72
|
+
export function render(nodeOrFn, options = {}) {
|
|
73
|
+
const { stdout = process.stdout, stdin = process.stdin, debug = false, exitOnCtrlC = true, maxFps = 30, clearOnStart = true, showCursor = false, autoTabNavigation = true, } = options;
|
|
74
|
+
// Initialize app context FIRST (before calling component functions)
|
|
75
|
+
const appContext = initializeApp(stdin, stdout, { autoTabNavigation });
|
|
76
|
+
// Store the component function for re-evaluation
|
|
77
|
+
const componentFn = typeof nodeOrFn === 'function' ? nodeOrFn : () => nodeOrFn;
|
|
78
|
+
// Create log updater for efficient incremental rendering
|
|
79
|
+
// Uses line-diffing to reduce flickering
|
|
80
|
+
const logUpdate = createLogUpdate(stdout, {
|
|
81
|
+
showCursor,
|
|
82
|
+
incremental: !debug, // Use incremental rendering unless in debug mode
|
|
83
|
+
});
|
|
84
|
+
// State
|
|
85
|
+
let currentNode = null;
|
|
86
|
+
let lastOutput = '';
|
|
87
|
+
let isUnmounted = false;
|
|
88
|
+
let exitPromise;
|
|
89
|
+
let resolveExit;
|
|
90
|
+
let rejectExit;
|
|
91
|
+
// Static content tracking
|
|
92
|
+
const renderedStaticIds = new Set();
|
|
93
|
+
let staticLineCount = 0; // Track how many lines of static content we've written
|
|
94
|
+
// Create exit promise
|
|
95
|
+
exitPromise = new Promise((resolve, reject) => {
|
|
96
|
+
resolveExit = resolve;
|
|
97
|
+
rejectExit = reject;
|
|
98
|
+
});
|
|
99
|
+
// Throttle rendering
|
|
100
|
+
const minRenderInterval = maxFps > 0 ? Math.ceil(1000 / maxFps) : 0;
|
|
101
|
+
let lastRenderTime = 0;
|
|
102
|
+
let pendingRender = false;
|
|
103
|
+
// Mouse tracking state
|
|
104
|
+
let mouseTrackingEnabled = false;
|
|
105
|
+
// Initial setup
|
|
106
|
+
if (clearOnStart && !debug) {
|
|
107
|
+
stdout.write(ansi.clearTerminal);
|
|
108
|
+
}
|
|
109
|
+
// Handle resize - need to re-evaluate component for new dimensions
|
|
110
|
+
const handleResize = () => {
|
|
111
|
+
if (!isUnmounted) {
|
|
112
|
+
beginRender();
|
|
113
|
+
currentNode = componentFn();
|
|
114
|
+
endRender();
|
|
115
|
+
scheduleRender();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
stdout.on('resize', handleResize);
|
|
119
|
+
// Cleanup on exit
|
|
120
|
+
appContext.onExit(() => {
|
|
121
|
+
cleanup();
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* Schedule a render (with throttling)
|
|
125
|
+
*/
|
|
126
|
+
function scheduleRender() {
|
|
127
|
+
if (pendingRender || isUnmounted)
|
|
128
|
+
return;
|
|
129
|
+
const now = Date.now();
|
|
130
|
+
const elapsed = now - lastRenderTime;
|
|
131
|
+
if (elapsed >= minRenderInterval) {
|
|
132
|
+
doRender();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
pendingRender = true;
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
pendingRender = false;
|
|
138
|
+
if (!isUnmounted) {
|
|
139
|
+
doRender();
|
|
140
|
+
}
|
|
141
|
+
}, minRenderInterval - elapsed);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Perform actual render
|
|
146
|
+
*/
|
|
147
|
+
function doRender() {
|
|
148
|
+
if (isUnmounted || !currentNode)
|
|
149
|
+
return;
|
|
150
|
+
lastRenderTime = Date.now();
|
|
151
|
+
const width = stdout.columns || 80;
|
|
152
|
+
const height = stdout.rows || 24;
|
|
153
|
+
// Separate static from interactive content
|
|
154
|
+
const { staticNodes, interactiveNode } = separateStaticNodes(currentNode);
|
|
155
|
+
// Render new static content first (above interactive content)
|
|
156
|
+
for (let i = 0; i < staticNodes.length; i++) {
|
|
157
|
+
const staticNode = staticNodes[i];
|
|
158
|
+
const staticId = getStaticNodeId(staticNode, i);
|
|
159
|
+
if (!renderedStaticIds.has(staticId)) {
|
|
160
|
+
// Render this static node
|
|
161
|
+
const staticOutput = renderToString(staticNode, width);
|
|
162
|
+
if (staticOutput.trim()) {
|
|
163
|
+
// Clear the interactive area before writing static
|
|
164
|
+
logUpdate.clear();
|
|
165
|
+
// Write static content (it becomes permanent)
|
|
166
|
+
stdout.write(staticOutput + '\n');
|
|
167
|
+
staticLineCount += staticOutput.split('\n').length;
|
|
168
|
+
renderedStaticIds.add(staticId);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Calculate layout for hit testing (use full screen dimensions)
|
|
173
|
+
const layout = calculateLayout(interactiveNode, width, height);
|
|
174
|
+
// Register elements in hit-test registry for mouse events
|
|
175
|
+
registerHitTestFromLayout(layout);
|
|
176
|
+
// Enable/disable mouse tracking based on clickable elements
|
|
177
|
+
const hitTestRegistry = getHitTestRegistry();
|
|
178
|
+
if (hitTestRegistry.hasClickableElements() && !mouseTrackingEnabled) {
|
|
179
|
+
enableMouseTracking();
|
|
180
|
+
mouseTrackingEnabled = true;
|
|
181
|
+
}
|
|
182
|
+
else if (!hitTestRegistry.hasClickableElements() && mouseTrackingEnabled) {
|
|
183
|
+
disableMouseTracking();
|
|
184
|
+
mouseTrackingEnabled = false;
|
|
185
|
+
}
|
|
186
|
+
// Render interactive content
|
|
187
|
+
const output = renderToString(interactiveNode, width);
|
|
188
|
+
if (output === lastOutput && !debug) {
|
|
189
|
+
return; // No changes
|
|
190
|
+
}
|
|
191
|
+
if (debug) {
|
|
192
|
+
// Debug mode: append output instead of replacing
|
|
193
|
+
stdout.write(output + '\n');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// Use incremental log updater for efficient rendering
|
|
197
|
+
logUpdate(output);
|
|
198
|
+
}
|
|
199
|
+
lastOutput = output;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Cleanup resources
|
|
203
|
+
*/
|
|
204
|
+
function cleanup() {
|
|
205
|
+
if (isUnmounted)
|
|
206
|
+
return;
|
|
207
|
+
isUnmounted = true;
|
|
208
|
+
// Disable mouse tracking if enabled
|
|
209
|
+
if (mouseTrackingEnabled) {
|
|
210
|
+
disableMouseTracking();
|
|
211
|
+
mouseTrackingEnabled = false;
|
|
212
|
+
}
|
|
213
|
+
stdout.off('resize', handleResize);
|
|
214
|
+
logUpdate.done(); // Restore cursor and cleanup
|
|
215
|
+
resetHookState(); // Clear all hook state
|
|
216
|
+
cleanupApp();
|
|
217
|
+
}
|
|
218
|
+
// Create reactive render effect
|
|
219
|
+
// This will re-run whenever any signal used in the component changes
|
|
220
|
+
const disposeRender = createEffect(() => {
|
|
221
|
+
// Call componentFn inside the effect to track signal dependencies
|
|
222
|
+
// When any signal read during component evaluation changes, this effect re-runs
|
|
223
|
+
beginRender();
|
|
224
|
+
currentNode = componentFn();
|
|
225
|
+
endRender();
|
|
226
|
+
scheduleRender();
|
|
227
|
+
});
|
|
228
|
+
return {
|
|
229
|
+
rerender: (newNode) => {
|
|
230
|
+
currentNode = newNode;
|
|
231
|
+
scheduleRender();
|
|
232
|
+
},
|
|
233
|
+
unmount: () => {
|
|
234
|
+
cleanup();
|
|
235
|
+
disposeRender();
|
|
236
|
+
// Final render
|
|
237
|
+
if (!debug) {
|
|
238
|
+
stdout.write('\n');
|
|
239
|
+
}
|
|
240
|
+
resolveExit();
|
|
241
|
+
},
|
|
242
|
+
waitUntilExit: () => exitPromise,
|
|
243
|
+
clear: () => {
|
|
244
|
+
if (!debug) {
|
|
245
|
+
logUpdate.clear();
|
|
246
|
+
stdout.write(ansi.clearTerminal);
|
|
247
|
+
lastOutput = '';
|
|
248
|
+
doRender();
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Render once and return the string (no interactivity)
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* const output = renderOnce(MyComponent());
|
|
258
|
+
* console.log(output);
|
|
259
|
+
*/
|
|
260
|
+
export function renderOnce(node, width) {
|
|
261
|
+
return renderToString(node, width ?? process.stdout.columns ?? 80);
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=render-loop.js.map
|