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,118 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@opentui/react'
|
|
3
|
+
import List from 'termcast'
|
|
4
|
+
import { Action, ActionPanel } from 'termcast'
|
|
5
|
+
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
6
|
+
import { Providers } from 'termcast/src/internal/providers'
|
|
7
|
+
|
|
8
|
+
function ThirdLevel({ path }: { path: string[] }): any {
|
|
9
|
+
const { pop } = useNavigation()
|
|
10
|
+
const fullPath = path.join(' > ')
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<List
|
|
14
|
+
searchBarPlaceholder='Third level - Press ESC to go back'
|
|
15
|
+
navigationTitle={fullPath}
|
|
16
|
+
>
|
|
17
|
+
<List.Section title='Final Level'>
|
|
18
|
+
<List.Item
|
|
19
|
+
id='info'
|
|
20
|
+
title="You've reached the deepest level"
|
|
21
|
+
subtitle={`Path: ${fullPath}`}
|
|
22
|
+
actions={
|
|
23
|
+
<ActionPanel>
|
|
24
|
+
<Action title='← Go Back' onAction={() => pop()} />
|
|
25
|
+
<Action.CopyToClipboard content={fullPath} title='Copy Path' />
|
|
26
|
+
</ActionPanel>
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
</List.Section>
|
|
30
|
+
</List>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function SecondLevel({ category }: { category: string }): any {
|
|
35
|
+
const { push, pop } = useNavigation()
|
|
36
|
+
|
|
37
|
+
const items = ['Item A', 'Item B', 'Item C']
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<List
|
|
41
|
+
searchBarPlaceholder='Second level - Press ESC to go back'
|
|
42
|
+
navigationTitle={category}
|
|
43
|
+
>
|
|
44
|
+
<List.Section title={`${category} Items`}>
|
|
45
|
+
{items.map((item) => (
|
|
46
|
+
<List.Item
|
|
47
|
+
id={`item-${item}`}
|
|
48
|
+
title={item}
|
|
49
|
+
subtitle={`View details for ${item}`}
|
|
50
|
+
actions={
|
|
51
|
+
<ActionPanel>
|
|
52
|
+
<Action
|
|
53
|
+
title='View Details'
|
|
54
|
+
onAction={() => {
|
|
55
|
+
push(<ThirdLevel path={[category, item]} />, () =>
|
|
56
|
+
console.log(`Popped from ${item}`),
|
|
57
|
+
)
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
<Action title='← Back' onAction={() => pop()} />
|
|
61
|
+
</ActionPanel>
|
|
62
|
+
}
|
|
63
|
+
/>
|
|
64
|
+
))}
|
|
65
|
+
</List.Section>
|
|
66
|
+
</List>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function FirstLevel(): any {
|
|
71
|
+
const { push } = useNavigation()
|
|
72
|
+
|
|
73
|
+
const categories = [
|
|
74
|
+
{ id: 'docs', title: 'Documents', icon: '📄' },
|
|
75
|
+
{ id: 'images', title: 'Images', icon: '🖼️' },
|
|
76
|
+
{ id: 'videos', title: 'Videos', icon: '🎥' },
|
|
77
|
+
{ id: 'music', title: 'Music', icon: '🎵' },
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<List
|
|
82
|
+
searchBarPlaceholder='Search categories'
|
|
83
|
+
navigationTitle='Nested Navigation Demo'
|
|
84
|
+
>
|
|
85
|
+
<List.Section title='Categories'>
|
|
86
|
+
{categories.map((cat) => (
|
|
87
|
+
<List.Item
|
|
88
|
+
id={cat.id}
|
|
89
|
+
title={`${cat.icon} ${cat.title}`}
|
|
90
|
+
subtitle={`Browse ${cat.title.toLowerCase()}`}
|
|
91
|
+
actions={
|
|
92
|
+
<ActionPanel>
|
|
93
|
+
<Action
|
|
94
|
+
title='Open Category'
|
|
95
|
+
onAction={() => {
|
|
96
|
+
push(<SecondLevel category={cat.title} />, () =>
|
|
97
|
+
console.log(`Popped from ${cat.title}`),
|
|
98
|
+
)
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
</ActionPanel>
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
))}
|
|
105
|
+
</List.Section>
|
|
106
|
+
</List>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function App(): any {
|
|
111
|
+
return (
|
|
112
|
+
<Providers>
|
|
113
|
+
<FirstLevel />
|
|
114
|
+
</Providers>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
render(<App />)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { List, Action, ActionPanel, showToast, Toast } from 'termcast'
|
|
3
|
+
import {
|
|
4
|
+
getPreferenceValues,
|
|
5
|
+
openExtensionPreferences,
|
|
6
|
+
openCommandPreferences,
|
|
7
|
+
} from 'termcast'
|
|
8
|
+
import { renderWithProviders } from 'termcast'
|
|
9
|
+
|
|
10
|
+
function PreferencesTestExample(): any {
|
|
11
|
+
const handleGetPreferences = () => {
|
|
12
|
+
const prefs = getPreferenceValues()
|
|
13
|
+
showToast({
|
|
14
|
+
style: Toast.Style.Success,
|
|
15
|
+
title: 'Current Preferences',
|
|
16
|
+
message:
|
|
17
|
+
Object.keys(prefs).length > 0
|
|
18
|
+
? JSON.stringify(prefs, null, 2)
|
|
19
|
+
: 'No preferences set',
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const handleOpenExtensionPrefs = async () => {
|
|
24
|
+
try {
|
|
25
|
+
await openExtensionPreferences()
|
|
26
|
+
} catch (error) {
|
|
27
|
+
showToast({
|
|
28
|
+
style: Toast.Style.Failure,
|
|
29
|
+
title: 'Error',
|
|
30
|
+
message: String(error),
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const handleOpenCommandPrefs = async () => {
|
|
36
|
+
try {
|
|
37
|
+
await openCommandPreferences()
|
|
38
|
+
} catch (error) {
|
|
39
|
+
showToast({
|
|
40
|
+
style: Toast.Style.Failure,
|
|
41
|
+
title: 'Error',
|
|
42
|
+
message: String(error),
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<List navigationTitle='Preferences Test'>
|
|
49
|
+
<List.Item
|
|
50
|
+
title='Get Current Preferences'
|
|
51
|
+
subtitle='Shows current preference values'
|
|
52
|
+
actions={
|
|
53
|
+
<ActionPanel>
|
|
54
|
+
<Action title='Get Preferences' onAction={handleGetPreferences} />
|
|
55
|
+
</ActionPanel>
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<List.Item
|
|
60
|
+
title='Open Extension Preferences'
|
|
61
|
+
subtitle='Opens the extension preferences form'
|
|
62
|
+
actions={
|
|
63
|
+
<ActionPanel>
|
|
64
|
+
<Action title='Open' onAction={handleOpenExtensionPrefs} />
|
|
65
|
+
</ActionPanel>
|
|
66
|
+
}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<List.Item
|
|
70
|
+
title='Open Command Preferences'
|
|
71
|
+
subtitle='Opens the command preferences form'
|
|
72
|
+
actions={
|
|
73
|
+
<ActionPanel>
|
|
74
|
+
<Action title='Open' onAction={handleOpenCommandPrefs} />
|
|
75
|
+
</ActionPanel>
|
|
76
|
+
}
|
|
77
|
+
/>
|
|
78
|
+
</List>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
renderWithProviders(<PreferencesTestExample />)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { renderWithProviders } from 'termcast'
|
|
2
|
+
import { Dropdown } from 'termcast'
|
|
3
|
+
import { logger } from 'termcast'
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
|
|
6
|
+
const App: any = () => {
|
|
7
|
+
const [selectedValue, setSelectedValue] = useState<string>('one')
|
|
8
|
+
|
|
9
|
+
const handleChange = (newValue: string) => {
|
|
10
|
+
logger.log('Dropdown value changed to:', newValue)
|
|
11
|
+
setSelectedValue(newValue)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Dropdown
|
|
16
|
+
tooltip='Select Drink Type'
|
|
17
|
+
onChange={handleChange}
|
|
18
|
+
value={selectedValue}
|
|
19
|
+
placeholder='Search drinks...'
|
|
20
|
+
filtering
|
|
21
|
+
storeValue
|
|
22
|
+
>
|
|
23
|
+
<Dropdown.Section title='Alcoholic Beverages'>
|
|
24
|
+
<Dropdown.Item
|
|
25
|
+
value='beer'
|
|
26
|
+
title='Beer'
|
|
27
|
+
icon='🍺'
|
|
28
|
+
keywords={['lager', 'ale', 'stout']}
|
|
29
|
+
label='⌃B'
|
|
30
|
+
/>
|
|
31
|
+
<Dropdown.Item
|
|
32
|
+
value='wine'
|
|
33
|
+
title='Wine'
|
|
34
|
+
icon='🍷'
|
|
35
|
+
keywords={['red', 'white', 'rose']}
|
|
36
|
+
label='⌃W'
|
|
37
|
+
/>
|
|
38
|
+
<Dropdown.Item
|
|
39
|
+
value='whiskey'
|
|
40
|
+
title='Whiskey'
|
|
41
|
+
icon='🥃'
|
|
42
|
+
keywords={['scotch', 'bourbon', 'rye']}
|
|
43
|
+
label='⌘W'
|
|
44
|
+
/>
|
|
45
|
+
</Dropdown.Section>
|
|
46
|
+
|
|
47
|
+
<Dropdown.Section title='Non-Alcoholic'>
|
|
48
|
+
<Dropdown.Item
|
|
49
|
+
value='coffee'
|
|
50
|
+
title='Coffee'
|
|
51
|
+
icon='☕'
|
|
52
|
+
keywords={['espresso', 'latte', 'cappuccino']}
|
|
53
|
+
label='⌃C'
|
|
54
|
+
/>
|
|
55
|
+
<Dropdown.Item
|
|
56
|
+
value='tea'
|
|
57
|
+
title='Tea'
|
|
58
|
+
icon='🍵'
|
|
59
|
+
keywords={['green', 'black', 'herbal']}
|
|
60
|
+
label='⌃T'
|
|
61
|
+
/>
|
|
62
|
+
<Dropdown.Item
|
|
63
|
+
value='juice'
|
|
64
|
+
title='Juice'
|
|
65
|
+
icon='🧃'
|
|
66
|
+
keywords={['orange', 'apple', 'grape']}
|
|
67
|
+
/>
|
|
68
|
+
<Dropdown.Item
|
|
69
|
+
value='water'
|
|
70
|
+
title='Water'
|
|
71
|
+
icon='💧'
|
|
72
|
+
keywords={['sparkling', 'still', 'mineral']}
|
|
73
|
+
/>
|
|
74
|
+
</Dropdown.Section>
|
|
75
|
+
|
|
76
|
+
<Dropdown.Section title='Soft Drinks'>
|
|
77
|
+
<Dropdown.Item
|
|
78
|
+
value='cola'
|
|
79
|
+
title='Cola'
|
|
80
|
+
icon='🥤'
|
|
81
|
+
keywords={['coke', 'pepsi', 'soda']}
|
|
82
|
+
label='⌃O'
|
|
83
|
+
/>
|
|
84
|
+
<Dropdown.Item
|
|
85
|
+
value='lemonade'
|
|
86
|
+
title='Lemonade'
|
|
87
|
+
icon='🍋'
|
|
88
|
+
keywords={['lemon', 'citrus', 'sweet']}
|
|
89
|
+
/>
|
|
90
|
+
</Dropdown.Section>
|
|
91
|
+
</Dropdown>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
renderWithProviders(<App />)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Form, Action, ActionPanel } from 'termcast'
|
|
2
|
+
import { showToast, Toast } from 'termcast'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { renderWithProviders } from '../utils'
|
|
5
|
+
|
|
6
|
+
const SimpleFilePicker = () => {
|
|
7
|
+
const [submittedFiles, setSubmittedFiles] = useState<string[]>([])
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Form
|
|
11
|
+
actions={
|
|
12
|
+
<ActionPanel>
|
|
13
|
+
<Action.SubmitForm
|
|
14
|
+
title='Submit Files'
|
|
15
|
+
onSubmit={(values) => {
|
|
16
|
+
const files = values.files as string[]
|
|
17
|
+
setSubmittedFiles(files)
|
|
18
|
+
showToast({
|
|
19
|
+
style: Toast.Style.Success,
|
|
20
|
+
title: 'Files Selected',
|
|
21
|
+
message:
|
|
22
|
+
files.length > 0
|
|
23
|
+
? `Selected ${files.length} file(s)`
|
|
24
|
+
: 'No files selected',
|
|
25
|
+
})
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
</ActionPanel>
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
<Form.TextField
|
|
32
|
+
id='name'
|
|
33
|
+
title='Your Name'
|
|
34
|
+
placeholder='Enter your name'
|
|
35
|
+
defaultValue='John Doe'
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<Form.FilePicker
|
|
39
|
+
id='files'
|
|
40
|
+
title='Select Files'
|
|
41
|
+
info='Choose one or more files to upload'
|
|
42
|
+
allowMultipleSelection={true}
|
|
43
|
+
canChooseFiles={true}
|
|
44
|
+
canChooseDirectories={false}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<Form.FilePicker
|
|
48
|
+
id='folder'
|
|
49
|
+
title='Select Folder'
|
|
50
|
+
info='Choose a folder for output'
|
|
51
|
+
allowMultipleSelection={false}
|
|
52
|
+
canChooseFiles={false}
|
|
53
|
+
canChooseDirectories={true}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<Form.FilePicker
|
|
57
|
+
id='singleFile'
|
|
58
|
+
title='Select Single File'
|
|
59
|
+
info='Choose exactly one file'
|
|
60
|
+
allowMultipleSelection={false}
|
|
61
|
+
canChooseFiles={true}
|
|
62
|
+
canChooseDirectories={false}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
{submittedFiles.length > 0 && (
|
|
66
|
+
<Form.Description
|
|
67
|
+
title='Last Submitted Files'
|
|
68
|
+
text={submittedFiles.join('\n')}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
</Form>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
renderWithProviders(<SimpleFilePicker />)
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
2
|
+
import { NodeTuiDriver } from 'termcast/src/e2e-node'
|
|
3
|
+
|
|
4
|
+
let driver: NodeTuiDriver
|
|
5
|
+
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
driver = new NodeTuiDriver('bun', ['src/examples/simple-file-picker.tsx'], {
|
|
8
|
+
cols: 70,
|
|
9
|
+
rows: 50,
|
|
10
|
+
})
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
driver?.dispose()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('file picker with autocomplete', async () => {
|
|
18
|
+
await driver.text({
|
|
19
|
+
waitFor: (text) => {
|
|
20
|
+
// wait for form to show up
|
|
21
|
+
return /Your Name/i.test(text)
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const initialSnapshot = await driver.text()
|
|
26
|
+
expect(initialSnapshot).toMatchInlineSnapshot(`
|
|
27
|
+
"
|
|
28
|
+
|
|
29
|
+
◆ Your Name
|
|
30
|
+
│ John Doe
|
|
31
|
+
◇ Select Files
|
|
32
|
+
│ Enter file path...
|
|
33
|
+
│ Choose one or more files to upload
|
|
34
|
+
│
|
|
35
|
+
◇ Select Folder
|
|
36
|
+
│ Enter file path...
|
|
37
|
+
│ Choose a folder for output
|
|
38
|
+
│
|
|
39
|
+
◇ Select Single File
|
|
40
|
+
│ Enter file path...
|
|
41
|
+
│ Choose exactly one file
|
|
42
|
+
│
|
|
43
|
+
└
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
47
|
+
`)
|
|
48
|
+
|
|
49
|
+
// Tab to navigate to file picker field
|
|
50
|
+
await driver.keys.tab()
|
|
51
|
+
await driver.keys.tab()
|
|
52
|
+
|
|
53
|
+
// Type "src" to trigger autocomplete
|
|
54
|
+
await driver.keys.type('src')
|
|
55
|
+
|
|
56
|
+
// Wait for autocomplete to appear
|
|
57
|
+
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
58
|
+
|
|
59
|
+
const autocompleteSnapshot = await driver.text()
|
|
60
|
+
expect(autocompleteSnapshot).toMatchInlineSnapshot(`
|
|
61
|
+
"
|
|
62
|
+
|
|
63
|
+
◇ Your Name
|
|
64
|
+
│ John Doe
|
|
65
|
+
◇ Select Files
|
|
66
|
+
│ Enter file path...
|
|
67
|
+
│ Choose one or more files to upload
|
|
68
|
+
│
|
|
69
|
+
◆ Select Folder
|
|
70
|
+
│ src
|
|
71
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
72
|
+
│ │ 📁a src │
|
|
73
|
+
◇ Select─Single─File────────────────────────────────────────────┘
|
|
74
|
+
│ Enter file path...
|
|
75
|
+
│ Choose exactly one file
|
|
76
|
+
│
|
|
77
|
+
└
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
81
|
+
`)
|
|
82
|
+
|
|
83
|
+
// Navigate down in autocomplete
|
|
84
|
+
await driver.keys.down()
|
|
85
|
+
|
|
86
|
+
const afterDownSnapshot = await driver.text()
|
|
87
|
+
expect(afterDownSnapshot).toMatchInlineSnapshot(`
|
|
88
|
+
"
|
|
89
|
+
|
|
90
|
+
◇ Your Name
|
|
91
|
+
│ John Doe
|
|
92
|
+
◇ Select Files
|
|
93
|
+
│ Enter file path...
|
|
94
|
+
│ Choose one or more files to upload
|
|
95
|
+
│
|
|
96
|
+
◆ Select Folder
|
|
97
|
+
│ src
|
|
98
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
99
|
+
│ │ 📁a src │
|
|
100
|
+
◇ Select─Single─File────────────────────────────────────────────┘
|
|
101
|
+
│ Enter file path...
|
|
102
|
+
│ Choose exactly one file
|
|
103
|
+
│
|
|
104
|
+
└
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
108
|
+
`)
|
|
109
|
+
|
|
110
|
+
// Select item with Enter
|
|
111
|
+
await driver.keys.enter()
|
|
112
|
+
|
|
113
|
+
const afterSelectSnapshot = await driver.text()
|
|
114
|
+
expect(afterSelectSnapshot).toMatchInlineSnapshot(`
|
|
115
|
+
"
|
|
116
|
+
|
|
117
|
+
◇ Your Name
|
|
118
|
+
│ John Doe
|
|
119
|
+
◇ Select Files
|
|
120
|
+
│ Enter file path...
|
|
121
|
+
│ Choose one or more files to upload
|
|
122
|
+
│
|
|
123
|
+
◆ Select Folder
|
|
124
|
+
│ src/
|
|
125
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
126
|
+
│ │ 📁a apis │
|
|
127
|
+
◇ SelectoSingletFile │
|
|
128
|
+
│ Enterefilelpath... │
|
|
129
|
+
│ Choosexexactlysone file │
|
|
130
|
+
│ │ hooks │
|
|
131
|
+
└ │ 📁 internal │
|
|
132
|
+
│ 📁 store-api │
|
|
133
|
+
│ utils │
|
|
134
|
+
↵ submitcti↑↓-navigatex──^k─actions─────────────────────────────┘
|
|
135
|
+
📄 build.test.tsx"
|
|
136
|
+
`)
|
|
137
|
+
|
|
138
|
+
// Clear and test absolute path
|
|
139
|
+
await driver.keys.backspace()
|
|
140
|
+
await driver.keys.backspace()
|
|
141
|
+
await driver.keys.backspace()
|
|
142
|
+
await driver.keys.type('/tmp')
|
|
143
|
+
|
|
144
|
+
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
145
|
+
|
|
146
|
+
const absolutePathSnapshot = await driver.text()
|
|
147
|
+
expect(absolutePathSnapshot).toMatchInlineSnapshot(`
|
|
148
|
+
"
|
|
149
|
+
|
|
150
|
+
◇ Your Name
|
|
151
|
+
│ John Doe
|
|
152
|
+
◇ Select Files
|
|
153
|
+
│ Enter file path...
|
|
154
|
+
│ Choose one or more files to upload
|
|
155
|
+
│
|
|
156
|
+
◆ Select Folder
|
|
157
|
+
│ /tmp/
|
|
158
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
159
|
+
│ │ 📁 bunx-501-@alignui │
|
|
160
|
+
◇ SelectuSingle-Fileeya │
|
|
161
|
+
│ Enterbfile5path...elcontextprotocol │
|
|
162
|
+
│ Chooseuexactly@onecfile │
|
|
163
|
+
│ │ bunx-501-npkill@latest │
|
|
164
|
+
└ │ 📁 com.apple.launchd.D0VRoDoOHk │
|
|
165
|
+
│ 📁 com.apple.launchd.i00Yz9AggD │
|
|
166
|
+
│ node-compile-cache │
|
|
167
|
+
↵ submitode↑↓inavigate───^k─actions─────────────────────────────┘
|
|
168
|
+
📁 powerlog"
|
|
169
|
+
`)
|
|
170
|
+
|
|
171
|
+
// Test ~ home directory expansion
|
|
172
|
+
await driver.keys.backspace()
|
|
173
|
+
await driver.keys.backspace()
|
|
174
|
+
await driver.keys.backspace()
|
|
175
|
+
await driver.keys.backspace()
|
|
176
|
+
await driver.keys.type('~/')
|
|
177
|
+
|
|
178
|
+
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
179
|
+
|
|
180
|
+
const homeDirectorySnapshot = await driver.text()
|
|
181
|
+
expect(homeDirectorySnapshot).toMatchInlineSnapshot(`
|
|
182
|
+
"
|
|
183
|
+
|
|
184
|
+
◇ Your Name
|
|
185
|
+
│ John Doe
|
|
186
|
+
◇ Select Files
|
|
187
|
+
│ Enter file path...
|
|
188
|
+
│ Choose one or more files to upload
|
|
189
|
+
│
|
|
190
|
+
◆ Select Folder
|
|
191
|
+
│ ~//
|
|
192
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
193
|
+
│ │ 📁a Applications │
|
|
194
|
+
◇ SelectwSingle File │
|
|
195
|
+
│ Entercfileepath... │
|
|
196
|
+
│ Chooseoexactly_one_filee │
|
|
197
|
+
│ │ conductor │
|
|
198
|
+
└ │ 📁 Desktop │
|
|
199
|
+
│ 📁 Documents │
|
|
200
|
+
│ Downloads │
|
|
201
|
+
↵ submityad↑↓pnavigate───^k─actions─────────────────────────────┘
|
|
202
|
+
📁 example-pnpm-pubcket"
|
|
203
|
+
`)
|
|
204
|
+
}, 15000)
|
|
205
|
+
|
|
206
|
+
test('file picker keyboard navigation', async () => {
|
|
207
|
+
await driver.text({
|
|
208
|
+
waitFor: (text) => {
|
|
209
|
+
return /Your Name/i.test(text)
|
|
210
|
+
},
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
// Tab to file picker
|
|
214
|
+
await driver.keys.tab()
|
|
215
|
+
await driver.keys.tab()
|
|
216
|
+
|
|
217
|
+
// Type to trigger autocomplete
|
|
218
|
+
await driver.keys.type('.')
|
|
219
|
+
|
|
220
|
+
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
221
|
+
|
|
222
|
+
const withDotSnapshot = await driver.text()
|
|
223
|
+
expect(withDotSnapshot).toMatchInlineSnapshot(`
|
|
224
|
+
"
|
|
225
|
+
|
|
226
|
+
◇ Your Name
|
|
227
|
+
│ John Doe
|
|
228
|
+
◇ Select Files
|
|
229
|
+
│ Enter file path...
|
|
230
|
+
│ Choose one or more files to upload
|
|
231
|
+
│
|
|
232
|
+
◆ Select Folder
|
|
233
|
+
│ .
|
|
234
|
+
│ ┌─────────────────────────────────────────────────────────────┐
|
|
235
|
+
│ │ 📁 .termcast-bundle │
|
|
236
|
+
◇ SelectgSinglerFile │
|
|
237
|
+
│ Enter─file─path...────────────────────────────────────────────┘
|
|
238
|
+
│ Choose exactly one file
|
|
239
|
+
│
|
|
240
|
+
└
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
244
|
+
`)
|
|
245
|
+
|
|
246
|
+
// Test escape key to close autocomplete
|
|
247
|
+
await driver.keys.escape()
|
|
248
|
+
|
|
249
|
+
const afterEscapeSnapshot = await driver.text()
|
|
250
|
+
expect(afterEscapeSnapshot).toMatchInlineSnapshot(`
|
|
251
|
+
"
|
|
252
|
+
|
|
253
|
+
◇ Your Name
|
|
254
|
+
│ John Doe
|
|
255
|
+
◇ Select Files
|
|
256
|
+
│ Enter file path...
|
|
257
|
+
│ Choose one or more files to upload
|
|
258
|
+
│
|
|
259
|
+
◆ Select Folder
|
|
260
|
+
│ .
|
|
261
|
+
│ Choose a folder for output
|
|
262
|
+
│
|
|
263
|
+
◇ Select Single File
|
|
264
|
+
│ Enter file path...
|
|
265
|
+
│ Choose exactly one file
|
|
266
|
+
│
|
|
267
|
+
└
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
271
|
+
`)
|
|
272
|
+
|
|
273
|
+
// Type again and navigate with arrows
|
|
274
|
+
await driver.keys.type('s')
|
|
275
|
+
|
|
276
|
+
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
277
|
+
|
|
278
|
+
// Navigate down multiple times
|
|
279
|
+
await driver.keys.down()
|
|
280
|
+
await driver.keys.down()
|
|
281
|
+
await driver.keys.up()
|
|
282
|
+
|
|
283
|
+
const afterNavigationSnapshot = await driver.text()
|
|
284
|
+
expect(afterNavigationSnapshot).toMatchInlineSnapshot(`
|
|
285
|
+
"
|
|
286
|
+
|
|
287
|
+
◇ Your Name
|
|
288
|
+
│ John Doe
|
|
289
|
+
◇ Select Files
|
|
290
|
+
│ Enter file path...
|
|
291
|
+
│ Choose one or more files to upload
|
|
292
|
+
│
|
|
293
|
+
◆ Select Folder
|
|
294
|
+
│ .s
|
|
295
|
+
│ Choose a folder for output
|
|
296
|
+
│
|
|
297
|
+
◇ Select Single File
|
|
298
|
+
│ Enter file path...
|
|
299
|
+
│ Choose exactly one file
|
|
300
|
+
│
|
|
301
|
+
└
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
↵ submit ↑↓ navigate ^k actions"
|
|
305
|
+
`)
|
|
306
|
+
}, 10000)
|