@celljs/ta-web 4.9.0 → 4.10.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 +4 -3
- package/README.md +4 -3
- package/esm/browser/assistant/assistant-chat-list.js +8 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +33 -5
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-source.js +2 -0
- package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
- package/esm/browser/assistant/assistant-task-util.js +13 -3
- package/esm/browser/assistant/assistant-tasks.js +3 -2
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +30 -1
- package/esm/browser/assistant/assistant.js +89 -6
- package/esm/browser/assistant/task-views.d.ts +40 -6
- package/esm/browser/assistant/task-views.js +73 -21
- package/esm/browser/avatar/dino-avatar.d.ts +3 -4
- package/esm/browser/avatar/dino-avatar.js +4 -178
- package/esm/browser/avatar/dino-face.d.ts +19 -0
- package/esm/browser/avatar/dino-face.js +142 -0
- package/esm/browser/avatar/dino-geometry.d.ts +11 -0
- package/esm/browser/avatar/dino-geometry.js +38 -0
- package/esm/browser/avatar/dino-kinds.d.ts +15 -0
- package/esm/browser/avatar/dino-kinds.js +544 -0
- package/esm/browser/avatar/dino-motion.js +1 -1
- package/esm/browser/avatar/dino-shape.d.ts +80 -0
- package/esm/browser/avatar/dino-shape.js +113 -0
- package/esm/browser/avatar/dino-species.d.ts +1 -61
- package/esm/browser/avatar/dino-species.js +2 -653
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +23 -1
- package/esm/browser/chat/chat-stores.d.ts +59 -0
- package/esm/browser/chat/chat-stores.js +121 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +33 -12
- package/esm/browser/chat/chat.d.ts +31 -39
- package/esm/browser/chat/chat.js +226 -175
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +47 -0
- package/esm/browser/components/app-shell-hooks.js +169 -0
- package/esm/browser/components/app-view.js +81 -172
- package/esm/browser/components/auth-view.js +1 -1
- package/esm/browser/components/chat-list.d.ts +20 -2
- package/esm/browser/components/chat-list.js +138 -22
- package/esm/browser/components/composer-box.d.ts +5 -5
- package/esm/browser/components/composer-box.js +111 -4
- package/esm/browser/components/composer.d.ts +7 -0
- package/esm/browser/components/composer.js +22 -14
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +129 -6
- package/esm/browser/components/conversation-scroll.js +429 -109
- package/esm/browser/components/dino.js +1 -1
- package/esm/browser/components/earlier-messages.d.ts +2 -1
- package/esm/browser/components/earlier-messages.js +2 -17
- package/esm/browser/components/editor-area.d.ts +3 -1
- package/esm/browser/components/editor-area.js +6 -5
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +30 -9
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +1 -1
- package/esm/browser/components/icon.d.ts +2 -2
- package/esm/browser/components/icon.js +5 -6
- package/esm/browser/components/image-viewer.d.ts +124 -0
- package/esm/browser/components/image-viewer.js +397 -0
- package/esm/browser/components/lightbox.d.ts +11 -0
- package/esm/browser/components/lightbox.js +24 -0
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +24 -10
- package/esm/browser/components/media.js +1 -10
- package/esm/browser/components/message-footer.d.ts +16 -2
- package/esm/browser/components/message-footer.js +29 -12
- package/esm/browser/components/message-list.d.ts +24 -3
- package/esm/browser/components/message-list.js +149 -20
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +18 -3
- package/esm/browser/components/nav-places.d.ts +16 -1
- package/esm/browser/components/nav-places.js +12 -3
- package/esm/browser/components/phone-shell.d.ts +4 -1
- package/esm/browser/components/phone-shell.js +3 -1
- package/esm/browser/components/run-status.js +3 -3
- package/esm/browser/components/select-bar.d.ts +9 -0
- package/esm/browser/components/select-bar.js +24 -0
- package/esm/browser/components/session-settings.d.ts +6 -0
- package/esm/browser/components/session-settings.js +14 -1
- package/esm/browser/components/session-view.js +8 -4
- package/esm/browser/components/settings-choices.d.ts +35 -0
- package/esm/browser/components/settings-choices.js +117 -0
- package/esm/browser/components/settings-parts.d.ts +21 -0
- package/esm/browser/components/settings-parts.js +323 -0
- package/esm/browser/components/settings-view.d.ts +0 -6
- package/esm/browser/components/settings-view.js +4 -406
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +14 -12
- package/esm/browser/components/voice-button.d.ts +1 -1
- package/esm/browser/components/voice-button.js +1 -1
- package/esm/browser/components/voice-talk.d.ts +43 -0
- package/esm/browser/components/voice-talk.js +222 -0
- package/esm/browser/components/workbench-view.js +1 -1
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +136 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +2 -0
- package/esm/browser/device/long-press.js +16 -1
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +64 -76
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +149 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +406 -107
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-extension-api.d.ts +135 -2
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
- package/esm/browser/extension/web-extension-protocol.js +8 -0
- package/esm/browser/extension/web-extensions.d.ts +14 -1
- package/esm/browser/extension/web-extensions.js +128 -24
- package/esm/browser/extension/web-tasks.d.ts +9 -1
- package/esm/browser/extension/web-tasks.js +24 -0
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/hooks.d.ts +3 -1
- package/esm/browser/hooks.js +8 -0
- package/esm/browser/i18n/locales.d.ts +29 -2
- package/esm/browser/i18n/messages.d.ts +28 -1
- package/esm/browser/i18n/messages.js +58 -4
- package/esm/browser/index.d.ts +6 -0
- package/esm/browser/index.js +6 -0
- package/esm/browser/notices/notices-protocol.d.ts +9 -1
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +20 -10
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +142 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +107 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +57 -17
- package/esm/browser/style/device.js +43 -4
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +67 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -3
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +2 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/markdown.d.ts +18 -1
- package/esm/browser/util/markdown.js +119 -5
- package/esm/browser/util/process.d.ts +21 -0
- package/esm/browser/util/process.js +45 -1
- package/esm/browser/util/voice.d.ts +5 -2
- package/esm/browser/util/voice.js +6 -3
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +59 -0
- package/esm/browser/workbench-calls.js +141 -0
- package/esm/browser/workbench-protocol.d.ts +5 -1
- package/esm/browser/workbench-util.d.ts +68 -0
- package/esm/browser/workbench-util.js +145 -0
- package/esm/browser/workbench.d.ts +15 -42
- package/esm/browser/workbench.js +53 -167
- package/lib/browser/assistant/assistant-chat-list.js +8 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +33 -5
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-source.js +2 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
- package/lib/browser/assistant/assistant-task-util.js +13 -3
- package/lib/browser/assistant/assistant-tasks.js +2 -1
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +30 -1
- package/lib/browser/assistant/assistant.js +89 -6
- package/lib/browser/assistant/task-views.d.ts +40 -6
- package/lib/browser/assistant/task-views.js +74 -21
- package/lib/browser/avatar/dino-avatar.d.ts +3 -4
- package/lib/browser/avatar/dino-avatar.js +27 -202
- package/lib/browser/avatar/dino-face.d.ts +20 -0
- package/lib/browser/avatar/dino-face.js +148 -0
- package/lib/browser/avatar/dino-geometry.d.ts +12 -0
- package/lib/browser/avatar/dino-geometry.js +47 -0
- package/lib/browser/avatar/dino-kinds.d.ts +16 -0
- package/lib/browser/avatar/dino-kinds.js +547 -0
- package/lib/browser/avatar/dino-motion.js +2 -2
- package/lib/browser/avatar/dino-shape.d.ts +81 -0
- package/lib/browser/avatar/dino-shape.js +126 -0
- package/lib/browser/avatar/dino-species.d.ts +1 -61
- package/lib/browser/avatar/dino-species.js +34 -687
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +23 -1
- package/lib/browser/chat/chat-stores.d.ts +60 -0
- package/lib/browser/chat/chat-stores.js +125 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +33 -12
- package/lib/browser/chat/chat.d.ts +31 -39
- package/lib/browser/chat/chat.js +227 -176
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +2 -2
- package/lib/browser/components/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +48 -0
- package/lib/browser/components/app-shell-hooks.js +211 -0
- package/lib/browser/components/app-view.js +89 -180
- package/lib/browser/components/auth-view.js +3 -3
- package/lib/browser/components/chat-list.d.ts +20 -2
- package/lib/browser/components/chat-list.js +137 -21
- package/lib/browser/components/composer-box.d.ts +5 -5
- package/lib/browser/components/composer-box.js +111 -4
- package/lib/browser/components/composer.d.ts +7 -0
- package/lib/browser/components/composer.js +22 -14
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- package/lib/browser/components/dino.js +3 -3
- package/lib/browser/components/earlier-messages.d.ts +2 -1
- package/lib/browser/components/earlier-messages.js +2 -17
- package/lib/browser/components/editor-area.d.ts +3 -1
- package/lib/browser/components/editor-area.js +5 -4
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +30 -9
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +5 -5
- package/lib/browser/components/icon.d.ts +2 -2
- package/lib/browser/components/icon.js +7 -6
- package/lib/browser/components/image-viewer.d.ts +125 -0
- package/lib/browser/components/image-viewer.js +435 -0
- package/lib/browser/components/lightbox.d.ts +12 -0
- package/lib/browser/components/lightbox.js +60 -0
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +24 -10
- package/lib/browser/components/media.js +2 -11
- package/lib/browser/components/message-footer.d.ts +16 -2
- package/lib/browser/components/message-footer.js +31 -12
- package/lib/browser/components/message-list.d.ts +24 -3
- package/lib/browser/components/message-list.js +146 -16
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +17 -2
- package/lib/browser/components/nav-places.d.ts +16 -1
- package/lib/browser/components/nav-places.js +13 -3
- package/lib/browser/components/phone-shell.d.ts +4 -1
- package/lib/browser/components/phone-shell.js +3 -1
- package/lib/browser/components/run-status.js +3 -3
- package/lib/browser/components/select-bar.d.ts +10 -0
- package/lib/browser/components/select-bar.js +61 -0
- package/lib/browser/components/session-settings.d.ts +6 -0
- package/lib/browser/components/session-settings.js +14 -1
- package/lib/browser/components/session-view.js +7 -3
- package/lib/browser/components/settings-choices.d.ts +36 -0
- package/lib/browser/components/settings-choices.js +156 -0
- package/lib/browser/components/settings-parts.d.ts +22 -0
- package/lib/browser/components/settings-parts.js +359 -0
- package/lib/browser/components/settings-view.d.ts +0 -6
- package/lib/browser/components/settings-view.js +2 -405
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +14 -12
- package/lib/browser/components/voice-button.d.ts +1 -1
- package/lib/browser/components/voice-button.js +1 -1
- package/lib/browser/components/voice-talk.d.ts +44 -0
- package/lib/browser/components/voice-talk.js +260 -0
- package/lib/browser/components/workbench-view.js +3 -3
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +173 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +2 -0
- package/lib/browser/device/long-press.js +16 -1
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +63 -75
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +148 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +410 -108
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +135 -2
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
- package/lib/browser/extension/web-extension-protocol.js +9 -1
- package/lib/browser/extension/web-extensions.d.ts +14 -1
- package/lib/browser/extension/web-extensions.js +125 -21
- package/lib/browser/extension/web-tasks.d.ts +9 -1
- package/lib/browser/extension/web-tasks.js +24 -0
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/hooks.d.ts +3 -1
- package/lib/browser/hooks.js +9 -0
- package/lib/browser/i18n/locales.d.ts +29 -2
- package/lib/browser/i18n/messages.d.ts +28 -1
- package/lib/browser/i18n/messages.js +58 -4
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.js +6 -0
- package/lib/browser/notices/notices-protocol.d.ts +9 -1
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +20 -10
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +148 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +111 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +57 -17
- package/lib/browser/style/device.js +43 -4
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +67 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -3
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +2 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/markdown.d.ts +18 -1
- package/lib/browser/util/markdown.js +119 -5
- package/lib/browser/util/process.d.ts +21 -0
- package/lib/browser/util/process.js +46 -2
- package/lib/browser/util/voice.d.ts +5 -2
- package/lib/browser/util/voice.js +6 -3
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +60 -0
- package/lib/browser/workbench-calls.js +145 -0
- package/lib/browser/workbench-protocol.d.ts +5 -1
- package/lib/browser/workbench-util.d.ts +69 -0
- package/lib/browser/workbench-util.js +151 -0
- package/lib/browser/workbench.d.ts +15 -42
- package/lib/browser/workbench.js +74 -189
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EYES = exports.EYE = void 0;
|
|
4
|
+
exports.eye = eye;
|
|
5
|
+
exports.cuteEye = cuteEye;
|
|
6
|
+
exports.mark = mark;
|
|
7
|
+
/* The face of the dinosaur: its eyes, brows and the marks of its moods, as markup for dino-avatar.ts. */
|
|
8
|
+
/** The eye of the logo: the eye of every kind is drawn here, then moved and scaled onto its own. */
|
|
9
|
+
exports.EYE = { x: 141.3, y: 44.6, r: 10.9 };
|
|
10
|
+
const DARK = '#06281d';
|
|
11
|
+
const WHITE = '#fff';
|
|
12
|
+
/** The cheeks of a close-up, as the faces of the agents blush. */
|
|
13
|
+
const BLUSH = 'rgba(255, 128, 160, 0.7)';
|
|
14
|
+
const round = (n) => Math.round(n * 100) / 100;
|
|
15
|
+
exports.EYES = {
|
|
16
|
+
idle: 'open',
|
|
17
|
+
listening: 'wide',
|
|
18
|
+
thinking: 'up',
|
|
19
|
+
working: 'down',
|
|
20
|
+
speaking: 'open',
|
|
21
|
+
attention: 'wide',
|
|
22
|
+
done: 'happy',
|
|
23
|
+
sleeping: 'closed',
|
|
24
|
+
};
|
|
25
|
+
/** Where the slit of the pupil looks, and how low the brow comes down over the eye (its back, its front over the snout). */
|
|
26
|
+
const GAZE = {
|
|
27
|
+
open: { dx: 2.4, dy: 0.8, brow: [34, 43] },
|
|
28
|
+
wide: { dx: 1.2, dy: 0, brow: [32, 39] },
|
|
29
|
+
up: { dx: -0.4, dy: -2.4, brow: [33, 41] },
|
|
30
|
+
down: { dx: 3.4, dy: 2.6, brow: [35.5, 45] },
|
|
31
|
+
};
|
|
32
|
+
const IRIS = '<stop offset="0" stop-color="#FEF08A"/><stop offset="0.35" stop-color="#FACC15"/><stop offset="0.75" stop-color="#F97316"/><stop offset="1" stop-color="#B91C1C"/>';
|
|
33
|
+
/** A closed eye: a heavy line cut out of the skin, frowning, or curved and content in a close-up. */
|
|
34
|
+
function shut(skin, content) {
|
|
35
|
+
const { x, y, r } = exports.EYE;
|
|
36
|
+
const line = content ? `M${x - 8} ${y - 1} Q${x} ${y + 6} ${x + 8} ${y - 1}` : `M${x - 9} ${y - 3} Q${x} ${y + 3} ${x + 9} ${y + 2}`;
|
|
37
|
+
return `<circle cx="${x}" cy="${y}" r="${r + 0.6}" fill="${skin}"/><path d="${line}" fill="none" stroke="${DARK}" stroke-width="3.6" stroke-linecap="round"/>`;
|
|
38
|
+
}
|
|
39
|
+
/** When the lids of a drawing blink: each drawing at its own moment and pace, so the dinosaurs of a page never blink together. */
|
|
40
|
+
function blink(id) {
|
|
41
|
+
let hash = 0;
|
|
42
|
+
for (const char of id) {
|
|
43
|
+
hash = (hash * 31 + char.charCodeAt(0)) | 0;
|
|
44
|
+
}
|
|
45
|
+
const at = Math.abs(hash % 97) / 97;
|
|
46
|
+
return ` style="animation-delay:-${(at * 5).toFixed(2)}s;animation-duration:${(4.4 + at * 2.4).toFixed(2)}s"`;
|
|
47
|
+
}
|
|
48
|
+
/** The fierce eye of a whole dinosaur: a slit pupil in a yellow-red iris under a low brow. */
|
|
49
|
+
function eye(kind, id, species) {
|
|
50
|
+
const { x, y, r } = exports.EYE;
|
|
51
|
+
const { skin, ridge } = species.colors;
|
|
52
|
+
if (kind === 'closed') {
|
|
53
|
+
return shut(skin, false);
|
|
54
|
+
}
|
|
55
|
+
const defs = `<radialGradient id="${id}-iris" cx="0.4" cy="0.6" r="0.62">${IRIS}</radialGradient>` +
|
|
56
|
+
`<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>`;
|
|
57
|
+
const ball = `<circle cx="${x}" cy="${y}" r="${r + 1}" fill="url(#${id}-iris)"/>`;
|
|
58
|
+
if (kind === 'happy') {
|
|
59
|
+
// Pleased with itself: a smug, narrowed eye, the lower lid pushed up under the brow.
|
|
60
|
+
return (defs +
|
|
61
|
+
`<g clip-path="url(#${id}-eye)">${ball}<ellipse cx="${x + 2.4}" cy="${y}" rx="1.4" ry="6" fill="${DARK}"/>` +
|
|
62
|
+
`<path d="M${x - r - 1} ${y - r - 1} H${x + r + 1} V${y - 1} L${x - r - 1} ${y - 6}Z" fill="${skin}"/>` +
|
|
63
|
+
`<path d="M${x - r - 1} ${y + r + 1} V${y + 3} Q${x} ${y - 2} ${x + r + 1} ${y + 3} V${y + r + 1}Z" fill="${skin}"/></g>` +
|
|
64
|
+
brow(ridge, x - r - 4, y - 7, x + r + 5, y - 2));
|
|
65
|
+
}
|
|
66
|
+
const gaze = GAZE[kind];
|
|
67
|
+
const px = x + gaze.dx;
|
|
68
|
+
const py = y + gaze.dy;
|
|
69
|
+
const [back, front] = gaze.brow;
|
|
70
|
+
return (defs +
|
|
71
|
+
`<g clip-path="url(#${id}-eye)">${ball}` +
|
|
72
|
+
`<g class="ta-dino-pupil"><path d="M${px} ${py - 8.6} Q${px + 2.6} ${py} ${px} ${py + 8.6} Q${px - 2.6} ${py} ${px} ${py - 8.6}Z" fill="${DARK}"/><circle cx="${px - 3.4}" cy="${py - 3}" r="1.2" fill="${WHITE}" opacity="0.9"/></g>` +
|
|
73
|
+
// The upper lid comes down to the brow, lowest over the snout, so it glares; the lower lid narrows it from below.
|
|
74
|
+
`<path d="M${x - r - 1} ${y - r - 2} H${x + r + 1} V${front} L${x - r - 1} ${back}Z" fill="${skin}"/>` +
|
|
75
|
+
`<path d="M${x - r - 1} ${y + r + 1} V${y + 6} Q${x} ${y + 9.5} ${x + r + 1} ${y + 8} V${y + r + 1}Z" fill="${skin}"/>` +
|
|
76
|
+
`<rect class="ta-dino-lid"${blink(id)} x="${x - r - 1}" y="${y - r - 1}" width="${r * 2 + 2}" height="${r * 2 + 2}" fill="${skin}"/></g>` +
|
|
77
|
+
brow(ridge, x - r - 4, back - 1.6, x + r + 5, front + 0.4));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The eye of a close-up, the dinosaur at its sweetest: round and dark with two glints, a blush below it;
|
|
81
|
+
* the glints follow the pointer. Pleased (done, or poked), it squeezes shut into an arc.
|
|
82
|
+
*/
|
|
83
|
+
function cuteEye(kind, id, species) {
|
|
84
|
+
const { x, y, r } = exports.EYE;
|
|
85
|
+
const { skin } = species.colors;
|
|
86
|
+
const cheek = `<ellipse cx="${x + 3}" cy="${y + r + 6}" rx="${round(r * 0.8)}" ry="${round(r * 0.42)}" fill="${BLUSH}"/>`;
|
|
87
|
+
const joy = `<circle cx="${x}" cy="${y}" r="${r + 0.6}" fill="${skin}"/><path d="M${x - 7.5} ${y + 3} Q${x} ${y - 7} ${x + 7.5} ${y + 3}" fill="none" stroke="${DARK}" stroke-width="3.4" stroke-linecap="round"/>`;
|
|
88
|
+
// A close-up has bigger eyes than the whole dinosaur.
|
|
89
|
+
const big = (inner) => `<g transform="translate(${x} ${y}) scale(1.2) translate(${-x} ${-y})">${inner}</g>`;
|
|
90
|
+
if (kind === 'closed') {
|
|
91
|
+
return big(shut(skin, true)) + cheek;
|
|
92
|
+
}
|
|
93
|
+
if (kind === 'happy') {
|
|
94
|
+
return big(joy) + cheek;
|
|
95
|
+
}
|
|
96
|
+
const look = `<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>` +
|
|
97
|
+
`<g clip-path="url(#${id}-eye)"><circle cx="${x}" cy="${y}" r="${r + 1}" fill="${DARK}"/>` +
|
|
98
|
+
`<g class="ta-dino-pupil"><circle cx="${x + 2.6}" cy="${y - 3.2}" r="${round(r * 0.36)}" fill="${WHITE}"/><circle cx="${x - 3.6}" cy="${y + 3.6}" r="${round(r * 0.16)}" fill="${WHITE}" opacity="0.85"/></g>` +
|
|
99
|
+
`<rect class="ta-dino-lid"${blink(id)} x="${x - r - 1}" y="${y - r - 1}" width="${r * 2 + 2}" height="${r * 2 + 2}" fill="${skin}"/></g>`;
|
|
100
|
+
// Poked, the round eye gives way to the pleased one for a moment (a class on the drawing, set as it plays).
|
|
101
|
+
return big(`<g class="ta-dino-look">${look}</g><g class="ta-dino-joy">${joy}</g>`) + cheek;
|
|
102
|
+
}
|
|
103
|
+
/** The ridge of the brow over the lid: a wedge, thin at the back, thick and low over the snout. */
|
|
104
|
+
function brow(color, x1, y1, x2, y2) {
|
|
105
|
+
const p = (x, y) => `${round(x)} ${round(y)}`;
|
|
106
|
+
return `<path class="ta-dino-brow" d="M${p(x1, y1 - 1)} Q${p((x1 + x2) / 2, (y1 + y2) / 2 - 4.4)} ${p(x2 + 1, y2 - 3.6)} Q${p(x2 + 3, y2 + 1.4)} ${p(x2 - 1, y2 + 2.2)} L${p(x1 + 1, y1 + 1.4)} Q${p(x1 - 1.4, y1 + 0.6)} ${p(x1, y1 - 1)}Z" fill="${color}"/>`;
|
|
107
|
+
}
|
|
108
|
+
/** A round mark above the back, ringed in the color of the page so it stands off the dinosaur. */
|
|
109
|
+
function badge(at, color, inner) {
|
|
110
|
+
return `<g transform="translate(${at.x} ${at.y}) scale(1.3)"><g class="ta-dino-badge"><circle r="23" fill="${color}" stroke="var(--ta-main, #fff)" stroke-width="5"/>${inner}</g></g>`;
|
|
111
|
+
}
|
|
112
|
+
function mark(mood, species) {
|
|
113
|
+
const at = species.badge;
|
|
114
|
+
switch (mood) {
|
|
115
|
+
case 'attention':
|
|
116
|
+
return badge(at, '#F59E0B', `<path d="M0 -11 L0 2.5" stroke="${WHITE}" stroke-width="5.4" stroke-linecap="round"/><circle cy="10" r="3.2" fill="${WHITE}"/>`);
|
|
117
|
+
case 'working':
|
|
118
|
+
return badge(at, '#3B82F6', [-9, 0, 9].map(x => `<circle class="ta-dino-dot" cx="${x}" r="3.4" fill="${WHITE}"/>`).join(''));
|
|
119
|
+
case 'listening':
|
|
120
|
+
return badge(at, '#8B5CF6', `<rect x="-5" y="-12" width="10" height="16" rx="5" fill="${WHITE}"/><path d="M-9.5 -1 Q-9.5 9 0 9 Q9.5 9 9.5 -1 M0 9 L0 13" fill="none" stroke="${WHITE}" stroke-width="3.2" stroke-linecap="round"/>`);
|
|
121
|
+
case 'thinking':
|
|
122
|
+
// Bubbles rising from the head to where the mark goes.
|
|
123
|
+
return [
|
|
124
|
+
[48, -10, 6],
|
|
125
|
+
[24, -24, 8.5],
|
|
126
|
+
[-6, -30, 12],
|
|
127
|
+
]
|
|
128
|
+
.map(([x, y, r]) => `<circle class="ta-dino-bubble" cx="${at.x + x}" cy="${at.y + y}" r="${r}" fill="var(--ta-muted, #8e8e93)"/>`)
|
|
129
|
+
.join('');
|
|
130
|
+
case 'sleeping':
|
|
131
|
+
return [
|
|
132
|
+
[32, 0, 0.9],
|
|
133
|
+
[0, -22, 1.35],
|
|
134
|
+
]
|
|
135
|
+
.map(([x, y, s]) => `<path class="ta-dino-z" transform="translate(${at.x + x} ${at.y + y}) scale(${s})" d="M-8 -8 L8 -8 L-8 8 L8 8" fill="none" stroke="var(--ta-muted, #8e8e93)" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>`)
|
|
136
|
+
.join('');
|
|
137
|
+
case 'speaking': {
|
|
138
|
+
// Waves from the snout.
|
|
139
|
+
const { x, y } = species.snout;
|
|
140
|
+
return [12, 22]
|
|
141
|
+
.map(r => `<path class="ta-dino-wave" d="M${x + r * 0.3} ${y - r} Q${x + r} ${y} ${x + r * 0.3} ${y + r}" fill="none" stroke="${species.colors.skin}" stroke-width="4.5" stroke-linecap="round"/>`)
|
|
142
|
+
.join('');
|
|
143
|
+
}
|
|
144
|
+
default:
|
|
145
|
+
return '';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=dino-face.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Point } from './dino-shape';
|
|
2
|
+
/** A 2D affine transform [a, b, c, d, e, f], as in SVG's matrix(). */
|
|
3
|
+
export type Matrix = [number, number, number, number, number, number];
|
|
4
|
+
export declare function multiply(m: Matrix, n: Matrix): Matrix;
|
|
5
|
+
/** Turn by `degrees` around `at`, scaling by `sx`, `sy` there. */
|
|
6
|
+
export declare function around(at: Point, degrees: number, sx?: number, sy?: number): Matrix;
|
|
7
|
+
export declare const move: (x: number, y: number) => Matrix;
|
|
8
|
+
export declare function matrix(m: Matrix): string;
|
|
9
|
+
export declare function smoothstep(x: number): number;
|
|
10
|
+
/** A color of six hex digits mixed toward another by `k` (0 to 1). */
|
|
11
|
+
export declare function mix(color: string, toward: string, k: number): string;
|
|
12
|
+
//# sourceMappingURL=dino-geometry.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.move = void 0;
|
|
4
|
+
exports.multiply = multiply;
|
|
5
|
+
exports.around = around;
|
|
6
|
+
exports.matrix = matrix;
|
|
7
|
+
exports.smoothstep = smoothstep;
|
|
8
|
+
exports.mix = mix;
|
|
9
|
+
function multiply(m, n) {
|
|
10
|
+
return [
|
|
11
|
+
m[0] * n[0] + m[2] * n[1],
|
|
12
|
+
m[1] * n[0] + m[3] * n[1],
|
|
13
|
+
m[0] * n[2] + m[2] * n[3],
|
|
14
|
+
m[1] * n[2] + m[3] * n[3],
|
|
15
|
+
m[0] * n[4] + m[2] * n[5] + m[4],
|
|
16
|
+
m[1] * n[4] + m[3] * n[5] + m[5],
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
/** Turn by `degrees` around `at`, scaling by `sx`, `sy` there. */
|
|
20
|
+
function around(at, degrees, sx = 1, sy = 1) {
|
|
21
|
+
const a = (degrees * Math.PI) / 180;
|
|
22
|
+
const cos = Math.cos(a);
|
|
23
|
+
const sin = Math.sin(a);
|
|
24
|
+
const m = [cos * sx, sin * sx, -sin * sy, cos * sy, 0, 0];
|
|
25
|
+
m[4] = at.x - m[0] * at.x - m[2] * at.y;
|
|
26
|
+
m[5] = at.y - m[1] * at.x - m[3] * at.y;
|
|
27
|
+
return m;
|
|
28
|
+
}
|
|
29
|
+
const move = (x, y) => [1, 0, 0, 1, x, y];
|
|
30
|
+
exports.move = move;
|
|
31
|
+
function matrix(m) {
|
|
32
|
+
return `matrix(${m.map(n => Math.round(n * 1000) / 1000).join(' ')})`;
|
|
33
|
+
}
|
|
34
|
+
function smoothstep(x) {
|
|
35
|
+
const t = Math.min(1, Math.max(0, x));
|
|
36
|
+
return t * t * (3 - 2 * t);
|
|
37
|
+
}
|
|
38
|
+
/** A color of six hex digits mixed toward another by `k` (0 to 1). */
|
|
39
|
+
function mix(color, toward, k) {
|
|
40
|
+
const channel = (hex, i) => Number.parseInt(hex.slice(1 + i * 2, 3 + i * 2), 16);
|
|
41
|
+
return `#${[0, 1, 2]
|
|
42
|
+
.map(i => Math.round(channel(color, i) + (channel(toward, i) - channel(color, i)) * k)
|
|
43
|
+
.toString(16)
|
|
44
|
+
.padStart(2, '0'))
|
|
45
|
+
.join('')}`;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=dino-geometry.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DinoSpecies } from './dino-species';
|
|
2
|
+
/** ta as the logo draws it. */
|
|
3
|
+
export declare const TREX: DinoSpecies;
|
|
4
|
+
/** Three horns and a frill; on four legs. */
|
|
5
|
+
export declare const TRICERATOPS: DinoSpecies;
|
|
6
|
+
/** Plates along its back and spikes at the end of its tail; on four legs, its head low. */
|
|
7
|
+
export declare const STEGOSAURUS: DinoSpecies;
|
|
8
|
+
/** A neck that reaches up to the trees; on four legs, the front ones long. */
|
|
9
|
+
export declare const BRACHIOSAURUS: DinoSpecies;
|
|
10
|
+
/** Quick and lean, a long straight tail; on two legs. */
|
|
11
|
+
export declare const VELOCIRAPTOR: DinoSpecies;
|
|
12
|
+
/** Armored all over, spikes on its back and a club at the end of its tail; low, on four legs. */
|
|
13
|
+
export declare const ANKYLOSAURUS: DinoSpecies;
|
|
14
|
+
/** A flier: wings, a long beak and a crest behind it; it stands on small legs. */
|
|
15
|
+
export declare const PTERANODON: DinoSpecies;
|
|
16
|
+
//# sourceMappingURL=dino-kinds.d.ts.map
|