termcast 1.3.9 → 1.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-utils.js +1 -1
- package/dist/action-utils.js.map +1 -1
- package/dist/apis/ai.js +1 -1
- package/dist/apis/ai.js.map +1 -1
- package/dist/apis/clipboard.js +2 -2
- package/dist/apis/clipboard.js.map +1 -1
- package/dist/apis/hud.d.ts +2 -2
- package/dist/apis/hud.d.ts.map +1 -1
- package/dist/apis/hud.js +5 -5
- package/dist/apis/hud.js.map +1 -1
- package/dist/apis/oauth.d.ts +1 -1
- package/dist/apis/oauth.d.ts.map +1 -1
- package/dist/apis/oauth.js +8 -8
- package/dist/apis/oauth.js.map +1 -1
- package/dist/apis/preferences.js +4 -4
- package/dist/apis/preferences.js.map +1 -1
- package/dist/apis/toast.d.ts +1 -5
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +26 -20
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.d.ts +2 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +9 -8
- package/dist/build.js.map +1 -1
- package/dist/cli.js +44 -2
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +8 -1
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +12 -0
- package/dist/colors.js.map +1 -1
- package/dist/compile.d.ts +30 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +156 -0
- package/dist/compile.js.map +1 -0
- package/dist/components/actions.d.ts +2 -1
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +11 -8
- package/dist/components/actions.js.map +1 -1
- package/dist/components/alert.js +4 -4
- package/dist/components/alert.js.map +1 -1
- package/dist/components/command-arguments.d.ts +9 -0
- package/dist/components/command-arguments.d.ts.map +1 -0
- package/dist/components/command-arguments.js +21 -0
- package/dist/components/command-arguments.js.map +1 -0
- package/dist/components/detail.d.ts +3 -3
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +20 -42
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +2 -1
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +81 -25
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +23 -33
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +11 -4
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.js +18 -31
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/description.d.ts +2 -0
- package/dist/components/form/description.d.ts.map +1 -1
- package/dist/components/form/description.js +21 -3
- package/dist/components/form/description.js.map +1 -1
- package/dist/components/form/dropdown.d.ts.map +1 -1
- package/dist/components/form/dropdown.js +17 -32
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/file-autocomplete.d.ts +7 -4
- package/dist/components/form/file-autocomplete.d.ts.map +1 -1
- package/dist/components/form/file-autocomplete.js +56 -48
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.d.ts +5 -0
- package/dist/components/form/file-picker.d.ts.map +1 -1
- package/dist/components/form/file-picker.js +48 -51
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/form-end.js +1 -1
- package/dist/components/form/form-end.js.map +1 -1
- package/dist/components/form/form-ref.d.ts +43 -0
- package/dist/components/form/form-ref.d.ts.map +1 -0
- package/dist/components/form/form-ref.js +53 -0
- package/dist/components/form/form-ref.js.map +1 -0
- package/dist/components/form/index.d.ts +16 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +90 -27
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/password-field.d.ts.map +1 -1
- package/dist/components/form/password-field.js +33 -17
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/separator.js +1 -1
- package/dist/components/form/separator.js.map +1 -1
- package/dist/components/form/tagpicker.d.ts +1 -1
- package/dist/components/form/tagpicker.d.ts.map +1 -1
- package/dist/components/form/text-area.d.ts.map +1 -1
- package/dist/components/form/text-area.js +33 -16
- package/dist/components/form/text-area.js.map +1 -1
- package/dist/components/form/text-field.d.ts.map +1 -1
- package/dist/components/form/text-field.js +38 -18
- package/dist/components/form/text-field.js.map +1 -1
- package/dist/components/form/use-form-navigation.d.ts +4 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -1
- package/dist/components/form/use-form-navigation.js +35 -18
- package/dist/components/form/use-form-navigation.js.map +1 -1
- package/dist/components/form/with-left-border.d.ts.map +1 -1
- package/dist/components/form/with-left-border.js +3 -3
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/icon.d.ts +3 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +494 -469
- package/dist/components/icon.js.map +1 -1
- package/dist/components/image.js +1 -1
- package/dist/components/image.js.map +1 -1
- package/dist/components/list.d.ts +12 -8
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +172 -40
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +2 -2
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/menubar-extra.d.ts +1 -1
- package/dist/components/menubar-extra.d.ts.map +1 -1
- package/dist/components/menubar-extra.js +2 -2
- package/dist/components/menubar-extra.js.map +1 -1
- package/dist/descendants.d.ts.map +1 -1
- package/dist/descendants.js +8 -5
- package/dist/descendants.js.map +1 -1
- package/dist/e2e-node.d.ts +2 -0
- package/dist/e2e-node.d.ts.map +1 -1
- package/dist/e2e-node.js +14 -0
- package/dist/e2e-node.js.map +1 -1
- package/dist/examples/action-show-in-finder.js +3 -3
- package/dist/examples/action-show-in-finder.js.map +1 -1
- package/dist/examples/environment-test.js +4 -4
- package/dist/examples/environment-test.js.map +1 -1
- package/dist/examples/error-boundary.js +5 -5
- package/dist/examples/error-boundary.js.map +1 -1
- package/dist/examples/form-basic.d.ts.map +1 -1
- package/dist/examples/form-basic.js +6 -6
- package/dist/examples/form-basic.js.map +1 -1
- package/dist/examples/form-dropdown.js +3 -3
- package/dist/examples/form-dropdown.js.map +1 -1
- package/dist/examples/form-scroll.d.ts +2 -0
- package/dist/examples/form-scroll.d.ts.map +1 -0
- package/dist/examples/form-scroll.js +8 -0
- package/dist/examples/form-scroll.js.map +1 -0
- package/dist/examples/form-tagpicker.js +3 -3
- package/dist/examples/form-tagpicker.js.map +1 -1
- package/dist/examples/internal/descendants-filtering.js +10 -5
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +13 -6
- package/dist/examples/internal/descendants.js.map +1 -1
- package/dist/examples/internal/rhf-custom-ref.d.ts +2 -0
- package/dist/examples/internal/rhf-custom-ref.d.ts.map +1 -0
- package/dist/examples/internal/rhf-custom-ref.js +67 -0
- package/dist/examples/internal/rhf-custom-ref.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +4 -8
- package/dist/examples/internal/scrollbox-demo.js.map +1 -1
- package/dist/examples/internal/scrollbox-with-descendants.d.ts +2 -0
- package/dist/examples/internal/scrollbox-with-descendants.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-with-descendants.js +63 -0
- package/dist/examples/internal/scrollbox-with-descendants.js.map +1 -0
- package/dist/examples/internal/simple-dialog.js +7 -7
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.d.ts +2 -0
- package/dist/examples/internal/simple-scrollbox.d.ts.map +1 -0
- package/dist/examples/internal/simple-scrollbox.js +25 -0
- package/dist/examples/internal/simple-scrollbox.js.map +1 -0
- package/dist/examples/internal/text-stacking.js +4 -2
- package/dist/examples/internal/text-stacking.js.map +1 -1
- package/dist/examples/list-dropdown-default.js +3 -3
- package/dist/examples/list-dropdown-default.js.map +1 -1
- package/dist/examples/list-fetch-data.js +3 -3
- package/dist/examples/list-fetch-data.js.map +1 -1
- package/dist/examples/list-scrollbox.d.ts +2 -0
- package/dist/examples/list-scrollbox.d.ts.map +1 -0
- package/dist/examples/list-scrollbox.js +29 -0
- package/dist/examples/list-scrollbox.js.map +1 -0
- package/dist/examples/list-with-detail.js +2 -2
- package/dist/examples/list-with-detail.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +2 -2
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/list-with-sections.js +6 -6
- package/dist/examples/list-with-sections.js.map +1 -1
- package/dist/examples/miscellaneous.js +14 -14
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/nested-navigation.js +9 -7
- package/dist/examples/nested-navigation.js.map +1 -1
- package/dist/examples/preferences-test.js +4 -4
- package/dist/examples/preferences-test.js.map +1 -1
- package/dist/examples/simple-dropdown.js +4 -4
- package/dist/examples/simple-dropdown.js.map +1 -1
- package/dist/examples/simple-file-picker.js +3 -3
- package/dist/examples/simple-file-picker.js.map +1 -1
- package/dist/examples/simple-grid.js +2 -2
- package/dist/examples/simple-grid.js.map +1 -1
- package/dist/examples/simple-hud.js +4 -4
- package/dist/examples/simple-hud.js.map +1 -1
- package/dist/examples/simple-list-search.js +21 -5
- package/dist/examples/simple-list-search.js.map +1 -1
- package/dist/examples/simple-list.js +4 -4
- package/dist/examples/simple-list.js.map +1 -1
- package/dist/examples/simple-navigation.js +9 -7
- package/dist/examples/simple-navigation.js.map +1 -1
- package/dist/examples/store.js +1 -1
- package/dist/examples/store.js.map +1 -1
- package/dist/examples/submodule-diff.d.ts +2 -0
- package/dist/examples/submodule-diff.d.ts.map +1 -0
- package/dist/examples/submodule-diff.js +99 -0
- package/dist/examples/submodule-diff.js.map +1 -0
- package/dist/examples/tanstack-demo.js +3 -3
- package/dist/examples/tanstack-demo.js.map +1 -1
- package/dist/examples/use-promise-demo.js +3 -3
- package/dist/examples/use-promise-demo.js.map +1 -1
- package/dist/extensions/dev.d.ts +8 -0
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +60 -35
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +22 -97
- package/dist/extensions/home.js.map +1 -1
- package/dist/extensions/store.js +2 -2
- package/dist/extensions/store.js.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-action-panel.js +1 -1
- package/dist/hooks/use-action-panel.js.map +1 -1
- package/dist/hooks/use-unstable-ai.js +1 -1
- package/dist/hooks/use-unstable-ai.js.map +1 -1
- package/dist/index.d.ts +57 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -38
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker-widget.d.ts.map +1 -1
- package/dist/internal/date-picker-widget.js +56 -48
- package/dist/internal/date-picker-widget.js.map +1 -1
- package/dist/internal/dialog.d.ts +3 -3
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +10 -10
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/error-handler.js +2 -2
- package/dist/internal/error-handler.js.map +1 -1
- package/dist/internal/focus-context.d.ts +1 -1
- package/dist/internal/focus-context.d.ts.map +1 -1
- package/dist/internal/navigation.d.ts +1 -1
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +2 -2
- package/dist/internal/navigation.js.map +1 -1
- package/dist/internal/providers.d.ts +2 -2
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +9 -9
- package/dist/internal/providers.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +12 -0
- package/dist/internal/scrollbox.d.ts.map +1 -0
- package/dist/internal/scrollbox.js +34 -0
- package/dist/internal/scrollbox.js.map +1 -0
- package/dist/preload.js +1 -1
- package/dist/preload.js.map +1 -1
- package/dist/release.d.ts +11 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +113 -0
- package/dist/release.js.map +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -0
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +11 -8
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +31 -8
- package/dist/theme.js.map +1 -1
- package/dist/utils/run-command.d.ts +22 -0
- package/dist/utils/run-command.d.ts.map +1 -0
- package/dist/utils/run-command.js +127 -0
- package/dist/utils/run-command.js.map +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -4
- package/dist/utils.js.map +1 -1
- package/package.json +13 -8
- package/src/apis/toast.tsx +38 -17
- package/src/build.tsx +5 -3
- package/src/cli.tsx +46 -0
- package/src/colors.tsx +22 -1
- package/src/compile.tsx +219 -0
- package/src/components/actions.tsx +7 -1
- package/src/components/command-arguments.tsx +81 -0
- package/src/components/detail.tsx +26 -58
- package/src/components/dropdown.tsx +108 -23
- package/src/components/extension-preferences.tsx +55 -35
- package/src/components/form/checkbox.tsx +13 -5
- package/src/components/form/date-picker.tsx +24 -29
- package/src/components/form/description.tsx +35 -7
- package/src/components/form/dropdown.tsx +16 -30
- package/src/components/form/file-autocomplete.tsx +87 -77
- package/src/components/form/file-picker.tsx +69 -57
- package/src/components/form/form-ref.tsx +68 -0
- package/src/components/form/index.tsx +152 -41
- package/src/components/form/password-field.tsx +35 -22
- package/src/components/form/text-area.tsx +78 -58
- package/src/components/form/text-field.tsx +82 -61
- package/src/components/form/use-form-navigation.tsx +43 -23
- package/src/components/form/with-left-border.tsx +2 -1
- package/src/components/icon.tsx +497 -469
- package/src/components/list.tsx +279 -112
- package/src/components/loading-bar.tsx +1 -1
- package/src/descendants.tsx +15 -5
- package/src/e2e-node.tsx +16 -0
- package/src/examples/action-show-in-finder.tsx +1 -1
- package/src/examples/environment-test.tsx +1 -1
- package/src/examples/error-boundary.tsx +1 -1
- package/src/examples/file-autocomplete.vitest.tsx +245 -0
- package/src/examples/form-basic.tsx +12 -12
- package/src/examples/form-basic.vitest.tsx +297 -671
- package/src/examples/form-dropdown.tsx +1 -1
- package/src/examples/form-dropdown.vitest.tsx +353 -221
- package/src/examples/form-scroll.tsx +56 -0
- package/src/examples/form-scroll.vitest.tsx +228 -0
- package/src/examples/form-tagpicker.tsx +1 -1
- package/src/examples/form-tagpicker.vitest.tsx +438 -193
- package/src/examples/internal/descendants-filtering.tsx +13 -5
- package/src/examples/internal/descendants.tsx +17 -5
- package/src/examples/internal/rhf-custom-ref.tsx +152 -0
- package/src/examples/internal/scrollbox-demo.tsx +15 -7
- package/src/examples/internal/scrollbox-with-descendants.tsx +94 -0
- package/src/examples/internal/simple-dialog.tsx +1 -1
- package/src/examples/internal/simple-scrollbox.tsx +58 -0
- package/src/examples/internal/simple-scrollbox.vitest.tsx +104 -0
- package/src/examples/internal/text-stacking.tsx +4 -2
- package/src/examples/list-dropdown-default.tsx +1 -1
- package/src/examples/list-dropdown-default.vitest.tsx +136 -71
- package/src/examples/list-fetch-data.tsx +1 -1
- package/src/examples/list-fetch-data.vitest.tsx +42 -33
- package/src/examples/list-scrollbox.tsx +46 -0
- package/src/examples/list-scrollbox.vitest.tsx +103 -0
- package/src/examples/list-with-detail.tsx +1 -1
- package/src/examples/list-with-detail.vitest.tsx +290 -294
- package/src/examples/list-with-dropdown.tsx +1 -1
- package/src/examples/list-with-dropdown.vitest.tsx +190 -150
- package/src/examples/list-with-sections.tsx +12 -1
- package/src/examples/list-with-sections.vitest.tsx +390 -218
- package/src/examples/miscellaneous.tsx +1 -1
- package/src/examples/nested-navigation.tsx +7 -5
- package/src/examples/preferences-test.tsx +1 -1
- package/src/examples/simple-dropdown.tsx +1 -1
- package/src/examples/simple-file-picker.tsx +1 -1
- package/src/examples/simple-file-picker.vitest.tsx +533 -127
- package/src/examples/simple-grid.tsx +1 -1
- package/src/examples/simple-grid.vitest.tsx +258 -234
- package/src/examples/simple-hud.tsx +1 -1
- package/src/examples/simple-list-search.tsx +42 -1
- package/src/examples/simple-list.tsx +1 -1
- package/src/examples/simple-navigation.tsx +7 -5
- package/src/examples/simple-navigation.vitest.tsx +434 -238
- package/src/examples/store.tsx +1 -1
- package/src/examples/store.vitest.tsx +31 -14
- package/src/examples/submodule-diff.tsx +153 -0
- package/src/examples/tanstack-demo.tsx +1 -1
- package/src/examples/use-promise-demo.tsx +1 -1
- package/src/extensions/dev.tsx +76 -38
- package/src/extensions/dev.vitest.tsx +220 -0
- package/src/extensions/home.tsx +20 -121
- package/src/globals.ts +1 -1
- package/src/index.tsx +12 -25
- package/src/internal/date-picker-widget.tsx +56 -46
- package/src/internal/dialog.tsx +6 -6
- package/src/internal/providers.tsx +1 -1
- package/src/internal/scrollbox.tsx +63 -0
- package/src/release.tsx +159 -0
- package/src/state.tsx +2 -0
- package/src/store-api/search.test.tsx +4 -13
- package/src/theme.tsx +33 -8
- package/src/utils/run-command.tsx +204 -0
- package/src/utils.tsx +6 -4
- package/dist/ai.d.ts +0 -104
- package/dist/ai.d.ts.map +0 -1
- package/dist/ai.js +0 -135
- package/dist/ai.js.map +0 -1
- package/dist/apis/cache.test.d.ts +0 -2
- package/dist/apis/cache.test.d.ts.map +0 -1
- package/dist/apis/cache.test.js +0 -246
- package/dist/apis/cache.test.js.map +0 -1
- package/dist/apis/localstorage.test.d.ts +0 -2
- package/dist/apis/localstorage.test.d.ts.map +0 -1
- package/dist/apis/localstorage.test.js +0 -131
- package/dist/apis/localstorage.test.js.map +0 -1
- package/dist/apis/toast.test.d.ts +0 -2
- package/dist/apis/toast.test.d.ts.map +0 -1
- package/dist/apis/toast.test.js +0 -67
- package/dist/apis/toast.test.js.map +0 -1
- package/dist/build.test.d.ts +0 -2
- package/dist/build.test.d.ts.map +0 -1
- package/dist/build.test.js +0 -73
- package/dist/build.test.js.map +0 -1
- package/dist/cache.d.ts +0 -32
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -205
- package/dist/cache.js.map +0 -1
- package/dist/cache.test.d.ts +0 -2
- package/dist/cache.test.d.ts.map +0 -1
- package/dist/cache.test.js +0 -246
- package/dist/cache.test.js.map +0 -1
- package/dist/clipboard.d.ts +0 -36
- package/dist/clipboard.d.ts.map +0 -1
- package/dist/clipboard.js +0 -154
- package/dist/clipboard.js.map +0 -1
- package/dist/components/form/form-type-only.d.ts +0 -174
- package/dist/components/form/form-type-only.d.ts.map +0 -1
- package/dist/components/form/form-type-only.js +0 -2
- package/dist/components/form/form-type-only.js.map +0 -1
- package/dist/components/form/use-form-handling.d.ts +0 -4
- package/dist/components/form/use-form-handling.d.ts.map +0 -1
- package/dist/components/form/use-form-handling.js +0 -37
- package/dist/components/form/use-form-handling.js.map +0 -1
- package/dist/dev-ui.d.ts +0 -7
- package/dist/dev-ui.d.ts.map +0 -1
- package/dist/dev-ui.js +0 -118
- package/dist/dev-ui.js.map +0 -1
- package/dist/environment.d.ts +0 -63
- package/dist/environment.d.ts.map +0 -1
- package/dist/environment.js +0 -189
- package/dist/environment.js.map +0 -1
- package/dist/examples/datepicker.d.ts +0 -2
- package/dist/examples/datepicker.d.ts.map +0 -1
- package/dist/examples/datepicker.js +0 -344
- package/dist/examples/datepicker.js.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +0 -2
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.js +0 -46
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +0 -1
- package/dist/examples/form-basic.vitest.d.ts +0 -2
- package/dist/examples/form-basic.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic.vitest.js +0 -995
- package/dist/examples/form-basic.vitest.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.js +0 -13
- package/dist/examples/form-dropdown-with-sections.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.js +0 -75
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +0 -1
- package/dist/examples/form-dropdown.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown.vitest.js +0 -722
- package/dist/examples/form-dropdown.vitest.js.map +0 -1
- package/dist/examples/form-multiselect-dropdown.d.ts +0 -2
- package/dist/examples/form-multiselect-dropdown.d.ts.map +0 -1
- package/dist/examples/form-multiselect-dropdown.js +0 -13
- package/dist/examples/form-multiselect-dropdown.js.map +0 -1
- package/dist/examples/form-tagpicker.vitest.d.ts +0 -2
- package/dist/examples/form-tagpicker.vitest.d.ts.map +0 -1
- package/dist/examples/form-tagpicker.vitest.js +0 -491
- package/dist/examples/form-tagpicker.vitest.js.map +0 -1
- package/dist/examples/internal/nested-boxes.d.ts +0 -2
- package/dist/examples/internal/nested-boxes.d.ts.map +0 -1
- package/dist/examples/internal/nested-boxes.js +0 -7
- package/dist/examples/internal/nested-boxes.js.map +0 -1
- package/dist/examples/internal/unicode-square-repro.d.ts +0 -2
- package/dist/examples/internal/unicode-square-repro.d.ts.map +0 -1
- package/dist/examples/internal/unicode-square-repro.js +0 -7
- package/dist/examples/internal/unicode-square-repro.js.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.d.ts +0 -2
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.js +0 -164
- package/dist/examples/list-dropdown-default.vitest.js.map +0 -1
- package/dist/examples/list-fetch-data.vitest.d.ts +0 -2
- package/dist/examples/list-fetch-data.vitest.d.ts.map +0 -1
- package/dist/examples/list-fetch-data.vitest.js +0 -103
- package/dist/examples/list-fetch-data.vitest.js.map +0 -1
- package/dist/examples/list-filter-navigation.d.ts +0 -2
- package/dist/examples/list-filter-navigation.d.ts.map +0 -1
- package/dist/examples/list-filter-navigation.js +0 -8
- package/dist/examples/list-filter-navigation.js.map +0 -1
- package/dist/examples/list-with-detail.vitest.d.ts +0 -2
- package/dist/examples/list-with-detail.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-detail.vitest.js +0 -438
- package/dist/examples/list-with-detail.vitest.js.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.d.ts +0 -2
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.js +0 -297
- package/dist/examples/list-with-dropdown.vitest.js.map +0 -1
- package/dist/examples/list-with-sections.vitest.d.ts +0 -2
- package/dist/examples/list-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-sections.vitest.js +0 -441
- package/dist/examples/list-with-sections.vitest.js.map +0 -1
- package/dist/examples/simple-file-picker.vitest.d.ts +0 -2
- package/dist/examples/simple-file-picker.vitest.d.ts.map +0 -1
- package/dist/examples/simple-file-picker.vitest.js +0 -277
- package/dist/examples/simple-file-picker.vitest.js.map +0 -1
- package/dist/examples/simple-grid.vitest.d.ts +0 -2
- package/dist/examples/simple-grid.vitest.d.ts.map +0 -1
- package/dist/examples/simple-grid.vitest.js +0 -498
- package/dist/examples/simple-grid.vitest.js.map +0 -1
- package/dist/examples/simple-navigation.vitest.d.ts +0 -2
- package/dist/examples/simple-navigation.vitest.d.ts.map +0 -1
- package/dist/examples/simple-navigation.vitest.js +0 -522
- package/dist/examples/simple-navigation.vitest.js.map +0 -1
- package/dist/examples/store.vitest.d.ts +0 -2
- package/dist/examples/store.vitest.d.ts.map +0 -1
- package/dist/examples/store.vitest.js +0 -52
- package/dist/examples/store.vitest.js.map +0 -1
- package/dist/home-command.d.ts +0 -8
- package/dist/home-command.d.ts.map +0 -1
- package/dist/home-command.js +0 -181
- package/dist/home-command.js.map +0 -1
- package/dist/hooks/hooks.test.d.ts +0 -2
- package/dist/hooks/hooks.test.d.ts.map +0 -1
- package/dist/hooks/hooks.test.js +0 -37
- package/dist/hooks/hooks.test.js.map +0 -1
- package/dist/hover-repro.d.ts +0 -2
- package/dist/hover-repro.d.ts.map +0 -1
- package/dist/hover-repro.js +0 -20
- package/dist/hover-repro.js.map +0 -1
- package/dist/localstorage.d.ts +0 -13
- package/dist/localstorage.d.ts.map +0 -1
- package/dist/localstorage.js +0 -190
- package/dist/localstorage.js.map +0 -1
- package/dist/localstorage.test.d.ts +0 -2
- package/dist/localstorage.test.d.ts.map +0 -1
- package/dist/localstorage.test.js +0 -131
- package/dist/localstorage.test.js.map +0 -1
- package/dist/oauth.d.ts +0 -142
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -551
- package/dist/oauth.js.map +0 -1
- package/dist/preferences.d.ts +0 -23
- package/dist/preferences.d.ts.map +0 -1
- package/dist/preferences.js +0 -105
- package/dist/preferences.js.map +0 -1
- package/dist/store-api/download.test.d.ts +0 -2
- package/dist/store-api/download.test.d.ts.map +0 -1
- package/dist/store-api/download.test.js +0 -36
- package/dist/store-api/download.test.js.map +0 -1
- package/dist/store-api/extension.test.d.ts +0 -2
- package/dist/store-api/extension.test.d.ts.map +0 -1
- package/dist/store-api/extension.test.js +0 -22
- package/dist/store-api/extension.test.js.map +0 -1
- package/dist/store-api/search.test.d.ts +0 -2
- package/dist/store-api/search.test.d.ts.map +0 -1
- package/dist/store-api/search.test.js +0 -45
- package/dist/store-api/search.test.js.map +0 -1
- package/dist/store.d.ts +0 -21
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -84
- package/dist/store.js.map +0 -1
- package/dist/toast.d.ts +0 -44
- package/dist/toast.d.ts.map +0 -1
- package/dist/toast.js +0 -221
- package/dist/toast.js.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/utils.test.js +0 -152
- package/dist/utils.test.js.map +0 -1
- package/dist/window.d.ts +0 -12
- package/dist/window.d.ts.map +0 -1
- package/dist/window.js +0 -48
- package/dist/window.js.map +0 -1
|
@@ -1,187 +1,252 @@
|
|
|
1
|
-
// node-pty does not work in bun, so we use vitest to run this test
|
|
2
1
|
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
3
|
-
import {
|
|
2
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
4
3
|
|
|
5
|
-
let
|
|
4
|
+
let session: Session
|
|
6
5
|
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
|
|
9
|
-
'bun',
|
|
10
|
-
['src/examples/list-dropdown-default.tsx'],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
)
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
session = await launchTerminal({
|
|
8
|
+
command: 'bun',
|
|
9
|
+
args: ['src/examples/list-dropdown-default.tsx'],
|
|
10
|
+
cols: 80,
|
|
11
|
+
rows: 30,
|
|
12
|
+
})
|
|
16
13
|
})
|
|
17
14
|
|
|
18
15
|
afterEach(() => {
|
|
19
|
-
|
|
16
|
+
session?.close()
|
|
20
17
|
})
|
|
21
18
|
|
|
22
19
|
test('dropdown defaults to first item when no value is provided', async () => {
|
|
23
|
-
await
|
|
20
|
+
await session.text({
|
|
24
21
|
waitFor: (text) => {
|
|
25
|
-
// wait for list to show up
|
|
26
22
|
return /Dropdown Default Value Example/i.test(text)
|
|
27
23
|
},
|
|
28
24
|
})
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
await driver.waitIdle()
|
|
26
|
+
await session.waitIdle()
|
|
32
27
|
|
|
33
|
-
const initialSnapshot = await
|
|
28
|
+
const initialSnapshot = await session.text()
|
|
34
29
|
|
|
35
30
|
expect(initialSnapshot).toMatchInlineSnapshot(`
|
|
36
31
|
"
|
|
37
32
|
|
|
33
|
+
|
|
38
34
|
Dropdown Default Value Example ───────────────────────────────────────────
|
|
39
35
|
|
|
40
36
|
|
|
41
37
|
Search... Apple ▾
|
|
42
38
|
|
|
43
|
-
|
|
44
39
|
›First Item This list has a dropdown
|
|
45
40
|
Second Item The dropdown should default to first item
|
|
46
|
-
|
|
47
41
|
Vegetables
|
|
48
42
|
Carrot With another dropdown
|
|
49
43
|
|
|
50
44
|
|
|
51
|
-
↵ select ↑↓ navigate ^k actions"
|
|
52
|
-
`)
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
↵ select ↑↓ navigate ^k actions"
|
|
60
|
+
`)
|
|
56
61
|
}, 10000)
|
|
57
62
|
|
|
58
63
|
test('dropdown opens and shows items', async () => {
|
|
59
|
-
await
|
|
64
|
+
await session.text({
|
|
60
65
|
waitFor: (text) => {
|
|
61
66
|
return /Dropdown Default Value Example/i.test(text)
|
|
62
67
|
},
|
|
63
68
|
})
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
await driver.keys.ctrlP()
|
|
70
|
+
await session.press(['ctrl', 'p'])
|
|
67
71
|
|
|
68
|
-
const dropdownOpenSnapshot = await
|
|
72
|
+
const dropdownOpenSnapshot = await session.text()
|
|
69
73
|
expect(dropdownOpenSnapshot).toMatchInlineSnapshot(`
|
|
70
74
|
"
|
|
71
75
|
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
78
|
+
┃ ┃
|
|
79
|
+
┃ Filter by category esc ┃
|
|
80
|
+
┃ ┃
|
|
81
|
+
┃ Select category... ┃
|
|
82
|
+
┃ ┃
|
|
83
|
+
┃ ›Apple ┃
|
|
84
|
+
┃ Banana ┃
|
|
85
|
+
┃ Orange ┃
|
|
86
|
+
┃ Grape ┃
|
|
87
|
+
┃ ┃
|
|
88
|
+
┃ ┃
|
|
89
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
90
|
+
┃ ┃
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
74
94
|
|
|
75
|
-
Select category...
|
|
76
|
-
›Apple
|
|
77
|
-
Banana
|
|
78
|
-
Orange
|
|
79
|
-
Grape
|
|
80
95
|
|
|
81
96
|
|
|
82
|
-
↵ select ↑↓ navigate
|
|
83
97
|
|
|
84
98
|
|
|
85
|
-
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
↵ select ↑↓ navigate ^k actions"
|
|
86
103
|
`)
|
|
87
104
|
|
|
88
|
-
|
|
89
|
-
await driver.keys.down()
|
|
105
|
+
await session.press('down')
|
|
90
106
|
|
|
91
|
-
const afterDownSnapshot = await
|
|
107
|
+
const afterDownSnapshot = await session.text()
|
|
92
108
|
expect(afterDownSnapshot).toMatchInlineSnapshot(`
|
|
93
109
|
"
|
|
94
110
|
|
|
95
111
|
|
|
96
|
-
|
|
112
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
113
|
+
┃ ┃
|
|
114
|
+
┃ Filter by category esc ┃
|
|
115
|
+
┃ ┃
|
|
116
|
+
┃ Select category... ┃
|
|
117
|
+
┃ ┃
|
|
118
|
+
┃ Apple ┃
|
|
119
|
+
┃ ›Banana ┃
|
|
120
|
+
┃ Orange ┃
|
|
121
|
+
┃ Grape ┃
|
|
122
|
+
┃ ┃
|
|
123
|
+
┃ ┃
|
|
124
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
125
|
+
┃ ┃
|
|
126
|
+
|
|
97
127
|
|
|
98
|
-
Select category...
|
|
99
|
-
Apple
|
|
100
|
-
›Banana
|
|
101
|
-
Orange
|
|
102
|
-
Grape
|
|
103
128
|
|
|
104
129
|
|
|
105
|
-
↵ select ↑↓ navigate
|
|
106
130
|
|
|
107
131
|
|
|
108
|
-
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
↵ select ↑↓ navigate ^k actions"
|
|
109
138
|
`)
|
|
110
139
|
|
|
111
|
-
|
|
112
|
-
await driver.keys.enter()
|
|
140
|
+
await session.press('enter')
|
|
113
141
|
|
|
114
|
-
const afterSelectSnapshot = await
|
|
142
|
+
const afterSelectSnapshot = await session.text()
|
|
115
143
|
expect(afterSelectSnapshot).toMatchInlineSnapshot(`
|
|
116
144
|
"
|
|
117
145
|
|
|
146
|
+
|
|
118
147
|
Dropdown Default Value Example ───────────────────────────────────────────
|
|
119
148
|
|
|
120
149
|
|
|
121
150
|
Search... Banana ▾
|
|
122
151
|
|
|
123
|
-
|
|
124
152
|
›First Item This list has a dropdown
|
|
125
153
|
Second Item The dropdown should default to first item
|
|
126
|
-
|
|
127
154
|
Vegetables
|
|
128
155
|
Carrot With another dropdown
|
|
129
156
|
|
|
130
157
|
|
|
131
|
-
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
↵ select ↑↓ navigate ^k actions"
|
|
132
173
|
`)
|
|
133
174
|
}, 10000)
|
|
134
175
|
|
|
135
176
|
test('clicking dropdown opens it', async () => {
|
|
136
|
-
await
|
|
177
|
+
await session.text({
|
|
137
178
|
waitFor: (text) => {
|
|
138
179
|
return /Dropdown Default Value Example/i.test(text)
|
|
139
180
|
},
|
|
140
181
|
})
|
|
141
182
|
|
|
142
|
-
|
|
143
|
-
await driver.clickText('Apple')
|
|
183
|
+
await session.click('Apple', { first: true })
|
|
144
184
|
|
|
145
|
-
const afterClickSnapshot = await
|
|
185
|
+
const afterClickSnapshot = await session.text()
|
|
146
186
|
expect(afterClickSnapshot).toMatchInlineSnapshot(`
|
|
147
187
|
"
|
|
148
188
|
|
|
149
189
|
|
|
150
|
-
|
|
190
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
191
|
+
┃ ┃
|
|
192
|
+
┃ Filter by category esc ┃
|
|
193
|
+
┃ ┃
|
|
194
|
+
┃ Select category... ┃
|
|
195
|
+
┃ ┃
|
|
196
|
+
┃ ›Apple ┃
|
|
197
|
+
┃ Banana ┃
|
|
198
|
+
┃ Orange ┃
|
|
199
|
+
┃ Grape ┃
|
|
200
|
+
┃ ┃
|
|
201
|
+
┃ ┃
|
|
202
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
203
|
+
┃ ┃
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
151
209
|
|
|
152
|
-
Select category...
|
|
153
|
-
›Apple
|
|
154
|
-
Banana
|
|
155
|
-
Orange
|
|
156
|
-
Grape
|
|
157
210
|
|
|
158
211
|
|
|
159
|
-
↵ select ↑↓ navigate
|
|
160
212
|
|
|
161
213
|
|
|
162
|
-
|
|
214
|
+
|
|
215
|
+
↵ select ↑↓ navigate ^k actions"
|
|
163
216
|
`)
|
|
164
217
|
|
|
165
|
-
|
|
166
|
-
await driver.clickText('Orange')
|
|
218
|
+
await session.click('Orange', { first: true })
|
|
167
219
|
|
|
168
|
-
const afterSelectOrangeSnapshot = await
|
|
220
|
+
const afterSelectOrangeSnapshot = await session.text()
|
|
169
221
|
expect(afterSelectOrangeSnapshot).toMatchInlineSnapshot(`
|
|
170
222
|
"
|
|
171
223
|
|
|
224
|
+
|
|
172
225
|
Dropdown Default Value Example ───────────────────────────────────────────
|
|
173
226
|
|
|
174
227
|
|
|
175
228
|
Search... Orange ▾
|
|
176
229
|
|
|
177
|
-
|
|
178
230
|
›First Item This list has a dropdown
|
|
179
231
|
Second Item The dropdown should default to first item
|
|
180
|
-
|
|
181
232
|
Vegetables
|
|
182
233
|
Carrot With another dropdown
|
|
183
234
|
|
|
184
235
|
|
|
185
|
-
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
↵ select ↑↓ navigate ^k actions"
|
|
186
251
|
`)
|
|
187
252
|
}, 10000)
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { test, expect, beforeEach, afterEach } from 'vitest'
|
|
2
|
-
import {
|
|
2
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
3
3
|
|
|
4
|
-
let
|
|
4
|
+
let session: Session
|
|
5
5
|
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
session = await launchTerminal({
|
|
8
|
+
command: 'bun',
|
|
9
|
+
args: ['src/examples/list-fetch-data.tsx'],
|
|
8
10
|
cols: 70,
|
|
9
|
-
rows:
|
|
11
|
+
rows: 25,
|
|
10
12
|
})
|
|
11
13
|
})
|
|
12
14
|
|
|
13
15
|
afterEach(() => {
|
|
14
|
-
|
|
16
|
+
session?.close()
|
|
15
17
|
})
|
|
16
18
|
|
|
17
19
|
test('list shows initial items after fetch', async () => {
|
|
18
|
-
|
|
19
|
-
await driver.text({
|
|
20
|
+
await session.text({
|
|
20
21
|
waitFor: (text) => {
|
|
21
22
|
return /SVG Library/i.test(text)
|
|
22
23
|
},
|
|
23
24
|
})
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
const afterFetchSnapshot = await driver.text({
|
|
26
|
+
const afterFetchSnapshot = await session.text({
|
|
27
27
|
waitFor: (text) => {
|
|
28
|
-
// Wait until we see at least one section title
|
|
29
28
|
return text.includes('Icons') || text.includes('Home Icon')
|
|
30
29
|
},
|
|
31
30
|
timeout: 2000,
|
|
@@ -33,11 +32,11 @@ test('list shows initial items after fetch', async () => {
|
|
|
33
32
|
expect(afterFetchSnapshot).toMatchInlineSnapshot(`
|
|
34
33
|
"
|
|
35
34
|
|
|
35
|
+
|
|
36
36
|
SVG Library ────────────────────────────────────────────────────
|
|
37
37
|
|
|
38
38
|
Search...
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
Icons
|
|
42
41
|
›Home Icon Category: Icons
|
|
43
42
|
User Icon Category: Icons
|
|
@@ -45,32 +44,30 @@ test('list shows initial items after fetch', async () => {
|
|
|
45
44
|
|
|
46
45
|
Illustrations
|
|
47
46
|
Welcome Banner Category: Illustrations
|
|
48
|
-
Hero
|
|
47
|
+
Hero
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
49
52
|
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
↵ select ↑↓ navigate ^k actions"
|
|
52
57
|
`)
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
expect(afterFetchSnapshot).toContain('User Icon')
|
|
59
|
-
expect(afterFetchSnapshot).toContain('Settings Icon')
|
|
60
|
-
expect(afterFetchSnapshot).toContain('Welcome Banner')
|
|
61
|
-
expect(afterFetchSnapshot).toContain('Hero Image')
|
|
62
|
-
|
|
63
|
-
// Test navigation
|
|
64
|
-
await driver.keys.down()
|
|
65
|
-
const afterDownSnapshot = await driver.text()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
await session.press('down')
|
|
62
|
+
const afterDownSnapshot = await session.text()
|
|
66
63
|
expect(afterDownSnapshot).toMatchInlineSnapshot(`
|
|
67
64
|
"
|
|
68
65
|
|
|
66
|
+
|
|
69
67
|
SVG Library ────────────────────────────────────────────────────
|
|
70
68
|
|
|
71
69
|
Search...
|
|
72
70
|
|
|
73
|
-
|
|
74
71
|
Icons
|
|
75
72
|
Home Icon Category: Icons
|
|
76
73
|
›User Icon Category: Icons
|
|
@@ -81,20 +78,26 @@ test('list shows initial items after fetch', async () => {
|
|
|
81
78
|
Hero Image Category: Illustrations
|
|
82
79
|
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
↵ select ↑↓ navigate ^k actions"
|
|
85
88
|
`)
|
|
86
89
|
|
|
87
|
-
await
|
|
88
|
-
await
|
|
89
|
-
const afterThreeDownsSnapshot = await
|
|
90
|
+
await session.press('down')
|
|
91
|
+
await session.press('down')
|
|
92
|
+
const afterThreeDownsSnapshot = await session.text()
|
|
90
93
|
expect(afterThreeDownsSnapshot).toMatchInlineSnapshot(`
|
|
91
94
|
"
|
|
92
95
|
|
|
96
|
+
|
|
93
97
|
SVG Library ────────────────────────────────────────────────────
|
|
94
98
|
|
|
95
99
|
Search...
|
|
96
100
|
|
|
97
|
-
|
|
98
101
|
Icons
|
|
99
102
|
Home Icon Category: Icons
|
|
100
103
|
User Icon Category: Icons
|
|
@@ -105,6 +108,12 @@ test('list shows initial items after fetch', async () => {
|
|
|
105
108
|
Hero Image Category: Illustrations
|
|
106
109
|
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
↵ select ↑↓ navigate ^k actions"
|
|
109
118
|
`)
|
|
110
119
|
}, 10000)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { renderWithProviders, Icon, Color } from 'termcast'
|
|
2
|
+
import List from 'termcast'
|
|
3
|
+
|
|
4
|
+
const iconConfigs = [
|
|
5
|
+
{ name: 'Circle', color: Color.Red },
|
|
6
|
+
{ name: 'Star', color: Color.Yellow },
|
|
7
|
+
{ name: 'Heart', color: Color.Magenta },
|
|
8
|
+
{ name: 'Bolt', color: Color.Orange },
|
|
9
|
+
{ name: 'Bookmark', color: Color.Blue },
|
|
10
|
+
{ name: 'Calendar', color: Color.Green },
|
|
11
|
+
{ name: 'Clock', color: Color.Purple },
|
|
12
|
+
{ name: 'Document', color: Color.SecondaryText },
|
|
13
|
+
{ name: 'Folder', color: Color.Blue },
|
|
14
|
+
{ name: 'Globe', color: Color.Green },
|
|
15
|
+
] as const
|
|
16
|
+
|
|
17
|
+
function ListScrollboxExample() {
|
|
18
|
+
const items = Array.from({ length: 20 }, (_, i) => {
|
|
19
|
+
const config = iconConfigs[i % iconConfigs.length]
|
|
20
|
+
return {
|
|
21
|
+
id: `item-${i + 1}`,
|
|
22
|
+
title: `Item ${i + 1}`,
|
|
23
|
+
subtitle: `Description for item ${i + 1}`,
|
|
24
|
+
icon: { source: Icon[config.name], tintColor: config.color },
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<List
|
|
30
|
+
navigationTitle='Scrollbox Test'
|
|
31
|
+
searchBarPlaceholder='Search items...'
|
|
32
|
+
>
|
|
33
|
+
{items.map((item) => (
|
|
34
|
+
<List.Item
|
|
35
|
+
key={item.id}
|
|
36
|
+
id={item.id}
|
|
37
|
+
title={item.title}
|
|
38
|
+
subtitle={item.subtitle}
|
|
39
|
+
icon={item.icon}
|
|
40
|
+
/>
|
|
41
|
+
))}
|
|
42
|
+
</List>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
await renderWithProviders(<ListScrollboxExample />)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
2
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
3
|
+
|
|
4
|
+
let session: Session
|
|
5
|
+
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
session = await launchTerminal({
|
|
8
|
+
command: 'bun',
|
|
9
|
+
args: ['src/examples/list-scrollbox.tsx'],
|
|
10
|
+
cols: 50,
|
|
11
|
+
rows: 12,
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
session?.close()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('list scrollbox auto-scrolls when navigating down', async () => {
|
|
20
|
+
await session.text({
|
|
21
|
+
waitFor: (text) => {
|
|
22
|
+
return /Item 1/i.test(text)
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const initialSnapshot = await session.text()
|
|
27
|
+
expect(initialSnapshot).toMatchInlineSnapshot(`
|
|
28
|
+
"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Scrollbox Test ─────────────────────────────
|
|
32
|
+
Search items...
|
|
33
|
+
|
|
34
|
+
›♠ Item 1 Description for item 1 ▲
|
|
35
|
+
■ Item 2 Description for item 2 ▼
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
↵ select ↑↓ navigate ^k actions"
|
|
39
|
+
`)
|
|
40
|
+
|
|
41
|
+
await session.press('down')
|
|
42
|
+
await session.press('down')
|
|
43
|
+
await session.press('down')
|
|
44
|
+
await session.press('down')
|
|
45
|
+
await session.press('down')
|
|
46
|
+
|
|
47
|
+
const afterFiveDownsSnapshot = await session.text()
|
|
48
|
+
expect(afterFiveDownsSnapshot).toMatchInlineSnapshot(`
|
|
49
|
+
"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Scrollbox Test ─────────────────────────────
|
|
53
|
+
Search items...
|
|
54
|
+
|
|
55
|
+
▼ Item 5 Description for item 5 ▲
|
|
56
|
+
›♦ Item 6 Description for item 6 ▼
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
↵ select ↑↓ navigate ^k actions"
|
|
60
|
+
`)
|
|
61
|
+
|
|
62
|
+
await session.press('down')
|
|
63
|
+
await session.press('down')
|
|
64
|
+
await session.press('down')
|
|
65
|
+
|
|
66
|
+
const afterEightDownsSnapshot = await session.text()
|
|
67
|
+
expect(afterEightDownsSnapshot).toMatchInlineSnapshot(`
|
|
68
|
+
"
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Scrollbox Test ─────────────────────────────
|
|
72
|
+
Search items...
|
|
73
|
+
|
|
74
|
+
★ Item 8 Description for item 8 ▲
|
|
75
|
+
›■ Item 9 Description for item 9 ▼
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
↵ select ↑↓ navigate ^k actions"
|
|
79
|
+
`)
|
|
80
|
+
|
|
81
|
+
await session.press('up')
|
|
82
|
+
await session.press('up')
|
|
83
|
+
await session.press('up')
|
|
84
|
+
await session.press('up')
|
|
85
|
+
await session.press('up')
|
|
86
|
+
await session.press('up')
|
|
87
|
+
await session.press('up')
|
|
88
|
+
|
|
89
|
+
const afterScrollBackUpSnapshot = await session.text()
|
|
90
|
+
expect(afterScrollBackUpSnapshot).toMatchInlineSnapshot(`
|
|
91
|
+
"
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
Scrollbox Test ─────────────────────────────
|
|
95
|
+
Search items...
|
|
96
|
+
|
|
97
|
+
›■ Item 2 Description for item 2 ▲
|
|
98
|
+
♠ Item 3 Description for item 3 ▼
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
↵ select ↑↓ navigate ^k actions"
|
|
102
|
+
`)
|
|
103
|
+
}, 15000)
|