termcast 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-utils.d.ts +25 -0
- package/dist/action-utils.d.ts.map +1 -0
- package/dist/action-utils.js +209 -0
- package/dist/action-utils.js.map +1 -0
- package/dist/ai.d.ts +104 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +135 -0
- package/dist/ai.js.map +1 -0
- package/dist/apis/ai.d.ts +104 -0
- package/dist/apis/ai.d.ts.map +1 -0
- package/dist/apis/ai.js +135 -0
- package/dist/apis/ai.js.map +1 -0
- package/dist/apis/cache.d.ts +84 -0
- package/dist/apis/cache.d.ts.map +1 -0
- package/dist/apis/cache.js +307 -0
- package/dist/apis/cache.js.map +1 -0
- package/dist/apis/cache.test.d.ts +2 -0
- package/dist/apis/cache.test.d.ts.map +1 -0
- package/dist/apis/cache.test.js +246 -0
- package/dist/apis/cache.test.js.map +1 -0
- package/dist/apis/clipboard.d.ts +36 -0
- package/dist/apis/clipboard.d.ts.map +1 -0
- package/dist/apis/clipboard.js +154 -0
- package/dist/apis/clipboard.js.map +1 -0
- package/dist/apis/environment.d.ts +63 -0
- package/dist/apis/environment.d.ts.map +1 -0
- package/dist/apis/environment.js +189 -0
- package/dist/apis/environment.js.map +1 -0
- package/dist/apis/hud.d.ts +7 -0
- package/dist/apis/hud.d.ts.map +1 -0
- package/dist/apis/hud.js +45 -0
- package/dist/apis/hud.js.map +1 -0
- package/dist/apis/localstorage.d.ts +13 -0
- package/dist/apis/localstorage.d.ts.map +1 -0
- package/dist/apis/localstorage.js +190 -0
- package/dist/apis/localstorage.js.map +1 -0
- package/dist/apis/localstorage.test.d.ts +2 -0
- package/dist/apis/localstorage.test.d.ts.map +1 -0
- package/dist/apis/localstorage.test.js +131 -0
- package/dist/apis/localstorage.test.js.map +1 -0
- package/dist/apis/oauth.d.ts +142 -0
- package/dist/apis/oauth.d.ts.map +1 -0
- package/dist/apis/oauth.js +551 -0
- package/dist/apis/oauth.js.map +1 -0
- package/dist/apis/preferences.d.ts +23 -0
- package/dist/apis/preferences.d.ts.map +1 -0
- package/dist/apis/preferences.js +105 -0
- package/dist/apis/preferences.js.map +1 -0
- package/dist/apis/toast.d.ts +81 -0
- package/dist/apis/toast.d.ts.map +1 -0
- package/dist/apis/toast.js +275 -0
- package/dist/apis/toast.js.map +1 -0
- package/dist/apis/toast.test.d.ts +2 -0
- package/dist/apis/toast.test.d.ts.map +1 -0
- package/dist/apis/toast.test.js +67 -0
- package/dist/apis/toast.test.js.map +1 -0
- package/dist/apis/window.d.ts +12 -0
- package/dist/apis/window.d.ts.map +1 -0
- package/dist/apis/window.js +47 -0
- package/dist/apis/window.js.map +1 -0
- package/dist/build.d.ts +15 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +213 -0
- package/dist/build.js.map +1 -0
- package/dist/build.test.d.ts +2 -0
- package/dist/build.test.d.ts.map +1 -0
- package/dist/build.test.js +73 -0
- package/dist/build.test.js.map +1 -0
- package/dist/cache.d.ts +32 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +205 -0
- package/dist/cache.js.map +1 -0
- package/dist/cache.test.d.ts +2 -0
- package/dist/cache.test.d.ts.map +1 -0
- package/dist/cache.test.js +246 -0
- package/dist/cache.test.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +278 -0
- package/dist/cli.js.map +1 -0
- package/dist/clipboard.d.ts +36 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +154 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/colors.d.ts +15 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +13 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/actions.d.ts +120 -0
- package/dist/components/actions.d.ts.map +1 -0
- package/dist/components/actions.js +371 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/alert.d.ts +25 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +99 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/detail.d.ts +65 -0
- package/dist/components/detail.d.ts.map +1 -0
- package/dist/components/detail.js +147 -0
- package/dist/components/detail.js.map +1 -0
- package/dist/components/dropdown.d.ts +40 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/dropdown.js +202 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/extension-preferences.d.ts +8 -0
- package/dist/components/extension-preferences.d.ts.map +1 -0
- package/dist/components/extension-preferences.js +139 -0
- package/dist/components/extension-preferences.js.map +1 -0
- package/dist/components/form/assign-components.d.ts +2 -0
- package/dist/components/form/assign-components.d.ts.map +1 -0
- package/dist/components/form/assign-components.js +22 -0
- package/dist/components/form/assign-components.js.map +1 -0
- package/dist/components/form/checkbox.d.ts +7 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.js +46 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +18 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.js +69 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/description.d.ts +7 -0
- package/dist/components/form/description.d.ts.map +1 -0
- package/dist/components/form/description.js +8 -0
- package/dist/components/form/description.js.map +1 -0
- package/dist/components/form/dropdown.d.ts +25 -0
- package/dist/components/form/dropdown.d.ts.map +1 -0
- package/dist/components/form/dropdown.js +286 -0
- package/dist/components/form/dropdown.js.map +1 -0
- package/dist/components/form/file-autocomplete.d.ts +12 -0
- package/dist/components/form/file-autocomplete.d.ts.map +1 -0
- package/dist/components/form/file-autocomplete.js +84 -0
- package/dist/components/form/file-autocomplete.js.map +1 -0
- package/dist/components/form/file-picker.d.ts +31 -0
- package/dist/components/form/file-picker.d.ts.map +1 -0
- package/dist/components/form/file-picker.js +113 -0
- package/dist/components/form/file-picker.js.map +1 -0
- package/dist/components/form/form-end.d.ts +2 -0
- package/dist/components/form/form-end.d.ts.map +1 -0
- package/dist/components/form/form-end.js +6 -0
- package/dist/components/form/form-end.js.map +1 -0
- package/dist/components/form/form-type-only.d.ts +174 -0
- package/dist/components/form/form-type-only.d.ts.map +1 -0
- package/dist/components/form/form-type-only.js +2 -0
- package/dist/components/form/form-type-only.js.map +1 -0
- package/dist/components/form/index.d.ts +46 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +106 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/password-field.d.ts +7 -0
- package/dist/components/form/password-field.d.ts.map +1 -0
- package/dist/components/form/password-field.js +34 -0
- package/dist/components/form/password-field.js.map +1 -0
- package/dist/components/form/separator.d.ts +2 -0
- package/dist/components/form/separator.d.ts.map +1 -0
- package/dist/components/form/separator.js +8 -0
- package/dist/components/form/separator.js.map +1 -0
- package/dist/components/form/tagpicker.d.ts +134 -0
- package/dist/components/form/tagpicker.d.ts.map +1 -0
- package/dist/components/form/tagpicker.js +79 -0
- package/dist/components/form/tagpicker.js.map +1 -0
- package/dist/components/form/text-area.d.ts +8 -0
- package/dist/components/form/text-area.d.ts.map +1 -0
- package/dist/components/form/text-area.js +26 -0
- package/dist/components/form/text-area.js.map +1 -0
- package/dist/components/form/text-field.d.ts +7 -0
- package/dist/components/form/text-field.d.ts.map +1 -0
- package/dist/components/form/text-field.js +28 -0
- package/dist/components/form/text-field.js.map +1 -0
- package/dist/components/form/types.d.ts +43 -0
- package/dist/components/form/types.d.ts.map +1 -0
- package/dist/components/form/types.js +2 -0
- package/dist/components/form/types.js.map +1 -0
- package/dist/components/form/use-form-handling.d.ts +4 -0
- package/dist/components/form/use-form-handling.d.ts.map +1 -0
- package/dist/components/form/use-form-handling.js +37 -0
- package/dist/components/form/use-form-handling.js.map +1 -0
- package/dist/components/form/use-form-navigation.d.ts +8 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -0
- package/dist/components/form/use-form-navigation.js +58 -0
- package/dist/components/form/use-form-navigation.js.map +1 -0
- package/dist/components/form/with-left-border.d.ts +17 -0
- package/dist/components/form/with-left-border.d.ts.map +1 -0
- package/dist/components/form/with-left-border.js +10 -0
- package/dist/components/form/with-left-border.js.map +1 -0
- package/dist/components/icon.d.ts +9 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +485 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/image.d.ts +19 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/image.js +32 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/list.d.ts +234 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +667 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.d.ts.map +1 -0
- package/dist/components/loading-bar.js +107 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/menubar-extra.d.ts +68 -0
- package/dist/components/menubar-extra.d.ts.map +1 -0
- package/dist/components/menubar-extra.js +39 -0
- package/dist/components/menubar-extra.js.map +1 -0
- package/dist/descendants.d.ts +25 -0
- package/dist/descendants.d.ts.map +1 -0
- package/dist/descendants.js +81 -0
- package/dist/descendants.js.map +1 -0
- package/dist/dev-ui.d.ts +7 -0
- package/dist/dev-ui.d.ts.map +1 -0
- package/dist/dev-ui.js +118 -0
- package/dist/dev-ui.js.map +1 -0
- package/dist/e2e-node.d.ts +63 -0
- package/dist/e2e-node.d.ts.map +1 -0
- package/dist/e2e-node.js +255 -0
- package/dist/e2e-node.js.map +1 -0
- package/dist/e2e.d.ts +39 -0
- package/dist/e2e.d.ts.map +1 -0
- package/dist/e2e.js +127 -0
- package/dist/e2e.js.map +1 -0
- package/dist/environment.d.ts +63 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +189 -0
- package/dist/environment.js.map +1 -0
- package/dist/examples/action-show-in-finder.d.ts +2 -0
- package/dist/examples/action-show-in-finder.d.ts.map +1 -0
- package/dist/examples/action-show-in-finder.js +13 -0
- package/dist/examples/action-show-in-finder.js.map +1 -0
- package/dist/examples/datepicker.d.ts +2 -0
- package/dist/examples/datepicker.d.ts.map +1 -0
- package/dist/examples/datepicker.js +344 -0
- package/dist/examples/datepicker.js.map +1 -0
- package/dist/examples/environment-test.d.ts +2 -0
- package/dist/examples/environment-test.d.ts.map +1 -0
- package/dist/examples/environment-test.js +28 -0
- package/dist/examples/environment-test.js.map +1 -0
- package/dist/examples/error-boundary.d.ts +6 -0
- package/dist/examples/error-boundary.d.ts.map +1 -0
- package/dist/examples/error-boundary.js +67 -0
- package/dist/examples/error-boundary.js.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +2 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js +46 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +1 -0
- package/dist/examples/form-basic.d.ts +2 -0
- package/dist/examples/form-basic.d.ts.map +1 -0
- package/dist/examples/form-basic.js +21 -0
- package/dist/examples/form-basic.js.map +1 -0
- package/dist/examples/form-basic.vitest.d.ts +2 -0
- package/dist/examples/form-basic.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic.vitest.js +995 -0
- package/dist/examples/form-basic.vitest.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.js +13 -0
- package/dist/examples/form-dropdown-with-sections.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js +75 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +1 -0
- package/dist/examples/form-dropdown.d.ts +2 -0
- package/dist/examples/form-dropdown.d.ts.map +1 -0
- package/dist/examples/form-dropdown.js +13 -0
- package/dist/examples/form-dropdown.js.map +1 -0
- package/dist/examples/form-dropdown.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown.vitest.js +722 -0
- package/dist/examples/form-dropdown.vitest.js.map +1 -0
- package/dist/examples/form-multiselect-dropdown.d.ts +2 -0
- package/dist/examples/form-multiselect-dropdown.d.ts.map +1 -0
- package/dist/examples/form-multiselect-dropdown.js +13 -0
- package/dist/examples/form-multiselect-dropdown.js.map +1 -0
- package/dist/examples/form-tagpicker.d.ts +2 -0
- package/dist/examples/form-tagpicker.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.js +13 -0
- package/dist/examples/form-tagpicker.js.map +1 -0
- package/dist/examples/form-tagpicker.vitest.d.ts +2 -0
- package/dist/examples/form-tagpicker.vitest.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.vitest.js +491 -0
- package/dist/examples/form-tagpicker.vitest.js.map +1 -0
- package/dist/examples/internal/descendants-filtering.d.ts +2 -0
- package/dist/examples/internal/descendants-filtering.d.ts.map +1 -0
- package/dist/examples/internal/descendants-filtering.js +144 -0
- package/dist/examples/internal/descendants-filtering.js.map +1 -0
- package/dist/examples/internal/descendants.d.ts +2 -0
- package/dist/examples/internal/descendants.d.ts.map +1 -0
- package/dist/examples/internal/descendants.js +134 -0
- package/dist/examples/internal/descendants.js.map +1 -0
- package/dist/examples/internal/nested-boxes.d.ts +2 -0
- package/dist/examples/internal/nested-boxes.d.ts.map +1 -0
- package/dist/examples/internal/nested-boxes.js +7 -0
- package/dist/examples/internal/nested-boxes.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.d.ts +2 -0
- package/dist/examples/internal/scrollbox-demo.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +104 -0
- package/dist/examples/internal/scrollbox-demo.js.map +1 -0
- package/dist/examples/internal/simple-dialog.d.ts +2 -0
- package/dist/examples/internal/simple-dialog.d.ts.map +1 -0
- package/dist/examples/internal/simple-dialog.js +43 -0
- package/dist/examples/internal/simple-dialog.js.map +1 -0
- package/dist/examples/internal/text-stacking.d.ts +2 -0
- package/dist/examples/internal/text-stacking.d.ts.map +1 -0
- package/dist/examples/internal/text-stacking.js +53 -0
- package/dist/examples/internal/text-stacking.js.map +1 -0
- package/dist/examples/internal/unicode-square-repro.d.ts +2 -0
- package/dist/examples/internal/unicode-square-repro.d.ts.map +1 -0
- package/dist/examples/internal/unicode-square-repro.js +7 -0
- package/dist/examples/internal/unicode-square-repro.js.map +1 -0
- package/dist/examples/list-dropdown-default.d.ts +2 -0
- package/dist/examples/list-dropdown-default.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.js +14 -0
- package/dist/examples/list-dropdown-default.js.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts +2 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.js +164 -0
- package/dist/examples/list-dropdown-default.vitest.js.map +1 -0
- package/dist/examples/list-fetch-data.d.ts +2 -0
- package/dist/examples/list-fetch-data.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.js +87 -0
- package/dist/examples/list-fetch-data.js.map +1 -0
- package/dist/examples/list-fetch-data.vitest.d.ts +2 -0
- package/dist/examples/list-fetch-data.vitest.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.vitest.js +103 -0
- package/dist/examples/list-fetch-data.vitest.js.map +1 -0
- package/dist/examples/list-filter-navigation.d.ts +2 -0
- package/dist/examples/list-filter-navigation.d.ts.map +1 -0
- package/dist/examples/list-filter-navigation.js +8 -0
- package/dist/examples/list-filter-navigation.js.map +1 -0
- package/dist/examples/list-with-detail.d.ts +2 -0
- package/dist/examples/list-with-detail.d.ts.map +1 -0
- package/dist/examples/list-with-detail.js +94 -0
- package/dist/examples/list-with-detail.js.map +1 -0
- package/dist/examples/list-with-detail.vitest.d.ts +2 -0
- package/dist/examples/list-with-detail.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-detail.vitest.js +438 -0
- package/dist/examples/list-with-detail.vitest.js.map +1 -0
- package/dist/examples/list-with-dropdown.d.ts +2 -0
- package/dist/examples/list-with-dropdown.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.js +43 -0
- package/dist/examples/list-with-dropdown.js.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts +2 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.js +297 -0
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -0
- package/dist/examples/list-with-sections.d.ts +2 -0
- package/dist/examples/list-with-sections.d.ts.map +1 -0
- package/dist/examples/list-with-sections.js +67 -0
- package/dist/examples/list-with-sections.js.map +1 -0
- package/dist/examples/list-with-sections.vitest.d.ts +2 -0
- package/dist/examples/list-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-sections.vitest.js +441 -0
- package/dist/examples/list-with-sections.vitest.js.map +1 -0
- package/dist/examples/miscellaneous.d.ts +2 -0
- package/dist/examples/miscellaneous.d.ts.map +1 -0
- package/dist/examples/miscellaneous.js +313 -0
- package/dist/examples/miscellaneous.js.map +1 -0
- package/dist/examples/nested-navigation.d.ts +2 -0
- package/dist/examples/nested-navigation.d.ts.map +1 -0
- package/dist/examples/nested-navigation.js +35 -0
- package/dist/examples/nested-navigation.js.map +1 -0
- package/dist/examples/preferences-test.d.ts +2 -0
- package/dist/examples/preferences-test.d.ts.map +1 -0
- package/dist/examples/preferences-test.js +43 -0
- package/dist/examples/preferences-test.js.map +1 -0
- package/dist/examples/simple-dropdown.d.ts +2 -0
- package/dist/examples/simple-dropdown.d.ts.map +1 -0
- package/dist/examples/simple-dropdown.js +15 -0
- package/dist/examples/simple-dropdown.js.map +1 -0
- package/dist/examples/simple-file-picker.d.ts +2 -0
- package/dist/examples/simple-file-picker.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.js +21 -0
- package/dist/examples/simple-file-picker.js.map +1 -0
- package/dist/examples/simple-file-picker.vitest.d.ts +2 -0
- package/dist/examples/simple-file-picker.vitest.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.vitest.js +277 -0
- package/dist/examples/simple-file-picker.vitest.js.map +1 -0
- package/dist/examples/simple-grid.d.ts +2 -0
- package/dist/examples/simple-grid.d.ts.map +1 -0
- package/dist/examples/simple-grid.js +51 -0
- package/dist/examples/simple-grid.js.map +1 -0
- package/dist/examples/simple-grid.vitest.d.ts +2 -0
- package/dist/examples/simple-grid.vitest.d.ts.map +1 -0
- package/dist/examples/simple-grid.vitest.js +498 -0
- package/dist/examples/simple-grid.vitest.js.map +1 -0
- package/dist/examples/simple-hud.d.ts +2 -0
- package/dist/examples/simple-hud.d.ts.map +1 -0
- package/dist/examples/simple-hud.js +18 -0
- package/dist/examples/simple-hud.js.map +1 -0
- package/dist/examples/simple-list-search.d.ts +2 -0
- package/dist/examples/simple-list-search.d.ts.map +1 -0
- package/dist/examples/simple-list-search.js +26 -0
- package/dist/examples/simple-list-search.js.map +1 -0
- package/dist/examples/simple-list.d.ts +2 -0
- package/dist/examples/simple-list.d.ts.map +1 -0
- package/dist/examples/simple-list.js +50 -0
- package/dist/examples/simple-list.js.map +1 -0
- package/dist/examples/simple-navigation.d.ts +2 -0
- package/dist/examples/simple-navigation.d.ts.map +1 -0
- package/dist/examples/simple-navigation.js +36 -0
- package/dist/examples/simple-navigation.js.map +1 -0
- package/dist/examples/simple-navigation.vitest.d.ts +2 -0
- package/dist/examples/simple-navigation.vitest.d.ts.map +1 -0
- package/dist/examples/simple-navigation.vitest.js +522 -0
- package/dist/examples/simple-navigation.vitest.js.map +1 -0
- package/dist/examples/store.d.ts +2 -0
- package/dist/examples/store.d.ts.map +1 -0
- package/dist/examples/store.js +5 -0
- package/dist/examples/store.js.map +1 -0
- package/dist/examples/store.vitest.d.ts +2 -0
- package/dist/examples/store.vitest.d.ts.map +1 -0
- package/dist/examples/store.vitest.js +52 -0
- package/dist/examples/store.vitest.js.map +1 -0
- package/dist/examples/tanstack-demo.d.ts +2 -0
- package/dist/examples/tanstack-demo.d.ts.map +1 -0
- package/dist/examples/tanstack-demo.js +51 -0
- package/dist/examples/tanstack-demo.js.map +1 -0
- package/dist/examples/use-promise-demo.d.ts +2 -0
- package/dist/examples/use-promise-demo.d.ts.map +1 -0
- package/dist/examples/use-promise-demo.js +45 -0
- package/dist/examples/use-promise-demo.js.map +1 -0
- package/dist/extensions/dev.d.ts +7 -0
- package/dist/extensions/dev.d.ts.map +1 -0
- package/dist/extensions/dev.js +124 -0
- package/dist/extensions/dev.js.map +1 -0
- package/dist/extensions/home.d.ts +8 -0
- package/dist/extensions/home.d.ts.map +1 -0
- package/dist/extensions/home.js +184 -0
- package/dist/extensions/home.js.map +1 -0
- package/dist/extensions/store.d.ts +6 -0
- package/dist/extensions/store.d.ts.map +1 -0
- package/dist/extensions/store.js +203 -0
- package/dist/extensions/store.js.map +1 -0
- package/dist/globals.d.ts +9 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +21 -0
- package/dist/globals.js.map +1 -0
- package/dist/home-command.d.ts +8 -0
- package/dist/home-command.d.ts.map +1 -0
- package/dist/home-command.js +181 -0
- package/dist/home-command.js.map +1 -0
- package/dist/hooks/hooks.test.d.ts +2 -0
- package/dist/hooks/hooks.test.d.ts.map +1 -0
- package/dist/hooks/hooks.test.js +37 -0
- package/dist/hooks/hooks.test.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-action-panel.d.ts +16 -0
- package/dist/hooks/use-action-panel.d.ts.map +1 -0
- package/dist/hooks/use-action-panel.js +19 -0
- package/dist/hooks/use-action-panel.js.map +1 -0
- package/dist/hooks/use-id.d.ts +9 -0
- package/dist/hooks/use-id.d.ts.map +1 -0
- package/dist/hooks/use-id.js +17 -0
- package/dist/hooks/use-id.js.map +1 -0
- package/dist/hooks/use-unstable-ai.d.ts +9 -0
- package/dist/hooks/use-unstable-ai.d.ts.map +1 -0
- package/dist/hooks/use-unstable-ai.js +13 -0
- package/dist/hooks/use-unstable-ai.js.map +1 -0
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +20 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hover-repro.d.ts +2 -0
- package/dist/hover-repro.d.ts.map +1 -0
- package/dist/hover-repro.js +20 -0
- package/dist/hover-repro.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/date-picker-widget.d.ts +9 -0
- package/dist/internal/date-picker-widget.d.ts.map +1 -0
- package/dist/internal/date-picker-widget.js +380 -0
- package/dist/internal/date-picker-widget.js.map +1 -0
- package/dist/internal/dialog.d.ts +21 -0
- package/dist/internal/dialog.d.ts.map +1 -0
- package/dist/internal/dialog.js +122 -0
- package/dist/internal/dialog.js.map +1 -0
- package/dist/internal/error-handler.d.ts +2 -0
- package/dist/internal/error-handler.d.ts.map +1 -0
- package/dist/internal/error-handler.js +29 -0
- package/dist/internal/error-handler.js.map +1 -0
- package/dist/internal/focus-context.d.ts +10 -0
- package/dist/internal/focus-context.d.ts.map +1 -0
- package/dist/internal/focus-context.js +12 -0
- package/dist/internal/focus-context.js.map +1 -0
- package/dist/internal/navigation.d.ts +18 -0
- package/dist/internal/navigation.d.ts.map +1 -0
- package/dist/internal/navigation.js +83 -0
- package/dist/internal/navigation.js.map +1 -0
- package/dist/internal/providers.d.ts +8 -0
- package/dist/internal/providers.d.ts.map +1 -0
- package/dist/internal/providers.js +262 -0
- package/dist/internal/providers.js.map +1 -0
- package/dist/localstorage.d.ts +13 -0
- package/dist/localstorage.d.ts.map +1 -0
- package/dist/localstorage.js +190 -0
- package/dist/localstorage.js.map +1 -0
- package/dist/localstorage.test.d.ts +2 -0
- package/dist/localstorage.test.d.ts.map +1 -0
- package/dist/localstorage.test.js +131 -0
- package/dist/localstorage.test.js.map +1 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +70 -0
- package/dist/logger.js.map +1 -0
- package/dist/oauth.d.ts +142 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +551 -0
- package/dist/oauth.js.map +1 -0
- package/dist/package-json.d.ts +84 -0
- package/dist/package-json.d.ts.map +1 -0
- package/dist/package-json.js +77 -0
- package/dist/package-json.js.map +1 -0
- package/dist/preferences.d.ts +23 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +105 -0
- package/dist/preferences.js.map +1 -0
- package/dist/preload.d.ts +2 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +28 -0
- package/dist/preload.js.map +1 -0
- package/dist/state.d.ts +26 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +18 -0
- package/dist/state.js.map +1 -0
- package/dist/store-api/download.d.ts +8 -0
- package/dist/store-api/download.d.ts.map +1 -0
- package/dist/store-api/download.js +37 -0
- package/dist/store-api/download.js.map +1 -0
- package/dist/store-api/download.test.d.ts +2 -0
- package/dist/store-api/download.test.d.ts.map +1 -0
- package/dist/store-api/download.test.js +36 -0
- package/dist/store-api/download.test.js.map +1 -0
- package/dist/store-api/extension.d.ts +87 -0
- package/dist/store-api/extension.d.ts.map +1 -0
- package/dist/store-api/extension.js +23 -0
- package/dist/store-api/extension.js.map +1 -0
- package/dist/store-api/extension.test.d.ts +2 -0
- package/dist/store-api/extension.test.d.ts.map +1 -0
- package/dist/store-api/extension.test.js +22 -0
- package/dist/store-api/extension.test.js.map +1 -0
- package/dist/store-api/search.d.ts +101 -0
- package/dist/store-api/search.d.ts.map +1 -0
- package/dist/store-api/search.js +29 -0
- package/dist/store-api/search.js.map +1 -0
- package/dist/store-api/search.test.d.ts +2 -0
- package/dist/store-api/search.test.d.ts.map +1 -0
- package/dist/store-api/search.test.js +45 -0
- package/dist/store-api/search.test.js.map +1 -0
- package/dist/store.d.ts +21 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +84 -0
- package/dist/store.js.map +1 -0
- package/dist/theme.d.ts +20 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +26 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast.d.ts +44 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +221 -0
- package/dist/toast.js.map +1 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +66 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils.d.ts +234 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +473 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +152 -0
- package/dist/utils.test.js.map +1 -0
- package/dist/window.d.ts +12 -0
- package/dist/window.d.ts.map +1 -0
- package/dist/window.js +48 -0
- package/dist/window.js.map +1 -0
- package/package.json +56 -0
- package/src/action-utils.tsx +207 -0
- package/src/apis/ai.tsx +177 -0
- package/src/apis/cache.test.ts +311 -0
- package/src/apis/cache.tsx +394 -0
- package/src/apis/clipboard.tsx +200 -0
- package/src/apis/environment.tsx +239 -0
- package/src/apis/hud.tsx +86 -0
- package/src/apis/localstorage.test.ts +164 -0
- package/src/apis/localstorage.tsx +215 -0
- package/src/apis/oauth.tsx +744 -0
- package/src/apis/preferences.tsx +140 -0
- package/src/apis/toast.tsx +388 -0
- package/src/apis/window.tsx +61 -0
- package/src/build.test.tsx +78 -0
- package/src/build.tsx +273 -0
- package/src/cli.tsx +328 -0
- package/src/colors.tsx +15 -0
- package/src/components/actions.tsx +718 -0
- package/src/components/alert.tsx +205 -0
- package/src/components/detail.tsx +359 -0
- package/src/components/dropdown.tsx +438 -0
- package/src/components/extension-preferences.tsx +269 -0
- package/src/components/form/assign-components.tsx +22 -0
- package/src/components/form/checkbox.tsx +96 -0
- package/src/components/form/date-picker.tsx +125 -0
- package/src/components/form/description.tsx +30 -0
- package/src/components/form/dropdown.tsx +512 -0
- package/src/components/form/file-autocomplete.tsx +141 -0
- package/src/components/form/file-picker.tsx +233 -0
- package/src/components/form/form-end.tsx +6 -0
- package/src/components/form/index.tsx +242 -0
- package/src/components/form/password-field.tsx +87 -0
- package/src/components/form/separator.tsx +15 -0
- package/src/components/form/tagpicker.tsx +245 -0
- package/src/components/form/text-area.tsx +82 -0
- package/src/components/form/text-field.tsx +82 -0
- package/src/components/form/types.tsx +49 -0
- package/src/components/form/use-form-navigation.tsx +65 -0
- package/src/components/form/with-left-border.tsx +53 -0
- package/src/components/icon.tsx +496 -0
- package/src/components/image.tsx +54 -0
- package/src/components/list.tsx +1564 -0
- package/src/components/loading-bar.tsx +141 -0
- package/src/components/menubar-extra.tsx +181 -0
- package/src/descendants.tsx +134 -0
- package/src/e2e-node.tsx +303 -0
- package/src/e2e.tsx +147 -0
- package/src/examples/action-show-in-finder.tsx +80 -0
- package/src/examples/environment-test.tsx +50 -0
- package/src/examples/error-boundary.tsx +217 -0
- package/src/examples/form-basic.tsx +122 -0
- package/src/examples/form-basic.vitest.tsx +1035 -0
- package/src/examples/form-dropdown.tsx +102 -0
- package/src/examples/form-dropdown.vitest.tsx +758 -0
- package/src/examples/form-tagpicker.tsx +66 -0
- package/src/examples/form-tagpicker.vitest.tsx +523 -0
- package/src/examples/internal/descendants-filtering.tsx +223 -0
- package/src/examples/internal/descendants.tsx +208 -0
- package/src/examples/internal/scrollbox-demo.tsx +149 -0
- package/src/examples/internal/simple-dialog.tsx +124 -0
- package/src/examples/internal/text-stacking.tsx +90 -0
- package/src/examples/list-dropdown-default.tsx +69 -0
- package/src/examples/list-dropdown-default.vitest.tsx +187 -0
- package/src/examples/list-fetch-data.tsx +123 -0
- package/src/examples/list-fetch-data.vitest.tsx +110 -0
- package/src/examples/list-with-detail.tsx +161 -0
- package/src/examples/list-with-detail.vitest.tsx +468 -0
- package/src/examples/list-with-dropdown.tsx +97 -0
- package/src/examples/list-with-dropdown.vitest.tsx +324 -0
- package/src/examples/list-with-sections.tsx +196 -0
- package/src/examples/list-with-sections.vitest.tsx +479 -0
- package/src/examples/miscellaneous.tsx +780 -0
- package/src/examples/nested-navigation.tsx +118 -0
- package/src/examples/preferences-test.tsx +82 -0
- package/src/examples/simple-dropdown.tsx +95 -0
- package/src/examples/simple-file-picker.tsx +75 -0
- package/src/examples/simple-file-picker.vitest.tsx +306 -0
- package/src/examples/simple-grid.tsx +149 -0
- package/src/examples/simple-grid.vitest.tsx +535 -0
- package/src/examples/simple-hud.tsx +60 -0
- package/src/examples/simple-list-search.tsx +93 -0
- package/src/examples/simple-list.tsx +149 -0
- package/src/examples/simple-navigation.tsx +89 -0
- package/src/examples/simple-navigation.vitest.tsx +571 -0
- package/src/examples/store.tsx +4 -0
- package/src/examples/store.vitest.tsx +59 -0
- package/src/examples/tanstack-demo.tsx +104 -0
- package/src/examples/use-promise-demo.tsx +96 -0
- package/src/extensions/dev.tsx +215 -0
- package/src/extensions/home.tsx +332 -0
- package/src/extensions/store.tsx +375 -0
- package/src/globals.ts +34 -0
- package/src/hooks/index.tsx +8 -0
- package/src/hooks/use-action-panel.tsx +28 -0
- package/src/hooks/use-id.tsx +19 -0
- package/src/hooks/use-unstable-ai.tsx +15 -0
- package/src/hooks.tsx +22 -0
- package/src/index.tsx +240 -0
- package/src/internal/date-picker-widget.tsx +500 -0
- package/src/internal/dialog.tsx +202 -0
- package/src/internal/error-handler.tsx +32 -0
- package/src/internal/focus-context.tsx +23 -0
- package/src/internal/navigation.tsx +149 -0
- package/src/internal/providers.tsx +430 -0
- package/src/logger.tsx +84 -0
- package/src/package-json.tsx +197 -0
- package/src/preload.tsx +32 -0
- package/src/state.tsx +49 -0
- package/src/store-api/download.test.tsx +38 -0
- package/src/store-api/download.tsx +52 -0
- package/src/store-api/extension.test.tsx +24 -0
- package/src/store-api/extension.tsx +123 -0
- package/src/store-api/search.test.tsx +50 -0
- package/src/store-api/search.tsx +146 -0
- package/src/theme.tsx +31 -0
- package/src/utils/file-system.ts +87 -0
- package/src/utils.test.tsx +204 -0
- package/src/utils.tsx +657 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { render } from '@opentui/react'
|
|
4
|
+
import { List, logger, useStore } from 'termcast'
|
|
5
|
+
import { Action, ActionPanel } from 'termcast'
|
|
6
|
+
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
7
|
+
import { Providers } from 'termcast/src/internal/providers'
|
|
8
|
+
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
9
|
+
import { Icon } from 'termcast'
|
|
10
|
+
import { getStoredExtensions } from '../utils'
|
|
11
|
+
import Store from './store'
|
|
12
|
+
import { ExtensionPreferences } from '../components/extension-preferences'
|
|
13
|
+
import { LocalStorage } from 'termcast/src/apis/localstorage'
|
|
14
|
+
import '../globals'
|
|
15
|
+
|
|
16
|
+
interface ExtensionCommand {
|
|
17
|
+
extensionName: string
|
|
18
|
+
extensionTitle: string
|
|
19
|
+
command: any
|
|
20
|
+
bundledPath?: string
|
|
21
|
+
Component?: () => any
|
|
22
|
+
packageJson?: any
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Built-in extensions available globally
|
|
26
|
+
const builtinExtensions: ExtensionCommand[] = [
|
|
27
|
+
{
|
|
28
|
+
extensionName: 'termcast-store',
|
|
29
|
+
extensionTitle: 'Termcast Store',
|
|
30
|
+
command: {
|
|
31
|
+
name: 'store',
|
|
32
|
+
title: 'Store - Install Extensions',
|
|
33
|
+
description: 'Browse and install extensions from the Raycast Store',
|
|
34
|
+
mode: 'view',
|
|
35
|
+
icon: 'Store',
|
|
36
|
+
},
|
|
37
|
+
Component: Store,
|
|
38
|
+
},
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
function ExtensionsList({
|
|
42
|
+
allCommands,
|
|
43
|
+
initialSearchQuery = '',
|
|
44
|
+
}: {
|
|
45
|
+
allCommands: ExtensionCommand[]
|
|
46
|
+
initialSearchQuery?: string
|
|
47
|
+
}): any {
|
|
48
|
+
const { push } = useNavigation()
|
|
49
|
+
const [searchText, setSearchText] = React.useState(initialSearchQuery)
|
|
50
|
+
|
|
51
|
+
const handleCommandSelect = async (item: ExtensionCommand) => {
|
|
52
|
+
try {
|
|
53
|
+
await runCommand(item)
|
|
54
|
+
} catch (error: any) {
|
|
55
|
+
await showToast({
|
|
56
|
+
style: Toast.Style.Failure,
|
|
57
|
+
title: 'Failed to load command',
|
|
58
|
+
message: error.message || String(error),
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
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
|
+
// Group commands by extension
|
|
174
|
+
const groupedByExtension = allCommands.reduce(
|
|
175
|
+
(acc, cmd) => {
|
|
176
|
+
if (!acc[cmd.extensionName]) {
|
|
177
|
+
acc[cmd.extensionName] = {
|
|
178
|
+
title: cmd.extensionTitle,
|
|
179
|
+
commands: [],
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
acc[cmd.extensionName].commands.push(cmd)
|
|
183
|
+
return acc
|
|
184
|
+
},
|
|
185
|
+
{} as Record<string, { title: string; commands: ExtensionCommand[] }>,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<List
|
|
190
|
+
navigationTitle='Installed Extensions'
|
|
191
|
+
searchBarPlaceholder='Search commands...'
|
|
192
|
+
filtering={true}
|
|
193
|
+
onSearchTextChange={setSearchText}
|
|
194
|
+
searchText={searchText}
|
|
195
|
+
>
|
|
196
|
+
{Object.entries(groupedByExtension).map(
|
|
197
|
+
([extensionName, { title, commands }]) => (
|
|
198
|
+
<List.Section key={extensionName} title={title}>
|
|
199
|
+
{commands.map((item) => (
|
|
200
|
+
<List.Item
|
|
201
|
+
key={`${item.extensionName}-${item.command.name}`}
|
|
202
|
+
id={`${item.extensionName}-${item.command.name}`}
|
|
203
|
+
title={item.command.title}
|
|
204
|
+
subtitle={item.command.description}
|
|
205
|
+
icon={
|
|
206
|
+
item.command.icon
|
|
207
|
+
? Icon[item.command.icon as keyof typeof Icon]
|
|
208
|
+
: undefined
|
|
209
|
+
}
|
|
210
|
+
accessories={
|
|
211
|
+
item.command.mode ? [{ text: item.command.mode }] : []
|
|
212
|
+
}
|
|
213
|
+
keywords={[
|
|
214
|
+
...(item.command.keywords || []),
|
|
215
|
+
item.extensionName,
|
|
216
|
+
]}
|
|
217
|
+
actions={
|
|
218
|
+
<ActionPanel>
|
|
219
|
+
<Action
|
|
220
|
+
title='Run Command'
|
|
221
|
+
onAction={() => {
|
|
222
|
+
handleCommandSelect(item)
|
|
223
|
+
}}
|
|
224
|
+
/>
|
|
225
|
+
<Action
|
|
226
|
+
title='Configure Extension'
|
|
227
|
+
onAction={() => {
|
|
228
|
+
push(
|
|
229
|
+
<ExtensionPreferences
|
|
230
|
+
extensionName={item.extensionName}
|
|
231
|
+
onSubmit={() => {
|
|
232
|
+
// After configuring extension preferences, try to run the command
|
|
233
|
+
runCommand(item)
|
|
234
|
+
}}
|
|
235
|
+
/>,
|
|
236
|
+
)
|
|
237
|
+
}}
|
|
238
|
+
/>
|
|
239
|
+
<Action
|
|
240
|
+
title='Configure Command'
|
|
241
|
+
onAction={() => {
|
|
242
|
+
push(
|
|
243
|
+
<ExtensionPreferences
|
|
244
|
+
extensionName={item.extensionName}
|
|
245
|
+
commandName={item.command.name}
|
|
246
|
+
onSubmit={() => {
|
|
247
|
+
// After configuring command preferences, try to run the command
|
|
248
|
+
runCommand(item)
|
|
249
|
+
}}
|
|
250
|
+
/>,
|
|
251
|
+
)
|
|
252
|
+
}}
|
|
253
|
+
/>
|
|
254
|
+
{item.bundledPath && (
|
|
255
|
+
<Action.CopyToClipboard
|
|
256
|
+
content={item.bundledPath}
|
|
257
|
+
title='Copy Bundle Path'
|
|
258
|
+
/>
|
|
259
|
+
)}
|
|
260
|
+
<Action.CopyToClipboard
|
|
261
|
+
content={JSON.stringify(item.command, null, 2)}
|
|
262
|
+
title='Copy Command Info'
|
|
263
|
+
/>
|
|
264
|
+
</ActionPanel>
|
|
265
|
+
}
|
|
266
|
+
/>
|
|
267
|
+
))}
|
|
268
|
+
</List.Section>
|
|
269
|
+
),
|
|
270
|
+
)}
|
|
271
|
+
|
|
272
|
+
{allCommands.length === 0 && (
|
|
273
|
+
<List.Section title='No Commands'>
|
|
274
|
+
<List.Item
|
|
275
|
+
title='No extensions installed'
|
|
276
|
+
subtitle='Use "termcast build" to install an extension'
|
|
277
|
+
/>
|
|
278
|
+
</List.Section>
|
|
279
|
+
)}
|
|
280
|
+
</List>
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export async function runHomeCommand(): Promise<void> {
|
|
285
|
+
logger.log(`preparing to render the home command component`)
|
|
286
|
+
|
|
287
|
+
await render(
|
|
288
|
+
<Providers>
|
|
289
|
+
<Home />
|
|
290
|
+
</Providers>,
|
|
291
|
+
)
|
|
292
|
+
logger.log(`rendered home command component`)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export default function Home({
|
|
296
|
+
initialSearchQuery = '',
|
|
297
|
+
key,
|
|
298
|
+
}: {
|
|
299
|
+
initialSearchQuery?: string
|
|
300
|
+
key?: React.Key
|
|
301
|
+
}): any {
|
|
302
|
+
const storedExtensions = getStoredExtensions()
|
|
303
|
+
|
|
304
|
+
const allCommands: ExtensionCommand[] = []
|
|
305
|
+
|
|
306
|
+
allCommands.push(...builtinExtensions)
|
|
307
|
+
|
|
308
|
+
for (const extension of storedExtensions) {
|
|
309
|
+
const packageJson = JSON.parse(
|
|
310
|
+
fs.readFileSync(extension.packageJsonPath, 'utf-8'),
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
for (const command of extension.commands) {
|
|
314
|
+
if (command.bundledPath) {
|
|
315
|
+
allCommands.push({
|
|
316
|
+
extensionName: extension.name,
|
|
317
|
+
extensionTitle: packageJson.title || extension.name,
|
|
318
|
+
command,
|
|
319
|
+
bundledPath: command.bundledPath,
|
|
320
|
+
packageJson,
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
<ExtensionsList
|
|
328
|
+
allCommands={allCommands}
|
|
329
|
+
initialSearchQuery={initialSearchQuery}
|
|
330
|
+
/>
|
|
331
|
+
)
|
|
332
|
+
}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import dedent from 'string-dedent'
|
|
5
|
+
import { useQuery } from '@tanstack/react-query'
|
|
6
|
+
import {
|
|
7
|
+
List,
|
|
8
|
+
Detail,
|
|
9
|
+
Action,
|
|
10
|
+
ActionPanel,
|
|
11
|
+
showToast,
|
|
12
|
+
Toast,
|
|
13
|
+
Icon,
|
|
14
|
+
} from 'termcast'
|
|
15
|
+
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
16
|
+
import { ExtensionPreferences } from '../components/extension-preferences'
|
|
17
|
+
import { searchStoreListings } from '../store-api/search'
|
|
18
|
+
import { fetchExtension } from '../store-api/extension'
|
|
19
|
+
import { downloadExtension } from '../store-api/download'
|
|
20
|
+
import { getStoreDirectory } from '../utils'
|
|
21
|
+
import { buildExtensionCommands } from '../build'
|
|
22
|
+
import { logger } from '../logger'
|
|
23
|
+
import { parsePackageJson } from '../package-json'
|
|
24
|
+
import Home from './home'
|
|
25
|
+
import {
|
|
26
|
+
checkExtensionPreferences,
|
|
27
|
+
type ExtensionPreferencesInfo,
|
|
28
|
+
} from '../utils'
|
|
29
|
+
|
|
30
|
+
interface StoreListing {
|
|
31
|
+
id: string
|
|
32
|
+
name: string
|
|
33
|
+
author: {
|
|
34
|
+
name: string
|
|
35
|
+
handle: string
|
|
36
|
+
}
|
|
37
|
+
owner: {
|
|
38
|
+
name: string
|
|
39
|
+
handle: string
|
|
40
|
+
}
|
|
41
|
+
title: string
|
|
42
|
+
description: string
|
|
43
|
+
download_count: number
|
|
44
|
+
updated_at: number
|
|
45
|
+
categories: string[]
|
|
46
|
+
commands: Array<{
|
|
47
|
+
title: string
|
|
48
|
+
description: string
|
|
49
|
+
mode: string
|
|
50
|
+
}>
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function StoreSearch(): any {
|
|
54
|
+
const [searchQuery, setSearchQuery] = useState('')
|
|
55
|
+
const { push } = useNavigation()
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
isLoading,
|
|
59
|
+
isPending,
|
|
60
|
+
isFetching,
|
|
61
|
+
data: extensions,
|
|
62
|
+
error,
|
|
63
|
+
} = useQuery({
|
|
64
|
+
queryKey: ['store-search', searchQuery],
|
|
65
|
+
queryFn: async () => {
|
|
66
|
+
// If no query, use 'raycast' to get default popular extensions
|
|
67
|
+
const query = searchQuery.trim() || 'raycast'
|
|
68
|
+
logger.log(`Store searching for: "${query}"`)
|
|
69
|
+
const response = await searchStoreListings({ query })
|
|
70
|
+
logger.log(`Store search returned ${response.data?.length || 0} results`)
|
|
71
|
+
return response.data
|
|
72
|
+
},
|
|
73
|
+
placeholderData: (previousData) => previousData, // Keep previous data while fetching
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Show error toast if query fails
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
if (error) {
|
|
79
|
+
showToast({
|
|
80
|
+
style: Toast.Style.Failure,
|
|
81
|
+
title: 'Search failed',
|
|
82
|
+
message: (error as Error).message,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}, [error])
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<List
|
|
89
|
+
navigationTitle='Store - Install Extensions'
|
|
90
|
+
searchBarPlaceholder='Search extensions...'
|
|
91
|
+
filtering={false}
|
|
92
|
+
onSearchTextChange={setSearchQuery}
|
|
93
|
+
isLoading={isPending || isFetching}
|
|
94
|
+
>
|
|
95
|
+
{extensions?.map((ext) => (
|
|
96
|
+
<List.Item
|
|
97
|
+
key={ext.id}
|
|
98
|
+
id={ext.id}
|
|
99
|
+
title={ext.title}
|
|
100
|
+
subtitle={ext.description}
|
|
101
|
+
accessories={[]}
|
|
102
|
+
keywords={ext.categories}
|
|
103
|
+
actions={
|
|
104
|
+
<ActionPanel>
|
|
105
|
+
<Action
|
|
106
|
+
title='View Details'
|
|
107
|
+
onAction={() => {
|
|
108
|
+
const Component = () => <ExtensionDetails extension={ext} />
|
|
109
|
+
Component.displayName = `store-extension-${ext.name}`
|
|
110
|
+
push(<Component />)
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
<Action.OpenInBrowser
|
|
114
|
+
url={`https://raycast.com/${ext.owner.handle}/${ext.name}`}
|
|
115
|
+
title='Open in Raycast Store'
|
|
116
|
+
/>
|
|
117
|
+
</ActionPanel>
|
|
118
|
+
}
|
|
119
|
+
/>
|
|
120
|
+
))}
|
|
121
|
+
</List>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function ExtensionDetails({ extension }: { extension: StoreListing }): any {
|
|
126
|
+
const [isInstalling, setIsInstalling] = useState(false)
|
|
127
|
+
const [isInstalled, setIsInstalled] = useState(false)
|
|
128
|
+
const [extensionInfo, setExtensionInfo] = useState<ExtensionPreferencesInfo>({
|
|
129
|
+
hasPreferences: false,
|
|
130
|
+
hasRequiredPreferences: false,
|
|
131
|
+
})
|
|
132
|
+
const { pop, push } = useNavigation()
|
|
133
|
+
|
|
134
|
+
// Check if extension is already installed and get preferences info
|
|
135
|
+
React.useEffect(() => {
|
|
136
|
+
const storeDir = getStoreDirectory()
|
|
137
|
+
const extensionDir = path.join(storeDir, extension.name)
|
|
138
|
+
const installed = fs.existsSync(extensionDir)
|
|
139
|
+
setIsInstalled(installed)
|
|
140
|
+
|
|
141
|
+
// Check preferences info if installed
|
|
142
|
+
if (installed) {
|
|
143
|
+
const prefsInfo = checkExtensionPreferences(extension.name)
|
|
144
|
+
setExtensionInfo(prefsInfo)
|
|
145
|
+
}
|
|
146
|
+
}, [extension.name])
|
|
147
|
+
|
|
148
|
+
const formatDate = (timestamp: number) => {
|
|
149
|
+
return new Date(timestamp * 1000).toLocaleDateString('en-US', {
|
|
150
|
+
year: 'numeric',
|
|
151
|
+
month: 'long',
|
|
152
|
+
day: 'numeric',
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const handleInstall = async () => {
|
|
157
|
+
setIsInstalling(true)
|
|
158
|
+
try {
|
|
159
|
+
await showToast({
|
|
160
|
+
style: Toast.Style.Animated,
|
|
161
|
+
title: 'Downloading extension...',
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const files = await downloadExtension({
|
|
165
|
+
author: extension.owner.handle,
|
|
166
|
+
extension: extension.name,
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
const storeDir = getStoreDirectory()
|
|
170
|
+
const extensionDir = path.join(storeDir, extension.name)
|
|
171
|
+
|
|
172
|
+
if (fs.existsSync(extensionDir)) {
|
|
173
|
+
fs.rmSync(extensionDir, { recursive: true, force: true })
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
fs.mkdirSync(extensionDir, { recursive: true })
|
|
177
|
+
|
|
178
|
+
// Write all files to the extension directory
|
|
179
|
+
for (const file of files) {
|
|
180
|
+
const filePath = path.join(extensionDir, file.filename)
|
|
181
|
+
const fileDir = path.dirname(filePath)
|
|
182
|
+
|
|
183
|
+
if (!fs.existsSync(fileDir)) {
|
|
184
|
+
fs.mkdirSync(fileDir, { recursive: true })
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
fs.writeFileSync(filePath, file.buffer)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
await showToast({
|
|
191
|
+
style: Toast.Style.Animated,
|
|
192
|
+
title: 'Building extension...',
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
// Build the extension commands to create bundles
|
|
196
|
+
try {
|
|
197
|
+
const buildResult = await buildExtensionCommands({
|
|
198
|
+
extensionPath: extensionDir,
|
|
199
|
+
format: 'cjs',
|
|
200
|
+
target: 'node',
|
|
201
|
+
})
|
|
202
|
+
logger.log(
|
|
203
|
+
`Built ${buildResult.commands.length} commands for ${extension.name}`,
|
|
204
|
+
)
|
|
205
|
+
} catch (buildError: any) {
|
|
206
|
+
// Log build error but don't fail installation
|
|
207
|
+
logger.error(
|
|
208
|
+
`Failed to build extension commands: ${buildError.message}`,
|
|
209
|
+
)
|
|
210
|
+
await showToast({
|
|
211
|
+
style: Toast.Style.Animated,
|
|
212
|
+
title: 'Warning',
|
|
213
|
+
message: buildError?.message,
|
|
214
|
+
})
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
await showToast({
|
|
219
|
+
style: Toast.Style.Success,
|
|
220
|
+
title: 'Extension installed',
|
|
221
|
+
message: `${extension.title} has been installed successfully`,
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
logger.log(`Extension '${extension.name}' installed to ${extensionDir}`)
|
|
225
|
+
setIsInstalled(true)
|
|
226
|
+
|
|
227
|
+
// Update extension info after installation
|
|
228
|
+
const prefsInfo = checkExtensionPreferences(extension.name)
|
|
229
|
+
setExtensionInfo(prefsInfo)
|
|
230
|
+
|
|
231
|
+
// Ask if user wants to configure preferences
|
|
232
|
+
await showToast({
|
|
233
|
+
style: Toast.Style.Success,
|
|
234
|
+
title: 'Configure preferences?',
|
|
235
|
+
message: 'Would you like to configure extension preferences now?',
|
|
236
|
+
primaryAction: {
|
|
237
|
+
title: 'Configure',
|
|
238
|
+
onAction: () => {
|
|
239
|
+
const Component = () => (
|
|
240
|
+
<ExtensionPreferences extensionName={extension.name} />
|
|
241
|
+
)
|
|
242
|
+
Component.displayName = `store-preferences-${extension.name}`
|
|
243
|
+
push(<Component />)
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
})
|
|
247
|
+
} catch (error: any) {
|
|
248
|
+
await showToast({
|
|
249
|
+
style: Toast.Style.Failure,
|
|
250
|
+
title: 'Installation failed',
|
|
251
|
+
message: error.message,
|
|
252
|
+
})
|
|
253
|
+
} finally {
|
|
254
|
+
setIsInstalling(false)
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const markdownContent = dedent`
|
|
259
|
+
# ${extension.title}
|
|
260
|
+
|
|
261
|
+
${extension.description}
|
|
262
|
+
|
|
263
|
+
## Commands
|
|
264
|
+
|
|
265
|
+
${extension.commands
|
|
266
|
+
.map(
|
|
267
|
+
(cmd) => dedent`
|
|
268
|
+
### ${cmd.title}
|
|
269
|
+
${cmd.description || 'No description available'}
|
|
270
|
+
**Mode:** ${cmd.mode}
|
|
271
|
+
`,
|
|
272
|
+
)
|
|
273
|
+
.join('\n\n')}
|
|
274
|
+
|
|
275
|
+
## Information
|
|
276
|
+
|
|
277
|
+
- **Author:** ${extension.author.name} (@${extension.author.handle})
|
|
278
|
+
- **Downloads:** ${extension.download_count.toLocaleString()}
|
|
279
|
+
- **Last Updated:** ${formatDate(extension.updated_at)}
|
|
280
|
+
- **Categories:** ${extension.categories.join(', ')}
|
|
281
|
+
`
|
|
282
|
+
|
|
283
|
+
return (
|
|
284
|
+
<Detail
|
|
285
|
+
navigationTitle={extension.title}
|
|
286
|
+
markdown={markdownContent}
|
|
287
|
+
metadata={
|
|
288
|
+
<Detail.Metadata>
|
|
289
|
+
<Detail.Metadata.Label title='Author' text={extension.author.name} />
|
|
290
|
+
<Detail.Metadata.Label
|
|
291
|
+
title='Downloads'
|
|
292
|
+
text={extension.download_count.toLocaleString()}
|
|
293
|
+
/>
|
|
294
|
+
<Detail.Metadata.Label
|
|
295
|
+
title='Commands'
|
|
296
|
+
text={extension.commands.length.toString()}
|
|
297
|
+
/>
|
|
298
|
+
<Detail.Metadata.Separator />
|
|
299
|
+
<Detail.Metadata.Label
|
|
300
|
+
title='Updated'
|
|
301
|
+
text={formatDate(extension.updated_at)}
|
|
302
|
+
/>
|
|
303
|
+
<Detail.Metadata.TagList title='Categories'>
|
|
304
|
+
{extension.categories.map((cat, index) => (
|
|
305
|
+
<Detail.Metadata.TagList.Item text={cat} />
|
|
306
|
+
))}
|
|
307
|
+
</Detail.Metadata.TagList>
|
|
308
|
+
</Detail.Metadata>
|
|
309
|
+
}
|
|
310
|
+
actions={
|
|
311
|
+
<ActionPanel>
|
|
312
|
+
{!isInstalled ? (
|
|
313
|
+
<Action
|
|
314
|
+
title={isInstalling ? 'Installing...' : 'Install Extension'}
|
|
315
|
+
onAction={handleInstall}
|
|
316
|
+
/>
|
|
317
|
+
) : (
|
|
318
|
+
<>
|
|
319
|
+
{extensionInfo.hasRequiredPreferences && (
|
|
320
|
+
<Action
|
|
321
|
+
title='Configure Extension'
|
|
322
|
+
onAction={() => {
|
|
323
|
+
const Component = () => (
|
|
324
|
+
<ExtensionPreferences extensionName={extension.name} />
|
|
325
|
+
)
|
|
326
|
+
Component.displayName = `store-preferences-${extension.name}`
|
|
327
|
+
push(<Component />)
|
|
328
|
+
}}
|
|
329
|
+
/>
|
|
330
|
+
)}
|
|
331
|
+
<Action
|
|
332
|
+
title='Use Extension'
|
|
333
|
+
onAction={() => {
|
|
334
|
+
const Component = () => (
|
|
335
|
+
<Home
|
|
336
|
+
key={extension.name}
|
|
337
|
+
initialSearchQuery={extension.name}
|
|
338
|
+
/>
|
|
339
|
+
)
|
|
340
|
+
Component.displayName = `store-home-${extension.name}`
|
|
341
|
+
push(<Component />)
|
|
342
|
+
}}
|
|
343
|
+
/>
|
|
344
|
+
{extensionInfo.hasPreferences &&
|
|
345
|
+
!extensionInfo.hasRequiredPreferences && (
|
|
346
|
+
<Action
|
|
347
|
+
title='Configure Extension'
|
|
348
|
+
onAction={() => {
|
|
349
|
+
const Component = () => (
|
|
350
|
+
<ExtensionPreferences extensionName={extension.name} />
|
|
351
|
+
)
|
|
352
|
+
Component.displayName = `store-preferences-${extension.name}`
|
|
353
|
+
push(<Component />)
|
|
354
|
+
}}
|
|
355
|
+
/>
|
|
356
|
+
)}
|
|
357
|
+
<Action title='Reinstall Extension' onAction={handleInstall} />
|
|
358
|
+
</>
|
|
359
|
+
)}
|
|
360
|
+
<Action.OpenInBrowser
|
|
361
|
+
url={`https://raycast.com/${extension.owner.handle}/${extension.name}`}
|
|
362
|
+
title='View in Raycast Store'
|
|
363
|
+
/>
|
|
364
|
+
</ActionPanel>
|
|
365
|
+
}
|
|
366
|
+
/>
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
ExtensionDetails.displayName = 'ExtensionDetails'
|
|
370
|
+
|
|
371
|
+
StoreSearch.displayName = 'StoreSearch'
|
|
372
|
+
export default function Store(): any {
|
|
373
|
+
return <StoreSearch />
|
|
374
|
+
}
|
|
375
|
+
Store.displayName = 'Store'
|