@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.
Files changed (376) hide show
  1. package/README.en.md +4 -3
  2. package/README.md +4 -3
  3. package/esm/browser/assistant/assistant-chat-list.js +8 -2
  4. package/esm/browser/assistant/assistant-extension.d.ts +8 -1
  5. package/esm/browser/assistant/assistant-extension.js +33 -5
  6. package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
  7. package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
  8. package/esm/browser/assistant/assistant-task-source.js +2 -0
  9. package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
  10. package/esm/browser/assistant/assistant-task-util.js +13 -3
  11. package/esm/browser/assistant/assistant-tasks.js +3 -2
  12. package/esm/browser/assistant/assistant-view.js +81 -56
  13. package/esm/browser/assistant/assistant.d.ts +30 -1
  14. package/esm/browser/assistant/assistant.js +89 -6
  15. package/esm/browser/assistant/task-views.d.ts +40 -6
  16. package/esm/browser/assistant/task-views.js +73 -21
  17. package/esm/browser/avatar/dino-avatar.d.ts +3 -4
  18. package/esm/browser/avatar/dino-avatar.js +4 -178
  19. package/esm/browser/avatar/dino-face.d.ts +19 -0
  20. package/esm/browser/avatar/dino-face.js +142 -0
  21. package/esm/browser/avatar/dino-geometry.d.ts +11 -0
  22. package/esm/browser/avatar/dino-geometry.js +38 -0
  23. package/esm/browser/avatar/dino-kinds.d.ts +15 -0
  24. package/esm/browser/avatar/dino-kinds.js +544 -0
  25. package/esm/browser/avatar/dino-motion.js +1 -1
  26. package/esm/browser/avatar/dino-shape.d.ts +80 -0
  27. package/esm/browser/avatar/dino-shape.js +113 -0
  28. package/esm/browser/avatar/dino-species.d.ts +1 -61
  29. package/esm/browser/avatar/dino-species.js +2 -653
  30. package/esm/browser/chat/chat-packages.d.ts +39 -0
  31. package/esm/browser/chat/chat-packages.js +70 -0
  32. package/esm/browser/chat/chat-protocol.d.ts +23 -1
  33. package/esm/browser/chat/chat-stores.d.ts +59 -0
  34. package/esm/browser/chat/chat-stores.js +121 -0
  35. package/esm/browser/chat/chat-util.d.ts +17 -0
  36. package/esm/browser/chat/chat-util.js +61 -0
  37. package/esm/browser/chat/chat-view.js +33 -12
  38. package/esm/browser/chat/chat.d.ts +31 -39
  39. package/esm/browser/chat/chat.js +226 -175
  40. package/esm/browser/components/access-view.js +1 -1
  41. package/esm/browser/components/account-menu.js +1 -1
  42. package/esm/browser/components/app-nav.d.ts +6 -3
  43. package/esm/browser/components/app-nav.js +19 -10
  44. package/esm/browser/components/app-shell-hooks.d.ts +47 -0
  45. package/esm/browser/components/app-shell-hooks.js +169 -0
  46. package/esm/browser/components/app-view.js +81 -172
  47. package/esm/browser/components/auth-view.js +1 -1
  48. package/esm/browser/components/chat-list.d.ts +20 -2
  49. package/esm/browser/components/chat-list.js +138 -22
  50. package/esm/browser/components/composer-box.d.ts +5 -5
  51. package/esm/browser/components/composer-box.js +111 -4
  52. package/esm/browser/components/composer.d.ts +7 -0
  53. package/esm/browser/components/composer.js +22 -14
  54. package/esm/browser/components/connection-bar.js +50 -17
  55. package/esm/browser/components/context-menu.d.ts +30 -4
  56. package/esm/browser/components/context-menu.js +199 -37
  57. package/esm/browser/components/conversation-scroll.d.ts +129 -6
  58. package/esm/browser/components/conversation-scroll.js +429 -109
  59. package/esm/browser/components/dino.js +1 -1
  60. package/esm/browser/components/earlier-messages.d.ts +2 -1
  61. package/esm/browser/components/earlier-messages.js +2 -17
  62. package/esm/browser/components/editor-area.d.ts +3 -1
  63. package/esm/browser/components/editor-area.js +6 -5
  64. package/esm/browser/components/empty-pictures.d.ts +0 -2
  65. package/esm/browser/components/empty-pictures.js +0 -16
  66. package/esm/browser/components/folder-picker.d.ts +5 -2
  67. package/esm/browser/components/folder-picker.js +30 -9
  68. package/esm/browser/components/held-talk.d.ts +28 -0
  69. package/esm/browser/components/held-talk.js +76 -0
  70. package/esm/browser/components/host-view.d.ts +1 -1
  71. package/esm/browser/components/host-view.js +1 -1
  72. package/esm/browser/components/icon.d.ts +2 -2
  73. package/esm/browser/components/icon.js +5 -6
  74. package/esm/browser/components/image-viewer.d.ts +124 -0
  75. package/esm/browser/components/image-viewer.js +397 -0
  76. package/esm/browser/components/lightbox.d.ts +11 -0
  77. package/esm/browser/components/lightbox.js +24 -0
  78. package/esm/browser/components/markdown.d.ts +6 -2
  79. package/esm/browser/components/markdown.js +24 -10
  80. package/esm/browser/components/media.js +1 -10
  81. package/esm/browser/components/message-footer.d.ts +16 -2
  82. package/esm/browser/components/message-footer.js +29 -12
  83. package/esm/browser/components/message-list.d.ts +24 -3
  84. package/esm/browser/components/message-list.js +149 -20
  85. package/esm/browser/components/message-menu.d.ts +3 -1
  86. package/esm/browser/components/message-menu.js +18 -3
  87. package/esm/browser/components/nav-places.d.ts +16 -1
  88. package/esm/browser/components/nav-places.js +12 -3
  89. package/esm/browser/components/phone-shell.d.ts +4 -1
  90. package/esm/browser/components/phone-shell.js +3 -1
  91. package/esm/browser/components/run-status.js +3 -3
  92. package/esm/browser/components/select-bar.d.ts +9 -0
  93. package/esm/browser/components/select-bar.js +24 -0
  94. package/esm/browser/components/session-settings.d.ts +6 -0
  95. package/esm/browser/components/session-settings.js +14 -1
  96. package/esm/browser/components/session-view.js +8 -4
  97. package/esm/browser/components/settings-choices.d.ts +35 -0
  98. package/esm/browser/components/settings-choices.js +117 -0
  99. package/esm/browser/components/settings-parts.d.ts +21 -0
  100. package/esm/browser/components/settings-parts.js +323 -0
  101. package/esm/browser/components/settings-view.d.ts +0 -6
  102. package/esm/browser/components/settings-view.js +4 -406
  103. package/esm/browser/components/swipe-row.d.ts +2 -2
  104. package/esm/browser/components/swipe-row.js +7 -3
  105. package/esm/browser/components/tool-view.js +14 -12
  106. package/esm/browser/components/voice-button.d.ts +1 -1
  107. package/esm/browser/components/voice-button.js +1 -1
  108. package/esm/browser/components/voice-talk.d.ts +43 -0
  109. package/esm/browser/components/voice-talk.js +222 -0
  110. package/esm/browser/components/workbench-view.js +1 -1
  111. package/esm/browser/device/device.d.ts +3 -0
  112. package/esm/browser/device/device.js +11 -1
  113. package/esm/browser/device/hold.d.ts +42 -0
  114. package/esm/browser/device/hold.js +136 -0
  115. package/esm/browser/device/launch-screen.d.ts +1 -1
  116. package/esm/browser/device/launch-screen.js +1 -1
  117. package/esm/browser/device/long-press.d.ts +2 -0
  118. package/esm/browser/device/long-press.js +16 -1
  119. package/esm/browser/device/pull-down.d.ts +4 -2
  120. package/esm/browser/device/pull-down.js +64 -76
  121. package/esm/browser/device/row-swipe.d.ts +35 -10
  122. package/esm/browser/device/row-swipe.js +149 -71
  123. package/esm/browser/device/shake-undo.d.ts +16 -0
  124. package/esm/browser/device/shake-undo.js +59 -0
  125. package/esm/browser/device/sheet-swipe.d.ts +118 -18
  126. package/esm/browser/device/sheet-swipe.js +406 -107
  127. package/esm/browser/extension/icons.js +2 -1
  128. package/esm/browser/extension/web-extension-api.d.ts +135 -2
  129. package/esm/browser/extension/web-extension-code.d.ts +6 -0
  130. package/esm/browser/extension/web-extension-code.js +24 -0
  131. package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
  132. package/esm/browser/extension/web-extension-protocol.js +8 -0
  133. package/esm/browser/extension/web-extensions.d.ts +14 -1
  134. package/esm/browser/extension/web-extensions.js +128 -24
  135. package/esm/browser/extension/web-tasks.d.ts +9 -1
  136. package/esm/browser/extension/web-tasks.js +24 -0
  137. package/esm/browser/files/files-protocol.d.ts +25 -0
  138. package/esm/browser/files/files-protocol.js +2 -0
  139. package/esm/browser/files/files.d.ts +35 -0
  140. package/esm/browser/files/files.js +119 -0
  141. package/esm/browser/hooks.d.ts +3 -1
  142. package/esm/browser/hooks.js +8 -0
  143. package/esm/browser/i18n/locales.d.ts +29 -2
  144. package/esm/browser/i18n/messages.d.ts +28 -1
  145. package/esm/browser/i18n/messages.js +58 -4
  146. package/esm/browser/index.d.ts +6 -0
  147. package/esm/browser/index.js +6 -0
  148. package/esm/browser/notices/notices-protocol.d.ts +9 -1
  149. package/esm/browser/notices/notices.d.ts +2 -0
  150. package/esm/browser/notices/notices.js +20 -10
  151. package/esm/browser/offline/device-values.d.ts +55 -0
  152. package/esm/browser/offline/device-values.js +142 -0
  153. package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
  154. package/esm/browser/offline/kept-chats-protocol.js +2 -0
  155. package/esm/browser/offline/kept-chats.d.ts +47 -0
  156. package/esm/browser/offline/kept-chats.js +146 -0
  157. package/esm/browser/offline/offline-reads.d.ts +44 -0
  158. package/esm/browser/offline/offline-reads.js +107 -0
  159. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  160. package/esm/browser/settings/settings-protocol.js +2 -0
  161. package/esm/browser/style/conversation.d.ts +1 -1
  162. package/esm/browser/style/conversation.js +57 -17
  163. package/esm/browser/style/device.js +43 -4
  164. package/esm/browser/style/layout.d.ts +1 -1
  165. package/esm/browser/style/layout.js +67 -15
  166. package/esm/browser/style/pages.d.ts +1 -1
  167. package/esm/browser/style/pages.js +2 -1
  168. package/esm/browser/style/shell.d.ts +1 -1
  169. package/esm/browser/style/shell.js +47 -3
  170. package/esm/browser/style/tasks.d.ts +1 -1
  171. package/esm/browser/style/tasks.js +2 -0
  172. package/esm/browser/util/frame.d.ts +5 -4
  173. package/esm/browser/util/frame.js +5 -4
  174. package/esm/browser/util/markdown.d.ts +18 -1
  175. package/esm/browser/util/markdown.js +119 -5
  176. package/esm/browser/util/process.d.ts +21 -0
  177. package/esm/browser/util/process.js +45 -1
  178. package/esm/browser/util/voice.d.ts +5 -2
  179. package/esm/browser/util/voice.js +6 -3
  180. package/esm/browser/util/zoom.d.ts +46 -0
  181. package/esm/browser/util/zoom.js +96 -0
  182. package/esm/browser/workbench-calls.d.ts +59 -0
  183. package/esm/browser/workbench-calls.js +141 -0
  184. package/esm/browser/workbench-protocol.d.ts +5 -1
  185. package/esm/browser/workbench-util.d.ts +68 -0
  186. package/esm/browser/workbench-util.js +145 -0
  187. package/esm/browser/workbench.d.ts +15 -42
  188. package/esm/browser/workbench.js +53 -167
  189. package/lib/browser/assistant/assistant-chat-list.js +8 -2
  190. package/lib/browser/assistant/assistant-extension.d.ts +8 -1
  191. package/lib/browser/assistant/assistant-extension.js +33 -5
  192. package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
  193. package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
  194. package/lib/browser/assistant/assistant-task-source.js +2 -0
  195. package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
  196. package/lib/browser/assistant/assistant-task-util.js +13 -3
  197. package/lib/browser/assistant/assistant-tasks.js +2 -1
  198. package/lib/browser/assistant/assistant-view.js +78 -53
  199. package/lib/browser/assistant/assistant.d.ts +30 -1
  200. package/lib/browser/assistant/assistant.js +89 -6
  201. package/lib/browser/assistant/task-views.d.ts +40 -6
  202. package/lib/browser/assistant/task-views.js +74 -21
  203. package/lib/browser/avatar/dino-avatar.d.ts +3 -4
  204. package/lib/browser/avatar/dino-avatar.js +27 -202
  205. package/lib/browser/avatar/dino-face.d.ts +20 -0
  206. package/lib/browser/avatar/dino-face.js +148 -0
  207. package/lib/browser/avatar/dino-geometry.d.ts +12 -0
  208. package/lib/browser/avatar/dino-geometry.js +47 -0
  209. package/lib/browser/avatar/dino-kinds.d.ts +16 -0
  210. package/lib/browser/avatar/dino-kinds.js +547 -0
  211. package/lib/browser/avatar/dino-motion.js +2 -2
  212. package/lib/browser/avatar/dino-shape.d.ts +81 -0
  213. package/lib/browser/avatar/dino-shape.js +126 -0
  214. package/lib/browser/avatar/dino-species.d.ts +1 -61
  215. package/lib/browser/avatar/dino-species.js +34 -687
  216. package/lib/browser/chat/chat-packages.d.ts +40 -0
  217. package/lib/browser/chat/chat-packages.js +74 -0
  218. package/lib/browser/chat/chat-protocol.d.ts +23 -1
  219. package/lib/browser/chat/chat-stores.d.ts +60 -0
  220. package/lib/browser/chat/chat-stores.js +125 -0
  221. package/lib/browser/chat/chat-util.d.ts +18 -0
  222. package/lib/browser/chat/chat-util.js +64 -0
  223. package/lib/browser/chat/chat-view.js +33 -12
  224. package/lib/browser/chat/chat.d.ts +31 -39
  225. package/lib/browser/chat/chat.js +227 -176
  226. package/lib/browser/components/access-view.js +2 -2
  227. package/lib/browser/components/account-menu.js +2 -2
  228. package/lib/browser/components/app-nav.d.ts +6 -3
  229. package/lib/browser/components/app-nav.js +17 -8
  230. package/lib/browser/components/app-shell-hooks.d.ts +48 -0
  231. package/lib/browser/components/app-shell-hooks.js +211 -0
  232. package/lib/browser/components/app-view.js +89 -180
  233. package/lib/browser/components/auth-view.js +3 -3
  234. package/lib/browser/components/chat-list.d.ts +20 -2
  235. package/lib/browser/components/chat-list.js +137 -21
  236. package/lib/browser/components/composer-box.d.ts +5 -5
  237. package/lib/browser/components/composer-box.js +111 -4
  238. package/lib/browser/components/composer.d.ts +7 -0
  239. package/lib/browser/components/composer.js +22 -14
  240. package/lib/browser/components/connection-bar.js +48 -15
  241. package/lib/browser/components/context-menu.d.ts +30 -4
  242. package/lib/browser/components/context-menu.js +198 -36
  243. package/lib/browser/components/conversation-scroll.d.ts +129 -6
  244. package/lib/browser/components/conversation-scroll.js +431 -110
  245. package/lib/browser/components/dino.js +3 -3
  246. package/lib/browser/components/earlier-messages.d.ts +2 -1
  247. package/lib/browser/components/earlier-messages.js +2 -17
  248. package/lib/browser/components/editor-area.d.ts +3 -1
  249. package/lib/browser/components/editor-area.js +5 -4
  250. package/lib/browser/components/empty-pictures.d.ts +0 -2
  251. package/lib/browser/components/empty-pictures.js +0 -17
  252. package/lib/browser/components/folder-picker.d.ts +5 -2
  253. package/lib/browser/components/folder-picker.js +30 -9
  254. package/lib/browser/components/held-talk.d.ts +29 -0
  255. package/lib/browser/components/held-talk.js +79 -0
  256. package/lib/browser/components/host-view.d.ts +1 -1
  257. package/lib/browser/components/host-view.js +5 -5
  258. package/lib/browser/components/icon.d.ts +2 -2
  259. package/lib/browser/components/icon.js +7 -6
  260. package/lib/browser/components/image-viewer.d.ts +125 -0
  261. package/lib/browser/components/image-viewer.js +435 -0
  262. package/lib/browser/components/lightbox.d.ts +12 -0
  263. package/lib/browser/components/lightbox.js +60 -0
  264. package/lib/browser/components/markdown.d.ts +6 -2
  265. package/lib/browser/components/markdown.js +24 -10
  266. package/lib/browser/components/media.js +2 -11
  267. package/lib/browser/components/message-footer.d.ts +16 -2
  268. package/lib/browser/components/message-footer.js +31 -12
  269. package/lib/browser/components/message-list.d.ts +24 -3
  270. package/lib/browser/components/message-list.js +146 -16
  271. package/lib/browser/components/message-menu.d.ts +3 -1
  272. package/lib/browser/components/message-menu.js +17 -2
  273. package/lib/browser/components/nav-places.d.ts +16 -1
  274. package/lib/browser/components/nav-places.js +13 -3
  275. package/lib/browser/components/phone-shell.d.ts +4 -1
  276. package/lib/browser/components/phone-shell.js +3 -1
  277. package/lib/browser/components/run-status.js +3 -3
  278. package/lib/browser/components/select-bar.d.ts +10 -0
  279. package/lib/browser/components/select-bar.js +61 -0
  280. package/lib/browser/components/session-settings.d.ts +6 -0
  281. package/lib/browser/components/session-settings.js +14 -1
  282. package/lib/browser/components/session-view.js +7 -3
  283. package/lib/browser/components/settings-choices.d.ts +36 -0
  284. package/lib/browser/components/settings-choices.js +156 -0
  285. package/lib/browser/components/settings-parts.d.ts +22 -0
  286. package/lib/browser/components/settings-parts.js +359 -0
  287. package/lib/browser/components/settings-view.d.ts +0 -6
  288. package/lib/browser/components/settings-view.js +2 -405
  289. package/lib/browser/components/swipe-row.d.ts +2 -2
  290. package/lib/browser/components/swipe-row.js +7 -3
  291. package/lib/browser/components/tool-view.js +14 -12
  292. package/lib/browser/components/voice-button.d.ts +1 -1
  293. package/lib/browser/components/voice-button.js +1 -1
  294. package/lib/browser/components/voice-talk.d.ts +44 -0
  295. package/lib/browser/components/voice-talk.js +260 -0
  296. package/lib/browser/components/workbench-view.js +3 -3
  297. package/lib/browser/device/device.d.ts +3 -0
  298. package/lib/browser/device/device.js +11 -1
  299. package/lib/browser/device/hold.d.ts +43 -0
  300. package/lib/browser/device/hold.js +173 -0
  301. package/lib/browser/device/launch-screen.d.ts +1 -1
  302. package/lib/browser/device/launch-screen.js +1 -1
  303. package/lib/browser/device/long-press.d.ts +2 -0
  304. package/lib/browser/device/long-press.js +16 -1
  305. package/lib/browser/device/pull-down.d.ts +4 -2
  306. package/lib/browser/device/pull-down.js +63 -75
  307. package/lib/browser/device/row-swipe.d.ts +35 -10
  308. package/lib/browser/device/row-swipe.js +148 -70
  309. package/lib/browser/device/shake-undo.d.ts +17 -0
  310. package/lib/browser/device/shake-undo.js +63 -0
  311. package/lib/browser/device/sheet-swipe.d.ts +118 -18
  312. package/lib/browser/device/sheet-swipe.js +410 -108
  313. package/lib/browser/extension/icons.js +1 -0
  314. package/lib/browser/extension/web-extension-api.d.ts +135 -2
  315. package/lib/browser/extension/web-extension-code.d.ts +6 -0
  316. package/lib/browser/extension/web-extension-code.js +24 -0
  317. package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
  318. package/lib/browser/extension/web-extension-protocol.js +9 -1
  319. package/lib/browser/extension/web-extensions.d.ts +14 -1
  320. package/lib/browser/extension/web-extensions.js +125 -21
  321. package/lib/browser/extension/web-tasks.d.ts +9 -1
  322. package/lib/browser/extension/web-tasks.js +24 -0
  323. package/lib/browser/files/files-protocol.d.ts +26 -0
  324. package/lib/browser/files/files-protocol.js +5 -0
  325. package/lib/browser/files/files.d.ts +36 -0
  326. package/lib/browser/files/files.js +122 -0
  327. package/lib/browser/hooks.d.ts +3 -1
  328. package/lib/browser/hooks.js +9 -0
  329. package/lib/browser/i18n/locales.d.ts +29 -2
  330. package/lib/browser/i18n/messages.d.ts +28 -1
  331. package/lib/browser/i18n/messages.js +58 -4
  332. package/lib/browser/index.d.ts +6 -0
  333. package/lib/browser/index.js +6 -0
  334. package/lib/browser/notices/notices-protocol.d.ts +9 -1
  335. package/lib/browser/notices/notices.d.ts +2 -0
  336. package/lib/browser/notices/notices.js +20 -10
  337. package/lib/browser/offline/device-values.d.ts +56 -0
  338. package/lib/browser/offline/device-values.js +148 -0
  339. package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
  340. package/lib/browser/offline/kept-chats-protocol.js +5 -0
  341. package/lib/browser/offline/kept-chats.d.ts +48 -0
  342. package/lib/browser/offline/kept-chats.js +149 -0
  343. package/lib/browser/offline/offline-reads.d.ts +45 -0
  344. package/lib/browser/offline/offline-reads.js +111 -0
  345. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  346. package/lib/browser/settings/settings-protocol.js +2 -0
  347. package/lib/browser/style/conversation.d.ts +1 -1
  348. package/lib/browser/style/conversation.js +57 -17
  349. package/lib/browser/style/device.js +43 -4
  350. package/lib/browser/style/layout.d.ts +1 -1
  351. package/lib/browser/style/layout.js +67 -15
  352. package/lib/browser/style/pages.d.ts +1 -1
  353. package/lib/browser/style/pages.js +2 -1
  354. package/lib/browser/style/shell.d.ts +1 -1
  355. package/lib/browser/style/shell.js +47 -3
  356. package/lib/browser/style/tasks.d.ts +1 -1
  357. package/lib/browser/style/tasks.js +2 -0
  358. package/lib/browser/util/frame.d.ts +5 -4
  359. package/lib/browser/util/frame.js +5 -4
  360. package/lib/browser/util/markdown.d.ts +18 -1
  361. package/lib/browser/util/markdown.js +119 -5
  362. package/lib/browser/util/process.d.ts +21 -0
  363. package/lib/browser/util/process.js +46 -2
  364. package/lib/browser/util/voice.d.ts +5 -2
  365. package/lib/browser/util/voice.js +6 -3
  366. package/lib/browser/util/zoom.d.ts +47 -0
  367. package/lib/browser/util/zoom.js +99 -0
  368. package/lib/browser/workbench-calls.d.ts +60 -0
  369. package/lib/browser/workbench-calls.js +145 -0
  370. package/lib/browser/workbench-protocol.d.ts +5 -1
  371. package/lib/browser/workbench-util.d.ts +69 -0
  372. package/lib/browser/workbench-util.js +151 -0
  373. package/lib/browser/workbench.d.ts +15 -42
  374. package/lib/browser/workbench.js +74 -189
  375. package/package.json +10 -10
  376. package/public/launch.svg +46 -42
@@ -1,13 +1,10 @@
1
- import { DinoSpecies, LEG } from './dino-species.js';
1
+ import { cuteEye, EYE, EYES, eye, mark } from './dino-face.js';
2
+ import { around, matrix, mix, move, multiply, smoothstep } from './dino-geometry.js';
3
+ import { LEG } from './dino-shape.js';
4
+ import { DinoSpecies } from './dino-species.js';
2
5
  export const MOODS = ['idle', 'listening', 'thinking', 'working', 'speaking', 'attention', 'done', 'sleeping'];
3
6
  /** The viewBox of assets/logo.svg with a little room around it for the marks. */
4
7
  export const AVATAR_VIEWBOX = '-8 -8 272 272';
5
- /** The eye of the logo: the eye of every kind is drawn here, then moved and scaled onto its own. */
6
- const EYE = { x: 141.3, y: 44.6, r: 10.9 };
7
- const DARK = '#06281d';
8
- const WHITE = '#fff';
9
- /** The cheeks of a close-up, as the faces of the agents blush. */
10
- const BLUSH = 'rgba(255, 128, 160, 0.7)';
11
8
  export const REST = {
12
9
  x: 0,
13
10
  y: 0,
@@ -28,27 +25,6 @@ export const REST = {
28
25
  arm: 0,
29
26
  wing: 0,
30
27
  };
31
- function multiply(m, n) {
32
- return [
33
- m[0] * n[0] + m[2] * n[1],
34
- m[1] * n[0] + m[3] * n[1],
35
- m[0] * n[2] + m[2] * n[3],
36
- m[1] * n[2] + m[3] * n[3],
37
- m[0] * n[4] + m[2] * n[5] + m[4],
38
- m[1] * n[4] + m[3] * n[5] + m[5],
39
- ];
40
- }
41
- /** Turn by `degrees` around `at`, scaling by `sx`, `sy` there. */
42
- function around(at, degrees, sx = 1, sy = 1) {
43
- const a = (degrees * Math.PI) / 180;
44
- const cos = Math.cos(a);
45
- const sin = Math.sin(a);
46
- const m = [cos * sx, sin * sx, -sin * sy, cos * sy, 0, 0];
47
- m[4] = at.x - m[0] * at.x - m[2] * at.y;
48
- m[5] = at.y - m[1] * at.x - m[3] * at.y;
49
- return m;
50
- }
51
- const move = (x, y) => [1, 0, 0, 1, x, y];
52
28
  const SKINS = new Map();
53
29
  function skinOf(species) {
54
30
  var _a;
@@ -272,7 +248,6 @@ export function rig(pose, species = DinoSpecies.of(DinoSpecies.DEFAULT)) {
272
248
  };
273
249
  }
274
250
  const r1 = (n) => Math.round(n * 10) / 10;
275
- const round = (n) => Math.round(n * 100) / 100;
276
251
  /**
277
252
  * The points of the outline in a pose, each moved by its bones blended by its weights: `side` 1 for
278
253
  * the side you see, -1 for the far side, and in between for the inside of the solid; `eye` with the
@@ -375,142 +350,6 @@ export function headAt(pose, species = DinoSpecies.of(DinoSpecies.DEFAULT)) {
375
350
  const { center } = species.head;
376
351
  return { x: m[0] * center.x + m[2] * center.y + m[4], y: m[1] * center.x + m[3] * center.y + m[5] };
377
352
  }
378
- export function matrix(m) {
379
- return `matrix(${m.map(n => Math.round(n * 1000) / 1000).join(' ')})`;
380
- }
381
- const EYES = {
382
- idle: 'open',
383
- listening: 'wide',
384
- thinking: 'up',
385
- working: 'down',
386
- speaking: 'open',
387
- attention: 'wide',
388
- done: 'happy',
389
- sleeping: 'closed',
390
- };
391
- /** Where the slit of the pupil looks, and how low the brow comes down over the eye (its back, its front over the snout). */
392
- const GAZE = {
393
- open: { dx: 2.4, dy: 0.8, brow: [34, 43] },
394
- wide: { dx: 1.2, dy: 0, brow: [32, 39] },
395
- up: { dx: -0.4, dy: -2.4, brow: [33, 41] },
396
- down: { dx: 3.4, dy: 2.6, brow: [35.5, 45] },
397
- };
398
- 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"/>';
399
- /** A closed eye: a heavy line cut out of the skin, frowning, or curved and content in a close-up. */
400
- function shut(skin, content) {
401
- const { x, y, r } = EYE;
402
- 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}`;
403
- 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"/>`;
404
- }
405
- /** When the lids of a drawing blink: each drawing at its own moment and pace, so the dinosaurs of a page never blink together. */
406
- function blink(id) {
407
- let hash = 0;
408
- for (const char of id) {
409
- hash = (hash * 31 + char.charCodeAt(0)) | 0;
410
- }
411
- const at = Math.abs(hash % 97) / 97;
412
- return ` style="animation-delay:-${(at * 5).toFixed(2)}s;animation-duration:${(4.4 + at * 2.4).toFixed(2)}s"`;
413
- }
414
- /** The fierce eye of a whole dinosaur: a slit pupil in a yellow-red iris under a low brow. */
415
- function eye(kind, id, species) {
416
- const { x, y, r } = EYE;
417
- const { skin, ridge } = species.colors;
418
- if (kind === 'closed') {
419
- return shut(skin, false);
420
- }
421
- const defs = `<radialGradient id="${id}-iris" cx="0.4" cy="0.6" r="0.62">${IRIS}</radialGradient>` +
422
- `<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>`;
423
- const ball = `<circle cx="${x}" cy="${y}" r="${r + 1}" fill="url(#${id}-iris)"/>`;
424
- if (kind === 'happy') {
425
- // Pleased with itself: a smug, narrowed eye, the lower lid pushed up under the brow.
426
- return (defs +
427
- `<g clip-path="url(#${id}-eye)">${ball}<ellipse cx="${x + 2.4}" cy="${y}" rx="1.4" ry="6" fill="${DARK}"/>` +
428
- `<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}"/>` +
429
- `<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>` +
430
- brow(ridge, x - r - 4, y - 7, x + r + 5, y - 2));
431
- }
432
- const gaze = GAZE[kind];
433
- const px = x + gaze.dx;
434
- const py = y + gaze.dy;
435
- const [back, front] = gaze.brow;
436
- return (defs +
437
- `<g clip-path="url(#${id}-eye)">${ball}` +
438
- `<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>` +
439
- // The upper lid comes down to the brow, lowest over the snout, so it glares; the lower lid narrows it from below.
440
- `<path d="M${x - r - 1} ${y - r - 2} H${x + r + 1} V${front} L${x - r - 1} ${back}Z" fill="${skin}"/>` +
441
- `<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}"/>` +
442
- `<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>` +
443
- brow(ridge, x - r - 4, back - 1.6, x + r + 5, front + 0.4));
444
- }
445
- /**
446
- * The eye of a close-up, the dinosaur at its sweetest: round and dark with two glints, a blush below it;
447
- * the glints follow the pointer. Pleased (done, or poked), it squeezes shut into an arc.
448
- */
449
- function cuteEye(kind, id, species) {
450
- const { x, y, r } = EYE;
451
- const { skin } = species.colors;
452
- const cheek = `<ellipse cx="${x + 3}" cy="${y + r + 6}" rx="${round(r * 0.8)}" ry="${round(r * 0.42)}" fill="${BLUSH}"/>`;
453
- 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"/>`;
454
- // A close-up has bigger eyes than the whole dinosaur.
455
- const big = (inner) => `<g transform="translate(${x} ${y}) scale(1.2) translate(${-x} ${-y})">${inner}</g>`;
456
- if (kind === 'closed') {
457
- return big(shut(skin, true)) + cheek;
458
- }
459
- if (kind === 'happy') {
460
- return big(joy) + cheek;
461
- }
462
- const look = `<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>` +
463
- `<g clip-path="url(#${id}-eye)"><circle cx="${x}" cy="${y}" r="${r + 1}" fill="${DARK}"/>` +
464
- `<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>` +
465
- `<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>`;
466
- // Poked, the round eye gives way to the pleased one for a moment (a class on the drawing, set as it plays).
467
- return big(`<g class="ta-dino-look">${look}</g><g class="ta-dino-joy">${joy}</g>`) + cheek;
468
- }
469
- /** The ridge of the brow over the lid: a wedge, thin at the back, thick and low over the snout. */
470
- function brow(color, x1, y1, x2, y2) {
471
- const p = (x, y) => `${round(x)} ${round(y)}`;
472
- 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}"/>`;
473
- }
474
- /** A round mark above the back, ringed in the color of the page so it stands off the dinosaur. */
475
- function badge(at, color, inner) {
476
- 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>`;
477
- }
478
- function mark(mood, species) {
479
- const at = species.badge;
480
- switch (mood) {
481
- case 'attention':
482
- 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}"/>`);
483
- case 'working':
484
- return badge(at, '#3B82F6', [-9, 0, 9].map(x => `<circle class="ta-dino-dot" cx="${x}" r="3.4" fill="${WHITE}"/>`).join(''));
485
- case 'listening':
486
- 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"/>`);
487
- case 'thinking':
488
- // Bubbles rising from the head to where the mark goes.
489
- return [
490
- [48, -10, 6],
491
- [24, -24, 8.5],
492
- [-6, -30, 12],
493
- ]
494
- .map(([x, y, r]) => `<circle class="ta-dino-bubble" cx="${at.x + x}" cy="${at.y + y}" r="${r}" fill="var(--ta-muted, #8e8e93)"/>`)
495
- .join('');
496
- case 'sleeping':
497
- return [
498
- [32, 0, 0.9],
499
- [0, -22, 1.35],
500
- ]
501
- .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"/>`)
502
- .join('');
503
- case 'speaking': {
504
- // Waves from the snout.
505
- const { x, y } = species.snout;
506
- return [12, 22]
507
- .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"/>`)
508
- .join('');
509
- }
510
- default:
511
- return '';
512
- }
513
- }
514
353
  const fixed = (n) => String(Math.round(n * 100) / 100);
515
354
  /**
516
355
  * What a pose draws. `fine` for a large drawing; a small one (a few dozen pixels) is swept in fewer
@@ -546,19 +385,6 @@ export function frame(pose, fine = true, species = DinoSpecies.of(DinoSpecies.DE
546
385
  shadow: { cx: fixed(feet.x + (middle - feet.x) * pose.face + pose.x), rx: fixed(width), opacity: fixed(1 - Math.min(0.7, lifted / 32)) },
547
386
  };
548
387
  }
549
- function smoothstep(x) {
550
- const t = Math.min(1, Math.max(0, x));
551
- return t * t * (3 - 2 * t);
552
- }
553
- /** A color of six hex digits mixed toward another by `k` (0 to 1). */
554
- function mix(color, toward, k) {
555
- const channel = (hex, i) => Number.parseInt(hex.slice(1 + i * 2, 3 + i * 2), 16);
556
- return `#${[0, 1, 2]
557
- .map(i => Math.round(channel(color, i) + (channel(toward, i) - channel(color, i)) * k)
558
- .toString(16)
559
- .padStart(2, '0'))
560
- .join('')}`;
561
- }
562
388
  /**
563
389
  * The body of a kind in a pose, with the eye `eyes` draws. `detail` for a drawing
564
390
  * large enough to show it: its shadow on the ground, and a gap of the page between the body and the legs and arms
@@ -0,0 +1,19 @@
1
+ import type { Mood } from './dino-avatar.js';
2
+ import type { DinoSpecies } from './dino-species.js';
3
+ /** The eye of the logo: the eye of every kind is drawn here, then moved and scaled onto its own. */
4
+ export declare const EYE: {
5
+ x: number;
6
+ y: number;
7
+ r: number;
8
+ };
9
+ type Eyes = 'open' | 'wide' | 'up' | 'down' | 'happy' | 'closed';
10
+ export declare const EYES: Record<Mood, Eyes>;
11
+ /** The fierce eye of a whole dinosaur: a slit pupil in a yellow-red iris under a low brow. */
12
+ export declare function eye(kind: Eyes, id: string, species: DinoSpecies): string;
13
+ /**
14
+ * The eye of a close-up, the dinosaur at its sweetest: round and dark with two glints, a blush below it;
15
+ * the glints follow the pointer. Pleased (done, or poked), it squeezes shut into an arc.
16
+ */
17
+ export declare function cuteEye(kind: Eyes, id: string, species: DinoSpecies): string;
18
+ export declare function mark(mood: Mood, species: DinoSpecies): string;
19
+ export {};
@@ -0,0 +1,142 @@
1
+ /* The face of the dinosaur: its eyes, brows and the marks of its moods, as markup for dino-avatar.ts. */
2
+ /** The eye of the logo: the eye of every kind is drawn here, then moved and scaled onto its own. */
3
+ export const EYE = { x: 141.3, y: 44.6, r: 10.9 };
4
+ const DARK = '#06281d';
5
+ const WHITE = '#fff';
6
+ /** The cheeks of a close-up, as the faces of the agents blush. */
7
+ const BLUSH = 'rgba(255, 128, 160, 0.7)';
8
+ const round = (n) => Math.round(n * 100) / 100;
9
+ export const EYES = {
10
+ idle: 'open',
11
+ listening: 'wide',
12
+ thinking: 'up',
13
+ working: 'down',
14
+ speaking: 'open',
15
+ attention: 'wide',
16
+ done: 'happy',
17
+ sleeping: 'closed',
18
+ };
19
+ /** Where the slit of the pupil looks, and how low the brow comes down over the eye (its back, its front over the snout). */
20
+ const GAZE = {
21
+ open: { dx: 2.4, dy: 0.8, brow: [34, 43] },
22
+ wide: { dx: 1.2, dy: 0, brow: [32, 39] },
23
+ up: { dx: -0.4, dy: -2.4, brow: [33, 41] },
24
+ down: { dx: 3.4, dy: 2.6, brow: [35.5, 45] },
25
+ };
26
+ 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"/>';
27
+ /** A closed eye: a heavy line cut out of the skin, frowning, or curved and content in a close-up. */
28
+ function shut(skin, content) {
29
+ const { x, y, r } = EYE;
30
+ 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}`;
31
+ 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"/>`;
32
+ }
33
+ /** When the lids of a drawing blink: each drawing at its own moment and pace, so the dinosaurs of a page never blink together. */
34
+ function blink(id) {
35
+ let hash = 0;
36
+ for (const char of id) {
37
+ hash = (hash * 31 + char.charCodeAt(0)) | 0;
38
+ }
39
+ const at = Math.abs(hash % 97) / 97;
40
+ return ` style="animation-delay:-${(at * 5).toFixed(2)}s;animation-duration:${(4.4 + at * 2.4).toFixed(2)}s"`;
41
+ }
42
+ /** The fierce eye of a whole dinosaur: a slit pupil in a yellow-red iris under a low brow. */
43
+ export function eye(kind, id, species) {
44
+ const { x, y, r } = EYE;
45
+ const { skin, ridge } = species.colors;
46
+ if (kind === 'closed') {
47
+ return shut(skin, false);
48
+ }
49
+ const defs = `<radialGradient id="${id}-iris" cx="0.4" cy="0.6" r="0.62">${IRIS}</radialGradient>` +
50
+ `<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>`;
51
+ const ball = `<circle cx="${x}" cy="${y}" r="${r + 1}" fill="url(#${id}-iris)"/>`;
52
+ if (kind === 'happy') {
53
+ // Pleased with itself: a smug, narrowed eye, the lower lid pushed up under the brow.
54
+ return (defs +
55
+ `<g clip-path="url(#${id}-eye)">${ball}<ellipse cx="${x + 2.4}" cy="${y}" rx="1.4" ry="6" fill="${DARK}"/>` +
56
+ `<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}"/>` +
57
+ `<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>` +
58
+ brow(ridge, x - r - 4, y - 7, x + r + 5, y - 2));
59
+ }
60
+ const gaze = GAZE[kind];
61
+ const px = x + gaze.dx;
62
+ const py = y + gaze.dy;
63
+ const [back, front] = gaze.brow;
64
+ return (defs +
65
+ `<g clip-path="url(#${id}-eye)">${ball}` +
66
+ `<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>` +
67
+ // The upper lid comes down to the brow, lowest over the snout, so it glares; the lower lid narrows it from below.
68
+ `<path d="M${x - r - 1} ${y - r - 2} H${x + r + 1} V${front} L${x - r - 1} ${back}Z" fill="${skin}"/>` +
69
+ `<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}"/>` +
70
+ `<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>` +
71
+ brow(ridge, x - r - 4, back - 1.6, x + r + 5, front + 0.4));
72
+ }
73
+ /**
74
+ * The eye of a close-up, the dinosaur at its sweetest: round and dark with two glints, a blush below it;
75
+ * the glints follow the pointer. Pleased (done, or poked), it squeezes shut into an arc.
76
+ */
77
+ export function cuteEye(kind, id, species) {
78
+ const { x, y, r } = EYE;
79
+ const { skin } = species.colors;
80
+ const cheek = `<ellipse cx="${x + 3}" cy="${y + r + 6}" rx="${round(r * 0.8)}" ry="${round(r * 0.42)}" fill="${BLUSH}"/>`;
81
+ 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"/>`;
82
+ // A close-up has bigger eyes than the whole dinosaur.
83
+ const big = (inner) => `<g transform="translate(${x} ${y}) scale(1.2) translate(${-x} ${-y})">${inner}</g>`;
84
+ if (kind === 'closed') {
85
+ return big(shut(skin, true)) + cheek;
86
+ }
87
+ if (kind === 'happy') {
88
+ return big(joy) + cheek;
89
+ }
90
+ const look = `<clipPath id="${id}-eye"><circle cx="${x}" cy="${y}" r="${r + 0.8}"/></clipPath>` +
91
+ `<g clip-path="url(#${id}-eye)"><circle cx="${x}" cy="${y}" r="${r + 1}" fill="${DARK}"/>` +
92
+ `<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>` +
93
+ `<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>`;
94
+ // Poked, the round eye gives way to the pleased one for a moment (a class on the drawing, set as it plays).
95
+ return big(`<g class="ta-dino-look">${look}</g><g class="ta-dino-joy">${joy}</g>`) + cheek;
96
+ }
97
+ /** The ridge of the brow over the lid: a wedge, thin at the back, thick and low over the snout. */
98
+ function brow(color, x1, y1, x2, y2) {
99
+ const p = (x, y) => `${round(x)} ${round(y)}`;
100
+ 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}"/>`;
101
+ }
102
+ /** A round mark above the back, ringed in the color of the page so it stands off the dinosaur. */
103
+ function badge(at, color, inner) {
104
+ 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>`;
105
+ }
106
+ export function mark(mood, species) {
107
+ const at = species.badge;
108
+ switch (mood) {
109
+ case 'attention':
110
+ 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}"/>`);
111
+ case 'working':
112
+ return badge(at, '#3B82F6', [-9, 0, 9].map(x => `<circle class="ta-dino-dot" cx="${x}" r="3.4" fill="${WHITE}"/>`).join(''));
113
+ case 'listening':
114
+ 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"/>`);
115
+ case 'thinking':
116
+ // Bubbles rising from the head to where the mark goes.
117
+ return [
118
+ [48, -10, 6],
119
+ [24, -24, 8.5],
120
+ [-6, -30, 12],
121
+ ]
122
+ .map(([x, y, r]) => `<circle class="ta-dino-bubble" cx="${at.x + x}" cy="${at.y + y}" r="${r}" fill="var(--ta-muted, #8e8e93)"/>`)
123
+ .join('');
124
+ case 'sleeping':
125
+ return [
126
+ [32, 0, 0.9],
127
+ [0, -22, 1.35],
128
+ ]
129
+ .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"/>`)
130
+ .join('');
131
+ case 'speaking': {
132
+ // Waves from the snout.
133
+ const { x, y } = species.snout;
134
+ return [12, 22]
135
+ .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"/>`)
136
+ .join('');
137
+ }
138
+ default:
139
+ return '';
140
+ }
141
+ }
142
+ //# sourceMappingURL=dino-face.js.map
@@ -0,0 +1,11 @@
1
+ import type { Point } from './dino-shape.js';
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;
@@ -0,0 +1,38 @@
1
+ export function multiply(m, n) {
2
+ return [
3
+ m[0] * n[0] + m[2] * n[1],
4
+ m[1] * n[0] + m[3] * n[1],
5
+ m[0] * n[2] + m[2] * n[3],
6
+ m[1] * n[2] + m[3] * n[3],
7
+ m[0] * n[4] + m[2] * n[5] + m[4],
8
+ m[1] * n[4] + m[3] * n[5] + m[5],
9
+ ];
10
+ }
11
+ /** Turn by `degrees` around `at`, scaling by `sx`, `sy` there. */
12
+ export function around(at, degrees, sx = 1, sy = 1) {
13
+ const a = (degrees * Math.PI) / 180;
14
+ const cos = Math.cos(a);
15
+ const sin = Math.sin(a);
16
+ const m = [cos * sx, sin * sx, -sin * sy, cos * sy, 0, 0];
17
+ m[4] = at.x - m[0] * at.x - m[2] * at.y;
18
+ m[5] = at.y - m[1] * at.x - m[3] * at.y;
19
+ return m;
20
+ }
21
+ export const move = (x, y) => [1, 0, 0, 1, x, y];
22
+ export function matrix(m) {
23
+ return `matrix(${m.map(n => Math.round(n * 1000) / 1000).join(' ')})`;
24
+ }
25
+ export function smoothstep(x) {
26
+ const t = Math.min(1, Math.max(0, x));
27
+ return t * t * (3 - 2 * t);
28
+ }
29
+ /** A color of six hex digits mixed toward another by `k` (0 to 1). */
30
+ export function mix(color, toward, k) {
31
+ const channel = (hex, i) => Number.parseInt(hex.slice(1 + i * 2, 3 + i * 2), 16);
32
+ return `#${[0, 1, 2]
33
+ .map(i => Math.round(channel(color, i) + (channel(toward, i) - channel(color, i)) * k)
34
+ .toString(16)
35
+ .padStart(2, '0'))
36
+ .join('')}`;
37
+ }
38
+ //# sourceMappingURL=dino-geometry.js.map
@@ -0,0 +1,15 @@
1
+ import type { DinoSpecies } from './dino-species.js';
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;