@celljs/ta-web 4.10.0 → 4.12.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 +48 -24
- 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 +23 -15
- 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 +84 -20
- 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 +15 -4
- package/esm/browser/components/composer-box.js +139 -77
- package/esm/browser/components/composer.d.ts +9 -6
- package/esm/browser/components/composer.js +32 -4
- package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
- package/esm/browser/components/conversation-scroll-hooks.js +98 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
- package/esm/browser/components/conversation-scroll-util.js +56 -0
- package/esm/browser/components/conversation-scroll.d.ts +52 -31
- package/esm/browser/components/conversation-scroll.js +170 -129
- 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/face.d.ts +24 -0
- package/esm/browser/components/face.js +42 -0
- 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 +73 -7
- package/esm/browser/components/message-actions.js +3 -0
- package/esm/browser/components/message-footer.d.ts +8 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +60 -7
- package/esm/browser/components/message-list.js +206 -58
- 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 +98 -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.d.ts +3 -1
- package/esm/browser/components/session-view.js +35 -21
- 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/stop-times.d.ts +47 -0
- package/esm/browser/components/stop-times.js +81 -0
- 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/use-stop-times.d.ts +3 -0
- package/esm/browser/components/use-stop-times.js +17 -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/photo-picker.d.ts +14 -0
- package/esm/browser/device/photo-picker.js +48 -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.d.ts +2 -0
- package/esm/browser/device/row-swipe.js +14 -3
- package/esm/browser/device/sheet-swipe.d.ts +1 -1
- package/esm/browser/device/sheet-swipe.js +25 -4
- 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 +16 -2
- package/esm/browser/extension/web-api-components.d.ts +287 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +394 -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 +186 -565
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +354 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
- package/esm/browser/extension/web-extension-protocol.js +34 -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 +121 -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 +92 -2
- package/esm/browser/i18n/messages.d.ts +91 -1
- package/esm/browser/i18n/messages.js +187 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -0
- package/esm/browser/links/links-protocol.d.ts +7 -0
- package/esm/browser/links/links.d.ts +24 -7
- package/esm/browser/links/links.js +64 -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 +45 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +192 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +39 -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 +32 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +21 -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/frame.d.ts +2 -0
- package/esm/browser/util/frame.js +2 -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 +57 -3
- package/esm/browser/util/process.js +123 -11
- 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 +46 -22
- 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 +22 -14
- 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 +80 -16
- 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 +15 -4
- package/lib/browser/components/composer-box.js +136 -74
- package/lib/browser/components/composer.d.ts +9 -6
- package/lib/browser/components/composer.js +31 -3
- package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
- package/lib/browser/components/conversation-scroll-hooks.js +135 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
- package/lib/browser/components/conversation-scroll-util.js +60 -0
- package/lib/browser/components/conversation-scroll.d.ts +52 -31
- package/lib/browser/components/conversation-scroll.js +171 -164
- 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/face.d.ts +25 -0
- package/lib/browser/components/face.js +79 -0
- 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 +73 -7
- package/lib/browser/components/message-actions.js +3 -0
- package/lib/browser/components/message-footer.d.ts +8 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +60 -7
- package/lib/browser/components/message-list.js +206 -55
- 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 +99 -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.d.ts +3 -1
- package/lib/browser/components/session-view.js +32 -18
- 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/stop-times.d.ts +48 -0
- package/lib/browser/components/stop-times.js +85 -0
- 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/use-stop-times.d.ts +4 -0
- package/lib/browser/components/use-stop-times.js +53 -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/photo-picker.d.ts +15 -0
- package/lib/browser/device/photo-picker.js +51 -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.d.ts +2 -0
- package/lib/browser/device/row-swipe.js +14 -3
- package/lib/browser/device/sheet-swipe.d.ts +1 -1
- package/lib/browser/device/sheet-swipe.js +25 -4
- 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 +15 -1
- package/lib/browser/extension/web-api-components.d.ts +288 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +395 -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 +186 -565
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +391 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
- package/lib/browser/extension/web-extension-protocol.js +35 -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 +117 -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 +92 -2
- package/lib/browser/i18n/messages.d.ts +91 -1
- package/lib/browser/i18n/messages.js +187 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -0
- package/lib/browser/links/links-protocol.d.ts +7 -0
- package/lib/browser/links/links.d.ts +24 -7
- package/lib/browser/links/links.js +64 -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 +45 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +192 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +39 -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 +32 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +21 -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/frame.d.ts +2 -0
- package/lib/browser/util/frame.js +2 -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 +57 -3
- package/lib/browser/util/process.js +125 -12
- 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
|
@@ -1,125 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
7
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
10
|
};
|
|
44
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
12
|
exports.TaWebExtensionsImpl = void 0;
|
|
46
13
|
const core_1 = require("@celljs/core");
|
|
47
|
-
const React = __importStar(require("react"));
|
|
48
|
-
const code_editor_1 = require("../components/code-editor");
|
|
49
|
-
const context_menu_1 = require("../components/context-menu");
|
|
50
|
-
const conversation_scroll_1 = require("../components/conversation-scroll");
|
|
51
|
-
const diff_editor_1 = require("../components/diff-editor");
|
|
52
|
-
const empty_state_1 = require("../components/empty-state");
|
|
53
|
-
const folder_picker_1 = require("../components/folder-picker");
|
|
54
|
-
const host_tag_1 = require("../components/host-tag");
|
|
55
|
-
const image_viewer_1 = require("../components/image-viewer");
|
|
56
|
-
const list_skeleton_1 = require("../components/list-skeleton");
|
|
57
|
-
const markdown_1 = require("../components/markdown");
|
|
58
|
-
const model_picker_1 = require("../components/model-picker");
|
|
59
14
|
const nav_places_1 = require("../components/nav-places");
|
|
60
|
-
const picture_1 = require("../components/picture");
|
|
61
|
-
const qr_view_1 = require("../components/qr-view");
|
|
62
|
-
const select_bar_1 = require("../components/select-bar");
|
|
63
|
-
const swipe_row_1 = require("../components/swipe-row");
|
|
64
|
-
const ta_avatar_1 = require("../components/ta-avatar");
|
|
65
|
-
const web_composer_1 = require("../components/web-composer");
|
|
66
|
-
const web_dialog_1 = require("../components/web-dialog");
|
|
67
15
|
const device_1 = require("../device/device");
|
|
68
|
-
const scanner_1 = require("../device/scanner");
|
|
69
16
|
const files_protocol_1 = require("../files/files-protocol");
|
|
70
17
|
const messages_1 = require("../i18n/messages");
|
|
71
|
-
const use_t_1 = require("../i18n/use-t");
|
|
72
18
|
const links_protocol_1 = require("../links/links-protocol");
|
|
73
19
|
const notices_protocol_1 = require("../notices/notices-protocol");
|
|
20
|
+
const session_notices_1 = require("../notices/session-notices");
|
|
74
21
|
const settings_protocol_1 = require("../settings/settings-protocol");
|
|
75
22
|
const state_protocol_1 = require("../state/state-protocol");
|
|
76
|
-
const web_terminal_1 = require("../terminal/web-terminal");
|
|
77
|
-
const desktop_1 = require("../util/desktop");
|
|
78
|
-
const file_drag_1 = require("../util/file-drag");
|
|
79
23
|
const workbench_protocol_1 = require("../workbench-protocol");
|
|
80
|
-
const
|
|
24
|
+
const web_editor_tabs_1 = require("./web-editor-tabs");
|
|
81
25
|
const web_extension_code_1 = require("./web-extension-code");
|
|
26
|
+
const web_extension_context_1 = require("./web-extension-context");
|
|
82
27
|
const web_extension_protocol_1 = require("./web-extension-protocol");
|
|
28
|
+
const web_extension_run_1 = require("./web-extension-run");
|
|
29
|
+
const web_home_1 = require("./web-home");
|
|
83
30
|
const web_on_demand_1 = require("./web-on-demand");
|
|
84
31
|
const web_pages_1 = require("./web-pages");
|
|
85
32
|
const web_sharing_1 = require("./web-sharing");
|
|
86
33
|
const web_tasks_1 = require("./web-tasks");
|
|
87
34
|
const web_view_util_1 = require("./web-view-util");
|
|
88
|
-
const DEFAULT_ORDER = 100;
|
|
89
|
-
const FILE_DRAG = Object.freeze({ set: file_drag_1.FileDragUtil.set, has: file_drag_1.FileDragUtil.has, get: file_drag_1.FileDragUtil.get, paths: file_drag_1.FileDragUtil.paths });
|
|
90
35
|
let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
91
36
|
constructor() {
|
|
92
37
|
this.builtins = [];
|
|
93
38
|
this.tasks = new web_tasks_1.WebTaskBoard();
|
|
39
|
+
this.home = new web_home_1.WebHomeBoard();
|
|
40
|
+
this.tabs = new web_editor_tabs_1.WebEditorTabs({
|
|
41
|
+
state: () => this.current,
|
|
42
|
+
update: change => this.update(change),
|
|
43
|
+
persisted: () => this.persisted,
|
|
44
|
+
notices: () => this.notices,
|
|
45
|
+
language: () => this.settings.state.language,
|
|
46
|
+
closed: editor => {
|
|
47
|
+
const run = this.running.get(editor.extension);
|
|
48
|
+
if (editor.onClose && run) {
|
|
49
|
+
this.guard(run, editor.onClose);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
openView: id => this.openView(id, true),
|
|
53
|
+
});
|
|
94
54
|
/** The code read before, by its hash: a start reads only what changed. */
|
|
95
55
|
this.code = new web_extension_code_1.WebExtensionCode(() => (typeof localStorage === 'undefined' ? undefined : localStorage));
|
|
96
|
-
this.current =
|
|
97
|
-
extensions: [],
|
|
98
|
-
views: [],
|
|
99
|
-
widgets: [],
|
|
100
|
-
composerAddons: [],
|
|
101
|
-
settingsSections: [],
|
|
102
|
-
renderers: {},
|
|
103
|
-
avatars: {},
|
|
104
|
-
tools: [],
|
|
105
|
-
openers: [],
|
|
106
|
-
editors: [],
|
|
107
|
-
focus: 0,
|
|
108
|
-
page: '',
|
|
109
|
-
pageShown: 0,
|
|
110
|
-
conversationShown: true,
|
|
111
|
-
onOpen: [],
|
|
112
|
-
kept: [],
|
|
113
|
-
usage: {},
|
|
114
|
-
searches: [],
|
|
115
|
-
};
|
|
56
|
+
this.current = web_extension_protocol_1.WebExtensionsStateUtil.empty();
|
|
116
57
|
this.running = new Map();
|
|
117
58
|
this.listeners = new Set();
|
|
118
59
|
this.refreshing = Promise.resolve(false);
|
|
119
|
-
/** The tabs of before are open again: from now on, what is open is kept. */
|
|
120
|
-
this.restored = false;
|
|
121
60
|
/** The extensions of the list of the last time have started (startKept), once. */
|
|
122
61
|
this.keptStarted = false;
|
|
62
|
+
this.nextCustom = 0;
|
|
123
63
|
this.sharing = new web_sharing_1.WebSharing({
|
|
124
64
|
language: () => this.settings.state.language,
|
|
125
65
|
notices: () => this.notices,
|
|
@@ -127,6 +67,14 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
127
67
|
views: () => this.current.views,
|
|
128
68
|
refresh: () => this.refresh(),
|
|
129
69
|
showView: id => this.showView(id),
|
|
70
|
+
openSpecific: async (url) => {
|
|
71
|
+
for (const opener of this.current.specificOpeners) {
|
|
72
|
+
if (await opener({ type: 'url', url })) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
},
|
|
130
78
|
});
|
|
131
79
|
/** The pages change with the extensions and with the navigation of the settings. */
|
|
132
80
|
this.subscribePages = (listener) => {
|
|
@@ -137,27 +85,6 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
137
85
|
settings();
|
|
138
86
|
};
|
|
139
87
|
};
|
|
140
|
-
/** The API of one extension: what it registers is its own and goes when it stops. */
|
|
141
|
-
/** Monaco in the theme and language of the settings, the same component for every extension. */
|
|
142
|
-
this.codeEditor = (props) => React.createElement(code_editor_1.CodeEditor, { ...props, settings: this.settings });
|
|
143
|
-
this.diffEditor = (props) => React.createElement(diff_editor_1.DiffEditor, { ...props, settings: this.settings });
|
|
144
|
-
this.listDirectory = (directory) => this.workbench.workspace.listDirectory('.', directory);
|
|
145
|
-
/** The message box, whose button of the directory lists those of the server. */
|
|
146
|
-
this.composer = (props) => { var _a; return React.createElement(web_composer_1.WebComposer, {
|
|
147
|
-
...props,
|
|
148
|
-
notices: this.notices,
|
|
149
|
-
listDirectory: this.listDirectory,
|
|
150
|
-
serverCwd: (_a = this.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd,
|
|
151
|
-
remote: this.workbench,
|
|
152
|
-
}); };
|
|
153
|
-
this.modelPicker = (props) => React.createElement(model_picker_1.SettingsModelPicker, { ...props, settings: this.workbench.settings });
|
|
154
|
-
this.folderPicker = ({ initial, onPick, onClose }) => { var _a; return React.createElement(folder_picker_1.FolderPicker, {
|
|
155
|
-
list: this.listDirectory,
|
|
156
|
-
initial: initial || ((_a = this.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.',
|
|
157
|
-
remote: this.workbench,
|
|
158
|
-
onPick: async (path) => onPick(path),
|
|
159
|
-
onClose,
|
|
160
|
-
}); };
|
|
161
88
|
}
|
|
162
89
|
get state() {
|
|
163
90
|
return this.current;
|
|
@@ -190,6 +117,9 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
190
117
|
refresh() {
|
|
191
118
|
const next = this.refreshing.then(() => this.reconcile(), () => this.reconcile());
|
|
192
119
|
this.refreshing = next;
|
|
120
|
+
if (!this.current.loaded) {
|
|
121
|
+
void next.finally(() => this.current.loaded || this.update({ loaded: true })).catch(() => undefined);
|
|
122
|
+
}
|
|
193
123
|
return next;
|
|
194
124
|
}
|
|
195
125
|
/**
|
|
@@ -201,22 +131,14 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
201
131
|
await this.refresh();
|
|
202
132
|
await ((_b = (_a = this.conversation) === null || _a === void 0 ? void 0 : _a.reload) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
203
133
|
}
|
|
204
|
-
async remove(id) {
|
|
205
|
-
await this.workbench.packages.removeWebExtension(id);
|
|
206
|
-
await this.reloadPackages();
|
|
207
|
-
}
|
|
208
134
|
showEditor(id) {
|
|
209
|
-
|
|
210
|
-
this.pendingActive = undefined;
|
|
211
|
-
this.update({ activeEditor: id, focus: this.current.focus + 1 });
|
|
212
|
-
this.keepTabs();
|
|
213
|
-
}
|
|
135
|
+
this.tabs.show(id);
|
|
214
136
|
}
|
|
215
137
|
openView(id, preserveFocus = false) {
|
|
216
138
|
const view = this.current.views.find(candidate => candidate.id === id && candidate.location === 'panel');
|
|
217
139
|
const run = view && this.running.get(view.extension);
|
|
218
140
|
if (view && run) {
|
|
219
|
-
this.
|
|
141
|
+
this.open({ id: web_view_util_1.WebViewUtil.editorId(view.id), extension: run.loaded.id, title: view.title, icon: view.icon, render: view.component }, preserveFocus);
|
|
220
142
|
}
|
|
221
143
|
}
|
|
222
144
|
showPage(id) {
|
|
@@ -243,6 +165,11 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
243
165
|
this.showPage('');
|
|
244
166
|
return true;
|
|
245
167
|
}
|
|
168
|
+
// Of an extension this page has not heard of yet (one an agent just made, installed from another device):
|
|
169
|
+
// the list is read again once, not the page of extensions shown in its place.
|
|
170
|
+
if (!this.knows(id)) {
|
|
171
|
+
await this.refresh().catch(() => undefined);
|
|
172
|
+
}
|
|
246
173
|
const info = this.onDemand.find(id);
|
|
247
174
|
if (info) {
|
|
248
175
|
await this.onDemand.ensure(info);
|
|
@@ -267,6 +194,10 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
267
194
|
}
|
|
268
195
|
return !!view && (view.location === 'page' || view.location === 'panel');
|
|
269
196
|
}
|
|
197
|
+
/** Whether `ui.showView` has something for an id: an extension started on open, or a view. */
|
|
198
|
+
knows(id) {
|
|
199
|
+
return !!this.onDemand.find(id) || this.current.views.some(view => view.id === id || (view.location === 'page' && view.id.startsWith(`${id}/`)));
|
|
200
|
+
}
|
|
270
201
|
pages() {
|
|
271
202
|
const { language, settings } = this.settings.state;
|
|
272
203
|
const handheld = device_1.Device.state.handheld;
|
|
@@ -283,13 +214,25 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
283
214
|
listed.handheld === handheld) {
|
|
284
215
|
return listed.pages;
|
|
285
216
|
}
|
|
286
|
-
const arranged = (0, nav_places_1.places)(views, settings.navigation, handheld);
|
|
287
|
-
const placeOf = (view) => view === arranged.home || arranged.nav.includes(view) ? 'navigation' : arranged.discover.includes(view) ? 'discover' : 'list';
|
|
288
217
|
const infoOf = (id) => { var _a; return (_a = this.running.get(id)) === null || _a === void 0 ? void 0 : _a.loaded.info; };
|
|
289
|
-
const
|
|
218
|
+
const kinds = this.listedKinds();
|
|
219
|
+
const pages = web_pages_1.WebPagesUtil.pages({
|
|
220
|
+
views,
|
|
221
|
+
onOpen,
|
|
222
|
+
shown: page,
|
|
223
|
+
usage,
|
|
224
|
+
language,
|
|
225
|
+
placeOf: (0, nav_places_1.arrangeViews)(views, onOpen, settings.navigation, handheld, infoOf, kinds),
|
|
226
|
+
infoOf,
|
|
227
|
+
kinds,
|
|
228
|
+
});
|
|
290
229
|
this.listedPages = { state: this.current, language, navigation: settings.navigation, handheld, pages };
|
|
291
230
|
return pages;
|
|
292
231
|
}
|
|
232
|
+
/** The kinds the pages of the extensions there are list (TaWebExtensionInfo.lists), started or not. */
|
|
233
|
+
listedKinds() {
|
|
234
|
+
return web_pages_1.WebPagesUtil.listedKinds([...this.current.onOpen.map(entry => entry.info), ...[...this.running.values()].map(run => run.loaded.info)]);
|
|
235
|
+
}
|
|
293
236
|
stopExtension(name) {
|
|
294
237
|
const info = this.onDemand.find(name);
|
|
295
238
|
if (info && this.running.has(info.id)) {
|
|
@@ -308,6 +251,16 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
308
251
|
share(target) {
|
|
309
252
|
this.update({ sharing: target });
|
|
310
253
|
}
|
|
254
|
+
showCustom(extension, component) {
|
|
255
|
+
const id = ++this.nextCustom;
|
|
256
|
+
this.update({ customs: [...this.current.customs, { id, extension, component }] });
|
|
257
|
+
return () => this.closeCustom(id);
|
|
258
|
+
}
|
|
259
|
+
closeCustom(id) {
|
|
260
|
+
if (this.current.customs.some(entry => entry.id === id)) {
|
|
261
|
+
this.update({ customs: this.current.customs.filter(entry => entry.id !== id) });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
311
264
|
/** Loads and starts an extension started on open, as reconcile starts the others. */
|
|
312
265
|
async launch(info) {
|
|
313
266
|
var _a;
|
|
@@ -338,53 +291,13 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
338
291
|
return this.current.page === id || this.current.activeEditor === web_view_util_1.WebViewUtil.editorId(id);
|
|
339
292
|
}
|
|
340
293
|
closeEditor(id) {
|
|
341
|
-
return this.
|
|
342
|
-
}
|
|
343
|
-
async closeEditors(ids) {
|
|
344
|
-
const editors = this.current.editors.filter(candidate => ids.includes(candidate.id));
|
|
345
|
-
const dirty = editors.filter(editor => editor.dirty);
|
|
346
|
-
if (dirty.length > 0) {
|
|
347
|
-
const language = this.settings.state.language;
|
|
348
|
-
const title = dirty.length === 1
|
|
349
|
-
? (0, messages_1.message)(language, 'ta.editor.unsavedTitle').replace('{title}', web_extension_protocol_1.WebLabelUtil.text(dirty[0].title))
|
|
350
|
-
: (0, messages_1.message)(language, 'ta.editor.unsavedManyTitle').replace('{count}', String(dirty.length));
|
|
351
|
-
const confirmed = await this.notices.confirm({
|
|
352
|
-
title,
|
|
353
|
-
message: (0, messages_1.message)(language, 'ta.editor.unsavedMessage'),
|
|
354
|
-
confirmLabel: (0, messages_1.message)(language, 'ta.editor.discardClose'),
|
|
355
|
-
danger: true,
|
|
356
|
-
});
|
|
357
|
-
if (!confirmed) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
// Those closed meanwhile are not closed twice.
|
|
362
|
-
for (const editor of editors) {
|
|
363
|
-
if (this.current.editors.includes(editor)) {
|
|
364
|
-
this.dropEditor(editor);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
pinEditor(id) {
|
|
369
|
-
if (this.current.editors.some(editor => editor.id === id && editor.preview)) {
|
|
370
|
-
this.update({ editors: this.current.editors.map(editor => (editor.id === id ? { ...editor, preview: false } : editor)) });
|
|
371
|
-
}
|
|
294
|
+
return this.tabs.close([id]);
|
|
372
295
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
this.removeEditors(candidate => candidate === editor);
|
|
376
|
-
const run = this.running.get(editor.extension);
|
|
377
|
-
if (editor.onClose && run) {
|
|
378
|
-
this.guard(run, editor.onClose);
|
|
379
|
-
}
|
|
296
|
+
closeEditors(ids) {
|
|
297
|
+
return this.tabs.close(ids);
|
|
380
298
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
if (found && !!found.dirty !== dirty) {
|
|
384
|
-
this.update({
|
|
385
|
-
editors: this.current.editors.map(editor => (editor === found ? { ...editor, dirty, preview: dirty ? false : editor.preview } : editor)),
|
|
386
|
-
});
|
|
387
|
-
}
|
|
299
|
+
pinEditor(id) {
|
|
300
|
+
this.tabs.pin(id);
|
|
388
301
|
}
|
|
389
302
|
connect(conversation) {
|
|
390
303
|
this.conversation = conversation;
|
|
@@ -400,6 +313,9 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
400
313
|
setSessionSwitcher(switcher) {
|
|
401
314
|
this.switcher = switcher;
|
|
402
315
|
}
|
|
316
|
+
sessionSwitcher() {
|
|
317
|
+
return this.switcher;
|
|
318
|
+
}
|
|
403
319
|
emit(event) {
|
|
404
320
|
for (const run of this.running.values()) {
|
|
405
321
|
for (const { type, handler } of run.handlers) {
|
|
@@ -466,9 +382,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
466
382
|
// The list of those started on open may have changed too.
|
|
467
383
|
this.publish();
|
|
468
384
|
changed = changed || stopped || starting.length > 0;
|
|
469
|
-
|
|
470
|
-
await this.restoreTabs();
|
|
471
|
-
}
|
|
385
|
+
await this.tabs.restore();
|
|
472
386
|
return changed;
|
|
473
387
|
}
|
|
474
388
|
/**
|
|
@@ -500,25 +414,6 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
500
414
|
}
|
|
501
415
|
return started;
|
|
502
416
|
}
|
|
503
|
-
/** The tools open before, behind what is shown; the tab shown before, once it is open again. */
|
|
504
|
-
async restoreTabs() {
|
|
505
|
-
const kept = await this.persisted.load(web_view_util_1.WebViewUtil.TABS);
|
|
506
|
-
this.restored = true;
|
|
507
|
-
this.pendingActive = this.current.editors.some(editor => editor.id === kept.active) ? undefined : kept.active;
|
|
508
|
-
for (const id of kept.views) {
|
|
509
|
-
this.openView(id, true);
|
|
510
|
-
}
|
|
511
|
-
if (kept.active && this.current.editors.some(editor => editor.id === kept.active)) {
|
|
512
|
-
this.update({ activeEditor: kept.active });
|
|
513
|
-
}
|
|
514
|
-
this.keepTabs();
|
|
515
|
-
}
|
|
516
|
-
keepTabs() {
|
|
517
|
-
var _a;
|
|
518
|
-
if (this.restored) {
|
|
519
|
-
this.persisted.set(web_view_util_1.WebViewUtil.TABS, web_view_util_1.WebViewUtil.tabs(this.current.editors, (_a = this.pendingActive) !== null && _a !== void 0 ? _a : this.current.activeEditor));
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
417
|
/** Stops and forgets the extensions running that `keep` does not keep; whether there were any. */
|
|
523
418
|
stopUnless(keep) {
|
|
524
419
|
let stopped = false;
|
|
@@ -548,17 +443,17 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
548
443
|
startPackage(info, load) {
|
|
549
444
|
const loaded = { id: info.id, name: info.name, info };
|
|
550
445
|
if ('error' in load) {
|
|
551
|
-
this.running.set(info.id,
|
|
446
|
+
this.running.set(info.id, web_extension_run_1.WebExtensionRunUtil.create({ ...loaded, error: load.error }, info.hash));
|
|
552
447
|
}
|
|
553
448
|
else {
|
|
554
449
|
this.start(loaded, load.factory, load.hash);
|
|
555
450
|
}
|
|
556
451
|
}
|
|
557
452
|
start(loaded, factory, hash) {
|
|
558
|
-
const run =
|
|
453
|
+
const run = web_extension_run_1.WebExtensionRunUtil.create(loaded, hash);
|
|
559
454
|
this.running.set(loaded.id, run);
|
|
560
455
|
try {
|
|
561
|
-
const dispose = factory(this.
|
|
456
|
+
const dispose = factory(this.context.create(run));
|
|
562
457
|
run.dispose = typeof dispose === 'function' ? dispose : undefined;
|
|
563
458
|
run.started = true;
|
|
564
459
|
}
|
|
@@ -572,322 +467,39 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
572
467
|
if (run.dispose) {
|
|
573
468
|
this.guard(run, run.dispose);
|
|
574
469
|
}
|
|
575
|
-
|
|
576
|
-
run.
|
|
577
|
-
run.renderers.clear();
|
|
578
|
-
run.avatar = undefined;
|
|
579
|
-
run.tools = [];
|
|
580
|
-
run.openers = [];
|
|
581
|
-
run.taskSources = [];
|
|
582
|
-
run.searches = [];
|
|
583
|
-
run.handlers = [];
|
|
584
|
-
for (const unsubscribe of run.unsubscribes.splice(0)) {
|
|
585
|
-
unsubscribe();
|
|
586
|
-
}
|
|
587
|
-
this.removeEditors(editor => editor.extension === run.loaded.id);
|
|
588
|
-
}
|
|
589
|
-
openEditor(run, editor, preserveFocus = false, preview = false) {
|
|
590
|
-
if (!run.stopped) {
|
|
591
|
-
this.open({ ...editor, extension: run.loaded.id, preview }, preserveFocus);
|
|
592
|
-
}
|
|
470
|
+
web_extension_run_1.WebExtensionRunUtil.clear(run);
|
|
471
|
+
this.tabs.remove(editor => editor.extension === run.loaded.id);
|
|
593
472
|
}
|
|
594
473
|
open(editor, preserveFocus = false) {
|
|
595
|
-
|
|
596
|
-
const index = editors.findIndex(candidate => candidate.id === editor.id);
|
|
597
|
-
if (index >= 0) {
|
|
598
|
-
const open = editors[index];
|
|
599
|
-
// A tab kept stays kept; one dirty stays dirty.
|
|
600
|
-
editors[index] = { ...editor, preview: !!editor.preview && !!open.preview && !open.dirty, dirty: open.dirty };
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
// A preview takes the place of the preview open, as a single click does in an IDE.
|
|
604
|
-
const replaced = editor.preview ? editors.find(candidate => candidate.preview && !candidate.dirty) : undefined;
|
|
605
|
-
if (replaced) {
|
|
606
|
-
editors[editors.indexOf(replaced)] = editor;
|
|
607
|
-
const run = this.running.get(replaced.extension);
|
|
608
|
-
if (replaced.onClose && run) {
|
|
609
|
-
this.guard(run, replaced.onClose);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
editors = [...editors, editor];
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (!preserveFocus) {
|
|
617
|
-
this.pendingActive = undefined;
|
|
618
|
-
this.update({ editors, activeEditor: editor.id, focus: this.current.focus + 1 });
|
|
619
|
-
}
|
|
620
|
-
else if (editor.id === this.pendingActive || this.current.activeEditor === undefined) {
|
|
621
|
-
if (editor.id === this.pendingActive) {
|
|
622
|
-
this.pendingActive = undefined;
|
|
623
|
-
}
|
|
624
|
-
this.update({ editors, activeEditor: editor.id });
|
|
625
|
-
}
|
|
626
|
-
else {
|
|
627
|
-
this.update({ editors });
|
|
628
|
-
}
|
|
629
|
-
this.keepTabs();
|
|
474
|
+
this.tabs.open(editor, preserveFocus);
|
|
630
475
|
}
|
|
631
|
-
|
|
476
|
+
/** What the API of each extension asks of the page; made when the first starts, once the fields are injected. */
|
|
477
|
+
get context() {
|
|
632
478
|
var _a;
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
const active = editors.some(editor => editor.id === this.current.activeEditor) ? this.current.activeEditor : (_a = editors[editors.length - 1]) === null || _a === void 0 ? void 0 : _a.id;
|
|
638
|
-
this.update({ editors, activeEditor: active });
|
|
639
|
-
this.keepTabs();
|
|
640
|
-
}
|
|
641
|
-
record(loaded, hash) {
|
|
642
|
-
return {
|
|
643
|
-
loaded,
|
|
644
|
-
hash,
|
|
645
|
-
started: false,
|
|
646
|
-
stopped: false,
|
|
647
|
-
views: new Map(),
|
|
648
|
-
widgets: new Map(),
|
|
649
|
-
renderers: new Map(),
|
|
650
|
-
tools: [],
|
|
651
|
-
openers: [],
|
|
652
|
-
taskSources: [],
|
|
653
|
-
searches: [],
|
|
654
|
-
composerAddons: [],
|
|
655
|
-
settingsSections: [],
|
|
656
|
-
handlers: [],
|
|
657
|
-
unsubscribes: [],
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
api(run) {
|
|
661
|
-
const { workbench, settings, taFiles } = this;
|
|
662
|
-
const subscribe = (listener) => this.subscribe(listener);
|
|
663
|
-
const register = (change) => {
|
|
664
|
-
if (!run.stopped) {
|
|
665
|
-
change();
|
|
666
|
-
if (run.started) {
|
|
667
|
-
this.publish();
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
return {
|
|
672
|
-
React,
|
|
673
|
-
get server() {
|
|
674
|
-
return workbench.server;
|
|
675
|
-
},
|
|
676
|
-
get workspace() {
|
|
677
|
-
return workbench.workspace;
|
|
678
|
-
},
|
|
679
|
-
get terminals() {
|
|
680
|
-
return workbench.terminals;
|
|
681
|
-
},
|
|
682
|
-
get packages() {
|
|
683
|
-
return workbench.packages;
|
|
684
|
-
},
|
|
685
|
-
get files() {
|
|
686
|
-
return taFiles;
|
|
687
|
-
},
|
|
688
|
-
get remote() {
|
|
689
|
-
return workbench.remote;
|
|
690
|
-
},
|
|
691
|
-
get settings() {
|
|
692
|
-
return workbench.settings;
|
|
693
|
-
},
|
|
694
|
-
ui: {
|
|
695
|
-
setWidget: (key, component, options = {}) => register(() => (component ? run.widgets.set(key, { component, options }) : run.widgets.delete(key))),
|
|
696
|
-
notify: (message, type = 'info') => {
|
|
697
|
-
if (!run.stopped) {
|
|
698
|
-
this.notices.notify(message, { level: type });
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
confirm: (title, message, options) => (run.stopped ? Promise.resolve(false) : this.notices.confirm({ title, message, ...options })),
|
|
702
|
-
input: (title, placeholder, options) => run.stopped ? Promise.resolve(undefined) : this.notices.input({ title, placeholder, value: options === null || options === void 0 ? void 0 : options.value }),
|
|
703
|
-
editor: (title, prefill) => (run.stopped ? Promise.resolve(undefined) : this.notices.input({ title, value: prefill, multiline: true })),
|
|
704
|
-
get theme() {
|
|
705
|
-
return settings.state.theme;
|
|
706
|
-
},
|
|
707
|
-
get language() {
|
|
708
|
-
return settings.state.language;
|
|
709
|
-
},
|
|
710
|
-
supportsWebview: desktop_1.DesktopUtil.has('webview'),
|
|
711
|
-
desktop: desktop_1.DesktopUtil.fileManager(),
|
|
712
|
-
fileDrag: FILE_DRAG,
|
|
713
|
-
debugWebview: desktop_1.DesktopUtil.debugWebview(),
|
|
714
|
-
openEditor: (editor, options) => this.openEditor(run, editor, (options === null || options === void 0 ? void 0 : options.preserveFocus) === true, (options === null || options === void 0 ? void 0 : options.preview) === true),
|
|
715
|
-
closeEditor: id => this.removeEditors(editor => editor.id === id && editor.extension === run.loaded.id),
|
|
716
|
-
pinEditor: id => {
|
|
717
|
-
if (this.current.editors.some(editor => editor.id === id && editor.extension === run.loaded.id)) {
|
|
718
|
-
this.pinEditor(id);
|
|
719
|
-
}
|
|
720
|
-
},
|
|
721
|
-
setEditorDirty: (id, dirty) => this.setDirty(run, id, dirty),
|
|
722
|
-
useActiveEditor: () => {
|
|
723
|
-
const active = () => this.current.activeEditor;
|
|
724
|
-
return React.useSyncExternalStore(subscribe, active, active);
|
|
725
|
-
},
|
|
726
|
-
useCwd: () => {
|
|
727
|
-
var _a;
|
|
728
|
-
// The conversation's while it is in front; with a page, the settings or nothing in front, the default directory.
|
|
729
|
-
const shown = () => web_extension_protocol_1.WebCwdUtil.shown(this.current);
|
|
730
|
-
const cwd = React.useSyncExternalStore(subscribe, shown, shown);
|
|
731
|
-
const server = () => { var _a; return (_a = workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd; };
|
|
732
|
-
const fallback = React.useSyncExternalStore(listener => workbench.subscribe(listener), server, server);
|
|
733
|
-
return (_a = cwd !== null && cwd !== void 0 ? cwd : fallback) !== null && _a !== void 0 ? _a : '.';
|
|
734
|
-
},
|
|
735
|
-
useSessionId: () => React.useSyncExternalStore(subscribe, () => this.current.sessionId),
|
|
736
|
-
useSessions: () => {
|
|
737
|
-
const sessions = () => workbench.state.sessions;
|
|
738
|
-
return React.useSyncExternalStore(listener => workbench.subscribe(listener), sessions, sessions);
|
|
739
|
-
},
|
|
740
|
-
useDevice: device_1.useDevice,
|
|
741
|
-
showView: id => (run.stopped ? Promise.resolve(false) : this.showView(id)),
|
|
742
|
-
usePages: () => {
|
|
743
|
-
// Read again when the device or the navigation changes where a page is.
|
|
744
|
-
(0, device_1.useDevice)(device => device.handheld);
|
|
745
|
-
return React.useSyncExternalStore(this.subscribePages, () => this.pages());
|
|
746
|
-
},
|
|
747
|
-
useContextMenu: () => {
|
|
748
|
-
const [menu, open] = (0, context_menu_1.useContextMenu)();
|
|
749
|
-
const openSections = React.useCallback((event, sections) => open(event, sections
|
|
750
|
-
.filter(section => section.length > 0)
|
|
751
|
-
.flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])), [open]);
|
|
752
|
-
return [menu, openSections];
|
|
753
|
-
},
|
|
754
|
-
attachMenu: context_menu_1.ContextMenuUtil.attach,
|
|
755
|
-
scanCode: scanner_1.Scanner.available() ? instructions => scanner_1.Scanner.scan(instructions, (0, messages_1.message)(settings.state.language, 'ta.cancel')) : undefined,
|
|
756
|
-
stopExtension: name => !run.stopped && this.stopExtension(name),
|
|
757
|
-
shareExtension: target => !run.stopped && this.share(target),
|
|
758
|
-
openShared: text => (run.stopped ? Promise.resolve(false) : this.openShared(text)),
|
|
759
|
-
forgetPage: id => !run.stopped && this.forgetPage(id),
|
|
760
|
-
useTasks: () => React.useSyncExternalStore(this.tasks.subscribe, this.tasks.tasks, this.tasks.tasks),
|
|
761
|
-
removeTasks: tasks => (run.stopped ? Promise.resolve(false) : web_tasks_1.WebTaskUtil.remove(tasks, this.notices, (0, use_t_1.translator)(settings.state.language))),
|
|
762
|
-
useView: id => {
|
|
763
|
-
const find = () => this.current.views.find(candidate => candidate.id === id);
|
|
764
|
-
const isShown = () => this.isShown(id);
|
|
765
|
-
const view = React.useSyncExternalStore(subscribe, find, find);
|
|
766
|
-
const shown = React.useSyncExternalStore(subscribe, isShown, isShown);
|
|
767
|
-
// The title is read again in another language: a string, so that the same words stay the same value.
|
|
768
|
-
const title = view ? web_extension_protocol_1.WebLabelUtil.text(view.title) : undefined;
|
|
769
|
-
// The preview as one string, so that the same line stays the same value.
|
|
770
|
-
const watch = React.useCallback((listener) => { var _a; var _b; return (_b = (_a = view === null || view === void 0 ? void 0 : view.subscribePreview) === null || _a === void 0 ? void 0 : _a.call(view, listener)) !== null && _b !== void 0 ? _b : (() => undefined); }, [view]);
|
|
771
|
-
const read = () => {
|
|
772
|
-
var _a;
|
|
773
|
-
const preview = (_a = view === null || view === void 0 ? void 0 : view.preview) === null || _a === void 0 ? void 0 : _a.call(view);
|
|
774
|
-
return preview ? `${preview.at}\n${preview.text}` : '';
|
|
775
|
-
};
|
|
776
|
-
const line = React.useSyncExternalStore(watch, read, read);
|
|
777
|
-
const isBusy = () => { var _a; return !!((_a = view === null || view === void 0 ? void 0 : view.busy) === null || _a === void 0 ? void 0 : _a.call(view)); };
|
|
778
|
-
const busy = React.useSyncExternalStore(watch, isBusy, isBusy);
|
|
779
|
-
return React.useMemo(() => {
|
|
780
|
-
if (!view || title === undefined) {
|
|
781
|
-
return undefined;
|
|
782
|
-
}
|
|
783
|
-
const cut = line.indexOf('\n');
|
|
784
|
-
const preview = line ? { at: Number(line.slice(0, cut)), text: line.slice(cut + 1) } : undefined;
|
|
785
|
-
return { title, location: view.location, shown, menu: view.menu, preview, busy };
|
|
786
|
-
}, [view, title, shown, line, busy]);
|
|
787
|
-
},
|
|
788
|
-
Avatar: ta_avatar_1.TaAvatar,
|
|
789
|
-
icons: icons_1.WEB_ICONS,
|
|
790
|
-
CodeEditor: this.codeEditor,
|
|
791
|
-
DiffEditor: this.diffEditor,
|
|
792
|
-
// Ends with the extension.
|
|
793
|
-
createTerminal: (options) => {
|
|
794
|
-
const terminal = new web_terminal_1.DefaultWebTerminal(settings, (target, open) => void this.links.open(target, open), options);
|
|
795
|
-
run.unsubscribes.push(() => terminal.dispose());
|
|
796
|
-
return terminal;
|
|
797
|
-
},
|
|
798
|
-
Composer: this.composer,
|
|
799
|
-
Markdown: markdown_1.Markdown,
|
|
800
|
-
useChatScroll: (sent, key) => (0, conversation_scroll_1.useConversationScroll)(sent, { sentTo: 'bottom', key }),
|
|
801
|
-
Empty: empty_state_1.EmptyState,
|
|
802
|
-
Skeleton: list_skeleton_1.ListSkeleton,
|
|
803
|
-
HostTag: host_tag_1.HostTag,
|
|
804
|
-
SwipeRow: swipe_row_1.SwipeRow,
|
|
805
|
-
SelectCheck: select_bar_1.SelectCheck,
|
|
806
|
-
SelectBar: select_bar_1.SelectBar,
|
|
807
|
-
Picture: picture_1.Picture,
|
|
808
|
-
PictureCards: picture_1.PictureCards,
|
|
809
|
-
ImageViewer: image_viewer_1.ImageViewer,
|
|
810
|
-
QrCode: qr_view_1.QrView,
|
|
811
|
-
Dialog: web_dialog_1.WebDialog,
|
|
812
|
-
FolderPicker: this.folderPicker,
|
|
813
|
-
ModelPicker: this.modelPicker,
|
|
814
|
-
},
|
|
815
|
-
onTerminalData: listener => {
|
|
816
|
-
if (run.stopped) {
|
|
817
|
-
return () => undefined;
|
|
818
|
-
}
|
|
819
|
-
const unsubscribe = workbench.onTerminalData((terminalId, data, exitCode) => this.guard(run, () => listener(terminalId, data, exitCode)));
|
|
820
|
-
run.unsubscribes.push(unsubscribe);
|
|
821
|
-
return () => {
|
|
822
|
-
unsubscribe();
|
|
823
|
-
run.unsubscribes = run.unsubscribes.filter(other => other !== unsubscribe);
|
|
824
|
-
};
|
|
825
|
-
},
|
|
826
|
-
storage: { ...this.storage(run), directory: cwd => this.storage(run, cwd) },
|
|
827
|
-
registerView: (name, view) => register(() => run.views.set(name, view)),
|
|
828
|
-
registerMessageRenderer: (customType, renderer) => register(() => run.renderers.set(customType, renderer)),
|
|
829
|
-
registerAvatar: avatar => register(() => {
|
|
830
|
-
run.avatar = avatar;
|
|
831
|
-
}),
|
|
832
|
-
registerTool: tool => register(() => run.tools.push(tool)),
|
|
833
|
-
registerTasks: source => register(() => run.taskSources.push(source)),
|
|
834
|
-
registerSearch: source => register(() => run.searches.push(source)),
|
|
835
|
-
registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
|
|
836
|
-
registerSettings: section => register(() => run.settingsSections.push(section)),
|
|
837
|
-
registerOpener: opener => register(() => run.openers.push(async (link) => {
|
|
838
|
-
// An opener that fails, or of an extension that stopped, leaves the link to the next one.
|
|
839
|
-
try {
|
|
840
|
-
return !run.stopped && (await opener(link)) === true;
|
|
841
|
-
}
|
|
842
|
-
catch (error) {
|
|
843
|
-
console.error(`The web extension ${run.loaded.name} failed:`, error);
|
|
844
|
-
return false;
|
|
845
|
-
}
|
|
846
|
-
})),
|
|
847
|
-
on: (type, handler) => register(() => run.handlers.push({ type, handler: handler })),
|
|
848
|
-
sendUserMessage: async (text) => {
|
|
849
|
-
var _a;
|
|
850
|
-
if (!((_a = this.conversation) === null || _a === void 0 ? void 0 : _a.send)) {
|
|
851
|
-
throw new Error('No conversation is shown yet.');
|
|
852
|
-
}
|
|
853
|
-
await this.conversation.send(text);
|
|
854
|
-
},
|
|
855
|
-
switchSession: async (session, opening) => {
|
|
856
|
-
if (!this.switcher) {
|
|
857
|
-
throw new Error('The page cannot show another conversation yet.');
|
|
858
|
-
}
|
|
859
|
-
const shown = this.switcher(session, opening);
|
|
860
|
-
this.showPage('');
|
|
861
|
-
await shown;
|
|
862
|
-
},
|
|
863
|
-
openTemporary: (source, from) => this.openTemporary(source, from),
|
|
864
|
-
callHost: (method, ...params) => workbench.packages.callPackageHost(run.loaded.name, method, params),
|
|
865
|
-
reloadExtensions: () => this.reloadPackages(),
|
|
866
|
-
};
|
|
479
|
+
(_a = this.wired) !== null && _a !== void 0 ? _a : (this.wired = new web_extension_context_1.WebExtensionContext(this.contextHost()));
|
|
480
|
+
return this.wired;
|
|
867
481
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
const { workbench } = this;
|
|
871
|
-
const { name } = run.loaded;
|
|
482
|
+
contextHost() {
|
|
483
|
+
const self = this;
|
|
872
484
|
return {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
if (changed === name && directory === cwd) {
|
|
882
|
-
this.guard(run, () => listener(keys));
|
|
883
|
-
}
|
|
884
|
-
});
|
|
885
|
-
run.unsubscribes.push(unsubscribe);
|
|
886
|
-
return () => {
|
|
887
|
-
unsubscribe();
|
|
888
|
-
run.unsubscribes = run.unsubscribes.filter(other => other !== unsubscribe);
|
|
889
|
-
};
|
|
485
|
+
extensions: this,
|
|
486
|
+
workbench: this.workbench,
|
|
487
|
+
settings: this.settings,
|
|
488
|
+
files: this.taFiles,
|
|
489
|
+
notices: this.notices,
|
|
490
|
+
// Detached: asked for when a terminal opens a link, not before.
|
|
491
|
+
get links() {
|
|
492
|
+
return self.links;
|
|
890
493
|
},
|
|
494
|
+
tabs: this.tabs,
|
|
495
|
+
publish: () => this.publish(),
|
|
496
|
+
guard: (run, action) => this.guard(run, action),
|
|
497
|
+
isShown: id => this.isShown(id),
|
|
498
|
+
subscribePages: listener => this.subscribePages(listener),
|
|
499
|
+
conversation: () => this.conversation,
|
|
500
|
+
switcher: () => this.switcher,
|
|
501
|
+
sessionNotices: this.sessionNotices,
|
|
502
|
+
persisted: this.persisted,
|
|
891
503
|
};
|
|
892
504
|
}
|
|
893
505
|
guard(run, action) {
|
|
@@ -899,68 +511,24 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
899
511
|
}
|
|
900
512
|
}
|
|
901
513
|
publish() {
|
|
902
|
-
var _a;
|
|
903
514
|
const runs = [...this.running.values()];
|
|
904
|
-
const renderers = {};
|
|
905
|
-
const avatars = {};
|
|
906
|
-
const tools = [];
|
|
907
|
-
for (const run of runs) {
|
|
908
|
-
if (run.avatar) {
|
|
909
|
-
avatars[run.loaded.name] = run.avatar;
|
|
910
|
-
}
|
|
911
|
-
for (const [type, renderer] of run.renderers) {
|
|
912
|
-
(_a = renderers[type]) !== null && _a !== void 0 ? _a : (renderers[type] = renderer);
|
|
913
|
-
}
|
|
914
|
-
for (const tool of run.tools) {
|
|
915
|
-
if (!tools.some(other => other.name === tool.name)) {
|
|
916
|
-
tools.push(tool);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
515
|
this.tasks.setSources(runs.flatMap(run => run.taskSources.map(source => ({ extension: run.loaded.name, source }))));
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
extension: run.loaded.id,
|
|
924
|
-
title: view.title,
|
|
925
|
-
component: view.render,
|
|
926
|
-
icon: view.icon,
|
|
927
|
-
location: (_e = view.location) !== null && _e !== void 0 ? _e : 'page',
|
|
928
|
-
order: (_f = view.order) !== null && _f !== void 0 ? _f : DEFAULT_ORDER,
|
|
929
|
-
head: view.head,
|
|
930
|
-
pages: view.pages,
|
|
931
|
-
discover: view.discover,
|
|
932
|
-
menu: (_a = view.menu) === null || _a === void 0 ? void 0 : _a.bind(view),
|
|
933
|
-
preview: (_b = view.preview) === null || _b === void 0 ? void 0 : _b.bind(view),
|
|
934
|
-
busy: (_c = view.busy) === null || _c === void 0 ? void 0 : _c.bind(view),
|
|
935
|
-
subscribePreview: (_d = view.subscribe) === null || _d === void 0 ? void 0 : _d.bind(view),
|
|
936
|
-
...(this.onDemand.has(run.loaded.id) ? { onOpen: true } : {}),
|
|
937
|
-
}); }));
|
|
516
|
+
this.home.setSources(runs.flatMap(run => run.homeSources.map(source => ({ extension: run.loaded.name, source }))));
|
|
517
|
+
const { views, ...registered } = web_extension_run_1.WebExtensionRunUtil.collect(runs, id => this.onDemand.has(id));
|
|
938
518
|
if (this.placeholders) {
|
|
939
519
|
views.push(...this.placeholders.filter(placeholder => !views.some(view => view.id === placeholder.id)));
|
|
940
520
|
}
|
|
941
521
|
else {
|
|
942
|
-
this.
|
|
522
|
+
const kinds = this.listedKinds();
|
|
523
|
+
// Those of a kind a page lists never take a place of the navigation: none to keep for its first frame.
|
|
524
|
+
this.persisted.set(web_view_util_1.WebViewUtil.KEPT, web_view_util_1.WebViewUtil.keep(views.filter(view => { var _a; return !web_pages_1.WebPagesUtil.listed((_a = this.running.get(view.extension)) === null || _a === void 0 ? void 0 : _a.loaded.info, kinds); })));
|
|
943
525
|
}
|
|
944
526
|
this.update({
|
|
945
|
-
|
|
946
|
-
extensions: runs.map(run => run.loaded),
|
|
527
|
+
...registered,
|
|
947
528
|
views: views.sort((a, b) => a.order - b.order),
|
|
948
|
-
widgets: runs.flatMap(run => [...run.widgets].map(([key, { component, options }]) => { var _a; return ({
|
|
949
|
-
id: `${run.loaded.id}/${key}`,
|
|
950
|
-
extension: run.loaded.id,
|
|
951
|
-
placement: (_a = options.placement) !== null && _a !== void 0 ? _a : 'aboveEditor',
|
|
952
|
-
title: options.title,
|
|
953
|
-
component,
|
|
954
|
-
}); })),
|
|
955
|
-
composerAddons: runs.flatMap(run => run.composerAddons.map((addon, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, addon }))),
|
|
956
|
-
settingsSections: runs.flatMap(run => run.settingsSections.map((section, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, section }))),
|
|
957
|
-
renderers,
|
|
958
|
-
avatars,
|
|
959
|
-
tools,
|
|
960
529
|
onOpen: this.onDemand.list(),
|
|
961
530
|
kept: this.onDemand.kept(),
|
|
962
531
|
usage: this.onDemand.used,
|
|
963
|
-
searches: runs.flatMap(run => run.searches).sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : DEFAULT_ORDER) - ((_b = b.order) !== null && _b !== void 0 ? _b : DEFAULT_ORDER); }),
|
|
964
532
|
});
|
|
965
533
|
}
|
|
966
534
|
update(change) {
|
|
@@ -995,6 +563,10 @@ __decorate([
|
|
|
995
563
|
(0, core_1.Autowired)(state_protocol_1.TaState),
|
|
996
564
|
__metadata("design:type", Object)
|
|
997
565
|
], TaWebExtensionsImpl.prototype, "persisted", void 0);
|
|
566
|
+
__decorate([
|
|
567
|
+
(0, core_1.Autowired)(session_notices_1.TaSessionNotices),
|
|
568
|
+
__metadata("design:type", Object)
|
|
569
|
+
], TaWebExtensionsImpl.prototype, "sessionNotices", void 0);
|
|
998
570
|
__decorate([
|
|
999
571
|
(0, core_1.Autowired)(web_extension_protocol_1.BuiltinWebExtension),
|
|
1000
572
|
(0, core_1.Optional)(),
|