@celljs/ta-web 4.9.1 → 4.11.0
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/README.en.md +8 -7
- package/README.md +8 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +20 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +25 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +14 -2
- package/esm/browser/assistant/assistant-task-util.js +62 -13
- package/esm/browser/assistant/assistant-view.js +117 -71
- package/esm/browser/assistant/assistant.d.ts +28 -5
- package/esm/browser/assistant/assistant.js +96 -22
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +28 -1
- package/esm/browser/chat/chat-stores.d.ts +62 -0
- package/esm/browser/chat/chat-stores.js +129 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +45 -17
- package/esm/browser/chat/chat.d.ts +41 -41
- package/esm/browser/chat/chat.js +276 -190
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +11 -5
- package/esm/browser/components/app-nav.js +39 -17
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +12 -6
- package/esm/browser/components/app-view.js +150 -36
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +93 -8
- package/esm/browser/components/chat-list.js +411 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +18 -8
- package/esm/browser/components/composer-box.js +199 -52
- package/esm/browser/components/composer.d.ts +13 -6
- package/esm/browser/components/composer.js +8 -5
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +136 -6
- package/esm/browser/components/conversation-scroll.js +467 -108
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -2
- package/esm/browser/components/earlier-messages.js +42 -23
- package/esm/browser/components/editor-area.d.ts +6 -20
- package/esm/browser/components/editor-area.js +10 -96
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +6 -3
- package/esm/browser/components/folder-picker.js +27 -9
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +5 -3
- package/esm/browser/components/icon.js +9 -9
- package/esm/browser/components/image-viewer.d.ts +132 -0
- package/esm/browser/components/image-viewer.js +434 -0
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +14 -0
- package/esm/browser/components/lightbox.js +25 -0
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +60 -14
- package/esm/browser/components/media.js +20 -12
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +22 -2
- package/esm/browser/components/message-footer.js +47 -13
- package/esm/browser/components/message-list.d.ts +78 -6
- package/esm/browser/components/message-list.js +281 -36
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +24 -4
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +37 -3
- package/esm/browser/components/nav-places.js +32 -7
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +27 -2
- package/esm/browser/components/phone-shell.js +98 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +8 -3
- package/esm/browser/components/session-settings.js +15 -1
- package/esm/browser/components/session-view.js +36 -22
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +69 -15
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +21 -14
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +51 -0
- package/esm/browser/components/voice-talk.js +242 -0
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +134 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +12 -0
- package/esm/browser/device/long-press.js +44 -13
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +67 -78
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +154 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +414 -108
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +15 -2
- package/esm/browser/extension/web-api-components.d.ts +269 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +385 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +218 -521
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +346 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +66 -6
- package/esm/browser/extension/web-extension-protocol.js +41 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +41 -68
- package/esm/browser/extension/web-extensions.js +188 -487
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -0
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +105 -3
- package/esm/browser/i18n/messages.d.ts +104 -2
- package/esm/browser/i18n/messages.js +215 -11
- package/esm/browser/index.d.ts +15 -0
- package/esm/browser/index.js +15 -0
- package/esm/browser/links/links-protocol.d.ts +5 -0
- package/esm/browser/links/links.d.ts +19 -7
- package/esm/browser/links/links.js +57 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +26 -1
- package/esm/browser/notices/notices.d.ts +3 -1
- package/esm/browser/notices/notices.js +26 -12
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +151 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +109 -0
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +17 -0
- package/esm/browser/settings/settings-protocol.js +20 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +95 -17
- package/esm/browser/style/device.js +42 -5
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +252 -67
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +38 -2
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +76 -9
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +2 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +22 -2
- package/esm/browser/util/markdown.js +120 -6
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +35 -2
- package/esm/browser/util/process.js +79 -4
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +49 -6
- package/esm/browser/util/voice.js +271 -26
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +61 -0
- package/esm/browser/workbench-calls.js +146 -0
- package/esm/browser/workbench-protocol.d.ts +36 -3
- package/esm/browser/workbench-util.d.ts +22 -4
- package/esm/browser/workbench-util.js +37 -7
- package/esm/browser/workbench.d.ts +47 -6
- package/esm/browser/workbench.js +191 -43
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +21 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +25 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +14 -2
- package/lib/browser/assistant/assistant-task-util.js +62 -13
- package/lib/browser/assistant/assistant-view.js +113 -67
- package/lib/browser/assistant/assistant.d.ts +28 -5
- package/lib/browser/assistant/assistant.js +96 -22
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +28 -1
- package/lib/browser/chat/chat-stores.d.ts +63 -0
- package/lib/browser/chat/chat-stores.js +133 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +44 -16
- package/lib/browser/chat/chat.d.ts +41 -41
- package/lib/browser/chat/chat.js +277 -191
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +11 -5
- package/lib/browser/components/app-nav.js +35 -13
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +12 -6
- package/lib/browser/components/app-view.js +145 -31
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +93 -8
- package/lib/browser/components/chat-list.js +412 -60
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +18 -8
- package/lib/browser/components/composer-box.js +198 -51
- package/lib/browser/components/composer.d.ts +13 -6
- package/lib/browser/components/composer.js +7 -4
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +136 -6
- package/lib/browser/components/conversation-scroll.js +469 -109
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -2
- package/lib/browser/components/earlier-messages.js +44 -24
- package/lib/browser/components/editor-area.d.ts +6 -20
- package/lib/browser/components/editor-area.js +11 -97
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +6 -3
- package/lib/browser/components/folder-picker.js +27 -9
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +5 -3
- package/lib/browser/components/icon.js +11 -9
- package/lib/browser/components/image-viewer.d.ts +133 -0
- package/lib/browser/components/image-viewer.js +472 -0
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +15 -0
- package/lib/browser/components/lightbox.js +61 -0
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +60 -14
- package/lib/browser/components/media.js +21 -13
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +22 -2
- package/lib/browser/components/message-footer.js +49 -12
- package/lib/browser/components/message-list.d.ts +78 -6
- package/lib/browser/components/message-list.js +281 -32
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +23 -3
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +37 -3
- package/lib/browser/components/nav-places.js +35 -7
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +27 -2
- package/lib/browser/components/phone-shell.js +99 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +8 -3
- package/lib/browser/components/session-settings.js +15 -1
- package/lib/browser/components/session-view.js +32 -18
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +67 -13
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +21 -14
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +52 -0
- package/lib/browser/components/voice-talk.js +281 -0
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +171 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +12 -0
- package/lib/browser/device/long-press.js +44 -13
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +66 -77
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +153 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +418 -109
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +14 -1
- package/lib/browser/extension/web-api-components.d.ts +270 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +386 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +218 -521
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +383 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +66 -6
- package/lib/browser/extension/web-extension-protocol.js +42 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +41 -68
- package/lib/browser/extension/web-extensions.js +184 -516
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -0
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +105 -3
- package/lib/browser/i18n/messages.d.ts +104 -2
- package/lib/browser/i18n/messages.js +215 -11
- package/lib/browser/index.d.ts +15 -0
- package/lib/browser/index.js +15 -0
- package/lib/browser/links/links-protocol.d.ts +5 -0
- package/lib/browser/links/links.d.ts +19 -7
- package/lib/browser/links/links.js +57 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +26 -1
- package/lib/browser/notices/notices.d.ts +3 -1
- package/lib/browser/notices/notices.js +26 -12
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +157 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +113 -0
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +17 -0
- package/lib/browser/settings/settings-protocol.js +21 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +95 -17
- package/lib/browser/style/device.js +42 -5
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +252 -67
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +38 -2
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +76 -9
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +2 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +22 -2
- package/lib/browser/util/markdown.js +120 -6
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +35 -2
- package/lib/browser/util/process.js +80 -5
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +49 -6
- package/lib/browser/util/voice.js +271 -26
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +62 -0
- package/lib/browser/workbench-calls.js +150 -0
- package/lib/browser/workbench-protocol.d.ts +36 -3
- package/lib/browser/workbench-util.d.ts +22 -4
- package/lib/browser/workbench-util.js +38 -8
- package/lib/browser/workbench.d.ts +47 -6
- package/lib/browser/workbench.js +189 -41
- package/package.json +14 -11
- package/public/launch.svg +46 -42
|
@@ -5,6 +5,15 @@ import { ModelPickerUtil, useModelSource } from './model-picker.js';
|
|
|
5
5
|
export var SessionSettingsUtil;
|
|
6
6
|
(function (SessionSettingsUtil) {
|
|
7
7
|
SessionSettingsUtil.EMPTY = { models: [], levels: [], commands: [] };
|
|
8
|
+
/**
|
|
9
|
+
* Whether the settings are loaded again: at once, a run going or not, so that a conversation opened
|
|
10
|
+
* while it works (a new one, the first message just sent) lists its models from the start, and after
|
|
11
|
+
* each run, which an extension or another client may have changed them in.
|
|
12
|
+
*/
|
|
13
|
+
function reloads(wasWorking, working) {
|
|
14
|
+
return wasWorking === undefined || (wasWorking && !working);
|
|
15
|
+
}
|
|
16
|
+
SessionSettingsUtil.reloads = reloads;
|
|
8
17
|
function modelRef(model) {
|
|
9
18
|
return model ? `${model.provider}/${model.id}` : '';
|
|
10
19
|
}
|
|
@@ -31,6 +40,7 @@ export var SessionSettingsUtil;
|
|
|
31
40
|
label: t('ta.message.thinking'),
|
|
32
41
|
icon: React.createElement(Icon, { icon: Brain, size: 16 }),
|
|
33
42
|
detail: settings.thinkingLevel,
|
|
43
|
+
setting: true,
|
|
34
44
|
items: settings.levels.map(level => ({
|
|
35
45
|
key: level,
|
|
36
46
|
label: level,
|
|
@@ -73,10 +83,14 @@ export function useSessionSettings(server, settingsServer, store, working, t, on
|
|
|
73
83
|
.then(([state, { models }, { levels }, { commands }]) => setSettings({ models, model: SessionSettingsUtil.modelRef(state.model), thinkingLevel: state.thinkingLevel, levels, commands }))
|
|
74
84
|
.catch(() => undefined);
|
|
75
85
|
}, [server, sessionId]);
|
|
86
|
+
// Whether the session worked when it was last looked at; none for a session not looked at yet.
|
|
87
|
+
const last = React.useRef(undefined);
|
|
76
88
|
React.useEffect(() => {
|
|
77
|
-
|
|
89
|
+
var _a;
|
|
90
|
+
if (SessionSettingsUtil.reloads(((_a = last.current) === null || _a === void 0 ? void 0 : _a.load) === load ? last.current.working : undefined, working)) {
|
|
78
91
|
load();
|
|
79
92
|
}
|
|
93
|
+
last.current = { load, working };
|
|
80
94
|
}, [load, working]);
|
|
81
95
|
React.useEffect(() => store.onEvent(event => {
|
|
82
96
|
if (event.type === 'session_reloaded') {
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import { useInject } from '@celljs/react';
|
|
1
2
|
import { ArrowDown } from 'lucide-react';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { useKeyboardDismiss } from '../device/device.js';
|
|
4
|
-
import {
|
|
5
|
+
import { TaFiles } from '../files/files-protocol.js';
|
|
6
|
+
import { useNotices, useOpenLink, useSessionState, useSettings, useSettingsServer } from '../hooks.js';
|
|
5
7
|
import { useT } from '../i18n/use-t.js';
|
|
6
8
|
import { MessageUtil } from '../util/message.js';
|
|
7
9
|
import { TerminalText } from '../util/terminal-text.js';
|
|
8
10
|
import { Composer } from './composer.js';
|
|
9
11
|
import { useComposerAddons } from './composer-addons.js';
|
|
10
|
-
import { useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
|
|
12
|
+
import { SCROLL_SKIP, useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
|
|
11
13
|
import { DialogView } from './dialog-view.js';
|
|
12
|
-
import { useAsked, useEarlierMessages } from './earlier-messages.js';
|
|
14
|
+
import { useAsked, useEarlierMessages, useRowWindow } from './earlier-messages.js';
|
|
15
|
+
import { GrowBox } from './grow-box.js';
|
|
13
16
|
import { OpenLink } from './link.js';
|
|
14
17
|
import { FileUrls } from './media.js';
|
|
15
18
|
import { useMessageActions } from './message-actions.js';
|
|
16
19
|
import { MessageActions } from './message-footer.js';
|
|
17
|
-
import { ConversationSession, MessageList } from './message-list.js';
|
|
20
|
+
import { ConversationSession, MessageImages, MessageList } from './message-list.js';
|
|
18
21
|
import { useSessionSettings } from './session-settings.js';
|
|
19
22
|
import { TerminalArt } from './terminal-art.js';
|
|
20
23
|
/**
|
|
@@ -22,18 +25,20 @@ import { TerminalArt } from './terminal-art.js';
|
|
|
22
25
|
* opened stays quiet. A picture in it (a QR code to sign in) is drawn, and stays until the next notice of the
|
|
23
26
|
* session, which says how it went or brings a new code.
|
|
24
27
|
*/
|
|
25
|
-
function useSessionNotices(notices) {
|
|
28
|
+
function useSessionNotices(store, notices) {
|
|
26
29
|
const [, center] = useNotices();
|
|
30
|
+
// Of the store shown: one that took the place of another (attached for what the device showed) starts quiet too.
|
|
27
31
|
const seen = React.useRef(undefined);
|
|
28
32
|
const picture = React.useRef(undefined);
|
|
29
33
|
React.useEffect(() => {
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
var _a;
|
|
35
|
+
if (((_a = seen.current) === null || _a === void 0 ? void 0 : _a.store) !== store) {
|
|
36
|
+
seen.current = { store, ids: new Set(notices.map(notice => notice.id)) };
|
|
32
37
|
return;
|
|
33
38
|
}
|
|
34
39
|
for (const notice of notices) {
|
|
35
|
-
if (!seen.current.has(notice.id)) {
|
|
36
|
-
seen.current.add(notice.id);
|
|
40
|
+
if (!seen.current.ids.has(notice.id)) {
|
|
41
|
+
seen.current.ids.add(notice.id);
|
|
37
42
|
if (picture.current !== undefined) {
|
|
38
43
|
center.dismiss(picture.current);
|
|
39
44
|
picture.current = undefined;
|
|
@@ -43,7 +48,7 @@ function useSessionNotices(notices) {
|
|
|
43
48
|
picture.current = art ? id : undefined;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
|
-
}, [notices, center]);
|
|
51
|
+
}, [store, notices, center]);
|
|
47
52
|
}
|
|
48
53
|
/** What an extension shows above or below the message box (`setWidget`): its lines as a terminal draws them, a picture in them drawn. */
|
|
49
54
|
function WidgetView({ lines }) {
|
|
@@ -68,14 +73,17 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
68
73
|
const state = useSessionState(store);
|
|
69
74
|
const [, notices] = useNotices();
|
|
70
75
|
const asked = useAsked(state);
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
// Another store in the same view (the one attached for what the device showed) is no message sent.
|
|
77
|
+
const scroller = useConversationScroll(asked, { key: store.sessionId });
|
|
78
|
+
const rows = useRowWindow();
|
|
79
|
+
useEarlierMessages(store, state, scroller, rows);
|
|
73
80
|
const [away, toBottom] = useAwayFromBottom(scroller);
|
|
74
81
|
useKeyboardDismiss(scroller);
|
|
75
82
|
const fail = (cause) => notices.error(cause);
|
|
76
|
-
useSessionNotices(state.notices);
|
|
83
|
+
useSessionNotices(store, state.notices);
|
|
77
84
|
const { settings, actions } = useSessionSettings(server, useSettingsServer(), store, state.working, t, fail);
|
|
78
85
|
const composer = React.useRef(null);
|
|
86
|
+
const recentShots = useSettings()[0].settings.recentShots;
|
|
79
87
|
const cwd = info === null || info === void 0 ? void 0 : info.cwd;
|
|
80
88
|
const messageActions = useMessageActions(store, server, state.working, cwd, composer, onActivity);
|
|
81
89
|
// An extension puts text in the message box, as in pi's terminal.
|
|
@@ -94,8 +102,10 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
94
102
|
(_a = composer.current) === null || _a === void 0 ? void 0 : _a.setText(draftText);
|
|
95
103
|
}
|
|
96
104
|
}, [draftText]);
|
|
97
|
-
const
|
|
98
|
-
const
|
|
105
|
+
const files = useInject(TaFiles);
|
|
106
|
+
const fileUrl = React.useCallback(async (path) => files.loadable(await workspace.fileUrl(path, cwd)), [workspace, cwd, files]);
|
|
107
|
+
const namedPaths = React.useCallback(() => MessageUtil.namedPaths(store.state.messages), [store]);
|
|
108
|
+
const openLink = useOpenLink(cwd, namedPaths);
|
|
99
109
|
// biome-ignore lint/correctness/useExhaustiveDependencies: runs when a run starts or settles
|
|
100
110
|
React.useEffect(() => onActivity(), [state.working, onActivity]);
|
|
101
111
|
React.useEffect(() => {
|
|
@@ -110,6 +120,8 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
110
120
|
const title = (info === null || info === void 0 ? void 0 : info.sessionName) || (info ? MessageUtil.basename(info.cwd) : t('ta.session.title'));
|
|
111
121
|
const conversation = React.useMemo(() => ({ sessionId: store.sessionId, sessionFile: info === null || info === void 0 ? void 0 : info.sessionFile, cwd: info === null || info === void 0 ? void 0 : info.cwd, kind: 'chat', group: info === null || info === void 0 ? void 0 : info.group, title }), [store.sessionId, info === null || info === void 0 ? void 0 : info.sessionFile, info === null || info === void 0 ? void 0 : info.cwd, info === null || info === void 0 ? void 0 : info.group, title]);
|
|
112
122
|
const addons = useComposerAddons(conversation);
|
|
123
|
+
const outbox = React.useMemo(() => ({ resend: id => void store.resend(id), discard: id => store.discard(id) }), [store]);
|
|
124
|
+
const images = React.useCallback((timestamp, index) => server.getMessageImage(store.sessionId, timestamp, index), [server, store]);
|
|
113
125
|
return (React.createElement("section", { className: `ta-session ${compact ? 'ta-session-compact' : ''}` },
|
|
114
126
|
!compact && (React.createElement("header", { className: "ta-session-header" },
|
|
115
127
|
leading,
|
|
@@ -119,22 +131,24 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
119
131
|
trailing)),
|
|
120
132
|
React.createElement("div", { className: "ta-scroll ta-conversation", ref: scroller },
|
|
121
133
|
React.createElement("div", { className: "ta-thread" },
|
|
122
|
-
state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier') },
|
|
134
|
+
state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier'), ...SCROLL_SKIP },
|
|
123
135
|
React.createElement("span", { className: "ta-spinner" }))),
|
|
124
136
|
state.messages.length === 0 && (empty !== null && empty !== void 0 ? empty : React.createElement("div", { className: "ta-empty" }, t('ta.session.empty', { cwd: (_a = info === null || info === void 0 ? void 0 : info.cwd) !== null && _a !== void 0 ? _a : '.' }))),
|
|
125
137
|
React.createElement(ConversationSession.Provider, { value: info },
|
|
126
138
|
React.createElement(MessageActions.Provider, { value: messageActions },
|
|
127
139
|
React.createElement(FileUrls.Provider, { value: fileUrl },
|
|
128
140
|
React.createElement(OpenLink.Provider, { value: openLink },
|
|
129
|
-
React.createElement(
|
|
141
|
+
React.createElement(MessageImages.Provider, { value: images },
|
|
142
|
+
React.createElement(MessageList, { state: state, outbox: outbox, rows: rows })))))))),
|
|
130
143
|
React.createElement("div", { className: "ta-bottom" },
|
|
131
144
|
away && (React.createElement("button", { type: "button", className: "ta-to-bottom", "aria-label": t('ta.session.toBottom'), title: t('ta.session.toBottom'), onClick: toBottom },
|
|
132
145
|
React.createElement(ArrowDown, { size: 18 }))),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
146
|
+
React.createElement(GrowBox, null,
|
|
147
|
+
dialog && React.createElement(DialogView, { key: dialog.id, request: dialog, respond: response => store.respondUi(response).catch(fail) }),
|
|
148
|
+
aboveComposer,
|
|
149
|
+
widgetsAt('aboveEditor'),
|
|
150
|
+
addons.above),
|
|
151
|
+
React.createElement(Composer, { ref: composer, store: store, server: server, workspace: workspace, working: state.working, commands: settings.commands, cwd: info === null || info === void 0 ? void 0 : info.cwd, actions: [actions, ...addons.actions], recentShots: recentShots, onError: fail }),
|
|
138
152
|
belowComposer,
|
|
139
153
|
widgetsAt('belowEditor'),
|
|
140
154
|
statuses.length > 0 && (React.createElement("div", { className: "ta-statusline" }, statuses.map(([key, text]) => (React.createElement(StatusChip, { key: key, text: text }))))))));
|
|
@@ -8,6 +8,7 @@ import { type Choice, type RowEntry } from './settings-controls.js';
|
|
|
8
8
|
export declare const THEMES: Choice<ThemeSetting>[];
|
|
9
9
|
export declare const FONT_SIZES: Choice<FontSize>[];
|
|
10
10
|
export declare const LANGUAGES: Choice<LanguageSetting>[];
|
|
11
|
+
/** The model has the icon of the + menu's model (ModelPicker), the others their own. */
|
|
11
12
|
export declare const GROUP_ICONS: Record<string, LucideIcon>;
|
|
12
13
|
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
13
14
|
export declare const SHORTCUTS: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TaPackageTextUtil } from '@celljs/ta-protocol';
|
|
2
|
-
import { Globe, Layers, MessagesSquare, Monitor, Moon, Puzzle, RefreshCw,
|
|
2
|
+
import { Box, Globe, Layers, MessagesSquare, Monitor, Moon, Puzzle, RefreshCw, Sun, Wrench } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { WEB_ICONS } from '../extension/icons.js';
|
|
5
5
|
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
@@ -23,7 +23,8 @@ export const LANGUAGES = [
|
|
|
23
23
|
{ value: 'zh-CN', label: '简体中文' },
|
|
24
24
|
{ value: 'en-US', label: 'English' },
|
|
25
25
|
];
|
|
26
|
-
|
|
26
|
+
/** The model has the icon of the + menu's model (ModelPicker), the others their own. */
|
|
27
|
+
export const GROUP_ICONS = { model: Box, conversation: MessagesSquare, context: Layers, tools: Wrench };
|
|
27
28
|
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
28
29
|
export const SHORTCUTS = [
|
|
29
30
|
{ keys: 'Mod+,', label: 'ta.shortcut.settings' },
|
|
@@ -22,12 +22,14 @@ export declare function Segmented<T extends string>({ value, choices, onChange,
|
|
|
22
22
|
onChange(value: T): void;
|
|
23
23
|
label: string;
|
|
24
24
|
}): React.JSX.Element;
|
|
25
|
-
export
|
|
25
|
+
export interface SwitchProps {
|
|
26
26
|
checked: boolean;
|
|
27
|
-
|
|
27
|
+
/** What it does; a promise keeps it busy (`ui.Switch`): it shows the new state at once, its knob turning until done, and goes back if it fails. */
|
|
28
|
+
onChange(checked: boolean): unknown;
|
|
28
29
|
label: string;
|
|
29
30
|
disabled?: boolean;
|
|
30
|
-
}
|
|
31
|
+
}
|
|
32
|
+
export declare function Switch({ checked, onChange, label, disabled }: SwitchProps): React.JSX.Element;
|
|
31
33
|
export interface RowProps {
|
|
32
34
|
label: React.ReactNode;
|
|
33
35
|
/** Drawn in a tile before the label, for rows that are things rather than settings (extensions). */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useT } from '../i18n/use-t.js';
|
|
3
3
|
import { AgentSettingsUtil, ShortcutUtil } from '../settings/agent-settings.js';
|
|
4
|
+
import { useBusy } from './busy.js';
|
|
4
5
|
import { EmptyState } from './empty-state.js';
|
|
5
6
|
import { Icon } from './icon.js';
|
|
6
7
|
export function Keys({ keys }) {
|
|
@@ -13,7 +14,15 @@ export function Segmented({ value, choices, onChange, label }) {
|
|
|
13
14
|
choice.label.startsWith('ta.') ? t(choice.label) : choice.label)))));
|
|
14
15
|
}
|
|
15
16
|
export function Switch({ checked, onChange, label, disabled }) {
|
|
16
|
-
|
|
17
|
+
const [busy, run] = useBusy();
|
|
18
|
+
const [wanted, setWanted] = React.useState(checked);
|
|
19
|
+
const shown = busy ? wanted : checked;
|
|
20
|
+
return (React.createElement("input", { type: "checkbox", role: "switch", className: busy ? 'ta-switch ta-busy' : 'ta-switch', "aria-label": label, "aria-checked": shown, "aria-busy": busy || undefined, checked: shown, disabled: disabled, onChange: event => {
|
|
21
|
+
const next = event.target.checked;
|
|
22
|
+
setWanted(next);
|
|
23
|
+
// What failed is said by what it does (a notice); the switch goes back.
|
|
24
|
+
run(() => onChange(next)).catch(() => undefined);
|
|
25
|
+
} }));
|
|
17
26
|
}
|
|
18
27
|
/** Label and description on the left, the control on the right; stacked when the control is wide. */
|
|
19
28
|
export function Row({ label, icon, description, stacked, modified, children }) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TaSettingsScope } from '@celljs/ta-protocol';
|
|
2
|
-
import { type LucideIcon } from 'lucide-react';
|
|
3
2
|
import * as React from 'react';
|
|
3
|
+
import { type Glyph } from './icon.js';
|
|
4
4
|
import { type RowEntry } from './settings-controls.js';
|
|
5
5
|
export interface SectionEntry {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
|
-
icon:
|
|
8
|
+
icon: Glyph;
|
|
9
9
|
rows: RowEntry[];
|
|
10
10
|
}
|
|
11
11
|
export interface Part {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { Blocks, Bot, Cloud, Compass, FolderOpen, Info, Keyboard, KeyRound, Languages, Link2, LogOut, Palette, Puzzle, RefreshCw, Server, ShieldCheck, Smartphone, Trash2, Volume2, Wrench, } from 'lucide-react';
|
|
1
|
+
import { Blocks, Bot, Cloud, Compass, FolderOpen, Info, Keyboard, KeyRound, Languages, Link2, LogOut, MessagesSquare, Palette, Puzzle, RefreshCw, Server, ShieldCheck, Smartphone, Trash2, Volume2, Wrench, } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useDevice } from '../device/device.js';
|
|
4
|
+
import { ExtensionBoundary } from '../extension/extension-view.js';
|
|
5
|
+
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
4
6
|
import { useNotices, useSettings, useSettingsServer, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
5
7
|
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
6
8
|
import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil } from '../settings/agent-settings.js';
|
|
7
|
-
import { MAX_TASKS_CHOICES } from '../settings/settings-protocol.js';
|
|
9
|
+
import { CHAT_ARCHIVE_CHOICES, CHAT_FOLD_CHOICES, MAX_TASKS_CHOICES } from '../settings/settings-protocol.js';
|
|
10
|
+
import { Voice } from '../util/voice.js';
|
|
8
11
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
9
12
|
import { AccessSettings, useAccess } from './access-view.js';
|
|
10
13
|
import { AgentControl, ScopeBar, useAgentSettings } from './agent-settings-view.js';
|
|
11
14
|
import { useNavigation } from './app-nav.js';
|
|
15
|
+
import { BusyMark } from './busy.js';
|
|
12
16
|
import { EnvironmentSettings, useGateway } from './environment-view.js';
|
|
13
17
|
import { Icon, IconButton } from './icon.js';
|
|
14
18
|
import { useLaunchRows } from './launch-settings.js';
|
|
@@ -16,6 +20,7 @@ import { SettingsModelPicker } from './model-picker.js';
|
|
|
16
20
|
import { RemoteHosts } from './remote-hosts.js';
|
|
17
21
|
import { EmptyRow, Keys, Row, row, Segmented, Switch } from './settings-controls.js';
|
|
18
22
|
import { TrustedDomains } from './trusted-domains.js';
|
|
23
|
+
import { VoicePicker } from './voice-picker.js';
|
|
19
24
|
import { FONT_SIZES, GROUP_ICONS, LANGUAGES, navigationRows, packageLabel, SHORTCUTS, THEMES, usePackages } from './settings-choices.js';
|
|
20
25
|
/** The sections of the page and of ta, by part, with their rows. */
|
|
21
26
|
export function useParts(scope, onScope, onClose, onDialog) {
|
|
@@ -25,7 +30,7 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
25
30
|
const [{ settings }, store] = useSettings();
|
|
26
31
|
const settingsServer = useSettingsServer();
|
|
27
32
|
const [workbench, bench] = useWorkbench();
|
|
28
|
-
const [{ extensions, cwd, views }, host] = useWebExtensions();
|
|
33
|
+
const [{ extensions, cwd, views, settingsSections }, host] = useWebExtensions();
|
|
29
34
|
const navigation = useNavigation(views);
|
|
30
35
|
const packageList = usePackages();
|
|
31
36
|
const builtinPackages = packageList.packages.filter(pkg => pkg.origin === 'builtin');
|
|
@@ -37,14 +42,16 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
37
42
|
// that pairs phones, and signs out at the foot of Me.
|
|
38
43
|
const touch = useDevice(device => device.touch);
|
|
39
44
|
const handheld = useDevice(device => device.handheld);
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
// What runs, one thing at a time: its control turns (Switch, IconButton busy), the others wait.
|
|
46
|
+
const [busy, setBusy] = React.useState();
|
|
47
|
+
const run = (key, action, done) => {
|
|
48
|
+
setBusy(key);
|
|
49
|
+
return action()
|
|
44
50
|
.then(() => done && notices.notify(done, { level: 'success' }))
|
|
45
51
|
.catch(error => notices.error(error))
|
|
46
|
-
.finally(() => setBusy(
|
|
52
|
+
.finally(() => setBusy(undefined));
|
|
47
53
|
};
|
|
54
|
+
const waits = (key) => busy !== undefined && busy !== key;
|
|
48
55
|
const remove = async (pkg) => {
|
|
49
56
|
const confirmed = await notices.confirm({
|
|
50
57
|
title: t('ta.packages.removeConfirm', { name: pkg.name }),
|
|
@@ -53,12 +60,12 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
53
60
|
danger: true,
|
|
54
61
|
});
|
|
55
62
|
if (confirmed) {
|
|
56
|
-
run(() => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
|
|
63
|
+
void run(`remove:${pkg.id}`, () => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
|
|
57
64
|
}
|
|
58
65
|
};
|
|
59
66
|
const toggleBuiltin = (name, on) => {
|
|
60
67
|
store.update({ builtinsOff: on ? settings.builtinsOff.filter(other => other !== name) : [...settings.builtinsOff, name] });
|
|
61
|
-
run(() => host.refresh());
|
|
68
|
+
return run(`builtin:${name}`, () => host.refresh());
|
|
62
69
|
};
|
|
63
70
|
const web = [
|
|
64
71
|
{
|
|
@@ -91,6 +98,25 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
91
98
|
icon: Compass,
|
|
92
99
|
rows: navigationRows(navigation, t),
|
|
93
100
|
},
|
|
101
|
+
{
|
|
102
|
+
id: 'chats',
|
|
103
|
+
title: t('ta.settings.chats'),
|
|
104
|
+
icon: MessagesSquare,
|
|
105
|
+
rows: [
|
|
106
|
+
row('chat-fold', [t('ta.settings.chatFold'), t('ta.settings.chatFoldHint')], React.createElement(Row, { label: t('ta.settings.chatFold'), description: t('ta.settings.chatFoldHint'), stacked: true },
|
|
107
|
+
React.createElement(Segmented, { label: t('ta.settings.chatFold'), value: String(settings.chatFoldDays), choices: CHAT_FOLD_CHOICES.map(days => ({
|
|
108
|
+
value: String(days),
|
|
109
|
+
label: days ? t('ta.settings.days', { count: days }) : t('ta.settings.never'),
|
|
110
|
+
})), onChange: value => store.update({ chatFoldDays: Number(value) }) }))),
|
|
111
|
+
row('chat-archive', [t('ta.settings.chatArchive'), t('ta.settings.chatArchiveHint')], React.createElement(Row, { label: t('ta.settings.chatArchive'), description: t('ta.settings.chatArchiveHint'), stacked: true },
|
|
112
|
+
React.createElement(Segmented, { label: t('ta.settings.chatArchive'), value: String(settings.chatArchiveDays), choices: CHAT_ARCHIVE_CHOICES.map(days => ({
|
|
113
|
+
value: String(days),
|
|
114
|
+
label: days === 365 ? t('ta.settings.oneYear') : days ? t('ta.settings.days', { count: days }) : t('ta.settings.never'),
|
|
115
|
+
})), onChange: value => store.update({ chatArchiveDays: Number(value) }) }))),
|
|
116
|
+
row('recent-shots', [t('ta.settings.recentShots'), t('ta.settings.recentShotsHint')], React.createElement(Row, { label: t('ta.settings.recentShots'), description: t('ta.settings.recentShotsHint') },
|
|
117
|
+
React.createElement(Switch, { label: t('ta.settings.recentShots'), checked: settings.recentShots, onChange: recentShots => store.update({ recentShots }) }))),
|
|
118
|
+
],
|
|
119
|
+
},
|
|
94
120
|
{
|
|
95
121
|
id: 'links',
|
|
96
122
|
title: t('ta.settings.links'),
|
|
@@ -124,6 +150,14 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
124
150
|
rows: [
|
|
125
151
|
row('speak', [t('ta.settings.speak'), t('ta.settings.speakHint')], React.createElement(Row, { label: t('ta.settings.speak'), description: t('ta.settings.speakHint') },
|
|
126
152
|
React.createElement(Switch, { label: t('ta.settings.speak'), checked: settings.speak, onChange: speak => store.update({ speak }) }))),
|
|
153
|
+
row('speakTalk', [t('ta.settings.speakTalk'), t('ta.settings.speakTalkHint')], React.createElement(Row, { label: t('ta.settings.speakTalk'), description: t('ta.settings.speakTalkHint') },
|
|
154
|
+
React.createElement(Switch, { label: t('ta.settings.speakTalk'), checked: settings.speakTalk, onChange: speakTalk => store.update({ speakTalk }) }))),
|
|
155
|
+
...(Voice.canSpeak()
|
|
156
|
+
? [
|
|
157
|
+
row('voiceName', [t('ta.settings.voiceName'), t('ta.settings.voiceNameHint')], React.createElement(Row, { label: t('ta.settings.voiceName'), description: t('ta.settings.voiceNameHint'), stacked: true },
|
|
158
|
+
React.createElement(VoicePicker, { value: settings.voice, onChange: voice => store.update({ voice }) }))),
|
|
159
|
+
]
|
|
160
|
+
: []),
|
|
127
161
|
],
|
|
128
162
|
},
|
|
129
163
|
];
|
|
@@ -170,18 +204,19 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
170
204
|
icon: Puzzle,
|
|
171
205
|
rows: [
|
|
172
206
|
row('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
|
|
173
|
-
React.createElement("button", { type: "button", className:
|
|
207
|
+
React.createElement("button", { type: "button", className: busy === 'reload' ? 'ta-button ta-busy' : 'ta-button', "aria-busy": busy === 'reload' || undefined, disabled: waits('reload'), onClick: () => void run('reload', reload, t('ta.packages.reloaded')) },
|
|
174
208
|
React.createElement(Icon, { icon: RefreshCw, size: 14 }),
|
|
175
209
|
" ",
|
|
176
|
-
t('ta.packages.reload')
|
|
210
|
+
t('ta.packages.reload'),
|
|
211
|
+
React.createElement(BusyMark, { busy: busy === 'reload' })))),
|
|
177
212
|
...packages.map(pkg => {
|
|
178
213
|
const error = failure(pkg);
|
|
179
214
|
const { title, summary, icon } = packageLabel(pkg, language);
|
|
180
215
|
return row(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(Row, { icon: icon, label: title, description: error
|
|
181
216
|
? t('ta.packages.failed', { error })
|
|
182
217
|
: [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
|
|
183
|
-
React.createElement(IconButton, { icon: Trash2, label: t('ta.packages.remove'), disabled:
|
|
184
|
-
React.createElement(Switch, { label: title, checked: pkg.enabled, disabled:
|
|
218
|
+
React.createElement(IconButton, { icon: Trash2, label: t('ta.packages.remove'), busy: busy === `remove:${pkg.id}`, disabled: waits(`remove:${pkg.id}`), onClick: () => void remove(pkg) }),
|
|
219
|
+
React.createElement(Switch, { label: title, checked: pkg.enabled, disabled: waits(`toggle:${pkg.id}`), onChange: on => run(`toggle:${pkg.id}`, () => packageList.toggle(pkg, on)) })));
|
|
185
220
|
}),
|
|
186
221
|
...(packages.length === 0
|
|
187
222
|
? [row('packages:none', [t('ta.packages.none')], React.createElement(EmptyRow, { title: t('ta.packages.none'), hint: t('ta.packages.noneHint') }))]
|
|
@@ -199,10 +234,11 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
199
234
|
...builtinPackages.map(info => {
|
|
200
235
|
const { title, summary, icon } = packageLabel(info, language);
|
|
201
236
|
return row(`builtin:${info.name}`, [title, summary, info.name, t('ta.packages.builtinTitle')], React.createElement(Row, { icon: icon, label: title, description: summary },
|
|
202
|
-
React.createElement(Switch, { label: title, checked: info.enabled, onChange: on => run(() => packageList.toggle(info, on)) })));
|
|
237
|
+
React.createElement(Switch, { label: title, checked: info.enabled, onChange: on => run(`toggle:${info.id}`, () => packageList.toggle(info, on)) })));
|
|
203
238
|
}),
|
|
204
239
|
],
|
|
205
240
|
},
|
|
241
|
+
...settingsSections.map(extensionSection),
|
|
206
242
|
// Behind a gateway only: where the Ta of this account runs.
|
|
207
243
|
...(gateway.info
|
|
208
244
|
? [
|
|
@@ -297,4 +333,22 @@ export function useParts(scope, onScope, onClose, onDialog) {
|
|
|
297
333
|
{ id: 'more', title: t('ta.settings.more'), sections: more },
|
|
298
334
|
];
|
|
299
335
|
}
|
|
336
|
+
/** A section an extension added (WebExtensionAPI.registerSettings): its rows as Ta's, each control in a boundary of its own. */
|
|
337
|
+
function extensionSection({ id, section }) {
|
|
338
|
+
var _a;
|
|
339
|
+
const title = WebLabelUtil.text(section.title);
|
|
340
|
+
return {
|
|
341
|
+
id: `extension-${id.replace(/[^\w-]+/g, '-')}`,
|
|
342
|
+
title,
|
|
343
|
+
icon: (_a = section.icon) !== null && _a !== void 0 ? _a : Puzzle,
|
|
344
|
+
rows: section.rows.map(item => {
|
|
345
|
+
const label = WebLabelUtil.text(item.label);
|
|
346
|
+
const description = item.description === undefined ? undefined : WebLabelUtil.text(item.description);
|
|
347
|
+
const Control = item.render;
|
|
348
|
+
return row(`${id}/${item.key}`, [label, description, title], React.createElement(Row, { label: label, description: description, stacked: item.stacked },
|
|
349
|
+
React.createElement(ExtensionBoundary, { name: title, resetKey: Control },
|
|
350
|
+
React.createElement(Control, null))));
|
|
351
|
+
}),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
300
354
|
//# sourceMappingURL=settings-parts.js.map
|
|
@@ -11,7 +11,7 @@ export interface SwipeRowProps extends WebSwipeRowProps, Omit<React.HTMLAttribut
|
|
|
11
11
|
* list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
|
|
12
12
|
* it closes it rather than opening what it is.
|
|
13
13
|
*/
|
|
14
|
-
export declare function SwipeRow({ as, actions, className, overlay, children, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
|
|
14
|
+
export declare function SwipeRow({ as, actions, className, overlay, children, style, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
|
|
15
15
|
dangerouslySetInnerHTML?: {
|
|
16
16
|
__html: string | TrustedHTML;
|
|
17
17
|
} | undefined;
|
|
@@ -254,7 +254,6 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
|
|
|
254
254
|
nonce?: string | undefined;
|
|
255
255
|
slot?: string | undefined;
|
|
256
256
|
spellCheck?: ("false" | "true" | boolean) | undefined;
|
|
257
|
-
style?: React.CSSProperties | undefined;
|
|
258
257
|
tabIndex?: number | undefined;
|
|
259
258
|
title?: string | undefined;
|
|
260
259
|
translate?: "yes" | "no" | undefined;
|
|
@@ -294,4 +293,5 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
|
|
|
294
293
|
className: string;
|
|
295
294
|
'data-swipeable': string | undefined;
|
|
296
295
|
'data-swiped': string | undefined;
|
|
296
|
+
style: React.CSSProperties | undefined;
|
|
297
297
|
}, HTMLElement>;
|
|
@@ -8,7 +8,7 @@ const ACTION_PX = 84;
|
|
|
8
8
|
* list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
|
|
9
9
|
* it closes it rather than opening what it is.
|
|
10
10
|
*/
|
|
11
|
-
export function SwipeRow({ as = 'div', actions, className, overlay, children, ...rest }) {
|
|
11
|
+
export function SwipeRow({ as = 'div', actions, className, overlay, children, style, ...rest }) {
|
|
12
12
|
var _a;
|
|
13
13
|
const row = React.useRef(null);
|
|
14
14
|
const handheld = useDevice(device => device.handheld);
|
|
@@ -26,9 +26,13 @@ export function SwipeRow({ as = 'div', actions, className, overlay, children, ..
|
|
|
26
26
|
className: className ? `ta-swipe-row ${className}` : 'ta-swipe-row',
|
|
27
27
|
'data-swipeable': enabled ? '' : undefined,
|
|
28
28
|
'data-swiped': open ? '' : undefined,
|
|
29
|
-
|
|
29
|
+
// How far the content slides open, and its actions come out from: theirs together.
|
|
30
|
+
style: enabled ? { ...style, '--ta-swipe-width': `${ACTION_PX * ((_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0)}px` } : style,
|
|
31
|
+
}, enabled && (React.createElement("div", { className: "ta-swipe-actions", inert: !open }, actions === null || actions === void 0 ? void 0 : actions.map((action, index) => (React.createElement("button", { key: action.key, type: "button", className: `ta-swipe-action${action.danger ? ' ta-danger' : ''}`,
|
|
32
|
+
// Of the way the row is shown, how far it is pushed out while closed (RowSwipeUtil.shift).
|
|
33
|
+
style: { '--ta-swipe-share': 1 - index / actions.length }, onClick: () => {
|
|
30
34
|
unswipe();
|
|
31
35
|
action.run();
|
|
32
|
-
} }, action.label))))), React.createElement("div", { className: "ta-swipe-content",
|
|
36
|
+
} }, action.label))))), React.createElement("div", { className: "ta-swipe-content", onClickCapture: open ? closeInstead : undefined }, children), overlay);
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=swipe-row.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChevronRight, ChevronUp, FileCode2 } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { ExtensionBoundary, ToolRenderers } from '../extension/extension-view.js';
|
|
3
4
|
import { useT } from '../i18n/use-t.js';
|
|
4
5
|
import { MessageUtil } from '../util/message.js';
|
|
5
6
|
import { ToolUtil } from '../util/tool.js';
|
|
@@ -28,15 +29,19 @@ function Output({ text }) {
|
|
|
28
29
|
function ToolRow({ name, args, status, trailing, details }) {
|
|
29
30
|
const t = useT();
|
|
30
31
|
const [open, setOpen] = React.useState(false);
|
|
31
|
-
const summary = ToolUtil.summary(name, args);
|
|
32
|
+
const summary = ToolUtil.summary(name, args, React.useContext(ToolRenderers));
|
|
33
|
+
const ToolIcon = summary.icon;
|
|
32
34
|
const line = (React.createElement(React.Fragment, null,
|
|
33
35
|
React.createElement(StatusDot, { status: status }),
|
|
34
|
-
React.createElement("span", { className: "ta-tool-verb" },
|
|
36
|
+
React.createElement("span", { className: "ta-tool-verb" }, ToolUtil.verb(summary, t)),
|
|
37
|
+
ToolIcon && (React.createElement("span", { className: "ta-tool-icon" },
|
|
38
|
+
React.createElement(ExtensionBoundary, { name: name, resetKey: ToolIcon, fallback: false },
|
|
39
|
+
React.createElement(ToolIcon, { size: 18 })))),
|
|
35
40
|
summary.target && React.createElement("span", { className: `ta-tool-target ${summary.code ? 'ta-mono' : ''}` }, summary.target),
|
|
36
|
-
|
|
41
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-tool-chevron" })));
|
|
37
42
|
return (React.createElement("div", { className: `ta-tool ta-tool-${status}` },
|
|
38
43
|
React.createElement("div", { className: "ta-tool-line" },
|
|
39
|
-
|
|
44
|
+
React.createElement("button", { type: "button", className: "ta-tool-title", disabled: !details, "aria-expanded": details ? open : undefined, onClick: () => setOpen(!open) }, line),
|
|
40
45
|
React.createElement("span", { className: "ta-tool-trailing" }, trailing)),
|
|
41
46
|
details && open && React.createElement("div", { className: "ta-tool-body" }, details)));
|
|
42
47
|
}
|
|
@@ -88,23 +93,25 @@ function CodemodeView({ id, args, output, status, runs }) {
|
|
|
88
93
|
const script = (React.createElement(React.Fragment, null,
|
|
89
94
|
React.createElement(CodeBlock, { code: code, language: "js" }),
|
|
90
95
|
result && React.createElement(Output, { text: result })));
|
|
91
|
-
if (!calls.length) {
|
|
92
|
-
return React.createElement(ToolRow, { name: "codemode", args: args, status: status, details: script });
|
|
93
|
-
}
|
|
94
96
|
const label = t(showScript ? 'ta.tool.hideScript' : 'ta.tool.showScript');
|
|
95
|
-
const toggle = (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
|
|
97
|
+
const toggle = calls.length > 0 && (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
|
|
96
98
|
React.createElement(Icon, { icon: FileCode2, size: 13 })));
|
|
99
|
+
// Before its first call the script is the one step; its calls then take its place, the first in the same
|
|
100
|
+
// element, so that the line changes rather than comes again. By place: the calls are in order, live or
|
|
101
|
+
// kept, and their ids are not the same in both.
|
|
102
|
+
const rows = calls.length ? calls.map(nestedRow) : [{ name: 'codemode', args, status, details: script }];
|
|
97
103
|
// A script that failed after its calls went well: one more step, the script, whose output says what went wrong.
|
|
98
|
-
|
|
104
|
+
if (calls.length && status === 'error' && !calls.some(call => call.status === 'error')) {
|
|
105
|
+
rows.push({ name: 'codemode', args: { code }, status: 'error', details: result ? React.createElement(Output, { text: result }) : undefined });
|
|
106
|
+
}
|
|
99
107
|
return (React.createElement("div", { className: "ta-tool-group" },
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
showScript && React.createElement("div", { className: "ta-tool-body" }, script)));
|
|
108
|
+
rows.map((row, index) => (React.createElement(ToolRow, { key: index, ...row, trailing: index === 0 ? toggle || undefined : undefined }))),
|
|
109
|
+
showScript && calls.length > 0 && React.createElement("div", { className: "ta-tool-body" }, script)));
|
|
103
110
|
}
|
|
104
|
-
function
|
|
111
|
+
function nestedRow(call) {
|
|
105
112
|
var _a;
|
|
106
113
|
const shown = details(call.name, call.args, (_a = call.run) === null || _a === void 0 ? void 0 : _a.result, call.status);
|
|
107
114
|
const error = call.status === 'error' && call.error ? React.createElement(Output, { text: call.error }) : undefined;
|
|
108
|
-
return
|
|
115
|
+
return { name: call.name, args: call.args, status: call.status, details: shown || error || undefined };
|
|
109
116
|
}
|
|
110
117
|
//# sourceMappingURL=tool-view.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** A point on the screen. */
|
|
3
|
+
interface Point {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How a dragged drop is drawn (as QQ's unread): the dot left behind shrinks as the finger goes, joined to the drop
|
|
9
|
+
* under the finger by a neck that thins, and breaks off past BREAK_PX; let go then, it bursts.
|
|
10
|
+
*/
|
|
11
|
+
export declare namespace UnseenDropUtil {
|
|
12
|
+
/** How far the drop stretches before it breaks off. */
|
|
13
|
+
const BREAK_PX = 84;
|
|
14
|
+
/** Broken off, let go nearer than this to where it was, it goes back: the user changed their mind. */
|
|
15
|
+
const KEEP_PX = 28;
|
|
16
|
+
/** The drop under the finger. */
|
|
17
|
+
const DROP_R = 9;
|
|
18
|
+
/** The dot left behind, at rest and stretched furthest. */
|
|
19
|
+
const DOT_R = 6;
|
|
20
|
+
const DOT_MIN_R = 2.5;
|
|
21
|
+
/** The radius of the dot left behind, the drop `distance` away. */
|
|
22
|
+
function dotRadius(distance: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* The neck between the dot (`from`, radius `r`) and the drop (`to`, radius `R`): an SVG path, its two sides
|
|
25
|
+
* curving in toward the middle, the more as it stretches. Empty when they are one.
|
|
26
|
+
*/
|
|
27
|
+
function neck(from: Point, r: number, to: Point, R: number): string;
|
|
28
|
+
function distance(a: Point, b: Point): number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The amber dot of a tab that has something unseen. A finger drags it off as a drop of water, as QQ's unread:
|
|
32
|
+
* stretched past its neck and let go, it bursts and everything is seen (`onDismiss`); let go before, or brought
|
|
33
|
+
* back, it springs back. A tap is the tab's.
|
|
34
|
+
*/
|
|
35
|
+
export declare function UnseenDrop({ label, onDismiss }: {
|
|
36
|
+
label: string;
|
|
37
|
+
onDismiss?: () => void;
|
|
38
|
+
}): React.JSX.Element;
|
|
39
|
+
export {};
|