termcast 1.3.21 → 1.3.25
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/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/browser-extension.d.ts +18 -0
- package/dist/apis/browser-extension.d.ts.map +1 -0
- package/dist/apis/browser-extension.js +14 -0
- package/dist/apis/browser-extension.js.map +1 -0
- package/dist/apis/localstorage.d.ts.map +1 -1
- package/dist/apis/localstorage.js +4 -7
- package/dist/apis/localstorage.js.map +1 -1
- package/dist/apis/oauth.d.ts.map +1 -1
- package/dist/apis/oauth.js +5 -1
- package/dist/apis/oauth.js.map +1 -1
- package/dist/apis/preferences.d.ts.map +1 -1
- package/dist/apis/preferences.js +38 -19
- package/dist/apis/preferences.js.map +1 -1
- package/dist/apis/toast.d.ts +5 -0
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +7 -43
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +3 -1
- package/dist/build.js.map +1 -1
- 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/cli.d.ts.map +1 -1
- package/dist/cli.js +87 -41
- package/dist/cli.js.map +1 -1
- 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/compile.d.ts +2 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -12
- package/dist/compile.js.map +1 -1
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +56 -30
- package/dist/components/actions.js.map +1 -1
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +4 -0
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +38 -15
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +40 -13
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +5 -3
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.js +5 -3
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/description.d.ts.map +1 -1
- package/dist/components/form/description.js +2 -2
- package/dist/components/form/description.js.map +1 -1
- package/dist/components/form/dropdown.d.ts.map +1 -1
- package/dist/components/form/dropdown.js +84 -80
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/file-autocomplete.d.ts +3 -6
- package/dist/components/form/file-autocomplete.d.ts.map +1 -1
- package/dist/components/form/file-autocomplete.js +61 -66
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.d.ts.map +1 -1
- package/dist/components/form/file-picker.js +33 -30
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/form-end.d.ts.map +1 -1
- package/dist/components/form/form-end.js +21 -1
- package/dist/components/form/form-end.js.map +1 -1
- 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 +3 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +104 -30
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/password-field.d.ts.map +1 -1
- package/dist/components/form/password-field.js +5 -3
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/text-area.d.ts.map +1 -1
- package/dist/components/form/text-area.js +5 -3
- package/dist/components/form/text-area.js.map +1 -1
- package/dist/components/form/text-field.d.ts.map +1 -1
- package/dist/components/form/text-field.js +6 -4
- package/dist/components/form/text-field.js.map +1 -1
- package/dist/components/form/types.d.ts +5 -0
- package/dist/components/form/types.d.ts.map +1 -1
- 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/with-left-border.d.ts +2 -1
- package/dist/components/form/with-left-border.d.ts.map +1 -1
- package/dist/components/form/with-left-border.js +27 -3
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/icon.d.ts +1 -0
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +24 -8
- package/dist/components/icon.js.map +1 -1
- package/dist/components/list.d.ts +2 -2
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +155 -70
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.d.ts.map +1 -1
- package/dist/components/loading-bar.js +2 -2
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/loading-text.d.ts +8 -0
- package/dist/components/loading-text.d.ts.map +1 -0
- package/dist/components/loading-text.js +58 -0
- package/dist/components/loading-text.js.map +1 -0
- package/dist/descendants.js +1 -1
- package/dist/descendants.js.map +1 -1
- 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/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/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/file-autocomplete.vitest.d.ts +2 -0
- package/dist/examples/file-autocomplete.vitest.d.ts.map +1 -0
- package/dist/examples/file-autocomplete.vitest.js +223 -0
- package/dist/examples/file-autocomplete.vitest.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.vitest.d.ts +2 -0
- package/dist/examples/form-basic.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic.vitest.js +630 -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.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown.vitest.js +854 -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-scroll.d.ts.map +1 -1
- package/dist/examples/form-scroll.js +7 -1
- package/dist/examples/form-scroll.js.map +1 -1
- package/dist/examples/form-scroll.vitest.d.ts +2 -0
- package/dist/examples/form-scroll.vitest.d.ts.map +1 -0
- package/dist/examples/form-scroll.vitest.js +211 -0
- package/dist/examples/form-scroll.vitest.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 +736 -0
- package/dist/examples/form-tagpicker.vitest.js.map +1 -0
- package/dist/examples/internal/descendants-filtering.js +1 -1
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +1 -1
- package/dist/examples/internal/descendants.js.map +1 -1
- 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/rhf-custom-ref.js +2 -2
- package/dist/examples/internal/rhf-custom-ref.js.map +1 -1
- package/dist/examples/internal/scrollbox-demo.js +3 -22
- package/dist/examples/internal/scrollbox-demo.js.map +1 -1
- package/dist/examples/internal/scrollbox-descendants.d.ts +2 -0
- package/dist/examples/internal/scrollbox-descendants.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-descendants.js +83 -0
- package/dist/examples/internal/scrollbox-descendants.js.map +1 -0
- package/dist/examples/internal/scrollbox-with-descendants.js +4 -8
- package/dist/examples/internal/scrollbox-with-descendants.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts +2 -0
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts.map +1 -0
- package/dist/examples/internal/simple-scrollbox.vitest.js +96 -0
- package/dist/examples/internal/simple-scrollbox.vitest.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-detail-metadata.d.ts +2 -0
- package/dist/examples/list-detail-metadata.d.ts.map +1 -0
- package/dist/examples/list-detail-metadata.js +8 -0
- package/dist/examples/list-detail-metadata.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 +234 -0
- package/dist/examples/list-dropdown-default.vitest.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 +111 -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-scrollbox.vitest.d.ts +2 -0
- package/dist/examples/list-scrollbox.vitest.d.ts.map +1 -0
- package/dist/examples/list-scrollbox.vitest.js +93 -0
- package/dist/examples/list-scrollbox.vitest.js.map +1 -0
- package/dist/examples/list-with-detail-long.d.ts +2 -0
- package/dist/examples/list-with-detail-long.d.ts.map +1 -0
- package/dist/examples/list-with-detail-long.js +53 -0
- package/dist/examples/list-with-detail-long.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 +434 -0
- package/dist/examples/list-with-detail.vitest.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 +337 -0
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -0
- package/dist/examples/list-with-sections.js +5 -1
- package/dist/examples/list-with-sections.js.map +1 -1
- 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 +601 -0
- package/dist/examples/list-with-sections.vitest.js.map +1 -0
- package/dist/examples/scrollbox-vertical-centering.d.ts +6 -0
- package/dist/examples/scrollbox-vertical-centering.d.ts.map +1 -0
- package/dist/examples/scrollbox-vertical-centering.js +17 -0
- package/dist/examples/scrollbox-vertical-centering.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 +678 -0
- package/dist/examples/simple-file-picker.vitest.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 +521 -0
- package/dist/examples/simple-grid.vitest.js.map +1 -0
- package/dist/examples/simple-navigation.js +10 -4
- package/dist/examples/simple-navigation.js.map +1 -1
- 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 +718 -0
- package/dist/examples/simple-navigation.vitest.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 +69 -0
- package/dist/examples/store.vitest.js.map +1 -0
- package/dist/examples/toast-variations.d.ts +2 -0
- package/dist/examples/toast-variations.d.ts.map +1 -0
- package/dist/examples/toast-variations.js +122 -0
- package/dist/examples/toast-variations.js.map +1 -0
- package/dist/extensions/dev.d.ts +4 -2
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +61 -10
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/dev.vitest.d.ts +2 -0
- package/dist/extensions/dev.vitest.d.ts.map +1 -0
- package/dist/extensions/dev.vitest.js +197 -0
- package/dist/extensions/dev.vitest.js.map +1 -0
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +3 -0
- package/dist/extensions/home.js.map +1 -1
- 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/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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/dialog.d.ts +1 -0
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +27 -18
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/navigation.d.ts +9 -1
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +5 -5
- package/dist/internal/navigation.js.map +1 -1
- package/dist/internal/offscreen.d.ts +6 -0
- package/dist/internal/offscreen.d.ts.map +1 -0
- package/dist/internal/offscreen.js +10 -0
- package/dist/internal/offscreen.js.map +1 -0
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +2 -2
- package/dist/internal/providers.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +1 -10
- package/dist/internal/scrollbox.d.ts.map +1 -1
- package/dist/internal/scrollbox.js +2 -1
- package/dist/internal/scrollbox.js.map +1 -1
- 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/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/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/release.d.ts +1 -1
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +29 -33
- package/dist/release.js.map +1 -1
- package/dist/state.d.ts +2 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +3 -0
- package/dist/state.js.map +1 -1
- 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/swift-loader.d.ts +3 -0
- package/dist/swift-loader.d.ts.map +1 -0
- package/dist/swift-loader.js +193 -0
- package/dist/swift-loader.js.map +1 -0
- package/dist/swift-runtime.d.ts +2 -0
- package/dist/swift-runtime.d.ts.map +1 -0
- package/dist/swift-runtime.js +27 -0
- package/dist/swift-runtime.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 +9 -0
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +49 -0
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/run-command.d.ts +26 -1
- package/dist/utils/run-command.d.ts.map +1 -1
- package/dist/utils/run-command.js +53 -4
- package/dist/utils/run-command.js.map +1 -1
- 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 +12 -12
- package/src/apis/browser-extension.tsx +29 -0
- package/src/apis/localstorage.test.ts +14 -6
- package/src/apis/localstorage.tsx +8 -5
- package/src/apis/oauth.tsx +5 -1
- package/src/apis/preferences.tsx +48 -22
- package/src/apis/toast.tsx +37 -62
- package/src/build.test.tsx +52 -0
- package/src/build.tsx +3 -1
- package/src/cli.tsx +99 -48
- package/src/compile.tsx +32 -11
- package/src/components/actions.tsx +94 -32
- package/src/components/detail.tsx +4 -0
- package/src/components/dropdown.tsx +47 -14
- package/src/components/extension-preferences.tsx +44 -16
- package/src/components/form/checkbox.tsx +12 -6
- package/src/components/form/date-picker.tsx +12 -6
- package/src/components/form/description.tsx +7 -2
- package/src/components/form/dropdown.tsx +131 -119
- package/src/components/form/file-autocomplete.tsx +90 -108
- package/src/components/form/file-picker.tsx +54 -43
- package/src/components/form/form-end.tsx +23 -2
- package/src/components/form/index.tsx +168 -41
- package/src/components/form/password-field.tsx +12 -6
- package/src/components/form/text-area.tsx +13 -6
- package/src/components/form/text-field.tsx +13 -6
- package/src/components/form/types.tsx +6 -0
- package/src/components/form/with-left-border.tsx +41 -8
- package/src/components/icon.tsx +27 -8
- package/src/components/list.tsx +243 -101
- package/src/components/loading-bar.tsx +3 -2
- package/src/components/loading-text.tsx +79 -0
- package/src/descendants.tsx +1 -0
- package/src/examples/file-autocomplete.vitest.tsx +130 -125
- package/src/examples/form-basic.vitest.tsx +376 -176
- package/src/examples/form-dropdown.vitest.tsx +126 -126
- package/src/examples/form-scroll.tsx +2 -0
- package/src/examples/form-scroll.vitest.tsx +58 -58
- package/src/examples/form-tagpicker.vitest.tsx +99 -99
- package/src/examples/internal/descendants-filtering.tsx +1 -0
- package/src/examples/internal/descendants.tsx +1 -0
- package/src/examples/internal/rhf-custom-ref.tsx +2 -0
- package/src/examples/internal/scrollbox-demo.tsx +3 -27
- package/src/examples/internal/scrollbox-with-descendants.tsx +4 -7
- package/src/examples/internal/simple-scrollbox.vitest.tsx +7 -5
- package/src/examples/list-detail-metadata.tsx +49 -0
- package/src/examples/list-detail-metadata.vitest.tsx +88 -0
- package/src/examples/list-dropdown-default.vitest.tsx +51 -51
- package/src/examples/list-fetch-data.vitest.tsx +4 -4
- package/src/examples/list-scrollbox.vitest.tsx +73 -14
- package/src/examples/list-with-detail-long.tsx +70 -0
- package/src/examples/list-with-detail.vitest.tsx +191 -85
- package/src/examples/list-with-dropdown.vitest.tsx +53 -53
- package/src/examples/list-with-sections.tsx +1 -0
- package/src/examples/list-with-sections.vitest.tsx +221 -97
- package/src/examples/list-with-toast.vitest.tsx +16 -16
- package/src/examples/simple-file-picker.vitest.tsx +63 -469
- package/src/examples/simple-grid.vitest.tsx +238 -233
- package/src/examples/simple-navigation.tsx +15 -7
- package/src/examples/simple-navigation.vitest.tsx +130 -219
- package/src/examples/store.vitest.tsx +1 -1
- package/src/examples/swift-extension.vitest.tsx +148 -0
- package/src/examples/synonyms.vitest.tsx +159 -0
- package/src/examples/toast-variations.tsx +150 -0
- package/src/examples/toast-variations.vitest.tsx +370 -0
- package/src/extensions/dev.tsx +74 -7
- package/src/extensions/dev.vitest.tsx +102 -34
- package/src/extensions/home.tsx +6 -0
- package/src/index.tsx +3 -0
- package/src/internal/dialog.tsx +43 -30
- package/src/internal/navigation.tsx +3 -1
- package/src/internal/offscreen.tsx +15 -0
- package/src/internal/providers.tsx +4 -2
- package/src/internal/scrollbox.tsx +4 -8
- package/src/keyboard.test.tsx +69 -0
- package/src/release.tsx +32 -38
- package/src/state.tsx +7 -0
- package/src/swift-loader.tsx +239 -0
- package/src/swift-runtime.tsx +36 -0
- package/src/utils/file-system.ts +61 -0
- package/src/utils/run-command.tsx +82 -6
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextareaRenderable } from '@opentui/core';
|
|
3
|
-
export interface
|
|
3
|
+
export interface FileAutocompleteDialogProps {
|
|
4
4
|
onSelect: (path: string) => void;
|
|
5
|
-
|
|
6
|
-
onVisibilityChange: (visible: boolean) => void;
|
|
5
|
+
onClose: () => void;
|
|
7
6
|
inputRef: React.RefObject<TextareaRenderable | null>;
|
|
8
|
-
anchorRef: React.RefObject<any>;
|
|
9
|
-
searchTrigger: number;
|
|
10
7
|
canChooseFiles?: boolean;
|
|
11
8
|
canChooseDirectories?: boolean;
|
|
12
9
|
initialDirectory?: string;
|
|
13
10
|
}
|
|
14
|
-
export declare const
|
|
11
|
+
export declare const FileAutocompleteDialog: ({ onSelect, onClose, inputRef, canChooseFiles, canChooseDirectories, initialDirectory, }: FileAutocompleteDialogProps) => any;
|
|
15
12
|
//# sourceMappingURL=file-autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"file-autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAKlD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IACpD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAgBD,eAAO,MAAM,sBAAsB,GAAI,0FAOpC,2BAA2B,KAAG,GA8FhC,CAAA"}
|
|
@@ -2,91 +2,86 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@opentui/reac
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useQuery } from '@tanstack/react-query';
|
|
4
4
|
import { Theme } from 'termcast/src/theme';
|
|
5
|
-
import {
|
|
6
|
-
import { searchFiles, parsePath } from '../../utils/file-system';
|
|
5
|
+
import { listAllFiles } from '../../utils/file-system';
|
|
7
6
|
import { useKeyboard } from '@opentui/react';
|
|
8
7
|
import { useIsInFocus } from 'termcast/src/internal/focus-context';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
function fuzzyMatch(text, query) {
|
|
9
|
+
if (!query)
|
|
10
|
+
return true;
|
|
11
|
+
const lowerText = text.toLowerCase();
|
|
12
|
+
const lowerQuery = query.toLowerCase();
|
|
13
|
+
let queryIndex = 0;
|
|
14
|
+
for (let i = 0; i < lowerText.length && queryIndex < lowerQuery.length; i++) {
|
|
15
|
+
if (lowerText[i] === lowerQuery[queryIndex]) {
|
|
16
|
+
queryIndex++;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return queryIndex === lowerQuery.length;
|
|
20
|
+
}
|
|
21
|
+
export const FileAutocompleteDialog = ({ onSelect, onClose, inputRef, canChooseFiles = true, canChooseDirectories = false, initialDirectory, }) => {
|
|
13
22
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
23
|
+
const [filter, setFilter] = useState(() => inputRef.current?.plainText || '');
|
|
14
24
|
const isInFocus = useIsInFocus();
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const { basePath, prefix } = inputValue
|
|
18
|
-
? parsePath(inputValue)
|
|
19
|
-
: { basePath: defaultBasePath, prefix: '' };
|
|
20
|
-
const { data: items = [], isLoading: loading } = useQuery({
|
|
21
|
-
queryKey: ['file-autocomplete', basePath, prefix, searchTrigger, canChooseFiles, canChooseDirectories],
|
|
25
|
+
const { data: allFiles = [], isLoading } = useQuery({
|
|
26
|
+
queryKey: ['file-list', initialDirectory, canChooseFiles, canChooseDirectories],
|
|
22
27
|
queryFn: async () => {
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
// Always include directories in the listing, filter afterwards
|
|
29
|
+
const files = await listAllFiles({
|
|
30
|
+
basePath: initialDirectory || '.',
|
|
31
|
+
maxDepth: 4,
|
|
32
|
+
maxFiles: 500,
|
|
33
|
+
includeDirectories: true,
|
|
34
|
+
});
|
|
35
|
+
// Filter based on canChooseFiles/canChooseDirectories
|
|
36
|
+
return files.filter((f) => {
|
|
37
|
+
const isDir = f.endsWith('/');
|
|
38
|
+
if (isDir) {
|
|
39
|
+
return canChooseDirectories;
|
|
40
|
+
}
|
|
27
41
|
return canChooseFiles;
|
|
28
42
|
});
|
|
29
|
-
setSelectedIndex(0);
|
|
30
|
-
return filtered;
|
|
31
43
|
},
|
|
32
|
-
enabled: visible,
|
|
33
44
|
});
|
|
34
|
-
|
|
45
|
+
// Filter files based on current input
|
|
46
|
+
const filteredFiles = allFiles.filter((file) => fuzzyMatch(file, filter));
|
|
47
|
+
const visibleFiles = filteredFiles.slice(0, 10);
|
|
35
48
|
useKeyboard((evt) => {
|
|
36
|
-
if (!
|
|
49
|
+
if (!isInFocus)
|
|
37
50
|
return;
|
|
38
51
|
if (evt.name === 'up') {
|
|
39
|
-
setSelectedIndex((prev) => (prev > 0 ? prev - 1 :
|
|
52
|
+
setSelectedIndex((prev) => (prev > 0 ? prev - 1 : visibleFiles.length - 1));
|
|
40
53
|
}
|
|
41
54
|
else if (evt.name === 'down') {
|
|
42
|
-
setSelectedIndex((prev) => (prev <
|
|
43
|
-
}
|
|
44
|
-
else if (evt.name === 'escape') {
|
|
45
|
-
onVisibilityChange(false);
|
|
55
|
+
setSelectedIndex((prev) => (prev < visibleFiles.length - 1 ? prev + 1 : 0));
|
|
46
56
|
}
|
|
47
|
-
else if (evt.name === 'return') {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
inputRef.current?.setText(fullPath);
|
|
55
|
-
inputRef.current.cursorOffset = fullPath.length;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
onSelect(newValue);
|
|
59
|
-
onVisibilityChange(false);
|
|
60
|
-
}
|
|
57
|
+
else if (evt.name === 'return' || evt.name === 'tab') {
|
|
58
|
+
const selected = visibleFiles[selectedIndex];
|
|
59
|
+
if (selected) {
|
|
60
|
+
const path = selected.endsWith('/') ? selected.slice(0, -1) : selected;
|
|
61
|
+
inputRef.current?.setText(path);
|
|
62
|
+
onSelect(path);
|
|
63
|
+
onClose();
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
else if (evt.name === '
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
onSelect(newValue);
|
|
69
|
-
onVisibilityChange(false);
|
|
66
|
+
else if (evt.name === 'backspace') {
|
|
67
|
+
if (filter.length > 0) {
|
|
68
|
+
const newFilter = filter.slice(0, -1);
|
|
69
|
+
setFilter(newFilter);
|
|
70
|
+
setSelectedIndex(0);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
73
|
+
else if (evt.name && evt.name.length === 1 && !evt.ctrl && !evt.meta) {
|
|
74
|
+
// Single character input
|
|
75
|
+
const newFilter = filter + evt.name;
|
|
76
|
+
setFilter(newFilter);
|
|
77
|
+
setSelectedIndex(0);
|
|
78
|
+
}
|
|
72
79
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const visibleItems = items.slice(0, maxVisible);
|
|
80
|
-
const displayHeight = visibleItems.length + 1;
|
|
81
|
-
const contentWidth = anchorElement.width - 2;
|
|
82
|
-
const hintText = directoryOnlyMode
|
|
83
|
-
? '↑↓ navigate ⏎ open folder → select folder esc close'
|
|
84
|
-
: '↑↓ navigate ⏎ open/select → select esc close';
|
|
85
|
-
return (_jsx("box", { position: 'absolute', top: anchorElement.y - displayHeight - 2, left: anchorElement.x, width: anchorElement.width, height: displayHeight + 2, zIndex: 1000, borderStyle: 'single', borderColor: border, backgroundColor: backgroundPanel, shouldFill: true, children: _jsx("box", { flexDirection: 'column', backgroundColor: backgroundPanel, shouldFill: true, children: loading ? (_jsx("text", { fg: Theme.textMuted, children: " Loading..." })) : (_jsxs(_Fragment, { children: [visibleItems.map((item, index) => {
|
|
86
|
-
const icon = item.isDirectory ? '📁 ' : '📄 ';
|
|
87
|
-
const text = ' ' + icon + item.name;
|
|
88
|
-
const padded = text.padEnd(contentWidth, ' ');
|
|
89
|
-
return (_jsx("text", { fg: index === selectedIndex ? Theme.background : Theme.text, bg: index === selectedIndex ? Theme.primary : Theme.backgroundPanel, children: padded }, item.path));
|
|
90
|
-
}), _jsxs("text", { fg: Theme.textMuted, children: [" ", hintText] })] })) }) }));
|
|
80
|
+
const hintText = '↑↓ navigate ⏎/tab select esc close';
|
|
81
|
+
return (_jsxs("box", { flexDirection: 'column', paddingLeft: 1, paddingRight: 1, children: [_jsxs("box", { flexDirection: 'row', children: [_jsx("text", { fg: Theme.textMuted, children: "Filter: " }), _jsx("text", { fg: Theme.primary, children: filter || '(type to filter)' })] }), _jsx("box", { height: 1 }), isLoading ? (_jsx("text", { fg: Theme.textMuted, children: "Loading files..." })) : visibleFiles.length === 0 ? (_jsx("text", { fg: Theme.textMuted, children: "No files found" })) : (_jsx(_Fragment, { children: visibleFiles.map((file, index) => {
|
|
82
|
+
const isDir = file.endsWith('/');
|
|
83
|
+
const icon = isDir ? '📁 ' : '📄 ';
|
|
84
|
+
return (_jsxs("text", { fg: index === selectedIndex ? Theme.background : Theme.text, bg: index === selectedIndex ? Theme.primary : Theme.backgroundPanel, children: [' ', icon, file] }, file));
|
|
85
|
+
}) })), _jsx("box", { height: 1 }), _jsx("text", { fg: Theme.textMuted, children: hintText })] }));
|
|
91
86
|
};
|
|
92
87
|
//# sourceMappingURL=file-autocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-autocomplete.js","sourceRoot":"","sources":["../../../src/components/form/file-autocomplete.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"file-autocomplete.js","sourceRoot":"","sources":["../../../src/components/form/file-autocomplete.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAWlE,SAAS,UAAU,CAAC,IAAY,EAAE,KAAa;IAC7C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,C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|
+
{"version":3,"file":"file-picker.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAUpD,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,MAAM,EAAE,CAAC;IAC9D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,CAAA;AA8JvC,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,KAAG,GAkDnD,CAAA"}
|
|
@@ -6,14 +6,31 @@ import { useFormContext, Controller } from 'react-hook-form';
|
|
|
6
6
|
import { useFocusContext, useFormFieldDescendant } from './index';
|
|
7
7
|
import { useKeyboard } from '@opentui/react';
|
|
8
8
|
import { useIsInFocus } from 'termcast/src/internal/focus-context';
|
|
9
|
-
import {
|
|
9
|
+
import { FileAutocompleteDialog } from './file-autocomplete';
|
|
10
10
|
import { useFormNavigationHelpers } from './use-form-navigation';
|
|
11
|
-
|
|
11
|
+
import { useDialog } from 'termcast/src/internal/dialog';
|
|
12
|
+
import { LoadingText } from 'termcast/src/components/loading-text';
|
|
13
|
+
const FilePickerField = ({ field, fieldState, formState, props, isFocused, setFocusedField, isFormLoading, }) => {
|
|
12
14
|
const isInFocus = useIsInFocus();
|
|
13
|
-
const [showAutocomplete, setShowAutocomplete] = React.useState(false);
|
|
14
|
-
const [searchTrigger, setSearchTrigger] = React.useState(0);
|
|
15
15
|
const inputRef = React.useRef(null);
|
|
16
|
-
const
|
|
16
|
+
const dialog = useDialog();
|
|
17
|
+
const showAutocomplete = () => {
|
|
18
|
+
if (dialog.stack.length > 0)
|
|
19
|
+
return;
|
|
20
|
+
const handleSelect = (path) => {
|
|
21
|
+
const currentFiles = field.value || [];
|
|
22
|
+
const newFiles = props.allowMultipleSelection !== false ? [...currentFiles, path] : [path];
|
|
23
|
+
field.onChange(newFiles);
|
|
24
|
+
if (props.onChange) {
|
|
25
|
+
props.onChange(newFiles);
|
|
26
|
+
}
|
|
27
|
+
inputRef.current?.setText('');
|
|
28
|
+
dialog.clear();
|
|
29
|
+
};
|
|
30
|
+
dialog.push(_jsx(FileAutocompleteDialog, { onSelect: handleSelect, onClose: () => {
|
|
31
|
+
dialog.clear();
|
|
32
|
+
}, inputRef: inputRef, canChooseFiles: props.canChooseFiles, canChooseDirectories: props.canChooseDirectories, initialDirectory: props.initialDirectory }));
|
|
33
|
+
};
|
|
17
34
|
// Handle Enter key and left arrow for removing last file
|
|
18
35
|
useKeyboard((evt) => {
|
|
19
36
|
if (!isFocused || !isInFocus)
|
|
@@ -33,12 +50,11 @@ const FilePickerField = ({ field, fieldState, formState, props, isFocused, setFo
|
|
|
33
50
|
if (evt.name === 'return') {
|
|
34
51
|
const inputValue = inputRef.current?.plainText || '';
|
|
35
52
|
// If input is empty, show files in current directory
|
|
36
|
-
if (!inputValue
|
|
37
|
-
|
|
38
|
-
setSearchTrigger((n) => n + 1);
|
|
53
|
+
if (!inputValue) {
|
|
54
|
+
showAutocomplete();
|
|
39
55
|
}
|
|
40
|
-
// If
|
|
41
|
-
else if (inputValue.trim()
|
|
56
|
+
// If input has value, add the path directly
|
|
57
|
+
else if (inputValue.trim()) {
|
|
42
58
|
const currentFiles = field.value || [];
|
|
43
59
|
const newFiles = props.allowMultipleSelection !== false
|
|
44
60
|
? [...currentFiles, inputValue.trim()]
|
|
@@ -51,36 +67,23 @@ const FilePickerField = ({ field, fieldState, formState, props, isFocused, setFo
|
|
|
51
67
|
}
|
|
52
68
|
}
|
|
53
69
|
});
|
|
54
|
-
const handleSelectFile = (path) => {
|
|
55
|
-
const currentFiles = field.value || [];
|
|
56
|
-
const newFiles = props.allowMultipleSelection !== false ? [...currentFiles, path] : [path];
|
|
57
|
-
field.onChange(newFiles);
|
|
58
|
-
if (props.onChange) {
|
|
59
|
-
props.onChange(newFiles);
|
|
60
|
-
}
|
|
61
|
-
inputRef.current?.setText('');
|
|
62
|
-
setShowAutocomplete(false);
|
|
63
|
-
};
|
|
64
70
|
const selectedFiles = field.value || [];
|
|
65
|
-
return (_jsxs("box", { flexDirection: 'column', children: [_jsx(WithLeftBorder, { withDiamond: true, isFocused: isFocused, children: _jsx("
|
|
71
|
+
return (_jsxs("box", { flexDirection: 'column', children: [_jsx(WithLeftBorder, { withDiamond: true, isFocused: isFocused, isLoading: isFormLoading, children: _jsx("box", { onMouseDown: () => {
|
|
66
72
|
setFocusedField(props.id);
|
|
67
|
-
}, children: props.title || 'File Path' }) }), _jsx(WithLeftBorder, { isFocused: isFocused, children: _jsxs("box", { flexDirection: 'column',
|
|
73
|
+
}, children: _jsx(LoadingText, { isLoading: isFocused && isFormLoading, color: isFocused ? Theme.primary : Theme.text, children: props.title || 'File Path' }) }) }), _jsx(WithLeftBorder, { isFocused: isFocused, children: _jsxs("box", { flexDirection: 'column', children: [_jsx("textarea", { ref: inputRef, height: 1, wrapMode: 'none', keyBindings: [
|
|
68
74
|
{ name: 'return', action: 'submit' },
|
|
69
75
|
{ name: 'linefeed', action: 'submit' },
|
|
70
76
|
], initialValue: "", placeholder: props.placeholder || 'Enter file path...', focused: isFocused, onMouseDown: () => setFocusedField(props.id), onContentChange: () => {
|
|
71
77
|
const value = inputRef.current?.plainText || '';
|
|
72
78
|
if (value && isFocused) {
|
|
73
|
-
|
|
74
|
-
setSearchTrigger((n) => n + 1);
|
|
75
|
-
}
|
|
76
|
-
else if (!value) {
|
|
77
|
-
setShowAutocomplete(false);
|
|
79
|
+
showAutocomplete();
|
|
78
80
|
}
|
|
79
|
-
} }), selectedFiles.length > 0 && (_jsxs("box", { flexDirection: 'column', marginTop: 1, children: [_jsx("text", { fg: Theme.textMuted, children: "Selected files:" }), selectedFiles.map((file, index) => (_jsxs("text", { fg: Theme.text, children: ["\u2022 ", file] }, index)))] }))] }) }), (fieldState.error || props.error) && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.error, children: fieldState.error?.message || props.error }) })), props.info && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.textMuted, children: props.info }) }))
|
|
81
|
+
} }), selectedFiles.length > 0 && (_jsxs("box", { flexDirection: 'column', marginTop: 1, children: [_jsx("text", { fg: Theme.textMuted, children: "Selected files:" }), selectedFiles.map((file, index) => (_jsxs("text", { fg: Theme.text, children: ["\u2022 ", file] }, index)))] }))] }) }), (fieldState.error || props.error) && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.error, children: fieldState.error?.message || props.error }) })), props.info && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.textMuted, children: props.info }) }))] }));
|
|
80
82
|
};
|
|
81
83
|
export const FilePicker = (props) => {
|
|
82
84
|
const { control } = useFormContext();
|
|
83
|
-
const
|
|
85
|
+
const focusContext = useFocusContext();
|
|
86
|
+
const { focusedField, setFocusedField } = focusContext;
|
|
84
87
|
const isFocused = focusedField === props.id;
|
|
85
88
|
const isInFocus = useIsInFocus();
|
|
86
89
|
const elementRef = useRef(null);
|
|
@@ -104,7 +107,7 @@ export const FilePicker = (props) => {
|
|
|
104
107
|
}
|
|
105
108
|
});
|
|
106
109
|
return (_jsx(Controller, { name: props.id, control: control, defaultValue: props.defaultValue || props.value || [], render: (renderProps) => {
|
|
107
|
-
return (_jsx("box", { ref: elementRef, flexDirection: 'column', children: _jsx(FilePickerField, { ...renderProps, props: props, isFocused: isFocused, setFocusedField: setFocusedField }) }));
|
|
110
|
+
return (_jsx("box", { ref: elementRef, flexDirection: 'column', children: _jsx(FilePickerField, { ...renderProps, props: props, isFocused: isFocused, setFocusedField: setFocusedField, isFormLoading: focusContext.isLoading }) }));
|
|
108
111
|
} }));
|
|
109
112
|
};
|
|
110
113
|
//# sourceMappingURL=file-picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-picker.js","sourceRoot":"","sources":["../../../src/components/form/file-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"file-picker.js","sourceRoot":"","sources":["../../../src/components/form/file-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,wBAAwB,EAAE,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ources":["../../../src/components/form/form-end.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-end.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-end.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,QAAO,GAsB1B,CAAA"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useState, useLayoutEffect } from 'react';
|
|
2
3
|
import { Theme } from 'termcast/src/theme';
|
|
4
|
+
import { useFocusContext, useFormScrollContext } from './index';
|
|
3
5
|
export const FormEnd = () => {
|
|
4
|
-
|
|
6
|
+
const { focusedField } = useFocusContext();
|
|
7
|
+
const scrollContext = useFormScrollContext();
|
|
8
|
+
const [isLastFieldFocused, setIsLastFieldFocused] = useState(false);
|
|
9
|
+
useLayoutEffect(() => {
|
|
10
|
+
if (!scrollContext || !focusedField) {
|
|
11
|
+
setIsLastFieldFocused(false);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const descendants = Object.values(scrollContext.descendantsContext.map.current)
|
|
15
|
+
.filter((item) => item.index !== -1 && item.props?.id)
|
|
16
|
+
.sort((a, b) => a.index - b.index);
|
|
17
|
+
if (descendants.length === 0) {
|
|
18
|
+
setIsLastFieldFocused(false);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const lastField = descendants[descendants.length - 1];
|
|
22
|
+
setIsLastFieldFocused(lastField.props?.id === focusedField);
|
|
23
|
+
}, [focusedField]);
|
|
24
|
+
return _jsx("text", { fg: isLastFieldFocused ? Theme.accent : Theme.text, children: "\u2514" });
|
|
5
25
|
};
|
|
6
26
|
//# sourceMappingURL=form-end.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-end.js","sourceRoot":"","sources":["../../../src/components/form/form-end.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"form-end.js","sourceRoot":"","sources":["../../../src/components/form/form-end.tsx"],"names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ElB,OAAO,eAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,uBAAU,CAAA;AAC3E,CAAC,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormEvent, FormEventType, FormItemRef, FormValue_2, FormValues_2, FormProps_2, FormItemProps_2 } from './types';
|
|
3
|
+
import type { TextFieldProps, TextFieldRef } from './text-field';
|
|
4
|
+
import type { PasswordFieldProps, PasswordFieldRef } from './password-field';
|
|
5
|
+
import type { TextAreaProps, TextAreaRef } from './text-area';
|
|
6
|
+
import type { CheckboxProps, CheckboxRef } from './checkbox';
|
|
7
|
+
import type { DropdownProps, DropdownRef, DropdownItemProps, DropdownSectionProps } from './dropdown';
|
|
8
|
+
import type { DatePickerProps, DatePickerRef, DatePickerType as DatePickerEnum } from './date-picker';
|
|
9
|
+
import type { TagPickerType } from './tagpicker';
|
|
10
|
+
import type { DescriptionProps } from './description';
|
|
11
|
+
import type { FilePickerProps, FilePickerRef } from './file-picker';
|
|
12
|
+
interface LinkAccessoryProps {
|
|
13
|
+
text: string;
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace Form {
|
|
17
|
+
type ItemProps<T extends FormValue_2> = FormItemProps_2<T>;
|
|
18
|
+
type Value = FormValue_2;
|
|
19
|
+
type Values = FormValues_2;
|
|
20
|
+
type Props = FormProps_2 & {
|
|
21
|
+
searchBarAccessory?: React.ReactElement<LinkAccessoryProps> | undefined | null;
|
|
22
|
+
};
|
|
23
|
+
type ItemReference = FormItemRef;
|
|
24
|
+
/**
|
|
25
|
+
* An interface describing event in callbacks {@link Form.Item.Props.onFocus} and {@link Form.Item.Props.onBlur}
|
|
26
|
+
*/
|
|
27
|
+
type Event<T extends FormValue_2> = FormEvent<T>;
|
|
28
|
+
namespace Event {
|
|
29
|
+
/**
|
|
30
|
+
* Types of Form event {@link Form.Event}
|
|
31
|
+
* * `focus` - the type will be returned for the event of {@link Form.Item.Props.onFocus} callback
|
|
32
|
+
* * `blur` - the type will be returned for the event of {@link Form.Item.Props.onBlur} callback
|
|
33
|
+
*/
|
|
34
|
+
type Type = FormEventType;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A Ref Type for the {@link Form.TextField}.
|
|
38
|
+
* Use refs to control your Form by calling `Form.TextField.focus()` or `Form.TextField.reset()` functions.
|
|
39
|
+
*/
|
|
40
|
+
type TextField = TextFieldRef;
|
|
41
|
+
namespace TextField {
|
|
42
|
+
/**
|
|
43
|
+
* Props of the {@link Form.TextField} React component.
|
|
44
|
+
*/
|
|
45
|
+
type Props = TextFieldProps;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A Ref Type for the {@link Form.PasswordField}.
|
|
49
|
+
* Use refs to control your Form by calling `Form.PasswordField.focus()` or `Form.PasswordField.reset()` functions.
|
|
50
|
+
*/
|
|
51
|
+
type PasswordField = PasswordFieldRef;
|
|
52
|
+
namespace PasswordField {
|
|
53
|
+
/**
|
|
54
|
+
* Props of the {@link Form.PasswordField} React component.
|
|
55
|
+
*/
|
|
56
|
+
type Props = PasswordFieldProps;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A Ref Type for the {@link Form.TextArea}.
|
|
60
|
+
* Use refs to control your Form by calling `Form.TextArea.focus()` or `Form.TextArea.reset()` functions.
|
|
61
|
+
*/
|
|
62
|
+
type TextArea = TextAreaRef;
|
|
63
|
+
namespace TextArea {
|
|
64
|
+
/**
|
|
65
|
+
* Props of the {@link Form.TextArea} React component.
|
|
66
|
+
*/
|
|
67
|
+
type Props = TextAreaProps;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A Ref Type for the {@link Form.Checkbox}.
|
|
71
|
+
* Use refs to control your Form by calling `Form.Checkbox.focus()` or `Form.Checkbox.reset()` functions.
|
|
72
|
+
*/
|
|
73
|
+
type Checkbox = CheckboxRef;
|
|
74
|
+
namespace Checkbox {
|
|
75
|
+
/**
|
|
76
|
+
* Props of the {@link Form.Checkbox} React component.
|
|
77
|
+
*/
|
|
78
|
+
type Props = CheckboxProps;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A Ref Type for the {@link Form.Dropdown}.
|
|
82
|
+
* Use refs to control your Form by calling `Form.Dropdown.focus()` or `Form.Dropdown.reset()` functions.
|
|
83
|
+
*/
|
|
84
|
+
type Dropdown = DropdownRef;
|
|
85
|
+
namespace Dropdown {
|
|
86
|
+
/**
|
|
87
|
+
* Props of the {@link Form.Dropdown} React component.
|
|
88
|
+
*/
|
|
89
|
+
type Props = DropdownProps;
|
|
90
|
+
namespace Item {
|
|
91
|
+
/**
|
|
92
|
+
* Props of the {@link Form.Dropdown.Item} React component.
|
|
93
|
+
*/
|
|
94
|
+
type Props = DropdownItemProps;
|
|
95
|
+
}
|
|
96
|
+
namespace Section {
|
|
97
|
+
/**
|
|
98
|
+
* Props of the {@link Form.Dropdown.Section} React component.
|
|
99
|
+
*/
|
|
100
|
+
type Props = DropdownSectionProps;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A Ref Type for the {@link Form.DatePicker}.
|
|
105
|
+
* Use refs to control your Form by calling `Form.DatePicker.focus()` or `Form.DatePicker.reset()` functions.
|
|
106
|
+
*/
|
|
107
|
+
type DatePicker = DatePickerRef;
|
|
108
|
+
namespace DatePicker {
|
|
109
|
+
/**
|
|
110
|
+
* Props of the {@link Form.DatePicker} React component.
|
|
111
|
+
*/
|
|
112
|
+
type Props = DatePickerProps;
|
|
113
|
+
/**
|
|
114
|
+
* The types of date components the user can pick with {@link Form.DatePicker}.
|
|
115
|
+
*/
|
|
116
|
+
type Type = DatePickerEnum;
|
|
117
|
+
}
|
|
118
|
+
namespace TagPicker {
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A Ref Type for the {@link Form.FilePicker}.
|
|
122
|
+
* Use refs to control your Form by calling `Form.FilePicker.focus()` or `Form.FilePicker.reset()` functions.
|
|
123
|
+
*/
|
|
124
|
+
type FilePicker = FilePickerRef;
|
|
125
|
+
namespace FilePicker {
|
|
126
|
+
/**
|
|
127
|
+
* Props of the {@link Form.FilePicker} React component.
|
|
128
|
+
*/
|
|
129
|
+
type Props = FilePickerProps;
|
|
130
|
+
}
|
|
131
|
+
namespace Separator {
|
|
132
|
+
/**
|
|
133
|
+
* Props of the {@link Form.Separator} React component.
|
|
134
|
+
*/
|
|
135
|
+
interface Props {
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
namespace Description {
|
|
139
|
+
/**
|
|
140
|
+
* Props of the {@link Form.Description} React component.
|
|
141
|
+
*/
|
|
142
|
+
type Props = DescriptionProps;
|
|
143
|
+
}
|
|
144
|
+
namespace LinkAccessory {
|
|
145
|
+
/**
|
|
146
|
+
* Props of the {@link Form.LinkAccessory} React component.
|
|
147
|
+
*/
|
|
148
|
+
type Props = LinkAccessoryProps;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
interface FormType {
|
|
152
|
+
(props: Form.Props): any;
|
|
153
|
+
TextField: React.ForwardRefExoticComponent<Form.TextField.Props & React.RefAttributes<Form.TextField>>;
|
|
154
|
+
PasswordField: React.ForwardRefExoticComponent<Form.PasswordField.Props & React.RefAttributes<Form.PasswordField>>;
|
|
155
|
+
TextArea: React.ForwardRefExoticComponent<Form.TextArea.Props & React.RefAttributes<Form.TextArea>>;
|
|
156
|
+
Checkbox: React.ForwardRefExoticComponent<Form.Checkbox.Props & React.RefAttributes<Form.Checkbox>>;
|
|
157
|
+
Dropdown: {
|
|
158
|
+
(props: Form.Dropdown.Props): any;
|
|
159
|
+
Item: (props: Form.Dropdown.Item.Props) => any;
|
|
160
|
+
Section: (props: Form.Dropdown.Section.Props) => any;
|
|
161
|
+
};
|
|
162
|
+
DatePicker: {
|
|
163
|
+
(props: Form.DatePicker.Props): any;
|
|
164
|
+
Type: typeof DatePickerEnum;
|
|
165
|
+
};
|
|
166
|
+
TagPicker: TagPickerType;
|
|
167
|
+
FilePicker: React.ForwardRefExoticComponent<Form.FilePicker.Props & React.RefAttributes<Form.FilePicker>>;
|
|
168
|
+
Separator: (props: Form.Separator.Props) => any;
|
|
169
|
+
Description: (props: Form.Description.Props) => any;
|
|
170
|
+
LinkAccessory: (props: Form.LinkAccessory.Props) => any;
|
|
171
|
+
}
|
|
172
|
+
export declare const Form: FormType;
|
|
173
|
+
export {};
|
|
174
|
+
//# sourceMappingURL=form-type-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-type-only.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-type-only.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAGH,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EAClB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EACR,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACR,eAAe,EACf,aAAa,EACb,cAAc,IAAI,cAAc,EACnC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,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../src/components/form/form-type-only.tsx"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ScrollBoxRenderable, BoxRenderable } from '@opentui/core';
|
|
3
3
|
import { DescendantContextType } from 'termcast/src/descendants';
|
|
4
|
-
import { FormValues, FormProps } from './types';
|
|
4
|
+
import { FormValues, FormProps, LinkAccessoryProps } from './types';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export { useFormContext } from 'react-hook-form';
|
|
7
7
|
interface FormFieldDescendant {
|
|
@@ -21,6 +21,7 @@ export declare const useFormScrollContext: () => FormScrollContextValue | null;
|
|
|
21
21
|
interface FocusContextValue {
|
|
22
22
|
focusedField: string | null;
|
|
23
23
|
setFocusedField: (id: string | null) => void;
|
|
24
|
+
isLoading: boolean;
|
|
24
25
|
}
|
|
25
26
|
export declare const useFocusContext: () => FocusContextValue;
|
|
26
27
|
interface FormSubmitContextValue {
|
|
@@ -57,6 +58,7 @@ interface FormType {
|
|
|
57
58
|
FilePicker: (props: FilePickerProps) => any;
|
|
58
59
|
Separator: () => any;
|
|
59
60
|
Description: (props: DescriptionProps) => any;
|
|
61
|
+
LinkAccessory: (props: LinkAccessoryProps) => any;
|
|
60
62
|
}
|
|
61
63
|
export declare const Form: FormType;
|
|
62
64
|
//# sourceMappingURL=index.d.ts.map
|