@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,7 +1,7 @@
|
|
|
1
1
|
import type { TaAccountInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { type AccountSide } from '../account/device-account.js';
|
|
4
|
-
type Act = (run: (side: AccountSide) => Promise<TaAccountInfo>) => Promise<void>;
|
|
4
|
+
export type Act = (run: (side: AccountSide) => Promise<TaAccountInfo>) => Promise<void>;
|
|
5
5
|
/** The ways an account's id tells (`github:42`, `iam:su`), as the user knows them: GitHub, the company account. */
|
|
6
6
|
export declare function useAccountWay(): (id: string) => string;
|
|
7
7
|
/** What the user is called in an account: its name, without the way it came by (`iam:su` is su). */
|
|
@@ -47,4 +47,3 @@ export declare function AccountSignInDialog({ onClose }: {
|
|
|
47
47
|
* until it is let in, refused, or put off for now.
|
|
48
48
|
*/
|
|
49
49
|
export declare function AccountAsk(): React.ReactPortal | null;
|
|
50
|
-
export {};
|
|
@@ -10,6 +10,7 @@ import { useNotices, useWorkbench } from '../hooks.js';
|
|
|
10
10
|
import { HostUtil } from '../hosts.js';
|
|
11
11
|
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
12
12
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
13
|
+
import { RecoveryPart } from './account-recovery-view.js';
|
|
13
14
|
import { BusyMark, useBusy } from './busy.js';
|
|
14
15
|
import { Callout } from './callout.js';
|
|
15
16
|
import { CloudSignInEntry, CloudSignInFlow, CodeBox } from './cloud-sign-in-view.js';
|
|
@@ -68,6 +69,12 @@ export function SignInPart({ info, act }) {
|
|
|
68
69
|
void ((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(url).then(() => notices.notify(t('ta.link.copiedToOpen'), { level: 'success' }), () => notices.notify(url, { level: 'info' })));
|
|
69
70
|
};
|
|
70
71
|
const signing = info.signingIn;
|
|
72
|
+
if (signing === null || signing === void 0 ? void 0 : signing.waiting) {
|
|
73
|
+
// Signed in there, its code used: what is left is the admin's, and this device connects once they let it in.
|
|
74
|
+
return (React.createElement("div", { className: "ta-account-signing" },
|
|
75
|
+
React.createElement("p", null, t('ta.cloud.waiting', { account: signing.waiting })),
|
|
76
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => go(side => side.cancelSignIn()) }, t('ta.cancel'))));
|
|
77
|
+
}
|
|
71
78
|
if (signing) {
|
|
72
79
|
const name = providerName(info, signing.provider);
|
|
73
80
|
return (React.createElement("div", { className: "ta-account-signing" },
|
|
@@ -231,6 +238,7 @@ export function DevicesDialog({ onClose }) {
|
|
|
231
238
|
React.createElement("span", { className: "ta-modal-title" }, t('ta.myDevices.title')),
|
|
232
239
|
React.createElement(IconButton, { icon: X, label: t('ta.close'), onClick: onClose })),
|
|
233
240
|
(info === null || info === void 0 ? void 0 : info.waiting) && info.code ? React.createElement(WaitingPart, { code: info.code }) : null,
|
|
241
|
+
(info === null || info === void 0 ? void 0 : info.account) && (side === null || side === void 0 ? void 0 : side.makeRecovery) ? React.createElement(RecoveryPart, { info: info, act: act }) : null,
|
|
234
242
|
(info === null || info === void 0 ? void 0 : info.error) || failed ? React.createElement(Callout, { level: "error" }, (_a = info === null || info === void 0 ? void 0 : info.error) !== null && _a !== void 0 ? _a : String((_b = failed.message) !== null && _b !== void 0 ? _b : failed)) : null,
|
|
235
243
|
React.createElement("ul", { className: "ta-host-list", hidden: adding === 'cloud' }, hosts.map(host => {
|
|
236
244
|
const device = ofAccount(host);
|
|
@@ -331,7 +339,8 @@ export function AccountSignInDialog({ onClose }) {
|
|
|
331
339
|
info ? (React.createElement(React.Fragment, null,
|
|
332
340
|
!info.signingIn && !info.waiting && React.createElement("p", { className: "ta-account-hint" }, t('ta.myDevices.hint')),
|
|
333
341
|
through && !info.signingIn && !info.waiting && React.createElement(JoinThrough, { through: through, act: act }),
|
|
334
|
-
React.createElement(AccountWays, { info: info, act: act })
|
|
342
|
+
React.createElement(AccountWays, { info: info, act: act }),
|
|
343
|
+
info.account && info.waiting && (side === null || side === void 0 ? void 0 : side.makeRecovery) ? React.createElement(RecoveryPart, { info: info, act: act }) : null)) : (React.createElement(Loading, { compact: true })))), document.body);
|
|
335
344
|
}
|
|
336
345
|
/**
|
|
337
346
|
* A device asks to join the account: whichever device of it the user has at hand says so, with the code to compare,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChevronLeft, Compass, Grip, LayoutDashboard, PanelTop } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useDevice } from '../device/device.js';
|
|
4
|
+
import { useDragMove } from '../device/drag-move.js';
|
|
4
5
|
import { useHeld } from '../device/hold.js';
|
|
5
6
|
import { ExtensionBoundary, ExtensionPart } from '../extension/extension-view.js';
|
|
6
7
|
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
@@ -32,19 +33,22 @@ export function useNavigation(views) {
|
|
|
32
33
|
// The pages a page lists (a game, on the Games page) are there, not in the navigation or under Discover.
|
|
33
34
|
const listed = React.useMemo(() => new Set(pages.filter(page => page.place === 'list').map(page => page.id)), [pages]);
|
|
34
35
|
const infos = React.useMemo(() => new Map(pages.map(page => [page.id, page])), [pages]);
|
|
36
|
+
const arranged = places(views.filter(view => !listed.has(view.id)), setting, handheld, onOpen.length > 0);
|
|
35
37
|
return {
|
|
36
|
-
...
|
|
38
|
+
...arranged,
|
|
37
39
|
onOpen,
|
|
38
40
|
setting,
|
|
39
41
|
...(settings.allFeatures ? {} : { first: (id) => discoverFirst(infos.get(id), Date.now()) }),
|
|
40
42
|
showAll: on => store.update({ allFeatures: on }),
|
|
41
|
-
pin: id => update(NavigationUtil.pin(setting, id)),
|
|
42
|
-
fold: id => update(NavigationUtil.fold(setting, id)),
|
|
43
|
+
pin: id => update(NavigationUtil.pin(setting, id, handheld)),
|
|
44
|
+
fold: id => update(NavigationUtil.fold(setting, id, handheld)),
|
|
45
|
+
// Among the pages the user sees in the navigation, those under Discover keeping their place in the list.
|
|
46
|
+
move: (page, before) => update(NavigationUtil.move(setting, page, before, arranged.nav.map(view => view.id))),
|
|
43
47
|
update,
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
|
-
function RailItem({ label, place, active, onClick, onContextMenu, onPointerDown, 'data-held': held, children }) {
|
|
47
|
-
return (React.createElement("button", { type: "button", className: `ta-rail-item ${active ? 'ta-active' : ''}`, title: label, "aria-label": label, "aria-pressed": active, onClick: onClick, onContextMenu: onContextMenu, onPointerDown: onPointerDown, "data-held": held, "data-ta-place": place }, children));
|
|
50
|
+
function RailItem({ label, place, page, dragged, active, onClick, onContextMenu, onPointerDown, 'data-held': held, children }) {
|
|
51
|
+
return (React.createElement("button", { type: "button", className: `ta-rail-item ${active ? 'ta-active' : ''} ${dragged ? 'ta-dragged' : ''}`, title: label, "aria-label": label, "aria-pressed": active, onClick: onClick, onContextMenu: onContextMenu, onPointerDown: onPointerDown, "data-held": held, "data-ta-place": place, "data-nav-page": page }, children));
|
|
48
52
|
}
|
|
49
53
|
/**
|
|
50
54
|
* The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
|
|
@@ -56,12 +60,17 @@ export function Rail({ lists, list, onList, navigation, current, onPage, onDisco
|
|
|
56
60
|
const [{ server }] = useWorkbench();
|
|
57
61
|
const [menu, openMenu] = useContextMenu();
|
|
58
62
|
const held = useHeld();
|
|
63
|
+
// A page dragged among the others (useDragMove): its place under the pointer, drawn as a line.
|
|
64
|
+
const drag = useDragMove({ attr: 'data-nav-page', onMove: navigation.move });
|
|
65
|
+
// The line where the dragged page would land: before the one whose place it takes.
|
|
66
|
+
const drop = (view, before) => { var _a; return before && ((_a = drag.dragging) === null || _a === void 0 ? void 0 : _a.target) === view.id && React.createElement("hr", { className: "ta-rail-drop" }); };
|
|
59
67
|
const settingsItem = { label: t('ta.nav.settings'), run: () => onSettings('navigation') };
|
|
60
68
|
/** A page of the rail: its menu puts it under Discover. */
|
|
61
69
|
const item = (view) => {
|
|
62
70
|
var _a;
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
var _b;
|
|
72
|
+
const Glyph = (_b = view.icon) !== null && _b !== void 0 ? _b : PanelTop;
|
|
73
|
+
return (React.createElement(RailItem, { key: view.id, label: WebLabelUtil.text(view.title), place: `page:${view.id}`, page: view.id, dragged: ((_a = drag.dragging) === null || _a === void 0 ? void 0 : _a.page) === view.id, active: !settingsShown && current === view.id, onClick: () => onPage(view.id), onPointerDown: drag.onPointerDown, onContextMenu: event => openMenu(event, [{ label: t('ta.nav.fold'), run: () => navigation.fold(view.id) }, '-', settingsItem]) },
|
|
65
74
|
React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
|
|
66
75
|
};
|
|
67
76
|
const discover = hasDiscover(navigation) || current === DISCOVER;
|
|
@@ -79,7 +88,9 @@ export function Rail({ lists, list, onList, navigation, current, onPage, onDisco
|
|
|
79
88
|
entry.double &&
|
|
80
89
|
(count ? (React.createElement(PeopleBadge, { count: count, onDismiss: onSeeAll })) : asks ? (React.createElement(AsksBadge, { count: asks, onDismiss: onDismissAsks })) : (onSeeAll && React.createElement(UnseenDrop, { label: t('ta.chat.unseen'), onDismiss: onSeeAll, className: "ta-tabbar-dot ta-rail-dot" })))))),
|
|
81
90
|
(navigation.nav.length > 0 || discover) && React.createElement("hr", { className: "ta-rail-divider" }),
|
|
82
|
-
navigation.nav.map(view =>
|
|
91
|
+
navigation.nav.map(view => (React.createElement(React.Fragment, { key: view.id },
|
|
92
|
+
drop(view, true),
|
|
93
|
+
item(view)))),
|
|
83
94
|
discover && (React.createElement(RailItem, { label: t('ta.discover'), place: "discover", active: !settingsShown && current === DISCOVER, onClick: onDiscover, onContextMenu: event => openMenu(event, [settingsItem]) },
|
|
84
95
|
React.createElement(Compass, { size: 20, strokeWidth: 1.6 })))),
|
|
85
96
|
(surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
|
|
@@ -34,6 +34,11 @@ export declare function useRight(): [boolean, () => void, () => void, () => void
|
|
|
34
34
|
* Cmd/Ctrl+Shift+T opens again the conversation last taken out of the list, as a browser its tab last closed.
|
|
35
35
|
*/
|
|
36
36
|
export declare function useKeys(toggle: () => void, openSettings: () => void, toggleWorkbench: () => void, reopen?: () => void): void;
|
|
37
|
+
/**
|
|
38
|
+
* A letter typed on the page, with nothing else taking it, goes into the message box in front (TypeFocus); not on a
|
|
39
|
+
* touch screen, whose keyboard comes up only with a field.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useTypeToFocus(active: boolean): void;
|
|
37
42
|
/**
|
|
38
43
|
* The installed app with its title bar hidden draws the bar itself (see .ta-titlebar), but the browser
|
|
39
44
|
* paints the corners of the window's buttons with theme-color: the traffic lights at the left over the
|
|
@@ -6,6 +6,8 @@ import { usePersisted, useSettings, useWebExtensions, useWorkbench } from '../ho
|
|
|
6
6
|
import { message } from '../i18n/messages.js';
|
|
7
7
|
import { THEME_COLORS } from '../settings/settings.js';
|
|
8
8
|
import { StateUtil } from '../state/state-protocol.js';
|
|
9
|
+
import { ComposerTarget } from './composer-target.js';
|
|
10
|
+
import { TypeFocus } from './composer-type-focus.js';
|
|
9
11
|
import { WorkbenchCards } from './editor-area.js';
|
|
10
12
|
/**
|
|
11
13
|
* What the sidebar shows in this tab: `` for the chats, else the id of a sidebar view. Until the user picks
|
|
@@ -98,6 +100,49 @@ export function useKeys(toggle, openSettings, toggleWorkbench, reopen) {
|
|
|
98
100
|
return () => window.removeEventListener('keydown', onKey);
|
|
99
101
|
}, [toggle, openSettings, toggleWorkbench, reopen]);
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Whether what has the focus keeps the keys pressed: a field, an editor, a terminal, or anything else focusable that
|
|
105
|
+
* listens to keys itself (a game of the workbench, a widget of an extension). Not the page itself, a button or a link
|
|
106
|
+
* pressed before, nor the conversation being read and scrolled.
|
|
107
|
+
*/
|
|
108
|
+
function ownsKeys(focused) {
|
|
109
|
+
if (!focused || focused === document.body || focused === document.documentElement) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (focused.matches('input, textarea, select, [role="textbox"], [contenteditable=""], [contenteditable="true"]')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return !focused.matches('button, a, summary, [role="button"], [role="tab"], [role="option"]') && !focused.closest('.ta-conversation');
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A letter typed on the page, with nothing else taking it, goes into the message box in front (TypeFocus); not on a
|
|
119
|
+
* touch screen, whose keyboard comes up only with a field.
|
|
120
|
+
*/
|
|
121
|
+
export function useTypeToFocus(active) {
|
|
122
|
+
React.useEffect(() => {
|
|
123
|
+
if (!active) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const onKey = (event) => {
|
|
127
|
+
const takes = TypeFocus.takes({
|
|
128
|
+
key: event.key,
|
|
129
|
+
ctrlKey: event.ctrlKey,
|
|
130
|
+
metaKey: event.metaKey,
|
|
131
|
+
altKey: event.altKey,
|
|
132
|
+
isComposing: event.isComposing,
|
|
133
|
+
defaultPrevented: event.defaultPrevented,
|
|
134
|
+
editable: ownsKeys(document.activeElement),
|
|
135
|
+
overlain: !!document.querySelector('[aria-modal="true"], [role="menu"], [role="dialog"]'),
|
|
136
|
+
shown: ComposerTarget.present(),
|
|
137
|
+
});
|
|
138
|
+
if (takes && ComposerTarget.type(event.key)) {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
window.addEventListener('keydown', onKey);
|
|
143
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
144
|
+
}, [active]);
|
|
145
|
+
}
|
|
101
146
|
/**
|
|
102
147
|
* The installed app with its title bar hidden draws the bar itself (see .ta-titlebar), but the browser
|
|
103
148
|
* paints the corners of the window's buttons with theme-color: the traffic lights at the left over the
|
|
@@ -15,7 +15,7 @@ import { useT } from '../i18n/use-t.js';
|
|
|
15
15
|
import { TaState } from '../state/state-protocol.js';
|
|
16
16
|
import { ThumbnailUtil } from '../util/thumbnail.js';
|
|
17
17
|
import { useNavigation } from './app-nav.js';
|
|
18
|
-
import { CARDS_ID, EDITOR, FIRST_SIDE, SETTINGS_SHOWN, SIDE, SIDEBAR, TAB_PAGE, useDrawerSwipe, useKeys, useRefresh, useRight, useTitlebarColor, useWorkbenchCards, WORKBENCH_MAX, } from './app-shell-hooks.js';
|
|
18
|
+
import { CARDS_ID, EDITOR, FIRST_SIDE, SETTINGS_SHOWN, SIDE, SIDEBAR, TAB_PAGE, useDrawerSwipe, useKeys, useRefresh, useRight, useTitlebarColor, useTypeToFocus, useWorkbenchCards, WORKBENCH_MAX, } from './app-shell-hooks.js';
|
|
19
19
|
import { useSurfaces } from './board.js';
|
|
20
20
|
import { LET_GO_ASKS } from './chat-asks.js';
|
|
21
21
|
import { BY_DIRECTORY, FOLDED, PINNED } from './chat-list-util.js';
|
|
@@ -431,6 +431,7 @@ export function useAppShell() {
|
|
|
431
431
|
}
|
|
432
432
|
}, [removedChats, chat]);
|
|
433
433
|
useKeys(toggleSide, openSettings, () => editors && toggleWorkbench(), reopenChat);
|
|
434
|
+
useTypeToFocus(!touch);
|
|
434
435
|
useTitlebarColor(workbench.status !== 'signed-out', theme, skinColor);
|
|
435
436
|
return {
|
|
436
437
|
t,
|
|
@@ -20,15 +20,15 @@ export function AppUpdateNotices() {
|
|
|
20
20
|
if (!offer || told.current || ((_a = storage()) === null || _a === void 0 ? void 0 : _a.getItem(LATER_KEY)) === offer.version) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
const { version } = offer;
|
|
23
|
+
const { version, back } = offer;
|
|
24
24
|
told.current = {
|
|
25
25
|
version,
|
|
26
|
-
id: notices.notify(t('ta.appUpdate.available', { version }), {
|
|
27
|
-
detail: t('ta.appUpdate.detail'),
|
|
26
|
+
id: notices.notify(t(back ? 'ta.appUpdate.back' : 'ta.appUpdate.available', { version }), {
|
|
27
|
+
detail: t(back ? 'ta.appUpdate.backDetail' : 'ta.appUpdate.detail'),
|
|
28
28
|
key: 'ta-app-update',
|
|
29
29
|
sticky: true,
|
|
30
30
|
actions: [{ label: t('ta.update.later'), run: () => { var _a; return (_a = storage()) === null || _a === void 0 ? void 0 : _a.setItem(LATER_KEY, version); } }],
|
|
31
|
-
action: { label: t('ta.appUpdate.update'), run: () => AppUpdate.install() },
|
|
31
|
+
action: { label: t(back ? 'ta.appUpdate.goBack' : 'ta.appUpdate.update'), run: () => AppUpdate.install() },
|
|
32
32
|
}),
|
|
33
33
|
};
|
|
34
34
|
}, [offer, notices, t]);
|
|
@@ -4,14 +4,13 @@ import { AssistantChatList } from '../assistant/assistant-chat-list.js';
|
|
|
4
4
|
import { ChatView } from '../chat/chat-view.js';
|
|
5
5
|
import { AppBadge } from '../device/app-badge.js';
|
|
6
6
|
import { WebCwdUtil } from '../extension/web-extension-protocol.js';
|
|
7
|
-
import { usePersisted } from '../hooks.js';
|
|
7
|
+
import { usePersisted, useTasks } from '../hooks.js';
|
|
8
8
|
import { SIGN_IN_EVENT, SIGNED_IN_EVENT } from '../notices/notices.js';
|
|
9
9
|
import { AppContexts } from './app-contexts.js';
|
|
10
10
|
import { PageView, Rail, SidebarView } from './app-nav.js';
|
|
11
11
|
import { LOGIN_LATER, RAIL } from './app-shell-hooks.js';
|
|
12
12
|
import { useAppShell } from './app-shell-state.js';
|
|
13
13
|
import { AppUpdateNotices } from './app-update-view.js';
|
|
14
|
-
import { CountUtil } from './asks-badge.js';
|
|
15
14
|
import { AuthUtil, LoginPage, useAuthProviders } from './auth-view.js';
|
|
16
15
|
import { BoardSurface } from './board.js';
|
|
17
16
|
import { ChatAskUtil } from './chat-asks.js';
|
|
@@ -44,6 +43,7 @@ import { ShareHost } from './share-dialog.js';
|
|
|
44
43
|
import { DOUBLE_PAGE, SideListUtil } from './side-lists.js';
|
|
45
44
|
import { paneStyle, Sash } from './split-pane.js';
|
|
46
45
|
import { SurfaceFlyout } from './surface-flyout.js';
|
|
46
|
+
import { TabTitleUtil } from './tab-title.js';
|
|
47
47
|
import { SidebarPane, WorkbenchToggleContext } from './workbench-toggle.js';
|
|
48
48
|
import { SignIn } from './workbench-view.js';
|
|
49
49
|
/**
|
|
@@ -103,11 +103,15 @@ export function AppShell() {
|
|
|
103
103
|
extensions,
|
|
104
104
|
host,
|
|
105
105
|
});
|
|
106
|
-
// As a messenger's: the messages of people unseen on the title of the tab and on the icon of Ta Desktop
|
|
106
|
+
// As a messenger's: the messages of people unseen on the title of the tab and on the icon of Ta Desktop, and beside
|
|
107
|
+
// them what waits for the user (TabTitleUtil).
|
|
108
|
+
const tabTasks = useTasks();
|
|
109
|
+
const { tabTitle, tabCounts } = chatSettings;
|
|
107
110
|
React.useEffect(() => {
|
|
108
|
-
|
|
111
|
+
const counts = tabCounts ? TabTitleUtil.counts(tabTasks) : { todo: 0, urgent: 0 };
|
|
112
|
+
document.title = TabTitleUtil.text({ name: tabTitle, unseen: chatsCount, ...counts }, t);
|
|
109
113
|
AppBadge.set(chatsCount);
|
|
110
|
-
}, [chatsCount]);
|
|
114
|
+
}, [chatsCount, tabTasks, tabTitle, tabCounts, t]);
|
|
111
115
|
if (workbench.status === 'signed-out') {
|
|
112
116
|
return workbench.leaving ? React.createElement("div", { className: "ta-signin" }) : React.createElement(SignIn, { error: workbench.error });
|
|
113
117
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChatEmojiUtil } from '../util/chat-emoji.js';
|
|
3
|
+
/**
|
|
4
|
+
* The faces of a chat, as WeChat's (ChatEmojiUtil says them and cuts them out of a text): one drawn from the sheet of
|
|
5
|
+
* the panel (`public/emoji/wechat-v1.webp`), and words with the faces said in them drawn as their pictures.
|
|
6
|
+
*/
|
|
7
|
+
export { ChatEmojiUtil };
|
|
8
|
+
/** The name of a face in the language of the page. */
|
|
9
|
+
export declare function useFaceName(): (index: number) => string;
|
|
10
|
+
/** The picture of the sheet, from the page that shows it (a path there, whatever the page is served under). */
|
|
11
|
+
export declare function sheet(): string;
|
|
12
|
+
/** One face, the size of the text around it unless its class says otherwise. */
|
|
13
|
+
export declare function ChatFace({ index, className }: {
|
|
14
|
+
index: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
/** Words with the faces said in them (`[微笑]`) drawn as the faces; the words alone as they are. In a span with `className`. */
|
|
18
|
+
export declare function EmojiText({ text, className }: {
|
|
19
|
+
text: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): string | React.JSX.Element[] | React.JSX.Element;
|
|
22
|
+
/** The label of an entry of a menu: a face alone (`[强]`) as the face with its name beside it, as WeChat's; other words with their faces drawn. */
|
|
23
|
+
export declare function MenuLabel({ text }: {
|
|
24
|
+
text: string;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* The faces of a field drawn as they are sent, as WeChat's box shows them: over a textarea whose text is the faces as
|
|
28
|
+
* one character each (ChatEmojiUtil.glyphs, as wide as a face in the font `Ta Faces`) and is itself see-through
|
|
29
|
+
* (`.ta-faced`), the same words in the same place with each face's picture on its character. The field keeps its
|
|
30
|
+
* caret, its selection, its typing and its scrolling; this only draws.
|
|
31
|
+
*/
|
|
32
|
+
export declare function FaceField({ field, text }: {
|
|
33
|
+
field: React.RefObject<HTMLTextAreaElement | null>;
|
|
34
|
+
text: string;
|
|
35
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useLanguage } from '../i18n/use-t.js';
|
|
3
|
+
import { ChatEmojiUtil } from '../util/chat-emoji.js';
|
|
4
|
+
/**
|
|
5
|
+
* The faces of a chat, as WeChat's (ChatEmojiUtil says them and cuts them out of a text): one drawn from the sheet of
|
|
6
|
+
* the panel (`public/emoji/wechat-v1.webp`), and words with the faces said in them drawn as their pictures.
|
|
7
|
+
*/
|
|
8
|
+
export { ChatEmojiUtil };
|
|
9
|
+
/** The name of a face in the language of the page. */
|
|
10
|
+
export function useFaceName() {
|
|
11
|
+
const language = useLanguage();
|
|
12
|
+
const chinese = language.startsWith('zh');
|
|
13
|
+
return React.useCallback((index) => ChatEmojiUtil.FACES[index][chinese ? 0 : 1], [chinese]);
|
|
14
|
+
}
|
|
15
|
+
let sheetUrl;
|
|
16
|
+
/** The picture of the sheet, from the page that shows it (a path there, whatever the page is served under). */
|
|
17
|
+
export function sheet() {
|
|
18
|
+
sheetUrl !== null && sheetUrl !== void 0 ? sheetUrl : (sheetUrl = new URL(ChatEmojiUtil.SHEET, document.baseURI).href);
|
|
19
|
+
return sheetUrl;
|
|
20
|
+
}
|
|
21
|
+
/** One face, the size of the text around it unless its class says otherwise. */
|
|
22
|
+
export function ChatFace({ index, className }) {
|
|
23
|
+
const name = useFaceName()(index);
|
|
24
|
+
return (React.createElement("span", { className: className ? `ta-face-emoji ${className}` : 'ta-face-emoji', role: "img", "aria-label": name, title: name, style: {
|
|
25
|
+
backgroundImage: `url("${sheet()}")`,
|
|
26
|
+
backgroundSize: ChatEmojiUtil.SIZE,
|
|
27
|
+
backgroundPosition: ChatEmojiUtil.position(index),
|
|
28
|
+
} }));
|
|
29
|
+
}
|
|
30
|
+
/** Words with the faces said in them (`[微笑]`) drawn as the faces; the words alone as they are. In a span with `className`. */
|
|
31
|
+
export function EmojiText({ text, className }) {
|
|
32
|
+
const parts = ChatEmojiUtil.has(text)
|
|
33
|
+
? ChatEmojiUtil.split(text).map((part, index) => typeof part === 'number' ? React.createElement(ChatFace, { key: index, index: part }) : React.createElement(React.Fragment, { key: index }, part))
|
|
34
|
+
: text;
|
|
35
|
+
return className === undefined ? parts : React.createElement("span", { className: className }, parts);
|
|
36
|
+
}
|
|
37
|
+
/** The label of an entry of a menu: a face alone (`[强]`) as the face with its name beside it, as WeChat's; other words with their faces drawn. */
|
|
38
|
+
export function MenuLabel({ text }) {
|
|
39
|
+
const name = useFaceName();
|
|
40
|
+
const face = ChatEmojiUtil.faceOf(text);
|
|
41
|
+
if (face === undefined) {
|
|
42
|
+
return React.createElement(EmojiText, { text: text });
|
|
43
|
+
}
|
|
44
|
+
return (React.createElement(React.Fragment, null,
|
|
45
|
+
React.createElement(ChatFace, { index: face, className: "ta-face-menu" }),
|
|
46
|
+
name(face)));
|
|
47
|
+
}
|
|
48
|
+
/** What of a field FaceField copies, for its words to fall where the field's do. */
|
|
49
|
+
const FIELD_STYLE = [
|
|
50
|
+
'fontFamily',
|
|
51
|
+
'fontSize',
|
|
52
|
+
'fontWeight',
|
|
53
|
+
'fontStyle',
|
|
54
|
+
'lineHeight',
|
|
55
|
+
'letterSpacing',
|
|
56
|
+
'wordSpacing',
|
|
57
|
+
'tabSize',
|
|
58
|
+
'textIndent',
|
|
59
|
+
'textAlign',
|
|
60
|
+
'whiteSpace',
|
|
61
|
+
'wordBreak',
|
|
62
|
+
'overflowWrap',
|
|
63
|
+
'paddingTop',
|
|
64
|
+
'paddingRight',
|
|
65
|
+
'paddingBottom',
|
|
66
|
+
'paddingLeft',
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* The faces of a field drawn as they are sent, as WeChat's box shows them: over a textarea whose text is the faces as
|
|
70
|
+
* one character each (ChatEmojiUtil.glyphs, as wide as a face in the font `Ta Faces`) and is itself see-through
|
|
71
|
+
* (`.ta-faced`), the same words in the same place with each face's picture on its character. The field keeps its
|
|
72
|
+
* caret, its selection, its typing and its scrolling; this only draws.
|
|
73
|
+
*/
|
|
74
|
+
export function FaceField({ field, text }) {
|
|
75
|
+
const own = React.useRef(null);
|
|
76
|
+
React.useLayoutEffect(() => {
|
|
77
|
+
const element = field.current;
|
|
78
|
+
const mirror = own.current;
|
|
79
|
+
const parent = mirror === null || mirror === void 0 ? void 0 : mirror.offsetParent;
|
|
80
|
+
if (!element || !mirror || !parent) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const place = () => {
|
|
84
|
+
const style = getComputedStyle(element);
|
|
85
|
+
for (const key of FIELD_STYLE) {
|
|
86
|
+
mirror.style[key] = style[key];
|
|
87
|
+
}
|
|
88
|
+
const at = element.getBoundingClientRect();
|
|
89
|
+
const base = parent.getBoundingClientRect();
|
|
90
|
+
mirror.style.left = `${at.left - base.left - parent.clientLeft + element.clientLeft}px`;
|
|
91
|
+
mirror.style.top = `${at.top - base.top - parent.clientTop + element.clientTop}px`;
|
|
92
|
+
mirror.style.width = `${element.clientWidth}px`;
|
|
93
|
+
mirror.style.height = `${element.clientHeight}px`;
|
|
94
|
+
mirror.scrollTop = element.scrollTop;
|
|
95
|
+
};
|
|
96
|
+
place();
|
|
97
|
+
const scrolled = () => {
|
|
98
|
+
mirror.scrollTop = element.scrollTop;
|
|
99
|
+
};
|
|
100
|
+
element.addEventListener('scroll', scrolled, { passive: true });
|
|
101
|
+
const resized = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);
|
|
102
|
+
resized === null || resized === void 0 ? void 0 : resized.observe(element);
|
|
103
|
+
return () => {
|
|
104
|
+
element.removeEventListener('scroll', scrolled);
|
|
105
|
+
resized === null || resized === void 0 ? void 0 : resized.disconnect();
|
|
106
|
+
};
|
|
107
|
+
// Where the field is: placed there, and again as it moves or grows. Its words the mirror draws by itself.
|
|
108
|
+
}, [field]);
|
|
109
|
+
const parts = [];
|
|
110
|
+
let words = '';
|
|
111
|
+
for (const character of text) {
|
|
112
|
+
const face = ChatEmojiUtil.glyphFace(character);
|
|
113
|
+
if (face === undefined) {
|
|
114
|
+
words += character;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (words) {
|
|
118
|
+
parts.push(words);
|
|
119
|
+
words = '';
|
|
120
|
+
}
|
|
121
|
+
parts.push(React.createElement("span", { key: parts.length, className: "ta-face-glyph" },
|
|
122
|
+
React.createElement("span", { className: "ta-face-emoji", style: { backgroundImage: `url("${sheet()}")`, backgroundSize: ChatEmojiUtil.SIZE, backgroundPosition: ChatEmojiUtil.position(face) } }),
|
|
123
|
+
character));
|
|
124
|
+
}
|
|
125
|
+
// A last line left empty still takes its height, as in the field.
|
|
126
|
+
parts.push(`${words}${words.endsWith('\n') ? '\u200b' : ''}`);
|
|
127
|
+
return (React.createElement("div", { ref: own, className: "ta-face-field", "aria-hidden": "true" }, parts));
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=chat-emoji.js.map
|