@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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { PenLine, X } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { HeldUtil } from '../device/hold.js';
|
|
5
|
+
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
6
|
+
import { Voice } from '../util/voice.js';
|
|
7
|
+
import { Icon } from './icon.js';
|
|
8
|
+
export var VoiceTalkUtil;
|
|
9
|
+
(function (VoiceTalkUtil) {
|
|
10
|
+
/** How long a talk lasts for the words to count: shorter, a finger slipped on the box and nothing is given. */
|
|
11
|
+
VoiceTalkUtil.SHORT_MS = 600;
|
|
12
|
+
/** How long the end of a talk waits for recognition to say it ended before it ends anyway. */
|
|
13
|
+
VoiceTalkUtil.SETTLE_MS = 1500;
|
|
14
|
+
/** How long "too short" stays before the page comes back. */
|
|
15
|
+
VoiceTalkUtil.SHORT_NOTICE_MS = 700;
|
|
16
|
+
/** How long the overlay takes to fade out. */
|
|
17
|
+
VoiceTalkUtil.LEAVE_MS = 160;
|
|
18
|
+
/** What a talk gives; none when it was too short to be meant, or when nothing was heard. */
|
|
19
|
+
function given(words, heldMs) {
|
|
20
|
+
const text = words.trim();
|
|
21
|
+
return text && heldMs >= VoiceTalkUtil.SHORT_MS ? text : undefined;
|
|
22
|
+
}
|
|
23
|
+
VoiceTalkUtil.given = given;
|
|
24
|
+
/** The zone of the overlay under a point (`data-talk-zone`): the bottom, where the finger starts, sends. */
|
|
25
|
+
function zone(element) {
|
|
26
|
+
var _a;
|
|
27
|
+
const zone = (_a = element === null || element === void 0 ? void 0 : element.closest('[data-talk-zone]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-talk-zone');
|
|
28
|
+
return zone === 'cancel' || zone === 'edit' ? zone : 'send';
|
|
29
|
+
}
|
|
30
|
+
VoiceTalkUtil.zone = zone;
|
|
31
|
+
})(VoiceTalkUtil || (VoiceTalkUtil = {}));
|
|
32
|
+
const IDLE = { phase: 'idle', words: '', zone: 'send' };
|
|
33
|
+
/**
|
|
34
|
+
* A conversation by voice as WeChat's: a finger held on the bar of the message box held to talk (TalkBar, or on an
|
|
35
|
+
* entry of the navigation) dims the page and a green bubble listens, the words coming as they are said. Let go on the bottom, they are sent; slid
|
|
36
|
+
* over 取消 they are dropped, over 编辑 they stay in the box to be read over. A talk too short to be meant, which a
|
|
37
|
+
* wrong touch is, says so and gives nothing, as one where nothing was heard does.
|
|
38
|
+
*/
|
|
39
|
+
export function useVoiceTalk(onGive, onError, hints) {
|
|
40
|
+
const t = useT();
|
|
41
|
+
const language = useLanguage();
|
|
42
|
+
const [state, setState] = React.useState(IDLE);
|
|
43
|
+
// The phase as the finger and recognition find it, between renders.
|
|
44
|
+
const phase = React.useRef('idle');
|
|
45
|
+
const listening = React.useRef(undefined);
|
|
46
|
+
const heard = React.useRef('');
|
|
47
|
+
const since = React.useRef(0);
|
|
48
|
+
const held = React.useRef(0);
|
|
49
|
+
const zone = React.useRef('send');
|
|
50
|
+
/** Recognition ended while the finger was still down (a long silence): what it heard waits for the finger. */
|
|
51
|
+
const ended = React.useRef(false);
|
|
52
|
+
const timer = React.useRef(undefined);
|
|
53
|
+
// Recognition and the finger outlive a render: always to what the box is now.
|
|
54
|
+
const give = React.useRef(onGive);
|
|
55
|
+
give.current = onGive;
|
|
56
|
+
const fail = React.useRef(onError);
|
|
57
|
+
fail.current = onError;
|
|
58
|
+
// The box goes as it listens (another conversation, another page): what was said is not given to it.
|
|
59
|
+
React.useEffect(() => () => {
|
|
60
|
+
clearTimeout(timer.current);
|
|
61
|
+
const session = listening.current;
|
|
62
|
+
listening.current = undefined;
|
|
63
|
+
session === null || session === void 0 ? void 0 : session.stop();
|
|
64
|
+
}, []);
|
|
65
|
+
const go = (next, more) => {
|
|
66
|
+
phase.current = next;
|
|
67
|
+
setState(current => ({ ...current, ...more, phase: next }));
|
|
68
|
+
};
|
|
69
|
+
const later = (ms, then) => {
|
|
70
|
+
clearTimeout(timer.current);
|
|
71
|
+
timer.current = setTimeout(then, ms);
|
|
72
|
+
};
|
|
73
|
+
/** Stops listening, whatever it heard after. */
|
|
74
|
+
const quiet = () => {
|
|
75
|
+
const session = listening.current;
|
|
76
|
+
listening.current = undefined;
|
|
77
|
+
session === null || session === void 0 ? void 0 : session.stop();
|
|
78
|
+
};
|
|
79
|
+
/** The page comes back, the overlay fading out. */
|
|
80
|
+
const leave = () => {
|
|
81
|
+
quiet();
|
|
82
|
+
go('leaving');
|
|
83
|
+
later(VoiceTalkUtil.LEAVE_MS, () => {
|
|
84
|
+
phase.current = 'idle';
|
|
85
|
+
setState(IDLE);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/** The finger let go off 取消 and recognition said its last: the words go as the place it let go says. */
|
|
89
|
+
const deliver = () => {
|
|
90
|
+
const text = VoiceTalkUtil.given(heard.current, held.current);
|
|
91
|
+
const where = zone.current;
|
|
92
|
+
leave();
|
|
93
|
+
if (text && where !== 'cancel') {
|
|
94
|
+
give.current(text, where);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const start = () => {
|
|
98
|
+
if (phase.current === 'listening' || phase.current === 'released') {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
clearTimeout(timer.current);
|
|
102
|
+
since.current = Date.now();
|
|
103
|
+
held.current = 0;
|
|
104
|
+
heard.current = '';
|
|
105
|
+
zone.current = 'send';
|
|
106
|
+
ended.current = false;
|
|
107
|
+
// What a talk ended or dropped before still says it ended (onerror, then onend): not to the next one.
|
|
108
|
+
let session;
|
|
109
|
+
session = Voice.listen(language, words => {
|
|
110
|
+
if (listening.current === session) {
|
|
111
|
+
heard.current = words;
|
|
112
|
+
setState(current => ({ ...current, words }));
|
|
113
|
+
}
|
|
114
|
+
}, failure => {
|
|
115
|
+
if (listening.current !== session) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (failure) {
|
|
119
|
+
fail.current(new Error(t(Voice.denied(failure) ? 'ta.composer.voiceDenied' : 'ta.composer.voiceFailed', { error: failure })));
|
|
120
|
+
leave();
|
|
121
|
+
}
|
|
122
|
+
else if (phase.current === 'released') {
|
|
123
|
+
listening.current = undefined;
|
|
124
|
+
deliver();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
ended.current = true;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
// A finger held goes on past a pause: it stops when it lets go.
|
|
131
|
+
{ continuous: true, hints });
|
|
132
|
+
if (session) {
|
|
133
|
+
listening.current = session;
|
|
134
|
+
go('listening', { words: '', zone: 'send' });
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const point = (x, y) => {
|
|
138
|
+
if (phase.current !== 'listening') {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const next = VoiceTalkUtil.zone(document.elementFromPoint(x, y));
|
|
142
|
+
if (next !== zone.current) {
|
|
143
|
+
zone.current = next;
|
|
144
|
+
setState(current => ({ ...current, zone: next }));
|
|
145
|
+
if (next !== 'send') {
|
|
146
|
+
HeldUtil.tick();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const release = () => {
|
|
151
|
+
var _a;
|
|
152
|
+
if (phase.current !== 'listening') {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
held.current = Date.now() - since.current;
|
|
156
|
+
if (zone.current === 'cancel') {
|
|
157
|
+
leave();
|
|
158
|
+
}
|
|
159
|
+
else if (held.current < VoiceTalkUtil.SHORT_MS) {
|
|
160
|
+
// Too short to be meant: said so for a moment, and nothing is given.
|
|
161
|
+
quiet();
|
|
162
|
+
go('short');
|
|
163
|
+
later(VoiceTalkUtil.SHORT_NOTICE_MS, leave);
|
|
164
|
+
}
|
|
165
|
+
else if (ended.current) {
|
|
166
|
+
listening.current = undefined;
|
|
167
|
+
deliver();
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
go('released');
|
|
171
|
+
(_a = listening.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
172
|
+
// Recognition that does not say it ended would leave the page dimmed: the talk ends with what was heard.
|
|
173
|
+
later(VoiceTalkUtil.SETTLE_MS, () => phase.current === 'released' && deliver());
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const cancel = () => {
|
|
177
|
+
if (phase.current !== 'idle' && phase.current !== 'leaving') {
|
|
178
|
+
leave();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
return { ...state, active: state.phase === 'listening' || state.phase === 'released', start, point, release, cancel };
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The field of a message box on a touch screen once its microphone is tapped, as WeChat's: 按住 说话. The finger
|
|
185
|
+
* talks as soon as it lands (no wait, the bar is for nothing else), and is the bar's until it lets go, wherever it
|
|
186
|
+
* slides: onto 取消 or 编辑 of the overlay.
|
|
187
|
+
*/
|
|
188
|
+
export function TalkBar({ talk }) {
|
|
189
|
+
const t = useT();
|
|
190
|
+
return (React.createElement("button", { type: "button", className: `ta-talk-bar${talk.active ? ' ta-on' : ''}`, "data-held": "", onPointerDown: event => {
|
|
191
|
+
var _a, _b;
|
|
192
|
+
if (!event.isPrimary || event.button !== 0) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
197
|
+
talk.start();
|
|
198
|
+
talk.point(event.clientX, event.clientY);
|
|
199
|
+
}, onPointerMove: event => talk.point(event.clientX, event.clientY), onPointerUp: () => talk.release(), onPointerCancel: () => talk.cancel(),
|
|
200
|
+
// A finger held is the bar's: no menu (device/long-press.ts sends one), no selection.
|
|
201
|
+
onContextMenu: event => event.preventDefault() }, t(talk.active ? 'ta.talk.releaseSend' : 'ta.talk.hold')));
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* What a talk shows, over the whole page (above the keyboard): the page dimmed, a green bubble with the words as
|
|
205
|
+
* they come, 取消 and 编辑 to slide the finger onto, and the bottom it starts on, which says what letting go does.
|
|
206
|
+
*/
|
|
207
|
+
export function VoiceTalkOverlay({ talk }) {
|
|
208
|
+
const t = useT();
|
|
209
|
+
const { phase, cancel } = talk;
|
|
210
|
+
const listening = phase === 'listening';
|
|
211
|
+
React.useEffect(() => {
|
|
212
|
+
if (!listening) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const onKey = (event) => event.key === 'Escape' && cancel();
|
|
216
|
+
document.addEventListener('keydown', onKey);
|
|
217
|
+
return () => document.removeEventListener('keydown', onKey);
|
|
218
|
+
}, [listening, cancel]);
|
|
219
|
+
if (phase === 'idle') {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
const short = phase === 'short';
|
|
223
|
+
const hint = listening ? t(talk.zone === 'cancel' ? 'ta.talk.releaseCancel' : talk.zone === 'edit' ? 'ta.talk.releaseEdit' : 'ta.talk.releaseSend') : '';
|
|
224
|
+
return createPortal(React.createElement("div", { className: `ta-talk ta-talk-${talk.zone} ta-talk-${phase}`, role: "dialog", "aria-modal": "true", "aria-label": t('ta.talk.listening') },
|
|
225
|
+
React.createElement("div", { className: "ta-talk-bubble", "aria-live": "polite" }, short ? (React.createElement("p", { className: "ta-talk-words" }, t('ta.talk.tooShort'))) : talk.words ? (React.createElement("p", { className: "ta-talk-words" }, talk.words)) : (React.createElement("span", { className: "ta-wave", "aria-hidden": "true" },
|
|
226
|
+
React.createElement("i", null),
|
|
227
|
+
React.createElement("i", null),
|
|
228
|
+
React.createElement("i", null),
|
|
229
|
+
React.createElement("i", null)))),
|
|
230
|
+
React.createElement("div", { className: "ta-talk-zones", "aria-hidden": !listening },
|
|
231
|
+
React.createElement("div", { className: `ta-talk-zone${talk.zone === 'cancel' ? ' ta-on' : ''}`, "data-talk-zone": "cancel" },
|
|
232
|
+
React.createElement("span", { className: "ta-talk-zone-label" }, t('ta.cancel')),
|
|
233
|
+
React.createElement("span", { className: "ta-talk-zone-circle" },
|
|
234
|
+
React.createElement(Icon, { icon: X, size: 26 }))),
|
|
235
|
+
React.createElement("div", { className: `ta-talk-zone${talk.zone === 'edit' ? ' ta-on' : ''}`, "data-talk-zone": "edit" },
|
|
236
|
+
React.createElement("span", { className: "ta-talk-zone-label" }, t('ta.talk.edit')),
|
|
237
|
+
React.createElement("span", { className: "ta-talk-zone-circle" },
|
|
238
|
+
React.createElement(Icon, { icon: PenLine, size: 24 })))),
|
|
239
|
+
React.createElement("div", { className: "ta-talk-base" },
|
|
240
|
+
React.createElement("span", { className: "ta-talk-hint" }, hint))), document.body);
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=voice-talk.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TaDirEntry } from '@celljs/ta-protocol';
|
|
1
|
+
import type { TaDirEntry, TaServer } from '@celljs/ta-protocol';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { WebComposerProps } from '../extension/web-extension-api.js';
|
|
4
4
|
import type { TaNotices } from '../notices/notices-protocol.js';
|
|
@@ -6,6 +6,8 @@ import { type FolderPickerRemote } from './folder-picker.js';
|
|
|
6
6
|
export interface WebComposerHostProps extends WebComposerProps {
|
|
7
7
|
/** Where a failure to send goes. */
|
|
8
8
|
notices: TaNotices;
|
|
9
|
+
/** Where the commands of `commands` are read. */
|
|
10
|
+
server: Pick<TaServer, 'getDirectoryCommands'>;
|
|
9
11
|
/** The entries of a directory of the server, for the button of `onPickCwd`. */
|
|
10
12
|
listDirectory?(directory: string): Promise<TaDirEntry[]>;
|
|
11
13
|
/** The directory of ta serve: that of a `cwd` left empty. */
|
|
@@ -14,4 +16,4 @@ export interface WebComposerHostProps extends WebComposerProps {
|
|
|
14
16
|
remote?: FolderPickerRemote;
|
|
15
17
|
}
|
|
16
18
|
/** The message box as web extensions get it (`pi.ui.Composer`): text only, `@` for the names they give; a failure is a notice of the page. */
|
|
17
|
-
export declare function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
|
|
19
|
+
export declare function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, server, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useT } from '../i18n/use-t.js';
|
|
2
|
+
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
3
3
|
import { ComposerUtil } from '../util/composer.js';
|
|
4
4
|
import { ComposerBox } from './composer-box.js';
|
|
5
|
+
import { useDirectoryCommands } from './directory-commands.js';
|
|
5
6
|
import { DirectoryButton } from './folder-picker.js';
|
|
6
7
|
/** The message box as web extensions get it (`pi.ui.Composer`): text only, `@` for the names they give; a failure is a notice of the page. */
|
|
7
|
-
export function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, listDirectory, serverCwd, remote, }) {
|
|
8
|
+
export function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, server, listDirectory, serverCwd, remote, }) {
|
|
8
9
|
const t = useT();
|
|
10
|
+
const language = useLanguage();
|
|
9
11
|
const [query, setQuery] = React.useState();
|
|
12
|
+
const found = useDirectoryCommands(server, commands ? cwd || serverCwd : undefined);
|
|
13
|
+
const listed = React.useMemo(() => found.map(command => ({ name: command.name, description: ComposerUtil.commandDescription(command, language, t) })), [found, language, t]);
|
|
10
14
|
return (React.createElement(ComposerBox, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('ta.composer.label'), onSend: async (text) => {
|
|
11
15
|
await onSend(text);
|
|
12
|
-
}, onMentionQuery: mentions ? setQuery : undefined, mentions: mentions && query !== undefined
|
|
16
|
+
}, commands: listed, onMentionQuery: mentions ? setQuery : undefined, mentions: mentions && query !== undefined
|
|
13
17
|
? {
|
|
14
18
|
items: ComposerUtil.commands(mentions, query).map(mention => ({
|
|
15
19
|
key: mention.name,
|
|
@@ -17,6 +21,6 @@ export function WebComposer({ notices, placeholder, onSend, mentions, mentionLab
|
|
|
17
21
|
detail: mention.detail,
|
|
18
22
|
})),
|
|
19
23
|
}
|
|
20
|
-
: undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions,
|
|
24
|
+
: undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions, head: onPickCwd && listDirectory && React.createElement(DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, remote: remote, onPick: onPickCwd }), cwd: cwd || serverCwd, working: working, onStop: onStop, voiceSends: voiceSends, onTalkSent: onTalkSent, onListening: onListening, after: after, onError: cause => notices.error(cause) }));
|
|
21
25
|
}
|
|
22
26
|
//# sourceMappingURL=web-composer.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type WebEditorEntry, type WebViewEntry } from '../extension/web-extension-protocol.js';
|
|
3
|
+
/** What the head of the workbench shows and does: its tabs, the tools it opens, its place. */
|
|
4
|
+
export interface WorkbenchTabsProps {
|
|
5
|
+
editors: WebEditorEntry[];
|
|
6
|
+
active?: string;
|
|
7
|
+
/** The `panel` views: what `+` and the empty workbench open. */
|
|
8
|
+
views: WebViewEntry[];
|
|
9
|
+
onShow(id: string): void;
|
|
10
|
+
/** Closes tabs: one, or several at once from the menu of a tab. */
|
|
11
|
+
onClose(ids: string[]): void;
|
|
12
|
+
/** Keeps a preview tab (a double click on it). */
|
|
13
|
+
onPin(id: string): void;
|
|
14
|
+
onOpenView(id: string): void;
|
|
15
|
+
onHide(): void;
|
|
16
|
+
/** Where its tools are (`ui.useCwd`): that of the conversation in front, else the default directory. */
|
|
17
|
+
cwd?: string;
|
|
18
|
+
/** Whether the workbench takes the place of the conversation too; none on narrow screens, where it always does. */
|
|
19
|
+
maximized?: boolean;
|
|
20
|
+
onMaximize?(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function ViewGlyph({ view, size }: {
|
|
23
|
+
view: WebViewEntry;
|
|
24
|
+
size: number;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* The tabs of a wide workbench, as those of a browser or an editor: the one shown is a card joined to what it
|
|
28
|
+
* shows, the others lie on the strip with a line between them, `+` follows the last one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function TabStrip({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd, maximized, onMaximize }: WorkbenchTabsProps): React.JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* The head of the workbench on a phone, as a browser's there: back to the conversation, the tab shown with how
|
|
33
|
+
* many are open, which opens the list of them (TabSwitcher), and `+`. A row of tabs a finger scrolls and
|
|
34
|
+
* closes by their small crosses is neither seen nor hit well on a phone.
|
|
35
|
+
*/
|
|
36
|
+
export declare function CompactHead({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd }: WorkbenchTabsProps): React.JSX.Element;
|
|
37
|
+
/** The tabs open on a phone, as rows of a finger's height under its head: a tap shows one, its cross closes it, a long press opens its menu. */
|
|
38
|
+
export declare function TabSwitcher({ editors, active, onShow, onClose, onMenu, onDismiss, }: Pick<WorkbenchTabsProps, 'editors' | 'active' | 'onShow' | 'onClose'> & {
|
|
39
|
+
onMenu(event: React.MouseEvent, editor: WebEditorEntry): void;
|
|
40
|
+
onDismiss(): void;
|
|
41
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { ChevronDown, ChevronLeft, Folder, Maximize2, Minimize2, PanelTop, Plus, X } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
4
|
+
import { useT } from '../i18n/use-t.js';
|
|
5
|
+
import { MessageUtil } from '../util/message.js';
|
|
6
|
+
import { useContextMenu } from './context-menu.js';
|
|
7
|
+
import { useDismiss } from './dismiss.js';
|
|
8
|
+
import { Icon, IconButton, SidebarRight } from './icon.js';
|
|
9
|
+
export function ViewGlyph({ view, size }) {
|
|
10
|
+
var _a;
|
|
11
|
+
const Glyph = (_a = view.icon) !== null && _a !== void 0 ? _a : PanelTop;
|
|
12
|
+
return React.createElement(Glyph, { size: size, strokeWidth: 1.6 });
|
|
13
|
+
}
|
|
14
|
+
/** How far a menu keeps from the edges of the window. */
|
|
15
|
+
const MENU_MARGIN = 8;
|
|
16
|
+
/** `+` of the workbench, after its tabs as a browser's: the tools it opens, under the directory they open in. */
|
|
17
|
+
function OpenMenu({ views, onOpenView, cwd, align = 'start' }) {
|
|
18
|
+
const t = useT();
|
|
19
|
+
const [open, setOpen] = React.useState(false);
|
|
20
|
+
const root = React.useRef(null);
|
|
21
|
+
const button = React.useRef(null);
|
|
22
|
+
const menu = React.useRef(null);
|
|
23
|
+
const id = React.useId();
|
|
24
|
+
const close = React.useCallback(() => setOpen(false), []);
|
|
25
|
+
useDismiss(open, close, root, button);
|
|
26
|
+
// Under +, kept inside the window: + follows the tabs, and may be near its right edge.
|
|
27
|
+
React.useLayoutEffect(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
const element = menu.current;
|
|
30
|
+
if (!open || !element) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const box = element.getBoundingClientRect();
|
|
34
|
+
const over = box.right - (document.documentElement.clientWidth - MENU_MARGIN);
|
|
35
|
+
if (over > 0) {
|
|
36
|
+
element.style.transform = `translateX(${-Math.min(over, box.left - MENU_MARGIN)}px)`;
|
|
37
|
+
}
|
|
38
|
+
(_a = element.querySelector('[role="menuitem"]')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
39
|
+
}, [open]);
|
|
40
|
+
const onKeyDown = (event) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
var _c;
|
|
43
|
+
if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
const items = [...((_c = (_a = menu.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[role="menuitem"]')) !== null && _c !== void 0 ? _c : [])];
|
|
48
|
+
const at = items.indexOf(document.activeElement);
|
|
49
|
+
(_b = items[(at + (event.key === 'ArrowDown' ? 1 : items.length - 1)) % items.length]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
50
|
+
};
|
|
51
|
+
return (React.createElement("div", { className: "ta-workbench-open", ref: root },
|
|
52
|
+
React.createElement("button", { ref: button, type: "button", className: `ta-icon-button ${open ? 'ta-on' : ''}`, title: t('ta.workbench.open'), "aria-label": t('ta.workbench.open'), "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": open ? id : undefined, onClick: () => setOpen(!open) },
|
|
53
|
+
React.createElement(Icon, { icon: Plus })),
|
|
54
|
+
open && (React.createElement("div", { className: `ta-workbench-menu ta-${align}`, id: id, role: "menu", ref: menu, "aria-label": t('ta.workbench.open'), onKeyDown: onKeyDown },
|
|
55
|
+
cwd && (React.createElement("div", { className: "ta-workbench-menu-cwd", title: t('ta.workbench.cwd', { path: cwd }) },
|
|
56
|
+
React.createElement(Folder, { size: 13, strokeWidth: 1.7, "aria-hidden": "true" }),
|
|
57
|
+
React.createElement("span", { className: "ta-ellipsis" }, MessageUtil.basename(cwd)))),
|
|
58
|
+
views.map(view => (React.createElement("button", { key: view.id, type: "button", role: "menuitem", className: "ta-account-item", onClick: () => {
|
|
59
|
+
close();
|
|
60
|
+
onOpenView(view.id);
|
|
61
|
+
} },
|
|
62
|
+
React.createElement(ViewGlyph, { view: view, size: 15 }),
|
|
63
|
+
React.createElement("span", { className: "ta-ellipsis" }, WebLabelUtil.text(view.title)))))))));
|
|
64
|
+
}
|
|
65
|
+
/** The menu of a tab: closing it, the others, those to a side, the saved ones, all; keeping a preview. */
|
|
66
|
+
function useTabMenu(editors, onClose, onPin) {
|
|
67
|
+
const t = useT();
|
|
68
|
+
return (editor) => {
|
|
69
|
+
const at = editors.indexOf(editor);
|
|
70
|
+
const ids = (list) => list.map(candidate => candidate.id);
|
|
71
|
+
const others = editors.filter(candidate => candidate !== editor);
|
|
72
|
+
const left = editors.slice(0, at);
|
|
73
|
+
const right = editors.slice(at + 1);
|
|
74
|
+
const saved = editors.filter(candidate => !candidate.dirty);
|
|
75
|
+
const items = [
|
|
76
|
+
{ label: t('ta.tab.close'), run: () => onClose([editor.id]) },
|
|
77
|
+
{ label: t('ta.tab.closeOthers'), run: () => onClose(ids(others)), disabled: others.length === 0 },
|
|
78
|
+
{ label: t('ta.tab.closeLeft'), run: () => onClose(ids(left)), disabled: left.length === 0 },
|
|
79
|
+
{ label: t('ta.tab.closeRight'), run: () => onClose(ids(right)), disabled: right.length === 0 },
|
|
80
|
+
'-',
|
|
81
|
+
{ label: t('ta.tab.closeSaved'), run: () => onClose(ids(saved)), disabled: saved.length === 0 },
|
|
82
|
+
{ label: t('ta.tab.closeAll'), run: () => onClose(ids(editors)) },
|
|
83
|
+
];
|
|
84
|
+
if (editor.preview) {
|
|
85
|
+
items.push('-', { label: t('ta.tab.keepOpen'), run: () => onPin(editor.id) });
|
|
86
|
+
}
|
|
87
|
+
return items;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** The close of a tab, or of a row of the tabs of a phone; the dot of a tab not saved, which it shows under a pointer. */
|
|
91
|
+
function CloseTab({ editor, title, onClose, onContextMenu, }) {
|
|
92
|
+
const t = useT();
|
|
93
|
+
return (React.createElement("button", { type: "button", className: "ta-editor-tab-close", "aria-label": t('ta.editor.close', { title }), onClick: onClose, onContextMenu: onContextMenu },
|
|
94
|
+
React.createElement(Icon, { icon: X, size: 13 }),
|
|
95
|
+
editor.dirty && React.createElement("span", { className: "ta-editor-tab-dirty", "aria-hidden": "true" })));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The tabs of a wide workbench, as those of a browser or an editor: the one shown is a card joined to what it
|
|
99
|
+
* shows, the others lie on the strip with a line between them, `+` follows the last one.
|
|
100
|
+
*/
|
|
101
|
+
export function TabStrip({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd, maximized, onMaximize }) {
|
|
102
|
+
const t = useT();
|
|
103
|
+
const [menu, openMenu] = useContextMenu();
|
|
104
|
+
const menuFor = useTabMenu(editors, onClose, onPin);
|
|
105
|
+
const list = React.useRef(null);
|
|
106
|
+
// The tab shown is in sight, also one opened past the edge of a strip that scrolls.
|
|
107
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: run again when another tab is shown or one opens
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
(_b = (_a = list.current) === null || _a === void 0 ? void 0 : _a.querySelector('.ta-editor-tab.ta-active')) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
111
|
+
}, [active, editors.length]);
|
|
112
|
+
return (React.createElement("header", { className: "ta-editor-tabs" },
|
|
113
|
+
React.createElement("div", { className: "ta-editor-tablist", role: "tablist", ref: list },
|
|
114
|
+
editors.length === 0 && React.createElement("span", { className: "ta-workbench-title" }, t('ta.workbench')),
|
|
115
|
+
editors.map(editor => {
|
|
116
|
+
const title = WebLabelUtil.text(editor.title);
|
|
117
|
+
const Glyph = editor.icon;
|
|
118
|
+
const selected = editor.id === active;
|
|
119
|
+
return (React.createElement("div", { key: editor.id, className: `ta-editor-tab ${selected ? 'ta-active' : ''} ${editor.preview ? 'ta-preview' : ''} ${editor.dirty ? 'ta-dirty' : ''}`, title: title },
|
|
120
|
+
React.createElement("button", { type: "button", role: "tab", "aria-selected": selected, className: "ta-editor-tab-button", onClick: () => onShow(editor.id), onDoubleClick: () => onPin(editor.id), onAuxClick: event => event.button === 1 && onClose([editor.id]), onContextMenu: event => openMenu(event, menuFor(editor)) },
|
|
121
|
+
Glyph && React.createElement(Glyph, { size: 14 }),
|
|
122
|
+
React.createElement("span", null, title)),
|
|
123
|
+
React.createElement(CloseTab, { editor: editor, title: title, onClose: () => onClose([editor.id]), onContextMenu: event => openMenu(event, menuFor(editor)) })));
|
|
124
|
+
})),
|
|
125
|
+
views.length > 0 && React.createElement(OpenMenu, { views: views, onOpenView: onOpenView, cwd: cwd }),
|
|
126
|
+
menu,
|
|
127
|
+
React.createElement("div", { className: "ta-workbench-actions" },
|
|
128
|
+
onMaximize && (React.createElement(IconButton, { icon: maximized ? Minimize2 : Maximize2, label: t(maximized ? 'ta.workbench.restore' : 'ta.workbench.maximize'), className: "ta-wide-only", "aria-pressed": maximized, onClick: onMaximize })),
|
|
129
|
+
React.createElement(IconButton, { icon: SidebarRight, label: t('ta.panel.hide'), onClick: onHide }))));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The head of the workbench on a phone, as a browser's there: back to the conversation, the tab shown with how
|
|
133
|
+
* many are open, which opens the list of them (TabSwitcher), and `+`. A row of tabs a finger scrolls and
|
|
134
|
+
* closes by their small crosses is neither seen nor hit well on a phone.
|
|
135
|
+
*/
|
|
136
|
+
export function CompactHead({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd }) {
|
|
137
|
+
const t = useT();
|
|
138
|
+
const [open, setOpen] = React.useState(false);
|
|
139
|
+
const [menu, openMenu] = useContextMenu();
|
|
140
|
+
const menuFor = useTabMenu(editors, onClose, onPin);
|
|
141
|
+
const root = React.useRef(null);
|
|
142
|
+
const button = React.useRef(null);
|
|
143
|
+
const close = React.useCallback(() => setOpen(false), []);
|
|
144
|
+
useDismiss(open, close, root, button);
|
|
145
|
+
const shown = editors.find(editor => editor.id === active);
|
|
146
|
+
// Nothing left to list: the list goes with the last tab.
|
|
147
|
+
React.useEffect(() => {
|
|
148
|
+
if (editors.length === 0) {
|
|
149
|
+
setOpen(false);
|
|
150
|
+
}
|
|
151
|
+
}, [editors.length]);
|
|
152
|
+
const Glyph = shown === null || shown === void 0 ? void 0 : shown.icon;
|
|
153
|
+
const title = shown ? WebLabelUtil.text(shown.title) : t('ta.workbench');
|
|
154
|
+
return (React.createElement("div", { className: "ta-editor-head-compact", ref: root },
|
|
155
|
+
React.createElement("header", { className: "ta-editor-tabs" },
|
|
156
|
+
React.createElement(IconButton, { icon: ChevronLeft, label: t('ta.panel.hide'), className: "ta-workbench-back", onClick: onHide }),
|
|
157
|
+
shown ? (React.createElement("button", { ref: button, type: "button", className: `ta-workbench-switch ${open ? 'ta-on' : ''}`, "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": `${title}, ${t('ta.workbench.tabs', { count: editors.length })}`, onClick: () => setOpen(!open), onContextMenu: event => openMenu(event, menuFor(shown)) },
|
|
158
|
+
Glyph && React.createElement(Glyph, { size: 16 }),
|
|
159
|
+
React.createElement("span", { className: "ta-workbench-switch-title" }, title),
|
|
160
|
+
editors.length > 1 && React.createElement("span", { className: "ta-workbench-count" }, editors.length),
|
|
161
|
+
React.createElement(ChevronDown, { className: "ta-workbench-switch-caret", size: 15, strokeWidth: 1.8, "aria-hidden": "true" }))) : (React.createElement("span", { className: "ta-workbench-title" }, title)),
|
|
162
|
+
views.length > 0 && React.createElement(OpenMenu, { views: views, onOpenView: onOpenView, cwd: cwd, align: "end" })),
|
|
163
|
+
menu,
|
|
164
|
+
open && (React.createElement(TabSwitcher, { editors: editors, active: active, onShow: id => {
|
|
165
|
+
close();
|
|
166
|
+
onShow(id);
|
|
167
|
+
}, onClose: onClose, onMenu: (event, editor) => openMenu(event, menuFor(editor)), onDismiss: close }))));
|
|
168
|
+
}
|
|
169
|
+
/** The tabs open on a phone, as rows of a finger's height under its head: a tap shows one, its cross closes it, a long press opens its menu. */
|
|
170
|
+
export function TabSwitcher({ editors, active, onShow, onClose, onMenu, onDismiss, }) {
|
|
171
|
+
const t = useT();
|
|
172
|
+
return (React.createElement(React.Fragment, null,
|
|
173
|
+
React.createElement("button", { type: "button", className: "ta-tab-switcher-scrim", tabIndex: -1, "aria-label": t('ta.close'), onClick: onDismiss }),
|
|
174
|
+
React.createElement("div", { className: "ta-tab-switcher" },
|
|
175
|
+
React.createElement("div", { className: "ta-tab-switcher-head" },
|
|
176
|
+
React.createElement("span", { className: "ta-tab-switcher-count" }, t('ta.workbench.tabs', { count: editors.length })),
|
|
177
|
+
editors.length > 1 && (React.createElement("button", { type: "button", className: "ta-tab-switcher-all", onClick: () => onClose(editors.map(editor => editor.id)) }, t('ta.tab.closeAll')))),
|
|
178
|
+
React.createElement("div", { className: "ta-tab-switcher-list", role: "listbox", "aria-label": t('ta.workbench.tabs', { count: editors.length }) }, editors.map(editor => {
|
|
179
|
+
var _a;
|
|
180
|
+
const title = WebLabelUtil.text(editor.title);
|
|
181
|
+
const Glyph = (_a = editor.icon) !== null && _a !== void 0 ? _a : PanelTop;
|
|
182
|
+
const selected = editor.id === active;
|
|
183
|
+
return (React.createElement("div", { key: editor.id, className: `ta-tab-switcher-row ${selected ? 'ta-active' : ''} ${editor.dirty ? 'ta-dirty' : ''}` },
|
|
184
|
+
React.createElement("button", { type: "button", role: "option", "aria-selected": selected, className: "ta-tab-switcher-main", onClick: () => onShow(editor.id), onContextMenu: event => onMenu(event, editor) },
|
|
185
|
+
React.createElement("span", { className: "ta-tab-switcher-glyph" },
|
|
186
|
+
React.createElement(Glyph, { size: 16 })),
|
|
187
|
+
React.createElement("span", { className: `ta-tab-switcher-title ${editor.preview ? 'ta-preview' : ''}` }, title),
|
|
188
|
+
editor.dirty && React.createElement("span", { className: "ta-tab-switcher-dirty", "aria-hidden": "true" })),
|
|
189
|
+
React.createElement("button", { type: "button", className: "ta-tab-switcher-close", "aria-label": t('ta.editor.close', { title }), onClick: () => onClose([editor.id]) },
|
|
190
|
+
React.createElement(Icon, { icon: X, size: 16 }))));
|
|
191
|
+
})))));
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=workbench-tabs.js.map
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type Translate } from '../i18n/use-t.js';
|
|
3
|
-
import type { ComposerAction } from './composer-box.js';
|
|
4
2
|
/** The workbench on the right is the page's, one for all of it: whether it shows, and the button that shows or hides it. */
|
|
5
3
|
export interface WorkbenchToggleState {
|
|
6
4
|
open: boolean;
|
|
7
5
|
toggle(): void;
|
|
8
|
-
/** The tabs open in it. */
|
|
9
|
-
tabs: number;
|
|
10
6
|
}
|
|
11
7
|
export declare const WorkbenchToggleContext: React.Context<WorkbenchToggleState | undefined>;
|
|
12
8
|
/**
|
|
@@ -14,12 +10,3 @@ export declare const WorkbenchToggleContext: React.Context<WorkbenchToggleState
|
|
|
14
10
|
* hidden: once shown, the same button on top of the workbench hides it.
|
|
15
11
|
*/
|
|
16
12
|
export declare function WorkbenchToggle(): React.JSX.Element | null;
|
|
17
|
-
/**
|
|
18
|
-
* The same, as an entry of the + menu of the message box, on a phone only: held in one hand, the head is out
|
|
19
|
-
* of reach of the thumb, and a swipe to the left across the conversation is not easy either.
|
|
20
|
-
*/
|
|
21
|
-
export declare function useWorkbenchAction(): ComposerAction | undefined;
|
|
22
|
-
export declare namespace WorkbenchToggleUtil {
|
|
23
|
-
/** The entry of the + menu that shows the workbench: on a phone, while it is hidden. */
|
|
24
|
-
function action(state: WorkbenchToggleState | undefined, handheld: boolean, t: Translate): ComposerAction | undefined;
|
|
25
|
-
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useDevice } from '../device/device.js';
|
|
3
2
|
import { useT } from '../i18n/use-t.js';
|
|
4
|
-
import {
|
|
3
|
+
import { IconButton, SidebarRight } from './icon.js';
|
|
5
4
|
export const WorkbenchToggleContext = React.createContext(undefined);
|
|
6
5
|
/**
|
|
7
6
|
* The button that shows the workbench, for the head of the conversation or of a page. Only while it is
|
|
@@ -15,30 +14,4 @@ export function WorkbenchToggle() {
|
|
|
15
14
|
}
|
|
16
15
|
return React.createElement(IconButton, { icon: SidebarRight, label: t('ta.panel.show'), onClick: state.toggle });
|
|
17
16
|
}
|
|
18
|
-
/**
|
|
19
|
-
* The same, as an entry of the + menu of the message box, on a phone only: held in one hand, the head is out
|
|
20
|
-
* of reach of the thumb, and a swipe to the left across the conversation is not easy either.
|
|
21
|
-
*/
|
|
22
|
-
export function useWorkbenchAction() {
|
|
23
|
-
const t = useT();
|
|
24
|
-
const { handheld } = useDevice();
|
|
25
|
-
return WorkbenchToggleUtil.action(React.useContext(WorkbenchToggleContext), handheld, t);
|
|
26
|
-
}
|
|
27
|
-
export var WorkbenchToggleUtil;
|
|
28
|
-
(function (WorkbenchToggleUtil) {
|
|
29
|
-
/** The entry of the + menu that shows the workbench: on a phone, while it is hidden. */
|
|
30
|
-
function action(state, handheld, t) {
|
|
31
|
-
if (!handheld || !state || state.open) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
key: 'workbench',
|
|
36
|
-
label: t('ta.workbench'),
|
|
37
|
-
icon: React.createElement(Icon, { icon: SidebarRight, size: 16 }),
|
|
38
|
-
detail: state.tabs ? t('ta.workbench.tabs', { count: state.tabs }) : undefined,
|
|
39
|
-
run: state.toggle,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
WorkbenchToggleUtil.action = action;
|
|
43
|
-
})(WorkbenchToggleUtil || (WorkbenchToggleUtil = {}));
|
|
44
17
|
//# sourceMappingURL=workbench-toggle.js.map
|