termcast 1.3.10 → 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/apis/toast.d.ts +1 -5
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +23 -17
- 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 +4 -3
- package/dist/build.js.map +1 -1
- package/dist/cli.js +42 -0
- 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 +1 -0
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +5 -2
- package/dist/components/actions.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 +1 -1
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +17 -39
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +1 -0
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +77 -21
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +19 -29
- 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 +9 -2
- 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 +15 -28
- 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 +20 -2
- 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 +13 -28
- 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 +54 -46
- 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 +46 -49
- package/dist/components/form/file-picker.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 +86 -23
- 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 +32 -16
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/text-area.d.ts.map +1 -1
- package/dist/components/form/text-area.js +32 -15
- 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 +37 -17
- 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 +2 -2
- 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/list.d.ts +11 -7
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +170 -38
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +1 -1
- package/dist/components/loading-bar.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/examples/action-show-in-finder.js +1 -1
- package/dist/examples/action-show-in-finder.js.map +1 -1
- package/dist/examples/environment-test.js +1 -1
- package/dist/examples/environment-test.js.map +1 -1
- package/dist/examples/error-boundary.js +1 -1
- 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 +2 -2
- package/dist/examples/form-basic.js.map +1 -1
- package/dist/examples/form-dropdown.js +1 -1
- 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 +1 -1
- package/dist/examples/form-tagpicker.js.map +1 -1
- package/dist/examples/internal/descendants-filtering.js +8 -3
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +10 -3
- 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 +3 -7
- 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 +1 -1
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.js +2 -3
- package/dist/examples/internal/simple-scrollbox.js.map +1 -1
- 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 +1 -1
- package/dist/examples/list-dropdown-default.js.map +1 -1
- package/dist/examples/list-fetch-data.js +1 -1
- 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 +1 -1
- package/dist/examples/list-with-detail.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +1 -1
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/list-with-sections.js +3 -3
- package/dist/examples/list-with-sections.js.map +1 -1
- package/dist/examples/miscellaneous.js +1 -1
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/nested-navigation.js +4 -2
- package/dist/examples/nested-navigation.js.map +1 -1
- package/dist/examples/preferences-test.js +1 -1
- package/dist/examples/preferences-test.js.map +1 -1
- package/dist/examples/simple-dropdown.js +1 -1
- package/dist/examples/simple-dropdown.js.map +1 -1
- package/dist/examples/simple-file-picker.js +1 -1
- package/dist/examples/simple-file-picker.js.map +1 -1
- package/dist/examples/simple-grid.js +1 -1
- package/dist/examples/simple-grid.js.map +1 -1
- package/dist/examples/simple-hud.js +1 -1
- package/dist/examples/simple-hud.js.map +1 -1
- package/dist/examples/simple-list-search.js +1 -1
- package/dist/examples/simple-list-search.js.map +1 -1
- package/dist/examples/simple-list.js +1 -1
- package/dist/examples/simple-list.js.map +1 -1
- package/dist/examples/simple-navigation.js +4 -2
- 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 +1 -1
- package/dist/examples/tanstack-demo.js.map +1 -1
- package/dist/examples/use-promise-demo.js +1 -1
- 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 +53 -28
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +16 -91
- package/dist/extensions/home.js.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- 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.map +1 -1
- package/dist/internal/dialog.js +7 -7
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +2 -1
- package/dist/internal/scrollbox.d.ts.map +1 -1
- package/dist/internal/scrollbox.js +13 -7
- package/dist/internal/scrollbox.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 +5 -3
- package/dist/utils.js.map +1 -1
- package/package.json +10 -7
- 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/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 +8 -5
- package/src/examples/internal/simple-scrollbox.vitest.tsx +47 -37
- 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 +4 -2
- 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 +538 -132
- 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 +1 -1
- package/src/examples/simple-list.tsx +1 -1
- package/src/examples/simple-navigation.tsx +4 -2
- package/src/examples/simple-navigation.vitest.tsx +434 -238
- package/src/examples/store.tsx +1 -1
- package/src/examples/store.vitest.tsx +31 -10
- 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 +74 -36
- package/src/extensions/dev.vitest.tsx +220 -0
- package/src/extensions/home.tsx +17 -118
- package/src/globals.ts +1 -1
- package/src/index.tsx +7 -1
- package/src/internal/date-picker-widget.tsx +56 -46
- package/src/internal/dialog.tsx +6 -6
- package/src/internal/scrollbox.tsx +15 -5
- 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 +5 -3
- 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/simple-scrollbox.vitest.d.ts +0 -2
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts.map +0 -1
- package/dist/examples/internal/simple-scrollbox.vitest.js +0 -88
- package/dist/examples/internal/simple-scrollbox.vitest.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 -48
- 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
package/src/examples/store.tsx
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { test, expect, afterEach, beforeEach } 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/store.tsx'],
|
|
8
10
|
cols: 80,
|
|
9
11
|
rows: 30,
|
|
10
12
|
})
|
|
11
13
|
})
|
|
12
14
|
|
|
13
15
|
afterEach(() => {
|
|
14
|
-
|
|
16
|
+
session?.close()
|
|
15
17
|
})
|
|
16
18
|
|
|
17
19
|
test('Store extension - searching for spiceblow shows Database', async () => {
|
|
18
20
|
// Wait for store interface to load
|
|
19
|
-
const initialOutput = await
|
|
21
|
+
const initialOutput = await session.text({
|
|
20
22
|
waitFor: (text) => {
|
|
21
23
|
// Wait until we see the store title
|
|
22
24
|
return text.includes('Store - Install Extensions')
|
|
@@ -28,11 +30,11 @@ test('Store extension - searching for spiceblow shows Database', async () => {
|
|
|
28
30
|
expect(initialOutput).toContain('Store - Install Extensions')
|
|
29
31
|
|
|
30
32
|
// Type "spiceblow" in the search bar
|
|
31
|
-
await
|
|
33
|
+
await session.type('spiceblow')
|
|
32
34
|
|
|
33
35
|
// Get the output after search, waiting for Database to appear
|
|
34
36
|
// This will automatically wait for the API request to complete and results to show
|
|
35
|
-
const afterSearchOutput = await
|
|
37
|
+
const afterSearchOutput = await session.text({
|
|
36
38
|
waitFor: (text) => {
|
|
37
39
|
return text.includes('Search, update, insert')
|
|
38
40
|
},
|
|
@@ -43,13 +45,32 @@ test('Store extension - searching for spiceblow shows Database', async () => {
|
|
|
43
45
|
expect(afterSearchOutput).toMatchInlineSnapshot(`
|
|
44
46
|
"
|
|
45
47
|
|
|
48
|
+
|
|
46
49
|
Store - Install Extensions ───────────────────────────────────────────────
|
|
47
50
|
|
|
48
51
|
spiceblow
|
|
49
52
|
|
|
50
|
-
›Spiceblow - Sql Database Management Search, update, insert and delete
|
|
53
|
+
›Spiceblow - Sql Database Management Search, update, insert and delete row
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
51
72
|
|
|
52
73
|
|
|
53
|
-
↵ select
|
|
74
|
+
↵ select ↑↓ navigate ^k actions"
|
|
54
75
|
`)
|
|
55
76
|
}, 30000)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { $ } from 'bun'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { List, Action, ActionPanel, renderWithProviders, Color } from 'termcast'
|
|
5
|
+
|
|
6
|
+
interface FileDiff {
|
|
7
|
+
file: string
|
|
8
|
+
additions: number
|
|
9
|
+
deletions: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface SubmoduleDiff {
|
|
13
|
+
name: string
|
|
14
|
+
path: string
|
|
15
|
+
files: FileDiff[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function getSubmodules(): Promise<{ name: string; path: string }[]> {
|
|
19
|
+
const result = await $`git submodule status`.text()
|
|
20
|
+
return result
|
|
21
|
+
.trim()
|
|
22
|
+
.split('\n')
|
|
23
|
+
.filter((line) => {
|
|
24
|
+
return line.trim()
|
|
25
|
+
})
|
|
26
|
+
.map((line) => {
|
|
27
|
+
const parts = line.trim().split(/\s+/)
|
|
28
|
+
const submodulePath = parts[1]
|
|
29
|
+
return {
|
|
30
|
+
name: path.basename(submodulePath),
|
|
31
|
+
path: submodulePath,
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function getSubmoduleDiff({ submodulePath }: { submodulePath: string }): Promise<FileDiff[]> {
|
|
37
|
+
try {
|
|
38
|
+
const result = await $`git -C ${submodulePath} diff --numstat`.text()
|
|
39
|
+
if (!result.trim()) {
|
|
40
|
+
return []
|
|
41
|
+
}
|
|
42
|
+
return result
|
|
43
|
+
.trim()
|
|
44
|
+
.split('\n')
|
|
45
|
+
.filter((line) => {
|
|
46
|
+
return line.trim()
|
|
47
|
+
})
|
|
48
|
+
.map((line) => {
|
|
49
|
+
const [additions, deletions, file] = line.split('\t')
|
|
50
|
+
return {
|
|
51
|
+
file,
|
|
52
|
+
additions: additions === '-' ? 0 : parseInt(additions, 10),
|
|
53
|
+
deletions: deletions === '-' ? 0 : parseInt(deletions, 10),
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
} catch {
|
|
57
|
+
return []
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function loadSubmoduleDiffs(): Promise<SubmoduleDiff[]> {
|
|
62
|
+
const submodules = await getSubmodules()
|
|
63
|
+
const allRepos = [{ name: 'root', path: '.' }, ...submodules]
|
|
64
|
+
const diffs = await Promise.all(
|
|
65
|
+
allRepos.map(async (sub) => {
|
|
66
|
+
const files = await getSubmoduleDiff({ submodulePath: sub.path })
|
|
67
|
+
return {
|
|
68
|
+
name: sub.name,
|
|
69
|
+
path: sub.path,
|
|
70
|
+
files,
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
)
|
|
74
|
+
return diffs.filter((d) => {
|
|
75
|
+
return d.files.length > 0
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const POLL_INTERVAL_MS = 2000
|
|
80
|
+
|
|
81
|
+
function SubmoduleDiffList(): any {
|
|
82
|
+
const [diffs, setDiffs] = React.useState<SubmoduleDiff[]>([])
|
|
83
|
+
const [isLoading, setIsLoading] = React.useState(true)
|
|
84
|
+
const [lastUpdated, setLastUpdated] = React.useState<Date | null>(null)
|
|
85
|
+
|
|
86
|
+
React.useEffect(() => {
|
|
87
|
+
let mounted = true
|
|
88
|
+
|
|
89
|
+
const refresh = async () => {
|
|
90
|
+
const result = await loadSubmoduleDiffs()
|
|
91
|
+
if (mounted) {
|
|
92
|
+
setDiffs(result)
|
|
93
|
+
setIsLoading(false)
|
|
94
|
+
setLastUpdated(new Date())
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
refresh()
|
|
99
|
+
const interval = setInterval(refresh, POLL_INTERVAL_MS)
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
mounted = false
|
|
103
|
+
clearInterval(interval)
|
|
104
|
+
}
|
|
105
|
+
}, [])
|
|
106
|
+
|
|
107
|
+
const subtitle = lastUpdated ? `Watching · Last checked ${lastUpdated.toLocaleTimeString()}` : undefined
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<List navigationTitle='Submodule Diffs' isLoading={isLoading} searchBarPlaceholder='Search files...'>
|
|
111
|
+
{diffs.length === 0 && !isLoading ? (
|
|
112
|
+
<List.EmptyView title='No changes' description={`No uncommitted changes in submodules · ${subtitle}`} />
|
|
113
|
+
) : (
|
|
114
|
+
diffs.map((submodule) => {
|
|
115
|
+
return (
|
|
116
|
+
<List.Section
|
|
117
|
+
key={submodule.name}
|
|
118
|
+
title={submodule.name}
|
|
119
|
+
subtitle={`${submodule.files.length} file${submodule.files.length === 1 ? '' : 's'}`}
|
|
120
|
+
>
|
|
121
|
+
{submodule.files.map((file) => {
|
|
122
|
+
const fullPath = path.join(submodule.path, file.file)
|
|
123
|
+
return (
|
|
124
|
+
<List.Item
|
|
125
|
+
key={fullPath}
|
|
126
|
+
id={fullPath}
|
|
127
|
+
title={file.file}
|
|
128
|
+
accessories={[
|
|
129
|
+
{ text: { value: `+${file.additions}`, color: Color.Green } },
|
|
130
|
+
{ text: { value: `-${file.deletions}`, color: Color.Red } },
|
|
131
|
+
]}
|
|
132
|
+
actions={
|
|
133
|
+
<ActionPanel>
|
|
134
|
+
<Action
|
|
135
|
+
title='Open in Zed'
|
|
136
|
+
onAction={async () => {
|
|
137
|
+
await $`zed ${fullPath}`
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
</ActionPanel>
|
|
141
|
+
}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
})}
|
|
145
|
+
</List.Section>
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
)}
|
|
149
|
+
</List>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
await renderWithProviders(<SubmoduleDiffList />)
|
package/src/extensions/dev.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import {
|
|
4
|
+
import { createRoot } from '@opentui/react'
|
|
5
|
+
import { createCliRenderer } from '@opentui/core'
|
|
5
6
|
import { List, useStore } from 'termcast'
|
|
6
7
|
import { Action, ActionPanel } from 'termcast'
|
|
7
8
|
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
@@ -10,9 +11,11 @@ import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
|
10
11
|
import { Icon } from 'termcast'
|
|
11
12
|
import { getCommandsWithFiles, CommandWithFile } from '../package-json'
|
|
12
13
|
import { buildExtensionCommands } from '../build'
|
|
14
|
+
import { runCommand, clearCommandArguments } from '../utils/run-command'
|
|
13
15
|
|
|
14
16
|
interface BundledCommand extends CommandWithFile {
|
|
15
17
|
bundledPath: string
|
|
18
|
+
Component?: (props: any) => any
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
function ExtensionCommandsList({
|
|
@@ -23,47 +26,38 @@ function ExtensionCommandsList({
|
|
|
23
26
|
commands: BundledCommand[]
|
|
24
27
|
}): any {
|
|
25
28
|
const { push } = useNavigation()
|
|
26
|
-
const packageJson = getCommandsWithFiles({
|
|
29
|
+
const { packageJson } = getCommandsWithFiles({
|
|
27
30
|
packageJsonPath: path.join(extensionPath, 'package.json'),
|
|
28
|
-
})
|
|
31
|
+
})
|
|
32
|
+
const devRebuildCount = useStore((state) => state.devRebuildCount)
|
|
29
33
|
|
|
30
34
|
const handleCommandSelect = async (command: BundledCommand) => {
|
|
35
|
+
clearCommandArguments()
|
|
36
|
+
|
|
37
|
+
if (!command.bundledPath && !command.Component) {
|
|
38
|
+
await showToast({
|
|
39
|
+
style: Toast.Style.Failure,
|
|
40
|
+
title: 'Command not built',
|
|
41
|
+
message: `Command ${command.name} was not built successfully`,
|
|
42
|
+
})
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
try {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const devRebuildCount = state.devRebuildCount
|
|
43
|
-
|
|
44
|
-
// Set the current command in state
|
|
45
|
-
useStore.setState({ currentCommandName: command.name })
|
|
46
|
-
|
|
47
|
-
const module = await import(
|
|
48
|
-
`${command.bundledPath}?rebuild=${devRebuildCount}`
|
|
49
|
-
)
|
|
50
|
-
const Component = module.default
|
|
51
|
-
|
|
52
|
-
if (!Component) {
|
|
53
|
-
await showToast({
|
|
54
|
-
style: Toast.Style.Failure,
|
|
55
|
-
title: 'No default export',
|
|
56
|
-
message: `Command file ${command.name} has no default export`,
|
|
57
|
-
})
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
push(<Component />)
|
|
62
|
-
} catch (error) {
|
|
47
|
+
await runCommand({
|
|
48
|
+
command,
|
|
49
|
+
extensionName: packageJson.name,
|
|
50
|
+
packageJson,
|
|
51
|
+
bundledPath: command.bundledPath,
|
|
52
|
+
Component: command.Component,
|
|
53
|
+
push,
|
|
54
|
+
cacheBustParam: String(devRebuildCount),
|
|
55
|
+
})
|
|
56
|
+
} catch (error: any) {
|
|
63
57
|
await showToast({
|
|
64
58
|
style: Toast.Style.Failure,
|
|
65
59
|
title: 'Failed to load command',
|
|
66
|
-
message: error.message
|
|
60
|
+
message: error.message || String(error),
|
|
67
61
|
})
|
|
68
62
|
}
|
|
69
63
|
}
|
|
@@ -173,7 +167,51 @@ export async function startDevMode({
|
|
|
173
167
|
return <TermcastProvider key={String(devRebuildCount)}>{devElement}</TermcastProvider>
|
|
174
168
|
}
|
|
175
169
|
|
|
176
|
-
await
|
|
170
|
+
const renderer = await createCliRenderer()
|
|
171
|
+
createRoot(renderer).render(<App />)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export async function startCompiledExtension({
|
|
175
|
+
extensionPath,
|
|
176
|
+
compiledCommands,
|
|
177
|
+
}: {
|
|
178
|
+
extensionPath: string
|
|
179
|
+
compiledCommands: Array<{
|
|
180
|
+
name: string
|
|
181
|
+
bundledPath: string
|
|
182
|
+
Component: (props: any) => any
|
|
183
|
+
}>
|
|
184
|
+
}): Promise<void> {
|
|
185
|
+
const packageJsonPath = path.join(extensionPath, 'package.json')
|
|
186
|
+
const { packageJson, commands: commandsMetadata } = getCommandsWithFiles({
|
|
187
|
+
packageJsonPath,
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
const commands: BundledCommand[] = compiledCommands.map((compiled) => {
|
|
191
|
+
const metadata = commandsMetadata.find((cmd) => cmd.name === compiled.name)
|
|
192
|
+
return {
|
|
193
|
+
...metadata!,
|
|
194
|
+
bundledPath: '',
|
|
195
|
+
Component: compiled.Component,
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
useStore.setState({
|
|
200
|
+
...useStore.getInitialState(),
|
|
201
|
+
extensionPath,
|
|
202
|
+
extensionPackageJson: packageJson,
|
|
203
|
+
devElement: (
|
|
204
|
+
<ExtensionCommandsList extensionPath={extensionPath} commands={commands} />
|
|
205
|
+
),
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
function App(): any {
|
|
209
|
+
const devElement = useStore((state) => state.devElement)
|
|
210
|
+
return <TermcastProvider>{devElement}</TermcastProvider>
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const renderer = await createCliRenderer()
|
|
214
|
+
createRoot(renderer).render(<App />)
|
|
177
215
|
}
|
|
178
216
|
|
|
179
217
|
export async function triggerRebuild({
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
2
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
let session: Session
|
|
6
|
+
|
|
7
|
+
const fixtureDir = path.resolve(__dirname, '../../fixtures/simple-extension')
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
session = await launchTerminal({
|
|
11
|
+
command: 'bun',
|
|
12
|
+
args: ['src/cli.tsx', 'dev', fixtureDir],
|
|
13
|
+
cols: 60,
|
|
14
|
+
rows: 16,
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
session?.close()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('dev command shows extension commands list', async () => {
|
|
23
|
+
await session.text({
|
|
24
|
+
waitFor: (text) => /Simple Test Extension/i.test(text),
|
|
25
|
+
timeout: 10000,
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const snapshot = await session.text()
|
|
29
|
+
expect(snapshot).toMatchInlineSnapshot(`
|
|
30
|
+
"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Simple Test Extension ────────────────────────────────
|
|
34
|
+
|
|
35
|
+
Search commands...
|
|
36
|
+
|
|
37
|
+
Commands ▲
|
|
38
|
+
›List Items Displays a simple list with some ite view ▀
|
|
39
|
+
Search Items Search and filter through a list o view
|
|
40
|
+
Google Oauth view
|
|
41
|
+
usePromise Demo Shows how to use the usePromise view
|
|
42
|
+
▼
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
↵ select ↑↓ navigate ^k actions"
|
|
46
|
+
`)
|
|
47
|
+
}, 30000)
|
|
48
|
+
|
|
49
|
+
test('selecting command with arguments shows arguments form', async () => {
|
|
50
|
+
await session.text({
|
|
51
|
+
waitFor: (text) => /Simple Test Extension/i.test(text),
|
|
52
|
+
timeout: 10000,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
// Navigate to "With Arguments" command (6th item)
|
|
56
|
+
await session.press('down')
|
|
57
|
+
await session.press('down')
|
|
58
|
+
await session.press('down')
|
|
59
|
+
await session.press('down')
|
|
60
|
+
await session.press('down')
|
|
61
|
+
|
|
62
|
+
const selectedSnapshot = await session.text()
|
|
63
|
+
expect(selectedSnapshot).toMatchInlineSnapshot(`
|
|
64
|
+
"
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
Simple Test Extension ────────────────────────────────
|
|
68
|
+
|
|
69
|
+
Search commands...
|
|
70
|
+
|
|
71
|
+
Search Items Search and filter through a list o view ▲
|
|
72
|
+
Google Oauth view
|
|
73
|
+
usePromise Demo Shows how to use the usePromise view ▄
|
|
74
|
+
Show State Shows the current application state view
|
|
75
|
+
›With Arguments Demonstrates command arguments ( view
|
|
76
|
+
▼
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
↵ select ↑↓ navigate ^k actions"
|
|
80
|
+
`)
|
|
81
|
+
|
|
82
|
+
// Select the command to show arguments form (enter opens action panel, enter again runs)
|
|
83
|
+
await session.press('enter')
|
|
84
|
+
await session.press('enter')
|
|
85
|
+
|
|
86
|
+
await session.text({
|
|
87
|
+
waitFor: (text) => /Search query/i.test(text),
|
|
88
|
+
timeout: 10000,
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const argsFormSnapshot = await session.text()
|
|
92
|
+
expect(argsFormSnapshot).toMatchInlineSnapshot(`
|
|
93
|
+
"
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
▪ With Arguments █
|
|
97
|
+
│ Enter the arguments to run this command. ▀
|
|
98
|
+
│
|
|
99
|
+
◆ Search query
|
|
100
|
+
┃ Search query
|
|
101
|
+
┃
|
|
102
|
+
◇ Secret key
|
|
103
|
+
│ Secret key
|
|
104
|
+
◇ Category
|
|
105
|
+
│ Category
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
alt ↵ submit ↑↓ navigate ^k actions"
|
|
109
|
+
`)
|
|
110
|
+
}, 30000)
|
|
111
|
+
|
|
112
|
+
test('can fill arguments and run command', async () => {
|
|
113
|
+
await session.text({
|
|
114
|
+
waitFor: (text) => /Simple Test Extension/i.test(text),
|
|
115
|
+
timeout: 10000,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
// Navigate to "With Arguments" command
|
|
119
|
+
await session.press('down')
|
|
120
|
+
await session.press('down')
|
|
121
|
+
await session.press('down')
|
|
122
|
+
await session.press('down')
|
|
123
|
+
await session.press('down')
|
|
124
|
+
await session.press('enter')
|
|
125
|
+
await session.press('enter')
|
|
126
|
+
|
|
127
|
+
await session.text({
|
|
128
|
+
waitFor: (text) => /Search query/i.test(text),
|
|
129
|
+
timeout: 10000,
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// Type in the search query field
|
|
133
|
+
await session.type('my search term')
|
|
134
|
+
|
|
135
|
+
const afterTypingSnapshot = await session.text()
|
|
136
|
+
expect(afterTypingSnapshot).toMatchInlineSnapshot(`
|
|
137
|
+
"
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
▪ With Arguments █
|
|
141
|
+
│ Enter the arguments to run this command. ▀
|
|
142
|
+
│
|
|
143
|
+
◆ Search query
|
|
144
|
+
┃ my search term
|
|
145
|
+
┃
|
|
146
|
+
◇ Secret key
|
|
147
|
+
│ Secret key
|
|
148
|
+
◇ Category
|
|
149
|
+
│ Category
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
alt ↵ submit ↑↓ navigate ^k actions"
|
|
153
|
+
`)
|
|
154
|
+
|
|
155
|
+
// Submit the form with Alt+Enter (opens action panel), then Enter (selects submit)
|
|
156
|
+
await session.press(['alt', 'enter'])
|
|
157
|
+
await session.press('enter')
|
|
158
|
+
|
|
159
|
+
await session.text({
|
|
160
|
+
waitFor: (text) => /Received Arguments/i.test(text),
|
|
161
|
+
timeout: 10000,
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const commandResultSnapshot = await session.text()
|
|
165
|
+
expect(commandResultSnapshot).toMatchInlineSnapshot(`
|
|
166
|
+
"
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
Command Arguments Demo ───────────────────────────────
|
|
170
|
+
|
|
171
|
+
Search...
|
|
172
|
+
|
|
173
|
+
Received Arguments
|
|
174
|
+
›Search Query my search term
|
|
175
|
+
Secret Key (empty)
|
|
176
|
+
Category (empty)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
↵ sele┌────────────────────────────────────────┐
|
|
181
|
+
│ ✓ Copied to Clipboard - my search term │
|
|
182
|
+
└────────────────────────────────────────┘"
|
|
183
|
+
`)
|
|
184
|
+
}, 30000)
|
|
185
|
+
|
|
186
|
+
test('can run simple view command without arguments', async () => {
|
|
187
|
+
await session.text({
|
|
188
|
+
waitFor: (text) => /Simple Test Extension/i.test(text),
|
|
189
|
+
timeout: 10000,
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
// Select first command (List Items) - enter opens action panel, enter again runs
|
|
193
|
+
await session.press('enter')
|
|
194
|
+
await session.press('enter')
|
|
195
|
+
|
|
196
|
+
await session.text({
|
|
197
|
+
waitFor: (text) => /First Item/i.test(text),
|
|
198
|
+
timeout: 10000,
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
const listItemsSnapshot = await session.text()
|
|
202
|
+
expect(listItemsSnapshot).toMatchInlineSnapshot(`
|
|
203
|
+
"
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
List Items ───────────────────────────────────────────
|
|
207
|
+
|
|
208
|
+
Search...
|
|
209
|
+
|
|
210
|
+
Items ▲
|
|
211
|
+
›First Item This is the first item █
|
|
212
|
+
Second Item This is the second item
|
|
213
|
+
Third Item This is the third item
|
|
214
|
+
Fourth Item This is the fourth item
|
|
215
|
+
▼
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
↵ select ↑↓ navigate ^k actions"
|
|
219
|
+
`)
|
|
220
|
+
}, 30000)
|