@celljs/ta-web 4.17.0 → 4.19.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 +2 -1
- package/README.md +2 -1
- package/esm/browser/account/account-side.d.ts +13 -0
- package/esm/browser/account/account-side.js +74 -0
- package/esm/browser/account/device-account.d.ts +69 -0
- package/esm/browser/account/device-account.js +215 -0
- package/esm/browser/assistant/assistant-chat-list.d.ts +4 -4
- package/esm/browser/assistant/assistant-chat-list.js +74 -4
- package/esm/browser/assistant/assistant-export.js +6 -2
- package/esm/browser/assistant/assistant-extension.js +70 -15
- package/esm/browser/assistant/assistant-role.d.ts +2 -2
- package/esm/browser/assistant/assistant-role.js +7 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +4 -0
- package/esm/browser/assistant/assistant-task-source.js +18 -4
- package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
- package/esm/browser/assistant/assistant-task-util.js +14 -3
- package/esm/browser/assistant/assistant-tasks.js +2 -2
- package/esm/browser/assistant/assistant-thread.js +5 -1
- package/esm/browser/assistant/assistant-view.js +3 -5
- package/esm/browser/assistant/assistant.js +2 -1
- package/esm/browser/assistant/call-keeper.d.ts +142 -0
- package/esm/browser/assistant/call-keeper.js +292 -0
- package/esm/browser/assistant/call-screen.d.ts +39 -0
- package/esm/browser/assistant/call-screen.js +75 -0
- package/esm/browser/assistant/chat-task-source.d.ts +16 -18
- package/esm/browser/assistant/chat-task-source.js +27 -52
- package/esm/browser/assistant/realtime-voice.d.ts +62 -1
- package/esm/browser/assistant/realtime-voice.js +188 -29
- package/esm/browser/assistant/task-views.d.ts +9 -6
- package/esm/browser/assistant/task-views.js +28 -10
- package/esm/browser/assistant/voice-call-bar.d.ts +11 -4
- package/esm/browser/assistant/voice-call-bar.js +102 -46
- package/esm/browser/assistant/voice-call.d.ts +33 -1
- package/esm/browser/assistant/voice-call.js +131 -28
- package/esm/browser/assistant/voice-reopen.d.ts +18 -0
- package/esm/browser/assistant/voice-reopen.js +54 -0
- package/esm/browser/chat/chat-view.js +5 -8
- package/esm/browser/cloud/cloud-sign-in.d.ts +100 -0
- package/esm/browser/cloud/cloud-sign-in.js +239 -0
- package/esm/browser/cloud/device-page.d.ts +15 -0
- package/esm/browser/cloud/device-page.js +39 -0
- package/esm/browser/components/access-view.js +25 -1
- package/esm/browser/components/account-menu.d.ts +1 -1
- package/esm/browser/components/account-menu.js +7 -2
- package/esm/browser/components/account-view.d.ts +17 -0
- package/esm/browser/components/account-view.js +216 -0
- package/esm/browser/components/app-contexts.d.ts +12 -0
- package/esm/browser/components/app-contexts.js +28 -0
- package/esm/browser/components/app-nav.d.ts +5 -3
- package/esm/browser/components/app-nav.js +11 -8
- package/esm/browser/components/app-shell-state.d.ts +2 -2
- package/esm/browser/components/app-shell-state.js +33 -28
- package/esm/browser/components/app-view.js +113 -82
- package/esm/browser/components/auth-view.js +3 -5
- package/esm/browser/components/call-pill.d.ts +11 -0
- package/esm/browser/components/call-pill.js +19 -0
- package/esm/browser/components/chat-home-util.d.ts +112 -0
- package/esm/browser/components/chat-home-util.js +123 -0
- package/esm/browser/components/chat-home.d.ts +54 -0
- package/esm/browser/components/chat-home.js +125 -0
- package/esm/browser/components/chat-icon.d.ts +4 -2
- package/esm/browser/components/chat-icon.js +15 -5
- package/esm/browser/components/chat-list-hooks.d.ts +30 -0
- package/esm/browser/components/chat-list-hooks.js +81 -0
- package/esm/browser/components/chat-list-props.d.ts +54 -0
- package/esm/browser/components/chat-list-props.js +2 -0
- package/esm/browser/components/chat-list-row.d.ts +14 -2
- package/esm/browser/components/chat-list-row.js +27 -17
- package/esm/browser/components/chat-list-util.d.ts +40 -9
- package/esm/browser/components/chat-list-util.js +72 -9
- package/esm/browser/components/chat-list.d.ts +4 -49
- package/esm/browser/components/chat-list.js +118 -87
- package/esm/browser/components/cloud-sign-in-view.d.ts +65 -0
- package/esm/browser/components/cloud-sign-in-view.js +351 -0
- package/esm/browser/components/code-editor.js +2 -1
- package/esm/browser/components/composer-box.js +7 -0
- package/esm/browser/components/connection-bar.js +22 -3
- package/esm/browser/components/context-menu.d.ts +11 -2
- package/esm/browser/components/context-menu.js +14 -3
- package/esm/browser/components/conversation-scroll.d.ts +2 -0
- package/esm/browser/components/conversation-scroll.js +14 -0
- package/esm/browser/components/device-sign-in-page.d.ts +12 -0
- package/esm/browser/components/device-sign-in-page.js +74 -0
- package/esm/browser/components/diff-editor.js +2 -1
- package/esm/browser/components/entry-holds.d.ts +22 -0
- package/esm/browser/components/entry-holds.js +49 -0
- package/esm/browser/components/environment-view.js +8 -8
- package/esm/browser/components/face.d.ts +1 -1
- package/esm/browser/components/fold-text.js +3 -1
- package/esm/browser/components/fork-view.js +2 -4
- package/esm/browser/components/gallery.js +2 -1
- package/esm/browser/components/held-talk.d.ts +6 -2
- package/esm/browser/components/held-talk.js +20 -2
- package/esm/browser/components/host-view.d.ts +11 -4
- package/esm/browser/components/host-view.js +60 -14
- package/esm/browser/components/image-swipe.d.ts +50 -0
- package/esm/browser/components/image-swipe.js +139 -0
- package/esm/browser/components/image-viewer.d.ts +10 -114
- package/esm/browser/components/image-viewer.js +46 -365
- package/esm/browser/components/image-zoom.d.ts +112 -0
- package/esm/browser/components/image-zoom.js +355 -0
- package/esm/browser/components/kept-call-bar.d.ts +12 -0
- package/esm/browser/components/kept-call-bar.js +99 -0
- package/esm/browser/components/lightbox.d.ts +6 -2
- package/esm/browser/components/lightbox.js +4 -3
- package/esm/browser/components/link-dialog.d.ts +2 -1
- package/esm/browser/components/link-dialog.js +5 -1
- package/esm/browser/components/link.d.ts +4 -0
- package/esm/browser/components/link.js +11 -0
- package/esm/browser/components/loading.d.ts +12 -0
- package/esm/browser/components/loading.js +18 -0
- package/esm/browser/components/markdown.js +2 -1
- package/esm/browser/components/mermaid-view.js +14 -7
- package/esm/browser/components/message-images.js +1 -1
- package/esm/browser/components/message-list.js +12 -7
- package/esm/browser/components/message-steps.js +31 -23
- package/esm/browser/components/message-user.d.ts +10 -1
- package/esm/browser/components/message-user.js +48 -13
- package/esm/browser/components/model-picker.d.ts +3 -1
- package/esm/browser/components/model-picker.js +14 -3
- package/esm/browser/components/nav-places.d.ts +7 -12
- package/esm/browser/components/nav-places.js +10 -13
- package/esm/browser/components/phone-shell.d.ts +1 -1
- package/esm/browser/components/scan-screen.d.ts +4 -2
- package/esm/browser/components/scan-screen.js +46 -20
- package/esm/browser/components/search-page.js +3 -2
- package/esm/browser/components/secret-peek.d.ts +3 -0
- package/esm/browser/components/secret-peek.js +19 -0
- package/esm/browser/components/secret-text.d.ts +41 -0
- package/esm/browser/components/secret-text.js +80 -0
- package/esm/browser/components/session-view.js +44 -13
- package/esm/browser/components/settings-choices.d.ts +3 -3
- package/esm/browser/components/settings-choices.js +9 -29
- package/esm/browser/components/settings-parts.js +5 -2
- package/esm/browser/components/settings-view.js +2 -2
- package/esm/browser/components/share-dialog.d.ts +2 -3
- package/esm/browser/components/share-dialog.js +6 -41
- package/esm/browser/components/share-friends.d.ts +18 -0
- package/esm/browser/components/share-friends.js +56 -0
- package/esm/browser/components/share-sheet.d.ts +15 -0
- package/esm/browser/components/share-sheet.js +79 -0
- package/esm/browser/components/side-lists.d.ts +16 -4
- package/esm/browser/components/side-lists.js +28 -12
- package/esm/browser/components/sign-in-accounts.d.ts +2 -1
- package/esm/browser/components/sign-in-accounts.js +59 -5
- package/esm/browser/components/sign-in-label.d.ts +5 -0
- package/esm/browser/components/sign-in-label.js +10 -0
- package/esm/browser/components/system-link-host.d.ts +2 -0
- package/esm/browser/components/system-link-host.js +17 -0
- package/esm/browser/components/tool-result.d.ts +3 -2
- package/esm/browser/components/tool-result.js +5 -3
- package/esm/browser/components/tool-view.d.ts +21 -3
- package/esm/browser/components/tool-view.js +103 -35
- package/esm/browser/components/unseen-drop.d.ts +2 -1
- package/esm/browser/components/unseen-drop.js +1 -1
- package/esm/browser/components/voice-services.js +26 -3
- package/esm/browser/components/workbench-view.d.ts +1 -1
- package/esm/browser/components/workbench-view.js +42 -5
- package/esm/browser/device/code-scan.d.ts +23 -10
- package/esm/browser/device/code-scan.js +48 -43
- package/esm/browser/device/edge-back.d.ts +17 -0
- package/esm/browser/device/edge-back.js +52 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +2 -2
- package/esm/browser/device/screen-awake.d.ts +24 -0
- package/esm/browser/device/screen-awake.js +59 -0
- package/esm/browser/extension/icons.js +13 -2
- package/esm/browser/extension/share-sheet-compat.d.ts +11 -0
- package/esm/browser/extension/share-sheet-compat.js +27 -0
- package/esm/browser/extension/web-api-chats.d.ts +49 -0
- package/esm/browser/extension/web-api-chats.js +2 -0
- package/esm/browser/extension/web-api-components.d.ts +61 -6
- package/esm/browser/extension/web-api-contributions.d.ts +28 -53
- package/esm/browser/extension/web-api-screen-share.d.ts +10 -0
- package/esm/browser/extension/web-api-screen-share.js +3 -0
- package/esm/browser/extension/web-api-services.d.ts +50 -0
- package/esm/browser/extension/web-api-services.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +45 -65
- package/esm/browser/extension/web-extension-context.d.ts +5 -10
- package/esm/browser/extension/web-extension-context.js +33 -21
- package/esm/browser/extension/web-extension-protocol.d.ts +8 -3
- package/esm/browser/extension/web-extension-run.js +0 -1
- package/esm/browser/extension/web-extensions.d.ts +4 -1
- package/esm/browser/extension/web-extensions.js +12 -0
- package/esm/browser/extension/web-tasks.d.ts +6 -1
- package/esm/browser/extension/web-tasks.js +11 -3
- package/esm/browser/extension/web-view-util.d.ts +0 -1
- package/esm/browser/extension/web-view-util.js +4 -5
- package/esm/browser/files/files.d.ts +1 -0
- package/esm/browser/files/files.js +14 -3
- package/esm/browser/game/game-control.d.ts +118 -0
- package/esm/browser/game/game-control.js +341 -0
- package/esm/browser/game/game-host.d.ts +14 -2
- package/esm/browser/game/game-host.js +22 -5
- package/esm/browser/game/game-protocol.d.ts +15 -0
- package/esm/browser/game/game-runner.d.ts +3 -1
- package/esm/browser/game/game-runner.js +6 -0
- package/esm/browser/game/game-util.d.ts +3 -0
- package/esm/browser/game/game-util.js +3 -0
- package/esm/browser/game/game-view.d.ts +5 -2
- package/esm/browser/game/game-view.js +4 -4
- package/esm/browser/game/game3d-protocol.d.ts +5 -1
- package/esm/browser/game/game3d-runner.d.ts +3 -1
- package/esm/browser/game/game3d-runner.js +14 -0
- package/esm/browser/gateway/console-agents.d.ts +11 -0
- package/esm/browser/gateway/console-agents.js +128 -0
- package/esm/browser/gateway/console-extension.js +0 -1
- package/esm/browser/gateway/console-limits.d.ts +19 -0
- package/esm/browser/gateway/console-limits.js +164 -0
- package/esm/browser/gateway/console-parts.d.ts +29 -22
- package/esm/browser/gateway/console-parts.js +67 -137
- package/esm/browser/gateway/console-tenant.d.ts +2 -4
- package/esm/browser/gateway/console-tenant.js +117 -209
- package/esm/browser/gateway/console-trend.js +6 -4
- package/esm/browser/gateway/console-view.js +136 -109
- package/esm/browser/hooks.js +1 -3
- package/esm/browser/hosts.d.ts +7 -0
- package/esm/browser/hosts.js +23 -2
- package/esm/browser/i18n/locales.d.ts +169 -14
- package/esm/browser/i18n/messages-ja.js +178 -23
- package/esm/browser/i18n/messages-zh-tw.js +178 -23
- package/esm/browser/i18n/messages.d.ts +166 -11
- package/esm/browser/i18n/messages.js +357 -47
- package/esm/browser/index.d.ts +1 -0
- package/esm/browser/index.js +1 -0
- package/esm/browser/links/links-protocol.d.ts +10 -1
- package/esm/browser/links/links.d.ts +11 -2
- package/esm/browser/links/links.js +65 -7
- package/esm/browser/links/system-links.d.ts +21 -0
- package/esm/browser/links/system-links.js +54 -0
- package/esm/browser/markdown/hooks.d.ts +3 -1
- package/esm/browser/markdown/hooks.js +11 -3
- package/esm/browser/markdown/mermaid.d.ts +18 -4
- package/esm/browser/markdown/mermaid.js +117 -17
- package/esm/browser/screen/screen-protocol.d.ts +74 -1
- package/esm/browser/screen/screen-protocol.js +15 -0
- package/esm/browser/screen/screen-scroll.d.ts +55 -0
- package/esm/browser/screen/screen-scroll.js +182 -0
- package/esm/browser/screen/screen.d.ts +34 -1
- package/esm/browser/screen/screen.js +172 -2
- package/esm/browser/settings/navigation.d.ts +9 -21
- package/esm/browser/settings/navigation.js +11 -31
- package/esm/browser/settings/settings-protocol.d.ts +9 -0
- package/esm/browser/settings/settings-protocol.js +18 -0
- package/esm/browser/settings/settings.d.ts +7 -1
- package/esm/browser/settings/settings.js +31 -7
- package/esm/browser/share/shared-extensions.js +4 -3
- package/esm/browser/share/shared-page.js +2 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +8 -1
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +0 -3
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +42 -4
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +31 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +7 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +168 -112
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +10 -3
- package/esm/browser/style/shared.d.ts +1 -1
- package/esm/browser/style/shared.js +1 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +12 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +38 -13
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +16 -2
- package/esm/browser/style/tints.d.ts +5 -4
- package/esm/browser/style/tints.js +9 -9
- package/esm/browser/util/desktop.d.ts +7 -1
- package/esm/browser/util/desktop.js +17 -0
- package/esm/browser/util/image-swipe.d.ts +42 -0
- package/esm/browser/util/image-swipe.js +66 -0
- package/esm/browser/util/process.d.ts +31 -3
- package/esm/browser/util/process.js +75 -8
- package/esm/browser/util/share-link.d.ts +5 -0
- package/esm/browser/util/share-link.js +10 -0
- package/esm/browser/util/shell-words.d.ts +18 -0
- package/esm/browser/util/shell-words.js +397 -0
- package/esm/browser/util/spoken.d.ts +5 -0
- package/esm/browser/util/spoken.js +11 -2
- package/esm/browser/util/tool.d.ts +9 -0
- package/esm/browser/util/tool.js +71 -6
- package/esm/browser/util/transcript.js +3 -1
- package/esm/browser/util/turn-end.d.ts +17 -0
- package/esm/browser/util/turn-end.js +164 -0
- package/esm/browser/workbench-hosts.d.ts +8 -1
- package/esm/browser/workbench-hosts.js +22 -2
- package/esm/browser/workbench-protocol.d.ts +25 -3
- package/esm/browser/workbench-services.d.ts +10 -1
- package/esm/browser/workbench-services.js +41 -0
- package/esm/browser/workbench-util.d.ts +9 -3
- package/esm/browser/workbench-util.js +24 -4
- package/esm/browser/workbench.d.ts +3 -0
- package/esm/browser/workbench.js +36 -9
- package/lib/browser/account/account-side.d.ts +14 -0
- package/lib/browser/account/account-side.js +111 -0
- package/lib/browser/account/device-account.d.ts +70 -0
- package/lib/browser/account/device-account.js +219 -0
- package/lib/browser/assistant/assistant-chat-list.d.ts +4 -4
- package/lib/browser/assistant/assistant-chat-list.js +73 -3
- package/lib/browser/assistant/assistant-export.js +5 -1
- package/lib/browser/assistant/assistant-extension.js +69 -14
- package/lib/browser/assistant/assistant-role.d.ts +2 -2
- package/lib/browser/assistant/assistant-role.js +7 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +4 -0
- package/lib/browser/assistant/assistant-task-source.js +19 -4
- package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
- package/lib/browser/assistant/assistant-task-util.js +14 -3
- package/lib/browser/assistant/assistant-tasks.js +2 -2
- package/lib/browser/assistant/assistant-thread.js +4 -0
- package/lib/browser/assistant/assistant-view.js +3 -5
- package/lib/browser/assistant/assistant.js +2 -1
- package/lib/browser/assistant/call-keeper.d.ts +143 -0
- package/lib/browser/assistant/call-keeper.js +295 -0
- package/lib/browser/assistant/call-screen.d.ts +40 -0
- package/lib/browser/assistant/call-screen.js +78 -0
- package/lib/browser/assistant/chat-task-source.d.ts +16 -18
- package/lib/browser/assistant/chat-task-source.js +28 -53
- package/lib/browser/assistant/realtime-voice.d.ts +62 -1
- package/lib/browser/assistant/realtime-voice.js +188 -29
- package/lib/browser/assistant/task-views.d.ts +9 -6
- package/lib/browser/assistant/task-views.js +29 -10
- package/lib/browser/assistant/voice-call-bar.d.ts +11 -4
- package/lib/browser/assistant/voice-call-bar.js +102 -46
- package/lib/browser/assistant/voice-call.d.ts +33 -1
- package/lib/browser/assistant/voice-call.js +132 -29
- package/lib/browser/assistant/voice-reopen.d.ts +19 -0
- package/lib/browser/assistant/voice-reopen.js +58 -0
- package/lib/browser/chat/chat-view.js +5 -8
- package/lib/browser/cloud/cloud-sign-in.d.ts +101 -0
- package/lib/browser/cloud/cloud-sign-in.js +244 -0
- package/lib/browser/cloud/device-page.d.ts +16 -0
- package/lib/browser/cloud/device-page.js +42 -0
- package/lib/browser/components/access-view.js +24 -0
- package/lib/browser/components/account-menu.d.ts +1 -1
- package/lib/browser/components/account-menu.js +6 -1
- package/lib/browser/components/account-view.d.ts +18 -0
- package/lib/browser/components/account-view.js +255 -0
- package/lib/browser/components/app-contexts.d.ts +13 -0
- package/lib/browser/components/app-contexts.js +64 -0
- package/lib/browser/components/app-nav.d.ts +5 -3
- package/lib/browser/components/app-nav.js +11 -8
- package/lib/browser/components/app-shell-state.d.ts +2 -2
- package/lib/browser/components/app-shell-state.js +33 -28
- package/lib/browser/components/app-view.js +109 -78
- package/lib/browser/components/auth-view.js +3 -5
- package/lib/browser/components/call-pill.d.ts +12 -0
- package/lib/browser/components/call-pill.js +55 -0
- package/lib/browser/components/chat-home-util.d.ts +113 -0
- package/lib/browser/components/chat-home-util.js +126 -0
- package/lib/browser/components/chat-home.d.ts +55 -0
- package/lib/browser/components/chat-home.js +164 -0
- package/lib/browser/components/chat-icon.d.ts +4 -2
- package/lib/browser/components/chat-icon.js +15 -5
- package/lib/browser/components/chat-list-hooks.d.ts +31 -0
- package/lib/browser/components/chat-list-hooks.js +120 -0
- package/lib/browser/components/chat-list-props.d.ts +55 -0
- package/lib/browser/components/chat-list-props.js +3 -0
- package/lib/browser/components/chat-list-row.d.ts +14 -2
- package/lib/browser/components/chat-list-row.js +27 -16
- package/lib/browser/components/chat-list-util.d.ts +40 -9
- package/lib/browser/components/chat-list-util.js +73 -10
- package/lib/browser/components/chat-list.d.ts +4 -49
- package/lib/browser/components/chat-list.js +121 -90
- package/lib/browser/components/cloud-sign-in-view.d.ts +66 -0
- package/lib/browser/components/cloud-sign-in-view.js +394 -0
- package/lib/browser/components/code-editor.js +2 -1
- package/lib/browser/components/composer-box.js +7 -0
- package/lib/browser/components/connection-bar.js +22 -3
- package/lib/browser/components/context-menu.d.ts +11 -2
- package/lib/browser/components/context-menu.js +14 -3
- package/lib/browser/components/conversation-scroll.d.ts +2 -0
- package/lib/browser/components/conversation-scroll.js +14 -0
- package/lib/browser/components/device-sign-in-page.d.ts +13 -0
- package/lib/browser/components/device-sign-in-page.js +110 -0
- package/lib/browser/components/diff-editor.js +2 -1
- package/lib/browser/components/entry-holds.d.ts +23 -0
- package/lib/browser/components/entry-holds.js +86 -0
- package/lib/browser/components/environment-view.js +8 -8
- package/lib/browser/components/face.d.ts +1 -1
- package/lib/browser/components/fold-text.js +3 -1
- package/lib/browser/components/fork-view.js +2 -4
- package/lib/browser/components/gallery.js +2 -1
- package/lib/browser/components/held-talk.d.ts +6 -2
- package/lib/browser/components/held-talk.js +20 -2
- package/lib/browser/components/host-view.d.ts +11 -4
- package/lib/browser/components/host-view.js +60 -13
- package/lib/browser/components/image-swipe.d.ts +51 -0
- package/lib/browser/components/image-swipe.js +143 -0
- package/lib/browser/components/image-viewer.d.ts +10 -114
- package/lib/browser/components/image-viewer.js +47 -368
- package/lib/browser/components/image-zoom.d.ts +113 -0
- package/lib/browser/components/image-zoom.js +359 -0
- package/lib/browser/components/kept-call-bar.d.ts +13 -0
- package/lib/browser/components/kept-call-bar.js +135 -0
- package/lib/browser/components/lightbox.d.ts +6 -2
- package/lib/browser/components/lightbox.js +4 -3
- package/lib/browser/components/link-dialog.d.ts +2 -1
- package/lib/browser/components/link-dialog.js +5 -1
- package/lib/browser/components/link.d.ts +4 -0
- package/lib/browser/components/link.js +12 -0
- package/lib/browser/components/loading.d.ts +13 -0
- package/lib/browser/components/loading.js +55 -0
- package/lib/browser/components/markdown.js +2 -1
- package/lib/browser/components/mermaid-view.js +13 -6
- package/lib/browser/components/message-images.js +1 -1
- package/lib/browser/components/message-list.js +12 -7
- package/lib/browser/components/message-steps.js +31 -23
- package/lib/browser/components/message-user.d.ts +10 -1
- package/lib/browser/components/message-user.js +48 -12
- package/lib/browser/components/model-picker.d.ts +3 -1
- package/lib/browser/components/model-picker.js +14 -3
- package/lib/browser/components/nav-places.d.ts +7 -12
- package/lib/browser/components/nav-places.js +10 -13
- package/lib/browser/components/phone-shell.d.ts +1 -1
- package/lib/browser/components/scan-screen.d.ts +4 -2
- package/lib/browser/components/scan-screen.js +47 -20
- package/lib/browser/components/search-page.js +3 -2
- package/lib/browser/components/secret-peek.d.ts +4 -0
- package/lib/browser/components/secret-peek.js +55 -0
- package/lib/browser/components/secret-text.d.ts +42 -0
- package/lib/browser/components/secret-text.js +118 -0
- package/lib/browser/components/session-view.js +43 -12
- package/lib/browser/components/settings-choices.d.ts +3 -3
- package/lib/browser/components/settings-choices.js +8 -28
- package/lib/browser/components/settings-parts.js +4 -1
- package/lib/browser/components/settings-view.js +2 -2
- package/lib/browser/components/share-dialog.d.ts +2 -3
- package/lib/browser/components/share-dialog.js +5 -40
- package/lib/browser/components/share-friends.d.ts +19 -0
- package/lib/browser/components/share-friends.js +93 -0
- package/lib/browser/components/share-sheet.d.ts +16 -0
- package/lib/browser/components/share-sheet.js +115 -0
- package/lib/browser/components/side-lists.d.ts +16 -4
- package/lib/browser/components/side-lists.js +28 -12
- package/lib/browser/components/sign-in-accounts.d.ts +2 -1
- package/lib/browser/components/sign-in-accounts.js +59 -5
- package/lib/browser/components/sign-in-label.d.ts +6 -0
- package/lib/browser/components/sign-in-label.js +13 -0
- package/lib/browser/components/system-link-host.d.ts +3 -0
- package/lib/browser/components/system-link-host.js +53 -0
- package/lib/browser/components/tool-result.d.ts +3 -2
- package/lib/browser/components/tool-result.js +5 -3
- package/lib/browser/components/tool-view.d.ts +21 -3
- package/lib/browser/components/tool-view.js +104 -36
- package/lib/browser/components/unseen-drop.d.ts +2 -1
- package/lib/browser/components/unseen-drop.js +1 -1
- package/lib/browser/components/voice-services.js +23 -0
- package/lib/browser/components/workbench-view.d.ts +1 -1
- package/lib/browser/components/workbench-view.js +42 -5
- package/lib/browser/device/code-scan.d.ts +23 -10
- package/lib/browser/device/code-scan.js +47 -42
- package/lib/browser/device/edge-back.d.ts +18 -0
- package/lib/browser/device/edge-back.js +89 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +2 -2
- package/lib/browser/device/screen-awake.d.ts +25 -0
- package/lib/browser/device/screen-awake.js +63 -0
- package/lib/browser/extension/icons.js +12 -1
- package/lib/browser/extension/share-sheet-compat.d.ts +12 -0
- package/lib/browser/extension/share-sheet-compat.js +30 -0
- package/lib/browser/extension/web-api-chats.d.ts +50 -0
- package/lib/browser/extension/web-api-chats.js +3 -0
- package/lib/browser/extension/web-api-components.d.ts +61 -6
- package/lib/browser/extension/web-api-contributions.d.ts +28 -53
- package/lib/browser/extension/web-api-screen-share.d.ts +11 -0
- package/lib/browser/extension/web-api-screen-share.js +6 -0
- package/lib/browser/extension/web-api-services.d.ts +51 -0
- package/lib/browser/extension/web-api-services.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +45 -65
- package/lib/browser/extension/web-extension-context.d.ts +5 -10
- package/lib/browser/extension/web-extension-context.js +33 -21
- package/lib/browser/extension/web-extension-protocol.d.ts +8 -3
- package/lib/browser/extension/web-extension-run.js +0 -1
- package/lib/browser/extension/web-extensions.d.ts +4 -1
- package/lib/browser/extension/web-extensions.js +12 -0
- package/lib/browser/extension/web-tasks.d.ts +6 -1
- package/lib/browser/extension/web-tasks.js +11 -3
- package/lib/browser/extension/web-view-util.d.ts +0 -1
- package/lib/browser/extension/web-view-util.js +4 -5
- package/lib/browser/files/files.d.ts +1 -0
- package/lib/browser/files/files.js +14 -3
- package/lib/browser/game/game-control.d.ts +119 -0
- package/lib/browser/game/game-control.js +345 -0
- package/lib/browser/game/game-host.d.ts +14 -2
- package/lib/browser/game/game-host.js +22 -5
- package/lib/browser/game/game-protocol.d.ts +15 -0
- package/lib/browser/game/game-runner.d.ts +3 -1
- package/lib/browser/game/game-runner.js +6 -0
- package/lib/browser/game/game-util.d.ts +3 -0
- package/lib/browser/game/game-util.js +3 -0
- package/lib/browser/game/game-view.d.ts +5 -2
- package/lib/browser/game/game-view.js +4 -4
- package/lib/browser/game/game3d-protocol.d.ts +5 -1
- package/lib/browser/game/game3d-runner.d.ts +3 -1
- package/lib/browser/game/game3d-runner.js +14 -0
- package/lib/browser/gateway/console-agents.d.ts +12 -0
- package/lib/browser/gateway/console-agents.js +165 -0
- package/lib/browser/gateway/console-extension.js +0 -1
- package/lib/browser/gateway/console-limits.d.ts +20 -0
- package/lib/browser/gateway/console-limits.js +200 -0
- package/lib/browser/gateway/console-parts.d.ts +29 -22
- package/lib/browser/gateway/console-parts.js +72 -141
- package/lib/browser/gateway/console-tenant.d.ts +2 -4
- package/lib/browser/gateway/console-tenant.js +115 -208
- package/lib/browser/gateway/console-trend.js +6 -4
- package/lib/browser/gateway/console-view.js +134 -107
- package/lib/browser/hooks.js +1 -3
- package/lib/browser/hosts.d.ts +7 -0
- package/lib/browser/hosts.js +23 -2
- package/lib/browser/i18n/locales.d.ts +169 -14
- package/lib/browser/i18n/messages-ja.js +178 -23
- package/lib/browser/i18n/messages-zh-tw.js +178 -23
- package/lib/browser/i18n/messages.d.ts +166 -11
- package/lib/browser/i18n/messages.js +357 -47
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.js +1 -0
- package/lib/browser/links/links-protocol.d.ts +10 -1
- package/lib/browser/links/links.d.ts +11 -2
- package/lib/browser/links/links.js +65 -7
- package/lib/browser/links/system-links.d.ts +22 -0
- package/lib/browser/links/system-links.js +58 -0
- package/lib/browser/markdown/hooks.d.ts +3 -1
- package/lib/browser/markdown/hooks.js +12 -3
- package/lib/browser/markdown/mermaid.d.ts +18 -4
- package/lib/browser/markdown/mermaid.js +117 -17
- package/lib/browser/screen/screen-protocol.d.ts +74 -1
- package/lib/browser/screen/screen-protocol.js +15 -0
- package/lib/browser/screen/screen-scroll.d.ts +56 -0
- package/lib/browser/screen/screen-scroll.js +185 -0
- package/lib/browser/screen/screen.d.ts +34 -1
- package/lib/browser/screen/screen.js +172 -2
- package/lib/browser/settings/navigation.d.ts +9 -21
- package/lib/browser/settings/navigation.js +11 -31
- package/lib/browser/settings/settings-protocol.d.ts +9 -0
- package/lib/browser/settings/settings-protocol.js +19 -1
- package/lib/browser/settings/settings.d.ts +7 -1
- package/lib/browser/settings/settings.js +31 -7
- package/lib/browser/share/shared-extensions.js +4 -3
- package/lib/browser/share/shared-page.js +2 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +8 -1
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +0 -3
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +42 -4
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +31 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +7 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +168 -112
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +10 -3
- package/lib/browser/style/shared.d.ts +1 -1
- package/lib/browser/style/shared.js +1 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +12 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +38 -13
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +16 -2
- package/lib/browser/style/tints.d.ts +5 -4
- package/lib/browser/style/tints.js +9 -9
- package/lib/browser/util/desktop.d.ts +7 -1
- package/lib/browser/util/desktop.js +17 -0
- package/lib/browser/util/image-swipe.d.ts +43 -0
- package/lib/browser/util/image-swipe.js +69 -0
- package/lib/browser/util/process.d.ts +31 -3
- package/lib/browser/util/process.js +74 -7
- package/lib/browser/util/share-link.d.ts +5 -0
- package/lib/browser/util/share-link.js +10 -0
- package/lib/browser/util/shell-words.d.ts +19 -0
- package/lib/browser/util/shell-words.js +400 -0
- package/lib/browser/util/spoken.d.ts +5 -0
- package/lib/browser/util/spoken.js +10 -1
- package/lib/browser/util/tool.d.ts +9 -0
- package/lib/browser/util/tool.js +71 -6
- package/lib/browser/util/transcript.js +3 -1
- package/lib/browser/util/turn-end.d.ts +18 -0
- package/lib/browser/util/turn-end.js +167 -0
- package/lib/browser/workbench-hosts.d.ts +8 -1
- package/lib/browser/workbench-hosts.js +22 -2
- package/lib/browser/workbench-protocol.d.ts +25 -3
- package/lib/browser/workbench-services.d.ts +10 -1
- package/lib/browser/workbench-services.js +41 -0
- package/lib/browser/workbench-util.d.ts +9 -3
- package/lib/browser/workbench-util.js +24 -4
- package/lib/browser/workbench.d.ts +3 -0
- package/lib/browser/workbench.js +35 -8
- package/package.json +7 -7
- package/esm/browser/components/list-skeleton.d.ts +0 -10
- package/esm/browser/components/list-skeleton.js +0 -31
- package/lib/browser/components/list-skeleton.d.ts +0 -11
- package/lib/browser/components/list-skeleton.js +0 -68
|
@@ -3,28 +3,41 @@ import * as React from 'react';
|
|
|
3
3
|
import { ExtensionBoundary, ToolRenderers } from '../extension/extension-view.js';
|
|
4
4
|
import { useT } from '../i18n/use-t.js';
|
|
5
5
|
import { MessageUtil } from '../util/message.js';
|
|
6
|
+
import { ProcessUtil } from '../util/process.js';
|
|
6
7
|
import { ToolUtil } from '../util/tool.js';
|
|
7
8
|
import { DiffView } from './diff-view.js';
|
|
8
9
|
import { Icon } from './icon.js';
|
|
9
10
|
import { CodeBlock } from './markdown.js';
|
|
10
11
|
import { agentToolDetails, Output } from './tool-result.js';
|
|
12
|
+
/** A thought folded into one line; it opens to the whole text. Drawn again only when its text changes. */
|
|
13
|
+
export const ThinkingStep = React.memo(function ThinkingStep({ text, tagged = true }) {
|
|
14
|
+
const t = useT();
|
|
15
|
+
const [open, setOpen] = React.useState(false);
|
|
16
|
+
return (React.createElement("div", { className: "ta-step-thinking" },
|
|
17
|
+
React.createElement("button", { type: "button", className: "ta-step-toggle", "aria-expanded": open, onClick: () => setOpen(!open) },
|
|
18
|
+
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
19
|
+
tagged && React.createElement("span", { className: "ta-step-tag" }, t('ta.message.thinking')),
|
|
20
|
+
!open && React.createElement("span", { className: "ta-step-preview" }, ProcessUtil.preview(text))),
|
|
21
|
+
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
22
|
+
});
|
|
11
23
|
/** The state of a call as the color of a dot: it pulses while the call runs. */
|
|
12
24
|
function StatusDot({ status }) {
|
|
13
25
|
return React.createElement("span", { className: `ta-status ta-status-${status}` });
|
|
14
26
|
}
|
|
15
27
|
/** One step in one line: a dot for its state and what it does; a click opens what it did. */
|
|
16
|
-
function ToolRow({ name, args, status, trailing, details }) {
|
|
28
|
+
function ToolRow({ name, args, status, trailing, details, count = 0 }) {
|
|
17
29
|
const t = useT();
|
|
18
30
|
const [open, setOpen] = React.useState(false);
|
|
19
31
|
const summary = ToolUtil.summary(name, args, React.useContext(ToolRenderers));
|
|
20
32
|
const ToolIcon = summary.icon;
|
|
21
33
|
const line = (React.createElement(React.Fragment, null,
|
|
22
34
|
React.createElement(StatusDot, { status: status }),
|
|
23
|
-
React.createElement("span", { className: "ta-tool-verb" }, ToolUtil.verb(summary, t)),
|
|
35
|
+
!summary.titled && React.createElement("span", { className: "ta-tool-verb" }, ToolUtil.verb(summary, t)),
|
|
24
36
|
ToolIcon && (React.createElement("span", { className: "ta-tool-icon" },
|
|
25
37
|
React.createElement(ExtensionBoundary, { name: name, resetKey: ToolIcon, fallback: false },
|
|
26
38
|
React.createElement(ToolIcon, { size: 18 })))),
|
|
27
|
-
summary.target && React.createElement("span", { className: `ta-tool-target ${summary.code ? 'ta-mono' : ''}` }, summary.target),
|
|
39
|
+
summary.target && (React.createElement("span", { className: summary.titled ? 'ta-tool-verb ta-tool-title-text' : `ta-tool-target ${summary.code ? 'ta-mono' : ''}` }, summary.target)),
|
|
40
|
+
count > 1 && React.createElement("span", { className: "ta-tool-count" }, t('ta.process.steps', { count })),
|
|
28
41
|
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-tool-chevron" })));
|
|
29
42
|
return (React.createElement("div", { className: `ta-tool ta-tool-${status}` },
|
|
30
43
|
React.createElement("div", { className: "ta-tool-line" },
|
|
@@ -39,6 +52,14 @@ function details(name, args, output, status) {
|
|
|
39
52
|
return agentToolDetails(args, output);
|
|
40
53
|
}
|
|
41
54
|
const text = MessageUtil.text(output === null || output === void 0 ? void 0 : output.content);
|
|
55
|
+
if (name === 'bash') {
|
|
56
|
+
// The line says the command in words: here it is as it ran, then what it printed.
|
|
57
|
+
const command = typeof args.command === 'string' ? args.command : '';
|
|
58
|
+
return ((command || text) && (React.createElement(React.Fragment, null,
|
|
59
|
+
command && (React.createElement("div", { className: "ta-result-command" },
|
|
60
|
+
React.createElement(CodeBlock, { code: command, language: "bash" }))),
|
|
61
|
+
text && React.createElement(Output, { text: text }))));
|
|
62
|
+
}
|
|
42
63
|
if (status === 'error') {
|
|
43
64
|
return text && React.createElement(Output, { text: text });
|
|
44
65
|
}
|
|
@@ -53,50 +74,97 @@ function details(name, args, output, status) {
|
|
|
53
74
|
return text && React.createElement(Output, { text: text });
|
|
54
75
|
}
|
|
55
76
|
}
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
/** The thoughts that led to a thing ta did, at the top of what it opens to. */
|
|
78
|
+
function Thoughts({ texts }) {
|
|
79
|
+
return (React.createElement(React.Fragment, null, texts.map((text, index) => (React.createElement(ThinkingStep, { key: index, text: text })))));
|
|
80
|
+
}
|
|
81
|
+
function same(a, b) {
|
|
82
|
+
return a.length === b.length && a.every((call, index) => call === b[index]);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A thing ta did, in one line that opens to how: a call of a tool, or a script with the calls it made. Drawn again
|
|
86
|
+
* only when its calls, their runs or their results change (a codemode script: any run, its calls are among them).
|
|
87
|
+
*/
|
|
88
|
+
export const ActView = React.memo(Act, (previous, next) => {
|
|
89
|
+
const a = previous.act;
|
|
90
|
+
const b = next.act;
|
|
91
|
+
if (a.call !== b.call || !same(a.nested, b.nested) || a.thoughts.join('\0') !== b.thoughts.join('\0')) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (b.call.name === 'codemode' && previous.runs !== next.runs) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return [b.call, ...b.nested].every(call => {
|
|
98
|
+
var _a;
|
|
99
|
+
const id = (_a = call.id) !== null && _a !== void 0 ? _a : '';
|
|
100
|
+
return previous.runs[id] === next.runs[id] && previous.results.get(id) === next.results.get(id);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
function Act({ act, results, runs }) {
|
|
104
|
+
var _a;
|
|
105
|
+
const { id = '', name = '', arguments: raw } = act.call;
|
|
106
|
+
const args = (_a = raw) !== null && _a !== void 0 ? _a : {};
|
|
107
|
+
const run = id ? runs[id] : undefined;
|
|
108
|
+
const output = MessageUtil.output(run, id ? results.get(id) : undefined);
|
|
67
109
|
const status = MessageUtil.status(run, output);
|
|
110
|
+
const thoughts = act.thoughts.length > 0 && React.createElement(Thoughts, { texts: act.thoughts });
|
|
68
111
|
if (name === 'codemode') {
|
|
69
|
-
return React.createElement(CodemodeView, { id: id, args: args, output: output, status: status, runs: runs });
|
|
112
|
+
return React.createElement(CodemodeView, { id: id, args: args, output: output, status: status, runs: runs, thoughts: thoughts || undefined });
|
|
70
113
|
}
|
|
71
|
-
|
|
114
|
+
const own = details(name, args, output, status);
|
|
115
|
+
if (!act.nested.length) {
|
|
116
|
+
const body = thoughts || own ? (React.createElement(React.Fragment, null,
|
|
117
|
+
thoughts,
|
|
118
|
+
own)) : undefined;
|
|
119
|
+
return React.createElement(ToolRow, { name: name, args: args, status: status, details: body });
|
|
120
|
+
}
|
|
121
|
+
// The script of another agent and the calls it made: one line, which opens to the calls, then the script.
|
|
122
|
+
const steps = act.nested.map(call => {
|
|
123
|
+
var _a;
|
|
124
|
+
const key = (_a = call.id) !== null && _a !== void 0 ? _a : '';
|
|
125
|
+
const nestedOutput = MessageUtil.output(runs[key], results.get(key));
|
|
126
|
+
return { call, output: nestedOutput, status: MessageUtil.status(runs[key], nestedOutput) };
|
|
127
|
+
});
|
|
128
|
+
const failed = steps.some(step => step.status === 'error');
|
|
129
|
+
const script = agentToolDetails(args, output, true);
|
|
130
|
+
return (React.createElement(ToolRow, { name: name, args: args, status: status === 'done' && failed ? 'error' : status, count: steps.length, details: React.createElement("div", { className: "ta-act-body" },
|
|
131
|
+
thoughts,
|
|
132
|
+
steps.map(step => {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
const nestedArgs = (_a = step.call.arguments) !== null && _a !== void 0 ? _a : {};
|
|
135
|
+
const shown = details((_b = step.call.name) !== null && _b !== void 0 ? _b : '', nestedArgs, step.output, step.status);
|
|
136
|
+
return React.createElement(ToolRow, { key: step.call.id, name: (_c = step.call.name) !== null && _c !== void 0 ? _c : '', args: nestedArgs, status: step.status, details: shown || undefined });
|
|
137
|
+
}),
|
|
138
|
+
script && React.createElement(ScriptLine, { script: script })) }));
|
|
72
139
|
}
|
|
73
140
|
/**
|
|
74
|
-
* A codemode script
|
|
75
|
-
*
|
|
141
|
+
* A codemode script, as one line that says what it is for and how many calls it made; it opens to the calls, each a
|
|
142
|
+
* step of its own that opens to what it did, and to the script and what it returned.
|
|
76
143
|
*/
|
|
77
|
-
function CodemodeView({ id, args, output, status, runs }) {
|
|
78
|
-
const t = useT();
|
|
79
|
-
const [showScript, setShowScript] = React.useState(false);
|
|
144
|
+
function CodemodeView({ id, args, output, status, runs, thoughts }) {
|
|
80
145
|
const code = typeof args.code === 'string' ? args.code : '';
|
|
81
146
|
const result = MessageUtil.scriptOutput(MessageUtil.text(output === null || output === void 0 ? void 0 : output.content)).trim();
|
|
82
147
|
const calls = ToolUtil.nestedCalls(id, output, runs);
|
|
83
148
|
const script = (React.createElement(React.Fragment, null,
|
|
84
149
|
React.createElement(CodeBlock, { code: code, language: "js" }),
|
|
85
150
|
result && React.createElement(Output, { text: result })));
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
151
|
+
const failed = calls.some(call => call.status === 'error');
|
|
152
|
+
// A script that does not say what it is for reads as its first call: what it went to do, not its code.
|
|
153
|
+
const said = ToolUtil.scriptComment(code) || !calls.length;
|
|
154
|
+
return (React.createElement(ToolRow, { name: said ? 'codemode' : calls[0].name, args: said ? args : calls[0].args, status: status === 'done' && failed ? 'error' : status, count: calls.length, details: React.createElement("div", { className: "ta-act-body" },
|
|
155
|
+
thoughts,
|
|
156
|
+
calls.map(call => (React.createElement(ToolRow, { key: call.key, ...nestedRow(call) }))),
|
|
157
|
+
React.createElement(ScriptLine, { script: script })) }));
|
|
158
|
+
}
|
|
159
|
+
/** The script itself and what it returned, behind one quiet line at the end of its calls. */
|
|
160
|
+
function ScriptLine({ script }) {
|
|
161
|
+
const t = useT();
|
|
162
|
+
const [open, setOpen] = React.useState(false);
|
|
163
|
+
return (React.createElement("div", { className: "ta-tool" },
|
|
164
|
+
React.createElement("button", { type: "button", className: "ta-step-toggle ta-act-script", "aria-expanded": open, onClick: () => setOpen(!open) },
|
|
165
|
+
React.createElement(Icon, { icon: FileCode2, size: 13 }),
|
|
166
|
+
React.createElement("span", null, t(open ? 'ta.tool.hideScript' : 'ta.tool.showScript'))),
|
|
167
|
+
open && React.createElement("div", { className: "ta-tool-body" }, script)));
|
|
100
168
|
}
|
|
101
169
|
function nestedRow(call) {
|
|
102
170
|
var _a;
|
|
@@ -36,7 +36,8 @@ export type DropTone = 'unseen' | 'asks';
|
|
|
36
36
|
* tab's.
|
|
37
37
|
*/
|
|
38
38
|
export declare function UnseenDrop({ label, onDismiss, className, tone, children, }: {
|
|
39
|
-
|
|
39
|
+
/** Told only with one: a dot that is off says nothing. */
|
|
40
|
+
label?: string;
|
|
40
41
|
onDismiss?: () => void;
|
|
41
42
|
className?: string;
|
|
42
43
|
tone?: DropTone;
|
|
@@ -215,6 +215,6 @@ export function UnseenDrop({ label, onDismiss, className = 'ta-tabbar-dot', tone
|
|
|
215
215
|
document.addEventListener('pointercancel', onCancel);
|
|
216
216
|
document.addEventListener('touchmove', onTouchMove, { passive: false });
|
|
217
217
|
};
|
|
218
|
-
return (React.createElement("span", { className: `${className}${onDismiss ? ' ta-draggable' : ''}`, role:
|
|
218
|
+
return (React.createElement("span", { className: `${className}${onDismiss ? ' ta-draggable' : ''}`, ...(label ? { role: 'img', 'aria-label': label } : {}), ...(onDismiss ? { [OwnGestures.ATTRIBUTE]: '', onPointerDown } : {}) }, children));
|
|
219
219
|
}
|
|
220
220
|
//# sourceMappingURL=unseen-drop.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TaPackageTextUtil } from '@celljs/ta-protocol';
|
|
2
|
-
import { Check, FileJson, Pencil, Plus, ShieldCheck, Smartphone, Trash2 } from 'lucide-react';
|
|
1
|
+
import { TaBargeIn, TaPackageTextUtil } from '@celljs/ta-protocol';
|
|
2
|
+
import { AudioLines, Check, FileJson, Hand, Pencil, Plus, ShieldCheck, Smartphone, Trash2 } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
5
|
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
6
6
|
import { Icon, IconButton } from './icon.js';
|
|
7
7
|
import { RelayServicesUtil } from './relay-services.js';
|
|
8
|
-
import { Row } from './settings-controls.js';
|
|
8
|
+
import { Row, Switch } from './settings-controls.js';
|
|
9
9
|
/**
|
|
10
10
|
* The voice of calls (docs/design/ta-voice.md): the device's, or a real-time voice service of voices.json, each a row
|
|
11
11
|
* to use it; the types packages registered, each with a form to add one. Keys are typed here and never shown again.
|
|
@@ -61,6 +61,9 @@ export function VoiceServices() {
|
|
|
61
61
|
await read();
|
|
62
62
|
} })))));
|
|
63
63
|
}),
|
|
64
|
+
voices.use && (React.createElement(Row, { icon: Hand, label: t('ta.voices.cutIn'), description: t('ta.voices.cutInHint') },
|
|
65
|
+
React.createElement(Switch, { checked: !voices.bargeIn.tap, label: t('ta.voices.cutIn'), onChange: on => run('bargeIn', () => bench.voice.setBargeIn({ tap: !on })) }))),
|
|
66
|
+
voices.use && !voices.bargeIn.tap && (React.createElement(BargeInRow, { bargeIn: voices.bargeIn, onChange: bargeIn => void run('bargeIn', () => bench.voice.setBargeIn(bargeIn)) })),
|
|
64
67
|
voices.types.length === 0 && React.createElement(Row, { label: "", description: t('ta.voices.none') }),
|
|
65
68
|
voices.types.map(type => {
|
|
66
69
|
const name = title(type, type.type);
|
|
@@ -75,6 +78,26 @@ export function VoiceServices() {
|
|
|
75
78
|
}),
|
|
76
79
|
React.createElement(Row, { icon: FileJson, label: t('ta.voices.file'), description: React.createElement("span", { className: "ta-path" }, voices.file) })));
|
|
77
80
|
}
|
|
81
|
+
const SENSITIVITY_WORDS = ['ta.voices.bargeIn.0', 'ta.voices.bargeIn.1', 'ta.voices.bargeIn.2', 'ta.voices.bargeIn.3', 'ta.voices.bargeIn.4'];
|
|
82
|
+
/**
|
|
83
|
+
* How readily the user's voice stops what a service reads (voices.json `bargeIn`): a slider of the steps of
|
|
84
|
+
* TaBargeIn.SENSITIVITY, kept as it is let go of. Only for a service: the voice of the device does not listen as it reads.
|
|
85
|
+
*/
|
|
86
|
+
function BargeInRow({ bargeIn, onChange }) {
|
|
87
|
+
const t = useT();
|
|
88
|
+
const kept = TaBargeIn.sensitivity(bargeIn);
|
|
89
|
+
const [step, setStep] = React.useState(kept);
|
|
90
|
+
React.useEffect(() => setStep(kept), [kept]);
|
|
91
|
+
const keep = () => {
|
|
92
|
+
if (step !== kept) {
|
|
93
|
+
onChange(TaBargeIn.SENSITIVITY[step]);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const label = t('ta.voices.bargeIn');
|
|
97
|
+
return (React.createElement(Row, { icon: AudioLines, label: label, description: t('ta.voices.bargeInHint') },
|
|
98
|
+
React.createElement("input", { type: "range", className: "ta-setting-range", min: 0, max: TaBargeIn.SENSITIVITY.length - 1, step: 1, value: step, "aria-label": label, "aria-valuetext": t(SENSITIVITY_WORDS[step]), onChange: event => setStep(Number(event.target.value)), onPointerUp: keep, onKeyUp: keep, onBlur: keep }),
|
|
99
|
+
React.createElement("span", { className: "ta-setting-range-value" }, t(SENSITIVITY_WORDS[step]))));
|
|
100
|
+
}
|
|
78
101
|
/**
|
|
79
102
|
* The form of a type of voice service: its fields as the package said, keys as passwords. Ta connects once before it
|
|
80
103
|
* adds it, or before it changes `service`, whose fields it starts with: its keys are never shown, left empty they stay.
|
|
@@ -6,6 +6,6 @@ export declare function useDocument(): void;
|
|
|
6
6
|
* Signed out: sign in with an account when the ta serve of the page takes them, scan the code of a computer (in
|
|
7
7
|
* the app), paste its link or a token, or pick a computer used before.
|
|
8
8
|
*/
|
|
9
|
-
export declare function SignIn(
|
|
9
|
+
export declare function SignIn(props: {
|
|
10
10
|
error?: WorkbenchState['error'];
|
|
11
11
|
}): React.JSX.Element;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { CodeScan } from '../device/code-scan.js';
|
|
2
3
|
import { Device } from '../device/device.js';
|
|
3
|
-
import { Scanner } from '../device/scanner.js';
|
|
4
4
|
import { usePwa, useSettings } from '../hooks.js';
|
|
5
5
|
import { useT } from '../i18n/use-t.js';
|
|
6
6
|
import { STYLE } from '../style.js';
|
|
7
7
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
8
|
+
import { AccountAsk, AccountSignInEntry } from './account-view.js';
|
|
9
|
+
import { BuiltInSignIn, CloudSignInEntry, CloudSignInFlow, useBuiltInState } from './cloud-sign-in-view.js';
|
|
8
10
|
import { dinoFavicon } from './dino.js';
|
|
9
11
|
import { AddHostPanel } from './host-view.js';
|
|
12
|
+
import { ScanReader } from './scan-screen.js';
|
|
10
13
|
import { SignInAccounts, useSignInWays } from './sign-in-accounts.js';
|
|
11
14
|
import { ConnectPicture } from './sign-in-picture.js';
|
|
12
15
|
import { TaAvatar } from './ta-avatar.js';
|
|
@@ -48,14 +51,47 @@ export function useDocument() {
|
|
|
48
51
|
* Signed out: sign in with an account when the ta serve of the page takes them, scan the code of a computer (in
|
|
49
52
|
* the app), paste its link or a token, or pick a computer used before.
|
|
50
53
|
*/
|
|
51
|
-
export function SignIn(
|
|
54
|
+
export function SignIn(props) {
|
|
55
|
+
return (React.createElement(React.Fragment, null,
|
|
56
|
+
React.createElement(SignInPage, { ...props }),
|
|
57
|
+
React.createElement(ScanReader, null),
|
|
58
|
+
React.createElement(AccountAsk, null)));
|
|
59
|
+
}
|
|
60
|
+
function SignInPage({ error }) {
|
|
52
61
|
const t = useT();
|
|
53
62
|
const app = WorkbenchUtil.isApp();
|
|
54
|
-
const way =
|
|
63
|
+
const way = CodeScan.available() ? 'scan' : app ? 'pair' : 'serve';
|
|
55
64
|
// The ta serve of this page may take accounts (GitHub, Google, WeChat...); the app has none of its own.
|
|
56
|
-
const { providers, outcome } = useSignInWays(!app);
|
|
65
|
+
const { providers, outcome, settled } = useSignInWays(!app);
|
|
57
66
|
const accounts = providers.length > 0;
|
|
67
|
+
// Ta in the cloud, the whole card while signing in to it; not offered on a page that takes accounts itself (a gateway).
|
|
68
|
+
// A way to sign in of the Ta in the cloud offered first, which goes to it at once, or another by its address (`typing`).
|
|
69
|
+
const [cloud, setCloud] = React.useState();
|
|
70
|
+
const { known: builtIn, settled: builtInSettled } = useBuiltInState();
|
|
71
|
+
// Its ways, or, out of reach from inside the company's network, the way to it.
|
|
72
|
+
const company = !accounts && builtIn && (builtIn.providers.length > 0 || builtIn.unreachable) ? builtIn : undefined;
|
|
58
73
|
useDocument();
|
|
74
|
+
if (!settled || !builtInSettled) {
|
|
75
|
+
// Drawn once, as it will stay: not a page of a computer, then one of a company's accounts.
|
|
76
|
+
return React.createElement("div", { className: "ta-signin" });
|
|
77
|
+
}
|
|
78
|
+
if (cloud) {
|
|
79
|
+
return (React.createElement("div", { className: "ta-signin" },
|
|
80
|
+
React.createElement("div", { className: "ta-card" },
|
|
81
|
+
React.createElement(CloudSignInFlow, { page: true, onBack: () => setCloud(undefined), provider: cloud.provider, typing: cloud.typing }))));
|
|
82
|
+
}
|
|
83
|
+
if (company) {
|
|
84
|
+
// A build for a deployment: its accounts first, the ways to a computer of one's own under them.
|
|
85
|
+
return (React.createElement("div", { className: "ta-signin" },
|
|
86
|
+
React.createElement("div", { className: "ta-card" },
|
|
87
|
+
React.createElement(TaAvatar, { size: 88 }),
|
|
88
|
+
React.createElement("h1", null, t('ta.signin.title')),
|
|
89
|
+
React.createElement("p", null, t('ta.cloud.builtInHint')),
|
|
90
|
+
React.createElement(BuiltInSignIn, { known: company, onPick: provider => setCloud({ provider }), onOther: () => setCloud({ typing: true }) }),
|
|
91
|
+
React.createElement("div", { className: "ta-sign-in-or" }, t('ta.cloud.orComputer')),
|
|
92
|
+
app && React.createElement(AccountSignInEntry, null),
|
|
93
|
+
React.createElement(AddHostPanel, { error: error === 'refused' ? (app ? 'ta.signin.pairRefused' : 'ta.signin.refused') : undefined }))));
|
|
94
|
+
}
|
|
59
95
|
return (React.createElement("div", { className: "ta-signin" },
|
|
60
96
|
React.createElement("div", { className: "ta-card" },
|
|
61
97
|
React.createElement(TaAvatar, { size: 88 }),
|
|
@@ -71,6 +107,7 @@ export function SignIn({ error }) {
|
|
|
71
107
|
: 'ta.signin.hint')),
|
|
72
108
|
!accounts && React.createElement(ConnectPicture, { way: way }),
|
|
73
109
|
React.createElement(SignInAccounts, { providers: providers, outcome: outcome }),
|
|
74
|
-
React.createElement(
|
|
110
|
+
app && React.createElement(AccountSignInEntry, null),
|
|
111
|
+
React.createElement(AddHostPanel, { error: error === 'refused' ? (app ? 'ta.signin.pairRefused' : 'ta.signin.refused') : undefined }, !accounts && React.createElement(CloudSignInEntry, { onPick: () => setCloud({}) })))));
|
|
75
112
|
}
|
|
76
113
|
//# sourceMappingURL=workbench-view.js.map
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import type { TaWebExtensions } from '../extension/web-extension-protocol.js';
|
|
2
1
|
import { type MessageId } from '../i18n/messages.js';
|
|
3
2
|
import type { TaLinks } from '../links/links-protocol.js';
|
|
4
3
|
import type { TaNotices } from '../notices/notices-protocol.js';
|
|
5
4
|
import type { TaSettings } from '../settings/settings-protocol.js';
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/** A code asked for by CodeScan.read: what the screen says, and where the code read (or none) goes. */
|
|
6
|
+
export interface ScanRequest {
|
|
7
|
+
readonly instructions: string;
|
|
8
|
+
done(text: string | undefined): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Whether the scan screen of the page is open: ScanHost (components/scan-screen.tsx) draws it, CodeScan opens it;
|
|
12
|
+
* the whole of Scan, or only to read a code for whoever asked (`read`), with the camera and the album.
|
|
13
|
+
*/
|
|
8
14
|
export declare namespace ScanScreen {
|
|
9
15
|
const isOpen: () => boolean;
|
|
10
16
|
const show: () => void;
|
|
11
17
|
const hide: () => void;
|
|
18
|
+
/** The code being read for someone, while the screen reads it. */
|
|
19
|
+
const reading: () => ScanRequest | undefined;
|
|
20
|
+
/** Opens the screen to read a code: its text, or undefined once closed without one. Another asked before gets none. */
|
|
21
|
+
function read(instructions: string): Promise<string | undefined>;
|
|
12
22
|
function subscribe(listener: () => void): () => void;
|
|
13
23
|
}
|
|
14
24
|
/** What a scanned code carries, as WeChat's Scan reads it: a computer to pair with, a link of an extension, a page of the web, or text. */
|
|
@@ -29,27 +39,30 @@ export declare namespace CodeScanUtil {
|
|
|
29
39
|
}
|
|
30
40
|
/** What the scan of the page uses (the services of the page; a web extension's context has them). */
|
|
31
41
|
export interface CodeScanHost {
|
|
32
|
-
readonly workbench: TaWorkbench;
|
|
33
42
|
readonly notices: TaNotices;
|
|
34
43
|
readonly links: TaLinks;
|
|
35
|
-
readonly extensions: Pick<TaWebExtensions, 'openShared'>;
|
|
36
44
|
readonly settings: TaSettings;
|
|
37
45
|
}
|
|
38
46
|
/**
|
|
39
47
|
* Scan, as WeChat's: the scan screen of the page where the app reads codes (CodeVision), else the scanner of the
|
|
40
|
-
* app's plugin (an app built before); then what the code carries opens
|
|
41
|
-
*
|
|
42
|
-
*
|
|
48
|
+
* app's plugin (an app built before); then what the code carries opens: a link as every link does (TaLinks.open: a
|
|
49
|
+
* kind of Ta, a computer once the user said so, an extension asking first, a page of the web after the question of
|
|
50
|
+
* links going out of Ta), other text shows to copy.
|
|
43
51
|
*/
|
|
44
52
|
export declare class CodeScan {
|
|
45
53
|
protected readonly host: CodeScanHost;
|
|
46
54
|
constructor(host: CodeScanHost);
|
|
47
55
|
/** Only the Ta app has a camera to scan with. */
|
|
48
56
|
static available(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Reads a code for the caller (`ui.scanCode`, adding a computer): the scan screen of the page, which picks from
|
|
59
|
+
* the album too, else the scanner of the app's plugin. Its text, or undefined when the user cancelled; rejects
|
|
60
|
+
* with a ScanError where the plugin could not.
|
|
61
|
+
*/
|
|
62
|
+
static read(instructions: string, cancelLabel: string): Promise<string | undefined>;
|
|
49
63
|
scan(): Promise<void>;
|
|
50
|
-
/** What a code scanned carries. */
|
|
64
|
+
/** What a code scanned carries: text shows to copy, any link goes where every link goes (TaLinks.open). */
|
|
51
65
|
open(text: string): Promise<void>;
|
|
52
|
-
protected pair(link: string): Promise<void>;
|
|
53
66
|
protected show(text: string): Promise<void>;
|
|
54
67
|
protected say(id: MessageId): string;
|
|
55
68
|
}
|
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
import { message } from '../i18n/messages.js';
|
|
2
2
|
import { ShareLinkUtil } from '../util/share-link.js';
|
|
3
|
-
import {
|
|
3
|
+
import { WorkbenchUtil } from '../workbench-util.js';
|
|
4
4
|
import { CodeVision } from './code-vision.js';
|
|
5
5
|
import { ScanError, Scanner } from './scanner.js';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Whether the scan screen of the page is open: ScanHost (components/scan-screen.tsx) draws it, CodeScan opens it;
|
|
8
|
+
* the whole of Scan, or only to read a code for whoever asked (`read`), with the camera and the album.
|
|
9
|
+
*/
|
|
7
10
|
export var ScanScreen;
|
|
8
11
|
(function (ScanScreen) {
|
|
9
12
|
let open = false;
|
|
13
|
+
let request;
|
|
10
14
|
const listeners = new Set();
|
|
11
|
-
const
|
|
12
|
-
open = value;
|
|
15
|
+
const changed = () => {
|
|
13
16
|
for (const listener of listeners) {
|
|
14
17
|
listener();
|
|
15
18
|
}
|
|
16
19
|
};
|
|
20
|
+
const set = (value) => {
|
|
21
|
+
open = value;
|
|
22
|
+
changed();
|
|
23
|
+
};
|
|
17
24
|
ScanScreen.isOpen = () => open;
|
|
18
25
|
ScanScreen.show = () => set(true);
|
|
19
26
|
ScanScreen.hide = () => set(false);
|
|
27
|
+
/** The code being read for someone, while the screen reads it. */
|
|
28
|
+
ScanScreen.reading = () => request;
|
|
29
|
+
/** Opens the screen to read a code: its text, or undefined once closed without one. Another asked before gets none. */
|
|
30
|
+
function read(instructions) {
|
|
31
|
+
request === null || request === void 0 ? void 0 : request.done(undefined);
|
|
32
|
+
return new Promise(resolve => {
|
|
33
|
+
const asked = {
|
|
34
|
+
instructions,
|
|
35
|
+
done: text => {
|
|
36
|
+
if (request === asked) {
|
|
37
|
+
request = undefined;
|
|
38
|
+
changed();
|
|
39
|
+
resolve(text);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
request = asked;
|
|
44
|
+
changed();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
ScanScreen.read = read;
|
|
20
48
|
function subscribe(listener) {
|
|
21
49
|
listeners.add(listener);
|
|
22
50
|
return () => listeners.delete(listener);
|
|
@@ -32,8 +60,7 @@ export var CodeScanUtil;
|
|
|
32
60
|
if ('pairing' in WorkbenchUtil.credential(trimmed)) {
|
|
33
61
|
return { kind: 'pairing' };
|
|
34
62
|
}
|
|
35
|
-
|
|
36
|
-
if (source && (source !== trimmed || !WEB.test(trimmed) || ShareLinkUtil.relayed(trimmed))) {
|
|
63
|
+
if (ShareLinkUtil.ofExtension(trimmed)) {
|
|
37
64
|
return { kind: 'extension' };
|
|
38
65
|
}
|
|
39
66
|
if (WEB.test(trimmed)) {
|
|
@@ -50,9 +77,9 @@ export var CodeScanUtil;
|
|
|
50
77
|
})(CodeScanUtil || (CodeScanUtil = {}));
|
|
51
78
|
/**
|
|
52
79
|
* Scan, as WeChat's: the scan screen of the page where the app reads codes (CodeVision), else the scanner of the
|
|
53
|
-
* app's plugin (an app built before); then what the code carries opens
|
|
54
|
-
*
|
|
55
|
-
*
|
|
80
|
+
* app's plugin (an app built before); then what the code carries opens: a link as every link does (TaLinks.open: a
|
|
81
|
+
* kind of Ta, a computer once the user said so, an extension asking first, a page of the web after the question of
|
|
82
|
+
* links going out of Ta), other text shows to copy.
|
|
56
83
|
*/
|
|
57
84
|
export class CodeScan {
|
|
58
85
|
constructor(host) {
|
|
@@ -62,6 +89,14 @@ export class CodeScan {
|
|
|
62
89
|
static available() {
|
|
63
90
|
return CodeVision.available() || Scanner.available();
|
|
64
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Reads a code for the caller (`ui.scanCode`, adding a computer): the scan screen of the page, which picks from
|
|
94
|
+
* the album too, else the scanner of the app's plugin. Its text, or undefined when the user cancelled; rejects
|
|
95
|
+
* with a ScanError where the plugin could not.
|
|
96
|
+
*/
|
|
97
|
+
static read(instructions, cancelLabel) {
|
|
98
|
+
return CodeVision.available() ? ScanScreen.read(instructions) : Scanner.scan(instructions, cancelLabel);
|
|
99
|
+
}
|
|
65
100
|
async scan() {
|
|
66
101
|
if (CodeVision.available()) {
|
|
67
102
|
ScanScreen.show();
|
|
@@ -80,43 +115,13 @@ export class CodeScan {
|
|
|
80
115
|
await this.open(text);
|
|
81
116
|
}
|
|
82
117
|
}
|
|
83
|
-
/** What a code scanned carries. */
|
|
118
|
+
/** What a code scanned carries: text shows to copy, any link goes where every link goes (TaLinks.open). */
|
|
84
119
|
async open(text) {
|
|
85
120
|
const code = CodeScanUtil.read(text);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return this.pair(text.trim());
|
|
89
|
-
case 'extension':
|
|
90
|
-
await this.host.extensions.openShared(text);
|
|
91
|
-
return;
|
|
92
|
-
case 'web':
|
|
93
|
-
return this.host.links.open({ type: 'url', url: code.url }, { external: true });
|
|
94
|
-
case 'text':
|
|
95
|
-
return this.show(code.text);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async pair(link) {
|
|
99
|
-
const { workbench, notices } = this.host;
|
|
100
|
-
const id = WorkbenchUtil.serverOf(WorkbenchUtil.credential(link), pageHost());
|
|
101
|
-
if (id === workbench.state.host && workbench.state.status !== 'signed-out') {
|
|
102
|
-
notices.notify(this.say('ta.scan.sameHost'));
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const yes = await notices.confirm({
|
|
106
|
-
title: this.say('ta.scan.pairTitle'),
|
|
107
|
-
message: this.say('ta.scan.pairMessage'),
|
|
108
|
-
confirmLabel: this.say('ta.signin.connect'),
|
|
109
|
-
});
|
|
110
|
-
if (!yes) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
await workbench.signIn(link);
|
|
115
|
-
}
|
|
116
|
-
catch (failure) {
|
|
117
|
-
const refused = failure instanceof WorkbenchError && failure.reason === 'refused';
|
|
118
|
-
notices.notify(this.say(refused ? 'ta.hosts.refused' : 'ta.hosts.unreachable'), { level: 'error' });
|
|
121
|
+
if (code.kind === 'text') {
|
|
122
|
+
return this.show(code.text);
|
|
119
123
|
}
|
|
124
|
+
await this.host.links.open({ type: 'url', url: text.trim() }, { external: true });
|
|
120
125
|
}
|
|
121
126
|
async show(text) {
|
|
122
127
|
const { notices } = this.host;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** How far a finger from the left edge goes to the right to go back, as iOS's swipe back: a third of the screen, or a flick. */
|
|
2
|
+
export declare namespace EdgeBackUtil {
|
|
3
|
+
const FLICK_PX_PER_MS = 0.4;
|
|
4
|
+
/** Whether a swipe from `start` to `end` in `ms` goes back, on a screen `width` wide. */
|
|
5
|
+
function back(start: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}, end: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}, ms: number, width: number): boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A React hook: while `enabled`, a finger from the left edge to the right goes back with `onBack`, as on iOS, over a page
|
|
15
|
+
* that has no sheets of the shell to slide (the sign-in, outside the shell).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useEdgeBack(enabled: boolean, onBack: () => void): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SwipeUtil } from './swipe-util.js';
|
|
3
|
+
/** How far a finger from the left edge goes to the right to go back, as iOS's swipe back: a third of the screen, or a flick. */
|
|
4
|
+
export var EdgeBackUtil;
|
|
5
|
+
(function (EdgeBackUtil) {
|
|
6
|
+
EdgeBackUtil.FLICK_PX_PER_MS = 0.4;
|
|
7
|
+
/** Whether a swipe from `start` to `end` in `ms` goes back, on a screen `width` wide. */
|
|
8
|
+
function back(start, end, ms, width) {
|
|
9
|
+
if (start.x > SwipeUtil.EDGE_PX) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const dx = end.x - start.x;
|
|
13
|
+
const dy = Math.abs(end.y - start.y);
|
|
14
|
+
if (dx <= dy) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return dx > width / 3 || (dx > 40 && dx / Math.max(ms, 1) > EdgeBackUtil.FLICK_PX_PER_MS);
|
|
18
|
+
}
|
|
19
|
+
EdgeBackUtil.back = back;
|
|
20
|
+
})(EdgeBackUtil || (EdgeBackUtil = {}));
|
|
21
|
+
/**
|
|
22
|
+
* A React hook: while `enabled`, a finger from the left edge to the right goes back with `onBack`, as on iOS, over a page
|
|
23
|
+
* that has no sheets of the shell to slide (the sign-in, outside the shell).
|
|
24
|
+
*/
|
|
25
|
+
export function useEdgeBack(enabled, onBack) {
|
|
26
|
+
const latest = React.useRef(onBack);
|
|
27
|
+
latest.current = onBack;
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (!enabled) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let start;
|
|
33
|
+
const down = (event) => {
|
|
34
|
+
const touch = event.touches[0];
|
|
35
|
+
start = event.touches.length === 1 && touch.clientX <= SwipeUtil.EDGE_PX ? { x: touch.clientX, y: touch.clientY, at: event.timeStamp } : undefined;
|
|
36
|
+
};
|
|
37
|
+
const up = (event) => {
|
|
38
|
+
const touch = event.changedTouches[0];
|
|
39
|
+
if (start && touch && EdgeBackUtil.back(start, { x: touch.clientX, y: touch.clientY }, event.timeStamp - start.at, window.innerWidth)) {
|
|
40
|
+
latest.current();
|
|
41
|
+
}
|
|
42
|
+
start = undefined;
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener('touchstart', down, { passive: true });
|
|
45
|
+
document.addEventListener('touchend', up, { passive: true });
|
|
46
|
+
return () => {
|
|
47
|
+
document.removeEventListener('touchstart', down);
|
|
48
|
+
document.removeEventListener('touchend', up);
|
|
49
|
+
};
|
|
50
|
+
}, [enabled]);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=edge-back.js.map
|