@celljs/ta-web 4.48.0 → 4.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/account/account-side.js +4 -0
- package/esm/browser/account/device-account.d.ts +6 -0
- package/esm/browser/account/device-account.js +20 -5
- package/esm/browser/assistant/assistant-view.js +2 -0
- package/esm/browser/assistant/call-announcing.d.ts +25 -0
- package/esm/browser/assistant/call-announcing.js +32 -0
- package/esm/browser/assistant/call-answering.d.ts +43 -0
- package/esm/browser/assistant/call-answering.js +63 -0
- package/esm/browser/assistant/call-hearing.d.ts +53 -0
- package/esm/browser/assistant/call-hearing.js +98 -0
- package/esm/browser/assistant/call-pausing.d.ts +40 -0
- package/esm/browser/assistant/call-pausing.js +82 -0
- package/esm/browser/assistant/call-reading.d.ts +32 -0
- package/esm/browser/assistant/call-reading.js +35 -0
- package/esm/browser/assistant/call-revoicing.d.ts +33 -0
- package/esm/browser/assistant/call-revoicing.js +68 -0
- package/esm/browser/assistant/call-turns.d.ts +29 -0
- package/esm/browser/assistant/call-turns.js +33 -0
- package/esm/browser/assistant/spoken-answer.d.ts +21 -0
- package/esm/browser/assistant/spoken-answer.js +69 -0
- package/esm/browser/assistant/spoken-call.d.ts +7 -0
- package/esm/browser/assistant/spoken-call.js +16 -0
- package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/esm/browser/assistant/voice-call.d.ts +47 -43
- package/esm/browser/assistant/voice-call.js +193 -219
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/components/account-recovery-view.d.ts +11 -0
- package/esm/browser/components/account-recovery-view.js +81 -0
- package/esm/browser/components/account-view.d.ts +1 -2
- package/esm/browser/components/account-view.js +10 -1
- package/esm/browser/components/app-nav.js +19 -8
- package/esm/browser/components/app-shell-hooks.d.ts +5 -0
- package/esm/browser/components/app-shell-hooks.js +45 -0
- package/esm/browser/components/app-shell-state.js +2 -1
- package/esm/browser/components/app-view.js +9 -5
- package/esm/browser/components/chat-emoji.d.ts +35 -0
- package/esm/browser/components/chat-emoji.js +129 -0
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +6 -0
- package/esm/browser/components/composer-attachments.js +12 -1
- package/esm/browser/components/composer-box-protocol.d.ts +15 -0
- package/esm/browser/components/composer-box.js +110 -87
- package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
- package/esm/browser/components/composer-drop-hooks.js +36 -0
- package/esm/browser/components/composer-emoji.js +1 -1
- package/esm/browser/components/composer-faces.d.ts +16 -0
- package/esm/browser/components/composer-faces.js +37 -0
- package/esm/browser/components/composer-media.d.ts +10 -0
- package/esm/browser/components/composer-media.js +12 -1
- package/esm/browser/components/composer-target.d.ts +4 -0
- package/esm/browser/components/composer-target.js +18 -7
- package/esm/browser/components/composer-type-focus.d.ts +24 -0
- package/esm/browser/components/composer-type-focus.js +17 -0
- package/esm/browser/components/composer-voice.d.ts +24 -0
- package/esm/browser/components/composer-voice.js +37 -0
- package/esm/browser/components/composer.d.ts +2 -2
- package/esm/browser/components/composer.js +39 -8
- package/esm/browser/components/context-menu.js +2 -1
- package/esm/browser/components/emoji-panel.d.ts +11 -7
- package/esm/browser/components/emoji-panel.js +40 -22
- package/esm/browser/components/extension-settings.js +2 -2
- package/esm/browser/components/folder-new.d.ts +18 -0
- package/esm/browser/components/folder-new.js +53 -0
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +18 -6
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-menu.d.ts +8 -3
- package/esm/browser/components/image-menu.js +34 -9
- package/esm/browser/components/markdown.js +9 -2
- package/esm/browser/components/media.js +3 -2
- package/esm/browser/components/message-list.js +2 -2
- package/esm/browser/components/message-steps.js +20 -11
- package/esm/browser/components/message-user.js +2 -2
- package/esm/browser/components/moved-notice.js +2 -1
- package/esm/browser/components/nav-places.d.ts +2 -0
- package/esm/browser/components/nav-places.js +4 -2
- package/esm/browser/components/phone-shell.d.ts +2 -0
- package/esm/browser/components/phone-shell.js +5 -1
- package/esm/browser/components/secret-text.d.ts +1 -1
- package/esm/browser/components/secret-text.js +4 -3
- package/esm/browser/components/session-view.js +3 -0
- package/esm/browser/components/settings-choices.d.ts +2 -1
- package/esm/browser/components/settings-choices.js +13 -5
- package/esm/browser/components/settings-more.js +3 -3
- package/esm/browser/components/settings-parts.js +13 -2
- package/esm/browser/components/share-item-sheet.js +7 -1
- package/esm/browser/components/tab-title.d.ts +27 -0
- package/esm/browser/components/tab-title.js +35 -0
- package/esm/browser/components/use-composer-attachments.d.ts +28 -0
- package/esm/browser/components/use-composer-attachments.js +65 -0
- package/esm/browser/components/use-composer-files.d.ts +25 -0
- package/esm/browser/components/use-composer-files.js +52 -0
- package/esm/browser/components/web-composer.d.ts +3 -1
- package/esm/browser/components/web-composer.js +3 -2
- package/esm/browser/components/workbench-view.js +1 -0
- package/esm/browser/components/working-directory.js +2 -1
- package/esm/browser/device/drag-move.d.ts +21 -0
- package/esm/browser/device/drag-move.js +86 -0
- package/esm/browser/extension/icons.js +7 -1
- package/esm/browser/extension/web-api-desktop.d.ts +19 -0
- package/esm/browser/extension/web-api-menus.d.ts +19 -0
- package/esm/browser/extension/web-api-spec.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +24 -23
- package/esm/browser/extension/web-extension-context.d.ts +1 -0
- package/esm/browser/extension/web-extension-context.js +12 -5
- package/esm/browser/extension/web-extension-run.js +1 -0
- package/esm/browser/extension/web-share-ui.d.ts +1 -1
- package/esm/browser/extension/web-share-ui.js +2 -0
- package/esm/browser/extension/web-share.d.ts +13 -0
- package/esm/browser/extension/web-share.js +37 -2
- package/esm/browser/i18n/en/account.d.ts +18 -0
- package/esm/browser/i18n/en/account.js +18 -0
- package/esm/browser/i18n/en/call.js +1 -1
- package/esm/browser/i18n/en/chat.d.ts +15 -0
- package/esm/browser/i18n/en/chat.js +16 -1
- package/esm/browser/i18n/en/common.d.ts +2 -0
- package/esm/browser/i18n/en/common.js +2 -0
- package/esm/browser/i18n/en/discover.d.ts +2 -0
- package/esm/browser/i18n/en/discover.js +2 -0
- package/esm/browser/i18n/en/settings.d.ts +17 -0
- package/esm/browser/i18n/en/settings.js +17 -0
- package/esm/browser/i18n/ja/account.js +18 -0
- package/esm/browser/i18n/ja/call.js +1 -1
- package/esm/browser/i18n/ja/chat.js +16 -1
- package/esm/browser/i18n/ja/common.js +2 -0
- package/esm/browser/i18n/ja/discover.js +3 -1
- package/esm/browser/i18n/ja/settings.js +17 -0
- package/esm/browser/i18n/locales.d.ts +55 -1
- package/esm/browser/i18n/messages.d.ts +54 -0
- package/esm/browser/i18n/zh/account.js +18 -0
- package/esm/browser/i18n/zh/call.js +1 -1
- package/esm/browser/i18n/zh/chat.js +16 -1
- package/esm/browser/i18n/zh/common.js +2 -0
- package/esm/browser/i18n/zh/discover.js +3 -1
- package/esm/browser/i18n/zh/settings.js +17 -0
- package/esm/browser/i18n/zh-tw/account.js +18 -0
- package/esm/browser/i18n/zh-tw/call.js +1 -1
- package/esm/browser/i18n/zh-tw/chat.js +16 -1
- package/esm/browser/i18n/zh-tw/common.js +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +3 -1
- package/esm/browser/i18n/zh-tw/settings.js +17 -0
- package/esm/browser/offline/kept-chats.d.ts +3 -1
- package/esm/browser/offline/kept-chats.js +1 -1
- package/esm/browser/partners/group-picker.d.ts +3 -2
- package/esm/browser/partners/group-picker.js +8 -3
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-docs.js +5 -2
- package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
- package/esm/browser/sandbox/work/work-frame.js +9 -3
- package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
- package/esm/browser/sandbox/work/work-gates.js +182 -0
- package/esm/browser/settings/agent-settings.js +1 -1
- package/esm/browser/settings/navigation.d.ts +38 -10
- package/esm/browser/settings/navigation.js +73 -17
- package/esm/browser/settings/settings-protocol.d.ts +16 -1
- package/esm/browser/settings/settings-protocol.js +20 -2
- package/esm/browser/settings/settings.js +4 -1
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +15 -2
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +6 -3
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +28 -8
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +5 -0
- package/esm/browser/style/device.js +5 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +3 -3
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +13 -6
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +4 -2
- package/esm/browser/util/chat-emoji.d.ts +44 -0
- package/esm/browser/util/chat-emoji.js +269 -0
- package/esm/browser/util/composer-drop.d.ts +26 -0
- package/esm/browser/util/composer-drop.js +40 -0
- package/esm/browser/util/composer-files.d.ts +48 -0
- package/esm/browser/util/composer-files.js +99 -0
- package/esm/browser/util/composer.d.ts +13 -1
- package/esm/browser/util/composer.js +24 -6
- package/esm/browser/util/markdown.d.ts +5 -0
- package/esm/browser/util/markdown.js +18 -0
- package/esm/browser/util/message.d.ts +6 -1
- package/esm/browser/util/message.js +13 -2
- package/esm/browser/util/process.d.ts +10 -13
- package/esm/browser/util/process.js +31 -83
- package/esm/browser/util/turn-join.d.ts +38 -0
- package/esm/browser/util/turn-join.js +119 -0
- package/esm/browser/workbench-services.js +1 -1
- package/lib/browser/account/account-side.js +4 -0
- package/lib/browser/account/device-account.d.ts +6 -0
- package/lib/browser/account/device-account.js +20 -5
- package/lib/browser/assistant/assistant-view.js +2 -0
- package/lib/browser/assistant/call-announcing.d.ts +26 -0
- package/lib/browser/assistant/call-announcing.js +36 -0
- package/lib/browser/assistant/call-answering.d.ts +44 -0
- package/lib/browser/assistant/call-answering.js +67 -0
- package/lib/browser/assistant/call-hearing.d.ts +54 -0
- package/lib/browser/assistant/call-hearing.js +102 -0
- package/lib/browser/assistant/call-pausing.d.ts +41 -0
- package/lib/browser/assistant/call-pausing.js +86 -0
- package/lib/browser/assistant/call-reading.d.ts +33 -0
- package/lib/browser/assistant/call-reading.js +39 -0
- package/lib/browser/assistant/call-revoicing.d.ts +34 -0
- package/lib/browser/assistant/call-revoicing.js +72 -0
- package/lib/browser/assistant/call-turns.d.ts +30 -0
- package/lib/browser/assistant/call-turns.js +37 -0
- package/lib/browser/assistant/spoken-answer.d.ts +22 -0
- package/lib/browser/assistant/spoken-answer.js +73 -0
- package/lib/browser/assistant/spoken-call.d.ts +8 -0
- package/lib/browser/assistant/spoken-call.js +19 -0
- package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/lib/browser/assistant/voice-call.d.ts +47 -43
- package/lib/browser/assistant/voice-call.js +192 -218
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/components/account-recovery-view.d.ts +12 -0
- package/lib/browser/components/account-recovery-view.js +117 -0
- package/lib/browser/components/account-view.d.ts +1 -2
- package/lib/browser/components/account-view.js +10 -1
- package/lib/browser/components/app-nav.js +19 -8
- package/lib/browser/components/app-shell-hooks.d.ts +5 -0
- package/lib/browser/components/app-shell-hooks.js +46 -0
- package/lib/browser/components/app-shell-state.js +1 -0
- package/lib/browser/components/app-view.js +8 -4
- package/lib/browser/components/chat-emoji.d.ts +36 -0
- package/lib/browser/components/chat-emoji.js +167 -0
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +6 -0
- package/lib/browser/components/composer-attachments.js +12 -0
- package/lib/browser/components/composer-box-protocol.d.ts +15 -0
- package/lib/browser/components/composer-box.js +107 -84
- package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
- package/lib/browser/components/composer-drop-hooks.js +72 -0
- package/lib/browser/components/composer-emoji.js +1 -1
- package/lib/browser/components/composer-faces.d.ts +17 -0
- package/lib/browser/components/composer-faces.js +73 -0
- package/lib/browser/components/composer-media.d.ts +10 -0
- package/lib/browser/components/composer-media.js +13 -0
- package/lib/browser/components/composer-target.d.ts +4 -0
- package/lib/browser/components/composer-target.js +18 -7
- package/lib/browser/components/composer-type-focus.d.ts +25 -0
- package/lib/browser/components/composer-type-focus.js +20 -0
- package/lib/browser/components/composer-voice.d.ts +25 -0
- package/lib/browser/components/composer-voice.js +73 -0
- package/lib/browser/components/composer.d.ts +2 -2
- package/lib/browser/components/composer.js +38 -7
- package/lib/browser/components/context-menu.js +2 -1
- package/lib/browser/components/emoji-panel.d.ts +11 -7
- package/lib/browser/components/emoji-panel.js +40 -22
- package/lib/browser/components/extension-settings.js +1 -1
- package/lib/browser/components/folder-new.d.ts +19 -0
- package/lib/browser/components/folder-new.js +90 -0
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +17 -5
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-menu.d.ts +8 -3
- package/lib/browser/components/image-menu.js +34 -9
- package/lib/browser/components/markdown.js +9 -2
- package/lib/browser/components/media.js +3 -2
- package/lib/browser/components/message-list.js +2 -2
- package/lib/browser/components/message-steps.js +20 -11
- package/lib/browser/components/message-user.js +1 -1
- package/lib/browser/components/moved-notice.js +2 -1
- package/lib/browser/components/nav-places.d.ts +2 -0
- package/lib/browser/components/nav-places.js +4 -2
- package/lib/browser/components/phone-shell.d.ts +2 -0
- package/lib/browser/components/phone-shell.js +5 -1
- package/lib/browser/components/secret-text.d.ts +1 -1
- package/lib/browser/components/secret-text.js +4 -3
- package/lib/browser/components/session-view.js +3 -0
- package/lib/browser/components/settings-choices.d.ts +2 -1
- package/lib/browser/components/settings-choices.js +12 -4
- package/lib/browser/components/settings-more.js +2 -2
- package/lib/browser/components/settings-parts.js +11 -0
- package/lib/browser/components/share-item-sheet.js +7 -1
- package/lib/browser/components/tab-title.d.ts +28 -0
- package/lib/browser/components/tab-title.js +38 -0
- package/lib/browser/components/use-composer-attachments.d.ts +29 -0
- package/lib/browser/components/use-composer-attachments.js +101 -0
- package/lib/browser/components/use-composer-files.d.ts +26 -0
- package/lib/browser/components/use-composer-files.js +88 -0
- package/lib/browser/components/web-composer.d.ts +3 -1
- package/lib/browser/components/web-composer.js +3 -2
- package/lib/browser/components/workbench-view.js +1 -0
- package/lib/browser/components/working-directory.js +2 -1
- package/lib/browser/device/drag-move.d.ts +22 -0
- package/lib/browser/device/drag-move.js +122 -0
- package/lib/browser/extension/icons.js +6 -0
- package/lib/browser/extension/web-api-desktop.d.ts +19 -0
- package/lib/browser/extension/web-api-menus.d.ts +19 -0
- package/lib/browser/extension/web-api-spec.js +2 -0
- package/lib/browser/extension/web-extension-api.d.ts +24 -23
- package/lib/browser/extension/web-extension-context.d.ts +1 -0
- package/lib/browser/extension/web-extension-context.js +12 -5
- package/lib/browser/extension/web-extension-run.js +1 -0
- package/lib/browser/extension/web-share-ui.d.ts +1 -1
- package/lib/browser/extension/web-share-ui.js +2 -0
- package/lib/browser/extension/web-share.d.ts +13 -0
- package/lib/browser/extension/web-share.js +37 -2
- package/lib/browser/i18n/en/account.d.ts +18 -0
- package/lib/browser/i18n/en/account.js +18 -0
- package/lib/browser/i18n/en/call.js +1 -1
- package/lib/browser/i18n/en/chat.d.ts +15 -0
- package/lib/browser/i18n/en/chat.js +16 -1
- package/lib/browser/i18n/en/common.d.ts +2 -0
- package/lib/browser/i18n/en/common.js +2 -0
- package/lib/browser/i18n/en/discover.d.ts +2 -0
- package/lib/browser/i18n/en/discover.js +2 -0
- package/lib/browser/i18n/en/settings.d.ts +17 -0
- package/lib/browser/i18n/en/settings.js +17 -0
- package/lib/browser/i18n/ja/account.js +18 -0
- package/lib/browser/i18n/ja/call.js +1 -1
- package/lib/browser/i18n/ja/chat.js +16 -1
- package/lib/browser/i18n/ja/common.js +2 -0
- package/lib/browser/i18n/ja/discover.js +3 -1
- package/lib/browser/i18n/ja/settings.js +17 -0
- package/lib/browser/i18n/locales.d.ts +55 -1
- package/lib/browser/i18n/messages.d.ts +54 -0
- package/lib/browser/i18n/zh/account.js +18 -0
- package/lib/browser/i18n/zh/call.js +1 -1
- package/lib/browser/i18n/zh/chat.js +16 -1
- package/lib/browser/i18n/zh/common.js +2 -0
- package/lib/browser/i18n/zh/discover.js +3 -1
- package/lib/browser/i18n/zh/settings.js +17 -0
- package/lib/browser/i18n/zh-tw/account.js +18 -0
- package/lib/browser/i18n/zh-tw/call.js +1 -1
- package/lib/browser/i18n/zh-tw/chat.js +16 -1
- package/lib/browser/i18n/zh-tw/common.js +2 -0
- package/lib/browser/i18n/zh-tw/discover.js +3 -1
- package/lib/browser/i18n/zh-tw/settings.js +17 -0
- package/lib/browser/offline/kept-chats.d.ts +3 -1
- package/lib/browser/offline/kept-chats.js +1 -1
- package/lib/browser/partners/group-picker.d.ts +3 -2
- package/lib/browser/partners/group-picker.js +8 -3
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-docs.js +5 -2
- package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
- package/lib/browser/sandbox/work/work-frame.js +9 -3
- package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
- package/lib/browser/sandbox/work/work-gates.js +185 -0
- package/lib/browser/settings/agent-settings.js +1 -1
- package/lib/browser/settings/navigation.d.ts +38 -10
- package/lib/browser/settings/navigation.js +74 -18
- package/lib/browser/settings/settings-protocol.d.ts +16 -1
- package/lib/browser/settings/settings-protocol.js +21 -3
- package/lib/browser/settings/settings.js +3 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +15 -2
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +6 -3
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +28 -8
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +5 -0
- package/lib/browser/style/device.js +5 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +3 -3
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +13 -6
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +4 -2
- package/lib/browser/util/chat-emoji.d.ts +45 -0
- package/lib/browser/util/chat-emoji.js +272 -0
- package/lib/browser/util/composer-drop.d.ts +27 -0
- package/lib/browser/util/composer-drop.js +43 -0
- package/lib/browser/util/composer-files.d.ts +49 -0
- package/lib/browser/util/composer-files.js +102 -0
- package/lib/browser/util/composer.d.ts +13 -1
- package/lib/browser/util/composer.js +24 -6
- package/lib/browser/util/markdown.d.ts +5 -0
- package/lib/browser/util/markdown.js +18 -0
- package/lib/browser/util/message.d.ts +6 -1
- package/lib/browser/util/message.js +13 -2
- package/lib/browser/util/process.d.ts +10 -13
- package/lib/browser/util/process.js +32 -84
- package/lib/browser/util/turn-join.d.ts +39 -0
- package/lib/browser/util/turn-join.js +122 -0
- package/lib/browser/workbench-services.js +1 -1
- package/package.json +7 -7
- package/public/emoji/wechat-v1.webp +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useComposerFiles = useComposerFiles;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const composer_files_1 = require("../util/composer-files");
|
|
39
|
+
/**
|
|
40
|
+
* Picks files of the box other than the pictures a model sees itself: each shows at once and is uploaded under
|
|
41
|
+
* `uploads/` of the directory of the conversation, where the message names it as an `@` reference (ComposerFileUtil).
|
|
42
|
+
* A file that fails to go takes its chip away, and says why.
|
|
43
|
+
*/
|
|
44
|
+
function useComposerFiles(files, cwd, t, onError) {
|
|
45
|
+
const [picked, setPicked] = React.useState([]);
|
|
46
|
+
const add = React.useCallback((list) => {
|
|
47
|
+
const workspace = files === null || files === void 0 ? void 0 : files.workspace;
|
|
48
|
+
if (!workspace || !list.length) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!cwd) {
|
|
52
|
+
onError(new Error(t('ta.composer.file.noDir')));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const refused = list.flatMap(file => {
|
|
56
|
+
const reason = composer_files_1.ComposerFileUtil.refuse(file);
|
|
57
|
+
return reason ? [{ file, reason }] : [];
|
|
58
|
+
});
|
|
59
|
+
for (const { file, reason } of refused) {
|
|
60
|
+
onError(new Error(t(`ta.composer.file.${reason}`, { name: file.name, mb: Math.round(composer_files_1.MAX_FILE_BYTES / (1024 * 1024)) })));
|
|
61
|
+
}
|
|
62
|
+
const accepted = list.filter(file => !composer_files_1.ComposerFileUtil.refuse(file));
|
|
63
|
+
if (!accepted.length) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
void composer_files_1.ComposerFileUtil.taken(workspace, cwd).then(there => {
|
|
67
|
+
// Each place is taken at once, so that two files of a name picked together do not meet.
|
|
68
|
+
const shown = accepted.map(file => {
|
|
69
|
+
const path = composer_files_1.ComposerFileUtil.place(file.name, there);
|
|
70
|
+
there.add(path);
|
|
71
|
+
return { id: crypto.randomUUID(), name: file.name, path, size: file.size, done: 0 };
|
|
72
|
+
});
|
|
73
|
+
setPicked(previous => [...previous, ...shown]);
|
|
74
|
+
accepted.forEach((file, index) => {
|
|
75
|
+
const entry = shown[index];
|
|
76
|
+
void composer_files_1.ComposerFileUtil.upload(workspace, cwd, entry.path, file, done => setPicked(previous => previous.map(other => (other.id === entry.id ? { ...other, done } : other)))).catch(error => {
|
|
77
|
+
setPicked(previous => previous.filter(other => other.id !== entry.id));
|
|
78
|
+
onError(error);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}, error => onError(error));
|
|
82
|
+
}, [files, cwd, t, onError]);
|
|
83
|
+
const remove = React.useCallback((id) => setPicked(previous => previous.filter(file => file.id !== id)), []);
|
|
84
|
+
const clear = React.useCallback(() => setPicked([]), []);
|
|
85
|
+
const restore = React.useCallback((files) => setPicked(files), []);
|
|
86
|
+
return { files: picked, ready: picked.every(file => file.done >= 1), add, remove, clear, restore };
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=use-composer-files.js.map
|
|
@@ -10,6 +10,8 @@ export interface WebComposerHostProps extends WebComposerProps {
|
|
|
10
10
|
server: Pick<TaServer, 'getDirectoryCommands'>;
|
|
11
11
|
/** The entries of a directory of the server, for the button of `onPickCwd`. */
|
|
12
12
|
listDirectory?(directory: string): Promise<TaDirEntry[]>;
|
|
13
|
+
/** Makes the folder `name` in a directory of the server, for the button of `onPickCwd`. */
|
|
14
|
+
createDirectory?(directory: string, name: string): Promise<void>;
|
|
13
15
|
/** The directory of ta serve: that of a `cwd` left empty. */
|
|
14
16
|
serverCwd?: string;
|
|
15
17
|
/** The hosts of ssh, which the button offers too. */
|
|
@@ -19,5 +21,5 @@ export interface WebComposerHostProps extends WebComposerProps {
|
|
|
19
21
|
* The message box as web extensions get it (`pi.ui.Composer`): text, and pictures when it takes them (shrunk within
|
|
20
22
|
* the limits given), `@` for the names they give; a failure is a notice of the page.
|
|
21
23
|
*/
|
|
22
|
-
export declare function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
|
|
24
|
+
export declare function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, createDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
|
|
23
25
|
//# sourceMappingURL=web-composer.d.ts.map
|
|
@@ -47,7 +47,7 @@ const folder_picker_1 = require("./folder-picker");
|
|
|
47
47
|
* The message box as web extensions get it (`pi.ui.Composer`): text, and pictures when it takes them (shrunk within
|
|
48
48
|
* the limits given), `@` for the names they give; a failure is a notice of the page.
|
|
49
49
|
*/
|
|
50
|
-
function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, serverCwd, remote, }) {
|
|
50
|
+
function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, createDirectory, serverCwd, remote, }) {
|
|
51
51
|
const t = (0, use_t_1.useT)();
|
|
52
52
|
const language = (0, use_t_1.useLanguage)();
|
|
53
53
|
const [query, setQuery] = React.useState();
|
|
@@ -72,6 +72,7 @@ function WebComposer({ notices, placeholder, onSend, images, videos, emoji, auto
|
|
|
72
72
|
detail: mention.detail,
|
|
73
73
|
})),
|
|
74
74
|
}
|
|
75
|
-
: undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions === null || actions === void 0 ? void 0 : actions.map(section => section.map(composer_addon_util_1.ComposerAddonUtil.action)), head: onPickCwd &&
|
|
75
|
+
: undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions === null || actions === void 0 ? void 0 : actions.map(section => section.map(composer_addon_util_1.ComposerAddonUtil.action)), head: onPickCwd &&
|
|
76
|
+
listDirectory && (React.createElement(folder_picker_1.DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, create: createDirectory, remote: remote, onPick: onPickCwd })), cwd: cwd || serverCwd, working: working, onStop: onStop, voiceSends: voiceSends, draft: draft, onTalkSent: onTalkSent, onListening: onListening, after: after, onError: cause => notices.error(cause) }));
|
|
76
77
|
}
|
|
77
78
|
//# sourceMappingURL=web-composer.js.map
|
|
@@ -60,6 +60,7 @@ function useDocument() {
|
|
|
60
60
|
// Before the browser draws what this commit made.
|
|
61
61
|
React.useLayoutEffect(() => style_1.PageStyle.attach(), []);
|
|
62
62
|
React.useEffect(() => {
|
|
63
|
+
// The name alone: the shell gives it with what waits for the user over this (TabTitleUtil).
|
|
63
64
|
document.title = 'Ta';
|
|
64
65
|
// Where the installed app's window is dragged when the page draws its title bar.
|
|
65
66
|
const titlebar = document.createElement('div');
|
|
@@ -46,6 +46,7 @@ function WorkingDirectoryPicker({ onClose }) {
|
|
|
46
46
|
const [workbench, bench] = (0, hooks_1.useWorkbench)();
|
|
47
47
|
const [, notices] = (0, hooks_1.useNotices)();
|
|
48
48
|
const list = React.useCallback((directory) => bench.workspace.listDirectory('.', directory), [bench]);
|
|
49
|
+
const create = React.useCallback((directory, name) => bench.workspace.createDirectory(name, directory), [bench]);
|
|
49
50
|
const pick = async (path) => {
|
|
50
51
|
try {
|
|
51
52
|
await bench.setWorkingDirectory(path);
|
|
@@ -56,6 +57,6 @@ function WorkingDirectoryPicker({ onClose }) {
|
|
|
56
57
|
notices.error(error);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
return React.createElement(folder_picker_1.FolderPicker, { list: list, initial: (_b = (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) !== null && _b !== void 0 ? _b : '.', remote: bench, onPick: pick, onClose: onClose });
|
|
60
|
+
return React.createElement(folder_picker_1.FolderPicker, { list: list, create: create, initial: (_b = (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) !== null && _b !== void 0 ? _b : '.', remote: bench, onPick: pick, onClose: onClose });
|
|
60
61
|
}
|
|
61
62
|
//# sourceMappingURL=working-directory.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Moving a page of the navigation by dragging it, as the rail does with a mouse: a press that goes a few pixels
|
|
4
|
+
* drags the entry, faint where it was, and a line says where it lands (the place of the entry the pointer is
|
|
5
|
+
* nearest). The entries say which page they are (`attr`); the caller keeps the order (NavigationUtil.move).
|
|
6
|
+
*/
|
|
7
|
+
export interface DragMove {
|
|
8
|
+
/** The attribute of an entry that says which page it is, its value the id. */
|
|
9
|
+
attr: string;
|
|
10
|
+
/** The page goes where that one was, or last (`target` none). */
|
|
11
|
+
onMove(page: string, target: string | undefined): void;
|
|
12
|
+
}
|
|
13
|
+
/** The drag as far as the caller draws it: the page on its way, and the entry whose place it would take (none: last). */
|
|
14
|
+
export interface Dragging {
|
|
15
|
+
page: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function useDragMove(move: DragMove): {
|
|
19
|
+
onPointerDown(event: React.PointerEvent): void;
|
|
20
|
+
dragging: Dragging | undefined;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=drag-move.d.ts.map
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useDragMove = useDragMove;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
/** How far a press moves before it drags: less is a click. */
|
|
39
|
+
const MOVE_PX = 6;
|
|
40
|
+
/** Where the entries are: the rail of the desktop, the tabs at the bottom of a phone. */
|
|
41
|
+
const CONTAINER = '.ta-rail-items, .ta-tabbar';
|
|
42
|
+
/** Where a drop lands: the place of the entry whose middle is nearest the pointer, along the row or the column. */
|
|
43
|
+
function landing(target, x, y) {
|
|
44
|
+
var _a;
|
|
45
|
+
var _b;
|
|
46
|
+
const container = (_a = target === null || target === void 0 ? void 0 : target.closest) === null || _a === void 0 ? void 0 : _a.call(target, CONTAINER);
|
|
47
|
+
const entries = container ? [...container.querySelectorAll('[data-nav-page]')] : [];
|
|
48
|
+
const row = !!(container === null || container === void 0 ? void 0 : container.classList.contains('ta-tabbar'));
|
|
49
|
+
let nearest;
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const rect = entry.getBoundingClientRect();
|
|
52
|
+
const distance = row ? Math.abs(x - (rect.left + rect.width / 2)) : Math.abs(y - (rect.top + rect.height / 2));
|
|
53
|
+
if (!nearest || distance < nearest.distance) {
|
|
54
|
+
nearest = { id: (_b = entry.getAttribute('data-nav-page')) !== null && _b !== void 0 ? _b : '', distance };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return nearest ? { target: nearest.id } : {};
|
|
58
|
+
}
|
|
59
|
+
function useDragMove(move) {
|
|
60
|
+
const [dragging, setDragging] = React.useState(undefined);
|
|
61
|
+
const current = React.useRef(move);
|
|
62
|
+
current.current = move;
|
|
63
|
+
const stop = React.useRef(() => undefined);
|
|
64
|
+
React.useEffect(() => stop.current, []);
|
|
65
|
+
const onPointerDown = React.useCallback((event) => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
var _c;
|
|
68
|
+
const entry = (_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, `[${current.current.attr}]`);
|
|
69
|
+
if (!entry || !event.isPrimary || event.button !== 0 || event.pointerType === 'touch') {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const page = (_c = entry.getAttribute(current.current.attr)) !== null && _c !== void 0 ? _c : '';
|
|
73
|
+
const from = { x: event.clientX, y: event.clientY };
|
|
74
|
+
let on = false;
|
|
75
|
+
let at = {};
|
|
76
|
+
const begin = (x, y) => {
|
|
77
|
+
on = true;
|
|
78
|
+
entry.setAttribute('data-dragging', '');
|
|
79
|
+
document.documentElement.setAttribute('data-dragging', '');
|
|
80
|
+
at = landing(document.elementFromPoint(x, y), x, y);
|
|
81
|
+
setDragging({ page, ...at });
|
|
82
|
+
};
|
|
83
|
+
const finish = (commit) => {
|
|
84
|
+
if (on) {
|
|
85
|
+
entry.removeAttribute('data-dragging');
|
|
86
|
+
document.documentElement.removeAttribute('data-dragging');
|
|
87
|
+
setDragging(undefined);
|
|
88
|
+
if (commit) {
|
|
89
|
+
current.current.onMove(page, at.target);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
off();
|
|
93
|
+
};
|
|
94
|
+
const onMove = (moved) => {
|
|
95
|
+
var _a;
|
|
96
|
+
if (!on) {
|
|
97
|
+
if (Math.hypot(moved.clientX - from.x, moved.clientY - from.y) <= MOVE_PX) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Past a few pixels it is a drag: no selection of the icon under it, no click of the press.
|
|
101
|
+
(_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
102
|
+
begin(moved.clientX, moved.clientY);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
at = landing(document.elementFromPoint(moved.clientX, moved.clientY), moved.clientX, moved.clientY);
|
|
106
|
+
setDragging({ page, ...at });
|
|
107
|
+
};
|
|
108
|
+
const onUp = () => finish(true);
|
|
109
|
+
const onCancel = () => finish(false);
|
|
110
|
+
const off = () => {
|
|
111
|
+
document.removeEventListener('pointermove', onMove);
|
|
112
|
+
document.removeEventListener('pointerup', onUp);
|
|
113
|
+
document.removeEventListener('pointercancel', onCancel);
|
|
114
|
+
};
|
|
115
|
+
document.addEventListener('pointermove', onMove);
|
|
116
|
+
document.addEventListener('pointerup', onUp);
|
|
117
|
+
document.addEventListener('pointercancel', onCancel);
|
|
118
|
+
stop.current = off;
|
|
119
|
+
}, []);
|
|
120
|
+
return { onPointerDown, dragging };
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=drag-move.js.map
|
|
@@ -16,8 +16,11 @@ exports.WEB_ICONS = Object.freeze({
|
|
|
16
16
|
Eraser: lucide_react_1.Eraser,
|
|
17
17
|
PaintBucket: lucide_react_1.PaintBucket,
|
|
18
18
|
Sigma: lucide_react_1.Sigma,
|
|
19
|
+
SkipBack: lucide_react_1.SkipBack,
|
|
20
|
+
SkipForward: lucide_react_1.SkipForward,
|
|
19
21
|
Snowflake: lucide_react_1.Snowflake,
|
|
20
22
|
TableCellsMerge: lucide_react_1.TableCellsMerge,
|
|
23
|
+
Blocks: lucide_react_1.Blocks,
|
|
21
24
|
AlarmClock: lucide_react_1.AlarmClock,
|
|
22
25
|
Aperture: lucide_react_1.Aperture,
|
|
23
26
|
AppWindow: lucide_react_1.AppWindow,
|
|
@@ -135,7 +138,9 @@ exports.WEB_ICONS = Object.freeze({
|
|
|
135
138
|
Navigation: lucide_react_1.Navigation,
|
|
136
139
|
Package: lucide_react_1.Package,
|
|
137
140
|
PackageOpen: lucide_react_1.PackageOpen,
|
|
141
|
+
Palette: lucide_react_1.Palette,
|
|
138
142
|
Paperclip: lucide_react_1.Paperclip,
|
|
143
|
+
Pause: lucide_react_1.Pause,
|
|
139
144
|
Pencil: lucide_react_1.Pencil,
|
|
140
145
|
Phone: lucide_react_1.Phone,
|
|
141
146
|
Pin: lucide_react_1.Pin,
|
|
@@ -195,6 +200,7 @@ exports.WEB_ICONS = Object.freeze({
|
|
|
195
200
|
UserPlus: lucide_react_1.UserPlus,
|
|
196
201
|
Users: lucide_react_1.Users,
|
|
197
202
|
Volume2: lucide_react_1.Volume2,
|
|
203
|
+
VolumeX: lucide_react_1.VolumeX,
|
|
198
204
|
WholeWord: lucide_react_1.WholeWord,
|
|
199
205
|
Wrench: lucide_react_1.Wrench,
|
|
200
206
|
X: lucide_react_1.X,
|
|
@@ -24,6 +24,25 @@ export interface WebDeviceUI {
|
|
|
24
24
|
* finger lands on something, `medium` for what the user should feel, a pat say. Newer than some Ta apps.
|
|
25
25
|
*/
|
|
26
26
|
haptic?(strength?: 'light' | 'medium'): void;
|
|
27
|
+
/**
|
|
28
|
+
* Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
|
|
29
|
+
* this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
|
|
30
|
+
*/
|
|
31
|
+
readonly desktop?: WebDesktop;
|
|
32
|
+
/**
|
|
33
|
+
* Ta Desktop: sends a command of the Chrome DevTools Protocol to the page of a `<webview>` of this page
|
|
34
|
+
* (its `getWebContentsId()`), as that page's debugger, and resolves with its result; `undefined`
|
|
35
|
+
* elsewhere. Only commands on the page itself: Accessibility, CSS, DOM, DOMSnapshot, Emulation, Input,
|
|
36
|
+
* Log, Overlay, Page and Runtime, without those that touch files, downloads or navigate (use the
|
|
37
|
+
* element's `loadURL`); the app refuses the rest.
|
|
38
|
+
*/
|
|
39
|
+
readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Ta Desktop: hears the tabs the pages of this page's `<webview>`s open or close (WebviewTabEvent); returns how to
|
|
42
|
+
* stop. Hearing tells the app the view has tabs: until then, and in an older app, a page opens its new tabs in place
|
|
43
|
+
* and Cmd+W goes to the app. `undefined` elsewhere.
|
|
44
|
+
*/
|
|
45
|
+
readonly onWebviewTab?: (listener: (event: WebviewTabEvent) => void) => () => void;
|
|
27
46
|
}
|
|
28
47
|
/**
|
|
29
48
|
* A tab the browser view should open or close, as Ta Desktop tells it (`ui.onWebviewTab`): a page of a webview opened a
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Part of the web extension API (web-extension-api.ts, which exports it all): the entries extensions add to menus of the page. */
|
|
2
2
|
import type { TaWorkPoint } from '@celljs/ta-protocol';
|
|
3
|
+
import type { WebComposerImage, WebComposerImageLimits } from './web-api-components';
|
|
3
4
|
import type { WebMenuItem } from './web-api-contributions';
|
|
4
5
|
import type { WebIcon } from './web-extension-api';
|
|
5
6
|
/** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
|
|
@@ -72,6 +73,17 @@ export type WebShareItem = {
|
|
|
72
73
|
gets?: string;
|
|
73
74
|
/** An icon of the page (WEB_ICONS) for what it is. */
|
|
74
75
|
icon?: string;
|
|
76
|
+
} | {
|
|
77
|
+
/**
|
|
78
|
+
* A picture or a video of a conversation or a chat, long pressed (its menu: Forward, Share). `url` is one the
|
|
79
|
+
* page can fetch (data:, blob: or http:), of the picture itself, not the smaller one shown; `accepts` reads
|
|
80
|
+
* `media`, not the bytes.
|
|
81
|
+
*/
|
|
82
|
+
kind: 'media';
|
|
83
|
+
media: 'image' | 'video';
|
|
84
|
+
url: string;
|
|
85
|
+
/** As it is called, with its extension: `photo.jpg`. */
|
|
86
|
+
name: string;
|
|
75
87
|
};
|
|
76
88
|
/**
|
|
77
89
|
* A way to share (registerShareWay): a tile of the share sheet, for what it takes. Send to friends and group chats,
|
|
@@ -84,6 +96,8 @@ export interface WebShareWay {
|
|
|
84
96
|
icon: WebIcon;
|
|
85
97
|
/** Its place among the tiles, the lowest first; default 100. */
|
|
86
98
|
order?: number;
|
|
99
|
+
/** Sends it into chats the user picks: Forward in the menu of a picture or a video goes straight to it. */
|
|
100
|
+
forward?: boolean;
|
|
87
101
|
/** Whether it takes the item; read as the sheet opens. */
|
|
88
102
|
accepts(item: WebShareItem): boolean;
|
|
89
103
|
/** The user picked it: the sheet has closed, the way shows what it needs (who to send to, the words of a post). */
|
|
@@ -96,6 +110,11 @@ export interface WebShareUI {
|
|
|
96
110
|
* Share under a block and in the menu of a file opens it. Newer than some Ta apps: `pi.ui.share?.(…)`.
|
|
97
111
|
*/
|
|
98
112
|
share(item: WebShareItem): void;
|
|
113
|
+
/**
|
|
114
|
+
* A picture made smaller as the message box makes it (WebComposerProps.images with `limits`), the picture as it
|
|
115
|
+
* was kept as `original` when it was: for one forwarded into a chat. Newer than some Ta apps: `pi.ui.shrinkImage?.(…)`.
|
|
116
|
+
*/
|
|
117
|
+
shrinkImage?(image: WebComposerImage, limits: WebComposerImageLimits): Promise<WebComposerImage>;
|
|
99
118
|
}
|
|
100
119
|
/** What a web extension adds to the menus of the page (WebExtensionAPI extends it). */
|
|
101
120
|
export interface WebMenus {
|
|
@@ -78,6 +78,7 @@ exports.WEB_UI_SPEC = {
|
|
|
78
78
|
FullScreen: component(B),
|
|
79
79
|
Stack: component(B),
|
|
80
80
|
Markdown: component(B),
|
|
81
|
+
EmojiText: component(B),
|
|
81
82
|
Empty: component(B),
|
|
82
83
|
Loading: component(B),
|
|
83
84
|
Skeleton: component(B),
|
|
@@ -110,6 +111,7 @@ exports.WEB_UI_SPEC = {
|
|
|
110
111
|
saveFile: call(A),
|
|
111
112
|
shareExtension: fire(A),
|
|
112
113
|
share: fire(B),
|
|
114
|
+
shrinkImage: call(B),
|
|
113
115
|
stopExtension: fire(A),
|
|
114
116
|
forgetPage: fire(A),
|
|
115
117
|
useView: hook(A),
|
|
@@ -7,7 +7,7 @@ import type { Language, Theme } from '../settings/settings-protocol';
|
|
|
7
7
|
import type { WebCodeRendererOptions, WebCodeRendererProps, WebMarkdownProps } from './web-api-code';
|
|
8
8
|
import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components';
|
|
9
9
|
import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebNotifyOptions, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions';
|
|
10
|
-
import type {
|
|
10
|
+
import type { WebDeviceUI, WebFileDrag } from './web-api-desktop';
|
|
11
11
|
import type { WebEditorsUI } from './web-api-editors';
|
|
12
12
|
import type { WebFileViews, WebFileViewsUI } from './web-api-file-views';
|
|
13
13
|
import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home';
|
|
@@ -245,31 +245,12 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
|
|
|
245
245
|
readonly supportsWebview: boolean;
|
|
246
246
|
/** The message box (`Composer`) takes `videos`, picked with the pictures. Newer than some Ta apps. */
|
|
247
247
|
readonly composerVideos?: boolean;
|
|
248
|
-
/**
|
|
249
|
-
* Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
|
|
250
|
-
* this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
|
|
251
|
-
*/
|
|
252
|
-
readonly desktop?: WebDesktop;
|
|
253
248
|
/**
|
|
254
249
|
* Files dragged between views, as the explorer drags them: `set` them in `dragstart`. Dropped on the
|
|
255
250
|
* message box of a conversation they become `@` references (relative to its directory when they are in
|
|
256
251
|
* it); a terminal takes their `paths`; anywhere else they are their paths as text.
|
|
257
252
|
*/
|
|
258
253
|
readonly fileDrag: WebFileDrag;
|
|
259
|
-
/**
|
|
260
|
-
* Ta Desktop: sends a command of the Chrome DevTools Protocol to the page of a `<webview>` of this page
|
|
261
|
-
* (its `getWebContentsId()`), as that page's debugger, and resolves with its result; `undefined`
|
|
262
|
-
* elsewhere. Only commands on the page itself: Accessibility, CSS, DOM, DOMSnapshot, Emulation, Input,
|
|
263
|
-
* Log, Overlay, Page and Runtime, without those that touch files, downloads or navigate (use the
|
|
264
|
-
* element's `loadURL`); the app refuses the rest.
|
|
265
|
-
*/
|
|
266
|
-
readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
267
|
-
/**
|
|
268
|
-
* Ta Desktop: hears the tabs the pages of this page's `<webview>`s open or close (WebviewTabEvent); returns how to
|
|
269
|
-
* stop. Hearing tells the app the view has tabs: until then, and in an older app, a page opens its new tabs in place
|
|
270
|
-
* and Cmd+W goes to the app. `undefined` elsewhere.
|
|
271
|
-
*/
|
|
272
|
-
readonly onWebviewTab?: (listener: (event: WebviewTabEvent) => void) => () => void;
|
|
273
254
|
/**
|
|
274
255
|
* Into the message box in front (a conversation's, or `ui.Composer` of a page): `quote` before what it holds, `images`
|
|
275
256
|
* (base64) as if pasted, `text` typed at its end (newer than some Ta apps); false when none shows.
|
|
@@ -338,9 +319,21 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
|
|
|
338
319
|
usePages(): readonly WebPageInfo[];
|
|
339
320
|
/**
|
|
340
321
|
* A React hook: the context menu of the page, as its lists open it (a right click, a long press on a touch
|
|
341
|
-
* screen): the menu to render,
|
|
342
|
-
|
|
343
|
-
|
|
322
|
+
* screen): the menu to render, `open` for `onContextMenu`, with sections set apart by a line, and `openAt` to
|
|
323
|
+
* open it where the user pressed (the point and the row around it), as an entry of a menu opening another.
|
|
324
|
+
*/
|
|
325
|
+
useContextMenu(): [
|
|
326
|
+
React.ReactNode,
|
|
327
|
+
(event: React.MouseEvent, sections: WebMenuItem[][]) => void,
|
|
328
|
+
(at: {
|
|
329
|
+
x: number;
|
|
330
|
+
y: number;
|
|
331
|
+
around?: {
|
|
332
|
+
top: number;
|
|
333
|
+
bottom: number;
|
|
334
|
+
};
|
|
335
|
+
}, sections: WebMenuItem[][], caption?: string) => void
|
|
336
|
+
];
|
|
344
337
|
/**
|
|
345
338
|
* For a menu of your own (`position: fixed`, its entries `role="menuitem"`), from a layout effect: places it
|
|
346
339
|
* where it was `opened` as the menus of the page go (at the pointer; under a finger, out from under it and the
|
|
@@ -481,6 +474,14 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
|
|
|
481
474
|
readonly keepAwake?: () => () => void;
|
|
482
475
|
/** As the conversations show it (WebMarkdownProps). */
|
|
483
476
|
readonly Markdown: React.ComponentType<WebMarkdownProps>;
|
|
477
|
+
/**
|
|
478
|
+
* Words with the faces of a chat said in them (`[微笑]`, as WeChat says them) drawn as their pictures, as the
|
|
479
|
+
* conversations draw them; the words alone as they are. Newer than some Ta apps: `pi.ui.EmojiText ?? …`.
|
|
480
|
+
*/
|
|
481
|
+
readonly EmojiText?: React.ComponentType<{
|
|
482
|
+
text: string;
|
|
483
|
+
className?: string;
|
|
484
|
+
}>;
|
|
484
485
|
/**
|
|
485
486
|
* A conversation to read, drawn as those of the page are, with what extensions draw in them (cards, plots,
|
|
486
487
|
* 3D); nothing in it acts. Newer than some Ta apps: `pi.ui.Conversation ?? …`.
|
|
@@ -58,6 +58,7 @@ export declare class WebExtensionContext {
|
|
|
58
58
|
settings: TaSettings;
|
|
59
59
|
}>;
|
|
60
60
|
protected readonly listDirectory: (directory: string) => Promise<import("@celljs/ta-protocol").TaDirEntry[]>;
|
|
61
|
+
protected readonly createDirectory: (directory: string, name: string) => Promise<void>;
|
|
61
62
|
/** The message box, whose button of the directory lists those of the server. */
|
|
62
63
|
protected readonly composer: (props: WebComposerProps) => React.FunctionComponentElement<import("../components/web-composer").WebComposerHostProps>;
|
|
63
64
|
/** The message box of an extension: its drafts under its name, apart from those of the others. */
|
|
@@ -41,6 +41,7 @@ const task_views_1 = require("../assistant/task-views");
|
|
|
41
41
|
const web_voice_1 = require("../assistant/web-voice");
|
|
42
42
|
const busy_1 = require("../components/busy");
|
|
43
43
|
const chat_asks_1 = require("../components/chat-asks");
|
|
44
|
+
const chat_emoji_1 = require("../components/chat-emoji");
|
|
44
45
|
const chat_list_util_1 = require("../components/chat-list-util");
|
|
45
46
|
const code_editor_1 = require("../components/code-editor");
|
|
46
47
|
const composer_target_1 = require("../components/composer-target");
|
|
@@ -109,12 +110,14 @@ class WebExtensionContext {
|
|
|
109
110
|
this.codeEditor = (props) => React.createElement(code_editor_1.CodeEditor, { ...props, settings: this.host.settings });
|
|
110
111
|
this.diffEditor = (props) => React.createElement(diff_editor_1.DiffEditor, { ...props, settings: this.host.settings });
|
|
111
112
|
this.listDirectory = (directory) => this.host.workbench.workspace.listDirectory('.', directory);
|
|
113
|
+
this.createDirectory = (directory, name) => this.host.workbench.workspace.createDirectory(name, directory);
|
|
112
114
|
/** The message box, whose button of the directory lists those of the server. */
|
|
113
115
|
this.composer = (props) => { var _a; return React.createElement(web_composer_1.WebComposer, {
|
|
114
116
|
...props,
|
|
115
117
|
notices: this.host.notices,
|
|
116
118
|
server: this.host.workbench.server,
|
|
117
119
|
listDirectory: this.listDirectory,
|
|
120
|
+
createDirectory: this.createDirectory,
|
|
118
121
|
serverCwd: (_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd,
|
|
119
122
|
remote: this.host.workbench,
|
|
120
123
|
}); };
|
|
@@ -123,6 +126,7 @@ class WebExtensionContext {
|
|
|
123
126
|
this.modelPicker = (props) => React.createElement(model_picker_1.SettingsModelPicker, { ...props, settings: this.host.workbench.settings });
|
|
124
127
|
this.folderPicker = ({ initial, onPick, onClose }) => { var _a; return React.createElement(folder_picker_1.FolderPicker, {
|
|
125
128
|
list: this.listDirectory,
|
|
129
|
+
create: this.createDirectory,
|
|
126
130
|
initial: initial || ((_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.',
|
|
127
131
|
remote: this.host.workbench,
|
|
128
132
|
onPick: async (path) => onPick(path),
|
|
@@ -376,11 +380,13 @@ class WebExtensionContext {
|
|
|
376
380
|
return React.useSyncExternalStore(host.subscribePages, () => host.extensions.pages());
|
|
377
381
|
},
|
|
378
382
|
useContextMenu: () => {
|
|
379
|
-
const [menu, open] = (0, context_menu_1.useContextMenu)();
|
|
380
|
-
const
|
|
383
|
+
const [menu, open, openAt] = (0, context_menu_1.useContextMenu)();
|
|
384
|
+
const items = React.useCallback((sections) => sections
|
|
381
385
|
.filter(section => section.length > 0)
|
|
382
|
-
.flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])
|
|
383
|
-
|
|
386
|
+
.flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section]), []);
|
|
387
|
+
const openSections = React.useCallback((event, sections) => open(event, items(sections)), [open, items]);
|
|
388
|
+
const openSectionsAt = React.useCallback((at, sections, caption) => openAt(at, items(sections), caption), [openAt, items]);
|
|
389
|
+
return [menu, openSections, openSectionsAt];
|
|
384
390
|
},
|
|
385
391
|
attachMenu: context_menu_1.ContextMenuUtil.attach,
|
|
386
392
|
scanCode: code_scan_1.CodeScan.readable()
|
|
@@ -449,8 +455,9 @@ class WebExtensionContext {
|
|
|
449
455
|
voice: web_extension_run_1.WebExtensionRunUtil.voice(run, this.voice),
|
|
450
456
|
// Let go as the extension stops, whether or not it did; nothing held once stopped.
|
|
451
457
|
keepAwake: () => web_extension_run_1.WebExtensionRunUtil.track(run, () => screen_awake_1.KeepAwake.shared.hold()),
|
|
452
|
-
apps: web_apps_1.TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: icons_1.WEB_ICONS.
|
|
458
|
+
apps: web_apps_1.TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: icons_1.WEB_ICONS.Blocks, stopped: () => run.stopped }),
|
|
453
459
|
Markdown: markdown_1.Markdown,
|
|
460
|
+
EmojiText: chat_emoji_1.EmojiText,
|
|
454
461
|
Conversation: conversation_view_1.ConversationView,
|
|
455
462
|
useChatScroll: (sent, key) => (0, conversation_scroll_hooks_1.useConversationScroll)(sent, { sentTo: 'bottom', key }),
|
|
456
463
|
Empty: empty_state_1.EmptyState,
|
|
@@ -4,5 +4,5 @@ import type { WebExtensionContextHost } from './web-extension-context';
|
|
|
4
4
|
* What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
|
|
5
5
|
* (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
|
|
6
6
|
*/
|
|
7
|
-
export declare function shareUI(host: Pick<WebExtensionContextHost, 'extensions' | 'notices' | 'workbench'>, stopped: () => boolean): Pick<WebExtensionUI, 'shareExtension' | 'share' | 'ShareSheet'>;
|
|
7
|
+
export declare function shareUI(host: Pick<WebExtensionContextHost, 'extensions' | 'notices' | 'workbench'>, stopped: () => boolean): Pick<WebExtensionUI, 'shareExtension' | 'share' | 'shrinkImage' | 'ShareSheet'>;
|
|
8
8
|
//# sourceMappingURL=web-share-ui.d.ts.map
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.shareUI = shareUI;
|
|
37
37
|
const React = __importStar(require("react"));
|
|
38
38
|
const share_sheet_1 = require("../components/share-sheet");
|
|
39
|
+
const image_shrink_1 = require("../util/image-shrink");
|
|
39
40
|
/**
|
|
40
41
|
* What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
|
|
41
42
|
* (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
|
|
@@ -51,6 +52,7 @@ function shareUI(host, stopped) {
|
|
|
51
52
|
return {
|
|
52
53
|
shareExtension: target => !stopped() && host.extensions.share(target),
|
|
53
54
|
share: item => !stopped() && host.extensions.shareItem(item),
|
|
55
|
+
shrinkImage: (image, limits) => image_shrink_1.ImageShrink.shrink(image, limits),
|
|
54
56
|
ShareSheet: sheet,
|
|
55
57
|
};
|
|
56
58
|
}
|
|
@@ -8,6 +8,19 @@ export declare namespace WebShareUtil {
|
|
|
8
8
|
function ofBlock(block: WebCodeRef): WebShareItem | undefined;
|
|
9
9
|
/** A file; none for a folder. */
|
|
10
10
|
function ofFile(file: WebFileRef): WebShareItem | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* A picture or a video at `url`, called `name` when given, else as the end of its path says (a file of the
|
|
13
|
+
* workspace, of the web), else by its kind and the type a data: URL says.
|
|
14
|
+
*/
|
|
15
|
+
function ofMedia(media: 'image' | 'video', url: string, name?: string): WebShareItem;
|
|
16
|
+
/**
|
|
17
|
+
* The ways that take a picture or a video (`accepts` reads `media`, not its URL, known only once picked): Forward
|
|
18
|
+
* goes straight to the one that sends into chats (WebShareWay.forward), Share to the sheet when any other takes it.
|
|
19
|
+
*/
|
|
20
|
+
function mediaWays(all: readonly WebShareWay[], media: 'image' | 'video'): {
|
|
21
|
+
forward?: WebShareWay;
|
|
22
|
+
others: WebShareWay[];
|
|
23
|
+
};
|
|
11
24
|
/** The ways that take it, in their order. */
|
|
12
25
|
function ways(all: readonly WebShareWay[], item: WebShareItem): WebShareWay[];
|
|
13
26
|
/** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
|