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