@celljs/ta-web 4.10.0 → 4.11.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 +7 -7
- package/README.md +7 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +12 -0
- package/esm/browser/assistant/assistant-extension.js +5 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
- package/esm/browser/assistant/assistant-task-util.js +59 -12
- package/esm/browser/assistant/assistant-view.js +44 -23
- package/esm/browser/assistant/assistant.d.ts +18 -4
- package/esm/browser/assistant/assistant.js +52 -17
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-protocol.d.ts +5 -0
- package/esm/browser/chat/chat-stores.d.ts +8 -5
- package/esm/browser/chat/chat-stores.js +17 -9
- package/esm/browser/chat/chat-view.js +18 -11
- package/esm/browser/chat/chat.d.ts +16 -8
- package/esm/browser/chat/chat.js +86 -51
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +5 -2
- package/esm/browser/components/app-nav.js +22 -9
- package/esm/browser/components/app-shell-hooks.js +5 -3
- package/esm/browser/components/app-view.js +76 -16
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +73 -6
- package/esm/browser/components/chat-list.js +295 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +14 -4
- package/esm/browser/components/composer-box.js +104 -64
- package/esm/browser/components/composer.d.ts +6 -6
- package/esm/browser/components/composer.js +5 -3
- package/esm/browser/components/conversation-scroll.d.ts +7 -0
- package/esm/browser/components/conversation-scroll.js +46 -7
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -3
- package/esm/browser/components/earlier-messages.js +42 -8
- package/esm/browser/components/editor-area.d.ts +6 -22
- package/esm/browser/components/editor-area.js +10 -97
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +1 -1
- package/esm/browser/components/folder-picker.js +1 -1
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +3 -1
- package/esm/browser/components/icon.js +4 -3
- package/esm/browser/components/image-viewer.d.ts +10 -2
- package/esm/browser/components/image-viewer.js +48 -11
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +5 -2
- package/esm/browser/components/lightbox.js +4 -3
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.js +36 -4
- package/esm/browser/components/media.js +19 -2
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +6 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +57 -6
- package/esm/browser/components/message-list.js +152 -36
- package/esm/browser/components/message-menu.js +6 -1
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +21 -2
- package/esm/browser/components/nav-places.js +20 -4
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +23 -1
- package/esm/browser/components/phone-shell.js +96 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +2 -3
- package/esm/browser/components/session-settings.js +1 -0
- package/esm/browser/components/session-view.js +29 -19
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.js +45 -14
- package/esm/browser/components/tool-view.js +7 -2
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +11 -3
- package/esm/browser/components/voice-talk.js +24 -4
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- package/esm/browser/device/hold.js +4 -6
- package/esm/browser/device/long-press.d.ts +10 -0
- package/esm/browser/device/long-press.js +28 -12
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/pull-down.js +3 -2
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.js +6 -1
- package/esm/browser/device/sheet-swipe.js +8 -1
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +15 -2
- package/esm/browser/extension/web-api-components.d.ts +269 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +385 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +166 -565
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +346 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +44 -6
- package/esm/browser/extension/web-extension-protocol.js +33 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +29 -69
- package/esm/browser/extension/web-extensions.js +118 -516
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -0
- package/esm/browser/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +82 -2
- package/esm/browser/i18n/messages.d.ts +81 -1
- package/esm/browser/i18n/messages.js +167 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -0
- package/esm/browser/links/links-protocol.d.ts +5 -0
- package/esm/browser/links/links.d.ts +19 -7
- package/esm/browser/links/links.js +57 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +17 -0
- package/esm/browser/notices/notices.d.ts +1 -1
- package/esm/browser/notices/notices.js +6 -2
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.js +12 -3
- package/esm/browser/offline/offline-reads.js +3 -1
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +15 -0
- package/esm/browser/settings/settings-protocol.js +18 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +43 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +189 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +36 -1
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +30 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +2 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +4 -1
- package/esm/browser/util/markdown.js +1 -1
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +14 -2
- package/esm/browser/util/process.js +39 -8
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +47 -7
- package/esm/browser/util/voice.js +269 -27
- package/esm/browser/workbench-calls.d.ts +6 -4
- package/esm/browser/workbench-calls.js +15 -10
- package/esm/browser/workbench-protocol.d.ts +31 -2
- package/esm/browser/workbench-util.d.ts +15 -4
- package/esm/browser/workbench-util.js +28 -5
- package/esm/browser/workbench.d.ts +33 -1
- package/esm/browser/workbench.js +142 -14
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +13 -0
- package/lib/browser/assistant/assistant-extension.js +5 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
- package/lib/browser/assistant/assistant-task-util.js +59 -12
- package/lib/browser/assistant/assistant-view.js +42 -21
- package/lib/browser/assistant/assistant.d.ts +18 -4
- package/lib/browser/assistant/assistant.js +52 -17
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-protocol.d.ts +5 -0
- package/lib/browser/chat/chat-stores.d.ts +8 -5
- package/lib/browser/chat/chat-stores.js +17 -9
- package/lib/browser/chat/chat-view.js +17 -10
- package/lib/browser/chat/chat.d.ts +16 -8
- package/lib/browser/chat/chat.js +86 -51
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +5 -2
- package/lib/browser/components/app-nav.js +18 -5
- package/lib/browser/components/app-shell-hooks.js +5 -3
- package/lib/browser/components/app-view.js +72 -12
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +73 -6
- package/lib/browser/components/chat-list.js +295 -59
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +14 -4
- package/lib/browser/components/composer-box.js +102 -62
- package/lib/browser/components/composer.d.ts +6 -6
- package/lib/browser/components/composer.js +4 -2
- package/lib/browser/components/conversation-scroll.d.ts +7 -0
- package/lib/browser/components/conversation-scroll.js +46 -7
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -3
- package/lib/browser/components/earlier-messages.js +44 -9
- package/lib/browser/components/editor-area.d.ts +6 -22
- package/lib/browser/components/editor-area.js +11 -98
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +1 -1
- package/lib/browser/components/folder-picker.js +1 -1
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +3 -1
- package/lib/browser/components/icon.js +4 -3
- package/lib/browser/components/image-viewer.d.ts +10 -2
- package/lib/browser/components/image-viewer.js +47 -10
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +5 -2
- package/lib/browser/components/lightbox.js +4 -3
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.js +36 -4
- package/lib/browser/components/media.js +19 -2
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +6 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +57 -6
- package/lib/browser/components/message-list.js +153 -34
- package/lib/browser/components/message-menu.js +6 -1
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +21 -2
- package/lib/browser/components/nav-places.js +22 -4
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +23 -1
- package/lib/browser/components/phone-shell.js +97 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +2 -3
- package/lib/browser/components/session-settings.js +1 -0
- package/lib/browser/components/session-view.js +26 -16
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.js +43 -12
- package/lib/browser/components/tool-view.js +7 -2
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +11 -3
- package/lib/browser/components/voice-talk.js +25 -4
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- package/lib/browser/device/hold.js +4 -6
- package/lib/browser/device/long-press.d.ts +10 -0
- package/lib/browser/device/long-press.js +28 -12
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/pull-down.js +3 -2
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.js +6 -1
- package/lib/browser/device/sheet-swipe.js +8 -1
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +14 -1
- package/lib/browser/extension/web-api-components.d.ts +270 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +386 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +166 -565
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +383 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +44 -6
- package/lib/browser/extension/web-extension-protocol.js +34 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +29 -69
- package/lib/browser/extension/web-extensions.js +114 -545
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -0
- package/lib/browser/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +82 -2
- package/lib/browser/i18n/messages.d.ts +81 -1
- package/lib/browser/i18n/messages.js +167 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -0
- package/lib/browser/links/links-protocol.d.ts +5 -0
- package/lib/browser/links/links.d.ts +19 -7
- package/lib/browser/links/links.js +57 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +17 -0
- package/lib/browser/notices/notices.d.ts +1 -1
- package/lib/browser/notices/notices.js +6 -2
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.js +12 -3
- package/lib/browser/offline/offline-reads.js +3 -1
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +15 -0
- package/lib/browser/settings/settings-protocol.js +19 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +43 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +189 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +36 -1
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +30 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +2 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +4 -1
- package/lib/browser/util/markdown.js +1 -1
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +14 -2
- package/lib/browser/util/process.js +39 -8
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +47 -7
- package/lib/browser/util/voice.js +269 -27
- package/lib/browser/workbench-calls.d.ts +6 -4
- package/lib/browser/workbench-calls.js +15 -10
- package/lib/browser/workbench-protocol.d.ts +31 -2
- package/lib/browser/workbench-util.d.ts +15 -4
- package/lib/browser/workbench-util.js +28 -5
- package/lib/browser/workbench.d.ts +33 -1
- package/lib/browser/workbench.js +140 -12
- package/package.json +11 -8
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.MessageFooterUtil = exports.MessageActions = void 0;
|
|
37
37
|
exports.useTimeLabel = useTimeLabel;
|
|
38
38
|
exports.TimeBreak = TimeBreak;
|
|
39
|
+
exports.ModelBreak = ModelBreak;
|
|
39
40
|
exports.UserFooter = UserFooter;
|
|
40
41
|
exports.TurnFooter = TurnFooter;
|
|
41
42
|
const lucide_react_1 = require("lucide-react");
|
|
@@ -43,6 +44,7 @@ const React = __importStar(require("react"));
|
|
|
43
44
|
const use_t_1 = require("../i18n/use-t");
|
|
44
45
|
const message_1 = require("../util/message");
|
|
45
46
|
const progress_1 = require("../util/progress");
|
|
47
|
+
const quote_1 = require("../util/quote");
|
|
46
48
|
const icon_1 = require("./icon");
|
|
47
49
|
exports.MessageActions = React.createContext(undefined);
|
|
48
50
|
var MessageFooterUtil;
|
|
@@ -65,8 +67,8 @@ var MessageFooterUtil;
|
|
|
65
67
|
}
|
|
66
68
|
MessageFooterUtil.debugInfo = debugInfo;
|
|
67
69
|
})(MessageFooterUtil || (exports.MessageFooterUtil = MessageFooterUtil = {}));
|
|
68
|
-
function FooterButton({ icon, label, onClick, className }) {
|
|
69
|
-
return (React.createElement("button", { type: "button", className: className ? `ta-footer-button ${className}` : 'ta-footer-button', title: label, "aria-label": label, onClick: onClick },
|
|
70
|
+
function FooterButton({ icon, label, onClick, onMouseDown, className, }) {
|
|
71
|
+
return (React.createElement("button", { type: "button", className: className ? `ta-footer-button ${className}` : 'ta-footer-button', title: label, "aria-label": label, onClick: onClick, onMouseDown: onMouseDown },
|
|
70
72
|
React.createElement(icon_1.Icon, { icon: icon, size: 14 })));
|
|
71
73
|
}
|
|
72
74
|
/** Copies, and says so on the button for a moment. */
|
|
@@ -104,6 +106,21 @@ function Time({ timestamp, className = 'ta-footer-time' }) {
|
|
|
104
106
|
function TimeBreak({ timestamp }) {
|
|
105
107
|
return React.createElement(Time, { timestamp: timestamp, className: "ta-time-break" });
|
|
106
108
|
}
|
|
109
|
+
/** Above the first turn of another model (ProcessUtil.modelBreaks): the conversation goes on with it. */
|
|
110
|
+
function ModelBreak({ model }) {
|
|
111
|
+
const t = (0, use_t_1.useT)();
|
|
112
|
+
return (React.createElement("div", { className: "ta-model-break", title: model },
|
|
113
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.ArrowRightLeft, size: 12 }),
|
|
114
|
+
React.createElement("span", null, t('ta.message.modelSwitched', { model: model.slice(model.indexOf('/') + 1) }))));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Quotes the reply in the message box, or the part of it selected: the button keeps the selection (no focus on
|
|
118
|
+
* a press), and takes it when it is in the same message.
|
|
119
|
+
*/
|
|
120
|
+
function QuoteButton({ text, quote }) {
|
|
121
|
+
const t = (0, use_t_1.useT)();
|
|
122
|
+
return (React.createElement(FooterButton, { icon: lucide_react_1.TextQuote, label: t('ta.message.quote'), onMouseDown: event => event.preventDefault(), onClick: event => { var _a; return quote((_a = quote_1.QuoteUtil.selected(event.currentTarget.closest('.ta-message'))) !== null && _a !== void 0 ? _a : text); } }));
|
|
123
|
+
}
|
|
107
124
|
/** Under a message of the user: when, copy, a new conversation from here, back to here. */
|
|
108
125
|
function UserFooter({ message, text }) {
|
|
109
126
|
const t = (0, use_t_1.useT)();
|
|
@@ -127,6 +144,7 @@ function TurnFooter({ messages, last, reply, session, latest, }) {
|
|
|
127
144
|
const used = usage.input > 0 || usage.output > 0;
|
|
128
145
|
return (React.createElement("div", { className: latest ? 'ta-footer ta-footer-latest' : 'ta-footer' },
|
|
129
146
|
reply && React.createElement(CopyButton, { text: () => reply, icon: lucide_react_1.Copy, label: "ta.copy", done: "ta.copied" }),
|
|
147
|
+
reply && (actions === null || actions === void 0 ? void 0 : actions.quote) && React.createElement(QuoteButton, { text: reply, quote: actions.quote }),
|
|
130
148
|
last && actions && !actions.working && React.createElement(FooterButton, { icon: lucide_react_1.GitFork, label: t('ta.message.forkAt'), onClick: () => actions.fork(last, 'at') }),
|
|
131
149
|
last && (React.createElement(CopyButton, { text: () => MessageFooterUtil.debugInfo(last, session), icon: lucide_react_1.Bug, label: "ta.message.debug", done: "ta.message.debugCopied", className: "ta-footer-debug" })),
|
|
132
150
|
React.createElement(Time, { timestamp: last === null || last === void 0 ? void 0 : last.timestamp }),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { SessionState, ToolRun } from '@celljs/ta-client';
|
|
2
|
-
import { type TaSessionInfo } from '@celljs/ta-protocol';
|
|
2
|
+
import { type ImageContent, type TaSessionInfo, TaSkillUse } from '@celljs/ta-protocol';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import type { Mood } from '../avatar/dino-avatar';
|
|
5
5
|
import { MessageUtil, type ToolOutput } from '../util/message';
|
|
6
6
|
import { type ProcessStep, type ThreadItem } from '../util/process';
|
|
7
|
+
import type { RowWindow } from './earlier-messages';
|
|
7
8
|
/** The session of the conversation: who answers in it may be drawn by the extension of its group. */
|
|
8
9
|
export declare const ConversationSession: React.Context<TaSessionInfo | undefined>;
|
|
9
10
|
/** What can be done with a message sent from here that failed to go. */
|
|
@@ -16,23 +17,66 @@ export declare function TurnAvatar({ mood }: {
|
|
|
16
17
|
mood: Mood;
|
|
17
18
|
}): React.JSX.Element;
|
|
18
19
|
type Blocks = ReturnType<typeof MessageUtil.blocks>;
|
|
20
|
+
type ImageBlock = Blocks[number] & {
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Where the images of the messages of the user come from that the conversation gave without their bytes
|
|
26
|
+
* (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MessageImages: React.Context<((timestamp: number, index: number) => Promise<ImageContent | undefined>) | undefined>;
|
|
29
|
+
export declare namespace UserImageUtil {
|
|
30
|
+
/** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
|
|
31
|
+
function images(blocks: Blocks): {
|
|
32
|
+
block: ImageBlock;
|
|
33
|
+
index: number;
|
|
34
|
+
}[];
|
|
35
|
+
/** Its size in pixels: given (TaShownImage), or read from its bytes. */
|
|
36
|
+
function size(block: ImageBlock): {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
} | undefined;
|
|
40
|
+
/** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
|
|
41
|
+
function box(size: {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
} | undefined): React.CSSProperties | undefined;
|
|
45
|
+
}
|
|
19
46
|
/**
|
|
20
47
|
* The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
|
|
21
|
-
* squares of one size, and a click on any of them opens it full size over the page.
|
|
48
|
+
* squares of one size, and a click on any of them opens it full size over the page. Each has its place
|
|
49
|
+
* before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
|
|
50
|
+
* for those given without their bytes (MessageImages).
|
|
22
51
|
*/
|
|
23
|
-
export declare function UserImages({ blocks }: {
|
|
52
|
+
export declare function UserImages({ blocks, timestamp }: {
|
|
24
53
|
blocks: Blocks;
|
|
54
|
+
timestamp?: number;
|
|
25
55
|
}): React.JSX.Element | null;
|
|
26
56
|
/**
|
|
27
57
|
* What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
|
|
28
58
|
* bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
|
|
29
59
|
* `bubble` is the class of that bubble, which a conversation and the double have of their own.
|
|
30
60
|
*/
|
|
31
|
-
export declare function UserSaid({ blocks, text, bubble }: {
|
|
61
|
+
export declare function UserSaid({ blocks, text, bubble, timestamp }: {
|
|
32
62
|
blocks: Blocks;
|
|
33
63
|
text: string;
|
|
34
64
|
bubble?: string;
|
|
65
|
+
timestamp?: number;
|
|
35
66
|
}): React.JSX.Element | null;
|
|
67
|
+
/**
|
|
68
|
+
* What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
|
|
69
|
+
* pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
|
|
70
|
+
*/
|
|
71
|
+
export declare function userWords(blocks: Blocks): {
|
|
72
|
+
text: string;
|
|
73
|
+
copied: string;
|
|
74
|
+
skill?: TaSkillUse;
|
|
75
|
+
};
|
|
76
|
+
/** A skill the user ran: one line with its name, which opens to the skill's file, as a tool call opens. */
|
|
77
|
+
export declare function SkillUse({ skill }: {
|
|
78
|
+
skill: TaSkillUse;
|
|
79
|
+
}): React.JSX.Element;
|
|
36
80
|
/**
|
|
37
81
|
* The head of a turn and its work: the work in one line, "N steps", open while ta is at it, then folded,
|
|
38
82
|
* so that a long conversation reads as what was asked and what came of it. Before the first step the
|
|
@@ -50,10 +94,17 @@ export declare function Process({ steps, active, results, tools, leading, status
|
|
|
50
94
|
}): React.JSX.Element;
|
|
51
95
|
/** A turn that has shown nothing yet: what ta does goes on its head. */
|
|
52
96
|
export declare function quiet(item: ThreadItem | undefined): boolean;
|
|
53
|
-
/**
|
|
54
|
-
|
|
97
|
+
/**
|
|
98
|
+
* A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
|
|
99
|
+
* (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
|
|
100
|
+
* again when the words under the steps go into them, and it stayed out of line until something else drew.
|
|
101
|
+
*/
|
|
102
|
+
export declare function endsInSteps(item: ThreadItem | undefined): boolean;
|
|
103
|
+
/** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
|
|
104
|
+
export declare function MessageList({ state, outbox, rows }: {
|
|
55
105
|
state: SessionState;
|
|
56
106
|
outbox?: OutboxActions;
|
|
107
|
+
rows?: RowWindow;
|
|
57
108
|
}): React.JSX.Element;
|
|
58
109
|
export {};
|
|
59
110
|
//# sourceMappingURL=message-list.d.ts.map
|
|
@@ -33,18 +33,22 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ConversationSession = void 0;
|
|
36
|
+
exports.UserImageUtil = exports.MessageImages = exports.ConversationSession = void 0;
|
|
37
37
|
exports.TurnAvatar = TurnAvatar;
|
|
38
38
|
exports.UserImages = UserImages;
|
|
39
39
|
exports.UserSaid = UserSaid;
|
|
40
|
+
exports.userWords = userWords;
|
|
41
|
+
exports.SkillUse = SkillUse;
|
|
40
42
|
exports.Process = Process;
|
|
41
43
|
exports.quiet = quiet;
|
|
44
|
+
exports.endsInSteps = endsInSteps;
|
|
42
45
|
exports.MessageList = MessageList;
|
|
43
46
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
44
47
|
const lucide_react_1 = require("lucide-react");
|
|
45
48
|
const React = __importStar(require("react"));
|
|
46
49
|
const extension_view_1 = require("../extension/extension-view");
|
|
47
50
|
const use_t_1 = require("../i18n/use-t");
|
|
51
|
+
const lazy_1 = require("../markdown/lazy");
|
|
48
52
|
const message_1 = require("../util/message");
|
|
49
53
|
const process_1 = require("../util/process");
|
|
50
54
|
const tool_1 = require("../util/tool");
|
|
@@ -56,6 +60,7 @@ const markdown_1 = require("./markdown");
|
|
|
56
60
|
const message_footer_1 = require("./message-footer");
|
|
57
61
|
const message_menu_1 = require("./message-menu");
|
|
58
62
|
const run_status_1 = require("./run-status");
|
|
63
|
+
const said_text_1 = require("./said-text");
|
|
59
64
|
const ta_avatar_1 = require("./ta-avatar");
|
|
60
65
|
const tool_view_1 = require("./tool-view");
|
|
61
66
|
/** The session of the conversation: who answers in it may be drawn by the extension of its group. */
|
|
@@ -86,6 +91,8 @@ function TurnAvatar({ mood }) {
|
|
|
86
91
|
React.createElement(Avatar, { session: session, mood: mood, size: 24 })));
|
|
87
92
|
}
|
|
88
93
|
const TASK_UPDATE = /^<task_update id="[^"]+" title="([^"]*)" status="(\w+)">\n?([\s\S]*?)\n?<\/task_update>$/;
|
|
94
|
+
/** AssistantTaskUtil.renamedNote. */
|
|
95
|
+
const TASK_RENAMED = /^<task_renamed id="[^"]+" was="[^"]+"/;
|
|
89
96
|
/** What the double of the web client told ta about a task that ended: a note, not something the user said. */
|
|
90
97
|
function TaskUpdate({ title, status, result }) {
|
|
91
98
|
const t = (0, use_t_1.useT)();
|
|
@@ -96,53 +103,148 @@ function TaskUpdate({ title, status, result }) {
|
|
|
96
103
|
t(`ta.task.${status}`)),
|
|
97
104
|
React.createElement(markdown_1.Markdown, { text: result })));
|
|
98
105
|
}
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Where the images of the messages of the user come from that the conversation gave without their bytes
|
|
108
|
+
* (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
|
|
109
|
+
*/
|
|
110
|
+
exports.MessageImages = React.createContext(undefined);
|
|
111
|
+
/** The images shown lately, by message and block: drawn again at once, in this conversation or another view of it. */
|
|
112
|
+
const shownImages = new lazy_1.Recent(48);
|
|
113
|
+
/** The size of the images with their bytes, read once. */
|
|
114
|
+
const sizes = new WeakMap();
|
|
115
|
+
/** How large one image of a message is drawn, at most. */
|
|
116
|
+
const ONE_IMAGE = { width: 220, height: 280 };
|
|
117
|
+
var UserImageUtil;
|
|
118
|
+
(function (UserImageUtil) {
|
|
119
|
+
/** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
|
|
120
|
+
function images(blocks) {
|
|
121
|
+
return blocks.flatMap((block, index) => { var _a; return block.type === 'image' && ((_a = block.mimeType) === null || _a === void 0 ? void 0 : _a.startsWith('image/')) && typeof block.data === 'string' ? [{ block: block, index }] : []; });
|
|
122
|
+
}
|
|
123
|
+
UserImageUtil.images = images;
|
|
124
|
+
/** Its size in pixels: given (TaShownImage), or read from its bytes. */
|
|
125
|
+
function size(block) {
|
|
126
|
+
if (block.width && block.height) {
|
|
127
|
+
return { width: block.width, height: block.height };
|
|
128
|
+
}
|
|
129
|
+
if (!block.data) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
if (!sizes.has(block)) {
|
|
133
|
+
sizes.set(block, ta_protocol_1.TaImageSize.of(block.data));
|
|
134
|
+
}
|
|
135
|
+
return sizes.get(block);
|
|
136
|
+
}
|
|
137
|
+
UserImageUtil.size = size;
|
|
138
|
+
/** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
|
|
139
|
+
function box(size) {
|
|
140
|
+
if (!size) {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
const scale = Math.min(1, ONE_IMAGE.width / size.width, ONE_IMAGE.height / size.height);
|
|
144
|
+
return { width: Math.max(1, Math.round(size.width * scale)), aspectRatio: `${size.width} / ${size.height}` };
|
|
145
|
+
}
|
|
146
|
+
UserImageUtil.box = box;
|
|
147
|
+
})(UserImageUtil || (exports.UserImageUtil = UserImageUtil = {}));
|
|
148
|
+
/** The URLs of the images of a message: those with their bytes at once, the others as `MessageImages` gives them. */
|
|
149
|
+
function useImageSources(images, timestamp) {
|
|
150
|
+
const load = React.useContext(exports.MessageImages);
|
|
151
|
+
const keyOf = (index) => (timestamp === undefined ? undefined : `${timestamp}:${index}`);
|
|
152
|
+
const own = images.map(({ block, index }) => {
|
|
153
|
+
const key = keyOf(index);
|
|
154
|
+
return block.data ? `data:${block.mimeType};base64,${block.data}` : key ? shownImages.get(key) : undefined;
|
|
155
|
+
});
|
|
156
|
+
const [loaded, setLoaded] = React.useState({});
|
|
157
|
+
const wanted = images.filter((image, at) => !own[at] && !loaded[image.index]).map(image => image.index);
|
|
158
|
+
const missing = wanted.join(',');
|
|
159
|
+
// Asked again only for other images: `missing` says which.
|
|
160
|
+
React.useEffect(() => {
|
|
161
|
+
if (!load || timestamp === undefined || !missing) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
let live = true;
|
|
165
|
+
for (const index of missing.split(',').map(Number)) {
|
|
166
|
+
load(timestamp, index).then(image => {
|
|
167
|
+
if (image === null || image === void 0 ? void 0 : image.data) {
|
|
168
|
+
const url = `data:${image.mimeType};base64,${image.data}`;
|
|
169
|
+
shownImages.set(`${timestamp}:${index}`, url);
|
|
170
|
+
if (live) {
|
|
171
|
+
setLoaded(current => ({ ...current, [index]: url }));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}, () => undefined);
|
|
175
|
+
}
|
|
176
|
+
return () => {
|
|
177
|
+
live = false;
|
|
178
|
+
};
|
|
179
|
+
}, [load, timestamp, missing]);
|
|
180
|
+
// Those with their bytes are kept too: the same message given again without them (the conversation read again) shows them at once.
|
|
181
|
+
React.useEffect(() => {
|
|
182
|
+
images.forEach(({ block, index }, at) => {
|
|
183
|
+
const key = keyOf(index);
|
|
184
|
+
if (block.data && key && own[at]) {
|
|
185
|
+
shownImages.set(key, own[at]);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
return images.map(({ index }, at) => { var _a; return (_a = own[at]) !== null && _a !== void 0 ? _a : loaded[index]; });
|
|
102
190
|
}
|
|
103
191
|
/**
|
|
104
192
|
* The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
|
|
105
|
-
* squares of one size, and a click on any of them opens it full size over the page.
|
|
193
|
+
* squares of one size, and a click on any of them opens it full size over the page. Each has its place
|
|
194
|
+
* before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
|
|
195
|
+
* for those given without their bytes (MessageImages).
|
|
106
196
|
*/
|
|
107
|
-
function UserImages({ blocks }) {
|
|
197
|
+
function UserImages({ blocks, timestamp }) {
|
|
108
198
|
const t = (0, use_t_1.useT)();
|
|
109
199
|
const [open, setOpen] = React.useState();
|
|
110
|
-
const images =
|
|
200
|
+
const images = UserImageUtil.images(blocks);
|
|
201
|
+
const sources = useImageSources(images, timestamp);
|
|
111
202
|
if (images.length === 0) {
|
|
112
203
|
return null;
|
|
113
204
|
}
|
|
114
|
-
const
|
|
205
|
+
const single = images.length === 1 ? UserImageUtil.box(UserImageUtil.size(images[0].block)) : undefined;
|
|
206
|
+
const shown = open !== undefined ? sources[open] : undefined;
|
|
115
207
|
return (React.createElement("div", { className: "ta-user-images", "data-count": Math.min(images.length, 3) },
|
|
116
|
-
images.map((
|
|
117
|
-
|
|
118
|
-
open !== undefined && images[open] && React.createElement(lightbox_1.Lightbox, { src: src(images[open]), alt: "", onClose: () => setOpen(undefined) })));
|
|
208
|
+
images.map(({ index }, at) => (React.createElement("button", { key: index, type: "button", className: "ta-user-image", title: t('ta.markdown.enlarge'), disabled: !sources[at], onClick: () => setOpen(at) }, sources[at] ? (React.createElement("img", { className: "ta-thumb", src: sources[at], alt: "", style: single })) : (React.createElement("span", { className: "ta-thumb ta-thumb-waiting", style: single }))))),
|
|
209
|
+
open !== undefined && shown && (React.createElement(lightbox_1.Lightbox, { src: shown, alt: "", onClose: () => setOpen(undefined), onPrevious: open > 0 && sources[open - 1] ? () => setOpen(open - 1) : undefined, onNext: open < images.length - 1 && sources[open + 1] ? () => setOpen(open + 1) : undefined }))));
|
|
119
210
|
}
|
|
120
211
|
/**
|
|
121
212
|
* What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
|
|
122
213
|
* bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
|
|
123
214
|
* `bubble` is the class of that bubble, which a conversation and the double have of their own.
|
|
124
215
|
*/
|
|
125
|
-
function UserSaid({ blocks, text, bubble = 'ta-bubble' }) {
|
|
126
|
-
if (
|
|
127
|
-
return text ? React.createElement("div", { className: bubble },
|
|
216
|
+
function UserSaid({ blocks, text, bubble = 'ta-bubble', timestamp }) {
|
|
217
|
+
if (UserImageUtil.images(blocks).length === 0) {
|
|
218
|
+
return text ? (React.createElement("div", { className: bubble },
|
|
219
|
+
React.createElement(said_text_1.SaidText, { text: text }))) : null;
|
|
128
220
|
}
|
|
129
221
|
return (React.createElement("div", { className: `${bubble} ta-bubble-media${text ? '' : ' ta-bubble-bare'}` },
|
|
130
|
-
React.createElement(UserImages, { blocks: blocks }),
|
|
131
|
-
text && React.createElement(
|
|
222
|
+
React.createElement(UserImages, { blocks: blocks, timestamp: timestamp }),
|
|
223
|
+
text && React.createElement(said_text_1.SaidText, { text: text, className: "ta-bubble-text" })));
|
|
132
224
|
}
|
|
133
225
|
function UserMessage({ message }) {
|
|
134
|
-
var _a;
|
|
135
226
|
const blocks = message_1.MessageUtil.blocks(message);
|
|
136
|
-
const
|
|
227
|
+
const said = message_1.MessageUtil.text(blocks).trim();
|
|
228
|
+
if (TASK_RENAMED.test(said)) {
|
|
229
|
+
// The double's conversation opened as a conversation: what told it a task's new id is for it only.
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
const update = TASK_UPDATE.exec(said);
|
|
137
233
|
if (update) {
|
|
138
234
|
return React.createElement(TaskUpdate, { title: update[1], status: update[2], result: update[3] });
|
|
139
235
|
}
|
|
140
|
-
const
|
|
236
|
+
const { text, copied, skill } = userWords(blocks);
|
|
237
|
+
return React.createElement(UserBubble, { message: message, blocks: blocks, text: text, copied: copied, skill: skill });
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
|
|
241
|
+
* pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
|
|
242
|
+
*/
|
|
243
|
+
function userWords(blocks) {
|
|
244
|
+
var _a;
|
|
245
|
+
const said = ta_protocol_1.TaImageNote.strip(ta_protocol_1.TaMessageContext.strip(message_1.MessageUtil.text(blocks))).trim();
|
|
141
246
|
const skill = ta_protocol_1.TaSkillUse.parse(said);
|
|
142
|
-
|
|
143
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: ta_protocol_1.TaSkillUse.command(skill), skill: skill });
|
|
144
|
-
}
|
|
145
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: said, copied: said });
|
|
247
|
+
return skill ? { text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: ta_protocol_1.TaSkillUse.command(skill), skill } : { text: said, copied: said };
|
|
146
248
|
}
|
|
147
249
|
/** pi's first line of a skill it read, for the model: the path is in the title of the skill's line. */
|
|
148
250
|
const SKILL_BASE = /^References are relative to [^\n]*\n+/;
|
|
@@ -166,12 +268,12 @@ function UserBubble({ message, blocks, text, copied, skill, }) {
|
|
|
166
268
|
if (sent) {
|
|
167
269
|
// Not in the session yet: nothing to branch from or rewind to.
|
|
168
270
|
return (React.createElement("div", { className: `ta-message ta-user ${sent.failed ? 'ta-user-failed' : 'ta-user-sending'}` },
|
|
169
|
-
React.createElement(UserSaid, { blocks: blocks, text: text }),
|
|
271
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
170
272
|
sent.failed ? React.createElement(SendFailed, { sent: sent, actions: outbox.actions }) : React.createElement("div", { className: "ta-footer" })));
|
|
171
273
|
}
|
|
172
274
|
return (React.createElement("div", { className: "ta-message ta-user", onContextMenu: onContextMenu },
|
|
173
275
|
skill && React.createElement(SkillUse, { skill: skill }),
|
|
174
|
-
React.createElement(UserSaid, { blocks: blocks, text: text }),
|
|
276
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
175
277
|
React.createElement(message_footer_1.UserFooter, { message: message, text: copied }),
|
|
176
278
|
menu));
|
|
177
279
|
}
|
|
@@ -287,6 +389,8 @@ function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
287
389
|
const open = manual !== null && manual !== void 0 ? manual : active;
|
|
288
390
|
const shown = useFold(open && steps.length > 0, stepsRef, !active);
|
|
289
391
|
const folded = process_1.ProcessUtil.fold(steps, active, showAll);
|
|
392
|
+
// The earlier steps count as the head does: the calls among them, not the thoughts.
|
|
393
|
+
const earlier = folded.hidden ? tool_1.ToolUtil.count(process_1.ProcessUtil.tools(steps.slice(0, folded.hidden)), results, tools).steps : 0;
|
|
290
394
|
// Only thoughts: the head already says so, the steps need not say it again.
|
|
291
395
|
const thoughtOnly = steps.every(step => step.kind === 'thinking');
|
|
292
396
|
const title = count ? t(active ? 'ta.process.running' : 'ta.process.done', { count }) : t(active ? 'ta.process.thinking' : 'ta.process.thought');
|
|
@@ -300,13 +404,21 @@ function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
300
404
|
t('ta.process.failed', { count: failed })),
|
|
301
405
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 14, className: "ta-process-chevron" }))) : (status)),
|
|
302
406
|
shown && (React.createElement("div", { id: id, ref: stepsRef, className: "ta-process-steps" },
|
|
303
|
-
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, t('ta.process.earlier', { count:
|
|
407
|
+
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, earlier ? t('ta.process.earlier', { count: earlier }) : t('ta.process.showAll'))),
|
|
304
408
|
folded.steps.map(step => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly })))))));
|
|
305
409
|
}
|
|
306
410
|
/** A turn that has shown nothing yet: what ta does goes on its head. */
|
|
307
411
|
function quiet(item) {
|
|
308
412
|
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.active && !item.steps.length && !item.reply.some(text => text.trim());
|
|
309
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
|
|
416
|
+
* (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
|
|
417
|
+
* again when the words under the steps go into them, and it stayed out of line until something else drew.
|
|
418
|
+
*/
|
|
419
|
+
function endsInSteps(item) {
|
|
420
|
+
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.steps.length > 0 && !item.reply.length;
|
|
421
|
+
}
|
|
310
422
|
function Turn({ item, tools, mood, status, latest, }) {
|
|
311
423
|
var _a;
|
|
312
424
|
const t = (0, use_t_1.useT)();
|
|
@@ -379,20 +491,26 @@ const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status, lat
|
|
|
379
491
|
(next.item.kind === 'message' || !next.item.active || previous.tools === next.tools));
|
|
380
492
|
/** The last rows, which change and are in view, are always laid out. */
|
|
381
493
|
const SETTLED_AFTER = 4;
|
|
382
|
-
/** The conversation; tool results show with the calls they answer. */
|
|
383
|
-
function MessageList({ state, outbox }) {
|
|
494
|
+
/** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
|
|
495
|
+
function MessageList({ state, outbox, rows }) {
|
|
384
496
|
var _a;
|
|
385
|
-
const items = React.useMemo(() => process_1.ProcessUtil.items(state.messages, state.working, state.start), [state.messages, state.working, state.start]);
|
|
386
497
|
const renderers = React.useContext(extension_view_1.MessageRenderers);
|
|
498
|
+
const items = React.useMemo(() => process_1.ProcessUtil.items(state.messages, state.working, state.start, renderers), [state.messages, state.working, state.start, renderers]);
|
|
387
499
|
const breaks = React.useMemo(() => process_1.ProcessUtil.timeBreaks(process_1.ProcessUtil.starts(items), index => process_1.ProcessUtil.shown(items[index], renderers)), [items, renderers]);
|
|
500
|
+
const models = React.useMemo(() => process_1.ProcessUtil.modelBreaks(items), [items]);
|
|
388
501
|
const sent = React.useMemo(() => { var _a; return ({ of: new Map(((_a = state.outbox) !== null && _a !== void 0 ? _a : []).map(message => [message.message, message])), actions: outbox }); }, [state.outbox, outbox]);
|
|
502
|
+
// The rows held back: those before the latest `rows.rows`.
|
|
503
|
+
const from = rows ? Math.max(0, items.length - rows.rows) : 0;
|
|
504
|
+
if (rows) {
|
|
505
|
+
rows.hidden.current = from;
|
|
506
|
+
}
|
|
389
507
|
// Rows of earlier messages put in front are laid out once before they may skip it (content-visibility):
|
|
390
508
|
// their height is then known, and the view does not move as they come near it.
|
|
391
|
-
const firstKey = React.useRef((_a = items[
|
|
392
|
-
const front = Math.max(
|
|
509
|
+
const firstKey = React.useRef((_a = items[from]) === null || _a === void 0 ? void 0 : _a.key);
|
|
510
|
+
const front = Math.max(from, items.findIndex(item => item.key === firstKey.current));
|
|
393
511
|
React.useLayoutEffect(() => {
|
|
394
512
|
var _a;
|
|
395
|
-
firstKey.current = (_a = items[
|
|
513
|
+
firstKey.current = (_a = items[from]) === null || _a === void 0 ? void 0 : _a.key;
|
|
396
514
|
});
|
|
397
515
|
// Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again, still.
|
|
398
516
|
const still = React.useRef(items.length);
|
|
@@ -411,7 +529,7 @@ function MessageList({ state, outbox }) {
|
|
|
411
529
|
const status = state.working || state.compacting ? React.createElement(run_status_1.RunStatus, { state: state }) : undefined;
|
|
412
530
|
const onHead = status && quiet(last);
|
|
413
531
|
return (React.createElement(Outbox.Provider, { value: sent },
|
|
414
|
-
items.map((item, index) => (React.createElement("div", { key: item.key, className: [
|
|
532
|
+
items.map((item, index) => index < from ? null : (React.createElement("div", { key: item.key, className: [
|
|
415
533
|
'ta-thread-item',
|
|
416
534
|
index >= front && index < items.length - SETTLED_AFTER && 'ta-settled',
|
|
417
535
|
index === items.length - 1 && 'ta-thread-last',
|
|
@@ -421,7 +539,8 @@ function MessageList({ state, outbox }) {
|
|
|
421
539
|
.filter(Boolean)
|
|
422
540
|
.join(' ') },
|
|
423
541
|
breaks[index] !== undefined && React.createElement(message_footer_1.TimeBreak, { timestamp: breaks[index] }),
|
|
542
|
+
models[index] && React.createElement(message_footer_1.ModelBreak, { model: models[index] }),
|
|
424
543
|
React.createElement(ThreadRow, { item: item, tools: state.tools, mood: item.kind === 'turn' ? process_1.ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn })))),
|
|
425
|
-
status && !onHead && React.createElement("div", { className:
|
|
544
|
+
status && !onHead && React.createElement("div", { className: `ta-run-line ${endsInSteps(last) ? 'ta-run-steps' : ''}` }, status)));
|
|
426
545
|
}
|
|
427
546
|
//# sourceMappingURL=message-list.js.map
|
|
@@ -73,7 +73,12 @@ function useMessageMenu(subject) {
|
|
|
73
73
|
const items = [];
|
|
74
74
|
const text = subject.kind === 'user' ? subject.text : subject.reply;
|
|
75
75
|
if (text) {
|
|
76
|
-
items.push({ label: t('ta.copy'), run: () => copy(text) }
|
|
76
|
+
items.push({ label: t('ta.copy'), run: () => copy(text) });
|
|
77
|
+
if (actions === null || actions === void 0 ? void 0 : actions.quote) {
|
|
78
|
+
const quote = actions.quote;
|
|
79
|
+
items.push({ label: t('ta.message.quote'), run: () => quote(text) });
|
|
80
|
+
}
|
|
81
|
+
items.push({ label: t('ta.message.selectText'), run: () => setSelecting(text) });
|
|
77
82
|
}
|
|
78
83
|
if (subject.kind === 'user' && branches) {
|
|
79
84
|
items.push('-', { label: t('ta.message.forkBefore'), run: () => actions.fork(subject.message, 'before') }, { label: t('ta.message.rewind'), run: () => actions.rewind(subject.message) });
|
|
@@ -99,6 +99,7 @@ var ModelPickerUtil;
|
|
|
99
99
|
key: 'model',
|
|
100
100
|
label: t('ta.session.model'),
|
|
101
101
|
icon: React.createElement(icon_1.Icon, { icon: lucide_react_1.Box, size: 16 }),
|
|
102
|
+
setting: true,
|
|
102
103
|
detail: value ? name(source, value) : t('ta.session.noModel'),
|
|
103
104
|
searchLabel: t('ta.model.search'),
|
|
104
105
|
items: options(source, value).map(option => ({ ...option, run: () => pick(option.key) })),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
1
2
|
import type { Hold } from '../device/hold';
|
|
2
3
|
import { type WebViewEntry } from '../extension/web-extension-protocol';
|
|
4
|
+
import { type WebPageInfo } from '../extension/web-pages';
|
|
3
5
|
import { type NavigationSetting } from '../settings/navigation';
|
|
4
6
|
import type { ContextMenuItem } from './context-menu';
|
|
5
7
|
import type { PhoneTab } from './phone-shell';
|
|
@@ -37,13 +39,30 @@ export interface Navigation {
|
|
|
37
39
|
/** Those in the navigation, and those under Discover (NavigationUtil.arrange). */
|
|
38
40
|
nav: WebViewEntry[];
|
|
39
41
|
discover: WebViewEntry[];
|
|
42
|
+
/**
|
|
43
|
+
* The pages of installed extensions started on open (ta-launcher.md): under Discover after `discover`,
|
|
44
|
+
* never in the navigation, their extensions loaded only when opened.
|
|
45
|
+
*/
|
|
46
|
+
onOpen: WebPageInfo[];
|
|
40
47
|
setting: NavigationSetting;
|
|
41
48
|
pin(id: string): void;
|
|
42
49
|
fold(id: string): void;
|
|
43
50
|
update(setting: NavigationSetting): void;
|
|
44
51
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
|
|
54
|
+
* in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
|
|
55
|
+
*/
|
|
56
|
+
export declare function places(views: WebViewEntry[], setting: NavigationSetting, handheld: boolean, own?: boolean): Pick<Navigation, 'home' | 'pages' | 'nav' | 'discover'>;
|
|
57
|
+
/**
|
|
58
|
+
* Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
|
|
59
|
+
* in a list; the pages of a kind that a page lists (the Games page) are only there.
|
|
60
|
+
*/
|
|
61
|
+
export declare function arrangeViews(views: readonly WebViewEntry[], onOpen: readonly {
|
|
62
|
+
info: TaWebExtensionInfo;
|
|
63
|
+
}[], setting: NavigationSetting, handheld: boolean, infoOf: (extensionId: string) => TaWebExtensionInfo | undefined, kinds: ReadonlySet<string>): (view: WebViewEntry) => 'navigation' | 'discover' | 'list';
|
|
64
|
+
/** Discover is in the navigation: some pages are under it. */
|
|
65
|
+
export declare function hasDiscover(navigation: Pick<Navigation, 'discover' | 'onOpen'>): boolean;
|
|
47
66
|
export interface PhoneTabLabels {
|
|
48
67
|
discover: string;
|
|
49
68
|
me: string;
|
|
@@ -5,9 +5,12 @@ exports.railPages = railPages;
|
|
|
5
5
|
exports.entryHold = entryHold;
|
|
6
6
|
exports.fixedTabs = fixedTabs;
|
|
7
7
|
exports.places = places;
|
|
8
|
+
exports.arrangeViews = arrangeViews;
|
|
9
|
+
exports.hasDiscover = hasDiscover;
|
|
8
10
|
exports.phoneTabs = phoneTabs;
|
|
9
11
|
const lucide_react_1 = require("lucide-react");
|
|
10
12
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
13
|
+
const web_pages_1 = require("../extension/web-pages");
|
|
11
14
|
const navigation_1 = require("../settings/navigation");
|
|
12
15
|
const side_lists_1 = require("./side-lists");
|
|
13
16
|
/* The places of the navigation, the same on the rail and in the tabs of a phone: which pages, in what order. */
|
|
@@ -34,13 +37,28 @@ exports.ME_TAB = 'ta/me';
|
|
|
34
37
|
function fixedTabs(views) {
|
|
35
38
|
return views.filter(view => view.location === 'sidebar').length + 2;
|
|
36
39
|
}
|
|
37
|
-
/**
|
|
38
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
|
|
42
|
+
* in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
|
|
43
|
+
*/
|
|
44
|
+
function places(views, setting, handheld, own = false) {
|
|
39
45
|
const all = railPages(views);
|
|
40
46
|
const home = all.find(view => view.id === side_lists_1.DOUBLE_PAGE);
|
|
41
47
|
const pages = home ? all.filter(view => view !== home) : all;
|
|
42
48
|
const room = handheld ? Math.max(1, navigation_1.NavigationUtil.PHONE_TABS - fixedTabs(views) - (home ? 1 : 0)) : undefined;
|
|
43
|
-
return { home, pages, ...navigation_1.NavigationUtil.arrange(pages, setting, room) };
|
|
49
|
+
return { home, pages, ...navigation_1.NavigationUtil.arrange(pages, setting, room, own) };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
|
|
53
|
+
* in a list; the pages of a kind that a page lists (the Games page) are only there.
|
|
54
|
+
*/
|
|
55
|
+
function arrangeViews(views, onOpen, setting, handheld, infoOf, kinds) {
|
|
56
|
+
const arranged = places(views.filter(view => !web_pages_1.WebPagesUtil.listed(infoOf(view.extension), kinds)), setting, handheld, onOpen.some(entry => !entry.info.temporary && !web_pages_1.WebPagesUtil.listed(entry.info, kinds)));
|
|
57
|
+
return view => (view === arranged.home || arranged.nav.includes(view) ? 'navigation' : arranged.discover.includes(view) ? 'discover' : 'list');
|
|
58
|
+
}
|
|
59
|
+
/** Discover is in the navigation: some pages are under it. */
|
|
60
|
+
function hasDiscover(navigation) {
|
|
61
|
+
return navigation.discover.length > 0 || navigation.onOpen.length > 0;
|
|
44
62
|
}
|
|
45
63
|
/**
|
|
46
64
|
* The tabs at the bottom of a phone, as a messaging app has them: the lists of the sidebar, the chats, the pages
|
|
@@ -59,7 +77,7 @@ function phoneTabs(lists, navigation, labels) {
|
|
|
59
77
|
...(navigation.home ? [{ ...tab(navigation.home), double: true, hold: labels.holds.double }] : []),
|
|
60
78
|
...lists.map(list),
|
|
61
79
|
...navigation.nav.map(view => tab(view, [{ label: labels.fold, run: () => navigation.fold(view.id) }, '-', labels.settings])),
|
|
62
|
-
...(navigation
|
|
80
|
+
...(hasDiscover(navigation) ? [{ id: exports.DISCOVER, label: labels.discover, icon: lucide_react_1.Compass, menu: [labels.settings] }] : []),
|
|
63
81
|
{ id: exports.ME_TAB, label: labels.me, icon: lucide_react_1.User },
|
|
64
82
|
];
|
|
65
83
|
}
|