@jean-is/render 0.8.0-r4be30bcaa9fe → 0.8.0-r5b1c2ce97a6c

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 (1085) hide show
  1. package/brand.js +1 -1
  2. package/caps/charts/charts.js +2 -2
  3. package/caps/files/office.js +16 -9
  4. package/caps/files/pdf.js +3 -0
  5. package/caps/games/shell.js +2 -2
  6. package/caps/interactive/apps.js +1 -4
  7. package/caps/interactive/diagram.js +1 -1
  8. package/caps/interactive/interactive.css +4 -1
  9. package/caps/interactive/interactive.js +50 -11
  10. package/caps/interactive/live.js +4 -4
  11. package/caps/interactive/map.js +11 -5
  12. package/caps/interactive/starts.js +15 -0
  13. package/caps/interactive/test.js +76 -0
  14. package/caps/interactive/view-parts.js +5 -2
  15. package/caps/layouts/layouts.js +35 -34
  16. package/caps/layouts/shapes.js +49 -33
  17. package/caps/layouts/types.d.ts +8 -0
  18. package/caps/made/paper.js +1 -1
  19. package/caps/receipt/der.js +1 -1
  20. package/caps/scores/scores.js +2 -2
  21. package/caps/share/view.js +2 -1
  22. package/caps/skills/directory.js +4 -0
  23. package/caps/slides/edit.js +13 -3
  24. package/caps/slides/kit-page.js +4 -3
  25. package/caps/slides/kit-sample.js +1 -1
  26. package/caps/slides/save.js +2 -2
  27. package/caps/slides/slides.css +3 -0
  28. package/caps/slides/slides.js +1 -1
  29. package/caps/tables/formula.js +1 -1
  30. package/core/anthropic.js +10 -10
  31. package/core/deferred.js +5 -4
  32. package/core/events.js +4 -4
  33. package/core/files.js +1 -1
  34. package/core/fs.js +21 -75
  35. package/core/hooks.js +3 -3
  36. package/core/i18n.js +22 -19
  37. package/core/llm.js +16 -13
  38. package/core/loop.js +9 -5
  39. package/core/rules.js +1 -1
  40. package/core/settings.js +3 -56
  41. package/core/skills.js +1 -1
  42. package/core/vertex.js +1 -1
  43. package/core/zip.js +1 -1
  44. package/locales/am.json +27 -16
  45. package/locales/approvals/am.json +0 -2
  46. package/locales/approvals/ar.json +0 -2
  47. package/locales/approvals/bg.json +0 -2
  48. package/locales/approvals/bn.json +0 -2
  49. package/locales/approvals/br.json +0 -2
  50. package/locales/approvals/co.json +0 -2
  51. package/locales/approvals/cs.json +0 -2
  52. package/locales/approvals/da.json +0 -2
  53. package/locales/approvals/de.json +0 -2
  54. package/locales/approvals/el.json +0 -2
  55. package/locales/approvals/en.json +0 -2
  56. package/locales/approvals/es.json +0 -2
  57. package/locales/approvals/fa.json +0 -2
  58. package/locales/approvals/fi.json +0 -2
  59. package/locales/approvals/fr-CA.json +3 -5
  60. package/locales/approvals/fr.json +3 -5
  61. package/locales/approvals/ha.json +0 -2
  62. package/locales/approvals/he.json +0 -2
  63. package/locales/approvals/hi.json +0 -2
  64. package/locales/approvals/hr.json +0 -2
  65. package/locales/approvals/hu.json +0 -2
  66. package/locales/approvals/id.json +0 -2
  67. package/locales/approvals/it.json +0 -2
  68. package/locales/approvals/ja.json +0 -2
  69. package/locales/approvals/ko.json +0 -2
  70. package/locales/approvals/mr.json +0 -2
  71. package/locales/approvals/ms.json +0 -2
  72. package/locales/approvals/nl.json +0 -2
  73. package/locales/approvals/pl.json +0 -2
  74. package/locales/approvals/pt.json +0 -2
  75. package/locales/approvals/ro.json +0 -2
  76. package/locales/approvals/ru.json +0 -2
  77. package/locales/approvals/sk.json +0 -2
  78. package/locales/approvals/sv.json +0 -2
  79. package/locales/approvals/sw.json +0 -2
  80. package/locales/approvals/ta.json +0 -2
  81. package/locales/approvals/te.json +0 -2
  82. package/locales/approvals/th.json +0 -2
  83. package/locales/approvals/tl.json +0 -2
  84. package/locales/approvals/tr.json +0 -2
  85. package/locales/approvals/uk.json +0 -2
  86. package/locales/approvals/ur.json +0 -2
  87. package/locales/approvals/vi.json +0 -2
  88. package/locales/approvals/yo.json +0 -2
  89. package/locales/approvals/zh-Hans.json +0 -2
  90. package/locales/approvals/zh-Hant.json +0 -2
  91. package/locales/ar.json +27 -16
  92. package/locales/bg.json +27 -16
  93. package/locales/bn.json +26 -15
  94. package/locales/br.json +27 -16
  95. package/locales/brains/am.json +1 -1
  96. package/locales/brains/ar.json +1 -1
  97. package/locales/brains/bg.json +1 -1
  98. package/locales/brains/bn.json +1 -1
  99. package/locales/brains/br.json +1 -1
  100. package/locales/brains/co.json +1 -1
  101. package/locales/brains/cs.json +1 -1
  102. package/locales/brains/da.json +1 -1
  103. package/locales/brains/de.json +1 -1
  104. package/locales/brains/el.json +1 -1
  105. package/locales/brains/en.json +1 -1
  106. package/locales/brains/es.json +1 -1
  107. package/locales/brains/fa.json +1 -1
  108. package/locales/brains/fi.json +1 -1
  109. package/locales/brains/fr-CA.json +1 -1
  110. package/locales/brains/fr.json +1 -1
  111. package/locales/brains/ha.json +1 -1
  112. package/locales/brains/he.json +1 -1
  113. package/locales/brains/hi.json +1 -1
  114. package/locales/brains/hr.json +1 -1
  115. package/locales/brains/hu.json +1 -1
  116. package/locales/brains/id.json +1 -1
  117. package/locales/brains/it.json +1 -1
  118. package/locales/brains/ja.json +1 -1
  119. package/locales/brains/ko.json +1 -1
  120. package/locales/brains/mr.json +1 -1
  121. package/locales/brains/ms.json +1 -1
  122. package/locales/brains/nl.json +1 -1
  123. package/locales/brains/pl.json +1 -1
  124. package/locales/brains/pt.json +1 -1
  125. package/locales/brains/ro.json +1 -1
  126. package/locales/brains/ru.json +1 -1
  127. package/locales/brains/sk.json +1 -1
  128. package/locales/brains/sv.json +1 -1
  129. package/locales/brains/sw.json +1 -1
  130. package/locales/brains/ta.json +1 -1
  131. package/locales/brains/te.json +1 -1
  132. package/locales/brains/th.json +1 -1
  133. package/locales/brains/tl.json +1 -1
  134. package/locales/brains/tr.json +1 -1
  135. package/locales/brains/uk.json +1 -1
  136. package/locales/brains/ur.json +1 -1
  137. package/locales/brains/vi.json +1 -1
  138. package/locales/brains/yo.json +1 -1
  139. package/locales/brains/zh-Hans.json +1 -1
  140. package/locales/brains/zh-Hant.json +1 -1
  141. package/locales/case/co.json +8 -8
  142. package/locales/case/es.json +5 -5
  143. package/locales/case/fr-CA.json +9 -9
  144. package/locales/case/fr.json +9 -9
  145. package/locales/case/it.json +8 -8
  146. package/locales/case/pt.json +5 -5
  147. package/locales/co.json +27 -16
  148. package/locales/computer/fr-CA.json +14 -14
  149. package/locales/computer/fr.json +14 -14
  150. package/locales/connections/am.json +4 -2
  151. package/locales/connections/ar.json +4 -2
  152. package/locales/connections/bg.json +4 -2
  153. package/locales/connections/bn.json +4 -2
  154. package/locales/connections/br.json +4 -2
  155. package/locales/connections/co.json +4 -2
  156. package/locales/connections/cs.json +4 -2
  157. package/locales/connections/da.json +4 -2
  158. package/locales/connections/de.json +4 -2
  159. package/locales/connections/el.json +4 -2
  160. package/locales/connections/en.json +4 -2
  161. package/locales/connections/es.json +4 -2
  162. package/locales/connections/fa.json +4 -2
  163. package/locales/connections/fi.json +4 -2
  164. package/locales/connections/fr-CA.json +4 -2
  165. package/locales/connections/fr.json +4 -2
  166. package/locales/connections/ha.json +4 -2
  167. package/locales/connections/he.json +4 -2
  168. package/locales/connections/hi.json +4 -2
  169. package/locales/connections/hr.json +4 -2
  170. package/locales/connections/hu.json +4 -2
  171. package/locales/connections/id.json +4 -2
  172. package/locales/connections/it.json +4 -2
  173. package/locales/connections/ja.json +4 -2
  174. package/locales/connections/ko.json +4 -2
  175. package/locales/connections/mr.json +4 -2
  176. package/locales/connections/ms.json +4 -2
  177. package/locales/connections/nl.json +4 -2
  178. package/locales/connections/pl.json +4 -2
  179. package/locales/connections/pt.json +4 -2
  180. package/locales/connections/ro.json +4 -2
  181. package/locales/connections/ru.json +4 -2
  182. package/locales/connections/sk.json +4 -2
  183. package/locales/connections/sv.json +4 -2
  184. package/locales/connections/sw.json +4 -2
  185. package/locales/connections/ta.json +4 -2
  186. package/locales/connections/te.json +4 -2
  187. package/locales/connections/th.json +4 -2
  188. package/locales/connections/tl.json +4 -2
  189. package/locales/connections/tr.json +4 -2
  190. package/locales/connections/uk.json +4 -2
  191. package/locales/connections/ur.json +4 -2
  192. package/locales/connections/vi.json +4 -2
  193. package/locales/connections/yo.json +4 -2
  194. package/locales/connections/zh-Hans.json +4 -2
  195. package/locales/connections/zh-Hant.json +4 -2
  196. package/locales/creations/am.json +4 -0
  197. package/locales/creations/ar.json +4 -0
  198. package/locales/creations/bg.json +4 -0
  199. package/locales/creations/bn.json +4 -0
  200. package/locales/creations/br.json +4 -0
  201. package/locales/creations/co.json +4 -0
  202. package/locales/creations/cs.json +4 -0
  203. package/locales/creations/da.json +4 -0
  204. package/locales/creations/de.json +4 -0
  205. package/locales/creations/el.json +4 -0
  206. package/locales/creations/en.json +4 -0
  207. package/locales/creations/es.json +4 -0
  208. package/locales/creations/fa.json +4 -0
  209. package/locales/creations/fi.json +4 -0
  210. package/locales/creations/fr-CA.json +4 -0
  211. package/locales/creations/fr.json +4 -0
  212. package/locales/creations/ha.json +4 -0
  213. package/locales/creations/he.json +4 -0
  214. package/locales/creations/hi.json +4 -0
  215. package/locales/creations/hr.json +4 -0
  216. package/locales/creations/hu.json +4 -0
  217. package/locales/creations/id.json +4 -0
  218. package/locales/creations/it.json +4 -0
  219. package/locales/creations/ja.json +4 -0
  220. package/locales/creations/ko.json +4 -0
  221. package/locales/creations/mr.json +4 -0
  222. package/locales/creations/ms.json +4 -0
  223. package/locales/creations/nl.json +4 -0
  224. package/locales/creations/pl.json +4 -0
  225. package/locales/creations/pt.json +4 -0
  226. package/locales/creations/ro.json +4 -0
  227. package/locales/creations/ru.json +4 -0
  228. package/locales/creations/sk.json +4 -0
  229. package/locales/creations/sv.json +4 -0
  230. package/locales/creations/sw.json +4 -0
  231. package/locales/creations/ta.json +4 -0
  232. package/locales/creations/te.json +4 -0
  233. package/locales/creations/th.json +4 -0
  234. package/locales/creations/tl.json +4 -0
  235. package/locales/creations/tr.json +4 -0
  236. package/locales/creations/uk.json +4 -0
  237. package/locales/creations/ur.json +4 -0
  238. package/locales/creations/vi.json +4 -0
  239. package/locales/creations/yo.json +4 -0
  240. package/locales/creations/zh-Hans.json +4 -0
  241. package/locales/creations/zh-Hant.json +4 -0
  242. package/locales/cs.json +27 -16
  243. package/locales/da.json +26 -15
  244. package/locales/data/am.json +5 -1
  245. package/locales/data/ar.json +5 -1
  246. package/locales/data/bg.json +5 -1
  247. package/locales/data/bn.json +5 -1
  248. package/locales/data/br.json +5 -1
  249. package/locales/data/co.json +5 -1
  250. package/locales/data/cs.json +5 -1
  251. package/locales/data/da.json +5 -1
  252. package/locales/data/de.json +5 -1
  253. package/locales/data/el.json +5 -1
  254. package/locales/data/en.json +5 -1
  255. package/locales/data/es.json +5 -1
  256. package/locales/data/fa.json +5 -1
  257. package/locales/data/fi.json +5 -1
  258. package/locales/data/fr-CA.json +5 -1
  259. package/locales/data/fr.json +5 -1
  260. package/locales/data/ha.json +5 -1
  261. package/locales/data/he.json +5 -1
  262. package/locales/data/hi.json +5 -1
  263. package/locales/data/hr.json +5 -1
  264. package/locales/data/hu.json +5 -1
  265. package/locales/data/id.json +5 -1
  266. package/locales/data/it.json +5 -1
  267. package/locales/data/ja.json +5 -1
  268. package/locales/data/ko.json +5 -1
  269. package/locales/data/mr.json +5 -1
  270. package/locales/data/ms.json +5 -1
  271. package/locales/data/nl.json +5 -1
  272. package/locales/data/pl.json +5 -1
  273. package/locales/data/pt.json +5 -1
  274. package/locales/data/ro.json +5 -1
  275. package/locales/data/ru.json +5 -1
  276. package/locales/data/sk.json +5 -1
  277. package/locales/data/sv.json +5 -1
  278. package/locales/data/sw.json +5 -1
  279. package/locales/data/ta.json +5 -1
  280. package/locales/data/te.json +5 -1
  281. package/locales/data/th.json +5 -1
  282. package/locales/data/tl.json +5 -1
  283. package/locales/data/tr.json +5 -1
  284. package/locales/data/uk.json +5 -1
  285. package/locales/data/ur.json +5 -1
  286. package/locales/data/vi.json +5 -1
  287. package/locales/data/yo.json +5 -1
  288. package/locales/data/zh-Hans.json +5 -1
  289. package/locales/data/zh-Hant.json +5 -1
  290. package/locales/de.json +26 -15
  291. package/locales/devices/am.json +79 -0
  292. package/locales/devices/ar.json +87 -0
  293. package/locales/devices/bg.json +79 -0
  294. package/locales/devices/bn.json +79 -0
  295. package/locales/devices/br.json +85 -0
  296. package/locales/devices/co.json +81 -0
  297. package/locales/devices/cs.json +83 -0
  298. package/locales/devices/da.json +79 -0
  299. package/locales/devices/de.json +79 -0
  300. package/locales/devices/el.json +79 -0
  301. package/locales/devices/en.json +79 -0
  302. package/locales/devices/es.json +81 -0
  303. package/locales/devices/fa.json +79 -0
  304. package/locales/devices/fi.json +79 -0
  305. package/locales/devices/fr-CA.json +81 -0
  306. package/locales/devices/fr.json +81 -0
  307. package/locales/devices/ha.json +79 -0
  308. package/locales/devices/he.json +81 -0
  309. package/locales/devices/hi.json +79 -0
  310. package/locales/devices/hr.json +81 -0
  311. package/locales/devices/hu.json +79 -0
  312. package/locales/devices/id.json +77 -0
  313. package/locales/devices/it.json +81 -0
  314. package/locales/devices/ja.json +77 -0
  315. package/locales/devices/ko.json +77 -0
  316. package/locales/devices/mr.json +79 -0
  317. package/locales/devices/ms.json +77 -0
  318. package/locales/devices/nl.json +79 -0
  319. package/locales/devices/pl.json +83 -0
  320. package/locales/devices/pt.json +81 -0
  321. package/locales/devices/ro.json +81 -0
  322. package/locales/devices/ru.json +83 -0
  323. package/locales/devices/sk.json +83 -0
  324. package/locales/devices/sv.json +79 -0
  325. package/locales/devices/sw.json +79 -0
  326. package/locales/devices/ta.json +79 -0
  327. package/locales/devices/te.json +79 -0
  328. package/locales/devices/th.json +77 -0
  329. package/locales/devices/tl.json +79 -0
  330. package/locales/devices/tr.json +79 -0
  331. package/locales/devices/uk.json +83 -0
  332. package/locales/devices/ur.json +79 -0
  333. package/locales/devices/vi.json +77 -0
  334. package/locales/devices/yo.json +77 -0
  335. package/locales/devices/zh-Hans.json +77 -0
  336. package/locales/devices/zh-Hant.json +77 -0
  337. package/locales/dialogs/am.json +19 -11
  338. package/locales/dialogs/ar.json +19 -11
  339. package/locales/dialogs/bg.json +19 -11
  340. package/locales/dialogs/bn.json +19 -11
  341. package/locales/dialogs/br.json +19 -11
  342. package/locales/dialogs/co.json +23 -15
  343. package/locales/dialogs/cs.json +19 -11
  344. package/locales/dialogs/da.json +19 -11
  345. package/locales/dialogs/de.json +19 -11
  346. package/locales/dialogs/el.json +19 -11
  347. package/locales/dialogs/en.json +19 -11
  348. package/locales/dialogs/es.json +23 -15
  349. package/locales/dialogs/fa.json +19 -11
  350. package/locales/dialogs/fi.json +19 -11
  351. package/locales/dialogs/fr-CA.json +25 -17
  352. package/locales/dialogs/fr.json +25 -17
  353. package/locales/dialogs/ha.json +19 -11
  354. package/locales/dialogs/he.json +19 -11
  355. package/locales/dialogs/hi.json +19 -11
  356. package/locales/dialogs/hr.json +19 -11
  357. package/locales/dialogs/hu.json +19 -11
  358. package/locales/dialogs/id.json +19 -11
  359. package/locales/dialogs/it.json +23 -15
  360. package/locales/dialogs/ja.json +19 -11
  361. package/locales/dialogs/ko.json +19 -11
  362. package/locales/dialogs/mr.json +19 -11
  363. package/locales/dialogs/ms.json +19 -11
  364. package/locales/dialogs/nl.json +19 -11
  365. package/locales/dialogs/pl.json +19 -11
  366. package/locales/dialogs/pt.json +22 -14
  367. package/locales/dialogs/ro.json +19 -11
  368. package/locales/dialogs/ru.json +19 -11
  369. package/locales/dialogs/sk.json +19 -11
  370. package/locales/dialogs/sv.json +19 -11
  371. package/locales/dialogs/sw.json +19 -11
  372. package/locales/dialogs/ta.json +19 -11
  373. package/locales/dialogs/te.json +19 -11
  374. package/locales/dialogs/th.json +19 -11
  375. package/locales/dialogs/tl.json +19 -11
  376. package/locales/dialogs/tr.json +19 -11
  377. package/locales/dialogs/uk.json +19 -11
  378. package/locales/dialogs/ur.json +19 -11
  379. package/locales/dialogs/vi.json +19 -11
  380. package/locales/dialogs/yo.json +19 -11
  381. package/locales/dialogs/zh-Hans.json +19 -11
  382. package/locales/dialogs/zh-Hant.json +19 -11
  383. package/locales/documents/am.json +12 -2
  384. package/locales/documents/ar.json +12 -2
  385. package/locales/documents/bg.json +12 -2
  386. package/locales/documents/bn.json +12 -2
  387. package/locales/documents/br.json +12 -2
  388. package/locales/documents/co.json +12 -2
  389. package/locales/documents/cs.json +12 -2
  390. package/locales/documents/da.json +12 -2
  391. package/locales/documents/de.json +12 -2
  392. package/locales/documents/el.json +12 -2
  393. package/locales/documents/en.json +12 -2
  394. package/locales/documents/es.json +12 -2
  395. package/locales/documents/fa.json +12 -2
  396. package/locales/documents/fi.json +12 -2
  397. package/locales/documents/fr-CA.json +12 -2
  398. package/locales/documents/fr.json +12 -2
  399. package/locales/documents/ha.json +12 -2
  400. package/locales/documents/he.json +12 -2
  401. package/locales/documents/hi.json +12 -2
  402. package/locales/documents/hr.json +12 -2
  403. package/locales/documents/hu.json +12 -2
  404. package/locales/documents/id.json +12 -2
  405. package/locales/documents/it.json +12 -2
  406. package/locales/documents/ja.json +12 -2
  407. package/locales/documents/ko.json +12 -2
  408. package/locales/documents/mr.json +12 -2
  409. package/locales/documents/ms.json +12 -2
  410. package/locales/documents/nl.json +12 -2
  411. package/locales/documents/pl.json +12 -2
  412. package/locales/documents/pt.json +12 -2
  413. package/locales/documents/ro.json +12 -2
  414. package/locales/documents/ru.json +12 -2
  415. package/locales/documents/sk.json +12 -2
  416. package/locales/documents/sv.json +12 -2
  417. package/locales/documents/sw.json +12 -2
  418. package/locales/documents/ta.json +12 -2
  419. package/locales/documents/te.json +12 -2
  420. package/locales/documents/th.json +12 -2
  421. package/locales/documents/tl.json +12 -2
  422. package/locales/documents/tr.json +12 -2
  423. package/locales/documents/uk.json +12 -2
  424. package/locales/documents/ur.json +12 -2
  425. package/locales/documents/vi.json +12 -2
  426. package/locales/documents/yo.json +12 -2
  427. package/locales/documents/zh-Hans.json +12 -2
  428. package/locales/documents/zh-Hant.json +12 -2
  429. package/locales/el.json +27 -16
  430. package/locales/en.json +27 -16
  431. package/locales/es.json +27 -16
  432. package/locales/extensions/am.json +2 -1
  433. package/locales/extensions/ar.json +2 -1
  434. package/locales/extensions/bg.json +2 -1
  435. package/locales/extensions/bn.json +2 -1
  436. package/locales/extensions/br.json +2 -1
  437. package/locales/extensions/co.json +2 -1
  438. package/locales/extensions/cs.json +2 -1
  439. package/locales/extensions/da.json +2 -1
  440. package/locales/extensions/de.json +2 -1
  441. package/locales/extensions/el.json +2 -1
  442. package/locales/extensions/en.json +2 -1
  443. package/locales/extensions/es.json +2 -1
  444. package/locales/extensions/fa.json +2 -1
  445. package/locales/extensions/fi.json +2 -1
  446. package/locales/extensions/fr-CA.json +2 -1
  447. package/locales/extensions/fr.json +2 -1
  448. package/locales/extensions/ha.json +2 -1
  449. package/locales/extensions/he.json +2 -1
  450. package/locales/extensions/hi.json +2 -1
  451. package/locales/extensions/hr.json +2 -1
  452. package/locales/extensions/hu.json +2 -1
  453. package/locales/extensions/id.json +2 -1
  454. package/locales/extensions/it.json +2 -1
  455. package/locales/extensions/ja.json +2 -1
  456. package/locales/extensions/ko.json +2 -1
  457. package/locales/extensions/mr.json +2 -1
  458. package/locales/extensions/ms.json +2 -1
  459. package/locales/extensions/nl.json +2 -1
  460. package/locales/extensions/pl.json +2 -1
  461. package/locales/extensions/pt.json +2 -1
  462. package/locales/extensions/ro.json +2 -1
  463. package/locales/extensions/ru.json +2 -1
  464. package/locales/extensions/sk.json +2 -1
  465. package/locales/extensions/sv.json +2 -1
  466. package/locales/extensions/sw.json +2 -1
  467. package/locales/extensions/ta.json +2 -1
  468. package/locales/extensions/te.json +2 -1
  469. package/locales/extensions/th.json +2 -1
  470. package/locales/extensions/tl.json +2 -1
  471. package/locales/extensions/tr.json +2 -1
  472. package/locales/extensions/uk.json +2 -1
  473. package/locales/extensions/ur.json +2 -1
  474. package/locales/extensions/vi.json +2 -1
  475. package/locales/extensions/yo.json +2 -1
  476. package/locales/extensions/zh-Hans.json +2 -1
  477. package/locales/extensions/zh-Hant.json +2 -1
  478. package/locales/fa.json +26 -15
  479. package/locales/feedback/am.json +7 -0
  480. package/locales/feedback/ar.json +7 -0
  481. package/locales/feedback/bg.json +7 -0
  482. package/locales/feedback/bn.json +7 -0
  483. package/locales/feedback/br.json +7 -0
  484. package/locales/feedback/co.json +7 -0
  485. package/locales/feedback/cs.json +7 -0
  486. package/locales/feedback/da.json +7 -0
  487. package/locales/feedback/de.json +7 -0
  488. package/locales/feedback/el.json +7 -0
  489. package/locales/feedback/en.json +7 -0
  490. package/locales/feedback/es.json +7 -0
  491. package/locales/feedback/fa.json +7 -0
  492. package/locales/feedback/fi.json +7 -0
  493. package/locales/feedback/fr-CA.json +7 -0
  494. package/locales/feedback/fr.json +7 -0
  495. package/locales/feedback/ha.json +7 -0
  496. package/locales/feedback/he.json +7 -0
  497. package/locales/feedback/hi.json +7 -0
  498. package/locales/feedback/hr.json +7 -0
  499. package/locales/feedback/hu.json +7 -0
  500. package/locales/feedback/id.json +7 -0
  501. package/locales/feedback/it.json +7 -0
  502. package/locales/feedback/ja.json +7 -0
  503. package/locales/feedback/ko.json +7 -0
  504. package/locales/feedback/mr.json +7 -0
  505. package/locales/feedback/ms.json +7 -0
  506. package/locales/feedback/nl.json +7 -0
  507. package/locales/feedback/pl.json +7 -0
  508. package/locales/feedback/pt.json +7 -0
  509. package/locales/feedback/ro.json +7 -0
  510. package/locales/feedback/ru.json +7 -0
  511. package/locales/feedback/sk.json +7 -0
  512. package/locales/feedback/sv.json +7 -0
  513. package/locales/feedback/sw.json +7 -0
  514. package/locales/feedback/ta.json +7 -0
  515. package/locales/feedback/te.json +7 -0
  516. package/locales/feedback/th.json +7 -0
  517. package/locales/feedback/tl.json +7 -0
  518. package/locales/feedback/tr.json +7 -0
  519. package/locales/feedback/uk.json +7 -0
  520. package/locales/feedback/ur.json +7 -0
  521. package/locales/feedback/vi.json +7 -0
  522. package/locales/feedback/yo.json +7 -0
  523. package/locales/feedback/zh-Hans.json +7 -0
  524. package/locales/feedback/zh-Hant.json +7 -0
  525. package/locales/fi.json +27 -16
  526. package/locales/files/am.json +10 -0
  527. package/locales/files/ar.json +10 -0
  528. package/locales/files/bg.json +10 -0
  529. package/locales/files/bn.json +10 -0
  530. package/locales/files/br.json +10 -0
  531. package/locales/files/co.json +10 -0
  532. package/locales/files/cs.json +10 -0
  533. package/locales/files/da.json +10 -0
  534. package/locales/files/de.json +10 -0
  535. package/locales/files/el.json +10 -0
  536. package/locales/files/en.json +10 -0
  537. package/locales/files/es.json +10 -0
  538. package/locales/files/fa.json +10 -0
  539. package/locales/files/fi.json +10 -0
  540. package/locales/files/fr-CA.json +10 -0
  541. package/locales/files/fr.json +10 -0
  542. package/locales/files/ha.json +10 -0
  543. package/locales/files/he.json +10 -0
  544. package/locales/files/hi.json +10 -0
  545. package/locales/files/hr.json +10 -0
  546. package/locales/files/hu.json +10 -0
  547. package/locales/files/id.json +10 -0
  548. package/locales/files/it.json +10 -0
  549. package/locales/files/ja.json +10 -0
  550. package/locales/files/ko.json +10 -0
  551. package/locales/files/mr.json +10 -0
  552. package/locales/files/ms.json +10 -0
  553. package/locales/files/nl.json +10 -0
  554. package/locales/files/pl.json +10 -0
  555. package/locales/files/pt.json +10 -0
  556. package/locales/files/ro.json +10 -0
  557. package/locales/files/ru.json +10 -0
  558. package/locales/files/sk.json +10 -0
  559. package/locales/files/sv.json +10 -0
  560. package/locales/files/sw.json +10 -0
  561. package/locales/files/ta.json +10 -0
  562. package/locales/files/te.json +10 -0
  563. package/locales/files/th.json +10 -0
  564. package/locales/files/tl.json +10 -0
  565. package/locales/files/tr.json +10 -0
  566. package/locales/files/uk.json +10 -0
  567. package/locales/files/ur.json +10 -0
  568. package/locales/files/vi.json +10 -0
  569. package/locales/files/yo.json +10 -0
  570. package/locales/files/zh-Hans.json +10 -0
  571. package/locales/files/zh-Hant.json +10 -0
  572. package/locales/flows/am.json +3 -0
  573. package/locales/flows/ar.json +3 -0
  574. package/locales/flows/bg.json +3 -0
  575. package/locales/flows/bn.json +3 -0
  576. package/locales/flows/br.json +3 -0
  577. package/locales/flows/co.json +3 -0
  578. package/locales/flows/cs.json +3 -0
  579. package/locales/flows/da.json +3 -0
  580. package/locales/flows/de.json +3 -0
  581. package/locales/flows/el.json +3 -0
  582. package/locales/flows/en.json +3 -0
  583. package/locales/flows/es.json +3 -0
  584. package/locales/flows/fa.json +3 -0
  585. package/locales/flows/fi.json +3 -0
  586. package/locales/flows/fr-CA.json +3 -0
  587. package/locales/flows/fr.json +3 -0
  588. package/locales/flows/ha.json +3 -0
  589. package/locales/flows/he.json +3 -0
  590. package/locales/flows/hi.json +3 -0
  591. package/locales/flows/hr.json +3 -0
  592. package/locales/flows/hu.json +3 -0
  593. package/locales/flows/id.json +3 -0
  594. package/locales/flows/it.json +3 -0
  595. package/locales/flows/ja.json +3 -0
  596. package/locales/flows/ko.json +3 -0
  597. package/locales/flows/mr.json +3 -0
  598. package/locales/flows/ms.json +3 -0
  599. package/locales/flows/nl.json +3 -0
  600. package/locales/flows/pl.json +3 -0
  601. package/locales/flows/pt.json +3 -0
  602. package/locales/flows/ro.json +3 -0
  603. package/locales/flows/ru.json +3 -0
  604. package/locales/flows/sk.json +3 -0
  605. package/locales/flows/sv.json +3 -0
  606. package/locales/flows/sw.json +3 -0
  607. package/locales/flows/ta.json +3 -0
  608. package/locales/flows/te.json +3 -0
  609. package/locales/flows/th.json +3 -0
  610. package/locales/flows/tl.json +3 -0
  611. package/locales/flows/tr.json +3 -0
  612. package/locales/flows/uk.json +3 -0
  613. package/locales/flows/ur.json +3 -0
  614. package/locales/flows/vi.json +3 -0
  615. package/locales/flows/yo.json +3 -0
  616. package/locales/flows/zh-Hans.json +3 -0
  617. package/locales/flows/zh-Hant.json +3 -0
  618. package/locales/fr-CA.json +27 -16
  619. package/locales/fr.json +27 -16
  620. package/locales/ha.json +26 -15
  621. package/locales/he.json +26 -15
  622. package/locales/hi.json +26 -15
  623. package/locales/hr.json +27 -16
  624. package/locales/hu.json +26 -15
  625. package/locales/id.json +27 -16
  626. package/locales/it.json +27 -16
  627. package/locales/ja.json +27 -16
  628. package/locales/ko.json +26 -15
  629. package/locales/look/am.json +5 -1
  630. package/locales/look/ar.json +5 -1
  631. package/locales/look/bg.json +5 -1
  632. package/locales/look/bn.json +5 -1
  633. package/locales/look/br.json +5 -1
  634. package/locales/look/co.json +5 -1
  635. package/locales/look/cs.json +5 -1
  636. package/locales/look/da.json +5 -1
  637. package/locales/look/de.json +5 -1
  638. package/locales/look/el.json +5 -1
  639. package/locales/look/en.json +5 -1
  640. package/locales/look/es.json +5 -1
  641. package/locales/look/fa.json +5 -1
  642. package/locales/look/fi.json +5 -1
  643. package/locales/look/fr-CA.json +5 -1
  644. package/locales/look/fr.json +5 -1
  645. package/locales/look/ha.json +5 -1
  646. package/locales/look/he.json +5 -1
  647. package/locales/look/hi.json +5 -1
  648. package/locales/look/hr.json +5 -1
  649. package/locales/look/hu.json +5 -1
  650. package/locales/look/id.json +5 -1
  651. package/locales/look/it.json +5 -1
  652. package/locales/look/ja.json +5 -1
  653. package/locales/look/ko.json +5 -1
  654. package/locales/look/mr.json +5 -1
  655. package/locales/look/ms.json +5 -1
  656. package/locales/look/nl.json +5 -1
  657. package/locales/look/pl.json +5 -1
  658. package/locales/look/pt.json +5 -1
  659. package/locales/look/ro.json +5 -1
  660. package/locales/look/ru.json +5 -1
  661. package/locales/look/sk.json +5 -1
  662. package/locales/look/sv.json +5 -1
  663. package/locales/look/sw.json +5 -1
  664. package/locales/look/ta.json +5 -1
  665. package/locales/look/te.json +5 -1
  666. package/locales/look/th.json +5 -1
  667. package/locales/look/tl.json +5 -1
  668. package/locales/look/tr.json +5 -1
  669. package/locales/look/uk.json +5 -1
  670. package/locales/look/ur.json +5 -1
  671. package/locales/look/vi.json +5 -1
  672. package/locales/look/yo.json +5 -1
  673. package/locales/look/zh-Hans.json +5 -1
  674. package/locales/look/zh-Hant.json +5 -1
  675. package/locales/machine/fr-CA.json +1 -1
  676. package/locales/machine/fr.json +1 -1
  677. package/locales/mr.json +26 -15
  678. package/locales/ms.json +27 -16
  679. package/locales/nl.json +27 -16
  680. package/locales/pl.json +26 -15
  681. package/locales/projects/am.json +4 -0
  682. package/locales/projects/ar.json +4 -0
  683. package/locales/projects/bg.json +4 -0
  684. package/locales/projects/bn.json +4 -0
  685. package/locales/projects/br.json +4 -0
  686. package/locales/projects/co.json +4 -0
  687. package/locales/projects/cs.json +4 -0
  688. package/locales/projects/da.json +4 -0
  689. package/locales/projects/de.json +4 -0
  690. package/locales/projects/el.json +4 -0
  691. package/locales/projects/en.json +4 -0
  692. package/locales/projects/es.json +4 -0
  693. package/locales/projects/fa.json +4 -0
  694. package/locales/projects/fi.json +4 -0
  695. package/locales/projects/fr-CA.json +4 -0
  696. package/locales/projects/fr.json +4 -0
  697. package/locales/projects/ha.json +4 -0
  698. package/locales/projects/he.json +4 -0
  699. package/locales/projects/hi.json +4 -0
  700. package/locales/projects/hr.json +4 -0
  701. package/locales/projects/hu.json +4 -0
  702. package/locales/projects/id.json +4 -0
  703. package/locales/projects/it.json +4 -0
  704. package/locales/projects/ja.json +4 -0
  705. package/locales/projects/ko.json +4 -0
  706. package/locales/projects/mr.json +4 -0
  707. package/locales/projects/ms.json +4 -0
  708. package/locales/projects/nl.json +4 -0
  709. package/locales/projects/pl.json +4 -0
  710. package/locales/projects/pt.json +4 -0
  711. package/locales/projects/ro.json +4 -0
  712. package/locales/projects/ru.json +4 -0
  713. package/locales/projects/sk.json +4 -0
  714. package/locales/projects/sv.json +4 -0
  715. package/locales/projects/sw.json +4 -0
  716. package/locales/projects/ta.json +4 -0
  717. package/locales/projects/te.json +4 -0
  718. package/locales/projects/th.json +4 -0
  719. package/locales/projects/tl.json +4 -0
  720. package/locales/projects/tr.json +4 -0
  721. package/locales/projects/uk.json +4 -0
  722. package/locales/projects/ur.json +4 -0
  723. package/locales/projects/vi.json +4 -0
  724. package/locales/projects/yo.json +4 -0
  725. package/locales/projects/zh-Hans.json +4 -0
  726. package/locales/projects/zh-Hant.json +4 -0
  727. package/locales/pt.json +27 -16
  728. package/locales/receipt/am.json +14 -1
  729. package/locales/receipt/ar.json +14 -1
  730. package/locales/receipt/bg.json +14 -1
  731. package/locales/receipt/bn.json +14 -1
  732. package/locales/receipt/br.json +14 -1
  733. package/locales/receipt/co.json +14 -1
  734. package/locales/receipt/cs.json +14 -1
  735. package/locales/receipt/da.json +14 -1
  736. package/locales/receipt/de.json +14 -1
  737. package/locales/receipt/el.json +14 -1
  738. package/locales/receipt/en.json +14 -1
  739. package/locales/receipt/es.json +14 -1
  740. package/locales/receipt/fa.json +14 -1
  741. package/locales/receipt/fi.json +14 -1
  742. package/locales/receipt/fr-CA.json +14 -1
  743. package/locales/receipt/fr.json +14 -1
  744. package/locales/receipt/ha.json +14 -1
  745. package/locales/receipt/he.json +14 -1
  746. package/locales/receipt/hi.json +14 -1
  747. package/locales/receipt/hr.json +14 -1
  748. package/locales/receipt/hu.json +14 -1
  749. package/locales/receipt/id.json +14 -1
  750. package/locales/receipt/it.json +14 -1
  751. package/locales/receipt/ja.json +14 -1
  752. package/locales/receipt/ko.json +14 -1
  753. package/locales/receipt/mr.json +14 -1
  754. package/locales/receipt/ms.json +14 -1
  755. package/locales/receipt/nl.json +14 -1
  756. package/locales/receipt/pl.json +14 -1
  757. package/locales/receipt/pt.json +14 -1
  758. package/locales/receipt/ro.json +14 -1
  759. package/locales/receipt/ru.json +14 -1
  760. package/locales/receipt/sk.json +14 -1
  761. package/locales/receipt/sv.json +14 -1
  762. package/locales/receipt/sw.json +14 -1
  763. package/locales/receipt/ta.json +14 -1
  764. package/locales/receipt/te.json +14 -1
  765. package/locales/receipt/th.json +14 -1
  766. package/locales/receipt/tl.json +14 -1
  767. package/locales/receipt/tr.json +14 -1
  768. package/locales/receipt/uk.json +14 -1
  769. package/locales/receipt/ur.json +14 -1
  770. package/locales/receipt/vi.json +14 -1
  771. package/locales/receipt/yo.json +14 -1
  772. package/locales/receipt/zh-Hans.json +14 -1
  773. package/locales/receipt/zh-Hant.json +14 -1
  774. package/locales/ro.json +27 -16
  775. package/locales/routines/am.json +2 -0
  776. package/locales/routines/ar.json +2 -0
  777. package/locales/routines/bg.json +2 -0
  778. package/locales/routines/bn.json +2 -0
  779. package/locales/routines/br.json +2 -0
  780. package/locales/routines/co.json +2 -0
  781. package/locales/routines/cs.json +2 -0
  782. package/locales/routines/da.json +2 -0
  783. package/locales/routines/de.json +2 -0
  784. package/locales/routines/el.json +2 -0
  785. package/locales/routines/en.json +2 -0
  786. package/locales/routines/es.json +2 -0
  787. package/locales/routines/fa.json +2 -0
  788. package/locales/routines/fi.json +2 -0
  789. package/locales/routines/fr-CA.json +2 -0
  790. package/locales/routines/fr.json +2 -0
  791. package/locales/routines/ha.json +2 -0
  792. package/locales/routines/he.json +2 -0
  793. package/locales/routines/hi.json +2 -0
  794. package/locales/routines/hr.json +2 -0
  795. package/locales/routines/hu.json +2 -0
  796. package/locales/routines/id.json +2 -0
  797. package/locales/routines/it.json +2 -0
  798. package/locales/routines/ja.json +2 -0
  799. package/locales/routines/ko.json +2 -0
  800. package/locales/routines/mr.json +2 -0
  801. package/locales/routines/ms.json +2 -0
  802. package/locales/routines/nl.json +2 -0
  803. package/locales/routines/pl.json +2 -0
  804. package/locales/routines/pt.json +2 -0
  805. package/locales/routines/ro.json +2 -0
  806. package/locales/routines/ru.json +2 -0
  807. package/locales/routines/sk.json +2 -0
  808. package/locales/routines/sv.json +2 -0
  809. package/locales/routines/sw.json +2 -0
  810. package/locales/routines/ta.json +2 -0
  811. package/locales/routines/te.json +2 -0
  812. package/locales/routines/th.json +2 -0
  813. package/locales/routines/tl.json +2 -0
  814. package/locales/routines/tr.json +2 -0
  815. package/locales/routines/uk.json +2 -0
  816. package/locales/routines/ur.json +2 -0
  817. package/locales/routines/vi.json +2 -0
  818. package/locales/routines/yo.json +2 -0
  819. package/locales/routines/zh-Hans.json +2 -0
  820. package/locales/routines/zh-Hant.json +2 -0
  821. package/locales/ru.json +26 -15
  822. package/locales/screen/am.json +11 -0
  823. package/locales/screen/ar.json +11 -0
  824. package/locales/screen/bg.json +11 -0
  825. package/locales/screen/bn.json +11 -0
  826. package/locales/screen/br.json +11 -0
  827. package/locales/screen/co.json +11 -0
  828. package/locales/screen/cs.json +11 -0
  829. package/locales/screen/da.json +11 -0
  830. package/locales/screen/de.json +11 -0
  831. package/locales/screen/el.json +11 -0
  832. package/locales/screen/en.json +11 -0
  833. package/locales/screen/es.json +11 -0
  834. package/locales/screen/fa.json +11 -0
  835. package/locales/screen/fi.json +11 -0
  836. package/locales/screen/fr-CA.json +11 -0
  837. package/locales/screen/fr.json +11 -0
  838. package/locales/screen/ha.json +11 -0
  839. package/locales/screen/he.json +11 -0
  840. package/locales/screen/hi.json +11 -0
  841. package/locales/screen/hr.json +11 -0
  842. package/locales/screen/hu.json +11 -0
  843. package/locales/screen/id.json +11 -0
  844. package/locales/screen/it.json +11 -0
  845. package/locales/screen/ja.json +11 -0
  846. package/locales/screen/ko.json +11 -0
  847. package/locales/screen/mr.json +11 -0
  848. package/locales/screen/ms.json +11 -0
  849. package/locales/screen/nl.json +11 -0
  850. package/locales/screen/pl.json +11 -0
  851. package/locales/screen/pt.json +11 -0
  852. package/locales/screen/ro.json +11 -0
  853. package/locales/screen/ru.json +11 -0
  854. package/locales/screen/sk.json +11 -0
  855. package/locales/screen/sv.json +11 -0
  856. package/locales/screen/sw.json +11 -0
  857. package/locales/screen/ta.json +11 -0
  858. package/locales/screen/te.json +11 -0
  859. package/locales/screen/th.json +11 -0
  860. package/locales/screen/tl.json +11 -0
  861. package/locales/screen/tr.json +11 -0
  862. package/locales/screen/uk.json +11 -0
  863. package/locales/screen/ur.json +11 -0
  864. package/locales/screen/vi.json +11 -0
  865. package/locales/screen/yo.json +11 -0
  866. package/locales/screen/zh-Hans.json +11 -0
  867. package/locales/screen/zh-Hant.json +11 -0
  868. package/locales/sites/am.json +48 -0
  869. package/locales/sites/ar.json +52 -0
  870. package/locales/sites/bg.json +48 -0
  871. package/locales/sites/bn.json +48 -0
  872. package/locales/sites/br.json +51 -0
  873. package/locales/sites/co.json +49 -0
  874. package/locales/sites/cs.json +50 -0
  875. package/locales/sites/da.json +48 -0
  876. package/locales/sites/de.json +48 -0
  877. package/locales/sites/el.json +48 -0
  878. package/locales/sites/en.json +48 -0
  879. package/locales/sites/es.json +49 -0
  880. package/locales/sites/fa.json +48 -0
  881. package/locales/sites/fi.json +48 -0
  882. package/locales/sites/fr-CA.json +49 -0
  883. package/locales/sites/fr.json +49 -0
  884. package/locales/sites/ha.json +48 -0
  885. package/locales/sites/he.json +49 -0
  886. package/locales/sites/hi.json +48 -0
  887. package/locales/sites/hr.json +49 -0
  888. package/locales/sites/hu.json +48 -0
  889. package/locales/sites/id.json +47 -0
  890. package/locales/sites/it.json +49 -0
  891. package/locales/sites/ja.json +47 -0
  892. package/locales/sites/ko.json +47 -0
  893. package/locales/sites/mr.json +48 -0
  894. package/locales/sites/ms.json +47 -0
  895. package/locales/sites/nl.json +48 -0
  896. package/locales/sites/pl.json +50 -0
  897. package/locales/sites/pt.json +49 -0
  898. package/locales/sites/ro.json +49 -0
  899. package/locales/sites/ru.json +50 -0
  900. package/locales/sites/sk.json +50 -0
  901. package/locales/sites/sv.json +48 -0
  902. package/locales/sites/sw.json +48 -0
  903. package/locales/sites/ta.json +48 -0
  904. package/locales/sites/te.json +48 -0
  905. package/locales/sites/th.json +47 -0
  906. package/locales/sites/tl.json +48 -0
  907. package/locales/sites/tr.json +48 -0
  908. package/locales/sites/uk.json +50 -0
  909. package/locales/sites/ur.json +48 -0
  910. package/locales/sites/vi.json +47 -0
  911. package/locales/sites/yo.json +47 -0
  912. package/locales/sites/zh-Hans.json +47 -0
  913. package/locales/sites/zh-Hant.json +47 -0
  914. package/locales/sk.json +27 -16
  915. package/locales/skills/am.json +1 -0
  916. package/locales/skills/ar.json +1 -0
  917. package/locales/skills/bg.json +1 -0
  918. package/locales/skills/bn.json +1 -0
  919. package/locales/skills/br.json +1 -0
  920. package/locales/skills/co.json +1 -0
  921. package/locales/skills/cs.json +1 -0
  922. package/locales/skills/da.json +1 -0
  923. package/locales/skills/de.json +1 -0
  924. package/locales/skills/el.json +1 -0
  925. package/locales/skills/en.json +1 -0
  926. package/locales/skills/es.json +1 -0
  927. package/locales/skills/fa.json +1 -0
  928. package/locales/skills/fi.json +1 -0
  929. package/locales/skills/fr-CA.json +1 -0
  930. package/locales/skills/fr.json +1 -0
  931. package/locales/skills/ha.json +1 -0
  932. package/locales/skills/he.json +1 -0
  933. package/locales/skills/hi.json +1 -0
  934. package/locales/skills/hr.json +1 -0
  935. package/locales/skills/hu.json +1 -0
  936. package/locales/skills/id.json +1 -0
  937. package/locales/skills/it.json +1 -0
  938. package/locales/skills/ja.json +1 -0
  939. package/locales/skills/ko.json +1 -0
  940. package/locales/skills/mr.json +1 -0
  941. package/locales/skills/ms.json +1 -0
  942. package/locales/skills/nl.json +1 -0
  943. package/locales/skills/pl.json +1 -0
  944. package/locales/skills/pt.json +1 -0
  945. package/locales/skills/ro.json +1 -0
  946. package/locales/skills/ru.json +1 -0
  947. package/locales/skills/sk.json +1 -0
  948. package/locales/skills/sv.json +1 -0
  949. package/locales/skills/sw.json +1 -0
  950. package/locales/skills/ta.json +1 -0
  951. package/locales/skills/te.json +1 -0
  952. package/locales/skills/th.json +1 -0
  953. package/locales/skills/tl.json +1 -0
  954. package/locales/skills/tr.json +1 -0
  955. package/locales/skills/uk.json +1 -0
  956. package/locales/skills/ur.json +1 -0
  957. package/locales/skills/vi.json +1 -0
  958. package/locales/skills/yo.json +1 -0
  959. package/locales/skills/zh-Hans.json +1 -0
  960. package/locales/skills/zh-Hant.json +1 -0
  961. package/locales/sv.json +26 -15
  962. package/locales/sw.json +26 -15
  963. package/locales/ta.json +26 -15
  964. package/locales/te.json +26 -15
  965. package/locales/th.json +26 -15
  966. package/locales/tl.json +26 -15
  967. package/locales/tr.json +26 -15
  968. package/locales/uk.json +26 -15
  969. package/locales/ur.json +26 -15
  970. package/locales/vi.json +26 -15
  971. package/locales/{search → web-search}/am.json +1 -1
  972. package/locales/{search → web-search}/ar.json +1 -1
  973. package/locales/{search → web-search}/bg.json +1 -1
  974. package/locales/{search → web-search}/bn.json +1 -1
  975. package/locales/{search → web-search}/br.json +1 -1
  976. package/locales/{search → web-search}/co.json +1 -1
  977. package/locales/{search → web-search}/cs.json +1 -1
  978. package/locales/{search → web-search}/da.json +1 -1
  979. package/locales/{search → web-search}/de.json +1 -1
  980. package/locales/{search → web-search}/el.json +1 -1
  981. package/locales/{search → web-search}/en.json +1 -1
  982. package/locales/{search → web-search}/es.json +1 -1
  983. package/locales/{search → web-search}/fa.json +1 -1
  984. package/locales/{search → web-search}/fi.json +1 -1
  985. package/locales/{search → web-search}/fr-CA.json +1 -1
  986. package/locales/{search → web-search}/fr.json +1 -1
  987. package/locales/{search → web-search}/ha.json +1 -1
  988. package/locales/{search → web-search}/he.json +1 -1
  989. package/locales/{search → web-search}/hi.json +1 -1
  990. package/locales/{search → web-search}/hr.json +1 -1
  991. package/locales/{search → web-search}/hu.json +1 -1
  992. package/locales/{search → web-search}/id.json +1 -1
  993. package/locales/{search → web-search}/it.json +1 -1
  994. package/locales/{search → web-search}/ja.json +1 -1
  995. package/locales/{search → web-search}/ko.json +1 -1
  996. package/locales/{search → web-search}/mr.json +1 -1
  997. package/locales/{search → web-search}/ms.json +1 -1
  998. package/locales/{search → web-search}/nl.json +1 -1
  999. package/locales/{search → web-search}/pl.json +1 -1
  1000. package/locales/{search → web-search}/pt.json +1 -1
  1001. package/locales/{search → web-search}/ro.json +1 -1
  1002. package/locales/{search → web-search}/ru.json +1 -1
  1003. package/locales/{search → web-search}/sk.json +1 -1
  1004. package/locales/{search → web-search}/sv.json +1 -1
  1005. package/locales/{search → web-search}/sw.json +1 -1
  1006. package/locales/{search → web-search}/ta.json +1 -1
  1007. package/locales/{search → web-search}/te.json +1 -1
  1008. package/locales/{search → web-search}/th.json +1 -1
  1009. package/locales/{search → web-search}/tl.json +1 -1
  1010. package/locales/{search → web-search}/tr.json +1 -1
  1011. package/locales/{search → web-search}/uk.json +1 -1
  1012. package/locales/{search → web-search}/ur.json +1 -1
  1013. package/locales/{search → web-search}/vi.json +1 -1
  1014. package/locales/{search → web-search}/yo.json +1 -1
  1015. package/locales/{search → web-search}/zh-Hans.json +1 -1
  1016. package/locales/{search → web-search}/zh-Hant.json +1 -1
  1017. package/locales/yo.json +26 -15
  1018. package/locales/zh-Hans.json +26 -15
  1019. package/locales/zh-Hant.json +26 -15
  1020. package/package.json +1 -1
  1021. package/preview.html +8 -2
  1022. package/ui/base.js +33 -0
  1023. package/ui/caps.js +9 -5
  1024. package/ui/csp.js +1 -1
  1025. package/ui/export.js +1 -1
  1026. package/ui/icons.js +3 -3
  1027. package/ui/kit.js +7 -2
  1028. package/ui/looks/human.css +4 -2
  1029. package/ui/markdown.js +23 -19
  1030. package/ui/menu-icons.js +10 -5
  1031. package/ui/model.js +4 -4
  1032. package/ui/pointed.js +22 -0
  1033. package/ui/reader-state.js +3 -2
  1034. package/ui/seal.js +62 -2
  1035. package/ui/shown.js +53 -0
  1036. package/ui/style.css +9 -6
  1037. package/ui/view.css +27 -1
  1038. package/ui/view.js +38 -15
  1039. package/vendor/pele/lazy.d.ts +1 -0
  1040. /package/locales/{reader → natural-voice}/am.json +0 -0
  1041. /package/locales/{reader → natural-voice}/ar.json +0 -0
  1042. /package/locales/{reader → natural-voice}/bg.json +0 -0
  1043. /package/locales/{reader → natural-voice}/bn.json +0 -0
  1044. /package/locales/{reader → natural-voice}/br.json +0 -0
  1045. /package/locales/{reader → natural-voice}/co.json +0 -0
  1046. /package/locales/{reader → natural-voice}/cs.json +0 -0
  1047. /package/locales/{reader → natural-voice}/da.json +0 -0
  1048. /package/locales/{reader → natural-voice}/de.json +0 -0
  1049. /package/locales/{reader → natural-voice}/el.json +0 -0
  1050. /package/locales/{reader → natural-voice}/en.json +0 -0
  1051. /package/locales/{reader → natural-voice}/es.json +0 -0
  1052. /package/locales/{reader → natural-voice}/fa.json +0 -0
  1053. /package/locales/{reader → natural-voice}/fi.json +0 -0
  1054. /package/locales/{reader → natural-voice}/fr-CA.json +0 -0
  1055. /package/locales/{reader → natural-voice}/fr.json +0 -0
  1056. /package/locales/{reader → natural-voice}/ha.json +0 -0
  1057. /package/locales/{reader → natural-voice}/he.json +0 -0
  1058. /package/locales/{reader → natural-voice}/hi.json +0 -0
  1059. /package/locales/{reader → natural-voice}/hr.json +0 -0
  1060. /package/locales/{reader → natural-voice}/hu.json +0 -0
  1061. /package/locales/{reader → natural-voice}/id.json +0 -0
  1062. /package/locales/{reader → natural-voice}/it.json +0 -0
  1063. /package/locales/{reader → natural-voice}/ja.json +0 -0
  1064. /package/locales/{reader → natural-voice}/ko.json +0 -0
  1065. /package/locales/{reader → natural-voice}/mr.json +0 -0
  1066. /package/locales/{reader → natural-voice}/ms.json +0 -0
  1067. /package/locales/{reader → natural-voice}/nl.json +0 -0
  1068. /package/locales/{reader → natural-voice}/pl.json +0 -0
  1069. /package/locales/{reader → natural-voice}/pt.json +0 -0
  1070. /package/locales/{reader → natural-voice}/ro.json +0 -0
  1071. /package/locales/{reader → natural-voice}/ru.json +0 -0
  1072. /package/locales/{reader → natural-voice}/sk.json +0 -0
  1073. /package/locales/{reader → natural-voice}/sv.json +0 -0
  1074. /package/locales/{reader → natural-voice}/sw.json +0 -0
  1075. /package/locales/{reader → natural-voice}/ta.json +0 -0
  1076. /package/locales/{reader → natural-voice}/te.json +0 -0
  1077. /package/locales/{reader → natural-voice}/th.json +0 -0
  1078. /package/locales/{reader → natural-voice}/tl.json +0 -0
  1079. /package/locales/{reader → natural-voice}/tr.json +0 -0
  1080. /package/locales/{reader → natural-voice}/uk.json +0 -0
  1081. /package/locales/{reader → natural-voice}/ur.json +0 -0
  1082. /package/locales/{reader → natural-voice}/vi.json +0 -0
  1083. /package/locales/{reader → natural-voice}/yo.json +0 -0
  1084. /package/locales/{reader → natural-voice}/zh-Hans.json +0 -0
  1085. /package/locales/{reader → natural-voice}/zh-Hant.json +0 -0
package/brand.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // The only place the name lives. Display only: never use it in storage keys,
2
2
  // file paths, cache names, CSS classes or element names (see AGENTS.md).
3
- export const BRAND = Object.freeze({
3
+ export const BRAND = Object.seal({
4
4
  name: 'Jean',
5
5
  domain: 'jean.is',
6
6
  })
@@ -22,7 +22,7 @@ const [echarts] = await Promise.all([import(new URL('../../vendor/echarts/echart
22
22
  const [contrast, forced] = [matchMedia('(prefers-contrast: more)'), matchMedia('(forced-colors: active)')]
23
23
  let charts = 0
24
24
  // Escape hides a tip.
25
- addEventListener('keydown', (event) => { if (event.key === 'Escape') for (const one of document.querySelectorAll('app-chart')) /** @type {any} */ (one).chart?.dispatchAction({ type: 'hideTip' }) })
25
+ addEventListener('keydown', (event) => { if (event.key === 'Escape') for (const one of document.querySelectorAll('app-chart')) /** @type {{ chart?: import('echarts').ECharts | null }} */ (one).chart?.dispatchAction({ type: 'hideTip' }) })
26
26
 
27
27
  /**
28
28
  * The option as drawn here: numbers in the user's language, the room's type, no animation for
@@ -38,7 +38,7 @@ function dressed(option, font) {
38
38
  }
39
39
  }
40
40
 
41
- /** A chart's numbers as a table, its categories down the side and a column for each series; its source where it has neither. @param {any} option @param {string} source */
41
+ /** A chart's numbers as a table, its categories down the side and a column for each series; its source where it has neither. @param {Option} option @param {string} source */
42
42
  function figures(option, source) {
43
43
  const series = [option.series].flat().filter((one) => Array.isArray(one?.data)), axis = [option.xAxis, option.yAxis].flat().find((one) => Array.isArray(one?.data))?.data, value = (/** @type {any} */ one) => [one?.value ?? one].flat().join(', '), rows = Math.max(0, ...series.map((one) => one.data.length))
44
44
  const links = [option.series].flat().flatMap((one) => one?.links ?? one?.edges ?? []), set = [option.dataset].flat()[0]?.source; if (links.length) return html`<ul>${links.map((/** @type {any} */ one) => html`<li dir="auto">${one.source} → ${one.target}${one.value == null ? '' : ` (${one.value})`}</li>`)}</ul>`
@@ -1,14 +1,15 @@
1
1
  // Word, Excel and PowerPoint files as Office draws them (D183), in a file's pane and the browser: by
2
2
  // @silurus/ooxml, its parsers WebAssembly, its viewers drawing on a canvas, so nothing of the file
3
3
  // becomes markup, in a frame of a file pane's kind (an opaque origin with no network), in a page made
4
- // here: modules as data: addresses under an import map, the parser and the file as data too.
4
+ // here: its modules as text the page makes blob: addresses of, under an import map it writes, the
5
+ // parser and the file as data.
5
6
  import { encode } from '../../ui/seal.js'
6
7
  import { t } from '../../core/i18n.js'
7
8
 
8
9
  const BASE = new URL('../../vendor/ooxml/', import.meta.url)
9
10
  const VIEWERS = /** @type {Record<string, string>} */ ({ docx: 'DocxScrollViewer', pptx: 'PptxScrollViewer', xlsx: 'XlsxViewer' })
10
- /** A file of vendor/ooxml as a data: address. @param {string} path @param {string} [type] */
11
- const data = async (path, type = 'text/javascript') => `data:${type};base64,${encode(new Uint8Array(await (await fetch(new URL(path, BASE))).arrayBuffer()))}`
11
+ /** A file of vendor/ooxml. @param {string} path */
12
+ const read = (path) => fetch(new URL(path, BASE))
12
13
  let graph = /** @type {Promise<Record<string, string[]>> | undefined} */ (undefined)
13
14
 
14
15
  /** Where a workbook was being looked at: its sheet, how far it was scrolled, the cell chosen. @typedef {{ sheet: number, x: number, y: number, ref: string }} Place */
@@ -16,7 +17,9 @@ let graph = /** @type {Promise<Record<string, string[]>> | undefined} */ (undefi
16
17
  // A workbook's cells changed where they are (D229): a double click, F2 or typing opens a box over the cell
17
18
  // chosen (Enter is the viewer's, for comments); Enter, Tab or leaving it sends Jean what it is to hold, and
18
19
  // Jean keeps a new version and shows it again where it was; Escape leaves the box, as does Jean's answer
19
- // that the cell can't change. Closed from the keyboard, the box gives the keys back to the sheet.
20
+ // that the cell can't change. Closed from the keyboard, the box gives the keys back to the sheet. A sheet is
21
+ // drawn before the viewer has read it whole, and can't say what a cell holds until then: the box waits for
22
+ // that, 10 s at most, unless another box opened meanwhile.
20
23
  const CELLS = `
21
24
  const box = Object.assign(document.createElement('input'), { dir: 'auto', spellcheck: false, autocomplete: 'off' })
22
25
  box.style.cssText = 'position: fixed; display: none; box-sizing: border-box; margin: 0; padding: 0 4px; border: 2px solid #1a73e8; background: #fff; color: #111; font: 13px system-ui, sans-serif'
@@ -26,11 +29,13 @@ let was = ''
26
29
  let back = null
27
30
  const ref = ({ row, col }) => { let name = ''; for (let n = col; n > 0; n = Math.floor((n - 1) / 26)) name = String.fromCharCode(65 + ((n - 1) % 26)) + name; return name + row }
28
31
  const close = (keys) => { cell = null; box.readOnly = false; box.style.display = 'none'; if (keys) back?.focus() }
29
- const open = (typed) => {
32
+ const open = (typed, tries = 0) => {
30
33
  const active = viewer.selectionState?.activeCell
31
34
  const rect = active && viewer.getCellViewportRect(active)
32
35
  if (!rect) return
33
- const known = viewer.getSelectionContext()?.cells?.find(({ address }) => address.row === active.row && address.col === active.col)
36
+ const context = viewer.getSelectionContext()
37
+ if (!context) return void (tries < 200 && setTimeout(() => cell || open(typed, tries + 1), 50))
38
+ const known = context.cells?.find(({ address }) => address.row === active.row && address.col === active.col)
34
39
  const grid = viewer.canvasElement.getBoundingClientRect()
35
40
  cell = active
36
41
  back = document.activeElement
@@ -73,16 +78,18 @@ addEventListener('message', ({ source, data }) => { if (source === parent && dat
73
78
  */
74
79
  export async function officePage(ext, bytes, name, cells, words) {
75
80
  graph ??= fetch(new URL('graph.json', BASE)).then((response) => response.json())
76
- const imports = Object.fromEntries(await Promise.all((await graph)[ext].map(async (file) => [`ooxml/${file}`, await data(file)])))
81
+ // Its modules as blob: addresses the page makes, never data: ones: Chromium took 2.6 s over the 1.6 MB data: address of a Word
82
+ // document's largest module, on a fast computer, and fourteen on a busy one, and Jean's page, whose thread the frame shares, froze with it.
83
+ const modules = Object.fromEntries(await Promise.all((await graph)[ext].map(async (file) => [`ooxml/${file}`, await (await read(file)).text()])))
77
84
  const failed = JSON.stringify(t('files.failed', { name })).replace(/</g, '\\u003c')
78
85
  const at = JSON.stringify(cells?.at ?? null).replace(/</g, '\\u003c')
79
86
  const find = words && JSON.stringify(words.replace(/^#+ /gm, '').split('\n').map((line) => line.trim()).sort((a, b) => b.length - a.length)[0]).replace(/</g, '\\u003c')
80
87
  return /* html */ `<meta charset="utf-8"><style>html, body { block-size: 100%; margin: 0; background: #ececef; font: 0.9rem system-ui, sans-serif; } main { block-size: 100vh; } p { margin: 2rem; text-align: center; }</style>
81
- <script type="importmap">${JSON.stringify({ imports })}</script><main></main>
88
+ <script>document.head.append(Object.assign(document.createElement('script'), { type: 'importmap', textContent: JSON.stringify({ imports: Object.fromEntries(Object.entries(${JSON.stringify(modules).replace(/</g, '\\u003c')}).map(([name, text]) => [name, URL.createObjectURL(new Blob([text], { type: 'text/javascript' }))])) }) }))</script><main></main>
82
89
  <script type="module">
83
90
  import { ${VIEWERS[ext]} as Viewer } from 'ooxml/${ext}.mjs'
84
91
  const main = document.querySelector('main')
85
- const viewer = new Viewer(main, { wasmUrl: '${await data(`${ext}_parser_bg.wasm`, 'application/wasm')}', enableTextSelection: true, background: '#ececef' })
92
+ const viewer = new Viewer(main, { wasmUrl: 'data:application/wasm;base64,${encode(new Uint8Array(await (await read(`${ext}_parser_bg.wasm`)).arrayBuffer()))}', enableTextSelection: true, background: '#ececef' })
86
93
  viewer.load(Uint8Array.from(atob('${encode(bytes)}'), (char) => char.charCodeAt(0)).buffer)${find ? `
87
94
  .then(() => viewer.findText(${find}).then(() => viewer.findNext()).catch(() => {}))` : ''}${ext === 'xlsx' && cells ? `
88
95
  .then(async () => {
package/caps/files/pdf.js CHANGED
@@ -22,6 +22,9 @@ function pdfjs() {
22
22
  return library
23
23
  }
24
24
 
25
+ /** pdf.js's words of a page, laid over it to select (D690). */
26
+ export const textLayer = async () => (await pdfjs()).TextLayer
27
+
25
28
  /** A PDF, opened: its text is read here, its pages drawn where a file shows (ui/view.js, D126). @param {Uint8Array} bytes */
26
29
  export async function openPdf(bytes) {
27
30
  return (await pdfjs()).getDocument({
@@ -48,7 +48,7 @@
48
48
  Object.defineProperties(document, { hidden: { get: () => false }, visibilityState: { get: () => 'visible' } })
49
49
  }
50
50
  win.Date = class extends RealDate {
51
- constructor(/** @type {any[]} */ ...args) { if (args.length) super(.../** @type {[any]} */ (args)); else super(start + now) }
51
+ constructor(/** @type {unknown[]} */ ...args) { if (args.length) super(.../** @type {[string | number | Date]} */ (args)); else super(start + now) }
52
52
  static now() { return start + now }
53
53
  }
54
54
  performance.now = () => now
@@ -56,7 +56,7 @@
56
56
  const timers = /** @type {Map<number, { at: number, every?: number, fn: unknown, args: unknown[] }>} */ (new Map())
57
57
  win.requestAnimationFrame = (/** @type {Function} */ fn) => (frames.set(++ids, fn), ids)
58
58
  win.cancelAnimationFrame = (/** @type {number} */ id) => frames.delete(id)
59
- win.setTimeout = (/** @type {any} */ fn, ms = 0, /** @type {unknown[]} */ ...args) => (running ? (timers.set(++ids, { at: now + Math.max(0, Number(ms) || 0), fn, args }), ids) : real.later(fn, ms, ...args))
59
+ win.setTimeout = (/** @type {TimerHandler} */ fn, ms = 0, /** @type {unknown[]} */ ...args) => (running ? (timers.set(++ids, { at: now + Math.max(0, Number(ms) || 0), fn, args }), ids) : real.later(fn, ms, ...args))
60
60
  win.setInterval = (/** @type {unknown} */ fn, ms = 0, /** @type {unknown[]} */ ...args) => ((every) => (timers.set(++ids, { at: now + every, every, fn, args }), ids))(Math.max(1, Number(ms) || 0))
61
61
  win.clearTimeout = win.clearInterval = (/** @type {number} */ id) => (id > 1e6 ? timers.delete(id) : real.clear(id))
62
62
  const step = (/** @type {number} */ ms) => {
@@ -12,14 +12,11 @@ import { icon, icons } from '../../ui/menu-icons.js'
12
12
  import { t } from '../../core/i18n.js'
13
13
  import { ask, page } from '../../ui/creations.js'
14
14
  import { held } from '../../ui/held.js'
15
- import { capability, page as drawn } from './interactive.js'
15
+ import { capability, named, page as drawn } from './interactive.js'
16
16
  import { frozen } from './parts.js'
17
17
 
18
18
  /** Four tiles, the last turned on its corner: what is made to be used. */
19
19
  const GLYPH = icon(svg`<rect x="4" y="4" width="6.5" height="6.5" rx="1.5"/><rect x="4" y="13.5" width="6.5" height="6.5" rx="1.5"/><rect x="13.5" y="13.5" width="6.5" height="6.5" rx="1.5"/><g transform="rotate(45 16.75 7.25)"><rect x="14" y="4.5" width="5.5" height="5.5" rx="1.5"/></g>`, 'flip-rtl')
20
- /** What a page calls itself, as text: its title, else its first heading. @param {string} source */
21
- const named = (source) => ((/<title[^>]*>([^<]*)</i.exec(source) ?? /<h[12][^>]*>([\s\S]*?)<\/h[12]>/i.exec(source))?.[1] ?? '')
22
- .replace(/<[^>]*>/g, '').replaceAll('&amp;', '&').replace(/\s+/g, ' ').trim()
23
20
 
24
21
  const { kept, find, metaOf, pin, rename, hide } = held({ fence: 'html', record: 'app', at: 'app-', latest: true, named, extension: 'html', mimeType: 'text/html' })
25
22
  /** An app's page as the pane's Download gives it, what it shows of the project's collections written in (D633). @param {string} uri */
@@ -174,7 +174,7 @@ function tones(style) {
174
174
  let worker
175
175
  let count = 0
176
176
  const asked = /** @type {Map<number, { source: string, options: object, resolve: (drawn: Drawn) => void, reject: (error: Error) => void }>} */ (new Map())
177
- /** Pele beside the page. @type {Promise<any> | undefined} */
177
+ /** Pele beside the page. @type {Promise<typeof import('pele/lazy')> | undefined} */
178
178
  let here
179
179
 
180
180
  /** Mermaid as Pele draws it. @param {string} source @param {object} options @returns {Promise<Drawn>} */
@@ -11,7 +11,7 @@ app-page iframe { display: block; box-sizing: content-box; inline-size: 100%; bl
11
11
  (ui/style.css's --column), centred on it and never narrower than it, as Layouts' wide tables do (--shell, D215). */
12
12
  app-parts { position: relative; display: block; container-type: inline-size; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 0.9rem; margin-block: 0 0.85rem; } @media screen { main .prose > app-parts { --wide: max(100cqi, min(var(--shell) - 2.5rem, 64rem)); margin-inline: calc((100cqi - var(--wide)) / 2); } }
13
13
  app-parts .part-cards { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-end: 0.85rem; } app-parts .part-cards > * { flex: 1 1 15rem; } app-parts .part-card.wide { flex-basis: 100%; }
14
- app-parts .part-card { min-inline-size: 0; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6); } app-parts .part-card > :last-child { margin-block-end: 0; } app-parts .part-card > h4 { margin-block: 0 0.5rem; } app-parts .part-card > :is(app-chart, .diagram, app-page) { padding: 0; border: 0; }
14
+ app-parts .part-card { min-inline-size: 0; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6); } app-parts .part-card > :last-child { margin-block-end: 0; } app-parts .part-card > h4 { margin-block: 0 0.5rem; } app-parts :is(.parts, .part-card) > :is(app-chart, .diagram, app-page) { padding: 0; border: 0; }
15
15
  @container (min-width: 36rem) { app-parts .parts:has(> aside) { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; } }
16
16
  app-parts th .sorts { padding: 0; border: 0; background: none; font-weight: inherit; text-align: inherit; }
17
17
  app-parts .part-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0.6rem 0.75rem; margin-block-end: 0.85rem; } app-parts .part-form :is(.button, label:has(textarea)) { grid-column: 1 / -1; } app-parts .part-form .button { justify-self: start; }
@@ -39,3 +39,6 @@ app-page:has(> pre) { padding: 0; border: 0; }
39
39
  .mode-chip:hover .icon:last-child { color: var(--ink); }
40
40
  @media (forced-colors: active) { .mode-chip { border-color: Highlight; } }
41
41
  @media (width < 30rem) { .mode-chip span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); } }
42
+ /* An app played before the turn ends (D689): laid out as a page in an answer is, never seen. */
43
+ .page-test { position: fixed; inset-block-start: 0; inset-inline-start: 0; inline-size: 640px; block-size: 480px; clip-path: inset(50%); pointer-events: none; }
44
+ .page-test iframe { inline-size: 100%; block-size: 100%; border: 0; }
@@ -9,7 +9,8 @@
9
9
  // charts take the room's light or dark. It is as tall as what it shows, or, made to fill a screen
10
10
  // (its root or body as tall as its frame, 100% or 100vh), as tall as a page may be; it speaks to Jean on a click
11
11
  // of the user's only: `sendPrompt(text)` sends the text as the user's next message, as a follow-up
12
- // does, and a link opens in a new tab. With Run its code off, it is code. Copy puts its source on the
12
+ // does, a link opens in a new tab, and a link that saves a file the page made saves it (D158). What it keeps in localStorage
13
+ // is kept for it, by its name, in its task's file of apps (D688), so an app is still as it was left. With Run its code off, it is code. Copy puts its source on the
13
14
  // clipboard. Loaded with the first message, for its rule, then at each visit, so that pages written
14
15
  // before show again, or by the first page a conversation holds. Written again under a new policy,
15
16
  // which a page keeps from its start; a new theme, look or language is put on the page as it is
@@ -27,23 +28,37 @@ import { app, effective, theme, notify, send, updateSettings } from '../../ui/st
27
28
  import { register, drawnActions } from '../../ui/caps.js'
28
29
  import { declared, drawn, PAGES, blocks, lex } from '../../ui/markdown.js'
29
30
  import { pageRights, pagePolicy, pageAllow, mapStyles, PAGE_SANDBOX } from '../../ui/csp.js'
30
- import { copyDrawing } from '../../ui/save.js'
31
+ import { copyDrawing, savePage } from '../../ui/save.js'
31
32
  import { icons } from '../../ui/icons.js'
32
33
  import { styleSheet, still } from '../../ui/sheet.js'
33
34
  import { t, locale, dir, useStrings } from '../../core/i18n.js'
34
35
  import { row, chip, notes } from './mode.js'
35
36
  import { parse } from './parts.js'
37
+ /** @import { Settings } from '../../core/settings.js' */
38
+ /** What goes on to the next hook, and what came of it (core/hooks.js). @typedef {(e?: unknown) => Promise<unknown>} Next */
36
39
 
37
40
  await Promise.all([useStrings('interactive'), styleSheet(new URL('interactive.css', import.meta.url))])
38
41
 
39
42
  /** What it brings, to which ./apps.js adds the apps in the room. */
40
43
  export const capability = {
41
44
  id: 'interactive',
42
- rules: ["Bills, loans, recipes, timezones, quizzes, science: end with a working ```html tool, not code: offline, var(--color-*), import 'echarts', sendPrompt(text)."],
45
+ rules: ["Bills, loans, recipes, timezones, quizzes, science: end with a working ```html tool, not code: offline, var(--color-*), import 'echarts', sendPrompt(text); localStorage keeps, <a download> saves."],
43
46
  // Visual answers as a mode of the box (./mode.js, D300): a row of +, then pressed at the box's foot while it is on.
44
- slots: { add: { at: 6, draw: row }, modes: { at: 0, draw: chip, notes } },
47
+ slots: { add: { at: 3, draw: row }, modes: { at: 0, draw: chip, notes } },
48
+ // A task gone for good takes what its apps kept with it (D688).
49
+ hooks: [{ on: 'record', match: { type: 'removed' }, run: (/** @type {{ all: true, task: string } | { all?: false }} */ e, /** @type {Next} */ next) => { const at = e.all && keptAt(e.task); if (at) app.fs.remove(at).catch(() => {}); return next(e) } },
50
+ // A task duplicated (D230) keeps what its apps kept, as it keeps their answers (D688).
51
+ { on: 'task.start', run: async (/** @type {{ task: string, from?: { path: string } }} */ e, /** @type {Next} */ next) => { const [was, now] = [keptAt(e.from?.path ?? ''), keptAt(e.task)], kept = was && now && (await app.fs.read(was).catch(() => null)); if (kept && now) await app.fs.write(now, kept); return next(e) } },
52
+ // An answer's pages with a script, played out of sight before the turn ends; what broke goes back to the brain (./test.js, D689).
53
+ { on: 'turn.answer', run: async (/** @type {{ text: string, task?: string, signal?: AbortSignal }} */ e, /** @type {Next} */ next) => (rights.peek().allows.scripts && /```html/.test(e.text) && (await (await import('./test.js')).played(e))) || next(e) }],
45
54
  }
46
55
  register(capability)
56
+
57
+ /** What a page calls itself, as text: its title, else its first heading. @param {string} source */
58
+ export const named = (source) => ((/<title[^>]*>([^<]*)</i.exec(source) ?? /<h[12][^>]*>([\s\S]*?)<\/h[12]>/i.exec(source))?.[1] ?? '')
59
+ .replace(/<[^>]*>/g, '').replaceAll('&amp;', '&').replace(/\s+/g, ' ').trim()
60
+ /** Where a task's apps keep what they keep, each by its name: `apps/<its ULID>.json` beside its project's conversations (D688). @param {string} task */
61
+ export const keptAt = (task) => (/\/conversations\/[^/]+\.jsonl$/.test(task) ? task.replace(/conversations\/([^/]+)\.jsonl$/, 'apps/$1.json') : null)
47
62
  // A page, a diagram or a map needs no skill to declare it (D289, D291): they stay among the kinds drawn, however often the room's skills are read again.
48
63
  effect(() => { if (PAGES.some((kind) => !declared.value.has(kind))) declared.value = new Set([...declared.value, ...PAGES]) })
49
64
 
@@ -77,7 +92,7 @@ const ALIASES = Object.entries({
77
92
  * @type {Promise<{ text: string, url: string }> | undefined}
78
93
  */
79
94
  let echarts
80
- const library = () => (echarts ??= fetch(new URL('../../vendor/echarts/echarts.mjs', import.meta.url)).then((response) => response.text()).then((text) => {
95
+ export const library = () => (echarts ??= fetch(new URL('../../vendor/echarts/echarts.mjs', import.meta.url)).then((response) => response.text()).then((text) => {
81
96
  const names = (/export\s*\{([^}]*)\}\s*;?\s*$/.exec(text)?.[1] ?? '').split(',').map((name) => name.trim().split(/\s+as\s+/).pop()).filter((name) => /^\w+$/.test(String(name)) && name !== 'init')
82
97
  const stand = `const text = await new Promise((resolve) => { addEventListener('message', function got({ data, source }) { if (source === parent && typeof data?.echarts === 'string') removeEventListener('message', got), resolve(data.echarts) }); parent.postMessage({ need: 'echarts' }, '*') })
83
98
  const m = await import(URL.createObjectURL(new Blob([text], { type: 'text/javascript' })))
@@ -111,11 +126,11 @@ export default { ...m, init }`
111
126
  /** What a page is lent when it holds one, each read once: Jean's diagrams and maps, and MapLibre for the maps. @type {Map<string, Promise<string>>} */
112
127
  const parts = new Map()
113
128
  /** @param {string} path */
114
- const part = (path) => parts.get(path) ?? /** @type {Promise<string>} */ (parts.set(path, fetch(new URL(path, import.meta.url)).then((response) => response.text())).get(path))
115
- const LENT = /** @type {Record<string, string>} */ ({ diagram: './page-diagram.js', map: './map.js' })
129
+ export const part = (path) => parts.get(path) ?? /** @type {Promise<string>} */ (parts.set(path, fetch(new URL(path, import.meta.url)).then((response) => response.text())).get(path))
130
+ export const LENT = /** @type {Record<string, string>} */ ({ diagram: './page-diagram.js', map: './map.js' })
116
131
 
117
132
  /** The map service's styles, light and dark, and the addresses that may be fetched for a map: theirs. */
118
- const styles = () => mapStyles(/** @type {any} */ (effective.peek().settings), app.policy)
133
+ const styles = () => mapStyles(effective.peek().settings, app.policy)
119
134
  const mapSites = () => Object.values(styles()).map((address) => new URL(address).origin)
120
135
 
121
136
  // Each component a page holds is asked for as it appears, and lent then; the rest isn't.
@@ -147,7 +162,7 @@ function room(style) {
147
162
  * its <main> and <aside> side by side on a wide screen.
148
163
  * @param {CSSStyleDeclaration} style @param {string} charts the address of ECharts' stand-in
149
164
  */
150
- function head(style, charts) {
165
+ export function head(style, charts) {
151
166
  const { lang, dir, theme, look, motion, css } = room(style)
152
167
  return /* html */ `<html lang="${lang}" dir="${dir}" data-theme="${theme}" data-look="${look}" data-motion="${motion}"><script type="importmap">${JSON.stringify({ imports: { echarts: charts } })}</script>${LOADER}<style>${css}</style>${ROOM}<style>
153
168
  :root { --border-radius-md: calc(var(--border-radius-lg) / 2) !important; accent-color: var(--color-ring-primary); }
@@ -177,6 +192,10 @@ class AppPage extends HTMLElement {
177
192
  whole = false
178
193
  /** @type {(() => void) | undefined} */
179
194
  unwatch
195
+ /** Where what it keeps is kept, and its name there; none in a saved copy, which holds no project. @type {[string, string] | null} */
196
+ kept = null
197
+ /** @type {ReturnType<typeof setTimeout> | undefined} */
198
+ keeping
180
199
 
181
200
  connectedCallback() {
182
201
  addEventListener('message', this.heard)
@@ -241,7 +260,10 @@ class AppPage extends HTMLElement {
241
260
  const { url } = await library()
242
261
  const now = this.text()
243
262
  const open = this.hasAttribute('open')
244
- frame.contentWindow?.postMessage({ page: head(getComputedStyle(this), url) + now, policy, open }, '*')
263
+ const at = RELAY === null && app.projectDir && !this.hasAttribute('map') ? keptAt(this.getAttribute('task')?.replace(/#.*/, '') || app.current.peek()?.path || '') : null
264
+ this.kept = at ? [at, named(now)] : null
265
+ const storage = at ? JSON.parse((await app.fs.read(at).catch(() => null)) ?? '{}').apps?.[named(now)] ?? {} : {}
266
+ frame.contentWindow?.postMessage({ page: head(getComputedStyle(this), url) + now, policy, open, storage }, '*')
245
267
  this.written = now
246
268
  this.whole = !open
247
269
  } }
@@ -290,12 +312,29 @@ class AppPage extends HTMLElement {
290
312
  else if (typeof data?.diagram === 'string') void import('./diagram.js').then(({ picture }) => picture(data.diagram, this, Number(data.width) || this.clientWidth)).then(({ url, words }) => answer({ picture: url, words }), () => answer({}))
291
313
  else if (data?.need === 'maplibre') void this.maps().then(answer)
292
314
  else if (typeof data?.fetch === 'string') void this.fetched(data.fetch).then(({ bytes, error }) => answer({ bytes, error }, bytes ? [bytes.buffer] : []))
315
+ else if (data?.storage && typeof data.storage === 'object') this.keep(data.storage)
316
+ else if (data?.save instanceof Blob) savePage(data, rights.peek().allows.downloads)
293
317
  else if (navigator.userActivation?.isActive === false) return
294
318
  else if (data?.allow === 'maps') void this.allow().then((allowed) => answer({ allowed }))
295
319
  else if (typeof data?.prompt === 'string' && data.prompt.trim() && !app.busy.peek()) send(data.prompt.trim().slice(0, 2000))
296
320
  else if (typeof data?.open === 'string' && /^https:\/\//i.test(data.open)) window.open(data.open, '_blank', 'noopener')
297
321
  }
298
322
 
323
+ /**
324
+ * What it keeps in localStorage, kept a moment after its last change, beside what its task's other apps keep;
325
+ * past 256 KB, nothing more is kept. @param {object} storage
326
+ */
327
+ keep(storage) {
328
+ const kept = this.kept
329
+ clearTimeout(this.keeping)
330
+ if (kept) this.keeping = setTimeout(async () => {
331
+ const own = Object.fromEntries(Object.entries(storage).map(([key, value]) => [String(key), String(value)]))
332
+ if (JSON.stringify(own).length > 262144) return
333
+ const all = JSON.parse((await app.fs.read(kept[0]).catch(() => null)) ?? '{}')
334
+ await app.fs.write(kept[0], JSON.stringify({ format: 1, apps: { ...all.apps, [kept[1]]: own } }))
335
+ }, 300)
336
+ }
337
+
299
338
  /** MapLibre, its worker and its style sheet, the styles for light and dark, and whether maps are allowed; the words its card asks with. */
300
339
  async maps() {
301
340
  const [library, worker, css] = await Promise.all(['maplibre-gl.mjs', 'maplibre-gl-worker.js', 'maplibre-gl.css'].map((file) => part(`../../vendor/maplibre/${file}`)))
@@ -307,7 +346,7 @@ class AppPage extends HTMLElement {
307
346
  /** Maps allowed, from now on, unless the organisation says otherwise. */
308
347
  async allow() {
309
348
  const { allows, locked } = rights.peek()
310
- if (!allows.maps && !locked.has('maps')) await updateSettings({ pages: /** @type {any} */ ({ ...app.settings.peek().pages, maps: true }) })
349
+ if (!allows.maps && !locked.has('maps')) await updateSettings({ pages: { ...app.settings.peek().pages, maps: true } })
311
350
  return rights.peek().allows.maps
312
351
  }
313
352
 
@@ -9,7 +9,7 @@ import { compile } from '../tables/formula.js'
9
9
  import { all, form, lines, number, split, table } from './parts.js'
10
10
 
11
11
  /** @import { Part } from './parts.js' */
12
- /** What a form's fields, what they work out and a table's sums hold, by their names. @typedef {Record<string, any>} Cells */
12
+ /** What a form's fields, what they work out and a table's sums hold, by their names. @typedef {Record<string, unknown>} Cells */
13
13
 
14
14
  const FORMULA = /\{([^{}]+)\}/g, HOLDS = /\{[^{}]+\}/, LIST = /\s*[,،、]\s*/
15
15
  /** The parts whose lines may hold a formula: a diagram's braces are its own. */
@@ -41,7 +41,7 @@ export function shared(parts, { given, added, lang, locales }) {
41
41
  const reader = (/** @type {string} */ text) => { try { return compile(text.replace(/[{}]/g, ''), columns) } catch { return () => NaN } }
42
42
  /** What a formula comes to; NaN where it can't be read or worked out. @param {string} text @param {Cells} cells */
43
43
  const value = (text, cells) => /** @type {(cells: Cells) => any} */ (readers.get(text) ?? readers.set(text, reader(text)).get(text))(cells)
44
- /** A result in the page's words. @param {any} got @param {string} [digits] @param {boolean} [bare] with no marks between thousands */
44
+ /** A result in the page's words. @param {unknown} got @param {string} [digits] @param {boolean} [bare] with no marks between thousands */
45
45
  const said = (got, digits, bare) => (typeof got === 'boolean' ? (got ? '✓' : '') : typeof got !== 'number' ? String(got) : !Number.isFinite(got) ? '—' : /** @type {Intl.NumberFormat} */ (formats.get(`${digits}${bare}`)
46
46
  ?? formats.set(`${digits}${bare}`, new Intl.NumberFormat(locales, { maximumFractionDigits: digits ? Number(digits) : 2, minimumFractionDigits: digits ? Number(digits) : 0, useGrouping: !bare, signDisplay: 'negative' })).get(`${digits}${bare}`)).format(got))
47
47
  /** A line with each formula worked out, an `each`'s own name as it is written. @param {string} line @param {Cells} cells @param {string} [name] */
@@ -50,7 +50,7 @@ export function shared(parts, { given, added, lang, locales }) {
50
50
  : /^(number|range)$/.test(kind) ? (raw === '' ? NaN : number(raw, lang, true)) : read(raw)])(given.get(label) ?? (start || choices?.[0] || '')))))
51
51
  /** The fields, the tables' sums, and each value worked out, as often as there are values, so that one written before what it reads sees it. @param {Cells} [extra] */
52
52
  const work = (extra) => { const cells = { ...base, ...extra }; for (const _ of worked) for (const [name, text] of worked) cells[name] = value(text, cells); return cells }
53
- /** The name an `each` gives, and the values it goes over: `from..to..step`, or a list. @param {string} each @returns {[string, any[]]} */
53
+ /** The name an `each` gives, and the values it goes over: `from..to..step`, or a list. @param {string} each @returns {[string, unknown[]]} */
54
54
  const steps = (each) => {
55
55
  const [name, over] = split(each, '='), cells = work(), [from, to, by = 1] = over.split('..').map((text) => value(text, cells))
56
56
  return [name, !over.includes('..') ? over.split(LIST).map(read) : by > 0 ? Array.from({ length: Math.min(MOST, Math.max(0, Math.floor((to - from) / by + 1e-9) + 1 || 0)) }, (_, i) => from + i * by) : []]
@@ -87,7 +87,7 @@ export function shared(parts, { given, added, lang, locales }) {
87
87
  if (drawn) return { ...part, text: [drawn.heads, ...drawn.rows].map((row) => row.join(' | ')).join('\n') }
88
88
  if (!live) return part
89
89
  if (part.tag === 'app-card') return { ...part, attrs: { ...part.attrs, heading: spell(part.attrs.heading ?? '', cells) } }
90
- if (part.tag === 'app-chart') return { ...part, text: from ? tally(part, /** @type {any} */ (shown.get(from))) : lines(part).map((line, i) => (i ? spelled(line, (text, digits) => plain(value(text, cells), digits)) : spell(line, cells))).join('\n') }
90
+ if (part.tag === 'app-chart') return { ...part, text: from ? tally(part, /** @type {ReturnType<typeof tabled>} */ (shown.get(from))) : lines(part).map((line, i) => (i ? spelled(line, (text, digits) => plain(value(text, cells), digits)) : spell(line, cells))).join('\n') }
91
91
  return SPELLED.includes(part.tag) ? { ...part, text: spell(part.text, cells) } : part
92
92
  }
93
93
  const now = () => [...fields.map(({ label }) => [label, base[label]]), ...worked.map(([name]) => [name, cells[name]])].map(([name, held]) => [name, typeof held === 'number' ? plain(held) : held]).filter(([, held]) => held !== '').map(([name, held]) => `${name}: ${held}`)
@@ -22,7 +22,13 @@ const routed = (url) => url.replace(/^(https?):\/\//, 'jean://$1/')
22
22
  /** @param {string} url */
23
23
  const direct = (url) => url.replace(/^jean:\/\/(https?)\//, '$1://')
24
24
 
25
- /** MapLibre, made ready once: its worker classic, and every address it reaches fetched by Jean. @type {Promise<any> | undefined} */
25
+ /**
26
+ * What Jean lends a map (interactive.js): MapLibre and its worker as text, its style sheet, the map service's styles for light and dark,
27
+ * whether maps are allowed, and the words it says; with MapLibre made ready.
28
+ * @typedef {{ library: string, worker: string, css: string, styles: Record<'light' | 'dark', string>, allowed: boolean, strings: Record<string, string>, maplibregl: typeof import('maplibre-gl') }} Lent
29
+ */
30
+ /** A place its fold names, and what it says of itself. @typedef {{ name: unknown, about: unknown }} Named */
31
+ /** MapLibre, made ready once: its worker classic, and every address it reaches fetched by Jean. @type {Promise<Lent> | undefined} */
26
32
  let lent
27
33
  const lend = () => (lent ??= ask({ need: 'maplibre' }).then(async (given) => {
28
34
  const maplibregl = await import(URL.createObjectURL(new Blob([given.library], { type: 'text/javascript' })))
@@ -55,7 +61,7 @@ function rgba(colour) {
55
61
  /** Features of a kind, one or many (MultiPoint is points too). @param {string} type */
56
62
  const kind = (type) => ['in', ['geometry-type'], ['literal', [type, `Multi${type}`]]]
57
63
 
58
- /** Every position in some GeoJSON. @param {any} value @returns {number[][]} */
64
+ /** Every position in some GeoJSON. @param {unknown} value @returns {number[][]} */
59
65
  const positions = (value) => (Array.isArray(value) && typeof value[0] === 'number' ? [value] : Array.isArray(value) ? value.flatMap(positions)
60
66
  : value && typeof value === 'object' ? Object.entries(value).flatMap(([key, inner]) => (key === 'properties' ? [] : positions(inner))) : [])
61
67
 
@@ -132,12 +138,12 @@ class AppMap extends HTMLElement {
132
138
  tell() {
133
139
  const data = this.data, strings = this.given?.strings
134
140
  if (!data || !strings) return
135
- const named = (data.features ?? [data]).map((/** @type {any} */ one) => ({ name: one?.properties?.name ?? one?.properties?.title ?? positions(one)[0]?.toReversed().join(', '), about: one?.properties?.description })).filter((/** @type {any} */ { name }) => name)
141
+ const named = (data.features ?? [data]).map((/** @type {{ properties?: Record<string, unknown> | null }} */ one) => ({ name: one?.properties?.name ?? one?.properties?.title ?? positions(one)[0]?.toReversed().join(', '), about: one?.properties?.description })).filter((/** @type {Named} */ { name }) => name)
136
142
  const list = this.words.querySelector('ul') ?? this.words.appendChild(document.createElement('ul'))
137
- list.replaceChildren(...named.map((/** @type {any} */ { name, about }) => Object.assign(document.createElement('li'), { dir: 'auto', textContent: about ? `${name}: ${about}` : name })))
143
+ list.replaceChildren(...named.map((/** @type {Named} */ { name, about }) => Object.assign(document.createElement('li'), { dir: 'auto', textContent: about ? `${name}: ${about}` : name })))
138
144
  this.words.hidden = !named.length
139
145
  if (!this.words.querySelector('summary')) this.words.prepend(Object.assign(document.createElement('summary'), { textContent: strings.words }))
140
- this.map?.getCanvas().setAttribute('aria-label', named.length ? strings.named.replace('{places}', new Intl.ListFormat(document.documentElement.lang || undefined).format(named.map((/** @type {any} */ { name }) => String(name)))) : strings.map)
146
+ this.map?.getCanvas().setAttribute('aria-label', named.length ? strings.named.replace('{places}', new Intl.ListFormat(document.documentElement.lang || undefined).format(named.map((/** @type {Named} */ { name }) => String(name)))) : strings.map)
141
147
  }
142
148
 
143
149
  /** The map service's style for the page's light or dark. */
@@ -0,0 +1,15 @@
1
+ // What visual answers draw (D291, D631), each as a start drawn at once that a document's "/" offers (D485): a page, the charts a page
2
+ // draws, diagrams, a map, a timeline and key figures. Each has its name's key among a document's strings, a glyph, a few English words
3
+ // to find it by as well as its name, and its Markdown, as an answer writes it. Pure, so a document reads it without the rest of this capability.
4
+
5
+ /** @type {{ key: string, glyph: string, words: string, markdown: string }[]} */
6
+ export const STARTS = [
7
+ { key: 'page', glyph: '</>', words: 'page html app web interactive', markdown: '```html\n```' },
8
+ ...Object.entries({ bar: ['▃▇', 'column histogram'], line: ['∿', 'trend curve'], area: ['◢', 'filled'], pie: ['◔', 'donut doughnut share'], hbar: ['☰', 'horizontal across ranking'] }).map(([kind, [glyph, more]]) => ({ key: `${kind}Chart`, glyph, words: `chart graph plot ${kind} ${more}`, markdown: `\`\`\`html\n<app-chart kind="${kind}">\nA | B | C | D\n1: 3, 5, 2, 6\n</app-chart>\n\`\`\`` })),
9
+ { key: 'flowchart', glyph: '◇', words: 'diagram flowchart graph process decision mermaid', markdown: '```mermaid\nflowchart LR\n A --> B\n```' },
10
+ { key: 'mindMap', glyph: '⊛', words: 'diagram mind map ideas brainstorm mermaid', markdown: '```mermaid\nmindmap\n root((A))\n B\n C\n D\n```' },
11
+ { key: 'sequence', glyph: '⇄', words: 'diagram sequence messages exchange mermaid', markdown: '```mermaid\nsequenceDiagram\n A->>B: 1\n B-->>A: 2\n```' },
12
+ { key: 'map', glyph: '⌖', words: 'map places geojson', markdown: '```geojson\n{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[2.35,48.86]},"properties":{}}]}\n```' },
13
+ { key: 'timeline', glyph: '◷', words: 'timeline schedule agenda dates history', markdown: '- **09:00** A\n- **10:30** B\n- **12:00** C' },
14
+ { key: 'figures', glyph: '#', words: 'key figures numbers metrics stats kpi', markdown: '- **3** A\n- **85%** B\n- **12** C' },
15
+ ]
@@ -0,0 +1,76 @@
1
+ // Apps played before the turn ends (D689): each page with a script that a step of an answer wrote is played out of sight, as
2
+ // Games plays a game (D648), in a frame of its kind (preview.html), given what it kept: what goes wrong is caught as it starts,
3
+ // then as each of its controls is used once, its buttons pressed and its fields changed; nothing it sends or saves goes anywhere.
4
+ // What broke, in the browser's words, goes back to the brain, which writes it again (turn.answer, core/loop.js).
5
+ import { app } from '../../ui/state.js'
6
+ import { pagePolicy, pageRights, PAGE_SANDBOX } from '../../ui/csp.js'
7
+ import { lex } from '../../ui/markdown.js'
8
+ import { head, library, part, LENT, named, keptAt } from './interactive.js'
9
+ import { parse } from './parts.js'
10
+
11
+ /** How long a page has to start, before its controls are used, and in all. */
12
+ const [START, ALL] = [800, 6000]
13
+ /** The notes each turn may give, so that a page the brain can't mend doesn't take all its steps. @type {WeakMap<AbortSignal, number>} */
14
+ const told = new WeakMap()
15
+
16
+ /**
17
+ * What catches what goes wrong, ahead of the page, and uses its controls when told (its buttons pressed, its fields but a file's
18
+ * changed): errors and failures left unhandled, each said once, in the browser's words. Its listeners' errors are caught as they
19
+ * run, as WebKit tells the page no more than "Script error." of what a written script throws. What its policy blocks isn't a
20
+ * fault: a fetch the page catches works offline, and WebKit's policy refuses every <select>'s style.
21
+ */
22
+ const PROBE = /* html */ `<script>{const faults=[],fault=(words)=>{words=String(words);if(!faults.includes(words))faults.push(words)},add=EventTarget.prototype.addEventListener,remove=EventTarget.prototype.removeEventListener,own=new WeakMap()
23
+ EventTarget.prototype.addEventListener=function(type,run,...rest){if(typeof run==='function'&&!own.has(run))own.set(run,function(...args){try{return run.apply(this,args)}catch(e){fault(e?.message??e)}});return add.call(this,type,own.get(run)??run,...rest)}
24
+ EventTarget.prototype.removeEventListener=function(type,run,...rest){return remove.call(this,type,own.get(run)??run,...rest)}
25
+ add.call(window,'error',(e)=>fault(e.message))
26
+ add.call(window,'unhandledrejection',(e)=>fault('Unhandled: '+(e.reason?.message??e.reason)))
27
+ for(const name of['alert','confirm','prompt'])globalThis[name]=()=>fault(name+'() is never shown')
28
+ add.call(window,'message',({data,source})=>{if(source!==parent||!data?.play)return
29
+ for(const one of document.querySelectorAll('button,input:not([type=file]),select,textarea'))one.matches('button')?one.click():(one.dispatchEvent(new Event('input',{bubbles:true})),one.dispatchEvent(new Event('change',{bubbles:true})))
30
+ setTimeout(()=>parent.postMessage({faults},'*'),400)})}</script>`
31
+
32
+ /**
33
+ * One page played: what went wrong, each once; nothing when it played clean or didn't answer in time.
34
+ * @param {string} source @param {Record<string, string>} storage what it kept @param {AbortSignal} [signal] @returns {Promise<string[]>}
35
+ */
36
+ function play(source, storage, signal) {
37
+ const { allows, sites } = pageRights(app.settings.peek(), app.policy)
38
+ const box = Object.assign(document.createElement('div'), { className: 'page-test', inert: true }), frame = Object.assign(document.createElement('iframe'), { src: new URL('../../preview.html', import.meta.url).href })
39
+ frame.setAttribute('sandbox', PAGE_SANDBOX)
40
+ box.setAttribute('aria-hidden', 'true')
41
+ return new Promise((resolve) => {
42
+ const done = (/** @type {string[]} */ faults) => { clearTimeout(timer); removeEventListener('message', heard); box.remove(); resolve(faults) }
43
+ const heard = (/** @type {MessageEvent} */ { source: from, data }) => {
44
+ if (from !== frame.contentWindow) return
45
+ const answer = (/** @type {object} */ reply) => frame.contentWindow?.postMessage({ ...reply, id: data.id }, '*')
46
+ if (Array.isArray(data?.faults)) done(data.faults.map(String))
47
+ else if (data?.need === 'echarts') void library().then(({ text }) => frame.contentWindow?.postMessage({ echarts: text }, '*'))
48
+ else if (Object.hasOwn(LENT, data?.need)) void part(LENT[data.need]).then((text) => answer({ text }))
49
+ else if (typeof data?.diagram === 'string') answer({})
50
+ }
51
+ const timer = setTimeout(() => done([]), ALL)
52
+ signal?.addEventListener('abort', () => done([]), { once: true })
53
+ addEventListener('message', heard)
54
+ frame.addEventListener('load', async () => {
55
+ const { url } = await library(), ahead = head(getComputedStyle(document.documentElement), url)
56
+ frame.contentWindow?.postMessage({ page: PROBE + ahead + source, policy: pagePolicy(allows, sites, true), storage }, '*')
57
+ setTimeout(() => frame.contentWindow?.postMessage({ play: true }, '*'), START)
58
+ }, { once: true })
59
+ box.append(frame)
60
+ document.body.append(box)
61
+ })
62
+ }
63
+
64
+ /**
65
+ * What the brain is told of the pages with a script its answer just wrote, played; nothing when they all played clean.
66
+ * @param {{ text: string, task?: string, signal?: AbortSignal }} e @returns {Promise<string>}
67
+ */
68
+ export async function played({ text, task = '', signal }) {
69
+ const pages = lex(text).flatMap((token) => (token.type === 'code' && token.lang === 'html' && /<script\b/i.test(token.text) && !parse(token.text) ? [token.text] : []))
70
+ if (!pages.length || !signal || (told.get(signal) ?? 0) >= 2) return ''
71
+ const at = keptAt(task), kept = at ? JSON.parse((await app.fs.read(at).catch(() => null)) ?? '{}').apps ?? {} : {}
72
+ const broke = (await Promise.all(pages.map(async (source) => ({ name: named(source), faults: await play(source, kept[named(source)] ?? {}, signal) })))).filter(({ faults }) => faults.length)
73
+ if (!broke.length) return ''
74
+ told.set(signal, (told.get(signal) ?? 0) + 1)
75
+ return `Played out of sight, ${broke.length > 1 ? 'pages you wrote' : 'the page you wrote'} broke:\n${broke.map(({ name, faults }) => `${name ? `${name}:\n` : ''}${faults.map((fault) => `- ${fault}`).join('\n')}`).join('\n')}\nWrite it again whole, fixed, after a sentence saying what you fixed.`
76
+ }
@@ -22,7 +22,10 @@ import { parse, all, bound, key, frozen, figures, table, chart, form, number, ch
22
22
  import { shared } from './live.js'
23
23
 
24
24
  /** @import { Part } from './parts.js' */
25
- /** A part as it is drawn: one that shows a collection with its lines filled, the collection followed, and a form's columns; or the name of one not here, or of one its `where` can't filter. @typedef {Part & { live?: any, columns?: any[], missing?: string, unread?: string }} Shown */
25
+ /** @import { Signal } from '@preact/signals-core' */
26
+ /** @import { Loaded } from '../tables/tables.js' */
27
+ /** @import { Property } from '../tables/table.js' */
28
+ /** A part as it is drawn: one that shows a collection with its lines filled, the collection followed, and a form's columns; or the name of one not here, or of one its `where` can't filter. @typedef {Part & { live?: Signal<Loaded | null>, columns?: Property[], missing?: string, unread?: string }} Shown */
26
29
 
27
30
  /** A chart's option for ECharts: bars, lines, areas, bars across or a pie, by its labels and series. @param {ReturnType<typeof chart>} drawing */
28
31
  function option({ kind, labels, series }) {
@@ -65,7 +68,7 @@ customElements.define('app-parts', class extends HTMLElement {
65
68
  given = new Map()
66
69
  /** How each of its tables is sorted, by its place among them: by which column, and whether down. @type {Map<number, { column: number, down: boolean }>} */
67
70
  sorted = new Map()
68
- /** The collections its parts name, by name: followed, a signal; being read, null; out of its reach, false. @type {Map<string, any>} */
71
+ /** The collections its parts name, by name: followed, a signal; being read, null; out of its reach, false. @type {Map<string, Signal<Loaded | null> | null | false>} */
69
72
  followed = new Map()
70
73
  /** What lets them go with it. @type {(() => void)[]} */
71
74
  holds = []