@celljs/ta-web 4.16.0 → 4.17.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 +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-ask-book.d.ts +35 -0
- package/esm/browser/assistant/assistant-ask-book.js +96 -0
- package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
- package/esm/browser/assistant/assistant-conversation.js +351 -0
- package/esm/browser/assistant/assistant-export.js +6 -7
- package/esm/browser/assistant/assistant-extension.d.ts +3 -2
- package/esm/browser/assistant/assistant-extension.js +57 -4
- package/esm/browser/assistant/assistant-protocol.d.ts +17 -2
- package/esm/browser/assistant/assistant-role.d.ts +22 -4
- package/esm/browser/assistant/assistant-role.js +29 -7
- package/esm/browser/assistant/assistant-state.d.ts +5 -1
- package/esm/browser/assistant/assistant-state.js +11 -0
- package/esm/browser/assistant/assistant-task-source.js +7 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +19 -7
- package/esm/browser/assistant/assistant-task-util.js +73 -20
- package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
- package/esm/browser/assistant/assistant-tasks.js +0 -2
- package/esm/browser/assistant/assistant-thread.d.ts +22 -0
- package/esm/browser/assistant/assistant-thread.js +108 -0
- package/esm/browser/assistant/assistant-view.js +77 -126
- package/esm/browser/assistant/assistant.d.ts +33 -105
- package/esm/browser/assistant/assistant.js +103 -356
- package/esm/browser/assistant/chat-task-source.d.ts +58 -0
- package/esm/browser/assistant/chat-task-source.js +107 -0
- package/esm/browser/assistant/read-aloud.d.ts +34 -0
- package/esm/browser/assistant/read-aloud.js +98 -0
- package/esm/browser/assistant/realtime-voice.d.ts +77 -0
- package/esm/browser/assistant/realtime-voice.js +320 -0
- package/esm/browser/assistant/task-views.d.ts +2 -3
- package/esm/browser/assistant/task-views.js +20 -16
- package/esm/browser/assistant/voice-call-bar.d.ts +60 -0
- package/esm/browser/assistant/voice-call-bar.js +260 -0
- package/esm/browser/assistant/voice-call.d.ts +175 -0
- package/esm/browser/assistant/voice-call.js +366 -0
- package/esm/browser/chat/chat-shown.d.ts +78 -0
- package/esm/browser/chat/chat-shown.js +262 -0
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/chat/chat.d.ts +4 -68
- package/esm/browser/chat/chat.js +5 -253
- package/esm/browser/chat/draft-model.d.ts +1 -1
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +3 -1
- package/esm/browser/components/app-nav.js +7 -7
- package/esm/browser/components/app-shell-hooks.d.ts +11 -2
- package/esm/browser/components/app-shell-hooks.js +25 -4
- package/esm/browser/components/app-shell-state.d.ts +80 -0
- package/esm/browser/components/app-shell-state.js +466 -0
- package/esm/browser/components/app-view.js +121 -333
- package/esm/browser/components/asks-badge.d.ts +6 -2
- package/esm/browser/components/asks-badge.js +7 -3
- package/esm/browser/components/auth-pictures.d.ts +2 -2
- package/esm/browser/components/auth-pictures.js +13 -1
- package/esm/browser/components/auth-view.d.ts +4 -3
- package/esm/browser/components/auth-view.js +54 -5
- package/esm/browser/components/chat-asks.d.ts +2 -0
- package/esm/browser/components/chat-asks.js +8 -0
- package/esm/browser/components/chat-busy.d.ts +32 -0
- package/esm/browser/components/chat-busy.js +49 -0
- package/esm/browser/components/chat-icon.d.ts +6 -0
- package/esm/browser/components/chat-icon.js +17 -1
- package/esm/browser/components/chat-list-row.d.ts +84 -0
- package/esm/browser/components/chat-list-row.js +198 -0
- package/esm/browser/components/chat-list-util.d.ts +166 -0
- package/esm/browser/components/chat-list-util.js +335 -0
- package/esm/browser/components/chat-list.d.ts +9 -148
- package/esm/browser/components/chat-list.js +277 -513
- package/esm/browser/components/chat-seen.js +1 -0
- package/esm/browser/components/composer-addon-util.d.ts +1 -1
- package/esm/browser/components/composer-addons.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +11 -0
- package/esm/browser/components/composer-attachments.js +27 -0
- package/esm/browser/components/composer-box-hooks.d.ts +9 -0
- package/esm/browser/components/composer-box-hooks.js +138 -0
- package/esm/browser/components/composer-box-protocol.d.ts +108 -0
- package/esm/browser/components/composer-box-protocol.js +2 -0
- package/esm/browser/components/composer-box.d.ts +1 -95
- package/esm/browser/components/composer-box.js +49 -156
- package/esm/browser/components/composer-target.d.ts +21 -0
- package/esm/browser/components/composer-target.js +43 -0
- package/esm/browser/components/composer.d.ts +7 -1
- package/esm/browser/components/composer.js +13 -9
- package/esm/browser/components/context-menu.js +4 -0
- package/esm/browser/components/conversation-find.d.ts +27 -0
- package/esm/browser/components/conversation-find.js +151 -0
- package/esm/browser/components/conversation-scroll-hooks.js +2 -1
- package/esm/browser/components/conversation-scroll-util.d.ts +73 -0
- package/esm/browser/components/conversation-scroll-util.js +80 -0
- package/esm/browser/components/conversation-scroll.d.ts +1 -35
- package/esm/browser/components/conversation-scroll.js +2 -81
- package/esm/browser/components/conversation-view.d.ts +8 -0
- package/esm/browser/components/conversation-view.js +41 -0
- package/esm/browser/components/discover-view.d.ts +3 -2
- package/esm/browser/components/discover-view.js +31 -26
- package/esm/browser/components/dismiss.js +2 -0
- package/esm/browser/components/earlier-messages.d.ts +2 -0
- package/esm/browser/components/earlier-messages.js +2 -1
- package/esm/browser/components/folder-picker.d.ts +7 -0
- package/esm/browser/components/folder-picker.js +89 -19
- package/esm/browser/components/gallery.d.ts +1 -1
- package/esm/browser/components/gallery.js +57 -14
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +3 -1
- package/esm/browser/components/image-menu.d.ts +11 -0
- package/esm/browser/components/image-menu.js +29 -0
- package/esm/browser/components/image-viewer.d.ts +3 -2
- package/esm/browser/components/image-viewer.js +29 -4
- package/esm/browser/components/lightbox.js +2 -0
- package/esm/browser/components/link-dialog.js +2 -0
- package/esm/browser/components/list-rows.d.ts +3 -1
- package/esm/browser/components/list-rows.js +2 -1
- package/esm/browser/components/markdown.js +5 -0
- package/esm/browser/components/media.d.ts +2 -0
- package/esm/browser/components/media.js +16 -1
- package/esm/browser/components/message-actions.d.ts +1 -1
- package/esm/browser/components/message-actions.js +9 -0
- package/esm/browser/components/message-footer.d.ts +3 -1
- package/esm/browser/components/message-footer.js +3 -2
- package/esm/browser/components/message-images.d.ts +41 -0
- package/esm/browser/components/message-images.js +120 -0
- package/esm/browser/components/message-list.d.ts +4 -100
- package/esm/browser/components/message-list.js +10 -447
- package/esm/browser/components/message-menu.js +4 -0
- package/esm/browser/components/message-steps.d.ts +21 -0
- package/esm/browser/components/message-steps.js +182 -0
- package/esm/browser/components/message-user.d.ts +54 -0
- package/esm/browser/components/message-user.js +169 -0
- package/esm/browser/components/model-picker.d.ts +1 -1
- package/esm/browser/components/model-picker.js +2 -0
- package/esm/browser/components/moved-notice.d.ts +14 -0
- package/esm/browser/components/moved-notice.js +60 -0
- package/esm/browser/components/nav-places.d.ts +12 -1
- package/esm/browser/components/nav-places.js +10 -2
- package/esm/browser/components/notice-center.js +36 -1
- package/esm/browser/components/notice-face.js +2 -1
- package/esm/browser/components/phone-shell.d.ts +4 -3
- package/esm/browser/components/phone-shell.js +60 -68
- package/esm/browser/components/plus-menu.d.ts +1 -1
- package/esm/browser/components/relay-services.d.ts +6 -1
- package/esm/browser/components/relay-services.js +109 -2
- package/esm/browser/components/relay-view.js +2 -0
- package/esm/browser/components/remote-hosts.d.ts +10 -0
- package/esm/browser/components/remote-hosts.js +7 -6
- package/esm/browser/components/remote-prompts.js +2 -0
- package/esm/browser/components/scan-screen.js +7 -0
- package/esm/browser/components/screen-navigator-util.d.ts +28 -0
- package/esm/browser/components/screen-navigator-util.js +33 -0
- package/esm/browser/components/screen-navigator.d.ts +30 -0
- package/esm/browser/components/screen-navigator.js +47 -0
- package/esm/browser/components/session-settings.d.ts +1 -1
- package/esm/browser/components/session-view.js +157 -7
- package/esm/browser/components/settings-choices.d.ts +6 -0
- package/esm/browser/components/settings-choices.js +8 -0
- package/esm/browser/components/settings-more.d.ts +7 -0
- package/esm/browser/components/settings-more.js +263 -0
- package/esm/browser/components/settings-parts.d.ts +8 -3
- package/esm/browser/components/settings-parts.js +31 -249
- package/esm/browser/components/settings-view.js +43 -15
- package/esm/browser/components/stop-times.js +1 -0
- package/esm/browser/components/surface-flyout.js +2 -0
- package/esm/browser/components/unseen-drop.d.ts +10 -4
- package/esm/browser/components/unseen-drop.js +9 -8
- package/esm/browser/components/use-seen-chats.js +1 -1
- package/esm/browser/components/voice-services.d.ts +6 -0
- package/esm/browser/components/voice-services.js +137 -0
- package/esm/browser/components/voice-talk.d.ts +23 -6
- package/esm/browser/components/voice-talk.js +46 -11
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/components/web-dialog.js +2 -0
- package/esm/browser/device/back-stack.d.ts +89 -11
- package/esm/browser/device/back-stack.js +200 -29
- package/esm/browser/device/device-protocol.d.ts +1 -1
- package/esm/browser/device/device-protocol.js +1 -1
- package/esm/browser/device/own-gestures.d.ts +1 -1
- package/esm/browser/device/pull-down.js +3 -1
- package/esm/browser/device/row-swipe.js +3 -1
- package/esm/browser/device/sheet-swipe.d.ts +1 -179
- package/esm/browser/device/sheet-swipe.js +3 -433
- package/esm/browser/device/swipe-finger.d.ts +31 -0
- package/esm/browser/device/swipe-finger.js +83 -0
- package/esm/browser/device/swipe-settle.d.ts +52 -0
- package/esm/browser/device/swipe-settle.js +170 -0
- package/esm/browser/device/swipe-util.d.ts +97 -0
- package/esm/browser/device/swipe-util.js +183 -0
- package/esm/browser/drafts/drafts-protocol.d.ts +58 -0
- package/esm/browser/drafts/drafts-protocol.js +75 -0
- package/esm/browser/drafts/drafts.d.ts +21 -0
- package/esm/browser/drafts/drafts.js +91 -0
- package/esm/browser/drafts/use-composer-draft.d.ts +20 -0
- package/esm/browser/drafts/use-composer-draft.js +108 -0
- package/esm/browser/extension/icons.js +3 -1
- package/esm/browser/extension/web-api-components.d.ts +13 -0
- package/esm/browser/extension/web-api-contributions.d.ts +125 -0
- package/esm/browser/extension/web-extension-api.d.ts +88 -5
- package/esm/browser/extension/web-extension-context.d.ts +5 -0
- package/esm/browser/extension/web-extension-context.js +60 -7
- package/esm/browser/extension/web-extension-protocol.d.ts +19 -1
- package/esm/browser/extension/web-extension-protocol.js +3 -0
- package/esm/browser/extension/web-extension-run.d.ts +5 -2
- package/esm/browser/extension/web-extension-run.js +13 -1
- package/esm/browser/extension/web-extensions-running.d.ts +93 -0
- package/esm/browser/extension/web-extensions-running.js +339 -0
- package/esm/browser/extension/web-extensions.d.ts +6 -82
- package/esm/browser/extension/web-extensions.js +10 -319
- package/esm/browser/extension/web-pages.js +1 -0
- package/esm/browser/extension/web-session-notices.js +6 -1
- package/esm/browser/extension/web-tasks.d.ts +2 -0
- package/esm/browser/extension/web-tasks.js +6 -0
- package/esm/browser/extension/web-view-util.d.ts +2 -1
- package/esm/browser/extension/web-view-util.js +4 -1
- package/esm/browser/gateway/console-parts.d.ts +1 -11
- package/esm/browser/gateway/console-parts.js +38 -128
- package/esm/browser/gateway/console-tenant.js +2 -1
- package/esm/browser/gateway/console-trend.d.ts +11 -0
- package/esm/browser/gateway/console-trend.js +115 -0
- package/esm/browser/gateway/console-view.js +39 -1
- package/esm/browser/i18n/locales.d.ts +143 -6
- package/esm/browser/i18n/messages-ja.js +144 -7
- package/esm/browser/i18n/messages-zh-tw.js +144 -7
- package/esm/browser/i18n/messages.d.ts +140 -3
- package/esm/browser/i18n/messages.js +288 -14
- package/esm/browser/index.d.ts +17 -0
- package/esm/browser/index.js +17 -0
- package/esm/browser/notices/notices-protocol.d.ts +12 -0
- package/esm/browser/notices/notices.js +7 -4
- package/esm/browser/offline/device-values.d.ts +2 -0
- package/esm/browser/offline/device-values.js +6 -1
- package/esm/browser/screen/page-answers.d.ts +42 -0
- package/esm/browser/screen/page-answers.js +89 -0
- package/esm/browser/screen/screen-protocol.d.ts +112 -0
- package/esm/browser/screen/screen-protocol.js +45 -0
- package/esm/browser/screen/screen.d.ts +20 -0
- package/esm/browser/screen/screen.js +122 -0
- package/esm/browser/screen/use-screen-part.d.ts +6 -0
- package/esm/browser/screen/use-screen-part.js +14 -0
- package/esm/browser/settings/settings-protocol.d.ts +5 -1
- package/esm/browser/settings/settings-protocol.js +6 -2
- package/esm/browser/share/shared-extensions.d.ts +29 -0
- package/esm/browser/share/shared-extensions.js +145 -0
- package/esm/browser/share/shared-link.d.ts +11 -0
- package/esm/browser/share/shared-link.js +38 -0
- package/esm/browser/share/shared-page.d.ts +5 -0
- package/esm/browser/share/shared-page.js +137 -0
- package/esm/browser/state/state-protocol.d.ts +14 -0
- package/esm/browser/state/state-protocol.js +18 -0
- package/esm/browser/state/state.d.ts +10 -2
- package/esm/browser/state/state.js +19 -3
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +4 -0
- package/esm/browser/style/chat-list.d.ts +2 -0
- package/esm/browser/style/chat-list.js +153 -0
- package/esm/browser/style/conversation-column.d.ts +2 -0
- package/esm/browser/style/conversation-column.js +250 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +24 -8
- package/esm/browser/style/dialogs.d.ts +2 -0
- package/esm/browser/style/dialogs.js +163 -0
- package/esm/browser/style/layout.d.ts +2 -2
- package/esm/browser/style/layout.js +1 -525
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +9 -3
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +6 -2
- package/esm/browser/style/shared.d.ts +2 -0
- package/esm/browser/style/shared.js +23 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -0
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +13 -8
- package/esm/browser/style.js +8 -0
- package/esm/browser/util/gallery.d.ts +24 -2
- package/esm/browser/util/gallery.js +82 -2
- package/esm/browser/util/image-copy.d.ts +16 -0
- package/esm/browser/util/image-copy.js +57 -0
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +14 -0
- package/esm/browser/util/process.d.ts +6 -2
- package/esm/browser/util/process.js +6 -2
- package/esm/browser/util/spoken.d.ts +24 -0
- package/esm/browser/util/spoken.js +83 -0
- package/esm/browser/util/transcript.d.ts +22 -0
- package/esm/browser/util/transcript.js +46 -0
- package/esm/browser/util/voice.d.ts +5 -1
- package/esm/browser/util/voice.js +6 -1
- package/esm/browser/workbench-hosts.d.ts +36 -0
- package/esm/browser/workbench-hosts.js +120 -0
- package/esm/browser/workbench-lists.d.ts +33 -0
- package/esm/browser/workbench-lists.js +128 -0
- package/esm/browser/workbench-protocol.d.ts +14 -1
- package/esm/browser/workbench-services.d.ts +49 -0
- package/esm/browser/workbench-services.js +120 -0
- package/esm/browser/workbench-util.d.ts +1 -1
- package/esm/browser/workbench.d.ts +6 -89
- package/esm/browser/workbench.js +26 -336
- package/lib/browser/assistant/assistant-ask-book.d.ts +36 -0
- package/lib/browser/assistant/assistant-ask-book.js +100 -0
- package/lib/browser/assistant/assistant-conversation.d.ts +111 -0
- package/lib/browser/assistant/assistant-conversation.js +355 -0
- package/lib/browser/assistant/assistant-export.js +6 -7
- package/lib/browser/assistant/assistant-extension.d.ts +3 -2
- package/lib/browser/assistant/assistant-extension.js +55 -2
- package/lib/browser/assistant/assistant-protocol.d.ts +17 -2
- package/lib/browser/assistant/assistant-role.d.ts +22 -4
- package/lib/browser/assistant/assistant-role.js +30 -8
- package/lib/browser/assistant/assistant-state.d.ts +5 -1
- package/lib/browser/assistant/assistant-state.js +11 -0
- package/lib/browser/assistant/assistant-task-source.js +7 -1
- package/lib/browser/assistant/assistant-task-util.d.ts +19 -7
- package/lib/browser/assistant/assistant-task-util.js +73 -20
- package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
- package/lib/browser/assistant/assistant-tasks.js +1 -3
- package/lib/browser/assistant/assistant-thread.d.ts +23 -0
- package/lib/browser/assistant/assistant-thread.js +144 -0
- package/lib/browser/assistant/assistant-view.js +74 -123
- package/lib/browser/assistant/assistant.d.ts +33 -105
- package/lib/browser/assistant/assistant.js +100 -353
- package/lib/browser/assistant/chat-task-source.d.ts +59 -0
- package/lib/browser/assistant/chat-task-source.js +111 -0
- package/lib/browser/assistant/read-aloud.d.ts +35 -0
- package/lib/browser/assistant/read-aloud.js +102 -0
- package/lib/browser/assistant/realtime-voice.d.ts +78 -0
- package/lib/browser/assistant/realtime-voice.js +324 -0
- package/lib/browser/assistant/task-views.d.ts +2 -3
- package/lib/browser/assistant/task-views.js +19 -15
- package/lib/browser/assistant/voice-call-bar.d.ts +61 -0
- package/lib/browser/assistant/voice-call-bar.js +306 -0
- package/lib/browser/assistant/voice-call.d.ts +176 -0
- package/lib/browser/assistant/voice-call.js +370 -0
- package/lib/browser/chat/chat-shown.d.ts +79 -0
- package/lib/browser/chat/chat-shown.js +266 -0
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/chat/chat.d.ts +4 -68
- package/lib/browser/chat/chat.js +3 -251
- package/lib/browser/chat/draft-model.d.ts +1 -1
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +1 -1
- package/lib/browser/components/app-nav.d.ts +3 -1
- package/lib/browser/components/app-nav.js +7 -7
- package/lib/browser/components/app-shell-hooks.d.ts +11 -2
- package/lib/browser/components/app-shell-hooks.js +26 -5
- package/lib/browser/components/app-shell-state.d.ts +81 -0
- package/lib/browser/components/app-shell-state.js +502 -0
- package/lib/browser/components/app-view.js +114 -326
- package/lib/browser/components/asks-badge.d.ts +6 -2
- package/lib/browser/components/asks-badge.js +7 -3
- package/lib/browser/components/auth-pictures.d.ts +2 -2
- package/lib/browser/components/auth-pictures.js +13 -1
- package/lib/browser/components/auth-view.d.ts +4 -3
- package/lib/browser/components/auth-view.js +53 -4
- package/lib/browser/components/chat-asks.d.ts +2 -0
- package/lib/browser/components/chat-asks.js +8 -0
- package/lib/browser/components/chat-busy.d.ts +33 -0
- package/lib/browser/components/chat-busy.js +52 -0
- package/lib/browser/components/chat-icon.d.ts +6 -0
- package/lib/browser/components/chat-icon.js +17 -1
- package/lib/browser/components/chat-list-row.d.ts +85 -0
- package/lib/browser/components/chat-list-row.js +236 -0
- package/lib/browser/components/chat-list-util.d.ts +167 -0
- package/lib/browser/components/chat-list-util.js +338 -0
- package/lib/browser/components/chat-list.d.ts +9 -148
- package/lib/browser/components/chat-list.js +294 -532
- package/lib/browser/components/chat-seen.js +1 -0
- package/lib/browser/components/composer-addon-util.d.ts +1 -1
- package/lib/browser/components/composer-addons.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +12 -0
- package/lib/browser/components/composer-attachments.js +64 -0
- package/lib/browser/components/composer-box-hooks.d.ts +10 -0
- package/lib/browser/components/composer-box-hooks.js +178 -0
- package/lib/browser/components/composer-box-protocol.d.ts +109 -0
- package/lib/browser/components/composer-box-protocol.js +3 -0
- package/lib/browser/components/composer-box.d.ts +1 -95
- package/lib/browser/components/composer-box.js +51 -159
- package/lib/browser/components/composer-target.d.ts +22 -0
- package/lib/browser/components/composer-target.js +46 -0
- package/lib/browser/components/composer.d.ts +7 -1
- package/lib/browser/components/composer.js +15 -11
- package/lib/browser/components/context-menu.js +4 -0
- package/lib/browser/components/conversation-find.d.ts +28 -0
- package/lib/browser/components/conversation-find.js +188 -0
- package/lib/browser/components/conversation-scroll-hooks.js +3 -2
- package/lib/browser/components/conversation-scroll-util.d.ts +73 -0
- package/lib/browser/components/conversation-scroll-util.js +85 -1
- package/lib/browser/components/conversation-scroll.d.ts +1 -35
- package/lib/browser/components/conversation-scroll.js +20 -100
- package/lib/browser/components/conversation-view.d.ts +9 -0
- package/lib/browser/components/conversation-view.js +77 -0
- package/lib/browser/components/discover-view.d.ts +3 -2
- package/lib/browser/components/discover-view.js +30 -25
- package/lib/browser/components/dismiss.js +2 -0
- package/lib/browser/components/earlier-messages.d.ts +2 -0
- package/lib/browser/components/earlier-messages.js +2 -1
- package/lib/browser/components/folder-picker.d.ts +7 -0
- package/lib/browser/components/folder-picker.js +88 -18
- package/lib/browser/components/gallery.d.ts +1 -1
- package/lib/browser/components/gallery.js +56 -13
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +4 -2
- package/lib/browser/components/image-menu.d.ts +12 -0
- package/lib/browser/components/image-menu.js +65 -0
- package/lib/browser/components/image-viewer.d.ts +3 -2
- package/lib/browser/components/image-viewer.js +28 -3
- package/lib/browser/components/lightbox.js +2 -0
- package/lib/browser/components/link-dialog.js +2 -0
- package/lib/browser/components/list-rows.d.ts +3 -1
- package/lib/browser/components/list-rows.js +2 -1
- package/lib/browser/components/markdown.js +5 -0
- package/lib/browser/components/media.d.ts +2 -0
- package/lib/browser/components/media.js +17 -1
- package/lib/browser/components/message-actions.d.ts +1 -1
- package/lib/browser/components/message-actions.js +9 -0
- package/lib/browser/components/message-footer.d.ts +3 -1
- package/lib/browser/components/message-footer.js +2 -1
- package/lib/browser/components/message-images.d.ts +42 -0
- package/lib/browser/components/message-images.js +157 -0
- package/lib/browser/components/message-list.d.ts +4 -100
- package/lib/browser/components/message-list.js +11 -455
- package/lib/browser/components/message-menu.js +4 -0
- package/lib/browser/components/message-steps.d.ts +22 -0
- package/lib/browser/components/message-steps.js +218 -0
- package/lib/browser/components/message-user.d.ts +55 -0
- package/lib/browser/components/message-user.js +211 -0
- package/lib/browser/components/model-picker.d.ts +1 -1
- package/lib/browser/components/model-picker.js +2 -0
- package/lib/browser/components/moved-notice.d.ts +15 -0
- package/lib/browser/components/moved-notice.js +96 -0
- package/lib/browser/components/nav-places.d.ts +12 -1
- package/lib/browser/components/nav-places.js +12 -3
- package/lib/browser/components/notice-center.js +35 -0
- package/lib/browser/components/notice-face.js +7 -6
- package/lib/browser/components/phone-shell.d.ts +4 -3
- package/lib/browser/components/phone-shell.js +59 -67
- package/lib/browser/components/plus-menu.d.ts +1 -1
- package/lib/browser/components/relay-services.d.ts +6 -1
- package/lib/browser/components/relay-services.js +107 -0
- package/lib/browser/components/relay-view.js +2 -0
- package/lib/browser/components/remote-hosts.d.ts +10 -0
- package/lib/browser/components/remote-hosts.js +8 -6
- package/lib/browser/components/remote-prompts.js +2 -0
- package/lib/browser/components/scan-screen.js +7 -0
- package/lib/browser/components/screen-navigator-util.d.ts +29 -0
- package/lib/browser/components/screen-navigator-util.js +36 -0
- package/lib/browser/components/screen-navigator.d.ts +31 -0
- package/lib/browser/components/screen-navigator.js +83 -0
- package/lib/browser/components/session-settings.d.ts +1 -1
- package/lib/browser/components/session-view.js +157 -7
- package/lib/browser/components/settings-choices.d.ts +7 -1
- package/lib/browser/components/settings-choices.js +9 -1
- package/lib/browser/components/settings-more.d.ts +8 -0
- package/lib/browser/components/settings-more.js +299 -0
- package/lib/browser/components/settings-parts.d.ts +8 -3
- package/lib/browser/components/settings-parts.js +27 -245
- package/lib/browser/components/settings-view.js +43 -15
- package/lib/browser/components/stop-times.js +1 -0
- package/lib/browser/components/surface-flyout.js +2 -0
- package/lib/browser/components/unseen-drop.d.ts +10 -4
- package/lib/browser/components/unseen-drop.js +9 -8
- package/lib/browser/components/use-seen-chats.js +2 -2
- package/lib/browser/components/voice-services.d.ts +7 -0
- package/lib/browser/components/voice-services.js +173 -0
- package/lib/browser/components/voice-talk.d.ts +23 -6
- package/lib/browser/components/voice-talk.js +45 -10
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/components/web-dialog.js +2 -0
- package/lib/browser/device/back-stack.d.ts +89 -11
- package/lib/browser/device/back-stack.js +205 -31
- package/lib/browser/device/device-protocol.d.ts +1 -1
- package/lib/browser/device/device-protocol.js +1 -1
- package/lib/browser/device/own-gestures.d.ts +1 -1
- package/lib/browser/device/pull-down.js +8 -6
- package/lib/browser/device/row-swipe.js +11 -9
- package/lib/browser/device/sheet-swipe.d.ts +1 -179
- package/lib/browser/device/sheet-swipe.js +16 -452
- package/lib/browser/device/swipe-finger.d.ts +32 -0
- package/lib/browser/device/swipe-finger.js +87 -0
- package/lib/browser/device/swipe-settle.d.ts +53 -0
- package/lib/browser/device/swipe-settle.js +176 -0
- package/lib/browser/device/swipe-util.d.ts +98 -0
- package/lib/browser/device/swipe-util.js +187 -0
- package/lib/browser/drafts/drafts-protocol.d.ts +59 -0
- package/lib/browser/drafts/drafts-protocol.js +78 -0
- package/lib/browser/drafts/drafts.d.ts +22 -0
- package/lib/browser/drafts/drafts.js +94 -0
- package/lib/browser/drafts/use-composer-draft.d.ts +21 -0
- package/lib/browser/drafts/use-composer-draft.js +146 -0
- package/lib/browser/extension/icons.js +2 -0
- package/lib/browser/extension/web-api-components.d.ts +13 -0
- package/lib/browser/extension/web-api-contributions.d.ts +125 -0
- package/lib/browser/extension/web-extension-api.d.ts +88 -5
- package/lib/browser/extension/web-extension-context.d.ts +5 -0
- package/lib/browser/extension/web-extension-context.js +62 -9
- package/lib/browser/extension/web-extension-protocol.d.ts +19 -1
- package/lib/browser/extension/web-extension-protocol.js +3 -0
- package/lib/browser/extension/web-extension-run.d.ts +5 -2
- package/lib/browser/extension/web-extension-run.js +13 -1
- package/lib/browser/extension/web-extensions-running.d.ts +94 -0
- package/lib/browser/extension/web-extensions-running.js +343 -0
- package/lib/browser/extension/web-extensions.d.ts +6 -82
- package/lib/browser/extension/web-extensions.js +7 -316
- package/lib/browser/extension/web-pages.js +1 -0
- package/lib/browser/extension/web-session-notices.js +8 -3
- package/lib/browser/extension/web-tasks.d.ts +2 -0
- package/lib/browser/extension/web-tasks.js +6 -0
- package/lib/browser/extension/web-view-util.d.ts +2 -1
- package/lib/browser/extension/web-view-util.js +4 -1
- package/lib/browser/gateway/console-parts.d.ts +1 -11
- package/lib/browser/gateway/console-parts.js +38 -129
- package/lib/browser/gateway/console-tenant.js +2 -1
- package/lib/browser/gateway/console-trend.d.ts +12 -0
- package/lib/browser/gateway/console-trend.js +151 -0
- package/lib/browser/gateway/console-view.js +39 -1
- package/lib/browser/i18n/locales.d.ts +143 -6
- package/lib/browser/i18n/messages-ja.js +144 -7
- package/lib/browser/i18n/messages-zh-tw.js +144 -7
- package/lib/browser/i18n/messages.d.ts +140 -3
- package/lib/browser/i18n/messages.js +288 -14
- package/lib/browser/index.d.ts +17 -0
- package/lib/browser/index.js +17 -0
- package/lib/browser/notices/notices-protocol.d.ts +12 -0
- package/lib/browser/notices/notices.js +7 -4
- package/lib/browser/offline/device-values.d.ts +2 -0
- package/lib/browser/offline/device-values.js +6 -1
- package/lib/browser/screen/page-answers.d.ts +43 -0
- package/lib/browser/screen/page-answers.js +93 -0
- package/lib/browser/screen/screen-protocol.d.ts +113 -0
- package/lib/browser/screen/screen-protocol.js +48 -0
- package/lib/browser/screen/screen.d.ts +21 -0
- package/lib/browser/screen/screen.js +125 -0
- package/lib/browser/screen/use-screen-part.d.ts +7 -0
- package/lib/browser/screen/use-screen-part.js +50 -0
- package/lib/browser/settings/settings-protocol.d.ts +5 -1
- package/lib/browser/settings/settings-protocol.js +5 -1
- package/lib/browser/share/shared-extensions.d.ts +30 -0
- package/lib/browser/share/shared-extensions.js +181 -0
- package/lib/browser/share/shared-link.d.ts +12 -0
- package/lib/browser/share/shared-link.js +41 -0
- package/lib/browser/share/shared-page.d.ts +6 -0
- package/lib/browser/share/shared-page.js +173 -0
- package/lib/browser/state/state-protocol.d.ts +14 -0
- package/lib/browser/state/state-protocol.js +20 -1
- package/lib/browser/state/state.d.ts +10 -2
- package/lib/browser/state/state.js +18 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +4 -0
- package/lib/browser/style/chat-list.d.ts +3 -0
- package/lib/browser/style/chat-list.js +156 -0
- package/lib/browser/style/conversation-column.d.ts +3 -0
- package/lib/browser/style/conversation-column.js +253 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +24 -8
- package/lib/browser/style/dialogs.d.ts +3 -0
- package/lib/browser/style/dialogs.js +166 -0
- package/lib/browser/style/layout.d.ts +2 -2
- package/lib/browser/style/layout.js +1 -525
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +9 -3
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +7 -3
- package/lib/browser/style/shared.d.ts +3 -0
- package/lib/browser/style/shared.js +26 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -0
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +13 -8
- package/lib/browser/style.js +8 -0
- package/lib/browser/util/gallery.d.ts +24 -2
- package/lib/browser/util/gallery.js +82 -2
- package/lib/browser/util/image-copy.d.ts +17 -0
- package/lib/browser/util/image-copy.js +60 -0
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +14 -0
- package/lib/browser/util/process.d.ts +6 -2
- package/lib/browser/util/process.js +6 -2
- package/lib/browser/util/spoken.d.ts +25 -0
- package/lib/browser/util/spoken.js +86 -0
- package/lib/browser/util/transcript.d.ts +23 -0
- package/lib/browser/util/transcript.js +49 -0
- package/lib/browser/util/voice.d.ts +5 -1
- package/lib/browser/util/voice.js +6 -1
- package/lib/browser/workbench-hosts.d.ts +37 -0
- package/lib/browser/workbench-hosts.js +124 -0
- package/lib/browser/workbench-lists.d.ts +34 -0
- package/lib/browser/workbench-lists.js +132 -0
- package/lib/browser/workbench-protocol.d.ts +14 -1
- package/lib/browser/workbench-services.d.ts +50 -0
- package/lib/browser/workbench-services.js +124 -0
- package/lib/browser/workbench-util.d.ts +1 -1
- package/lib/browser/workbench.d.ts +6 -89
- package/lib/browser/workbench.js +23 -333
- package/package.json +7 -7
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { useInject } from '@celljs/react';
|
|
2
|
+
import { TA_PAGE_CONFIRM } from '@celljs/ta-protocol';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useSeenConversations } from '../assistant/assistant-chat-list.js';
|
|
5
|
+
import { REMOVED_CHATS } from '../chat/chat-protocol.js';
|
|
6
|
+
import { useChat } from '../chat/chat-view.js';
|
|
7
|
+
import { useBackLayer, useNoBackLayer } from '../device/back-stack.js';
|
|
8
|
+
import { useDevice } from '../device/device.js';
|
|
9
|
+
import { TaFiles } from '../files/files-protocol.js';
|
|
10
|
+
import { useCodeScan, useNotices, useOpenLink, usePersisted, useSettings, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
11
|
+
import { useT } from '../i18n/use-t.js';
|
|
12
|
+
import { TaState } from '../state/state-protocol.js';
|
|
13
|
+
import { ThumbnailUtil } from '../util/thumbnail.js';
|
|
14
|
+
import { useNavigation } from './app-nav.js';
|
|
15
|
+
import { CARDS_ID, EDITOR, FIRST_SIDE, SETTINGS_SHOWN, SIDE, SIDEBAR, TAB_PAGE, useDrawerSwipe, useKeys, useRefresh, useRight, useTitlebarColor, useWorkbenchCards, WORKBENCH_MAX, } from './app-shell-hooks.js';
|
|
16
|
+
import { useSurfaces } from './board.js';
|
|
17
|
+
import { LET_GO_ASKS } from './chat-asks.js';
|
|
18
|
+
import { BY_DIRECTORY, FOLDED, PINNED } from './chat-list-util.js';
|
|
19
|
+
import { DOUBLE_PAGE, SideListUtil } from './side-lists.js';
|
|
20
|
+
import { usePane } from './split-pane.js';
|
|
21
|
+
import { usePageVisible } from './use-seen-chats.js';
|
|
22
|
+
import { useDocument } from './workbench-view.js';
|
|
23
|
+
/** What AppShell shows and does: its state, what follows it, and the ways it changes. */
|
|
24
|
+
export function useAppShell() {
|
|
25
|
+
var _a;
|
|
26
|
+
const t = useT();
|
|
27
|
+
const [workbench, bench] = useWorkbench();
|
|
28
|
+
const [extensions, host] = useWebExtensions();
|
|
29
|
+
const [{ store, pending }, chat] = useChat();
|
|
30
|
+
const [sideId, setSideId] = usePersisted(SIDE);
|
|
31
|
+
const [removedChats] = usePersisted(REMOVED_CHATS);
|
|
32
|
+
const [chatsByDirectory, setChatsByDirectory] = usePersisted(BY_DIRECTORY);
|
|
33
|
+
const [foldedChats, setFoldedChats] = usePersisted(FOLDED);
|
|
34
|
+
const [pinnedChats, setPinnedChats] = usePersisted(PINNED);
|
|
35
|
+
const [letGoAsks, setLetGoAsks] = usePersisted(LET_GO_ASKS);
|
|
36
|
+
const [navOpen, setNavOpen] = React.useState(false);
|
|
37
|
+
const layout = useDevice(device => device.layout);
|
|
38
|
+
const touch = useDevice(device => device.touch);
|
|
39
|
+
// A phone: tabs at the bottom, and the conversation or a page over them, a screen of its own (phone-shell.tsx).
|
|
40
|
+
const phone = useDevice(device => device.handheld);
|
|
41
|
+
const [screenOpen, setScreenOpen] = React.useState(false);
|
|
42
|
+
// The launcher or the board, over the first tab of a phone or in a flyout of the rail (ta-launcher.md).
|
|
43
|
+
const [surface, setSurface] = React.useState();
|
|
44
|
+
const closing = React.useRef(undefined);
|
|
45
|
+
const surfaces = useSurfaces();
|
|
46
|
+
/**
|
|
47
|
+
* The settings view is shown in place of the conversation or the page, at that section (`''`: the first); on a
|
|
48
|
+
* phone it is a screen over Me, which stays while it slides away, until another screen takes its place.
|
|
49
|
+
*/
|
|
50
|
+
const [settings, setSettings] = usePersisted(SETTINGS_SHOWN);
|
|
51
|
+
// Each opening of the settings on a phone starts afresh: no search or section left from the last.
|
|
52
|
+
const [settingsOpened, setSettingsOpened] = React.useState(0);
|
|
53
|
+
const [tabPage, setTabPage] = usePersisted(TAB_PAGE);
|
|
54
|
+
// It opens on its first tab, as those apps do, whatever this tab of the browser showed before.
|
|
55
|
+
const opened = React.useRef(false);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (phone && !opened.current) {
|
|
58
|
+
opened.current = true;
|
|
59
|
+
setSideId(FIRST_SIDE);
|
|
60
|
+
setSettings(undefined);
|
|
61
|
+
setTabPage(undefined);
|
|
62
|
+
host.showPage('');
|
|
63
|
+
}
|
|
64
|
+
}, [phone, setSideId, setSettings, setTabPage, host]);
|
|
65
|
+
const openSettings = React.useCallback((section) => {
|
|
66
|
+
setSettings(section !== null && section !== void 0 ? section : '');
|
|
67
|
+
setSettingsOpened(count => count + 1);
|
|
68
|
+
setNavOpen(false);
|
|
69
|
+
setScreenOpen(phone);
|
|
70
|
+
}, [phone, setSettings]);
|
|
71
|
+
const closeSettings = React.useCallback(() => (phone ? setScreenOpen(false) : setSettings(undefined)), [phone, setSettings]);
|
|
72
|
+
const settingsShown = settings !== undefined && (!phone || screenOpen);
|
|
73
|
+
const [rightOpen, toggleRight, revealRight, uncoverRight] = useRight();
|
|
74
|
+
const [maximized, setMaximized] = usePersisted(WORKBENCH_MAX);
|
|
75
|
+
const [{ theme, language, settings: chatSettings }] = useSettings();
|
|
76
|
+
const readArchived = React.useCallback(() => void bench.readArchived().catch(() => undefined), [bench]);
|
|
77
|
+
React.useEffect(() => bench.setArchiveDays(chatSettings.chatArchiveDays), [bench, chatSettings.chatArchiveDays]);
|
|
78
|
+
const sidebar = usePane(SIDEBAR);
|
|
79
|
+
const editor = usePane(EDITOR);
|
|
80
|
+
const online = workbench.status === 'online';
|
|
81
|
+
// Files named in replies outside a conversation (channels, pages) are in the server's directory.
|
|
82
|
+
const files = useInject(TaFiles);
|
|
83
|
+
const fileUrl = React.useCallback(async (path, box) => files.loadable(ThumbnailUtil.boxed(await bench.workspace.fileUrl(path), box)), [bench, files]);
|
|
84
|
+
const openLink = useOpenLink(undefined);
|
|
85
|
+
useDocument();
|
|
86
|
+
useRefresh(online);
|
|
87
|
+
// What the server and its packages say (errors, questions) is in the language of the page.
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (online) {
|
|
90
|
+
bench.settings.setLanguage(language).catch(() => undefined);
|
|
91
|
+
}
|
|
92
|
+
}, [online, language, bench]);
|
|
93
|
+
React.useEffect(() => {
|
|
94
|
+
void bench.start();
|
|
95
|
+
}, [bench]);
|
|
96
|
+
// The computer cannot be reached from the start: the web extensions of the last time start anyway (from
|
|
97
|
+
// the code this device kept) and show what they read last; online, `chat.start` loads them.
|
|
98
|
+
const offline = workbench.status === 'offline';
|
|
99
|
+
const startedOffline = React.useRef(false);
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
if (offline && !startedOffline.current) {
|
|
102
|
+
startedOffline.current = true;
|
|
103
|
+
void host.refresh().catch(() => undefined);
|
|
104
|
+
}
|
|
105
|
+
}, [offline, host]);
|
|
106
|
+
/** The conversation the page opens with is shown: those shown after are the user's doing. */
|
|
107
|
+
const started = React.useRef(false);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
if (online) {
|
|
110
|
+
void chat.start().then(() => {
|
|
111
|
+
started.current = true;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}, [online, chat]);
|
|
115
|
+
// A tab a web extension opens is meant to be seen, unless it opens again behind the others as the page loads.
|
|
116
|
+
const { activeEditor, focus } = extensions;
|
|
117
|
+
const revealEditor = editor.reveal;
|
|
118
|
+
React.useEffect(() => {
|
|
119
|
+
if (focus > 0) {
|
|
120
|
+
revealRight();
|
|
121
|
+
revealEditor();
|
|
122
|
+
// Opened from the launcher or the board: the workbench comes in their place.
|
|
123
|
+
setSurface(undefined);
|
|
124
|
+
}
|
|
125
|
+
}, [focus, revealRight, revealEditor]);
|
|
126
|
+
React.useEffect(() => {
|
|
127
|
+
host.setSettingsOpener(openSettings);
|
|
128
|
+
return () => host.setSettingsOpener(undefined);
|
|
129
|
+
}, [host, openSettings]);
|
|
130
|
+
// A web extension shows another conversation: the conversation, not a page, a drawer or the workbench over it, is then in front.
|
|
131
|
+
React.useEffect(() => {
|
|
132
|
+
host.setSessionSwitcher(async (session, opening) => {
|
|
133
|
+
// In front at once, while it opens.
|
|
134
|
+
const shown = typeof session === 'object' && 'sessionFile' in session ? chat.resume(session.sessionFile) : chat.show(session, opening);
|
|
135
|
+
setNavOpen(false);
|
|
136
|
+
setSurface(undefined);
|
|
137
|
+
setSettings(undefined);
|
|
138
|
+
setScreenOpen(true);
|
|
139
|
+
setMaximized(false);
|
|
140
|
+
uncoverRight();
|
|
141
|
+
try {
|
|
142
|
+
await shown;
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
// A phone goes back to the list it came from, rather than showing the conversation of before.
|
|
146
|
+
if (phone && chat.state.pending === undefined) {
|
|
147
|
+
setScreenOpen(false);
|
|
148
|
+
}
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return () => host.setSessionSwitcher(undefined);
|
|
153
|
+
}, [host, chat, uncoverRight, phone, setSettings, setMaximized]);
|
|
154
|
+
// A page shown from the sidebar on a phone: the drawer goes; so do the settings, for the page or the conversation shown.
|
|
155
|
+
const { page } = extensions;
|
|
156
|
+
const shownSession = store === null || store === void 0 ? void 0 : store.sessionId;
|
|
157
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows the page
|
|
158
|
+
React.useEffect(() => setNavOpen(false), [page]);
|
|
159
|
+
// What the main area showed as the page opened (kept for this tab: the settings, Discover) stays over the
|
|
160
|
+
// conversation it opens with; another page or conversation shown after takes their place.
|
|
161
|
+
const mainShown = React.useRef({ page, shownSession });
|
|
162
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows what the main area shows
|
|
163
|
+
React.useEffect(() => {
|
|
164
|
+
const before = mainShown.current;
|
|
165
|
+
mainShown.current = { page, shownSession };
|
|
166
|
+
if (before.page === page && (before.shownSession === shownSession || before.shownSession === undefined)) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
setSettings(undefined);
|
|
170
|
+
// A phone keeps the tab under what came over it.
|
|
171
|
+
if (!phone) {
|
|
172
|
+
setTabPage(undefined);
|
|
173
|
+
}
|
|
174
|
+
}, [page, shownSession]);
|
|
175
|
+
// Another conversation shown that no sidebar view lists (not that of an agent, which is in a group), by a page,
|
|
176
|
+
// a link or a fork: the sidebar turns to the chats, where it is selected, to be found again. Not the one the page opens with,
|
|
177
|
+
// nor one the list does not have yet: it may be an agent's.
|
|
178
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows the conversation shown
|
|
179
|
+
React.useEffect(() => {
|
|
180
|
+
if (!shownSession || !started.current || phone) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const info = workbench.sessions.find(session => session.sessionId === shownSession);
|
|
184
|
+
if (info && !info.group) {
|
|
185
|
+
setSideId('');
|
|
186
|
+
}
|
|
187
|
+
}, [shownSession]);
|
|
188
|
+
const { hasCards, openCards, cardsTool } = useWorkbenchCards(rightOpen && !editor.collapsed);
|
|
189
|
+
const view = extensions.views.find(candidate => candidate.id === page && candidate.location === 'page');
|
|
190
|
+
const sideViews = SideListUtil.sidebarViews(extensions.views);
|
|
191
|
+
const sideView = sideId === FIRST_SIDE ? sideViews[0] : sideViews.find(candidate => candidate.id === sideId);
|
|
192
|
+
// The first start, nothing kept: the double's list may still come, rather than the chats shown a moment before it.
|
|
193
|
+
const sideComing = sideId === FIRST_SIDE && !sideView && !extensions.loaded;
|
|
194
|
+
const side = sideView ? sideView.id : sideComing ? FIRST_SIDE : '';
|
|
195
|
+
const showPage = (id) => {
|
|
196
|
+
host.showPage(id);
|
|
197
|
+
setNavOpen(false);
|
|
198
|
+
setSettings(undefined);
|
|
199
|
+
setTabPage(undefined);
|
|
200
|
+
};
|
|
201
|
+
const lists = SideListUtil.of(sideViews, t('ta.chat'));
|
|
202
|
+
const tools = [...(hasCards ? [cardsTool] : []), ...extensions.views.filter(candidate => candidate.location === 'panel')];
|
|
203
|
+
const openTool = (id) => (id === CARDS_ID ? openCards() : host.openView(id));
|
|
204
|
+
// The workbench: the tabs open, or the tools that open there.
|
|
205
|
+
const editors = extensions.editors.length > 0 || tools.length > 0;
|
|
206
|
+
// The settings take the place of the conversation and of the workbench, as a page of their own.
|
|
207
|
+
const showEditors = rightOpen && editors && !editor.collapsed && !settingsShown;
|
|
208
|
+
// Over the conversation of a narrow screen, closing the last tab goes back to the conversation.
|
|
209
|
+
const tabCount = extensions.editors.length;
|
|
210
|
+
const tabsBefore = React.useRef(tabCount);
|
|
211
|
+
React.useEffect(() => {
|
|
212
|
+
if (tabsBefore.current > 0 && tabCount === 0 && showEditors && layout !== 'expanded') {
|
|
213
|
+
toggleRight();
|
|
214
|
+
}
|
|
215
|
+
tabsBefore.current = tabCount;
|
|
216
|
+
}, [tabCount, showEditors, toggleRight, layout]);
|
|
217
|
+
// The drawer of a narrow screen and the workbench over the conversation are layers of the back too (BackLayers),
|
|
218
|
+
// as the conversation and the workbench of a phone are (PhoneShell).
|
|
219
|
+
const drawerLayer = useBackLayer(layout === 'compact' && !phone && navOpen, () => setNavOpen(false));
|
|
220
|
+
useBackLayer(!phone && layout !== 'expanded' && showEditors, toggleRight);
|
|
221
|
+
const bare = useNoBackLayer();
|
|
222
|
+
useDrawerSwipe(touch && layout === 'compact' && !phone && !showEditors && (navOpen ? drawerLayer.top : bare), navOpen, setNavOpen);
|
|
223
|
+
// The pages of the rail: in the navigation, or under Discover.
|
|
224
|
+
const navigation = useNavigation(extensions.views);
|
|
225
|
+
const codeScan = useCodeScan();
|
|
226
|
+
const [, notices] = useNotices();
|
|
227
|
+
// Without a sidebar view that lists the double, its page is the first tab: it opens there, once the views are in.
|
|
228
|
+
const homeOpened = React.useRef(false);
|
|
229
|
+
const homeId = phone && extensions.views.length > 0 ? (_a = navigation.home) === null || _a === void 0 ? void 0 : _a.id : undefined;
|
|
230
|
+
React.useEffect(() => {
|
|
231
|
+
if (homeId && !homeOpened.current) {
|
|
232
|
+
homeOpened.current = true;
|
|
233
|
+
if (!host.state.page) {
|
|
234
|
+
host.showPage(homeId);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, [homeId, host]);
|
|
238
|
+
// A page of an extension started on open that Discover lists: shown as those of Discover are.
|
|
239
|
+
const discoveredOnOpen = !!(view === null || view === void 0 ? void 0 : view.onOpen) && navigation.onOpen.some(entry => entry.state === 'shown');
|
|
240
|
+
const railView = view && (view === navigation.home || navigation.pages.includes(view) || discoveredOnOpen) ? view : undefined;
|
|
241
|
+
// On a phone a page of a list (a channel, the double) or of Discover comes in front of the tabs; one of the navigation is a tab.
|
|
242
|
+
const tabView = view && (view === navigation.home || navigation.nav.includes(view)) ? view : undefined;
|
|
243
|
+
// A page of the screen, and those in the background beside it, kept as they were.
|
|
244
|
+
const screenPage = settings === undefined && view && !tabView ? view : undefined;
|
|
245
|
+
// The conversation in front, where the tools of the workbench follow its directory; else they are in the default one.
|
|
246
|
+
const conversationShown = phone ? screenOpen && settings === undefined && !screenPage : settings === undefined && tabPage !== 'discover' && !view;
|
|
247
|
+
React.useEffect(() => host.setConversationShown(conversationShown), [host, conversationShown]);
|
|
248
|
+
// What the user has seen is kept here, whichever list or tab is out: one read from the agents' list is seen too.
|
|
249
|
+
const { seen: seenChats, looking } = useSeenConversations(workbench.sessions, conversationShown ? store === null || store === void 0 ? void 0 : store.sessionId : undefined, (view === null || view === void 0 ? void 0 : view.id) === DOUBLE_PAGE && settings === undefined && (!phone || screenOpen || view === tabView));
|
|
250
|
+
// The others in the same Ta see who looks at a conversation with them (TaSessionInfo.people), while the page is seen.
|
|
251
|
+
const pageVisible = usePageVisible();
|
|
252
|
+
React.useEffect(() => bench.presence.look(pageVisible ? looking : undefined), [bench, pageVisible, looking]);
|
|
253
|
+
// Requests of ta serve go to the page in front of the user, on the device they use (docs/design/ta-app-use.md 4.1).
|
|
254
|
+
const device = phone ? 'phone' : touch ? 'tablet' : 'computer';
|
|
255
|
+
React.useEffect(() => bench.pages.setDevice(device), [bench, device]);
|
|
256
|
+
// What an agent wants done that cannot be undone, or acts for the user, waits for them to agree here (TaAppCommands).
|
|
257
|
+
React.useEffect(() => bench.pages.answer(TA_PAGE_CONFIRM, payload => {
|
|
258
|
+
var _a;
|
|
259
|
+
const ask = payload;
|
|
260
|
+
return notices.confirm({
|
|
261
|
+
title: t('ta.screen.confirm', { who: String((_a = ask === null || ask === void 0 ? void 0 : ask.who) !== null && _a !== void 0 ? _a : 'Ta') }),
|
|
262
|
+
message: [ask === null || ask === void 0 ? void 0 : ask.what, ask === null || ask === void 0 ? void 0 : ask.detail].filter(Boolean).join('\n'),
|
|
263
|
+
confirmLabel: t('ta.screen.allow'),
|
|
264
|
+
danger: true,
|
|
265
|
+
});
|
|
266
|
+
}), [bench, notices, t]);
|
|
267
|
+
const state = useInject(TaState);
|
|
268
|
+
const { pageShown } = extensions;
|
|
269
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows the pages shown
|
|
270
|
+
React.useEffect(() => {
|
|
271
|
+
// A page that slides in over it: the launcher or the board goes once covered, not under the page as it comes.
|
|
272
|
+
if (phone && surface && view && !tabView) {
|
|
273
|
+
const timer = setTimeout(() => setSurface(undefined), 420);
|
|
274
|
+
closing.current = () => clearTimeout(timer);
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
setSurface(undefined);
|
|
278
|
+
}
|
|
279
|
+
// A page shown from the workbench over it (Open in the main area of a channel): the workbench goes, as for a conversation.
|
|
280
|
+
if (pageShown > 0 && view) {
|
|
281
|
+
setSettings(undefined);
|
|
282
|
+
setScreenOpen(!tabView);
|
|
283
|
+
setMaximized(false);
|
|
284
|
+
uncoverRight();
|
|
285
|
+
}
|
|
286
|
+
}, [pageShown]);
|
|
287
|
+
React.useEffect(() => () => { var _a; return (_a = closing.current) === null || _a === void 0 ? void 0 : _a.call(closing); }, []);
|
|
288
|
+
React.useEffect(() => {
|
|
289
|
+
if (layout !== 'compact') {
|
|
290
|
+
setNavOpen(false);
|
|
291
|
+
}
|
|
292
|
+
}, [layout]);
|
|
293
|
+
// The settings and the pages of the rail take the place of the sidebar too, as on their own; in the drawer of a narrow screen the sidebar stays.
|
|
294
|
+
const full = settings !== undefined || tabPage === 'discover' || railView !== undefined;
|
|
295
|
+
const sideShown = navOpen || (!sidebar.collapsed && !full);
|
|
296
|
+
// Over such a page, the logo (and Mod+B) goes back to the conversation, with the sidebar.
|
|
297
|
+
const toggleSide = () => {
|
|
298
|
+
if (navOpen) {
|
|
299
|
+
setNavOpen(false);
|
|
300
|
+
}
|
|
301
|
+
else if (full) {
|
|
302
|
+
setSettings(undefined);
|
|
303
|
+
setTabPage(undefined);
|
|
304
|
+
if (view) {
|
|
305
|
+
host.showPage('');
|
|
306
|
+
}
|
|
307
|
+
sidebar.reveal();
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
sidebar.toggle();
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
// A list of the rail: it shows in the sidebar, in place of a page; picked again, the sidebar (or the drawer) goes.
|
|
314
|
+
const showList = (id) => {
|
|
315
|
+
const pick = SideListUtil.pick(id, { side, drawer: navOpen, shown: sideShown });
|
|
316
|
+
if (pick === 'close') {
|
|
317
|
+
setNavOpen(false);
|
|
318
|
+
}
|
|
319
|
+
else if (pick === 'hide') {
|
|
320
|
+
sidebar.toggle();
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
setSideId(id);
|
|
324
|
+
}
|
|
325
|
+
if (pick === 'show') {
|
|
326
|
+
setSettings(undefined);
|
|
327
|
+
setTabPage(undefined);
|
|
328
|
+
if (view && full) {
|
|
329
|
+
host.showPage('');
|
|
330
|
+
}
|
|
331
|
+
sidebar.reveal();
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
// The list of chats asked for (ui.showChats): in the sidebar, or the tab of a phone; `busy` keeps only those going
|
|
335
|
+
// on, until the user clears it or another list is shown.
|
|
336
|
+
const [chatsBusy, setChatsBusy] = React.useState(false);
|
|
337
|
+
const chatsAsked = extensions.chatsShown;
|
|
338
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: each time it is asked, the same again too
|
|
339
|
+
React.useEffect(() => {
|
|
340
|
+
if (chatsAsked.count === 0) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
setChatsBusy(chatsAsked.busy);
|
|
344
|
+
setSideId('');
|
|
345
|
+
setSurface(undefined);
|
|
346
|
+
setSettings(undefined);
|
|
347
|
+
setTabPage(undefined);
|
|
348
|
+
setNavOpen(false);
|
|
349
|
+
if (phone) {
|
|
350
|
+
setScreenOpen(false);
|
|
351
|
+
if (showEditors) {
|
|
352
|
+
toggleRight();
|
|
353
|
+
}
|
|
354
|
+
if (tabView) {
|
|
355
|
+
host.showPage('');
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
if (view && full) {
|
|
360
|
+
host.showPage('');
|
|
361
|
+
}
|
|
362
|
+
sidebar.reveal();
|
|
363
|
+
}
|
|
364
|
+
}, [chatsAsked.count]);
|
|
365
|
+
React.useEffect(() => {
|
|
366
|
+
if (side !== '') {
|
|
367
|
+
setChatsBusy(false);
|
|
368
|
+
}
|
|
369
|
+
}, [side]);
|
|
370
|
+
const toggleWorkbench = () => {
|
|
371
|
+
if (showEditors) {
|
|
372
|
+
toggleRight();
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
// Over the settings of a wide screen (the rail, Cmd/Ctrl+J): they give way to what was under them.
|
|
376
|
+
if (!phone && settings !== undefined) {
|
|
377
|
+
setSettings(undefined);
|
|
378
|
+
}
|
|
379
|
+
revealRight();
|
|
380
|
+
editor.reveal();
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
// Cmd/Ctrl+Shift+T: the conversation last taken out of the list, back in it and shown, as it is picked there.
|
|
384
|
+
const picking = React.useRef(() => undefined);
|
|
385
|
+
const reopenChat = React.useCallback(() => {
|
|
386
|
+
const last = removedChats[removedChats.length - 1];
|
|
387
|
+
if (last) {
|
|
388
|
+
void chat.resume(last);
|
|
389
|
+
picking.current();
|
|
390
|
+
}
|
|
391
|
+
}, [removedChats, chat]);
|
|
392
|
+
useKeys(toggleSide, openSettings, () => editors && toggleWorkbench(), reopenChat);
|
|
393
|
+
useTitlebarColor(workbench.status !== 'signed-out', theme);
|
|
394
|
+
return {
|
|
395
|
+
t,
|
|
396
|
+
workbench,
|
|
397
|
+
extensions,
|
|
398
|
+
host,
|
|
399
|
+
store,
|
|
400
|
+
pending,
|
|
401
|
+
chat,
|
|
402
|
+
setSideId,
|
|
403
|
+
removedChats,
|
|
404
|
+
chatsByDirectory,
|
|
405
|
+
setChatsByDirectory,
|
|
406
|
+
foldedChats,
|
|
407
|
+
setFoldedChats,
|
|
408
|
+
pinnedChats,
|
|
409
|
+
setPinnedChats,
|
|
410
|
+
letGoAsks,
|
|
411
|
+
setLetGoAsks,
|
|
412
|
+
navOpen,
|
|
413
|
+
setNavOpen,
|
|
414
|
+
phone,
|
|
415
|
+
screenOpen,
|
|
416
|
+
setScreenOpen,
|
|
417
|
+
surface,
|
|
418
|
+
setSurface,
|
|
419
|
+
surfaces,
|
|
420
|
+
settings,
|
|
421
|
+
setSettings,
|
|
422
|
+
settingsOpened,
|
|
423
|
+
tabPage,
|
|
424
|
+
setTabPage,
|
|
425
|
+
openSettings,
|
|
426
|
+
closeSettings,
|
|
427
|
+
settingsShown,
|
|
428
|
+
toggleRight,
|
|
429
|
+
maximized,
|
|
430
|
+
setMaximized,
|
|
431
|
+
chatSettings,
|
|
432
|
+
readArchived,
|
|
433
|
+
sidebar,
|
|
434
|
+
editor,
|
|
435
|
+
online,
|
|
436
|
+
fileUrl,
|
|
437
|
+
openLink,
|
|
438
|
+
activeEditor,
|
|
439
|
+
view,
|
|
440
|
+
sideView,
|
|
441
|
+
sideComing,
|
|
442
|
+
side,
|
|
443
|
+
showPage,
|
|
444
|
+
lists,
|
|
445
|
+
tools,
|
|
446
|
+
openTool,
|
|
447
|
+
editors,
|
|
448
|
+
showEditors,
|
|
449
|
+
navigation,
|
|
450
|
+
codeScan,
|
|
451
|
+
notices,
|
|
452
|
+
discoveredOnOpen,
|
|
453
|
+
tabView,
|
|
454
|
+
screenPage,
|
|
455
|
+
seenChats,
|
|
456
|
+
looking,
|
|
457
|
+
state,
|
|
458
|
+
sideShown,
|
|
459
|
+
showList,
|
|
460
|
+
toggleWorkbench,
|
|
461
|
+
picking,
|
|
462
|
+
chatsBusy,
|
|
463
|
+
setChatsBusy,
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
//# sourceMappingURL=app-shell-state.js.map
|