@celljs/ta-web 4.27.0 → 4.29.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/assistant/assistant-role.d.ts +9 -4
- package/esm/browser/assistant/assistant-role.js +17 -5
- package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
- package/esm/browser/assistant/assistant-task-util.js +12 -1
- package/esm/browser/assistant/assistant-thread.js +15 -2
- package/esm/browser/assistant/assistant-view.js +4 -1
- package/esm/browser/assistant/assistant.d.ts +2 -1
- package/esm/browser/assistant/assistant.js +9 -7
- package/esm/browser/assistant/call-conversing.d.ts +45 -0
- package/esm/browser/assistant/call-conversing.js +91 -0
- package/esm/browser/assistant/call-face.d.ts +13 -0
- package/esm/browser/assistant/call-face.js +81 -0
- package/esm/browser/assistant/call-keeper.d.ts +8 -4
- package/esm/browser/assistant/call-keeper.js +32 -11
- package/esm/browser/assistant/call-partnering.d.ts +37 -0
- package/esm/browser/assistant/call-partnering.js +79 -0
- package/esm/browser/assistant/call-scenes.d.ts +26 -0
- package/esm/browser/assistant/call-scenes.js +85 -0
- package/esm/browser/assistant/call-screen.d.ts +3 -0
- package/esm/browser/assistant/call-screen.js +15 -0
- package/esm/browser/assistant/mic-sense.d.ts +31 -0
- package/esm/browser/assistant/mic-sense.js +119 -0
- package/esm/browser/assistant/noise-gate.d.ts +32 -0
- package/esm/browser/assistant/noise-gate.js +66 -0
- package/esm/browser/assistant/pcm-util.d.ts +10 -0
- package/esm/browser/assistant/pcm-util.js +55 -0
- package/esm/browser/assistant/read-aloud.d.ts +2 -1
- package/esm/browser/assistant/realtime-voice-protocol.d.ts +84 -0
- package/esm/browser/assistant/realtime-voice-protocol.js +40 -0
- package/esm/browser/assistant/realtime-voice.d.ts +50 -62
- package/esm/browser/assistant/realtime-voice.js +213 -134
- package/esm/browser/assistant/spoken-timeline.d.ts +27 -0
- package/esm/browser/assistant/spoken-timeline.js +49 -0
- package/esm/browser/assistant/voice-call-bar.d.ts +9 -2
- package/esm/browser/assistant/voice-call-bar.js +81 -31
- package/esm/browser/assistant/voice-call-protocol.d.ts +61 -4
- package/esm/browser/assistant/voice-call.d.ts +16 -23
- package/esm/browser/assistant/voice-call.js +134 -117
- package/esm/browser/assistant/voice-reading.d.ts +83 -0
- package/esm/browser/assistant/voice-reading.js +150 -0
- package/esm/browser/avatar/dino-talk.d.ts +15 -0
- package/esm/browser/avatar/dino-talk.js +34 -0
- package/esm/browser/chat/chat-protocol.d.ts +2 -0
- package/esm/browser/chat/chat-shown.d.ts +3 -1
- package/esm/browser/chat/chat-shown.js +25 -3
- package/esm/browser/chat/chat.d.ts +5 -1
- package/esm/browser/chat/chat.js +32 -16
- package/esm/browser/components/account-menu.d.ts +6 -16
- package/esm/browser/components/account-menu.js +47 -101
- package/esm/browser/components/app-contexts.js +3 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-protocol.d.ts +2 -0
- package/esm/browser/components/composer-box.js +20 -1
- package/esm/browser/components/composer-emoji.d.ts +22 -0
- package/esm/browser/components/composer-emoji.js +50 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +8 -1
- package/esm/browser/components/conversation-scroll-util.js +21 -0
- package/esm/browser/components/conversation-scroll.js +10 -11
- package/esm/browser/components/discover-view.d.ts +4 -3
- package/esm/browser/components/discover-view.js +5 -4
- package/esm/browser/components/emoji-panel.d.ts +22 -0
- package/esm/browser/components/emoji-panel.js +54 -0
- package/esm/browser/components/gallery.js +28 -7
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-pull.d.ts +64 -0
- package/esm/browser/components/image-pull.js +202 -0
- package/esm/browser/components/kept-call-bar.js +2 -1
- package/esm/browser/components/lightbox.d.ts +1 -1
- package/esm/browser/components/lightbox.js +57 -2
- package/esm/browser/components/markdown.d.ts +8 -1
- package/esm/browser/components/markdown.js +12 -4
- package/esm/browser/components/me-rows.d.ts +24 -0
- package/esm/browser/components/me-rows.js +19 -0
- package/esm/browser/components/me-view.d.ts +2 -1
- package/esm/browser/components/me-view.js +3 -2
- package/esm/browser/components/message-list.js +47 -7
- package/esm/browser/components/message-steps.js +13 -0
- package/esm/browser/components/nav-places.js +1 -1
- package/esm/browser/components/partner-row.js +2 -1
- package/esm/browser/components/relay-services.d.ts +9 -3
- package/esm/browser/components/relay-services.js +73 -35
- package/esm/browser/components/session-view.js +4 -2
- package/esm/browser/components/settings-choices.js +3 -0
- package/esm/browser/components/settings-controls.d.ts +13 -0
- package/esm/browser/components/settings-controls.js +19 -0
- package/esm/browser/components/settings-more.d.ts +1 -1
- package/esm/browser/components/settings-more.js +28 -39
- package/esm/browser/components/settings-parts.d.ts +4 -2
- package/esm/browser/components/settings-parts.js +16 -9
- package/esm/browser/components/settings-view.js +2 -6
- package/esm/browser/components/ta-avatar.d.ts +15 -1
- package/esm/browser/components/ta-avatar.js +38 -5
- package/esm/browser/components/voice-services.js +6 -1
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/device/file-save.d.ts +31 -0
- package/esm/browser/device/file-save.js +80 -0
- package/esm/browser/extension/extension-view.d.ts +2 -0
- package/esm/browser/extension/extension-view.js +2 -0
- package/esm/browser/extension/web-api-call.d.ts +109 -2
- package/esm/browser/extension/web-api-components.d.ts +4 -0
- package/esm/browser/extension/web-api-contributions.d.ts +14 -14
- package/esm/browser/extension/web-api-desktop.d.ts +16 -1
- package/esm/browser/extension/web-api-desktop.js +1 -0
- package/esm/browser/extension/web-api-partners.d.ts +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +8 -10
- package/esm/browser/extension/web-extension-code.d.ts +15 -8
- package/esm/browser/extension/web-extension-code.js +25 -27
- package/esm/browser/extension/web-extension-context.js +4 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +10 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +4 -2
- package/esm/browser/extension/web-extension-run.js +10 -4
- package/esm/browser/extension/web-extensions-running.js +7 -6
- package/esm/browser/extension/web-pages.d.ts +2 -0
- package/esm/browser/extension/web-pages.js +2 -0
- package/esm/browser/i18n/en/account.d.ts +202 -0
- package/esm/browser/i18n/en/account.js +205 -0
- package/esm/browser/i18n/en/assistant.d.ts +129 -0
- package/esm/browser/i18n/en/assistant.js +130 -0
- package/esm/browser/i18n/en/call.d.ts +86 -0
- package/esm/browser/i18n/en/call.js +87 -0
- package/esm/browser/i18n/en/chat.d.ts +213 -0
- package/esm/browser/i18n/en/chat.js +214 -0
- package/esm/browser/i18n/en/common.d.ts +99 -0
- package/esm/browser/i18n/en/common.js +101 -0
- package/esm/browser/i18n/en/console.d.ts +230 -0
- package/esm/browser/i18n/en/console.js +232 -0
- package/esm/browser/i18n/en/discover.d.ts +117 -0
- package/esm/browser/i18n/en/discover.js +119 -0
- package/esm/browser/i18n/en/service.d.ts +242 -0
- package/esm/browser/i18n/en/service.js +245 -0
- package/esm/browser/i18n/en/settings.d.ts +213 -0
- package/esm/browser/i18n/en/settings.js +214 -0
- package/esm/browser/i18n/en/tools.d.ts +85 -0
- package/esm/browser/i18n/en/tools.js +87 -0
- package/esm/browser/i18n/ja/account.d.ts +2 -0
- package/esm/browser/i18n/ja/account.js +202 -0
- package/esm/browser/i18n/ja/assistant.d.ts +2 -0
- package/esm/browser/i18n/ja/assistant.js +129 -0
- package/esm/browser/i18n/ja/call.d.ts +2 -0
- package/esm/browser/i18n/ja/call.js +86 -0
- package/esm/browser/i18n/ja/chat.d.ts +2 -0
- package/esm/browser/i18n/ja/chat.js +213 -0
- package/esm/browser/i18n/ja/common.d.ts +2 -0
- package/esm/browser/i18n/ja/common.js +99 -0
- package/esm/browser/i18n/ja/console.d.ts +2 -0
- package/esm/browser/i18n/ja/console.js +230 -0
- package/esm/browser/i18n/ja/discover.d.ts +2 -0
- package/esm/browser/i18n/ja/discover.js +117 -0
- package/esm/browser/i18n/ja/service.d.ts +2 -0
- package/esm/browser/i18n/ja/service.js +242 -0
- package/esm/browser/i18n/ja/settings.d.ts +2 -0
- package/esm/browser/i18n/ja/settings.js +213 -0
- package/esm/browser/i18n/ja/tools.d.ts +2 -0
- package/esm/browser/i18n/ja/tools.js +85 -0
- package/esm/browser/i18n/locales.d.ts +1150 -1131
- package/esm/browser/i18n/messages-ja.js +20 -1567
- package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/esm/browser/i18n/messages-zh-tw.js +20 -1568
- package/esm/browser/i18n/messages.d.ts +1153 -1131
- package/esm/browser/i18n/messages.js +44 -3145
- package/esm/browser/i18n/zh/account.d.ts +2 -0
- package/esm/browser/i18n/zh/account.js +203 -0
- package/esm/browser/i18n/zh/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh/assistant.js +129 -0
- package/esm/browser/i18n/zh/call.d.ts +2 -0
- package/esm/browser/i18n/zh/call.js +86 -0
- package/esm/browser/i18n/zh/chat.d.ts +2 -0
- package/esm/browser/i18n/zh/chat.js +213 -0
- package/esm/browser/i18n/zh/common.d.ts +2 -0
- package/esm/browser/i18n/zh/common.js +99 -0
- package/esm/browser/i18n/zh/console.d.ts +2 -0
- package/esm/browser/i18n/zh/console.js +230 -0
- package/esm/browser/i18n/zh/discover.d.ts +2 -0
- package/esm/browser/i18n/zh/discover.js +117 -0
- package/esm/browser/i18n/zh/service.d.ts +2 -0
- package/esm/browser/i18n/zh/service.js +242 -0
- package/esm/browser/i18n/zh/settings.d.ts +2 -0
- package/esm/browser/i18n/zh/settings.js +213 -0
- package/esm/browser/i18n/zh/tools.d.ts +2 -0
- package/esm/browser/i18n/zh/tools.js +86 -0
- package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/account.js +202 -0
- package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/assistant.js +129 -0
- package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/call.js +86 -0
- package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/chat.js +213 -0
- package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/common.js +99 -0
- package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/console.js +230 -0
- package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +117 -0
- package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/service.js +242 -0
- package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/settings.js +213 -0
- package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/tools.js +85 -0
- package/esm/browser/markdown/code-renderers.d.ts +2 -0
- package/esm/browser/markdown/code-renderers.js +2 -0
- package/esm/browser/offline/device-values.d.ts +4 -0
- package/esm/browser/offline/device-values.js +10 -0
- package/esm/browser/pwa/page-build.d.ts +15 -0
- package/esm/browser/pwa/page-build.js +45 -0
- package/esm/browser/screen/page-answers.d.ts +2 -1
- package/esm/browser/screen/page-answers.js +7 -4
- package/esm/browser/settings/settings-protocol.d.ts +4 -0
- package/esm/browser/settings/settings-protocol.js +4 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +3 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +1 -1
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +17 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +11 -1
- package/esm/browser/style/device.js +1 -0
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +1 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +135 -57
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +0 -7
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +8 -0
- package/esm/browser/style/video-call.d.ts +2 -0
- package/esm/browser/style/video-call.js +63 -0
- package/esm/browser/style.js +2 -0
- package/esm/browser/util/call-transcript.d.ts +16 -0
- package/esm/browser/util/call-transcript.js +110 -0
- package/esm/browser/util/desktop.d.ts +10 -1
- package/esm/browser/util/desktop.js +10 -0
- package/esm/browser/util/image-pull.d.ts +61 -0
- package/esm/browser/util/image-pull.js +88 -0
- package/esm/browser/util/process.d.ts +6 -0
- package/esm/browser/util/process.js +18 -5
- package/esm/browser/util/spoken.d.ts +3 -3
- package/esm/browser/util/spoken.js +4 -4
- package/esm/browser/video-call/call-camera.d.ts +59 -0
- package/esm/browser/video-call/call-camera.js +188 -0
- package/esm/browser/video-call/call-people.d.ts +21 -0
- package/esm/browser/video-call/call-people.js +29 -0
- package/esm/browser/video-call/call-window.d.ts +19 -0
- package/esm/browser/video-call/call-window.js +80 -0
- package/esm/browser/video-call/clip-plan.d.ts +56 -0
- package/esm/browser/video-call/clip-plan.js +76 -0
- package/esm/browser/video-call/face-camera.d.ts +93 -0
- package/esm/browser/video-call/face-camera.js +192 -0
- package/esm/browser/video-call/face-files.d.ts +69 -0
- package/esm/browser/video-call/face-files.js +132 -0
- package/esm/browser/video-call/face-moves.d.ts +68 -0
- package/esm/browser/video-call/face-moves.js +180 -0
- package/esm/browser/video-call/face-stage.d.ts +139 -0
- package/esm/browser/video-call/face-stage.js +219 -0
- package/esm/browser/video-call/mouth-layer.d.ts +81 -0
- package/esm/browser/video-call/mouth-layer.js +241 -0
- package/esm/browser/video-call/video-call-view.d.ts +19 -0
- package/esm/browser/video-call/video-call-view.js +254 -0
- package/esm/browser/video-call/video-face.d.ts +19 -0
- package/esm/browser/video-call/video-face.js +471 -0
- package/esm/browser/workbench-hosts.d.ts +1 -0
- package/esm/browser/workbench-protocol.d.ts +2 -0
- package/esm/browser/workbench-util.d.ts +5 -0
- package/esm/browser/workbench-util.js +18 -0
- package/esm/browser/workbench.d.ts +14 -0
- package/esm/browser/workbench.js +73 -6
- package/lib/browser/assistant/assistant-role.d.ts +9 -4
- package/lib/browser/assistant/assistant-role.js +17 -5
- package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
- package/lib/browser/assistant/assistant-task-util.js +11 -0
- package/lib/browser/assistant/assistant-thread.js +15 -2
- package/lib/browser/assistant/assistant-view.js +3 -0
- package/lib/browser/assistant/assistant.d.ts +2 -1
- package/lib/browser/assistant/assistant.js +9 -7
- package/lib/browser/assistant/call-conversing.d.ts +46 -0
- package/lib/browser/assistant/call-conversing.js +96 -0
- package/lib/browser/assistant/call-face.d.ts +14 -0
- package/lib/browser/assistant/call-face.js +117 -0
- package/lib/browser/assistant/call-keeper.d.ts +8 -4
- package/lib/browser/assistant/call-keeper.js +32 -11
- package/lib/browser/assistant/call-partnering.d.ts +38 -0
- package/lib/browser/assistant/call-partnering.js +83 -0
- package/lib/browser/assistant/call-scenes.d.ts +27 -0
- package/lib/browser/assistant/call-scenes.js +88 -0
- package/lib/browser/assistant/call-screen.d.ts +3 -0
- package/lib/browser/assistant/call-screen.js +15 -0
- package/lib/browser/assistant/mic-sense.d.ts +32 -0
- package/lib/browser/assistant/mic-sense.js +123 -0
- package/lib/browser/assistant/noise-gate.d.ts +33 -0
- package/lib/browser/assistant/noise-gate.js +71 -0
- package/lib/browser/assistant/pcm-util.d.ts +11 -0
- package/lib/browser/assistant/pcm-util.js +58 -0
- package/lib/browser/assistant/read-aloud.d.ts +2 -1
- package/lib/browser/assistant/realtime-voice-protocol.d.ts +85 -0
- package/lib/browser/assistant/realtime-voice-protocol.js +43 -0
- package/lib/browser/assistant/realtime-voice.d.ts +50 -62
- package/lib/browser/assistant/realtime-voice.js +217 -138
- package/lib/browser/assistant/spoken-timeline.d.ts +28 -0
- package/lib/browser/assistant/spoken-timeline.js +53 -0
- package/lib/browser/assistant/voice-call-bar.d.ts +9 -2
- package/lib/browser/assistant/voice-call-bar.js +81 -30
- package/lib/browser/assistant/voice-call-protocol.d.ts +61 -4
- package/lib/browser/assistant/voice-call.d.ts +16 -23
- package/lib/browser/assistant/voice-call.js +134 -117
- package/lib/browser/assistant/voice-reading.d.ts +84 -0
- package/lib/browser/assistant/voice-reading.js +156 -0
- package/lib/browser/avatar/dino-talk.d.ts +16 -0
- package/lib/browser/avatar/dino-talk.js +37 -0
- package/lib/browser/chat/chat-protocol.d.ts +2 -0
- package/lib/browser/chat/chat-shown.d.ts +3 -1
- package/lib/browser/chat/chat-shown.js +25 -3
- package/lib/browser/chat/chat.d.ts +5 -1
- package/lib/browser/chat/chat.js +32 -16
- package/lib/browser/components/account-menu.d.ts +6 -16
- package/lib/browser/components/account-menu.js +45 -99
- package/lib/browser/components/app-contexts.js +2 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-protocol.d.ts +2 -0
- package/lib/browser/components/composer-box.js +20 -1
- package/lib/browser/components/composer-emoji.d.ts +23 -0
- package/lib/browser/components/composer-emoji.js +87 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +8 -1
- package/lib/browser/components/conversation-scroll-util.js +21 -0
- package/lib/browser/components/conversation-scroll.js +10 -11
- package/lib/browser/components/discover-view.d.ts +4 -3
- package/lib/browser/components/discover-view.js +5 -4
- package/lib/browser/components/emoji-panel.d.ts +23 -0
- package/lib/browser/components/emoji-panel.js +90 -0
- package/lib/browser/components/gallery.js +28 -7
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-pull.d.ts +65 -0
- package/lib/browser/components/image-pull.js +206 -0
- package/lib/browser/components/kept-call-bar.js +2 -1
- package/lib/browser/components/lightbox.d.ts +1 -1
- package/lib/browser/components/lightbox.js +57 -2
- package/lib/browser/components/markdown.d.ts +8 -1
- package/lib/browser/components/markdown.js +11 -3
- package/lib/browser/components/me-rows.d.ts +25 -0
- package/lib/browser/components/me-rows.js +22 -0
- package/lib/browser/components/me-view.d.ts +2 -1
- package/lib/browser/components/me-view.js +3 -2
- package/lib/browser/components/message-list.js +46 -6
- package/lib/browser/components/message-steps.js +13 -0
- package/lib/browser/components/nav-places.js +1 -1
- package/lib/browser/components/partner-row.js +2 -1
- package/lib/browser/components/relay-services.d.ts +9 -3
- package/lib/browser/components/relay-services.js +71 -33
- package/lib/browser/components/session-view.js +3 -1
- package/lib/browser/components/settings-choices.js +3 -0
- package/lib/browser/components/settings-controls.d.ts +13 -0
- package/lib/browser/components/settings-controls.js +19 -0
- package/lib/browser/components/settings-more.d.ts +1 -1
- package/lib/browser/components/settings-more.js +27 -38
- package/lib/browser/components/settings-parts.d.ts +4 -2
- package/lib/browser/components/settings-parts.js +15 -8
- package/lib/browser/components/settings-view.js +2 -6
- package/lib/browser/components/ta-avatar.d.ts +15 -1
- package/lib/browser/components/ta-avatar.js +38 -5
- package/lib/browser/components/voice-services.js +5 -0
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/device/file-save.d.ts +32 -0
- package/lib/browser/device/file-save.js +83 -0
- package/lib/browser/extension/extension-view.d.ts +2 -0
- package/lib/browser/extension/extension-view.js +3 -1
- package/lib/browser/extension/web-api-call.d.ts +109 -2
- package/lib/browser/extension/web-api-components.d.ts +4 -0
- package/lib/browser/extension/web-api-contributions.d.ts +14 -14
- package/lib/browser/extension/web-api-desktop.d.ts +16 -1
- package/lib/browser/extension/web-api-desktop.js +1 -0
- package/lib/browser/extension/web-api-partners.d.ts +2 -0
- package/lib/browser/extension/web-extension-api.d.ts +8 -10
- package/lib/browser/extension/web-extension-code.d.ts +15 -8
- package/lib/browser/extension/web-extension-code.js +25 -27
- package/lib/browser/extension/web-extension-context.js +4 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +10 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +4 -2
- package/lib/browser/extension/web-extension-run.js +10 -4
- package/lib/browser/extension/web-extensions-running.js +7 -6
- package/lib/browser/extension/web-pages.d.ts +2 -0
- package/lib/browser/extension/web-pages.js +2 -0
- package/lib/browser/i18n/en/account.d.ts +203 -0
- package/lib/browser/i18n/en/account.js +208 -0
- package/lib/browser/i18n/en/assistant.d.ts +130 -0
- package/lib/browser/i18n/en/assistant.js +133 -0
- package/lib/browser/i18n/en/call.d.ts +87 -0
- package/lib/browser/i18n/en/call.js +90 -0
- package/lib/browser/i18n/en/chat.d.ts +214 -0
- package/lib/browser/i18n/en/chat.js +217 -0
- package/lib/browser/i18n/en/common.d.ts +100 -0
- package/lib/browser/i18n/en/common.js +104 -0
- package/lib/browser/i18n/en/console.d.ts +231 -0
- package/lib/browser/i18n/en/console.js +235 -0
- package/lib/browser/i18n/en/discover.d.ts +118 -0
- package/lib/browser/i18n/en/discover.js +122 -0
- package/lib/browser/i18n/en/service.d.ts +243 -0
- package/lib/browser/i18n/en/service.js +248 -0
- package/lib/browser/i18n/en/settings.d.ts +214 -0
- package/lib/browser/i18n/en/settings.js +217 -0
- package/lib/browser/i18n/en/tools.d.ts +86 -0
- package/lib/browser/i18n/en/tools.js +90 -0
- package/lib/browser/i18n/ja/account.d.ts +3 -0
- package/lib/browser/i18n/ja/account.js +205 -0
- package/lib/browser/i18n/ja/assistant.d.ts +3 -0
- package/lib/browser/i18n/ja/assistant.js +132 -0
- package/lib/browser/i18n/ja/call.d.ts +3 -0
- package/lib/browser/i18n/ja/call.js +89 -0
- package/lib/browser/i18n/ja/chat.d.ts +3 -0
- package/lib/browser/i18n/ja/chat.js +216 -0
- package/lib/browser/i18n/ja/common.d.ts +3 -0
- package/lib/browser/i18n/ja/common.js +102 -0
- package/lib/browser/i18n/ja/console.d.ts +3 -0
- package/lib/browser/i18n/ja/console.js +233 -0
- package/lib/browser/i18n/ja/discover.d.ts +3 -0
- package/lib/browser/i18n/ja/discover.js +120 -0
- package/lib/browser/i18n/ja/service.d.ts +3 -0
- package/lib/browser/i18n/ja/service.js +245 -0
- package/lib/browser/i18n/ja/settings.d.ts +3 -0
- package/lib/browser/i18n/ja/settings.js +216 -0
- package/lib/browser/i18n/ja/tools.d.ts +3 -0
- package/lib/browser/i18n/ja/tools.js +88 -0
- package/lib/browser/i18n/locales.d.ts +1150 -1131
- package/lib/browser/i18n/messages-ja.js +20 -1567
- package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/lib/browser/i18n/messages-zh-tw.js +20 -1568
- package/lib/browser/i18n/messages.d.ts +1153 -1131
- package/lib/browser/i18n/messages.js +44 -3145
- package/lib/browser/i18n/zh/account.d.ts +3 -0
- package/lib/browser/i18n/zh/account.js +206 -0
- package/lib/browser/i18n/zh/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh/assistant.js +132 -0
- package/lib/browser/i18n/zh/call.d.ts +3 -0
- package/lib/browser/i18n/zh/call.js +89 -0
- package/lib/browser/i18n/zh/chat.d.ts +3 -0
- package/lib/browser/i18n/zh/chat.js +216 -0
- package/lib/browser/i18n/zh/common.d.ts +3 -0
- package/lib/browser/i18n/zh/common.js +102 -0
- package/lib/browser/i18n/zh/console.d.ts +3 -0
- package/lib/browser/i18n/zh/console.js +233 -0
- package/lib/browser/i18n/zh/discover.d.ts +3 -0
- package/lib/browser/i18n/zh/discover.js +120 -0
- package/lib/browser/i18n/zh/service.d.ts +3 -0
- package/lib/browser/i18n/zh/service.js +245 -0
- package/lib/browser/i18n/zh/settings.d.ts +3 -0
- package/lib/browser/i18n/zh/settings.js +216 -0
- package/lib/browser/i18n/zh/tools.d.ts +3 -0
- package/lib/browser/i18n/zh/tools.js +89 -0
- package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/account.js +205 -0
- package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/assistant.js +132 -0
- package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/call.js +89 -0
- package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/chat.js +216 -0
- package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/common.js +102 -0
- package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/console.js +233 -0
- package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/discover.js +120 -0
- package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/service.js +245 -0
- package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/settings.js +216 -0
- package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/tools.js +88 -0
- package/lib/browser/markdown/code-renderers.d.ts +2 -0
- package/lib/browser/markdown/code-renderers.js +3 -1
- package/lib/browser/offline/device-values.d.ts +4 -0
- package/lib/browser/offline/device-values.js +10 -0
- package/lib/browser/pwa/page-build.d.ts +16 -0
- package/lib/browser/pwa/page-build.js +48 -0
- package/lib/browser/screen/page-answers.d.ts +2 -1
- package/lib/browser/screen/page-answers.js +7 -4
- package/lib/browser/settings/settings-protocol.d.ts +4 -0
- package/lib/browser/settings/settings-protocol.js +4 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +3 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +1 -1
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +17 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +11 -1
- package/lib/browser/style/device.js +1 -0
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +1 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +135 -57
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +0 -7
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +8 -0
- package/lib/browser/style/video-call.d.ts +3 -0
- package/lib/browser/style/video-call.js +66 -0
- package/lib/browser/style.js +2 -0
- package/lib/browser/util/call-transcript.d.ts +17 -0
- package/lib/browser/util/call-transcript.js +113 -0
- package/lib/browser/util/desktop.d.ts +10 -1
- package/lib/browser/util/desktop.js +10 -0
- package/lib/browser/util/image-pull.d.ts +62 -0
- package/lib/browser/util/image-pull.js +91 -0
- package/lib/browser/util/process.d.ts +6 -0
- package/lib/browser/util/process.js +17 -4
- package/lib/browser/util/spoken.d.ts +3 -3
- package/lib/browser/util/spoken.js +4 -4
- package/lib/browser/video-call/call-camera.d.ts +60 -0
- package/lib/browser/video-call/call-camera.js +192 -0
- package/lib/browser/video-call/call-people.d.ts +22 -0
- package/lib/browser/video-call/call-people.js +32 -0
- package/lib/browser/video-call/call-window.d.ts +20 -0
- package/lib/browser/video-call/call-window.js +83 -0
- package/lib/browser/video-call/clip-plan.d.ts +57 -0
- package/lib/browser/video-call/clip-plan.js +80 -0
- package/lib/browser/video-call/face-camera.d.ts +94 -0
- package/lib/browser/video-call/face-camera.js +197 -0
- package/lib/browser/video-call/face-files.d.ts +70 -0
- package/lib/browser/video-call/face-files.js +137 -0
- package/lib/browser/video-call/face-moves.d.ts +69 -0
- package/lib/browser/video-call/face-moves.js +184 -0
- package/lib/browser/video-call/face-stage.d.ts +140 -0
- package/lib/browser/video-call/face-stage.js +223 -0
- package/lib/browser/video-call/mouth-layer.d.ts +82 -0
- package/lib/browser/video-call/mouth-layer.js +245 -0
- package/lib/browser/video-call/video-call-view.d.ts +20 -0
- package/lib/browser/video-call/video-call-view.js +290 -0
- package/lib/browser/video-call/video-face.d.ts +20 -0
- package/lib/browser/video-call/video-face.js +507 -0
- package/lib/browser/workbench-hosts.d.ts +1 -0
- package/lib/browser/workbench-protocol.d.ts +2 -0
- package/lib/browser/workbench-util.d.ts +5 -0
- package/lib/browser/workbench-util.js +18 -0
- package/lib/browser/workbench.d.ts +14 -0
- package/lib/browser/workbench.js +71 -4
- package/package.json +7 -7
- package/public/faces/README.md +40 -0
- package/public/faces/blonde/clap.mp4 +0 -0
- package/public/faces/blonde/dance.mp4 +0 -0
- package/public/faces/blonde/face.jpg +0 -0
- package/public/faces/blonde/happy.mp4 +0 -0
- package/public/faces/blonde/heart.mp4 +0 -0
- package/public/faces/blonde/idle-1.mp4 +0 -0
- package/public/faces/blonde/idle-2.mp4 +0 -0
- package/public/faces/blonde/idle-3.mp4 +0 -0
- package/public/faces/blonde/laugh.mp4 +0 -0
- package/public/faces/blonde/listening.mp4 +0 -0
- package/public/faces/blonde/poster.jpg +0 -0
- package/public/faces/blonde/shy.mp4 +0 -0
- package/public/faces/blonde/sorry.mp4 +0 -0
- package/public/faces/blonde/stretch.mp4 +0 -0
- package/public/faces/blonde/surprised.mp4 +0 -0
- package/public/faces/blonde/talk-1.mp4 +0 -0
- package/public/faces/blonde/talk-2.mp4 +0 -0
- package/public/faces/blonde/think-2.mp4 +0 -0
- package/public/faces/blonde/thinking.mp4 +0 -0
- package/public/faces/blonde/wave.mp4 +0 -0
- package/public/faces/clap.mp4 +0 -0
- package/public/faces/dance.mp4 +0 -0
- package/public/faces/face.jpg +0 -0
- package/public/faces/framing.json +1 -0
- package/public/faces/happy.mp4 +0 -0
- package/public/faces/heart.mp4 +0 -0
- package/public/faces/idle-1.mp4 +0 -0
- package/public/faces/idle-2.mp4 +0 -0
- package/public/faces/idle-3.mp4 +0 -0
- package/public/faces/laugh.mp4 +0 -0
- package/public/faces/lips.json +1 -0
- package/public/faces/listening.mp4 +0 -0
- package/public/faces/poster.jpg +0 -0
- package/public/faces/shy.mp4 +0 -0
- package/public/faces/sorry.mp4 +0 -0
- package/public/faces/stretch.mp4 +0 -0
- package/public/faces/surprised.mp4 +0 -0
- package/public/faces/talk-1.mp4 +0 -0
- package/public/faces/talk-2.mp4 +0 -0
- package/public/faces/think-2.mp4 +0 -0
- package/public/faces/thinking.mp4 +0 -0
- package/public/faces/wave.mp4 +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MouthLayer = void 0;
|
|
4
|
+
const clip_plan_1 = require("./clip-plan");
|
|
5
|
+
const face_camera_1 = require("./face-camera");
|
|
6
|
+
/** How much longer a reading may wait while the mouth starts, at most, in ms. */
|
|
7
|
+
const STARTING_MS = 6000;
|
|
8
|
+
/** How many frames the clip shown may be from the one a mouth was drawn for, laid over it moved with the face. */
|
|
9
|
+
const NEAR_FRAMES = 3;
|
|
10
|
+
/** How long the mouth fades out once Ta stops reading, in ms (as .ta-video-mouth's transition). */
|
|
11
|
+
const FADE_OUT_MS = 160;
|
|
12
|
+
/**
|
|
13
|
+
* The mouth an extension draws for what Ta reads (WebCallMouth), laid over the clip: told the sound of each reading as
|
|
14
|
+
* it comes with the frame of the clip at each moment of it (ClipPlan), it gives that frame's lower face drawn again
|
|
15
|
+
* for that sound. As each frame of the clip is shown (requestVideoFrameCallback), that frame and the mouth of that
|
|
16
|
+
* moment of the sound are drawn together, the mouth moved with her face when it was drawn for a frame near it: the
|
|
17
|
+
* clip and the sound keep their own clocks a little apart. The reading waits for it as long as it asks (holdMs).
|
|
18
|
+
*/
|
|
19
|
+
class MouthLayer {
|
|
20
|
+
constructor(call, planOf, canvas, view, faces,
|
|
21
|
+
/** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
|
|
22
|
+
placeOf, showing) {
|
|
23
|
+
this.call = call;
|
|
24
|
+
this.planOf = planOf;
|
|
25
|
+
this.canvas = canvas;
|
|
26
|
+
this.view = view;
|
|
27
|
+
this.faces = faces;
|
|
28
|
+
this.placeOf = placeOf;
|
|
29
|
+
this.showing = showing;
|
|
30
|
+
this.closed = false;
|
|
31
|
+
/** Of each reading: the seconds of its sound that came, and the slots told. */
|
|
32
|
+
this.sounds = new Map();
|
|
33
|
+
this.atSlot = -1;
|
|
34
|
+
/** The canvas shows the frames of the clip now, not the layers of video under it. */
|
|
35
|
+
this.drawing = false;
|
|
36
|
+
}
|
|
37
|
+
async open(mouth) {
|
|
38
|
+
var _a;
|
|
39
|
+
const session = await (mouth === null || mouth === void 0 ? void 0 : mouth.open().catch(() => undefined));
|
|
40
|
+
if (!session) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (this.closed) {
|
|
44
|
+
session.close();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.session = session;
|
|
48
|
+
this.missed = (_a = this.call.sounds.nowReading()) === null || _a === void 0 ? void 0 : _a.say;
|
|
49
|
+
this.call.sounds.hold(session.holdMs);
|
|
50
|
+
this.offSound = this.call.sounds.on((say, pcm, rate) => this.sound(say, pcm, rate));
|
|
51
|
+
}
|
|
52
|
+
sound(say, pcm, rate) {
|
|
53
|
+
var _a;
|
|
54
|
+
var _b, _c;
|
|
55
|
+
const session = this.session;
|
|
56
|
+
if (!session || say === this.missed) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!this.sounds.has(say)) {
|
|
60
|
+
// A reading begins: it waits as long as the mouth asks, more while the mouth starts.
|
|
61
|
+
this.call.sounds.hold(session.holdMs + Math.min(STARTING_MS, (_b = (_a = session.readyIn) === null || _a === void 0 ? void 0 : _a.call(session)) !== null && _b !== void 0 ? _b : 0));
|
|
62
|
+
}
|
|
63
|
+
const heard = (_c = this.sounds.get(say)) !== null && _c !== void 0 ? _c : { seconds: 0, told: 0 };
|
|
64
|
+
this.sounds.set(say, heard);
|
|
65
|
+
for (const old of this.sounds.keys()) {
|
|
66
|
+
if (old < say - 1) {
|
|
67
|
+
this.sounds.delete(old);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (pcm) {
|
|
71
|
+
heard.seconds += pcm.byteLength / 2 / rate;
|
|
72
|
+
}
|
|
73
|
+
const upto = pcm ? Math.floor(heard.seconds * session.fps) : Math.ceil(heard.seconds * session.fps);
|
|
74
|
+
const plan = this.planOf(say);
|
|
75
|
+
const slots = [];
|
|
76
|
+
for (let slot = heard.told; slot < upto; slot++) {
|
|
77
|
+
const { clip, frame } = plan.at(slot / session.fps);
|
|
78
|
+
// By the name of its file (FaceFiles.full): of the person of the call.
|
|
79
|
+
slots.push([this.faces.full(clip), frame]);
|
|
80
|
+
}
|
|
81
|
+
const first = heard.told;
|
|
82
|
+
heard.told = Math.max(heard.told, upto);
|
|
83
|
+
session.sound(say, pcm, rate, slots, first);
|
|
84
|
+
}
|
|
85
|
+
/** The reading plays at `seconds` of its sound: the extension knows what it need not draw any more. */
|
|
86
|
+
follow(reading, seconds) {
|
|
87
|
+
const session = this.session;
|
|
88
|
+
if (!session) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (this.say !== undefined && this.say !== reading.say) {
|
|
92
|
+
session.cut(this.say);
|
|
93
|
+
}
|
|
94
|
+
this.say = reading.say;
|
|
95
|
+
const slot = Math.floor(seconds * session.fps);
|
|
96
|
+
if (slot !== this.atSlot) {
|
|
97
|
+
this.atSlot = slot;
|
|
98
|
+
session.at(reading.say, slot);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** Draws as each frame of the layers of video is shown, the one in front. */
|
|
102
|
+
watch(videos) {
|
|
103
|
+
const offs = videos.map(video => {
|
|
104
|
+
if (typeof video.requestVideoFrameCallback !== 'function') {
|
|
105
|
+
return () => undefined;
|
|
106
|
+
}
|
|
107
|
+
const shown = (_now, frame) => {
|
|
108
|
+
handle = video.requestVideoFrameCallback(shown);
|
|
109
|
+
this.shown(video, frame.mediaTime);
|
|
110
|
+
};
|
|
111
|
+
let handle = video.requestVideoFrameCallback(shown);
|
|
112
|
+
return () => video.cancelVideoFrameCallback(handle);
|
|
113
|
+
});
|
|
114
|
+
this.offFrames = () => {
|
|
115
|
+
for (const off of offs) {
|
|
116
|
+
off();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** A frame of `video` is shown, `mediaTime` into its clip: it is drawn, with the mouth of the moment over it. */
|
|
121
|
+
shown(video, mediaTime) {
|
|
122
|
+
var _a, _b, _c;
|
|
123
|
+
const session = this.session;
|
|
124
|
+
const canvas = this.canvas;
|
|
125
|
+
const now = this.showing();
|
|
126
|
+
if (!session || !canvas || !now || now.video !== video || !video.videoWidth) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const context = this.fit(canvas);
|
|
130
|
+
if (!context) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const width = canvas.width;
|
|
134
|
+
const height = canvas.height;
|
|
135
|
+
// Where each layer of video shows it, so that nothing moves as the canvas comes over it.
|
|
136
|
+
const where = (layer) => { var _a; return (_a = this.placeOf(layer, width)) !== null && _a !== void 0 ? _a : face_camera_1.FaceCamera.place(face_camera_1.FaceCamera.close(width / height, { x: 0, y: 0, w: layer.videoWidth, h: layer.videoHeight }), width); };
|
|
137
|
+
// A clip fading in: the one under it first, whole, and this one over it as much as it shows, its mouth with it.
|
|
138
|
+
const under = now.under;
|
|
139
|
+
if (under === null || under === void 0 ? void 0 : under.video.videoWidth) {
|
|
140
|
+
const at = where(under.video);
|
|
141
|
+
context.drawImage(under.video, at.left, at.top, under.video.videoWidth * at.scale, under.video.videoHeight * at.scale);
|
|
142
|
+
context.globalAlpha = under.alpha;
|
|
143
|
+
}
|
|
144
|
+
const { scale, left, top } = where(video);
|
|
145
|
+
context.drawImage(video, left, top, video.videoWidth * scale, video.videoHeight * scale);
|
|
146
|
+
this.show(canvas);
|
|
147
|
+
const shownFrame = Math.round(mediaTime * clip_plan_1.CLIP_FPS);
|
|
148
|
+
const drawn = this.nearest(session, now.reading.say, Math.floor(now.reading.now() * session.fps), this.faces.full(now.clip), shownFrame);
|
|
149
|
+
const at = this.place(drawn, this.faces.full(now.clip), shownFrame);
|
|
150
|
+
if (drawn && at) {
|
|
151
|
+
context.drawImage(drawn.image, left + at[0] * scale, top + at[1] * scale, at[2] * scale, at[3] * scale);
|
|
152
|
+
}
|
|
153
|
+
context.globalAlpha = 1;
|
|
154
|
+
// How many frames showed while Ta read, and how many with her mouth: read by checks of the call (and by anyone curious).
|
|
155
|
+
canvas.dataset.frames = String(Number((_a = canvas.dataset.frames) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
156
|
+
canvas.dataset.mouths = String(Number((_b = canvas.dataset.mouths) !== null && _b !== void 0 ? _b : 0) + (drawn && at ? 1 : 0));
|
|
157
|
+
if (drawn && at) {
|
|
158
|
+
canvas.dataset.apart = String(Number((_c = canvas.dataset.apart) !== null && _c !== void 0 ? _c : 0) + Math.abs(drawn.frame - shownFrame));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The mouth of the moment of the sound, or of the slot just before or after it if that one was drawn for a frame
|
|
163
|
+
* nearer the one shown (the frame comes to the screen a little after its moment): a mouth a slot early or late is
|
|
164
|
+
* not seen, one laid over a frame it was not drawn for is.
|
|
165
|
+
*/
|
|
166
|
+
nearest(session, say, slot, clip, frame) {
|
|
167
|
+
let best;
|
|
168
|
+
for (const near of [slot, slot - 1, slot + 1]) {
|
|
169
|
+
const drawn = session.frame(say, near);
|
|
170
|
+
if ((drawn === null || drawn === void 0 ? void 0 : drawn.clip) === clip && (!best || Math.abs(drawn.frame - frame) < Math.abs(best.frame - frame))) {
|
|
171
|
+
best = drawn;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return best !== null && best !== void 0 ? best : session.frame(say, slot);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Where the mouth drawn goes over `frame` of `clip`: its place in the frame it was drawn for, moved and scaled as her
|
|
178
|
+
* face is from that frame to this one; undefined when it is of another clip, or of a frame too far.
|
|
179
|
+
*/
|
|
180
|
+
place(drawn, clip, frame) {
|
|
181
|
+
if (!drawn || drawn.clip !== clip || Math.abs(drawn.frame - frame) > NEAR_FRAMES) {
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
const boxes = this.faces.boxes(clip);
|
|
185
|
+
const from = boxes === null || boxes === void 0 ? void 0 : boxes[drawn.frame];
|
|
186
|
+
const to = boxes === null || boxes === void 0 ? void 0 : boxes[Math.min(frame, boxes.length - 1)];
|
|
187
|
+
const [x, y, w, h] = drawn.box;
|
|
188
|
+
if (!from || !to || drawn.frame === frame) {
|
|
189
|
+
return [x, y, w, h];
|
|
190
|
+
}
|
|
191
|
+
const sx = (to[2] - to[0]) / Math.max(1, from[2] - from[0]);
|
|
192
|
+
const sy = (to[3] - to[1]) / Math.max(1, from[3] - from[1]);
|
|
193
|
+
return [to[0] + (x - from[0]) * sx, to[1] + (y - from[1]) * sy, w * sx, h * sy];
|
|
194
|
+
}
|
|
195
|
+
/** Nothing over the clip: Ta is not reading with its voice service now. */
|
|
196
|
+
clear() {
|
|
197
|
+
var _a;
|
|
198
|
+
if (this.say !== undefined) {
|
|
199
|
+
(_a = this.session) === null || _a === void 0 ? void 0 : _a.cut(this.say);
|
|
200
|
+
this.say = undefined;
|
|
201
|
+
this.atSlot = -1;
|
|
202
|
+
}
|
|
203
|
+
const canvas = this.canvas;
|
|
204
|
+
if (this.drawing && canvas) {
|
|
205
|
+
// It fades out over the clip under it (the same frame, without the mouth drawn), then is cleared.
|
|
206
|
+
this.drawing = false;
|
|
207
|
+
canvas.style.opacity = '0';
|
|
208
|
+
clearTimeout(this.fading);
|
|
209
|
+
this.fading = setTimeout(() => !this.drawing && this.fit(canvas), FADE_OUT_MS);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/** The canvas shows the frames of the clip now. */
|
|
213
|
+
show(canvas) {
|
|
214
|
+
if (!this.drawing) {
|
|
215
|
+
this.drawing = true;
|
|
216
|
+
clearTimeout(this.fading);
|
|
217
|
+
canvas.style.opacity = '1';
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/** The canvas the size it shows at, cleared. */
|
|
221
|
+
fit(canvas) {
|
|
222
|
+
const ratio = Math.min(2, this.view.devicePixelRatio || 1);
|
|
223
|
+
const width = Math.round(canvas.clientWidth * ratio);
|
|
224
|
+
const height = Math.round(canvas.clientHeight * ratio);
|
|
225
|
+
if (canvas.width !== width || canvas.height !== height) {
|
|
226
|
+
canvas.width = width;
|
|
227
|
+
canvas.height = height;
|
|
228
|
+
}
|
|
229
|
+
const context = canvas.getContext('2d');
|
|
230
|
+
context === null || context === void 0 ? void 0 : context.clearRect(0, 0, width, height);
|
|
231
|
+
return context;
|
|
232
|
+
}
|
|
233
|
+
close() {
|
|
234
|
+
var _a, _b, _c;
|
|
235
|
+
this.closed = true;
|
|
236
|
+
clearTimeout(this.fading);
|
|
237
|
+
(_a = this.offSound) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
238
|
+
(_b = this.offFrames) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
239
|
+
(_c = this.session) === null || _c === void 0 ? void 0 : _c.close();
|
|
240
|
+
this.session = undefined;
|
|
241
|
+
this.call.sounds.hold(0);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.MouthLayer = MouthLayer;
|
|
245
|
+
//# sourceMappingURL=mouth-layer.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { VoiceCall } from '../assistant/voice-call';
|
|
3
|
+
import type { CallState } from '../assistant/voice-call-protocol';
|
|
4
|
+
/**
|
|
5
|
+
* A video call (docs/design/ta-call.md 12), as a messenger's: Ta as a person who speaks with the voice of the call,
|
|
6
|
+
* its mouth, face and hands moving with what it says, and the user's own camera in a corner once they turn it on
|
|
7
|
+
* (it begins off), which Ta then sees. On a phone it takes the whole screen while the user is on the call's
|
|
8
|
+
* conversation, and floats small elsewhere (or when minimized; a tap brings it back); in Ta Desktop it is a window of
|
|
9
|
+
* its own; in a browser on a computer, a panel.
|
|
10
|
+
*/
|
|
11
|
+
export declare function VideoCallView({ call, state, title, here, onBack, onHangUp, }: {
|
|
12
|
+
call: VoiceCall;
|
|
13
|
+
state: CallState;
|
|
14
|
+
title: string;
|
|
15
|
+
/** The call's conversation is the one in front. */
|
|
16
|
+
here: boolean;
|
|
17
|
+
onBack(): void;
|
|
18
|
+
onHangUp(): void;
|
|
19
|
+
}): React.JSX.Element | null;
|
|
20
|
+
//# sourceMappingURL=video-call-view.d.ts.map
|
|
@@ -0,0 +1,290 @@
|
|
|
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.VideoCallView = VideoCallView;
|
|
37
|
+
const lucide_react_1 = require("lucide-react");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_dom_1 = require("react-dom");
|
|
40
|
+
const call_scenes_1 = require("../assistant/call-scenes");
|
|
41
|
+
const call_screen_1 = require("../assistant/call-screen");
|
|
42
|
+
const icon_1 = require("../components/icon");
|
|
43
|
+
const loading_1 = require("../components/loading");
|
|
44
|
+
const ta_avatar_1 = require("../components/ta-avatar");
|
|
45
|
+
const device_1 = require("../device/device");
|
|
46
|
+
const hooks_1 = require("../hooks");
|
|
47
|
+
const use_t_1 = require("../i18n/use-t");
|
|
48
|
+
const desktop_1 = require("../util/desktop");
|
|
49
|
+
const call_camera_1 = require("./call-camera");
|
|
50
|
+
const call_people_1 = require("./call-people");
|
|
51
|
+
const call_window_1 = require("./call-window");
|
|
52
|
+
const face_files_1 = require("./face-files");
|
|
53
|
+
const video_face_1 = require("./video-face");
|
|
54
|
+
/** How far a finger or the mouse moves before the small window is dragged rather than tapped, in pixels. */
|
|
55
|
+
const DRAG_PX = 6;
|
|
56
|
+
/**
|
|
57
|
+
* A video call (docs/design/ta-call.md 12), as a messenger's: Ta as a person who speaks with the voice of the call,
|
|
58
|
+
* its mouth, face and hands moving with what it says, and the user's own camera in a corner once they turn it on
|
|
59
|
+
* (it begins off), which Ta then sees. On a phone it takes the whole screen while the user is on the call's
|
|
60
|
+
* conversation, and floats small elsewhere (or when minimized; a tap brings it back); in Ta Desktop it is a window of
|
|
61
|
+
* its own; in a browser on a computer, a panel.
|
|
62
|
+
*/
|
|
63
|
+
function VideoCallView({ call, state, title, here, onBack, onHangUp, }) {
|
|
64
|
+
const handheld = (0, device_1.useDevice)(device => device.handheld);
|
|
65
|
+
const [minimized, setMinimized] = React.useState(false);
|
|
66
|
+
const [windowHost, setWindowHost] = React.useState(undefined);
|
|
67
|
+
const windowed = !handheld && call_window_1.CallWindow.can();
|
|
68
|
+
const camera = call_camera_1.CallCameras.of(call);
|
|
69
|
+
// Coming back to the call's conversation brings it back whole.
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
if (here) {
|
|
72
|
+
setMinimized(false);
|
|
73
|
+
}
|
|
74
|
+
}, [here]);
|
|
75
|
+
// The camera stays off until the user turns it on; the call ending lets go of it.
|
|
76
|
+
React.useEffect(() => () => call_camera_1.CallCameras.end(call), [call]);
|
|
77
|
+
// Opened once a call, closed as it ends: what it is told as it opens is of its start.
|
|
78
|
+
const latest = React.useRef({ title, onHangUp });
|
|
79
|
+
latest.current = { title, onHangUp };
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (!windowed) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setWindowHost((_a = call_window_1.CallWindow.open(latest.current.title, () => latest.current.onHangUp())) !== null && _a !== void 0 ? _a : null);
|
|
86
|
+
return () => call_window_1.CallWindow.close();
|
|
87
|
+
}, [windowed]);
|
|
88
|
+
const shape = windowed && windowHost ? 'window' : minimized || (handheld && !here) ? 'mini' : handheld ? 'full' : 'panel';
|
|
89
|
+
const stage = (React.createElement(VideoStage, { call: call, state: state, camera: camera, shape: shape, title: title, handheld: handheld, onMinimize: () => setMinimized(true), onExpand: () => {
|
|
90
|
+
setMinimized(false);
|
|
91
|
+
if (!here) {
|
|
92
|
+
onBack();
|
|
93
|
+
}
|
|
94
|
+
}, onHangUp: onHangUp }));
|
|
95
|
+
if (windowed && windowHost === undefined) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return shape === 'window' && windowHost ? (0, react_dom_1.createPortal)(stage, windowHost) : stage;
|
|
99
|
+
}
|
|
100
|
+
function useCamera(camera) {
|
|
101
|
+
React.useSyncExternalStore(listener => camera.subscribe(listener), () => { var _a; var _b; return `${camera.off}:${camera.denied}:${camera.facing}:${(_b = (_a = camera.stream) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ''}`; });
|
|
102
|
+
return camera;
|
|
103
|
+
}
|
|
104
|
+
function VideoStage({ call, state, camera, shape, title, handheld, onMinimize, onExpand, onHangUp, }) {
|
|
105
|
+
var _a;
|
|
106
|
+
const t = (0, use_t_1.useT)();
|
|
107
|
+
const [{ settings }, store] = (0, hooks_1.useSettings)();
|
|
108
|
+
const person = call_people_1.CallPeople.of(settings.callPerson).id;
|
|
109
|
+
useCamera(camera);
|
|
110
|
+
// Whoever answers knows whether the user's camera is on and how the call shows (CallScenes).
|
|
111
|
+
React.useEffect(() => call_scenes_1.CallScenes.show(call, { camera: !camera.off, view: shape }), [call, camera.off, shape]);
|
|
112
|
+
const mini = shape === 'mini';
|
|
113
|
+
const drag = useDrag(mini, onExpand);
|
|
114
|
+
const [top, clear] = useClear();
|
|
115
|
+
const pin = useWindowPin(shape === 'window');
|
|
116
|
+
const phase = call_screen_1.CallScreen.phase(t, { phase: state.phase, paused: state.paused, heard: !!state.heard.trim() });
|
|
117
|
+
const words = state.phase === 'speaking' ? (_a = state.reading) === null || _a === void 0 ? void 0 : _a.pieces[state.reading.at] : state.phase === 'listening' ? state.heard.trim() || undefined : undefined;
|
|
118
|
+
const cut = !state.paused && state.phase === 'speaking';
|
|
119
|
+
return (React.createElement("div", { className: `ta-video-call ta-video-${shape} ta-video-${state.paused ? 'paused' : state.phase}`, role: "dialog", "aria-label": title, ...drag.props },
|
|
120
|
+
React.createElement(Person, { key: person, call: call, state: state, person: person, clear: mini ? 0 : clear, onTap: cut && !mini ? () => call.interrupt() : undefined }),
|
|
121
|
+
mini ? (React.createElement("span", { className: "ta-video-mini-phase" }, phase)) : (React.createElement(React.Fragment, null,
|
|
122
|
+
React.createElement("div", { ref: top, className: "ta-video-top" },
|
|
123
|
+
shape !== 'window' && (React.createElement("button", { type: "button", className: "ta-video-round ta-video-minimize", "aria-label": t('ta.call.minimize'), title: t('ta.call.minimize'), onClick: onMinimize },
|
|
124
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.Minimize2, size: 18 }))),
|
|
125
|
+
React.createElement("div", { className: "ta-video-title" },
|
|
126
|
+
React.createElement("span", null, title),
|
|
127
|
+
React.createElement("small", null,
|
|
128
|
+
phase,
|
|
129
|
+
" \u00B7 ",
|
|
130
|
+
t('ta.call.aiMade'))),
|
|
131
|
+
pin && (React.createElement("button", { type: "button", className: `ta-video-round ta-video-pin${pin.pinned ? ' ta-on' : ''}`, "aria-pressed": pin.pinned, "aria-label": t(pin.pinned ? 'ta.call.unpin' : 'ta.call.pin'), title: t(pin.pinned ? 'ta.call.unpin' : 'ta.call.pin'), onClick: pin.toggle },
|
|
132
|
+
React.createElement(icon_1.Icon, { icon: pin.pinned ? lucide_react_1.Pin : lucide_react_1.PinOff, size: 18 })))),
|
|
133
|
+
React.createElement(SelfView, { camera: camera }),
|
|
134
|
+
React.createElement(PeoplePicker, { value: person, onChange: callPerson => store.update({ callPerson }) }),
|
|
135
|
+
words && React.createElement("div", { className: `ta-video-caption${state.phase === 'listening' ? ' ta-mine' : ''}` }, words),
|
|
136
|
+
React.createElement("div", { className: "ta-video-controls" },
|
|
137
|
+
React.createElement("button", { type: "button", className: `ta-video-round${camera.off ? ' ta-off' : ''}`, "aria-pressed": !camera.off, "aria-label": t(camera.denied ? 'ta.call.cameraDenied' : camera.off ? 'ta.call.cameraOn' : 'ta.call.cameraOff'), title: t(camera.denied ? 'ta.call.cameraDenied' : camera.off ? 'ta.call.cameraOn' : 'ta.call.cameraOff'), onClick: () => camera.toggle() },
|
|
138
|
+
React.createElement(icon_1.Icon, { icon: camera.off ? lucide_react_1.CameraOff : lucide_react_1.Camera, size: 22 })),
|
|
139
|
+
React.createElement("button", { type: "button", className: "ta-video-round ta-video-end", "aria-label": t('ta.call.hangUp'), title: t('ta.call.hangUp'), onClick: onHangUp },
|
|
140
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.PhoneOff, size: 26 })),
|
|
141
|
+
handheld ? (React.createElement("button", { type: "button", className: "ta-video-round", "aria-label": t('ta.call.flip'), title: t('ta.call.flip'), disabled: camera.off, onClick: () => camera.flip() },
|
|
142
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.SwitchCamera, size: 22 }))) : (React.createElement("span", { className: "ta-video-round ta-video-spacer" })))))));
|
|
143
|
+
}
|
|
144
|
+
/** What the title of the call lays over the top of the view, in pixels down from it: its ref, and how far. */
|
|
145
|
+
function useClear() {
|
|
146
|
+
const [clear, setClear] = React.useState(0);
|
|
147
|
+
const observer = React.useRef(undefined);
|
|
148
|
+
const ref = React.useCallback((element) => {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
(_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
151
|
+
observer.current = undefined;
|
|
152
|
+
if (!element) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const measure = () => setClear(element.offsetTop + element.offsetHeight);
|
|
156
|
+
measure();
|
|
157
|
+
const View = (_b = element.ownerDocument.defaultView) === null || _b === void 0 ? void 0 : _b.ResizeObserver;
|
|
158
|
+
if (View) {
|
|
159
|
+
observer.current = new View(measure);
|
|
160
|
+
observer.current.observe(element);
|
|
161
|
+
}
|
|
162
|
+
}, []);
|
|
163
|
+
return [ref, clear];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The pin of the window of a video call in Ta Desktop: whether it floats above every window, as the user chose the last
|
|
167
|
+
* time (the app keeps it), and the switch. None elsewhere, nor in an older Ta Desktop.
|
|
168
|
+
*/
|
|
169
|
+
function useWindowPin(on) {
|
|
170
|
+
const pin = React.useMemo(() => (on ? desktop_1.DesktopUtil.callWindowPin() : undefined), [on]);
|
|
171
|
+
const [pinned, setPinned] = React.useState(undefined);
|
|
172
|
+
React.useEffect(() => {
|
|
173
|
+
let live = true;
|
|
174
|
+
pin === null || pin === void 0 ? void 0 : pin().then(now => live && setPinned(now)).catch(() => undefined);
|
|
175
|
+
return () => {
|
|
176
|
+
live = false;
|
|
177
|
+
};
|
|
178
|
+
}, [pin]);
|
|
179
|
+
if (!pin || pinned === undefined) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
pinned,
|
|
184
|
+
toggle: () => {
|
|
185
|
+
const next = !pinned;
|
|
186
|
+
setPinned(next);
|
|
187
|
+
pin(next).then(setPinned, () => setPinned(!next));
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/** What the user's camera shows, small in a corner, as one sees oneself in a video call; mirrored for the front camera. */
|
|
192
|
+
function SelfView({ camera }) {
|
|
193
|
+
const video = React.useRef(null);
|
|
194
|
+
const stream = camera.stream;
|
|
195
|
+
React.useEffect(() => {
|
|
196
|
+
var _a;
|
|
197
|
+
const element = video.current;
|
|
198
|
+
if (element && element.srcObject !== (stream !== null && stream !== void 0 ? stream : null)) {
|
|
199
|
+
element.srcObject = stream !== null && stream !== void 0 ? stream : null;
|
|
200
|
+
void ((_a = element.play) === null || _a === void 0 ? void 0 : _a.call(element).catch(() => undefined));
|
|
201
|
+
}
|
|
202
|
+
}, [stream]);
|
|
203
|
+
if (camera.off || !stream) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return React.createElement("video", { ref: video, className: `ta-video-self${camera.facing === 'user' ? ' ta-mirror' : ''}`, autoPlay: true, muted: true, playsInline: true });
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Who Ta shows as (CallPeople), picked in the call by her face, as a row of round pictures in a corner: the one shown
|
|
210
|
+
* ringed. The choice is kept (settings `callPerson`) for the calls after.
|
|
211
|
+
*/
|
|
212
|
+
function PeoplePicker({ value, onChange }) {
|
|
213
|
+
const t = (0, use_t_1.useT)();
|
|
214
|
+
if (call_people_1.CallPeople.ALL.length < 2) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
return (React.createElement("fieldset", { className: "ta-video-people", "aria-label": t('ta.call.person') }, call_people_1.CallPeople.ALL.map(person => (React.createElement("button", { key: person.id, type: "button", "aria-pressed": person.id === value, className: `ta-video-person-pick${person.id === value ? ' ta-on' : ''}`, "aria-label": t(person.title), title: t(person.title), onClick: () => person.id !== value && onChange(person.id) },
|
|
218
|
+
React.createElement("img", { src: (0, face_files_1.faceUrl)(call_people_1.CallPeople.face(person.id), document), alt: "", draggable: false }))))));
|
|
219
|
+
}
|
|
220
|
+
/** Ta as a person (VideoFace), its clips loaded as the call shows; the dinosaur in its place where they cannot play. */
|
|
221
|
+
function Person({ call, state, person, clear, onTap }) {
|
|
222
|
+
const t = (0, use_t_1.useT)();
|
|
223
|
+
const [failed, setFailed] = React.useState(false);
|
|
224
|
+
const [ready, setReady] = React.useState(false);
|
|
225
|
+
return (React.createElement("div", { className: `ta-video-person${ready ? ' ta-ready' : ''}` },
|
|
226
|
+
!failed && React.createElement(video_face_1.VideoFace, { call: call, person: person, clear: clear, onReady: () => setReady(true), onFailed: () => setFailed(true) }),
|
|
227
|
+
onTap && React.createElement("button", { type: "button", className: "ta-video-tap", "aria-label": t('ta.call.interrupt'), title: t('ta.call.interrupt'), onClick: onTap }),
|
|
228
|
+
failed && React.createElement(ta_avatar_1.DinoFace, { mood: call_screen_1.CallScreen.mood(state), size: 200, talk: { level: () => call.level() }, fill: true, className: "ta-video-dino" }),
|
|
229
|
+
failed && React.createElement("span", { className: "ta-video-failed" }, t('ta.call.faceFailed')),
|
|
230
|
+
!ready && !failed && React.createElement(loading_1.Loading, { compact: true })));
|
|
231
|
+
}
|
|
232
|
+
/** The small window dragged about, keeping to the nearer side; a tap that does not drag brings the call back. */
|
|
233
|
+
function useDrag(on, tap) {
|
|
234
|
+
const [offset, setOffset] = React.useState(undefined);
|
|
235
|
+
const [side, setSide] = React.useState('right');
|
|
236
|
+
const [top, setTop] = React.useState(undefined);
|
|
237
|
+
const start = React.useRef(undefined);
|
|
238
|
+
if (!on) {
|
|
239
|
+
return { props: {} };
|
|
240
|
+
}
|
|
241
|
+
const props = {
|
|
242
|
+
style: {
|
|
243
|
+
...(top === undefined ? {} : { top }),
|
|
244
|
+
...(offset ? { transform: `translate3d(${offset.x}px, ${offset.y}px, 0)`, transition: 'none' } : {}),
|
|
245
|
+
},
|
|
246
|
+
'data-side': side,
|
|
247
|
+
onPointerDown: (event) => {
|
|
248
|
+
var _a, _b;
|
|
249
|
+
start.current = { x: event.clientX, y: event.clientY, id: event.pointerId, moved: false };
|
|
250
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
251
|
+
},
|
|
252
|
+
onPointerMove: (event) => {
|
|
253
|
+
const begun = start.current;
|
|
254
|
+
if (!begun || begun.id !== event.pointerId) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const x = event.clientX - begun.x;
|
|
258
|
+
const y = event.clientY - begun.y;
|
|
259
|
+
if (!begun.moved && Math.hypot(x, y) < DRAG_PX) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
begun.moved = true;
|
|
263
|
+
setOffset({ x, y });
|
|
264
|
+
},
|
|
265
|
+
onPointerUp: (event) => {
|
|
266
|
+
var _a;
|
|
267
|
+
const begun = start.current;
|
|
268
|
+
start.current = undefined;
|
|
269
|
+
if (!begun || begun.id !== event.pointerId) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (!begun.moved) {
|
|
273
|
+
tap();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const element = event.currentTarget;
|
|
277
|
+
const rect = element.getBoundingClientRect();
|
|
278
|
+
const view = (_a = element.ownerDocument.defaultView) !== null && _a !== void 0 ? _a : window;
|
|
279
|
+
setSide(rect.left + rect.width / 2 < view.innerWidth / 2 ? 'left' : 'right');
|
|
280
|
+
setTop(Math.max(12, Math.min(view.innerHeight - rect.height - 12, rect.top)));
|
|
281
|
+
setOffset(undefined);
|
|
282
|
+
},
|
|
283
|
+
onPointerCancel: () => {
|
|
284
|
+
start.current = undefined;
|
|
285
|
+
setOffset(undefined);
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
return { props };
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=video-call-view.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { VoiceCall } from '../assistant/voice-call';
|
|
3
|
+
/**
|
|
4
|
+
* The person of a video call (docs/design/ta-call.md 12, 15, 16): two layers of video (FaceStage), the next clip decoded
|
|
5
|
+
* behind and fading in over the one shown once its first frame is on the screen. What plays is decided in one place,
|
|
6
|
+
* each frame: as Ta reads with a voice service, the clip its ClipPlan has for that moment of the sound, the mouth an
|
|
7
|
+
* extension draws for it laid over it (MouthLayer); otherwise the clips of the state of the call, and the moves of
|
|
8
|
+
* what she says (FaceMoves, the user's own first). Each layer shows the part of its clip its camera aims at
|
|
9
|
+
* (FaceCameras): her face close as she sits, all of her as she stands up and moves.
|
|
10
|
+
*/
|
|
11
|
+
export declare function VideoFace({ call, person, clear, onReady, onFailed, }: {
|
|
12
|
+
call: VoiceCall;
|
|
13
|
+
/** Who she is (CallPeople): her clips play, the same moves and looks as any. */
|
|
14
|
+
person?: string;
|
|
15
|
+
/** How much of the top of the view, in pixels, has something laid over it: her head is kept under it as she stands. */
|
|
16
|
+
clear?: number;
|
|
17
|
+
onReady(): void;
|
|
18
|
+
onFailed(): void;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
//# sourceMappingURL=video-face.d.ts.map
|