@celljs/ta-web 4.16.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-ask-book.d.ts +35 -0
- package/esm/browser/assistant/assistant-ask-book.js +96 -0
- package/esm/browser/assistant/assistant-chat-list.d.ts +4 -4
- package/esm/browser/assistant/assistant-chat-list.js +74 -4
- package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
- package/esm/browser/assistant/assistant-conversation.js +351 -0
- package/esm/browser/assistant/assistant-export.js +11 -8
- package/esm/browser/assistant/assistant-extension.d.ts +3 -2
- package/esm/browser/assistant/assistant-extension.js +119 -11
- 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 +33 -8
- 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.d.ts +4 -0
- package/esm/browser/assistant/assistant-task-source.js +24 -4
- package/esm/browser/assistant/assistant-task-util.d.ts +27 -7
- package/esm/browser/assistant/assistant-task-util.js +84 -20
- package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
- package/esm/browser/assistant/assistant-tasks.js +2 -4
- package/esm/browser/assistant/assistant-thread.d.ts +22 -0
- package/esm/browser/assistant/assistant-thread.js +112 -0
- package/esm/browser/assistant/assistant-view.js +79 -130
- package/esm/browser/assistant/assistant.d.ts +33 -105
- package/esm/browser/assistant/assistant.js +105 -357
- 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 +56 -0
- package/esm/browser/assistant/chat-task-source.js +82 -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 +138 -0
- package/esm/browser/assistant/realtime-voice.js +479 -0
- package/esm/browser/assistant/task-views.d.ts +11 -9
- package/esm/browser/assistant/task-views.js +47 -25
- package/esm/browser/assistant/voice-call-bar.d.ts +67 -0
- package/esm/browser/assistant/voice-call-bar.js +316 -0
- package/esm/browser/assistant/voice-call.d.ts +207 -0
- package/esm/browser/assistant/voice-call.js +469 -0
- package/esm/browser/assistant/voice-reopen.d.ts +18 -0
- package/esm/browser/assistant/voice-reopen.js +54 -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 +7 -9
- 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/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 +26 -2
- package/esm/browser/components/account-menu.js +4 -2
- 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 +6 -2
- package/esm/browser/components/app-nav.js +15 -12
- 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 +471 -0
- package/esm/browser/components/app-view.js +212 -393
- 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 +57 -10
- package/esm/browser/components/call-pill.d.ts +11 -0
- package/esm/browser/components/call-pill.js +19 -0
- 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-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 +10 -2
- package/esm/browser/components/chat-icon.js +32 -6
- 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 +96 -0
- package/esm/browser/components/chat-list-row.js +208 -0
- package/esm/browser/components/chat-list-util.d.ts +197 -0
- package/esm/browser/components/chat-list-util.js +398 -0
- package/esm/browser/components/chat-list.d.ts +6 -190
- package/esm/browser/components/chat-list.js +340 -545
- package/esm/browser/components/chat-seen.js +1 -0
- 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-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 +54 -154
- 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/connection-bar.js +22 -3
- package/esm/browser/components/context-menu.d.ts +11 -2
- package/esm/browser/components/context-menu.js +18 -3
- 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 +3 -35
- package/esm/browser/components/conversation-scroll.js +16 -81
- package/esm/browser/components/conversation-view.d.ts +8 -0
- package/esm/browser/components/conversation-view.js +41 -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/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/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/folder-picker.d.ts +7 -0
- package/esm/browser/components/folder-picker.js +89 -19
- package/esm/browser/components/fork-view.js +2 -4
- package/esm/browser/components/gallery.d.ts +1 -1
- package/esm/browser/components/gallery.js +59 -15
- 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 +56 -15
- package/esm/browser/components/image-menu.d.ts +11 -0
- package/esm/browser/components/image-menu.js +29 -0
- 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 +12 -115
- package/esm/browser/components/image-viewer.js +74 -368
- 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 +6 -3
- package/esm/browser/components/link-dialog.d.ts +2 -1
- package/esm/browser/components/link-dialog.js +7 -1
- package/esm/browser/components/link.d.ts +4 -0
- package/esm/browser/components/link.js +11 -0
- package/esm/browser/components/list-rows.d.ts +3 -1
- package/esm/browser/components/list-rows.js +2 -1
- package/esm/browser/components/loading.d.ts +12 -0
- package/esm/browser/components/loading.js +18 -0
- package/esm/browser/components/markdown.js +7 -1
- package/esm/browser/components/media.d.ts +2 -0
- package/esm/browser/components/media.js +16 -1
- package/esm/browser/components/mermaid-view.js +14 -7
- 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 +22 -454
- 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 +190 -0
- package/esm/browser/components/message-user.d.ts +63 -0
- package/esm/browser/components/message-user.js +204 -0
- package/esm/browser/components/model-picker.d.ts +4 -2
- package/esm/browser/components/model-picker.js +16 -3
- 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 +17 -11
- package/esm/browser/components/nav-places.js +18 -13
- 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 +5 -4
- 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.d.ts +4 -2
- package/esm/browser/components/scan-screen.js +53 -20
- 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/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-settings.d.ts +1 -1
- package/esm/browser/components/session-view.js +188 -7
- package/esm/browser/components/settings-choices.d.ts +9 -3
- package/esm/browser/components/settings-choices.js +17 -29
- 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 +35 -250
- package/esm/browser/components/settings-view.js +44 -16
- 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/stop-times.js +1 -0
- package/esm/browser/components/surface-flyout.js +2 -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 +12 -5
- 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 +160 -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/components/workbench-view.d.ts +1 -1
- package/esm/browser/components/workbench-view.js +38 -5
- package/esm/browser/device/back-stack.d.ts +89 -11
- package/esm/browser/device/back-stack.js +200 -29
- package/esm/browser/device/code-scan.d.ts +23 -10
- package/esm/browser/device/code-scan.js +48 -43
- package/esm/browser/device/device-protocol.d.ts +1 -1
- package/esm/browser/device/device-protocol.js +1 -1
- 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/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/screen-awake.d.ts +24 -0
- package/esm/browser/device/screen-awake.js +59 -0
- 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 +14 -1
- 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 +74 -6
- package/esm/browser/extension/web-api-contributions.d.ts +139 -39
- 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 +126 -63
- package/esm/browser/extension/web-extension-context.d.ts +9 -9
- package/esm/browser/extension/web-extension-context.js +84 -19
- package/esm/browser/extension/web-extension-protocol.d.ts +26 -3
- 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 -2
- 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 +9 -82
- package/esm/browser/extension/web-extensions.js +22 -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 +8 -1
- package/esm/browser/extension/web-tasks.js +17 -3
- package/esm/browser/extension/web-view-util.d.ts +2 -2
- package/esm/browser/extension/web-view-util.js +7 -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 -32
- package/esm/browser/gateway/console-parts.js +58 -218
- package/esm/browser/gateway/console-tenant.d.ts +2 -4
- package/esm/browser/gateway/console-tenant.js +118 -209
- package/esm/browser/gateway/console-trend.d.ts +11 -0
- package/esm/browser/gateway/console-trend.js +117 -0
- package/esm/browser/gateway/console-view.js +153 -88
- 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 +280 -13
- package/esm/browser/i18n/messages-ja.js +292 -25
- package/esm/browser/i18n/messages-zh-tw.js +292 -25
- package/esm/browser/i18n/messages.d.ts +277 -10
- package/esm/browser/i18n/messages.js +585 -51
- package/esm/browser/index.d.ts +18 -0
- package/esm/browser/index.js +18 -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/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 +185 -0
- package/esm/browser/screen/screen-protocol.js +60 -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 +53 -0
- package/esm/browser/screen/screen.js +292 -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/navigation.d.ts +9 -21
- package/esm/browser/settings/navigation.js +11 -31
- package/esm/browser/settings/settings-protocol.d.ts +14 -1
- package/esm/browser/settings/settings-protocol.js +24 -2
- package/esm/browser/settings/settings.d.ts +7 -1
- package/esm/browser/settings/settings.js +31 -7
- package/esm/browser/share/shared-extensions.d.ts +29 -0
- package/esm/browser/share/shared-extensions.js +146 -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 +12 -1
- package/esm/browser/style/chat-list.d.ts +2 -0
- package/esm/browser/style/chat-list.js +150 -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 +66 -12
- package/esm/browser/style/dialogs.d.ts +2 -0
- package/esm/browser/style/dialogs.js +162 -0
- package/esm/browser/style/layout.d.ts +2 -2
- package/esm/browser/style/layout.js +8 -540
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +172 -110
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +13 -3
- package/esm/browser/style/shared.d.ts +2 -0
- package/esm/browser/style/shared.js +24 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +59 -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 +29 -10
- package/esm/browser/style/tints.d.ts +5 -4
- package/esm/browser/style/tints.js +9 -9
- package/esm/browser/style.js +8 -0
- package/esm/browser/util/desktop.d.ts +7 -1
- package/esm/browser/util/desktop.js +17 -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/image-swipe.d.ts +42 -0
- package/esm/browser/util/image-swipe.js +66 -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 +37 -5
- package/esm/browser/util/process.js +81 -10
- 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 +29 -0
- package/esm/browser/util/spoken.js +92 -0
- package/esm/browser/util/tool.d.ts +9 -0
- package/esm/browser/util/tool.js +71 -6
- package/esm/browser/util/transcript.d.ts +22 -0
- package/esm/browser/util/transcript.js +48 -0
- package/esm/browser/util/turn-end.d.ts +17 -0
- package/esm/browser/util/turn-end.js +164 -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 +31 -3
- package/esm/browser/workbench-services.d.ts +57 -0
- package/esm/browser/workbench-services.js +158 -0
- package/esm/browser/workbench-util.d.ts +9 -3
- package/esm/browser/workbench-util.js +24 -4
- package/esm/browser/workbench.d.ts +9 -89
- package/esm/browser/workbench.js +61 -344
- 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-chat-list.d.ts +4 -4
- package/lib/browser/assistant/assistant-chat-list.js +73 -3
- 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 +11 -8
- package/lib/browser/assistant/assistant-extension.d.ts +3 -2
- package/lib/browser/assistant/assistant-extension.js +117 -9
- 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 +34 -9
- 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.d.ts +4 -0
- package/lib/browser/assistant/assistant-task-source.js +25 -4
- package/lib/browser/assistant/assistant-task-util.d.ts +27 -7
- package/lib/browser/assistant/assistant-task-util.js +84 -20
- package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
- package/lib/browser/assistant/assistant-tasks.js +3 -5
- package/lib/browser/assistant/assistant-thread.d.ts +23 -0
- package/lib/browser/assistant/assistant-thread.js +148 -0
- package/lib/browser/assistant/assistant-view.js +76 -127
- package/lib/browser/assistant/assistant.d.ts +33 -105
- package/lib/browser/assistant/assistant.js +102 -354
- 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 +57 -0
- package/lib/browser/assistant/chat-task-source.js +86 -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 +139 -0
- package/lib/browser/assistant/realtime-voice.js +483 -0
- package/lib/browser/assistant/task-views.d.ts +11 -9
- package/lib/browser/assistant/task-views.js +47 -24
- package/lib/browser/assistant/voice-call-bar.d.ts +68 -0
- package/lib/browser/assistant/voice-call-bar.js +362 -0
- package/lib/browser/assistant/voice-call.d.ts +208 -0
- package/lib/browser/assistant/voice-call.js +473 -0
- package/lib/browser/assistant/voice-reopen.d.ts +19 -0
- package/lib/browser/assistant/voice-reopen.js +58 -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 +7 -9
- 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/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 +26 -2
- package/lib/browser/components/account-menu.js +3 -1
- 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 +6 -2
- package/lib/browser/components/app-nav.js +15 -12
- 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 +507 -0
- package/lib/browser/components/app-view.js +202 -383
- 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 +56 -9
- package/lib/browser/components/call-pill.d.ts +12 -0
- package/lib/browser/components/call-pill.js +55 -0
- 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-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 +10 -2
- package/lib/browser/components/chat-icon.js +32 -6
- 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 +97 -0
- package/lib/browser/components/chat-list-row.js +247 -0
- package/lib/browser/components/chat-list-util.d.ts +198 -0
- package/lib/browser/components/chat-list-util.js +401 -0
- package/lib/browser/components/chat-list.d.ts +6 -190
- package/lib/browser/components/chat-list.js +354 -561
- package/lib/browser/components/chat-seen.js +1 -0
- 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-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 +56 -157
- 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/connection-bar.js +22 -3
- package/lib/browser/components/context-menu.d.ts +11 -2
- package/lib/browser/components/context-menu.js +18 -3
- 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 +3 -35
- package/lib/browser/components/conversation-scroll.js +34 -100
- package/lib/browser/components/conversation-view.d.ts +9 -0
- package/lib/browser/components/conversation-view.js +77 -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/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/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/folder-picker.d.ts +7 -0
- package/lib/browser/components/folder-picker.js +88 -18
- package/lib/browser/components/fork-view.js +2 -4
- package/lib/browser/components/gallery.d.ts +1 -1
- package/lib/browser/components/gallery.js +58 -14
- 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 +56 -15
- package/lib/browser/components/image-menu.d.ts +12 -0
- package/lib/browser/components/image-menu.js +65 -0
- 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 +12 -115
- package/lib/browser/components/image-viewer.js +74 -370
- 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 +6 -3
- package/lib/browser/components/link-dialog.d.ts +2 -1
- package/lib/browser/components/link-dialog.js +7 -1
- package/lib/browser/components/link.d.ts +4 -0
- package/lib/browser/components/link.js +12 -0
- package/lib/browser/components/list-rows.d.ts +3 -1
- package/lib/browser/components/list-rows.js +2 -1
- package/lib/browser/components/loading.d.ts +13 -0
- package/lib/browser/components/loading.js +55 -0
- package/lib/browser/components/markdown.js +7 -1
- package/lib/browser/components/media.d.ts +2 -0
- package/lib/browser/components/media.js +17 -1
- package/lib/browser/components/mermaid-view.js +13 -6
- 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 +23 -462
- 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 +226 -0
- package/lib/browser/components/message-user.d.ts +64 -0
- package/lib/browser/components/message-user.js +247 -0
- package/lib/browser/components/model-picker.d.ts +4 -2
- package/lib/browser/components/model-picker.js +16 -3
- 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 +17 -11
- package/lib/browser/components/nav-places.js +20 -14
- 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 +5 -4
- 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.d.ts +4 -2
- package/lib/browser/components/scan-screen.js +54 -20
- 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/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-settings.d.ts +1 -1
- package/lib/browser/components/session-view.js +188 -7
- package/lib/browser/components/settings-choices.d.ts +10 -4
- package/lib/browser/components/settings-choices.js +16 -28
- 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 +31 -246
- package/lib/browser/components/settings-view.js +44 -16
- 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/stop-times.js +1 -0
- package/lib/browser/components/surface-flyout.js +2 -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 +12 -5
- 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 +196 -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/components/workbench-view.d.ts +1 -1
- package/lib/browser/components/workbench-view.js +38 -5
- package/lib/browser/device/back-stack.d.ts +89 -11
- package/lib/browser/device/back-stack.js +205 -31
- package/lib/browser/device/code-scan.d.ts +23 -10
- package/lib/browser/device/code-scan.js +47 -42
- package/lib/browser/device/device-protocol.d.ts +1 -1
- package/lib/browser/device/device-protocol.js +1 -1
- 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/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/screen-awake.d.ts +25 -0
- package/lib/browser/device/screen-awake.js +63 -0
- 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 +13 -0
- 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 +74 -6
- package/lib/browser/extension/web-api-contributions.d.ts +139 -39
- 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 +126 -63
- package/lib/browser/extension/web-extension-context.d.ts +9 -9
- package/lib/browser/extension/web-extension-context.js +86 -21
- package/lib/browser/extension/web-extension-protocol.d.ts +26 -3
- 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 -2
- 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 +9 -82
- package/lib/browser/extension/web-extensions.js +19 -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 +8 -1
- package/lib/browser/extension/web-tasks.js +17 -3
- package/lib/browser/extension/web-view-util.d.ts +2 -2
- package/lib/browser/extension/web-view-util.js +7 -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 -32
- package/lib/browser/gateway/console-parts.js +63 -223
- package/lib/browser/gateway/console-tenant.d.ts +2 -4
- package/lib/browser/gateway/console-tenant.js +116 -208
- package/lib/browser/gateway/console-trend.d.ts +12 -0
- package/lib/browser/gateway/console-trend.js +153 -0
- package/lib/browser/gateway/console-view.js +151 -86
- 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 +280 -13
- package/lib/browser/i18n/messages-ja.js +292 -25
- package/lib/browser/i18n/messages-zh-tw.js +292 -25
- package/lib/browser/i18n/messages.d.ts +277 -10
- package/lib/browser/i18n/messages.js +585 -51
- package/lib/browser/index.d.ts +18 -0
- package/lib/browser/index.js +18 -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/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 +186 -0
- package/lib/browser/screen/screen-protocol.js +63 -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 +54 -0
- package/lib/browser/screen/screen.js +295 -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/navigation.d.ts +9 -21
- package/lib/browser/settings/navigation.js +11 -31
- package/lib/browser/settings/settings-protocol.d.ts +14 -1
- package/lib/browser/settings/settings-protocol.js +24 -2
- package/lib/browser/settings/settings.d.ts +7 -1
- package/lib/browser/settings/settings.js +31 -7
- package/lib/browser/share/shared-extensions.d.ts +30 -0
- package/lib/browser/share/shared-extensions.js +182 -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 +12 -1
- package/lib/browser/style/chat-list.d.ts +3 -0
- package/lib/browser/style/chat-list.js +153 -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 +66 -12
- package/lib/browser/style/dialogs.d.ts +3 -0
- package/lib/browser/style/dialogs.js +165 -0
- package/lib/browser/style/layout.d.ts +2 -2
- package/lib/browser/style/layout.js +8 -540
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +172 -110
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +14 -4
- package/lib/browser/style/shared.d.ts +3 -0
- package/lib/browser/style/shared.js +27 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +59 -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 +29 -10
- package/lib/browser/style/tints.d.ts +5 -4
- package/lib/browser/style/tints.js +9 -9
- package/lib/browser/style.js +8 -0
- package/lib/browser/util/desktop.d.ts +7 -1
- package/lib/browser/util/desktop.js +17 -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/image-swipe.d.ts +43 -0
- package/lib/browser/util/image-swipe.js +69 -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 +37 -5
- package/lib/browser/util/process.js +80 -9
- 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 +30 -0
- package/lib/browser/util/spoken.js +95 -0
- package/lib/browser/util/tool.d.ts +9 -0
- package/lib/browser/util/tool.js +71 -6
- package/lib/browser/util/transcript.d.ts +23 -0
- package/lib/browser/util/transcript.js +51 -0
- package/lib/browser/util/turn-end.d.ts +18 -0
- package/lib/browser/util/turn-end.js +167 -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 +31 -3
- package/lib/browser/workbench-services.d.ts +58 -0
- package/lib/browser/workbench-services.js +162 -0
- package/lib/browser/workbench-util.d.ts +9 -3
- package/lib/browser/workbench-util.js +24 -4
- package/lib/browser/workbench.d.ts +9 -89
- package/lib/browser/workbench.js +58 -341
- 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
|
@@ -1,464 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChevronRight, Folder, FolderTree, Plus, Search, Trash2, Undo2, X } from 'lucide-react';
|
|
1
|
+
import { ChevronLeft, ChevronRight, FolderTree, Plus, Search, X } from 'lucide-react';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { useDevice } from '../device/device.js';
|
|
5
|
-
import {
|
|
4
|
+
import { DeviceMotion } from '../device/device-protocol.js';
|
|
5
|
+
import { DraftPlaces, DraftsUtil } from '../drafts/drafts-protocol.js';
|
|
6
|
+
import { useDrafts } from '../drafts/use-composer-draft.js';
|
|
7
|
+
import { ChatIcons, SessionMenus } from '../extension/extension-view.js';
|
|
6
8
|
import { useT } from '../i18n/use-t.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
+
import { ScreenUtil } from '../screen/screen-protocol.js';
|
|
10
|
+
import { useScreenPart } from '../screen/use-screen-part.js';
|
|
9
11
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
10
|
-
import { useBusy } from './busy.js';
|
|
11
12
|
import { ChatAskUtil } from './chat-asks.js';
|
|
12
|
-
import {
|
|
13
|
+
import { ChatBusyUtil } from './chat-busy.js';
|
|
14
|
+
import { ChatHomeItem, ChatHomeTop, ChatTaskItem } from './chat-home.js';
|
|
15
|
+
import { ChatHomeUtil } from './chat-home-util.js';
|
|
16
|
+
import { ChatIconTile, ChatIconUtil } from './chat-icon.js';
|
|
17
|
+
import { useMinute, useOfferPins, usePageEnd, useReadArchive } from './chat-list-hooks.js';
|
|
18
|
+
import { ChatFolderItem, ChatItem } from './chat-list-row.js';
|
|
19
|
+
import { CHAT_PAGE, ChatListUtil } from './chat-list-util.js';
|
|
13
20
|
import { ChatSeenUtil } from './chat-seen.js';
|
|
14
|
-
import { useContextMenu } from './context-menu.js';
|
|
15
21
|
import { EmptyState } from './empty-state.js';
|
|
16
22
|
import { HostTag } from './host-tag.js';
|
|
17
23
|
import { Icon, IconButton } from './icon.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
24
|
+
import { Loading } from './loading.js';
|
|
25
|
+
import { PhoneStack } from './phone-shell.js';
|
|
20
26
|
import { DinoFace } from './ta-avatar.js';
|
|
21
|
-
/** The list by directory or package, else by day; in any browser. */
|
|
22
|
-
/** By day unless the user groups them: directories nest a list, and the remote ones are marked anyway (HostTag). */
|
|
23
|
-
export const BY_DIRECTORY = { key: 'chat.byDirectory', tier: 'user', initial: false, parse: StateUtil.boolean };
|
|
24
|
-
/** The groups folded: the keys of their sources (ChatListUtil.sourceKey). */
|
|
25
|
-
export const FOLDED = {
|
|
26
|
-
key: 'chat.folded',
|
|
27
|
-
tier: 'user',
|
|
28
|
-
initial: [],
|
|
29
|
-
parse: value => (Array.isArray(value) ? value.filter((key) => typeof key === 'string') : undefined),
|
|
30
|
-
};
|
|
31
|
-
/** The conversations pinned to the top of the list, in any browser: their files (ChatListUtil.file). */
|
|
32
|
-
export const PINNED = {
|
|
33
|
-
key: 'chat.pinned',
|
|
34
|
-
tier: 'user',
|
|
35
|
-
initial: [],
|
|
36
|
-
parse: value => (Array.isArray(value) ? value.filter((file) => typeof file === 'string') : undefined),
|
|
37
|
-
};
|
|
38
|
-
const TONES = 6;
|
|
39
|
-
const DAY = 24 * 60 * 60000;
|
|
40
|
-
/**
|
|
41
|
-
* The rows drawn at first, and more each time the end of those comes near: a list of thousands of
|
|
42
|
-
* conversations opens and scrolls as one of a few dozen.
|
|
43
|
-
*/
|
|
44
|
-
export const CHAT_PAGE = 60;
|
|
45
|
-
export var ChatListUtil;
|
|
46
|
-
(function (ChatListUtil) {
|
|
47
|
-
function isOpen(entry) {
|
|
48
|
-
return 'sessionId' in entry;
|
|
49
|
-
}
|
|
50
|
-
ChatListUtil.isOpen = isOpen;
|
|
51
|
-
/** Whether it is the double's own conversation: its session, or before that is open its file. */
|
|
52
|
-
function isDouble(entry, double) {
|
|
53
|
-
return isOpen(entry) && (entry.sessionId === double.session || (!!double.sessionFile && entry.sessionFile === double.sessionFile));
|
|
54
|
-
}
|
|
55
|
-
ChatListUtil.isDouble = isDouble;
|
|
56
|
-
/** The id of an open session, the file of a saved one. */
|
|
57
|
-
function key(entry) {
|
|
58
|
-
return isOpen(entry) ? entry.sessionId : entry.sessionFile;
|
|
59
|
-
}
|
|
60
|
-
ChatListUtil.key = key;
|
|
61
|
-
/** What stays the same as it closes and opens again: its file, else (before it has one) the id of its session. */
|
|
62
|
-
function file(entry) {
|
|
63
|
-
var _a;
|
|
64
|
-
return (_a = entry.sessionFile) !== null && _a !== void 0 ? _a : entry.sessionId;
|
|
65
|
-
}
|
|
66
|
-
ChatListUtil.file = file;
|
|
67
|
-
/** The files the list keeps however old (ChatListUtil.entries): those pinned, and the saved ones that still ask the user. */
|
|
68
|
-
function keptFiles(saved, pinned, letGo) {
|
|
69
|
-
const asking = saved.filter(session => ChatAskUtil.asking(session, letGo)).map(session => session.sessionFile);
|
|
70
|
-
return asking.length ? [...pinned, ...asking] : pinned;
|
|
71
|
-
}
|
|
72
|
-
ChatListUtil.keptFiles = keptFiles;
|
|
73
|
-
/** Those pinned, and the rest, each in the order it had. */
|
|
74
|
-
function pinnedApart(sessions, pinned) {
|
|
75
|
-
const files = new Set(pinned);
|
|
76
|
-
return { pinned: sessions.filter(entry => files.has(file(entry))), rest: sessions.filter(entry => !files.has(file(entry))) };
|
|
77
|
-
}
|
|
78
|
-
ChatListUtil.pinnedApart = pinnedApart;
|
|
79
|
-
/**
|
|
80
|
-
* The open sessions and the saved ones, those archived and those taken out apart. A saved conversation of a
|
|
81
|
-
* package's group is not listed: its package opens it again, with its role. An open one is always listed,
|
|
82
|
-
* however old, and so is one pinned; a saved one not updated `since` is archived (a ta serve of before lists
|
|
83
|
-
* them with the others), or not updated since what `sooner` says of it (ChatIconUtil.archiveSince).
|
|
84
|
-
*/
|
|
85
|
-
function entries(sessions, saved, removed, archived = [], since, pinned = [], sooner) {
|
|
86
|
-
const open = new Set(sessions.map(session => session.sessionFile));
|
|
87
|
-
const out = new Set(removed);
|
|
88
|
-
const seen = new Set();
|
|
89
|
-
const closed = [...saved, ...archived].filter(session => {
|
|
90
|
-
if (session.group || open.has(session.sessionFile) || seen.has(session.sessionFile)) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
seen.add(session.sessionFile);
|
|
94
|
-
return true;
|
|
95
|
-
});
|
|
96
|
-
const kept = new Set(pinned);
|
|
97
|
-
const recent = (session) => { var _a; return since === undefined || kept.has(session.sessionFile) || session.updatedAt >= Math.max(since, (_a = sooner === null || sooner === void 0 ? void 0 : sooner(session)) !== null && _a !== void 0 ? _a : since); };
|
|
98
|
-
return {
|
|
99
|
-
listed: [...sessions, ...closed.filter(session => recent(session) && !out.has(session.sessionFile))],
|
|
100
|
-
archived: closed.filter(session => !recent(session) && !out.has(session.sessionFile)),
|
|
101
|
-
removed: closed.filter(session => out.has(session.sessionFile)),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
ChatListUtil.entries = entries;
|
|
105
|
-
/** Those updated since `before`, and the older, which the list folds; all are recent without it. */
|
|
106
|
-
function split(sessions, before) {
|
|
107
|
-
if (before === undefined) {
|
|
108
|
-
return [sessions, []];
|
|
109
|
-
}
|
|
110
|
-
const recent = [];
|
|
111
|
-
const older = [];
|
|
112
|
-
for (const session of sessions) {
|
|
113
|
-
(session.updatedAt >= before ? recent : older).push(session);
|
|
114
|
-
}
|
|
115
|
-
return [recent, older];
|
|
116
|
-
}
|
|
117
|
-
ChatListUtil.split = split;
|
|
118
|
-
/**
|
|
119
|
-
* Draws `count` rows of a list, and those it `keeps` however far down they are: the conversation shown, and
|
|
120
|
-
* those unseen, which the tab of the chats scrolls to (PhoneUtil.locate).
|
|
121
|
-
*/
|
|
122
|
-
function budget(count, keeps) {
|
|
123
|
-
let left = count;
|
|
124
|
-
let more = false;
|
|
125
|
-
return {
|
|
126
|
-
take(entries) {
|
|
127
|
-
let end = Math.max(0, Math.min(entries.length, left));
|
|
128
|
-
for (let at = entries.length - 1; keeps && at >= end; at--) {
|
|
129
|
-
if (keeps(entries[at])) {
|
|
130
|
-
end = at + 1;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
left -= end;
|
|
134
|
-
more || (more = end < entries.length);
|
|
135
|
-
return end === entries.length ? entries : entries.slice(0, end);
|
|
136
|
-
},
|
|
137
|
-
get more() {
|
|
138
|
-
return more;
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
ChatListUtil.budget = budget;
|
|
143
|
-
function sourceKey(session) {
|
|
144
|
-
return session.group ? `pkg:${session.group}` : `dir:${session.cwd}`;
|
|
145
|
-
}
|
|
146
|
-
ChatListUtil.sourceKey = sourceKey;
|
|
147
|
-
/** `@celljs/ta-channels` → `ta-channels`. */
|
|
148
|
-
function label(group) {
|
|
149
|
-
return group.slice(group.lastIndexOf('/') + 1);
|
|
150
|
-
}
|
|
151
|
-
ChatListUtil.label = label;
|
|
152
|
-
function tone(key) {
|
|
153
|
-
let hash = 0;
|
|
154
|
-
for (let i = 0; i < key.length; i++) {
|
|
155
|
-
hash = (hash * 31 + key.charCodeAt(i)) | 0;
|
|
156
|
-
}
|
|
157
|
-
return Math.abs(hash) % TONES;
|
|
158
|
-
}
|
|
159
|
-
ChatListUtil.tone = tone;
|
|
160
|
-
/** The directories and packages of the conversations, the one with the latest first. */
|
|
161
|
-
function sources(sessions) {
|
|
162
|
-
var _a;
|
|
163
|
-
const sources = new Map();
|
|
164
|
-
for (const session of sessions) {
|
|
165
|
-
const key = sourceKey(session);
|
|
166
|
-
const known = sources.get(key);
|
|
167
|
-
if (known) {
|
|
168
|
-
known.count++;
|
|
169
|
-
known.latest = Math.max(known.latest, session.updatedAt);
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
const name = session.group ? label(session.group) : MessageUtil.basename(session.cwd);
|
|
173
|
-
sources.set(key, {
|
|
174
|
-
key,
|
|
175
|
-
label: name,
|
|
176
|
-
title: (_a = session.group) !== null && _a !== void 0 ? _a : session.cwd,
|
|
177
|
-
cwd: session.group ? undefined : session.cwd,
|
|
178
|
-
host: session.group ? undefined : TaLocation.host(session.cwd),
|
|
179
|
-
count: 1,
|
|
180
|
-
initial: initial(session.group ? name.replace(/^ta-/, '') : name),
|
|
181
|
-
tone: 0,
|
|
182
|
-
latest: session.updatedAt,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
const taken = new Set();
|
|
186
|
-
for (const source of [...sources.values()].sort((a, b) => a.key.localeCompare(b.key))) {
|
|
187
|
-
const first = tone(source.key);
|
|
188
|
-
const free = Array.from({ length: TONES }, (_, i) => (first + i) % TONES).find(candidate => !taken.has(candidate));
|
|
189
|
-
source.tone = free !== null && free !== void 0 ? free : first;
|
|
190
|
-
taken.add(source.tone);
|
|
191
|
-
}
|
|
192
|
-
return [...sources.values()].sort((a, b) => b.latest - a.latest).map(({ latest, ...source }) => source);
|
|
193
|
-
}
|
|
194
|
-
ChatListUtil.sources = sources;
|
|
195
|
-
/** The conversations whose title or place holds the query, the latest first. */
|
|
196
|
-
function filter(sessions, query, t) {
|
|
197
|
-
const words = query.trim().toLowerCase();
|
|
198
|
-
return sessions
|
|
199
|
-
.filter(session => { var _a, _b; return !words || `${title(session, t)} ${(_a = session.group) !== null && _a !== void 0 ? _a : session.cwd} ${(_b = session.lastMessage) !== null && _b !== void 0 ? _b : ''}`.toLowerCase().includes(words); })
|
|
200
|
-
.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
201
|
-
}
|
|
202
|
-
ChatListUtil.filter = filter;
|
|
203
|
-
/** The conversations by their directory or package, in the order of the sources; a source without one has no group. */
|
|
204
|
-
function groups(sessions, sources) {
|
|
205
|
-
var _a;
|
|
206
|
-
const bySource = new Map(sources.map(source => [source.key, []]));
|
|
207
|
-
for (const session of sessions) {
|
|
208
|
-
(_a = bySource.get(sourceKey(session))) === null || _a === void 0 ? void 0 : _a.push(session);
|
|
209
|
-
}
|
|
210
|
-
return sources.map(source => { var _a; return ({ source, sessions: (_a = bySource.get(source.key)) !== null && _a !== void 0 ? _a : [] }); }).filter(group => group.sessions.length > 0);
|
|
211
|
-
}
|
|
212
|
-
ChatListUtil.groups = groups;
|
|
213
|
-
/** Today, yesterday, the week before, earlier: by the local day. */
|
|
214
|
-
function sections(sessions, now) {
|
|
215
|
-
var _a;
|
|
216
|
-
const today = new Date(now).setHours(0, 0, 0, 0);
|
|
217
|
-
const bounds = [
|
|
218
|
-
[today, 'ta.time.today'],
|
|
219
|
-
[today - DAY, 'ta.time.yesterday'],
|
|
220
|
-
[today - 7 * DAY, 'ta.time.week'],
|
|
221
|
-
[-Infinity, 'ta.time.earlier'],
|
|
222
|
-
];
|
|
223
|
-
const sections = [];
|
|
224
|
-
for (const session of sessions) {
|
|
225
|
-
const [, id] = (_a = bounds.find(([from]) => session.updatedAt >= from)) !== null && _a !== void 0 ? _a : bounds[bounds.length - 1];
|
|
226
|
-
const last = sections[sections.length - 1];
|
|
227
|
-
if ((last === null || last === void 0 ? void 0 : last.id) === id) {
|
|
228
|
-
last.sessions.push(session);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
sections.push({ id, sessions: [session] });
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return sections;
|
|
235
|
-
}
|
|
236
|
-
ChatListUtil.sections = sections;
|
|
237
|
-
/** `19:59` today, `11/8` before. */
|
|
238
|
-
function clock(time, now) {
|
|
239
|
-
const date = new Date(time);
|
|
240
|
-
if (date.toDateString() === new Date(now).toDateString()) {
|
|
241
|
-
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
|
|
242
|
-
}
|
|
243
|
-
return `${date.getMonth() + 1}/${date.getDate()}`;
|
|
244
|
-
}
|
|
245
|
-
ChatListUtil.clock = clock;
|
|
246
|
-
function title(session, t) {
|
|
247
|
-
return session.sessionName || session.firstMessage || t('ta.chat.new');
|
|
248
|
-
}
|
|
249
|
-
ChatListUtil.title = title;
|
|
250
|
-
/**
|
|
251
|
-
* Whether a row shows the same: what of its conversation and its place it shows, and the rest as is. The list
|
|
252
|
-
* reads the conversations again every few seconds into new objects: one that answers draws its row again, not every row.
|
|
253
|
-
*/
|
|
254
|
-
function sameRow(before, after) {
|
|
255
|
-
const a = before.session;
|
|
256
|
-
const b = after.session;
|
|
257
|
-
const sameSession = a === b ||
|
|
258
|
-
(key(a) === key(b) &&
|
|
259
|
-
a.sessionName === b.sessionName &&
|
|
260
|
-
a.firstMessage === b.firstMessage &&
|
|
261
|
-
a.lastMessage === b.lastMessage &&
|
|
262
|
-
a.updatedAt === b.updatedAt &&
|
|
263
|
-
a.cwd === b.cwd &&
|
|
264
|
-
a.group === b.group &&
|
|
265
|
-
(isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming) &&
|
|
266
|
-
(isOpen(a) && !!a.waiting) === (isOpen(b) && !!b.waiting) &&
|
|
267
|
-
PresenceUtil.same(isOpen(a) ? a.people : undefined, isOpen(b) ? b.people : undefined));
|
|
268
|
-
const x = before.source;
|
|
269
|
-
const y = after.source;
|
|
270
|
-
const sameSource = x === y || (x.key === y.key && x.label === y.label && x.title === y.title && x.host === y.host && x.initial === y.initial && x.tone === y.tone);
|
|
271
|
-
if (!sameSession || !sameSource) {
|
|
272
|
-
return false;
|
|
273
|
-
}
|
|
274
|
-
for (const name of Object.keys(after)) {
|
|
275
|
-
if (name !== 'session' && name !== 'source' && before[name] !== after[name]) {
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return Object.keys(before).length === Object.keys(after).length;
|
|
280
|
-
}
|
|
281
|
-
ChatListUtil.sameRow = sameRow;
|
|
282
|
-
/** What a row says under its title: the last thing said, unless it is the title again. */
|
|
283
|
-
function preview(session, title) {
|
|
284
|
-
const last = session.lastMessage;
|
|
285
|
-
return last && last !== title ? last : undefined;
|
|
286
|
-
}
|
|
287
|
-
ChatListUtil.preview = preview;
|
|
288
|
-
/** The first letter of a name, for its avatar. */
|
|
289
|
-
function initial(name) {
|
|
290
|
-
const letter = [...name].find(char => /[\p{L}\p{N}]/u.test(char));
|
|
291
|
-
return (letter !== null && letter !== void 0 ? letter : '?').toUpperCase();
|
|
292
|
-
}
|
|
293
|
-
ChatListUtil.initial = initial;
|
|
294
|
-
})(ChatListUtil || (ChatListUtil = {}));
|
|
295
|
-
/** The time now, again each minute. */
|
|
296
|
-
function useMinute() {
|
|
297
|
-
const [now, setNow] = React.useState(Date.now);
|
|
298
|
-
React.useEffect(() => {
|
|
299
|
-
const timer = setInterval(() => setNow(Date.now()), 60000);
|
|
300
|
-
return () => clearInterval(timer);
|
|
301
|
-
}, []);
|
|
302
|
-
return now;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* The avatar of a row: the face of the double for its own conversation, the face an extension draws for its
|
|
306
|
-
* agents (registerAvatar), else the letter of its directory. A face works while the conversation answers.
|
|
307
|
-
*/
|
|
308
|
-
export function ChatAvatar({ session, source, who, size, mood }) {
|
|
309
|
-
var _a;
|
|
310
|
-
const avatars = React.useContext(SessionAvatars);
|
|
311
|
-
// A conversation of an extension that is no one to talk to (a brief, a question): the icon it gives.
|
|
312
|
-
const icon = useChatIcon(who ? undefined : session);
|
|
313
|
-
const letter = (React.createElement("span", { className: `ta-chat-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial));
|
|
314
|
-
if ((who === null || who === void 0 ? void 0 : who.kind) === 'double') {
|
|
315
|
-
return React.createElement(DinoFace, { className: "ta-chat-face", mood: mood, size: size });
|
|
316
|
-
}
|
|
317
|
-
if (icon) {
|
|
318
|
-
return React.createElement(ChatIconTile, { found: icon, size: size });
|
|
319
|
-
}
|
|
320
|
-
const Avatar = who && ChatListUtil.isOpen(session) && session.group ? avatars[session.group] : undefined;
|
|
321
|
-
if (!Avatar || !ChatListUtil.isOpen(session)) {
|
|
322
|
-
return letter;
|
|
323
|
-
}
|
|
324
|
-
return (React.createElement("span", { className: "ta-chat-face", style: { width: size, height: size }, "aria-hidden": "true" },
|
|
325
|
-
React.createElement(ExtensionBoundary, { name: (_a = session.group) !== null && _a !== void 0 ? _a : '', resetKey: Avatar, fallback: letter },
|
|
326
|
-
React.createElement(Avatar, { session: session, mood: mood, size: size }))));
|
|
327
|
-
}
|
|
328
|
-
/** What goes on in it, on the line of a row of one line: waiting for the user, answering now, or how the double's task ended. */
|
|
329
|
-
function ChatState({ streaming, waiting, task }) {
|
|
330
|
-
const t = useT();
|
|
331
|
-
if (waiting) {
|
|
332
|
-
return (React.createElement("span", { className: "ta-chat-state ta-waiting" },
|
|
333
|
-
React.createElement("span", { className: "ta-status ta-status-waiting" }),
|
|
334
|
-
t('ta.task.waiting')));
|
|
335
|
-
}
|
|
336
|
-
if (streaming) {
|
|
337
|
-
return (React.createElement("span", { className: "ta-chat-state" },
|
|
338
|
-
React.createElement("span", { className: "ta-spinner" })));
|
|
339
|
-
}
|
|
340
|
-
if (task === 'failed' || task === 'stopped') {
|
|
341
|
-
return (React.createElement("span", { className: `ta-chat-state ta-${task}` },
|
|
342
|
-
React.createElement("span", { className: `ta-status ${task === 'failed' ? 'ta-status-error' : 'ta-status-cancelled'}` }),
|
|
343
|
-
t(task === 'failed' ? 'ta.task.failed' : 'ta.task.stopped')));
|
|
344
|
-
}
|
|
345
|
-
return null;
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Always there, so that it grows in and goes, the avatar never drawn again; told only while it is on. A conversation
|
|
349
|
-
* that waits for the user to decide has a blue ? instead, over an amber dot: seeing it does not end it, answering does.
|
|
350
|
-
*/
|
|
351
|
-
function ChatDot({ unseen, asks }) {
|
|
352
|
-
const t = useT();
|
|
353
|
-
if (asks) {
|
|
354
|
-
return (React.createElement("span", { className: "ta-chat-dot ta-on ta-asks", role: "img", "aria-label": t('ta.chat.asking') }, "?"));
|
|
355
|
-
}
|
|
356
|
-
return unseen ? React.createElement("span", { className: "ta-chat-dot ta-on", role: "img", "aria-label": t('ta.chat.unseen') }) : React.createElement("span", { className: "ta-chat-dot" });
|
|
357
|
-
}
|
|
358
|
-
const ChatItem = React.memo(function ChatItem({ session, source, selected, time, compact, actions, restorable, task, doubleName, handable, pinned, unseen, asking, }) {
|
|
359
|
-
var _a;
|
|
360
|
-
const t = useT();
|
|
361
|
-
const onSelect = () => actions.open(session);
|
|
362
|
-
const [removing, run] = useBusy();
|
|
363
|
-
const onRemove = () => void run(() => actions.remove(session));
|
|
364
|
-
const onRestore = restorable ? () => actions.restore(session) : undefined;
|
|
365
|
-
const onHand = handable ? () => actions.hand(session) : undefined;
|
|
366
|
-
const onPin = onRestore ? undefined : () => actions.pin(session, !pinned);
|
|
367
|
-
const avatars = React.useContext(SessionAvatars);
|
|
368
|
-
// The double's conversation is named after it; an agent's has its name (the extension named it so).
|
|
369
|
-
const who = doubleName !== undefined ? { kind: 'double', name: doubleName } : session.group && avatars[session.group] ? { kind: 'agent' } : undefined;
|
|
370
|
-
const title = (who === null || who === void 0 ? void 0 : who.kind) === 'double' ? who.name : ChatListUtil.title(session, t);
|
|
371
|
-
// Held, a row offers what its hover does (its close button shows only on the row shown, on a phone).
|
|
372
|
-
const [menu, openMenu] = useContextMenu();
|
|
373
|
-
const onContextMenu = (event) => openMenu(event, [
|
|
374
|
-
{ label: t('ta.chat.open'), run: onSelect },
|
|
375
|
-
...(asking ? [{ label: t('ta.chat.letGo'), run: () => actions.letGo(session) }] : []),
|
|
376
|
-
...(onPin ? [{ label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: onPin }] : []),
|
|
377
|
-
// As a messenger's, read or not by hand; not the one shown, which is seen as it is.
|
|
378
|
-
...(onRestore || selected || asking
|
|
379
|
-
? []
|
|
380
|
-
: [{ label: t(unseen ? 'ta.chat.markSeen' : 'ta.chat.markUnseen'), run: () => actions.markUnseen(session, !unseen) }]),
|
|
381
|
-
...(onHand ? [{ label: t('ta.chat.handToDouble'), run: onHand }] : []),
|
|
382
|
-
// What extensions add (Share…) before taking it out, which stays last.
|
|
383
|
-
...actions.extensionMenu(session, title),
|
|
384
|
-
onRestore ? { label: t('ta.chat.restore'), run: onRestore } : { label: t('ta.chat.remove'), run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
385
|
-
]);
|
|
386
|
-
const tag = task && (React.createElement("span", { className: "ta-double-tag", title: t('ta.chat.doubleTagTitle') }, t('ta.chat.doubleTag')));
|
|
387
|
-
// On a phone, as in its messaging apps, a swipe to the left shows what its hover does behind the row.
|
|
388
|
-
const handheld = useDevice(device => device.handheld);
|
|
389
|
-
// As WeChat's: Pin, then Remove at the edge.
|
|
390
|
-
const swipe = onRestore
|
|
391
|
-
? [{ key: 'restore', label: t('ta.chat.restoreShort'), run: onRestore }]
|
|
392
|
-
: [
|
|
393
|
-
{ key: 'pin', label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin === null || onPin === void 0 ? void 0 : onPin() },
|
|
394
|
-
{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
395
|
-
];
|
|
396
|
-
// A dialog of it waits for the user: it needs them, it does not answer meanwhile.
|
|
397
|
-
const waiting = ChatListUtil.isOpen(session) && !!session.waiting;
|
|
398
|
-
const streaming = ChatListUtil.isOpen(session) && session.isStreaming && !waiting;
|
|
399
|
-
const asks = waiting || (!!asking && !streaming);
|
|
400
|
-
const mood = asks ? 'attention' : streaming ? 'working' : 'idle';
|
|
401
|
-
const state = React.createElement(ChatState, { streaming: streaming, waiting: waiting, task: task });
|
|
402
|
-
// Others in the same Ta: their faces while they look at it, and whose message it answers.
|
|
403
|
-
const people = ChatListUtil.isOpen(session) ? session.people : undefined;
|
|
404
|
-
const viewers = React.createElement(PeopleFaces, { people: PresenceUtil.viewing(people), size: 14, max: 3 });
|
|
405
|
-
const askers = streaming ? PresenceUtil.asked(people) : [];
|
|
406
|
-
const replying = askers.length > 0 && (React.createElement("span", { className: "ta-chat-flag ta-replying" }, t('ta.chat.replyingFor', { names: PresenceUtil.names(askers, t('ta.presence.separator'), count => t('ta.presence.more', { count })) })));
|
|
407
|
-
// As in a messaging app, the last thing said; its directory before the first, and on hover in place of its time.
|
|
408
|
-
const said = ChatListUtil.preview(session, title);
|
|
409
|
-
const place = who ? MessageUtil.basename(session.cwd) : source.label;
|
|
410
|
-
const ended = task === 'failed' || task === 'stopped' ? task : undefined;
|
|
411
|
-
return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
|
|
412
|
-
React.createElement("button", { type: "button", className: `ta-chat-item${compact ? ' ta-compact' : ''}${removing ? ' ta-pending' : ''}`, title: `${title}\n${source.title}`, "aria-current": selected ? 'true' : undefined, onClick: onSelect }, compact ? (React.createElement("span", { className: "ta-chat-text" },
|
|
413
|
-
React.createElement("span", { className: "ta-chat-line" },
|
|
414
|
-
who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
|
|
415
|
-
tag,
|
|
416
|
-
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
417
|
-
viewers,
|
|
418
|
-
state,
|
|
419
|
-
React.createElement(ChatDot, { unseen: !!unseen, asks: asks }),
|
|
420
|
-
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time)))) : (React.createElement(React.Fragment, null,
|
|
421
|
-
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
422
|
-
React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 38, mood: mood }),
|
|
423
|
-
React.createElement(ChatDot, { unseen: !!unseen, asks: asks })),
|
|
424
|
-
React.createElement("span", { className: "ta-chat-text" },
|
|
425
|
-
React.createElement("span", { className: "ta-chat-line" },
|
|
426
|
-
tag,
|
|
427
|
-
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
428
|
-
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time),
|
|
429
|
-
React.createElement("span", { className: "ta-chat-place" },
|
|
430
|
-
React.createElement(Icon, { icon: Folder, size: 12 }),
|
|
431
|
-
React.createElement("span", null, place))),
|
|
432
|
-
React.createElement("span", { className: "ta-chat-line" },
|
|
433
|
-
React.createElement("span", { className: `ta-chat-sub${unseen ? ' ta-unseen' : ''}` },
|
|
434
|
-
React.createElement(HostTag, { host: source.host }),
|
|
435
|
-
waiting && React.createElement("span", { className: "ta-chat-flag ta-waiting" },
|
|
436
|
-
"[",
|
|
437
|
-
t('ta.task.waiting'),
|
|
438
|
-
"]"),
|
|
439
|
-
asks && !waiting && React.createElement("span", { className: "ta-chat-flag ta-waiting" },
|
|
440
|
-
"[",
|
|
441
|
-
t('ta.chat.asking'),
|
|
442
|
-
"]"),
|
|
443
|
-
replying,
|
|
444
|
-
ended && !streaming && !asks && (React.createElement("span", { className: `ta-chat-flag ta-${ended}` },
|
|
445
|
-
"[",
|
|
446
|
-
t(ended === 'failed' ? 'ta.task.failed' : 'ta.task.stopped'),
|
|
447
|
-
"]")), (_a = (asks && !waiting ? asking : said)) !== null && _a !== void 0 ? _a : (React.createElement("span", { className: "ta-chat-dir" },
|
|
448
|
-
React.createElement(Icon, { icon: Folder, size: 12 }),
|
|
449
|
-
place))),
|
|
450
|
-
viewers,
|
|
451
|
-
streaming && React.createElement("span", { className: "ta-chat-state ta-spinner" })))))),
|
|
452
|
-
handheld ? null : onRestore ? (React.createElement(IconButton, { className: "ta-chat-delete", icon: Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(IconButton, { className: "ta-chat-delete", icon: Trash2, label: t('ta.sidebar.closeTitle'), busy: removing, onClick: onRemove }))));
|
|
453
|
-
}, ChatListUtil.sameRow);
|
|
454
27
|
/**
|
|
455
28
|
* The conversations of the server, open or saved, the latest first, with a search and `+` for a new one:
|
|
456
29
|
* by directory or package, each group folding and with a `+` of its own, or by day. Those not updated for
|
|
457
30
|
* `foldDays` are folded at the end (of each group), those for `archiveDays` archived after them, read when
|
|
458
|
-
* opened or searched, and those taken out last, folded, to put back.
|
|
459
|
-
* its
|
|
31
|
+
* opened or searched, and those taken out last, folded, to put back. What comes many a day (the runs of scheduled
|
|
32
|
+
* tasks) folds into one row of its folder (WebChatIcon.folder), pinned as a conversation is (pinned, it holds its archived
|
|
33
|
+
* conversations too and stays once they all are; the archive folds those of the others as the list does), which opens a list of its
|
|
34
|
+
* own (on a phone pushed over the list, as a page of iOS, back with a swipe from the edge); a search finds them one by one. However long, it draws the rows of its first screens, and more as it is scrolled to its end.
|
|
460
35
|
*/
|
|
461
|
-
export function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSaved, onArchive, foldDays, archiveDays, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, notice, pinned, onPinned, looking, seen, letGo, onLetGo, onUnseen, }) {
|
|
36
|
+
export function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSaved, onArchive, foldDays, archiveDays, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, home, notice, pinned, onPinned, looking, seen, letGo, onLetGo, onUnseen, busy = false, onBusy, }) {
|
|
462
37
|
const t = useT();
|
|
463
38
|
const now = useMinute();
|
|
464
39
|
const [query, setQuery] = React.useState('');
|
|
@@ -466,6 +41,10 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
466
41
|
const [archiveOpen, setArchiveOpen] = React.useState(false);
|
|
467
42
|
// The older of the list by day, and the groups whose older are shown: folded each time the list is drawn anew.
|
|
468
43
|
const [olderOpen, setOlderOpen] = React.useState(false);
|
|
44
|
+
// The folder whose conversations the list shows in place of its own (ChatFolder.key).
|
|
45
|
+
// On a phone kept while it slides away (open false), as a page pushed is; one of the archive lists those archived.
|
|
46
|
+
const [folderShown, setFolderShown] = React.useState();
|
|
47
|
+
const handheld = useDevice(device => device.handheld);
|
|
469
48
|
const [groupsOlder, setGroupsOlder] = React.useState([]);
|
|
470
49
|
// How many rows are drawn, for a search: another starts again from the first page.
|
|
471
50
|
const [paged, setPaged] = React.useState({ query, count: CHAT_PAGE });
|
|
@@ -474,6 +53,11 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
474
53
|
const sessionMenus = React.useContext(SessionMenus);
|
|
475
54
|
const latest = React.useRef({ chat, double, onPicked, t, pinned, onPinned, sessionMenus, onLetGo, onUnseen });
|
|
476
55
|
latest.current = { chat, double, onPicked, t, pinned, onPinned, sessionMenus, onLetGo, onUnseen };
|
|
56
|
+
// The last pinned first, as several may be: a conversation's file, a folder's key.
|
|
57
|
+
const pinKey = React.useCallback((key, pin) => {
|
|
58
|
+
const others = latest.current.pinned.filter(other => other !== key);
|
|
59
|
+
latest.current.onPinned(pin ? [key, ...others] : others);
|
|
60
|
+
}, []);
|
|
477
61
|
const actions = React.useMemo(() => {
|
|
478
62
|
const pick = (change) => {
|
|
479
63
|
void change;
|
|
@@ -489,12 +73,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
489
73
|
(_a = latest.current.double) === null || _a === void 0 ? void 0 : _a.hand(entry, ChatListUtil.title(entry, latest.current.t));
|
|
490
74
|
}
|
|
491
75
|
},
|
|
492
|
-
|
|
493
|
-
pin: (entry, pin) => {
|
|
494
|
-
const file = ChatListUtil.file(entry);
|
|
495
|
-
const others = latest.current.pinned.filter(other => other !== file);
|
|
496
|
-
latest.current.onPinned(pin ? [file, ...others] : others);
|
|
497
|
-
},
|
|
76
|
+
pin: (entry, pin) => pinKey(ChatListUtil.pinKey(entry), pin),
|
|
498
77
|
letGo: entry => latest.current.onLetGo(entry),
|
|
499
78
|
markUnseen: (entry, unseen) => latest.current.onUnseen(entry, unseen),
|
|
500
79
|
extensionMenu: (entry, title) => {
|
|
@@ -509,7 +88,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
509
88
|
return latest.current.sessionMenus.flatMap(menu => menu(session)).filter(item => !item.disabled);
|
|
510
89
|
},
|
|
511
90
|
};
|
|
512
|
-
}, []);
|
|
91
|
+
}, [pinKey]);
|
|
513
92
|
// A failure is a notice of the chat.
|
|
514
93
|
const pick = (change) => {
|
|
515
94
|
void change;
|
|
@@ -522,49 +101,182 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
522
101
|
const foldBefore = searching ? undefined : WorkbenchUtil.daysAgo(now, foldDays);
|
|
523
102
|
// Those an extension archives sooner (WebChatIcon.archiveDays), asked again as its icons change.
|
|
524
103
|
const icons = React.useContext(ChatIcons);
|
|
525
|
-
|
|
526
|
-
|
|
104
|
+
const sooner = React.useMemo(() => ChatIconUtil.archiveSince(icons.entries, now), [icons, now]);
|
|
105
|
+
// Those an extension folds into a row of their folder (WebChatIcon.folder), asked again as its icons change.
|
|
106
|
+
const folderOf = React.useMemo(() => ChatIconUtil.folderOf(icons.entries), [icons]);
|
|
527
107
|
// One that waits for the user is not archived, however old, as one pinned.
|
|
528
108
|
const kept = React.useMemo(() => ChatListUtil.keptFiles([...saved, ...(archivedSaved !== null && archivedSaved !== void 0 ? archivedSaved : [])], pinned, letGo), [saved, archivedSaved, pinned, letGo]);
|
|
529
|
-
const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, kept, sooner), [sessions, saved, removedFiles, archivedSaved, since, kept, sooner]);
|
|
109
|
+
const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, kept, sooner, folderOf), [sessions, saved, removedFiles, archivedSaved, since, kept, sooner, folderOf]);
|
|
110
|
+
// A folder pinned holds its archived conversations too, and stays once they all are: a row pinned never goes away.
|
|
111
|
+
const { held, rest: archivedRest } = React.useMemo(() => ChatListUtil.heldByPinned(archived, folderOf, pinned), [archived, folderOf, pinned]);
|
|
530
112
|
const sources = React.useMemo(() => ChatListUtil.sources(listed), [listed]);
|
|
113
|
+
// The double's tasks: what waits for the user above the rest, those that are no conversation rows by their time.
|
|
114
|
+
const allTasks = home === null || home === void 0 ? void 0 : home.tasks;
|
|
115
|
+
const homeTasks = React.useMemo(() => (allTasks ? ChatHomeUtil.tasks(allTasks) : undefined), [allTasks]);
|
|
116
|
+
// The rows extensions add to the double's list (a daily brief), and the conversations they stand for.
|
|
117
|
+
const allItems = home === null || home === void 0 ? void 0 : home.items;
|
|
118
|
+
const homeItems = React.useMemo(() => (allItems ? ChatHomeUtil.items(allItems) : []), [allItems]);
|
|
119
|
+
const standIns = React.useMemo(() => ChatHomeUtil.standIns(homeItems), [homeItems]);
|
|
120
|
+
// On the double's list its own conversation is its card, one that waits for the user is under the card, and one a
|
|
121
|
+
// row of the home stands for is that row.
|
|
122
|
+
const onHome = React.useCallback((entry) => !!homeTasks &&
|
|
123
|
+
((!!double && ChatListUtil.isDouble(entry, double)) ||
|
|
124
|
+
homeTasks.hidden.has(ChatListUtil.file(entry)) ||
|
|
125
|
+
standIns.has(ChatListUtil.file(entry)) ||
|
|
126
|
+
(ChatListUtil.isOpen(entry) && homeTasks.hidden.has(entry.sessionId))), [homeTasks, double, standIns]);
|
|
531
127
|
// A search finds the archived too.
|
|
532
|
-
const shown = React.useMemo(() => ChatListUtil.filter(searching ? [...listed, ...archived] : listed, query, t), [listed, archived, searching, query, t]);
|
|
128
|
+
const shown = React.useMemo(() => ChatListUtil.filter(searching ? [...listed, ...archived] : listed, query, t).filter(entry => !onHome(entry)), [listed, archived, searching, query, t, onHome]);
|
|
129
|
+
// The conversation of a task (WebTask.session), by its file or the id of its session.
|
|
130
|
+
const byFile = React.useMemo(() => new Map(listed.flatMap(entry => [
|
|
131
|
+
[ChatListUtil.file(entry), entry],
|
|
132
|
+
...(ChatListUtil.isOpen(entry) ? [[entry.sessionId, entry]] : []),
|
|
133
|
+
])), [listed]);
|
|
134
|
+
// A task whose conversation the list does not have is a row of its own; those that ended before the archive's bound are archived.
|
|
135
|
+
const { listed: taskRows, archived: archivedTasks } = React.useMemo(() => ChatHomeUtil.rows(homeTasks, allTasks, file => byFile.has(file), query, searching ? undefined : since, archived.map(ChatListUtil.file)), [homeTasks, allTasks, byFile, query, searching, since, archived]);
|
|
533
136
|
const shownRemoved = React.useMemo(() => ChatListUtil.filter(removed, query, t), [removed, query, t]);
|
|
534
|
-
// Those
|
|
535
|
-
|
|
536
|
-
const apart = React.useMemo(() => ChatListUtil.pinnedApart(
|
|
137
|
+
// Those pinned at the top, whatever their day or directory. Those that wait for the user to decide stay where they
|
|
138
|
+
// are, marked by a blue ?: the double's home gathers them (docs/design/ta-decide.md).
|
|
139
|
+
const apart = React.useMemo(() => ChatListUtil.pinnedApart(shown, pinned), [shown, pinned]);
|
|
140
|
+
// Each folder one row where its latest is; those pinned or asking the user stay above, as any other.
|
|
141
|
+
const { folders: allFolders, rest } = React.useMemo(() => (searching ? { folders: [], rest: apart.rest } : ChatListUtil.folders([...apart.rest, ...held], folderOf)), [apart.rest, held, folderOf, searching]);
|
|
142
|
+
// A folder pinned is a row of those pinned, as a conversation pinned; so is a row of the home.
|
|
143
|
+
const { pinned: pinnedFolders, rest: folders } = React.useMemo(() => ChatListUtil.pinnedApart(allFolders, pinned), [allFolders, pinned]);
|
|
144
|
+
const homeRows = React.useMemo(() => homeItems.filter(item => ChatHomeUtil.matches(query, item.title, item.detail)).map(ChatHomeUtil.homeRow), [homeItems, query]);
|
|
145
|
+
const { pinned: pinnedHome, rest: homeRest } = React.useMemo(() => ChatListUtil.pinnedApart(homeRows, pinned), [homeRows, pinned]);
|
|
146
|
+
const pinnedRows = React.useMemo(() => ChatListUtil.withFolders(apart.pinned, [...pinnedFolders, ...pinnedHome]), [apart.pinned, pinnedFolders, pinnedHome]);
|
|
147
|
+
useOfferPins(listed, folderOf, homeItems);
|
|
148
|
+
// The folder opened: all of it, those pinned too, as the search of the list finds them; one of the archive, its archived.
|
|
149
|
+
const folder = React.useMemo(() => folderShown
|
|
150
|
+
? ChatListUtil.folders(folderShown.archived ? archivedRest : [...listed, ...held], folderOf).folders.find(candidate => candidate.key === folderShown.key)
|
|
151
|
+
: undefined, [folderShown, listed, held, archivedRest, folderOf]);
|
|
152
|
+
const folderRows = React.useMemo(() => (folder ? ChatListUtil.filter(folder.sessions, query, t) : []), [folder, query, t]);
|
|
153
|
+
const folderOpen = !!folder && !!(folderShown === null || folderShown === void 0 ? void 0 : folderShown.open);
|
|
537
154
|
const lookedAt = looking ? sessions.find(session => session.sessionId === looking) : undefined;
|
|
538
155
|
const inFront = lookedAt && ChatListUtil.file(lookedAt);
|
|
539
156
|
// What a search finds is one list by day, wherever it is.
|
|
540
157
|
const grouped = byDirectory && sources.length > 1 && !searching;
|
|
541
|
-
const archiveShown = archiveDays > 0 && (archivedSaved ?
|
|
542
|
-
const readArchive = (
|
|
543
|
-
if (archiveDays > 0) {
|
|
544
|
-
onArchive();
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
// One pinned long ago is in the archive, which the list reads for it.
|
|
548
|
-
const pinnedAway = !archivedSaved && pinned.some(file => !listed.some(session => ChatListUtil.file(session) === file) && !removedFiles.includes(file));
|
|
549
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: once as a search starts, or as the list has none (all may be archived) or misses one pinned
|
|
550
|
-
React.useEffect(() => {
|
|
551
|
-
if (searching || listed.length === 0 || pinnedAway) {
|
|
552
|
-
readArchive();
|
|
553
|
-
}
|
|
554
|
-
}, [searching, listed.length === 0, pinnedAway]);
|
|
158
|
+
const archiveShown = archiveDays > 0 && (archivedSaved ? archivedRest.length + archivedTasks.length > 0 : listed.length > 0 || archivedTasks.length > 0);
|
|
159
|
+
const readArchive = useReadArchive({ archiveDays, onArchive, read: !!archivedSaved, searching, listed, pinned, folderOf, removed: removedFiles });
|
|
555
160
|
const draftIn = (cwd) => pick(chat.draft().then(() => chat.setDraftCwd(cwd)));
|
|
556
161
|
const fold = (key) => onFolded(folded.includes(key) ? folded.filter(other => other !== key) : [...folded, key]);
|
|
557
162
|
const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources([...archived, ...removed])].map(candidate => [candidate.key, candidate])), [sources, archived, removed]);
|
|
558
|
-
const isSelected = (session) => ChatListUtil.key(session) === selected;
|
|
163
|
+
const isSelected = (session) => (typeof session === 'string' ? session : ChatListUtil.key(session)) === selected;
|
|
559
164
|
const isUnseen = (session) => ChatSeenUtil.unseen({ ...session, isStreaming: ChatListUtil.isOpen(session) && session.isStreaming }, ChatListUtil.file(session), seen, inFront);
|
|
560
165
|
// What is folded or not drawn yet still has the conversation shown, and those unseen: the dot of the tab finds them.
|
|
561
166
|
const stays = (session) => isSelected(session) || isUnseen(session);
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
const
|
|
167
|
+
const taskUnseen = (task) => ChatHomeUtil.unseen(task, seen);
|
|
168
|
+
// A folder has the conversation shown and those unseen when one of its own does.
|
|
169
|
+
const rowStays = (row) => ChatListUtil.isFolder(row)
|
|
170
|
+
? row.sessions.some(stays)
|
|
171
|
+
: ChatListUtil.isTask(row)
|
|
172
|
+
? taskUnseen(row.task)
|
|
173
|
+
: ChatListUtil.isHome(row)
|
|
174
|
+
? !!row.item.unseen
|
|
175
|
+
: stays(row);
|
|
176
|
+
const budget = ChatListUtil.budget(pageCount, rowStays);
|
|
177
|
+
const pinnedKeys = React.useMemo(() => new Set(pinned), [pinned]);
|
|
178
|
+
const drafts = useDrafts();
|
|
179
|
+
// Not that of the conversation shown, whose box holds it in sight.
|
|
180
|
+
const draftOf = (session) => {
|
|
181
|
+
const place = double && ChatListUtil.isDouble(session, double) ? DraftPlaces.DOUBLE : DraftPlaces.chat(ChatListUtil.file(session));
|
|
182
|
+
const kept = isSelected(session) ? undefined : drafts[place];
|
|
183
|
+
return kept && DraftsUtil.preview(kept);
|
|
184
|
+
};
|
|
185
|
+
const item = (session, compact) => { var _a; var _b; return (React.createElement(ChatItem, { key: ChatListUtil.key(session), session: session, source: byKey.get(ChatListUtil.sourceKey(session)), selected: ChatListUtil.key(session) === selected, time: ChatListUtil.clock(session.updatedAt, now), compact: compact, actions: actions, task: (_b = (ChatListUtil.isOpen(session) ? double === null || double === void 0 ? void 0 : double.tasks.get(session.sessionId) : undefined)) !== null && _b !== void 0 ? _b : (session.sessionFile ? double === null || double === void 0 ? void 0 : double.tasks.get(session.sessionFile) : undefined), doubleName: double && ChatListUtil.isDouble(session, double) ? double.name : undefined, handable: !!double && ChatListUtil.isOpen(session) && !session.group && !double.tasks.has(session.sessionId) && !ChatListUtil.isDouble(session, double), pinned: pinnedKeys.has(ChatListUtil.file(session)), unseen: isUnseen(session), asking: (_a = ChatAskUtil.asking(session, letGo)) === null || _a === void 0 ? void 0 : _a.question, draft: draftOf(session) })); };
|
|
186
|
+
// What an agent reads of the list and does to it (docs/design/ta-app-use.md 3): the screen keeps the rows drawn in sight.
|
|
187
|
+
const inSight = () => (folder ? folderRows : [...apart.pinned, ...apart.rest]);
|
|
188
|
+
useScreenPart({
|
|
189
|
+
id: 'chats',
|
|
190
|
+
title: folder ? folder.title : t('ta.chat'),
|
|
191
|
+
state: () => t('ta.screen.chats', { count: shown.length, unread: shown.filter(isUnseen).length }),
|
|
192
|
+
items: () => inSight().map(entry => {
|
|
193
|
+
var _a;
|
|
194
|
+
const asking = (_a = ChatAskUtil.asking(entry, letGo)) === null || _a === void 0 ? void 0 : _a.question;
|
|
195
|
+
const marks = [
|
|
196
|
+
...(asking ? [t('ta.screen.asks', { question: asking })] : []),
|
|
197
|
+
...(isUnseen(entry) ? [t('ta.screen.unread')] : []),
|
|
198
|
+
...(pinnedKeys.has(ChatListUtil.file(entry)) ? [t('ta.chat.pinned')] : []),
|
|
199
|
+
...(ChatListUtil.isOpen(entry) && entry.isStreaming ? [t('ta.screen.working')] : []),
|
|
200
|
+
...(draftOf(entry) ? [t('ta.chat.draft')] : []),
|
|
201
|
+
];
|
|
202
|
+
return { id: ChatListUtil.file(entry), text: ChatListUtil.title(entry, t), ...(marks.length ? { marks } : {}) };
|
|
203
|
+
}),
|
|
204
|
+
actions: {
|
|
205
|
+
open: {
|
|
206
|
+
label: t('ta.screen.open'),
|
|
207
|
+
each: true,
|
|
208
|
+
run: file => {
|
|
209
|
+
const entry = inSight().find(one => ChatListUtil.file(one) === file);
|
|
210
|
+
if (entry) {
|
|
211
|
+
actions.open(entry);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
pin: {
|
|
216
|
+
label: t('ta.chat.pin'),
|
|
217
|
+
each: true,
|
|
218
|
+
command: 'chats.pin',
|
|
219
|
+
commandInput: file => ({ file, pinned: true }),
|
|
220
|
+
run: file => pinKey(file !== null && file !== void 0 ? file : '', true),
|
|
221
|
+
},
|
|
222
|
+
unpin: {
|
|
223
|
+
label: t('ta.chat.unpin'),
|
|
224
|
+
each: true,
|
|
225
|
+
command: 'chats.pin',
|
|
226
|
+
commandInput: file => ({ file, pinned: false }),
|
|
227
|
+
run: file => pinKey(file !== null && file !== void 0 ? file : '', false),
|
|
228
|
+
},
|
|
229
|
+
stop: { label: t('ta.stop'), each: true, command: 'chats.stop', commandInput: file => ({ file }) },
|
|
230
|
+
search: { label: t('ta.chat.search'), takes: 'text', run: (_file, input) => { var _a; return setQuery(String((_a = input.text) !== null && _a !== void 0 ? _a : '')); } },
|
|
231
|
+
},
|
|
232
|
+
scroll: { more: () => ((folder ? folderBudget : budget).more ? 'bottom' : undefined) },
|
|
233
|
+
});
|
|
234
|
+
// Into a folder from the top of its list, and back where the list was left.
|
|
235
|
+
const listScroll = React.useRef(0);
|
|
236
|
+
const openFolder = (key, archived) => {
|
|
237
|
+
var _a;
|
|
238
|
+
var _b;
|
|
239
|
+
listScroll.current = (_b = (_a = scroller.current) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0;
|
|
240
|
+
setFolderShown({ key, open: true, ...(archived ? { archived } : {}) });
|
|
241
|
+
setQuery('');
|
|
242
|
+
// A folder pinned lists its archived conversations too.
|
|
243
|
+
if (!archivedSaved && pinned.includes(key)) {
|
|
244
|
+
readArchive();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const closeFolder = () => {
|
|
248
|
+
setFolderShown(current => (handheld && current ? { ...current, open: false } : undefined));
|
|
249
|
+
setQuery('');
|
|
250
|
+
};
|
|
251
|
+
// On a phone the list stays under the folder, where it was; elsewhere the folder takes its place, and gives it back.
|
|
252
|
+
React.useLayoutEffect(() => {
|
|
253
|
+
if (!handheld && !folderOpen && scroller.current) {
|
|
254
|
+
scroller.current.scrollTop = listScroll.current;
|
|
255
|
+
}
|
|
256
|
+
}, [folderOpen, handheld]);
|
|
257
|
+
// Slid away, the folder is no longer drawn: nothing of it found under the list (the dot of the tab).
|
|
258
|
+
React.useEffect(() => {
|
|
259
|
+
if (!folderShown || folderShown.open) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const timer = setTimeout(() => setFolderShown(current => ((current === null || current === void 0 ? void 0 : current.open) ? current : undefined)), DeviceMotion.SHEET_MS);
|
|
263
|
+
return () => clearTimeout(timer);
|
|
264
|
+
}, [folderShown]);
|
|
265
|
+
// A folder gone (its conversations taken out, archived) is left.
|
|
266
|
+
React.useEffect(() => {
|
|
267
|
+
if (folderShown && !folder) {
|
|
268
|
+
setFolderShown(undefined);
|
|
269
|
+
}
|
|
270
|
+
}, [folderShown, folder]);
|
|
271
|
+
const folderItem = (row, archived) => (React.createElement(ChatFolderItem, { key: row.key, folder: row, time: ChatListUtil.clock(row.updatedAt, now), selected: row.sessions.some(isSelected), unseen: row.sessions.filter(isUnseen), pinned: pinnedKeys.has(row.key), onOpen: () => openFolder(row.key, archived), onPin: pin => pinKey(row.key, pin), actions: actions }));
|
|
272
|
+
const taskItem = (row) => home && (React.createElement(ChatTaskItem, { key: row.key, task: row.task, home: home, unseen: taskUnseen(row.task), time: ChatListUtil.clock(row.updatedAt, now), onPicked: onPicked }));
|
|
273
|
+
const homeItem = (row) => { var _a; return home && (React.createElement(ChatHomeItem, { key: row.key, item: row.item, time: row.item.at ? ChatListUtil.clock(row.item.at, now) : '', home: home, selected: !!row.item.sessionFile && isSelected((_a = byFile.get(row.item.sessionFile)) !== null && _a !== void 0 ? _a : row.item.sessionFile), pinned: pinnedKeys.has(row.key), onPin: pin => pinKey(row.key, pin) })); };
|
|
274
|
+
const rowItem = (row, compact) => ChatListUtil.isFolder(row) ? folderItem(row) : ChatListUtil.isTask(row) ? taskItem(row) : ChatListUtil.isHome(row) ? homeItem(row) : item(row, compact);
|
|
565
275
|
// The conversation shown is found in the list, however it came to be shown: out of a search that hides it, and scrolled to.
|
|
566
276
|
const scroller = React.useRef(null);
|
|
567
277
|
const end = React.useRef(null);
|
|
278
|
+
const folderScroller = React.useRef(null);
|
|
279
|
+
const folderEnd = React.useRef(null);
|
|
568
280
|
const reveal = React.useRef(false);
|
|
569
281
|
const hidden = !!selected && listed.some(session => ChatListUtil.key(session) === selected) && !shown.some(session => ChatListUtil.key(session) === selected);
|
|
570
282
|
// biome-ignore lint/correctness/useExhaustiveDependencies: only when another conversation is shown
|
|
@@ -576,7 +288,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
576
288
|
}, [selected]);
|
|
577
289
|
React.useEffect(() => {
|
|
578
290
|
var _a;
|
|
579
|
-
const row = reveal.current ? (_a = scroller.current) === null || _a === void 0 ? void 0 : _a.querySelector('[aria-current="true"]') : null;
|
|
291
|
+
const row = reveal.current ? (_a = (folderOpen ? folderScroller : scroller).current) === null || _a === void 0 ? void 0 : _a.querySelector('[aria-current="true"]') : null;
|
|
580
292
|
if (row) {
|
|
581
293
|
reveal.current = false;
|
|
582
294
|
row.scrollIntoView({ block: 'nearest' });
|
|
@@ -587,101 +299,184 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
|
|
|
587
299
|
React.createElement(Icon, { icon: ChevronRight, size: 13 }),
|
|
588
300
|
label));
|
|
589
301
|
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left.
|
|
302
|
+
// A group of the list by directory: its head, and its conversations, those older folded.
|
|
303
|
+
const groupSection = (key, head, sessions) => {
|
|
304
|
+
const closed = folded.includes(key);
|
|
305
|
+
const [recent, older] = ChatListUtil.split(sessions, foldBefore);
|
|
306
|
+
const olderShown = groupsOlder.includes(key);
|
|
307
|
+
// Folded, a group still has the conversation shown and those unseen; so do its older ones.
|
|
308
|
+
const candidates = closed ? sessions.filter(rowStays) : olderShown ? sessions : [...recent, ...older.filter(rowStays)];
|
|
309
|
+
const rows = budget.take(candidates);
|
|
310
|
+
if (rows.length === 0 && candidates.length > 0) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return (React.createElement("section", { key: key, className: "ta-chat-group" },
|
|
314
|
+
head,
|
|
315
|
+
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(row => rowItem(row, true))),
|
|
316
|
+
!closed &&
|
|
317
|
+
older.length > 0 &&
|
|
318
|
+
rows.length === candidates.length &&
|
|
319
|
+
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderShown, () => setGroupsOlder(olderShown ? groupsOlder.filter(other => other !== key) : [...groupsOlder, key]))));
|
|
320
|
+
};
|
|
321
|
+
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left. By
|
|
322
|
+
// directory, a folder is a group as a directory is, where its latest is.
|
|
323
|
+
// By directory, the double's tasks that are no conversation are a group of their own, where the latest of them is.
|
|
324
|
+
const doubleRows = [...homeRest, ...taskRows].sort((a, b) => b.updatedAt - a.updatedAt);
|
|
325
|
+
const taskGroup = grouped &&
|
|
326
|
+
doubleRows.length > 0 &&
|
|
327
|
+
groupSection('tasks', React.createElement("div", { className: "ta-chat-group-head" },
|
|
328
|
+
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes('tasks'), onClick: () => fold('tasks') },
|
|
329
|
+
React.createElement(DinoFace, { size: 20, mood: "idle" }),
|
|
330
|
+
React.createElement("span", { className: "ta-chat-group-label" }, t('ta.home.tasks')),
|
|
331
|
+
React.createElement("span", { className: "ta-chat-group-count" }, doubleRows.length),
|
|
332
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-chat-group-chevron" }))), doubleRows);
|
|
590
333
|
const list = grouped
|
|
591
|
-
?
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
if (
|
|
599
|
-
return
|
|
334
|
+
? [
|
|
335
|
+
...(taskGroup ? [{ latest: doubleRows[0].updatedAt, group: undefined, folder: undefined, tasks: taskGroup }] : []),
|
|
336
|
+
...ChatListUtil.groups(rest, sources).map(group => { var _a; var _b; return ({ latest: (_b = (_a = group.sessions[0]) === null || _a === void 0 ? void 0 : _a.updatedAt) !== null && _b !== void 0 ? _b : 0, group, folder: undefined }); }),
|
|
337
|
+
...folders.map(folder => ({ latest: folder.updatedAt, group: undefined, folder })),
|
|
338
|
+
]
|
|
339
|
+
.sort((a, b) => b.latest - a.latest)
|
|
340
|
+
.map(({ group, folder, tasks }) => {
|
|
341
|
+
if (tasks) {
|
|
342
|
+
return tasks;
|
|
343
|
+
}
|
|
344
|
+
if (folder) {
|
|
345
|
+
return groupSection(folder.key, React.createElement("div", { className: "ta-chat-group-head" },
|
|
346
|
+
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes(folder.key), title: folder.title, onClick: () => fold(folder.key) },
|
|
347
|
+
React.createElement(ChatIconTile, { found: folder.icon, size: 20 }),
|
|
348
|
+
React.createElement("span", { className: "ta-chat-group-label" }, folder.title),
|
|
349
|
+
React.createElement("span", { className: "ta-chat-group-count" }, folder.sessions.length),
|
|
350
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-chat-group-chevron" }))), folder.sessions);
|
|
600
351
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session, true))),
|
|
611
|
-
!closed &&
|
|
612
|
-
older.length > 0 &&
|
|
613
|
-
rows.length === candidates.length &&
|
|
614
|
-
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderShown, () => setGroupsOlder(olderShown ? groupsOlder.filter(key => key !== source.key) : [...groupsOlder, source.key]))));
|
|
352
|
+
const { source, sessions } = group;
|
|
353
|
+
return groupSection(source.key, React.createElement("div", { className: "ta-chat-group-head" },
|
|
354
|
+
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes(source.key), title: source.title, onClick: () => fold(source.key) },
|
|
355
|
+
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
356
|
+
React.createElement(HostTag, { host: source.host }),
|
|
357
|
+
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
358
|
+
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
359
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
360
|
+
source.cwd && (React.createElement(IconButton, { className: "ta-chat-group-add", icon: Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))), sessions);
|
|
615
361
|
})
|
|
616
362
|
: (() => {
|
|
617
|
-
const [recent, older] = ChatListUtil.split(
|
|
363
|
+
const [recent, older] = ChatListUtil.split(ChatListUtil.withFolders(rest, [...folders, ...taskRows, ...homeRest]), foldBefore);
|
|
618
364
|
const sections = ChatListUtil.sections(recent, now).map(section => {
|
|
619
365
|
const rows = budget.take(section.sessions);
|
|
620
366
|
return (rows.length > 0 && (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
621
367
|
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
622
|
-
React.createElement("ul", { className: "ta-side-list" }, rows.map(
|
|
368
|
+
React.createElement("ul", { className: "ta-side-list" }, rows.map(row => rowItem(row))))));
|
|
623
369
|
});
|
|
624
370
|
// Folded, the older still have the conversation shown and those unseen, drawn even before the rows above them are.
|
|
625
371
|
const cut = budget.more;
|
|
626
|
-
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(
|
|
372
|
+
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(rowStays)) : [];
|
|
627
373
|
return [
|
|
628
374
|
...sections,
|
|
629
375
|
older.length > 0 && (!cut || olderRows.length > 0) && (React.createElement("section", { key: "older", className: "ta-chat-section ta-chat-older" },
|
|
630
376
|
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderOpen, () => setOlderOpen(!olderOpen)),
|
|
631
|
-
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(
|
|
377
|
+
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(row => rowItem(row))))),
|
|
632
378
|
];
|
|
633
379
|
})();
|
|
634
380
|
// The archive, after the list once it is all drawn: read each time it opens, as it is not read with the list.
|
|
635
381
|
const archive = !searching && archiveShown && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-archive" },
|
|
636
|
-
toggle(archivedSaved ? t('ta.chat.archivedCount', { count:
|
|
382
|
+
toggle(archivedSaved ? t('ta.chat.archivedCount', { count: archivedRest.length + archivedTasks.length }) : t('ta.chat.archived'), archiveOpen, () => {
|
|
637
383
|
if (!archiveOpen) {
|
|
638
384
|
readArchive();
|
|
639
385
|
}
|
|
640
386
|
setArchiveOpen(!archiveOpen);
|
|
641
387
|
}, t('ta.chat.archivedHint', { count: archiveDays })),
|
|
642
388
|
archiveOpen &&
|
|
643
|
-
(archivedSaved ? (React.createElement("ul", { className: "ta-side-list" }, budget
|
|
644
|
-
|
|
389
|
+
(archivedSaved ? (React.createElement("ul", { className: "ta-side-list" }, budget
|
|
390
|
+
.take(ChatListUtil.archiveRows(ChatListUtil.filter(archivedRest, '', t), folderOf, archivedTasks))
|
|
391
|
+
.map(row => (ChatListUtil.isFolder(row) ? folderItem(row, true) : rowItem(row))))) : (React.createElement(Loading, { compact: true })))));
|
|
645
392
|
const taken = shownRemoved.length > 0 && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-removed" },
|
|
646
393
|
toggle(t('ta.chat.removed', { count: shownRemoved.length }), removedOpen, () => setRemovedOpen(!removedOpen)),
|
|
647
394
|
removedOpen && (React.createElement("ul", { className: "ta-side-list" }, budget.take(shownRemoved).map(session => (React.createElement(ChatItem, { key: ChatListUtil.key(session), session: session, source: byKey.get(ChatListUtil.sourceKey(session)), selected: false, time: ChatListUtil.clock(session.updatedAt, now), actions: actions, restorable: true })))))));
|
|
648
|
-
//
|
|
649
|
-
const
|
|
650
|
-
React.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
395
|
+
// The folder opened, by day as the list is: its own list and its own budget, the search finding in it.
|
|
396
|
+
const folderBudget = ChatListUtil.budget(pageCount, stays);
|
|
397
|
+
const folderList = folder && (React.createElement(React.Fragment, null,
|
|
398
|
+
ChatListUtil.sections(folderBudget.take(folderRows), now).map(section => (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
399
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
400
|
+
React.createElement("ul", { className: "ta-side-list" }, section.sessions.map(session => item(session)))))),
|
|
401
|
+
folderRows.length === 0 && React.createElement(EmptyState, { title: t('ta.chat.noMatch') })));
|
|
402
|
+
// Only those going on, as the row of the double opened the list: the one shown stays, though seen once opened.
|
|
403
|
+
const busyRows = React.useMemo(() => {
|
|
404
|
+
var _a;
|
|
405
|
+
if (!busy) {
|
|
406
|
+
return [];
|
|
654
407
|
}
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
React.createElement(
|
|
668
|
-
React.createElement(
|
|
669
|
-
|
|
670
|
-
|
|
408
|
+
const others = new Set([...((_a = double === null || double === void 0 ? void 0 : double.tasks.keys()) !== null && _a !== void 0 ? _a : []), double === null || double === void 0 ? void 0 : double.session, double === null || double === void 0 ? void 0 : double.sessionFile].filter((id) => !!id));
|
|
409
|
+
const going = ChatBusyUtil.list(sessions, saved, removedFiles, others, seen, letGo, entry => !!(folderOf === null || folderOf === void 0 ? void 0 : folderOf(entry))).entries.map(each => each.entry);
|
|
410
|
+
const kept = selected && !going.some(entry => ChatListUtil.key(entry) === selected) ? listed.find(entry => ChatListUtil.key(entry) === selected) : undefined;
|
|
411
|
+
const rows = kept ? [...going, kept] : going;
|
|
412
|
+
// Those that wait first, as the double's row counts them, not by when they last said something.
|
|
413
|
+
const found = new Set(ChatListUtil.filter(rows, query, t));
|
|
414
|
+
return rows.filter(entry => found.has(entry));
|
|
415
|
+
}, [busy, double, sessions, saved, removedFiles, seen, letGo, folderOf, selected, listed, query, t]);
|
|
416
|
+
const busyContent = (React.createElement(React.Fragment, null,
|
|
417
|
+
React.createElement("div", { className: "ta-chat-filter" },
|
|
418
|
+
React.createElement("button", { type: "button", className: "ta-chat-filter-chip", title: t('ta.chats.busyClear'), onClick: () => onBusy === null || onBusy === void 0 ? void 0 : onBusy(false) },
|
|
419
|
+
React.createElement("span", null, t('ta.chats.busyFilter')),
|
|
420
|
+
React.createElement("span", { className: "ta-chat-filter-count" }, busyRows.length),
|
|
421
|
+
React.createElement(Icon, { icon: X, size: 13 }))),
|
|
422
|
+
busyRows.length > 0 ? (React.createElement("ul", { className: "ta-side-list" }, busyRows.map(session => item(session)))) : (React.createElement(EmptyState, { title: t(query.trim() ? 'ta.chat.noMatch' : 'ta.chats.busyNone') }))));
|
|
423
|
+
// The double's card and the rows under it, then what waits for the user: above all the rest.
|
|
424
|
+
const homeWaiting = homeTasks ? homeTasks.waiting.filter(task => ChatHomeUtil.matches(query, task.title, task.detail)) : [];
|
|
425
|
+
const doubleEntry = home && double ? listed.find(entry => ChatListUtil.isDouble(entry, double)) : undefined;
|
|
426
|
+
const homeTop = home && (React.createElement(ChatHomeTop, { home: home, double: ChatHomeUtil.matches(query, home.double.name), waiting: homeWaiting, counts: ChatHomeUtil.counts(home.tasks, task => {
|
|
427
|
+
const entry = task.session ? byFile.get(task.session) : undefined;
|
|
428
|
+
return entry ? isUnseen(entry) : !task.session && taskUnseen(task);
|
|
429
|
+
}), unseen: !!doubleEntry && isUnseen(doubleEntry), now: now, onPicked: onPicked }));
|
|
430
|
+
const nothingFound = shown.length === 0 && taskRows.length === 0 && homeRows.length === 0;
|
|
431
|
+
const listContent = busy ? (busyContent) : (React.createElement(React.Fragment, null,
|
|
432
|
+
homeTop,
|
|
433
|
+
pinnedRows.length > 0 && (React.createElement("section", { className: "ta-chat-section ta-chat-pinned" },
|
|
434
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t('ta.chat.pinned')),
|
|
435
|
+
React.createElement("ul", { className: "ta-side-list" }, pinnedRows.map(row => rowItem(row))))),
|
|
436
|
+
list,
|
|
437
|
+
nothingFound && (!home || searching) && (React.createElement(EmptyState, { title: t(listed.length ? 'ta.chat.noMatch' : 'ta.chat.none'), hint: listed.length ? undefined : t('ta.chat.noneHint') })),
|
|
438
|
+
archive,
|
|
439
|
+
taken));
|
|
440
|
+
// Near the end of what is drawn, the next page is: the mark at the end is seen well before it scrolls into view.
|
|
441
|
+
const nextPage = () => setPaged({ query, count: pageCount + CHAT_PAGE });
|
|
442
|
+
const pageKey = `${pageCount}:${query}`;
|
|
443
|
+
usePageEnd(budget.more && !(folderOpen && !handheld), scroller, end, nextPage, pageKey);
|
|
444
|
+
usePageEnd(!!folder && folderBudget.more, folderScroller, folderEnd, nextPage, pageKey);
|
|
445
|
+
const head = (React.createElement("header", { className: "ta-chats-head" },
|
|
446
|
+
React.createElement("label", { className: "ta-chats-search" },
|
|
447
|
+
React.createElement(Icon, { icon: Search, size: 15 }),
|
|
448
|
+
React.createElement("input", { value: query, placeholder: t('ta.chat.search'), "aria-label": t('ta.chat.search'), onChange: event => setQuery(event.target.value) }),
|
|
449
|
+
query ? (React.createElement(IconButton, { className: "ta-chats-clear", icon: X, label: t('ta.close'), onClick: () => setQuery('') })) : (sources.length > 1 && (React.createElement(IconButton, { className: "ta-chats-view", icon: FolderTree, label: t('ta.chat.byDirectory'), "aria-pressed": byDirectory, onClick: () => onByDirectory(!byDirectory) })))),
|
|
450
|
+
React.createElement(IconButton, { className: "ta-chats-add", icon: Plus, label: t('ta.chat.new'), onClick: () => pick(chat.draft()) })));
|
|
451
|
+
const listPane = (React.createElement("div", { className: "ta-side-scroll", ref: scroller },
|
|
452
|
+
listContent,
|
|
453
|
+
budget.more && React.createElement("div", { ref: end, className: "ta-chat-more", "aria-hidden": "true" })));
|
|
454
|
+
const folderPane = folder && (React.createElement(React.Fragment, null,
|
|
455
|
+
React.createElement("div", { className: "ta-chat-folder-head" },
|
|
456
|
+
React.createElement(IconButton, { className: "ta-chat-folder-back", icon: ChevronLeft, label: t('ta.back'), onClick: closeFolder }),
|
|
457
|
+
React.createElement("span", { className: "ta-chat-folder-title" }, folder.title),
|
|
458
|
+
React.createElement("span", { className: "ta-chat-group-count" }, folder.sessions.length)),
|
|
459
|
+
React.createElement("div", { className: "ta-side-scroll", ref: folderScroller },
|
|
460
|
+
folderList,
|
|
461
|
+
folderBudget.more && React.createElement("div", { ref: folderEnd, className: "ta-chat-more", "aria-hidden": "true" }))));
|
|
462
|
+
// On a phone those going on are a page pushed over a tab (AppShell's PhoneHome): its head, as a folder's, goes back.
|
|
463
|
+
if (busy && handheld) {
|
|
464
|
+
return (React.createElement("section", { className: "ta-chats", "aria-label": t('ta.chats.busy'), ...ScreenUtil.part('chats') },
|
|
465
|
+
React.createElement("div", { className: "ta-chat-folder-head" },
|
|
466
|
+
React.createElement(IconButton, { className: "ta-chat-folder-back", icon: ChevronLeft, label: t('ta.back'), onClick: () => onBusy === null || onBusy === void 0 ? void 0 : onBusy(false) }),
|
|
467
|
+
React.createElement("span", { className: "ta-chat-folder-title" }, t('ta.chats.busy')),
|
|
468
|
+
React.createElement("span", { className: "ta-chat-group-count" }, busyRows.length)),
|
|
469
|
+
notice,
|
|
470
|
+
React.createElement("div", { className: "ta-side-scroll", ref: scroller }, busyRows.length > 0 ? (React.createElement("ul", { className: "ta-side-list" }, busyRows.map(session => item(session)))) : (React.createElement(EmptyState, { title: t('ta.chats.busyNone') })))));
|
|
471
|
+
}
|
|
472
|
+
// On a phone the folder is pushed over the list, as a page of iOS: back with its button, a swipe from the left
|
|
473
|
+
// edge or the back of the system; the list keeps its search, which finds the runs one by one.
|
|
474
|
+
return (React.createElement("section", { className: "ta-chats", "aria-label": t('ta.chat'), ...ScreenUtil.part('chats') }, handheld ? (React.createElement(PhoneStack, { base: React.createElement(React.Fragment, null,
|
|
475
|
+
head,
|
|
476
|
+
notice,
|
|
477
|
+
listPane), top: folderPane, open: folderOpen, onClose: closeFolder })) : (React.createElement(React.Fragment, null,
|
|
478
|
+
head,
|
|
671
479
|
notice,
|
|
672
|
-
|
|
673
|
-
asks.asking.length > 0 && (React.createElement("section", { className: "ta-chat-section ta-chat-asks" },
|
|
674
|
-
React.createElement("div", { className: "ta-chat-section-title" },
|
|
675
|
-
t('ta.chat.asks'),
|
|
676
|
-
React.createElement("span", { className: "ta-chat-asks-count" }, asks.asking.length)),
|
|
677
|
-
React.createElement("ul", { className: "ta-side-list" }, asks.asking.map(session => item(session))))),
|
|
678
|
-
apart.pinned.length > 0 && (React.createElement("section", { className: "ta-chat-section ta-chat-pinned" },
|
|
679
|
-
React.createElement("div", { className: "ta-chat-section-title" }, t('ta.chat.pinned')),
|
|
680
|
-
React.createElement("ul", { className: "ta-side-list" }, apart.pinned.map(session => item(session))))),
|
|
681
|
-
list,
|
|
682
|
-
shown.length === 0 && (React.createElement(EmptyState, { title: t(listed.length ? 'ta.chat.noMatch' : 'ta.chat.none'), hint: listed.length ? undefined : t('ta.chat.noneHint') })),
|
|
683
|
-
archive,
|
|
684
|
-
taken,
|
|
685
|
-
more && React.createElement("div", { ref: end, className: "ta-chat-more", "aria-hidden": "true" }))));
|
|
480
|
+
folderOpen ? folderPane : listPane))));
|
|
686
481
|
}
|
|
687
482
|
//# sourceMappingURL=chat-list.js.map
|