@celljs/ta-web 4.48.0 → 4.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/account/account-side.js +4 -0
- package/esm/browser/account/device-account.d.ts +6 -0
- package/esm/browser/account/device-account.js +20 -5
- package/esm/browser/assistant/assistant-view.js +2 -0
- package/esm/browser/assistant/call-announcing.d.ts +25 -0
- package/esm/browser/assistant/call-announcing.js +32 -0
- package/esm/browser/assistant/call-answering.d.ts +43 -0
- package/esm/browser/assistant/call-answering.js +63 -0
- package/esm/browser/assistant/call-hearing.d.ts +53 -0
- package/esm/browser/assistant/call-hearing.js +98 -0
- package/esm/browser/assistant/call-pausing.d.ts +40 -0
- package/esm/browser/assistant/call-pausing.js +82 -0
- package/esm/browser/assistant/call-reading.d.ts +32 -0
- package/esm/browser/assistant/call-reading.js +35 -0
- package/esm/browser/assistant/call-revoicing.d.ts +33 -0
- package/esm/browser/assistant/call-revoicing.js +68 -0
- package/esm/browser/assistant/call-turns.d.ts +29 -0
- package/esm/browser/assistant/call-turns.js +33 -0
- package/esm/browser/assistant/spoken-answer.d.ts +21 -0
- package/esm/browser/assistant/spoken-answer.js +69 -0
- package/esm/browser/assistant/spoken-call.d.ts +7 -0
- package/esm/browser/assistant/spoken-call.js +16 -0
- package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/esm/browser/assistant/voice-call.d.ts +47 -43
- package/esm/browser/assistant/voice-call.js +193 -219
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/components/account-recovery-view.d.ts +11 -0
- package/esm/browser/components/account-recovery-view.js +81 -0
- package/esm/browser/components/account-view.d.ts +1 -2
- package/esm/browser/components/account-view.js +10 -1
- package/esm/browser/components/app-nav.js +19 -8
- package/esm/browser/components/app-shell-hooks.d.ts +5 -0
- package/esm/browser/components/app-shell-hooks.js +45 -0
- package/esm/browser/components/app-shell-state.js +2 -1
- package/esm/browser/components/app-view.js +9 -5
- package/esm/browser/components/chat-emoji.d.ts +35 -0
- package/esm/browser/components/chat-emoji.js +129 -0
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +6 -0
- package/esm/browser/components/composer-attachments.js +12 -1
- package/esm/browser/components/composer-box-protocol.d.ts +15 -0
- package/esm/browser/components/composer-box.js +110 -87
- package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
- package/esm/browser/components/composer-drop-hooks.js +36 -0
- package/esm/browser/components/composer-emoji.js +1 -1
- package/esm/browser/components/composer-faces.d.ts +16 -0
- package/esm/browser/components/composer-faces.js +37 -0
- package/esm/browser/components/composer-media.d.ts +10 -0
- package/esm/browser/components/composer-media.js +12 -1
- package/esm/browser/components/composer-target.d.ts +4 -0
- package/esm/browser/components/composer-target.js +18 -7
- package/esm/browser/components/composer-type-focus.d.ts +24 -0
- package/esm/browser/components/composer-type-focus.js +17 -0
- package/esm/browser/components/composer-voice.d.ts +24 -0
- package/esm/browser/components/composer-voice.js +37 -0
- package/esm/browser/components/composer.d.ts +2 -2
- package/esm/browser/components/composer.js +39 -8
- package/esm/browser/components/context-menu.js +2 -1
- package/esm/browser/components/emoji-panel.d.ts +11 -7
- package/esm/browser/components/emoji-panel.js +40 -22
- package/esm/browser/components/extension-settings.js +2 -2
- package/esm/browser/components/folder-new.d.ts +18 -0
- package/esm/browser/components/folder-new.js +53 -0
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +18 -6
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-menu.d.ts +8 -3
- package/esm/browser/components/image-menu.js +34 -9
- package/esm/browser/components/markdown.js +9 -2
- package/esm/browser/components/media.js +3 -2
- package/esm/browser/components/message-list.js +2 -2
- package/esm/browser/components/message-steps.js +20 -11
- package/esm/browser/components/message-user.js +2 -2
- package/esm/browser/components/moved-notice.js +2 -1
- package/esm/browser/components/nav-places.d.ts +2 -0
- package/esm/browser/components/nav-places.js +4 -2
- package/esm/browser/components/phone-shell.d.ts +2 -0
- package/esm/browser/components/phone-shell.js +5 -1
- package/esm/browser/components/secret-text.d.ts +1 -1
- package/esm/browser/components/secret-text.js +4 -3
- package/esm/browser/components/session-view.js +3 -0
- package/esm/browser/components/settings-choices.d.ts +2 -1
- package/esm/browser/components/settings-choices.js +13 -5
- package/esm/browser/components/settings-more.js +3 -3
- package/esm/browser/components/settings-parts.js +13 -2
- package/esm/browser/components/share-item-sheet.js +7 -1
- package/esm/browser/components/tab-title.d.ts +27 -0
- package/esm/browser/components/tab-title.js +35 -0
- package/esm/browser/components/use-composer-attachments.d.ts +28 -0
- package/esm/browser/components/use-composer-attachments.js +65 -0
- package/esm/browser/components/use-composer-files.d.ts +25 -0
- package/esm/browser/components/use-composer-files.js +52 -0
- package/esm/browser/components/web-composer.d.ts +3 -1
- package/esm/browser/components/web-composer.js +3 -2
- package/esm/browser/components/workbench-view.js +1 -0
- package/esm/browser/components/working-directory.js +2 -1
- package/esm/browser/device/drag-move.d.ts +21 -0
- package/esm/browser/device/drag-move.js +86 -0
- package/esm/browser/extension/icons.js +7 -1
- package/esm/browser/extension/web-api-desktop.d.ts +19 -0
- package/esm/browser/extension/web-api-menus.d.ts +19 -0
- package/esm/browser/extension/web-api-spec.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +24 -23
- package/esm/browser/extension/web-extension-context.d.ts +1 -0
- package/esm/browser/extension/web-extension-context.js +12 -5
- package/esm/browser/extension/web-extension-run.js +1 -0
- package/esm/browser/extension/web-share-ui.d.ts +1 -1
- package/esm/browser/extension/web-share-ui.js +2 -0
- package/esm/browser/extension/web-share.d.ts +13 -0
- package/esm/browser/extension/web-share.js +37 -2
- package/esm/browser/i18n/en/account.d.ts +18 -0
- package/esm/browser/i18n/en/account.js +18 -0
- package/esm/browser/i18n/en/call.js +1 -1
- package/esm/browser/i18n/en/chat.d.ts +15 -0
- package/esm/browser/i18n/en/chat.js +16 -1
- package/esm/browser/i18n/en/common.d.ts +2 -0
- package/esm/browser/i18n/en/common.js +2 -0
- package/esm/browser/i18n/en/discover.d.ts +2 -0
- package/esm/browser/i18n/en/discover.js +2 -0
- package/esm/browser/i18n/en/settings.d.ts +17 -0
- package/esm/browser/i18n/en/settings.js +17 -0
- package/esm/browser/i18n/ja/account.js +18 -0
- package/esm/browser/i18n/ja/call.js +1 -1
- package/esm/browser/i18n/ja/chat.js +16 -1
- package/esm/browser/i18n/ja/common.js +2 -0
- package/esm/browser/i18n/ja/discover.js +3 -1
- package/esm/browser/i18n/ja/settings.js +17 -0
- package/esm/browser/i18n/locales.d.ts +55 -1
- package/esm/browser/i18n/messages.d.ts +54 -0
- package/esm/browser/i18n/zh/account.js +18 -0
- package/esm/browser/i18n/zh/call.js +1 -1
- package/esm/browser/i18n/zh/chat.js +16 -1
- package/esm/browser/i18n/zh/common.js +2 -0
- package/esm/browser/i18n/zh/discover.js +3 -1
- package/esm/browser/i18n/zh/settings.js +17 -0
- package/esm/browser/i18n/zh-tw/account.js +18 -0
- package/esm/browser/i18n/zh-tw/call.js +1 -1
- package/esm/browser/i18n/zh-tw/chat.js +16 -1
- package/esm/browser/i18n/zh-tw/common.js +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +3 -1
- package/esm/browser/i18n/zh-tw/settings.js +17 -0
- package/esm/browser/offline/kept-chats.d.ts +3 -1
- package/esm/browser/offline/kept-chats.js +1 -1
- package/esm/browser/partners/group-picker.d.ts +3 -2
- package/esm/browser/partners/group-picker.js +8 -3
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-docs.js +5 -2
- package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
- package/esm/browser/sandbox/work/work-frame.js +9 -3
- package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
- package/esm/browser/sandbox/work/work-gates.js +182 -0
- package/esm/browser/settings/agent-settings.js +1 -1
- package/esm/browser/settings/navigation.d.ts +38 -10
- package/esm/browser/settings/navigation.js +73 -17
- package/esm/browser/settings/settings-protocol.d.ts +16 -1
- package/esm/browser/settings/settings-protocol.js +20 -2
- package/esm/browser/settings/settings.js +4 -1
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +15 -2
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +6 -3
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +28 -8
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +5 -0
- package/esm/browser/style/device.js +5 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +3 -3
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +13 -6
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +4 -2
- package/esm/browser/util/chat-emoji.d.ts +44 -0
- package/esm/browser/util/chat-emoji.js +269 -0
- package/esm/browser/util/composer-drop.d.ts +26 -0
- package/esm/browser/util/composer-drop.js +40 -0
- package/esm/browser/util/composer-files.d.ts +48 -0
- package/esm/browser/util/composer-files.js +99 -0
- package/esm/browser/util/composer.d.ts +13 -1
- package/esm/browser/util/composer.js +24 -6
- package/esm/browser/util/markdown.d.ts +5 -0
- package/esm/browser/util/markdown.js +18 -0
- package/esm/browser/util/message.d.ts +6 -1
- package/esm/browser/util/message.js +13 -2
- package/esm/browser/util/process.d.ts +10 -13
- package/esm/browser/util/process.js +31 -83
- package/esm/browser/util/turn-join.d.ts +38 -0
- package/esm/browser/util/turn-join.js +119 -0
- package/esm/browser/workbench-services.js +1 -1
- package/lib/browser/account/account-side.js +4 -0
- package/lib/browser/account/device-account.d.ts +6 -0
- package/lib/browser/account/device-account.js +20 -5
- package/lib/browser/assistant/assistant-view.js +2 -0
- package/lib/browser/assistant/call-announcing.d.ts +26 -0
- package/lib/browser/assistant/call-announcing.js +36 -0
- package/lib/browser/assistant/call-answering.d.ts +44 -0
- package/lib/browser/assistant/call-answering.js +67 -0
- package/lib/browser/assistant/call-hearing.d.ts +54 -0
- package/lib/browser/assistant/call-hearing.js +102 -0
- package/lib/browser/assistant/call-pausing.d.ts +41 -0
- package/lib/browser/assistant/call-pausing.js +86 -0
- package/lib/browser/assistant/call-reading.d.ts +33 -0
- package/lib/browser/assistant/call-reading.js +39 -0
- package/lib/browser/assistant/call-revoicing.d.ts +34 -0
- package/lib/browser/assistant/call-revoicing.js +72 -0
- package/lib/browser/assistant/call-turns.d.ts +30 -0
- package/lib/browser/assistant/call-turns.js +37 -0
- package/lib/browser/assistant/spoken-answer.d.ts +22 -0
- package/lib/browser/assistant/spoken-answer.js +73 -0
- package/lib/browser/assistant/spoken-call.d.ts +8 -0
- package/lib/browser/assistant/spoken-call.js +19 -0
- package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/lib/browser/assistant/voice-call.d.ts +47 -43
- package/lib/browser/assistant/voice-call.js +192 -218
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/components/account-recovery-view.d.ts +12 -0
- package/lib/browser/components/account-recovery-view.js +117 -0
- package/lib/browser/components/account-view.d.ts +1 -2
- package/lib/browser/components/account-view.js +10 -1
- package/lib/browser/components/app-nav.js +19 -8
- package/lib/browser/components/app-shell-hooks.d.ts +5 -0
- package/lib/browser/components/app-shell-hooks.js +46 -0
- package/lib/browser/components/app-shell-state.js +1 -0
- package/lib/browser/components/app-view.js +8 -4
- package/lib/browser/components/chat-emoji.d.ts +36 -0
- package/lib/browser/components/chat-emoji.js +167 -0
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +6 -0
- package/lib/browser/components/composer-attachments.js +12 -0
- package/lib/browser/components/composer-box-protocol.d.ts +15 -0
- package/lib/browser/components/composer-box.js +107 -84
- package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
- package/lib/browser/components/composer-drop-hooks.js +72 -0
- package/lib/browser/components/composer-emoji.js +1 -1
- package/lib/browser/components/composer-faces.d.ts +17 -0
- package/lib/browser/components/composer-faces.js +73 -0
- package/lib/browser/components/composer-media.d.ts +10 -0
- package/lib/browser/components/composer-media.js +13 -0
- package/lib/browser/components/composer-target.d.ts +4 -0
- package/lib/browser/components/composer-target.js +18 -7
- package/lib/browser/components/composer-type-focus.d.ts +25 -0
- package/lib/browser/components/composer-type-focus.js +20 -0
- package/lib/browser/components/composer-voice.d.ts +25 -0
- package/lib/browser/components/composer-voice.js +73 -0
- package/lib/browser/components/composer.d.ts +2 -2
- package/lib/browser/components/composer.js +38 -7
- package/lib/browser/components/context-menu.js +2 -1
- package/lib/browser/components/emoji-panel.d.ts +11 -7
- package/lib/browser/components/emoji-panel.js +40 -22
- package/lib/browser/components/extension-settings.js +1 -1
- package/lib/browser/components/folder-new.d.ts +19 -0
- package/lib/browser/components/folder-new.js +90 -0
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +17 -5
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-menu.d.ts +8 -3
- package/lib/browser/components/image-menu.js +34 -9
- package/lib/browser/components/markdown.js +9 -2
- package/lib/browser/components/media.js +3 -2
- package/lib/browser/components/message-list.js +2 -2
- package/lib/browser/components/message-steps.js +20 -11
- package/lib/browser/components/message-user.js +1 -1
- package/lib/browser/components/moved-notice.js +2 -1
- package/lib/browser/components/nav-places.d.ts +2 -0
- package/lib/browser/components/nav-places.js +4 -2
- package/lib/browser/components/phone-shell.d.ts +2 -0
- package/lib/browser/components/phone-shell.js +5 -1
- package/lib/browser/components/secret-text.d.ts +1 -1
- package/lib/browser/components/secret-text.js +4 -3
- package/lib/browser/components/session-view.js +3 -0
- package/lib/browser/components/settings-choices.d.ts +2 -1
- package/lib/browser/components/settings-choices.js +12 -4
- package/lib/browser/components/settings-more.js +2 -2
- package/lib/browser/components/settings-parts.js +11 -0
- package/lib/browser/components/share-item-sheet.js +7 -1
- package/lib/browser/components/tab-title.d.ts +28 -0
- package/lib/browser/components/tab-title.js +38 -0
- package/lib/browser/components/use-composer-attachments.d.ts +29 -0
- package/lib/browser/components/use-composer-attachments.js +101 -0
- package/lib/browser/components/use-composer-files.d.ts +26 -0
- package/lib/browser/components/use-composer-files.js +88 -0
- package/lib/browser/components/web-composer.d.ts +3 -1
- package/lib/browser/components/web-composer.js +3 -2
- package/lib/browser/components/workbench-view.js +1 -0
- package/lib/browser/components/working-directory.js +2 -1
- package/lib/browser/device/drag-move.d.ts +22 -0
- package/lib/browser/device/drag-move.js +122 -0
- package/lib/browser/extension/icons.js +6 -0
- package/lib/browser/extension/web-api-desktop.d.ts +19 -0
- package/lib/browser/extension/web-api-menus.d.ts +19 -0
- package/lib/browser/extension/web-api-spec.js +2 -0
- package/lib/browser/extension/web-extension-api.d.ts +24 -23
- package/lib/browser/extension/web-extension-context.d.ts +1 -0
- package/lib/browser/extension/web-extension-context.js +12 -5
- package/lib/browser/extension/web-extension-run.js +1 -0
- package/lib/browser/extension/web-share-ui.d.ts +1 -1
- package/lib/browser/extension/web-share-ui.js +2 -0
- package/lib/browser/extension/web-share.d.ts +13 -0
- package/lib/browser/extension/web-share.js +37 -2
- package/lib/browser/i18n/en/account.d.ts +18 -0
- package/lib/browser/i18n/en/account.js +18 -0
- package/lib/browser/i18n/en/call.js +1 -1
- package/lib/browser/i18n/en/chat.d.ts +15 -0
- package/lib/browser/i18n/en/chat.js +16 -1
- package/lib/browser/i18n/en/common.d.ts +2 -0
- package/lib/browser/i18n/en/common.js +2 -0
- package/lib/browser/i18n/en/discover.d.ts +2 -0
- package/lib/browser/i18n/en/discover.js +2 -0
- package/lib/browser/i18n/en/settings.d.ts +17 -0
- package/lib/browser/i18n/en/settings.js +17 -0
- package/lib/browser/i18n/ja/account.js +18 -0
- package/lib/browser/i18n/ja/call.js +1 -1
- package/lib/browser/i18n/ja/chat.js +16 -1
- package/lib/browser/i18n/ja/common.js +2 -0
- package/lib/browser/i18n/ja/discover.js +3 -1
- package/lib/browser/i18n/ja/settings.js +17 -0
- package/lib/browser/i18n/locales.d.ts +55 -1
- package/lib/browser/i18n/messages.d.ts +54 -0
- package/lib/browser/i18n/zh/account.js +18 -0
- package/lib/browser/i18n/zh/call.js +1 -1
- package/lib/browser/i18n/zh/chat.js +16 -1
- package/lib/browser/i18n/zh/common.js +2 -0
- package/lib/browser/i18n/zh/discover.js +3 -1
- package/lib/browser/i18n/zh/settings.js +17 -0
- package/lib/browser/i18n/zh-tw/account.js +18 -0
- package/lib/browser/i18n/zh-tw/call.js +1 -1
- package/lib/browser/i18n/zh-tw/chat.js +16 -1
- package/lib/browser/i18n/zh-tw/common.js +2 -0
- package/lib/browser/i18n/zh-tw/discover.js +3 -1
- package/lib/browser/i18n/zh-tw/settings.js +17 -0
- package/lib/browser/offline/kept-chats.d.ts +3 -1
- package/lib/browser/offline/kept-chats.js +1 -1
- package/lib/browser/partners/group-picker.d.ts +3 -2
- package/lib/browser/partners/group-picker.js +8 -3
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-docs.js +5 -2
- package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
- package/lib/browser/sandbox/work/work-frame.js +9 -3
- package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
- package/lib/browser/sandbox/work/work-gates.js +185 -0
- package/lib/browser/settings/agent-settings.js +1 -1
- package/lib/browser/settings/navigation.d.ts +38 -10
- package/lib/browser/settings/navigation.js +74 -18
- package/lib/browser/settings/settings-protocol.d.ts +16 -1
- package/lib/browser/settings/settings-protocol.js +21 -3
- package/lib/browser/settings/settings.js +3 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +15 -2
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +6 -3
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +28 -8
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +5 -0
- package/lib/browser/style/device.js +5 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +3 -3
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +13 -6
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +4 -2
- package/lib/browser/util/chat-emoji.d.ts +45 -0
- package/lib/browser/util/chat-emoji.js +272 -0
- package/lib/browser/util/composer-drop.d.ts +27 -0
- package/lib/browser/util/composer-drop.js +43 -0
- package/lib/browser/util/composer-files.d.ts +49 -0
- package/lib/browser/util/composer-files.js +102 -0
- package/lib/browser/util/composer.d.ts +13 -1
- package/lib/browser/util/composer.js +24 -6
- package/lib/browser/util/markdown.d.ts +5 -0
- package/lib/browser/util/markdown.js +18 -0
- package/lib/browser/util/message.d.ts +6 -1
- package/lib/browser/util/message.js +13 -2
- package/lib/browser/util/process.d.ts +10 -13
- package/lib/browser/util/process.js +32 -84
- package/lib/browser/util/turn-join.d.ts +39 -0
- package/lib/browser/util/turn-join.js +122 -0
- package/lib/browser/workbench-services.js +1 -1
- package/package.json +7 -7
- package/public/emoji/wechat-v1.webp +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
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.RecoveryPart = RecoveryPart;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const console_util_1 = require("../gateway/console-util");
|
|
39
|
+
const hooks_1 = require("../hooks");
|
|
40
|
+
const use_t_1 = require("../i18n/use-t");
|
|
41
|
+
const busy_1 = require("./busy");
|
|
42
|
+
/**
|
|
43
|
+
* The recovery code of the account (docs/design/ta-account.md 10): made here and written down, or made on another
|
|
44
|
+
* computer, or given on a new one to bring the friends and group chats back. A computer's alone: the app has none.
|
|
45
|
+
*/
|
|
46
|
+
function RecoveryPart({ info, act }) {
|
|
47
|
+
var _a;
|
|
48
|
+
const t = (0, use_t_1.useT)();
|
|
49
|
+
const language = (0, use_t_1.useLanguage)();
|
|
50
|
+
const [, notices] = (0, hooks_1.useNotices)();
|
|
51
|
+
const [busy, run] = (0, busy_1.useBusy)();
|
|
52
|
+
const [entering, setEntering] = React.useState(false);
|
|
53
|
+
const [code, setCode] = React.useState('');
|
|
54
|
+
const recovery = info.recovery;
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (info.recovered) {
|
|
57
|
+
notices.notify(t('ta.recovery.restored', { friends: info.recovered.friends, rooms: info.recovered.rooms }), { level: 'success' });
|
|
58
|
+
}
|
|
59
|
+
}, [info.recovered, notices, t]);
|
|
60
|
+
const make = async () => {
|
|
61
|
+
await act(one => (one.makeRecovery ? one.makeRecovery() : Promise.resolve(info))).catch((error) => notices.error(error));
|
|
62
|
+
};
|
|
63
|
+
const saved = async () => {
|
|
64
|
+
await act(one => (one.recoverySaved ? one.recoverySaved() : Promise.resolve(info))).catch((error) => notices.error(error));
|
|
65
|
+
};
|
|
66
|
+
const drop = async () => {
|
|
67
|
+
if (!(await notices.confirm({ title: t('ta.recovery.dropConfirm'), confirmLabel: t('ta.recovery.drop'), danger: true }))) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await act(one => (one.dropRecovery ? one.dropRecovery() : Promise.resolve(info))).catch((error) => notices.error(error));
|
|
71
|
+
};
|
|
72
|
+
const restore = async () => {
|
|
73
|
+
try {
|
|
74
|
+
await act(one => (one.recover ? one.recover(code) : Promise.resolve(info)));
|
|
75
|
+
setEntering(false);
|
|
76
|
+
setCode('');
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
notices.error(error);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
if (entering) {
|
|
83
|
+
return (React.createElement("section", { className: "ta-account-recovery" },
|
|
84
|
+
React.createElement("h2", null, t('ta.recovery.code')),
|
|
85
|
+
React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.hint')),
|
|
86
|
+
React.createElement("form", { className: "ta-host-form", onSubmit: event => {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
void run(restore);
|
|
89
|
+
} },
|
|
90
|
+
React.createElement("label", { className: "ta-field" },
|
|
91
|
+
React.createElement("input", { autoFocus: true, autoComplete: "off", spellCheck: false, "aria-label": t('ta.recovery.code'), placeholder: t('ta.recovery.placeholder'), value: code, onChange: event => setCode(event.target.value) }))),
|
|
92
|
+
React.createElement("div", { className: "ta-host-actions" },
|
|
93
|
+
React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy || !code.trim(), onClick: () => void run(restore) },
|
|
94
|
+
React.createElement(busy_1.BusyMark, { busy: busy }),
|
|
95
|
+
t('ta.recovery.restoreNow')),
|
|
96
|
+
React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => setEntering(false) }, t('ta.cancel')))));
|
|
97
|
+
}
|
|
98
|
+
if (info.waiting) {
|
|
99
|
+
// A new computer waiting to be let in: the recovery code lets it in, with no other device at hand.
|
|
100
|
+
return (React.createElement("div", { className: "ta-host-actions" },
|
|
101
|
+
React.createElement("button", { type: "button", className: "ta-button", onClick: () => setEntering(true) }, t('ta.recovery.restore'))));
|
|
102
|
+
}
|
|
103
|
+
return (React.createElement("section", { className: "ta-account-recovery" },
|
|
104
|
+
React.createElement("h2", null, t('ta.recovery.title')),
|
|
105
|
+
(recovery === null || recovery === void 0 ? void 0 : recovery.code) ? (React.createElement(React.Fragment, null,
|
|
106
|
+
React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.show', { code: recovery.code })),
|
|
107
|
+
React.createElement("div", { className: "ta-host-actions" },
|
|
108
|
+
React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void run(saved) },
|
|
109
|
+
React.createElement(busy_1.BusyMark, { busy: busy }),
|
|
110
|
+
t('ta.recovery.saved'))))) : (recovery === null || recovery === void 0 ? void 0 : recovery.made) ? (React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.made', { time: console_util_1.ConsoleUtil.ago((_a = recovery.at) !== null && _a !== void 0 ? _a : Date.now(), language) }))) : (React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.none'))),
|
|
111
|
+
React.createElement("div", { className: "ta-host-actions" },
|
|
112
|
+
(recovery === null || recovery === void 0 ? void 0 : recovery.made) ? (React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => void run(drop) }, t('ta.recovery.drop'))) : (React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void run(make) },
|
|
113
|
+
React.createElement(busy_1.BusyMark, { busy: busy }),
|
|
114
|
+
t('ta.recovery.make'))),
|
|
115
|
+
React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => setEntering(true) }, t('ta.recovery.restore')))));
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=account-recovery-view.js.map
|
|
@@ -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';
|
|
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,5 +47,4 @@ 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 {};
|
|
51
50
|
//# sourceMappingURL=account-view.d.ts.map
|
|
@@ -54,6 +54,7 @@ const hooks_1 = require("../hooks");
|
|
|
54
54
|
const hosts_1 = require("../hosts");
|
|
55
55
|
const use_t_1 = require("../i18n/use-t");
|
|
56
56
|
const workbench_util_1 = require("../workbench-util");
|
|
57
|
+
const account_recovery_view_1 = require("./account-recovery-view");
|
|
57
58
|
const busy_1 = require("./busy");
|
|
58
59
|
const callout_1 = require("./callout");
|
|
59
60
|
const cloud_sign_in_view_1 = require("./cloud-sign-in-view");
|
|
@@ -112,6 +113,12 @@ function SignInPart({ info, act }) {
|
|
|
112
113
|
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' })));
|
|
113
114
|
};
|
|
114
115
|
const signing = info.signingIn;
|
|
116
|
+
if (signing === null || signing === void 0 ? void 0 : signing.waiting) {
|
|
117
|
+
// Signed in there, its code used: what is left is the admin's, and this device connects once they let it in.
|
|
118
|
+
return (React.createElement("div", { className: "ta-account-signing" },
|
|
119
|
+
React.createElement("p", null, t('ta.cloud.waiting', { account: signing.waiting })),
|
|
120
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => go(side => side.cancelSignIn()) }, t('ta.cancel'))));
|
|
121
|
+
}
|
|
115
122
|
if (signing) {
|
|
116
123
|
const name = providerName(info, signing.provider);
|
|
117
124
|
return (React.createElement("div", { className: "ta-account-signing" },
|
|
@@ -275,6 +282,7 @@ function DevicesDialog({ onClose }) {
|
|
|
275
282
|
React.createElement("span", { className: "ta-modal-title" }, t('ta.myDevices.title')),
|
|
276
283
|
React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.close'), onClick: onClose })),
|
|
277
284
|
(info === null || info === void 0 ? void 0 : info.waiting) && info.code ? React.createElement(WaitingPart, { code: info.code }) : null,
|
|
285
|
+
(info === null || info === void 0 ? void 0 : info.account) && (side === null || side === void 0 ? void 0 : side.makeRecovery) ? React.createElement(account_recovery_view_1.RecoveryPart, { info: info, act: act }) : null,
|
|
278
286
|
(info === null || info === void 0 ? void 0 : info.error) || failed ? React.createElement(callout_1.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,
|
|
279
287
|
React.createElement("ul", { className: "ta-host-list", hidden: adding === 'cloud' }, hosts.map(host => {
|
|
280
288
|
const device = ofAccount(host);
|
|
@@ -375,7 +383,8 @@ function AccountSignInDialog({ onClose }) {
|
|
|
375
383
|
info ? (React.createElement(React.Fragment, null,
|
|
376
384
|
!info.signingIn && !info.waiting && React.createElement("p", { className: "ta-account-hint" }, t('ta.myDevices.hint')),
|
|
377
385
|
through && !info.signingIn && !info.waiting && React.createElement(JoinThrough, { through: through, act: act }),
|
|
378
|
-
React.createElement(AccountWays, { info: info, act: act })
|
|
386
|
+
React.createElement(AccountWays, { info: info, act: act }),
|
|
387
|
+
info.account && info.waiting && (side === null || side === void 0 ? void 0 : side.makeRecovery) ? React.createElement(account_recovery_view_1.RecoveryPart, { info: info, act: act }) : null)) : (React.createElement(loading_1.Loading, { compact: true })))), document.body);
|
|
379
388
|
}
|
|
380
389
|
/**
|
|
381
390
|
* A device asks to join the account: whichever device of it the user has at hand says so, with the code to compare,
|
|
@@ -40,6 +40,7 @@ exports.PageView = PageView;
|
|
|
40
40
|
const lucide_react_1 = require("lucide-react");
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
42
|
const device_1 = require("../device/device");
|
|
43
|
+
const drag_move_1 = require("../device/drag-move");
|
|
43
44
|
const hold_1 = require("../device/hold");
|
|
44
45
|
const extension_view_1 = require("../extension/extension-view");
|
|
45
46
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
@@ -71,19 +72,22 @@ function useNavigation(views) {
|
|
|
71
72
|
// The pages a page lists (a game, on the Games page) are there, not in the navigation or under Discover.
|
|
72
73
|
const listed = React.useMemo(() => new Set(pages.filter(page => page.place === 'list').map(page => page.id)), [pages]);
|
|
73
74
|
const infos = React.useMemo(() => new Map(pages.map(page => [page.id, page])), [pages]);
|
|
75
|
+
const arranged = (0, nav_places_1.places)(views.filter(view => !listed.has(view.id)), setting, handheld, onOpen.length > 0);
|
|
74
76
|
return {
|
|
75
|
-
...
|
|
77
|
+
...arranged,
|
|
76
78
|
onOpen,
|
|
77
79
|
setting,
|
|
78
80
|
...(settings.allFeatures ? {} : { first: (id) => (0, nav_places_1.discoverFirst)(infos.get(id), Date.now()) }),
|
|
79
81
|
showAll: on => store.update({ allFeatures: on }),
|
|
80
|
-
pin: id => update(navigation_1.NavigationUtil.pin(setting, id)),
|
|
81
|
-
fold: id => update(navigation_1.NavigationUtil.fold(setting, id)),
|
|
82
|
+
pin: id => update(navigation_1.NavigationUtil.pin(setting, id, handheld)),
|
|
83
|
+
fold: id => update(navigation_1.NavigationUtil.fold(setting, id, handheld)),
|
|
84
|
+
// Among the pages the user sees in the navigation, those under Discover keeping their place in the list.
|
|
85
|
+
move: (page, before) => update(navigation_1.NavigationUtil.move(setting, page, before, arranged.nav.map(view => view.id))),
|
|
82
86
|
update,
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
|
-
function RailItem({ label, place, active, onClick, onContextMenu, onPointerDown, 'data-held': held, children }) {
|
|
86
|
-
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));
|
|
89
|
+
function RailItem({ label, place, page, dragged, active, onClick, onContextMenu, onPointerDown, 'data-held': held, children }) {
|
|
90
|
+
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));
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
|
|
@@ -95,12 +99,17 @@ function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, on
|
|
|
95
99
|
const [{ server }] = (0, hooks_1.useWorkbench)();
|
|
96
100
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
97
101
|
const held = (0, hold_1.useHeld)();
|
|
102
|
+
// A page dragged among the others (useDragMove): its place under the pointer, drawn as a line.
|
|
103
|
+
const drag = (0, drag_move_1.useDragMove)({ attr: 'data-nav-page', onMove: navigation.move });
|
|
104
|
+
// The line where the dragged page would land: before the one whose place it takes.
|
|
105
|
+
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" }); };
|
|
98
106
|
const settingsItem = { label: t('ta.nav.settings'), run: () => onSettings('navigation') };
|
|
99
107
|
/** A page of the rail: its menu puts it under Discover. */
|
|
100
108
|
const item = (view) => {
|
|
101
109
|
var _a;
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
var _b;
|
|
111
|
+
const Glyph = (_b = view.icon) !== null && _b !== void 0 ? _b : lucide_react_1.PanelTop;
|
|
112
|
+
return (React.createElement(RailItem, { key: view.id, label: web_extension_protocol_1.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]) },
|
|
104
113
|
React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
|
|
105
114
|
};
|
|
106
115
|
const discover = (0, nav_places_1.hasDiscover)(navigation) || current === nav_places_1.DISCOVER;
|
|
@@ -118,7 +127,9 @@ function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, on
|
|
|
118
127
|
entry.double &&
|
|
119
128
|
(count ? (React.createElement(asks_badge_1.PeopleBadge, { count: count, onDismiss: onSeeAll })) : asks ? (React.createElement(asks_badge_1.AsksBadge, { count: asks, onDismiss: onDismissAsks })) : (onSeeAll && React.createElement(unseen_drop_1.UnseenDrop, { label: t('ta.chat.unseen'), onDismiss: onSeeAll, className: "ta-tabbar-dot ta-rail-dot" })))))),
|
|
120
129
|
(navigation.nav.length > 0 || discover) && React.createElement("hr", { className: "ta-rail-divider" }),
|
|
121
|
-
navigation.nav.map(view =>
|
|
130
|
+
navigation.nav.map(view => (React.createElement(React.Fragment, { key: view.id },
|
|
131
|
+
drop(view, true),
|
|
132
|
+
item(view)))),
|
|
122
133
|
discover && (React.createElement(RailItem, { label: t('ta.discover'), place: "discover", active: !settingsShown && current === nav_places_1.DISCOVER, onClick: onDiscover, onContextMenu: event => openMenu(event, [settingsItem]) },
|
|
123
134
|
React.createElement(lucide_react_1.Compass, { size: 20, strokeWidth: 1.6 })))),
|
|
124
135
|
(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
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.CARDS_ID = exports.RAIL = exports.EDITOR = exports.SIDEBAR = exports.WORKBENCH_MAX = exports.SETTINGS_SHOWN = exports.TAB_PAGE = exports.SIDE = exports.LOGIN_LATER = exports.FIRST_SIDE = void 0;
|
|
37
37
|
exports.useRight = useRight;
|
|
38
38
|
exports.useKeys = useKeys;
|
|
39
|
+
exports.useTypeToFocus = useTypeToFocus;
|
|
39
40
|
exports.useTitlebarColor = useTitlebarColor;
|
|
40
41
|
exports.useRefresh = useRefresh;
|
|
41
42
|
exports.useDrawerSwipe = useDrawerSwipe;
|
|
@@ -48,6 +49,8 @@ const hooks_1 = require("../hooks");
|
|
|
48
49
|
const messages_1 = require("../i18n/messages");
|
|
49
50
|
const settings_1 = require("../settings/settings");
|
|
50
51
|
const state_protocol_1 = require("../state/state-protocol");
|
|
52
|
+
const composer_target_1 = require("./composer-target");
|
|
53
|
+
const composer_type_focus_1 = require("./composer-type-focus");
|
|
51
54
|
const editor_area_1 = require("./editor-area");
|
|
52
55
|
/**
|
|
53
56
|
* What the sidebar shows in this tab: `` for the chats, else the id of a sidebar view. Until the user picks
|
|
@@ -140,6 +143,49 @@ function useKeys(toggle, openSettings, toggleWorkbench, reopen) {
|
|
|
140
143
|
return () => window.removeEventListener('keydown', onKey);
|
|
141
144
|
}, [toggle, openSettings, toggleWorkbench, reopen]);
|
|
142
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Whether what has the focus keeps the keys pressed: a field, an editor, a terminal, or anything else focusable that
|
|
148
|
+
* listens to keys itself (a game of the workbench, a widget of an extension). Not the page itself, a button or a link
|
|
149
|
+
* pressed before, nor the conversation being read and scrolled.
|
|
150
|
+
*/
|
|
151
|
+
function ownsKeys(focused) {
|
|
152
|
+
if (!focused || focused === document.body || focused === document.documentElement) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
if (focused.matches('input, textarea, select, [role="textbox"], [contenteditable=""], [contenteditable="true"]')) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
return !focused.matches('button, a, summary, [role="button"], [role="tab"], [role="option"]') && !focused.closest('.ta-conversation');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A letter typed on the page, with nothing else taking it, goes into the message box in front (TypeFocus); not on a
|
|
162
|
+
* touch screen, whose keyboard comes up only with a field.
|
|
163
|
+
*/
|
|
164
|
+
function useTypeToFocus(active) {
|
|
165
|
+
React.useEffect(() => {
|
|
166
|
+
if (!active) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const onKey = (event) => {
|
|
170
|
+
const takes = composer_type_focus_1.TypeFocus.takes({
|
|
171
|
+
key: event.key,
|
|
172
|
+
ctrlKey: event.ctrlKey,
|
|
173
|
+
metaKey: event.metaKey,
|
|
174
|
+
altKey: event.altKey,
|
|
175
|
+
isComposing: event.isComposing,
|
|
176
|
+
defaultPrevented: event.defaultPrevented,
|
|
177
|
+
editable: ownsKeys(document.activeElement),
|
|
178
|
+
overlain: !!document.querySelector('[aria-modal="true"], [role="menu"], [role="dialog"]'),
|
|
179
|
+
shown: composer_target_1.ComposerTarget.present(),
|
|
180
|
+
});
|
|
181
|
+
if (takes && composer_target_1.ComposerTarget.type(event.key)) {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
window.addEventListener('keydown', onKey);
|
|
186
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
187
|
+
}, [active]);
|
|
188
|
+
}
|
|
143
189
|
/**
|
|
144
190
|
* The installed app with its title bar hidden draws the bar itself (see .ta-titlebar), but the browser
|
|
145
191
|
* paints the corners of the window's buttons with theme-color: the traffic lights at the left over the
|
|
@@ -467,6 +467,7 @@ function useAppShell() {
|
|
|
467
467
|
}
|
|
468
468
|
}, [removedChats, chat]);
|
|
469
469
|
(0, app_shell_hooks_1.useKeys)(toggleSide, openSettings, () => editors && toggleWorkbench(), reopenChat);
|
|
470
|
+
(0, app_shell_hooks_1.useTypeToFocus)(!touch);
|
|
470
471
|
(0, app_shell_hooks_1.useTitlebarColor)(workbench.status !== 'signed-out', theme, skinColor);
|
|
471
472
|
return {
|
|
472
473
|
t,
|
|
@@ -47,7 +47,6 @@ const app_nav_1 = require("./app-nav");
|
|
|
47
47
|
const app_shell_hooks_1 = require("./app-shell-hooks");
|
|
48
48
|
const app_shell_state_1 = require("./app-shell-state");
|
|
49
49
|
const app_update_view_1 = require("./app-update-view");
|
|
50
|
-
const asks_badge_1 = require("./asks-badge");
|
|
51
50
|
const auth_view_1 = require("./auth-view");
|
|
52
51
|
const board_1 = require("./board");
|
|
53
52
|
const chat_asks_1 = require("./chat-asks");
|
|
@@ -80,6 +79,7 @@ const share_dialog_1 = require("./share-dialog");
|
|
|
80
79
|
const side_lists_1 = require("./side-lists");
|
|
81
80
|
const split_pane_1 = require("./split-pane");
|
|
82
81
|
const surface_flyout_1 = require("./surface-flyout");
|
|
82
|
+
const tab_title_1 = require("./tab-title");
|
|
83
83
|
const workbench_toggle_1 = require("./workbench-toggle");
|
|
84
84
|
const workbench_view_1 = require("./workbench-view");
|
|
85
85
|
/**
|
|
@@ -139,11 +139,15 @@ function AppShell() {
|
|
|
139
139
|
extensions,
|
|
140
140
|
host,
|
|
141
141
|
});
|
|
142
|
-
// As a messenger's: the messages of people unseen on the title of the tab and on the icon of Ta Desktop
|
|
142
|
+
// As a messenger's: the messages of people unseen on the title of the tab and on the icon of Ta Desktop, and beside
|
|
143
|
+
// them what waits for the user (TabTitleUtil).
|
|
144
|
+
const tabTasks = (0, hooks_1.useTasks)();
|
|
145
|
+
const { tabTitle, tabCounts } = chatSettings;
|
|
143
146
|
React.useEffect(() => {
|
|
144
|
-
|
|
147
|
+
const counts = tabCounts ? tab_title_1.TabTitleUtil.counts(tabTasks) : { todo: 0, urgent: 0 };
|
|
148
|
+
document.title = tab_title_1.TabTitleUtil.text({ name: tabTitle, unseen: chatsCount, ...counts }, t);
|
|
145
149
|
app_badge_1.AppBadge.set(chatsCount);
|
|
146
|
-
}, [chatsCount]);
|
|
150
|
+
}, [chatsCount, tabTasks, tabTitle, tabCounts, t]);
|
|
147
151
|
if (workbench.status === 'signed-out') {
|
|
148
152
|
return workbench.leaving ? React.createElement("div", { className: "ta-signin" }) : React.createElement(workbench_view_1.SignIn, { error: workbench.error });
|
|
149
153
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChatEmojiUtil } from '../util/chat-emoji';
|
|
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;
|
|
36
|
+
//# sourceMappingURL=chat-emoji.d.ts.map
|
|
@@ -0,0 +1,167 @@
|
|
|
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.ChatEmojiUtil = void 0;
|
|
37
|
+
exports.useFaceName = useFaceName;
|
|
38
|
+
exports.sheet = sheet;
|
|
39
|
+
exports.ChatFace = ChatFace;
|
|
40
|
+
exports.EmojiText = EmojiText;
|
|
41
|
+
exports.MenuLabel = MenuLabel;
|
|
42
|
+
exports.FaceField = FaceField;
|
|
43
|
+
const React = __importStar(require("react"));
|
|
44
|
+
const use_t_1 = require("../i18n/use-t");
|
|
45
|
+
const chat_emoji_1 = require("../util/chat-emoji");
|
|
46
|
+
Object.defineProperty(exports, "ChatEmojiUtil", { enumerable: true, get: function () { return chat_emoji_1.ChatEmojiUtil; } });
|
|
47
|
+
/** The name of a face in the language of the page. */
|
|
48
|
+
function useFaceName() {
|
|
49
|
+
const language = (0, use_t_1.useLanguage)();
|
|
50
|
+
const chinese = language.startsWith('zh');
|
|
51
|
+
return React.useCallback((index) => chat_emoji_1.ChatEmojiUtil.FACES[index][chinese ? 0 : 1], [chinese]);
|
|
52
|
+
}
|
|
53
|
+
let sheetUrl;
|
|
54
|
+
/** The picture of the sheet, from the page that shows it (a path there, whatever the page is served under). */
|
|
55
|
+
function sheet() {
|
|
56
|
+
sheetUrl !== null && sheetUrl !== void 0 ? sheetUrl : (sheetUrl = new URL(chat_emoji_1.ChatEmojiUtil.SHEET, document.baseURI).href);
|
|
57
|
+
return sheetUrl;
|
|
58
|
+
}
|
|
59
|
+
/** One face, the size of the text around it unless its class says otherwise. */
|
|
60
|
+
function ChatFace({ index, className }) {
|
|
61
|
+
const name = useFaceName()(index);
|
|
62
|
+
return (React.createElement("span", { className: className ? `ta-face-emoji ${className}` : 'ta-face-emoji', role: "img", "aria-label": name, title: name, style: {
|
|
63
|
+
backgroundImage: `url("${sheet()}")`,
|
|
64
|
+
backgroundSize: chat_emoji_1.ChatEmojiUtil.SIZE,
|
|
65
|
+
backgroundPosition: chat_emoji_1.ChatEmojiUtil.position(index),
|
|
66
|
+
} }));
|
|
67
|
+
}
|
|
68
|
+
/** Words with the faces said in them (`[微笑]`) drawn as the faces; the words alone as they are. In a span with `className`. */
|
|
69
|
+
function EmojiText({ text, className }) {
|
|
70
|
+
const parts = chat_emoji_1.ChatEmojiUtil.has(text)
|
|
71
|
+
? chat_emoji_1.ChatEmojiUtil.split(text).map((part, index) => typeof part === 'number' ? React.createElement(ChatFace, { key: index, index: part }) : React.createElement(React.Fragment, { key: index }, part))
|
|
72
|
+
: text;
|
|
73
|
+
return className === undefined ? parts : React.createElement("span", { className: className }, parts);
|
|
74
|
+
}
|
|
75
|
+
/** 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. */
|
|
76
|
+
function MenuLabel({ text }) {
|
|
77
|
+
const name = useFaceName();
|
|
78
|
+
const face = chat_emoji_1.ChatEmojiUtil.faceOf(text);
|
|
79
|
+
if (face === undefined) {
|
|
80
|
+
return React.createElement(EmojiText, { text: text });
|
|
81
|
+
}
|
|
82
|
+
return (React.createElement(React.Fragment, null,
|
|
83
|
+
React.createElement(ChatFace, { index: face, className: "ta-face-menu" }),
|
|
84
|
+
name(face)));
|
|
85
|
+
}
|
|
86
|
+
/** What of a field FaceField copies, for its words to fall where the field's do. */
|
|
87
|
+
const FIELD_STYLE = [
|
|
88
|
+
'fontFamily',
|
|
89
|
+
'fontSize',
|
|
90
|
+
'fontWeight',
|
|
91
|
+
'fontStyle',
|
|
92
|
+
'lineHeight',
|
|
93
|
+
'letterSpacing',
|
|
94
|
+
'wordSpacing',
|
|
95
|
+
'tabSize',
|
|
96
|
+
'textIndent',
|
|
97
|
+
'textAlign',
|
|
98
|
+
'whiteSpace',
|
|
99
|
+
'wordBreak',
|
|
100
|
+
'overflowWrap',
|
|
101
|
+
'paddingTop',
|
|
102
|
+
'paddingRight',
|
|
103
|
+
'paddingBottom',
|
|
104
|
+
'paddingLeft',
|
|
105
|
+
];
|
|
106
|
+
/**
|
|
107
|
+
* 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
|
|
108
|
+
* one character each (ChatEmojiUtil.glyphs, as wide as a face in the font `Ta Faces`) and is itself see-through
|
|
109
|
+
* (`.ta-faced`), the same words in the same place with each face's picture on its character. The field keeps its
|
|
110
|
+
* caret, its selection, its typing and its scrolling; this only draws.
|
|
111
|
+
*/
|
|
112
|
+
function FaceField({ field, text }) {
|
|
113
|
+
const own = React.useRef(null);
|
|
114
|
+
React.useLayoutEffect(() => {
|
|
115
|
+
const element = field.current;
|
|
116
|
+
const mirror = own.current;
|
|
117
|
+
const parent = mirror === null || mirror === void 0 ? void 0 : mirror.offsetParent;
|
|
118
|
+
if (!element || !mirror || !parent) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const place = () => {
|
|
122
|
+
const style = getComputedStyle(element);
|
|
123
|
+
for (const key of FIELD_STYLE) {
|
|
124
|
+
mirror.style[key] = style[key];
|
|
125
|
+
}
|
|
126
|
+
const at = element.getBoundingClientRect();
|
|
127
|
+
const base = parent.getBoundingClientRect();
|
|
128
|
+
mirror.style.left = `${at.left - base.left - parent.clientLeft + element.clientLeft}px`;
|
|
129
|
+
mirror.style.top = `${at.top - base.top - parent.clientTop + element.clientTop}px`;
|
|
130
|
+
mirror.style.width = `${element.clientWidth}px`;
|
|
131
|
+
mirror.style.height = `${element.clientHeight}px`;
|
|
132
|
+
mirror.scrollTop = element.scrollTop;
|
|
133
|
+
};
|
|
134
|
+
place();
|
|
135
|
+
const scrolled = () => {
|
|
136
|
+
mirror.scrollTop = element.scrollTop;
|
|
137
|
+
};
|
|
138
|
+
element.addEventListener('scroll', scrolled, { passive: true });
|
|
139
|
+
const resized = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);
|
|
140
|
+
resized === null || resized === void 0 ? void 0 : resized.observe(element);
|
|
141
|
+
return () => {
|
|
142
|
+
element.removeEventListener('scroll', scrolled);
|
|
143
|
+
resized === null || resized === void 0 ? void 0 : resized.disconnect();
|
|
144
|
+
};
|
|
145
|
+
// Where the field is: placed there, and again as it moves or grows. Its words the mirror draws by itself.
|
|
146
|
+
}, [field]);
|
|
147
|
+
const parts = [];
|
|
148
|
+
let words = '';
|
|
149
|
+
for (const character of text) {
|
|
150
|
+
const face = chat_emoji_1.ChatEmojiUtil.glyphFace(character);
|
|
151
|
+
if (face === undefined) {
|
|
152
|
+
words += character;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (words) {
|
|
156
|
+
parts.push(words);
|
|
157
|
+
words = '';
|
|
158
|
+
}
|
|
159
|
+
parts.push(React.createElement("span", { key: parts.length, className: "ta-face-glyph" },
|
|
160
|
+
React.createElement("span", { className: "ta-face-emoji", style: { backgroundImage: `url("${sheet()}")`, backgroundSize: chat_emoji_1.ChatEmojiUtil.SIZE, backgroundPosition: chat_emoji_1.ChatEmojiUtil.position(face) } }),
|
|
161
|
+
character));
|
|
162
|
+
}
|
|
163
|
+
// A last line left empty still takes its height, as in the field.
|
|
164
|
+
parts.push(`${words}${words.endsWith('\n') ? '\u200b' : ''}`);
|
|
165
|
+
return (React.createElement("div", { ref: own, className: "ta-face-field", "aria-hidden": "true" }, parts));
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=chat-emoji.js.map
|