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