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
package/src/e2e-node.tsx
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// TODO node-pty has bugs, not all text is shown
|
|
2
|
+
|
|
3
|
+
import * as pty from 'node-pty'
|
|
4
|
+
import { Terminal } from '@xterm/headless'
|
|
5
|
+
import { SerializeAddon } from '@xterm/addon-serialize'
|
|
6
|
+
|
|
7
|
+
export class NodeTuiDriver {
|
|
8
|
+
private pty?: pty.IPty
|
|
9
|
+
private term: Terminal
|
|
10
|
+
private serialize: SerializeAddon
|
|
11
|
+
private cols: number
|
|
12
|
+
private rows: number
|
|
13
|
+
private idleResolvers: Array<() => void> = []
|
|
14
|
+
private idleTimer?: NodeJS.Timeout
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
private cmd: string,
|
|
18
|
+
private args: string[] = [],
|
|
19
|
+
{
|
|
20
|
+
cols = 80,
|
|
21
|
+
rows = 24,
|
|
22
|
+
cwd = process.cwd(),
|
|
23
|
+
env = process.env,
|
|
24
|
+
}: {
|
|
25
|
+
cols?: number
|
|
26
|
+
rows?: number
|
|
27
|
+
cwd?: string
|
|
28
|
+
env?: NodeJS.ProcessEnv
|
|
29
|
+
} = {},
|
|
30
|
+
) {
|
|
31
|
+
this.cols = cols
|
|
32
|
+
this.rows = rows
|
|
33
|
+
this.term = new Terminal({
|
|
34
|
+
cols,
|
|
35
|
+
rows,
|
|
36
|
+
scrollback: 0,
|
|
37
|
+
allowProposedApi: true,
|
|
38
|
+
minimumContrastRatio: 1,
|
|
39
|
+
drawBoldTextInBrightColors: true,
|
|
40
|
+
allowTransparency: false,
|
|
41
|
+
theme: {
|
|
42
|
+
background: '#000000',
|
|
43
|
+
foreground: '#ffffff',
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
this.serialize = new SerializeAddon()
|
|
47
|
+
this.term.loadAddon(this.serialize)
|
|
48
|
+
|
|
49
|
+
const envWithTerm = {
|
|
50
|
+
...env,
|
|
51
|
+
TERM: 'xterm-truecolor',
|
|
52
|
+
COLORTERM: 'truecolor',
|
|
53
|
+
}
|
|
54
|
+
this.pty = pty.spawn(this.cmd, this.args, {
|
|
55
|
+
name: 'xterm-truecolor',
|
|
56
|
+
cols,
|
|
57
|
+
rows,
|
|
58
|
+
cwd,
|
|
59
|
+
env: envWithTerm as any,
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
this.pty.onData((data) => {
|
|
63
|
+
this.term.write(data)
|
|
64
|
+
clearTimeout(this.idleTimer)
|
|
65
|
+
this.idleTimer = setTimeout(() => {
|
|
66
|
+
const r = this.idleResolvers.splice(0)
|
|
67
|
+
r.forEach((fn) => {
|
|
68
|
+
fn()
|
|
69
|
+
})
|
|
70
|
+
}, 10)
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async waitIdle({ timeout = 100 }: { timeout?: number } = {}) {
|
|
75
|
+
return new Promise<void>((resolve, reject) => {
|
|
76
|
+
if (!this.idleTimer) {
|
|
77
|
+
setTimeout(() => resolve(), 10)
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
const t = setTimeout(() => {
|
|
81
|
+
// console.warn(`reached timeout for waitIdle`)
|
|
82
|
+
resolve() // Just resolve instead of rejecting
|
|
83
|
+
}, timeout)
|
|
84
|
+
this.idleResolvers.push(() => {
|
|
85
|
+
clearTimeout(t)
|
|
86
|
+
resolve()
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async write(data: string) {
|
|
92
|
+
this.pty!.write(data)
|
|
93
|
+
return this.waitIdle()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
keys = {
|
|
97
|
+
enter: () => {
|
|
98
|
+
return this.write('\r')
|
|
99
|
+
},
|
|
100
|
+
esc: () => {
|
|
101
|
+
return this.write('\x1b')
|
|
102
|
+
},
|
|
103
|
+
escape: () => {
|
|
104
|
+
return this.write('\x1b')
|
|
105
|
+
},
|
|
106
|
+
bs: () => {
|
|
107
|
+
return this.write('\x7f')
|
|
108
|
+
},
|
|
109
|
+
backspace: () => {
|
|
110
|
+
return this.write('\x7f')
|
|
111
|
+
},
|
|
112
|
+
up: () => {
|
|
113
|
+
return this.write('\x1b[A')
|
|
114
|
+
},
|
|
115
|
+
down: () => {
|
|
116
|
+
return this.write('\x1b[B')
|
|
117
|
+
},
|
|
118
|
+
right: () => {
|
|
119
|
+
return this.write('\x1b[C')
|
|
120
|
+
},
|
|
121
|
+
left: () => {
|
|
122
|
+
return this.write('\x1b[D')
|
|
123
|
+
},
|
|
124
|
+
tab: () => {
|
|
125
|
+
return this.write('\t')
|
|
126
|
+
},
|
|
127
|
+
ctrlK: () => {
|
|
128
|
+
return this.write('\x0b')
|
|
129
|
+
},
|
|
130
|
+
ctrlP: () => {
|
|
131
|
+
return this.write('\x10')
|
|
132
|
+
},
|
|
133
|
+
ctrlC: () => {
|
|
134
|
+
return this.write('\x03')
|
|
135
|
+
},
|
|
136
|
+
ctrlD: () => {
|
|
137
|
+
return this.write('\x04')
|
|
138
|
+
},
|
|
139
|
+
ctrlZ: () => {
|
|
140
|
+
return this.write('\x1a')
|
|
141
|
+
},
|
|
142
|
+
home: () => {
|
|
143
|
+
return this.write('\x1b[H')
|
|
144
|
+
},
|
|
145
|
+
end: () => {
|
|
146
|
+
return this.write('\x1b[F')
|
|
147
|
+
},
|
|
148
|
+
pageUp: () => {
|
|
149
|
+
return this.write('\x1b[5~')
|
|
150
|
+
},
|
|
151
|
+
pageDown: () => {
|
|
152
|
+
return this.write('\x1b[6~')
|
|
153
|
+
},
|
|
154
|
+
delete: () => {
|
|
155
|
+
return this.write('\x1b[3~')
|
|
156
|
+
},
|
|
157
|
+
space: () => {
|
|
158
|
+
return this.write(' ')
|
|
159
|
+
},
|
|
160
|
+
shiftTab: () => {
|
|
161
|
+
return this.write('\x1b[Z')
|
|
162
|
+
},
|
|
163
|
+
cmdEnter: () => {
|
|
164
|
+
return this.write('\x1b\r')
|
|
165
|
+
},
|
|
166
|
+
ctrlA: () => {
|
|
167
|
+
return this.write('\x01')
|
|
168
|
+
},
|
|
169
|
+
type: async (text: string) => {
|
|
170
|
+
for (const ch of text.split('')) {
|
|
171
|
+
await this.write(ch)
|
|
172
|
+
}
|
|
173
|
+
await this.write('')
|
|
174
|
+
},
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async text(options?: {
|
|
178
|
+
waitFor?: (text: string) => boolean
|
|
179
|
+
timeout?: number
|
|
180
|
+
}): Promise<string> {
|
|
181
|
+
await sleep(10)
|
|
182
|
+
|
|
183
|
+
const timeout = options?.timeout ?? 5000
|
|
184
|
+
const waitFor =
|
|
185
|
+
options?.waitFor ?? ((text: string) => text.trim().length > 0)
|
|
186
|
+
const startTime = Date.now()
|
|
187
|
+
|
|
188
|
+
// Helper function to get the current text
|
|
189
|
+
const getCurrentText = () => {
|
|
190
|
+
const b = this.term.buffer.active
|
|
191
|
+
const lines: string[] = []
|
|
192
|
+
for (let y = 0; y < this.rows; y++) {
|
|
193
|
+
const line = b.getLine(y)?.translateToString(true) ?? ''
|
|
194
|
+
lines.push(line)
|
|
195
|
+
}
|
|
196
|
+
// Remove trailing lines that are only spaces
|
|
197
|
+
let lastNonEmpty = lines.length - 1
|
|
198
|
+
while (lastNonEmpty >= 0 && lines[lastNonEmpty].trim() === '') {
|
|
199
|
+
lastNonEmpty--
|
|
200
|
+
}
|
|
201
|
+
const trimmed = lines.slice(0, lastNonEmpty + 1)
|
|
202
|
+
// Strip leading indentation common to all non-empty lines
|
|
203
|
+
const nonEmpty = trimmed.filter((l) => l.trim().length > 0)
|
|
204
|
+
const leadingSpaces = nonEmpty.length
|
|
205
|
+
? Math.min(
|
|
206
|
+
...nonEmpty.map((l) => {
|
|
207
|
+
const m = l.match(/^\s*/)
|
|
208
|
+
return m ? m[0].length : 0
|
|
209
|
+
}),
|
|
210
|
+
)
|
|
211
|
+
: 0
|
|
212
|
+
const deindented = trimmed.map((l) =>
|
|
213
|
+
l.length >= leadingSpaces ? l.slice(leadingSpaces) : l.trimStart(),
|
|
214
|
+
)
|
|
215
|
+
// Trim right all lines
|
|
216
|
+
const rightTrimmed = deindented.map((l) => l.replace(/\s+$/, ''))
|
|
217
|
+
return rightTrimmed.join('\n')
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// If waitFor is provided, poll until condition is met or timeout
|
|
221
|
+
if (waitFor) {
|
|
222
|
+
while (Date.now() - startTime < timeout) {
|
|
223
|
+
await this.waitIdle({ timeout: 100 })
|
|
224
|
+
const text = getCurrentText()
|
|
225
|
+
if (waitFor(text)) {
|
|
226
|
+
return text
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return getCurrentText()
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// await this.waitIdle({ timeout: 200 })
|
|
234
|
+
return getCurrentText()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
vt(): string {
|
|
238
|
+
return this.serialize.serialize()
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
resize({ cols, rows }: { cols: number; rows: number }) {
|
|
242
|
+
this.cols = cols
|
|
243
|
+
this.rows = rows
|
|
244
|
+
this.term.resize(cols, rows)
|
|
245
|
+
this.pty!.resize(cols, rows)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
click(x: number, y: number) {
|
|
249
|
+
// Send mouse click escape sequence
|
|
250
|
+
// ESC[<0;x;yM for button press, ESC[<0;x;ym for button release
|
|
251
|
+
// x and y are 1-based in the terminal protocol
|
|
252
|
+
const xPos = x + 1
|
|
253
|
+
const yPos = y + 1
|
|
254
|
+
// Button press (0 = left button)
|
|
255
|
+
this.pty!.write(`\x1b[<0;${xPos};${yPos}M`)
|
|
256
|
+
// Button release
|
|
257
|
+
return this.write(`\x1b[<0;${xPos};${yPos}m`)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async clickText(
|
|
261
|
+
pattern: string | RegExp,
|
|
262
|
+
options?: { timeout?: number },
|
|
263
|
+
): Promise<void> {
|
|
264
|
+
const timeout = options?.timeout ?? 5000
|
|
265
|
+
const startTime = Date.now()
|
|
266
|
+
const regex =
|
|
267
|
+
typeof pattern === 'string'
|
|
268
|
+
? new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
|
|
269
|
+
: pattern
|
|
270
|
+
|
|
271
|
+
while (Date.now() - startTime < timeout) {
|
|
272
|
+
await this.waitIdle({ timeout: 100 })
|
|
273
|
+
|
|
274
|
+
// Get the current buffer state
|
|
275
|
+
const b = this.term.buffer.active
|
|
276
|
+
|
|
277
|
+
// Search through each line for the pattern
|
|
278
|
+
for (let y = 0; y < this.rows; y++) {
|
|
279
|
+
const line = b.getLine(y)?.translateToString(true) ?? ''
|
|
280
|
+
const match = line.match(regex)
|
|
281
|
+
|
|
282
|
+
if (match && match.index !== undefined) {
|
|
283
|
+
// Found the text, click on the first character
|
|
284
|
+
await this.click(match.index, y)
|
|
285
|
+
return
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
throw new Error(
|
|
291
|
+
`Text matching pattern "${pattern}" not found within ${timeout}ms`,
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
dispose() {
|
|
296
|
+
this.pty?.kill()
|
|
297
|
+
this.term.dispose()
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function sleep(ms: number): Promise<void> {
|
|
302
|
+
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
303
|
+
}
|
package/src/e2e.tsx
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { spawn, type IPty } from 'bun-pty'
|
|
2
|
+
import { Terminal } from '@xterm/headless'
|
|
3
|
+
import { SerializeAddon } from '@xterm/addon-serialize'
|
|
4
|
+
|
|
5
|
+
export class TuiDriver {
|
|
6
|
+
private pty?: IPty
|
|
7
|
+
private term: Terminal
|
|
8
|
+
private serialize: SerializeAddon
|
|
9
|
+
private cols: number
|
|
10
|
+
private rows: number
|
|
11
|
+
private idleResolvers: Array<() => void> = []
|
|
12
|
+
private idleTimer?: NodeJS.Timeout
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
private cmd: string,
|
|
16
|
+
private args: string[] = [],
|
|
17
|
+
{
|
|
18
|
+
cols = 80,
|
|
19
|
+
rows = 24,
|
|
20
|
+
cwd = process.cwd(),
|
|
21
|
+
env = process.env,
|
|
22
|
+
}: {
|
|
23
|
+
cols?: number
|
|
24
|
+
rows?: number
|
|
25
|
+
cwd?: string
|
|
26
|
+
env?: NodeJS.ProcessEnv
|
|
27
|
+
} = {},
|
|
28
|
+
) {
|
|
29
|
+
this.cols = cols
|
|
30
|
+
this.rows = rows
|
|
31
|
+
this.term = new Terminal({
|
|
32
|
+
cols,
|
|
33
|
+
rows,
|
|
34
|
+
scrollback: 0,
|
|
35
|
+
allowProposedApi: true,
|
|
36
|
+
minimumContrastRatio: 1,
|
|
37
|
+
drawBoldTextInBrightColors: true,
|
|
38
|
+
allowTransparency: false,
|
|
39
|
+
theme: {
|
|
40
|
+
background: '#000000',
|
|
41
|
+
foreground: '#ffffff',
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
this.serialize = new SerializeAddon()
|
|
45
|
+
this.term.loadAddon(this.serialize)
|
|
46
|
+
|
|
47
|
+
env = { ...env, TERM: 'xterm-truecolor', COLORTERM: 'truecolor' }
|
|
48
|
+
this.pty = spawn(this.cmd, this.args, {
|
|
49
|
+
name: 'xterm-truecolor',
|
|
50
|
+
cols,
|
|
51
|
+
rows,
|
|
52
|
+
cwd,
|
|
53
|
+
env: env as any,
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
this.pty.onData((data) => {
|
|
57
|
+
this.term.write(data)
|
|
58
|
+
clearTimeout(this.idleTimer)
|
|
59
|
+
this.idleTimer = setTimeout(() => {
|
|
60
|
+
const r = this.idleResolvers.splice(0)
|
|
61
|
+
r.forEach((fn) => {
|
|
62
|
+
fn()
|
|
63
|
+
})
|
|
64
|
+
}, 50)
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async waitIdle({ timeout = 500 }: { timeout?: number } = {}) {
|
|
69
|
+
return new Promise<void>((resolve, reject) => {
|
|
70
|
+
if (!this.idleTimer) {
|
|
71
|
+
setTimeout(() => resolve(), 100)
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const t = setTimeout(() => {
|
|
75
|
+
reject(new Error('waitIdle timeout'))
|
|
76
|
+
}, timeout)
|
|
77
|
+
this.idleResolvers.push(() => {
|
|
78
|
+
clearTimeout(t)
|
|
79
|
+
resolve()
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async write(data: string) {
|
|
85
|
+
this.pty!.write(data)
|
|
86
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
87
|
+
return this.waitIdle()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
keys = {
|
|
91
|
+
enter: () => {
|
|
92
|
+
return this.write('\r')
|
|
93
|
+
},
|
|
94
|
+
esc: () => {
|
|
95
|
+
return this.write('\x1b')
|
|
96
|
+
},
|
|
97
|
+
bs: () => {
|
|
98
|
+
return this.write('\x7f')
|
|
99
|
+
},
|
|
100
|
+
up: () => {
|
|
101
|
+
return this.write('\x1b[A')
|
|
102
|
+
},
|
|
103
|
+
down: () => {
|
|
104
|
+
return this.write('\x1b[B')
|
|
105
|
+
},
|
|
106
|
+
right: () => {
|
|
107
|
+
return this.write('\x1b[C')
|
|
108
|
+
},
|
|
109
|
+
left: () => {
|
|
110
|
+
return this.write('\x1b[D')
|
|
111
|
+
},
|
|
112
|
+
tab: () => {
|
|
113
|
+
return this.write('\t')
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
text(): string {
|
|
118
|
+
const b = this.term.buffer.active
|
|
119
|
+
const lines: string[] = []
|
|
120
|
+
for (let y = 0; y < this.rows; y++) {
|
|
121
|
+
const line = b.getLine(y)?.translateToString(false) ?? ''
|
|
122
|
+
lines.push(line)
|
|
123
|
+
}
|
|
124
|
+
// Remove trailing lines that are only spaces
|
|
125
|
+
let lastNonEmpty = lines.length - 1
|
|
126
|
+
while (lastNonEmpty >= 0 && lines[lastNonEmpty].trim() === '') {
|
|
127
|
+
lastNonEmpty--
|
|
128
|
+
}
|
|
129
|
+
return lines.slice(0, lastNonEmpty + 1).join('\n')
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
vt(): string {
|
|
133
|
+
return this.serialize.serialize()
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
resize({ cols, rows }: { cols: number; rows: number }) {
|
|
137
|
+
this.cols = cols
|
|
138
|
+
this.rows = rows
|
|
139
|
+
this.term.resize(cols, rows)
|
|
140
|
+
this.pty!.resize(cols, rows)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
dispose() {
|
|
144
|
+
this.pty?.kill()
|
|
145
|
+
this.term.dispose()
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { List, Action, ActionPanel } from 'termcast'
|
|
3
|
+
import { renderWithProviders } from 'termcast'
|
|
4
|
+
import { homedir } from 'os'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
|
|
7
|
+
function ShowInFinderExample(): any {
|
|
8
|
+
const DOWNLOADS_DIR = path.join(homedir(), 'Downloads')
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<List>
|
|
12
|
+
<List.Section title='Action.ShowInFinder Examples'>
|
|
13
|
+
<List.Item
|
|
14
|
+
title='Show Downloads Folder'
|
|
15
|
+
subtitle='Reveal your Downloads folder in Finder'
|
|
16
|
+
actions={
|
|
17
|
+
<ActionPanel>
|
|
18
|
+
<Action.ShowInFinder
|
|
19
|
+
path={DOWNLOADS_DIR}
|
|
20
|
+
title='Show Downloads'
|
|
21
|
+
icon='📁'
|
|
22
|
+
shortcut={{ modifiers: ['cmd'], key: 'd' }}
|
|
23
|
+
/>
|
|
24
|
+
</ActionPanel>
|
|
25
|
+
}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<List.Item
|
|
29
|
+
title='Show Home Directory'
|
|
30
|
+
subtitle='Reveal your home directory'
|
|
31
|
+
actions={
|
|
32
|
+
<ActionPanel>
|
|
33
|
+
<Action.ShowInFinder
|
|
34
|
+
path={homedir()}
|
|
35
|
+
title='Show Home'
|
|
36
|
+
icon='🏠'
|
|
37
|
+
shortcut={{ modifiers: ['cmd'], key: 'h' }}
|
|
38
|
+
/>
|
|
39
|
+
</ActionPanel>
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<List.Item
|
|
44
|
+
title='Show Package.json'
|
|
45
|
+
subtitle='Reveal the package.json file'
|
|
46
|
+
actions={
|
|
47
|
+
<ActionPanel>
|
|
48
|
+
<Action.ShowInFinder
|
|
49
|
+
path='package.json'
|
|
50
|
+
title='Show package.json'
|
|
51
|
+
icon='📦'
|
|
52
|
+
shortcut={{ modifiers: ['cmd'], key: 'p' }}
|
|
53
|
+
onShow={(path) => {
|
|
54
|
+
console.log(`Revealed: ${path}`)
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
</ActionPanel>
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<List.Item
|
|
62
|
+
title='Show Current Directory'
|
|
63
|
+
subtitle='Reveal the current working directory'
|
|
64
|
+
actions={
|
|
65
|
+
<ActionPanel>
|
|
66
|
+
<Action.ShowInFinder
|
|
67
|
+
path={process.cwd()}
|
|
68
|
+
title='Show Current Dir'
|
|
69
|
+
icon='📂'
|
|
70
|
+
shortcut={{ modifiers: ['cmd'], key: '.' }}
|
|
71
|
+
/>
|
|
72
|
+
</ActionPanel>
|
|
73
|
+
}
|
|
74
|
+
/>
|
|
75
|
+
</List.Section>
|
|
76
|
+
</List>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
renderWithProviders(<ShowInFinderExample />)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { List, environment, Toast, showToast } from 'termcast'
|
|
3
|
+
import { renderWithProviders } from 'termcast'
|
|
4
|
+
|
|
5
|
+
function EnvironmentExample(): any {
|
|
6
|
+
const handleShowEnvironment = async () => {
|
|
7
|
+
const envInfo = `
|
|
8
|
+
Raycast Version: ${environment.raycastVersion}
|
|
9
|
+
Extension: ${environment.extensionName}
|
|
10
|
+
Command: ${environment.commandName}
|
|
11
|
+
Theme: ${environment.appearance}
|
|
12
|
+
Text Size: ${environment.textSize}
|
|
13
|
+
Is Development: ${environment.isDevelopment}
|
|
14
|
+
Launch Type: ${environment.launchType}
|
|
15
|
+
Owner/Author: ${environment.ownerOrAuthorName}
|
|
16
|
+
Support Path: ${environment.supportPath}
|
|
17
|
+
Assets Path: ${environment.assetsPath}
|
|
18
|
+
Command Mode: ${environment.commandMode}
|
|
19
|
+
`.trim()
|
|
20
|
+
|
|
21
|
+
await showToast(Toast.Style.Success, 'Environment Info', envInfo)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<List>
|
|
26
|
+
<List.Item
|
|
27
|
+
title='Show Environment Info'
|
|
28
|
+
subtitle={`Current theme: ${environment.appearance}`}
|
|
29
|
+
actions={
|
|
30
|
+
<ActionPanel>
|
|
31
|
+
<Action title='Show Details' onAction={handleShowEnvironment} />
|
|
32
|
+
</ActionPanel>
|
|
33
|
+
}
|
|
34
|
+
/>
|
|
35
|
+
<List.Item title='Extension Name' subtitle={environment.extensionName} />
|
|
36
|
+
<List.Item
|
|
37
|
+
title='Development Mode'
|
|
38
|
+
subtitle={environment.isDevelopment ? 'Yes' : 'No'}
|
|
39
|
+
/>
|
|
40
|
+
<List.Item title='Launch Type' subtitle={environment.launchType} />
|
|
41
|
+
</List>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Import ActionPanel and Action to use them
|
|
46
|
+
import { ActionPanel, Action } from 'termcast'
|
|
47
|
+
|
|
48
|
+
if (require.main === module) {
|
|
49
|
+
renderWithProviders(<EnvironmentExample />)
|
|
50
|
+
}
|