@celljs/ta-web 4.42.0 → 4.44.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 (400) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/apps/app-window.js +2 -2
  4. package/esm/browser/apps/web-apps.d.ts +4 -0
  5. package/esm/browser/apps/web-apps.js +14 -3
  6. package/esm/browser/assistant/assistant-chat-list.js +2 -1
  7. package/esm/browser/assistant/assistant-extension.js +16 -2
  8. package/esm/browser/assistant/assistant-protocol.d.ts +6 -0
  9. package/esm/browser/assistant/assistant-task-source.js +3 -0
  10. package/esm/browser/assistant/assistant-task-util.d.ts +2 -0
  11. package/esm/browser/assistant/assistant-task-util.js +5 -0
  12. package/esm/browser/assistant/assistant.d.ts +3 -0
  13. package/esm/browser/assistant/assistant.js +26 -2
  14. package/esm/browser/assistant/ta-hearing.d.ts +85 -0
  15. package/esm/browser/assistant/ta-hearing.js +272 -0
  16. package/esm/browser/components/app-shell-hooks.d.ts +2 -1
  17. package/esm/browser/components/app-shell-hooks.js +4 -3
  18. package/esm/browser/components/app-shell-state.js +2 -2
  19. package/esm/browser/components/auth-view.js +1 -1
  20. package/esm/browser/components/board.js +9 -1
  21. package/esm/browser/components/chat-list-row.js +4 -4
  22. package/esm/browser/components/chat-list-util.d.ts +2 -2
  23. package/esm/browser/components/clipboard-link-host.d.ts +2 -0
  24. package/esm/browser/components/clipboard-link-host.js +27 -0
  25. package/esm/browser/components/cloud-network.js +1 -1
  26. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  27. package/esm/browser/components/custom-host.d.ts +4 -1
  28. package/esm/browser/components/custom-host.js +8 -2
  29. package/esm/browser/components/custom-provider-advanced.js +8 -8
  30. package/esm/browser/components/custom-provider-view.js +12 -12
  31. package/esm/browser/components/earlier-messages.d.ts +4 -1
  32. package/esm/browser/components/earlier-messages.js +5 -2
  33. package/esm/browser/components/empty-state.d.ts +2 -1
  34. package/esm/browser/components/empty-state.js +6 -2
  35. package/esm/browser/components/folder-picker.js +2 -2
  36. package/esm/browser/components/gallery.js +8 -9
  37. package/esm/browser/components/hearing-host.d.ts +5 -0
  38. package/esm/browser/components/hearing-host.js +58 -0
  39. package/esm/browser/components/host-view.d.ts +1 -1
  40. package/esm/browser/components/link-dialog.js +4 -0
  41. package/esm/browser/components/loading.d.ts +3 -2
  42. package/esm/browser/components/loading.js +7 -3
  43. package/esm/browser/components/markdown.d.ts +3 -1
  44. package/esm/browser/components/markdown.js +10 -5
  45. package/esm/browser/components/media.d.ts +10 -4
  46. package/esm/browser/components/media.js +60 -14
  47. package/esm/browser/components/message-list.js +2 -1
  48. package/esm/browser/components/message-steps.js +8 -5
  49. package/esm/browser/components/people-picker.d.ts +17 -0
  50. package/esm/browser/components/people-picker.js +129 -0
  51. package/esm/browser/components/relay-view.js +1 -1
  52. package/esm/browser/components/settings-choices.d.ts +2 -1
  53. package/esm/browser/components/settings-choices.js +2 -1
  54. package/esm/browser/components/settings-parts.js +25 -3
  55. package/esm/browser/components/share-dialog.d.ts +2 -2
  56. package/esm/browser/components/share-dialog.js +7 -4
  57. package/esm/browser/components/share-friends.d.ts +18 -2
  58. package/esm/browser/components/share-friends.js +64 -13
  59. package/esm/browser/components/share-item-sheet.d.ts +12 -0
  60. package/esm/browser/components/share-item-sheet.js +39 -0
  61. package/esm/browser/components/share-sheet.d.ts +12 -4
  62. package/esm/browser/components/share-sheet.js +15 -6
  63. package/esm/browser/components/sign-in-setup.js +4 -4
  64. package/esm/browser/components/trusted-domains.js +1 -1
  65. package/esm/browser/components/view-room.d.ts +25 -0
  66. package/esm/browser/components/view-room.js +136 -0
  67. package/esm/browser/components/voice-services.js +6 -6
  68. package/esm/browser/device/device-protocol.d.ts +9 -6
  69. package/esm/browser/device/device-protocol.js +7 -4
  70. package/esm/browser/device/launch-screen.d.ts +11 -1
  71. package/esm/browser/device/launch-screen.js +22 -4
  72. package/esm/browser/extension/share-sheet-compat.d.ts +2 -0
  73. package/esm/browser/extension/share-sheet-compat.js +12 -2
  74. package/esm/browser/extension/web-api-chats.d.ts +23 -0
  75. package/esm/browser/extension/web-api-code.d.ts +11 -0
  76. package/esm/browser/extension/web-api-components.d.ts +8 -1
  77. package/esm/browser/extension/web-api-contributions.d.ts +30 -1
  78. package/esm/browser/extension/web-api-desktop.d.ts +2 -1
  79. package/esm/browser/extension/web-api-file-views.d.ts +38 -0
  80. package/esm/browser/extension/web-api-file-views.js +2 -0
  81. package/esm/browser/extension/web-api-host.d.ts +47 -0
  82. package/esm/browser/extension/web-api-host.js +3 -0
  83. package/esm/browser/extension/web-api-menus.d.ts +46 -0
  84. package/esm/browser/extension/web-api-partners.d.ts +58 -1
  85. package/esm/browser/extension/web-api-skins.d.ts +95 -0
  86. package/esm/browser/extension/web-api-skins.js +2 -0
  87. package/esm/browser/extension/web-api-spec.js +9 -0
  88. package/esm/browser/extension/web-extension-api.d.ts +13 -34
  89. package/esm/browser/extension/web-extension-context.d.ts +2 -8
  90. package/esm/browser/extension/web-extension-context.js +15 -39
  91. package/esm/browser/extension/web-extension-marks.d.ts +10 -0
  92. package/esm/browser/extension/web-extension-marks.js +29 -0
  93. package/esm/browser/extension/web-extension-protocol.d.ts +13 -1
  94. package/esm/browser/extension/web-extension-protocol.js +4 -0
  95. package/esm/browser/extension/web-extension-run.d.ts +16 -2
  96. package/esm/browser/extension/web-extension-run.js +80 -0
  97. package/esm/browser/extension/web-extensions-running.d.ts +5 -1
  98. package/esm/browser/extension/web-extensions-running.js +16 -0
  99. package/esm/browser/extension/web-extensions.d.ts +2 -1
  100. package/esm/browser/extension/web-extensions.js +3 -0
  101. package/esm/browser/extension/web-home.js +3 -1
  102. package/esm/browser/extension/web-host-values.d.ts +66 -0
  103. package/esm/browser/extension/web-host-values.js +191 -0
  104. package/esm/browser/extension/web-hosts.d.ts +7 -2
  105. package/esm/browser/extension/web-hosts.js +16 -4
  106. package/esm/browser/extension/web-share-ui.d.ts +7 -0
  107. package/esm/browser/extension/web-share-ui.js +20 -0
  108. package/esm/browser/extension/web-share.d.ts +18 -0
  109. package/esm/browser/extension/web-share.js +42 -0
  110. package/esm/browser/i18n/en/assistant.d.ts +4 -0
  111. package/esm/browser/i18n/en/assistant.js +4 -0
  112. package/esm/browser/i18n/en/chat.d.ts +10 -0
  113. package/esm/browser/i18n/en/chat.js +10 -0
  114. package/esm/browser/i18n/en/common.d.ts +15 -0
  115. package/esm/browser/i18n/en/common.js +15 -0
  116. package/esm/browser/i18n/en/discover.d.ts +11 -1
  117. package/esm/browser/i18n/en/discover.js +11 -1
  118. package/esm/browser/i18n/en/settings.d.ts +10 -0
  119. package/esm/browser/i18n/en/settings.js +10 -0
  120. package/esm/browser/i18n/ja/assistant.js +4 -0
  121. package/esm/browser/i18n/ja/chat.js +10 -0
  122. package/esm/browser/i18n/ja/common.js +15 -0
  123. package/esm/browser/i18n/ja/discover.js +11 -1
  124. package/esm/browser/i18n/ja/settings.js +10 -0
  125. package/esm/browser/i18n/locales.d.ts +51 -2
  126. package/esm/browser/i18n/messages.d.ts +50 -1
  127. package/esm/browser/i18n/zh/assistant.js +4 -0
  128. package/esm/browser/i18n/zh/chat.js +10 -0
  129. package/esm/browser/i18n/zh/common.js +15 -0
  130. package/esm/browser/i18n/zh/discover.js +11 -1
  131. package/esm/browser/i18n/zh/settings.js +10 -0
  132. package/esm/browser/i18n/zh-tw/assistant.js +4 -0
  133. package/esm/browser/i18n/zh-tw/chat.js +10 -0
  134. package/esm/browser/i18n/zh-tw/common.js +15 -0
  135. package/esm/browser/i18n/zh-tw/discover.js +11 -1
  136. package/esm/browser/i18n/zh-tw/settings.js +10 -0
  137. package/esm/browser/launch-art/art-palette.d.ts +41 -0
  138. package/esm/browser/launch-art/art-palette.js +72 -0
  139. package/esm/browser/launch-art/cyclic-automaton.d.ts +45 -0
  140. package/esm/browser/launch-art/cyclic-automaton.js +176 -0
  141. package/esm/browser/launch-art/fractal-tree.d.ts +43 -0
  142. package/esm/browser/launch-art/fractal-tree.js +48 -0
  143. package/esm/browser/launch-art/launch-art.d.ts +98 -0
  144. package/esm/browser/launch-art/launch-art.js +420 -0
  145. package/esm/browser/launch-art/launch-sky.d.ts +66 -0
  146. package/esm/browser/launch-art/launch-sky.js +153 -0
  147. package/esm/browser/links/clipboard-links.d.ts +85 -0
  148. package/esm/browser/links/clipboard-links.js +261 -0
  149. package/esm/browser/links/link-text.d.ts +29 -0
  150. package/esm/browser/links/link-text.js +97 -0
  151. package/esm/browser/links/links-protocol.d.ts +12 -1
  152. package/esm/browser/links/links.d.ts +8 -2
  153. package/esm/browser/links/links.js +33 -3
  154. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  155. package/esm/browser/markdown/code-renderers.js +4 -0
  156. package/esm/browser/partners/group-picker.js +23 -29
  157. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  158. package/esm/browser/sandbox/work/work-senses.js +1 -1
  159. package/esm/browser/settings/settings-protocol.d.ts +26 -0
  160. package/esm/browser/settings/settings-protocol.js +11 -0
  161. package/esm/browser/settings/settings.d.ts +4 -1
  162. package/esm/browser/settings/settings.js +16 -3
  163. package/esm/browser/skin/skin-layer.d.ts +8 -0
  164. package/esm/browser/skin/skin-layer.js +118 -0
  165. package/esm/browser/skin/skin-util.d.ts +40 -0
  166. package/esm/browser/skin/skin-util.js +120 -0
  167. package/esm/browser/style/base.d.ts +1 -1
  168. package/esm/browser/style/base.js +10 -6
  169. package/esm/browser/style/chat-list.d.ts +1 -1
  170. package/esm/browser/style/chat-list.js +28 -15
  171. package/esm/browser/style/conversation-column.d.ts +1 -1
  172. package/esm/browser/style/conversation.d.ts +1 -1
  173. package/esm/browser/style/conversation.js +5 -4
  174. package/esm/browser/style/dialogs.d.ts +1 -1
  175. package/esm/browser/style/dialogs.js +2 -5
  176. package/esm/browser/style/forms.d.ts +5 -0
  177. package/esm/browser/style/forms.js +65 -0
  178. package/esm/browser/style/layout.d.ts +1 -1
  179. package/esm/browser/style/pages.d.ts +1 -1
  180. package/esm/browser/style/pages.js +14 -24
  181. package/esm/browser/style/phone.d.ts +1 -1
  182. package/esm/browser/style/shared.d.ts +1 -1
  183. package/esm/browser/style/shell.d.ts +1 -1
  184. package/esm/browser/style/shell.js +1 -6
  185. package/esm/browser/style/skins.d.ts +9 -0
  186. package/esm/browser/style/skins.js +107 -0
  187. package/esm/browser/style/surfaces.d.ts +1 -1
  188. package/esm/browser/style/surfaces.js +8 -6
  189. package/esm/browser/style/tasks.d.ts +1 -1
  190. package/esm/browser/style.js +4 -0
  191. package/esm/browser/util/fresh-rows.d.ts +21 -0
  192. package/esm/browser/util/fresh-rows.js +36 -0
  193. package/esm/browser/util/process.d.ts +12 -22
  194. package/esm/browser/util/process.js +49 -39
  195. package/esm/browser/util/voice.d.ts +18 -0
  196. package/esm/browser/util/voice.js +111 -3
  197. package/esm/browser/workbench-protocol.d.ts +2 -0
  198. package/esm/browser/workbench-services.d.ts +2 -0
  199. package/esm/browser/workbench-services.js +5 -0
  200. package/esm/browser/workbench.js +5 -0
  201. package/lib/browser/apps/app-window.js +2 -2
  202. package/lib/browser/apps/web-apps.d.ts +4 -0
  203. package/lib/browser/apps/web-apps.js +14 -3
  204. package/lib/browser/assistant/assistant-chat-list.js +2 -1
  205. package/lib/browser/assistant/assistant-extension.js +15 -1
  206. package/lib/browser/assistant/assistant-protocol.d.ts +6 -0
  207. package/lib/browser/assistant/assistant-task-source.js +3 -0
  208. package/lib/browser/assistant/assistant-task-util.d.ts +2 -0
  209. package/lib/browser/assistant/assistant-task-util.js +5 -0
  210. package/lib/browser/assistant/assistant.d.ts +3 -0
  211. package/lib/browser/assistant/assistant.js +26 -2
  212. package/lib/browser/assistant/ta-hearing.d.ts +86 -0
  213. package/lib/browser/assistant/ta-hearing.js +277 -0
  214. package/lib/browser/components/app-shell-hooks.d.ts +2 -1
  215. package/lib/browser/components/app-shell-hooks.js +4 -3
  216. package/lib/browser/components/app-shell-state.js +2 -2
  217. package/lib/browser/components/auth-view.js +1 -1
  218. package/lib/browser/components/board.js +9 -1
  219. package/lib/browser/components/chat-list-row.js +4 -4
  220. package/lib/browser/components/chat-list-util.d.ts +2 -2
  221. package/lib/browser/components/clipboard-link-host.d.ts +3 -0
  222. package/lib/browser/components/clipboard-link-host.js +63 -0
  223. package/lib/browser/components/cloud-network.js +1 -1
  224. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  225. package/lib/browser/components/custom-host.d.ts +4 -1
  226. package/lib/browser/components/custom-host.js +8 -2
  227. package/lib/browser/components/custom-provider-advanced.js +8 -8
  228. package/lib/browser/components/custom-provider-view.js +12 -12
  229. package/lib/browser/components/earlier-messages.d.ts +4 -1
  230. package/lib/browser/components/earlier-messages.js +5 -2
  231. package/lib/browser/components/empty-state.d.ts +2 -1
  232. package/lib/browser/components/empty-state.js +6 -2
  233. package/lib/browser/components/folder-picker.js +2 -2
  234. package/lib/browser/components/gallery.js +7 -8
  235. package/lib/browser/components/hearing-host.d.ts +6 -0
  236. package/lib/browser/components/hearing-host.js +94 -0
  237. package/lib/browser/components/host-view.d.ts +1 -1
  238. package/lib/browser/components/link-dialog.js +4 -0
  239. package/lib/browser/components/loading.d.ts +3 -2
  240. package/lib/browser/components/loading.js +7 -3
  241. package/lib/browser/components/markdown.d.ts +3 -1
  242. package/lib/browser/components/markdown.js +9 -4
  243. package/lib/browser/components/media.d.ts +10 -4
  244. package/lib/browser/components/media.js +61 -14
  245. package/lib/browser/components/message-list.js +2 -1
  246. package/lib/browser/components/message-steps.js +8 -5
  247. package/lib/browser/components/people-picker.d.ts +18 -0
  248. package/lib/browser/components/people-picker.js +166 -0
  249. package/lib/browser/components/relay-view.js +1 -1
  250. package/lib/browser/components/settings-choices.d.ts +2 -1
  251. package/lib/browser/components/settings-choices.js +2 -1
  252. package/lib/browser/components/settings-parts.js +23 -1
  253. package/lib/browser/components/share-dialog.d.ts +2 -2
  254. package/lib/browser/components/share-dialog.js +7 -4
  255. package/lib/browser/components/share-friends.d.ts +18 -2
  256. package/lib/browser/components/share-friends.js +67 -13
  257. package/lib/browser/components/share-item-sheet.d.ts +13 -0
  258. package/lib/browser/components/share-item-sheet.js +75 -0
  259. package/lib/browser/components/share-sheet.d.ts +12 -4
  260. package/lib/browser/components/share-sheet.js +14 -4
  261. package/lib/browser/components/sign-in-setup.js +4 -4
  262. package/lib/browser/components/trusted-domains.js +1 -1
  263. package/lib/browser/components/view-room.d.ts +26 -0
  264. package/lib/browser/components/view-room.js +173 -0
  265. package/lib/browser/components/voice-services.js +6 -6
  266. package/lib/browser/device/device-protocol.d.ts +9 -6
  267. package/lib/browser/device/device-protocol.js +7 -4
  268. package/lib/browser/device/launch-screen.d.ts +11 -1
  269. package/lib/browser/device/launch-screen.js +22 -4
  270. package/lib/browser/extension/share-sheet-compat.d.ts +2 -0
  271. package/lib/browser/extension/share-sheet-compat.js +13 -2
  272. package/lib/browser/extension/web-api-chats.d.ts +23 -0
  273. package/lib/browser/extension/web-api-code.d.ts +11 -0
  274. package/lib/browser/extension/web-api-components.d.ts +8 -1
  275. package/lib/browser/extension/web-api-contributions.d.ts +30 -1
  276. package/lib/browser/extension/web-api-desktop.d.ts +2 -1
  277. package/lib/browser/extension/web-api-file-views.d.ts +39 -0
  278. package/lib/browser/extension/web-api-file-views.js +3 -0
  279. package/lib/browser/extension/web-api-host.d.ts +48 -0
  280. package/lib/browser/extension/web-api-host.js +4 -0
  281. package/lib/browser/extension/web-api-menus.d.ts +46 -0
  282. package/lib/browser/extension/web-api-partners.d.ts +58 -1
  283. package/lib/browser/extension/web-api-skins.d.ts +96 -0
  284. package/lib/browser/extension/web-api-skins.js +3 -0
  285. package/lib/browser/extension/web-api-spec.js +9 -0
  286. package/lib/browser/extension/web-extension-api.d.ts +13 -34
  287. package/lib/browser/extension/web-extension-context.d.ts +2 -8
  288. package/lib/browser/extension/web-extension-context.js +15 -39
  289. package/lib/browser/extension/web-extension-marks.d.ts +11 -0
  290. package/lib/browser/extension/web-extension-marks.js +65 -0
  291. package/lib/browser/extension/web-extension-protocol.d.ts +13 -1
  292. package/lib/browser/extension/web-extension-protocol.js +4 -0
  293. package/lib/browser/extension/web-extension-run.d.ts +16 -2
  294. package/lib/browser/extension/web-extension-run.js +80 -0
  295. package/lib/browser/extension/web-extensions-running.d.ts +5 -1
  296. package/lib/browser/extension/web-extensions-running.js +16 -0
  297. package/lib/browser/extension/web-extensions.d.ts +2 -1
  298. package/lib/browser/extension/web-extensions.js +3 -0
  299. package/lib/browser/extension/web-home.js +3 -1
  300. package/lib/browser/extension/web-host-values.d.ts +67 -0
  301. package/lib/browser/extension/web-host-values.js +229 -0
  302. package/lib/browser/extension/web-hosts.d.ts +7 -2
  303. package/lib/browser/extension/web-hosts.js +16 -4
  304. package/lib/browser/extension/web-share-ui.d.ts +8 -0
  305. package/lib/browser/extension/web-share-ui.js +56 -0
  306. package/lib/browser/extension/web-share.d.ts +19 -0
  307. package/lib/browser/extension/web-share.js +45 -0
  308. package/lib/browser/i18n/en/assistant.d.ts +4 -0
  309. package/lib/browser/i18n/en/assistant.js +4 -0
  310. package/lib/browser/i18n/en/chat.d.ts +10 -0
  311. package/lib/browser/i18n/en/chat.js +10 -0
  312. package/lib/browser/i18n/en/common.d.ts +15 -0
  313. package/lib/browser/i18n/en/common.js +15 -0
  314. package/lib/browser/i18n/en/discover.d.ts +11 -1
  315. package/lib/browser/i18n/en/discover.js +11 -1
  316. package/lib/browser/i18n/en/settings.d.ts +10 -0
  317. package/lib/browser/i18n/en/settings.js +10 -0
  318. package/lib/browser/i18n/ja/assistant.js +4 -0
  319. package/lib/browser/i18n/ja/chat.js +10 -0
  320. package/lib/browser/i18n/ja/common.js +15 -0
  321. package/lib/browser/i18n/ja/discover.js +11 -1
  322. package/lib/browser/i18n/ja/settings.js +10 -0
  323. package/lib/browser/i18n/locales.d.ts +51 -2
  324. package/lib/browser/i18n/messages.d.ts +50 -1
  325. package/lib/browser/i18n/zh/assistant.js +4 -0
  326. package/lib/browser/i18n/zh/chat.js +10 -0
  327. package/lib/browser/i18n/zh/common.js +15 -0
  328. package/lib/browser/i18n/zh/discover.js +11 -1
  329. package/lib/browser/i18n/zh/settings.js +10 -0
  330. package/lib/browser/i18n/zh-tw/assistant.js +4 -0
  331. package/lib/browser/i18n/zh-tw/chat.js +10 -0
  332. package/lib/browser/i18n/zh-tw/common.js +15 -0
  333. package/lib/browser/i18n/zh-tw/discover.js +11 -1
  334. package/lib/browser/i18n/zh-tw/settings.js +10 -0
  335. package/lib/browser/launch-art/art-palette.d.ts +42 -0
  336. package/lib/browser/launch-art/art-palette.js +76 -0
  337. package/lib/browser/launch-art/cyclic-automaton.d.ts +46 -0
  338. package/lib/browser/launch-art/cyclic-automaton.js +180 -0
  339. package/lib/browser/launch-art/fractal-tree.d.ts +44 -0
  340. package/lib/browser/launch-art/fractal-tree.js +52 -0
  341. package/lib/browser/launch-art/launch-art.d.ts +99 -0
  342. package/lib/browser/launch-art/launch-art.js +424 -0
  343. package/lib/browser/launch-art/launch-sky.d.ts +67 -0
  344. package/lib/browser/launch-art/launch-sky.js +157 -0
  345. package/lib/browser/links/clipboard-links.d.ts +86 -0
  346. package/lib/browser/links/clipboard-links.js +266 -0
  347. package/lib/browser/links/link-text.d.ts +30 -0
  348. package/lib/browser/links/link-text.js +100 -0
  349. package/lib/browser/links/links-protocol.d.ts +12 -1
  350. package/lib/browser/links/links.d.ts +8 -2
  351. package/lib/browser/links/links.js +33 -3
  352. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  353. package/lib/browser/markdown/code-renderers.js +5 -1
  354. package/lib/browser/partners/group-picker.js +23 -29
  355. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  356. package/lib/browser/sandbox/work/work-senses.js +1 -1
  357. package/lib/browser/settings/settings-protocol.d.ts +26 -0
  358. package/lib/browser/settings/settings-protocol.js +12 -1
  359. package/lib/browser/settings/settings.d.ts +4 -1
  360. package/lib/browser/settings/settings.js +16 -3
  361. package/lib/browser/skin/skin-layer.d.ts +9 -0
  362. package/lib/browser/skin/skin-layer.js +154 -0
  363. package/lib/browser/skin/skin-util.d.ts +41 -0
  364. package/lib/browser/skin/skin-util.js +123 -0
  365. package/lib/browser/style/base.d.ts +1 -1
  366. package/lib/browser/style/base.js +10 -6
  367. package/lib/browser/style/chat-list.d.ts +1 -1
  368. package/lib/browser/style/chat-list.js +28 -15
  369. package/lib/browser/style/conversation-column.d.ts +1 -1
  370. package/lib/browser/style/conversation.d.ts +1 -1
  371. package/lib/browser/style/conversation.js +5 -4
  372. package/lib/browser/style/dialogs.d.ts +1 -1
  373. package/lib/browser/style/dialogs.js +2 -5
  374. package/lib/browser/style/forms.d.ts +6 -0
  375. package/lib/browser/style/forms.js +68 -0
  376. package/lib/browser/style/layout.d.ts +1 -1
  377. package/lib/browser/style/pages.d.ts +1 -1
  378. package/lib/browser/style/pages.js +14 -24
  379. package/lib/browser/style/phone.d.ts +1 -1
  380. package/lib/browser/style/shared.d.ts +1 -1
  381. package/lib/browser/style/shell.d.ts +1 -1
  382. package/lib/browser/style/shell.js +1 -6
  383. package/lib/browser/style/skins.d.ts +10 -0
  384. package/lib/browser/style/skins.js +110 -0
  385. package/lib/browser/style/surfaces.d.ts +1 -1
  386. package/lib/browser/style/surfaces.js +8 -6
  387. package/lib/browser/style/tasks.d.ts +1 -1
  388. package/lib/browser/style.js +4 -0
  389. package/lib/browser/util/fresh-rows.d.ts +22 -0
  390. package/lib/browser/util/fresh-rows.js +40 -0
  391. package/lib/browser/util/process.d.ts +12 -22
  392. package/lib/browser/util/process.js +49 -40
  393. package/lib/browser/util/voice.d.ts +18 -0
  394. package/lib/browser/util/voice.js +111 -3
  395. package/lib/browser/workbench-protocol.d.ts +2 -0
  396. package/lib/browser/workbench-services.d.ts +2 -0
  397. package/lib/browser/workbench-services.js +5 -0
  398. package/lib/browser/workbench.js +5 -0
  399. package/package.json +8 -8
  400. package/public/launch.svg +3 -3
@@ -0,0 +1,99 @@
1
+ import { ArtPalette } from './art-palette';
2
+ import { FractalTree } from './fractal-tree';
3
+ import { LaunchSky, type LaunchStir } from './launch-sky';
4
+ /** An SVG transform as its matrix: a, b, c, d, e, f. */
5
+ export type Affine = [number, number, number, number, number, number];
6
+ /** Where the picture (360 by 640, fit inside like `object-fit: contain`) lies on a canvas of `width` by `height`. */
7
+ export interface LaunchView {
8
+ scale: number;
9
+ x: number;
10
+ y: number;
11
+ }
12
+ /**
13
+ * The launch picture come alive, over the still one (`public/launch.svg`, which the native launch screen shows too): its
14
+ * night sky is painted, stroke by stroke, along the waves of a cyclic automaton (LaunchSky) that never comes to rest,
15
+ * whirling round its cores as Van Gogh's sky does, its colours and brush going from his night to Hokusai's wave, Klimt's
16
+ * gold, the green dawn of Ta and ink wash; and on the planet's rim, behind the dinosaur, a tree of life grows (FractalTree,
17
+ * Klimt's, its tips curls of gold) and sways. A tap sows a new whirl; a finger drawn across stirs the paint and the tree
18
+ * leans toward it; while a finger is down the launch screen stays (`held`). The canvases fade in over the still picture,
19
+ * so the native launch screen goes into it without a seam; the sky goes on at the next launch from where it was left.
20
+ */
21
+ export declare class LaunchArt {
22
+ protected readonly element: HTMLElement;
23
+ protected readonly storage: Storage | undefined;
24
+ protected readonly random: () => number;
25
+ static readonly KEY: string;
26
+ static readonly TREE_X = 262;
27
+ static readonly GROW = 1.8;
28
+ /** Pixels a point at most: strokes of paint need no more, and the launch screen keeps its memory small. */
29
+ static readonly RATIO = 1.5;
30
+ /** Of the paint left from the frame before, at 60 frames a second, what each frame wipes. */
31
+ static readonly FADE = 0.025;
32
+ held: boolean;
33
+ protected readonly paint: HTMLCanvasElement;
34
+ protected readonly live: HTMLCanvasElement;
35
+ protected readonly mask: HTMLCanvasElement;
36
+ protected readonly veil: HTMLDivElement;
37
+ protected readonly palette: ArtPalette;
38
+ protected readonly sky: LaunchSky;
39
+ protected readonly tree: FractalTree;
40
+ protected readonly releases: (() => void)[];
41
+ protected readonly ripples: {
42
+ x: number;
43
+ y: number;
44
+ age: number;
45
+ }[];
46
+ protected view: LaunchView;
47
+ protected ratio: number;
48
+ protected request: number;
49
+ protected last: number;
50
+ protected age: number;
51
+ protected stir: LaunchStir | undefined;
52
+ protected lean: number;
53
+ protected leanTo: number;
54
+ protected wind: number;
55
+ protected stopped: boolean;
56
+ protected readonly listeners: [string, (event: PointerEvent) => void][];
57
+ constructor(element: HTMLElement, storage: Storage | undefined, random?: () => number);
58
+ /** Where `width` by `height` shows the picture, as `object-fit: contain`. */
59
+ static fit(width: number, height: number): LaunchView;
60
+ static multiply(m: Affine, n: Affine): Affine;
61
+ /** The matrix of an SVG `transform` of translate, rotate (about the origin) and scale. */
62
+ static affine(transform: string): Affine;
63
+ /** The dinosaur of `launch.svg`: its outline and where the picture puts it, for the paint not to cover it. */
64
+ static dinosaur(svg: string): {
65
+ path: string;
66
+ matrix: Affine;
67
+ } | undefined;
68
+ /** The settings ask for less motion (Look.reduceMotion, kept by the page before), or the system does. */
69
+ static calm(storage: Storage | undefined, prefersReduced: boolean): boolean;
70
+ start(svg: Promise<string>): void;
71
+ /** `next` when the finger holding the launch screen lets go. */
72
+ onRelease(next: () => void): void;
73
+ stop(): void;
74
+ protected listen(name: string, listener: (event: PointerEvent) => void): void;
75
+ /** A point of the page in the units of the picture. */
76
+ protected point(event: PointerEvent): {
77
+ x: number;
78
+ y: number;
79
+ };
80
+ protected down(event: PointerEvent): void;
81
+ protected moved(event: PointerEvent): void;
82
+ protected up(): void;
83
+ protected readonly tick: (now: number) => void;
84
+ /**
85
+ * What the paint never covers, as how much of it each frame wipes: the planet, the dinosaur and the moon all of it,
86
+ * toward the rim, where the dawn is, a little.
87
+ */
88
+ protected draw(dinosaur: ReturnType<typeof LaunchArt.dinosaur>): void;
89
+ protected place(context: CanvasRenderingContext2D): void;
90
+ /** A frame of paint: the last frame's a little wiped, then each stroke drawn on along the fronts, in the colour of its phase. */
91
+ protected lay(seconds: number): void;
92
+ /** The tree on the rim and the rings of the taps, drawn anew each frame. */
93
+ protected grow(seconds: number): void;
94
+ }
95
+ export declare namespace LaunchArtUtil {
96
+ /** The living launch picture over `element` (`#ta-launch`), unless less motion is asked for. */
97
+ function start(element: HTMLElement): LaunchArt | undefined;
98
+ }
99
+ //# sourceMappingURL=launch-art.d.ts.map
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LaunchArtUtil = exports.LaunchArt = void 0;
4
+ const state_protocol_1 = require("../state/state-protocol");
5
+ const art_palette_1 = require("./art-palette");
6
+ const fractal_tree_1 = require("./fractal-tree");
7
+ const launch_sky_1 = require("./launch-sky");
8
+ const GOLD = [232, 185, 74];
9
+ const css = (color, alpha = 1) => `rgba(${color[0]},${color[1]},${color[2]},${alpha})`;
10
+ /**
11
+ * The launch picture come alive, over the still one (`public/launch.svg`, which the native launch screen shows too): its
12
+ * night sky is painted, stroke by stroke, along the waves of a cyclic automaton (LaunchSky) that never comes to rest,
13
+ * whirling round its cores as Van Gogh's sky does, its colours and brush going from his night to Hokusai's wave, Klimt's
14
+ * gold, the green dawn of Ta and ink wash; and on the planet's rim, behind the dinosaur, a tree of life grows (FractalTree,
15
+ * Klimt's, its tips curls of gold) and sways. A tap sows a new whirl; a finger drawn across stirs the paint and the tree
16
+ * leans toward it; while a finger is down the launch screen stays (`held`). The canvases fade in over the still picture,
17
+ * so the native launch screen goes into it without a seam; the sky goes on at the next launch from where it was left.
18
+ */
19
+ class LaunchArt {
20
+ constructor(element, storage, random = Math.random) {
21
+ this.element = element;
22
+ this.storage = storage;
23
+ this.random = random;
24
+ this.held = false;
25
+ this.paint = document.createElement('canvas');
26
+ this.live = document.createElement('canvas');
27
+ this.mask = document.createElement('canvas');
28
+ this.veil = document.createElement('div');
29
+ this.palette = new art_palette_1.ArtPalette();
30
+ this.releases = [];
31
+ this.ripples = [];
32
+ this.view = { scale: 1, x: 0, y: 0 };
33
+ this.ratio = 1;
34
+ this.request = 0;
35
+ this.last = 0;
36
+ this.age = 0;
37
+ this.lean = 0;
38
+ this.leanTo = 0;
39
+ this.wind = 0;
40
+ this.stopped = false;
41
+ this.listeners = [];
42
+ this.tick = (now) => {
43
+ const seconds = Math.min(0.05, (now - this.last) / 1000);
44
+ this.last = now;
45
+ this.age += seconds;
46
+ this.lean += (this.leanTo - this.lean) * Math.min(1, seconds * 4);
47
+ this.wind *= Math.max(0, 1 - seconds * 1.5);
48
+ if (this.stir) {
49
+ this.stir.vx *= 0.85;
50
+ this.stir.vy *= 0.85;
51
+ }
52
+ this.lay(seconds);
53
+ this.grow(seconds);
54
+ this.request = requestAnimationFrame(this.tick);
55
+ };
56
+ this.sky = new launch_sky_1.LaunchSky(launch_sky_1.LaunchSky.parse(storage === null || storage === void 0 ? void 0 : storage.getItem(LaunchArt.KEY)), random);
57
+ const { launches } = this.sky;
58
+ this.tree = new fractal_tree_1.FractalTree(6 + (launches >= 10 ? 1 : 0) + (launches >= 30 ? 1 : 0), random);
59
+ }
60
+ /** Where `width` by `height` shows the picture, as `object-fit: contain`. */
61
+ static fit(width, height) {
62
+ const scale = Math.min(width / 360, height / 640);
63
+ return { scale, x: (width - 360 * scale) / 2, y: (height - 640 * scale) / 2 };
64
+ }
65
+ static multiply(m, n) {
66
+ return [
67
+ m[0] * n[0] + m[2] * n[1],
68
+ m[1] * n[0] + m[3] * n[1],
69
+ m[0] * n[2] + m[2] * n[3],
70
+ m[1] * n[2] + m[3] * n[3],
71
+ m[0] * n[4] + m[2] * n[5] + m[4],
72
+ m[1] * n[4] + m[3] * n[5] + m[5],
73
+ ];
74
+ }
75
+ /** The matrix of an SVG `transform` of translate, rotate (about the origin) and scale. */
76
+ static affine(transform) {
77
+ var _a, _b, _c;
78
+ let matrix = [1, 0, 0, 1, 0, 0];
79
+ for (const [, name, args] of transform.matchAll(/(\w+)\(([^)]*)\)/g)) {
80
+ const values = args
81
+ .split(/[\s,]+/)
82
+ .filter(Boolean)
83
+ .map(Number);
84
+ const turn = (((_a = values[0]) !== null && _a !== void 0 ? _a : 0) * Math.PI) / 180;
85
+ const step = name === 'translate'
86
+ ? [1, 0, 0, 1, values[0], (_b = values[1]) !== null && _b !== void 0 ? _b : 0]
87
+ : name === 'scale'
88
+ ? [values[0], 0, 0, (_c = values[1]) !== null && _c !== void 0 ? _c : values[0], 0, 0]
89
+ : name === 'rotate'
90
+ ? [Math.cos(turn), Math.sin(turn), -Math.sin(turn), Math.cos(turn), 0, 0]
91
+ : undefined;
92
+ if (step) {
93
+ matrix = LaunchArt.multiply(matrix, step);
94
+ }
95
+ }
96
+ return matrix;
97
+ }
98
+ /** The dinosaur of `launch.svg`: its outline and where the picture puts it, for the paint not to cover it. */
99
+ static dinosaur(svg) {
100
+ var _a, _b;
101
+ const path = (_a = /<path id="dino"[^>]*\sd="([^"]+)"/.exec(svg)) === null || _a === void 0 ? void 0 : _a[1];
102
+ const transform = (_b = /<g transform="([^"]+)">\s*<use href="#dino"/.exec(svg)) === null || _b === void 0 ? void 0 : _b[1];
103
+ return path && transform ? { path, matrix: LaunchArt.affine(transform) } : undefined;
104
+ }
105
+ /** The settings ask for less motion (Look.reduceMotion, kept by the page before), or the system does. */
106
+ static calm(storage, prefersReduced) {
107
+ var _a;
108
+ var _b;
109
+ try {
110
+ return prefersReduced || ((_a = JSON.parse((_b = storage === null || storage === void 0 ? void 0 : storage.getItem(state_protocol_1.StateUtil.localKey('look', 'device', undefined))) !== null && _b !== void 0 ? _b : 'null')) === null || _a === void 0 ? void 0 : _a.reduceMotion) === true;
111
+ }
112
+ catch (_c) {
113
+ return prefersReduced;
114
+ }
115
+ }
116
+ start(svg) {
117
+ var _a;
118
+ const { element } = this;
119
+ const width = element.clientWidth;
120
+ const height = element.clientHeight;
121
+ this.ratio = Math.min(LaunchArt.RATIO, window.devicePixelRatio || 1);
122
+ this.view = LaunchArt.fit(width, height);
123
+ for (const canvas of [this.paint, this.live, this.mask]) {
124
+ canvas.width = Math.round(width * this.ratio);
125
+ canvas.height = Math.round(height * this.ratio);
126
+ }
127
+ const { scale, x, y } = this.view;
128
+ // The vignette of launch.svg over the paint, so the paint fades into the night at the edges as the picture does.
129
+ this.veil.style.background = `radial-gradient(ellipse ${180 * scale}px ${320 * scale}px at ${x + 180 * scale}px ${y + 320 * scale}px, rgba(11,13,16,0) 62%, #0b0d10 97%)`;
130
+ for (const layer of [this.paint, this.live, this.veil]) {
131
+ layer.style.cssText += ';position:absolute;inset:0;width:100%;height:100%;opacity:0;transition:opacity 600ms ease;pointer-events:none';
132
+ element.appendChild(layer);
133
+ }
134
+ element.style.touchAction = 'none';
135
+ this.listen('pointerdown', event => this.down(event));
136
+ // A long press is held to play, not the menu of the system (Android's for a picture).
137
+ this.listen('contextmenu', event => event.preventDefault());
138
+ this.listen('pointermove', event => this.moved(event));
139
+ for (const name of ['pointerup', 'pointercancel', 'pointerleave']) {
140
+ this.listen(name, () => this.up());
141
+ }
142
+ (_a = this.storage) === null || _a === void 0 ? void 0 : _a.setItem(LaunchArt.KEY, JSON.stringify(this.sky.kept()));
143
+ const begin = (dinosaur) => {
144
+ if (this.stopped) {
145
+ return;
146
+ }
147
+ this.draw(dinosaur);
148
+ for (const layer of [this.paint, this.live, this.veil]) {
149
+ layer.style.opacity = '1';
150
+ }
151
+ this.last = performance.now();
152
+ this.request = requestAnimationFrame(this.tick);
153
+ };
154
+ svg.then(text => begin(LaunchArt.dinosaur(text)), () => begin(undefined));
155
+ }
156
+ /** `next` when the finger holding the launch screen lets go. */
157
+ onRelease(next) {
158
+ this.releases.push(next);
159
+ }
160
+ stop() {
161
+ var _a;
162
+ if (this.stopped) {
163
+ return;
164
+ }
165
+ this.stopped = true;
166
+ cancelAnimationFrame(this.request);
167
+ for (const [name, listener] of this.listeners) {
168
+ this.element.removeEventListener(name, listener);
169
+ }
170
+ (_a = this.storage) === null || _a === void 0 ? void 0 : _a.setItem(LaunchArt.KEY, JSON.stringify(this.sky.kept()));
171
+ }
172
+ listen(name, listener) {
173
+ this.listeners.push([name, listener]);
174
+ this.element.addEventListener(name, listener);
175
+ }
176
+ /** A point of the page in the units of the picture. */
177
+ point(event) {
178
+ const box = this.element.getBoundingClientRect();
179
+ return { x: (event.clientX - box.left - this.view.x) / this.view.scale, y: (event.clientY - box.top - this.view.y) / this.view.scale };
180
+ }
181
+ down(event) {
182
+ this.held = true;
183
+ const { x, y } = this.point(event);
184
+ this.sky.plant(x, y);
185
+ this.ripples.push({ x, y, age: 0 });
186
+ this.stir = { x, y, vx: 0, vy: 0 };
187
+ this.leanTo = Math.max(-1, Math.min(1, (x - LaunchArt.TREE_X) / 120));
188
+ }
189
+ moved(event) {
190
+ if (!this.held || !this.stir) {
191
+ return;
192
+ }
193
+ const { x, y } = this.point(event);
194
+ this.stir = { x, y, vx: (x - this.stir.x) * 30, vy: (y - this.stir.y) * 30 };
195
+ this.leanTo = Math.max(-1, Math.min(1, (x - LaunchArt.TREE_X) / 120));
196
+ this.wind = Math.max(-1, Math.min(1, this.wind + this.stir.vx / 600));
197
+ }
198
+ up() {
199
+ if (!this.held) {
200
+ return;
201
+ }
202
+ this.held = false;
203
+ this.stir = undefined;
204
+ this.leanTo = 0;
205
+ for (const next of this.releases.splice(0)) {
206
+ next();
207
+ }
208
+ }
209
+ /**
210
+ * What the paint never covers, as how much of it each frame wipes: the planet, the dinosaur and the moon all of it,
211
+ * toward the rim, where the dawn is, a little.
212
+ */
213
+ draw(dinosaur) {
214
+ const context = this.mask.getContext('2d');
215
+ if (!context) {
216
+ return;
217
+ }
218
+ const { PLANET } = launch_sky_1.LaunchSky;
219
+ this.place(context);
220
+ const dawn = context.createLinearGradient(0, 340, 0, 404);
221
+ dawn.addColorStop(0, 'rgba(0,0,0,0)');
222
+ dawn.addColorStop(1, 'rgba(0,0,0,0.12)');
223
+ context.fillStyle = dawn;
224
+ context.fillRect(0, 330, 360, 80);
225
+ context.fillStyle = '#000';
226
+ context.beginPath();
227
+ context.rect(-2000, -2000, 4360, 4640);
228
+ context.rect(0, 0, 360, 640);
229
+ context.fill('evenodd');
230
+ context.beginPath();
231
+ context.arc(PLANET.x, PLANET.y, PLANET.r + 1, 0, Math.PI * 2);
232
+ context.fill();
233
+ // The young moon of the picture, which the paint goes round.
234
+ const moon = context.createRadialGradient(76, 170, 10, 76, 170, 22);
235
+ moon.addColorStop(0, 'rgba(0,0,0,1)');
236
+ moon.addColorStop(1, 'rgba(0,0,0,0)');
237
+ context.fillStyle = moon;
238
+ context.fillRect(50, 144, 52, 52);
239
+ context.fillStyle = '#000';
240
+ if (dinosaur) {
241
+ context.save();
242
+ context.transform(...dinosaur.matrix);
243
+ context.lineWidth = 6;
244
+ context.strokeStyle = '#000';
245
+ const outline = new Path2D(dinosaur.path);
246
+ context.fill(outline);
247
+ context.stroke(outline);
248
+ context.restore();
249
+ }
250
+ }
251
+ place(context) {
252
+ const { scale, x, y } = this.view;
253
+ const { ratio } = this;
254
+ context.setTransform(ratio * scale, 0, 0, ratio * scale, ratio * x, ratio * y);
255
+ }
256
+ /** A frame of paint: the last frame's a little wiped, then each stroke drawn on along the fronts, in the colour of its phase. */
257
+ lay(seconds) {
258
+ const context = this.paint.getContext('2d');
259
+ if (!context) {
260
+ return;
261
+ }
262
+ const { sky, palette } = this;
263
+ sky.advance(seconds);
264
+ const brush = palette.brush(sky.clock);
265
+ const colors = palette.colors(sky.clock, launch_sky_1.LaunchSky.STATES);
266
+ sky.move(seconds, brush, this.stir);
267
+ context.setTransform(1, 0, 0, 1, 0, 0);
268
+ context.globalCompositeOperation = 'destination-out';
269
+ context.globalAlpha = 1 - (1 - LaunchArt.FADE) ** (seconds * 60);
270
+ context.fillRect(0, 0, this.paint.width, this.paint.height);
271
+ context.globalAlpha = 1;
272
+ context.drawImage(this.mask, 0, 0);
273
+ context.globalCompositeOperation = 'source-over';
274
+ this.place(context);
275
+ context.lineCap = 'round';
276
+ context.globalAlpha = brush.alpha;
277
+ const groups = Array.from({ length: launch_sky_1.LaunchSky.STATES * 3 }, () => []);
278
+ const tiles = Array.from({ length: launch_sky_1.LaunchSky.STATES }, () => []);
279
+ const frame = Math.floor(sky.clock * 30);
280
+ for (let index = 0; index < launch_sky_1.LaunchSky.STROKES; index++) {
281
+ if (Math.abs(sky.x[index] - sky.px[index]) + Math.abs(sky.y[index] - sky.py[index]) < 0.15) {
282
+ // Barely moved (just laid, or where the fronts stall): a round cap of nothing would be a dot.
283
+ continue;
284
+ }
285
+ const phase = sky.phase(index);
286
+ if (sky.pick[index] < brush.tiles) {
287
+ if ((frame + index) % 6 === 0) {
288
+ tiles[phase].push(index);
289
+ }
290
+ }
291
+ else {
292
+ groups[phase * 3 + sky.tone[index]].push(index);
293
+ }
294
+ }
295
+ for (let group = 0; group < groups.length; group++) {
296
+ const members = groups[group];
297
+ if (!members.length) {
298
+ continue;
299
+ }
300
+ const phase = Math.floor(group / 3);
301
+ const tone = group % 3;
302
+ context.strokeStyle = css(art_palette_1.ArtPalette.blend(colors[phase], colors[(phase + 1) % colors.length], tone * 0.22));
303
+ context.lineWidth = brush.width * [1.25, 1, 0.7][tone];
304
+ context.beginPath();
305
+ for (const index of members) {
306
+ context.moveTo(sky.px[index], sky.py[index]);
307
+ context.lineTo(sky.x[index], sky.y[index]);
308
+ }
309
+ context.stroke();
310
+ }
311
+ const side = brush.width * 1.6;
312
+ for (let phase = 0; phase < tiles.length; phase++) {
313
+ if (!tiles[phase].length) {
314
+ continue;
315
+ }
316
+ context.fillStyle = css(art_palette_1.ArtPalette.blend(colors[phase], GOLD, 0.35));
317
+ for (const index of tiles[phase]) {
318
+ context.fillRect(Math.round(sky.x[index] / side) * side - side / 2, Math.round(sky.y[index] / side) * side - side / 2, side * 0.86, side * 0.86);
319
+ }
320
+ }
321
+ context.globalAlpha = 1;
322
+ }
323
+ /** The tree on the rim and the rings of the taps, drawn anew each frame. */
324
+ grow(seconds) {
325
+ const context = this.live.getContext('2d');
326
+ if (!context) {
327
+ return;
328
+ }
329
+ context.setTransform(1, 0, 0, 1, 0, 0);
330
+ context.clearRect(0, 0, this.live.width, this.live.height);
331
+ this.place(context);
332
+ const { sky, palette, tree } = this;
333
+ const light = art_palette_1.ArtPalette.lightest(palette.colors(sky.clock, launch_sky_1.LaunchSky.STATES));
334
+ const gold = art_palette_1.ArtPalette.blend(GOLD, light, 0.35);
335
+ const into = Math.min(1, this.age / LaunchArt.GROW);
336
+ const segments = tree.segments({
337
+ x: LaunchArt.TREE_X,
338
+ y: launch_sky_1.LaunchSky.rim(LaunchArt.TREE_X) + 1.5,
339
+ size: Math.min(52, 30 + sky.launches * 0.6),
340
+ sway: Math.sin(this.age * 0.8) * 0.35 + Math.sin(this.age * 2.3) * 0.08 + this.wind,
341
+ lean: this.lean,
342
+ growth: 1 - (1 - into) ** 3,
343
+ });
344
+ // The halo of the young moon, as Van Gogh's: rings of the lightest colour round it, breathing.
345
+ const breath = 0.5 + 0.5 * Math.sin(this.age * 1.3);
346
+ for (let ring = 0; ring < 3; ring++) {
347
+ context.strokeStyle = css(light, (0.22 - ring * 0.06) * (0.7 + 0.3 * breath));
348
+ context.lineWidth = 1.6 - ring * 0.4;
349
+ context.beginPath();
350
+ context.arc(76, 170, 15 + ring * 4.5 + breath * 0.8, 0, Math.PI * 2);
351
+ context.stroke();
352
+ }
353
+ context.lineCap = 'round';
354
+ context.strokeStyle = '#030605';
355
+ for (let depth = 0; depth <= tree.depth; depth++) {
356
+ context.lineWidth = (tree.depth - depth + 1) * 0.42;
357
+ context.beginPath();
358
+ for (const segment of segments) {
359
+ if (segment.depth === depth) {
360
+ context.moveTo(segment.x0, segment.y0);
361
+ context.lineTo(segment.x1, segment.y1);
362
+ }
363
+ }
364
+ context.stroke();
365
+ }
366
+ context.strokeStyle = css(gold, 0.95);
367
+ context.lineWidth = 0.55;
368
+ context.beginPath();
369
+ let hand = 1;
370
+ for (const segment of segments) {
371
+ if (!segment.tip) {
372
+ continue;
373
+ }
374
+ hand = -hand;
375
+ let { x1: x, y1: y, angle } = segment;
376
+ context.moveTo(x, y);
377
+ for (let turn = 0; turn < 9; turn++) {
378
+ angle += hand * 0.55;
379
+ const step = 1.2 * (1 - turn / 10);
380
+ x += Math.cos(angle) * step;
381
+ y += Math.sin(angle) * step;
382
+ context.lineTo(x, y);
383
+ }
384
+ }
385
+ context.stroke();
386
+ for (const ripple of this.ripples) {
387
+ ripple.age += seconds;
388
+ const left = 1 - ripple.age / 0.9;
389
+ if (left > 0) {
390
+ context.strokeStyle = css(light, left * 0.8);
391
+ context.lineWidth = 1.2;
392
+ context.beginPath();
393
+ context.arc(ripple.x, ripple.y, 4 + ripple.age * 60, 0, Math.PI * 2);
394
+ context.stroke();
395
+ }
396
+ }
397
+ this.ripples.splice(0, this.ripples.length, ...this.ripples.filter(ripple => ripple.age < 0.9));
398
+ }
399
+ }
400
+ exports.LaunchArt = LaunchArt;
401
+ LaunchArt.KEY = state_protocol_1.StateUtil.localKey('launch-art', 'device', undefined);
402
+ LaunchArt.TREE_X = 262;
403
+ LaunchArt.GROW = 1.8;
404
+ /** Pixels a point at most: strokes of paint need no more, and the launch screen keeps its memory small. */
405
+ LaunchArt.RATIO = 1.5;
406
+ /** Of the paint left from the frame before, at 60 frames a second, what each frame wipes. */
407
+ LaunchArt.FADE = 0.025;
408
+ var LaunchArtUtil;
409
+ (function (LaunchArtUtil) {
410
+ /** The living launch picture over `element` (`#ta-launch`), unless less motion is asked for. */
411
+ function start(element) {
412
+ var _a;
413
+ var _b;
414
+ const storage = typeof localStorage === 'undefined' ? undefined : localStorage;
415
+ if (typeof window === 'undefined' || LaunchArt.calm(storage, (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-reduced-motion: reduce)').matches) !== null && _b !== void 0 ? _b : false)) {
416
+ return undefined;
417
+ }
418
+ const art = new LaunchArt(element, storage);
419
+ art.start(fetch('launch.svg').then(response => response.text()));
420
+ return art;
421
+ }
422
+ LaunchArtUtil.start = start;
423
+ })(LaunchArtUtil || (exports.LaunchArtUtil = LaunchArtUtil = {}));
424
+ //# sourceMappingURL=launch-art.js.map
@@ -0,0 +1,67 @@
1
+ import type { ArtBrush } from './art-palette';
2
+ import { CyclicAutomaton } from './cyclic-automaton';
3
+ /** What a launch leaves for the next: the sky's cells, the clock of its eras, how many launches it has seen. */
4
+ export interface LaunchArtKept {
5
+ cells: string;
6
+ clock: number;
7
+ launches: number;
8
+ }
9
+ /** A hand stirring the paint: where (in the units of the picture) and how fast it moves. */
10
+ export interface LaunchStir {
11
+ x: number;
12
+ y: number;
13
+ vx: number;
14
+ vy: number;
15
+ }
16
+ /**
17
+ * The sky of the launch picture, without the page: a cyclic automaton over the sky of `public/launch.svg` (360 by 640,
18
+ * the planet's rim at y 400), the clock of the eras its colours go through, and the strokes painted along its wave fronts.
19
+ * It goes on from where the last launch left it (`kept`): each launch moves the clock on by PER_LAUNCH and the
20
+ * automaton by FIRST_STEPS, so no two launches open on the same sky.
21
+ */
22
+ export declare class LaunchSky {
23
+ protected readonly random: () => number;
24
+ static readonly COLS = 48;
25
+ static readonly ROWS = 55;
26
+ static readonly STATES = 8;
27
+ /** The side of a cell, in the units of the picture. */
28
+ static readonly CELL = 7.5;
29
+ /** Seconds between two steps of the automaton. */
30
+ static readonly STEP = 0.12;
31
+ static readonly PER_LAUNCH = 8;
32
+ static readonly FIRST_STEPS = 24;
33
+ static readonly STROKES = 900;
34
+ static readonly PLANET: {
35
+ x: number;
36
+ y: number;
37
+ r: number;
38
+ };
39
+ readonly automaton: CyclicAutomaton;
40
+ clock: number;
41
+ readonly launches: number;
42
+ /** Each stroke: where it is (x, y), where it was a frame ago (px, py), how long it has left, its pick (0 to 1) and tone (0, 1 or 2). */
43
+ readonly x: Float32Array<ArrayBuffer>;
44
+ readonly y: Float32Array<ArrayBuffer>;
45
+ readonly px: Float32Array<ArrayBuffer>;
46
+ readonly py: Float32Array<ArrayBuffer>;
47
+ readonly life: Float32Array<ArrayBuffer>;
48
+ readonly pick: Float32Array<ArrayBuffer>;
49
+ readonly tone: Uint8Array<ArrayBuffer>;
50
+ protected waiting: number;
51
+ constructor(kept: LaunchArtKept | undefined, random?: () => number);
52
+ static seed(random: () => number): CyclicAutomaton;
53
+ /** The height of the planet's rim at `x`. */
54
+ static rim(x: number): number;
55
+ static parse(text: string | null | undefined): LaunchArtKept | undefined;
56
+ kept(): LaunchArtKept;
57
+ /** `seconds` on: the clock, and the automaton a step every STEP (at most two a frame; a frozen sky is sown again). */
58
+ advance(seconds: number): void;
59
+ /** A new whirl where a finger touched the sky, `x`, `y` in the units of the picture; whether it was the sky. */
60
+ plant(x: number, y: number): boolean;
61
+ /** Every stroke `seconds` on along the fronts at the pace of `brush`, pushed by `stir` near it; those gone are laid anew. */
62
+ move(seconds: number, brush: ArtBrush, stir?: LaunchStir): void;
63
+ /** The phase of the automaton under a stroke. */
64
+ phase(index: number): number;
65
+ protected spawn(index: number): void;
66
+ }
67
+ //# sourceMappingURL=launch-sky.d.ts.map