@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
|
@@ -1,13 +1,75 @@
|
|
|
1
|
-
/** Talking to ta and hearing it, with what the browser has: no service, no dependency. */
|
|
1
|
+
/** Talking to ta and hearing it, with what the browser or the app has: no service, no dependency. */
|
|
2
2
|
export var Voice;
|
|
3
3
|
(function (Voice) {
|
|
4
|
+
/** The window event the Ta app on iOS answers a listening with. */
|
|
5
|
+
Voice.NATIVE_EVENT = 'ta-speech';
|
|
6
|
+
/**
|
|
7
|
+
* Words of the work a recognizer hears as others (`README` as 瑞德米): Apple's recognizer is told to expect them.
|
|
8
|
+
* At most 100 are taken, with the directory and the names a box adds.
|
|
9
|
+
*/
|
|
10
|
+
Voice.VOCABULARY = [
|
|
11
|
+
'Ta',
|
|
12
|
+
'pi',
|
|
13
|
+
'README',
|
|
14
|
+
'commit',
|
|
15
|
+
'push',
|
|
16
|
+
'pull request',
|
|
17
|
+
'PR',
|
|
18
|
+
'merge',
|
|
19
|
+
'rebase',
|
|
20
|
+
'branch',
|
|
21
|
+
'main',
|
|
22
|
+
'worktree',
|
|
23
|
+
'git',
|
|
24
|
+
'GitHub',
|
|
25
|
+
'npm',
|
|
26
|
+
'bun',
|
|
27
|
+
'Node',
|
|
28
|
+
'TypeScript',
|
|
29
|
+
'JavaScript',
|
|
30
|
+
'React',
|
|
31
|
+
'CSS',
|
|
32
|
+
'HTML',
|
|
33
|
+
'API',
|
|
34
|
+
'JSON',
|
|
35
|
+
'YAML',
|
|
36
|
+
'Markdown',
|
|
37
|
+
'bug',
|
|
38
|
+
'issue',
|
|
39
|
+
'build',
|
|
40
|
+
'deploy',
|
|
41
|
+
'debug',
|
|
42
|
+
'log',
|
|
43
|
+
'test',
|
|
44
|
+
'lint',
|
|
45
|
+
'iOS',
|
|
46
|
+
'Android',
|
|
47
|
+
'iPhone',
|
|
48
|
+
'iPad',
|
|
49
|
+
'Web',
|
|
50
|
+
'App',
|
|
51
|
+
'SDK',
|
|
52
|
+
'CLI',
|
|
53
|
+
'SSH',
|
|
54
|
+
'Docker',
|
|
55
|
+
'Python',
|
|
56
|
+
'Rust',
|
|
57
|
+
'Go',
|
|
58
|
+
'Swift',
|
|
59
|
+
'Cell',
|
|
60
|
+
];
|
|
4
61
|
function recognitionClass() {
|
|
5
62
|
var _a;
|
|
6
63
|
const scope = globalThis;
|
|
7
64
|
return (_a = scope.SpeechRecognition) !== null && _a !== void 0 ? _a : scope.webkitSpeechRecognition;
|
|
8
65
|
}
|
|
66
|
+
/** The recognizer of the Ta app on iOS, Apple's own: WebKit's repeats what it heard and leaves out punctuation. */
|
|
67
|
+
function nativeSpeech() {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
return (_b = (_a = globalThis.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taSpeech;
|
|
70
|
+
}
|
|
9
71
|
function canListen() {
|
|
10
|
-
return recognitionClass() !== undefined;
|
|
72
|
+
return nativeSpeech() !== undefined || recognitionClass() !== undefined;
|
|
11
73
|
}
|
|
12
74
|
Voice.canListen = canListen;
|
|
13
75
|
/** The user, the system or the browser does not let the page listen: the microphone or speech recognition is not allowed. */
|
|
@@ -15,12 +77,52 @@ export var Voice;
|
|
|
15
77
|
return error === 'not-allowed' || error === 'service-not-allowed';
|
|
16
78
|
}
|
|
17
79
|
Voice.denied = denied;
|
|
18
|
-
|
|
19
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The words of a recognition's results. Safari's repeat what came before: a result may be all the words so far
|
|
82
|
+
* rather than the next ones, and a phrase may come twice over. A result that starts with what was said before it
|
|
83
|
+
* takes its place, and a phrase said twice over in one go is said once.
|
|
84
|
+
*/
|
|
85
|
+
function transcript(results) {
|
|
86
|
+
var _a;
|
|
87
|
+
var _b;
|
|
88
|
+
let text = '';
|
|
89
|
+
for (let i = 0; i < results.length; i++) {
|
|
90
|
+
const part = once((_b = (_a = results[i][0]) === null || _a === void 0 ? void 0 : _a.transcript) !== null && _b !== void 0 ? _b : '');
|
|
91
|
+
const said = text.trim();
|
|
92
|
+
text = said && part.trim().startsWith(said) ? part : text + part;
|
|
93
|
+
}
|
|
94
|
+
return once(text);
|
|
20
95
|
}
|
|
21
|
-
Voice.
|
|
22
|
-
/**
|
|
23
|
-
function
|
|
96
|
+
Voice.transcript = transcript;
|
|
97
|
+
/** `a a` or `aa` as `a`, for a phrase `a` too long (4 characters) to be said twice on purpose. */
|
|
98
|
+
function once(text) {
|
|
99
|
+
const words = text.trim();
|
|
100
|
+
for (const gap of [' ', '']) {
|
|
101
|
+
const half = (words.length - gap.length) / 2;
|
|
102
|
+
if (Number.isInteger(half) &&
|
|
103
|
+
half >= 4 &&
|
|
104
|
+
words.slice(0, half) === words.slice(half + gap.length) &&
|
|
105
|
+
words.slice(half, half + gap.length) === gap) {
|
|
106
|
+
return words.slice(0, half);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return text;
|
|
110
|
+
}
|
|
111
|
+
/** The words to expect, the given ones first, at most the 100 Apple's recognizer takes. */
|
|
112
|
+
function hints(more = []) {
|
|
113
|
+
return [...new Set([...more.filter(word => word.trim()), ...Voice.VOCABULARY])].slice(0, 100);
|
|
114
|
+
}
|
|
115
|
+
Voice.hints = hints;
|
|
116
|
+
/**
|
|
117
|
+
* Listens for one utterance: `onText` gets the words so far, then the final ones with `final` set; `onEnd` follows
|
|
118
|
+
* once (an error ends it, silence is no error). In the Ta app on iOS, Apple's recognizer listens, with punctuation
|
|
119
|
+
* and the words to expect; elsewhere the browser's.
|
|
120
|
+
*/
|
|
121
|
+
function listen(language, onText, onEnd, options = {}) {
|
|
122
|
+
const native = nativeSpeech();
|
|
123
|
+
if (native) {
|
|
124
|
+
return listenNatively(native, language, onText, onEnd, options);
|
|
125
|
+
}
|
|
24
126
|
const Recognition = recognitionClass();
|
|
25
127
|
if (!Recognition) {
|
|
26
128
|
return undefined;
|
|
@@ -28,46 +130,189 @@ export var Voice;
|
|
|
28
130
|
const recognition = new Recognition();
|
|
29
131
|
recognition.lang = language;
|
|
30
132
|
recognition.interimResults = true;
|
|
31
|
-
recognition.continuous =
|
|
32
|
-
let
|
|
133
|
+
recognition.continuous = options.continuous === true;
|
|
134
|
+
let ended = false;
|
|
135
|
+
const end = (error) => {
|
|
136
|
+
if (!ended) {
|
|
137
|
+
ended = true;
|
|
138
|
+
onEnd(error);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
33
141
|
recognition.onresult = event => {
|
|
34
142
|
let final = false;
|
|
35
|
-
text = '';
|
|
36
143
|
for (let i = 0; i < event.results.length; i++) {
|
|
37
|
-
text += event.results[i][0].transcript;
|
|
38
144
|
final || (final = event.results[i].isFinal);
|
|
39
145
|
}
|
|
40
|
-
onText(
|
|
146
|
+
onText(transcript(event.results), final);
|
|
41
147
|
};
|
|
42
|
-
recognition.onerror = event =>
|
|
43
|
-
recognition.onend = () =>
|
|
148
|
+
recognition.onerror = event => end(event.error === 'no-speech' ? undefined : event.error);
|
|
149
|
+
recognition.onend = () => end();
|
|
44
150
|
recognition.start();
|
|
45
151
|
return { stop: () => recognition.stop() };
|
|
46
152
|
}
|
|
47
153
|
Voice.listen = listen;
|
|
48
|
-
|
|
154
|
+
function listenNatively(native, language, onText, onEnd, options) {
|
|
155
|
+
const id = crypto.randomUUID();
|
|
156
|
+
let ended = false;
|
|
157
|
+
const onEvent = (event) => {
|
|
158
|
+
const answer = event.detail;
|
|
159
|
+
if (ended || (answer === null || answer === void 0 ? void 0 : answer.id) !== id) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (answer.end) {
|
|
163
|
+
ended = true;
|
|
164
|
+
globalThis.removeEventListener(Voice.NATIVE_EVENT, onEvent);
|
|
165
|
+
onEnd(answer.error === 'no-speech' ? undefined : answer.error);
|
|
166
|
+
}
|
|
167
|
+
else if (typeof answer.text === 'string') {
|
|
168
|
+
onText(answer.text, answer.final === true);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
globalThis.addEventListener(Voice.NATIVE_EVENT, onEvent);
|
|
172
|
+
native.postMessage({ id, action: 'start', language, continuous: options.continuous === true, hints: hints(options.hints) });
|
|
173
|
+
return { stop: () => !ended && native.postMessage({ id, action: 'stop' }) };
|
|
174
|
+
}
|
|
175
|
+
function canSpeak() {
|
|
176
|
+
return typeof speechSynthesis !== 'undefined';
|
|
177
|
+
}
|
|
178
|
+
Voice.canSpeak = canSpeak;
|
|
179
|
+
/** Text for the ear: no markdown marks, no code, no links, no list marks; a line ends a sentence. */
|
|
49
180
|
function spoken(markdown) {
|
|
50
181
|
return markdown
|
|
51
182
|
.replace(/```[\s\S]*?(```|$)/g, ' ')
|
|
183
|
+
.replace(/!\[[^\]]*\]\([^)]*\)/g, ' ')
|
|
52
184
|
.replace(/`([^`]*)`/g, '$1')
|
|
53
185
|
.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
|
|
54
|
-
.replace(/
|
|
55
|
-
.replace(
|
|
186
|
+
.replace(/https?:\/\/\S+/g, ' ')
|
|
187
|
+
.replace(/^\s*([-*+]|\d+[.)])\s+/gm, '')
|
|
188
|
+
.replace(/^\s*\|?\s*:?-{3,}.*$/gm, '')
|
|
189
|
+
.replace(/[*_#>|~]+/g, ' ')
|
|
190
|
+
.replace(/\p{Extended_Pictographic}|\uFE0F/gu, '')
|
|
191
|
+
.replace(/[ \t]+/g, ' ')
|
|
192
|
+
.replace(/\s*\n\s*/g, '\n')
|
|
56
193
|
.trim();
|
|
57
194
|
}
|
|
58
195
|
Voice.spoken = spoken;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
196
|
+
/** The longest piece read at once: Chrome stops a long one half way, and a sentence each reads with its pauses. */
|
|
197
|
+
const PIECE = 180;
|
|
198
|
+
/** What a text is read in: its sentences and lines, a long one in pieces at its commas. */
|
|
199
|
+
function sentences(text) {
|
|
200
|
+
const pieces = [];
|
|
201
|
+
for (const sentence of text.split(/(?<=[。!?!?;;\n])|(?<=[.:])(?=\s)/)) {
|
|
202
|
+
const words = sentence.trim();
|
|
203
|
+
if (words.length <= PIECE) {
|
|
204
|
+
if (words) {
|
|
205
|
+
pieces.push(words);
|
|
206
|
+
}
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
let piece = '';
|
|
210
|
+
for (const part of words.split(/(?<=[,,、::])/)) {
|
|
211
|
+
if (piece && piece.length + part.length > PIECE) {
|
|
212
|
+
pieces.push(piece);
|
|
213
|
+
piece = '';
|
|
214
|
+
}
|
|
215
|
+
piece += part;
|
|
216
|
+
while (piece.length > PIECE) {
|
|
217
|
+
pieces.push(piece.slice(0, PIECE));
|
|
218
|
+
piece = piece.slice(PIECE);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (piece.trim()) {
|
|
222
|
+
pieces.push(piece.trim());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return pieces;
|
|
226
|
+
}
|
|
227
|
+
Voice.sentences = sentences;
|
|
228
|
+
/** The language a text is read in: Chinese for Chinese, whatever the page's. */
|
|
229
|
+
function languageOf(text, language) {
|
|
230
|
+
return /[\u4e00-\u9fff]/.test(text) ? 'zh-CN' : language;
|
|
231
|
+
}
|
|
232
|
+
Voice.languageOf = languageOf;
|
|
233
|
+
/** Toys and the voices of a screen reader of old (Eloquence), which sound as machines. */
|
|
234
|
+
const ROBOTIC = /eloquence|^(Albert|Bad News|Bahh|Bells|Boing|Bubbles|Cellos|Good News|Jester|Organ|Superstar|Trinoids|Whisper|Wobble|Zarvox|Eddy|Flo|Grandma|Grandpa|Reed|Rocko|Sandy|Shelley)\b/i;
|
|
235
|
+
/**
|
|
236
|
+
* How natural a voice sounds, from what its name and address say: the neural voices of Edge and the premium
|
|
237
|
+
* ones of Apple first, then the enhanced and Siri's, Google's, the default ones, and the robotic last.
|
|
238
|
+
*/
|
|
239
|
+
function quality(voice) {
|
|
240
|
+
const said = `${voice.name} ${voice.voiceURI}`;
|
|
241
|
+
if (ROBOTIC.test(voice.name) || ROBOTIC.test(voice.voiceURI)) {
|
|
242
|
+
return 0;
|
|
243
|
+
}
|
|
244
|
+
if (/premium|natural|neural|高音质/i.test(said)) {
|
|
245
|
+
return 4;
|
|
246
|
+
}
|
|
247
|
+
if (/enhanced|siri|优化|增强/i.test(said)) {
|
|
248
|
+
return 3;
|
|
249
|
+
}
|
|
250
|
+
if (/^Google/.test(voice.name)) {
|
|
251
|
+
return 2;
|
|
252
|
+
}
|
|
253
|
+
return 1;
|
|
254
|
+
}
|
|
255
|
+
Voice.quality = quality;
|
|
256
|
+
/** The voices of a language (`zh-CN`), the most natural first; those of its region before the others. */
|
|
257
|
+
function voicesFor(all, language) {
|
|
258
|
+
const tag = (lang) => lang.replace('_', '-').toLowerCase();
|
|
259
|
+
const wanted = tag(language);
|
|
260
|
+
const base = wanted.split('-')[0];
|
|
261
|
+
const rank = (voice) => quality(voice) * 2 + (tag(voice.lang) === wanted ? 1 : 0);
|
|
262
|
+
return all.filter(voice => tag(voice.lang).split('-')[0] === base).sort((a, b) => rank(b) - rank(a));
|
|
263
|
+
}
|
|
264
|
+
Voice.voicesFor = voicesFor;
|
|
265
|
+
/** The voice a text is read with: the one chosen (by its `voiceURI`) where it is of the language, else the most natural. */
|
|
266
|
+
function pick(all, language, chosen) {
|
|
267
|
+
var _a;
|
|
268
|
+
const voices = voicesFor(all, language);
|
|
269
|
+
return (_a = voices.find(voice => voice.voiceURI === chosen)) !== null && _a !== void 0 ? _a : voices[0];
|
|
270
|
+
}
|
|
271
|
+
Voice.pick = pick;
|
|
272
|
+
/** The voices of the system; Chrome has them only once it says so (voiceschanged). */
|
|
273
|
+
function voices() {
|
|
274
|
+
return canSpeak() ? speechSynthesis.getVoices() : [];
|
|
275
|
+
}
|
|
276
|
+
Voice.voices = voices;
|
|
277
|
+
let reading;
|
|
278
|
+
/** Reads a reply out, a sentence at a time, with `voice` (a `voiceURI`) or the most natural one; `onEnd` once it is all read. */
|
|
279
|
+
function speak(markdown, language, onEnd, voice) {
|
|
280
|
+
hush();
|
|
281
|
+
const text = spoken(markdown);
|
|
282
|
+
const lang = languageOf(text, language);
|
|
283
|
+
const chosen = pick(voices(), lang, voice);
|
|
284
|
+
const pieces = sentences(text);
|
|
285
|
+
const run = { stopped: false };
|
|
286
|
+
reading = run;
|
|
287
|
+
let index = 0;
|
|
288
|
+
const next = () => {
|
|
289
|
+
var _a;
|
|
290
|
+
if (run.stopped) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (index >= pieces.length) {
|
|
294
|
+
reading = undefined;
|
|
295
|
+
onEnd();
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const utterance = new SpeechSynthesisUtterance(pieces[index++]);
|
|
299
|
+
utterance.lang = (_a = chosen === null || chosen === void 0 ? void 0 : chosen.lang) !== null && _a !== void 0 ? _a : lang;
|
|
300
|
+
if (chosen) {
|
|
301
|
+
utterance.voice = chosen;
|
|
302
|
+
}
|
|
303
|
+
utterance.onend = next;
|
|
304
|
+
// Cancelled (hush), it stops; another failure skips the piece rather than the rest.
|
|
305
|
+
utterance.onerror = event => event.error !== 'interrupted' && event.error !== 'canceled' && next();
|
|
306
|
+
speechSynthesis.speak(utterance);
|
|
307
|
+
};
|
|
308
|
+
next();
|
|
68
309
|
}
|
|
69
310
|
Voice.speak = speak;
|
|
70
311
|
function hush() {
|
|
312
|
+
if (reading) {
|
|
313
|
+
reading.stopped = true;
|
|
314
|
+
reading = undefined;
|
|
315
|
+
}
|
|
71
316
|
if (canSpeak()) {
|
|
72
317
|
speechSynthesis.cancel();
|
|
73
318
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** The size of a picture or of the box it is shown in, in CSS pixels. */
|
|
2
|
+
export interface ZoomSize {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
/** How far a picture may be zoomed in its box: `base` it shows at first, between `min` and `max`. */
|
|
7
|
+
export interface ZoomLimits {
|
|
8
|
+
base: number;
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A picture zoomed in a box that scrolls: how big it is drawn, where it is in what scrolls, and how far that
|
|
14
|
+
* scrolls so that a point of the picture stays under the fingers or the pointer. Pure, for the tests.
|
|
15
|
+
*/
|
|
16
|
+
export declare namespace ZoomUtil {
|
|
17
|
+
/** Space around the picture at every scale, so that its edges never touch the box. */
|
|
18
|
+
const PAD = 16;
|
|
19
|
+
/** The steps of the + and − buttons and keys. */
|
|
20
|
+
const STOPS: number[];
|
|
21
|
+
/** At this scale and over, its pixels are drawn as squares, as the viewers of pictures do. */
|
|
22
|
+
const PIXELATED = 4;
|
|
23
|
+
/** The scale at which all of the picture shows in the box: what it shows at first unless that is larger than its own pixels. */
|
|
24
|
+
function contain(image: ZoomSize, box: ZoomSize): number;
|
|
25
|
+
/** All of it in the box, never larger than its own pixels; no smaller than that, and in to at least LEAST_MAX. */
|
|
26
|
+
function limits(image: ZoomSize, box: ZoomSize): ZoomLimits;
|
|
27
|
+
function clamp(scale: number, limits: ZoomLimits): number;
|
|
28
|
+
/** What a pinch past the limits draws: it goes on, ever less far. */
|
|
29
|
+
function rubber(scale: number, limits: ZoomLimits): number;
|
|
30
|
+
/** Where the picture starts along an axis of `box` pixels, `size` pixels drawn: centred while smaller, else after PAD. */
|
|
31
|
+
function offset(size: number, box: number): number;
|
|
32
|
+
/** How long what scrolls is along an axis: the box, or the picture and PAD on both sides. */
|
|
33
|
+
function extent(size: number, box: number): number;
|
|
34
|
+
/** Where in the picture (its own pixels) a point of the box is, along an axis, the picture `natural` pixels long at `scale`. */
|
|
35
|
+
function at(point: number, scroll: number, natural: number, scale: number, box: number): number;
|
|
36
|
+
/** How far to scroll along an axis so that `spot` of the picture (its own pixels) is under `point` of the box, at `scale`. */
|
|
37
|
+
function scrollTo(spot: number, point: number, natural: number, scale: number, box: number): number;
|
|
38
|
+
/** The next step in (`way` 1) or out (-1) from `scale`; `base` is a step too. */
|
|
39
|
+
function step(scale: number, way: 1 | -1, limits: ZoomLimits): number;
|
|
40
|
+
/** Whether it shows as at first. */
|
|
41
|
+
function fitted(scale: number, limits: ZoomLimits): boolean;
|
|
42
|
+
/** A double tap or click: back to `base` when zoomed, else in, to its own pixels when that is a few times nearer. */
|
|
43
|
+
function toggle(scale: number, limits: ZoomLimits): number;
|
|
44
|
+
/** How much a turn of the wheel or a pinch of the trackpad (a wheel with Ctrl) zooms: `deltaY` in `deltaMode`'s unit. */
|
|
45
|
+
function wheel(deltaY: number, deltaMode: number): number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A picture zoomed in a box that scrolls: how big it is drawn, where it is in what scrolls, and how far that
|
|
3
|
+
* scrolls so that a point of the picture stays under the fingers or the pointer. Pure, for the tests.
|
|
4
|
+
*/
|
|
5
|
+
export var ZoomUtil;
|
|
6
|
+
(function (ZoomUtil) {
|
|
7
|
+
/** Space around the picture at every scale, so that its edges never touch the box. */
|
|
8
|
+
ZoomUtil.PAD = 16;
|
|
9
|
+
/** The steps of the + and − buttons and keys. */
|
|
10
|
+
ZoomUtil.STOPS = [0.05, 0.1, 0.15, 0.25, 0.33, 0.5, 0.67, 0.75, 1, 1.25, 1.5, 2, 3, 4, 6, 8, 12, 16, 24, 32];
|
|
11
|
+
/** At least this far in, however big the picture. */
|
|
12
|
+
const LEAST_MAX = 8;
|
|
13
|
+
/** At this scale and over, its pixels are drawn as squares, as the viewers of pictures do. */
|
|
14
|
+
ZoomUtil.PIXELATED = 4;
|
|
15
|
+
/** A pinch past the limits goes on this much less far (a rubber band), then comes back. */
|
|
16
|
+
const RUBBER = 0.35;
|
|
17
|
+
/** The scale at which all of the picture shows in the box: what it shows at first unless that is larger than its own pixels. */
|
|
18
|
+
function contain(image, box) {
|
|
19
|
+
const width = Math.max(1, box.width - 2 * ZoomUtil.PAD);
|
|
20
|
+
const height = Math.max(1, box.height - 2 * ZoomUtil.PAD);
|
|
21
|
+
return Math.min(width / Math.max(1, image.width), height / Math.max(1, image.height));
|
|
22
|
+
}
|
|
23
|
+
ZoomUtil.contain = contain;
|
|
24
|
+
/** All of it in the box, never larger than its own pixels; no smaller than that, and in to at least LEAST_MAX. */
|
|
25
|
+
function limits(image, box) {
|
|
26
|
+
const whole = contain(image, box);
|
|
27
|
+
const base = Math.min(1, whole);
|
|
28
|
+
return { base, min: base, max: Math.max(LEAST_MAX, whole * 2) };
|
|
29
|
+
}
|
|
30
|
+
ZoomUtil.limits = limits;
|
|
31
|
+
function clamp(scale, limits) {
|
|
32
|
+
return Math.min(limits.max, Math.max(limits.min, scale));
|
|
33
|
+
}
|
|
34
|
+
ZoomUtil.clamp = clamp;
|
|
35
|
+
/** What a pinch past the limits draws: it goes on, ever less far. */
|
|
36
|
+
function rubber(scale, limits) {
|
|
37
|
+
if (scale < limits.min) {
|
|
38
|
+
return limits.min * (scale / limits.min) ** RUBBER;
|
|
39
|
+
}
|
|
40
|
+
if (scale > limits.max) {
|
|
41
|
+
return limits.max * (scale / limits.max) ** RUBBER;
|
|
42
|
+
}
|
|
43
|
+
return scale;
|
|
44
|
+
}
|
|
45
|
+
ZoomUtil.rubber = rubber;
|
|
46
|
+
/** Where the picture starts along an axis of `box` pixels, `size` pixels drawn: centred while smaller, else after PAD. */
|
|
47
|
+
function offset(size, box) {
|
|
48
|
+
return Math.max(ZoomUtil.PAD, (box - size) / 2);
|
|
49
|
+
}
|
|
50
|
+
ZoomUtil.offset = offset;
|
|
51
|
+
/** How long what scrolls is along an axis: the box, or the picture and PAD on both sides. */
|
|
52
|
+
function extent(size, box) {
|
|
53
|
+
return Math.max(box, size + 2 * ZoomUtil.PAD);
|
|
54
|
+
}
|
|
55
|
+
ZoomUtil.extent = extent;
|
|
56
|
+
/** Where in the picture (its own pixels) a point of the box is, along an axis, the picture `natural` pixels long at `scale`. */
|
|
57
|
+
function at(point, scroll, natural, scale, box) {
|
|
58
|
+
return (scroll + point - offset(natural * scale, box)) / scale;
|
|
59
|
+
}
|
|
60
|
+
ZoomUtil.at = at;
|
|
61
|
+
/** How far to scroll along an axis so that `spot` of the picture (its own pixels) is under `point` of the box, at `scale`. */
|
|
62
|
+
function scrollTo(spot, point, natural, scale, box) {
|
|
63
|
+
const size = natural * scale;
|
|
64
|
+
const most = extent(size, box) - box;
|
|
65
|
+
return Math.min(most, Math.max(0, spot * scale + offset(size, box) - point));
|
|
66
|
+
}
|
|
67
|
+
ZoomUtil.scrollTo = scrollTo;
|
|
68
|
+
/** The next step in (`way` 1) or out (-1) from `scale`; `base` is a step too. */
|
|
69
|
+
function step(scale, way, limits) {
|
|
70
|
+
const stops = [...ZoomUtil.STOPS, limits.base].sort((a, b) => a - b);
|
|
71
|
+
const next = way > 0 ? stops.find(stop => stop > scale * 1.01) : [...stops].reverse().find(stop => stop < scale * 0.99);
|
|
72
|
+
return clamp(next !== null && next !== void 0 ? next : (way > 0 ? limits.max : limits.min), limits);
|
|
73
|
+
}
|
|
74
|
+
ZoomUtil.step = step;
|
|
75
|
+
/** Whether it shows as at first. */
|
|
76
|
+
function fitted(scale, limits) {
|
|
77
|
+
return Math.abs(scale - limits.base) < limits.base * 0.01;
|
|
78
|
+
}
|
|
79
|
+
ZoomUtil.fitted = fitted;
|
|
80
|
+
/** A double tap or click: back to `base` when zoomed, else in, to its own pixels when that is a few times nearer. */
|
|
81
|
+
function toggle(scale, limits) {
|
|
82
|
+
if (!fitted(scale, limits)) {
|
|
83
|
+
return limits.base;
|
|
84
|
+
}
|
|
85
|
+
const target = limits.base < 1 ? Math.max(limits.base * 2, Math.min(1, limits.base * 4)) : limits.base * 2.5;
|
|
86
|
+
return clamp(target, limits);
|
|
87
|
+
}
|
|
88
|
+
ZoomUtil.toggle = toggle;
|
|
89
|
+
/** How much a turn of the wheel or a pinch of the trackpad (a wheel with Ctrl) zooms: `deltaY` in `deltaMode`'s unit. */
|
|
90
|
+
function wheel(deltaY, deltaMode) {
|
|
91
|
+
const pixels = deltaY * (deltaMode === 1 ? 16 : deltaMode === 2 ? 400 : 1);
|
|
92
|
+
return Math.exp(-Math.min(40, Math.max(-40, pixels)) * 0.01);
|
|
93
|
+
}
|
|
94
|
+
ZoomUtil.wheel = wheel;
|
|
95
|
+
})(ZoomUtil || (ZoomUtil = {}));
|
|
96
|
+
//# sourceMappingURL=zoom.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type SessionConnection, type TaConnection } from '@celljs/ta-client';
|
|
2
|
+
import { OfflineReads } from './offline/offline-reads.js';
|
|
3
|
+
import type { ConnectionStatus, WorkbenchState } from './workbench-protocol.js';
|
|
4
|
+
import { type ServiceName } from './workbench-util.js';
|
|
5
|
+
/** What the calls need of the workbench. */
|
|
6
|
+
export interface CallsOwner {
|
|
7
|
+
status(): ConnectionStatus;
|
|
8
|
+
/** The connection of now, if there is one. */
|
|
9
|
+
connection(): TaConnection | undefined;
|
|
10
|
+
connected(): Promise<void>;
|
|
11
|
+
subscribe(listener: (state: WorkbenchState) => void): () => void;
|
|
12
|
+
/** Tells web extensions that keys of their data changed. */
|
|
13
|
+
dataChanged(name: string, keys: string[], cwd?: string): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The calls of the page to its computer: those of the workbench's services, and those of its stores
|
|
17
|
+
* (`link`). Each goes to the connection of the time; before there is one, it waits for it. A call that
|
|
18
|
+
* reads (OFFLINE_READS) answers as it did last time while the computer cannot be reached, rather than
|
|
19
|
+
* waiting: what was shown shows again, web extensions started from the device too.
|
|
20
|
+
*/
|
|
21
|
+
export declare class WorkbenchCalls {
|
|
22
|
+
protected readonly owner: CallsOwner;
|
|
23
|
+
/** The answers of the calls that read, of the computer in use. */
|
|
24
|
+
readonly reads: OfflineReads;
|
|
25
|
+
/** The services, the same across connections. */
|
|
26
|
+
protected readonly services: Map<ServiceName, object>;
|
|
27
|
+
/**
|
|
28
|
+
* The data web extensions read (by call), from the device or the computer: read again once online, as the
|
|
29
|
+
* server tells of changes only to what the connection of the time read, and it may have changed meanwhile.
|
|
30
|
+
* A connection that dropped and came back is a new one there, which heard of no read before it.
|
|
31
|
+
*/
|
|
32
|
+
protected readonly readData: Map<string, {
|
|
33
|
+
name: string;
|
|
34
|
+
key: string;
|
|
35
|
+
cwd?: string;
|
|
36
|
+
}>;
|
|
37
|
+
constructor(owner: CallsOwner, host: string | undefined);
|
|
38
|
+
/** A service of the page, its methods the same each time too: what is given them is not drawn again for nothing. */
|
|
39
|
+
service<K extends ServiceName>(name: K): TaConnection[K];
|
|
40
|
+
/**
|
|
41
|
+
* What stores use of the connection, there before it is (a conversation kept on the device shows without
|
|
42
|
+
* one): their calls wait for it as on a connection that dropped, then fail; they attach once connected.
|
|
43
|
+
*/
|
|
44
|
+
readonly link: SessionConnection;
|
|
45
|
+
/** As `connected`, failing as a call on a connection that dropped does once it is not back within `ms`. */
|
|
46
|
+
connectedWithin(ms: number): Promise<void>;
|
|
47
|
+
/** Online again: the web extensions hear that the data they read changed, and read it from the computer, which tells them of changes again. */
|
|
48
|
+
online(): void;
|
|
49
|
+
protected call(name: ServiceName, method: string, params: unknown[]): Promise<unknown>;
|
|
50
|
+
protected readExtensionData(name: ServiceName, method: string, params: unknown[]): void;
|
|
51
|
+
/**
|
|
52
|
+
* The answer kept of a call, once the connection is not there to give it: at once while offline, after a
|
|
53
|
+
* moment while connecting (a start through a relay is online within it); none online, or with none kept.
|
|
54
|
+
*/
|
|
55
|
+
protected keptAnswer(name: ServiceName, method: string, params: unknown[]): Promise<{
|
|
56
|
+
value: unknown;
|
|
57
|
+
} | undefined>;
|
|
58
|
+
/** Resolves once the status is no longer `connecting`, or after `ms`. */
|
|
59
|
+
protected leavesConnecting(ms: number): Promise<void>;
|
|
60
|
+
protected signedIn(): TaConnection;
|
|
61
|
+
}
|