@celljs/ta-web 4.28.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-thread.js +15 -2
- package/esm/browser/assistant/call-scenes.d.ts +5 -4
- package/esm/browser/assistant/call-scenes.js +10 -7
- 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/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/host-view.d.ts +1 -1
- package/esm/browser/components/markdown.d.ts +6 -1
- package/esm/browser/components/markdown.js +6 -2
- 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/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 +14 -9
- package/esm/browser/components/settings-view.js +2 -6
- 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 +45 -0
- package/esm/browser/extension/web-api-components.d.ts +4 -0
- package/esm/browser/extension/web-api-contributions.d.ts +13 -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-extension-api.d.ts +7 -9
- 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 +3 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +8 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +3 -2
- package/esm/browser/extension/web-extension-run.js +8 -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 +1136 -1136
- package/esm/browser/i18n/messages-ja.js +20 -1586
- package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/esm/browser/i18n/messages-zh-tw.js +20 -1587
- package/esm/browser/i18n/messages.d.ts +1139 -1136
- package/esm/browser/i18n/messages.js +44 -3183
- 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/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/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +3 -0
- 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 +5 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +0 -7
- package/esm/browser/style/video-call.d.ts +1 -1
- package/esm/browser/style/video-call.js +15 -4
- package/esm/browser/util/call-transcript.d.ts +16 -0
- package/esm/browser/util/call-transcript.js +110 -0
- package/esm/browser/util/process.d.ts +6 -0
- package/esm/browser/util/process.js +18 -5
- 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/clip-plan.d.ts +11 -2
- package/esm/browser/video-call/clip-plan.js +19 -3
- 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 +43 -5
- package/esm/browser/video-call/face-files.js +73 -18
- 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.js +44 -4
- package/esm/browser/video-call/video-face.d.ts +11 -5
- package/esm/browser/video-call/video-face.js +302 -328
- package/esm/browser/workbench.d.ts +8 -0
- package/esm/browser/workbench.js +37 -1
- package/lib/browser/assistant/assistant-thread.js +15 -2
- package/lib/browser/assistant/call-scenes.d.ts +5 -4
- package/lib/browser/assistant/call-scenes.js +10 -7
- 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/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/host-view.d.ts +1 -1
- package/lib/browser/components/markdown.d.ts +6 -1
- package/lib/browser/components/markdown.js +6 -2
- 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/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 +13 -8
- package/lib/browser/components/settings-view.js +2 -6
- 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 +45 -0
- package/lib/browser/extension/web-api-components.d.ts +4 -0
- package/lib/browser/extension/web-api-contributions.d.ts +13 -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-extension-api.d.ts +7 -9
- 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 +3 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +8 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +3 -2
- package/lib/browser/extension/web-extension-run.js +8 -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 +1136 -1136
- package/lib/browser/i18n/messages-ja.js +20 -1586
- package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/lib/browser/i18n/messages-zh-tw.js +20 -1587
- package/lib/browser/i18n/messages.d.ts +1139 -1136
- package/lib/browser/i18n/messages.js +44 -3183
- 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/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/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +3 -0
- 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 +5 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +0 -7
- package/lib/browser/style/video-call.d.ts +1 -1
- package/lib/browser/style/video-call.js +15 -4
- package/lib/browser/util/call-transcript.d.ts +17 -0
- package/lib/browser/util/call-transcript.js +113 -0
- package/lib/browser/util/process.d.ts +6 -0
- package/lib/browser/util/process.js +17 -4
- 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/clip-plan.d.ts +11 -2
- package/lib/browser/video-call/clip-plan.js +19 -3
- 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 +43 -5
- package/lib/browser/video-call/face-files.js +73 -18
- 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.js +44 -4
- package/lib/browser/video-call/video-face.d.ts +11 -5
- package/lib/browser/video-call/video-face.js +302 -328
- package/lib/browser/workbench.d.ts +8 -0
- package/lib/browser/workbench.js +36 -0
- package/package.json +7 -7
- package/public/faces/README.md +17 -4
- 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/dance.mp4 +0 -0
- package/public/faces/face.jpg +0 -0
- package/public/faces/framing.json +1 -0
- package/public/faces/lips.json +1 -1
- package/public/faces/stretch.mp4 +0 -0
- package/esm/browser/video-call/face-clips.d.ts +0 -33
- package/esm/browser/video-call/face-clips.js +0 -93
- package/lib/browser/video-call/face-clips.d.ts +0 -34
- package/lib/browser/video-call/face-clips.js +0 -96
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FaceBlend = exports.FaceStage = exports.BLEND_MS = exports.SEAM_MS = void 0;
|
|
4
|
+
/** How long a clip fades in over the one before at a seam (both on the seated frame), in ms. */
|
|
5
|
+
exports.SEAM_MS = 120;
|
|
6
|
+
/** How long it fades in when it cuts into a clip midway: the more her pose differs, the longer, in ms. */
|
|
7
|
+
exports.BLEND_MS = { min: 200, max: 450, unknown: 300 };
|
|
8
|
+
/** How long a layer may take to show its first frame before it comes in anyway, in ms. */
|
|
9
|
+
const FIRST_FRAME_MS = 1500;
|
|
10
|
+
/**
|
|
11
|
+
* The two layers of video of the person of a video call (docs/design/ta-call.md 16), as players switch streams without
|
|
12
|
+
* a black frame: the next clip loads in the layer behind, hidden, and only once its first frame is on the screen
|
|
13
|
+
* (requestVideoFrameCallback) does it come over the one in front, fading in from nothing while that one stays whole
|
|
14
|
+
* under it; then the one under is hidden and paused. So the picture is whole at every moment: no empty layer, no
|
|
15
|
+
* room behind showing through. While a clip fades in, the next waits (the last asked), never taking the layer that
|
|
16
|
+
* shows. A clip known to come next is loaded and decoded ahead in the layer behind (prime).
|
|
17
|
+
*/
|
|
18
|
+
class FaceStage {
|
|
19
|
+
constructor(videos,
|
|
20
|
+
/** The URL a clip plays from. */
|
|
21
|
+
urlOf,
|
|
22
|
+
/** Now, in ms. */
|
|
23
|
+
now, events = {}) {
|
|
24
|
+
this.videos = videos;
|
|
25
|
+
this.urlOf = urlOf;
|
|
26
|
+
this.now = now;
|
|
27
|
+
this.events = events;
|
|
28
|
+
/** The layer in front, whole. */
|
|
29
|
+
this.front = 0;
|
|
30
|
+
/** The clip each layer plays, by name (what the cameras frame). */
|
|
31
|
+
this.names = [undefined, undefined];
|
|
32
|
+
this.token = 0;
|
|
33
|
+
this.closed = false;
|
|
34
|
+
videos.forEach((video, index) => {
|
|
35
|
+
FaceStage.layer(video, index === 0 ? 0 : -1);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** The clip that shows, or comes to: the last asked for. */
|
|
39
|
+
get wanted() {
|
|
40
|
+
var _a;
|
|
41
|
+
var _b, _c, _d;
|
|
42
|
+
return (_d = (_a = ((_c = (_b = this.pending) !== null && _b !== void 0 ? _b : this.coming) !== null && _c !== void 0 ? _c : this.loading)) === null || _a === void 0 ? void 0 : _a.clip) !== null && _d !== void 0 ? _d : this.names[this.front];
|
|
43
|
+
}
|
|
44
|
+
/** The layer that plays the clip on top, fading in or whole, with its clip. */
|
|
45
|
+
playing() {
|
|
46
|
+
var _a;
|
|
47
|
+
var _b;
|
|
48
|
+
const index = (_b = (_a = this.coming) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : this.front;
|
|
49
|
+
return { video: this.videos[index], clip: this.names[index] };
|
|
50
|
+
}
|
|
51
|
+
/** While a clip fades in: the layer under it, and how much of the one on top shows (0 to 1). */
|
|
52
|
+
under() {
|
|
53
|
+
const coming = this.coming;
|
|
54
|
+
return coming && { video: this.videos[this.front], alpha: FaceStage.ease(this.progress(coming)) };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Plays `clip` from `at` seconds, fading in over `ms` once its first frame shows; `again`: though it is the clip
|
|
58
|
+
* that shows (another moment of it, as she hurries back to where she sits down).
|
|
59
|
+
*/
|
|
60
|
+
show(clip, at = 0, ms = exports.SEAM_MS, again = false) {
|
|
61
|
+
if (this.closed || (clip === this.wanted && !again)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const wanted = { clip, at, ms };
|
|
65
|
+
if (this.coming) {
|
|
66
|
+
this.pending = wanted;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.pending = undefined;
|
|
70
|
+
this.load(wanted);
|
|
71
|
+
}
|
|
72
|
+
/** Whether a clip loads or fades in: one asked for is on its way. */
|
|
73
|
+
busy() {
|
|
74
|
+
return !!(this.loading || this.coming || this.pending);
|
|
75
|
+
}
|
|
76
|
+
/** Whether the clip asked for last comes from `at` seconds (a show `again` on its way). */
|
|
77
|
+
jumping(at) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const wanted = (_b = (_a = this.pending) !== null && _a !== void 0 ? _a : this.coming) !== null && _b !== void 0 ? _b : this.loading;
|
|
80
|
+
return !!wanted && Math.abs(wanted.at - at) < 0.05;
|
|
81
|
+
}
|
|
82
|
+
/** Loads `clip` ahead in the layer behind, decoded at `at`, so that it shows at once when asked for. */
|
|
83
|
+
prime(clip, at = 0) {
|
|
84
|
+
var _a;
|
|
85
|
+
if (this.closed || this.loading || this.coming || clip === this.names[this.front]) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const index = 1 - this.front;
|
|
89
|
+
if (((_a = this.primed) === null || _a === void 0 ? void 0 : _a.index) === index && this.primed.clip === clip) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const video = this.videos[index];
|
|
93
|
+
video.pause();
|
|
94
|
+
video.src = this.urlOf(clip);
|
|
95
|
+
video.currentTime = at;
|
|
96
|
+
this.primed = { index, clip, at };
|
|
97
|
+
}
|
|
98
|
+
/** Each frame of the screen: the clip fading in shows a little more; done, the one under goes. */
|
|
99
|
+
frame() {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
const coming = this.coming;
|
|
102
|
+
if (!coming) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const part = this.progress(coming);
|
|
106
|
+
this.videos[coming.index].style.opacity = FaceStage.ease(part).toFixed(3);
|
|
107
|
+
if (part < 1) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const old = this.videos[this.front];
|
|
111
|
+
this.front = coming.index;
|
|
112
|
+
this.coming = undefined;
|
|
113
|
+
FaceStage.layer(this.videos[this.front], 0);
|
|
114
|
+
FaceStage.layer(old, -1);
|
|
115
|
+
old.pause();
|
|
116
|
+
(_b = (_a = this.events).shown) === null || _b === void 0 ? void 0 : _b.call(_a, coming.clip);
|
|
117
|
+
const next = this.pending;
|
|
118
|
+
this.pending = undefined;
|
|
119
|
+
if (next && next.clip !== this.names[this.front]) {
|
|
120
|
+
this.load(next);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
close() {
|
|
124
|
+
this.closed = true;
|
|
125
|
+
this.token++;
|
|
126
|
+
}
|
|
127
|
+
load(wanted) {
|
|
128
|
+
const index = 1 - this.front;
|
|
129
|
+
const video = this.videos[index];
|
|
130
|
+
const token = ++this.token;
|
|
131
|
+
const primed = this.primed;
|
|
132
|
+
this.primed = undefined;
|
|
133
|
+
this.loading = { ...wanted, index, token };
|
|
134
|
+
this.names[index] = wanted.clip;
|
|
135
|
+
video.dataset.clip = wanted.clip;
|
|
136
|
+
const src = this.urlOf(wanted.clip);
|
|
137
|
+
if (!((primed === null || primed === void 0 ? void 0 : primed.index) === index && primed.clip === wanted.clip && video.src === src && Math.abs(primed.at - wanted.at) < 0.05)) {
|
|
138
|
+
if (video.src !== src) {
|
|
139
|
+
video.src = src;
|
|
140
|
+
}
|
|
141
|
+
video.currentTime = wanted.at;
|
|
142
|
+
}
|
|
143
|
+
video.playbackRate = 1;
|
|
144
|
+
video.play().then(() => this.firstFrame(video, token), error => {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
if (token === this.token && !this.closed) {
|
|
147
|
+
this.loading = undefined;
|
|
148
|
+
this.names[index] = undefined;
|
|
149
|
+
(_b = (_a = this.events).failed) === null || _b === void 0 ? void 0 : _b.call(_a, wanted.clip, error);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** Its first frame is on the screen (or it is late): the clip comes in. */
|
|
154
|
+
firstFrame(video, token) {
|
|
155
|
+
let done = false;
|
|
156
|
+
const come = () => {
|
|
157
|
+
if (!done) {
|
|
158
|
+
done = true;
|
|
159
|
+
this.come(token);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
if (typeof video.requestVideoFrameCallback === 'function') {
|
|
163
|
+
video.requestVideoFrameCallback(come);
|
|
164
|
+
}
|
|
165
|
+
else if (video.readyState >= 2) {
|
|
166
|
+
come();
|
|
167
|
+
}
|
|
168
|
+
setTimeout(come, FIRST_FRAME_MS);
|
|
169
|
+
}
|
|
170
|
+
come(token) {
|
|
171
|
+
const loading = this.loading;
|
|
172
|
+
if (!loading || loading.token !== token || this.closed) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.loading = undefined;
|
|
176
|
+
this.coming = { ...loading, since: this.now() };
|
|
177
|
+
const video = this.videos[loading.index];
|
|
178
|
+
FaceStage.layer(video, 1);
|
|
179
|
+
video.style.opacity = '0';
|
|
180
|
+
this.frame();
|
|
181
|
+
}
|
|
182
|
+
progress(coming) {
|
|
183
|
+
return coming.ms <= 0 ? 1 : Math.max(0, Math.min(1, (this.now() - coming.since) / coming.ms));
|
|
184
|
+
}
|
|
185
|
+
/** Smooth at both ends: the clip on top comes in without a step. */
|
|
186
|
+
static ease(part) {
|
|
187
|
+
return part * part * (3 - 2 * part);
|
|
188
|
+
}
|
|
189
|
+
/** A layer whole in front (0), fading in over it (1), or hidden behind (-1). */
|
|
190
|
+
static layer(video, place) {
|
|
191
|
+
video.style.zIndex = place === 1 ? '2' : place === 0 ? '1' : '0';
|
|
192
|
+
video.style.opacity = place === -1 ? '0' : place === 0 ? '1' : video.style.opacity;
|
|
193
|
+
video.classList.toggle('ta-front', place !== -1);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
exports.FaceStage = FaceStage;
|
|
197
|
+
/**
|
|
198
|
+
* How long a clip fades in over another, by how far apart her pose is in the two frames (docs/design/ta-call.md 16):
|
|
199
|
+
* all clips begin and end on the same seated frame, so at a seam the fade only hides the step of decoding; cutting in
|
|
200
|
+
* midway, the farther her face moved, the slower it fades, so that the two poses blend rather than jump.
|
|
201
|
+
*/
|
|
202
|
+
var FaceBlend;
|
|
203
|
+
(function (FaceBlend) {
|
|
204
|
+
function ms(from, to, seam) {
|
|
205
|
+
if (seam) {
|
|
206
|
+
return exports.SEAM_MS;
|
|
207
|
+
}
|
|
208
|
+
if (!from || !to || from.length < 4 || to.length < 4) {
|
|
209
|
+
return exports.BLEND_MS.unknown;
|
|
210
|
+
}
|
|
211
|
+
const width = Math.max(1, from[2] - from[0], to[2] - to[0]);
|
|
212
|
+
const moved = Math.hypot((from[0] + from[2] - to[0] - to[2]) / 2, (from[1] + from[3] - to[1] - to[3]) / 2) / width;
|
|
213
|
+
const scaled = Math.abs((to[2] - to[0]) / Math.max(1, from[2] - from[0]) - 1);
|
|
214
|
+
return Math.round(Math.min(exports.BLEND_MS.max, exports.BLEND_MS.min + 500 * (moved + scaled)));
|
|
215
|
+
}
|
|
216
|
+
FaceBlend.ms = ms;
|
|
217
|
+
/** Whether a frame is on the seated frame every clip begins and ends on: its first or last few. */
|
|
218
|
+
function seated(frame, frames) {
|
|
219
|
+
return frame <= 1 || frame >= frames - 2;
|
|
220
|
+
}
|
|
221
|
+
FaceBlend.seated = seated;
|
|
222
|
+
})(FaceBlend || (exports.FaceBlend = FaceBlend = {}));
|
|
223
|
+
//# sourceMappingURL=face-stage.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { VoiceCall } from '../assistant/voice-call';
|
|
2
|
+
import type { CallReading } from '../assistant/voice-call-protocol';
|
|
3
|
+
import type { WebCallMouth, WebMouthFrame, WebMouthSession } from '../extension/web-api-call';
|
|
4
|
+
import { type ClipPlan } from './clip-plan';
|
|
5
|
+
import { type Placement } from './face-camera';
|
|
6
|
+
import type { FaceFiles } from './face-files';
|
|
7
|
+
/**
|
|
8
|
+
* What a video call shows at a frame: the reading that drives it, the layer of video on top and its clip, and while that
|
|
9
|
+
* clip fades in (FaceStage) the layer under it and how much of the one on top shows.
|
|
10
|
+
*/
|
|
11
|
+
export interface Showing {
|
|
12
|
+
reading: CallReading;
|
|
13
|
+
video: HTMLVideoElement;
|
|
14
|
+
clip: string;
|
|
15
|
+
under?: {
|
|
16
|
+
video: HTMLVideoElement;
|
|
17
|
+
alpha: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The mouth an extension draws for what Ta reads (WebCallMouth), laid over the clip: told the sound of each reading as
|
|
22
|
+
* it comes with the frame of the clip at each moment of it (ClipPlan), it gives that frame's lower face drawn again
|
|
23
|
+
* for that sound. As each frame of the clip is shown (requestVideoFrameCallback), that frame and the mouth of that
|
|
24
|
+
* moment of the sound are drawn together, the mouth moved with her face when it was drawn for a frame near it: the
|
|
25
|
+
* clip and the sound keep their own clocks a little apart. The reading waits for it as long as it asks (holdMs).
|
|
26
|
+
*/
|
|
27
|
+
export declare class MouthLayer {
|
|
28
|
+
protected readonly call: VoiceCall;
|
|
29
|
+
protected readonly planOf: (say: number) => ClipPlan;
|
|
30
|
+
protected readonly canvas: HTMLCanvasElement | null;
|
|
31
|
+
protected readonly view: Window;
|
|
32
|
+
protected readonly faces: FaceFiles;
|
|
33
|
+
/** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
|
|
34
|
+
protected readonly placeOf: (video: HTMLVideoElement, width: number) => Placement | undefined;
|
|
35
|
+
protected readonly showing: () => Showing | undefined;
|
|
36
|
+
protected session?: WebMouthSession;
|
|
37
|
+
protected offSound?: () => void;
|
|
38
|
+
protected closed: boolean;
|
|
39
|
+
/** Of each reading: the seconds of its sound that came, and the slots told. */
|
|
40
|
+
protected readonly sounds: Map<number, {
|
|
41
|
+
seconds: number;
|
|
42
|
+
told: number;
|
|
43
|
+
}>;
|
|
44
|
+
protected say?: number;
|
|
45
|
+
protected atSlot: number;
|
|
46
|
+
/** The reading that played as the mouth opened: its sound came in part, so its frames would not fit. */
|
|
47
|
+
protected missed?: number;
|
|
48
|
+
/** The canvas shows the frames of the clip now, not the layers of video under it. */
|
|
49
|
+
protected drawing: boolean;
|
|
50
|
+
protected offFrames?: () => void;
|
|
51
|
+
protected fading?: ReturnType<typeof setTimeout>;
|
|
52
|
+
constructor(call: VoiceCall, planOf: (say: number) => ClipPlan, canvas: HTMLCanvasElement | null, view: Window, faces: FaceFiles,
|
|
53
|
+
/** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
|
|
54
|
+
placeOf: (video: HTMLVideoElement, width: number) => Placement | undefined, showing: () => Showing | undefined);
|
|
55
|
+
open(mouth: WebCallMouth | undefined): Promise<void>;
|
|
56
|
+
protected sound(say: number, pcm: Uint8Array | undefined, rate: number): void;
|
|
57
|
+
/** The reading plays at `seconds` of its sound: the extension knows what it need not draw any more. */
|
|
58
|
+
follow(reading: CallReading, seconds: number): void;
|
|
59
|
+
/** Draws as each frame of the layers of video is shown, the one in front. */
|
|
60
|
+
watch(videos: HTMLVideoElement[]): void;
|
|
61
|
+
/** A frame of `video` is shown, `mediaTime` into its clip: it is drawn, with the mouth of the moment over it. */
|
|
62
|
+
protected shown(video: HTMLVideoElement, mediaTime: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* 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
|
|
65
|
+
* nearer the one shown (the frame comes to the screen a little after its moment): a mouth a slot early or late is
|
|
66
|
+
* not seen, one laid over a frame it was not drawn for is.
|
|
67
|
+
*/
|
|
68
|
+
protected nearest(session: WebMouthSession, say: number, slot: number, clip: string, frame: number): WebMouthFrame | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Where the mouth drawn goes over `frame` of `clip`: its place in the frame it was drawn for, moved and scaled as her
|
|
71
|
+
* face is from that frame to this one; undefined when it is of another clip, or of a frame too far.
|
|
72
|
+
*/
|
|
73
|
+
protected place(drawn: WebMouthFrame | undefined, clip: string, frame: number): [number, number, number, number] | undefined;
|
|
74
|
+
/** Nothing over the clip: Ta is not reading with its voice service now. */
|
|
75
|
+
clear(): void;
|
|
76
|
+
/** The canvas shows the frames of the clip now. */
|
|
77
|
+
protected show(canvas: HTMLCanvasElement): void;
|
|
78
|
+
/** The canvas the size it shows at, cleared. */
|
|
79
|
+
protected fit(canvas: HTMLCanvasElement): CanvasRenderingContext2D | null;
|
|
80
|
+
close(): void;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=mouth-layer.d.ts.map
|
|
@@ -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
|
|
@@ -43,10 +43,13 @@ const icon_1 = require("../components/icon");
|
|
|
43
43
|
const loading_1 = require("../components/loading");
|
|
44
44
|
const ta_avatar_1 = require("../components/ta-avatar");
|
|
45
45
|
const device_1 = require("../device/device");
|
|
46
|
+
const hooks_1 = require("../hooks");
|
|
46
47
|
const use_t_1 = require("../i18n/use-t");
|
|
47
48
|
const desktop_1 = require("../util/desktop");
|
|
48
49
|
const call_camera_1 = require("./call-camera");
|
|
50
|
+
const call_people_1 = require("./call-people");
|
|
49
51
|
const call_window_1 = require("./call-window");
|
|
52
|
+
const face_files_1 = require("./face-files");
|
|
50
53
|
const video_face_1 = require("./video-face");
|
|
51
54
|
/** How far a finger or the mouse moves before the small window is dragged rather than tapped, in pixels. */
|
|
52
55
|
const DRAG_PX = 6;
|
|
@@ -101,19 +104,22 @@ function useCamera(camera) {
|
|
|
101
104
|
function VideoStage({ call, state, camera, shape, title, handheld, onMinimize, onExpand, onHangUp, }) {
|
|
102
105
|
var _a;
|
|
103
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;
|
|
104
109
|
useCamera(camera);
|
|
105
110
|
// Whoever answers knows whether the user's camera is on and how the call shows (CallScenes).
|
|
106
111
|
React.useEffect(() => call_scenes_1.CallScenes.show(call, { camera: !camera.off, view: shape }), [call, camera.off, shape]);
|
|
107
112
|
const mini = shape === 'mini';
|
|
108
113
|
const drag = useDrag(mini, onExpand);
|
|
114
|
+
const [top, clear] = useClear();
|
|
109
115
|
const pin = useWindowPin(shape === 'window');
|
|
110
116
|
const phase = call_screen_1.CallScreen.phase(t, { phase: state.phase, paused: state.paused, heard: !!state.heard.trim() });
|
|
111
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;
|
|
112
118
|
const cut = !state.paused && state.phase === 'speaking';
|
|
113
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 },
|
|
114
|
-
React.createElement(Person, { call: call, state: state, onTap: cut && !mini ? () => call.interrupt() : undefined }),
|
|
120
|
+
React.createElement(Person, { key: person, call: call, state: state, person: person, clear: mini ? 0 : clear, onTap: cut && !mini ? () => call.interrupt() : undefined }),
|
|
115
121
|
mini ? (React.createElement("span", { className: "ta-video-mini-phase" }, phase)) : (React.createElement(React.Fragment, null,
|
|
116
|
-
React.createElement("div", { className: "ta-video-top" },
|
|
122
|
+
React.createElement("div", { ref: top, className: "ta-video-top" },
|
|
117
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 },
|
|
118
124
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Minimize2, size: 18 }))),
|
|
119
125
|
React.createElement("div", { className: "ta-video-title" },
|
|
@@ -125,6 +131,7 @@ function VideoStage({ call, state, camera, shape, title, handheld, onMinimize, o
|
|
|
125
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 },
|
|
126
132
|
React.createElement(icon_1.Icon, { icon: pin.pinned ? lucide_react_1.Pin : lucide_react_1.PinOff, size: 18 })))),
|
|
127
133
|
React.createElement(SelfView, { camera: camera }),
|
|
134
|
+
React.createElement(PeoplePicker, { value: person, onChange: callPerson => store.update({ callPerson }) }),
|
|
128
135
|
words && React.createElement("div", { className: `ta-video-caption${state.phase === 'listening' ? ' ta-mine' : ''}` }, words),
|
|
129
136
|
React.createElement("div", { className: "ta-video-controls" },
|
|
130
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() },
|
|
@@ -134,6 +141,27 @@ function VideoStage({ call, state, camera, shape, title, handheld, onMinimize, o
|
|
|
134
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() },
|
|
135
142
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.SwitchCamera, size: 22 }))) : (React.createElement("span", { className: "ta-video-round ta-video-spacer" })))))));
|
|
136
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
|
+
}
|
|
137
165
|
/**
|
|
138
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
|
|
139
167
|
* time (the app keeps it), and the switch. None elsewhere, nor in an older Ta Desktop.
|
|
@@ -177,13 +205,25 @@ function SelfView({ camera }) {
|
|
|
177
205
|
}
|
|
178
206
|
return React.createElement("video", { ref: video, className: `ta-video-self${camera.facing === 'user' ? ' ta-mirror' : ''}`, autoPlay: true, muted: true, playsInline: true });
|
|
179
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
|
+
}
|
|
180
220
|
/** Ta as a person (VideoFace), its clips loaded as the call shows; the dinosaur in its place where they cannot play. */
|
|
181
|
-
function Person({ call, state, onTap }) {
|
|
221
|
+
function Person({ call, state, person, clear, onTap }) {
|
|
182
222
|
const t = (0, use_t_1.useT)();
|
|
183
223
|
const [failed, setFailed] = React.useState(false);
|
|
184
224
|
const [ready, setReady] = React.useState(false);
|
|
185
225
|
return (React.createElement("div", { className: `ta-video-person${ready ? ' ta-ready' : ''}` },
|
|
186
|
-
!failed && React.createElement(video_face_1.VideoFace, { call: call, onReady: () => setReady(true), onFailed: () => setFailed(true) }),
|
|
226
|
+
!failed && React.createElement(video_face_1.VideoFace, { call: call, person: person, clear: clear, onReady: () => setReady(true), onFailed: () => setFailed(true) }),
|
|
187
227
|
onTap && React.createElement("button", { type: "button", className: "ta-video-tap", "aria-label": t('ta.call.interrupt'), title: t('ta.call.interrupt'), onClick: onTap }),
|
|
188
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" }),
|
|
189
229
|
failed && React.createElement("span", { className: "ta-video-failed" }, t('ta.call.faceFailed')),
|