@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
|
@@ -1,32 +1,70 @@
|
|
|
1
|
+
import type { ClipFraming } from './face-camera';
|
|
1
2
|
/** A URL of the page's own, from the document a video call draws in (its window is about:blank). */
|
|
2
3
|
export declare function faceUrl(path: string, doc: Document): string;
|
|
3
4
|
/**
|
|
4
5
|
* The files of the person of a video call (faces/README.md), as they are now: their names stay the same from one Ta to
|
|
5
6
|
* the next while the files of the server are kept a year, so each is asked again once a page (a 304 when unchanged)
|
|
6
7
|
* and played from its copy in memory. A clip a cache kept from a Ta before would show another person than the one the
|
|
7
|
-
* mouth is drawn for. With where her face is in each frame (lips.json),
|
|
8
|
+
* mouth is drawn for. With where her face is in each frame (lips.json), the frames of the clips without a mouth, and
|
|
9
|
+
* how the clips she stands up in are framed (framing.json). Of one person of those Ta has (CallPeople): her files are in
|
|
10
|
+
* a directory of her own (`blonde/`), the first person's at the top; the clips are named here as the first person's are
|
|
11
|
+
* (`talk-1`), and `full` gives the name of the file, as lips.json and the mouth know it (`blonde/talk-1`).
|
|
8
12
|
*/
|
|
9
13
|
export declare class FaceFiles {
|
|
10
14
|
protected readonly base: string;
|
|
15
|
+
/** The directory of the person in faces/ (`blonde/`), `''` for the first. */
|
|
16
|
+
readonly person: string;
|
|
11
17
|
protected static current?: FaceFiles;
|
|
12
18
|
/** The URL each file plays from: its copy in memory, else its own. */
|
|
13
19
|
protected readonly urls: Map<string, string>;
|
|
14
20
|
protected faceBoxes: Record<string, number[][]>;
|
|
15
21
|
/** The frames of the clips no mouth is drawn on (lips.json `plain`). */
|
|
16
22
|
protected plainFrames: Record<string, number>;
|
|
23
|
+
protected framings: Record<string, ClipFraming>;
|
|
17
24
|
loaded: boolean;
|
|
18
25
|
readonly ready: Promise<void>;
|
|
19
|
-
protected constructor(base: string
|
|
20
|
-
/** The
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
protected constructor(base: string,
|
|
27
|
+
/** The directory of the person in faces/ (`blonde/`), `''` for the first. */
|
|
28
|
+
person: string);
|
|
29
|
+
/** The files of a person (CallPeople.dir) for the page, loaded once (again as the person changes). */
|
|
30
|
+
static of(doc: Document, person?: string): FaceFiles;
|
|
31
|
+
static poster(doc: Document, person?: string): string;
|
|
32
|
+
/** The name of a clip of this person as lips.json and the mouth know it; one of the user's (`own:…`) as it is. */
|
|
33
|
+
full(clip: string): string;
|
|
23
34
|
/** Where her face is (x1, y1, x2, y2) in each frame of a clip; undefined for a clip lips.json does not have. */
|
|
24
35
|
boxes(clip: string): readonly number[][] | undefined;
|
|
25
36
|
/** The frames of a clip; undefined for one lips.json does not have. */
|
|
26
37
|
frames(clip: string): number | undefined;
|
|
38
|
+
/** How a clip she stands up in is framed (FaceCamera); undefined for the others, framed as they are. */
|
|
39
|
+
framing(clip: string): ClipFraming | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A clip of the user's (WebCallMove), played from its URL as Ta's own are: its frames, where her face is in each,
|
|
42
|
+
* and how it is framed as she stands up.
|
|
43
|
+
*/
|
|
44
|
+
add(clip: string, file: {
|
|
45
|
+
url: string;
|
|
46
|
+
frames: number;
|
|
47
|
+
boxes?: number[][];
|
|
48
|
+
framing?: {
|
|
49
|
+
rest: number[];
|
|
50
|
+
body: number[][];
|
|
51
|
+
fps: number;
|
|
52
|
+
};
|
|
53
|
+
}): void;
|
|
27
54
|
clip(name: string): string;
|
|
28
55
|
protected load(): Promise<void>;
|
|
56
|
+
/** The framings of framing.json, those whole. */
|
|
57
|
+
static framings(file: FramingFile | undefined): Record<string, ClipFraming>;
|
|
29
58
|
/** The file as the server has it now. */
|
|
30
59
|
protected fresh(file: string): Promise<Response>;
|
|
31
60
|
}
|
|
61
|
+
/** faces/framing.json: of each clip she stands up in, where the picture of the others is (x, y, width, height) and her body. */
|
|
62
|
+
export interface FramingFile {
|
|
63
|
+
fps?: number;
|
|
64
|
+
clips?: Record<string, {
|
|
65
|
+
rest?: number[];
|
|
66
|
+
body?: number[][];
|
|
67
|
+
back?: number;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
32
70
|
//# sourceMappingURL=face-files.d.ts.map
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FaceFiles = void 0;
|
|
4
4
|
exports.faceUrl = faceUrl;
|
|
5
|
-
/** The picture shown until a clip plays (faces/README.md). */
|
|
6
|
-
const POSTER = '
|
|
5
|
+
/** The picture shown until a clip plays (faces/README.md), of a person (CallPeople). */
|
|
6
|
+
const POSTER = 'poster.jpg';
|
|
7
7
|
/** A URL of the page's own, from the document a video call draws in (its window is about:blank). */
|
|
8
8
|
function faceUrl(path, doc) {
|
|
9
9
|
return new URL(path, doc.baseURI === 'about:blank' ? document.baseURI : doc.baseURI).href;
|
|
@@ -12,63 +12,118 @@ function faceUrl(path, doc) {
|
|
|
12
12
|
* The files of the person of a video call (faces/README.md), as they are now: their names stay the same from one Ta to
|
|
13
13
|
* the next while the files of the server are kept a year, so each is asked again once a page (a 304 when unchanged)
|
|
14
14
|
* and played from its copy in memory. A clip a cache kept from a Ta before would show another person than the one the
|
|
15
|
-
* mouth is drawn for. With where her face is in each frame (lips.json),
|
|
15
|
+
* mouth is drawn for. With where her face is in each frame (lips.json), the frames of the clips without a mouth, and
|
|
16
|
+
* how the clips she stands up in are framed (framing.json). Of one person of those Ta has (CallPeople): her files are in
|
|
17
|
+
* a directory of her own (`blonde/`), the first person's at the top; the clips are named here as the first person's are
|
|
18
|
+
* (`talk-1`), and `full` gives the name of the file, as lips.json and the mouth know it (`blonde/talk-1`).
|
|
16
19
|
*/
|
|
17
20
|
class FaceFiles {
|
|
18
|
-
constructor(base
|
|
21
|
+
constructor(base,
|
|
22
|
+
/** The directory of the person in faces/ (`blonde/`), `''` for the first. */
|
|
23
|
+
person) {
|
|
19
24
|
this.base = base;
|
|
25
|
+
this.person = person;
|
|
20
26
|
/** The URL each file plays from: its copy in memory, else its own. */
|
|
21
27
|
this.urls = new Map();
|
|
22
28
|
this.faceBoxes = {};
|
|
23
29
|
/** The frames of the clips no mouth is drawn on (lips.json `plain`). */
|
|
24
30
|
this.plainFrames = {};
|
|
31
|
+
this.framings = {};
|
|
25
32
|
this.loaded = false;
|
|
26
33
|
this.ready = this.load().finally(() => {
|
|
27
34
|
this.loaded = true;
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
|
-
/** The files of the page, loaded once. */
|
|
31
|
-
static of(doc) {
|
|
37
|
+
/** The files of a person (CallPeople.dir) for the page, loaded once (again as the person changes). */
|
|
38
|
+
static of(doc, person = '') {
|
|
32
39
|
var _a;
|
|
33
40
|
const base = faceUrl('faces/', doc);
|
|
34
|
-
if (((_a = FaceFiles.current) === null || _a === void 0 ? void 0 : _a.base) !== base) {
|
|
35
|
-
FaceFiles.current = new FaceFiles(base);
|
|
41
|
+
if (((_a = FaceFiles.current) === null || _a === void 0 ? void 0 : _a.base) !== base || FaceFiles.current.person !== person) {
|
|
42
|
+
FaceFiles.current = new FaceFiles(base, person);
|
|
36
43
|
}
|
|
37
44
|
return FaceFiles.current;
|
|
38
45
|
}
|
|
39
|
-
static poster(doc) {
|
|
46
|
+
static poster(doc, person = '') {
|
|
40
47
|
var _a;
|
|
41
|
-
|
|
42
|
-
return (
|
|
48
|
+
const current = FaceFiles.current;
|
|
49
|
+
return (_a = ((current === null || current === void 0 ? void 0 : current.person) === person ? current.urls.get(`${person}${POSTER}`) : undefined)) !== null && _a !== void 0 ? _a : faceUrl(`faces/${person}${POSTER}`, doc);
|
|
50
|
+
}
|
|
51
|
+
/** The name of a clip of this person as lips.json and the mouth know it; one of the user's (`own:…`) as it is. */
|
|
52
|
+
full(clip) {
|
|
53
|
+
return clip.includes(':') ? clip : `${this.person}${clip}`;
|
|
43
54
|
}
|
|
44
55
|
/** Where her face is (x1, y1, x2, y2) in each frame of a clip; undefined for a clip lips.json does not have. */
|
|
45
56
|
boxes(clip) {
|
|
46
|
-
return this.faceBoxes[clip];
|
|
57
|
+
return this.faceBoxes[this.full(clip)];
|
|
47
58
|
}
|
|
48
59
|
/** The frames of a clip; undefined for one lips.json does not have. */
|
|
49
60
|
frames(clip) {
|
|
50
61
|
var _a;
|
|
51
62
|
var _b;
|
|
52
|
-
return (_b = (_a = this.faceBoxes[clip]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : this.plainFrames[clip];
|
|
63
|
+
return (_b = (_a = this.faceBoxes[this.full(clip)]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : this.plainFrames[this.full(clip)];
|
|
64
|
+
}
|
|
65
|
+
/** How a clip she stands up in is framed (FaceCamera); undefined for the others, framed as they are. */
|
|
66
|
+
framing(clip) {
|
|
67
|
+
return this.framings[this.full(clip)];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A clip of the user's (WebCallMove), played from its URL as Ta's own are: its frames, where her face is in each,
|
|
71
|
+
* and how it is framed as she stands up.
|
|
72
|
+
*/
|
|
73
|
+
add(clip, file) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
this.urls.set(`${clip}.mp4`, file.url);
|
|
76
|
+
if ((_a = file.boxes) === null || _a === void 0 ? void 0 : _a.length) {
|
|
77
|
+
this.faceBoxes[clip] = file.boxes;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.plainFrames[clip] = file.frames;
|
|
81
|
+
}
|
|
82
|
+
Object.assign(this.framings, FaceFiles.framings({ fps: (_b = file.framing) === null || _b === void 0 ? void 0 : _b.fps, clips: file.framing ? { [clip]: file.framing } : {} }));
|
|
53
83
|
}
|
|
54
84
|
clip(name) {
|
|
55
85
|
var _a;
|
|
56
|
-
const file = `${name}.mp4`;
|
|
86
|
+
const file = `${this.full(name)}.mp4`;
|
|
57
87
|
return (_a = this.urls.get(file)) !== null && _a !== void 0 ? _a : new URL(file, this.base).href;
|
|
58
88
|
}
|
|
59
89
|
async load() {
|
|
60
90
|
var _a, _b;
|
|
61
|
-
const lips = await
|
|
62
|
-
.
|
|
63
|
-
|
|
91
|
+
const [lips, framing] = await Promise.all([
|
|
92
|
+
this.fresh('lips.json')
|
|
93
|
+
.then(response => response.json())
|
|
94
|
+
.catch(() => undefined),
|
|
95
|
+
this.fresh('framing.json')
|
|
96
|
+
.then(response => response.json())
|
|
97
|
+
.catch(() => undefined),
|
|
98
|
+
]);
|
|
99
|
+
this.framings = FaceFiles.framings(framing);
|
|
64
100
|
this.faceBoxes = (_a = lips === null || lips === void 0 ? void 0 : lips.clips) !== null && _a !== void 0 ? _a : {};
|
|
65
101
|
this.plainFrames = (_b = lips === null || lips === void 0 ? void 0 : lips.plain) !== null && _b !== void 0 ? _b : {};
|
|
66
|
-
|
|
102
|
+
// Of this person alone: the others' clips are not fetched.
|
|
103
|
+
const mine = (clip) => (this.person ? clip.startsWith(this.person) : !clip.includes('/'));
|
|
104
|
+
const clips = [...Object.keys(this.faceBoxes), ...Object.keys(this.plainFrames)].filter(mine);
|
|
105
|
+
const files = [`${this.person}${POSTER}`, ...clips.map(clip => `${clip}.mp4`)];
|
|
67
106
|
await Promise.all(files.map(file => this.fresh(file)
|
|
68
107
|
.then(response => response.blob())
|
|
69
108
|
.then(blob => this.urls.set(file, URL.createObjectURL(blob)))
|
|
70
109
|
.catch(() => undefined)));
|
|
71
110
|
}
|
|
111
|
+
/** The framings of framing.json, those whole. */
|
|
112
|
+
static framings(file) {
|
|
113
|
+
var _a;
|
|
114
|
+
const framings = {};
|
|
115
|
+
for (const [clip, { rest, body, back }] of Object.entries((_a = file === null || file === void 0 ? void 0 : file.clips) !== null && _a !== void 0 ? _a : {})) {
|
|
116
|
+
if ((rest === null || rest === void 0 ? void 0 : rest.length) === 4 && (body === null || body === void 0 ? void 0 : body.length) && (file === null || file === void 0 ? void 0 : file.fps)) {
|
|
117
|
+
framings[clip] = {
|
|
118
|
+
rest: { x: rest[0], y: rest[1], w: rest[2], h: rest[3] },
|
|
119
|
+
body,
|
|
120
|
+
fps: file.fps,
|
|
121
|
+
...(typeof back === 'number' ? { back } : {}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return framings;
|
|
126
|
+
}
|
|
72
127
|
/** The file as the server has it now. */
|
|
73
128
|
async fresh(file) {
|
|
74
129
|
const response = await fetch(new URL(file, this.base).href, { cache: 'no-cache' });
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type TaCallOwnMove } from '@celljs/ta-protocol';
|
|
2
|
+
import type { CallPhase, CallReading } from '../assistant/voice-call-protocol';
|
|
3
|
+
import type { WebCallMove } from '../extension/web-api-call';
|
|
4
|
+
/** A state of the call, each with clips played at random, never the same twice in a row (loops). */
|
|
5
|
+
export type LoopKind = 'listening' | 'thinking' | 'speaking';
|
|
6
|
+
/** A move: a clip that plays once, as she says one of its words (`say`), or once she said it, as she listens (`after`). */
|
|
7
|
+
export interface FaceMove {
|
|
8
|
+
name: string;
|
|
9
|
+
when: 'say' | 'after';
|
|
10
|
+
clip: string;
|
|
11
|
+
/** Whether a sentence brings it. */
|
|
12
|
+
words: RegExp;
|
|
13
|
+
/** A few of its words, told to Ta (TaCallScene.moves): of the user's moves; Ta's own are told by TaCallMoves. */
|
|
14
|
+
told: string[];
|
|
15
|
+
/** The user's own (WebCallMoves). */
|
|
16
|
+
own?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What the person of a video call can do, in one place (docs/design/ta-call.md 16): the clips of each state of the call
|
|
20
|
+
* and the moves a sentence brings, Ta's own and the user's (WebCallMoves) before them. Both ways Ta answers (its own
|
|
21
|
+
* front, a voice service answering by itself) end in what she says, so a move is brought by the words said, and Ta is
|
|
22
|
+
* told which moves there are and their words (TaCallScene.moves). A clip of the user's that cannot play gives way to
|
|
23
|
+
* Ta's own.
|
|
24
|
+
*/
|
|
25
|
+
export declare class FaceMoves {
|
|
26
|
+
protected own: FaceMove[];
|
|
27
|
+
protected readonly ownLoops: Record<LoopKind, string[]>;
|
|
28
|
+
/** The user's clips that could not play, and why. */
|
|
29
|
+
protected readonly broken: Map<string, string>;
|
|
30
|
+
/** The state of the call as clips play it. */
|
|
31
|
+
static kind(phase: CallPhase, paused: boolean): LoopKind;
|
|
32
|
+
/** The clip name of a move of the user's, apart from those of Ta's own. */
|
|
33
|
+
static ownClip(name: string): string;
|
|
34
|
+
/** The user's moves (WebCallMoves), as a call begins. */
|
|
35
|
+
use(moves: readonly WebCallMove[]): void;
|
|
36
|
+
/** Words as a test of a sentence: any of them in it, whatever their case. */
|
|
37
|
+
static wordsOf(words: readonly string[]): RegExp;
|
|
38
|
+
/** The moves that may play now, the user's first; one of Ta's own named as one of the user's gives way to it. */
|
|
39
|
+
moves(): FaceMove[];
|
|
40
|
+
/**
|
|
41
|
+
* The move a sentence she says brings as she says it: one of the user's by its words, else the move it names
|
|
42
|
+
* (TaCallMoves: "给你比个心"), else its look ("谢谢你"); undefined for none.
|
|
43
|
+
*/
|
|
44
|
+
said(words: string | undefined): FaceMove | undefined;
|
|
45
|
+
/** What she stands up to do once she said a sentence (she dances when she says she will); undefined for nothing. */
|
|
46
|
+
after(words: string | undefined): FaceMove | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* A move begins at this second of a reading: the sentence heard then asks for one (the user's, or one TaCallMoves
|
|
49
|
+
* names), not played yet. The clip of speaking playing then gives way, so that she makes it as she says it.
|
|
50
|
+
*/
|
|
51
|
+
cue(reading: Pick<CallReading, 'pieces' | 'pieceAt'> | undefined, seconds: number, used: ReadonlySet<number>): boolean;
|
|
52
|
+
/** The move a clip plays; undefined for a clip of a state. */
|
|
53
|
+
of(clip: string | undefined): FaceMove | undefined;
|
|
54
|
+
/** The clips of a state: the user's when they gave some that play, else Ta's own. */
|
|
55
|
+
loops(kind: LoopKind): readonly string[];
|
|
56
|
+
/** The next clip of a state, at random but never the one just played where it has others. */
|
|
57
|
+
loop(kind: LoopKind, last: string | undefined, random?: () => number): string;
|
|
58
|
+
/**
|
|
59
|
+
* The clip that begins at a second of a reading, after `last`: the move of a sentence heard since the clip before
|
|
60
|
+
* began, each sentence once (`used`), the user's own first, else the latest; else another clip of speaking. A clip
|
|
61
|
+
* plays whole (the mouth is drawn for its frames ahead), so a sentence said in its middle shows at its end.
|
|
62
|
+
*/
|
|
63
|
+
at(reading: Pick<CallReading, 'pieces' | 'pieceAt'> | undefined, seconds: number, last: string | undefined, used: Set<number>): string;
|
|
64
|
+
/** A clip could not play: true when it was the user's, which then gives way to Ta's own. */
|
|
65
|
+
fail(clip: string, reason: string): boolean;
|
|
66
|
+
/** The moves of the user's Ta is told of (TaCallScene.moves), beside her own (TaCallMoves). */
|
|
67
|
+
told(): TaCallOwnMove[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=face-moves.d.ts.map
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FaceMoves = void 0;
|
|
4
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
5
|
+
/** The clips of each state, of Ta's own (public/faces, README.md there). */
|
|
6
|
+
const LOOPS = {
|
|
7
|
+
listening: ['listening', 'idle-1', 'idle-2', 'idle-3'],
|
|
8
|
+
thinking: ['thinking', 'think-2'],
|
|
9
|
+
speaking: ['talk-1', 'talk-2', 'idle-1', 'listening'],
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Ta's own moves: the looks of what she says, by its words, in the order they are tried (sorrow first); and those she
|
|
13
|
+
* stands up for, brought by TaCallMoves.named as the moves she is asked for (wave, heart, clap, laugh too).
|
|
14
|
+
*/
|
|
15
|
+
const BUILT_IN = [
|
|
16
|
+
move('sorry', 'say', /抱歉|对不起|不好意思|遗憾|可惜|失败了|出错|没做成|糟糕|對不起|ごめん|すみません|残念|\b(?:sorry|unfortunately|afraid|failed)\b/i, [
|
|
17
|
+
'抱歉',
|
|
18
|
+
'sorry',
|
|
19
|
+
]),
|
|
20
|
+
move('laugh', 'say', /哈哈|嘿嘿|笑死|好好笑|太好笑|逗死|ハハ|笑える|\b(?:haha\w*|lol|hilarious|funny)\b/i, ['哈哈', 'haha']),
|
|
21
|
+
move('surprised', 'say', /哇|天哪|天啊|真的吗|竟然|居然|没想到|わあ|まさか|\b(?:wow|really\?|no way|amazing|incredible)\b/i, ['哇', 'wow']),
|
|
22
|
+
move('clap', 'say', /恭喜|太棒了|真棒|好厉害|太厉害|干得漂亮|好样的|太強|おめでとう|すごい|\b(?:congrat\w*|bravo|well done|awesome)\b/i, [
|
|
23
|
+
'恭喜',
|
|
24
|
+
'congrats',
|
|
25
|
+
]),
|
|
26
|
+
move('heart', 'say', /爱你|喜欢你|比心|么么|谢谢你|感谢你|謝謝你|大好き|ありがとう|\b(?:love you|thank you|thanks)\b/i, ['谢谢你', 'thank you']),
|
|
27
|
+
move('shy', 'say', /过奖|過獎|哪里哪里|害羞|不好意思啦|夸得|照れ|\b(?:flattered|you're too kind|blush\w*)\b/i, ['过奖', 'flattered']),
|
|
28
|
+
move('wave', 'say', /你好|您好|嗨|哈喽|早上好|下午好|晚上好|再见|拜拜|回头见|こんにちは|おはよう|こんばんは|またね|さようなら|\b(?:hello|hi|hey|bye|goodbye|see you)\b/i, ['你好', '再见', 'hello']),
|
|
29
|
+
move('happy', 'say', /太好了|好开心|开心|高兴|很棒|成功了|搞定|嬉しい|やった|\b(?:great|glad|yay|done!)\b/i, ['太好了', 'great']),
|
|
30
|
+
move('dance', 'after', /(?!)/, []),
|
|
31
|
+
move('stretch', 'after', /(?!)/, []),
|
|
32
|
+
];
|
|
33
|
+
/** A sentence that says she cannot, or will not: no move of the user's that she would stand up for. */
|
|
34
|
+
const NOT_AFTER = /不会|不能|没法|没办法|做不了|跳不了|不行|不太方便|できない|無理|\b(?:can'?t|cannot|unable|won'?t|not able)\b/i;
|
|
35
|
+
function move(name, when, words, told) {
|
|
36
|
+
return { name, when, clip: name, words, told };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* What the person of a video call can do, in one place (docs/design/ta-call.md 16): the clips of each state of the call
|
|
40
|
+
* and the moves a sentence brings, Ta's own and the user's (WebCallMoves) before them. Both ways Ta answers (its own
|
|
41
|
+
* front, a voice service answering by itself) end in what she says, so a move is brought by the words said, and Ta is
|
|
42
|
+
* told which moves there are and their words (TaCallScene.moves). A clip of the user's that cannot play gives way to
|
|
43
|
+
* Ta's own.
|
|
44
|
+
*/
|
|
45
|
+
class FaceMoves {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.own = [];
|
|
48
|
+
this.ownLoops = { listening: [], thinking: [], speaking: [] };
|
|
49
|
+
/** The user's clips that could not play, and why. */
|
|
50
|
+
this.broken = new Map();
|
|
51
|
+
}
|
|
52
|
+
/** The state of the call as clips play it. */
|
|
53
|
+
static kind(phase, paused) {
|
|
54
|
+
if (paused) {
|
|
55
|
+
return 'listening';
|
|
56
|
+
}
|
|
57
|
+
return phase === 'thinking' ? 'thinking' : phase === 'speaking' ? 'speaking' : 'listening';
|
|
58
|
+
}
|
|
59
|
+
/** The clip name of a move of the user's, apart from those of Ta's own. */
|
|
60
|
+
static ownClip(name) {
|
|
61
|
+
return `own:${name}`;
|
|
62
|
+
}
|
|
63
|
+
/** The user's moves (WebCallMoves), as a call begins. */
|
|
64
|
+
use(moves) {
|
|
65
|
+
var _a;
|
|
66
|
+
this.own = [];
|
|
67
|
+
for (const loop of Object.values(this.ownLoops)) {
|
|
68
|
+
loop.length = 0;
|
|
69
|
+
}
|
|
70
|
+
for (const given of moves) {
|
|
71
|
+
const clip = FaceMoves.ownClip(given.name);
|
|
72
|
+
if (given.kind === 'say' || given.kind === 'after') {
|
|
73
|
+
const words = ((_a = given.words) !== null && _a !== void 0 ? _a : []).map(word => word.trim()).filter(Boolean);
|
|
74
|
+
// In place of one of Ta's own without words of its own: brought by that one's words.
|
|
75
|
+
const same = BUILT_IN.find(move => move.name === given.name && move.when === given.kind);
|
|
76
|
+
if (words.length) {
|
|
77
|
+
this.own.push({ name: given.name, when: given.kind, clip, words: FaceMoves.wordsOf(words), told: words.slice(0, 3), own: true });
|
|
78
|
+
}
|
|
79
|
+
else if (same) {
|
|
80
|
+
this.own.push({ ...same, clip, own: true });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (given.kind in this.ownLoops) {
|
|
84
|
+
this.ownLoops[given.kind].push(clip);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Words as a test of a sentence: any of them in it, whatever their case. */
|
|
89
|
+
static wordsOf(words) {
|
|
90
|
+
return new RegExp(words.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'i');
|
|
91
|
+
}
|
|
92
|
+
/** The moves that may play now, the user's first; one of Ta's own named as one of the user's gives way to it. */
|
|
93
|
+
moves() {
|
|
94
|
+
const own = this.own.filter(move => !this.broken.has(move.clip));
|
|
95
|
+
const names = new Set(own.map(move => move.name));
|
|
96
|
+
return [...own, ...BUILT_IN.filter(move => !names.has(move.name))];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The move a sentence she says brings as she says it: one of the user's by its words, else the move it names
|
|
100
|
+
* (TaCallMoves: "给你比个心"), else its look ("谢谢你"); undefined for none.
|
|
101
|
+
*/
|
|
102
|
+
said(words) {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
if (!words) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
const moves = this.moves();
|
|
108
|
+
const named = ta_protocol_1.TaCallMoves.named(words);
|
|
109
|
+
return ((_b = (_a = moves.find(move => move.own && move.when === 'say' && move.words.test(words))) !== null && _a !== void 0 ? _a : (named && !ta_protocol_1.TaCallMoves.standing(named) ? moves.find(move => move.name === named) : undefined)) !== null && _b !== void 0 ? _b : moves.find(move => move.when === 'say' && move.words.test(words)));
|
|
110
|
+
}
|
|
111
|
+
/** What she stands up to do once she said a sentence (she dances when she says she will); undefined for nothing. */
|
|
112
|
+
after(words) {
|
|
113
|
+
var _a;
|
|
114
|
+
if (!words) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const moves = this.moves();
|
|
118
|
+
const named = ta_protocol_1.TaCallMoves.named(words);
|
|
119
|
+
return ((_a = (NOT_AFTER.test(words) ? undefined : moves.find(move => move.own && move.when === 'after' && move.words.test(words)))) !== null && _a !== void 0 ? _a : (ta_protocol_1.TaCallMoves.standing(named) ? moves.find(move => move.name === named) : undefined));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A move begins at this second of a reading: the sentence heard then asks for one (the user's, or one TaCallMoves
|
|
123
|
+
* names), not played yet. The clip of speaking playing then gives way, so that she makes it as she says it.
|
|
124
|
+
*/
|
|
125
|
+
cue(reading, seconds, used) {
|
|
126
|
+
const piece = reading === null || reading === void 0 ? void 0 : reading.pieceAt(seconds);
|
|
127
|
+
if (piece === undefined || used.has(piece)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
const words = reading === null || reading === void 0 ? void 0 : reading.pieces[piece];
|
|
131
|
+
const named = ta_protocol_1.TaCallMoves.named(words);
|
|
132
|
+
return (!!named && !ta_protocol_1.TaCallMoves.standing(named)) || this.own.some(move => move.when === 'say' && !!words && move.words.test(words));
|
|
133
|
+
}
|
|
134
|
+
/** The move a clip plays; undefined for a clip of a state. */
|
|
135
|
+
of(clip) {
|
|
136
|
+
return clip === undefined ? undefined : this.moves().find(move => move.clip === clip);
|
|
137
|
+
}
|
|
138
|
+
/** The clips of a state: the user's when they gave some that play, else Ta's own. */
|
|
139
|
+
loops(kind) {
|
|
140
|
+
const own = this.ownLoops[kind].filter(clip => !this.broken.has(clip));
|
|
141
|
+
return own.length ? own : LOOPS[kind];
|
|
142
|
+
}
|
|
143
|
+
/** The next clip of a state, at random but never the one just played where it has others. */
|
|
144
|
+
loop(kind, last, random = Math.random) {
|
|
145
|
+
const all = this.loops(kind);
|
|
146
|
+
const others = all.filter(clip => clip !== last);
|
|
147
|
+
const from = others.length ? others : all;
|
|
148
|
+
return from[Math.floor(random() * from.length) % from.length];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The clip that begins at a second of a reading, after `last`: the move of a sentence heard since the clip before
|
|
152
|
+
* began, each sentence once (`used`), the user's own first, else the latest; else another clip of speaking. A clip
|
|
153
|
+
* plays whole (the mouth is drawn for its frames ahead), so a sentence said in its middle shows at its end.
|
|
154
|
+
*/
|
|
155
|
+
at(reading, seconds, last, used) {
|
|
156
|
+
var _a;
|
|
157
|
+
const piece = reading === null || reading === void 0 ? void 0 : reading.pieceAt(seconds);
|
|
158
|
+
let chosen;
|
|
159
|
+
for (let k = piece !== null && piece !== void 0 ? piece : -1; k >= 0 && !used.has(k); k--) {
|
|
160
|
+
used.add(k);
|
|
161
|
+
const move = this.said(reading === null || reading === void 0 ? void 0 : reading.pieces[k]);
|
|
162
|
+
if (move && (!chosen || (move.own && !chosen.own))) {
|
|
163
|
+
chosen = move;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return (_a = chosen === null || chosen === void 0 ? void 0 : chosen.clip) !== null && _a !== void 0 ? _a : this.loop('speaking', last);
|
|
167
|
+
}
|
|
168
|
+
/** A clip could not play: true when it was the user's, which then gives way to Ta's own. */
|
|
169
|
+
fail(clip, reason) {
|
|
170
|
+
if (!clip.startsWith('own:') || this.broken.has(clip)) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
this.broken.set(clip, reason);
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
/** The moves of the user's Ta is told of (TaCallScene.moves), beside her own (TaCallMoves). */
|
|
177
|
+
told() {
|
|
178
|
+
return this.moves()
|
|
179
|
+
.filter(move => move.own && move.told.length)
|
|
180
|
+
.map(move => ({ name: move.name, ...(move.when === 'after' ? { after: true } : {}), words: move.told }));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.FaceMoves = FaceMoves;
|
|
184
|
+
//# sourceMappingURL=face-moves.js.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** The parts of a layer of video the stage uses (HTMLVideoElement), so that a check can play it without a browser. */
|
|
2
|
+
export interface StageVideo {
|
|
3
|
+
src: string;
|
|
4
|
+
currentTime: number;
|
|
5
|
+
playbackRate: number;
|
|
6
|
+
readonly paused: boolean;
|
|
7
|
+
readonly readyState: number;
|
|
8
|
+
readonly dataset: DOMStringMap;
|
|
9
|
+
readonly style: {
|
|
10
|
+
opacity: string;
|
|
11
|
+
zIndex: string;
|
|
12
|
+
};
|
|
13
|
+
readonly classList: {
|
|
14
|
+
toggle(name: string, on: boolean): unknown;
|
|
15
|
+
};
|
|
16
|
+
play(): Promise<void>;
|
|
17
|
+
pause(): void;
|
|
18
|
+
requestVideoFrameCallback?(callback: () => void): number;
|
|
19
|
+
}
|
|
20
|
+
/** How long a clip fades in over the one before at a seam (both on the seated frame), in ms. */
|
|
21
|
+
export declare const SEAM_MS = 120;
|
|
22
|
+
/** How long it fades in when it cuts into a clip midway: the more her pose differs, the longer, in ms. */
|
|
23
|
+
export declare const BLEND_MS: {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
unknown: number;
|
|
27
|
+
};
|
|
28
|
+
/** A clip asked for: its name, from where, how long it fades in. */
|
|
29
|
+
interface Wanted {
|
|
30
|
+
clip: string;
|
|
31
|
+
at: number;
|
|
32
|
+
ms: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The two layers of video of the person of a video call (docs/design/ta-call.md 16), as players switch streams without
|
|
36
|
+
* a black frame: the next clip loads in the layer behind, hidden, and only once its first frame is on the screen
|
|
37
|
+
* (requestVideoFrameCallback) does it come over the one in front, fading in from nothing while that one stays whole
|
|
38
|
+
* under it; then the one under is hidden and paused. So the picture is whole at every moment: no empty layer, no
|
|
39
|
+
* room behind showing through. While a clip fades in, the next waits (the last asked), never taking the layer that
|
|
40
|
+
* shows. A clip known to come next is loaded and decoded ahead in the layer behind (prime).
|
|
41
|
+
*/
|
|
42
|
+
export declare class FaceStage {
|
|
43
|
+
protected readonly videos: StageVideo[];
|
|
44
|
+
/** The URL a clip plays from. */
|
|
45
|
+
protected readonly urlOf: (clip: string) => string;
|
|
46
|
+
/** Now, in ms. */
|
|
47
|
+
protected readonly now: () => number;
|
|
48
|
+
protected readonly events: {
|
|
49
|
+
/** A clip is whole in front. */
|
|
50
|
+
shown?(clip: string): void;
|
|
51
|
+
/** A clip could not play. */
|
|
52
|
+
failed?(clip: string, error: unknown): void;
|
|
53
|
+
};
|
|
54
|
+
/** The layer in front, whole. */
|
|
55
|
+
protected front: number;
|
|
56
|
+
/** The clip each layer plays, by name (what the cameras frame). */
|
|
57
|
+
readonly names: (string | undefined)[];
|
|
58
|
+
/** The layer behind loading a clip, hidden until its first frame shows. */
|
|
59
|
+
protected loading?: Wanted & {
|
|
60
|
+
index: number;
|
|
61
|
+
token: number;
|
|
62
|
+
};
|
|
63
|
+
/** The layer behind fading in over the one in front. */
|
|
64
|
+
protected coming?: Wanted & {
|
|
65
|
+
index: number;
|
|
66
|
+
since: number;
|
|
67
|
+
};
|
|
68
|
+
/** The clip asked for while one faded in: it comes next. */
|
|
69
|
+
protected pending?: Wanted;
|
|
70
|
+
/** The clip loaded ahead in the layer behind. */
|
|
71
|
+
protected primed?: {
|
|
72
|
+
index: number;
|
|
73
|
+
clip: string;
|
|
74
|
+
at: number;
|
|
75
|
+
};
|
|
76
|
+
protected token: number;
|
|
77
|
+
protected closed: boolean;
|
|
78
|
+
constructor(videos: StageVideo[],
|
|
79
|
+
/** The URL a clip plays from. */
|
|
80
|
+
urlOf: (clip: string) => string,
|
|
81
|
+
/** Now, in ms. */
|
|
82
|
+
now: () => number, events?: {
|
|
83
|
+
/** A clip is whole in front. */
|
|
84
|
+
shown?(clip: string): void;
|
|
85
|
+
/** A clip could not play. */
|
|
86
|
+
failed?(clip: string, error: unknown): void;
|
|
87
|
+
});
|
|
88
|
+
/** The clip that shows, or comes to: the last asked for. */
|
|
89
|
+
get wanted(): string | undefined;
|
|
90
|
+
/** The layer that plays the clip on top, fading in or whole, with its clip. */
|
|
91
|
+
playing(): {
|
|
92
|
+
video: StageVideo;
|
|
93
|
+
clip: string | undefined;
|
|
94
|
+
};
|
|
95
|
+
/** While a clip fades in: the layer under it, and how much of the one on top shows (0 to 1). */
|
|
96
|
+
under(): {
|
|
97
|
+
video: StageVideo;
|
|
98
|
+
alpha: number;
|
|
99
|
+
} | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Plays `clip` from `at` seconds, fading in over `ms` once its first frame shows; `again`: though it is the clip
|
|
102
|
+
* that shows (another moment of it, as she hurries back to where she sits down).
|
|
103
|
+
*/
|
|
104
|
+
show(clip: string, at?: number, ms?: number, again?: boolean): void;
|
|
105
|
+
/** Whether a clip loads or fades in: one asked for is on its way. */
|
|
106
|
+
busy(): boolean;
|
|
107
|
+
/** Whether the clip asked for last comes from `at` seconds (a show `again` on its way). */
|
|
108
|
+
jumping(at: number): boolean;
|
|
109
|
+
/** Loads `clip` ahead in the layer behind, decoded at `at`, so that it shows at once when asked for. */
|
|
110
|
+
prime(clip: string, at?: number): void;
|
|
111
|
+
/** Each frame of the screen: the clip fading in shows a little more; done, the one under goes. */
|
|
112
|
+
frame(): void;
|
|
113
|
+
close(): void;
|
|
114
|
+
protected load(wanted: Wanted): void;
|
|
115
|
+
/** Its first frame is on the screen (or it is late): the clip comes in. */
|
|
116
|
+
protected firstFrame(video: StageVideo, token: number): void;
|
|
117
|
+
protected come(token: number): void;
|
|
118
|
+
protected progress(coming: {
|
|
119
|
+
since: number;
|
|
120
|
+
ms: number;
|
|
121
|
+
}): number;
|
|
122
|
+
/** Smooth at both ends: the clip on top comes in without a step. */
|
|
123
|
+
static ease(part: number): number;
|
|
124
|
+
/** A layer whole in front (0), fading in over it (1), or hidden behind (-1). */
|
|
125
|
+
protected static layer(video: StageVideo, place: -1 | 0 | 1): void;
|
|
126
|
+
}
|
|
127
|
+
/** Where her face is in a frame (x1, y1, x2, y2); undefined where it is not known. */
|
|
128
|
+
type FaceBox = readonly number[] | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* 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):
|
|
131
|
+
* all clips begin and end on the same seated frame, so at a seam the fade only hides the step of decoding; cutting in
|
|
132
|
+
* midway, the farther her face moved, the slower it fades, so that the two poses blend rather than jump.
|
|
133
|
+
*/
|
|
134
|
+
export declare namespace FaceBlend {
|
|
135
|
+
function ms(from: FaceBox, to: FaceBox, seam: boolean): number;
|
|
136
|
+
/** Whether a frame is on the seated frame every clip begins and ends on: its first or last few. */
|
|
137
|
+
function seated(frame: number, frames: number): boolean;
|
|
138
|
+
}
|
|
139
|
+
export {};
|
|
140
|
+
//# sourceMappingURL=face-stage.d.ts.map
|