@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
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Process = Process;
|
|
37
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
37
38
|
const lucide_react_1 = require("lucide-react");
|
|
38
39
|
const React = __importStar(require("react"));
|
|
39
40
|
const use_t_1 = require("../i18n/use-t");
|
|
@@ -44,6 +45,7 @@ const tool_1 = require("../util/tool");
|
|
|
44
45
|
const icon_1 = require("./icon");
|
|
45
46
|
const link_1 = require("./link");
|
|
46
47
|
const markdown_1 = require("./markdown");
|
|
48
|
+
const message_images_1 = require("./message-images");
|
|
47
49
|
const message_user_1 = require("./message-user");
|
|
48
50
|
const tool_view_1 = require("./tool-view");
|
|
49
51
|
/** The summary an agent compacted its context to: folded into one line, it opens to the whole summary. */
|
|
@@ -80,20 +82,27 @@ const ErrorStep = React.memo(function ErrorStep({ text }) {
|
|
|
80
82
|
open && text && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
81
83
|
});
|
|
82
84
|
/**
|
|
83
|
-
* What the user said
|
|
84
|
-
*
|
|
85
|
+
* What the user said on the string of the steps (while the agent worked, or once a run stopped short and it goes on
|
|
86
|
+
* with what they said): one line of their words, marked where it came in, as quiet as the steps around it. It stays in
|
|
87
|
+
* sight when the steps fold.
|
|
85
88
|
*/
|
|
86
|
-
const SaidStep = React.memo(function SaidStep({ message }) {
|
|
89
|
+
const SaidStep = React.memo(function SaidStep({ message, wentOn }) {
|
|
87
90
|
const t = (0, use_t_1.useT)();
|
|
88
91
|
const blocks = message_1.MessageUtil.blocks(message);
|
|
89
92
|
const { text } = (0, message_user_1.userWords)(blocks);
|
|
90
|
-
|
|
93
|
+
const timestamp = message.timestamp;
|
|
94
|
+
const pictures = message_images_1.UserImageUtil.images(blocks).length > 0;
|
|
95
|
+
// One line, as the other steps are: the mark, a tag in the colour of the user's words, and what they said (a clip;
|
|
96
|
+
// the whole of it when opened). Words a part of Ta wrote for them, and pictures, show as they were said.
|
|
97
|
+
const line = !pictures && !ta_protocol_1.TaMessageSource.of(message_1.MessageUtil.text(blocks));
|
|
98
|
+
return (React.createElement("div", { className: line ? 'ta-step-said ta-said-line' : 'ta-step-said' },
|
|
91
99
|
React.createElement("span", { className: "ta-status ta-status-said" }),
|
|
92
|
-
React.createElement("div", { className: "ta-said-head", title: t('ta.message.steeredTitle') },
|
|
93
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.CornerDownRight, size: 12 }),
|
|
94
|
-
React.createElement("span",
|
|
95
|
-
React.createElement(message_user_1.MessageOrigin, { blocks: blocks })
|
|
96
|
-
|
|
100
|
+
React.createElement("div", { className: "ta-said-head", title: t(wentOn ? 'ta.message.wentOnTitle' : 'ta.message.steeredTitle') },
|
|
101
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.CornerDownRight, size: 12, className: "ta-said-arrow" }),
|
|
102
|
+
React.createElement("span", { className: "ta-said-tag" }, t(wentOn ? 'ta.message.wentOn' : 'ta.message.steered')),
|
|
103
|
+
React.createElement(message_user_1.MessageOrigin, { blocks: blocks }),
|
|
104
|
+
line && text && React.createElement("span", { className: "ta-said-text" }, text)),
|
|
105
|
+
line ? null : React.createElement(message_user_1.UserSaid, { blocks: blocks, text: text, bubble: "ta-said-bubble", timestamp: timestamp })));
|
|
97
106
|
});
|
|
98
107
|
/**
|
|
99
108
|
* Where the work went on after it was cut short (Ta restarted, the network came back, a part of Ta told it something,
|
|
@@ -123,7 +132,7 @@ function Step({ step, results, tools, tagged, streaming, }) {
|
|
|
123
132
|
case 'error':
|
|
124
133
|
return React.createElement(ErrorStep, { text: step.text });
|
|
125
134
|
case 'said':
|
|
126
|
-
return React.createElement(SaidStep, { message: step.message });
|
|
135
|
+
return React.createElement(SaidStep, { message: step.message, wentOn: step.wentOn });
|
|
127
136
|
case 'resumed':
|
|
128
137
|
return React.createElement(ResumedStep, { online: step.online, text: step.text });
|
|
129
138
|
default:
|
|
@@ -245,7 +254,7 @@ function Process({ steps, active, results, tools, leading, status, stopped, }) {
|
|
|
245
254
|
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
246
255
|
React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, earlier ? t('ta.process.earlier', { count: earlier }) : t('ta.process.showAll')))),
|
|
247
256
|
inline.map((step, index) => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly, streaming: active && index === inline.length - 1 }))))),
|
|
248
|
-
said.length > 0 && (React.createElement("div", { className: "ta-process-steps ta-said-folded" }, said.map(step => (React.createElement(SaidStep, { key: step.key, message: step.message }))))),
|
|
257
|
+
said.length > 0 && (React.createElement("div", { className: "ta-process-steps ta-said-folded" }, said.map(step => (React.createElement(SaidStep, { key: step.key, message: step.message, wentOn: step.wentOn }))))),
|
|
249
258
|
pinned.map(step => (React.createElement(markdown_1.Markdown, { key: step.key, text: step.text })))));
|
|
250
259
|
}
|
|
251
260
|
//# sourceMappingURL=message-steps.js.map
|
|
@@ -138,7 +138,7 @@ function useOrigin(from) {
|
|
|
138
138
|
const info = (_a = extensions.find(extension => extension.name === from)) === null || _a === void 0 ? void 0 : _a.info;
|
|
139
139
|
return {
|
|
140
140
|
name: (_b = ta_protocol_1.TaPackageTextUtil.pick(info === null || info === void 0 ? void 0 : info.title, language)) !== null && _b !== void 0 ? _b : (from !== null && from !== void 0 ? from : '').replace(/^@[^/]+\//, ''),
|
|
141
|
-
glyph: ((info === null || info === void 0 ? void 0 : info.icon) && icons_1.WEB_ICONS[info.icon]) ||
|
|
141
|
+
glyph: ((info === null || info === void 0 ? void 0 : info.icon) && icons_1.WEB_ICONS[info.icon]) || icons_1.WEB_ICONS.Blocks,
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
@@ -60,6 +60,7 @@ function MovedNotice({ server, sessionId, sessionFile, movedFrom, cwd, }) {
|
|
|
60
60
|
const [picking, setPicking] = React.useState(false);
|
|
61
61
|
const [busy, run] = (0, busy_1.useBusy)();
|
|
62
62
|
const list = React.useCallback((directory) => bench.workspace.listDirectory('.', directory), [bench]);
|
|
63
|
+
const create = React.useCallback((directory, name) => bench.workspace.createDirectory(name, directory), [bench]);
|
|
63
64
|
if (closed) {
|
|
64
65
|
return null;
|
|
65
66
|
}
|
|
@@ -91,6 +92,6 @@ function MovedNotice({ server, sessionId, sessionFile, movedFrom, cwd, }) {
|
|
|
91
92
|
React.createElement("button", { type: "button", className: "ta-button ta-small", disabled: busy, onClick: copy }, t('ta.session.movedCopy')),
|
|
92
93
|
React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.session.movedKeep'), onClick: () => setClosed(true) })) },
|
|
93
94
|
React.createElement("span", { title: movedFrom }, t('ta.session.moved', { dir: message_1.MessageUtil.basename(movedFrom) || movedFrom })),
|
|
94
|
-
picking && (React.createElement(folder_picker_1.FolderPicker, { list: list, initial: cwd || ((_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.', remote: bench, onPick: relocate, onClose: () => setPicking(false) }))));
|
|
95
|
+
picking && (React.createElement(folder_picker_1.FolderPicker, { list: list, create: create, initial: cwd || ((_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.', remote: bench, onPick: relocate, onClose: () => setPicking(false) }))));
|
|
95
96
|
}
|
|
96
97
|
//# sourceMappingURL=moved-notice.js.map
|
|
@@ -49,6 +49,8 @@ export interface Navigation {
|
|
|
49
49
|
showAll(on: boolean): void;
|
|
50
50
|
pin(id: string): void;
|
|
51
51
|
fold(id: string): void;
|
|
52
|
+
/** A page dragged before another, or last (NavigationUtil.move): the order the user put them in, for every device. */
|
|
53
|
+
move(page: string, before: string | undefined): void;
|
|
52
54
|
update(setting: NavigationSetting): void;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
@@ -47,8 +47,8 @@ function fixedTabs(views) {
|
|
|
47
47
|
*/
|
|
48
48
|
function places(views, setting, handheld, own = false) {
|
|
49
49
|
const pages = railPages(views);
|
|
50
|
-
const room = handheld ? Math.max(1, navigation_1.NavigationUtil.
|
|
51
|
-
return { pages, ...navigation_1.NavigationUtil.arrange(pages, setting, room, own) };
|
|
50
|
+
const room = handheld ? Math.max(1, navigation_1.NavigationUtil.tabs(setting) - fixedTabs(views)) : undefined;
|
|
51
|
+
return { pages, ...navigation_1.NavigationUtil.arrange(pages, setting, room, own, handheld) };
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
|
|
@@ -91,6 +91,8 @@ function phoneTabs(lists, navigation, labels) {
|
|
|
91
91
|
label: web_extension_protocol_1.WebLabelUtil.text(view.title),
|
|
92
92
|
icon: (_a = view.icon) !== null && _a !== void 0 ? _a : lucide_react_1.PanelTop,
|
|
93
93
|
menu,
|
|
94
|
+
// A page dragged among the others moves for every device, the tabs of a phone being the same pages.
|
|
95
|
+
move: navigation.move,
|
|
94
96
|
}); };
|
|
95
97
|
const list = (entry) => ({ ...entry, hold: entryHold(entry.id, entry.double, labels.holds) });
|
|
96
98
|
return [
|
|
@@ -21,6 +21,8 @@ export interface PhoneTab {
|
|
|
21
21
|
asks?: number;
|
|
22
22
|
/** How many messages people sent the user has not seen (the chats' tab): a red number, before all else. */
|
|
23
23
|
count?: number;
|
|
24
|
+
/** A page of the navigation: dragged among the others, it takes their place (NavigationUtil.move). */
|
|
25
|
+
move?(page: string, target: string | undefined): void;
|
|
24
26
|
}
|
|
25
27
|
export interface PhoneShellProps {
|
|
26
28
|
tabs: PhoneTab[];
|
|
@@ -42,6 +42,7 @@ const React = __importStar(require("react"));
|
|
|
42
42
|
const back_stack_1 = require("../device/back-stack");
|
|
43
43
|
const device_1 = require("../device/device");
|
|
44
44
|
const device_protocol_1 = require("../device/device-protocol");
|
|
45
|
+
const drag_move_1 = require("../device/drag-move");
|
|
45
46
|
const hold_1 = require("../device/hold");
|
|
46
47
|
const pull_down_1 = require("../device/pull-down");
|
|
47
48
|
const sheet_swipe_1 = require("../device/sheet-swipe");
|
|
@@ -266,6 +267,8 @@ function TabBar({ tabs, tab, onTab }) {
|
|
|
266
267
|
const t = (0, use_t_1.useT)();
|
|
267
268
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
268
269
|
const held = (0, hold_1.useHeld)();
|
|
270
|
+
// A page of the navigation dragged among the tabs, as on the rail: held by a finger first, then it follows.
|
|
271
|
+
const drag = (0, drag_move_1.useDragMove)({ attr: 'data-nav-page', onMove: (page, target) => { var _a, _b; return (_b = (_a = tabs.find(item => item.move)) === null || _a === void 0 ? void 0 : _a.move) === null || _b === void 0 ? void 0 : _b.call(_a, page, target); } });
|
|
269
272
|
// The tab shown tapped again: to the next row with a dot, as WeChat's; tapped twice quickly, to the top.
|
|
270
273
|
const lastTap = React.useRef({ id: '', at: 0 });
|
|
271
274
|
const again = (id, home) => {
|
|
@@ -278,9 +281,10 @@ function TabBar({ tabs, tab, onTab }) {
|
|
|
278
281
|
};
|
|
279
282
|
return (React.createElement("nav", { className: "ta-tabbar", "aria-label": t('ta.menu') },
|
|
280
283
|
tabs.map(item => {
|
|
284
|
+
var _a;
|
|
281
285
|
const Glyph = item.icon;
|
|
282
286
|
const active = item.id === tab;
|
|
283
|
-
return (React.createElement("button", { key: item.id, type: "button", className: `ta-tabbar-item${active ? ' ta-active' : ''}`, "aria-current": active ? 'page' : undefined, onClick: event => (active ? again(item.id, event.currentTarget.closest('.ta-phone-home')) : onTab(item.id)), onContextMenu: item.menu ? event => { var _a; return openMenu(event, (_a = item.menu) !== null && _a !== void 0 ? _a : []); } : undefined, ...held(item.hold) },
|
|
287
|
+
return (React.createElement("button", { key: item.id, type: "button", className: `ta-tabbar-item${active ? ' ta-active' : ''}${((_a = drag.dragging) === null || _a === void 0 ? void 0 : _a.page) === item.id ? ' ta-dragged' : ''}`, "aria-current": active ? 'page' : undefined, "data-nav-page": item.move ? item.id : undefined, onClick: event => (active ? again(item.id, event.currentTarget.closest('.ta-phone-home')) : onTab(item.id)), onContextMenu: item.menu ? event => { var _a; return openMenu(event, (_a = item.menu) !== null && _a !== void 0 ? _a : []); } : undefined, onPointerDown: item.move ? drag.onPointerDown : undefined, ...held(item.hold) },
|
|
284
288
|
React.createElement("span", { className: "ta-tabbar-icon" },
|
|
285
289
|
item.double ? React.createElement(ta_avatar_1.DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(Glyph, { size: 22, strokeWidth: active ? 2 : 1.6 }),
|
|
286
290
|
item.count ? (React.createElement(asks_badge_1.PeopleBadge, { count: item.count, onDismiss: item.onSeeAll })) : item.asks ? (React.createElement(asks_badge_1.AsksBadge, { count: item.asks, onDismiss: item.onSeeAll })) : (item.unseen && React.createElement(unseen_drop_1.UnseenDrop, { label: t('ta.chat.unseen'), onDismiss: item.onSeeAll }))),
|
|
@@ -35,7 +35,7 @@ export declare function SecretChip({ name, kind }: {
|
|
|
35
35
|
name: string;
|
|
36
36
|
kind: TaSecretKind;
|
|
37
37
|
}): React.JSX.Element;
|
|
38
|
-
/** Words with the names of the vault in them drawn as {@link SecretChip}
|
|
38
|
+
/** Words with the names of the vault in them drawn as {@link SecretChip}, and the faces of a chat (`[微笑]`) as theirs. */
|
|
39
39
|
export declare function SecretText({ text }: {
|
|
40
40
|
text: string;
|
|
41
41
|
}): React.JSX.Element;
|
|
@@ -40,6 +40,7 @@ const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
|
40
40
|
const lucide_react_1 = require("lucide-react");
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
42
|
const use_t_1 = require("../i18n/use-t");
|
|
43
|
+
const chat_emoji_1 = require("./chat-emoji");
|
|
43
44
|
const context_menu_1 = require("./context-menu");
|
|
44
45
|
const icon_1 = require("./icon");
|
|
45
46
|
exports.SecretPeeks = React.createContext(undefined);
|
|
@@ -108,11 +109,11 @@ function SecretChip({ name, kind }) {
|
|
|
108
109
|
React.createElement("button", { type: "button", className: "ta-secret-chip", title: t('ta.secret.title'), "aria-haspopup": "menu", onClick: open }, content),
|
|
109
110
|
menu));
|
|
110
111
|
}
|
|
111
|
-
/** Words with the names of the vault in them drawn as {@link SecretChip}
|
|
112
|
+
/** Words with the names of the vault in them drawn as {@link SecretChip}, and the faces of a chat (`[微笑]`) as theirs. */
|
|
112
113
|
function SecretText({ text }) {
|
|
113
114
|
if (!ta_protocol_1.TaSecretRef.has(text)) {
|
|
114
|
-
return React.createElement(
|
|
115
|
+
return React.createElement(chat_emoji_1.EmojiText, { text: text });
|
|
115
116
|
}
|
|
116
|
-
return (React.createElement(React.Fragment, null, ta_protocol_1.TaSecretRef.split(text).map((part, index) => 'secret' in part ? React.createElement(SecretChip, { key: index, name: part.secret, kind: part.kind }) : React.createElement(
|
|
117
|
+
return (React.createElement(React.Fragment, null, ta_protocol_1.TaSecretRef.split(text).map((part, index) => 'secret' in part ? React.createElement(SecretChip, { key: index, name: part.secret, kind: part.kind }) : React.createElement(chat_emoji_1.EmojiText, { key: index, text: part.text }))));
|
|
117
118
|
}
|
|
118
119
|
//# sourceMappingURL=secret-text.js.map
|
|
@@ -39,6 +39,7 @@ const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
|
39
39
|
const lucide_react_1 = require("lucide-react");
|
|
40
40
|
const React = __importStar(require("react"));
|
|
41
41
|
const call_face_1 = require("../assistant/call-face");
|
|
42
|
+
const spoken_call_1 = require("../assistant/spoken-call");
|
|
42
43
|
const voice_call_bar_1 = require("../assistant/voice-call-bar");
|
|
43
44
|
const device_1 = require("../device/device");
|
|
44
45
|
const drafts_protocol_1 = require("../drafts/drafts-protocol");
|
|
@@ -197,6 +198,8 @@ function SessionView({ store, server, workspace, info, onClosed, onActivity, lea
|
|
|
197
198
|
language: () => settingsState.language,
|
|
198
199
|
voice: () => settingsState.settings.voice,
|
|
199
200
|
send: text => store.prompt(text, { streamingBehavior: 'followUp' }),
|
|
201
|
+
// Said over a call, an answer to what the conversation waits on answers it, rather than going to the model.
|
|
202
|
+
answer: said => (0, spoken_call_1.answerSpoken)(state.pendingUi[0], said, response => store.respondUi(response)),
|
|
200
203
|
ended: (reason, detail) => notices.notify((0, voice_call_bar_1.callEndedNotice)(t, reason, detail)),
|
|
201
204
|
}, { sessionId: store.sessionId, sessionFile: info === null || info === void 0 ? void 0 : info.sessionFile, cwd: info === null || info === void 0 ? void 0 : info.cwd, double: false }, (info === null || info === void 0 ? void 0 : info.sessionName) || (info === null || info === void 0 ? void 0 : info.firstMessage) || (info ? message_1.MessageUtil.basename(info.cwd) : t('ta.session.title')));
|
|
202
205
|
(0, voice_call_bar_1.useCallTurns)(call, callState, state.working, message_1.MessageUtil.lastReply(state.messages, state.start));
|
|
@@ -3,11 +3,12 @@ import { type LucideIcon } from 'lucide-react';
|
|
|
3
3
|
import type { WebSettingsGroup } from '../extension/web-extension-api';
|
|
4
4
|
import type { MessageId } from '../i18n/messages';
|
|
5
5
|
import type { useT } from '../i18n/use-t';
|
|
6
|
-
import { type DiagramStyle, type FontSize, type LanguageSetting, type SkinGlass, type ThemeSetting } from '../settings/settings-protocol';
|
|
6
|
+
import { type DiagramStyle, type FontSize, type LanguageSetting, type PageWidth, type SkinGlass, type ThemeSetting } from '../settings/settings-protocol';
|
|
7
7
|
import type { Navigation } from './nav-places';
|
|
8
8
|
import { type Choice, type RowEntry } from './settings-controls';
|
|
9
9
|
export declare const THEMES: Choice<ThemeSetting>[];
|
|
10
10
|
export declare const FONT_SIZES: Choice<FontSize>[];
|
|
11
|
+
export declare const PAGE_WIDTH_CHOICES: Choice<PageWidth>[];
|
|
11
12
|
export declare const DIAGRAM_STYLE_CHOICES: Choice<DiagramStyle>[];
|
|
12
13
|
export declare const GLASS_CHOICES: Choice<SkinGlass>[];
|
|
13
14
|
export declare const LANGUAGES: Choice<LanguageSetting>[];
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SHORTCUTS = exports.SETTINGS_GROUPS = exports.GROUP_ICONS = exports.LANGUAGES = exports.GLASS_CHOICES = exports.DIAGRAM_STYLE_CHOICES = exports.FONT_SIZES = exports.THEMES = void 0;
|
|
36
|
+
exports.SHORTCUTS = exports.SETTINGS_GROUPS = exports.GROUP_ICONS = exports.LANGUAGES = exports.GLASS_CHOICES = exports.DIAGRAM_STYLE_CHOICES = exports.PAGE_WIDTH_CHOICES = exports.FONT_SIZES = exports.THEMES = void 0;
|
|
37
37
|
exports.usePackages = usePackages;
|
|
38
38
|
exports.navigationRows = navigationRows;
|
|
39
39
|
exports.packageLabel = packageLabel;
|
|
@@ -43,6 +43,7 @@ const React = __importStar(require("react"));
|
|
|
43
43
|
const icons_1 = require("../extension/icons");
|
|
44
44
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
45
45
|
const hooks_1 = require("../hooks");
|
|
46
|
+
const navigation_1 = require("../settings/navigation");
|
|
46
47
|
const settings_protocol_1 = require("../settings/settings-protocol");
|
|
47
48
|
const settings_controls_1 = require("./settings-controls");
|
|
48
49
|
exports.THEMES = [
|
|
@@ -56,6 +57,11 @@ exports.FONT_SIZES = [
|
|
|
56
57
|
{ value: 'large', label: 'ta.settings.fontSize.large' },
|
|
57
58
|
{ value: 'xlarge', label: 'ta.settings.fontSize.xlarge' },
|
|
58
59
|
];
|
|
60
|
+
exports.PAGE_WIDTH_CHOICES = [
|
|
61
|
+
{ value: 'standard', label: 'ta.settings.pageWidth.standard' },
|
|
62
|
+
{ value: 'wide', label: 'ta.settings.pageWidth.wide' },
|
|
63
|
+
{ value: 'wider', label: 'ta.settings.pageWidth.wider' },
|
|
64
|
+
];
|
|
59
65
|
exports.DIAGRAM_STYLE_CHOICES = settings_protocol_1.DIAGRAM_STYLES.map(value => ({ value, label: `ta.settings.diagramStyle.${value}` }));
|
|
60
66
|
exports.GLASS_CHOICES = settings_protocol_1.SKIN_GLASSES.map(value => ({ value, label: `ta.settings.glass.${value}` }));
|
|
61
67
|
exports.LANGUAGES = [
|
|
@@ -124,15 +130,17 @@ function navigationRows(navigation, t) {
|
|
|
124
130
|
if (navigation.nav.some(page => page.id === id)) {
|
|
125
131
|
return t('ta.settings.navigation.inNav');
|
|
126
132
|
}
|
|
127
|
-
return t(navigation.setting
|
|
133
|
+
return t(navigation_1.NavigationUtil.isPinned(navigation.setting, id) ? 'ta.settings.navigation.overflow' : 'ta.settings.navigation.folded');
|
|
128
134
|
};
|
|
129
135
|
return [
|
|
136
|
+
(0, settings_controls_1.row)('nav-tabs', [t('ta.settings.navigation.tabs'), t('ta.settings.navigation.tabsHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.navigation.tabs'), description: t('ta.settings.navigation.tabsHint'), stacked: true },
|
|
137
|
+
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.navigation.tabs'), value: String(navigation_1.NavigationUtil.tabs(navigation.setting)), choices: navigation_1.NavigationUtil.PHONE_TABS.map(tabs => ({ value: String(tabs), label: String(tabs) })), onChange: tabs => navigation.update({ ...navigation.setting, tabs: Number(tabs) }) }))),
|
|
130
138
|
(0, settings_controls_1.row)('all-features', [t('ta.settings.allFeatures'), t('ta.settings.allFeaturesHint'), t('ta.discover.all')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.allFeatures'), description: t('ta.settings.allFeaturesHint') },
|
|
131
139
|
React.createElement(settings_controls_1.Switch, { label: t('ta.settings.allFeatures'), checked: !navigation.first, onChange: navigation.showAll }))),
|
|
132
140
|
...navigation.pages.map(page => {
|
|
133
141
|
const title = web_extension_protocol_1.WebLabelUtil.text(page.title);
|
|
134
142
|
return (0, settings_controls_1.row)(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(settings_controls_1.Row, { label: title, description: where(page.id) },
|
|
135
|
-
React.createElement(settings_controls_1.Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: navigation.
|
|
143
|
+
React.createElement(settings_controls_1.Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: navigation.nav.some(other => other.id === page.id), onChange: on => (on ? navigation.pin(page.id) : navigation.fold(page.id)) })));
|
|
136
144
|
}),
|
|
137
145
|
...(navigation.pages.length === 0
|
|
138
146
|
? [(0, settings_controls_1.row)('navigation:none', [t('ta.settings.navigation.none')], React.createElement(settings_controls_1.EmptyRow, { title: t('ta.settings.navigation.none') }))]
|
|
@@ -145,7 +153,7 @@ function packageLabel(pkg, language) {
|
|
|
145
153
|
return {
|
|
146
154
|
title: (_a = ta_protocol_1.TaPackageTextUtil.pick(pkg.title, language)) !== null && _a !== void 0 ? _a : pkg.name,
|
|
147
155
|
summary: (_b = ta_protocol_1.TaPackageTextUtil.pick(pkg.summary, language)) !== null && _b !== void 0 ? _b : pkg.description,
|
|
148
|
-
icon: (pkg.icon && icons_1.WEB_ICONS[pkg.icon]) || lucide_react_1.
|
|
156
|
+
icon: (pkg.icon && icons_1.WEB_ICONS[pkg.icon]) || lucide_react_1.Blocks,
|
|
149
157
|
};
|
|
150
158
|
}
|
|
151
159
|
//# sourceMappingURL=settings-choices.js.map
|
|
@@ -119,7 +119,7 @@ function useMoreSections(onDialog) {
|
|
|
119
119
|
{
|
|
120
120
|
id: 'packages',
|
|
121
121
|
title: t('ta.packages.installed'),
|
|
122
|
-
icon: lucide_react_1.
|
|
122
|
+
icon: lucide_react_1.Blocks,
|
|
123
123
|
group: 'extensions',
|
|
124
124
|
rows: [
|
|
125
125
|
(0, settings_controls_1.row)('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(settings_controls_1.Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
|
|
@@ -154,7 +154,7 @@ function useMoreSections(onDialog) {
|
|
|
154
154
|
// The console only for administrators of a gateway, where it shows.
|
|
155
155
|
...host.builtins
|
|
156
156
|
.filter(builtin => { var _a; return !builtin.gatewayAdmin || ((_a = gateway.info) === null || _a === void 0 ? void 0 : _a.admin); })
|
|
157
|
-
.map(builtin => { var _a; return (0, settings_controls_1.row)(`web:${builtin.name}`, [t(builtin.title), t(builtin.description), t('ta.packages.builtinTitle')], React.createElement(settings_controls_1.Row, { icon: (_a = builtin.icon) !== null && _a !== void 0 ? _a : lucide_react_1.
|
|
157
|
+
.map(builtin => { var _a; return (0, settings_controls_1.row)(`web:${builtin.name}`, [t(builtin.title), t(builtin.description), t('ta.packages.builtinTitle')], React.createElement(settings_controls_1.Row, { icon: (_a = builtin.icon) !== null && _a !== void 0 ? _a : lucide_react_1.Blocks, label: t(builtin.title), description: t(builtin.description) },
|
|
158
158
|
React.createElement(settings_controls_1.Switch, { label: t(builtin.title), checked: !settings.builtinsOff.includes(builtin.name), onChange: on => toggleBuiltin(builtin.name, on) }))); }),
|
|
159
159
|
...builtinPackages.map(info => {
|
|
160
160
|
const { title, summary, icon } = (0, settings_choices_1.packageLabel)(info, language);
|
|
@@ -100,6 +100,13 @@ function useParts(scope, onScope, onDialog) {
|
|
|
100
100
|
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.fontSize'), value: settings.fontSize, choices: settings_choices_1.FONT_SIZES, onChange: fontSize => store.update({ fontSize }) }))),
|
|
101
101
|
(0, settings_controls_1.row)('chat-font-size', [t('ta.settings.chatFontSize'), t('ta.settings.chatFontSizeHint'), 'font'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.chatFontSize'), description: t('ta.settings.chatFontSizeHint'), stacked: true },
|
|
102
102
|
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.chatFontSize'), value: settings.chatFontSize, choices: settings_choices_1.FONT_SIZES, onChange: chatFontSize => store.update({ chatFontSize }) }))),
|
|
103
|
+
// A phone shows a page the width of its screen.
|
|
104
|
+
...(handheld
|
|
105
|
+
? []
|
|
106
|
+
: [
|
|
107
|
+
(0, settings_controls_1.row)('page-width', [t('ta.settings.pageWidth'), t('ta.settings.pageWidthHint'), 'width'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.pageWidth'), description: t('ta.settings.pageWidthHint'), stacked: true },
|
|
108
|
+
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.pageWidth'), value: settings.pageWidth, choices: settings_choices_1.PAGE_WIDTH_CHOICES, onChange: pageWidth => store.update({ pageWidth }) }))),
|
|
109
|
+
]),
|
|
103
110
|
(0, settings_controls_1.row)('diagram-style', [t('ta.settings.diagramStyle'), t('ta.settings.diagramStyleHint'), 'mermaid', 'diagram'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.diagramStyle'), description: t('ta.settings.diagramStyleHint'), stacked: true },
|
|
104
111
|
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.diagramStyle'), value: settings.diagramStyle, choices: settings_choices_1.DIAGRAM_STYLE_CHOICES, onChange: diagramStyle => store.update({ diagramStyle }) }))),
|
|
105
112
|
(0, settings_controls_1.row)('motion', [t('ta.settings.motion'), t('ta.settings.motionHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.motion'), description: t('ta.settings.motionHint') },
|
|
@@ -139,6 +146,10 @@ function useParts(scope, onScope, onDialog) {
|
|
|
139
146
|
value: String(days),
|
|
140
147
|
label: days ? t('ta.settings.days', { count: days }) : t('ta.settings.never'),
|
|
141
148
|
})), onChange: value => store.update({ chatFoldDays: Number(value) }) }))),
|
|
149
|
+
(0, settings_controls_1.row)('tab-title', [t('ta.settings.tabTitle'), t('ta.settings.tabTitleHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.tabTitle'), description: t('ta.settings.tabTitleHint'), stacked: true },
|
|
150
|
+
React.createElement("input", { className: "ta-input", value: settings.tabTitle, placeholder: "Ta", maxLength: settings_protocol_1.TAB_TITLE_CHARS, "aria-label": t('ta.settings.tabTitle'), spellCheck: false, onChange: event => store.update({ tabTitle: event.target.value }) }))),
|
|
151
|
+
(0, settings_controls_1.row)('tab-counts', [t('ta.settings.tabCounts'), t('ta.settings.tabCountsHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.tabCounts'), description: t('ta.settings.tabCountsHint') },
|
|
152
|
+
React.createElement(settings_controls_1.Switch, { label: t('ta.settings.tabCounts'), checked: settings.tabCounts, onChange: tabCounts => store.update({ tabCounts }) }))),
|
|
142
153
|
(0, settings_controls_1.row)('chat-archive', [t('ta.settings.chatArchive'), t('ta.settings.chatArchiveHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.chatArchive'), description: t('ta.settings.chatArchiveHint'), stacked: true },
|
|
143
154
|
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.chatArchive'), value: String(settings.chatArchiveDays), choices: settings_protocol_1.CHAT_ARCHIVE_CHOICES.map(days => ({
|
|
144
155
|
value: String(days),
|
|
@@ -69,7 +69,13 @@ function ShareItemSheet({ item, ways, onClose }) {
|
|
|
69
69
|
React.createElement(Icon, { size: 22 })),
|
|
70
70
|
React.createElement("span", { className: "ta-share-who-text" },
|
|
71
71
|
React.createElement("strong", { className: "ta-share-name" }, name),
|
|
72
|
-
React.createElement("span", { className: "ta-share-gets" }, item.kind === 'file'
|
|
72
|
+
React.createElement("span", { className: "ta-share-gets" }, item.kind === 'file'
|
|
73
|
+
? t('ta.share.itemFile')
|
|
74
|
+
: item.kind === 'link'
|
|
75
|
+
? item.gets
|
|
76
|
+
: item.kind === 'media'
|
|
77
|
+
? t('ta.share.itemMedia')
|
|
78
|
+
: t('ta.share.itemWork'))))),
|
|
73
79
|
taking.length ? (React.createElement("div", { className: "ta-share-tiles" }, taking.map(way => (React.createElement(share_sheet_1.Tile, { key: way.key, icon: way.icon, label: web_share_1.WebShareUtil.label(way), onClick: () => pick(way) }))))) : (React.createElement(empty_state_1.EmptyState, { title: t('ta.share.noWay'), compact: true })))));
|
|
74
80
|
}
|
|
75
81
|
//# sourceMappingURL=share-item-sheet.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WebTaskEntry } from '../extension/web-extension-api';
|
|
2
|
+
import type { Translate } from '../i18n/use-t';
|
|
3
|
+
/** What the tab of a browser says of Ta: its name, and what waits for the user. */
|
|
4
|
+
export interface TabTitleFacts {
|
|
5
|
+
/** What the user calls this Ta (Settings.tabTitle): `Ta` when they named none. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The messages of people the user has not seen (useChatsDot.count): the number before the name, as a messenger's. */
|
|
8
|
+
unseen: number;
|
|
9
|
+
/** The tasks that go on, those waiting for the user among them: what is left to do. */
|
|
10
|
+
todo: number;
|
|
11
|
+
/** What waits for the user to decide: the tasks that ask, a conversation that asked among them. */
|
|
12
|
+
urgent: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The title of the tab of the browser, made in one place: `Ta`, or with what waits for the user, `(3) Ta · 2 待办 ·
|
|
16
|
+
* 1 紧急`, as a messenger shows the messages not read there. A count is left out while there is none.
|
|
17
|
+
*
|
|
18
|
+
* Both counts come from the tasks the page already lists (WebTaskUtil, `ui.useTasks`): those that go on are the work
|
|
19
|
+
* left, those that wait for the user what is urgent, a conversation that asked being one of them already
|
|
20
|
+
* (ChatTaskSource), so the title never says what the double's list does not.
|
|
21
|
+
*/
|
|
22
|
+
export declare namespace TabTitleUtil {
|
|
23
|
+
/** What the tab says, of these facts: the name of Ta, or the one the user gave it. */
|
|
24
|
+
function text(facts: TabTitleFacts, t: Translate): string;
|
|
25
|
+
/** The counts of these tasks, for the tab. */
|
|
26
|
+
function counts(tasks: readonly WebTaskEntry[]): Pick<TabTitleFacts, 'todo' | 'urgent'>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=tab-title.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TabTitleUtil = void 0;
|
|
4
|
+
const web_tasks_1 = require("../extension/web-tasks");
|
|
5
|
+
const asks_badge_1 = require("./asks-badge");
|
|
6
|
+
/**
|
|
7
|
+
* The title of the tab of the browser, made in one place: `Ta`, or with what waits for the user, `(3) Ta · 2 待办 ·
|
|
8
|
+
* 1 紧急`, as a messenger shows the messages not read there. A count is left out while there is none.
|
|
9
|
+
*
|
|
10
|
+
* Both counts come from the tasks the page already lists (WebTaskUtil, `ui.useTasks`): those that go on are the work
|
|
11
|
+
* left, those that wait for the user what is urgent, a conversation that asked being one of them already
|
|
12
|
+
* (ChatTaskSource), so the title never says what the double's list does not.
|
|
13
|
+
*/
|
|
14
|
+
var TabTitleUtil;
|
|
15
|
+
(function (TabTitleUtil) {
|
|
16
|
+
/** What the tab says, of these facts: the name of Ta, or the one the user gave it. */
|
|
17
|
+
function text(facts, t) {
|
|
18
|
+
const name = facts.name.trim() || 'Ta';
|
|
19
|
+
const parts = [facts.unseen > 0 ? `(${asks_badge_1.CountUtil.text(facts.unseen)}) ${name}` : name];
|
|
20
|
+
if (facts.todo > 0) {
|
|
21
|
+
parts.push(t('ta.tab.todo', { count: facts.todo }));
|
|
22
|
+
}
|
|
23
|
+
if (facts.urgent > 0) {
|
|
24
|
+
parts.push(t('ta.tab.urgent', { count: facts.urgent }));
|
|
25
|
+
}
|
|
26
|
+
return parts.join(' · ');
|
|
27
|
+
}
|
|
28
|
+
TabTitleUtil.text = text;
|
|
29
|
+
/** The counts of these tasks, for the tab. */
|
|
30
|
+
function counts(tasks) {
|
|
31
|
+
return {
|
|
32
|
+
todo: tasks.filter(task => !web_tasks_1.WebTaskUtil.ended(task)).length,
|
|
33
|
+
urgent: tasks.filter(task => task.status === 'waiting').length,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
TabTitleUtil.counts = counts;
|
|
37
|
+
})(TabTitleUtil || (exports.TabTitleUtil = TabTitleUtil = {}));
|
|
38
|
+
//# sourceMappingURL=tab-title.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WebPickedVideo } from '../extension/web-api-components';
|
|
2
|
+
import type { MessageId } from '../i18n/messages';
|
|
3
|
+
import { type ComposerAttachment } from '../util/composer';
|
|
4
|
+
/** The pictures (and videos) of the message box: shown at once, read before they may be sent. */
|
|
5
|
+
export interface ComposerAttachments {
|
|
6
|
+
attachments: ComposerAttachment[];
|
|
7
|
+
/** As the draft of the place hands them back. */
|
|
8
|
+
set(next: ComposerAttachment[]): void;
|
|
9
|
+
/** Takes the files picked, dropped or pasted: pictures as pictures, videos to their owner, the rest as files. */
|
|
10
|
+
add(files: FileList | File[]): void;
|
|
11
|
+
remove(id: string): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The pictures a model sees itself: each is shown from its file at once and read at the same time, so that a box
|
|
15
|
+
* closes or another conversation opens without them lost; a file of another kind goes to `files` (the files of
|
|
16
|
+
* the box, uploaded), and a video to `videos` when the box takes them.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useComposerAttachments(options: {
|
|
19
|
+
/** Articles of the box that are taken as pictures. */
|
|
20
|
+
images: boolean;
|
|
21
|
+
videos?: (videos: WebPickedVideo[]) => void;
|
|
22
|
+
/** Whether the box takes other files (ComposerBoxProps.files). */
|
|
23
|
+
files: boolean;
|
|
24
|
+
/** Where those go: the files of the box (useComposerFiles.add). */
|
|
25
|
+
addFiles?(files: File[]): void;
|
|
26
|
+
t: (id: MessageId, values?: Record<string, string | number>) => string;
|
|
27
|
+
onError(error: unknown): void;
|
|
28
|
+
}): ComposerAttachments;
|
|
29
|
+
//# sourceMappingURL=use-composer-attachments.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
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.useComposerAttachments = useComposerAttachments;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const video_picks_1 = require("../device/video-picks");
|
|
39
|
+
const composer_1 = require("../util/composer");
|
|
40
|
+
const composer_attachments_1 = require("./composer-attachments");
|
|
41
|
+
/**
|
|
42
|
+
* The pictures a model sees itself: each is shown from its file at once and read at the same time, so that a box
|
|
43
|
+
* closes or another conversation opens without them lost; a file of another kind goes to `files` (the files of
|
|
44
|
+
* the box, uploaded), and a video to `videos` when the box takes them.
|
|
45
|
+
*/
|
|
46
|
+
function useComposerAttachments(options) {
|
|
47
|
+
const { images, videos, files, addFiles, t, onError } = options;
|
|
48
|
+
const [attachments, setAttachments] = React.useState([]);
|
|
49
|
+
// The previews of a box that goes away go with it.
|
|
50
|
+
const shown = React.useRef(attachments);
|
|
51
|
+
shown.current = attachments;
|
|
52
|
+
React.useEffect(() => () => composer_1.ComposerUtil.release(shown.current), []);
|
|
53
|
+
const known = React.useRef(attachments);
|
|
54
|
+
known.current = attachments;
|
|
55
|
+
const add = React.useCallback((list) => {
|
|
56
|
+
const added = [];
|
|
57
|
+
const uploads = [];
|
|
58
|
+
for (const file of video_picks_1.VideoPicks.take(list, videos)) {
|
|
59
|
+
const reason = composer_1.ComposerUtil.rejectImage(file, known.current.length + added.length);
|
|
60
|
+
// What a model cannot see as a picture (a PDF, a HEIC, one over 5 MB) goes as a file it opens.
|
|
61
|
+
if (files && (!images || reason === 'type' || reason === 'size')) {
|
|
62
|
+
uploads.push(file);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (reason) {
|
|
66
|
+
onError(new Error(t(`ta.composer.image.${reason}`, { name: file.name })));
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
added.push({ attachment: { id: crypto.randomUUID(), preview: URL.createObjectURL(file) }, file });
|
|
70
|
+
}
|
|
71
|
+
if (uploads.length) {
|
|
72
|
+
addFiles === null || addFiles === void 0 ? void 0 : addFiles(uploads);
|
|
73
|
+
}
|
|
74
|
+
if (!added.length) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
setAttachments(previous => [...previous, ...added.map(({ attachment }) => attachment)]);
|
|
78
|
+
for (const { attachment, file } of added) {
|
|
79
|
+
void (0, composer_attachments_1.readImage)(file).then(image => {
|
|
80
|
+
if (!image) {
|
|
81
|
+
composer_1.ComposerUtil.release([attachment]);
|
|
82
|
+
}
|
|
83
|
+
setAttachments(previous => image
|
|
84
|
+
? previous.map(other => (other.id === attachment.id ? { ...other, image } : other))
|
|
85
|
+
: previous.filter(other => other.id !== attachment.id));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}, [images, files, videos, addFiles, t, onError]);
|
|
89
|
+
const remove = React.useCallback((id) => {
|
|
90
|
+
setAttachments(previous => {
|
|
91
|
+
composer_1.ComposerUtil.release(previous.filter(attachment => attachment.id === id));
|
|
92
|
+
return previous.filter(attachment => attachment.id !== id);
|
|
93
|
+
});
|
|
94
|
+
}, []);
|
|
95
|
+
const set = React.useCallback((next) => setAttachments(previous => {
|
|
96
|
+
composer_1.ComposerUtil.release(previous.filter(attachment => !next.includes(attachment)));
|
|
97
|
+
return next;
|
|
98
|
+
}), []);
|
|
99
|
+
return { attachments, set, add, remove };
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=use-composer-attachments.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
2
|
+
import type { MessageId } from '../i18n/messages';
|
|
3
|
+
import { type ComposerFile } from '../util/composer-files';
|
|
4
|
+
/** The files of the message box (ComposerBoxProps.files): what was picked, uploaded under `uploads/` of `cwd`. */
|
|
5
|
+
export interface ComposerFileBox {
|
|
6
|
+
/** The files picked, each with how far it is uploaded. */
|
|
7
|
+
files: ComposerFile[];
|
|
8
|
+
/** All of them are there: the message may go. */
|
|
9
|
+
ready: boolean;
|
|
10
|
+
/** Takes files picked, dropped or pasted; the pictures a model sees itself are the box's (addFiles). */
|
|
11
|
+
add(files: readonly File[]): void;
|
|
12
|
+
remove(id: string): void;
|
|
13
|
+
/** Sent, or given up: the box holds none. */
|
|
14
|
+
clear(): void;
|
|
15
|
+
/** The sending failed: they are in the box again, as they were. */
|
|
16
|
+
restore(files: ComposerFile[]): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Picks files of the box other than the pictures a model sees itself: each shows at once and is uploaded under
|
|
20
|
+
* `uploads/` of the directory of the conversation, where the message names it as an `@` reference (ComposerFileUtil).
|
|
21
|
+
* A file that fails to go takes its chip away, and says why.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useComposerFiles(files: {
|
|
24
|
+
workspace: Pick<TaWorkspaceServer, 'uploadFile' | 'listDirectory'>;
|
|
25
|
+
} | undefined, cwd: string | undefined, t: (id: MessageId, values?: Record<string, string | number>) => string, onError: (error: unknown) => void): ComposerFileBox;
|
|
26
|
+
//# sourceMappingURL=use-composer-files.d.ts.map
|