@celljs/ta-web 4.42.0 → 4.43.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 (314) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/apps/web-apps.d.ts +4 -0
  4. package/esm/browser/apps/web-apps.js +14 -3
  5. package/esm/browser/assistant/ta-hearing.d.ts +85 -0
  6. package/esm/browser/assistant/ta-hearing.js +272 -0
  7. package/esm/browser/components/auth-view.js +1 -1
  8. package/esm/browser/components/board.js +9 -1
  9. package/esm/browser/components/clipboard-link-host.d.ts +2 -0
  10. package/esm/browser/components/clipboard-link-host.js +27 -0
  11. package/esm/browser/components/cloud-network.js +1 -1
  12. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  13. package/esm/browser/components/custom-provider-advanced.js +8 -8
  14. package/esm/browser/components/custom-provider-view.js +12 -12
  15. package/esm/browser/components/empty-state.d.ts +2 -1
  16. package/esm/browser/components/empty-state.js +6 -2
  17. package/esm/browser/components/folder-picker.js +2 -2
  18. package/esm/browser/components/gallery.js +8 -9
  19. package/esm/browser/components/hearing-host.d.ts +5 -0
  20. package/esm/browser/components/hearing-host.js +58 -0
  21. package/esm/browser/components/host-view.d.ts +1 -1
  22. package/esm/browser/components/link-dialog.js +4 -0
  23. package/esm/browser/components/loading.d.ts +3 -2
  24. package/esm/browser/components/loading.js +7 -3
  25. package/esm/browser/components/markdown.d.ts +3 -1
  26. package/esm/browser/components/markdown.js +10 -5
  27. package/esm/browser/components/media.d.ts +10 -4
  28. package/esm/browser/components/media.js +60 -14
  29. package/esm/browser/components/people-picker.d.ts +17 -0
  30. package/esm/browser/components/people-picker.js +129 -0
  31. package/esm/browser/components/relay-view.js +1 -1
  32. package/esm/browser/components/settings-parts.js +2 -0
  33. package/esm/browser/components/share-dialog.d.ts +2 -2
  34. package/esm/browser/components/share-dialog.js +7 -4
  35. package/esm/browser/components/share-friends.js +3 -10
  36. package/esm/browser/components/share-item-sheet.d.ts +12 -0
  37. package/esm/browser/components/share-item-sheet.js +39 -0
  38. package/esm/browser/components/share-sheet.d.ts +9 -2
  39. package/esm/browser/components/share-sheet.js +5 -4
  40. package/esm/browser/components/sign-in-setup.js +4 -4
  41. package/esm/browser/components/trusted-domains.js +1 -1
  42. package/esm/browser/components/view-room.d.ts +25 -0
  43. package/esm/browser/components/view-room.js +136 -0
  44. package/esm/browser/components/voice-services.js +6 -6
  45. package/esm/browser/device/device-protocol.d.ts +9 -6
  46. package/esm/browser/device/device-protocol.js +7 -4
  47. package/esm/browser/device/launch-screen.d.ts +11 -1
  48. package/esm/browser/device/launch-screen.js +22 -4
  49. package/esm/browser/extension/share-sheet-compat.d.ts +2 -0
  50. package/esm/browser/extension/share-sheet-compat.js +12 -2
  51. package/esm/browser/extension/web-api-code.d.ts +11 -0
  52. package/esm/browser/extension/web-api-components.d.ts +8 -1
  53. package/esm/browser/extension/web-api-contributions.d.ts +30 -1
  54. package/esm/browser/extension/web-api-desktop.d.ts +2 -1
  55. package/esm/browser/extension/web-api-file-views.d.ts +38 -0
  56. package/esm/browser/extension/web-api-file-views.js +2 -0
  57. package/esm/browser/extension/web-api-host.d.ts +47 -0
  58. package/esm/browser/extension/web-api-host.js +3 -0
  59. package/esm/browser/extension/web-api-menus.d.ts +46 -0
  60. package/esm/browser/extension/web-api-partners.d.ts +58 -1
  61. package/esm/browser/extension/web-api-spec.js +7 -0
  62. package/esm/browser/extension/web-extension-api.d.ts +10 -10
  63. package/esm/browser/extension/web-extension-context.d.ts +2 -8
  64. package/esm/browser/extension/web-extension-context.js +14 -39
  65. package/esm/browser/extension/web-extension-marks.d.ts +10 -0
  66. package/esm/browser/extension/web-extension-marks.js +29 -0
  67. package/esm/browser/extension/web-extension-protocol.d.ts +11 -1
  68. package/esm/browser/extension/web-extension-protocol.js +3 -0
  69. package/esm/browser/extension/web-extension-run.d.ts +15 -2
  70. package/esm/browser/extension/web-extension-run.js +77 -0
  71. package/esm/browser/extension/web-extensions-running.d.ts +5 -1
  72. package/esm/browser/extension/web-extensions-running.js +16 -0
  73. package/esm/browser/extension/web-extensions.d.ts +2 -1
  74. package/esm/browser/extension/web-extensions.js +3 -0
  75. package/esm/browser/extension/web-home.js +3 -1
  76. package/esm/browser/extension/web-host-values.d.ts +66 -0
  77. package/esm/browser/extension/web-host-values.js +191 -0
  78. package/esm/browser/extension/web-hosts.d.ts +7 -2
  79. package/esm/browser/extension/web-hosts.js +16 -4
  80. package/esm/browser/extension/web-share-ui.d.ts +7 -0
  81. package/esm/browser/extension/web-share-ui.js +15 -0
  82. package/esm/browser/extension/web-share.d.ts +18 -0
  83. package/esm/browser/extension/web-share.js +42 -0
  84. package/esm/browser/i18n/en/chat.d.ts +10 -0
  85. package/esm/browser/i18n/en/chat.js +10 -0
  86. package/esm/browser/i18n/en/common.d.ts +18 -0
  87. package/esm/browser/i18n/en/common.js +18 -0
  88. package/esm/browser/i18n/en/discover.d.ts +7 -0
  89. package/esm/browser/i18n/en/discover.js +7 -0
  90. package/esm/browser/i18n/en/settings.d.ts +2 -0
  91. package/esm/browser/i18n/en/settings.js +2 -0
  92. package/esm/browser/i18n/ja/chat.js +10 -0
  93. package/esm/browser/i18n/ja/common.js +18 -0
  94. package/esm/browser/i18n/ja/discover.js +7 -0
  95. package/esm/browser/i18n/ja/settings.js +2 -0
  96. package/esm/browser/i18n/locales.d.ts +38 -1
  97. package/esm/browser/i18n/messages.d.ts +37 -0
  98. package/esm/browser/i18n/zh/chat.js +10 -0
  99. package/esm/browser/i18n/zh/common.js +18 -0
  100. package/esm/browser/i18n/zh/discover.js +7 -0
  101. package/esm/browser/i18n/zh/settings.js +2 -0
  102. package/esm/browser/i18n/zh-tw/chat.js +10 -0
  103. package/esm/browser/i18n/zh-tw/common.js +18 -0
  104. package/esm/browser/i18n/zh-tw/discover.js +7 -0
  105. package/esm/browser/i18n/zh-tw/settings.js +2 -0
  106. package/esm/browser/launch-art/art-palette.d.ts +41 -0
  107. package/esm/browser/launch-art/art-palette.js +72 -0
  108. package/esm/browser/launch-art/cyclic-automaton.d.ts +45 -0
  109. package/esm/browser/launch-art/cyclic-automaton.js +176 -0
  110. package/esm/browser/launch-art/fractal-tree.d.ts +43 -0
  111. package/esm/browser/launch-art/fractal-tree.js +48 -0
  112. package/esm/browser/launch-art/launch-art.d.ts +98 -0
  113. package/esm/browser/launch-art/launch-art.js +420 -0
  114. package/esm/browser/launch-art/launch-sky.d.ts +66 -0
  115. package/esm/browser/launch-art/launch-sky.js +153 -0
  116. package/esm/browser/links/clipboard-links.d.ts +89 -0
  117. package/esm/browser/links/clipboard-links.js +303 -0
  118. package/esm/browser/links/link-text.d.ts +29 -0
  119. package/esm/browser/links/link-text.js +97 -0
  120. package/esm/browser/links/links-protocol.d.ts +12 -1
  121. package/esm/browser/links/links.d.ts +8 -2
  122. package/esm/browser/links/links.js +33 -3
  123. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  124. package/esm/browser/markdown/code-renderers.js +4 -0
  125. package/esm/browser/partners/group-picker.js +23 -29
  126. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  127. package/esm/browser/sandbox/work/work-senses.js +1 -1
  128. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  129. package/esm/browser/settings/settings-protocol.js +2 -0
  130. package/esm/browser/style/base.d.ts +1 -1
  131. package/esm/browser/style/base.js +10 -6
  132. package/esm/browser/style/chat-list.d.ts +1 -1
  133. package/esm/browser/style/chat-list.js +28 -15
  134. package/esm/browser/style/conversation-column.d.ts +1 -1
  135. package/esm/browser/style/conversation.d.ts +1 -1
  136. package/esm/browser/style/conversation.js +2 -2
  137. package/esm/browser/style/dialogs.d.ts +1 -1
  138. package/esm/browser/style/dialogs.js +2 -5
  139. package/esm/browser/style/forms.d.ts +5 -0
  140. package/esm/browser/style/forms.js +65 -0
  141. package/esm/browser/style/layout.d.ts +1 -1
  142. package/esm/browser/style/pages.d.ts +1 -1
  143. package/esm/browser/style/pages.js +14 -24
  144. package/esm/browser/style/phone.d.ts +1 -1
  145. package/esm/browser/style/shared.d.ts +1 -1
  146. package/esm/browser/style/shell.d.ts +1 -1
  147. package/esm/browser/style/shell.js +1 -6
  148. package/esm/browser/style/surfaces.d.ts +1 -1
  149. package/esm/browser/style/surfaces.js +0 -6
  150. package/esm/browser/style/tasks.d.ts +1 -1
  151. package/esm/browser/style.js +2 -0
  152. package/esm/browser/util/voice.d.ts +18 -0
  153. package/esm/browser/util/voice.js +111 -3
  154. package/esm/browser/workbench-protocol.d.ts +2 -0
  155. package/esm/browser/workbench-services.d.ts +2 -0
  156. package/esm/browser/workbench-services.js +5 -0
  157. package/esm/browser/workbench.js +5 -0
  158. package/lib/browser/apps/web-apps.d.ts +4 -0
  159. package/lib/browser/apps/web-apps.js +14 -3
  160. package/lib/browser/assistant/ta-hearing.d.ts +86 -0
  161. package/lib/browser/assistant/ta-hearing.js +277 -0
  162. package/lib/browser/components/auth-view.js +1 -1
  163. package/lib/browser/components/board.js +9 -1
  164. package/lib/browser/components/clipboard-link-host.d.ts +3 -0
  165. package/lib/browser/components/clipboard-link-host.js +63 -0
  166. package/lib/browser/components/cloud-network.js +1 -1
  167. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  168. package/lib/browser/components/custom-provider-advanced.js +8 -8
  169. package/lib/browser/components/custom-provider-view.js +12 -12
  170. package/lib/browser/components/empty-state.d.ts +2 -1
  171. package/lib/browser/components/empty-state.js +6 -2
  172. package/lib/browser/components/folder-picker.js +2 -2
  173. package/lib/browser/components/gallery.js +7 -8
  174. package/lib/browser/components/hearing-host.d.ts +6 -0
  175. package/lib/browser/components/hearing-host.js +94 -0
  176. package/lib/browser/components/host-view.d.ts +1 -1
  177. package/lib/browser/components/link-dialog.js +4 -0
  178. package/lib/browser/components/loading.d.ts +3 -2
  179. package/lib/browser/components/loading.js +7 -3
  180. package/lib/browser/components/markdown.d.ts +3 -1
  181. package/lib/browser/components/markdown.js +9 -4
  182. package/lib/browser/components/media.d.ts +10 -4
  183. package/lib/browser/components/media.js +61 -14
  184. package/lib/browser/components/people-picker.d.ts +18 -0
  185. package/lib/browser/components/people-picker.js +166 -0
  186. package/lib/browser/components/relay-view.js +1 -1
  187. package/lib/browser/components/settings-parts.js +2 -0
  188. package/lib/browser/components/share-dialog.d.ts +2 -2
  189. package/lib/browser/components/share-dialog.js +7 -4
  190. package/lib/browser/components/share-friends.js +3 -10
  191. package/lib/browser/components/share-item-sheet.d.ts +13 -0
  192. package/lib/browser/components/share-item-sheet.js +75 -0
  193. package/lib/browser/components/share-sheet.d.ts +9 -2
  194. package/lib/browser/components/share-sheet.js +5 -3
  195. package/lib/browser/components/sign-in-setup.js +4 -4
  196. package/lib/browser/components/trusted-domains.js +1 -1
  197. package/lib/browser/components/view-room.d.ts +26 -0
  198. package/lib/browser/components/view-room.js +173 -0
  199. package/lib/browser/components/voice-services.js +6 -6
  200. package/lib/browser/device/device-protocol.d.ts +9 -6
  201. package/lib/browser/device/device-protocol.js +7 -4
  202. package/lib/browser/device/launch-screen.d.ts +11 -1
  203. package/lib/browser/device/launch-screen.js +22 -4
  204. package/lib/browser/extension/share-sheet-compat.d.ts +2 -0
  205. package/lib/browser/extension/share-sheet-compat.js +13 -2
  206. package/lib/browser/extension/web-api-code.d.ts +11 -0
  207. package/lib/browser/extension/web-api-components.d.ts +8 -1
  208. package/lib/browser/extension/web-api-contributions.d.ts +30 -1
  209. package/lib/browser/extension/web-api-desktop.d.ts +2 -1
  210. package/lib/browser/extension/web-api-file-views.d.ts +39 -0
  211. package/lib/browser/extension/web-api-file-views.js +3 -0
  212. package/lib/browser/extension/web-api-host.d.ts +48 -0
  213. package/lib/browser/extension/web-api-host.js +4 -0
  214. package/lib/browser/extension/web-api-menus.d.ts +46 -0
  215. package/lib/browser/extension/web-api-partners.d.ts +58 -1
  216. package/lib/browser/extension/web-api-spec.js +7 -0
  217. package/lib/browser/extension/web-extension-api.d.ts +10 -10
  218. package/lib/browser/extension/web-extension-context.d.ts +2 -8
  219. package/lib/browser/extension/web-extension-context.js +14 -39
  220. package/lib/browser/extension/web-extension-marks.d.ts +11 -0
  221. package/lib/browser/extension/web-extension-marks.js +65 -0
  222. package/lib/browser/extension/web-extension-protocol.d.ts +11 -1
  223. package/lib/browser/extension/web-extension-protocol.js +3 -0
  224. package/lib/browser/extension/web-extension-run.d.ts +15 -2
  225. package/lib/browser/extension/web-extension-run.js +77 -0
  226. package/lib/browser/extension/web-extensions-running.d.ts +5 -1
  227. package/lib/browser/extension/web-extensions-running.js +16 -0
  228. package/lib/browser/extension/web-extensions.d.ts +2 -1
  229. package/lib/browser/extension/web-extensions.js +3 -0
  230. package/lib/browser/extension/web-home.js +3 -1
  231. package/lib/browser/extension/web-host-values.d.ts +67 -0
  232. package/lib/browser/extension/web-host-values.js +229 -0
  233. package/lib/browser/extension/web-hosts.d.ts +7 -2
  234. package/lib/browser/extension/web-hosts.js +16 -4
  235. package/lib/browser/extension/web-share-ui.d.ts +8 -0
  236. package/lib/browser/extension/web-share-ui.js +51 -0
  237. package/lib/browser/extension/web-share.d.ts +19 -0
  238. package/lib/browser/extension/web-share.js +45 -0
  239. package/lib/browser/i18n/en/chat.d.ts +10 -0
  240. package/lib/browser/i18n/en/chat.js +10 -0
  241. package/lib/browser/i18n/en/common.d.ts +18 -0
  242. package/lib/browser/i18n/en/common.js +18 -0
  243. package/lib/browser/i18n/en/discover.d.ts +7 -0
  244. package/lib/browser/i18n/en/discover.js +7 -0
  245. package/lib/browser/i18n/en/settings.d.ts +2 -0
  246. package/lib/browser/i18n/en/settings.js +2 -0
  247. package/lib/browser/i18n/ja/chat.js +10 -0
  248. package/lib/browser/i18n/ja/common.js +18 -0
  249. package/lib/browser/i18n/ja/discover.js +7 -0
  250. package/lib/browser/i18n/ja/settings.js +2 -0
  251. package/lib/browser/i18n/locales.d.ts +38 -1
  252. package/lib/browser/i18n/messages.d.ts +37 -0
  253. package/lib/browser/i18n/zh/chat.js +10 -0
  254. package/lib/browser/i18n/zh/common.js +18 -0
  255. package/lib/browser/i18n/zh/discover.js +7 -0
  256. package/lib/browser/i18n/zh/settings.js +2 -0
  257. package/lib/browser/i18n/zh-tw/chat.js +10 -0
  258. package/lib/browser/i18n/zh-tw/common.js +18 -0
  259. package/lib/browser/i18n/zh-tw/discover.js +7 -0
  260. package/lib/browser/i18n/zh-tw/settings.js +2 -0
  261. package/lib/browser/launch-art/art-palette.d.ts +42 -0
  262. package/lib/browser/launch-art/art-palette.js +76 -0
  263. package/lib/browser/launch-art/cyclic-automaton.d.ts +46 -0
  264. package/lib/browser/launch-art/cyclic-automaton.js +180 -0
  265. package/lib/browser/launch-art/fractal-tree.d.ts +44 -0
  266. package/lib/browser/launch-art/fractal-tree.js +52 -0
  267. package/lib/browser/launch-art/launch-art.d.ts +99 -0
  268. package/lib/browser/launch-art/launch-art.js +424 -0
  269. package/lib/browser/launch-art/launch-sky.d.ts +67 -0
  270. package/lib/browser/launch-art/launch-sky.js +157 -0
  271. package/lib/browser/links/clipboard-links.d.ts +90 -0
  272. package/lib/browser/links/clipboard-links.js +308 -0
  273. package/lib/browser/links/link-text.d.ts +30 -0
  274. package/lib/browser/links/link-text.js +100 -0
  275. package/lib/browser/links/links-protocol.d.ts +12 -1
  276. package/lib/browser/links/links.d.ts +8 -2
  277. package/lib/browser/links/links.js +33 -3
  278. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  279. package/lib/browser/markdown/code-renderers.js +5 -1
  280. package/lib/browser/partners/group-picker.js +23 -29
  281. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  282. package/lib/browser/sandbox/work/work-senses.js +1 -1
  283. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  284. package/lib/browser/settings/settings-protocol.js +2 -0
  285. package/lib/browser/style/base.d.ts +1 -1
  286. package/lib/browser/style/base.js +10 -6
  287. package/lib/browser/style/chat-list.d.ts +1 -1
  288. package/lib/browser/style/chat-list.js +28 -15
  289. package/lib/browser/style/conversation-column.d.ts +1 -1
  290. package/lib/browser/style/conversation.d.ts +1 -1
  291. package/lib/browser/style/conversation.js +2 -2
  292. package/lib/browser/style/dialogs.d.ts +1 -1
  293. package/lib/browser/style/dialogs.js +2 -5
  294. package/lib/browser/style/forms.d.ts +6 -0
  295. package/lib/browser/style/forms.js +68 -0
  296. package/lib/browser/style/layout.d.ts +1 -1
  297. package/lib/browser/style/pages.d.ts +1 -1
  298. package/lib/browser/style/pages.js +14 -24
  299. package/lib/browser/style/phone.d.ts +1 -1
  300. package/lib/browser/style/shared.d.ts +1 -1
  301. package/lib/browser/style/shell.d.ts +1 -1
  302. package/lib/browser/style/shell.js +1 -6
  303. package/lib/browser/style/surfaces.d.ts +1 -1
  304. package/lib/browser/style/surfaces.js +0 -6
  305. package/lib/browser/style/tasks.d.ts +1 -1
  306. package/lib/browser/style.js +2 -0
  307. package/lib/browser/util/voice.d.ts +18 -0
  308. package/lib/browser/util/voice.js +111 -3
  309. package/lib/browser/workbench-protocol.d.ts +2 -0
  310. package/lib/browser/workbench-services.d.ts +2 -0
  311. package/lib/browser/workbench-services.js +5 -0
  312. package/lib/browser/workbench.js +5 -0
  313. package/package.json +8 -8
  314. package/public/launch.svg +3 -3
@@ -0,0 +1,41 @@
1
+ export type Rgb = readonly [number, number, number];
2
+ /** How an era lays its paint: the width of a stroke, how fast it runs, how thick, and how many strokes are tiles instead. */
3
+ export interface ArtBrush {
4
+ width: number;
5
+ speed: number;
6
+ alpha: number;
7
+ /** 0 to 1: of the strokes, those laid as square tiles of colour (Klimt's mosaic). */
8
+ tiles: number;
9
+ }
10
+ /** A school of painting: the colours of the phases of the sky, round a ring from the first to the last and back, and its brush. */
11
+ export interface ArtEra {
12
+ name: string;
13
+ stops: readonly Rgb[];
14
+ brush: ArtBrush;
15
+ }
16
+ /**
17
+ * The eras the sky of the launch picture goes through, one after another, each into the next: the short thick strokes
18
+ * of Van Gogh's swirling night, the fine long lines of Hokusai's wave in indigo and foam, Klimt's gold laid in tiles, the
19
+ * green dawn of Ta, and the broad brush of ink wash, its gaps the paper left bare.
20
+ */
21
+ export declare const ART_ERAS: readonly ArtEra[];
22
+ /** The colours and brush of the sky at a time: an era for `seconds`, the next one coming in over its last third. */
23
+ export declare class ArtPalette {
24
+ readonly eras: readonly ArtEra[];
25
+ readonly seconds: number;
26
+ constructor(eras?: readonly ArtEra[], seconds?: number);
27
+ /** The era of `time`, the next, and how far (0 to 1, eased) the next has come in. */
28
+ moment(time: number): {
29
+ from: ArtEra;
30
+ to: ArtEra;
31
+ mix: number;
32
+ };
33
+ /** The colour of each of `states` phases at `time` seconds. */
34
+ colors(time: number, states: number): Rgb[];
35
+ brush(time: number): ArtBrush;
36
+ /** The colour at `at` (0 to 1) round the ring of `stops`. */
37
+ static ring(stops: readonly Rgb[], at: number): Rgb;
38
+ static blend(a: Rgb, b: Rgb, amount: number): Rgb;
39
+ /** The lightest of `colors`. */
40
+ static lightest(colors: readonly Rgb[]): Rgb;
41
+ }
@@ -0,0 +1,72 @@
1
+ const hex = (value) => [Number.parseInt(value.slice(1, 3), 16), Number.parseInt(value.slice(3, 5), 16), Number.parseInt(value.slice(5, 7), 16)];
2
+ /**
3
+ * The eras the sky of the launch picture goes through, one after another, each into the next: the short thick strokes
4
+ * of Van Gogh's swirling night, the fine long lines of Hokusai's wave in indigo and foam, Klimt's gold laid in tiles, the
5
+ * green dawn of Ta, and the broad brush of ink wash, its gaps the paper left bare.
6
+ */
7
+ export const ART_ERAS = [
8
+ {
9
+ name: 'starry-night',
10
+ stops: ['#0b1d3a', '#1b3f7a', '#3a6fb5', '#8fb8de', '#f4d35e', '#e9a23b'].map(hex),
11
+ brush: { width: 2.6, speed: 1, alpha: 0.6, tiles: 0 },
12
+ },
13
+ {
14
+ name: 'great-wave',
15
+ stops: ['#0a1a2f', '#123c69', '#2b6b9e', '#e8e4d8', '#b9d3e3', '#1d4e7a'].map(hex),
16
+ brush: { width: 1.3, speed: 1.5, alpha: 0.7, tiles: 0 },
17
+ },
18
+ {
19
+ name: 'gold-leaf',
20
+ stops: ['#1d160a', '#6b4e16', '#c99a2e', '#f2d27a', '#8a9a3b', '#3b2a10'].map(hex),
21
+ brush: { width: 2, speed: 0.6, alpha: 0.65, tiles: 0.5 },
22
+ },
23
+ {
24
+ name: 'green-dawn',
25
+ stops: ['#06231d', '#0f5c48', '#10b981', '#a7f3d0', '#ecfdf5', '#34d399'].map(hex),
26
+ brush: { width: 1.8, speed: 0.9, alpha: 0.5, tiles: 0 },
27
+ },
28
+ {
29
+ name: 'ink-wash',
30
+ stops: ['#0b0d10', '#0b0d10', '#4a4842', '#d9d3c4', '#8c8678', '#0b0d10'].map(hex),
31
+ brush: { width: 4.2, speed: 0.7, alpha: 0.3, tiles: 0 },
32
+ },
33
+ ];
34
+ /** The colours and brush of the sky at a time: an era for `seconds`, the next one coming in over its last third. */
35
+ export class ArtPalette {
36
+ constructor(eras = ART_ERAS, seconds = 40) {
37
+ this.eras = eras;
38
+ this.seconds = seconds;
39
+ }
40
+ /** The era of `time`, the next, and how far (0 to 1, eased) the next has come in. */
41
+ moment(time) {
42
+ const at = Math.max(0, time) / this.seconds;
43
+ const index = Math.floor(at);
44
+ const fade = Math.min(1, Math.max(0, (at - index - 2 / 3) * 3));
45
+ return { from: this.eras[index % this.eras.length], to: this.eras[(index + 1) % this.eras.length], mix: fade * fade * (3 - 2 * fade) };
46
+ }
47
+ /** The colour of each of `states` phases at `time` seconds. */
48
+ colors(time, states) {
49
+ const { from, to, mix } = this.moment(time);
50
+ return Array.from({ length: states }, (_, phase) => ArtPalette.blend(ArtPalette.ring(from.stops, phase / states), ArtPalette.ring(to.stops, phase / states), mix));
51
+ }
52
+ brush(time) {
53
+ const { from, to, mix } = this.moment(time);
54
+ const between = (key) => from.brush[key] + (to.brush[key] - from.brush[key]) * mix;
55
+ return { width: between('width'), speed: between('speed'), alpha: between('alpha'), tiles: between('tiles') };
56
+ }
57
+ /** The colour at `at` (0 to 1) round the ring of `stops`. */
58
+ static ring(stops, at) {
59
+ const position = (((at % 1) + 1) % 1) * stops.length;
60
+ const index = Math.floor(position);
61
+ return ArtPalette.blend(stops[index], stops[(index + 1) % stops.length], position - index);
62
+ }
63
+ static blend(a, b, amount) {
64
+ return [Math.round(a[0] + (b[0] - a[0]) * amount), Math.round(a[1] + (b[1] - a[1]) * amount), Math.round(a[2] + (b[2] - a[2]) * amount)];
65
+ }
66
+ /** The lightest of `colors`. */
67
+ static lightest(colors) {
68
+ const light = (color) => 0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2];
69
+ return colors.reduce((best, color) => (light(color) > light(best) ? color : best));
70
+ }
71
+ }
72
+ //# sourceMappingURL=art-palette.js.map
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A cyclic cellular automaton (Griffeath's): each cell holds one of `states` phases and takes the next one as soon as
3
+ * `threshold` of its neighbours (those within `range`, a round neighbourhood) hold it. Seeded with spirals it never comes
4
+ * to rest: its waves wind out of the points where all the phases meet (the cores) and run on until they meet the waves of
5
+ * another core. The sky of the launch picture (LaunchArt) is painted along them.
6
+ */
7
+ export declare class CyclicAutomaton {
8
+ readonly cols: number;
9
+ readonly rows: number;
10
+ readonly states: number;
11
+ readonly cells: Uint8Array;
12
+ readonly range: number;
13
+ readonly threshold: number;
14
+ /** Per cell, the direction its wave fronts run along (a unit vector); 0, 0 where its phases are flat. */
15
+ readonly flowX: Float32Array;
16
+ readonly flowY: Float32Array;
17
+ protected readonly next: Uint8Array;
18
+ protected readonly reach: readonly (readonly [number, number])[];
19
+ constructor(cols: number, rows: number, states?: number, cells?: Uint8Array, range?: number, threshold?: number);
20
+ /**
21
+ * A field already turning round `count` cores: the phase winds once round each (of either hand) and grows by one every
22
+ * `range` cells away from the nearest, so its first frame is spirals already, with no steps to run first.
23
+ */
24
+ static spirals(cols: number, rows: number, count: number, random: () => number, states?: number): CyclicAutomaton;
25
+ /** The automaton `encode` kept, if it is one of this size. */
26
+ static decode(cols: number, rows: number, text: string, states?: number): CyclicAutomaton | undefined;
27
+ static wrap(value: number, states: number): number;
28
+ /** How far phase `a` is ahead of `b`, the short way round: within (-states / 2, states / 2]. */
29
+ static ahead(a: number, b: number, states: number): number;
30
+ /** One step of every cell at once; how many cells changed. */
31
+ step(): number;
32
+ /** A new core of hand `hand` (1 or -1) at `x`, `y`, its spiral over the cells within `radius` of it. */
33
+ plant(x: number, y: number, radius: number, hand: number): void;
34
+ phase(x: number, y: number): number;
35
+ /** The direction of the fronts at `x`, `y` (in cells), between the cells round it. */
36
+ flow(x: number, y: number): [number, number];
37
+ /** Its cells, four bits each, in base 64: what the next launch goes on from. */
38
+ encode(): string;
39
+ /**
40
+ * The wave fronts: a phase goes on into the cells behind it, so a wave runs from the higher phases to the lower, and
41
+ * its front lies across that. Round a core the fronts turn, and the strokes along them whirl. Measured one and two
42
+ * cells away, so that inside a wave as wide as a cell or two the fronts still have a direction.
43
+ */
44
+ protected measure(): void;
45
+ }
@@ -0,0 +1,176 @@
1
+ /**
2
+ * A cyclic cellular automaton (Griffeath's): each cell holds one of `states` phases and takes the next one as soon as
3
+ * `threshold` of its neighbours (those within `range`, a round neighbourhood) hold it. Seeded with spirals it never comes
4
+ * to rest: its waves wind out of the points where all the phases meet (the cores) and run on until they meet the waves of
5
+ * another core. The sky of the launch picture (LaunchArt) is painted along them.
6
+ */
7
+ export class CyclicAutomaton {
8
+ constructor(cols, rows, states = 8, cells = new Uint8Array(cols * rows), range = 2, threshold = 3) {
9
+ this.cols = cols;
10
+ this.rows = rows;
11
+ this.states = states;
12
+ this.cells = cells;
13
+ this.range = range;
14
+ this.threshold = threshold;
15
+ this.next = new Uint8Array(cols * rows);
16
+ this.flowX = new Float32Array(cols * rows);
17
+ this.flowY = new Float32Array(cols * rows);
18
+ const reach = [];
19
+ for (let dy = -range; dy <= range; dy++) {
20
+ for (let dx = -range; dx <= range; dx++) {
21
+ if ((dx || dy) && dx * dx + dy * dy <= range * range + range) {
22
+ reach.push([dx, dy]);
23
+ }
24
+ }
25
+ }
26
+ this.reach = reach;
27
+ this.measure();
28
+ }
29
+ /**
30
+ * A field already turning round `count` cores: the phase winds once round each (of either hand) and grows by one every
31
+ * `range` cells away from the nearest, so its first frame is spirals already, with no steps to run first.
32
+ */
33
+ static spirals(cols, rows, count, random, states = 8) {
34
+ const automaton = new CyclicAutomaton(cols, rows, states);
35
+ const cores = Array.from({ length: count }, () => ({ x: random() * cols, y: random() * rows, hand: random() < 0.5 ? -1 : 1 }));
36
+ for (let y = 0; y < rows; y++) {
37
+ for (let x = 0; x < cols; x++) {
38
+ let winding = 0;
39
+ let nearest = Number.POSITIVE_INFINITY;
40
+ for (const core of cores) {
41
+ winding += core.hand * Math.atan2(y - core.y, x - core.x);
42
+ nearest = Math.min(nearest, Math.hypot(x - core.x, y - core.y));
43
+ }
44
+ const phase = (winding / (2 * Math.PI)) * states + nearest / automaton.range;
45
+ automaton.cells[y * cols + x] = CyclicAutomaton.wrap(Math.floor(phase), states);
46
+ }
47
+ }
48
+ automaton.measure();
49
+ return automaton;
50
+ }
51
+ /** The automaton `encode` kept, if it is one of this size. */
52
+ static decode(cols, rows, text, states = 8) {
53
+ let bytes;
54
+ try {
55
+ bytes = atob(text);
56
+ }
57
+ catch (_a) {
58
+ return undefined;
59
+ }
60
+ if (bytes.length !== Math.ceil((cols * rows) / 2)) {
61
+ return undefined;
62
+ }
63
+ const cells = new Uint8Array(cols * rows);
64
+ for (let index = 0; index < cells.length; index++) {
65
+ const byte = bytes.charCodeAt(index >> 1);
66
+ cells[index] = index % 2 === 0 ? byte >> 4 : byte & 15;
67
+ if (cells[index] >= states) {
68
+ return undefined;
69
+ }
70
+ }
71
+ return new CyclicAutomaton(cols, rows, states, cells);
72
+ }
73
+ static wrap(value, states) {
74
+ return ((value % states) + states) % states;
75
+ }
76
+ /** How far phase `a` is ahead of `b`, the short way round: within (-states / 2, states / 2]. */
77
+ static ahead(a, b, states) {
78
+ const difference = CyclicAutomaton.wrap(a - b, states);
79
+ return difference > states / 2 ? difference - states : difference;
80
+ }
81
+ /** One step of every cell at once; how many cells changed. */
82
+ step() {
83
+ const { cols, rows, states, cells, next, reach, threshold } = this;
84
+ let changed = 0;
85
+ for (let y = 0; y < rows; y++) {
86
+ for (let x = 0; x < cols; x++) {
87
+ const index = y * cols + x;
88
+ const phase = cells[index];
89
+ const following = phase + 1 === states ? 0 : phase + 1;
90
+ let count = 0;
91
+ for (const [dx, dy] of reach) {
92
+ const col = x + dx;
93
+ const row = y + dy;
94
+ if (col >= 0 && row >= 0 && col < cols && row < rows && cells[row * cols + col] === following && ++count >= threshold) {
95
+ break;
96
+ }
97
+ }
98
+ next[index] = count >= threshold ? following : phase;
99
+ if (next[index] !== phase) {
100
+ changed++;
101
+ }
102
+ }
103
+ }
104
+ cells.set(next);
105
+ this.measure();
106
+ return changed;
107
+ }
108
+ /** A new core of hand `hand` (1 or -1) at `x`, `y`, its spiral over the cells within `radius` of it. */
109
+ plant(x, y, radius, hand) {
110
+ const { cols, rows, states, cells } = this;
111
+ for (let row = Math.max(0, Math.floor(y - radius)); row <= Math.min(rows - 1, Math.ceil(y + radius)); row++) {
112
+ for (let col = Math.max(0, Math.floor(x - radius)); col <= Math.min(cols - 1, Math.ceil(x + radius)); col++) {
113
+ const distance = Math.hypot(col - x, row - y);
114
+ if (distance <= radius) {
115
+ const turn = (hand * Math.atan2(row - y, col - x)) / (2 * Math.PI);
116
+ cells[row * cols + col] = CyclicAutomaton.wrap(Math.floor(turn * states + distance / this.range), states);
117
+ }
118
+ }
119
+ }
120
+ this.measure();
121
+ }
122
+ phase(x, y) {
123
+ const col = Math.min(this.cols - 1, Math.max(0, Math.floor(x)));
124
+ const row = Math.min(this.rows - 1, Math.max(0, Math.floor(y)));
125
+ return this.cells[row * this.cols + col];
126
+ }
127
+ /** The direction of the fronts at `x`, `y` (in cells), between the cells round it. */
128
+ flow(x, y) {
129
+ const { cols, rows, flowX, flowY } = this;
130
+ const fx = Math.min(cols - 1.001, Math.max(0, x - 0.5));
131
+ const fy = Math.min(rows - 1.001, Math.max(0, y - 0.5));
132
+ const col = Math.floor(fx);
133
+ const row = Math.floor(fy);
134
+ const u = fx - col;
135
+ const v = fy - row;
136
+ const a = row * cols + col;
137
+ const b = a + (col + 1 < cols ? 1 : 0);
138
+ const c = a + (row + 1 < rows ? cols : 0);
139
+ const d = c + (col + 1 < cols ? 1 : 0);
140
+ const along = (field) => (field[a] * (1 - u) + field[b] * u) * (1 - v) + (field[c] * (1 - u) + field[d] * u) * v;
141
+ return [along(flowX), along(flowY)];
142
+ }
143
+ /** Its cells, four bits each, in base 64: what the next launch goes on from. */
144
+ encode() {
145
+ var _a;
146
+ let text = '';
147
+ for (let index = 0; index < this.cells.length; index += 2) {
148
+ text += String.fromCharCode((this.cells[index] << 4) | ((_a = this.cells[index + 1]) !== null && _a !== void 0 ? _a : 0));
149
+ }
150
+ return btoa(text);
151
+ }
152
+ /**
153
+ * The wave fronts: a phase goes on into the cells behind it, so a wave runs from the higher phases to the lower, and
154
+ * its front lies across that. Round a core the fronts turn, and the strokes along them whirl. Measured one and two
155
+ * cells away, so that inside a wave as wide as a cell or two the fronts still have a direction.
156
+ */
157
+ measure() {
158
+ const { cols, rows, states, cells, flowX, flowY } = this;
159
+ const clamp = (value, size) => (value < 0 ? 0 : value >= size ? size - 1 : value);
160
+ for (let y = 0; y < rows; y++) {
161
+ for (let x = 0; x < cols; x++) {
162
+ let gx = 0;
163
+ let gy = 0;
164
+ for (let reach = 1; reach <= 2; reach++) {
165
+ gx += CyclicAutomaton.ahead(cells[y * cols + clamp(x + reach, cols)], cells[y * cols + clamp(x - reach, cols)], states) / reach;
166
+ gy += CyclicAutomaton.ahead(cells[clamp(y + reach, rows) * cols + x], cells[clamp(y - reach, rows) * cols + x], states) / reach;
167
+ }
168
+ const length = Math.hypot(gx, gy);
169
+ const index = y * cols + x;
170
+ flowX[index] = length ? -gy / length : 0;
171
+ flowY[index] = length ? gx / length : 0;
172
+ }
173
+ }
174
+ }
175
+ }
176
+ //# sourceMappingURL=cyclic-automaton.js.map
@@ -0,0 +1,43 @@
1
+ interface TreeNode {
2
+ /** Of its parent's length (1 for the trunk). */
3
+ length: number;
4
+ /** Its angle from its parent's, in radians. */
5
+ turn: number;
6
+ children: TreeNode[];
7
+ }
8
+ /** Where the tree stands and how it moves this frame. */
9
+ export interface TreePose {
10
+ x: number;
11
+ y: number;
12
+ /** The length of the trunk. */
13
+ size: number;
14
+ /** The wind, about -1 to 1: the higher a branch, the more it bends. */
15
+ sway: number;
16
+ /** Toward a finger, about -1 to 1. */
17
+ lean: number;
18
+ /** 0 to 1: the tree grows from its trunk to its tips. */
19
+ growth: number;
20
+ }
21
+ export interface TreeSegment {
22
+ x0: number;
23
+ y0: number;
24
+ x1: number;
25
+ y1: number;
26
+ depth: number;
27
+ /** A branch of the last level, whole: it ends in a curl of gold. */
28
+ tip: boolean;
29
+ angle: number;
30
+ }
31
+ /**
32
+ * A fractal tree, Klimt's tree of life: each branch forks into two or three shorter ones down to `depth`, and its
33
+ * last ones end in curls of gold. Its shape is drawn from `random` once; each frame only bends it.
34
+ */
35
+ export declare class FractalTree {
36
+ readonly depth: number;
37
+ readonly root: TreeNode;
38
+ constructor(depth: number, random: () => number);
39
+ segments(pose: TreePose): TreeSegment[];
40
+ protected grow(depth: number, random: () => number): TreeNode;
41
+ protected lay(node: TreeNode, depth: number, x: number, y: number, angle: number, length: number, pose: TreePose, out: TreeSegment[]): void;
42
+ }
43
+ export {};
@@ -0,0 +1,48 @@
1
+ /**
2
+ * A fractal tree, Klimt's tree of life: each branch forks into two or three shorter ones down to `depth`, and its
3
+ * last ones end in curls of gold. Its shape is drawn from `random` once; each frame only bends it.
4
+ */
5
+ export class FractalTree {
6
+ constructor(depth, random) {
7
+ this.depth = depth;
8
+ this.root = this.grow(0, random);
9
+ }
10
+ segments(pose) {
11
+ const segments = [];
12
+ this.lay(this.root, 0, pose.x, pose.y, -Math.PI / 2, pose.size, pose, segments);
13
+ return segments;
14
+ }
15
+ grow(depth, random) {
16
+ const node = { length: depth === 0 ? 1 : 0.66 + random() * 0.14, turn: 0, children: [] };
17
+ if (depth < this.depth) {
18
+ const three = depth > 1 && random() < 0.22;
19
+ const turns = [-(0.3 + random() * 0.22), 0.26 + random() * 0.22];
20
+ if (three) {
21
+ turns.push((random() - 0.5) * 0.2);
22
+ }
23
+ for (const turn of turns) {
24
+ const child = this.grow(depth + 1, random);
25
+ child.turn = turn;
26
+ node.children.push(child);
27
+ }
28
+ }
29
+ return node;
30
+ }
31
+ lay(node, depth, x, y, angle, length, pose, out) {
32
+ const shown = Math.min(1, Math.max(0, pose.growth * (this.depth + 1) - depth));
33
+ if (shown === 0) {
34
+ return;
35
+ }
36
+ const heading = angle + node.turn + pose.sway * 0.035 * (depth + 1) + pose.lean * 0.05 * depth;
37
+ const reach = length * node.length;
38
+ const x1 = x + Math.cos(heading) * reach * shown;
39
+ const y1 = y + Math.sin(heading) * reach * shown;
40
+ out.push({ x0: x, y0: y, x1, y1, depth, tip: depth === this.depth && shown === 1, angle: heading });
41
+ if (shown === 1) {
42
+ for (const child of node.children) {
43
+ this.lay(child, depth + 1, x1, y1, heading, reach, pose, out);
44
+ }
45
+ }
46
+ }
47
+ }
48
+ //# sourceMappingURL=fractal-tree.js.map
@@ -0,0 +1,98 @@
1
+ import { ArtPalette } from './art-palette.js';
2
+ import { FractalTree } from './fractal-tree.js';
3
+ import { LaunchSky, type LaunchStir } from './launch-sky.js';
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
+ }