@celljs/ta-web 4.49.0 → 4.50.1
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-menu.js +1 -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-update-view.js +4 -4
- 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/app-update.d.ts +6 -3
- package/esm/browser/device/app-update.js +11 -5
- 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/service.d.ts +4 -0
- package/esm/browser/i18n/en/service.js +4 -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/service.js +4 -0
- package/esm/browser/i18n/ja/settings.js +17 -0
- package/esm/browser/i18n/locales.d.ts +59 -1
- package/esm/browser/i18n/messages.d.ts +58 -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/service.js +4 -0
- 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/service.js +4 -0
- 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-menu.js +1 -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-update-view.js +4 -4
- 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/app-update.d.ts +6 -3
- package/lib/browser/device/app-update.js +11 -5
- 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/service.d.ts +4 -0
- package/lib/browser/i18n/en/service.js +4 -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/service.js +4 -0
- package/lib/browser/i18n/ja/settings.js +17 -0
- package/lib/browser/i18n/locales.d.ts +59 -1
- package/lib/browser/i18n/messages.d.ts +58 -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/service.js +4 -0
- 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/service.js +4 -0
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComposerTarget = void 0;
|
|
4
|
+
const composer_1 = require("../util/composer");
|
|
4
5
|
const quote_1 = require("../util/quote");
|
|
5
6
|
/**
|
|
6
7
|
* The message box in front of the user, which extensions put things in (a conversation's, or one of an extension's
|
|
@@ -20,16 +21,26 @@ var ComposerTarget;
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
ComposerTarget.set = set;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const extension = ((_a = mimeType.split('/')[1]) === null || _a === void 0 ? void 0 : _a.replace('jpeg', 'jpg')) || 'png';
|
|
27
|
-
return new File([bytes], `picked-${index + 1}.${extension}`, { type: mimeType });
|
|
24
|
+
/** The box in front: the last one shown that is on the screen. */
|
|
25
|
+
function front() {
|
|
26
|
+
return [...shown].reverse().find(each => each.shown());
|
|
28
27
|
}
|
|
28
|
+
/** Whether a box is in front to type in. */
|
|
29
|
+
function present() {
|
|
30
|
+
return !!front();
|
|
31
|
+
}
|
|
32
|
+
ComposerTarget.present = present;
|
|
33
|
+
/** Types a key pressed on the page at the end of what the box in front holds, and focuses it; false when none is shown. */
|
|
34
|
+
function type(key) {
|
|
35
|
+
const box = front();
|
|
36
|
+
box === null || box === void 0 ? void 0 : box.setText(box.text() + key);
|
|
37
|
+
return !!box;
|
|
38
|
+
}
|
|
39
|
+
ComposerTarget.type = type;
|
|
29
40
|
/** Puts the draft in the box in front, and focuses it; false when no box is shown. */
|
|
30
41
|
function add(draft) {
|
|
31
42
|
var _a, _b;
|
|
32
|
-
const box =
|
|
43
|
+
const box = front();
|
|
33
44
|
if (!box) {
|
|
34
45
|
return false;
|
|
35
46
|
}
|
|
@@ -41,7 +52,7 @@ var ComposerTarget;
|
|
|
41
52
|
box.setText(`${held}${held && !/\s$/.test(held) ? ' ' : ''}${draft.text}`);
|
|
42
53
|
}
|
|
43
54
|
if (((_b = draft.images) === null || _b === void 0 ? void 0 : _b.length) && box.addFiles) {
|
|
44
|
-
box.addFiles(draft.images.map(
|
|
55
|
+
box.addFiles(draft.images.map(composer_1.ComposerUtil.imageFile));
|
|
45
56
|
}
|
|
46
57
|
return true;
|
|
47
58
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typing anywhere but in a field goes into the message box in front, as the composer of a desktop assistant does:
|
|
3
|
+
* a letter pressed while reading the conversation starts writing, the keyboard's focus going with it.
|
|
4
|
+
*
|
|
5
|
+
* Not when the field (or anything typed in) has the focus, nor under a dialog or a menu opened over the page: those
|
|
6
|
+
* take the keys first. Not a space (it scrolls the page), nor a key of a shortcut, nor what an input method composes.
|
|
7
|
+
*/
|
|
8
|
+
export interface TypeFocusInput {
|
|
9
|
+
key: string;
|
|
10
|
+
ctrlKey?: boolean;
|
|
11
|
+
metaKey?: boolean;
|
|
12
|
+
altKey?: boolean;
|
|
13
|
+
isComposing?: boolean;
|
|
14
|
+
defaultPrevented?: boolean;
|
|
15
|
+
/** What holds the focus: a field, an editor, a terminal, a page that draws its own keys. */
|
|
16
|
+
editable: boolean;
|
|
17
|
+
/** A dialog, a menu or a panel opened over the page (its own aria-modal, a popover, the + menu of the box). */
|
|
18
|
+
overlain: boolean;
|
|
19
|
+
/** The box is on the screen now. */
|
|
20
|
+
shown: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace TypeFocus {
|
|
23
|
+
function takes(input: TypeFocusInput): boolean;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=composer-type-focus.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeFocus = void 0;
|
|
4
|
+
var TypeFocus;
|
|
5
|
+
(function (TypeFocus) {
|
|
6
|
+
function takes(input) {
|
|
7
|
+
return (!input.editable &&
|
|
8
|
+
!input.overlain &&
|
|
9
|
+
input.shown &&
|
|
10
|
+
!input.ctrlKey &&
|
|
11
|
+
!input.metaKey &&
|
|
12
|
+
!input.altKey &&
|
|
13
|
+
!input.isComposing &&
|
|
14
|
+
!input.defaultPrevented &&
|
|
15
|
+
[...input.key].length === 1 &&
|
|
16
|
+
input.key !== ' ');
|
|
17
|
+
}
|
|
18
|
+
TypeFocus.takes = takes;
|
|
19
|
+
})(TypeFocus || (exports.TypeFocus = TypeFocus = {}));
|
|
20
|
+
//# sourceMappingURL=composer-type-focus.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The microphone of the box, as WeChat's: on a touch screen it turns the field into a bar held to talk (or, in a mini
|
|
4
|
+
* program, dictates); elsewhere it listens while pressed. What is heard goes where the caret was when listening began,
|
|
5
|
+
* between what was typed. Without a recognizer there is none.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMicrophone({ touch, talkMode, hints, voiceSends, said, onHear, onInsert, onListening, onTalkKey, onError, }: {
|
|
8
|
+
touch: boolean;
|
|
9
|
+
talkMode: boolean;
|
|
10
|
+
hints: string[];
|
|
11
|
+
voiceSends: boolean;
|
|
12
|
+
/** The text of the box, and the caret in it, as the listening begins. */
|
|
13
|
+
said: () => {
|
|
14
|
+
text: string;
|
|
15
|
+
caret: number;
|
|
16
|
+
};
|
|
17
|
+
/** What is heard: the words among the text, and where the caret goes after them. Sent when the box sends by voice. */
|
|
18
|
+
onHear: (words: string, caret: number) => void;
|
|
19
|
+
/** Words said with nothing heard yet, put after the text as it stands: the caret after them. */
|
|
20
|
+
onInsert: (words: string) => void;
|
|
21
|
+
onListening: (on: boolean) => void;
|
|
22
|
+
onTalkKey: (on: boolean) => void;
|
|
23
|
+
onError: (error: unknown) => void;
|
|
24
|
+
}): React.JSX.Element | null;
|
|
25
|
+
//# sourceMappingURL=composer-voice.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
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.useMicrophone = useMicrophone;
|
|
37
|
+
const lucide_react_1 = require("lucide-react");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const mini_program_1 = require("../device/mini-program");
|
|
40
|
+
const use_t_1 = require("../i18n/use-t");
|
|
41
|
+
const voice_1 = require("../util/voice");
|
|
42
|
+
const icon_1 = require("./icon");
|
|
43
|
+
const voice_button_1 = require("./voice-button");
|
|
44
|
+
/**
|
|
45
|
+
* The microphone of the box, as WeChat's: on a touch screen it turns the field into a bar held to talk (or, in a mini
|
|
46
|
+
* program, dictates); elsewhere it listens while pressed. What is heard goes where the caret was when listening began,
|
|
47
|
+
* between what was typed. Without a recognizer there is none.
|
|
48
|
+
*/
|
|
49
|
+
function useMicrophone({ touch, talkMode, hints, voiceSends, said, onHear, onInsert, onListening, onTalkKey, onError, }) {
|
|
50
|
+
const t = (0, use_t_1.useT)();
|
|
51
|
+
// Speech goes where the caret was when listening began, between what was typed.
|
|
52
|
+
const spoken = React.useRef({ before: '', after: '' });
|
|
53
|
+
const listen = (on) => {
|
|
54
|
+
if (on) {
|
|
55
|
+
const { text, caret } = said();
|
|
56
|
+
spoken.current = { before: text.slice(0, caret), after: text.slice(caret) };
|
|
57
|
+
}
|
|
58
|
+
onListening(on);
|
|
59
|
+
};
|
|
60
|
+
if (mini_program_1.MiniProgram.canDictate()) {
|
|
61
|
+
return React.createElement(voice_button_1.DictateButton, { onHeard: onInsert });
|
|
62
|
+
}
|
|
63
|
+
if (!voice_1.Voice.canListen()) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return touch ? (React.createElement("button", { type: "button", className: "ta-mic", title: t(talkMode ? 'ta.composer.keyboard' : 'ta.composer.voice'), "aria-label": t(talkMode ? 'ta.composer.keyboard' : 'ta.composer.voice'), "aria-pressed": talkMode, onClick: () => onTalkKey(!talkMode) },
|
|
67
|
+
React.createElement(icon_1.Icon, { icon: talkMode ? lucide_react_1.Keyboard : lucide_react_1.Mic, size: 18 }))) : (React.createElement(voice_button_1.VoiceButton, { hints: hints, onListening: listen, onText: words => onHear(`${spoken.current.before}${words}${spoken.current.after}`, spoken.current.before.length + words.length), onHeard: words => {
|
|
68
|
+
const text = `${spoken.current.before}${words}${spoken.current.after}`;
|
|
69
|
+
const caret = spoken.current.before.length + words.length;
|
|
70
|
+
onHear(voiceSends ? text.trim() : text, voiceSends ? 0 : caret);
|
|
71
|
+
}, onError: onError }));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=composer-voice.js.map
|
|
@@ -28,8 +28,8 @@ export interface ComposerProps {
|
|
|
28
28
|
talkCalls?: ComposerBoxProps['talkCalls'];
|
|
29
29
|
onListening?(listening: boolean): void;
|
|
30
30
|
server: TaServer;
|
|
31
|
-
/** Where `@` looks for files. */
|
|
32
|
-
workspace: Pick<TaWorkspaceServer, 'findFiles'>;
|
|
31
|
+
/** Where `@` looks for files, and where the files dropped in the box are uploaded (`uploads/` of `cwd`). */
|
|
32
|
+
workspace: Pick<TaWorkspaceServer, 'findFiles' | 'uploadFile' | 'listDirectory'>;
|
|
33
33
|
working: boolean;
|
|
34
34
|
/** ComposerBoxProps.compacting: the stop of the box stops compacting the conversation too. */
|
|
35
35
|
compacting?: boolean;
|
|
@@ -43,6 +43,7 @@ const device_1 = require("../device/device");
|
|
|
43
43
|
const use_t_1 = require("../i18n/use-t");
|
|
44
44
|
const agent_settings_1 = require("../settings/agent-settings");
|
|
45
45
|
const composer_1 = require("../util/composer");
|
|
46
|
+
const composer_drop_1 = require("../util/composer-drop");
|
|
46
47
|
const message_1 = require("../util/message");
|
|
47
48
|
const composer_box_1 = require("./composer-box");
|
|
48
49
|
const face_1 = require("./face");
|
|
@@ -65,6 +66,12 @@ const said = (texts) => texts.filter(text => !assistant_task_util_1.AssistantTas
|
|
|
65
66
|
/** A waiting message as the user sees it in the conversation: without its context, the package it came from apart. */
|
|
66
67
|
const blocksOf = (text) => [{ type: 'text', text }];
|
|
67
68
|
const words = (text) => (0, message_user_1.userWords)(blocksOf(text));
|
|
69
|
+
/** Whether a message of the conversation is the one last sent from this page: by its words, or, sent without any, by its images. */
|
|
70
|
+
const sentAs = (message, sent) => {
|
|
71
|
+
const blocks = message_1.MessageUtil.blocks(message);
|
|
72
|
+
const { text } = (0, message_user_1.userWords)(blocks);
|
|
73
|
+
return sent ? text.includes(sent) : blocks.some(block => block.type === 'image');
|
|
74
|
+
};
|
|
68
75
|
/** The files for an `@` being typed; a server without file search answers with an error, and the menu says so. */
|
|
69
76
|
function useFiles(workspace, cwd, query) {
|
|
70
77
|
const t = (0, use_t_1.useT)();
|
|
@@ -143,6 +150,7 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
|
|
|
143
150
|
const keyNames = React.useMemo(() => composer_1.ComposerUtil.keyNames(agent_settings_1.ShortcutUtil.isMac()), []);
|
|
144
151
|
const [query, setQuery] = React.useState();
|
|
145
152
|
const files = useFiles(workspace, cwd, query);
|
|
153
|
+
const uploads = React.useMemo(() => ({ workspace }), [workspace]);
|
|
146
154
|
const [argumentQuery, setArgumentQuery] = React.useState();
|
|
147
155
|
const argumentItems = useArgumentCompletions(server, store === null || store === void 0 ? void 0 : store.sessionId, argumentQuery);
|
|
148
156
|
const box = React.useRef(null);
|
|
@@ -176,7 +184,7 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
|
|
|
176
184
|
// Stopped before anything came of it, with nothing typed since: the message sent from this page comes back
|
|
177
185
|
// into the box. Not one of a scheduled task, a group or another device: only what was last sent here.
|
|
178
186
|
const last = ((_a = box.current) === null || _a === void 0 ? void 0 : _a.text().trim()) ? undefined : message_1.MessageUtil.unanswered(store.state.messages);
|
|
179
|
-
const unanswered = last && lastSent && (
|
|
187
|
+
const unanswered = last && lastSent !== undefined && sentAs(last, lastSent) ? last : undefined;
|
|
180
188
|
const waited = composer_1.ComposerUtil.queued(queue).length > 0;
|
|
181
189
|
return server.abort(store.sessionId).then(async () => {
|
|
182
190
|
timed(clock, clock.answered(performance.now()));
|
|
@@ -204,9 +212,16 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
|
|
|
204
212
|
if (!id || ((_a = box.current) === null || _a === void 0 ? void 0 : _a.text().trim())) {
|
|
205
213
|
return;
|
|
206
214
|
}
|
|
215
|
+
// Its images, as the box had them: the conversation gives them without their bytes, gone with it once moved.
|
|
216
|
+
const timestamp = message.timestamp;
|
|
217
|
+
const shown = message_1.MessageUtil.blocks(message).flatMap((block, index) => (block.type === 'image' ? [index] : []));
|
|
218
|
+
const images = timestamp === undefined ? [] : await Promise.all(shown.map(index => server.getMessageImage(store.sessionId, timestamp, index)));
|
|
207
219
|
const result = await server.navigateTree(store.sessionId, id);
|
|
208
|
-
if (!result.cancelled &&
|
|
209
|
-
|
|
220
|
+
if (!result.cancelled && !((_b = box.current) === null || _b === void 0 ? void 0 : _b.text().trim())) {
|
|
221
|
+
if (result.editorText) {
|
|
222
|
+
(_c = box.current) === null || _c === void 0 ? void 0 : _c.setText(result.editorText);
|
|
223
|
+
}
|
|
224
|
+
putBack(images.filter(image => !!image));
|
|
210
225
|
}
|
|
211
226
|
}
|
|
212
227
|
catch (_d) {
|
|
@@ -241,16 +256,25 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
|
|
|
241
256
|
setQueue(composer_1.ComposerUtil.without(queue, entry));
|
|
242
257
|
server.sendNow(store.sessionId, entry.kind, entry.index).catch(onError);
|
|
243
258
|
};
|
|
244
|
-
/**
|
|
259
|
+
/** Images taken back, into the box as they were pasted. */
|
|
260
|
+
const putBack = (images) => {
|
|
261
|
+
var _a, _b;
|
|
262
|
+
if (images.length) {
|
|
263
|
+
(_b = (_a = box.current) === null || _a === void 0 ? void 0 : _a.addFiles) === null || _b === void 0 ? void 0 : _b.call(_a, images.map(composer_1.ComposerUtil.imageFile));
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
/** Takes all that waits back into the box, with its images: before what is typed, or after it (`after`). */
|
|
245
267
|
const takeBack = (after = false) => {
|
|
246
268
|
if (!store) {
|
|
247
269
|
return;
|
|
248
270
|
}
|
|
249
271
|
server.clearQueue(store.sessionId).then(taken => {
|
|
250
|
-
var _a;
|
|
272
|
+
var _a, _b, _c;
|
|
273
|
+
var _d, _e;
|
|
251
274
|
setQueue(EMPTY_QUEUE);
|
|
252
275
|
const back = { steering: said(taken.steering), followUp: said(taken.followUp) };
|
|
253
276
|
(_a = box.current) === null || _a === void 0 ? void 0 : _a.setText(composer_1.ComposerUtil.restore(back, box.current.text(), after));
|
|
277
|
+
putBack([...((_d = (_b = taken.images) === null || _b === void 0 ? void 0 : _b.steering) !== null && _d !== void 0 ? _d : []), ...((_e = (_c = taken.images) === null || _c === void 0 ? void 0 : _c.followUp) !== null && _e !== void 0 ? _e : [])].flat());
|
|
254
278
|
}, onError);
|
|
255
279
|
};
|
|
256
280
|
/** Takes one message out; into the box when `back`. */
|
|
@@ -261,13 +285,16 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
|
|
|
261
285
|
setQueue(composer_1.ComposerUtil.without(queue, entry));
|
|
262
286
|
server.removeQueued(store.sessionId, entry.kind, entry.index).then(removed => {
|
|
263
287
|
var _a;
|
|
288
|
+
var _b;
|
|
264
289
|
if (removed && back) {
|
|
265
290
|
(_a = box.current) === null || _a === void 0 ? void 0 : _a.setText(composer_1.ComposerUtil.restore({ steering: said([entry.text]), followUp: [] }, box.current.text()));
|
|
291
|
+
// A Ta service of before says only that it was taken: its images stay behind.
|
|
292
|
+
putBack(typeof removed === 'object' ? ((_b = removed.images) !== null && _b !== void 0 ? _b : []) : []);
|
|
266
293
|
}
|
|
267
294
|
}, onError);
|
|
268
295
|
};
|
|
269
296
|
const waiting = composer_1.ComposerUtil.queued(queue);
|
|
270
|
-
return (React.createElement(composer_box_1.ComposerBox, { ref: box, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t(composer_1.ComposerUtil.placeholderKey(working, touch, sendWhileWorking), keyNames), sendTitle: t(composer_1.ComposerUtil.sendTitleKey(sendWhileWorking), keyNames), working: working, compacting: compacting, onStop: stop, onSend: send, commands: listed, onArgumentQuery: setArgumentQuery, argumentItems: argumentItems, onMentionQuery: setQuery, mentions: files, mentionLabel: t('ta.composer.mentionFile'), images: true, recentShots: recentShots, actions: actions, head: head, after: after, voiceSends: voiceSends, talkPlace: talkPlace, onTalkSent: onTalkSent, onTalkCall: onTalkCall, talkCalls: talkCalls, onListening: onListening, autoFocus: !touch, onTextChange: onTyping && (text => onTyping(!!text.trim())), draft: draft, cwd: cwd, onError: onError, above: React.createElement(React.Fragment, null,
|
|
297
|
+
return (React.createElement(composer_box_1.ComposerBox, { ref: box, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t(composer_1.ComposerUtil.placeholderKey(working, touch, sendWhileWorking), keyNames), sendTitle: t(composer_1.ComposerUtil.sendTitleKey(sendWhileWorking), keyNames), working: working, compacting: compacting, onStop: stop, onSend: send, commands: listed, onArgumentQuery: setArgumentQuery, argumentItems: argumentItems, onMentionQuery: setQuery, mentions: files, emoji: true, mentionLabel: t('ta.composer.mentionFile'), images: true, files: uploads, recentShots: recentShots, actions: actions, head: head, after: after, voiceSends: voiceSends, talkPlace: talkPlace, onTalkSent: onTalkSent, onTalkCall: onTalkCall, talkCalls: talkCalls, onListening: onListening, autoFocus: !touch, onTextChange: onTyping && (text => onTyping(!!text.trim())), draft: draft, cwd: cwd, droppedFiles: files => composer_drop_1.ComposerDropUtil.write(workspace, cwd, files), onError: onError, above: React.createElement(React.Fragment, null,
|
|
271
298
|
above,
|
|
272
299
|
waiting.length > 0 && (React.createElement(QueuedMessages, { waiting: waiting, onTakeBack: () => takeBack(), onRemove: remove, onSendNow: sendNow, onSettings: onQueueSettings }))) }));
|
|
273
300
|
});
|
|
@@ -285,7 +312,9 @@ function QueuedMessages({ waiting, onTakeBack, onRemove, onSendNow, onSettings,
|
|
|
285
312
|
var _a, _b, _c, _d;
|
|
286
313
|
const note = assistant_task_util_1.AssistantTaskUtil.noteOf(entry.text);
|
|
287
314
|
const shown = words(entry.text);
|
|
288
|
-
const
|
|
315
|
+
const images = entry.images > 0 ? t('ta.message.images', { count: entry.images }) : '';
|
|
316
|
+
// Images sent without words have no text: they show as what they are, as a chat list says them.
|
|
317
|
+
const text = (note && ((_a = assistant_task_util_1.AssistantTaskUtil.noteLine(note, t)) !== null && _a !== void 0 ? _a : note.title)) || shown.text || shown.copied || images;
|
|
289
318
|
const kind = t(entry.kind === 'steering' ? 'ta.composer.queue.steering' : 'ta.composer.queue.followUp');
|
|
290
319
|
// Another's waits as theirs: they take it back, or the owner of the Ta removes it (ta serve holds to it too).
|
|
291
320
|
const author = ta_protocol_1.TaMessageAuthor.of(entry.text);
|
|
@@ -298,6 +327,8 @@ function QueuedMessages({ waiting, onTakeBack, onRemove, onSendNow, onSettings,
|
|
|
298
327
|
React.createElement(face_1.Face, { seed: (_c = author === null || author === void 0 ? void 0 : author.id) !== null && _c !== void 0 ? _c : ta_protocol_1.TA_OWNER, size: 14, double: !author }),
|
|
299
328
|
React.createElement("span", { className: "ta-origin-name" }, (_d = author === null || author === void 0 ? void 0 : author.name) !== null && _d !== void 0 ? _d : (ownerName || t('ta.presence.owner'))))),
|
|
300
329
|
!note && React.createElement(message_user_1.MessageOrigin, { blocks: blocksOf(entry.text) }),
|
|
330
|
+
images && (React.createElement("span", { className: "ta-queue-images", title: images },
|
|
331
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.Image, size: 13 }))),
|
|
301
332
|
React.createElement("span", { className: "ta-ellipsis ta-queue-text", title: text }, text),
|
|
302
333
|
React.createElement("span", { className: "ta-queue-actions", hidden: !mine && me !== ta_protocol_1.TA_OWNER },
|
|
303
334
|
!note && mine && (React.createElement("button", { type: "button", className: "ta-icon-button", onClick: () => onRemove(entry, true), title: t('ta.composer.queue.editTitle'), "aria-label": t('ta.composer.queue.editTitle') },
|
|
@@ -41,6 +41,7 @@ const react_dom_1 = require("react-dom");
|
|
|
41
41
|
const back_stack_1 = require("../device/back-stack");
|
|
42
42
|
const device_1 = require("../device/device");
|
|
43
43
|
const long_press_1 = require("../device/long-press");
|
|
44
|
+
const chat_emoji_1 = require("./chat-emoji");
|
|
44
45
|
var ContextMenuUtil;
|
|
45
46
|
(function (ContextMenuUtil) {
|
|
46
47
|
/** A menu of groups of items, a line between them: the empty ones left out, as no line comes first, last or twice. */
|
|
@@ -304,7 +305,7 @@ function ContextMenu({ x, y, around, items, caption, onClose }) {
|
|
|
304
305
|
onClose();
|
|
305
306
|
item.run();
|
|
306
307
|
} },
|
|
307
|
-
item.label,
|
|
308
|
+
React.createElement(chat_emoji_1.MenuLabel, { text: item.label }),
|
|
308
309
|
choice && React.createElement(lucide_react_1.Check, { size: 15, className: item.checked ? 'ta-context-menu-check ta-on' : 'ta-context-menu-check', "aria-hidden": "true" }))))));
|
|
309
310
|
}
|
|
310
311
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare namespace EmojiPanelUtil {
|
|
3
|
-
/** The faces
|
|
4
|
-
|
|
5
|
-
/** The text with the
|
|
6
|
-
function insert(text: string, caret: number,
|
|
7
|
-
/** The text with the
|
|
3
|
+
/** The faces a text says at its end, as a face is said (`[微笑]`): the length of one, to be taken away whole. */
|
|
4
|
+
function faceBefore(text: string, caret: number): number;
|
|
5
|
+
/** The text with the face at the caret, right against what is there: no space put before it. */
|
|
6
|
+
function insert(text: string, caret: number, face: string): [string, number];
|
|
7
|
+
/** The text with the face before the caret taken out whole (`[微笑]`), or else one character. */
|
|
8
8
|
function deleteBack(text: string, caret: number): [string, number];
|
|
9
9
|
}
|
|
10
10
|
export interface EmojiPanelProps {
|
|
11
|
-
|
|
11
|
+
/** A face picked, as it is said in the text (`[微笑]`). */
|
|
12
|
+
onPick(face: string): void;
|
|
12
13
|
/** On a phone: a panel under the box in place of the keyboard, with Delete and Send, as WeChat's; else a popover above the button. */
|
|
13
14
|
docked?: boolean;
|
|
14
15
|
/** Going: a docked panel folds away, then `onClosed`. */
|
|
@@ -18,6 +19,9 @@ export interface EmojiPanelProps {
|
|
|
18
19
|
onSend?(): void;
|
|
19
20
|
sendable?: boolean;
|
|
20
21
|
}
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* The faces of the message box, as WeChat's panel: 最近使用 above 所有表情, a tap putting one where the caret is. What
|
|
24
|
+
* is put in is the face's name (`[微笑]`), drawn as the face by the conversation.
|
|
25
|
+
*/
|
|
22
26
|
export declare const EmojiPanel: React.ForwardRefExoticComponent<EmojiPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
27
|
//# sourceMappingURL=emoji-panel.d.ts.map
|
|
@@ -37,51 +37,69 @@ exports.EmojiPanel = exports.EmojiPanelUtil = void 0;
|
|
|
37
37
|
const lucide_react_1 = require("lucide-react");
|
|
38
38
|
const React = __importStar(require("react"));
|
|
39
39
|
const use_t_1 = require("../i18n/use-t");
|
|
40
|
+
const chat_emoji_1 = require("../util/chat-emoji");
|
|
41
|
+
const chat_emoji_2 = require("./chat-emoji");
|
|
40
42
|
const icon_1 = require("./icon");
|
|
41
43
|
var EmojiPanelUtil;
|
|
42
44
|
(function (EmojiPanelUtil) {
|
|
43
|
-
/** The faces
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return list;
|
|
53
|
-
}, []);
|
|
54
|
-
/** The text with the emoji at the caret, right against what is there: no space put before it. */
|
|
55
|
-
function insert(text, caret, emoji) {
|
|
56
|
-
return [text.slice(0, caret) + emoji + text.slice(caret), caret + emoji.length];
|
|
45
|
+
/** The faces a text says at its end, as a face is said (`[微笑]`): the length of one, to be taken away whole. */
|
|
46
|
+
function faceBefore(text, caret) {
|
|
47
|
+
return chat_emoji_1.ChatEmojiUtil.before(text, caret);
|
|
48
|
+
}
|
|
49
|
+
EmojiPanelUtil.faceBefore = faceBefore;
|
|
50
|
+
/** The text with the face at the caret, right against what is there: no space put before it. */
|
|
51
|
+
function insert(text, caret, face) {
|
|
52
|
+
return [text.slice(0, caret) + face + text.slice(caret), caret + face.length];
|
|
57
53
|
}
|
|
58
54
|
EmojiPanelUtil.insert = insert;
|
|
59
|
-
/** The text with the
|
|
55
|
+
/** The text with the face before the caret taken out whole (`[微笑]`), or else one character. */
|
|
60
56
|
function deleteBack(text, caret) {
|
|
61
|
-
var _a
|
|
57
|
+
var _a;
|
|
58
|
+
const face = chat_emoji_1.ChatEmojiUtil.before(text, caret);
|
|
59
|
+
if (face) {
|
|
60
|
+
return [text.slice(0, caret - face) + text.slice(caret), caret - face];
|
|
61
|
+
}
|
|
62
62
|
const before = text.slice(0, caret);
|
|
63
63
|
if (!before) {
|
|
64
64
|
return [text, caret];
|
|
65
65
|
}
|
|
66
|
-
const last = (
|
|
66
|
+
const last = (_a = Array.from(before).pop()) !== null && _a !== void 0 ? _a : '';
|
|
67
67
|
const at = caret - last.length;
|
|
68
68
|
return [text.slice(0, at) + text.slice(caret), at];
|
|
69
69
|
}
|
|
70
70
|
EmojiPanelUtil.deleteBack = deleteBack;
|
|
71
71
|
})(EmojiPanelUtil || (exports.EmojiPanelUtil = EmojiPanelUtil = {}));
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The faces of the message box, as WeChat's panel: 最近使用 above 所有表情, a tap putting one where the caret is. What
|
|
74
|
+
* is put in is the face's name (`[微笑]`), drawn as the face by the conversation.
|
|
75
|
+
*/
|
|
73
76
|
exports.EmojiPanel = React.forwardRef(function EmojiPanel({ onPick, docked, closing, onClosed, onDelete, onSend, sendable }, ref) {
|
|
74
77
|
const t = (0, use_t_1.useT)();
|
|
75
|
-
const
|
|
78
|
+
const [recent, setRecent] = React.useState(() => chat_emoji_1.ChatEmojiUtil.recent());
|
|
79
|
+
const pick = (index) => {
|
|
80
|
+
chat_emoji_1.ChatEmojiUtil.used(index);
|
|
81
|
+
setRecent(chat_emoji_1.ChatEmojiUtil.recent());
|
|
82
|
+
onPick(chat_emoji_1.ChatEmojiUtil.code(index));
|
|
83
|
+
};
|
|
84
|
+
const all = chat_emoji_1.ChatEmojiUtil.FACES.map((_face, index) => index);
|
|
85
|
+
const grid = (items) => (React.createElement("div", { className: "ta-emoji-grid", role: "listbox", "aria-label": t('ta.composer.emoji') }, items.map(index => (React.createElement("button", { key: index, type: "button", role: "option", "aria-selected": false, className: "ta-emoji",
|
|
76
86
|
// The field keeps the caret (and on a computer the focus) while one is picked.
|
|
77
|
-
onPointerDown: event => event.preventDefault(), onClick: () =>
|
|
87
|
+
onPointerDown: event => event.preventDefault(), onClick: () => pick(index) },
|
|
88
|
+
React.createElement(chat_emoji_2.ChatFace, { index: index }))))));
|
|
89
|
+
const body = (React.createElement(React.Fragment, null,
|
|
90
|
+
recent.length > 0 && (React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement("div", { className: "ta-emoji-title" }, t('ta.composer.emojiRecent')),
|
|
92
|
+
grid(recent))),
|
|
93
|
+
React.createElement("div", { className: "ta-emoji-title" }, t('ta.composer.emojiAll')),
|
|
94
|
+
grid(all)));
|
|
78
95
|
if (!docked) {
|
|
79
|
-
return (React.createElement("div", { ref: ref, className: "ta-emoji-pop" },
|
|
96
|
+
return (React.createElement("div", { ref: ref, className: "ta-emoji-pop" },
|
|
97
|
+
React.createElement("div", { className: "ta-emoji-scroll" }, body)));
|
|
80
98
|
}
|
|
81
99
|
return (React.createElement("div", { ref: ref, className: `ta-plus-dock${closing ? ' ta-closing' : ''}`, onAnimationEnd: event => closing && event.target === event.currentTarget && (onClosed === null || onClosed === void 0 ? void 0 : onClosed()) },
|
|
82
100
|
React.createElement("div", { className: "ta-plus-dock-inner" },
|
|
83
101
|
React.createElement("div", { className: "ta-emoji-panel" },
|
|
84
|
-
|
|
102
|
+
React.createElement("div", { className: "ta-emoji-scroll" }, body),
|
|
85
103
|
React.createElement("div", { className: "ta-emoji-keys" },
|
|
86
104
|
React.createElement("button", { type: "button", className: "ta-emoji-key", "aria-label": t('ta.composer.deleteBack'), onClick: onDelete },
|
|
87
105
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Delete, size: 20 })),
|
|
@@ -48,7 +48,7 @@ function extensionSection(entry) {
|
|
|
48
48
|
return {
|
|
49
49
|
id: `extension-${id.replace(/[^\w-]+/g, '-')}`,
|
|
50
50
|
title: web_extension_protocol_1.WebLabelUtil.text(section.title),
|
|
51
|
-
icon: (_a = section.icon) !== null && _a !== void 0 ? _a : lucide_react_1.
|
|
51
|
+
icon: (_a = section.icon) !== null && _a !== void 0 ? _a : lucide_react_1.Blocks,
|
|
52
52
|
group: section.group && settings_choices_1.SETTINGS_GROUPS.some(group => group.id === section.group) ? section.group : 'extensions',
|
|
53
53
|
order: (_b = section.order) !== null && _b !== void 0 ? _b : 100,
|
|
54
54
|
...(section.tier === 'common' ? { tier: 'common' } : {}),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TaDirEntry } from '@celljs/ta-protocol';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type Translate } from '../i18n/use-t';
|
|
4
|
+
export declare namespace NewFolderUtil {
|
|
5
|
+
/** Why `name` cannot be the name of a new folder in a directory holding `entries`; undefined when it can. */
|
|
6
|
+
function problem(name: string, entries: readonly TaDirEntry[], t: Translate): string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface NewFolderProps {
|
|
9
|
+
/** The directory it is made in, and what is there. */
|
|
10
|
+
location: string;
|
|
11
|
+
entries: readonly TaDirEntry[];
|
|
12
|
+
create(directory: string, name: string): Promise<void>;
|
|
13
|
+
/** The folder made, to go into. */
|
|
14
|
+
onMade(location: string): void;
|
|
15
|
+
onClose(): void;
|
|
16
|
+
}
|
|
17
|
+
/** The name of a folder to make in the directory shown; made, the picker goes into it. */
|
|
18
|
+
export declare function NewFolder({ location, entries, create, onMade, onClose }: NewFolderProps): React.JSX.Element;
|
|
19
|
+
//# sourceMappingURL=folder-new.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
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.NewFolderUtil = void 0;
|
|
37
|
+
exports.NewFolder = NewFolder;
|
|
38
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const use_t_1 = require("../i18n/use-t");
|
|
41
|
+
var NewFolderUtil;
|
|
42
|
+
(function (NewFolderUtil) {
|
|
43
|
+
/** Why `name` cannot be the name of a new folder in a directory holding `entries`; undefined when it can. */
|
|
44
|
+
function problem(name, entries, t) {
|
|
45
|
+
if (/[\\/]/.test(name) || name === '.' || name === '..') {
|
|
46
|
+
return t('ta.folder.newInvalid');
|
|
47
|
+
}
|
|
48
|
+
return entries.some(entry => entry.name === name) ? t('ta.folder.newExists', { name }) : undefined;
|
|
49
|
+
}
|
|
50
|
+
NewFolderUtil.problem = problem;
|
|
51
|
+
})(NewFolderUtil || (exports.NewFolderUtil = NewFolderUtil = {}));
|
|
52
|
+
/** The name of a folder to make in the directory shown; made, the picker goes into it. */
|
|
53
|
+
function NewFolder({ location, entries, create, onMade, onClose }) {
|
|
54
|
+
const t = (0, use_t_1.useT)();
|
|
55
|
+
const [name, setName] = React.useState('');
|
|
56
|
+
const [problem, setProblem] = React.useState();
|
|
57
|
+
const [busy, setBusy] = React.useState(false);
|
|
58
|
+
const make = () => {
|
|
59
|
+
const trimmed = name.trim();
|
|
60
|
+
const wrong = NewFolderUtil.problem(trimmed, entries, t);
|
|
61
|
+
if (wrong) {
|
|
62
|
+
setProblem(wrong);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const made = ta_protocol_1.TaLocation.child(location, trimmed);
|
|
66
|
+
setBusy(true);
|
|
67
|
+
create(location, trimmed).then(() => onMade(made), error => {
|
|
68
|
+
setBusy(false);
|
|
69
|
+
setProblem(error instanceof Error ? error.message : String(error));
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
return (React.createElement("form", { className: "ta-folder-add", onSubmit: event => {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
make();
|
|
75
|
+
} },
|
|
76
|
+
React.createElement("div", { className: "ta-folder-add-row" },
|
|
77
|
+
React.createElement("label", { className: "ta-field" },
|
|
78
|
+
React.createElement("input", { autoFocus: true, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", enterKeyHint: "done", value: name, placeholder: t('ta.folder.newName'), "aria-label": t('ta.folder.newName'), "aria-invalid": problem ? true : undefined, onChange: event => {
|
|
79
|
+
setName(event.target.value);
|
|
80
|
+
setProblem(undefined);
|
|
81
|
+
}, onKeyDown: event => {
|
|
82
|
+
if (event.key === 'Escape') {
|
|
83
|
+
event.stopPropagation();
|
|
84
|
+
onClose();
|
|
85
|
+
}
|
|
86
|
+
} })),
|
|
87
|
+
React.createElement("button", { type: "submit", className: "ta-button ta-primary", disabled: busy || !name.trim() }, t('ta.folder.newConfirm'))),
|
|
88
|
+
problem && React.createElement("div", { className: "ta-folder-failed" }, problem)));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=folder-new.js.map
|
|
@@ -43,6 +43,8 @@ export declare namespace FolderPickerUtil {
|
|
|
43
43
|
export interface FolderPickerProps {
|
|
44
44
|
/** The entries of a directory of the server. */
|
|
45
45
|
list(directory: string): Promise<TaDirEntry[]>;
|
|
46
|
+
/** Makes the folder `name` in `directory` (a location): offers to make one in the directory shown. */
|
|
47
|
+
create?(directory: string, name: string): Promise<void>;
|
|
46
48
|
/** Where it opens: a path, or an `ssh://` location. */
|
|
47
49
|
initial: string;
|
|
48
50
|
onPick(path: string): Promise<void>;
|
|
@@ -54,7 +56,7 @@ export interface FolderPickerProps {
|
|
|
54
56
|
* Picks a directory, of the machine of the server or of a host it reaches with ssh, folder by folder or by
|
|
55
57
|
* a path typed in, to open a conversation there.
|
|
56
58
|
*/
|
|
57
|
-
export declare function FolderPicker({ list, initial, onPick, onClose, remote: bench }: FolderPickerProps): React.ReactElement;
|
|
59
|
+
export declare function FolderPicker({ list, create, initial, onPick, onClose, remote: bench }: FolderPickerProps): React.ReactElement;
|
|
58
60
|
/** The name of a directory, with the host of one of another machine. */
|
|
59
61
|
export declare function DirectoryName({ cwd }: {
|
|
60
62
|
cwd: string;
|
|
@@ -64,9 +66,10 @@ export interface DirectoryButtonProps {
|
|
|
64
66
|
cwd: string;
|
|
65
67
|
/** The entries of a directory of the server, the same function from one render to the next. */
|
|
66
68
|
list(directory: string): Promise<TaDirEntry[]>;
|
|
69
|
+
create?(directory: string, name: string): Promise<void>;
|
|
67
70
|
onPick(cwd: string): void | Promise<void>;
|
|
68
71
|
remote?: FolderPickerRemote;
|
|
69
72
|
}
|
|
70
73
|
/** The directory a new conversation will work in, above its message box: a click picks another. */
|
|
71
|
-
export declare function DirectoryButton({ cwd, list, onPick, remote }: DirectoryButtonProps): React.ReactElement;
|
|
74
|
+
export declare function DirectoryButton({ cwd, list, create, onPick, remote }: DirectoryButtonProps): React.ReactElement;
|
|
72
75
|
//# sourceMappingURL=folder-picker.d.ts.map
|