termcast 1.3.10 → 1.3.18
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/extensions/home.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import { createRoot } from '@opentui/react'
|
|
4
|
+
import { createCliRenderer } from '@opentui/core'
|
|
4
5
|
import { List, logger, useStore } from 'termcast'
|
|
5
6
|
import { Action, ActionPanel } from 'termcast'
|
|
6
7
|
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
@@ -10,7 +11,7 @@ import { Icon } from 'termcast'
|
|
|
10
11
|
import { getStoredExtensions } from '../utils'
|
|
11
12
|
import Store from './store'
|
|
12
13
|
import { ExtensionPreferences } from '../components/extension-preferences'
|
|
13
|
-
import {
|
|
14
|
+
import { runCommand, clearCommandArguments } from '../utils/run-command'
|
|
14
15
|
import '../globals'
|
|
15
16
|
|
|
16
17
|
interface ExtensionCommand {
|
|
@@ -49,8 +50,17 @@ function ExtensionsList({
|
|
|
49
50
|
const [searchText, setSearchText] = React.useState(initialSearchQuery)
|
|
50
51
|
|
|
51
52
|
const handleCommandSelect = async (item: ExtensionCommand) => {
|
|
53
|
+
clearCommandArguments()
|
|
54
|
+
|
|
52
55
|
try {
|
|
53
|
-
await runCommand(
|
|
56
|
+
await runCommand({
|
|
57
|
+
command: item.command,
|
|
58
|
+
extensionName: item.extensionName,
|
|
59
|
+
packageJson: item.packageJson,
|
|
60
|
+
bundledPath: item.bundledPath,
|
|
61
|
+
Component: item.Component,
|
|
62
|
+
push,
|
|
63
|
+
})
|
|
54
64
|
} catch (error: any) {
|
|
55
65
|
await showToast({
|
|
56
66
|
style: Toast.Style.Failure,
|
|
@@ -60,116 +70,6 @@ function ExtensionsList({
|
|
|
60
70
|
}
|
|
61
71
|
}
|
|
62
72
|
|
|
63
|
-
const runCommand = async (item: ExtensionCommand) => {
|
|
64
|
-
// Check if command has required preferences that are missing
|
|
65
|
-
const checkRequiredPreferences = async (): Promise<{
|
|
66
|
-
hasRequiredPreferences: boolean
|
|
67
|
-
requiredPreferences?: 'command' | 'extension'
|
|
68
|
-
}> => {
|
|
69
|
-
// Get package.json to check required preferences
|
|
70
|
-
if (!item.bundledPath || item.Component || !item.packageJson) {
|
|
71
|
-
// Built-in commands or commands without packageJson don't have preferences
|
|
72
|
-
return { hasRequiredPreferences: true }
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const packageJson = item.packageJson
|
|
76
|
-
|
|
77
|
-
// Check command-specific preferences
|
|
78
|
-
const command = packageJson.commands?.find(
|
|
79
|
-
(cmd: any) => cmd.name === item.command.name,
|
|
80
|
-
)
|
|
81
|
-
const commandPrefs = command?.preferences || []
|
|
82
|
-
|
|
83
|
-
// Check extension-wide preferences
|
|
84
|
-
const extensionPrefs = packageJson.preferences || []
|
|
85
|
-
|
|
86
|
-
// Get saved preferences
|
|
87
|
-
const commandPrefsKey = `preferences.${item.extensionName}.${item.command.name}`
|
|
88
|
-
const extensionPrefsKey = `preferences.${item.extensionName}`
|
|
89
|
-
|
|
90
|
-
const savedCommandPrefs = await LocalStorage.getItem(commandPrefsKey)
|
|
91
|
-
const savedExtensionPrefs = await LocalStorage.getItem(extensionPrefsKey)
|
|
92
|
-
|
|
93
|
-
const parsedCommandPrefs = savedCommandPrefs
|
|
94
|
-
? JSON.parse(savedCommandPrefs as string)
|
|
95
|
-
: {}
|
|
96
|
-
const parsedExtensionPrefs = savedExtensionPrefs
|
|
97
|
-
? JSON.parse(savedExtensionPrefs as string)
|
|
98
|
-
: {}
|
|
99
|
-
|
|
100
|
-
// Check if all required command preferences are set
|
|
101
|
-
for (const pref of commandPrefs) {
|
|
102
|
-
if (pref.required && parsedCommandPrefs[pref.name] == null) {
|
|
103
|
-
return {
|
|
104
|
-
hasRequiredPreferences: false,
|
|
105
|
-
requiredPreferences: 'command',
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Check if all required extension preferences are set
|
|
111
|
-
for (const pref of extensionPrefs) {
|
|
112
|
-
if (pref.required && parsedExtensionPrefs[pref.name] == null) {
|
|
113
|
-
return {
|
|
114
|
-
hasRequiredPreferences: false,
|
|
115
|
-
requiredPreferences: 'extension',
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return { hasRequiredPreferences: true }
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const prefsCheck = await checkRequiredPreferences()
|
|
124
|
-
|
|
125
|
-
if (!prefsCheck.hasRequiredPreferences) {
|
|
126
|
-
// TODO: Use replace instead of push to avoid stacking navigation
|
|
127
|
-
// Redirect to preferences with onSubmit to run command after
|
|
128
|
-
push(
|
|
129
|
-
<ExtensionPreferences
|
|
130
|
-
extensionName={item.extensionName}
|
|
131
|
-
commandName={
|
|
132
|
-
prefsCheck.requiredPreferences === 'command'
|
|
133
|
-
? item.command.name
|
|
134
|
-
: undefined
|
|
135
|
-
}
|
|
136
|
-
onSubmit={() => {
|
|
137
|
-
// Recursively run command after preferences are set
|
|
138
|
-
runCommand(item)
|
|
139
|
-
}}
|
|
140
|
-
/>,
|
|
141
|
-
)
|
|
142
|
-
return
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
let Component: (() => any) | undefined
|
|
146
|
-
|
|
147
|
-
if (item.Component) {
|
|
148
|
-
Component = item.Component
|
|
149
|
-
} else if (item.bundledPath) {
|
|
150
|
-
const module = await import(item.bundledPath)
|
|
151
|
-
Component = module.default
|
|
152
|
-
|
|
153
|
-
if (!Component) {
|
|
154
|
-
await showToast({
|
|
155
|
-
style: Toast.Style.Failure,
|
|
156
|
-
title: 'No default export',
|
|
157
|
-
message: `Command file ${item.command.name} has no default export`,
|
|
158
|
-
})
|
|
159
|
-
return
|
|
160
|
-
}
|
|
161
|
-
} else {
|
|
162
|
-
await showToast({
|
|
163
|
-
style: Toast.Style.Failure,
|
|
164
|
-
title: 'Command not available',
|
|
165
|
-
message: `Command ${item.command.name} has no implementation`,
|
|
166
|
-
})
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
push(<Component />)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
73
|
// Group commands by extension
|
|
174
74
|
const groupedByExtension = allCommands.reduce(
|
|
175
75
|
(acc, cmd) => {
|
|
@@ -229,8 +129,7 @@ function ExtensionsList({
|
|
|
229
129
|
<ExtensionPreferences
|
|
230
130
|
extensionName={item.extensionName}
|
|
231
131
|
onSubmit={() => {
|
|
232
|
-
|
|
233
|
-
runCommand(item)
|
|
132
|
+
handleCommandSelect(item)
|
|
234
133
|
}}
|
|
235
134
|
/>,
|
|
236
135
|
)
|
|
@@ -244,8 +143,7 @@ function ExtensionsList({
|
|
|
244
143
|
extensionName={item.extensionName}
|
|
245
144
|
commandName={item.command.name}
|
|
246
145
|
onSubmit={() => {
|
|
247
|
-
|
|
248
|
-
runCommand(item)
|
|
146
|
+
handleCommandSelect(item)
|
|
249
147
|
}}
|
|
250
148
|
/>,
|
|
251
149
|
)
|
|
@@ -284,7 +182,8 @@ function ExtensionsList({
|
|
|
284
182
|
export async function runHomeCommand(): Promise<void> {
|
|
285
183
|
logger.log(`preparing to render the home command component`)
|
|
286
184
|
|
|
287
|
-
await
|
|
185
|
+
const renderer = await createCliRenderer()
|
|
186
|
+
createRoot(renderer).render(
|
|
288
187
|
<TermcastProvider>
|
|
289
188
|
<Home />
|
|
290
189
|
</TermcastProvider>,
|
package/src/globals.ts
CHANGED
|
@@ -9,7 +9,7 @@ import * as opentuiCore from '@opentui/core'
|
|
|
9
9
|
import * as opentuiReact from '@opentui/react'
|
|
10
10
|
import * as react from 'react'
|
|
11
11
|
import * as reactJsxRuntime from 'react/jsx-runtime'
|
|
12
|
-
import * as termcastApi from '
|
|
12
|
+
import * as termcastApi from './index'
|
|
13
13
|
|
|
14
14
|
declare global {
|
|
15
15
|
var opentuiCore: typeof opentuiCore
|
package/src/index.tsx
CHANGED
|
@@ -95,7 +95,7 @@ export type {
|
|
|
95
95
|
} from 'termcast/src/components/form/types'
|
|
96
96
|
|
|
97
97
|
// Icons and Images
|
|
98
|
-
export { Icon, getIconEmoji, IconComponent } from 'termcast/src/components/icon'
|
|
98
|
+
export { Icon, getIconEmoji, getIconShape, IconComponent } from 'termcast/src/components/icon'
|
|
99
99
|
export { Image, ImageMask } from 'termcast/src/components/image'
|
|
100
100
|
export type {
|
|
101
101
|
ImageProps,
|
|
@@ -107,6 +107,9 @@ export type {
|
|
|
107
107
|
// Alerts
|
|
108
108
|
export { Alert, confirmAlert } from 'termcast/src/components/alert'
|
|
109
109
|
|
|
110
|
+
// Command Arguments
|
|
111
|
+
export { CommandArguments } from 'termcast/src/components/command-arguments'
|
|
112
|
+
|
|
110
113
|
// MenuBar
|
|
111
114
|
export { MenuBarExtra } from 'termcast/src/components/menubar-extra'
|
|
112
115
|
export type {
|
|
@@ -219,3 +222,6 @@ export { closeMainWindow, PopToRootType } from 'termcast/src/apis/window'
|
|
|
219
222
|
|
|
220
223
|
// HUD
|
|
221
224
|
export { showHUD } from 'termcast/src/apis/hud'
|
|
225
|
+
|
|
226
|
+
// Compile support
|
|
227
|
+
export { startCompiledExtension } from 'termcast/src/extensions/dev'
|
|
@@ -291,40 +291,41 @@ export function DatePickerWidget({
|
|
|
291
291
|
setFocus('grid')
|
|
292
292
|
}
|
|
293
293
|
break
|
|
294
|
-
case 'tab':
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
294
|
+
// case 'tab':
|
|
295
|
+
// if (key.shift) {
|
|
296
|
+
// if (focus === 'year') {
|
|
297
|
+
// // At top of widget, trigger callback or cycle to bottom
|
|
298
|
+
// if (onFirstRowUpKey) {
|
|
299
|
+
// onFirstRowUpKey()
|
|
300
|
+
// } else {
|
|
301
|
+
// // Cycle to grid if no callback
|
|
302
|
+
// setFocus('grid')
|
|
303
|
+
// }
|
|
304
|
+
// } else {
|
|
305
|
+
// // Shift+Tab: Move focus up (grid -> month -> year)
|
|
306
|
+
// setFocus((f) =>
|
|
307
|
+
// f === 'grid' ? 'month' : f === 'month' ? 'year' : 'year',
|
|
308
|
+
// )
|
|
309
|
+
// }
|
|
310
|
+
// } else {
|
|
311
|
+
// if (focus === 'grid') {
|
|
312
|
+
// // At bottom of widget, trigger callback or cycle to top
|
|
313
|
+
// if (onLastRowDownKey) {
|
|
314
|
+
// onLastRowDownKey()
|
|
315
|
+
// } else {
|
|
316
|
+
// // Cycle to year if no callback
|
|
317
|
+
// setFocus('year')
|
|
318
|
+
// }
|
|
319
|
+
// } else {
|
|
320
|
+
// // Tab: Move focus down (year -> month -> grid)
|
|
321
|
+
// setFocus((f) =>
|
|
322
|
+
// f === 'year' ? 'month' : f === 'month' ? 'grid' : 'grid',
|
|
323
|
+
// )
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// break
|
|
327
327
|
case 'return': // Enter key
|
|
328
|
+
case 'space': // Space key
|
|
328
329
|
if (focus === 'grid' && onChange) {
|
|
329
330
|
onChange(selected)
|
|
330
331
|
}
|
|
@@ -357,7 +358,9 @@ export function DatePickerWidget({
|
|
|
357
358
|
style={{
|
|
358
359
|
flexDirection: 'column',
|
|
359
360
|
alignItems: 'flex-start',
|
|
360
|
-
|
|
361
|
+
paddingTop: 1,
|
|
362
|
+
paddingLeft: 1,
|
|
363
|
+
paddingRight: 1,
|
|
361
364
|
}}
|
|
362
365
|
>
|
|
363
366
|
{/* Year (line 1) */}
|
|
@@ -439,7 +442,7 @@ export function DatePickerWidget({
|
|
|
439
442
|
</box>
|
|
440
443
|
|
|
441
444
|
{/* Days grid: 7 columns x 6 rows, same fixed-box strategy */}
|
|
442
|
-
<box style={{ flexDirection: 'column'
|
|
445
|
+
<box style={{ flexDirection: 'column' }}>
|
|
443
446
|
{filteredWeeks.map((row, i) => {
|
|
444
447
|
// Skip empty rows
|
|
445
448
|
if (row.every((d) => d === null)) return null
|
|
@@ -455,7 +458,8 @@ export function DatePickerWidget({
|
|
|
455
458
|
)
|
|
456
459
|
}
|
|
457
460
|
|
|
458
|
-
const
|
|
461
|
+
const isCursor = sameDay(d, selected)
|
|
462
|
+
const isValue = initialValue ? sameDay(d, initialValue) : false
|
|
459
463
|
const isToday = sameDay(d, today)
|
|
460
464
|
return (
|
|
461
465
|
<box
|
|
@@ -463,11 +467,14 @@ export function DatePickerWidget({
|
|
|
463
467
|
style={{
|
|
464
468
|
...cellStyle,
|
|
465
469
|
backgroundColor:
|
|
466
|
-
|
|
470
|
+
focus !== 'grid' ? 'transparent' :
|
|
471
|
+
enableColors && isCursor
|
|
467
472
|
? Theme.primary
|
|
468
|
-
:
|
|
469
|
-
? Theme.
|
|
470
|
-
:
|
|
473
|
+
: isValue
|
|
474
|
+
? Theme.selectedMuted
|
|
475
|
+
: enableColors && isToday
|
|
476
|
+
? Theme.backgroundPanel
|
|
477
|
+
: undefined,
|
|
471
478
|
}}
|
|
472
479
|
onMouseDown={() => {
|
|
473
480
|
setSelected(d)
|
|
@@ -477,13 +484,16 @@ export function DatePickerWidget({
|
|
|
477
484
|
>
|
|
478
485
|
<text
|
|
479
486
|
fg={
|
|
480
|
-
|
|
487
|
+
|
|
488
|
+
enableColors && isCursor
|
|
481
489
|
? Theme.text
|
|
482
|
-
:
|
|
483
|
-
? Theme.
|
|
484
|
-
: enableColors &&
|
|
485
|
-
? Theme.
|
|
486
|
-
:
|
|
490
|
+
: isValue
|
|
491
|
+
? Theme.text
|
|
492
|
+
: enableColors && isToday
|
|
493
|
+
? Theme.accent
|
|
494
|
+
: enableColors && (j === 5 || j === 6)
|
|
495
|
+
? Theme.error
|
|
496
|
+
: Theme.text
|
|
487
497
|
}
|
|
488
498
|
>
|
|
489
499
|
{String(d.getDate()).padStart(2, ' ')}
|
package/src/internal/dialog.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useKeyboard, useTerminalDimensions } from '@opentui/react'
|
|
2
2
|
import React, { type ReactNode, useRef } from 'react'
|
|
3
3
|
import { Theme } from 'termcast/src/theme'
|
|
4
|
-
import { RGBA } from '@opentui/core'
|
|
5
4
|
import { InFocus, useIsInFocus } from 'termcast/src/internal/focus-context'
|
|
6
5
|
import { CommonProps } from 'termcast/src/utils'
|
|
7
6
|
import {
|
|
@@ -10,12 +9,13 @@ import {
|
|
|
10
9
|
type DialogStackItem,
|
|
11
10
|
} from 'termcast/src/state'
|
|
12
11
|
import { logger } from '../logger'
|
|
12
|
+
import { ToastOverlay } from 'termcast/src/apis/toast'
|
|
13
13
|
|
|
14
14
|
const Border = {
|
|
15
|
-
topLeft: '
|
|
16
|
-
topRight: '
|
|
17
|
-
bottomLeft: '
|
|
18
|
-
bottomRight: '
|
|
15
|
+
topLeft: '',
|
|
16
|
+
topRight: '',
|
|
17
|
+
bottomLeft: '',
|
|
18
|
+
bottomRight: '',
|
|
19
19
|
horizontal: '',
|
|
20
20
|
vertical: '┃',
|
|
21
21
|
topT: '+',
|
|
@@ -104,7 +104,6 @@ export function Dialog({
|
|
|
104
104
|
paddingRight={positionStyles.paddingRight}
|
|
105
105
|
left={0}
|
|
106
106
|
top={0}
|
|
107
|
-
backgroundColor={RGBA.fromInts(0, 0, 0, 150)}
|
|
108
107
|
onMouseDown={handleBackdropClick}
|
|
109
108
|
>
|
|
110
109
|
<box
|
|
@@ -171,6 +170,7 @@ export function DialogProvider(props: DialogProviderProps): any {
|
|
|
171
170
|
})}
|
|
172
171
|
</box>
|
|
173
172
|
)}
|
|
173
|
+
<ToastOverlay />
|
|
174
174
|
</>
|
|
175
175
|
)
|
|
176
176
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import Theme from '../theme'
|
|
2
3
|
|
|
3
4
|
interface ScrollBoxProps {
|
|
4
5
|
children?: React.ReactNode
|
|
@@ -6,6 +7,7 @@ interface ScrollBoxProps {
|
|
|
6
7
|
flexGrow?: number
|
|
7
8
|
flexShrink?: number
|
|
8
9
|
style?: any
|
|
10
|
+
ref?: React.Ref<any>
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export function ScrollBox({
|
|
@@ -14,21 +16,24 @@ export function ScrollBox({
|
|
|
14
16
|
flexGrow,
|
|
15
17
|
flexShrink,
|
|
16
18
|
style,
|
|
19
|
+
ref,
|
|
17
20
|
...props
|
|
18
21
|
}: ScrollBoxProps): any {
|
|
19
22
|
return (
|
|
20
23
|
<scrollbox
|
|
24
|
+
ref={ref}
|
|
21
25
|
focused={focused}
|
|
22
26
|
flexGrow={flexGrow}
|
|
23
27
|
flexShrink={flexShrink}
|
|
24
28
|
style={{
|
|
25
29
|
rootOptions: {
|
|
26
|
-
backgroundColor: '#1a1b26',
|
|
30
|
+
// backgroundColor: '#1a1b26',
|
|
27
31
|
...(style?.rootOptions || {}),
|
|
28
32
|
},
|
|
29
33
|
viewportOptions: {
|
|
30
34
|
flexGrow: 1,
|
|
31
35
|
flexShrink: 1,
|
|
36
|
+
paddingRight: 1,
|
|
32
37
|
...(style?.viewportOptions || {}),
|
|
33
38
|
},
|
|
34
39
|
contentOptions: {
|
|
@@ -36,14 +41,19 @@ export function ScrollBox({
|
|
|
36
41
|
...(style?.contentOptions || {}),
|
|
37
42
|
},
|
|
38
43
|
scrollbarOptions: {
|
|
39
|
-
visible: true,
|
|
40
|
-
showArrows: true,
|
|
44
|
+
// visible: true,
|
|
45
|
+
// showArrows: true,
|
|
41
46
|
trackOptions: {
|
|
42
|
-
foregroundColor:
|
|
43
|
-
|
|
47
|
+
foregroundColor: Theme.textMuted,
|
|
48
|
+
|
|
49
|
+
// backgroundColor: '#414868',
|
|
44
50
|
},
|
|
45
51
|
...(style?.scrollbarOptions || {}),
|
|
46
52
|
},
|
|
53
|
+
horizontalScrollbarOptions: {
|
|
54
|
+
visible: false,
|
|
55
|
+
...(style?.horizontalScrollbarOptions || {}),
|
|
56
|
+
},
|
|
47
57
|
}}
|
|
48
58
|
{...props}
|
|
49
59
|
>
|
package/src/release.tsx
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { execSync, exec } from 'node:child_process'
|
|
4
|
+
import { promisify } from 'node:util'
|
|
5
|
+
|
|
6
|
+
const execAsync = promisify(exec)
|
|
7
|
+
import {
|
|
8
|
+
compileExtension,
|
|
9
|
+
ALL_TARGETS,
|
|
10
|
+
targetToFileSuffix,
|
|
11
|
+
getArchiveExtension,
|
|
12
|
+
type CompileTarget,
|
|
13
|
+
} from './compile'
|
|
14
|
+
|
|
15
|
+
export interface ReleaseOptions {
|
|
16
|
+
extensionPath: string
|
|
17
|
+
single?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ReleaseResult {
|
|
21
|
+
success: boolean
|
|
22
|
+
version: string
|
|
23
|
+
uploadedFiles: string[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function releaseExtension({
|
|
27
|
+
extensionPath,
|
|
28
|
+
single = false,
|
|
29
|
+
}: ReleaseOptions): Promise<ReleaseResult> {
|
|
30
|
+
const resolvedPath = path.resolve(extensionPath)
|
|
31
|
+
|
|
32
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
33
|
+
throw new Error(`Extension path does not exist: ${resolvedPath}`)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const packageJsonPath = path.join(resolvedPath, 'package.json')
|
|
37
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
38
|
+
throw new Error(`No package.json found at: ${packageJsonPath}`)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))
|
|
42
|
+
const name = packageJson.name
|
|
43
|
+
const version = packageJson.version
|
|
44
|
+
|
|
45
|
+
if (!name) {
|
|
46
|
+
throw new Error('package.json must have a name field')
|
|
47
|
+
}
|
|
48
|
+
if (!version) {
|
|
49
|
+
throw new Error('package.json must have a version field')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const tag = `${name}@${version}`
|
|
53
|
+
console.log(`Preparing release ${tag}...`)
|
|
54
|
+
|
|
55
|
+
// Check if release already exists
|
|
56
|
+
try {
|
|
57
|
+
const checkResult = execSync(`gh release view "${tag}" --json tagName`, {
|
|
58
|
+
cwd: resolvedPath,
|
|
59
|
+
encoding: 'utf-8',
|
|
60
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
61
|
+
})
|
|
62
|
+
if (checkResult.includes(tag)) {
|
|
63
|
+
throw new Error(`Release ${tag} already exists. Bump the version in package.json first.`)
|
|
64
|
+
}
|
|
65
|
+
} catch (error: any) {
|
|
66
|
+
if (error.message?.includes('already exists')) {
|
|
67
|
+
throw error
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Install dependencies for all platforms
|
|
72
|
+
console.log('Installing dependencies for all platforms...')
|
|
73
|
+
execSync('bun install --os="*" --cpu="*"', {
|
|
74
|
+
cwd: resolvedPath,
|
|
75
|
+
stdio: 'inherit',
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const targets: CompileTarget[] = single
|
|
79
|
+
? ALL_TARGETS.filter((t) => t.os === process.platform && t.arch === process.arch)
|
|
80
|
+
: ALL_TARGETS
|
|
81
|
+
|
|
82
|
+
if (targets.length === 0) {
|
|
83
|
+
throw new Error(`No targets found for current platform: ${process.platform}-${process.arch}`)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const outputDir = path.join(resolvedPath, 'dist')
|
|
87
|
+
if (!fs.existsSync(outputDir)) {
|
|
88
|
+
fs.mkdirSync(outputDir, { recursive: true })
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Compile for all targets in parallel
|
|
92
|
+
console.log(`Compiling for ${targets.length} targets in parallel...`)
|
|
93
|
+
const compileResults = await Promise.all(
|
|
94
|
+
targets.map(async (target) => {
|
|
95
|
+
const suffix = targetToFileSuffix(target)
|
|
96
|
+
const binaryName = `${name}-${suffix}`
|
|
97
|
+
const outfile = path.join(outputDir, binaryName)
|
|
98
|
+
|
|
99
|
+
const result = await compileExtension({
|
|
100
|
+
extensionPath: resolvedPath,
|
|
101
|
+
outfile,
|
|
102
|
+
minify: true,
|
|
103
|
+
target,
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
console.log(` ✓ ${path.basename(result.outfile)}`)
|
|
107
|
+
|
|
108
|
+
const archiveExt = getArchiveExtension(target)
|
|
109
|
+
const archiveName = `${name}-${suffix}${archiveExt}`
|
|
110
|
+
const archivePath = path.join(outputDir, archiveName)
|
|
111
|
+
|
|
112
|
+
if (archiveExt === '.tar.gz') {
|
|
113
|
+
await execAsync(`tar -czvf "${archiveName}" "${binaryName}"`, { cwd: outputDir })
|
|
114
|
+
} else {
|
|
115
|
+
await execAsync(`zip "${archiveName}" "${binaryName}"`, { cwd: outputDir })
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
fs.unlinkSync(result.outfile)
|
|
119
|
+
console.log(` ✓ ${archiveName}`)
|
|
120
|
+
|
|
121
|
+
return archivePath
|
|
122
|
+
}),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
// Create GitHub release
|
|
126
|
+
console.log(`\nCreating GitHub release ${tag}...`)
|
|
127
|
+
try {
|
|
128
|
+
execSync(`gh release create "${tag}" --title "${tag}" --notes "Release ${version}"`, {
|
|
129
|
+
cwd: resolvedPath,
|
|
130
|
+
stdio: 'inherit',
|
|
131
|
+
})
|
|
132
|
+
} catch (error: any) {
|
|
133
|
+
throw new Error(`Failed to create release: ${error.message}`)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Upload all binaries in parallel
|
|
137
|
+
console.log('\nUploading binaries in parallel...')
|
|
138
|
+
await Promise.all(
|
|
139
|
+
compileResults.map(async (file) => {
|
|
140
|
+
const fileName = path.basename(file)
|
|
141
|
+
await execAsync(`gh release upload "${tag}" "${file}" --clobber`, {
|
|
142
|
+
cwd: resolvedPath,
|
|
143
|
+
})
|
|
144
|
+
console.log(` ✓ ${fileName}`)
|
|
145
|
+
}),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
console.log(`\n✅ Release ${tag} published successfully!`)
|
|
151
|
+
console.log(` ${compileResults.length} binaries uploaded`)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
success: true,
|
|
156
|
+
version,
|
|
157
|
+
uploadedFiles: compileResults,
|
|
158
|
+
}
|
|
159
|
+
}
|
package/src/state.tsx
CHANGED
|
@@ -26,6 +26,7 @@ interface AppState {
|
|
|
26
26
|
extensionPath: string | null
|
|
27
27
|
extensionPackageJson: RaycastPackageJson | null
|
|
28
28
|
currentCommandName: string | null
|
|
29
|
+
currentCommandArguments: Record<string, string> | null
|
|
29
30
|
// OAuth state
|
|
30
31
|
googleAccessToken?: string
|
|
31
32
|
googleIdToken?: string
|
|
@@ -43,6 +44,7 @@ export const useStore = create<AppState>(() => ({
|
|
|
43
44
|
extensionPath: null,
|
|
44
45
|
extensionPackageJson: null,
|
|
45
46
|
currentCommandName: null,
|
|
47
|
+
currentCommandArguments: null,
|
|
46
48
|
// OAuth state
|
|
47
49
|
googleAccessToken: undefined,
|
|
48
50
|
googleIdToken: undefined,
|
|
@@ -4,26 +4,17 @@ import { searchStoreListings } from './search'
|
|
|
4
4
|
describe('searchStoreListings', () => {
|
|
5
5
|
test('searches for extensions in the store', async () => {
|
|
6
6
|
const results = await searchStoreListings({
|
|
7
|
-
query: 'database',
|
|
7
|
+
query: 'spiceblow-database',
|
|
8
8
|
perPage: 5,
|
|
9
9
|
})
|
|
10
10
|
|
|
11
11
|
// Check we got results
|
|
12
12
|
expect(results.data).toBeDefined()
|
|
13
13
|
expect(results.data.length).toBeGreaterThan(0)
|
|
14
|
-
expect(results.data.length).toBeLessThanOrEqual(5)
|
|
15
14
|
|
|
16
|
-
//
|
|
17
|
-
const extensionNames = results.data.map((d) => d.name)
|
|
18
|
-
expect(extensionNames).
|
|
19
|
-
[
|
|
20
|
-
"discogs",
|
|
21
|
-
"notion",
|
|
22
|
-
"spiceblow-database",
|
|
23
|
-
"tmdb",
|
|
24
|
-
"turso",
|
|
25
|
-
]
|
|
26
|
-
`)
|
|
15
|
+
// Verify the specific extension is found
|
|
16
|
+
const extensionNames = results.data.map((d) => d.name)
|
|
17
|
+
expect(extensionNames).toContain('spiceblow-database')
|
|
27
18
|
}, 10000)
|
|
28
19
|
|
|
29
20
|
test.skip('returns results when searching without a query', async () => {
|