termcast 1.3.21 → 1.3.24
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/build.d.ts.map +1 -1
- package/dist/build.js +2 -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 +67 -31
- 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.map +1 -1
- package/dist/compile.js +22 -5
- 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 +100 -28
- 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 +140 -62
- 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/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/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 +25 -1
- package/dist/utils/run-command.d.ts.map +1 -1
- package/dist/utils/run-command.js +47 -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 -10
- 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/build.test.tsx +52 -0
- package/src/build.tsx +2 -1
- package/src/cli.tsx +78 -37
- package/src/compile.tsx +22 -5
- 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 +152 -34
- 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 +193 -74
- 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 +198 -92
- 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 +213 -89
- package/src/examples/list-with-toast.vitest.tsx +4 -4
- package/src/examples/simple-file-picker.vitest.tsx +61 -471
- package/src/examples/simple-grid.vitest.tsx +238 -233
- package/src/examples/simple-navigation.tsx +15 -7
- package/src/examples/simple-navigation.vitest.tsx +121 -210
- 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/extensions/dev.tsx +74 -7
- package/src/extensions/dev.vitest.tsx +97 -31
- 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/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 +75 -6
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { test, expect, afterEach, beforeEach } from 'vitest';
|
|
2
|
+
import { launchTerminal } from 'tuistory/src';
|
|
3
|
+
let session;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
session = await launchTerminal({
|
|
6
|
+
command: 'bun',
|
|
7
|
+
args: ['src/examples/simple-grid.tsx'],
|
|
8
|
+
cols: 70,
|
|
9
|
+
rows: 25,
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
session?.close();
|
|
14
|
+
});
|
|
15
|
+
test('grid navigation and display', async () => {
|
|
16
|
+
const initialSnapshot = await session.text({
|
|
17
|
+
waitFor: (text) => {
|
|
18
|
+
// wait for grid to show up with all sections and items
|
|
19
|
+
return (/Simple Grid Example/i.test(text) &&
|
|
20
|
+
text.includes('Fruits') &&
|
|
21
|
+
text.includes('Animals') &&
|
|
22
|
+
text.includes('Others') &&
|
|
23
|
+
text.includes('Apple'));
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
expect(initialSnapshot).toMatchInlineSnapshot(`
|
|
27
|
+
"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
Search items...
|
|
33
|
+
|
|
34
|
+
Fruits ▲
|
|
35
|
+
›Apple █
|
|
36
|
+
Banana █
|
|
37
|
+
Cherry
|
|
38
|
+
|
|
39
|
+
Animals
|
|
40
|
+
Dog
|
|
41
|
+
Cat
|
|
42
|
+
Rabbit
|
|
43
|
+
|
|
44
|
+
Others
|
|
45
|
+
House
|
|
46
|
+
Car
|
|
47
|
+
Rocket ▼
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
↵ select ↑↓ navigate ^k actions"
|
|
51
|
+
`);
|
|
52
|
+
// Navigate down
|
|
53
|
+
await session.press('down');
|
|
54
|
+
const afterDownSnapshot = await session.text();
|
|
55
|
+
expect(afterDownSnapshot).toMatchInlineSnapshot(`
|
|
56
|
+
"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
Search items...
|
|
62
|
+
|
|
63
|
+
Fruits ▲
|
|
64
|
+
Apple █
|
|
65
|
+
›Banana █
|
|
66
|
+
Cherry
|
|
67
|
+
|
|
68
|
+
Animals
|
|
69
|
+
Dog
|
|
70
|
+
Cat
|
|
71
|
+
Rabbit
|
|
72
|
+
|
|
73
|
+
Others
|
|
74
|
+
House
|
|
75
|
+
Car
|
|
76
|
+
Rocket ▼
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
↵ select ↑↓ navigate ^k actions"
|
|
80
|
+
`);
|
|
81
|
+
// Navigate right to Animals section
|
|
82
|
+
await session.press('down');
|
|
83
|
+
await session.press('down');
|
|
84
|
+
const animalsSnapshot = await session.text();
|
|
85
|
+
expect(animalsSnapshot).toMatchInlineSnapshot(`
|
|
86
|
+
"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
Search items...
|
|
92
|
+
|
|
93
|
+
Fruits ▲
|
|
94
|
+
Apple █
|
|
95
|
+
Banana █
|
|
96
|
+
Cherry
|
|
97
|
+
|
|
98
|
+
Animals
|
|
99
|
+
›Dog
|
|
100
|
+
Cat
|
|
101
|
+
Rabbit
|
|
102
|
+
|
|
103
|
+
Others
|
|
104
|
+
House
|
|
105
|
+
Car
|
|
106
|
+
Rocket ▼
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
↵ select ↑↓ navigate ^k actions"
|
|
110
|
+
`);
|
|
111
|
+
// Open actions with ctrl+k
|
|
112
|
+
await session.press(['ctrl', 'k']);
|
|
113
|
+
const actionsSnapshot = await session.text();
|
|
114
|
+
expect(actionsSnapshot).toMatchInlineSnapshot(`
|
|
115
|
+
"
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
119
|
+
|
|
120
|
+
Search items...
|
|
121
|
+
|
|
122
|
+
Fruits ▲
|
|
123
|
+
┃ ┃
|
|
124
|
+
┃ esc ┃
|
|
125
|
+
┃ ┃
|
|
126
|
+
┃ Search actions... ┃
|
|
127
|
+
┃ ┃
|
|
128
|
+
┃ ›Show Details ┃
|
|
129
|
+
┃ Copy Emoji ⌃C ┃
|
|
130
|
+
┃ ┃
|
|
131
|
+
┃ ┃
|
|
132
|
+
┃ ┃
|
|
133
|
+
┃ ┃
|
|
134
|
+
┃ ┃
|
|
135
|
+
┃ ┃
|
|
136
|
+
┃ ┃
|
|
137
|
+
┃ ┃
|
|
138
|
+
┃ ┃
|
|
139
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
140
|
+
┃ ┃"
|
|
141
|
+
`);
|
|
142
|
+
// Close actions with escape
|
|
143
|
+
await session.press('esc');
|
|
144
|
+
const afterEscapeSnapshot = await session.text();
|
|
145
|
+
expect(afterEscapeSnapshot).toMatchInlineSnapshot(`
|
|
146
|
+
"
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
Search items...
|
|
152
|
+
|
|
153
|
+
Fruits ▲
|
|
154
|
+
Apple █
|
|
155
|
+
Banana █
|
|
156
|
+
Cherry
|
|
157
|
+
|
|
158
|
+
Animals
|
|
159
|
+
›Dog
|
|
160
|
+
Cat
|
|
161
|
+
Rabbit
|
|
162
|
+
|
|
163
|
+
Others
|
|
164
|
+
House
|
|
165
|
+
Car
|
|
166
|
+
Rocket ▼
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
↵ select ↑↓ navigate ^k actions"
|
|
170
|
+
`);
|
|
171
|
+
}, 15000);
|
|
172
|
+
test('grid search functionality', async () => {
|
|
173
|
+
await session.text({
|
|
174
|
+
waitFor: (text) => {
|
|
175
|
+
// wait for grid to show up
|
|
176
|
+
return /Simple Grid Example/i.test(text);
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
// Search for "cat"
|
|
180
|
+
await session.type('cat');
|
|
181
|
+
const searchCatSnapshot = await session.text({
|
|
182
|
+
waitFor: (text) => {
|
|
183
|
+
return /cat/i.test(text);
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
expect(searchCatSnapshot).toMatchInlineSnapshot(`
|
|
187
|
+
"
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
191
|
+
|
|
192
|
+
cat
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
Cat
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
↵ select ↑↓ navigate ^k actions"
|
|
211
|
+
`);
|
|
212
|
+
// Clear search and search for "space"
|
|
213
|
+
await session.press('backspace');
|
|
214
|
+
await session.press('backspace');
|
|
215
|
+
await session.press('backspace');
|
|
216
|
+
await session.type('space');
|
|
217
|
+
const searchSpaceSnapshot = await session.text({
|
|
218
|
+
waitFor: (text) => {
|
|
219
|
+
return /space/i.test(text);
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
expect(searchSpaceSnapshot).toMatchInlineSnapshot(`
|
|
223
|
+
"
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
227
|
+
|
|
228
|
+
space
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
Rocket
|
|
233
|
+
Star
|
|
234
|
+
Moon
|
|
235
|
+
Sun
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
↵ select ↑↓ navigate ^k actions"
|
|
247
|
+
`);
|
|
248
|
+
// Clear search completely
|
|
249
|
+
await session.press('backspace');
|
|
250
|
+
await session.press('backspace');
|
|
251
|
+
await session.press('backspace');
|
|
252
|
+
await session.press('backspace');
|
|
253
|
+
await session.press('backspace');
|
|
254
|
+
const clearedSearchSnapshot = await session.text();
|
|
255
|
+
expect(clearedSearchSnapshot).toMatchInlineSnapshot(`
|
|
256
|
+
"
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
260
|
+
|
|
261
|
+
Search items...
|
|
262
|
+
|
|
263
|
+
Fruits ▲
|
|
264
|
+
›Apple █
|
|
265
|
+
Banana █
|
|
266
|
+
Cherry
|
|
267
|
+
|
|
268
|
+
Animals
|
|
269
|
+
Dog
|
|
270
|
+
Cat
|
|
271
|
+
Rabbit
|
|
272
|
+
|
|
273
|
+
Others
|
|
274
|
+
House
|
|
275
|
+
Car
|
|
276
|
+
Rocket ▼
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
↵ select ↑↓ navigate ^k actions"
|
|
280
|
+
`);
|
|
281
|
+
// Search for something that doesn't exist
|
|
282
|
+
await session.type('xyz123');
|
|
283
|
+
const noResultsSnapshot = await session.text({
|
|
284
|
+
waitFor: (text) => {
|
|
285
|
+
return /xyz123/i.test(text);
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
expect(noResultsSnapshot).toMatchInlineSnapshot(`
|
|
289
|
+
"
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
293
|
+
|
|
294
|
+
xyz123
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
↵ select ↑↓ navigate ^k actions"
|
|
313
|
+
`);
|
|
314
|
+
}, 10000);
|
|
315
|
+
test('grid item selection and actions', async () => {
|
|
316
|
+
await session.text({
|
|
317
|
+
waitFor: (text) => {
|
|
318
|
+
// wait for grid to show up
|
|
319
|
+
return /Simple Grid Example/i.test(text);
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
// Select first item and open actions
|
|
323
|
+
await session.press('enter');
|
|
324
|
+
const firstItemActionsSnapshot = await session.text();
|
|
325
|
+
expect(firstItemActionsSnapshot).toMatchInlineSnapshot(`
|
|
326
|
+
"
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
330
|
+
|
|
331
|
+
Search items...
|
|
332
|
+
|
|
333
|
+
Fruits ▲
|
|
334
|
+
┃ ┃
|
|
335
|
+
┃ esc ┃
|
|
336
|
+
┃ ┃
|
|
337
|
+
┃ Search actions... ┃
|
|
338
|
+
┃ ┃
|
|
339
|
+
┃ ›Show Details ┃
|
|
340
|
+
┃ Copy Emoji ⌃C ┃
|
|
341
|
+
┃ ┃
|
|
342
|
+
┃ ┃
|
|
343
|
+
┃ ┃
|
|
344
|
+
┃ ┃
|
|
345
|
+
┃ ┃
|
|
346
|
+
┃ ┃
|
|
347
|
+
┃ ┃
|
|
348
|
+
┃ ┃
|
|
349
|
+
┃ ┃
|
|
350
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
351
|
+
┃ ┃"
|
|
352
|
+
`);
|
|
353
|
+
// Navigate down in actions
|
|
354
|
+
await session.press('down');
|
|
355
|
+
const secondActionSnapshot = await session.text();
|
|
356
|
+
expect(secondActionSnapshot).toMatchInlineSnapshot(`
|
|
357
|
+
"
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
361
|
+
|
|
362
|
+
Search items...
|
|
363
|
+
|
|
364
|
+
Fruits ▲
|
|
365
|
+
┃ ┃
|
|
366
|
+
┃ esc ┃
|
|
367
|
+
┃ ┃
|
|
368
|
+
┃ Search actions... ┃
|
|
369
|
+
┃ ┃
|
|
370
|
+
┃ Show Details ┃
|
|
371
|
+
┃ ›Copy Emoji ⌃C ┃
|
|
372
|
+
┃ ┃
|
|
373
|
+
┃ ┃
|
|
374
|
+
┃ ┃
|
|
375
|
+
┃ ┃
|
|
376
|
+
┃ ┃
|
|
377
|
+
┃ ┃
|
|
378
|
+
┃ ┃
|
|
379
|
+
┃ ┃
|
|
380
|
+
┃ ┃
|
|
381
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
382
|
+
┃ ┃"
|
|
383
|
+
`);
|
|
384
|
+
// Select "Copy Emoji" action
|
|
385
|
+
await session.press('enter');
|
|
386
|
+
const afterCopySnapshot = await session.text();
|
|
387
|
+
expect(afterCopySnapshot).toMatchInlineSnapshot(`
|
|
388
|
+
"
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
392
|
+
|
|
393
|
+
Search items...
|
|
394
|
+
|
|
395
|
+
Fruits ▲
|
|
396
|
+
›Apple █
|
|
397
|
+
Banana █
|
|
398
|
+
Cherry
|
|
399
|
+
|
|
400
|
+
Animals
|
|
401
|
+
Dog
|
|
402
|
+
Cat
|
|
403
|
+
Rabbit
|
|
404
|
+
|
|
405
|
+
Others
|
|
406
|
+
House
|
|
407
|
+
Car
|
|
408
|
+
Rocket ▼
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
↵ select ↑↓ navigate ^k actions"
|
|
412
|
+
`);
|
|
413
|
+
}, 10000);
|
|
414
|
+
test('grid mouse interaction', async () => {
|
|
415
|
+
await session.text({
|
|
416
|
+
waitFor: (text) => {
|
|
417
|
+
// wait for grid to show up
|
|
418
|
+
return /Simple Grid Example/i.test(text);
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
// Click on "Dog" item
|
|
422
|
+
await session.click('Dog', { first: true });
|
|
423
|
+
const afterClickDogSnapshot = await session.text();
|
|
424
|
+
expect(afterClickDogSnapshot).toMatchInlineSnapshot(`
|
|
425
|
+
"
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
429
|
+
|
|
430
|
+
Search items...
|
|
431
|
+
|
|
432
|
+
Fruits ▲
|
|
433
|
+
Apple █
|
|
434
|
+
Banana █
|
|
435
|
+
Cherry
|
|
436
|
+
|
|
437
|
+
Animals
|
|
438
|
+
›Dog
|
|
439
|
+
Cat
|
|
440
|
+
Rabbit
|
|
441
|
+
|
|
442
|
+
Others
|
|
443
|
+
House
|
|
444
|
+
Car
|
|
445
|
+
Rocket ▼
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
↵ select ↑↓ navigate ^k actions"
|
|
449
|
+
`);
|
|
450
|
+
// Navigate down to make "Star" visible (it's below Rocket in Others section)
|
|
451
|
+
// Star is not visible with rows: 25 initially, so we need to scroll/navigate to it
|
|
452
|
+
await session.press('down'); // Cat
|
|
453
|
+
await session.press('down'); // Rabbit
|
|
454
|
+
await session.press('down'); // House
|
|
455
|
+
await session.press('down'); // Car
|
|
456
|
+
await session.press('down'); // Rocket
|
|
457
|
+
await session.press('down'); // Star (now visible)
|
|
458
|
+
// Click on "Star" item (now visible after navigation)
|
|
459
|
+
await session.click('Star', { first: true });
|
|
460
|
+
const afterClickStarSnapshot = await session.text();
|
|
461
|
+
expect(afterClickStarSnapshot).toMatchInlineSnapshot(`
|
|
462
|
+
"
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
466
|
+
|
|
467
|
+
Search items...
|
|
468
|
+
|
|
469
|
+
Apple ▲
|
|
470
|
+
┃ ┃
|
|
471
|
+
┃ esc ┃
|
|
472
|
+
┃ ┃
|
|
473
|
+
┃ Search actions... ┃
|
|
474
|
+
┃ ┃
|
|
475
|
+
┃ ›Show Details ┃
|
|
476
|
+
┃ Copy Emoji ⌃C ┃
|
|
477
|
+
┃ ┃
|
|
478
|
+
┃ ┃
|
|
479
|
+
┃ ┃
|
|
480
|
+
┃ ┃
|
|
481
|
+
┃ ┃
|
|
482
|
+
┃ ┃
|
|
483
|
+
┃ ┃
|
|
484
|
+
┃ ┃
|
|
485
|
+
┃ ┃
|
|
486
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
487
|
+
┃ ┃"
|
|
488
|
+
`);
|
|
489
|
+
// Click on "Apple" to go back to first section
|
|
490
|
+
await session.click('Apple', { first: true });
|
|
491
|
+
const afterClickAppleSnapshot = await session.text();
|
|
492
|
+
expect(afterClickAppleSnapshot).toMatchInlineSnapshot(`
|
|
493
|
+
"
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
Simple Grid Example ────────────────────────────────────────────
|
|
497
|
+
|
|
498
|
+
Search items...
|
|
499
|
+
|
|
500
|
+
Apple ▲
|
|
501
|
+
┃ ┃
|
|
502
|
+
┃ esc ┃
|
|
503
|
+
┃ ┃
|
|
504
|
+
┃ Search actions... ┃
|
|
505
|
+
┃ ┃
|
|
506
|
+
┃ ›Show Details ┃
|
|
507
|
+
┃ Copy Emoji ⌃C ┃
|
|
508
|
+
┃ ┃
|
|
509
|
+
┃ ┃
|
|
510
|
+
┃ ┃
|
|
511
|
+
┃ ┃
|
|
512
|
+
┃ ┃
|
|
513
|
+
┃ ┃
|
|
514
|
+
┃ ┃
|
|
515
|
+
┃ ┃
|
|
516
|
+
┃ ┃
|
|
517
|
+
┃ ↵ select ↑↓ navigate ┃
|
|
518
|
+
┃ ┃"
|
|
519
|
+
`);
|
|
520
|
+
}, 10000);
|
|
521
|
+
//# sourceMappingURL=simple-grid.vitest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-grid.vitest.js","sourceRoot":"","sources":["../../src/examples/simple-grid.vitest.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAW,MAAM,cAAc,CAAA;AAEtD,IAAI,OAAgB,CAAA;AAEpB,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,OAAO,GAAG,MAAM,cAAc,CAAC;QAC7B,OAAO,EAAE,KAAK;Q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;;;;;;;;;;;;;;;;;;;;;;;;;GA2BrD,CAAC,CAAA;AACJ,CAAC,EAAE,KAAK,CAAC,CAAA"}
|
|
@@ -5,12 +5,18 @@ import List from 'termcast';
|
|
|
5
5
|
import { Action, ActionPanel } from 'termcast';
|
|
6
6
|
import { useNavigation } from 'termcast/src/internal/navigation';
|
|
7
7
|
import { TermcastProvider } from 'termcast/src/internal/providers';
|
|
8
|
-
function
|
|
8
|
+
function GoBackAction() {
|
|
9
9
|
const { pop } = useNavigation();
|
|
10
|
-
return
|
|
10
|
+
return _jsx(Action, { title: 'Go Back', onAction: () => pop() });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function DetailView({ title }) {
|
|
13
|
+
return (_jsx(List, { searchBarPlaceholder: 'Detail view - Press ESC to go back', navigationTitle: `Detail: ${title}`, children: _jsx(List.Section, { title: 'Details', children: _jsx(List.Item, { id: 'back', title: `This is the detail view for ${title}`, subtitle: 'Press Enter to go back or ESC to navigate back', actions: _jsxs(ActionPanel, { children: [_jsx(GoBackAction, {}), _jsx(Action.CopyToClipboard, { content: title, title: 'Copy Title' })] }) }) }) }));
|
|
14
|
+
}
|
|
15
|
+
function OpenDetailsAction({ title }) {
|
|
13
16
|
const { push } = useNavigation();
|
|
17
|
+
return (_jsx(Action, { title: 'Open Details', onAction: () => push(_jsx(DetailView, { title: title })) }));
|
|
18
|
+
}
|
|
19
|
+
function MainView() {
|
|
14
20
|
const items = [
|
|
15
21
|
{
|
|
16
22
|
id: 'first',
|
|
@@ -28,7 +34,7 @@ function MainView() {
|
|
|
28
34
|
subtitle: 'Navigate to third detail',
|
|
29
35
|
},
|
|
30
36
|
];
|
|
31
|
-
return (_jsx(List, { searchBarPlaceholder: 'Main view', navigationTitle: 'Navigation Example', children: _jsx(List.Section, { title: 'Items', children: items.map((item) => (_jsx(List.Item, { id: item.id, title: item.title, subtitle: item.subtitle, actions: _jsxs(ActionPanel, { children: [_jsx(
|
|
37
|
+
return (_jsx(List, { searchBarPlaceholder: 'Main view', navigationTitle: 'Navigation Example', children: _jsx(List.Section, { title: 'Items', children: items.map((item) => (_jsx(List.Item, { id: item.id, title: item.title, subtitle: item.subtitle, actions: _jsxs(ActionPanel, { children: [_jsx(OpenDetailsAction, { title: item.title }), _jsx(Action.CopyToClipboard, { content: item.title, title: 'Copy Title' })] }) }))) }) }));
|
|
32
38
|
}
|
|
33
39
|
function App() {
|
|
34
40
|
return (_jsx(TermcastProvider, { children: _jsx(MainView, {}) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-navigation.js","sourceRoot":"","sources":["../../src/examples/simple-navigation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,IAAI,MAAM,UAAU,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAElE,SAAS,
|
|
1
|
+
{"version":3,"file":"simple-navigation.js","sourceRoot":"","sources":["../../src/examples/simple-navigation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,IAAI,MAAM,UAAU,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAElE,SAAS,YAAY;IACnB,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,EAAE,CAAA;IAC/B,OAAO,KAAC,MAAM,IAAC,KAAK,EAAC,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AoB,YACzE,KAAC,IAAI,CAAC,OAAO,IAAC,KAAK,EAAC,OAAO,YACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,KAAC,IAAI,CAAC,IAAI,IACR,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EACL,MAAC,WAAW,eACV,KAAC,iBAAiB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,EACxC,KAAC,MAAM,CAAC,eAAe,IACrB,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,KAAK,EAAC,YAAY,GAClB,IACU,GAEhB,CACH,CAAC,GACW,GACV,CACR,CAAA;AACH,CAAC;AAED,SAAS,GAAG;IACV,OAAO,CACL,KAAC,gBAAgB,cACf,KAAC,QAAQ,KAAG,GACK,CACpB,CAAA;AACH,CAAC;AAED,MAAM,QAAQ,GAAG,MAAM,iBAAiB,EAAE,CAAA;AAC1C,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-navigation.vitest.d.ts","sourceRoot":"","sources":["../../src/examples/simple-navigation.vitest.tsx"],"names":[],"mappings":""}
|