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,146 @@
|
|
|
1
|
+
// curl -H 'accept: application/json' \
|
|
2
|
+
// -H 'content-type: application/json' \
|
|
3
|
+
// -H 'user-agent: Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))' \
|
|
4
|
+
// -H 'authorization: Bearer REDACTED' \
|
|
5
|
+
// -H 'accept-language: en-GB,en;q=0.9' \
|
|
6
|
+
// 'https://backend.raycast.com/api/v1/store_listings/search?per_page=25&q=notion&include_native=true&page=1&platform=macOS'
|
|
7
|
+
|
|
8
|
+
export async function searchStoreListings({
|
|
9
|
+
query,
|
|
10
|
+
page = 1,
|
|
11
|
+
perPage = 25,
|
|
12
|
+
includeNative = true,
|
|
13
|
+
platform = 'macOS',
|
|
14
|
+
}: {
|
|
15
|
+
query: string
|
|
16
|
+
page?: number
|
|
17
|
+
perPage?: number
|
|
18
|
+
includeNative?: boolean
|
|
19
|
+
platform?: string
|
|
20
|
+
}): Promise<StoreSearchResponse> {
|
|
21
|
+
const params = new URLSearchParams({
|
|
22
|
+
q: query,
|
|
23
|
+
page: page.toString(),
|
|
24
|
+
per_page: perPage.toString(),
|
|
25
|
+
include_native: includeNative.toString(),
|
|
26
|
+
platform: platform,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const response = await fetch(
|
|
30
|
+
`https://backend.raycast.com/api/v1/store_listings/search?${params}`,
|
|
31
|
+
{
|
|
32
|
+
method: 'GET',
|
|
33
|
+
headers: {
|
|
34
|
+
accept: 'application/json',
|
|
35
|
+
'content-type': 'application/json',
|
|
36
|
+
'user-agent': 'Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))',
|
|
37
|
+
'accept-language': 'en-GB,en;q=0.9',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (await response.json()) as StoreSearchResponse
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface StoreSearchResponse {
|
|
50
|
+
data: StoreListing[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface StoreListing {
|
|
54
|
+
id: string
|
|
55
|
+
name: string
|
|
56
|
+
native_id: string | null
|
|
57
|
+
seo_categories: string[]
|
|
58
|
+
platforms: string[] | null
|
|
59
|
+
created_at: number
|
|
60
|
+
author: User
|
|
61
|
+
owner:
|
|
62
|
+
| User
|
|
63
|
+
| {
|
|
64
|
+
id: string
|
|
65
|
+
name: string
|
|
66
|
+
handle: string
|
|
67
|
+
initials: string
|
|
68
|
+
avatar_placeholder_color: string
|
|
69
|
+
avatar: string
|
|
70
|
+
}
|
|
71
|
+
status: string
|
|
72
|
+
is_new: boolean
|
|
73
|
+
access: string
|
|
74
|
+
store_url: string
|
|
75
|
+
download_count: number
|
|
76
|
+
kill_listed_at: number | null
|
|
77
|
+
title: string
|
|
78
|
+
description: string
|
|
79
|
+
commit_sha: string
|
|
80
|
+
relative_path: string
|
|
81
|
+
api_version: string
|
|
82
|
+
categories: string[]
|
|
83
|
+
prompt_examples: string[]
|
|
84
|
+
metadata_count: number
|
|
85
|
+
updated_at: number
|
|
86
|
+
source_url: string
|
|
87
|
+
readme_url: string
|
|
88
|
+
readme_assets_path: string
|
|
89
|
+
icons: {
|
|
90
|
+
light: string | null
|
|
91
|
+
dark: string | null
|
|
92
|
+
}
|
|
93
|
+
download_url: string
|
|
94
|
+
commands: Command[]
|
|
95
|
+
contributors: User[]
|
|
96
|
+
tools: Tool[]
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface User {
|
|
100
|
+
name: string
|
|
101
|
+
handle: string
|
|
102
|
+
bio: string | null
|
|
103
|
+
twitter_handle: string | null
|
|
104
|
+
github_handle: string | null
|
|
105
|
+
location: string | null
|
|
106
|
+
initials: string
|
|
107
|
+
avatar_placeholder_color: string
|
|
108
|
+
slack_community_username: string | null
|
|
109
|
+
slack_community_user_id: string | null
|
|
110
|
+
website_anchor: string | null
|
|
111
|
+
created_at: number
|
|
112
|
+
website: string | null
|
|
113
|
+
username: string
|
|
114
|
+
avatar: string | null
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface Command {
|
|
118
|
+
id: string
|
|
119
|
+
name: string
|
|
120
|
+
title: string
|
|
121
|
+
subtitle: string
|
|
122
|
+
description: string
|
|
123
|
+
keywords: string[]
|
|
124
|
+
mode: string
|
|
125
|
+
disabled_by_default: boolean
|
|
126
|
+
beta: boolean
|
|
127
|
+
icons: {
|
|
128
|
+
light: string | null
|
|
129
|
+
dark: string | null
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface Tool {
|
|
134
|
+
id: string
|
|
135
|
+
name: string
|
|
136
|
+
title: string
|
|
137
|
+
description: string
|
|
138
|
+
keywords: string[]
|
|
139
|
+
functionalities: unknown[]
|
|
140
|
+
mode: string | null
|
|
141
|
+
side_effects: boolean
|
|
142
|
+
icons: {
|
|
143
|
+
light: string | null
|
|
144
|
+
dark: string | null
|
|
145
|
+
}
|
|
146
|
+
}
|
package/src/theme.tsx
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const Theme = {
|
|
2
|
+
// Text colors
|
|
3
|
+
text: '#FFFFFF',
|
|
4
|
+
textMuted: '#999999',
|
|
5
|
+
|
|
6
|
+
// Background colors
|
|
7
|
+
background: '#000000',
|
|
8
|
+
backgroundPanel: '#1E1E1E', // Dark gray panel background
|
|
9
|
+
|
|
10
|
+
// Primary/accent colors
|
|
11
|
+
primary: '#0080FF', // Blue
|
|
12
|
+
accent: '#00FF80', // Light green (was using this for dates)
|
|
13
|
+
|
|
14
|
+
// Accessory colors (from List component)
|
|
15
|
+
info: '#0080FF', // Blue for text accessories
|
|
16
|
+
success: '#00FF80', // Green for date accessories
|
|
17
|
+
warning: '#FF8000', // Orange for tag accessories
|
|
18
|
+
error: '#FF0000', // Red for errors
|
|
19
|
+
|
|
20
|
+
// Additional UI colors
|
|
21
|
+
border: '#333333',
|
|
22
|
+
highlight: '#0080FF',
|
|
23
|
+
selected: '#0080FF',
|
|
24
|
+
yellow: '#FFFF00', // Yellow for icons
|
|
25
|
+
link: '#0080FF', // Blue for links
|
|
26
|
+
|
|
27
|
+
// Transparent
|
|
28
|
+
transparent: undefined, // Use undefined for no background color
|
|
29
|
+
} as const
|
|
30
|
+
|
|
31
|
+
export default Theme
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as fs from 'fs/promises'
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
import * as os from 'os'
|
|
4
|
+
|
|
5
|
+
export interface FileSystemItem {
|
|
6
|
+
name: string
|
|
7
|
+
path: string
|
|
8
|
+
isDirectory: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function searchFiles(
|
|
12
|
+
searchPath: string,
|
|
13
|
+
prefix: string,
|
|
14
|
+
): Promise<FileSystemItem[]> {
|
|
15
|
+
try {
|
|
16
|
+
// Resolve ~ to home directory
|
|
17
|
+
if (searchPath.startsWith('~')) {
|
|
18
|
+
searchPath = searchPath.replace('~', os.homedir())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Handle absolute vs relative paths
|
|
22
|
+
const basePath = path.isAbsolute(searchPath)
|
|
23
|
+
? searchPath
|
|
24
|
+
: path.resolve(process.cwd(), searchPath || '.')
|
|
25
|
+
|
|
26
|
+
// Check if directory exists
|
|
27
|
+
try {
|
|
28
|
+
await fs.access(basePath)
|
|
29
|
+
} catch {
|
|
30
|
+
return []
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// List files and directories
|
|
34
|
+
const entries = await fs.readdir(basePath, { withFileTypes: true })
|
|
35
|
+
|
|
36
|
+
const items: FileSystemItem[] = []
|
|
37
|
+
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
// Skip hidden files unless prefix starts with .
|
|
40
|
+
if (entry.name.startsWith('.') && !prefix.startsWith('.')) continue
|
|
41
|
+
|
|
42
|
+
// Case-insensitive prefix matching
|
|
43
|
+
if (
|
|
44
|
+
prefix === '' ||
|
|
45
|
+
entry.name.toLowerCase().startsWith(prefix.toLowerCase())
|
|
46
|
+
) {
|
|
47
|
+
items.push({
|
|
48
|
+
name: entry.name,
|
|
49
|
+
path: path.join(basePath, entry.name),
|
|
50
|
+
isDirectory: entry.isDirectory(),
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Sort directories first, then files
|
|
56
|
+
items.sort((a, b) => {
|
|
57
|
+
if (a.isDirectory === b.isDirectory) {
|
|
58
|
+
return a.name.localeCompare(b.name)
|
|
59
|
+
}
|
|
60
|
+
return a.isDirectory ? -1 : 1
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return items.slice(0, 10) // Limit results
|
|
64
|
+
} catch (error) {
|
|
65
|
+
return []
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function parsePath(input: string): { basePath: string; prefix: string } {
|
|
70
|
+
// Handle ~ expansion
|
|
71
|
+
if (input.startsWith('~')) {
|
|
72
|
+
input = input.replace('~', os.homedir())
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const lastSlashIndex = input.lastIndexOf('/')
|
|
76
|
+
|
|
77
|
+
if (lastSlashIndex === -1) {
|
|
78
|
+
// No slash, search in current directory
|
|
79
|
+
return { basePath: '.', prefix: input }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Extract base path and prefix
|
|
83
|
+
const basePath = input.substring(0, lastSlashIndex + 1) || '/'
|
|
84
|
+
const prefix = input.substring(lastSlashIndex + 1)
|
|
85
|
+
|
|
86
|
+
return { basePath, prefix }
|
|
87
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { describe, test, expect, beforeEach, afterEach } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
createDeeplink,
|
|
4
|
+
DeeplinkType,
|
|
5
|
+
LaunchType,
|
|
6
|
+
executeSQL,
|
|
7
|
+
runAppleScript,
|
|
8
|
+
} from './utils'
|
|
9
|
+
import { Database } from 'bun:sqlite'
|
|
10
|
+
import * as fs from 'fs'
|
|
11
|
+
import * as os from 'os'
|
|
12
|
+
import * as path from 'path'
|
|
13
|
+
|
|
14
|
+
describe('createDeeplink', () => {
|
|
15
|
+
test('creates extension deeplink without options', () => {
|
|
16
|
+
const url = createDeeplink({
|
|
17
|
+
command: 'my-command',
|
|
18
|
+
})
|
|
19
|
+
expect(url).toMatchInlineSnapshot(`"raycast://extensions/my-command"`)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('creates extension deeplink with all options', () => {
|
|
23
|
+
const url = createDeeplink({
|
|
24
|
+
command: 'my-command',
|
|
25
|
+
launchType: LaunchType.Background,
|
|
26
|
+
arguments: { foo: 'bar', count: 42 },
|
|
27
|
+
fallbackText: 'Fallback text',
|
|
28
|
+
ownerOrAuthorName: 'john-doe',
|
|
29
|
+
extensionName: 'my-extension',
|
|
30
|
+
})
|
|
31
|
+
expect(url).toMatchInlineSnapshot(
|
|
32
|
+
`"raycast://extensions/john-doe/my-extension/my-command?fallbackText=Fallback+text&launchType=background&arguments=%257B%2522foo%2522%253A%2522bar%2522%252C%2522count%2522%253A42%257D"`,
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('creates extension deeplink with only extension name', () => {
|
|
37
|
+
const url = createDeeplink({
|
|
38
|
+
command: 'my-command',
|
|
39
|
+
extensionName: 'my-extension',
|
|
40
|
+
fallbackText: 'Open extension',
|
|
41
|
+
})
|
|
42
|
+
expect(url).toMatchInlineSnapshot(
|
|
43
|
+
`"raycast://extensions/my-extension/my-command?fallbackText=Open+extension"`,
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('creates script command deeplink', () => {
|
|
48
|
+
const url = createDeeplink({
|
|
49
|
+
type: DeeplinkType.ScriptCommand,
|
|
50
|
+
command: 'my-script',
|
|
51
|
+
arguments: ['arg1', 'arg2', 'arg3'],
|
|
52
|
+
})
|
|
53
|
+
expect(url).toMatchInlineSnapshot(
|
|
54
|
+
`"raycast://script-commands/my-script?name=my-script&arguments=arg1%09arg2%09arg3"`,
|
|
55
|
+
)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('creates script command deeplink without arguments', () => {
|
|
59
|
+
const url = createDeeplink({
|
|
60
|
+
type: DeeplinkType.ScriptCommand,
|
|
61
|
+
command: 'my-script',
|
|
62
|
+
})
|
|
63
|
+
expect(url).toMatchInlineSnapshot(
|
|
64
|
+
`"raycast://script-commands/my-script?name=my-script"`,
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('executeSQL', () => {
|
|
70
|
+
const testDbPath = path.join(os.tmpdir(), 'test-db.sqlite')
|
|
71
|
+
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
// Create a test database
|
|
74
|
+
const db = new Database(testDbPath)
|
|
75
|
+
db.exec(`
|
|
76
|
+
CREATE TABLE users (
|
|
77
|
+
id INTEGER PRIMARY KEY,
|
|
78
|
+
name TEXT NOT NULL,
|
|
79
|
+
age INTEGER
|
|
80
|
+
)
|
|
81
|
+
`)
|
|
82
|
+
db.exec(`
|
|
83
|
+
INSERT INTO users (name, age) VALUES
|
|
84
|
+
('Alice', 30),
|
|
85
|
+
('Bob', 25),
|
|
86
|
+
('Charlie', 35)
|
|
87
|
+
`)
|
|
88
|
+
db.close()
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
afterEach(() => {
|
|
92
|
+
// Clean up test database
|
|
93
|
+
if (fs.existsSync(testDbPath)) {
|
|
94
|
+
fs.unlinkSync(testDbPath)
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
test('executes SELECT query', async () => {
|
|
99
|
+
const results = await executeSQL(
|
|
100
|
+
testDbPath,
|
|
101
|
+
'SELECT * FROM users ORDER BY age',
|
|
102
|
+
)
|
|
103
|
+
expect(results).toMatchInlineSnapshot(`
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
"age": 25,
|
|
107
|
+
"id": 2,
|
|
108
|
+
"name": "Bob",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"age": 30,
|
|
112
|
+
"id": 1,
|
|
113
|
+
"name": "Alice",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"age": 35,
|
|
117
|
+
"id": 3,
|
|
118
|
+
"name": "Charlie",
|
|
119
|
+
},
|
|
120
|
+
]
|
|
121
|
+
`)
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
test('executes query with WHERE clause', async () => {
|
|
125
|
+
const results = await executeSQL(
|
|
126
|
+
testDbPath,
|
|
127
|
+
'SELECT name FROM users WHERE age > 30',
|
|
128
|
+
)
|
|
129
|
+
expect(results).toMatchInlineSnapshot(`
|
|
130
|
+
[
|
|
131
|
+
{
|
|
132
|
+
"name": "Charlie",
|
|
133
|
+
},
|
|
134
|
+
]
|
|
135
|
+
`)
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
test('throws error for non-existent database', async () => {
|
|
139
|
+
await expect(
|
|
140
|
+
executeSQL('/non/existent/path.db', 'SELECT 1'),
|
|
141
|
+
).rejects.toThrow('Database file not found')
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
test('throws error for invalid SQL', async () => {
|
|
145
|
+
await expect(executeSQL(testDbPath, 'INVALID SQL QUERY')).rejects.toThrow(
|
|
146
|
+
'SQL execution failed',
|
|
147
|
+
)
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
describe('runAppleScript', () => {
|
|
152
|
+
test('throws error on non-macOS platforms', async () => {
|
|
153
|
+
if (process.platform !== 'darwin') {
|
|
154
|
+
await expect(runAppleScript('return "Hello"')).rejects.toThrow(
|
|
155
|
+
'runAppleScript is only supported on macOS',
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
// These tests will only run on macOS
|
|
161
|
+
if (process.platform === 'darwin') {
|
|
162
|
+
test('executes simple AppleScript', async () => {
|
|
163
|
+
const result = await runAppleScript('return "Hello World"')
|
|
164
|
+
expect(result).toBe('Hello World')
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
test('executes AppleScript with arguments', async () => {
|
|
168
|
+
const script = `return "Hello " & item 1 of argv & " " & item 2 of argv`
|
|
169
|
+
const result = await runAppleScript(script, ['John', 'Doe'])
|
|
170
|
+
expect(result).toBe('Hello John, Doe')
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
test('executes JavaScript for Automation', async () => {
|
|
174
|
+
const result = await runAppleScript('return "Hello from JS"', undefined, {
|
|
175
|
+
language: 'JavaScript',
|
|
176
|
+
})
|
|
177
|
+
expect(result).toBe('Hello from JS')
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
test('parses custom output', async () => {
|
|
181
|
+
interface CustomResult {
|
|
182
|
+
message: string
|
|
183
|
+
count: number
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const result = await runAppleScript<CustomResult>(
|
|
187
|
+
'return "{\\"message\\": \\"Test\\", \\"count\\": 42}"',
|
|
188
|
+
undefined,
|
|
189
|
+
{
|
|
190
|
+
humanReadableOutput: false, // Keep the raw quoted output for JSON parsing
|
|
191
|
+
parseOutput: ({ stdout }) => {
|
|
192
|
+
// Remove surrounding quotes from AppleScript output
|
|
193
|
+
const jsonStr =
|
|
194
|
+
stdout.startsWith('"') && stdout.endsWith('"')
|
|
195
|
+
? stdout.slice(1, -1).replace(/\\"/g, '"')
|
|
196
|
+
: stdout
|
|
197
|
+
return JSON.parse(jsonStr)
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
)
|
|
201
|
+
expect(result).toEqual({ message: 'Test', count: 42 })
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
})
|