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
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storybook App - Interactive component catalog
|
|
3
|
+
*
|
|
4
|
+
* Refactored version using modular story imports and reactive global store.
|
|
5
|
+
*/
|
|
6
|
+
import { Box, Text } from '../primitives/nodes.js';
|
|
7
|
+
import { Divider } from '../primitives/divider.js';
|
|
8
|
+
import { render } from '../app/render-loop.js';
|
|
9
|
+
import { useState, useInput, useApp, useEffect } from '../hooks/index.js';
|
|
10
|
+
import { createRef } from '../core/index.js';
|
|
11
|
+
import { startTick, stopTick, getTick, isTickRunning, setTickRate } from '../core/tick.js';
|
|
12
|
+
import { allStories } from './stories/index.js';
|
|
13
|
+
import { COLORS, TUIUIU_BIRD_COLORED } from './data/ascii-art.js';
|
|
14
|
+
import { SplashScreen, createSplashScreen } from '../design-system/visual/splash-screen.js';
|
|
15
|
+
// Storybook Global State & Logger
|
|
16
|
+
import { storybookStore, interceptConsole } from './store.js';
|
|
17
|
+
import { LogViewer } from './components/log-viewer.js';
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// Initialization
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// Patch console immediately to capture logs
|
|
22
|
+
interceptConsole();
|
|
23
|
+
/**
|
|
24
|
+
* Get unique categories from stories
|
|
25
|
+
*/
|
|
26
|
+
function getCategories() {
|
|
27
|
+
const categories = new Set();
|
|
28
|
+
for (const story of allStories) {
|
|
29
|
+
categories.add(story.category);
|
|
30
|
+
}
|
|
31
|
+
return Array.from(categories).sort();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get stories for a category
|
|
35
|
+
*/
|
|
36
|
+
function getStoriesByCategory(category) {
|
|
37
|
+
return allStories.filter((s) => s.category === category);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Render story content safely
|
|
41
|
+
*/
|
|
42
|
+
function StoryContent(props) {
|
|
43
|
+
const { story, values, frame = 0 } = props;
|
|
44
|
+
try {
|
|
45
|
+
return story.render(values, frame);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error('Render error:', error); // Captured by our interceptor!
|
|
49
|
+
return Box({ flexDirection: 'column', padding: 1, borderStyle: 'single', borderColor: 'red' }, Text({ color: 'red', bold: true }, 'Render Error'), Text({ color: 'red' }, error.message || String(error)));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sidebar component - category and story list with virtual scroll
|
|
54
|
+
*/
|
|
55
|
+
function Sidebar(props) {
|
|
56
|
+
const { categories, currentCategory, stories, selectedIndex, focusArea, onCategoryClick, onFocus } = props;
|
|
57
|
+
const isFocused = focusArea === 'sidebar';
|
|
58
|
+
// Virtual scroll: show window around selected item
|
|
59
|
+
const maxVisible = 20;
|
|
60
|
+
const totalStories = stories.length;
|
|
61
|
+
// Calculate visible window
|
|
62
|
+
let startIdx = 0;
|
|
63
|
+
let endIdx = Math.min(maxVisible, totalStories);
|
|
64
|
+
if (totalStories > maxVisible) {
|
|
65
|
+
// Keep selected item in the middle when possible
|
|
66
|
+
const halfWindow = Math.floor(maxVisible / 2);
|
|
67
|
+
startIdx = Math.max(0, selectedIndex - halfWindow);
|
|
68
|
+
endIdx = Math.min(totalStories, startIdx + maxVisible);
|
|
69
|
+
// Adjust if we hit the end
|
|
70
|
+
if (endIdx === totalStories) {
|
|
71
|
+
startIdx = Math.max(0, totalStories - maxVisible);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const visibleStories = stories.slice(startIdx, endIdx);
|
|
75
|
+
const hasMoreAbove = startIdx > 0;
|
|
76
|
+
const hasMoreBelow = endIdx < totalStories;
|
|
77
|
+
const scrollUpText = hasMoreAbove ? ` ▲ ${startIdx} more` : '';
|
|
78
|
+
const scrollDownText = hasMoreBelow ? ` ▼ ${totalStories - endIdx} more` : '';
|
|
79
|
+
return Box({
|
|
80
|
+
flexDirection: 'column',
|
|
81
|
+
width: 50,
|
|
82
|
+
borderStyle: 'single',
|
|
83
|
+
borderColor: isFocused ? 'cyan' : 'gray',
|
|
84
|
+
},
|
|
85
|
+
// Header
|
|
86
|
+
Box({ borderStyle: 'single', borderColor: isFocused ? 'cyan' : 'gray', paddingX: 1 }, Text({ color: 'cyan', bold: true }, 'Stories')),
|
|
87
|
+
// Categories (horizontal tabs) - clickable
|
|
88
|
+
Box({ flexDirection: 'row', paddingX: 1, marginY: 1 }, Text({ color: 'gray' }, '◀ ▶ '), ...categories.map((cat, catIdx) => {
|
|
89
|
+
const isActive = cat === currentCategory;
|
|
90
|
+
const count = getStoriesByCategory(cat).length;
|
|
91
|
+
const shortName = cat.slice(0, 4);
|
|
92
|
+
return Box({
|
|
93
|
+
onClick: () => {
|
|
94
|
+
onFocus?.();
|
|
95
|
+
onCategoryClick?.(catIdx);
|
|
96
|
+
},
|
|
97
|
+
}, Text({
|
|
98
|
+
color: isActive ? 'cyan' : 'gray',
|
|
99
|
+
bold: isActive,
|
|
100
|
+
inverse: isActive,
|
|
101
|
+
}, isActive ? `[${shortName}:${count}]` : ` ${shortName}:${count} `));
|
|
102
|
+
})), Divider({ color: 'gray' }),
|
|
103
|
+
// Scroll up indicator (always present, may be empty)
|
|
104
|
+
Box({ paddingX: 1, height: 1 }, Text({ color: 'cyan', dim: true }, scrollUpText)),
|
|
105
|
+
// Stories list (fixed height container) - clickable items
|
|
106
|
+
Box({ flexDirection: 'column', paddingX: 1, flexGrow: 1 }, ...visibleStories.map((story, idx) => {
|
|
107
|
+
const actualIdx = startIdx + idx;
|
|
108
|
+
const isSelected = actualIdx === selectedIndex;
|
|
109
|
+
return Box({
|
|
110
|
+
onClick: () => {
|
|
111
|
+
onFocus?.();
|
|
112
|
+
props.onStorySelect(actualIdx);
|
|
113
|
+
},
|
|
114
|
+
}, Text({
|
|
115
|
+
color: isSelected ? 'white' : 'gray',
|
|
116
|
+
bold: isSelected,
|
|
117
|
+
inverse: isSelected && isFocused,
|
|
118
|
+
}, isSelected ? ` ${story.name} ` : ` ${story.name}`));
|
|
119
|
+
})),
|
|
120
|
+
// Scroll down indicator (always present, may be empty)
|
|
121
|
+
Box({ paddingX: 1, height: 1 }, Text({ color: 'cyan', dim: true }, scrollDownText)),
|
|
122
|
+
// Footer
|
|
123
|
+
Box({ borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({ color: 'gray', dim: true }, `${selectedIndex + 1}/${stories.length}`)));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Control Panel component - edit story props
|
|
127
|
+
*/
|
|
128
|
+
function ControlPanel(props) {
|
|
129
|
+
const { story, values, focusedControlIndex, focusArea, isEditingText, editingTextValue, onTextChange, onFocus, onSelectControl, onStartTextEdit } = props;
|
|
130
|
+
const isFocused = focusArea === 'controls';
|
|
131
|
+
const controls = Object.entries(story.controls || {});
|
|
132
|
+
if (controls.length === 0) {
|
|
133
|
+
return Box({ padding: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, 'No controls defined'));
|
|
134
|
+
}
|
|
135
|
+
return Box({
|
|
136
|
+
flexDirection: 'column',
|
|
137
|
+
borderStyle: 'single',
|
|
138
|
+
borderColor: isFocused ? 'cyan' : 'gray',
|
|
139
|
+
width: 30,
|
|
140
|
+
}, Box({ borderStyle: 'single', borderColor: isFocused ? 'cyan' : 'gray', paddingX: 1 }, Text({ color: 'yellow', bold: true }, 'Controls')), Box({ flexDirection: 'column', padding: 1 }, ...controls.map(([key, control], idx) => {
|
|
141
|
+
const value = values[key] ?? control.defaultValue;
|
|
142
|
+
const isActive = idx === focusedControlIndex && isFocused;
|
|
143
|
+
const isThisEditingText = isActive && isEditingText && control.type === 'text';
|
|
144
|
+
// Click handler for control interaction
|
|
145
|
+
const handleClick = () => {
|
|
146
|
+
onFocus?.();
|
|
147
|
+
onSelectControl?.(idx);
|
|
148
|
+
// Direct interaction based on control type
|
|
149
|
+
if (control.type === 'boolean') {
|
|
150
|
+
props.onValueChange(key, !value);
|
|
151
|
+
}
|
|
152
|
+
else if (control.type === 'text') {
|
|
153
|
+
onStartTextEdit?.(key, value);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return Box({
|
|
157
|
+
flexDirection: 'column',
|
|
158
|
+
marginBottom: 1,
|
|
159
|
+
onClick: handleClick,
|
|
160
|
+
}, Box({}, Text({ color: isActive ? 'cyan' : 'gray' }, `${control.label}: `), isThisEditingText
|
|
161
|
+
? renderTextInputInline(editingTextValue, isActive, onTextChange)
|
|
162
|
+
: renderControlValue(value, control.type, isActive)));
|
|
163
|
+
})));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Render inline text input for editing
|
|
167
|
+
*/
|
|
168
|
+
function renderTextInputInline(value, isActive, onChange) {
|
|
169
|
+
// Create inline text input with visible cursor
|
|
170
|
+
const cursorChar = '▎';
|
|
171
|
+
return Box({ flexDirection: 'row' }, Text({ color: 'white' }, '"'), Text({ color: 'cyan' }, value), isActive ? Text({ color: 'cyan', bold: true }, cursorChar) : null, Text({ color: 'white' }, '"'));
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Render control value display
|
|
175
|
+
*/
|
|
176
|
+
function renderControlValue(value, type, isActive) {
|
|
177
|
+
const color = isActive ? 'white' : 'gray';
|
|
178
|
+
switch (type) {
|
|
179
|
+
case 'boolean':
|
|
180
|
+
return Text({ color: value ? 'green' : 'red' }, value ? 'true' : 'false');
|
|
181
|
+
case 'number':
|
|
182
|
+
case 'range':
|
|
183
|
+
return Text({ color }, String(value));
|
|
184
|
+
case 'color':
|
|
185
|
+
return Text({ color: value, bold: isActive }, value);
|
|
186
|
+
case 'select':
|
|
187
|
+
return Text({ color }, String(value));
|
|
188
|
+
case 'text':
|
|
189
|
+
return Text({ color }, `"${value}"`);
|
|
190
|
+
default:
|
|
191
|
+
return Text({ color }, String(value));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Docs view - show story documentation
|
|
196
|
+
*/
|
|
197
|
+
function DocsView(props) {
|
|
198
|
+
const { story } = props;
|
|
199
|
+
const controls = Object.entries(story.controls || {});
|
|
200
|
+
const children = [
|
|
201
|
+
// Title
|
|
202
|
+
Box({ marginBottom: 1 }, Text({ color: 'cyan', bold: true }, `📖 ${story.name}`)),
|
|
203
|
+
];
|
|
204
|
+
// Description (optional)
|
|
205
|
+
if (story.description) {
|
|
206
|
+
children.push(Box({ marginBottom: 1 }, Text({ color: 'white' }, story.description)));
|
|
207
|
+
}
|
|
208
|
+
// Controls documentation (if any)
|
|
209
|
+
if (controls.length > 0) {
|
|
210
|
+
children.push(Box({ flexDirection: 'column', marginTop: 1 }, Text({ color: 'yellow', bold: true }, 'Props:'), ...controls.map(([key, control]) => Box({ marginLeft: 1 }, Text({ color: 'cyan' }, `• ${key}`), Text({ color: 'gray' }, ` (${control.type})`), Text({ color: 'gray', dim: true }, ` - ${control.label}`)))));
|
|
211
|
+
}
|
|
212
|
+
// Category
|
|
213
|
+
children.push(Box({ marginTop: 1 }, Text({ color: 'gray' }, 'Category: '), Text({ color: 'magenta' }, story.category)));
|
|
214
|
+
return Box({ flexDirection: 'column', padding: 1 }, ...children);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Compare view - show story variants side by side
|
|
218
|
+
*/
|
|
219
|
+
function CompareView(props) {
|
|
220
|
+
const { story, values } = props;
|
|
221
|
+
const controls = Object.entries(story.controls || {});
|
|
222
|
+
// Find a control to compare (prefer select or boolean)
|
|
223
|
+
const compareControl = controls.find(([, c]) => c.type === 'select' || c.type === 'boolean');
|
|
224
|
+
if (!compareControl) {
|
|
225
|
+
return Box({ padding: 1 }, Text({ color: 'gray' }, 'No comparable props found for this story'));
|
|
226
|
+
}
|
|
227
|
+
const [key, control] = compareControl;
|
|
228
|
+
const variants = control.type === 'select' ? (control.options || []) :
|
|
229
|
+
control.type === 'boolean' ? [true, false] : [];
|
|
230
|
+
return Box({ flexDirection: 'column', padding: 1 }, Text({ color: 'green', bold: true }, `🔀 Comparing: ${control.label}`), Divider({ color: 'gray' }), Box({ flexDirection: 'row', flexWrap: 'wrap', gap: 1 }, ...variants.slice(0, 4).map((variant) => Box({
|
|
231
|
+
flexDirection: 'column',
|
|
232
|
+
borderStyle: 'single',
|
|
233
|
+
borderColor: values[key] === variant ? 'cyan' : 'gray',
|
|
234
|
+
padding: 1,
|
|
235
|
+
minWidth: 20,
|
|
236
|
+
}, Text({ color: 'cyan', dim: true }, String(variant)), Box({ marginTop: 1 }, StoryContent({ story, values: { ...values, [key]: variant }, frame: 0 }))))));
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Preview Panel component - render story with mode-specific content
|
|
240
|
+
*/
|
|
241
|
+
function PreviewPanel(props) {
|
|
242
|
+
const { story, values, viewMode, focusArea, frame, isPaused } = props;
|
|
243
|
+
const isFocused = focusArea === 'preview';
|
|
244
|
+
const isAnimated = story.animation?.enabled;
|
|
245
|
+
// Render mode-specific content
|
|
246
|
+
const renderContent = () => {
|
|
247
|
+
switch (viewMode) {
|
|
248
|
+
case 'docs':
|
|
249
|
+
return DocsView({ story });
|
|
250
|
+
case 'comparatives':
|
|
251
|
+
return CompareView({ story, values });
|
|
252
|
+
case 'preview':
|
|
253
|
+
case 'playground':
|
|
254
|
+
default:
|
|
255
|
+
return Box({ padding: 1, flexGrow: 1 }, StoryContent({ story, values, frame }));
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
// Build children array without false values
|
|
259
|
+
const previewChildren = [];
|
|
260
|
+
// Header with optional animation indicator
|
|
261
|
+
const headerChildren = [
|
|
262
|
+
Text({ color: 'gray' }, `${story.category} / `),
|
|
263
|
+
Text({ color: 'cyan', bold: true }, story.name),
|
|
264
|
+
];
|
|
265
|
+
if (isAnimated) {
|
|
266
|
+
headerChildren.push(Text({ color: isPaused ? 'yellow' : 'green' }, isPaused ? ' ⏸' : ' ▶'));
|
|
267
|
+
}
|
|
268
|
+
previewChildren.push(Box({ borderStyle: 'single', borderColor: isFocused ? 'cyan' : 'gray', paddingX: 1 }, ...headerChildren));
|
|
269
|
+
// View mode tabs
|
|
270
|
+
const modeText = isAnimated
|
|
271
|
+
? `[P][G][C][D] ${viewMode.toUpperCase()} Frame:${frame}`
|
|
272
|
+
: `[P][G][C][D] ${viewMode.toUpperCase()}`;
|
|
273
|
+
previewChildren.push(Box({ paddingX: 1 }, Text({ color: getModeColor(viewMode) }, modeText)));
|
|
274
|
+
if ((viewMode === 'preview' || viewMode === 'playground') && story.description) {
|
|
275
|
+
previewChildren.push(Box({ paddingX: 1 }, Text({ color: 'gray', dim: true }, story.description)));
|
|
276
|
+
}
|
|
277
|
+
previewChildren.push(Divider({ color: 'gray' }));
|
|
278
|
+
previewChildren.push(renderContent());
|
|
279
|
+
return Box({
|
|
280
|
+
flexDirection: 'column',
|
|
281
|
+
flexGrow: 1,
|
|
282
|
+
borderStyle: 'single',
|
|
283
|
+
borderColor: isFocused ? 'cyan' : 'gray',
|
|
284
|
+
}, ...previewChildren);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get color for view mode
|
|
288
|
+
*/
|
|
289
|
+
function getModeColor(mode) {
|
|
290
|
+
switch (mode) {
|
|
291
|
+
case 'preview': return 'cyan';
|
|
292
|
+
case 'playground': return 'yellow';
|
|
293
|
+
case 'comparatives': return 'green';
|
|
294
|
+
case 'docs': return 'magenta';
|
|
295
|
+
default: return 'white';
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Status bar component
|
|
300
|
+
*/
|
|
301
|
+
function StatusBar(props) {
|
|
302
|
+
const { isEditingText } = props;
|
|
303
|
+
if (isEditingText) {
|
|
304
|
+
return Box({ borderStyle: 'single', borderColor: 'yellow', paddingX: 1 }, Text({ color: 'yellow', bold: true }, '✏️ EDITING TEXT '), Text({ color: 'gray' }, '[Enter] Save '), Text({ color: 'gray' }, '[Esc] Cancel '), Text({ color: 'gray' }, '[Backspace] Delete'));
|
|
305
|
+
}
|
|
306
|
+
return Box({ borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({ color: 'gray' }, '[Esc] Back/Quit '), Text({ color: 'gray' }, '[Enter] Select '), Text({ color: 'gray' }, '[Tab] Focus '), Text({ color: 'gray' }, '[F12] Logs '), Text({ color: 'cyan', dim: true }, '🖱️ Mouse enabled'));
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Format elapsed time
|
|
310
|
+
*/
|
|
311
|
+
function formatTime(seconds) {
|
|
312
|
+
const mins = Math.floor(seconds / 60);
|
|
313
|
+
const secs = seconds % 60;
|
|
314
|
+
return `${String(mins).padStart(2, '0')}:${String(secs).padStart(2, '0')}`;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Navbar component with metrics
|
|
318
|
+
*/
|
|
319
|
+
function Navbar(props) {
|
|
320
|
+
const { componentCount, clicks, keystrokes, fps, elapsedSeconds } = props;
|
|
321
|
+
const fpsColor = fps >= 30 ? 'green' : fps >= 15 ? 'yellow' : 'red';
|
|
322
|
+
return Box({
|
|
323
|
+
flexDirection: 'row',
|
|
324
|
+
justifyContent: 'space-between',
|
|
325
|
+
borderStyle: 'single',
|
|
326
|
+
borderColor: 'magenta',
|
|
327
|
+
}, Text({ color: 'magenta', bold: true }, ' Tuiuiu.js '), Box({ flexDirection: 'row' }, Text({ color: 'white', bold: true }, formatTime(elapsedSeconds)), Text({ color: 'gray', dim: true }, ' '), Text({ color: 'cyan' }, String(componentCount)), Text({ color: 'gray', dim: true }, 's '), Text({ color: 'yellow' }, String(clicks)), Text({ color: 'gray', dim: true }, 'c '), Text({ color: 'green' }, String(keystrokes)), Text({ color: 'gray', dim: true }, 'k '), Text({ color: fpsColor, bold: true }, `${fps}fps `)));
|
|
328
|
+
}
|
|
329
|
+
// =============================================================================
|
|
330
|
+
// Splash Screen
|
|
331
|
+
// =============================================================================
|
|
332
|
+
// Module-level splash state (created once when storybook starts)
|
|
333
|
+
let splashState = null;
|
|
334
|
+
function getSplashState() {
|
|
335
|
+
if (!splashState) {
|
|
336
|
+
splashState = createSplashScreen({
|
|
337
|
+
duration: 1500,
|
|
338
|
+
fadeInDuration: 300,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return splashState;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Main Storybook App
|
|
345
|
+
*/
|
|
346
|
+
function StorybookApp() {
|
|
347
|
+
const app = useApp();
|
|
348
|
+
// Get or create splash state
|
|
349
|
+
const splash = getSplashState();
|
|
350
|
+
// Render splash screen if visible
|
|
351
|
+
if (splash.isVisible()) {
|
|
352
|
+
const splashNode = SplashScreen({
|
|
353
|
+
coloredArt: TUIUIU_BIRD_COLORED,
|
|
354
|
+
subtitle: 'Component Explorer',
|
|
355
|
+
version: '1.0.0',
|
|
356
|
+
loadingType: 'spinner',
|
|
357
|
+
spinnerStyle: 'dots',
|
|
358
|
+
loadingMessage: 'Loading stories...',
|
|
359
|
+
state: splash,
|
|
360
|
+
});
|
|
361
|
+
// Return splash or empty box (SplashScreen can return null when not visible)
|
|
362
|
+
return splashNode ?? Box({});
|
|
363
|
+
}
|
|
364
|
+
// State
|
|
365
|
+
const categories = getCategories();
|
|
366
|
+
const [currentCategoryIndex, setCurrentCategoryIndex] = useState(0);
|
|
367
|
+
const [selectedStoryIndex, setSelectedStoryIndex] = useState(0);
|
|
368
|
+
const [viewMode, setViewMode] = useState('preview');
|
|
369
|
+
const [focusArea, setFocusArea] = useState('sidebar');
|
|
370
|
+
const [focusedControlIndex, setFocusedControlIndex] = useState(0);
|
|
371
|
+
const [controlValues, setControlValues] = useState({});
|
|
372
|
+
// Text editing state
|
|
373
|
+
const [isEditingText, setIsEditingText] = useState(false);
|
|
374
|
+
const [editingTextValue, setEditingTextValue] = useState('');
|
|
375
|
+
// Animation state - now uses global tick
|
|
376
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
377
|
+
// Get animation frame from global tick
|
|
378
|
+
const animationFrame = () => getTick();
|
|
379
|
+
// Metrics state
|
|
380
|
+
const [clickCount, setClickCount] = useState(0);
|
|
381
|
+
const [keystrokeCount, setKeystrokeCount] = useState(0);
|
|
382
|
+
const [fps, setFps] = useState(0);
|
|
383
|
+
const [elapsedSeconds, setElapsedSeconds] = useState(0);
|
|
384
|
+
// Refs for perf tracking
|
|
385
|
+
const frameCountRef = createRef(0);
|
|
386
|
+
const lastFpsTimeRef = createRef(Date.now());
|
|
387
|
+
// Timer effect
|
|
388
|
+
useEffect(() => {
|
|
389
|
+
const timer = setInterval(() => {
|
|
390
|
+
setElapsedSeconds((s) => s + 1);
|
|
391
|
+
const now = Date.now();
|
|
392
|
+
const elapsed = now - lastFpsTimeRef.current;
|
|
393
|
+
if (elapsed >= 1000) {
|
|
394
|
+
setFps(Math.round((frameCountRef.current * 1000) / elapsed));
|
|
395
|
+
frameCountRef.current = 0;
|
|
396
|
+
lastFpsTimeRef.current = now;
|
|
397
|
+
}
|
|
398
|
+
}, 1000);
|
|
399
|
+
return () => clearInterval(timer);
|
|
400
|
+
});
|
|
401
|
+
frameCountRef.current++;
|
|
402
|
+
// Derived state
|
|
403
|
+
const currentCategory = categories[currentCategoryIndex()] || 'Primitives';
|
|
404
|
+
const stories = getStoriesByCategory(currentCategory);
|
|
405
|
+
const currentStory = stories[selectedStoryIndex()] || stories[0];
|
|
406
|
+
// Initialize control values from defaults
|
|
407
|
+
const getStoryValues = () => {
|
|
408
|
+
if (!currentStory)
|
|
409
|
+
return {};
|
|
410
|
+
const stored = controlValues()[currentStory.name];
|
|
411
|
+
if (stored)
|
|
412
|
+
return stored;
|
|
413
|
+
const defaults = {};
|
|
414
|
+
for (const [key, control] of Object.entries(currentStory.controls || {})) {
|
|
415
|
+
defaults[key] = control.defaultValue;
|
|
416
|
+
}
|
|
417
|
+
return defaults;
|
|
418
|
+
};
|
|
419
|
+
const values = getStoryValues();
|
|
420
|
+
// Global tick control for animations
|
|
421
|
+
useEffect(() => {
|
|
422
|
+
const cat = categories[currentCategoryIndex()] || 'Primitives';
|
|
423
|
+
const catStories = getStoriesByCategory(cat);
|
|
424
|
+
const activeStory = catStories[selectedStoryIndex()] || catStories[0];
|
|
425
|
+
const paused = isPaused();
|
|
426
|
+
// Stop tick if paused
|
|
427
|
+
if (paused && isTickRunning()) {
|
|
428
|
+
stopTick();
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
// Start tick if not paused and story has animation
|
|
432
|
+
if (!paused && activeStory?.animation?.enabled) {
|
|
433
|
+
const interval = activeStory.animation.interval ?? 100;
|
|
434
|
+
setTickRate(interval);
|
|
435
|
+
if (!isTickRunning()) {
|
|
436
|
+
startTick(interval);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
const setControlValue = (key, value) => {
|
|
441
|
+
if (!currentStory)
|
|
442
|
+
return;
|
|
443
|
+
setControlValues((cv) => ({
|
|
444
|
+
...cv,
|
|
445
|
+
[currentStory.name]: {
|
|
446
|
+
...(cv[currentStory.name] || {}),
|
|
447
|
+
[key]: value,
|
|
448
|
+
},
|
|
449
|
+
}));
|
|
450
|
+
};
|
|
451
|
+
const controlKeys = currentStory ? Object.keys(currentStory.controls || {}) : [];
|
|
452
|
+
// Input handling
|
|
453
|
+
useInput((input, key) => {
|
|
454
|
+
setKeystrokeCount((c) => c + 1);
|
|
455
|
+
// Toggle Console Logs
|
|
456
|
+
if (key.f12 || (key.ctrl && input === 'l')) {
|
|
457
|
+
storybookStore.dispatch({ type: 'TOGGLE_LOG' });
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
// Clear logs
|
|
461
|
+
if (input === 'C') { // Shift+c
|
|
462
|
+
storybookStore.dispatch({ type: 'CLEAR_LOGS' });
|
|
463
|
+
}
|
|
464
|
+
// =========================================================================
|
|
465
|
+
// TEXT EDITING MODE
|
|
466
|
+
// =========================================================================
|
|
467
|
+
if (isEditingText()) {
|
|
468
|
+
// Escape - cancel editing
|
|
469
|
+
if (key.escape) {
|
|
470
|
+
setIsEditingText(false);
|
|
471
|
+
setEditingTextValue('');
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
// Enter - save and exit editing
|
|
475
|
+
if (key.return) {
|
|
476
|
+
const currentKey = controlKeys[focusedControlIndex()];
|
|
477
|
+
if (currentKey) {
|
|
478
|
+
setControlValue(currentKey, editingTextValue());
|
|
479
|
+
}
|
|
480
|
+
setIsEditingText(false);
|
|
481
|
+
setEditingTextValue('');
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
// Backspace - delete character
|
|
485
|
+
if (key.backspace) {
|
|
486
|
+
setEditingTextValue((v) => v.slice(0, -1));
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
// Regular character input - append to value
|
|
490
|
+
if (input && input.length > 0 && !key.ctrl && !key.meta) {
|
|
491
|
+
setEditingTextValue((v) => v + input);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
// Consume all other keys while editing
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
// =========================================================================
|
|
498
|
+
// NORMAL MODE
|
|
499
|
+
// =========================================================================
|
|
500
|
+
// Global shortcuts
|
|
501
|
+
if (key.escape) {
|
|
502
|
+
if (focusArea() !== 'sidebar') {
|
|
503
|
+
setFocusArea('sidebar');
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
app.exit();
|
|
507
|
+
}
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if (input === 'q') {
|
|
511
|
+
app.exit();
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
if (input === 'p') {
|
|
515
|
+
setViewMode('preview');
|
|
516
|
+
setClickCount((c) => c + 1);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
if (input === 'g') {
|
|
520
|
+
setViewMode('playground');
|
|
521
|
+
setFocusArea('controls');
|
|
522
|
+
setClickCount((c) => c + 1);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (input === 'c') {
|
|
526
|
+
setViewMode('comparatives');
|
|
527
|
+
setClickCount((c) => c + 1);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (input === 'd') {
|
|
531
|
+
setViewMode('docs');
|
|
532
|
+
setClickCount((c) => c + 1);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (key.return) {
|
|
536
|
+
setClickCount((c) => c + 1);
|
|
537
|
+
if (focusArea() === 'sidebar') {
|
|
538
|
+
const hasControls = Object.keys(currentStory?.controls || {}).length > 0;
|
|
539
|
+
if (hasControls) {
|
|
540
|
+
setViewMode('playground');
|
|
541
|
+
setFocusArea('controls');
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
setViewMode('preview');
|
|
545
|
+
setFocusArea('preview');
|
|
546
|
+
}
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
// Enter on a text control - start editing
|
|
550
|
+
if (focusArea() === 'controls' && viewMode() === 'playground') {
|
|
551
|
+
const currentKey = controlKeys[focusedControlIndex()];
|
|
552
|
+
const currentControl = currentKey ? currentStory?.controls?.[currentKey] : null;
|
|
553
|
+
if (currentControl?.type === 'text') {
|
|
554
|
+
const currentValue = values[currentKey] ?? currentControl.defaultValue;
|
|
555
|
+
setEditingTextValue(currentValue);
|
|
556
|
+
setIsEditingText(true);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (key.tab) {
|
|
562
|
+
setFocusArea((f) => {
|
|
563
|
+
if (f === 'sidebar')
|
|
564
|
+
return 'preview';
|
|
565
|
+
if (f === 'preview')
|
|
566
|
+
return viewMode() === 'playground' ? 'controls' : 'sidebar';
|
|
567
|
+
return 'sidebar';
|
|
568
|
+
});
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
if (focusArea() === 'sidebar') {
|
|
572
|
+
if (key.upArrow) {
|
|
573
|
+
setSelectedStoryIndex((i) => Math.max(0, i - 1));
|
|
574
|
+
}
|
|
575
|
+
if (key.downArrow) {
|
|
576
|
+
setSelectedStoryIndex((i) => Math.min(stories.length - 1, i + 1));
|
|
577
|
+
}
|
|
578
|
+
if (key.leftArrow) {
|
|
579
|
+
setCurrentCategoryIndex((i) => Math.max(0, i - 1));
|
|
580
|
+
setSelectedStoryIndex(0);
|
|
581
|
+
}
|
|
582
|
+
if (key.rightArrow) {
|
|
583
|
+
setCurrentCategoryIndex((i) => Math.min(categories.length - 1, i + 1));
|
|
584
|
+
setSelectedStoryIndex(0);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
if (focusArea() === 'controls' && viewMode() === 'playground') {
|
|
588
|
+
if (key.upArrow) {
|
|
589
|
+
setFocusedControlIndex((i) => Math.max(0, i - 1));
|
|
590
|
+
}
|
|
591
|
+
if (key.downArrow) {
|
|
592
|
+
setFocusedControlIndex((i) => Math.min(controlKeys.length - 1, i + 1));
|
|
593
|
+
}
|
|
594
|
+
const currentKey = controlKeys[focusedControlIndex()];
|
|
595
|
+
const currentControl = currentKey ? currentStory?.controls?.[currentKey] : null;
|
|
596
|
+
if (currentControl && currentKey) {
|
|
597
|
+
const currentValue = values[currentKey] ?? currentControl.defaultValue;
|
|
598
|
+
if (key.leftArrow || key.rightArrow) {
|
|
599
|
+
const delta = key.rightArrow ? 1 : -1;
|
|
600
|
+
switch (currentControl.type) {
|
|
601
|
+
case 'boolean':
|
|
602
|
+
setControlValue(currentKey, !currentValue);
|
|
603
|
+
break;
|
|
604
|
+
case 'number':
|
|
605
|
+
case 'range':
|
|
606
|
+
const step = currentControl.step || 1;
|
|
607
|
+
const min = currentControl.min ?? -Infinity;
|
|
608
|
+
const max = currentControl.max ?? Infinity;
|
|
609
|
+
setControlValue(currentKey, Math.max(min, Math.min(max, currentValue + delta * step)));
|
|
610
|
+
break;
|
|
611
|
+
case 'select':
|
|
612
|
+
if (currentControl.options) {
|
|
613
|
+
const idx = currentControl.options.indexOf(currentValue);
|
|
614
|
+
const newIdx = (idx + delta + currentControl.options.length) % currentControl.options.length;
|
|
615
|
+
setControlValue(currentKey, currentControl.options[newIdx]);
|
|
616
|
+
}
|
|
617
|
+
break;
|
|
618
|
+
case 'color':
|
|
619
|
+
const colorIdx = COLORS.indexOf(currentValue);
|
|
620
|
+
const newColorIdx = (colorIdx + delta + COLORS.length) % COLORS.length;
|
|
621
|
+
setControlValue(currentKey, COLORS[newColorIdx]);
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (input === ' ' && currentControl.type === 'boolean') {
|
|
626
|
+
setControlValue(currentKey, !currentValue);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (input === ' ' && focusArea() !== 'controls') {
|
|
631
|
+
if (currentStory?.animation?.enabled && currentStory?.animation?.pausable) {
|
|
632
|
+
setIsPaused((p) => !p);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
if (!currentStory) {
|
|
637
|
+
return Box({ flexDirection: 'column', padding: 2 }, Text({ color: 'yellow' }, 'No stories found'), Text({ color: 'gray' }, 'Add stories to src/storybook/stories/'));
|
|
638
|
+
}
|
|
639
|
+
return Box({ flexDirection: 'column', height: '100%' }, Navbar({
|
|
640
|
+
componentCount: allStories.length,
|
|
641
|
+
clicks: clickCount(),
|
|
642
|
+
keystrokes: keystrokeCount(),
|
|
643
|
+
fps: fps(),
|
|
644
|
+
elapsedSeconds: elapsedSeconds(),
|
|
645
|
+
}), Box({ flexDirection: 'row', flexGrow: 1 }, Sidebar({
|
|
646
|
+
categories,
|
|
647
|
+
currentCategory,
|
|
648
|
+
stories,
|
|
649
|
+
selectedIndex: selectedStoryIndex(),
|
|
650
|
+
focusArea: focusArea(),
|
|
651
|
+
onCategoryChange: () => { },
|
|
652
|
+
onStorySelect: setSelectedStoryIndex,
|
|
653
|
+
onCategoryClick: (idx) => {
|
|
654
|
+
setCurrentCategoryIndex(idx);
|
|
655
|
+
setSelectedStoryIndex(0);
|
|
656
|
+
},
|
|
657
|
+
onFocus: () => setFocusArea('sidebar'),
|
|
658
|
+
}), PreviewPanel({
|
|
659
|
+
story: currentStory,
|
|
660
|
+
values,
|
|
661
|
+
viewMode: viewMode(),
|
|
662
|
+
focusArea: focusArea(),
|
|
663
|
+
frame: animationFrame(),
|
|
664
|
+
isPaused: isPaused(),
|
|
665
|
+
}), viewMode() === 'playground' &&
|
|
666
|
+
ControlPanel({
|
|
667
|
+
story: currentStory,
|
|
668
|
+
values,
|
|
669
|
+
focusedControlIndex: focusedControlIndex(),
|
|
670
|
+
focusArea: focusArea(),
|
|
671
|
+
onValueChange: setControlValue,
|
|
672
|
+
isEditingText: isEditingText(),
|
|
673
|
+
editingTextValue: editingTextValue(),
|
|
674
|
+
onTextChange: setEditingTextValue,
|
|
675
|
+
onFocus: () => setFocusArea('controls'),
|
|
676
|
+
onSelectControl: setFocusedControlIndex,
|
|
677
|
+
onStartTextEdit: (key, value) => {
|
|
678
|
+
setEditingTextValue(value);
|
|
679
|
+
setIsEditingText(true);
|
|
680
|
+
},
|
|
681
|
+
})), StatusBar({ viewMode: viewMode(), focusArea: focusArea(), isEditingText: isEditingText() }),
|
|
682
|
+
// LOG VIEWER OVERLAY
|
|
683
|
+
LogViewer());
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Run the storybook
|
|
687
|
+
*/
|
|
688
|
+
export async function runStorybook() {
|
|
689
|
+
// Start global tick for animations
|
|
690
|
+
startTick(100);
|
|
691
|
+
const { waitUntilExit } = render(() => StorybookApp());
|
|
692
|
+
await waitUntilExit();
|
|
693
|
+
// Cleanup tick on exit
|
|
694
|
+
stopTick();
|
|
695
|
+
}
|
|
696
|
+
export { StorybookApp };
|
|
697
|
+
//# sourceMappingURL=app.js.map
|