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,718 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
type ReactNode,
|
|
3
|
+
type ReactElement,
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
} from 'react'
|
|
9
|
+
import { useKeyboard } from '@opentui/react'
|
|
10
|
+
import { Theme } from 'termcast/src/theme'
|
|
11
|
+
import {
|
|
12
|
+
copyToClipboard,
|
|
13
|
+
openInBrowser,
|
|
14
|
+
openFile,
|
|
15
|
+
pasteContent,
|
|
16
|
+
showInFinder,
|
|
17
|
+
moveToTrash,
|
|
18
|
+
} from 'termcast/src/action-utils'
|
|
19
|
+
import { useDialog } from 'termcast/src/internal/dialog'
|
|
20
|
+
import { Dropdown } from 'termcast/src/components/dropdown'
|
|
21
|
+
import { useIsInFocus } from 'termcast/src/internal/focus-context'
|
|
22
|
+
import { CommonProps } from 'termcast/src/utils'
|
|
23
|
+
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
24
|
+
import { createDescendants } from 'termcast/src/descendants'
|
|
25
|
+
import { useFormSubmit } from 'termcast'
|
|
26
|
+
import { logger } from '../logger'
|
|
27
|
+
|
|
28
|
+
export enum ActionStyle {
|
|
29
|
+
Regular = 'regular',
|
|
30
|
+
Destructive = 'destructive',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ActionProps extends CommonProps {
|
|
34
|
+
title: string
|
|
35
|
+
icon?: string | null
|
|
36
|
+
style?: ActionStyle
|
|
37
|
+
shortcut?: {
|
|
38
|
+
modifiers?: string[]
|
|
39
|
+
key: string
|
|
40
|
+
} | null
|
|
41
|
+
onAction?: () => void
|
|
42
|
+
autoFocus?: boolean
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ActionPanelProps extends CommonProps {
|
|
46
|
+
children?: ReactNode
|
|
47
|
+
title?: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ActionPanelSectionProps extends CommonProps {
|
|
51
|
+
title?: string
|
|
52
|
+
children?: ReactNode
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface ActionType {
|
|
56
|
+
(props: ActionProps): any
|
|
57
|
+
Push: (props: PushActionProps) => any
|
|
58
|
+
CopyToClipboard: (props: CopyToClipboardProps) => any
|
|
59
|
+
OpenInBrowser: (props: OpenInBrowserProps) => any
|
|
60
|
+
Open: (props: OpenProps) => any
|
|
61
|
+
OpenWith: (props: OpenWithProps) => any
|
|
62
|
+
Paste: (props: PasteProps) => any
|
|
63
|
+
ShowInFinder: (props: ShowInFinderProps) => any
|
|
64
|
+
Trash: (props: TrashProps) => any
|
|
65
|
+
SubmitForm: (props: SubmitFormProps) => any
|
|
66
|
+
CreateSnippet: (props: CreateSnippetProps) => any
|
|
67
|
+
CreateQuicklink: (props: CreateQuicklinkProps) => any
|
|
68
|
+
ToggleQuickLook: (props: ToggleQuickLookProps) => any
|
|
69
|
+
PickDate: (props: PickDateProps) => any
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface PushActionProps extends Omit<ActionProps, 'onAction'> {
|
|
73
|
+
target: ReactElement
|
|
74
|
+
onPush?: () => void
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface CopyToClipboardProps extends Omit<ActionProps, 'onAction'> {
|
|
78
|
+
content: string | number
|
|
79
|
+
concealed?: boolean
|
|
80
|
+
onCopy?: (content: string | number) => void
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface OpenInBrowserProps extends Omit<ActionProps, 'onAction'> {
|
|
84
|
+
url: string
|
|
85
|
+
onOpen?: (url: string) => void
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface OpenProps extends Omit<ActionProps, 'onAction'> {
|
|
89
|
+
target: string
|
|
90
|
+
application?: string
|
|
91
|
+
onOpen?: (target: string) => void
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface PasteProps extends Omit<ActionProps, 'onAction'> {
|
|
95
|
+
content: string | number
|
|
96
|
+
onPaste?: (content: string | number) => void
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface ShowInFinderProps extends Omit<ActionProps, 'onAction'> {
|
|
100
|
+
path: string
|
|
101
|
+
onShow?: (path: string) => void
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface OpenWithProps extends Omit<ActionProps, 'onAction'> {
|
|
105
|
+
path: string
|
|
106
|
+
application: string
|
|
107
|
+
onOpen?: (path: string) => void
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface TrashProps extends Omit<ActionProps, 'onAction'> {
|
|
111
|
+
paths: string | string[]
|
|
112
|
+
onTrash?: (paths: string[]) => void
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface SubmitFormProps<T = any> extends Omit<ActionProps, 'onAction'> {
|
|
116
|
+
onSubmit?: (values: T) => void | Promise<void>
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface CreateSnippetProps extends Omit<ActionProps, 'onAction'> {
|
|
120
|
+
snippet: {
|
|
121
|
+
name?: string
|
|
122
|
+
text: string
|
|
123
|
+
}
|
|
124
|
+
onCreated?: () => void
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface CreateQuicklinkProps extends Omit<ActionProps, 'onAction'> {
|
|
128
|
+
quicklink: {
|
|
129
|
+
name?: string
|
|
130
|
+
link: string
|
|
131
|
+
}
|
|
132
|
+
onCreated?: () => void
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface ToggleQuickLookProps extends Omit<ActionProps, 'onAction'> {
|
|
136
|
+
path?: string
|
|
137
|
+
onToggle?: () => void
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface PickDateProps extends Omit<ActionProps, 'onAction'> {
|
|
141
|
+
type?: 'date' | 'datetime'
|
|
142
|
+
min?: Date
|
|
143
|
+
max?: Date
|
|
144
|
+
onPick?: (date: Date | null) => void
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Create descendants for Actions - minimal fields needed
|
|
148
|
+
interface ActionDescendant {
|
|
149
|
+
title: string
|
|
150
|
+
shortcut?: { modifiers?: string[]; key: string } | null
|
|
151
|
+
execute: () => void
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const {
|
|
155
|
+
DescendantsProvider: ActionDescendantsProvider,
|
|
156
|
+
useDescendants: useActionDescendants,
|
|
157
|
+
useDescendant: useActionDescendant,
|
|
158
|
+
} = createDescendants<ActionDescendant>()
|
|
159
|
+
|
|
160
|
+
// Context for ActionPanel
|
|
161
|
+
interface ActionPanelContextValue {
|
|
162
|
+
currentSection?: string
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const ActionPanelContext = createContext<ActionPanelContextValue>({})
|
|
166
|
+
|
|
167
|
+
const Action: ActionType = (props) => {
|
|
168
|
+
// Register as descendant with execute function
|
|
169
|
+
useActionDescendant({
|
|
170
|
+
title: props.title,
|
|
171
|
+
shortcut: props.shortcut,
|
|
172
|
+
execute: () => props.onAction?.(),
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
// Render as Dropdown.Item
|
|
176
|
+
return (
|
|
177
|
+
<Dropdown.Item
|
|
178
|
+
title={props.title}
|
|
179
|
+
value={props.title}
|
|
180
|
+
icon={props.icon}
|
|
181
|
+
label={formatShortcut(props.shortcut)}
|
|
182
|
+
/>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
Action.Push = (props) => {
|
|
187
|
+
const dialog = useDialog()
|
|
188
|
+
|
|
189
|
+
// Register as descendant with execute function
|
|
190
|
+
useActionDescendant({
|
|
191
|
+
title: props.title,
|
|
192
|
+
shortcut: props.shortcut,
|
|
193
|
+
execute: () => {
|
|
194
|
+
props.onPush?.()
|
|
195
|
+
// Push the target to dialog if needed
|
|
196
|
+
if (props.target) {
|
|
197
|
+
dialog.push(props.target, 'center')
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
// Render as Dropdown.Item
|
|
203
|
+
return (
|
|
204
|
+
<Dropdown.Item
|
|
205
|
+
title={props.title}
|
|
206
|
+
value={props.title}
|
|
207
|
+
icon={props.icon}
|
|
208
|
+
label={formatShortcut(props.shortcut)}
|
|
209
|
+
/>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
Action.CopyToClipboard = (props) => {
|
|
214
|
+
// Register as descendant with execute function
|
|
215
|
+
useActionDescendant({
|
|
216
|
+
title: props.title,
|
|
217
|
+
shortcut: props.shortcut,
|
|
218
|
+
execute: () => {
|
|
219
|
+
copyToClipboard(props.content, props.concealed)
|
|
220
|
+
props.onCopy?.(props.content)
|
|
221
|
+
const displayContent = props.concealed
|
|
222
|
+
? 'Concealed content'
|
|
223
|
+
: String(props.content)
|
|
224
|
+
showToast({
|
|
225
|
+
title: 'Copied to Clipboard',
|
|
226
|
+
message:
|
|
227
|
+
displayContent.length > 50
|
|
228
|
+
? displayContent.substring(0, 50) + '...'
|
|
229
|
+
: displayContent,
|
|
230
|
+
style: Toast.Style.Success,
|
|
231
|
+
})
|
|
232
|
+
},
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
// Render as Dropdown.Item
|
|
236
|
+
return (
|
|
237
|
+
<Dropdown.Item
|
|
238
|
+
title={props.title}
|
|
239
|
+
value={props.title}
|
|
240
|
+
icon={props.icon}
|
|
241
|
+
label={formatShortcut(props.shortcut)}
|
|
242
|
+
/>
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
Action.OpenInBrowser = (props) => {
|
|
247
|
+
// Register as descendant with execute function
|
|
248
|
+
useActionDescendant({
|
|
249
|
+
title: props.title,
|
|
250
|
+
shortcut: props.shortcut,
|
|
251
|
+
execute: () => {
|
|
252
|
+
openInBrowser(props.url)
|
|
253
|
+
props.onOpen?.(props.url)
|
|
254
|
+
showToast({
|
|
255
|
+
title: 'Opening in Browser',
|
|
256
|
+
message: props.url,
|
|
257
|
+
style: Toast.Style.Success,
|
|
258
|
+
})
|
|
259
|
+
},
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
// Render as Dropdown.Item
|
|
263
|
+
return (
|
|
264
|
+
<Dropdown.Item
|
|
265
|
+
title={props.title}
|
|
266
|
+
value={props.title}
|
|
267
|
+
icon={props.icon}
|
|
268
|
+
label={formatShortcut(props.shortcut)}
|
|
269
|
+
/>
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
Action.Open = (props) => {
|
|
274
|
+
// Register as descendant with execute function
|
|
275
|
+
useActionDescendant({
|
|
276
|
+
title: props.title,
|
|
277
|
+
shortcut: props.shortcut,
|
|
278
|
+
execute: () => {
|
|
279
|
+
openFile(props.target, props.application)
|
|
280
|
+
props.onOpen?.(props.target)
|
|
281
|
+
const appText = props.application ? ` with ${props.application}` : ''
|
|
282
|
+
showToast({
|
|
283
|
+
title: `Opening File${appText}`,
|
|
284
|
+
message: props.target,
|
|
285
|
+
style: Toast.Style.Success,
|
|
286
|
+
})
|
|
287
|
+
},
|
|
288
|
+
})
|
|
289
|
+
|
|
290
|
+
// Render as Dropdown.Item
|
|
291
|
+
return (
|
|
292
|
+
<Dropdown.Item
|
|
293
|
+
title={props.title}
|
|
294
|
+
value={props.title}
|
|
295
|
+
icon={props.icon}
|
|
296
|
+
label={formatShortcut(props.shortcut)}
|
|
297
|
+
/>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
Action.Paste = (props) => {
|
|
302
|
+
// Register as descendant with execute function
|
|
303
|
+
useActionDescendant({
|
|
304
|
+
title: props.title,
|
|
305
|
+
shortcut: props.shortcut,
|
|
306
|
+
execute: () => {
|
|
307
|
+
pasteContent(props.content)
|
|
308
|
+
props.onPaste?.(props.content)
|
|
309
|
+
showToast({
|
|
310
|
+
title: 'Content Pasted',
|
|
311
|
+
message:
|
|
312
|
+
String(props.content).length > 50
|
|
313
|
+
? String(props.content).substring(0, 50) + '...'
|
|
314
|
+
: String(props.content),
|
|
315
|
+
style: Toast.Style.Success,
|
|
316
|
+
})
|
|
317
|
+
},
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
// Render as Dropdown.Item
|
|
321
|
+
return (
|
|
322
|
+
<Dropdown.Item
|
|
323
|
+
title={props.title}
|
|
324
|
+
value={props.title}
|
|
325
|
+
icon={props.icon}
|
|
326
|
+
label={formatShortcut(props.shortcut)}
|
|
327
|
+
/>
|
|
328
|
+
)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
Action.ShowInFinder = (props) => {
|
|
332
|
+
// Register as descendant with execute function
|
|
333
|
+
useActionDescendant({
|
|
334
|
+
title: props.title || 'Show in Finder',
|
|
335
|
+
shortcut: props.shortcut,
|
|
336
|
+
execute: () => {
|
|
337
|
+
showInFinder(props.path)
|
|
338
|
+
props.onShow?.(props.path)
|
|
339
|
+
showToast({
|
|
340
|
+
title: 'Showing in Finder',
|
|
341
|
+
message: props.path,
|
|
342
|
+
style: Toast.Style.Success,
|
|
343
|
+
})
|
|
344
|
+
},
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
// Render as Dropdown.Item
|
|
348
|
+
return (
|
|
349
|
+
<Dropdown.Item
|
|
350
|
+
title={props.title || 'Show in Finder'}
|
|
351
|
+
value={props.title || 'Show in Finder'}
|
|
352
|
+
icon={props.icon}
|
|
353
|
+
label={formatShortcut(props.shortcut)}
|
|
354
|
+
/>
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
Action.OpenWith = (props) => {
|
|
359
|
+
// Register as descendant with execute function
|
|
360
|
+
useActionDescendant({
|
|
361
|
+
title: props.title || `Open with ${props.application}`,
|
|
362
|
+
shortcut: props.shortcut,
|
|
363
|
+
execute: () => {
|
|
364
|
+
openFile(props.path, props.application)
|
|
365
|
+
props.onOpen?.(props.path)
|
|
366
|
+
showToast({
|
|
367
|
+
title: `Opening with ${props.application}`,
|
|
368
|
+
message: props.path,
|
|
369
|
+
style: Toast.Style.Success,
|
|
370
|
+
})
|
|
371
|
+
},
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
// Render as Dropdown.Item
|
|
375
|
+
return (
|
|
376
|
+
<Dropdown.Item
|
|
377
|
+
title={props.title || `Open with ${props.application}`}
|
|
378
|
+
value={props.title || `Open with ${props.application}`}
|
|
379
|
+
icon={props.icon}
|
|
380
|
+
label={formatShortcut(props.shortcut)}
|
|
381
|
+
/>
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
Action.Trash = (props) => {
|
|
386
|
+
const paths = Array.isArray(props.paths) ? props.paths : [props.paths]
|
|
387
|
+
|
|
388
|
+
// Register as descendant with execute function
|
|
389
|
+
useActionDescendant({
|
|
390
|
+
title: props.title || 'Move to Trash',
|
|
391
|
+
shortcut: props.shortcut,
|
|
392
|
+
execute: async () => {
|
|
393
|
+
for (const path of paths) {
|
|
394
|
+
await moveToTrash(path)
|
|
395
|
+
}
|
|
396
|
+
props.onTrash?.(paths)
|
|
397
|
+
showToast({
|
|
398
|
+
title: 'Moved to Trash',
|
|
399
|
+
message: paths.length > 1 ? `${paths.length} items` : paths[0],
|
|
400
|
+
style: Toast.Style.Success,
|
|
401
|
+
})
|
|
402
|
+
},
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
// Render as Dropdown.Item
|
|
406
|
+
return (
|
|
407
|
+
<Dropdown.Item
|
|
408
|
+
title={props.title || 'Move to Trash'}
|
|
409
|
+
value={props.title || 'Move to Trash'}
|
|
410
|
+
icon={props.icon}
|
|
411
|
+
label={formatShortcut(props.shortcut)}
|
|
412
|
+
/>
|
|
413
|
+
)
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
Action.SubmitForm = (props) => {
|
|
417
|
+
const dialog = useDialog()
|
|
418
|
+
|
|
419
|
+
// Get form context - will be null if not in a form
|
|
420
|
+
const formContext = useFormSubmit()
|
|
421
|
+
|
|
422
|
+
// Register as descendant with execute function
|
|
423
|
+
useActionDescendant({
|
|
424
|
+
title: props.title || 'Submit',
|
|
425
|
+
shortcut: props.shortcut || { modifiers: ['cmd'], key: 'return' },
|
|
426
|
+
execute: () => {
|
|
427
|
+
if (formContext) {
|
|
428
|
+
// Also call the onSubmit if provided
|
|
429
|
+
if (props.onSubmit) {
|
|
430
|
+
const values = formContext.getFormValues()
|
|
431
|
+
props.onSubmit(values)
|
|
432
|
+
}
|
|
433
|
+
} else if (props.onSubmit) {
|
|
434
|
+
throw new Error(`SubmitForm should be called inside a Form`)
|
|
435
|
+
}
|
|
436
|
+
dialog.clear()
|
|
437
|
+
},
|
|
438
|
+
})
|
|
439
|
+
|
|
440
|
+
// Render as Dropdown.Item
|
|
441
|
+
return (
|
|
442
|
+
<Dropdown.Item
|
|
443
|
+
title={props.title || 'Submit'}
|
|
444
|
+
value={props.title || 'Submit'}
|
|
445
|
+
icon={props.icon}
|
|
446
|
+
label={formatShortcut(
|
|
447
|
+
props.shortcut || { modifiers: ['cmd'], key: 'return' },
|
|
448
|
+
)}
|
|
449
|
+
/>
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
Action.CreateSnippet = (props) => {
|
|
454
|
+
// Register as descendant with execute function
|
|
455
|
+
useActionDescendant({
|
|
456
|
+
title: props.title || 'Create Snippet',
|
|
457
|
+
shortcut: props.shortcut,
|
|
458
|
+
execute: () => {
|
|
459
|
+
// TODO: Navigate to Create Snippet command when extension system is implemented
|
|
460
|
+
logger.log(
|
|
461
|
+
`Creating snippet: ${props.snippet.name || 'Untitled'} - ${props.snippet.text}`,
|
|
462
|
+
)
|
|
463
|
+
props.onCreated?.()
|
|
464
|
+
showToast({
|
|
465
|
+
title: 'Create Snippet',
|
|
466
|
+
message: 'Snippet creation not yet implemented',
|
|
467
|
+
style: Toast.Style.Failure,
|
|
468
|
+
})
|
|
469
|
+
},
|
|
470
|
+
})
|
|
471
|
+
|
|
472
|
+
// Render as Dropdown.Item
|
|
473
|
+
return (
|
|
474
|
+
<Dropdown.Item
|
|
475
|
+
title={props.title || 'Create Snippet'}
|
|
476
|
+
value={props.title || 'Create Snippet'}
|
|
477
|
+
icon={props.icon}
|
|
478
|
+
label={formatShortcut(props.shortcut)}
|
|
479
|
+
/>
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
Action.CreateQuicklink = (props) => {
|
|
484
|
+
// Register as descendant with execute function
|
|
485
|
+
useActionDescendant({
|
|
486
|
+
title: props.title || 'Create Quicklink',
|
|
487
|
+
shortcut: props.shortcut,
|
|
488
|
+
execute: () => {
|
|
489
|
+
// TODO: Navigate to Create Quicklink command when extension system is implemented
|
|
490
|
+
logger.log(
|
|
491
|
+
`Creating quicklink: ${props.quicklink.name || 'Untitled'} - ${props.quicklink.link}`,
|
|
492
|
+
)
|
|
493
|
+
props.onCreated?.()
|
|
494
|
+
showToast({
|
|
495
|
+
title: 'Create Quicklink',
|
|
496
|
+
message: 'Quicklink creation not yet implemented',
|
|
497
|
+
style: Toast.Style.Failure,
|
|
498
|
+
})
|
|
499
|
+
},
|
|
500
|
+
})
|
|
501
|
+
|
|
502
|
+
// Render as Dropdown.Item
|
|
503
|
+
return (
|
|
504
|
+
<Dropdown.Item
|
|
505
|
+
title={props.title || 'Create Quicklink'}
|
|
506
|
+
value={props.title || 'Create Quicklink'}
|
|
507
|
+
icon={props.icon}
|
|
508
|
+
label={formatShortcut(props.shortcut)}
|
|
509
|
+
/>
|
|
510
|
+
)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
Action.ToggleQuickLook = (props) => {
|
|
514
|
+
// Register as descendant with execute function
|
|
515
|
+
useActionDescendant({
|
|
516
|
+
title: props.title || 'Quick Look',
|
|
517
|
+
shortcut: props.shortcut || { key: 'space' },
|
|
518
|
+
execute: () => {
|
|
519
|
+
// TODO: Implement Quick Look using macOS qlmanage command
|
|
520
|
+
if (props.path) {
|
|
521
|
+
logger.log(`Quick Look: ${props.path}`)
|
|
522
|
+
}
|
|
523
|
+
props.onToggle?.()
|
|
524
|
+
showToast({
|
|
525
|
+
title: 'Quick Look',
|
|
526
|
+
message: 'Quick Look not yet implemented',
|
|
527
|
+
style: Toast.Style.Failure,
|
|
528
|
+
})
|
|
529
|
+
},
|
|
530
|
+
})
|
|
531
|
+
|
|
532
|
+
// Render as Dropdown.Item
|
|
533
|
+
return (
|
|
534
|
+
<Dropdown.Item
|
|
535
|
+
title={props.title || 'Quick Look'}
|
|
536
|
+
value={props.title || 'Quick Look'}
|
|
537
|
+
icon={props.icon}
|
|
538
|
+
label={formatShortcut(props.shortcut || { key: 'space' })}
|
|
539
|
+
/>
|
|
540
|
+
)
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
Action.PickDate = (props) => {
|
|
544
|
+
const dialog = useDialog()
|
|
545
|
+
|
|
546
|
+
// Register as descendant with execute function
|
|
547
|
+
useActionDescendant({
|
|
548
|
+
title: props.title || 'Pick Date',
|
|
549
|
+
shortcut: props.shortcut,
|
|
550
|
+
execute: () => {
|
|
551
|
+
// TODO: Show date picker dialog when implemented
|
|
552
|
+
logger.log(`Picking ${props.type || 'date'}`)
|
|
553
|
+
props.onPick?.(new Date())
|
|
554
|
+
showToast({
|
|
555
|
+
title: 'Pick Date',
|
|
556
|
+
message: 'Date picker not yet implemented',
|
|
557
|
+
style: Toast.Style.Failure,
|
|
558
|
+
})
|
|
559
|
+
},
|
|
560
|
+
})
|
|
561
|
+
|
|
562
|
+
// Render as Dropdown.Item
|
|
563
|
+
return (
|
|
564
|
+
<Dropdown.Item
|
|
565
|
+
title={props.title || 'Pick Date'}
|
|
566
|
+
value={props.title || 'Pick Date'}
|
|
567
|
+
icon={props.icon}
|
|
568
|
+
label={formatShortcut(props.shortcut)}
|
|
569
|
+
/>
|
|
570
|
+
)
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
interface ActionPanelType {
|
|
574
|
+
(props: ActionPanelProps): any
|
|
575
|
+
Section: (props: ActionPanelSectionProps) => any
|
|
576
|
+
Submenu: (props: ActionPanelSubmenuProps) => any
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
interface ActionPanelSubmenuProps extends ActionPanelSectionProps {
|
|
580
|
+
title: string
|
|
581
|
+
icon?: string | null
|
|
582
|
+
shortcut?: {
|
|
583
|
+
modifiers?: string[]
|
|
584
|
+
key: string
|
|
585
|
+
} | null
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// Helper function to format shortcuts for display
|
|
589
|
+
function formatShortcut(
|
|
590
|
+
shortcut?: { modifiers?: string[]; key: string } | null,
|
|
591
|
+
): string {
|
|
592
|
+
if (!shortcut) return ''
|
|
593
|
+
|
|
594
|
+
const modifiers = shortcut.modifiers || []
|
|
595
|
+
const parts = [...modifiers, shortcut.key]
|
|
596
|
+
|
|
597
|
+
return parts
|
|
598
|
+
.map((part) => {
|
|
599
|
+
// Convert common modifiers to symbols
|
|
600
|
+
switch (part.toLowerCase()) {
|
|
601
|
+
case 'cmd':
|
|
602
|
+
case 'meta':
|
|
603
|
+
// Map cmd to ctrl since terminals can't intercept cmd
|
|
604
|
+
return '⌃'
|
|
605
|
+
case 'ctrl':
|
|
606
|
+
case 'control':
|
|
607
|
+
return '⌃'
|
|
608
|
+
case 'alt':
|
|
609
|
+
case 'option':
|
|
610
|
+
return '⌥'
|
|
611
|
+
case 'shift':
|
|
612
|
+
return '⇧'
|
|
613
|
+
default:
|
|
614
|
+
return part.toUpperCase()
|
|
615
|
+
}
|
|
616
|
+
})
|
|
617
|
+
.join('')
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
const ActionPanel: ActionPanelType = (props) => {
|
|
621
|
+
const { children, title } = props
|
|
622
|
+
const dialog = useDialog()
|
|
623
|
+
const inFocus = useIsInFocus()
|
|
624
|
+
const descendantsContext = useActionDescendants()
|
|
625
|
+
|
|
626
|
+
// Create context value
|
|
627
|
+
const contextValue = useMemo<ActionPanelContextValue>(
|
|
628
|
+
() => ({ currentSection: undefined }),
|
|
629
|
+
[],
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
// prevent showing actions if no dialog is shown
|
|
633
|
+
if (!dialog.stack.length) return null
|
|
634
|
+
// if (!inFocus) return
|
|
635
|
+
|
|
636
|
+
// Check if there's only one action and execute it immediately
|
|
637
|
+
useLayoutEffect(() => {
|
|
638
|
+
const allActions = Object.values(descendantsContext.map.current)
|
|
639
|
+
.filter((item: any) => item.index !== -1)
|
|
640
|
+
.map((item: any) => item.props as ActionDescendant)
|
|
641
|
+
|
|
642
|
+
if (allActions.length === 1) {
|
|
643
|
+
logger.log(`Auto-executing single action: ${allActions[0].title}`)
|
|
644
|
+
dialog.clear()
|
|
645
|
+
allActions[0].execute()
|
|
646
|
+
}
|
|
647
|
+
}, [descendantsContext.map, dialog])
|
|
648
|
+
|
|
649
|
+
// ActionPanel renders as Dropdown with children
|
|
650
|
+
return (
|
|
651
|
+
<ActionDescendantsProvider value={descendantsContext}>
|
|
652
|
+
<ActionPanelContext.Provider value={contextValue}>
|
|
653
|
+
<Dropdown
|
|
654
|
+
tooltip={title}
|
|
655
|
+
placeholder='Search actions...'
|
|
656
|
+
filtering
|
|
657
|
+
onChange={(value) => {
|
|
658
|
+
logger.log(`actions dropdown onChange`, value)
|
|
659
|
+
// Find and execute the selected action
|
|
660
|
+
const allActions = Object.values(descendantsContext.map.current)
|
|
661
|
+
.filter((item: any) => item.index !== -1)
|
|
662
|
+
.map((item: any) => item.props as ActionDescendant)
|
|
663
|
+
|
|
664
|
+
const action = allActions.find((a) => a.title === value)
|
|
665
|
+
if (action) {
|
|
666
|
+
dialog.clear()
|
|
667
|
+
action.execute()
|
|
668
|
+
}
|
|
669
|
+
}}
|
|
670
|
+
>
|
|
671
|
+
{children}
|
|
672
|
+
</Dropdown>
|
|
673
|
+
</ActionPanelContext.Provider>
|
|
674
|
+
</ActionDescendantsProvider>
|
|
675
|
+
)
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
ActionPanel.Section = (props) => {
|
|
679
|
+
const parentContext = useContext(ActionPanelContext)
|
|
680
|
+
|
|
681
|
+
// Create new context with section title
|
|
682
|
+
const sectionContextValue = useMemo(
|
|
683
|
+
() => ({
|
|
684
|
+
...parentContext,
|
|
685
|
+
currentSection: props.title,
|
|
686
|
+
}),
|
|
687
|
+
[parentContext, props.title],
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
// Section provides context to its children
|
|
691
|
+
return (
|
|
692
|
+
<ActionPanelContext.Provider value={sectionContextValue}>
|
|
693
|
+
{props.children}
|
|
694
|
+
</ActionPanelContext.Provider>
|
|
695
|
+
)
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
ActionPanel.Submenu = (props) => {
|
|
699
|
+
const parentContext = useContext(ActionPanelContext)
|
|
700
|
+
|
|
701
|
+
// Create new context with submenu title
|
|
702
|
+
const submenuContextValue = useMemo(
|
|
703
|
+
() => ({
|
|
704
|
+
...parentContext,
|
|
705
|
+
currentSection: props.title,
|
|
706
|
+
}),
|
|
707
|
+
[parentContext, props.title],
|
|
708
|
+
)
|
|
709
|
+
|
|
710
|
+
// Submenu provides context to its children
|
|
711
|
+
return (
|
|
712
|
+
<ActionPanelContext.Provider value={submenuContextValue}>
|
|
713
|
+
{props.children}
|
|
714
|
+
</ActionPanelContext.Provider>
|
|
715
|
+
)
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export { Action, ActionPanel }
|