@celljs/ta-web 4.28.0 → 4.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-thread.js +15 -2
  4. package/esm/browser/assistant/call-scenes.d.ts +5 -4
  5. package/esm/browser/assistant/call-scenes.js +10 -7
  6. package/esm/browser/chat/chat-protocol.d.ts +2 -0
  7. package/esm/browser/chat/chat-shown.d.ts +3 -1
  8. package/esm/browser/chat/chat-shown.js +25 -3
  9. package/esm/browser/chat/chat-view.js +1 -1
  10. package/esm/browser/chat/chat.d.ts +5 -1
  11. package/esm/browser/chat/chat.js +32 -16
  12. package/esm/browser/components/account-menu.d.ts +6 -16
  13. package/esm/browser/components/account-menu.js +47 -101
  14. package/esm/browser/components/app-contexts.js +7 -4
  15. package/esm/browser/components/app-nav.js +4 -4
  16. package/esm/browser/components/chat-list-row.js +7 -2
  17. package/esm/browser/components/chat-tag.d.ts +20 -0
  18. package/esm/browser/components/chat-tag.js +103 -0
  19. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  20. package/esm/browser/components/composer-box-protocol.d.ts +2 -0
  21. package/esm/browser/components/composer-box.js +20 -1
  22. package/esm/browser/components/composer-emoji.d.ts +22 -0
  23. package/esm/browser/components/composer-emoji.js +50 -0
  24. package/esm/browser/components/custom-host.js +1 -1
  25. package/esm/browser/components/discover-view.d.ts +4 -3
  26. package/esm/browser/components/discover-view.js +5 -4
  27. package/esm/browser/components/editor-area.js +1 -1
  28. package/esm/browser/components/emoji-panel.d.ts +22 -0
  29. package/esm/browser/components/emoji-panel.js +54 -0
  30. package/esm/browser/components/host-view.d.ts +1 -1
  31. package/esm/browser/components/launcher-surface.js +1 -1
  32. package/esm/browser/components/markdown.d.ts +6 -1
  33. package/esm/browser/components/markdown.js +6 -2
  34. package/esm/browser/components/me-rows.d.ts +24 -0
  35. package/esm/browser/components/me-rows.js +19 -0
  36. package/esm/browser/components/me-view.d.ts +2 -1
  37. package/esm/browser/components/me-view.js +3 -2
  38. package/esm/browser/components/message-list.js +47 -7
  39. package/esm/browser/components/message-steps.js +13 -0
  40. package/esm/browser/components/nav-places.js +1 -1
  41. package/esm/browser/components/session-view.js +6 -1
  42. package/esm/browser/components/settings-choices.js +3 -0
  43. package/esm/browser/components/settings-controls.d.ts +13 -0
  44. package/esm/browser/components/settings-controls.js +19 -0
  45. package/esm/browser/components/settings-more.d.ts +1 -1
  46. package/esm/browser/components/settings-more.js +28 -39
  47. package/esm/browser/components/settings-parts.d.ts +4 -2
  48. package/esm/browser/components/settings-parts.js +14 -9
  49. package/esm/browser/components/settings-view.js +2 -6
  50. package/esm/browser/components/web-composer.d.ts +1 -1
  51. package/esm/browser/components/web-composer.js +2 -2
  52. package/esm/browser/device/file-save.d.ts +31 -0
  53. package/esm/browser/device/file-save.js +80 -0
  54. package/esm/browser/extension/extension-view.d.ts +9 -0
  55. package/esm/browser/extension/extension-view.js +7 -0
  56. package/esm/browser/extension/icons.js +2 -1
  57. package/esm/browser/extension/web-api-call.d.ts +45 -0
  58. package/esm/browser/extension/web-api-chats.d.ts +29 -0
  59. package/esm/browser/extension/web-api-components.d.ts +4 -0
  60. package/esm/browser/extension/web-api-contributions.d.ts +13 -14
  61. package/esm/browser/extension/web-api-desktop.d.ts +16 -1
  62. package/esm/browser/extension/web-api-desktop.js +1 -0
  63. package/esm/browser/extension/web-extension-api.d.ts +9 -12
  64. package/esm/browser/extension/web-extension-code.d.ts +15 -8
  65. package/esm/browser/extension/web-extension-code.js +25 -27
  66. package/esm/browser/extension/web-extension-context.js +4 -0
  67. package/esm/browser/extension/web-extension-protocol.d.ts +15 -1
  68. package/esm/browser/extension/web-extension-protocol.js +2 -0
  69. package/esm/browser/extension/web-extension-run.d.ts +4 -2
  70. package/esm/browser/extension/web-extension-run.js +10 -4
  71. package/esm/browser/extension/web-extensions-running.d.ts +3 -0
  72. package/esm/browser/extension/web-extensions-running.js +20 -7
  73. package/esm/browser/extension/web-extensions.js +5 -1
  74. package/esm/browser/extension/web-metrics.d.ts +32 -0
  75. package/esm/browser/extension/web-metrics.js +98 -0
  76. package/esm/browser/extension/web-pages.d.ts +2 -0
  77. package/esm/browser/extension/web-pages.js +2 -0
  78. package/esm/browser/i18n/en/account.d.ts +202 -0
  79. package/esm/browser/i18n/en/account.js +205 -0
  80. package/esm/browser/i18n/en/assistant.d.ts +129 -0
  81. package/esm/browser/i18n/en/assistant.js +130 -0
  82. package/esm/browser/i18n/en/call.d.ts +86 -0
  83. package/esm/browser/i18n/en/call.js +87 -0
  84. package/esm/browser/i18n/en/chat.d.ts +213 -0
  85. package/esm/browser/i18n/en/chat.js +214 -0
  86. package/esm/browser/i18n/en/common.d.ts +99 -0
  87. package/esm/browser/i18n/en/common.js +101 -0
  88. package/esm/browser/i18n/en/console.d.ts +230 -0
  89. package/esm/browser/i18n/en/console.js +232 -0
  90. package/esm/browser/i18n/en/discover.d.ts +117 -0
  91. package/esm/browser/i18n/en/discover.js +119 -0
  92. package/esm/browser/i18n/en/service.d.ts +242 -0
  93. package/esm/browser/i18n/en/service.js +245 -0
  94. package/esm/browser/i18n/en/settings.d.ts +213 -0
  95. package/esm/browser/i18n/en/settings.js +214 -0
  96. package/esm/browser/i18n/en/tools.d.ts +85 -0
  97. package/esm/browser/i18n/en/tools.js +87 -0
  98. package/esm/browser/i18n/ja/account.d.ts +2 -0
  99. package/esm/browser/i18n/ja/account.js +202 -0
  100. package/esm/browser/i18n/ja/assistant.d.ts +2 -0
  101. package/esm/browser/i18n/ja/assistant.js +129 -0
  102. package/esm/browser/i18n/ja/call.d.ts +2 -0
  103. package/esm/browser/i18n/ja/call.js +86 -0
  104. package/esm/browser/i18n/ja/chat.d.ts +2 -0
  105. package/esm/browser/i18n/ja/chat.js +213 -0
  106. package/esm/browser/i18n/ja/common.d.ts +2 -0
  107. package/esm/browser/i18n/ja/common.js +99 -0
  108. package/esm/browser/i18n/ja/console.d.ts +2 -0
  109. package/esm/browser/i18n/ja/console.js +230 -0
  110. package/esm/browser/i18n/ja/discover.d.ts +2 -0
  111. package/esm/browser/i18n/ja/discover.js +117 -0
  112. package/esm/browser/i18n/ja/service.d.ts +2 -0
  113. package/esm/browser/i18n/ja/service.js +242 -0
  114. package/esm/browser/i18n/ja/settings.d.ts +2 -0
  115. package/esm/browser/i18n/ja/settings.js +213 -0
  116. package/esm/browser/i18n/ja/tools.d.ts +2 -0
  117. package/esm/browser/i18n/ja/tools.js +85 -0
  118. package/esm/browser/i18n/locales.d.ts +1136 -1136
  119. package/esm/browser/i18n/messages-ja.js +20 -1586
  120. package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
  121. package/esm/browser/i18n/messages-zh-tw.js +20 -1587
  122. package/esm/browser/i18n/messages.d.ts +1139 -1136
  123. package/esm/browser/i18n/messages.js +44 -3183
  124. package/esm/browser/i18n/zh/account.d.ts +2 -0
  125. package/esm/browser/i18n/zh/account.js +203 -0
  126. package/esm/browser/i18n/zh/assistant.d.ts +2 -0
  127. package/esm/browser/i18n/zh/assistant.js +129 -0
  128. package/esm/browser/i18n/zh/call.d.ts +2 -0
  129. package/esm/browser/i18n/zh/call.js +86 -0
  130. package/esm/browser/i18n/zh/chat.d.ts +2 -0
  131. package/esm/browser/i18n/zh/chat.js +213 -0
  132. package/esm/browser/i18n/zh/common.d.ts +2 -0
  133. package/esm/browser/i18n/zh/common.js +99 -0
  134. package/esm/browser/i18n/zh/console.d.ts +2 -0
  135. package/esm/browser/i18n/zh/console.js +230 -0
  136. package/esm/browser/i18n/zh/discover.d.ts +2 -0
  137. package/esm/browser/i18n/zh/discover.js +117 -0
  138. package/esm/browser/i18n/zh/service.d.ts +2 -0
  139. package/esm/browser/i18n/zh/service.js +242 -0
  140. package/esm/browser/i18n/zh/settings.d.ts +2 -0
  141. package/esm/browser/i18n/zh/settings.js +213 -0
  142. package/esm/browser/i18n/zh/tools.d.ts +2 -0
  143. package/esm/browser/i18n/zh/tools.js +86 -0
  144. package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
  145. package/esm/browser/i18n/zh-tw/account.js +202 -0
  146. package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
  147. package/esm/browser/i18n/zh-tw/assistant.js +129 -0
  148. package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
  149. package/esm/browser/i18n/zh-tw/call.js +86 -0
  150. package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
  151. package/esm/browser/i18n/zh-tw/chat.js +213 -0
  152. package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
  153. package/esm/browser/i18n/zh-tw/common.js +99 -0
  154. package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
  155. package/esm/browser/i18n/zh-tw/console.js +230 -0
  156. package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
  157. package/esm/browser/i18n/zh-tw/discover.js +117 -0
  158. package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
  159. package/esm/browser/i18n/zh-tw/service.js +242 -0
  160. package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
  161. package/esm/browser/i18n/zh-tw/settings.js +213 -0
  162. package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
  163. package/esm/browser/i18n/zh-tw/tools.js +85 -0
  164. package/esm/browser/offline/device-values.d.ts +4 -0
  165. package/esm/browser/offline/device-values.js +10 -0
  166. package/esm/browser/pwa/page-build.d.ts +15 -0
  167. package/esm/browser/pwa/page-build.js +45 -0
  168. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  169. package/esm/browser/settings/settings-protocol.js +2 -0
  170. package/esm/browser/style/base.d.ts +1 -1
  171. package/esm/browser/style/base.js +3 -0
  172. package/esm/browser/style/chat-list.d.ts +1 -1
  173. package/esm/browser/style/chat-list.js +6 -0
  174. package/esm/browser/style/conversation-column.d.ts +1 -1
  175. package/esm/browser/style/conversation-column.js +17 -0
  176. package/esm/browser/style/conversation.d.ts +1 -1
  177. package/esm/browser/style/conversation.js +5 -0
  178. package/esm/browser/style/pages.d.ts +1 -1
  179. package/esm/browser/style/pages.js +0 -7
  180. package/esm/browser/style/video-call.d.ts +1 -1
  181. package/esm/browser/style/video-call.js +15 -4
  182. package/esm/browser/util/call-transcript.d.ts +16 -0
  183. package/esm/browser/util/call-transcript.js +110 -0
  184. package/esm/browser/util/process.d.ts +6 -0
  185. package/esm/browser/util/process.js +18 -5
  186. package/esm/browser/video-call/call-people.d.ts +21 -0
  187. package/esm/browser/video-call/call-people.js +29 -0
  188. package/esm/browser/video-call/clip-plan.d.ts +11 -2
  189. package/esm/browser/video-call/clip-plan.js +19 -3
  190. package/esm/browser/video-call/face-camera.d.ts +93 -0
  191. package/esm/browser/video-call/face-camera.js +192 -0
  192. package/esm/browser/video-call/face-files.d.ts +43 -5
  193. package/esm/browser/video-call/face-files.js +73 -18
  194. package/esm/browser/video-call/face-moves.d.ts +68 -0
  195. package/esm/browser/video-call/face-moves.js +180 -0
  196. package/esm/browser/video-call/face-stage.d.ts +139 -0
  197. package/esm/browser/video-call/face-stage.js +219 -0
  198. package/esm/browser/video-call/mouth-layer.d.ts +81 -0
  199. package/esm/browser/video-call/mouth-layer.js +241 -0
  200. package/esm/browser/video-call/video-call-view.js +44 -4
  201. package/esm/browser/video-call/video-face.d.ts +11 -5
  202. package/esm/browser/video-call/video-face.js +302 -328
  203. package/esm/browser/workbench.d.ts +8 -0
  204. package/esm/browser/workbench.js +37 -1
  205. package/lib/browser/assistant/assistant-thread.js +15 -2
  206. package/lib/browser/assistant/call-scenes.d.ts +5 -4
  207. package/lib/browser/assistant/call-scenes.js +10 -7
  208. package/lib/browser/chat/chat-protocol.d.ts +2 -0
  209. package/lib/browser/chat/chat-shown.d.ts +3 -1
  210. package/lib/browser/chat/chat-shown.js +25 -3
  211. package/lib/browser/chat/chat-view.js +1 -1
  212. package/lib/browser/chat/chat.d.ts +5 -1
  213. package/lib/browser/chat/chat.js +32 -16
  214. package/lib/browser/components/account-menu.d.ts +6 -16
  215. package/lib/browser/components/account-menu.js +45 -99
  216. package/lib/browser/components/app-contexts.js +6 -3
  217. package/lib/browser/components/app-nav.js +4 -4
  218. package/lib/browser/components/chat-list-row.js +7 -2
  219. package/lib/browser/components/chat-tag.d.ts +21 -0
  220. package/lib/browser/components/chat-tag.js +142 -0
  221. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  222. package/lib/browser/components/composer-box-protocol.d.ts +2 -0
  223. package/lib/browser/components/composer-box.js +20 -1
  224. package/lib/browser/components/composer-emoji.d.ts +23 -0
  225. package/lib/browser/components/composer-emoji.js +87 -0
  226. package/lib/browser/components/custom-host.js +1 -1
  227. package/lib/browser/components/discover-view.d.ts +4 -3
  228. package/lib/browser/components/discover-view.js +5 -4
  229. package/lib/browser/components/editor-area.js +1 -1
  230. package/lib/browser/components/emoji-panel.d.ts +23 -0
  231. package/lib/browser/components/emoji-panel.js +90 -0
  232. package/lib/browser/components/host-view.d.ts +1 -1
  233. package/lib/browser/components/launcher-surface.js +1 -1
  234. package/lib/browser/components/markdown.d.ts +6 -1
  235. package/lib/browser/components/markdown.js +6 -2
  236. package/lib/browser/components/me-rows.d.ts +25 -0
  237. package/lib/browser/components/me-rows.js +22 -0
  238. package/lib/browser/components/me-view.d.ts +2 -1
  239. package/lib/browser/components/me-view.js +3 -2
  240. package/lib/browser/components/message-list.js +46 -6
  241. package/lib/browser/components/message-steps.js +13 -0
  242. package/lib/browser/components/nav-places.js +1 -1
  243. package/lib/browser/components/session-view.js +6 -1
  244. package/lib/browser/components/settings-choices.js +3 -0
  245. package/lib/browser/components/settings-controls.d.ts +13 -0
  246. package/lib/browser/components/settings-controls.js +19 -0
  247. package/lib/browser/components/settings-more.d.ts +1 -1
  248. package/lib/browser/components/settings-more.js +27 -38
  249. package/lib/browser/components/settings-parts.d.ts +4 -2
  250. package/lib/browser/components/settings-parts.js +13 -8
  251. package/lib/browser/components/settings-view.js +2 -6
  252. package/lib/browser/components/web-composer.d.ts +1 -1
  253. package/lib/browser/components/web-composer.js +2 -2
  254. package/lib/browser/device/file-save.d.ts +32 -0
  255. package/lib/browser/device/file-save.js +83 -0
  256. package/lib/browser/extension/extension-view.d.ts +9 -0
  257. package/lib/browser/extension/extension-view.js +8 -1
  258. package/lib/browser/extension/icons.js +1 -0
  259. package/lib/browser/extension/web-api-call.d.ts +45 -0
  260. package/lib/browser/extension/web-api-chats.d.ts +29 -0
  261. package/lib/browser/extension/web-api-components.d.ts +4 -0
  262. package/lib/browser/extension/web-api-contributions.d.ts +13 -14
  263. package/lib/browser/extension/web-api-desktop.d.ts +16 -1
  264. package/lib/browser/extension/web-api-desktop.js +1 -0
  265. package/lib/browser/extension/web-extension-api.d.ts +9 -12
  266. package/lib/browser/extension/web-extension-code.d.ts +15 -8
  267. package/lib/browser/extension/web-extension-code.js +25 -27
  268. package/lib/browser/extension/web-extension-context.js +4 -0
  269. package/lib/browser/extension/web-extension-protocol.d.ts +15 -1
  270. package/lib/browser/extension/web-extension-protocol.js +2 -0
  271. package/lib/browser/extension/web-extension-run.d.ts +4 -2
  272. package/lib/browser/extension/web-extension-run.js +10 -4
  273. package/lib/browser/extension/web-extensions-running.d.ts +3 -0
  274. package/lib/browser/extension/web-extensions-running.js +20 -7
  275. package/lib/browser/extension/web-extensions.js +5 -1
  276. package/lib/browser/extension/web-metrics.d.ts +33 -0
  277. package/lib/browser/extension/web-metrics.js +102 -0
  278. package/lib/browser/extension/web-pages.d.ts +2 -0
  279. package/lib/browser/extension/web-pages.js +2 -0
  280. package/lib/browser/i18n/en/account.d.ts +203 -0
  281. package/lib/browser/i18n/en/account.js +208 -0
  282. package/lib/browser/i18n/en/assistant.d.ts +130 -0
  283. package/lib/browser/i18n/en/assistant.js +133 -0
  284. package/lib/browser/i18n/en/call.d.ts +87 -0
  285. package/lib/browser/i18n/en/call.js +90 -0
  286. package/lib/browser/i18n/en/chat.d.ts +214 -0
  287. package/lib/browser/i18n/en/chat.js +217 -0
  288. package/lib/browser/i18n/en/common.d.ts +100 -0
  289. package/lib/browser/i18n/en/common.js +104 -0
  290. package/lib/browser/i18n/en/console.d.ts +231 -0
  291. package/lib/browser/i18n/en/console.js +235 -0
  292. package/lib/browser/i18n/en/discover.d.ts +118 -0
  293. package/lib/browser/i18n/en/discover.js +122 -0
  294. package/lib/browser/i18n/en/service.d.ts +243 -0
  295. package/lib/browser/i18n/en/service.js +248 -0
  296. package/lib/browser/i18n/en/settings.d.ts +214 -0
  297. package/lib/browser/i18n/en/settings.js +217 -0
  298. package/lib/browser/i18n/en/tools.d.ts +86 -0
  299. package/lib/browser/i18n/en/tools.js +90 -0
  300. package/lib/browser/i18n/ja/account.d.ts +3 -0
  301. package/lib/browser/i18n/ja/account.js +205 -0
  302. package/lib/browser/i18n/ja/assistant.d.ts +3 -0
  303. package/lib/browser/i18n/ja/assistant.js +132 -0
  304. package/lib/browser/i18n/ja/call.d.ts +3 -0
  305. package/lib/browser/i18n/ja/call.js +89 -0
  306. package/lib/browser/i18n/ja/chat.d.ts +3 -0
  307. package/lib/browser/i18n/ja/chat.js +216 -0
  308. package/lib/browser/i18n/ja/common.d.ts +3 -0
  309. package/lib/browser/i18n/ja/common.js +102 -0
  310. package/lib/browser/i18n/ja/console.d.ts +3 -0
  311. package/lib/browser/i18n/ja/console.js +233 -0
  312. package/lib/browser/i18n/ja/discover.d.ts +3 -0
  313. package/lib/browser/i18n/ja/discover.js +120 -0
  314. package/lib/browser/i18n/ja/service.d.ts +3 -0
  315. package/lib/browser/i18n/ja/service.js +245 -0
  316. package/lib/browser/i18n/ja/settings.d.ts +3 -0
  317. package/lib/browser/i18n/ja/settings.js +216 -0
  318. package/lib/browser/i18n/ja/tools.d.ts +3 -0
  319. package/lib/browser/i18n/ja/tools.js +88 -0
  320. package/lib/browser/i18n/locales.d.ts +1136 -1136
  321. package/lib/browser/i18n/messages-ja.js +20 -1586
  322. package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
  323. package/lib/browser/i18n/messages-zh-tw.js +20 -1587
  324. package/lib/browser/i18n/messages.d.ts +1139 -1136
  325. package/lib/browser/i18n/messages.js +44 -3183
  326. package/lib/browser/i18n/zh/account.d.ts +3 -0
  327. package/lib/browser/i18n/zh/account.js +206 -0
  328. package/lib/browser/i18n/zh/assistant.d.ts +3 -0
  329. package/lib/browser/i18n/zh/assistant.js +132 -0
  330. package/lib/browser/i18n/zh/call.d.ts +3 -0
  331. package/lib/browser/i18n/zh/call.js +89 -0
  332. package/lib/browser/i18n/zh/chat.d.ts +3 -0
  333. package/lib/browser/i18n/zh/chat.js +216 -0
  334. package/lib/browser/i18n/zh/common.d.ts +3 -0
  335. package/lib/browser/i18n/zh/common.js +102 -0
  336. package/lib/browser/i18n/zh/console.d.ts +3 -0
  337. package/lib/browser/i18n/zh/console.js +233 -0
  338. package/lib/browser/i18n/zh/discover.d.ts +3 -0
  339. package/lib/browser/i18n/zh/discover.js +120 -0
  340. package/lib/browser/i18n/zh/service.d.ts +3 -0
  341. package/lib/browser/i18n/zh/service.js +245 -0
  342. package/lib/browser/i18n/zh/settings.d.ts +3 -0
  343. package/lib/browser/i18n/zh/settings.js +216 -0
  344. package/lib/browser/i18n/zh/tools.d.ts +3 -0
  345. package/lib/browser/i18n/zh/tools.js +89 -0
  346. package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
  347. package/lib/browser/i18n/zh-tw/account.js +205 -0
  348. package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
  349. package/lib/browser/i18n/zh-tw/assistant.js +132 -0
  350. package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
  351. package/lib/browser/i18n/zh-tw/call.js +89 -0
  352. package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
  353. package/lib/browser/i18n/zh-tw/chat.js +216 -0
  354. package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
  355. package/lib/browser/i18n/zh-tw/common.js +102 -0
  356. package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
  357. package/lib/browser/i18n/zh-tw/console.js +233 -0
  358. package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
  359. package/lib/browser/i18n/zh-tw/discover.js +120 -0
  360. package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
  361. package/lib/browser/i18n/zh-tw/service.js +245 -0
  362. package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
  363. package/lib/browser/i18n/zh-tw/settings.js +216 -0
  364. package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
  365. package/lib/browser/i18n/zh-tw/tools.js +88 -0
  366. package/lib/browser/offline/device-values.d.ts +4 -0
  367. package/lib/browser/offline/device-values.js +10 -0
  368. package/lib/browser/pwa/page-build.d.ts +16 -0
  369. package/lib/browser/pwa/page-build.js +48 -0
  370. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  371. package/lib/browser/settings/settings-protocol.js +2 -0
  372. package/lib/browser/style/base.d.ts +1 -1
  373. package/lib/browser/style/base.js +3 -0
  374. package/lib/browser/style/chat-list.d.ts +1 -1
  375. package/lib/browser/style/chat-list.js +6 -0
  376. package/lib/browser/style/conversation-column.d.ts +1 -1
  377. package/lib/browser/style/conversation-column.js +17 -0
  378. package/lib/browser/style/conversation.d.ts +1 -1
  379. package/lib/browser/style/conversation.js +5 -0
  380. package/lib/browser/style/pages.d.ts +1 -1
  381. package/lib/browser/style/pages.js +0 -7
  382. package/lib/browser/style/video-call.d.ts +1 -1
  383. package/lib/browser/style/video-call.js +15 -4
  384. package/lib/browser/util/call-transcript.d.ts +17 -0
  385. package/lib/browser/util/call-transcript.js +113 -0
  386. package/lib/browser/util/process.d.ts +6 -0
  387. package/lib/browser/util/process.js +17 -4
  388. package/lib/browser/video-call/call-people.d.ts +22 -0
  389. package/lib/browser/video-call/call-people.js +32 -0
  390. package/lib/browser/video-call/clip-plan.d.ts +11 -2
  391. package/lib/browser/video-call/clip-plan.js +19 -3
  392. package/lib/browser/video-call/face-camera.d.ts +94 -0
  393. package/lib/browser/video-call/face-camera.js +197 -0
  394. package/lib/browser/video-call/face-files.d.ts +43 -5
  395. package/lib/browser/video-call/face-files.js +73 -18
  396. package/lib/browser/video-call/face-moves.d.ts +69 -0
  397. package/lib/browser/video-call/face-moves.js +184 -0
  398. package/lib/browser/video-call/face-stage.d.ts +140 -0
  399. package/lib/browser/video-call/face-stage.js +223 -0
  400. package/lib/browser/video-call/mouth-layer.d.ts +82 -0
  401. package/lib/browser/video-call/mouth-layer.js +245 -0
  402. package/lib/browser/video-call/video-call-view.js +44 -4
  403. package/lib/browser/video-call/video-face.d.ts +11 -5
  404. package/lib/browser/video-call/video-face.js +302 -328
  405. package/lib/browser/workbench.d.ts +8 -0
  406. package/lib/browser/workbench.js +36 -0
  407. package/package.json +7 -7
  408. package/public/faces/README.md +17 -4
  409. package/public/faces/blonde/clap.mp4 +0 -0
  410. package/public/faces/blonde/dance.mp4 +0 -0
  411. package/public/faces/blonde/face.jpg +0 -0
  412. package/public/faces/blonde/happy.mp4 +0 -0
  413. package/public/faces/blonde/heart.mp4 +0 -0
  414. package/public/faces/blonde/idle-1.mp4 +0 -0
  415. package/public/faces/blonde/idle-2.mp4 +0 -0
  416. package/public/faces/blonde/idle-3.mp4 +0 -0
  417. package/public/faces/blonde/laugh.mp4 +0 -0
  418. package/public/faces/blonde/listening.mp4 +0 -0
  419. package/public/faces/blonde/poster.jpg +0 -0
  420. package/public/faces/blonde/shy.mp4 +0 -0
  421. package/public/faces/blonde/sorry.mp4 +0 -0
  422. package/public/faces/blonde/stretch.mp4 +0 -0
  423. package/public/faces/blonde/surprised.mp4 +0 -0
  424. package/public/faces/blonde/talk-1.mp4 +0 -0
  425. package/public/faces/blonde/talk-2.mp4 +0 -0
  426. package/public/faces/blonde/think-2.mp4 +0 -0
  427. package/public/faces/blonde/thinking.mp4 +0 -0
  428. package/public/faces/blonde/wave.mp4 +0 -0
  429. package/public/faces/dance.mp4 +0 -0
  430. package/public/faces/face.jpg +0 -0
  431. package/public/faces/framing.json +1 -0
  432. package/public/faces/lips.json +1 -1
  433. package/public/faces/stretch.mp4 +0 -0
  434. package/esm/browser/video-call/face-clips.d.ts +0 -33
  435. package/esm/browser/video-call/face-clips.js +0 -93
  436. package/lib/browser/video-call/face-clips.d.ts +0 -34
  437. package/lib/browser/video-call/face-clips.js +0 -96
package/README.en.md CHANGED
@@ -66,7 +66,7 @@ As WeChat pulls its mini programs down over its chats (design record docs/design
66
66
  - **Widgets** (views at `location: 'board'`): on a phone, a swipe to the right over the first tab brings the board in from the left (from the left edge over a row swiped open); elsewhere a button of the rail. Edit takes cards off, puts them back and orders them by their handles, kept for the user (`board`). Built in: the double's tasks, Quick open, and Next up of the scheduled tasks.
67
67
  - **Started on open**: a package with `pi.webActivation: 'open'`, or one opened without installing (`origin: 'temporary'`), loads when one of its pages opens; left, it keeps running in the background with its page as it was (`KeptPages`), shown again at once; it stops after the time of Settings, Extensions (5 minutes by default) in the background, or when more than three are there. Its pages are not in the navigation: Quick open lists them.
68
68
  - **Sharing**: `ui.shareExtension` opens the dialog that hands an extension on (QR code, copy, the share of the system): the source of a published one, else end to end through the relay and kept nowhere (`TaRelayServer.sharePackage`); `ui.openShared` opens a link of an extension, asked first.
69
- - For web extensions: `ui.usePages()` (every page, with its state, place, last use and temporary package), `ui.showView` (starts one started on open first; its name opens its first page), `ui.stopExtension`, `ui.forgetPage`, `pi.openTemporary(source, from)`, `ui.useContextMenu()` (the menu of the page, right click or long press), `ui.QrCode`, `ui.scanCode` and `ui.scan` (in the Ta app only; `ui.scan` is the Scan of the page, which opens what the code carries), `ui.connect(link)` (connects to another Ta by a pairing link, of `ta pair` or the device a Ta that let the user in gave them, and switches to it once it answered, the page loading again; false, said in a notice, when it did not answer or refused).
69
+ - For web extensions: `ui.usePages()` (every page, with its state, place, last use and temporary package), `ui.showView` (starts one started on open first; its name opens its first page), `ui.stopExtension`, `ui.forgetPage`, `pi.openTemporary(source, from)`, `ui.useContextMenu()` (the menu of the page, right click or long press), `ui.QrCode`, `ui.scanCode` and `ui.scan` (in the Ta app only; `ui.scan` is the Scan of the page, which opens what the code carries), `ui.saveFile(file, name)` (in the Ta app only, whose web view downloads nothing: iOS keeps pictures and videos in Photos and other files in Files, Android in Downloads), `ui.connect(link)` (connects to another Ta by a pairing link, of `ta pair` or the device a Ta that let the user in gave them, and switches to it once it answered, the page loading again; false, said in a notice, when it did not answer or refused).
70
70
 
71
71
  ## Phones and tablets
72
72
 
package/README.md CHANGED
@@ -66,7 +66,7 @@ Web 客户端可以装成桌面或手机上的应用:Chrome / Edge 地址栏
66
66
  - **小组件**(`location: 'board'` 的视图):手机上在第一个标签上从左往右划,小组件面板从左侧滑入(已经划开的列表行上从左边缘开始);电脑和平板上是导轨底部的按钮。"编辑"里可以移除、加回卡片,拖动右侧把手排序,排列存在用户数据里(`board`)。内置的卡片有分身的任务、快捷打开和定时任务的"接下来"。
67
67
  - **按需启动**:包的 `pi.webActivation: 'open'`,或免安装打开的临时扩展(`origin: 'temporary'`),在打开它的页面时才加载;离开后在后台继续运行、页面原样保留(`KeptPages`),再次打开没有等待;在后台超过保留时间(设置 → 扩展,默认 5 分钟)或后台超过 3 个时停止。这类扩展的页面不进导航栏,在快捷打开里找到。
68
68
  - **分享**:`ui.shareExtension` 打开分享弹窗(二维码、复制、系统分享),已发布的扩展给来源,本机的经中继端到端发送、不存储(`TaRelayServer.sharePackage`);`ui.openShared` 打开扩展链接,先确认。
69
- - 扩展接口:`ui.usePages()`(所有页面及其状态、位置、最近使用时间、临时扩展信息)、`ui.showView`(按需启动的先启动,扩展名打开它的第一个页面)、`ui.stopExtension`、`ui.forgetPage`、`pi.openTemporary(source, from)`、`ui.useContextMenu()`(和页面一样的右键/长按菜单)、`ui.QrCode`、`ui.scanCode` 和 `ui.scan`(只在 Ta 手机应用里;`ui.scan` 就是页面自己的“扫一扫”,扫完打开二维码里的内容)、`ui.connect(link)`(按配对链接连到另一个 Ta,`ta pair` 或让你进入的 Ta 给的设备,对方回答后切过去、页面重新加载;没回答或被拒绝时返回 false 并提示原因)。
69
+ - 扩展接口:`ui.usePages()`(所有页面及其状态、位置、最近使用时间、临时扩展信息)、`ui.showView`(按需启动的先启动,扩展名打开它的第一个页面)、`ui.stopExtension`、`ui.forgetPage`、`pi.openTemporary(source, from)`、`ui.useContextMenu()`(和页面一样的右键/长按菜单)、`ui.QrCode`、`ui.scanCode` 和 `ui.scan`(只在 Ta 手机应用里;`ui.scan` 就是页面自己的“扫一扫”,扫完打开二维码里的内容)、`ui.saveFile(file, name)`(只在 Ta 手机应用里,它的网页视图不会下载:iOS 上图片和视频存进相册、其他文件存到“文件”,Android 存到“下载”)、`ui.connect(link)`(按配对链接连到另一个 Ta,`ta pair` 或让你进入的 Ta 给的设备,对方回答后切过去、页面重新加载;没回答或被拒绝时返回 false 并提示原因)。
70
70
 
71
71
  ## 手机与平板
72
72
 
@@ -38,7 +38,7 @@ function DoubleTurn({ item, latest, children }) {
38
38
  function DoubleUserMessage({ message, blocks }) {
39
39
  const { text, copied, skill } = userWords(blocks);
40
40
  const [menu, onContextMenu] = useMessageMenu({ kind: 'user', message, text: copied });
41
- return (React.createElement("div", { className: `ta-msg-user ${ASK_CLASS}`, onContextMenu: onContextMenu },
41
+ return (React.createElement("div", { className: "ta-msg-user", onContextMenu: onContextMenu },
42
42
  React.createElement(UserMarks, { blocks: blocks }),
43
43
  skill && React.createElement(SkillUse, { skill: skill }),
44
44
  React.createElement(UserSaid, { blocks: blocks, text: text, bubble: "ta-msg-bubble", timestamp: message.timestamp }),
@@ -82,6 +82,18 @@ function DoubleRowView({ item, tools, mood, status, latest, started, onTask, t }
82
82
  }
83
83
  return React.createElement(DoubleUserMessage, { message: item.message, blocks: blocks });
84
84
  }
85
+ /**
86
+ * Whether the row of `item` is what the user said (DoubleUserMessage), not a task's note nor a notice: marked on the
87
+ * row itself (ASK_CLASS), as in any conversation. Marked inside it, the view would go by the place of the message in its
88
+ * row while the row comes in with a motion (its transform makes it the offsetParent), to the top of the thread first.
89
+ */
90
+ function isAskRow(item) {
91
+ if (item.kind !== 'message' || item.message.role !== 'user') {
92
+ return false;
93
+ }
94
+ const text = MessageUtil.text(MessageUtil.blocks(item.message)).trim();
95
+ return !AssistantTaskUtil.noteOf(text) && !TaMessageSource.isNotice(text);
96
+ }
85
97
  function sameTasks(a, b) {
86
98
  return a.length === b.length && a.every((task, index) => task === b[index]);
87
99
  }
@@ -103,6 +115,7 @@ export const AssistantThread = React.memo(function AssistantThread({ state, repl
103
115
  const renderers = React.useContext(MessageRenderers);
104
116
  const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start, renderers, state.head), [state.messages, state.working, state.start, renderers, state.head]);
105
117
  const starts = React.useMemo(() => ProcessUtil.starts(items), [items]);
118
+ const asks = React.useMemo(() => items.map(isAskRow), [items]);
106
119
  const breaks = React.useMemo(() => ProcessUtil.timeBreaks(starts, index => ProcessUtil.shown(items[index], renderers)), [starts, items, renderers]);
107
120
  // A turn's cards know what the user said after it: a choice they asked for is made (message-list.tsx).
108
121
  const answers = React.useMemo(() => ProcessUtil.answers(items, message => userWords(MessageUtil.blocks(message)).copied), [items]);
@@ -126,7 +139,7 @@ export const AssistantThread = React.memo(function AssistantThread({ state, repl
126
139
  }
127
140
  const turn = item.kind === 'turn';
128
141
  const started = turn ? WebTaskUtil.startedIn(own, origin, starts[index], (_a = starts[index + 1]) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY) : NO_TASKS;
129
- return (React.createElement("div", { key: item.key, "data-row": item.key, className: shown.className(index) },
142
+ return (React.createElement("div", { key: item.key, "data-row": item.key, className: shown.className(index, asks[index] && ASK_CLASS) },
130
143
  breaks[index] !== undefined && React.createElement(TimeBreak, { timestamp: breaks[index] }),
131
144
  React.createElement(CodeAnswer.Provider, { value: answers[index] },
132
145
  React.createElement(DoubleRow, { item: item, tools: state.tools, mood: turn ? ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn, started: started, onTask: onTask, t: t }))));
@@ -1,9 +1,10 @@
1
- import { type TaCallScene, type TaCallView } from '@celljs/ta-protocol';
1
+ import { type TaCallOwnMove, type TaCallScene, type TaCallView } from '@celljs/ta-protocol';
2
2
  import type { VoiceCall } from './voice-call.js';
3
- /** What the view of a call shows of it now (VideoCallView): the user's camera, and how the call shows. */
3
+ /** What the view of a call shows of it now (VideoCallView): the user's camera, how the call shows, what she can do (VideoFace). */
4
4
  interface Shown {
5
5
  camera?: boolean;
6
6
  view?: TaCallView;
7
+ moves?: TaCallOwnMove[];
7
8
  }
8
9
  /**
9
10
  * How a call is for the user (TaCallScene, docs/design/ta-call.md 13), from the call (video or voice, when it began),
@@ -12,8 +13,8 @@ interface Shown {
12
13
  */
13
14
  export declare namespace CallScenes {
14
15
  function of(call: VoiceCall, device: TaCallScene['device']): TaCallScene;
15
- /** The view of the call shows this now. */
16
- function show(call: VoiceCall, now: Shown): void;
16
+ /** The view of the call shows this now (what it names; the rest as it was). */
17
+ function show(call: VoiceCall, part: Shown): void;
17
18
  /** Tells `changed` the scene of `call` as it changes and stays so a moment; until what it returns is called. */
18
19
  function watch(call: VoiceCall, device: TaCallScene['device'], changed: (scene: TaCallScene) => void): () => void;
19
20
  /**
@@ -14,25 +14,28 @@ export var CallScenes;
14
14
  const told = new WeakMap();
15
15
  function of(call, device) {
16
16
  var _a, _b;
17
- const { camera, view } = (_a = shown.get(call)) !== null && _a !== void 0 ? _a : {};
17
+ const { camera, view, moves } = (_a = shown.get(call)) !== null && _a !== void 0 ? _a : {};
18
18
  return {
19
19
  video: call.state.video === true,
20
20
  ...(call.state.video && camera ? { camera } : {}),
21
21
  ...(call.state.video && view ? { view } : {}),
22
22
  ...(device ? { device } : {}),
23
23
  since: (_b = call.state.since) !== null && _b !== void 0 ? _b : Date.now(),
24
+ ...(call.state.video && (moves === null || moves === void 0 ? void 0 : moves.length) ? { moves } : {}),
24
25
  };
25
26
  }
26
27
  CallScenes.of = of;
27
- /** The view of the call shows this now. */
28
- function show(call, now) {
29
- var _a;
30
- const before = shown.get(call);
31
- if ((before === null || before === void 0 ? void 0 : before.camera) === now.camera && (before === null || before === void 0 ? void 0 : before.view) === now.view) {
28
+ /** The view of the call shows this now (what it names; the rest as it was). */
29
+ function show(call, part) {
30
+ var _a, _b;
31
+ const before = (_a = shown.get(call)) !== null && _a !== void 0 ? _a : {};
32
+ const now = { ...before, ...part };
33
+ const key = (value) => JSON.stringify([value.camera, value.view, value.moves]);
34
+ if (key(before) === key(now)) {
32
35
  return;
33
36
  }
34
37
  shown.set(call, now);
35
- for (const listener of [...((_a = listeners.get(call)) !== null && _a !== void 0 ? _a : [])]) {
38
+ for (const listener of [...((_b = listeners.get(call)) !== null && _b !== void 0 ? _b : [])]) {
36
39
  listener();
37
40
  }
38
41
  }
@@ -17,6 +17,8 @@ export interface ChatDraft {
17
17
  sending?: {
18
18
  message: string;
19
19
  images?: ImageContent[];
20
+ /** Of this first message and its opening (openId, clientMessageId): sent again, it opens and runs once. */
21
+ id: string;
20
22
  failed?: string;
21
23
  heldAt?: number;
22
24
  };
@@ -46,7 +46,9 @@ export declare abstract class ChatShown {
46
46
  protected attach({ sessionId, attachment }: {
47
47
  sessionId: string;
48
48
  attachment?: TaAttachResult;
49
- }, send?: (store: SessionStore) => Promise<unknown>, sessionFile?: string): Promise<void>;
49
+ }, send?: (store: SessionStore) => Promise<unknown>, sessionFile?: string, wanted?: () => boolean): Promise<void>;
50
+ /** A store attached for a conversation no longer shown: detached, and kept to show again at once. */
51
+ protected putAway(store: SessionStore, tools: string): void;
50
52
  /**
51
53
  * The conversation picked, at once and whatever the connection, under `key` (what is pending): one this page
52
54
  * showed lately in this very frame, else the one this device kept once read, as a chat app shows a chat before
@@ -72,17 +72,21 @@ export class ChatShown {
72
72
  * switching does not flash an empty page. `attachment`: what opening it attached already (ChatStores.open),
73
73
  * taken by the store in the same turn of the event loop, so that no event after it is missed.
74
74
  */
75
- async attach({ sessionId, attachment }, send, sessionFile) {
75
+ async attach({ sessionId, attachment }, send, sessionFile, wanted) {
76
76
  var _a;
77
77
  var _b;
78
78
  const tools = this.stores.toolNames();
79
79
  const file = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOf(sessionId);
80
+ // Something else picked meanwhile (another conversation, a new one): this one is kept, not shown over it.
81
+ // `wanted`: whether what the caller was asked for is still what is wanted, from before it opened the session.
82
+ const asked = this.wanted;
83
+ const still = wanted !== null && wanted !== void 0 ? wanted : (() => this.wanted === asked);
80
84
  const shown = this.current.store;
81
85
  // Shown already, from the device before the connection: attached now, as it is.
82
86
  const early = (shown === null || shown === void 0 ? void 0 : shown.sessionId) === sessionId && !this.stores.isAttached(shown) && this.stores.toolsOf(shown) === tools ? shown : undefined;
83
87
  const kept = early !== null && early !== void 0 ? early : this.stores.recent.take(sessionId, tools);
84
88
  if (kept && this.stores.listed(sessionId)) {
85
- if (!early) {
89
+ if (!early && still()) {
86
90
  this.enter(kept, file);
87
91
  }
88
92
  try {
@@ -94,6 +98,9 @@ export class ChatShown {
94
98
  if (this.current.store === kept) {
95
99
  this.listen(kept);
96
100
  }
101
+ else {
102
+ this.putAway(kept, tools);
103
+ }
97
104
  await sending;
98
105
  return;
99
106
  }
@@ -112,7 +119,7 @@ export class ChatShown {
112
119
  // What failed to go there stays.
113
120
  store.carry(standing);
114
121
  }
115
- if (initial) {
122
+ if (initial && still()) {
116
123
  // As this device saw it, at once.
117
124
  this.enter(store, file);
118
125
  }
@@ -132,12 +139,27 @@ export class ChatShown {
132
139
  throw error;
133
140
  }
134
141
  this.stores.setAttached(store);
142
+ // Shown from the device and left since, or not shown yet with another picked: not shown over what is.
143
+ if (this.current.store !== store && (initial || !still())) {
144
+ this.putAway(store, tools);
145
+ await sending;
146
+ return;
147
+ }
135
148
  if (!initial) {
136
149
  this.enter(store, file);
137
150
  }
138
151
  this.listen(store);
139
152
  await sending;
140
153
  }
154
+ /** A store attached for a conversation no longer shown: detached, and kept to show again at once. */
155
+ putAway(store, tools) {
156
+ if (this.stores.setDetached(store)) {
157
+ store.detach().catch(() => undefined);
158
+ if (!store.state.closed) {
159
+ this.stores.recent.keep(store, tools);
160
+ }
161
+ }
162
+ }
141
163
  /**
142
164
  * The conversation picked, at once and whatever the connection, under `key` (what is pending): one this page
143
165
  * showed lately in this very frame, else the one this device kept once read, as a chat app shows a chat before
@@ -36,7 +36,7 @@ export function useChat() {
36
36
  /** What a web extension draws: in its own boundary, so that a failure stays in its place. */
37
37
  export function Widget({ widget }) {
38
38
  const Content = widget.component;
39
- return (React.createElement(ExtensionBoundary, { name: WebLabelUtil.text(widget.title) || widget.id, resetKey: Content },
39
+ return (React.createElement(ExtensionBoundary, { name: WebLabelUtil.text(widget.title) || widget.id, extension: widget.extension, resetKey: Content },
40
40
  React.createElement(Content, null)));
41
41
  }
42
42
  function Hero({ cwd, onPick }) {
@@ -4,6 +4,10 @@ import { type ChatDraft, type ChatOpening, TaChat } from './chat-protocol.js';
4
4
  import { ChatShown } from './chat-shown.js';
5
5
  export declare class TaChatImpl extends ChatShown implements TaChat {
6
6
  start(): Promise<void>;
7
+ /**
8
+ * At once, not behind what is queued (a conversation that waits for the connection, or attaches over a slow one):
9
+ * what was asked last is the new conversation, and what was asked before it does not show over it (`wanted`).
10
+ */
7
11
  draft(): Promise<void>;
8
12
  setDraftCwd(cwd: string): Promise<void>;
9
13
  /** A new conversation is in the default directory, as it changes here or on another device. */
@@ -36,7 +40,7 @@ export declare class TaChatImpl extends ChatShown implements TaChat {
36
40
  * A session of the list that the service closed since the list was read (idle, or a restart): opened
37
41
  * again from its file. One of a package's group is left to its package, which opens it with its role.
38
42
  */
39
- protected reopenClosed(sessionId: string, error: unknown): Promise<void>;
43
+ protected reopenClosed(sessionId: string, error: unknown, wanted?: () => boolean): Promise<void>;
40
44
  /** The conversation shown, opened again from its file; the newest other one if that fails. */
41
45
  protected recover(): Promise<void>;
42
46
  /** The newest other open session, or a new conversation. */
@@ -16,6 +16,8 @@ import { ChatUtil } from './chat-util.js';
16
16
  const FILE = { key: 'chat.file', tier: 'user', initial: '', parse: StateUtil.string, passive: true };
17
17
  /** That conversation is of a package's group: the page shows it again only while it is open, as its package opens it with a role of its own. */
18
18
  const GROUPED = { key: 'chat.grouped', tier: 'user', initial: false, parse: StateUtil.boolean };
19
+ /** What `wanted` is once a new conversation was asked for: no session has it. */
20
+ const DRAFT = 'draft';
19
21
  let TaChatImpl = class TaChatImpl extends ChatShown {
20
22
  start() {
21
23
  return this.enqueue(async () => {
@@ -62,13 +64,20 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
62
64
  }
63
65
  });
64
66
  }
67
+ /**
68
+ * At once, not behind what is queued (a conversation that waits for the connection, or attaches over a slow one):
69
+ * what was asked last is the new conversation, and what was asked before it does not show over it (`wanted`).
70
+ */
65
71
  draft() {
66
- return this.enqueue(async () => {
67
- if (!this.current.draft) {
68
- this.leave();
69
- this.showDraft();
70
- }
71
- });
72
+ this.wanted = DRAFT;
73
+ if (this.current.pending) {
74
+ this.update({ pending: undefined, opening: undefined });
75
+ }
76
+ if (!this.current.draft) {
77
+ this.leave();
78
+ this.showDraft();
79
+ }
80
+ return Promise.resolve();
72
81
  }
73
82
  async setDraftCwd(cwd) {
74
83
  if (this.current.draft) {
@@ -114,7 +123,7 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
114
123
  if (draft) {
115
124
  // What was sent shows at once, with Ta at work, while the conversation opens.
116
125
  this.stopping = false;
117
- this.update({ draft: { ...draft, sending: { message, images } } });
126
+ this.update({ draft: { ...draft, sending: { message, images, id: crypto.randomUUID() } } });
118
127
  }
119
128
  return this.openDraft();
120
129
  }
@@ -125,14 +134,15 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
125
134
  if (!(draft === null || draft === void 0 ? void 0 : draft.sending)) {
126
135
  return;
127
136
  }
128
- const { message, images } = draft.sending;
137
+ const { message, images, id } = draft.sending;
129
138
  let sessionId;
130
139
  try {
131
- const opened = await this.stores.open({ cwd: draft.cwd, model: draft.model });
140
+ // By the id of this first message: opened and sent again after a lost connection, it opens and runs once.
141
+ const opened = await this.stores.open({ cwd: draft.cwd, model: draft.model, openId: id });
132
142
  sessionId = opened.sessionId;
133
143
  // Sent with the attach, not after it: one round trip less before Ta starts. A failure to send
134
144
  // stays on the message in the conversation.
135
- await this.attach(opened, store => store.send(message, { images }));
145
+ await this.attach(opened, store => store.send(message, { images, clientMessageId: id }));
136
146
  }
137
147
  catch (error) {
138
148
  // No conversation: the message stays, marked, to send again; for a lost connection, once it is back.
@@ -172,8 +182,14 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
172
182
  }
173
183
  resendDraft() {
174
184
  var _a;
175
- const sending = (_a = this.current.draft) === null || _a === void 0 ? void 0 : _a.sending;
176
- return (sending === null || sending === void 0 ? void 0 : sending.failed) ? this.submit(sending.message, sending.images) : Promise.resolve();
185
+ const { draft } = this.current;
186
+ if (!((_a = draft === null || draft === void 0 ? void 0 : draft.sending) === null || _a === void 0 ? void 0 : _a.failed)) {
187
+ return Promise.resolve();
188
+ }
189
+ // With its id: one that opened before the failure was told is not opened again.
190
+ this.stopping = false;
191
+ this.update({ draft: { ...draft, sending: { ...draft.sending, failed: undefined, heldAt: undefined } } });
192
+ return this.openDraft();
177
193
  }
178
194
  discardDraft() {
179
195
  var _a;
@@ -213,7 +229,7 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
213
229
  await ChatUtil.untilConnected(async () => {
214
230
  const { store } = this.current;
215
231
  if (wanted() && ((store === null || store === void 0 ? void 0 : store.sessionId) !== sessionId || !this.stores.isAttached(store))) {
216
- await this.attach({ sessionId }, undefined, opening === null || opening === void 0 ? void 0 : opening.sessionFile).catch(error => this.reopenClosed(sessionId, error));
232
+ await this.attach({ sessionId }, undefined, opening === null || opening === void 0 ? void 0 : opening.sessionFile, wanted).catch(error => this.reopenClosed(sessionId, error, wanted));
217
233
  }
218
234
  }, () => this.workbench.connected(), wanted);
219
235
  }).finally(() => {
@@ -261,7 +277,7 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
261
277
  if (!wanted() || (open && (store === null || store === void 0 ? void 0 : store.sessionId) === open.sessionId && this.stores.isAttached(store))) {
262
278
  return;
263
279
  }
264
- await this.attach(open !== null && open !== void 0 ? open : (await this.stores.open({ sessionFile, cwd: saved === null || saved === void 0 ? void 0 : saved.cwd })), undefined, sessionFile);
280
+ await this.attach(open !== null && open !== void 0 ? open : (await this.stores.open({ sessionFile, cwd: saved === null || saved === void 0 ? void 0 : saved.cwd })), undefined, sessionFile, wanted);
265
281
  }, () => this.workbench.connected(), wanted);
266
282
  }).finally(() => {
267
283
  if (this.current.pending === sessionFile) {
@@ -313,13 +329,13 @@ let TaChatImpl = class TaChatImpl extends ChatShown {
313
329
  * A session of the list that the service closed since the list was read (idle, or a restart): opened
314
330
  * again from its file. One of a package's group is left to its package, which opens it with its role.
315
331
  */
316
- async reopenClosed(sessionId, error) {
332
+ async reopenClosed(sessionId, error, wanted) {
317
333
  const info = this.workbench.state.sessions.find(session => session.sessionId === sessionId);
318
334
  if ((error === null || error === void 0 ? void 0 : error.code) !== TaErrorCode.SESSION_NOT_FOUND || !(info === null || info === void 0 ? void 0 : info.sessionFile) || info.group) {
319
335
  await this.workbench.refresh().catch(() => undefined);
320
336
  throw error;
321
337
  }
322
- await this.attach(await this.stores.open({ sessionFile: info.sessionFile, cwd: info.cwd }), undefined, info.sessionFile);
338
+ await this.attach(await this.stores.open({ sessionFile: info.sessionFile, cwd: info.cwd }), undefined, info.sessionFile, wanted);
323
339
  }
324
340
  /** The conversation shown, opened again from its file; the newest other one if that fails. */
325
341
  async recover() {
@@ -2,13 +2,7 @@ import { type LucideIcon } from 'lucide-react';
2
2
  import * as React from 'react';
3
3
  import type { SettingsSection } from './settings-view.js';
4
4
  /** What an entry of the account opens over the page. */
5
- export type AccountDialog = 'accounts' | 'directory' | 'relay' | 'devices' | 'profile';
6
- export interface AccountChoice {
7
- key: string;
8
- label: string;
9
- checked: boolean;
10
- pick(): void;
11
- }
5
+ export type AccountDialog = 'accounts' | 'relay' | 'devices' | 'profile';
12
6
  /** An entry of the account: an item of the menu of the rail, a row of Me on a phone. */
13
7
  export interface AccountEntry {
14
8
  key: string;
@@ -18,16 +12,12 @@ export interface AccountEntry {
18
12
  /** The keys that do it too. */
19
13
  keys?: string;
20
14
  danger?: boolean;
21
- /** A second menu beside the first, of the menu; the row of a phone shows the one chosen and opens the settings. */
22
- choices?: AccountChoice[];
15
+ /** Something to do now (restart to a new version, install the app): a row of a phone without a chevron. */
16
+ action?: boolean;
23
17
  /** What the row of a phone shows on its right, muted. */
24
18
  detail?: string;
25
19
  }
26
- /**
27
- * The entries of the account and of the settings, in groups: the settings, the packages and the keys; the model
28
- * accounts, the default directory and the phone; the theme and the language; the pages of extensions that are the
29
- * user's own (WebView.group `me`: their feedback), about, and signing out.
30
- */
20
+ /** The entries of the account: the rows of Me on a phone, the menu of the account on the rail (MeUtil.keys). */
31
21
  export declare function useAccountEntries(onSettings: (section?: SettingsSection) => void, onDialog: (dialog: AccountDialog) => void): AccountEntry[][];
32
22
  /** What the entries of the account open over the page. */
33
23
  export declare function AccountDialogs({ dialog, onClose, onDialog }: {
@@ -62,7 +52,7 @@ export interface AccountMenuProps {
62
52
  }
63
53
  /**
64
54
  * The account at the foot of the rail, with the settings: who is signed in to which machine and whether the
65
- * page is connected (a dot on the figure while it is not), then the entries of useAccountEntries, the theme and
66
- * the language a step away, in a second menu beside the first. A phone has them as its tab Me (me-view.tsx).
55
+ * page is connected (a dot on the figure while it is not), then the entries of useAccountEntries. A phone has them as
56
+ * its tab Me (me-view.tsx).
67
57
  */
68
58
  export declare function AccountMenu({ onSettings, active }: AccountMenuProps): React.JSX.Element;
@@ -1,11 +1,10 @@
1
- import { TaLanguageUtil } from '@celljs/ta-protocol';
2
- import { ArrowLeftRight, Check, ChevronRight, Download, FolderOpen, Info, Keyboard, KeyRound, Languages, LogOut, MonitorSmartphone, Palette, Puzzle, RotateCw, Settings2, Smartphone, Sparkles, Vault, } from 'lucide-react';
1
+ import { ArrowLeftRight, Download, Info, KeyRound, LogOut, MonitorSmartphone, RotateCw, Settings2, Smartphone, Sparkles, Vault, } from 'lucide-react';
3
2
  import * as React from 'react';
4
3
  import { useAccountInfo, useAccountSide } from '../account/account-side.js';
5
4
  import { DeviceAccount } from '../account/device-account.js';
6
5
  import { useDevice } from '../device/device.js';
7
6
  import { WebLabelUtil } from '../extension/web-extension-protocol.js';
8
- import { useNotices, usePersisted, usePwa, useSettings, useWebExtensions, useWorkbench } from '../hooks.js';
7
+ import { useNotices, usePersisted, usePwa, useWebExtensions, useWorkbench } from '../hooks.js';
9
8
  import { HostUtil } from '../hosts.js';
10
9
  import { useT } from '../i18n/use-t.js';
11
10
  import { WorkbenchUtil } from '../workbench-util.js';
@@ -15,29 +14,16 @@ import { DinoLookPicker } from './dino-look-picker.js';
15
14
  import { useDismiss } from './dismiss.js';
16
15
  import { Face } from './face.js';
17
16
  import { Icon } from './icon.js';
17
+ import { MeUtil } from './me-rows.js';
18
18
  import { ProfileDialog, useAccountLine, useIdentity } from './profile-view.js';
19
19
  import { RelayDialog } from './relay-view.js';
20
20
  import { useSecretPeek } from './secret-peek.js';
21
21
  import { ServeRestartUtil, useRestartTa } from './serve-restart.js';
22
22
  import { Keys } from './settings-controls.js';
23
- import { WorkingDirectoryPicker } from './working-directory.js';
24
- const THEMES = [
25
- ['system', 'ta.settings.theme.system'],
26
- ['light', 'ta.settings.theme.light'],
27
- ['dark', 'ta.settings.theme.dark'],
28
- ];
29
- const LANGUAGES = [
30
- ['system', 'ta.settings.language.system'],
31
- ...TaLanguageUtil.ALL.map(language => [language, TaLanguageUtil.NAMES[language]]),
32
- ];
33
- /**
34
- * The entries of the account and of the settings, in groups: the settings, the packages and the keys; the model
35
- * accounts, the default directory and the phone; the theme and the language; the pages of extensions that are the
36
- * user's own (WebView.group `me`: their feedback), about, and signing out.
37
- */
23
+ /** The entries of the account: the rows of Me on a phone, the menu of the account on the rail (MeUtil.keys). */
38
24
  export function useAccountEntries(onSettings, onDialog) {
25
+ var _a;
39
26
  const t = useT();
40
- const [{ settings }, store] = useSettings();
41
27
  const [{ hosts, host }, workbench] = useWorkbench();
42
28
  const inUse = hosts.find(one => one.id === host);
43
29
  const [{ installable, standalone }, pwa] = usePwa();
@@ -73,68 +59,45 @@ export function useAccountEntries(onSettings, onDialog) {
73
59
  notices.error(error);
74
60
  }
75
61
  };
76
- const entry = (key, label, icon, run, more = {}) => ({
77
- key,
78
- label,
79
- icon,
80
- run,
81
- ...more,
62
+ const update = restartTa.can && restartTa.update ? restartTa.update : undefined;
63
+ const entries = {};
64
+ const entry = (key, label, icon, run, more = {}) => {
65
+ entries[key] = { key, label, icon, run, ...more };
66
+ };
67
+ entry('look', t('ta.look.title'), Sparkles, () => DinoLookPicker.open());
68
+ entry('devices', t('ta.myDevices.title'), MonitorSmartphone, () => onDialog('devices'), {
69
+ detail: inUse && (HostUtil.label(inUse) || t('ta.hosts.thisServer')),
82
70
  });
83
- return [
84
- [
85
- entry('look', t('ta.look.title'), Sparkles, () => DinoLookPicker.open()),
86
- entry('settings', t('ta.settings'), Settings2, () => onSettings(), { keys: touch ? undefined : 'Mod+,' }),
87
- entry('packages', t('ta.manage.packages'), Puzzle, () => onSettings('packages')),
88
- ...(touch ? [] : [entry('shortcuts', t('ta.manage.shortcuts'), Keyboard, () => onSettings('shortcuts'))]),
89
- ],
90
- [
91
- entry('devices', t('ta.myDevices.title'), MonitorSmartphone, () => onDialog('devices'), {
92
- detail: inUse && (HostUtil.label(inUse) || t('ta.hosts.thisServer')),
93
- }),
94
- entry('accounts', t('ta.manage.accounts'), KeyRound, () => onDialog('accounts')),
95
- ...(vault ? [entry('vault', t('ta.manage.vault'), Vault, vault)] : []),
96
- entry('directory', t('ta.manage.workingDirectory'), FolderOpen, () => onDialog('directory')),
97
- ...(WorkbenchUtil.isApp() || handheld ? [] : [entry('relay', t('ta.manage.relay'), Smartphone, () => onDialog('relay'))]),
98
- ],
99
- [
100
- entry('theme', t('ta.settings.theme'), Palette, () => onSettings('appearance'), {
101
- choices: THEMES.map(([theme, label]) => ({
102
- key: theme,
103
- label: t(label),
104
- checked: settings.theme === theme,
105
- pick: () => store.update({ theme }),
106
- })),
107
- }),
108
- entry('language', t('ta.settings.language'), Languages, () => onSettings('language'), {
109
- choices: LANGUAGES.map(([language, label]) => ({
110
- key: language,
111
- label: language === 'system' ? t(label) : label,
112
- checked: settings.language === language,
113
- pick: () => store.update({ language }),
114
- })),
115
- }),
116
- ],
117
- [
118
- ...(installable && !standalone ? [entry('install', t('ta.pwa.install'), Download, () => void pwa.install())] : []),
119
- ...(restartTa.can
120
- ? [
121
- entry('restart', restartTa.update ? t('ta.update.restartTo', { version: ServeRestartUtil.label(restartTa.update) }) : t('ta.restart'), RotateCw, () => void restartTa.restart()),
122
- ]
123
- : []),
124
- ...own.map(view => { var _a; return entry(`page:${view.id}`, WebLabelUtil.text(view.title), ((_a = view.icon) !== null && _a !== void 0 ? _a : Info), () => void extensions.showView(view.id)); }),
125
- entry('about', t('ta.manage.about'), Info, () => onSettings('about')),
126
- // As WeChat's: the account in use kept, with its computers, to come back to in one tap (docs/design/ta-me.md 4).
127
- ...(app && signedIn ? [entry('switchAccount', t('ta.account.switchSignIn'), ArrowLeftRight, () => { var _a; return (_a = DeviceAccount.current()) === null || _a === void 0 ? void 0 : _a.switchAccount(); })] : []),
128
- entry('signOut', t('ta.settings.signOut'), LogOut, () => void signOut(), { danger: true }),
129
- ],
130
- ];
71
+ entry('relay', t('ta.relay.title'), Smartphone, () => onDialog('relay'));
72
+ entry('accounts', t('ta.settings.accounts'), KeyRound, () => onDialog('accounts'));
73
+ if (vault) {
74
+ entry('vault', t('ta.manage.vault'), Vault, vault);
75
+ }
76
+ for (const view of own) {
77
+ entry(`page:${view.id}`, WebLabelUtil.text(view.title), ((_a = view.icon) !== null && _a !== void 0 ? _a : Info), () => void extensions.showView(view.id));
78
+ }
79
+ entry('settings', t('ta.settings'), Settings2, () => onSettings(), { keys: touch ? undefined : 'Mod+,' });
80
+ if (update) {
81
+ entry('restart', t('ta.update.restartTo', { version: ServeRestartUtil.label(update) }), RotateCw, () => void restartTa.restart(), { action: true });
82
+ }
83
+ entry('install', t('ta.pwa.install'), Download, () => void pwa.install(), { action: true });
84
+ // As WeChat's: the account in use kept, with its computers, to come back to in one tap (docs/design/ta-me.md 4).
85
+ entry('switchAccount', t('ta.account.switchSignIn'), ArrowLeftRight, () => { var _a; return (_a = DeviceAccount.current()) === null || _a === void 0 ? void 0 : _a.switchAccount(); });
86
+ entry('signOut', t('ta.settings.signOut'), LogOut, () => void signOut(), { danger: true });
87
+ return MeUtil.keys({
88
+ vault: Boolean(vault),
89
+ own: own.map(view => view.id),
90
+ update: Boolean(update),
91
+ installable: installable && !standalone,
92
+ switchAccount: app && signedIn,
93
+ pairPhone: !app && !handheld,
94
+ }).map(group => group.map(key => entries[key]));
131
95
  }
132
96
  /** What the entries of the account open over the page. */
133
97
  export function AccountDialogs({ dialog, onClose, onDialog }) {
134
98
  return (React.createElement(React.Fragment, null,
135
99
  dialog === 'profile' && React.createElement(ProfileDialog, { onClose: onClose, onDevices: () => onDialog('devices') }),
136
100
  dialog === 'accounts' && React.createElement(AuthDialog, { onClose: onClose }),
137
- dialog === 'directory' && React.createElement(WorkingDirectoryPicker, { onClose: onClose }),
138
101
  dialog === 'relay' && React.createElement(RelayDialog, { onClose: onClose }),
139
102
  dialog === 'devices' && React.createElement(DevicesDialog, { onClose: onClose })));
140
103
  }
@@ -202,46 +165,29 @@ function onArrows(event) {
202
165
  }
203
166
  /**
204
167
  * The account at the foot of the rail, with the settings: who is signed in to which machine and whether the
205
- * page is connected (a dot on the figure while it is not), then the entries of useAccountEntries, the theme and
206
- * the language a step away, in a second menu beside the first. A phone has them as its tab Me (me-view.tsx).
168
+ * page is connected (a dot on the figure while it is not), then the entries of useAccountEntries. A phone has them as
169
+ * its tab Me (me-view.tsx).
207
170
  */
208
171
  export function AccountMenu({ onSettings, active }) {
209
172
  var _a, _b;
210
173
  const t = useT();
211
174
  const account = useAccount();
212
175
  const [open, setOpen] = React.useState(false);
213
- const [sub, setSub] = React.useState();
214
176
  const [dialog, setDialog] = React.useState();
215
177
  const root = React.useRef(null);
216
178
  const button = React.useRef(null);
217
179
  const id = React.useId();
218
- const close = React.useCallback(() => {
219
- setOpen(false);
220
- setSub(undefined);
221
- }, []);
180
+ const close = React.useCallback(() => setOpen(false), []);
222
181
  useDismiss(open, close, root, button);
223
182
  const groups = useAccountEntries(onSettings, setDialog);
224
183
  const label = `${t('ta.account.menu')} · ${account.state}`;
225
- const item = (entry) => {
226
- if (!entry.choices) {
227
- return (React.createElement("button", { key: entry.key, type: "button", role: "menuitem", className: `ta-account-item${entry.danger ? ' ta-danger' : ''}`, onMouseEnter: () => setSub(undefined), onClick: () => {
228
- close();
229
- entry.run();
230
- } },
231
- React.createElement(Icon, { icon: entry.icon, size: 15 }),
232
- React.createElement("span", { className: "ta-menu-label" }, entry.label),
233
- entry.keys && React.createElement(Keys, { keys: entry.keys })));
234
- }
235
- const shown = sub === entry.key;
236
- return (React.createElement("div", { key: entry.key, className: "ta-submenu-anchor" },
237
- React.createElement("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", "aria-expanded": shown, className: `ta-account-item${shown ? ' ta-on' : ''}`, onMouseEnter: () => setSub(entry.key), onClick: () => setSub(shown ? undefined : entry.key), onKeyDown: event => event.key === 'ArrowRight' && setSub(entry.key) },
238
- React.createElement(Icon, { icon: entry.icon, size: 15 }),
239
- React.createElement("span", { className: "ta-menu-label" }, entry.label),
240
- React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-menu-chevron" })),
241
- shown && (React.createElement("div", { className: "ta-account-menu ta-submenu", role: "menu", "aria-label": entry.label, onKeyDown: event => event.key === 'ArrowLeft' && setSub(undefined) }, entry.choices.map(choice => (React.createElement("button", { key: choice.key, type: "button", role: "menuitemradio", "aria-checked": choice.checked, className: "ta-account-item", onClick: choice.pick },
242
- React.createElement("span", { className: "ta-menu-check" }, choice.checked && React.createElement(Icon, { icon: Check, size: 14 })),
243
- React.createElement("span", { className: "ta-menu-label" }, choice.label))))))));
244
- };
184
+ const item = (entry) => (React.createElement("button", { key: entry.key, type: "button", role: "menuitem", className: `ta-account-item${entry.danger ? ' ta-danger' : ''}`, onClick: () => {
185
+ close();
186
+ entry.run();
187
+ } },
188
+ React.createElement(Icon, { icon: entry.icon, size: 15 }),
189
+ React.createElement("span", { className: "ta-menu-label" }, entry.label),
190
+ entry.keys && React.createElement(Keys, { keys: entry.keys })));
245
191
  return (React.createElement("div", { className: "ta-account", ref: root },
246
192
  React.createElement("button", { ref: button, type: "button", className: `ta-account-button${open || active ? ' ta-on' : ''}`, title: `${account.name} · ${account.state}`, "aria-label": label, "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": open ? id : undefined, "data-ta-place": "settings", onClick: () => (open ? close() : setOpen(true)) },
247
193
  React.createElement(AccountFigure, { size: 28, className: "ta-account-figure" }),