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,147 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { TextAttributes } from '@opentui/core';
|
|
4
|
+
import { useKeyboard } from '@opentui/react';
|
|
5
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
6
|
+
import { useIsInFocus } from '@termcast/cli/src/internal/focus-context';
|
|
7
|
+
import { ActionPanel, Action } from '@termcast/cli/src/components/actions';
|
|
8
|
+
import { useStore } from '@termcast/cli/src/state';
|
|
9
|
+
import { useDialog } from '@termcast/cli/src/internal/dialog';
|
|
10
|
+
const DetailMetadataLabel = (props) => {
|
|
11
|
+
const textValue = typeof props.text === 'string' ? props.text : props.text?.value;
|
|
12
|
+
const textColor = typeof props.text === 'object' ? props.text?.color : undefined;
|
|
13
|
+
return (_jsxs("box", { style: {
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
paddingBottom: 1,
|
|
16
|
+
}, children: [_jsxs("text", { fg: Theme.textMuted, style: { minWidth: 15 }, children: [props.title, ":"] }), _jsx("text", { fg: textColor || Theme.text, children: textValue || '—' })] }));
|
|
17
|
+
};
|
|
18
|
+
const DetailMetadataSeparator = (props) => {
|
|
19
|
+
return (_jsx("box", { style: {
|
|
20
|
+
paddingTop: 1,
|
|
21
|
+
paddingBottom: 1,
|
|
22
|
+
}, children: _jsx("text", { fg: Theme.textMuted, children: '─'.repeat(30) }) }));
|
|
23
|
+
};
|
|
24
|
+
const DetailMetadataLink = (props) => {
|
|
25
|
+
return (_jsxs("box", { style: {
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
paddingBottom: 1,
|
|
28
|
+
}, children: [_jsxs("text", { fg: Theme.textMuted, style: { minWidth: 15 }, children: [props.title, ":"] }), _jsx("text", { fg: Theme.accent, attributes: TextAttributes.UNDERLINE, children: props.text })] }));
|
|
29
|
+
};
|
|
30
|
+
const DetailMetadataTagListItem = (props) => {
|
|
31
|
+
const displayText = props.text || '';
|
|
32
|
+
return (_jsx("text", { fg: props.color || Theme.text, style: {
|
|
33
|
+
paddingRight: 1,
|
|
34
|
+
paddingLeft: props.icon ? 1 : 0,
|
|
35
|
+
}, children: displayText }));
|
|
36
|
+
};
|
|
37
|
+
const DetailMetadataTagList = (props) => {
|
|
38
|
+
return (_jsxs("box", { style: {
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
paddingBottom: 1,
|
|
41
|
+
}, children: [_jsxs("text", { fg: Theme.textMuted, style: { minWidth: 15 }, children: [props.title, ":"] }), _jsx("box", { style: { flexDirection: 'row' }, children: props.children })] }));
|
|
42
|
+
};
|
|
43
|
+
DetailMetadataTagList.Item = DetailMetadataTagListItem;
|
|
44
|
+
const DetailMetadata = (props) => {
|
|
45
|
+
return (_jsx("box", { style: {
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
paddingTop: 2,
|
|
48
|
+
paddingLeft: 2,
|
|
49
|
+
paddingRight: 2,
|
|
50
|
+
}, children: props.children }));
|
|
51
|
+
};
|
|
52
|
+
DetailMetadata.Label = DetailMetadataLabel;
|
|
53
|
+
DetailMetadata.Separator = DetailMetadataSeparator;
|
|
54
|
+
DetailMetadata.Link = DetailMetadataLink;
|
|
55
|
+
DetailMetadata.TagList = DetailMetadataTagList;
|
|
56
|
+
function DetailFooter({ hasActions, firstActionTitle, }) {
|
|
57
|
+
const toast = useStore((state) => state.toast);
|
|
58
|
+
if (toast) {
|
|
59
|
+
return (_jsx("box", { border: false, style: {
|
|
60
|
+
paddingLeft: 1,
|
|
61
|
+
paddingRight: 1,
|
|
62
|
+
paddingTop: 1,
|
|
63
|
+
marginTop: 1,
|
|
64
|
+
}, children: toast }));
|
|
65
|
+
}
|
|
66
|
+
return (_jsxs("box", { border: false, style: {
|
|
67
|
+
paddingLeft: 1,
|
|
68
|
+
paddingRight: 1,
|
|
69
|
+
paddingTop: 1,
|
|
70
|
+
marginTop: 1,
|
|
71
|
+
flexDirection: 'row',
|
|
72
|
+
}, children: [_jsx("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: "esc" }), _jsx("text", { fg: Theme.textMuted, children: " go back" }), hasActions && (_jsxs(_Fragment, { children: [_jsxs("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: [' ', "^k"] }), _jsx("text", { fg: Theme.textMuted, children: " actions" })] })), hasActions && firstActionTitle && (_jsxs(_Fragment, { children: [_jsxs("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: [' ', "\u21B5"] }), _jsxs("text", { fg: Theme.textMuted, children: [" ", firstActionTitle] })] }))] }));
|
|
73
|
+
}
|
|
74
|
+
// Helper to extract first action title from actions
|
|
75
|
+
function getFirstActionTitle(actions) {
|
|
76
|
+
let firstTitle;
|
|
77
|
+
const findFirstAction = (nodes) => {
|
|
78
|
+
React.Children.forEach(nodes, (child) => {
|
|
79
|
+
if (firstTitle)
|
|
80
|
+
return;
|
|
81
|
+
if (React.isValidElement(child)) {
|
|
82
|
+
const actionTypes = [
|
|
83
|
+
Action,
|
|
84
|
+
Action.Push,
|
|
85
|
+
Action.CopyToClipboard,
|
|
86
|
+
Action.OpenInBrowser,
|
|
87
|
+
Action.Open,
|
|
88
|
+
Action.Paste,
|
|
89
|
+
];
|
|
90
|
+
if (actionTypes.includes(child.type)) {
|
|
91
|
+
firstTitle = child.props.title;
|
|
92
|
+
}
|
|
93
|
+
else if (child.type === ActionPanel) {
|
|
94
|
+
findFirstAction(child.props.children);
|
|
95
|
+
}
|
|
96
|
+
else if (child.type === ActionPanel.Section) {
|
|
97
|
+
findFirstAction(child.props.children);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
findFirstAction(actions);
|
|
103
|
+
return firstTitle;
|
|
104
|
+
}
|
|
105
|
+
const Detail = (props) => {
|
|
106
|
+
const { actions } = props;
|
|
107
|
+
const dialog = useDialog();
|
|
108
|
+
const inFocus = useIsInFocus();
|
|
109
|
+
const markdownLines = useMemo(() => {
|
|
110
|
+
if (!props.markdown)
|
|
111
|
+
return [];
|
|
112
|
+
// TODO: Implement proper markdown parsing
|
|
113
|
+
return props.markdown.split('\n');
|
|
114
|
+
}, [props.markdown]);
|
|
115
|
+
const firstActionTitle = useMemo(() => {
|
|
116
|
+
return actions ? getFirstActionTitle(actions) : undefined;
|
|
117
|
+
}, [actions]);
|
|
118
|
+
// Handle Ctrl+K and Return to show actions
|
|
119
|
+
useKeyboard((evt) => {
|
|
120
|
+
if (!inFocus)
|
|
121
|
+
return;
|
|
122
|
+
if (evt.name === 'k' && evt.ctrl && actions) {
|
|
123
|
+
dialog.push(actions, 'bottom-right');
|
|
124
|
+
}
|
|
125
|
+
else if (evt.name === 'return' && actions) {
|
|
126
|
+
dialog.push(actions, 'bottom-right');
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const content = (_jsxs("box", { style: {
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
flexGrow: 1,
|
|
132
|
+
width: '100%',
|
|
133
|
+
}, children: [_jsx("box", { style: {
|
|
134
|
+
flexGrow: 1,
|
|
135
|
+
flexDirection: 'column',
|
|
136
|
+
paddingTop: 2,
|
|
137
|
+
// paddingLeft: 2,
|
|
138
|
+
paddingRight: props.metadata ? 1 : 2,
|
|
139
|
+
}, children: markdownLines.map((line, index) => (_jsx("text", { fg: Theme.text, children: line || ' ' }, index))) }), props.metadata && (_jsx("box", { style: {
|
|
140
|
+
flexShrink: 0,
|
|
141
|
+
width: 40,
|
|
142
|
+
}, children: props.metadata }))] }));
|
|
143
|
+
return (_jsxs("box", { style: { flexDirection: 'column', height: '100%' }, children: [content, _jsx(DetailFooter, { hasActions: !!actions, firstActionTitle: firstActionTitle })] }));
|
|
144
|
+
};
|
|
145
|
+
Detail.Metadata = DetailMetadata;
|
|
146
|
+
export { Detail };
|
|
147
|
+
//# sourceMappingURL=detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail.js","sourceRoot":"","sources":["../../src/components/detail.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAa,OAAO,EAAgB,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAW,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAA;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AA6D7D,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAO,EAAE;IACrD,MAAM,SAAS,GACb,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAA;IACjE,MAAM,SAAS,GACb,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IAEhE,OAAO,CACL,eACE,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,aAAa,EAAE,CAAC;SACjB,aAED,gBAAM,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,aAC/C,KAAK,CAAC,KAAK,SACP,EACP,eAAM,EAAE,EAAE,SAAS,IAAI,KAAK,CAAC,IAAI,YAAG,SAAS,IAAI,GAAG,GAAQ,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CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;QACtC,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,CACd,eACE,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,MAAM;SACd,aAED,cACE,KAAK,EAAE;oBACL,QAAQ,EAAE,CAAC;oBACX,aAAa,EAAE,QAAQ;oBACvB,UAAU,EAAE,CAAC;oBACb,kBAAkB;oBAClB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrC,YAEA,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAClC,eAAkB,EAAE,EAAE,KAAK,CAAC,IAAI,YAC7B,IAAI,IAAI,GAAG,IADH,KAAK,CAET,CACR,CAAC,GACE,EACL,KAAK,CAAC,QAAQ,IAAI,CACjB,cACE,KAAK,EAAE;oBACL,UAAU,EAAE,CAAC;oBACb,KAAK,EAAE,EAAE;iBACV,YAEA,KAAK,CAAC,QAAQ,GACX,CACP,IACG,CACP,CAAA;IAED,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aACpD,OAAO,EACR,KAAC,YAAY,IACX,UAAU,EAAE,CAAC,CAAC,OAAO,EACrB,gBAAgB,EAAE,gBAAgB,GAClC,IACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '@termcast/cli/src/utils';
|
|
3
|
+
interface SearchBarInterface {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
filtering?: boolean | {
|
|
6
|
+
keepSectionOrder: boolean;
|
|
7
|
+
};
|
|
8
|
+
onSearchTextChange?: (text: string) => void;
|
|
9
|
+
throttle?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface DropdownProps extends SearchBarInterface, CommonProps {
|
|
12
|
+
id?: string;
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
storeValue?: boolean | undefined;
|
|
16
|
+
value?: string;
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
onChange?: (newValue: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface DropdownItemProps extends CommonProps {
|
|
22
|
+
title: string;
|
|
23
|
+
value: string;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
keywords?: string[];
|
|
26
|
+
label?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DropdownSectionProps extends CommonProps {
|
|
29
|
+
title?: string;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
interface DropdownType {
|
|
33
|
+
(props: DropdownProps): any;
|
|
34
|
+
Item: (props: DropdownItemProps) => any;
|
|
35
|
+
Section: (props: DropdownSectionProps) => any;
|
|
36
|
+
}
|
|
37
|
+
declare const Dropdown: DropdownType;
|
|
38
|
+
export default Dropdown;
|
|
39
|
+
export { Dropdown };
|
|
40
|
+
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/components/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,SAAS,EAOV,MAAM,OAAO,CAAA;AAMd,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAIrD,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,GAAG;QAAE,gBAAgB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xs as _jsxs, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useMemo, useRef, createContext, useContext, } from 'react';
|
|
3
|
+
import { useKeyboard } from '@opentui/react';
|
|
4
|
+
import { TextAttributes } from '@opentui/core';
|
|
5
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
6
|
+
import { logger } from '@termcast/cli/src/logger';
|
|
7
|
+
import { useIsInFocus } from '@termcast/cli/src/internal/focus-context';
|
|
8
|
+
import { createDescendants } from '@termcast/cli/src/descendants';
|
|
9
|
+
const { DescendantsProvider: DropdownDescendantsProvider, useDescendants: useDropdownDescendants, useDescendant: useDropdownItemDescendant, } = createDescendants();
|
|
10
|
+
const DropdownContext = createContext({
|
|
11
|
+
searchText: '',
|
|
12
|
+
filtering: true,
|
|
13
|
+
selectedIndex: 0,
|
|
14
|
+
});
|
|
15
|
+
const Dropdown = (props) => {
|
|
16
|
+
const { tooltip, onChange, value, defaultValue, children, placeholder = 'Search…', storeValue, isLoading, filtering = true, onSearchTextChange, throttle, } = props;
|
|
17
|
+
const [selected, setSelected] = useState(0);
|
|
18
|
+
const [searchText, setSearchText] = useState('');
|
|
19
|
+
const [currentValue, setCurrentValue] = useState(value || defaultValue);
|
|
20
|
+
const inputRef = useRef(null);
|
|
21
|
+
const lastSearchTextRef = useRef('');
|
|
22
|
+
const throttleTimeoutRef = useRef(undefined);
|
|
23
|
+
const descendantsContext = useDropdownDescendants();
|
|
24
|
+
// Create context value for children
|
|
25
|
+
const contextValue = useMemo(() => ({
|
|
26
|
+
searchText,
|
|
27
|
+
filtering,
|
|
28
|
+
currentSection: undefined,
|
|
29
|
+
selectedIndex: selected,
|
|
30
|
+
setSelectedIndex: setSelected,
|
|
31
|
+
currentValue,
|
|
32
|
+
onChange: (value) => selectItem(value),
|
|
33
|
+
}), [searchText, filtering, selected, currentValue]);
|
|
34
|
+
// Update controlled value
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (value !== undefined) {
|
|
37
|
+
setCurrentValue(value);
|
|
38
|
+
}
|
|
39
|
+
}, [value]);
|
|
40
|
+
// Reset selected index when search changes
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setSelected(0);
|
|
43
|
+
}, [searchText]);
|
|
44
|
+
// Handle search text change with throttling
|
|
45
|
+
const handleSearchTextChange = (text) => {
|
|
46
|
+
if (!inFocus)
|
|
47
|
+
return;
|
|
48
|
+
setSearchText(text);
|
|
49
|
+
if (onSearchTextChange) {
|
|
50
|
+
if (throttle) {
|
|
51
|
+
if (throttleTimeoutRef.current) {
|
|
52
|
+
clearTimeout(throttleTimeoutRef.current);
|
|
53
|
+
}
|
|
54
|
+
throttleTimeoutRef.current = setTimeout(() => {
|
|
55
|
+
onSearchTextChange(text);
|
|
56
|
+
}, 300);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
onSearchTextChange(text);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const move = (direction) => {
|
|
64
|
+
const items = Object.values(descendantsContext.map.current)
|
|
65
|
+
.filter((item) => item.index !== -1)
|
|
66
|
+
.sort((a, b) => a.index - b.index);
|
|
67
|
+
if (items.length === 0)
|
|
68
|
+
return;
|
|
69
|
+
let next = selected + direction;
|
|
70
|
+
if (next < 0)
|
|
71
|
+
next = items.length - 1;
|
|
72
|
+
if (next >= items.length)
|
|
73
|
+
next = 0;
|
|
74
|
+
setSelected(next);
|
|
75
|
+
};
|
|
76
|
+
const selectItem = (itemValue) => {
|
|
77
|
+
setCurrentValue(itemValue);
|
|
78
|
+
if (onChange) {
|
|
79
|
+
onChange(itemValue);
|
|
80
|
+
}
|
|
81
|
+
if (storeValue) {
|
|
82
|
+
// In a real implementation, this would persist the value
|
|
83
|
+
logger.log('Storing value:', itemValue);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
// Get focus state
|
|
87
|
+
const inFocus = useIsInFocus();
|
|
88
|
+
// Handle keyboard navigation
|
|
89
|
+
useKeyboard((evt) => {
|
|
90
|
+
if (!inFocus)
|
|
91
|
+
return;
|
|
92
|
+
if (evt.name === 'up') {
|
|
93
|
+
move(-1);
|
|
94
|
+
}
|
|
95
|
+
if (evt.name === 'down') {
|
|
96
|
+
move(1);
|
|
97
|
+
}
|
|
98
|
+
if (evt.name === 'return') {
|
|
99
|
+
const items = Object.values(descendantsContext.map.current)
|
|
100
|
+
.filter((item) => item.index !== -1)
|
|
101
|
+
.sort((a, b) => a.index - b.index);
|
|
102
|
+
const currentItem = items[selected];
|
|
103
|
+
if (currentItem?.props) {
|
|
104
|
+
selectItem(currentItem.props.value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return (_jsx(DropdownDescendantsProvider, { value: descendantsContext, children: _jsx(DropdownContext.Provider, { value: contextValue, children: _jsxs("box", { children: [_jsxs("box", { style: { paddingLeft: 2, paddingRight: 2 }, children: [_jsxs("box", { style: { paddingLeft: 1, paddingRight: 1 }, children: [_jsxs("box", { style: {
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
justifyContent: 'space-between',
|
|
111
|
+
}, children: [_jsx("text", { attributes: TextAttributes.BOLD, children: tooltip }), _jsx("text", { fg: Theme.textMuted, children: "esc" })] }), _jsx("box", { style: { paddingTop: 1, paddingBottom: 1 }, children: _jsx("input", { ref: inputRef, onInput: (value) => handleSearchTextChange(value), placeholder: placeholder, focused: inFocus, value: searchText, focusedBackgroundColor: Theme.backgroundPanel, cursorColor: Theme.primary, focusedTextColor: Theme.textMuted }) })] }), _jsx("box", { style: { paddingBottom: 1 }, children: children })] }), _jsxs("box", { border: false, style: {
|
|
112
|
+
paddingRight: 2,
|
|
113
|
+
paddingLeft: 3,
|
|
114
|
+
paddingBottom: 1,
|
|
115
|
+
paddingTop: 1,
|
|
116
|
+
flexDirection: 'row',
|
|
117
|
+
}, children: [_jsx("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: "\u21B5" }), _jsx("text", { fg: Theme.textMuted, children: " select" }), _jsxs("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: [' ', "\u2191\u2193"] }), _jsx("text", { fg: Theme.textMuted, children: " navigate" })] })] }) }) }));
|
|
118
|
+
};
|
|
119
|
+
function ItemOption(props) {
|
|
120
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
121
|
+
return (_jsxs("box", { style: {
|
|
122
|
+
flexDirection: 'row',
|
|
123
|
+
backgroundColor: props.active
|
|
124
|
+
? Theme.primary
|
|
125
|
+
: isHovered
|
|
126
|
+
? Theme.backgroundPanel
|
|
127
|
+
: undefined,
|
|
128
|
+
paddingLeft: props.active ? 0 : 1,
|
|
129
|
+
paddingRight: 1,
|
|
130
|
+
justifyContent: 'space-between',
|
|
131
|
+
}, border: false, onMouseMove: () => {
|
|
132
|
+
setIsHovered(true);
|
|
133
|
+
if (props.onMouseMove)
|
|
134
|
+
props.onMouseMove();
|
|
135
|
+
}, onMouseOut: () => setIsHovered(false), onMouseDown: props.onMouseDown, children: [_jsxs("box", { style: { flexDirection: 'row' }, children: [props.active && (_jsxs("text", { fg: Theme.background, selectable: false, children: ["\u203A", ''] })), props.icon && (_jsxs("text", { fg: props.active ? Theme.background : Theme.text, selectable: false, children: [String(props.icon), ' '] })), _jsx("text", { fg: props.active
|
|
136
|
+
? Theme.background
|
|
137
|
+
: props.current
|
|
138
|
+
? Theme.primary
|
|
139
|
+
: Theme.text, attributes: props.active ? TextAttributes.BOLD : undefined, selectable: false, children: props.title })] }), props.label && (_jsx("text", { fg: props.active ? Theme.background : Theme.textMuted, attributes: props.active ? TextAttributes.BOLD : undefined, selectable: false, children: props.label }))] }));
|
|
140
|
+
}
|
|
141
|
+
const DropdownItem = (props) => {
|
|
142
|
+
const context = useContext(DropdownContext);
|
|
143
|
+
if (!context)
|
|
144
|
+
return null;
|
|
145
|
+
const { searchText, filtering, currentSection, selectedIndex, currentValue } = context;
|
|
146
|
+
// Apply filtering logic
|
|
147
|
+
const shouldHide = (() => {
|
|
148
|
+
if (!filtering || !searchText.trim())
|
|
149
|
+
return false;
|
|
150
|
+
const needle = searchText.toLowerCase().trim();
|
|
151
|
+
const searchableText = [props.title, ...(props.keywords || [])]
|
|
152
|
+
.filter(Boolean)
|
|
153
|
+
.join(' ')
|
|
154
|
+
.toLowerCase();
|
|
155
|
+
return !searchableText.includes(needle);
|
|
156
|
+
})();
|
|
157
|
+
// Register as descendant
|
|
158
|
+
const { index } = useDropdownItemDescendant({
|
|
159
|
+
value: props.value,
|
|
160
|
+
title: props.title,
|
|
161
|
+
hidden: shouldHide,
|
|
162
|
+
});
|
|
163
|
+
// Don't render if hidden
|
|
164
|
+
if (shouldHide)
|
|
165
|
+
return null;
|
|
166
|
+
// Determine if active (index will be -1 if hidden)
|
|
167
|
+
const isActive = index === selectedIndex && index !== -1;
|
|
168
|
+
const isCurrent = props.value === currentValue;
|
|
169
|
+
// Handle mouse events
|
|
170
|
+
const handleMouseMove = () => {
|
|
171
|
+
// Update selected index on hover
|
|
172
|
+
if (context.setSelectedIndex &&
|
|
173
|
+
context.selectedIndex !== index &&
|
|
174
|
+
index !== -1) {
|
|
175
|
+
context.setSelectedIndex(index);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const handleMouseDown = () => {
|
|
179
|
+
// Trigger selection on click
|
|
180
|
+
if (context.onChange && props.value) {
|
|
181
|
+
context.onChange(props.value);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
// Render the item directly
|
|
185
|
+
return (_jsx(ItemOption, { title: props.title, icon: props.icon, active: isActive, current: isCurrent, label: props.label, onMouseMove: handleMouseMove, onMouseDown: handleMouseDown }));
|
|
186
|
+
};
|
|
187
|
+
const DropdownSection = (props) => {
|
|
188
|
+
const parentContext = useContext(DropdownContext);
|
|
189
|
+
if (!parentContext)
|
|
190
|
+
return null;
|
|
191
|
+
// Create new context with section title
|
|
192
|
+
const sectionContextValue = useMemo(() => ({
|
|
193
|
+
...parentContext,
|
|
194
|
+
currentSection: props.title,
|
|
195
|
+
}), [parentContext, props.title]);
|
|
196
|
+
return (_jsxs(_Fragment, { children: [props.title && (_jsx("box", { style: { paddingTop: 1, paddingLeft: 1 }, children: _jsx("text", { fg: Theme.accent, attributes: TextAttributes.BOLD, children: props.title }) })), _jsx(DropdownContext.Provider, { value: sectionContextValue, children: props.children })] }));
|
|
197
|
+
};
|
|
198
|
+
Dropdown.Item = DropdownItem;
|
|
199
|
+
Dropdown.Section = DropdownSection;
|
|
200
|
+
export default Dropdown;
|
|
201
|
+
export { Dropdown };
|
|
202
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/components/dropdown.tsx"],"names":[],"mappings":";AAAA,OAAc,EAEZ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,EACN,aAAa,EACb,UAAU,GACX,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AA0CjE,MAAM,EACJ,mBAAmB,EAAE,2BAA2B,EAChD,cAAc,EAAE,sBAAsB,EACtC,aAAa,EAAE,yBAAyB,GACzC,GAAG,iBAAiB,EAA0B,CAAA;AAa/C,MAAM,eAAe,GAAG,aAAa,CAAuB;IAC1D,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,CAAC;CACjB,CAAC,CAAA;AAQF,MAAM,QAAQ,GAAiB,CAAC,KAAK,EAAE,EAAE;IACvC,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,KAAK,EACL,YAAY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AE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,eAAe,GAC5B,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,eAAe,GAAyC,CAAC,KAAK,EAAE,EAAE;IACtE,MAAM,aAAa,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACjD,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAE/B,wCAAwC;IACxC,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,aAAa;QAChB,cAAc,EAAE,KAAK,CAAC,KAAK;KAC5B,CAAC,EACF,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAC7B,CAAA;IAED,OAAO,CACL,8BAEG,KAAK,CAAC,KAAK,IAAI,CACd,cAAK,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,YAC3C,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,CAAC,IAAI,YACpD,KAAK,CAAC,KAAK,GACP,GACH,CACP,EAED,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,mBAAmB,YACjD,KAAK,CAAC,QAAQ,GACU,IAC1B,CACJ,CAAA;AACH,CAAC,CAAA;AAED,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAA;AAC5B,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAA;AAElC,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ExtensionPreferencesProps {
|
|
2
|
+
extensionName: string;
|
|
3
|
+
commandName?: string;
|
|
4
|
+
onSubmit?: (values: Record<string, any>) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function ExtensionPreferences({ extensionName, commandName, onSubmit, }: ExtensionPreferencesProps): any;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=extension-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-preferences.d.ts","sourceRoot":"","sources":["../../src/components/extension-preferences.tsx"],"names":[],"mappings":"AAUA,UAAU,yBAAyB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;CACjD;AAoBD,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,WAAW,EACX,QAAQ,GACT,EAAE,yBAAyB,GAAG,GAAG,CAsOjC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { Form, showToast, Toast, ActionPanel, Action } from '@termcast/cli';
|
|
6
|
+
import { LocalStorage } from '@termcast/cli/src/apis/localstorage';
|
|
7
|
+
import { useNavigation } from '@termcast/cli/src/internal/navigation';
|
|
8
|
+
import { logger } from '@termcast/cli/src/logger';
|
|
9
|
+
import { getStoreDirectory } from '@termcast/cli/src/utils';
|
|
10
|
+
export function ExtensionPreferences({ extensionName, commandName, onSubmit, }) {
|
|
11
|
+
const [preferences, setPreferences] = useState([]);
|
|
12
|
+
const [savedValues, setSavedValues] = useState({});
|
|
13
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
14
|
+
const { pop } = useNavigation();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const loadPreferences = async () => {
|
|
17
|
+
try {
|
|
18
|
+
// Get extension package.json to read preference manifest
|
|
19
|
+
const storeDir = getStoreDirectory();
|
|
20
|
+
const extensionDir = path.join(storeDir, extensionName);
|
|
21
|
+
const packageJsonPath = path.join(extensionDir, 'package.json');
|
|
22
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
23
|
+
throw new Error(`Extension ${extensionName} not found`);
|
|
24
|
+
}
|
|
25
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
26
|
+
// Get preferences based on whether this is for a command or extension
|
|
27
|
+
let prefsToUse = [];
|
|
28
|
+
if (commandName) {
|
|
29
|
+
// Look for command-specific preferences
|
|
30
|
+
const command = packageJson.commands?.find((cmd) => cmd.name === commandName);
|
|
31
|
+
if (command) {
|
|
32
|
+
prefsToUse = command.preferences || [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Get extension preferences (shared across all commands)
|
|
37
|
+
prefsToUse = packageJson.preferences || [];
|
|
38
|
+
}
|
|
39
|
+
// Load saved values from LocalStorage
|
|
40
|
+
const preferencesKey = commandName
|
|
41
|
+
? `preferences.${extensionName}.${commandName}`
|
|
42
|
+
: `preferences.${extensionName}`;
|
|
43
|
+
const saved = await LocalStorage.getItem(preferencesKey);
|
|
44
|
+
if (saved && typeof saved === 'string') {
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(saved);
|
|
47
|
+
setSavedValues(parsed);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error('Failed to parse saved preferences:', e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
setPreferences(prefsToUse);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
logger.error(`Failed to load preferences for ${extensionName}:`, error);
|
|
57
|
+
await showToast({
|
|
58
|
+
style: Toast.Style.Failure,
|
|
59
|
+
title: 'Failed to load preferences',
|
|
60
|
+
message: String(error),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
setIsLoading(false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
loadPreferences();
|
|
68
|
+
}, [extensionName]);
|
|
69
|
+
const handleSubmit = async (values) => {
|
|
70
|
+
try {
|
|
71
|
+
// Save preferences to LocalStorage
|
|
72
|
+
const preferencesKey = commandName
|
|
73
|
+
? `preferences.${extensionName}.${commandName}`
|
|
74
|
+
: `preferences.${extensionName}`;
|
|
75
|
+
await LocalStorage.setItem(preferencesKey, JSON.stringify(values));
|
|
76
|
+
await showToast({
|
|
77
|
+
style: Toast.Style.Success,
|
|
78
|
+
title: 'Preferences saved',
|
|
79
|
+
message: commandName
|
|
80
|
+
? `Preferences for ${extensionName}/${commandName} have been saved`
|
|
81
|
+
: `Preferences for ${extensionName} have been saved`,
|
|
82
|
+
});
|
|
83
|
+
if (onSubmit) {
|
|
84
|
+
onSubmit(values);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
pop();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
await showToast({
|
|
92
|
+
style: Toast.Style.Failure,
|
|
93
|
+
title: 'Failed to save preferences',
|
|
94
|
+
message: String(error),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
if (isLoading) {
|
|
99
|
+
return _jsx(Form, { isLoading: true });
|
|
100
|
+
}
|
|
101
|
+
if (preferences.length === 0) {
|
|
102
|
+
// If no preferences but onSubmit provided, call it immediately
|
|
103
|
+
if (onSubmit) {
|
|
104
|
+
onSubmit({});
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return (_jsx(Form, { actions: _jsx(ActionPanel, { children: _jsx(Action.SubmitForm, { title: 'Close', onSubmit: () => pop() }) }), children: _jsx(Form.Description, { text: commandName
|
|
108
|
+
? `No preferences available for ${extensionName}/${commandName}`
|
|
109
|
+
: `No preferences available for ${extensionName}` }) }));
|
|
110
|
+
}
|
|
111
|
+
return (_jsx(Form, { actions: _jsx(ActionPanel, { children: _jsx(Action.SubmitForm, { title: 'Save Preferences', onSubmit: handleSubmit }) }), navigationTitle: commandName
|
|
112
|
+
? `${extensionName}/${commandName} Preferences`
|
|
113
|
+
: `${extensionName} Preferences`, children: preferences.map((pref) => {
|
|
114
|
+
const defaultValue = savedValues[pref.name] ?? pref.default;
|
|
115
|
+
switch (pref.type) {
|
|
116
|
+
case 'textfield':
|
|
117
|
+
return (_jsx(Form.TextField, { id: pref.name, title: pref.title, placeholder: pref.placeholder, defaultValue: defaultValue, info: pref.description, storeValue: true }, pref.name));
|
|
118
|
+
case 'password':
|
|
119
|
+
return (_jsx(Form.PasswordField, { id: pref.name, title: pref.title, placeholder: pref.placeholder, defaultValue: defaultValue, info: pref.description, storeValue: true }, pref.name));
|
|
120
|
+
case 'checkbox':
|
|
121
|
+
return (_jsx(Form.Checkbox, { id: pref.name, label: pref.title, defaultValue: defaultValue, info: pref.description, storeValue: true }, pref.name));
|
|
122
|
+
case 'dropdown':
|
|
123
|
+
return (_jsx(Form.Dropdown, { id: pref.name, title: pref.title, defaultValue: defaultValue, info: pref.description, storeValue: true, children: pref.data?.map((item) => (_jsx(Form.Dropdown.Item, { value: item.value, title: item.title }))) }));
|
|
124
|
+
// TODO: Implement file and directory pickers and appPicker
|
|
125
|
+
case 'file':
|
|
126
|
+
case 'directory':
|
|
127
|
+
case 'appPicker':
|
|
128
|
+
return (_jsx(Form.TextField, { id: pref.name, title: pref.title, placeholder: pref.type === 'file'
|
|
129
|
+
? 'Enter file path'
|
|
130
|
+
: pref.type === 'directory'
|
|
131
|
+
? 'Enter directory path'
|
|
132
|
+
: 'Enter application name', defaultValue: defaultValue, info: pref.description ||
|
|
133
|
+
`Select a ${pref.type.replace('appPicker', 'application')}`, storeValue: true }, pref.name));
|
|
134
|
+
default:
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}) }));
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=extension-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-preferences.js","sour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K,WAAW;oBACd,OAAO,CACL,KAAC,IAAI,CAAC,SAAS,IAEb,EAAE,EAAE,IAAI,CAAC,IAAI,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EACT,IAAI,CAAC,IAAI,KAAK,MAAM;4BAClB,CAAC,CAAC,iBAAiB;4BACnB,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;gCACzB,CAAC,CAAC,sBAAsB;gCACxB,CAAC,CAAC,wBAAwB,EAEhC,YAAY,EAAE,YAAY,EAC1B,IAAI,EACF,IAAI,CAAC,WAAW;4BAChB,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,EAE7D,UAAU,UAfL,IAAI,CAAC,IAAI,CAgBd,CACH,CAAA;gBAEH;oBACE,OAAO,IAAI,CAAA;YACf,CAAC;QACH,CAAC,CAAC,GACG,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assign-components.d.ts","sourceRoot":"","sources":["../../../src/components/form/assign-components.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Form } from './index';
|
|
2
|
+
import { TextField } from './text-field';
|
|
3
|
+
import { PasswordField } from './password-field';
|
|
4
|
+
import { TextArea } from './text-area';
|
|
5
|
+
import { Checkbox } from './checkbox';
|
|
6
|
+
import { Dropdown } from './dropdown';
|
|
7
|
+
import { DatePicker } from './date-picker';
|
|
8
|
+
import { TagPicker } from './tagpicker';
|
|
9
|
+
import { Separator } from './separator';
|
|
10
|
+
import { Description } from './description';
|
|
11
|
+
import { FilePicker } from './file-picker';
|
|
12
|
+
Form.TextField = TextField;
|
|
13
|
+
Form.PasswordField = PasswordField;
|
|
14
|
+
Form.TextArea = TextArea;
|
|
15
|
+
Form.Checkbox = Checkbox;
|
|
16
|
+
Form.Dropdown = Dropdown;
|
|
17
|
+
Form.DatePicker = DatePicker;
|
|
18
|
+
Form.TagPicker = TagPicker;
|
|
19
|
+
Form.FilePicker = FilePicker;
|
|
20
|
+
Form.Separator = Separator;
|
|
21
|
+
Form.Description = Description;
|
|
22
|
+
//# sourceMappingURL=assign-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assign-components.js","sourceRoot":"","sources":["../../../src/components/form/assign-components.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,IAAI,CAAC,SAAS,GAAG,SAAgB,CAAA;AACjC,IAAI,CAAC,aAAa,GAAG,aAAoB,CAAA;AACzC,IAAI,CAAC,QAAQ,GAAG,QAAe,CAAA;AAC/B,IAAI,CAAC,QAAQ,GAAG,QAAe,CAAA;AAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;AACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormItemProps, FormItemRef } from './types';
|
|
2
|
+
export interface CheckboxProps extends FormItemProps<boolean> {
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export type CheckboxRef = FormItemRef;
|
|
6
|
+
export declare const Checkbox: (props: CheckboxProps) => any;
|
|
7
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/form/checkbox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOpD,MAAM,WAAW,aAAc,SAAQ,aAAa,CAAC,OAAO,CAAC;IAC3D,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,CAAA;AAErC,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,GA6E/C,CAAA"}
|