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