@celljs/ta-web 4.17.0 → 4.18.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/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.js +3 -1
- 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 +61 -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 +9 -4
- package/esm/browser/components/host-view.js +53 -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 +38 -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 +2 -0
- package/esm/browser/hosts.js +12 -2
- package/esm/browser/i18n/locales.d.ts +144 -14
- package/esm/browser/i18n/messages-ja.js +153 -23
- package/esm/browser/i18n/messages-zh-tw.js +153 -23
- package/esm/browser/i18n/messages.d.ts +141 -11
- package/esm/browser/i18n/messages.js +307 -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 +0 -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 +8 -2
- 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 +1 -1
- package/esm/browser/workbench-hosts.js +2 -2
- package/esm/browser/workbench-protocol.d.ts +18 -3
- package/esm/browser/workbench-services.d.ts +9 -1
- package/esm/browser/workbench-services.js +38 -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/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.js +2 -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 +62 -0
- package/lib/browser/components/cloud-sign-in-view.js +393 -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 +9 -4
- package/lib/browser/components/host-view.js +52 -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 +38 -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 +2 -0
- package/lib/browser/hosts.js +12 -2
- package/lib/browser/i18n/locales.d.ts +144 -14
- package/lib/browser/i18n/messages-ja.js +153 -23
- package/lib/browser/i18n/messages-zh-tw.js +153 -23
- package/lib/browser/i18n/messages.d.ts +141 -11
- package/lib/browser/i18n/messages.js +307 -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 +0 -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 +8 -2
- 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 +1 -1
- package/lib/browser/workbench-hosts.js +2 -2
- package/lib/browser/workbench-protocol.d.ts +18 -3
- package/lib/browser/workbench-services.d.ts +9 -1
- package/lib/browser/workbench-services.js +38 -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
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { TaDeploymentUtil } from '@celljs/ta-protocol';
|
|
2
|
+
import { ChevronLeft, Cloud, Globe } from 'lucide-react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { CloudSignIn, CloudSignInError, CloudSignInUtil } from '../cloud/cloud-sign-in.js';
|
|
6
|
+
import { useEdgeBack } from '../device/edge-back.js';
|
|
7
|
+
import { useWorkbench } from '../hooks.js';
|
|
8
|
+
import { HostUtil } from '../hosts.js';
|
|
9
|
+
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
10
|
+
import { WorkbenchError } from '../workbench-util.js';
|
|
11
|
+
import { Callout } from './callout.js';
|
|
12
|
+
import { Icon, IconButton } from './icon.js';
|
|
13
|
+
import { SignInAccountsUtil } from './sign-in-accounts.js';
|
|
14
|
+
import { SignInMark } from './sign-in-marks.js';
|
|
15
|
+
import { TaAvatar } from './ta-avatar.js';
|
|
16
|
+
let distribution;
|
|
17
|
+
let builtIn;
|
|
18
|
+
/** How often the sign-in asks again a gateway out of reach while it is seen: the user may have just turned on the VPN. */
|
|
19
|
+
const RECHECK_MS = 8000;
|
|
20
|
+
/** Whether this device keeps the gateway at `url` among its computers: signed in to it before. */
|
|
21
|
+
function signedIn(url) {
|
|
22
|
+
var _a;
|
|
23
|
+
return HostUtil.read((_a = globalThis.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(HostUtil.KEY)).hosts.some(host => 'url' in host.credential && host.credential.url === url);
|
|
24
|
+
}
|
|
25
|
+
function lookUp() {
|
|
26
|
+
distribution !== null && distribution !== void 0 ? distribution : (distribution = CloudSignInUtil.distribution());
|
|
27
|
+
builtIn !== null && builtIn !== void 0 ? builtIn : (builtIn = distribution.then(async (given) => {
|
|
28
|
+
var _a;
|
|
29
|
+
const chosen = CloudSignInUtil.chosen();
|
|
30
|
+
const gateway = chosen !== null && chosen !== void 0 ? chosen : given === null || given === void 0 ? void 0 : given.gateway;
|
|
31
|
+
if (!gateway) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const own = chosen ? {} : { name: given === null || given === void 0 ? void 0 : given.name, reach: given === null || given === void 0 ? void 0 : given.reach };
|
|
35
|
+
const providers = await CloudSignInUtil.ways(gateway);
|
|
36
|
+
if (providers.length === 0 && !(await CloudSignInUtil.answers(gateway))) {
|
|
37
|
+
// Asked again next time: the gateway may be out of reach (no VPN) for now.
|
|
38
|
+
builtIn = undefined;
|
|
39
|
+
const remembered = (_a = CloudSignInUtil.remembered(gateway)) !== null && _a !== void 0 ? _a : [];
|
|
40
|
+
const away = { url: gateway, ...own, providers: remembered, unreachable: true };
|
|
41
|
+
const inside = chosen ? undefined : given === null || given === void 0 ? void 0 : given.inside;
|
|
42
|
+
if (inside) {
|
|
43
|
+
// Inside the company's network (its sign-in answers) but not its VPN: the company's way, and how to reach
|
|
44
|
+
// it. Outside it altogether: as if the build had no deployment.
|
|
45
|
+
return (await CloudSignInUtil.within(inside)) ? away : undefined;
|
|
46
|
+
}
|
|
47
|
+
return chosen || remembered.length > 0 || signedIn(gateway) ? away : undefined;
|
|
48
|
+
}
|
|
49
|
+
CloudSignInUtil.remember(gateway, providers);
|
|
50
|
+
return { url: gateway, ...own, providers };
|
|
51
|
+
}));
|
|
52
|
+
return builtIn;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* What a device does to reach the gateway at `url`, in the language of the page: told by the build for its deployment
|
|
56
|
+
* (TaDistribution.reach); none for another.
|
|
57
|
+
*/
|
|
58
|
+
export function useCloudReach(url) {
|
|
59
|
+
const language = useLanguage();
|
|
60
|
+
const [reach, setReach] = React.useState();
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
let live = true;
|
|
63
|
+
if (url) {
|
|
64
|
+
distribution !== null && distribution !== void 0 ? distribution : (distribution = CloudSignInUtil.distribution());
|
|
65
|
+
void distribution.then(given => live && setReach((given === null || given === void 0 ? void 0 : given.gateway) === url ? given.reach : undefined));
|
|
66
|
+
}
|
|
67
|
+
return () => {
|
|
68
|
+
live = false;
|
|
69
|
+
};
|
|
70
|
+
}, [url]);
|
|
71
|
+
return url ? TaDeploymentUtil.reachIn(reach, language) : undefined;
|
|
72
|
+
}
|
|
73
|
+
/** Calls `again` when the page is seen again or the network comes back, and now and then while it is seen. */
|
|
74
|
+
function useWhenBack(active, again) {
|
|
75
|
+
const call = React.useRef(again);
|
|
76
|
+
call.current = again;
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
if (!active) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const seen = () => document.visibilityState === 'visible' && call.current();
|
|
82
|
+
document.addEventListener('visibilitychange', seen);
|
|
83
|
+
window.addEventListener('online', seen);
|
|
84
|
+
const timer = setInterval(seen, RECHECK_MS);
|
|
85
|
+
return () => {
|
|
86
|
+
document.removeEventListener('visibilitychange', seen);
|
|
87
|
+
window.removeEventListener('online', seen);
|
|
88
|
+
clearInterval(timer);
|
|
89
|
+
};
|
|
90
|
+
}, [active]);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The ways to sign in of the Ta in the cloud of this build's deployment (a company's accounts), offered first on the
|
|
94
|
+
* sign-in: one tap goes to them, no address, no code. Undefined in a build for none; with no ways while its gateway does
|
|
95
|
+
* not answer, still the one signed in to, never an address to type.
|
|
96
|
+
*/
|
|
97
|
+
export function useBuiltInWays() {
|
|
98
|
+
return useBuiltInState().known;
|
|
99
|
+
}
|
|
100
|
+
/** How long the sign-in waits, the first time, for the gateway of its deployment before it is drawn without it. */
|
|
101
|
+
const SETTLE_MS = 1500;
|
|
102
|
+
/** What the last look found, for a sign-in drawn again in this page: as it was, at once. */
|
|
103
|
+
let lastFound;
|
|
104
|
+
/**
|
|
105
|
+
* What the last sign-in knew of the Ta in the cloud of this build, at once: none for a build without one; its ways
|
|
106
|
+
* kept on this device when it reached it before. `wait`: nothing known yet, the gateway is asked.
|
|
107
|
+
*/
|
|
108
|
+
async function known() {
|
|
109
|
+
distribution !== null && distribution !== void 0 ? distribution : (distribution = CloudSignInUtil.distribution());
|
|
110
|
+
const given = await distribution;
|
|
111
|
+
const chosen = CloudSignInUtil.chosen();
|
|
112
|
+
const gateway = chosen !== null && chosen !== void 0 ? chosen : given === null || given === void 0 ? void 0 : given.gateway;
|
|
113
|
+
if (!gateway) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
const kept = CloudSignInUtil.remembered(gateway);
|
|
117
|
+
return (kept === null || kept === void 0 ? void 0 : kept.length) ? { url: gateway, ...(chosen ? {} : { name: given === null || given === void 0 ? void 0 : given.name, reach: given === null || given === void 0 ? void 0 : given.reach }), providers: kept } : 'wait';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* useBuiltInWays, and whether the sign-in may be drawn yet (`settled`): once what it shows will stay, so that it is not
|
|
121
|
+
* a page of a computer turning into one of a company's accounts. What this device kept shows at once; the first time,
|
|
122
|
+
* the gateway is waited for SETTLE_MS at most.
|
|
123
|
+
*/
|
|
124
|
+
export function useBuiltInState() {
|
|
125
|
+
const [found, setFound] = React.useState(lastFound === null || lastFound === void 0 ? void 0 : lastFound.known);
|
|
126
|
+
const [settled, setSettled] = React.useState(Boolean(lastFound));
|
|
127
|
+
const live = React.useRef(true);
|
|
128
|
+
const look = React.useCallback(() => void lookUp().then(given => {
|
|
129
|
+
if (live.current) {
|
|
130
|
+
if (given) {
|
|
131
|
+
setFound(given);
|
|
132
|
+
}
|
|
133
|
+
lastFound = { known: given !== null && given !== void 0 ? given : lastFound === null || lastFound === void 0 ? void 0 : lastFound.known };
|
|
134
|
+
setSettled(true);
|
|
135
|
+
}
|
|
136
|
+
}), []);
|
|
137
|
+
React.useEffect(() => {
|
|
138
|
+
live.current = true;
|
|
139
|
+
void known().then(first => {
|
|
140
|
+
if (live.current && first !== 'wait') {
|
|
141
|
+
setFound(before => before !== null && before !== void 0 ? before : first);
|
|
142
|
+
setSettled(true);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const timer = setTimeout(() => live.current && setSettled(true), SETTLE_MS);
|
|
146
|
+
look();
|
|
147
|
+
return () => {
|
|
148
|
+
live.current = false;
|
|
149
|
+
clearTimeout(timer);
|
|
150
|
+
};
|
|
151
|
+
}, [look]);
|
|
152
|
+
// Out of reach (the VPN off): its ways show by themselves once it answers, the user back from turning it on.
|
|
153
|
+
useWhenBack(Boolean(found === null || found === void 0 ? void 0 : found.unreachable), look);
|
|
154
|
+
return { known: found, settled };
|
|
155
|
+
}
|
|
156
|
+
/** A button per way to sign in of the Ta in the cloud of this build, first on the sign-in. */
|
|
157
|
+
export function BuiltInSignIn({ known, onPick, onOther }) {
|
|
158
|
+
const t = useT();
|
|
159
|
+
const reach = useCloudReach(known.unreachable ? known.url : undefined);
|
|
160
|
+
return (React.createElement("div", { className: "ta-sign-in-accounts" },
|
|
161
|
+
known.providers.map(provider => (React.createElement("button", { key: provider.id, type: "button", className: "ta-button ta-primary ta-wide ta-sign-in-account", onClick: () => onPick(provider.id) },
|
|
162
|
+
React.createElement(SignInMark, { provider: provider.id }),
|
|
163
|
+
SignInAccountsUtil.label(provider, t)))),
|
|
164
|
+
known.providers.length === 0 && (React.createElement("button", { type: "button", className: "ta-button ta-primary ta-wide ta-sign-in-account", onClick: () => onPick() },
|
|
165
|
+
React.createElement(Icon, { icon: Cloud, size: 17 }),
|
|
166
|
+
t('ta.cloud.companyAccount'))),
|
|
167
|
+
reach && (React.createElement(Callout, { level: "warning", className: "ta-cloud-reach" }, t('ta.cloud.reachHint', { reach }))),
|
|
168
|
+
React.createElement("button", { type: "button", className: "ta-link-button ta-cloud-other", onClick: onOther }, t('ta.cloud.other'))));
|
|
169
|
+
}
|
|
170
|
+
const ERRORS = {
|
|
171
|
+
'no-gateway': 'ta.cloud.noGateway',
|
|
172
|
+
unreachable: 'ta.cloud.unreachable',
|
|
173
|
+
expired: 'ta.cloud.expired',
|
|
174
|
+
};
|
|
175
|
+
/** Signing in to Ta in the cloud, from an address (or the gateway of this build) to the computer kept and in use. */
|
|
176
|
+
export function useCloudSignIn() {
|
|
177
|
+
const [, bench] = useWorkbench();
|
|
178
|
+
const [busy, setBusy] = React.useState(false);
|
|
179
|
+
const [progress, setProgress] = React.useState();
|
|
180
|
+
const [error, setError] = React.useState();
|
|
181
|
+
const running = React.useRef(undefined);
|
|
182
|
+
React.useEffect(() => {
|
|
183
|
+
// Back from the browser: asked again at once rather than at the end of the wait.
|
|
184
|
+
const back = () => { var _a; return document.visibilityState === 'visible' && ((_a = running.current) === null || _a === void 0 ? void 0 : _a.poke()); };
|
|
185
|
+
document.addEventListener('visibilitychange', back);
|
|
186
|
+
return () => {
|
|
187
|
+
var _a;
|
|
188
|
+
document.removeEventListener('visibilitychange', back);
|
|
189
|
+
(_a = running.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
190
|
+
};
|
|
191
|
+
}, []);
|
|
192
|
+
const start = React.useCallback(async (address, known, provider) => {
|
|
193
|
+
var _a;
|
|
194
|
+
(_a = running.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
195
|
+
setBusy(true);
|
|
196
|
+
setError(undefined);
|
|
197
|
+
setProgress(undefined);
|
|
198
|
+
try {
|
|
199
|
+
const gateway = known ? address : (await CloudSignInUtil.gateway(address)).url;
|
|
200
|
+
const typed = !known;
|
|
201
|
+
const signIn = new CloudSignIn({
|
|
202
|
+
gateway,
|
|
203
|
+
name: navigator.userAgent,
|
|
204
|
+
open: url => window.open(url, '_blank', 'noopener,noreferrer'),
|
|
205
|
+
onProgress: setProgress,
|
|
206
|
+
provider,
|
|
207
|
+
});
|
|
208
|
+
running.current = signIn;
|
|
209
|
+
const credential = await signIn.run();
|
|
210
|
+
if (credential && running.current === signIn) {
|
|
211
|
+
await bench.signIn(credential);
|
|
212
|
+
if (typed) {
|
|
213
|
+
// Another company's Ta in the cloud: offered first on this device's sign-in from now on.
|
|
214
|
+
CloudSignInUtil.choose(gateway);
|
|
215
|
+
builtIn = undefined;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (failure) {
|
|
220
|
+
setProgress(undefined);
|
|
221
|
+
setError(failure instanceof CloudSignInError
|
|
222
|
+
? ERRORS[failure.reason]
|
|
223
|
+
: failure instanceof WorkbenchError && failure.reason === 'refused'
|
|
224
|
+
? 'ta.hosts.refused'
|
|
225
|
+
: 'ta.cloud.unreachable');
|
|
226
|
+
}
|
|
227
|
+
finally {
|
|
228
|
+
setBusy(false);
|
|
229
|
+
}
|
|
230
|
+
}, [bench]);
|
|
231
|
+
const cancel = React.useCallback(() => {
|
|
232
|
+
var _a;
|
|
233
|
+
(_a = running.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
234
|
+
running.current = undefined;
|
|
235
|
+
setBusy(false);
|
|
236
|
+
setProgress(undefined);
|
|
237
|
+
}, []);
|
|
238
|
+
return { busy, progress, error, start, cancel };
|
|
239
|
+
}
|
|
240
|
+
/** The code split as it is read aloud or typed: two groups of four. */
|
|
241
|
+
function CodeBox({ code }) {
|
|
242
|
+
const [first, second] = code.split('-');
|
|
243
|
+
return (React.createElement("div", { className: "ta-cloud-code", role: "img", "aria-label": code },
|
|
244
|
+
React.createElement("span", null, first),
|
|
245
|
+
React.createElement("span", { className: "ta-cloud-code-dash", "aria-hidden": "true" }),
|
|
246
|
+
React.createElement("span", null, second)));
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* What the way to Ta in the cloud says: its one way to sign in ("Continue with the company account", which it goes to at
|
|
250
|
+
* once), else the name of its deployment, else Ta in the cloud.
|
|
251
|
+
*/
|
|
252
|
+
function useCloudLabel() {
|
|
253
|
+
const t = useT();
|
|
254
|
+
const known = useBuiltInWays();
|
|
255
|
+
if ((known === null || known === void 0 ? void 0 : known.providers.length) === 1) {
|
|
256
|
+
return SignInAccountsUtil.label(known.providers[0], t);
|
|
257
|
+
}
|
|
258
|
+
return (known === null || known === void 0 ? void 0 : known.name) ? t('ta.cloud.signInTo', { name: known.name }) : t('ta.cloud.signIn');
|
|
259
|
+
}
|
|
260
|
+
/** The way to Ta in the cloud on the sign-in, under the ways to a computer: one wide button. */
|
|
261
|
+
export function CloudSignInEntry({ onPick }) {
|
|
262
|
+
const t = useT();
|
|
263
|
+
const label = useCloudLabel();
|
|
264
|
+
const known = useBuiltInWays();
|
|
265
|
+
const reach = useCloudReach((known === null || known === void 0 ? void 0 : known.unreachable) ? known.url : undefined);
|
|
266
|
+
return (React.createElement(React.Fragment, null,
|
|
267
|
+
React.createElement("div", { className: "ta-sign-in-or" }, t('ta.cloud.or')),
|
|
268
|
+
React.createElement("button", { type: "button", className: "ta-button ta-wide ta-cloud-entry", onClick: onPick },
|
|
269
|
+
React.createElement(Icon, { icon: Cloud, size: 17 }),
|
|
270
|
+
" ",
|
|
271
|
+
label),
|
|
272
|
+
reach && (React.createElement(Callout, { level: "warning", className: "ta-cloud-reach" }, t('ta.cloud.reachHint', { reach })))));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Signing in to Ta in the cloud, the whole card: the address once (none for the deployment of this build, which starts at
|
|
276
|
+
* once), then the code to check in the browser while the token comes. `onBack` goes back to the other ways.
|
|
277
|
+
*/
|
|
278
|
+
export function CloudSignInFlow({ onBack, provider, typing, page }) {
|
|
279
|
+
const t = useT();
|
|
280
|
+
const offered = useBuiltInWays();
|
|
281
|
+
// `typing`: another company's, by its address, whatever this device offers first.
|
|
282
|
+
const known = typing ? undefined : offered;
|
|
283
|
+
// Its one way to sign in at once; with several, the page of the code lists them.
|
|
284
|
+
const way = provider !== null && provider !== void 0 ? provider : ((known === null || known === void 0 ? void 0 : known.providers.length) === 1 ? known.providers[0].id : undefined);
|
|
285
|
+
const cloud = useCloudSignIn();
|
|
286
|
+
const reach = useCloudReach(known === null || known === void 0 ? void 0 : known.url);
|
|
287
|
+
const started = React.useRef(false);
|
|
288
|
+
React.useEffect(() => {
|
|
289
|
+
if (known && !started.current) {
|
|
290
|
+
started.current = true;
|
|
291
|
+
void cloud.start(known.url, true, way);
|
|
292
|
+
}
|
|
293
|
+
}, [known, cloud, way]);
|
|
294
|
+
// Out of reach: tried again once the user is back (from turning the VPN on), with no tap.
|
|
295
|
+
const outOfReach = Boolean(known) && !cloud.busy && cloud.error === 'ta.cloud.unreachable';
|
|
296
|
+
useWhenBack(outOfReach, () => {
|
|
297
|
+
// Asked quietly first: the hint stays put, no flicker, until the gateway answers.
|
|
298
|
+
if (known) {
|
|
299
|
+
void CloudSignInUtil.answers(known.url).then(async (answers) => {
|
|
300
|
+
if (answers) {
|
|
301
|
+
const ways = way ? [] : await CloudSignInUtil.ways(known.url);
|
|
302
|
+
void cloud.start(known.url, true, way !== null && way !== void 0 ? way : (ways.length === 1 ? ways[0].id : undefined));
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const back = () => {
|
|
308
|
+
cloud.cancel();
|
|
309
|
+
onBack();
|
|
310
|
+
};
|
|
311
|
+
// A page of its own (the sign-in): back by a swipe from the left edge, as iOS's, or the chevron at the top left.
|
|
312
|
+
useEdgeBack(Boolean(page), back);
|
|
313
|
+
const backButton = React.createElement(IconButton, { icon: ChevronLeft, label: t('ta.cloud.back'), className: "ta-cloud-back", onClick: back });
|
|
314
|
+
const { progress } = cloud;
|
|
315
|
+
return (React.createElement("div", { className: "ta-cloud-flow" },
|
|
316
|
+
page ? createPortal(React.createElement("div", { className: "ta-cloud-top" }, backButton), document.body) : backButton,
|
|
317
|
+
React.createElement(TaAvatar, { size: 72 }),
|
|
318
|
+
progress ? (React.createElement(React.Fragment, null,
|
|
319
|
+
React.createElement("h1", null, t('ta.cloud.codeTitle')),
|
|
320
|
+
React.createElement("p", null, t(progress.direct ? 'ta.cloud.direct' : 'ta.cloud.code')),
|
|
321
|
+
!progress.direct && React.createElement(CodeBox, { code: progress.code }),
|
|
322
|
+
React.createElement("div", { className: `ta-cloud-status${progress.waiting ? ' ta-cloud-status-wait' : ''}`, role: "status" },
|
|
323
|
+
!progress.waiting && React.createElement("span", { className: "ta-spinner" }),
|
|
324
|
+
progress.waiting ? t('ta.cloud.waiting', { account: progress.waiting }) : t('ta.cloud.pending')),
|
|
325
|
+
React.createElement("button", { type: "button", className: "ta-button ta-wide", onClick: () => window.open(progress.url, '_blank', 'noopener,noreferrer') }, t('ta.cloud.reopen')))) : (React.createElement(React.Fragment, null,
|
|
326
|
+
React.createElement("h1", null, (known === null || known === void 0 ? void 0 : known.name) ? t('ta.cloud.signInTo', { name: known.name }) : t('ta.cloud.signIn')),
|
|
327
|
+
React.createElement("p", null, t('ta.cloud.hint')),
|
|
328
|
+
known ? (React.createElement("div", { className: "ta-cloud-status", role: "status" },
|
|
329
|
+
cloud.busy && React.createElement("span", { className: "ta-spinner" }),
|
|
330
|
+
cloud.busy ? t('ta.cloud.connecting', { host: new URL(known.url).host }) : null)) : (React.createElement(CloudAddressForm, { busy: cloud.busy, onSubmit: address => void cloud.start(address) })),
|
|
331
|
+
known && !cloud.busy && cloud.error && (React.createElement("button", { type: "button", className: "ta-button ta-primary ta-wide", onClick: () => void cloud.start(known.url, true, way) }, t('ta.cloud.retry'))))),
|
|
332
|
+
cloud.error && (React.createElement(Callout, { level: outOfReach && reach ? 'warning' : 'error' }, outOfReach && known
|
|
333
|
+
? reach
|
|
334
|
+
? t('ta.cloud.reachHint', { reach })
|
|
335
|
+
: t('ta.cloud.unreachableAt', { host: new URL(known.url).host })
|
|
336
|
+
: t(cloud.error)))));
|
|
337
|
+
}
|
|
338
|
+
/** The address of a Ta in the cloud, typed: a gateway, or the relay of its deployment. */
|
|
339
|
+
function CloudAddressForm({ busy, onSubmit }) {
|
|
340
|
+
const t = useT();
|
|
341
|
+
const [text, setText] = React.useState('');
|
|
342
|
+
return (React.createElement("form", { className: "ta-cloud-form", onSubmit: event => {
|
|
343
|
+
event.preventDefault();
|
|
344
|
+
onSubmit(text.trim());
|
|
345
|
+
} },
|
|
346
|
+
React.createElement("label", { className: "ta-field" },
|
|
347
|
+
React.createElement(Icon, { icon: Globe, size: 16 }),
|
|
348
|
+
React.createElement("input", { type: "text", inputMode: "url", autoCapitalize: "off", autoCorrect: "off", autoFocus: true, placeholder: t('ta.cloud.address'), value: text, onChange: event => setText(event.target.value) })),
|
|
349
|
+
React.createElement("button", { type: "submit", className: "ta-button ta-primary ta-wide", disabled: busy || !text.trim() }, busy ? React.createElement("span", { className: "ta-spinner" }) : t('ta.cloud.go'))));
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=cloud-sign-in-view.js.map
|
|
@@ -3,6 +3,7 @@ import { useDevice } from '../device/device.js';
|
|
|
3
3
|
import { MonacoLoader, MonacoUtil } from '../editor/monaco-loader.js';
|
|
4
4
|
import { useT } from '../i18n/use-t.js';
|
|
5
5
|
import { SettingsUtil } from '../settings/settings-protocol.js';
|
|
6
|
+
import { Loading } from './loading.js';
|
|
6
7
|
let models = 0;
|
|
7
8
|
/** Monaco on the text of a file, in the theme of `settings`; it loads the first time one is shown. */
|
|
8
9
|
export function CodeEditor({ settings: store, path, value, readOnly = false, line, column, endColumn, selection, onChange, onSave, }) {
|
|
@@ -84,6 +85,6 @@ export function CodeEditor({ settings: store, path, value, readOnly = false, lin
|
|
|
84
85
|
}, [editor, rangeKey]);
|
|
85
86
|
return (React.createElement("div", { className: "ta-code-editor" },
|
|
86
87
|
React.createElement("div", { ref: host, className: "ta-code-editor-host" }),
|
|
87
|
-
!editor && React.createElement("div", { className: "ta-code-editor-state" }, error ? t('ta.editor.failed', { message: error }) : t('ta.editor.loading'))));
|
|
88
|
+
!editor && (React.createElement("div", { className: "ta-code-editor-state" }, error ? t('ta.editor.failed', { message: error }) : React.createElement(Loading, { label: t('ta.editor.loading') })))));
|
|
88
89
|
}
|
|
89
90
|
//# sourceMappingURL=code-editor.js.map
|
|
@@ -12,6 +12,7 @@ import { Voice } from '../util/voice.js';
|
|
|
12
12
|
import { Attachments, readImage } from './composer-attachments.js';
|
|
13
13
|
import { talkTarget, useFieldFit, usePlusMenuDismiss, useTalkWiring, useTapToType } from './composer-box-hooks.js';
|
|
14
14
|
import { ComposerMenu } from './composer-menu.js';
|
|
15
|
+
import { HeldTalk } from './held-talk.js';
|
|
15
16
|
import { Icon, IconButton } from './icon.js';
|
|
16
17
|
import { PlusMenu } from './plus-menu.js';
|
|
17
18
|
import { RecentShotOffer } from './recent-shot.js';
|
|
@@ -183,6 +184,9 @@ export const ComposerBox = React.forwardRef(function ComposerBox(props, ref) {
|
|
|
183
184
|
edit(message, message.length);
|
|
184
185
|
}
|
|
185
186
|
onTalkCall(sent ? { text: message, sent } : undefined, zone);
|
|
187
|
+
if (talkPlace) {
|
|
188
|
+
HeldTalk.given(talkPlace, zone);
|
|
189
|
+
}
|
|
186
190
|
return;
|
|
187
191
|
}
|
|
188
192
|
const [message, position] = ComposerUtil.insert(latest.current, latestCaret.current, words);
|
|
@@ -195,6 +199,9 @@ export const ComposerBox = React.forwardRef(function ComposerBox(props, ref) {
|
|
|
195
199
|
setTalkMode(false);
|
|
196
200
|
edit(message, position);
|
|
197
201
|
}
|
|
202
|
+
if (talkPlace) {
|
|
203
|
+
HeldTalk.given(talkPlace, zone);
|
|
204
|
+
}
|
|
198
205
|
}, onError, hints, onTalkCall ? talkCalls : []);
|
|
199
206
|
const talking = useTalkWiring(talk, onListening, talkPlace);
|
|
200
207
|
// Speech goes where the caret was when listening began, between what was typed.
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useDevice } from '../device/device.js';
|
|
4
4
|
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
5
|
import { useT } from '../i18n/use-t.js';
|
|
6
|
+
import { useCloudReach } from './cloud-sign-in-view.js';
|
|
6
7
|
import { Icon } from './icon.js';
|
|
7
8
|
/** How long "connected again" stays. */
|
|
8
9
|
const BACK_MS = 1200;
|
|
@@ -77,8 +78,9 @@ function usePressed() {
|
|
|
77
78
|
* button is seen to do something), when the next is, and how to try now.
|
|
78
79
|
*/
|
|
79
80
|
function useConnectionNotice() {
|
|
81
|
+
var _a;
|
|
80
82
|
const t = useT();
|
|
81
|
-
const [{ offlineShown, error, retryAt, status }, workbench] = useWorkbench();
|
|
83
|
+
const [{ offlineShown, error, retryAt, status, host, hosts }, workbench] = useWorkbench();
|
|
82
84
|
const [{ notDoneAt, outdated }] = useNotices();
|
|
83
85
|
// Something the user did did not happen: no notice over the page, this row says it. Offline, it shows at once.
|
|
84
86
|
const notDone = useRecent(notDoneAt, NOT_DONE_MS);
|
|
@@ -86,9 +88,26 @@ function useConnectionNotice() {
|
|
|
86
88
|
const phase = usePhase(!!offlineShown || (notDone && !online && status !== 'signed-out'), notDone && online);
|
|
87
89
|
const seconds = useSecondsUntil(phase === 'offline' ? retryAt : undefined);
|
|
88
90
|
const [pressed, press] = usePressed();
|
|
89
|
-
|
|
91
|
+
// Ta in the cloud that does not answer: no ta serve to start, but a network to reach (the company's VPN, its build says how).
|
|
92
|
+
const credential = (_a = hosts.find(one => one.id === host)) === null || _a === void 0 ? void 0 : _a.credential;
|
|
93
|
+
const cloud = error === 'unreachable' && credential && 'url' in credential ? credential.url : undefined;
|
|
94
|
+
const reach = useCloudReach(cloud);
|
|
95
|
+
const unreachable = cloud
|
|
96
|
+
? reach
|
|
97
|
+
? t('ta.cloud.reachHint', { reach })
|
|
98
|
+
: t('ta.connection.cloudUnreachable', { host: new URL(cloud).host })
|
|
99
|
+
: t('ta.unreachable');
|
|
100
|
+
const text = error === 'away' ? t('ta.connection.away') : error === 'unreachable' ? unreachable : t('ta.connection.lost');
|
|
90
101
|
// One line, for a phone: what was shown before still shows under it, as a chat app does without network.
|
|
91
|
-
const brief = error === 'away'
|
|
102
|
+
const brief = error === 'away'
|
|
103
|
+
? t('ta.connection.awayBrief')
|
|
104
|
+
: error === 'unreachable'
|
|
105
|
+
? cloud
|
|
106
|
+
? reach
|
|
107
|
+
? unreachable
|
|
108
|
+
: t('ta.connection.cloudUnreachableBrief')
|
|
109
|
+
: t('ta.connection.unreachableBrief')
|
|
110
|
+
: t('ta.connection.lost');
|
|
92
111
|
return {
|
|
93
112
|
phase,
|
|
94
113
|
// Below what the connection says: an outdated page reloads once it can.
|
|
@@ -3,8 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
export type ContextMenuItem = '-' | {
|
|
4
4
|
label: string;
|
|
5
5
|
run(): void;
|
|
6
|
-
disabled?: boolean
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Cannot be undone, as delete: drawn in red. */
|
|
7
8
|
danger?: boolean;
|
|
9
|
+
/** One of a choice: the one chosen is checked on the right. */
|
|
10
|
+
checked?: boolean;
|
|
8
11
|
};
|
|
9
12
|
/** Where a menu was opened: the pointer, and the element it is the menu of (a row), which a finger keeps in sight. */
|
|
10
13
|
export interface MenuOpening {
|
|
@@ -16,6 +19,8 @@ export interface MenuOpening {
|
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
export declare namespace ContextMenuUtil {
|
|
22
|
+
/** A menu of groups of items, a line between them: the empty ones left out, as no line comes first, last or twice. */
|
|
23
|
+
function sections(...groups: readonly Exclude<ContextMenuItem, '-'>[][]): ContextMenuItem[];
|
|
19
24
|
/**
|
|
20
25
|
* Where a menu of `size` goes for a click at `at`: its corner at the pointer, as a browser's. Under a finger,
|
|
21
26
|
* never where the finger covers it: above the finger and the row it pressed (`around`), centred, as the menus
|
|
@@ -58,4 +63,8 @@ export declare namespace ContextMenuUtil {
|
|
|
58
63
|
* elsewhere closes. `open` takes the event of a right click (or of the menu key) and the entries. Opened by a
|
|
59
64
|
* long press, it keeps out from under the finger and the finger may slide onto an entry (ContextMenuUtil.attach).
|
|
60
65
|
*/
|
|
61
|
-
export declare function useContextMenu(): [
|
|
66
|
+
export declare function useContextMenu(): [
|
|
67
|
+
React.ReactNode,
|
|
68
|
+
(event: React.MouseEvent, items: ContextMenuItem[], caption?: string) => void,
|
|
69
|
+
(at: MenuOpening, items: ContextMenuItem[], caption?: string) => void
|
|
70
|
+
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Check } from 'lucide-react';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
import { Back } from '../device/back-stack.js';
|
|
@@ -5,6 +6,11 @@ import { Device, nativePlugin } from '../device/device.js';
|
|
|
5
6
|
import { LongPressUtil } from '../device/long-press.js';
|
|
6
7
|
export var ContextMenuUtil;
|
|
7
8
|
(function (ContextMenuUtil) {
|
|
9
|
+
/** A menu of groups of items, a line between them: the empty ones left out, as no line comes first, last or twice. */
|
|
10
|
+
function sections(...groups) {
|
|
11
|
+
return groups.filter(group => group.length > 0).flatMap((group, index) => (index > 0 ? ['-', ...group] : group));
|
|
12
|
+
}
|
|
13
|
+
ContextMenuUtil.sections = sections;
|
|
8
14
|
/** Between the menu and the edges of the screen. */
|
|
9
15
|
const MARGIN = 4;
|
|
10
16
|
/** How far around the point it touches a fingertip covers the screen. */
|
|
@@ -203,11 +209,13 @@ export function useContextMenu() {
|
|
|
203
209
|
? { x: event.clientX, y: event.clientY, around: { top: box.top, bottom: box.bottom }, items, caption }
|
|
204
210
|
: { x: box.left + 8, y: box.bottom, items, caption });
|
|
205
211
|
}, []);
|
|
212
|
+
// Where an event put it, once what it lists has come (a read of the server after the click).
|
|
213
|
+
const openAt = React.useCallback((at, items, caption) => setMenu({ ...at, items, caption }), []);
|
|
206
214
|
const close = React.useCallback(() => setMenu(undefined), []);
|
|
207
215
|
// On the page, not in what opened it: a row far up of a conversation (content-visibility) or one coming in
|
|
208
216
|
// with a motion contains what is fixed in it, which the menu would be clipped by.
|
|
209
217
|
const element = menu ? createPortal(React.createElement(ContextMenu, { ...menu, onClose: close }), document.body) : null;
|
|
210
|
-
return [element, open];
|
|
218
|
+
return [element, open, openAt];
|
|
211
219
|
}
|
|
212
220
|
function ContextMenu({ x, y, around, items, caption, onClose }) {
|
|
213
221
|
const root = React.useRef(null);
|
|
@@ -252,11 +260,14 @@ function ContextMenu({ x, y, around, items, caption, onClose }) {
|
|
|
252
260
|
const at = buttons.indexOf(document.activeElement);
|
|
253
261
|
(_b = buttons[(at + (event.key === 'ArrowDown' ? 1 : buttons.length - 1)) % buttons.length]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
254
262
|
};
|
|
263
|
+
const choice = items.some(item => item !== '-' && item.checked !== undefined);
|
|
255
264
|
return (React.createElement("div", { ref: root, className: "ta-context-menu", role: "menu", onKeyDown: onKeyDown, onContextMenu: event => event.preventDefault() },
|
|
256
265
|
caption && React.createElement("div", { className: "ta-context-menu-caption" }, caption),
|
|
257
|
-
items.map((item, index) => item === '-' ? (React.createElement("hr", { key: `-${index}`, className: "ta-context-menu-line" })) : (React.createElement("button", { key: item.label, type: "button", role: "menuitem", className: `ta-context-menu-item${item.danger ? ' ta-danger' : ''}`, disabled: item.disabled, onClick: () => {
|
|
266
|
+
items.map((item, index) => item === '-' ? (React.createElement("hr", { key: `-${index}`, className: "ta-context-menu-line" })) : (React.createElement("button", { key: item.label, type: "button", role: "menuitem", "aria-current": item.checked || undefined, className: `ta-context-menu-item${item.danger ? ' ta-danger' : ''}`, disabled: item.disabled, onClick: () => {
|
|
258
267
|
onClose();
|
|
259
268
|
item.run();
|
|
260
|
-
} },
|
|
269
|
+
} },
|
|
270
|
+
item.label,
|
|
271
|
+
choice && React.createElement(Check, { size: 15, className: item.checked ? 'ta-context-menu-check ta-on' : 'ta-context-menu-check', "aria-hidden": "true" }))))));
|
|
261
272
|
}
|
|
262
273
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -78,6 +78,8 @@ export declare class ConversationScroller {
|
|
|
78
78
|
send(message: ScrollRow & Element): void;
|
|
79
79
|
/** Back to the latest (the button that shows away from it): following again at once, the view on its way. */
|
|
80
80
|
toBottom(): void;
|
|
81
|
+
/** Moved at once by Ta's screen tools (app_do scroll), as by the user: up, it stays there; at the bottom, it follows. */
|
|
82
|
+
scrollFor(top: number): void;
|
|
81
83
|
scrolled(): void;
|
|
82
84
|
/** Where there is no `scrollend`: one, once the view stopped moving. */
|
|
83
85
|
private endLater;
|
|
@@ -183,6 +183,20 @@ export class ConversationScroller {
|
|
|
183
183
|
this.endLater();
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
+
/** Moved at once by Ta's screen tools (app_do scroll), as by the user: up, it stays there; at the bottom, it follows. */
|
|
187
|
+
scrollFor(top) {
|
|
188
|
+
var _a;
|
|
189
|
+
this.byUser();
|
|
190
|
+
(_a = this.glider) === null || _a === void 0 ? void 0 : _a.stop();
|
|
191
|
+
if (top >= this.view.scrollHeight - this.view.clientHeight - 1) {
|
|
192
|
+
this.following = true;
|
|
193
|
+
this.toBottomNow();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.following = false;
|
|
197
|
+
this.moveTo(top);
|
|
198
|
+
this.remember();
|
|
199
|
+
}
|
|
186
200
|
scrolled() {
|
|
187
201
|
const { view } = this;
|
|
188
202
|
this.keepAnchor();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type DevicePageOutcome } from '../cloud/device-page.js';
|
|
3
|
+
/**
|
|
4
|
+
* The page of this address where the user lets a device in (TA_DEVICE_SIGN_IN_PATH): which device asks and its code, to
|
|
5
|
+
* check against the one it shows, then this browser's account in one tap, or a way to sign in (the device gets the token,
|
|
6
|
+
* not this browser). How it went, in a line and a mark, once done.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DeviceSignInPage({ code, outcome: given, from }: {
|
|
9
|
+
code: string;
|
|
10
|
+
outcome?: DevicePageOutcome;
|
|
11
|
+
from?: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { TA_SIGN_IN_PATH } from '@celljs/ta-protocol';
|
|
2
|
+
import { CircleCheck, CircleX, Clock, Laptop, Smartphone } from 'lucide-react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { DevicePageUtil } from '../cloud/device-page.js';
|
|
5
|
+
import { useWorkbench } from '../hooks.js';
|
|
6
|
+
import { useT } from '../i18n/use-t.js';
|
|
7
|
+
import { pageHost, WorkbenchUtil } from '../workbench-util.js';
|
|
8
|
+
import { AccessViewUtil } from './access-util.js';
|
|
9
|
+
import { Callout } from './callout.js';
|
|
10
|
+
import { Icon } from './icon.js';
|
|
11
|
+
import { SignInAccountsUtil, useSignInWays } from './sign-in-accounts.js';
|
|
12
|
+
import { SignInMark } from './sign-in-marks.js';
|
|
13
|
+
import { TaAvatar } from './ta-avatar.js';
|
|
14
|
+
import { useDocument } from './workbench-view.js';
|
|
15
|
+
const OUTCOMES = {
|
|
16
|
+
done: { icon: CircleCheck, tone: 'ok', title: 'ta.cloud.device.doneTitle', text: 'ta.cloud.device.done' },
|
|
17
|
+
waiting: { icon: Clock, tone: 'wait', title: 'ta.cloud.device.waitingTitle', text: 'ta.cloud.device.waiting' },
|
|
18
|
+
failed: { icon: CircleX, tone: 'bad', title: 'ta.cloud.device.failedTitle', text: 'ta.cloud.device.failed' },
|
|
19
|
+
ignored: { icon: CircleX, tone: 'quiet', title: 'ta.cloud.device.ignoredTitle', text: 'ta.cloud.device.ignored' },
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The page of this address where the user lets a device in (TA_DEVICE_SIGN_IN_PATH): which device asks and its code, to
|
|
23
|
+
* check against the one it shows, then this browser's account in one tap, or a way to sign in (the device gets the token,
|
|
24
|
+
* not this browser). How it went, in a line and a mark, once done.
|
|
25
|
+
*/
|
|
26
|
+
export function DeviceSignInPage({ code, outcome: given, from }) {
|
|
27
|
+
const t = useT();
|
|
28
|
+
const [{ hosts }] = useWorkbench();
|
|
29
|
+
const { providers } = useSignInWays(!given);
|
|
30
|
+
const [outcome, setOutcome] = React.useState(given);
|
|
31
|
+
const [busy, setBusy] = React.useState(false);
|
|
32
|
+
useDocument();
|
|
33
|
+
const here = hosts.find(host => host.id === WorkbenchUtil.serverOf({ token: '' }, pageHost()));
|
|
34
|
+
const token = here && 'token' in here.credential && !here.credential.url ? here.credential.token : undefined;
|
|
35
|
+
const device = AccessViewUtil.device(from);
|
|
36
|
+
const phone = /iOS|Android/.test(device !== null && device !== void 0 ? device : '');
|
|
37
|
+
const allow = async () => {
|
|
38
|
+
setBusy(true);
|
|
39
|
+
setOutcome((await DevicePageUtil.approve(code, token !== null && token !== void 0 ? token : '')) ? 'done' : 'failed');
|
|
40
|
+
setBusy(false);
|
|
41
|
+
};
|
|
42
|
+
if (outcome) {
|
|
43
|
+
const shown = OUTCOMES[outcome];
|
|
44
|
+
return (React.createElement("div", { className: "ta-signin" },
|
|
45
|
+
React.createElement("div", { className: "ta-card ta-device-card" },
|
|
46
|
+
React.createElement("span", { className: `ta-device-mark ta-device-${shown.tone}` },
|
|
47
|
+
React.createElement(Icon, { icon: shown.icon, size: 40 })),
|
|
48
|
+
React.createElement("h1", null, t(shown.title)),
|
|
49
|
+
React.createElement("p", null, t(shown.text)))));
|
|
50
|
+
}
|
|
51
|
+
const [first, second] = code.split('-');
|
|
52
|
+
return (React.createElement("div", { className: "ta-signin" },
|
|
53
|
+
React.createElement("div", { className: "ta-card ta-device-card" },
|
|
54
|
+
React.createElement(TaAvatar, { size: 72 }),
|
|
55
|
+
React.createElement("h1", null, t('ta.cloud.device.title')),
|
|
56
|
+
React.createElement("div", { className: "ta-device-ask" },
|
|
57
|
+
React.createElement(Icon, { icon: phone ? Smartphone : Laptop, size: 16 }),
|
|
58
|
+
React.createElement("span", null, device ? t('ta.cloud.device.from', { device }) : t('ta.cloud.device.fromAny'))),
|
|
59
|
+
React.createElement("div", { className: "ta-cloud-code", role: "img", "aria-label": code },
|
|
60
|
+
React.createElement("span", null, first),
|
|
61
|
+
React.createElement("span", { className: "ta-cloud-code-dash", "aria-hidden": "true" }),
|
|
62
|
+
React.createElement("span", null, second)),
|
|
63
|
+
React.createElement("p", null, t('ta.cloud.device.hint')),
|
|
64
|
+
React.createElement("div", { className: "ta-sign-in-accounts" },
|
|
65
|
+
token && (React.createElement("button", { type: "button", className: "ta-button ta-primary ta-wide ta-sign-in-account", disabled: busy, onClick: () => void allow() },
|
|
66
|
+
busy && React.createElement("span", { className: "ta-spinner" }),
|
|
67
|
+
t('ta.cloud.device.allow'))),
|
|
68
|
+
providers.map(provider => (React.createElement("a", { key: provider.id, className: `ta-button ta-wide ta-sign-in-account${token ? '' : ' ta-primary'}`, href: `${TA_SIGN_IN_PATH}/${provider.id}?device=${encodeURIComponent(code)}` },
|
|
69
|
+
React.createElement(SignInMark, { provider: provider.id }),
|
|
70
|
+
SignInAccountsUtil.label(provider, t)))),
|
|
71
|
+
(token || providers.length > 0) && (React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => setOutcome('ignored') }, t('ta.cloud.device.notMe')))),
|
|
72
|
+
!token && providers.length === 0 && React.createElement(Callout, { level: "warning" }, t('ta.cloud.device.none')))));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=device-sign-in-page.js.map
|