@celljs/ta-web 4.49.0 → 4.50.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 (382) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/account/account-side.js +4 -0
  4. package/esm/browser/account/device-account.d.ts +6 -0
  5. package/esm/browser/account/device-account.js +20 -5
  6. package/esm/browser/assistant/assistant-view.js +2 -0
  7. package/esm/browser/assistant/call-announcing.d.ts +25 -0
  8. package/esm/browser/assistant/call-announcing.js +32 -0
  9. package/esm/browser/assistant/call-answering.d.ts +43 -0
  10. package/esm/browser/assistant/call-answering.js +63 -0
  11. package/esm/browser/assistant/call-hearing.d.ts +53 -0
  12. package/esm/browser/assistant/call-hearing.js +98 -0
  13. package/esm/browser/assistant/call-pausing.d.ts +40 -0
  14. package/esm/browser/assistant/call-pausing.js +82 -0
  15. package/esm/browser/assistant/call-reading.d.ts +32 -0
  16. package/esm/browser/assistant/call-reading.js +35 -0
  17. package/esm/browser/assistant/call-revoicing.d.ts +33 -0
  18. package/esm/browser/assistant/call-revoicing.js +68 -0
  19. package/esm/browser/assistant/call-turns.d.ts +29 -0
  20. package/esm/browser/assistant/call-turns.js +33 -0
  21. package/esm/browser/assistant/spoken-answer.d.ts +21 -0
  22. package/esm/browser/assistant/spoken-answer.js +69 -0
  23. package/esm/browser/assistant/spoken-call.d.ts +7 -0
  24. package/esm/browser/assistant/spoken-call.js +16 -0
  25. package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
  26. package/esm/browser/assistant/voice-call.d.ts +47 -43
  27. package/esm/browser/assistant/voice-call.js +193 -219
  28. package/esm/browser/chat/chat-view.js +2 -1
  29. package/esm/browser/components/account-recovery-view.d.ts +11 -0
  30. package/esm/browser/components/account-recovery-view.js +81 -0
  31. package/esm/browser/components/account-view.d.ts +1 -2
  32. package/esm/browser/components/account-view.js +10 -1
  33. package/esm/browser/components/app-nav.js +19 -8
  34. package/esm/browser/components/app-shell-hooks.d.ts +5 -0
  35. package/esm/browser/components/app-shell-hooks.js +45 -0
  36. package/esm/browser/components/app-shell-state.js +2 -1
  37. package/esm/browser/components/app-view.js +9 -5
  38. package/esm/browser/components/chat-emoji.d.ts +35 -0
  39. package/esm/browser/components/chat-emoji.js +129 -0
  40. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  41. package/esm/browser/components/composer-attachments.d.ts +6 -0
  42. package/esm/browser/components/composer-attachments.js +12 -1
  43. package/esm/browser/components/composer-box-protocol.d.ts +15 -0
  44. package/esm/browser/components/composer-box.js +110 -87
  45. package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
  46. package/esm/browser/components/composer-drop-hooks.js +36 -0
  47. package/esm/browser/components/composer-emoji.js +1 -1
  48. package/esm/browser/components/composer-faces.d.ts +16 -0
  49. package/esm/browser/components/composer-faces.js +37 -0
  50. package/esm/browser/components/composer-media.d.ts +10 -0
  51. package/esm/browser/components/composer-media.js +12 -1
  52. package/esm/browser/components/composer-target.d.ts +4 -0
  53. package/esm/browser/components/composer-target.js +18 -7
  54. package/esm/browser/components/composer-type-focus.d.ts +24 -0
  55. package/esm/browser/components/composer-type-focus.js +17 -0
  56. package/esm/browser/components/composer-voice.d.ts +24 -0
  57. package/esm/browser/components/composer-voice.js +37 -0
  58. package/esm/browser/components/composer.d.ts +2 -2
  59. package/esm/browser/components/composer.js +39 -8
  60. package/esm/browser/components/context-menu.js +2 -1
  61. package/esm/browser/components/emoji-panel.d.ts +11 -7
  62. package/esm/browser/components/emoji-panel.js +40 -22
  63. package/esm/browser/components/extension-settings.js +2 -2
  64. package/esm/browser/components/folder-new.d.ts +18 -0
  65. package/esm/browser/components/folder-new.js +53 -0
  66. package/esm/browser/components/folder-picker.d.ts +5 -2
  67. package/esm/browser/components/folder-picker.js +18 -6
  68. package/esm/browser/components/host-view.d.ts +1 -1
  69. package/esm/browser/components/image-menu.d.ts +8 -3
  70. package/esm/browser/components/image-menu.js +34 -9
  71. package/esm/browser/components/markdown.js +9 -2
  72. package/esm/browser/components/media.js +3 -2
  73. package/esm/browser/components/message-list.js +2 -2
  74. package/esm/browser/components/message-steps.js +20 -11
  75. package/esm/browser/components/message-user.js +2 -2
  76. package/esm/browser/components/moved-notice.js +2 -1
  77. package/esm/browser/components/nav-places.d.ts +2 -0
  78. package/esm/browser/components/nav-places.js +4 -2
  79. package/esm/browser/components/phone-shell.d.ts +2 -0
  80. package/esm/browser/components/phone-shell.js +5 -1
  81. package/esm/browser/components/secret-text.d.ts +1 -1
  82. package/esm/browser/components/secret-text.js +4 -3
  83. package/esm/browser/components/session-view.js +3 -0
  84. package/esm/browser/components/settings-choices.d.ts +2 -1
  85. package/esm/browser/components/settings-choices.js +13 -5
  86. package/esm/browser/components/settings-more.js +3 -3
  87. package/esm/browser/components/settings-parts.js +13 -2
  88. package/esm/browser/components/share-item-sheet.js +7 -1
  89. package/esm/browser/components/tab-title.d.ts +27 -0
  90. package/esm/browser/components/tab-title.js +35 -0
  91. package/esm/browser/components/use-composer-attachments.d.ts +28 -0
  92. package/esm/browser/components/use-composer-attachments.js +65 -0
  93. package/esm/browser/components/use-composer-files.d.ts +25 -0
  94. package/esm/browser/components/use-composer-files.js +52 -0
  95. package/esm/browser/components/web-composer.d.ts +3 -1
  96. package/esm/browser/components/web-composer.js +3 -2
  97. package/esm/browser/components/workbench-view.js +1 -0
  98. package/esm/browser/components/working-directory.js +2 -1
  99. package/esm/browser/device/drag-move.d.ts +21 -0
  100. package/esm/browser/device/drag-move.js +86 -0
  101. package/esm/browser/extension/icons.js +7 -1
  102. package/esm/browser/extension/web-api-desktop.d.ts +19 -0
  103. package/esm/browser/extension/web-api-menus.d.ts +19 -0
  104. package/esm/browser/extension/web-api-spec.js +2 -0
  105. package/esm/browser/extension/web-extension-api.d.ts +24 -23
  106. package/esm/browser/extension/web-extension-context.d.ts +1 -0
  107. package/esm/browser/extension/web-extension-context.js +12 -5
  108. package/esm/browser/extension/web-extension-run.js +1 -0
  109. package/esm/browser/extension/web-share-ui.d.ts +1 -1
  110. package/esm/browser/extension/web-share-ui.js +2 -0
  111. package/esm/browser/extension/web-share.d.ts +13 -0
  112. package/esm/browser/extension/web-share.js +37 -2
  113. package/esm/browser/i18n/en/account.d.ts +18 -0
  114. package/esm/browser/i18n/en/account.js +18 -0
  115. package/esm/browser/i18n/en/call.js +1 -1
  116. package/esm/browser/i18n/en/chat.d.ts +15 -0
  117. package/esm/browser/i18n/en/chat.js +16 -1
  118. package/esm/browser/i18n/en/common.d.ts +2 -0
  119. package/esm/browser/i18n/en/common.js +2 -0
  120. package/esm/browser/i18n/en/discover.d.ts +2 -0
  121. package/esm/browser/i18n/en/discover.js +2 -0
  122. package/esm/browser/i18n/en/settings.d.ts +17 -0
  123. package/esm/browser/i18n/en/settings.js +17 -0
  124. package/esm/browser/i18n/ja/account.js +18 -0
  125. package/esm/browser/i18n/ja/call.js +1 -1
  126. package/esm/browser/i18n/ja/chat.js +16 -1
  127. package/esm/browser/i18n/ja/common.js +2 -0
  128. package/esm/browser/i18n/ja/discover.js +3 -1
  129. package/esm/browser/i18n/ja/settings.js +17 -0
  130. package/esm/browser/i18n/locales.d.ts +55 -1
  131. package/esm/browser/i18n/messages.d.ts +54 -0
  132. package/esm/browser/i18n/zh/account.js +18 -0
  133. package/esm/browser/i18n/zh/call.js +1 -1
  134. package/esm/browser/i18n/zh/chat.js +16 -1
  135. package/esm/browser/i18n/zh/common.js +2 -0
  136. package/esm/browser/i18n/zh/discover.js +3 -1
  137. package/esm/browser/i18n/zh/settings.js +17 -0
  138. package/esm/browser/i18n/zh-tw/account.js +18 -0
  139. package/esm/browser/i18n/zh-tw/call.js +1 -1
  140. package/esm/browser/i18n/zh-tw/chat.js +16 -1
  141. package/esm/browser/i18n/zh-tw/common.js +2 -0
  142. package/esm/browser/i18n/zh-tw/discover.js +3 -1
  143. package/esm/browser/i18n/zh-tw/settings.js +17 -0
  144. package/esm/browser/offline/kept-chats.d.ts +3 -1
  145. package/esm/browser/offline/kept-chats.js +1 -1
  146. package/esm/browser/partners/group-picker.d.ts +3 -2
  147. package/esm/browser/partners/group-picker.js +8 -3
  148. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  149. package/esm/browser/sandbox/work/work-docs.js +5 -2
  150. package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
  151. package/esm/browser/sandbox/work/work-frame.js +9 -3
  152. package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
  153. package/esm/browser/sandbox/work/work-gates.js +182 -0
  154. package/esm/browser/settings/agent-settings.js +1 -1
  155. package/esm/browser/settings/navigation.d.ts +38 -10
  156. package/esm/browser/settings/navigation.js +73 -17
  157. package/esm/browser/settings/settings-protocol.d.ts +16 -1
  158. package/esm/browser/settings/settings-protocol.js +20 -2
  159. package/esm/browser/settings/settings.js +4 -1
  160. package/esm/browser/style/base.d.ts +1 -1
  161. package/esm/browser/style/base.js +15 -2
  162. package/esm/browser/style/chat-list.d.ts +1 -1
  163. package/esm/browser/style/chat-list.js +6 -3
  164. package/esm/browser/style/conversation-column.d.ts +1 -1
  165. package/esm/browser/style/conversation-column.js +28 -8
  166. package/esm/browser/style/conversation.d.ts +1 -1
  167. package/esm/browser/style/conversation.js +5 -0
  168. package/esm/browser/style/device.js +5 -0
  169. package/esm/browser/style/pages.d.ts +1 -1
  170. package/esm/browser/style/pages.js +3 -3
  171. package/esm/browser/style/shell.d.ts +1 -1
  172. package/esm/browser/style/shell.js +13 -6
  173. package/esm/browser/style/tasks.d.ts +1 -1
  174. package/esm/browser/style/tasks.js +4 -2
  175. package/esm/browser/util/chat-emoji.d.ts +44 -0
  176. package/esm/browser/util/chat-emoji.js +269 -0
  177. package/esm/browser/util/composer-drop.d.ts +26 -0
  178. package/esm/browser/util/composer-drop.js +40 -0
  179. package/esm/browser/util/composer-files.d.ts +48 -0
  180. package/esm/browser/util/composer-files.js +99 -0
  181. package/esm/browser/util/composer.d.ts +13 -1
  182. package/esm/browser/util/composer.js +24 -6
  183. package/esm/browser/util/markdown.d.ts +5 -0
  184. package/esm/browser/util/markdown.js +18 -0
  185. package/esm/browser/util/message.d.ts +6 -1
  186. package/esm/browser/util/message.js +13 -2
  187. package/esm/browser/util/process.d.ts +10 -13
  188. package/esm/browser/util/process.js +31 -83
  189. package/esm/browser/util/turn-join.d.ts +38 -0
  190. package/esm/browser/util/turn-join.js +119 -0
  191. package/esm/browser/workbench-services.js +1 -1
  192. package/lib/browser/account/account-side.js +4 -0
  193. package/lib/browser/account/device-account.d.ts +6 -0
  194. package/lib/browser/account/device-account.js +20 -5
  195. package/lib/browser/assistant/assistant-view.js +2 -0
  196. package/lib/browser/assistant/call-announcing.d.ts +26 -0
  197. package/lib/browser/assistant/call-announcing.js +36 -0
  198. package/lib/browser/assistant/call-answering.d.ts +44 -0
  199. package/lib/browser/assistant/call-answering.js +67 -0
  200. package/lib/browser/assistant/call-hearing.d.ts +54 -0
  201. package/lib/browser/assistant/call-hearing.js +102 -0
  202. package/lib/browser/assistant/call-pausing.d.ts +41 -0
  203. package/lib/browser/assistant/call-pausing.js +86 -0
  204. package/lib/browser/assistant/call-reading.d.ts +33 -0
  205. package/lib/browser/assistant/call-reading.js +39 -0
  206. package/lib/browser/assistant/call-revoicing.d.ts +34 -0
  207. package/lib/browser/assistant/call-revoicing.js +72 -0
  208. package/lib/browser/assistant/call-turns.d.ts +30 -0
  209. package/lib/browser/assistant/call-turns.js +37 -0
  210. package/lib/browser/assistant/spoken-answer.d.ts +22 -0
  211. package/lib/browser/assistant/spoken-answer.js +73 -0
  212. package/lib/browser/assistant/spoken-call.d.ts +8 -0
  213. package/lib/browser/assistant/spoken-call.js +19 -0
  214. package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
  215. package/lib/browser/assistant/voice-call.d.ts +47 -43
  216. package/lib/browser/assistant/voice-call.js +192 -218
  217. package/lib/browser/chat/chat-view.js +2 -1
  218. package/lib/browser/components/account-recovery-view.d.ts +12 -0
  219. package/lib/browser/components/account-recovery-view.js +117 -0
  220. package/lib/browser/components/account-view.d.ts +1 -2
  221. package/lib/browser/components/account-view.js +10 -1
  222. package/lib/browser/components/app-nav.js +19 -8
  223. package/lib/browser/components/app-shell-hooks.d.ts +5 -0
  224. package/lib/browser/components/app-shell-hooks.js +46 -0
  225. package/lib/browser/components/app-shell-state.js +1 -0
  226. package/lib/browser/components/app-view.js +8 -4
  227. package/lib/browser/components/chat-emoji.d.ts +36 -0
  228. package/lib/browser/components/chat-emoji.js +167 -0
  229. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  230. package/lib/browser/components/composer-attachments.d.ts +6 -0
  231. package/lib/browser/components/composer-attachments.js +12 -0
  232. package/lib/browser/components/composer-box-protocol.d.ts +15 -0
  233. package/lib/browser/components/composer-box.js +107 -84
  234. package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
  235. package/lib/browser/components/composer-drop-hooks.js +72 -0
  236. package/lib/browser/components/composer-emoji.js +1 -1
  237. package/lib/browser/components/composer-faces.d.ts +17 -0
  238. package/lib/browser/components/composer-faces.js +73 -0
  239. package/lib/browser/components/composer-media.d.ts +10 -0
  240. package/lib/browser/components/composer-media.js +13 -0
  241. package/lib/browser/components/composer-target.d.ts +4 -0
  242. package/lib/browser/components/composer-target.js +18 -7
  243. package/lib/browser/components/composer-type-focus.d.ts +25 -0
  244. package/lib/browser/components/composer-type-focus.js +20 -0
  245. package/lib/browser/components/composer-voice.d.ts +25 -0
  246. package/lib/browser/components/composer-voice.js +73 -0
  247. package/lib/browser/components/composer.d.ts +2 -2
  248. package/lib/browser/components/composer.js +38 -7
  249. package/lib/browser/components/context-menu.js +2 -1
  250. package/lib/browser/components/emoji-panel.d.ts +11 -7
  251. package/lib/browser/components/emoji-panel.js +40 -22
  252. package/lib/browser/components/extension-settings.js +1 -1
  253. package/lib/browser/components/folder-new.d.ts +19 -0
  254. package/lib/browser/components/folder-new.js +90 -0
  255. package/lib/browser/components/folder-picker.d.ts +5 -2
  256. package/lib/browser/components/folder-picker.js +17 -5
  257. package/lib/browser/components/host-view.d.ts +1 -1
  258. package/lib/browser/components/image-menu.d.ts +8 -3
  259. package/lib/browser/components/image-menu.js +34 -9
  260. package/lib/browser/components/markdown.js +9 -2
  261. package/lib/browser/components/media.js +3 -2
  262. package/lib/browser/components/message-list.js +2 -2
  263. package/lib/browser/components/message-steps.js +20 -11
  264. package/lib/browser/components/message-user.js +1 -1
  265. package/lib/browser/components/moved-notice.js +2 -1
  266. package/lib/browser/components/nav-places.d.ts +2 -0
  267. package/lib/browser/components/nav-places.js +4 -2
  268. package/lib/browser/components/phone-shell.d.ts +2 -0
  269. package/lib/browser/components/phone-shell.js +5 -1
  270. package/lib/browser/components/secret-text.d.ts +1 -1
  271. package/lib/browser/components/secret-text.js +4 -3
  272. package/lib/browser/components/session-view.js +3 -0
  273. package/lib/browser/components/settings-choices.d.ts +2 -1
  274. package/lib/browser/components/settings-choices.js +12 -4
  275. package/lib/browser/components/settings-more.js +2 -2
  276. package/lib/browser/components/settings-parts.js +11 -0
  277. package/lib/browser/components/share-item-sheet.js +7 -1
  278. package/lib/browser/components/tab-title.d.ts +28 -0
  279. package/lib/browser/components/tab-title.js +38 -0
  280. package/lib/browser/components/use-composer-attachments.d.ts +29 -0
  281. package/lib/browser/components/use-composer-attachments.js +101 -0
  282. package/lib/browser/components/use-composer-files.d.ts +26 -0
  283. package/lib/browser/components/use-composer-files.js +88 -0
  284. package/lib/browser/components/web-composer.d.ts +3 -1
  285. package/lib/browser/components/web-composer.js +3 -2
  286. package/lib/browser/components/workbench-view.js +1 -0
  287. package/lib/browser/components/working-directory.js +2 -1
  288. package/lib/browser/device/drag-move.d.ts +22 -0
  289. package/lib/browser/device/drag-move.js +122 -0
  290. package/lib/browser/extension/icons.js +6 -0
  291. package/lib/browser/extension/web-api-desktop.d.ts +19 -0
  292. package/lib/browser/extension/web-api-menus.d.ts +19 -0
  293. package/lib/browser/extension/web-api-spec.js +2 -0
  294. package/lib/browser/extension/web-extension-api.d.ts +24 -23
  295. package/lib/browser/extension/web-extension-context.d.ts +1 -0
  296. package/lib/browser/extension/web-extension-context.js +12 -5
  297. package/lib/browser/extension/web-extension-run.js +1 -0
  298. package/lib/browser/extension/web-share-ui.d.ts +1 -1
  299. package/lib/browser/extension/web-share-ui.js +2 -0
  300. package/lib/browser/extension/web-share.d.ts +13 -0
  301. package/lib/browser/extension/web-share.js +37 -2
  302. package/lib/browser/i18n/en/account.d.ts +18 -0
  303. package/lib/browser/i18n/en/account.js +18 -0
  304. package/lib/browser/i18n/en/call.js +1 -1
  305. package/lib/browser/i18n/en/chat.d.ts +15 -0
  306. package/lib/browser/i18n/en/chat.js +16 -1
  307. package/lib/browser/i18n/en/common.d.ts +2 -0
  308. package/lib/browser/i18n/en/common.js +2 -0
  309. package/lib/browser/i18n/en/discover.d.ts +2 -0
  310. package/lib/browser/i18n/en/discover.js +2 -0
  311. package/lib/browser/i18n/en/settings.d.ts +17 -0
  312. package/lib/browser/i18n/en/settings.js +17 -0
  313. package/lib/browser/i18n/ja/account.js +18 -0
  314. package/lib/browser/i18n/ja/call.js +1 -1
  315. package/lib/browser/i18n/ja/chat.js +16 -1
  316. package/lib/browser/i18n/ja/common.js +2 -0
  317. package/lib/browser/i18n/ja/discover.js +3 -1
  318. package/lib/browser/i18n/ja/settings.js +17 -0
  319. package/lib/browser/i18n/locales.d.ts +55 -1
  320. package/lib/browser/i18n/messages.d.ts +54 -0
  321. package/lib/browser/i18n/zh/account.js +18 -0
  322. package/lib/browser/i18n/zh/call.js +1 -1
  323. package/lib/browser/i18n/zh/chat.js +16 -1
  324. package/lib/browser/i18n/zh/common.js +2 -0
  325. package/lib/browser/i18n/zh/discover.js +3 -1
  326. package/lib/browser/i18n/zh/settings.js +17 -0
  327. package/lib/browser/i18n/zh-tw/account.js +18 -0
  328. package/lib/browser/i18n/zh-tw/call.js +1 -1
  329. package/lib/browser/i18n/zh-tw/chat.js +16 -1
  330. package/lib/browser/i18n/zh-tw/common.js +2 -0
  331. package/lib/browser/i18n/zh-tw/discover.js +3 -1
  332. package/lib/browser/i18n/zh-tw/settings.js +17 -0
  333. package/lib/browser/offline/kept-chats.d.ts +3 -1
  334. package/lib/browser/offline/kept-chats.js +1 -1
  335. package/lib/browser/partners/group-picker.d.ts +3 -2
  336. package/lib/browser/partners/group-picker.js +8 -3
  337. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  338. package/lib/browser/sandbox/work/work-docs.js +5 -2
  339. package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
  340. package/lib/browser/sandbox/work/work-frame.js +9 -3
  341. package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
  342. package/lib/browser/sandbox/work/work-gates.js +185 -0
  343. package/lib/browser/settings/agent-settings.js +1 -1
  344. package/lib/browser/settings/navigation.d.ts +38 -10
  345. package/lib/browser/settings/navigation.js +74 -18
  346. package/lib/browser/settings/settings-protocol.d.ts +16 -1
  347. package/lib/browser/settings/settings-protocol.js +21 -3
  348. package/lib/browser/settings/settings.js +3 -0
  349. package/lib/browser/style/base.d.ts +1 -1
  350. package/lib/browser/style/base.js +15 -2
  351. package/lib/browser/style/chat-list.d.ts +1 -1
  352. package/lib/browser/style/chat-list.js +6 -3
  353. package/lib/browser/style/conversation-column.d.ts +1 -1
  354. package/lib/browser/style/conversation-column.js +28 -8
  355. package/lib/browser/style/conversation.d.ts +1 -1
  356. package/lib/browser/style/conversation.js +5 -0
  357. package/lib/browser/style/device.js +5 -0
  358. package/lib/browser/style/pages.d.ts +1 -1
  359. package/lib/browser/style/pages.js +3 -3
  360. package/lib/browser/style/shell.d.ts +1 -1
  361. package/lib/browser/style/shell.js +13 -6
  362. package/lib/browser/style/tasks.d.ts +1 -1
  363. package/lib/browser/style/tasks.js +4 -2
  364. package/lib/browser/util/chat-emoji.d.ts +45 -0
  365. package/lib/browser/util/chat-emoji.js +272 -0
  366. package/lib/browser/util/composer-drop.d.ts +27 -0
  367. package/lib/browser/util/composer-drop.js +43 -0
  368. package/lib/browser/util/composer-files.d.ts +49 -0
  369. package/lib/browser/util/composer-files.js +102 -0
  370. package/lib/browser/util/composer.d.ts +13 -1
  371. package/lib/browser/util/composer.js +24 -6
  372. package/lib/browser/util/markdown.d.ts +5 -0
  373. package/lib/browser/util/markdown.js +18 -0
  374. package/lib/browser/util/message.d.ts +6 -1
  375. package/lib/browser/util/message.js +13 -2
  376. package/lib/browser/util/process.d.ts +10 -13
  377. package/lib/browser/util/process.js +32 -84
  378. package/lib/browser/util/turn-join.d.ts +39 -0
  379. package/lib/browser/util/turn-join.js +122 -0
  380. package/lib/browser/workbench-services.js +1 -1
  381. package/package.json +7 -7
  382. package/public/emoji/wechat-v1.webp +0 -0
@@ -0,0 +1,86 @@
1
+ import * as React from 'react';
2
+ /** How far a press moves before it drags: less is a click. */
3
+ const MOVE_PX = 6;
4
+ /** Where the entries are: the rail of the desktop, the tabs at the bottom of a phone. */
5
+ const CONTAINER = '.ta-rail-items, .ta-tabbar';
6
+ /** Where a drop lands: the place of the entry whose middle is nearest the pointer, along the row or the column. */
7
+ function landing(target, x, y) {
8
+ var _a;
9
+ var _b;
10
+ const container = (_a = target === null || target === void 0 ? void 0 : target.closest) === null || _a === void 0 ? void 0 : _a.call(target, CONTAINER);
11
+ const entries = container ? [...container.querySelectorAll('[data-nav-page]')] : [];
12
+ const row = !!(container === null || container === void 0 ? void 0 : container.classList.contains('ta-tabbar'));
13
+ let nearest;
14
+ for (const entry of entries) {
15
+ const rect = entry.getBoundingClientRect();
16
+ const distance = row ? Math.abs(x - (rect.left + rect.width / 2)) : Math.abs(y - (rect.top + rect.height / 2));
17
+ if (!nearest || distance < nearest.distance) {
18
+ nearest = { id: (_b = entry.getAttribute('data-nav-page')) !== null && _b !== void 0 ? _b : '', distance };
19
+ }
20
+ }
21
+ return nearest ? { target: nearest.id } : {};
22
+ }
23
+ export function useDragMove(move) {
24
+ const [dragging, setDragging] = React.useState(undefined);
25
+ const current = React.useRef(move);
26
+ current.current = move;
27
+ const stop = React.useRef(() => undefined);
28
+ React.useEffect(() => stop.current, []);
29
+ const onPointerDown = React.useCallback((event) => {
30
+ var _a, _b;
31
+ var _c;
32
+ const entry = (_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, `[${current.current.attr}]`);
33
+ if (!entry || !event.isPrimary || event.button !== 0 || event.pointerType === 'touch') {
34
+ return;
35
+ }
36
+ const page = (_c = entry.getAttribute(current.current.attr)) !== null && _c !== void 0 ? _c : '';
37
+ const from = { x: event.clientX, y: event.clientY };
38
+ let on = false;
39
+ let at = {};
40
+ const begin = (x, y) => {
41
+ on = true;
42
+ entry.setAttribute('data-dragging', '');
43
+ document.documentElement.setAttribute('data-dragging', '');
44
+ at = landing(document.elementFromPoint(x, y), x, y);
45
+ setDragging({ page, ...at });
46
+ };
47
+ const finish = (commit) => {
48
+ if (on) {
49
+ entry.removeAttribute('data-dragging');
50
+ document.documentElement.removeAttribute('data-dragging');
51
+ setDragging(undefined);
52
+ if (commit) {
53
+ current.current.onMove(page, at.target);
54
+ }
55
+ }
56
+ off();
57
+ };
58
+ const onMove = (moved) => {
59
+ var _a;
60
+ if (!on) {
61
+ if (Math.hypot(moved.clientX - from.x, moved.clientY - from.y) <= MOVE_PX) {
62
+ return;
63
+ }
64
+ // Past a few pixels it is a drag: no selection of the icon under it, no click of the press.
65
+ (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
66
+ begin(moved.clientX, moved.clientY);
67
+ return;
68
+ }
69
+ at = landing(document.elementFromPoint(moved.clientX, moved.clientY), moved.clientX, moved.clientY);
70
+ setDragging({ page, ...at });
71
+ };
72
+ const onUp = () => finish(true);
73
+ const onCancel = () => finish(false);
74
+ const off = () => {
75
+ document.removeEventListener('pointermove', onMove);
76
+ document.removeEventListener('pointerup', onUp);
77
+ document.removeEventListener('pointercancel', onCancel);
78
+ };
79
+ document.addEventListener('pointermove', onMove);
80
+ document.addEventListener('pointerup', onUp);
81
+ document.addEventListener('pointercancel', onCancel);
82
+ stop.current = off;
83
+ }, []);
84
+ return { onPointerDown, dragging };
85
+ }
86
+ //# sourceMappingURL=drag-move.js.map
@@ -1,4 +1,4 @@
1
- import { AlarmClock, AlignCenter, AlignLeft, AlignRight, Aperture, AppWindow, Archive, ArrowDown, ArrowDownToLine, ArrowDownWideNarrow, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, ArrowUpNarrowWide, Bell, BellOff, BetweenHorizontalStart, BetweenVerticalStart, Bold, BookOpen, Bot, Box, Bug, Building2, Calendar, Camera, CaseSensitive, ChartColumn, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, CloudUpload, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, Eraser, ExternalLink, Eye, EyeOff, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderLock, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, Hand, HardDrive, Hash, Headphones, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Maximize2, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minimize2, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Navigation, Package, PackageOpen, PaintBucket, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Presentation, Puzzle, QrCode, Quote, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, Scan, ScanLine, ScrollText, Search, Send, Server, Share2, Sheet, Shield, ShieldAlert, ShieldCheck, Shuffle, Sigma, SlidersHorizontal, Smartphone, Snowflake, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, TableCellsMerge, Target, Text, ThumbsDown, ThumbsUp, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
1
+ import { AlarmClock, AlignCenter, AlignLeft, AlignRight, Aperture, AppWindow, Archive, ArrowDown, ArrowDownToLine, ArrowDownWideNarrow, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, ArrowUpNarrowWide, Bell, BellOff, BetweenHorizontalStart, BetweenVerticalStart, Blocks, Bold, BookOpen, Bot, Box, Bug, Building2, Calendar, Camera, CaseSensitive, ChartColumn, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, CloudUpload, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, Eraser, ExternalLink, Eye, EyeOff, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderLock, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, Hand, HardDrive, Hash, Headphones, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Maximize2, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minimize2, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Navigation, Package, PackageOpen, PaintBucket, Palette, Paperclip, Pause, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Presentation, Puzzle, QrCode, Quote, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, Scan, ScanLine, ScrollText, Search, Send, Server, Share2, Sheet, Shield, ShieldAlert, ShieldCheck, Shuffle, Sigma, SkipBack, SkipForward, SlidersHorizontal, Smartphone, Snowflake, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, TableCellsMerge, Target, Text, ThumbsDown, ThumbsUp, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, VolumeX, WholeWord, Wrench, X, Zap, } from 'lucide-react';
2
2
  /** The icons a web extension gets as `pi.ui.icons`; names are lucide's. Only add: removing one breaks extensions. */
3
3
  export const WEB_ICONS = Object.freeze({
4
4
  AlignCenter,
@@ -13,8 +13,11 @@ export const WEB_ICONS = Object.freeze({
13
13
  Eraser,
14
14
  PaintBucket,
15
15
  Sigma,
16
+ SkipBack,
17
+ SkipForward,
16
18
  Snowflake,
17
19
  TableCellsMerge,
20
+ Blocks,
18
21
  AlarmClock,
19
22
  Aperture,
20
23
  AppWindow,
@@ -132,7 +135,9 @@ export const WEB_ICONS = Object.freeze({
132
135
  Navigation,
133
136
  Package,
134
137
  PackageOpen,
138
+ Palette,
135
139
  Paperclip,
140
+ Pause,
136
141
  Pencil,
137
142
  Phone,
138
143
  Pin,
@@ -192,6 +197,7 @@ export const WEB_ICONS = Object.freeze({
192
197
  UserPlus,
193
198
  Users,
194
199
  Volume2,
200
+ VolumeX,
195
201
  WholeWord,
196
202
  Wrench,
197
203
  X,
@@ -24,6 +24,25 @@ export interface WebDeviceUI {
24
24
  * finger lands on something, `medium` for what the user should feel, a pat say. Newer than some Ta apps.
25
25
  */
26
26
  haptic?(strength?: 'light' | 'medium'): void;
27
+ /**
28
+ * Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
29
+ * this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
30
+ */
31
+ readonly desktop?: WebDesktop;
32
+ /**
33
+ * Ta Desktop: sends a command of the Chrome DevTools Protocol to the page of a `<webview>` of this page
34
+ * (its `getWebContentsId()`), as that page's debugger, and resolves with its result; `undefined`
35
+ * elsewhere. Only commands on the page itself: Accessibility, CSS, DOM, DOMSnapshot, Emulation, Input,
36
+ * Log, Overlay, Page and Runtime, without those that touch files, downloads or navigate (use the
37
+ * element's `loadURL`); the app refuses the rest.
38
+ */
39
+ readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
40
+ /**
41
+ * Ta Desktop: hears the tabs the pages of this page's `<webview>`s open or close (WebviewTabEvent); returns how to
42
+ * stop. Hearing tells the app the view has tabs: until then, and in an older app, a page opens its new tabs in place
43
+ * and Cmd+W goes to the app. `undefined` elsewhere.
44
+ */
45
+ readonly onWebviewTab?: (listener: (event: WebviewTabEvent) => void) => () => void;
27
46
  }
28
47
  /**
29
48
  * A tab the browser view should open or close, as Ta Desktop tells it (`ui.onWebviewTab`): a page of a webview opened a
@@ -1,5 +1,6 @@
1
1
  /** Part of the web extension API (web-extension-api.ts, which exports it all): the entries extensions add to menus of the page. */
2
2
  import type { TaWorkPoint } from '@celljs/ta-protocol';
3
+ import type { WebComposerImage, WebComposerImageLimits } from './web-api-components.js';
3
4
  import type { WebMenuItem } from './web-api-contributions.js';
4
5
  import type { WebIcon } from './web-extension-api.js';
5
6
  /** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
@@ -72,6 +73,17 @@ export type WebShareItem = {
72
73
  gets?: string;
73
74
  /** An icon of the page (WEB_ICONS) for what it is. */
74
75
  icon?: string;
76
+ } | {
77
+ /**
78
+ * A picture or a video of a conversation or a chat, long pressed (its menu: Forward, Share). `url` is one the
79
+ * page can fetch (data:, blob: or http:), of the picture itself, not the smaller one shown; `accepts` reads
80
+ * `media`, not the bytes.
81
+ */
82
+ kind: 'media';
83
+ media: 'image' | 'video';
84
+ url: string;
85
+ /** As it is called, with its extension: `photo.jpg`. */
86
+ name: string;
75
87
  };
76
88
  /**
77
89
  * A way to share (registerShareWay): a tile of the share sheet, for what it takes. Send to friends and group chats,
@@ -84,6 +96,8 @@ export interface WebShareWay {
84
96
  icon: WebIcon;
85
97
  /** Its place among the tiles, the lowest first; default 100. */
86
98
  order?: number;
99
+ /** Sends it into chats the user picks: Forward in the menu of a picture or a video goes straight to it. */
100
+ forward?: boolean;
87
101
  /** Whether it takes the item; read as the sheet opens. */
88
102
  accepts(item: WebShareItem): boolean;
89
103
  /** The user picked it: the sheet has closed, the way shows what it needs (who to send to, the words of a post). */
@@ -96,6 +110,11 @@ export interface WebShareUI {
96
110
  * Share under a block and in the menu of a file opens it. Newer than some Ta apps: `pi.ui.share?.(…)`.
97
111
  */
98
112
  share(item: WebShareItem): void;
113
+ /**
114
+ * A picture made smaller as the message box makes it (WebComposerProps.images with `limits`), the picture as it
115
+ * was kept as `original` when it was: for one forwarded into a chat. Newer than some Ta apps: `pi.ui.shrinkImage?.(…)`.
116
+ */
117
+ shrinkImage?(image: WebComposerImage, limits: WebComposerImageLimits): Promise<WebComposerImage>;
99
118
  }
100
119
  /** What a web extension adds to the menus of the page (WebExtensionAPI extends it). */
101
120
  export interface WebMenus {
@@ -75,6 +75,7 @@ export const WEB_UI_SPEC = {
75
75
  FullScreen: component(B),
76
76
  Stack: component(B),
77
77
  Markdown: component(B),
78
+ EmojiText: component(B),
78
79
  Empty: component(B),
79
80
  Loading: component(B),
80
81
  Skeleton: component(B),
@@ -107,6 +108,7 @@ export const WEB_UI_SPEC = {
107
108
  saveFile: call(A),
108
109
  shareExtension: fire(A),
109
110
  share: fire(B),
111
+ shrinkImage: call(B),
110
112
  stopExtension: fire(A),
111
113
  forgetPage: fire(A),
112
114
  useView: hook(A),
@@ -7,7 +7,7 @@ import type { Language, Theme } from '../settings/settings-protocol.js';
7
7
  import type { WebCodeRendererOptions, WebCodeRendererProps, WebMarkdownProps } from './web-api-code.js';
8
8
  import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components.js';
9
9
  import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebNotifyOptions, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
10
- import type { WebDesktop, WebDeviceUI, WebFileDrag, WebviewTabEvent } from './web-api-desktop.js';
10
+ import type { WebDeviceUI, WebFileDrag } from './web-api-desktop.js';
11
11
  import type { WebEditorsUI } from './web-api-editors.js';
12
12
  import type { WebFileViews, WebFileViewsUI } from './web-api-file-views.js';
13
13
  import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js';
@@ -245,31 +245,12 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
245
245
  readonly supportsWebview: boolean;
246
246
  /** The message box (`Composer`) takes `videos`, picked with the pictures. Newer than some Ta apps. */
247
247
  readonly composerVideos?: boolean;
248
- /**
249
- * Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
250
- * this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
251
- */
252
- readonly desktop?: WebDesktop;
253
248
  /**
254
249
  * Files dragged between views, as the explorer drags them: `set` them in `dragstart`. Dropped on the
255
250
  * message box of a conversation they become `@` references (relative to its directory when they are in
256
251
  * it); a terminal takes their `paths`; anywhere else they are their paths as text.
257
252
  */
258
253
  readonly fileDrag: WebFileDrag;
259
- /**
260
- * Ta Desktop: sends a command of the Chrome DevTools Protocol to the page of a `<webview>` of this page
261
- * (its `getWebContentsId()`), as that page's debugger, and resolves with its result; `undefined`
262
- * elsewhere. Only commands on the page itself: Accessibility, CSS, DOM, DOMSnapshot, Emulation, Input,
263
- * Log, Overlay, Page and Runtime, without those that touch files, downloads or navigate (use the
264
- * element's `loadURL`); the app refuses the rest.
265
- */
266
- readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
267
- /**
268
- * Ta Desktop: hears the tabs the pages of this page's `<webview>`s open or close (WebviewTabEvent); returns how to
269
- * stop. Hearing tells the app the view has tabs: until then, and in an older app, a page opens its new tabs in place
270
- * and Cmd+W goes to the app. `undefined` elsewhere.
271
- */
272
- readonly onWebviewTab?: (listener: (event: WebviewTabEvent) => void) => () => void;
273
254
  /**
274
255
  * Into the message box in front (a conversation's, or `ui.Composer` of a page): `quote` before what it holds, `images`
275
256
  * (base64) as if pasted, `text` typed at its end (newer than some Ta apps); false when none shows.
@@ -338,9 +319,21 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
338
319
  usePages(): readonly WebPageInfo[];
339
320
  /**
340
321
  * A React hook: the context menu of the page, as its lists open it (a right click, a long press on a touch
341
- * screen): the menu to render, and `open` for `onContextMenu`, with sections set apart by a line.
342
- */
343
- useContextMenu(): [React.ReactNode, (event: React.MouseEvent, sections: WebMenuItem[][]) => void];
322
+ * screen): the menu to render, `open` for `onContextMenu`, with sections set apart by a line, and `openAt` to
323
+ * open it where the user pressed (the point and the row around it), as an entry of a menu opening another.
324
+ */
325
+ useContextMenu(): [
326
+ React.ReactNode,
327
+ (event: React.MouseEvent, sections: WebMenuItem[][]) => void,
328
+ (at: {
329
+ x: number;
330
+ y: number;
331
+ around?: {
332
+ top: number;
333
+ bottom: number;
334
+ };
335
+ }, sections: WebMenuItem[][], caption?: string) => void
336
+ ];
344
337
  /**
345
338
  * For a menu of your own (`position: fixed`, its entries `role="menuitem"`), from a layout effect: places it
346
339
  * where it was `opened` as the menus of the page go (at the pointer; under a finger, out from under it and the
@@ -481,6 +474,14 @@ export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI,
481
474
  readonly keepAwake?: () => () => void;
482
475
  /** As the conversations show it (WebMarkdownProps). */
483
476
  readonly Markdown: React.ComponentType<WebMarkdownProps>;
477
+ /**
478
+ * Words with the faces of a chat said in them (`[微笑]`, as WeChat says them) drawn as their pictures, as the
479
+ * conversations draw them; the words alone as they are. Newer than some Ta apps: `pi.ui.EmojiText ?? …`.
480
+ */
481
+ readonly EmojiText?: React.ComponentType<{
482
+ text: string;
483
+ className?: string;
484
+ }>;
484
485
  /**
485
486
  * A conversation to read, drawn as those of the page are, with what extensions draw in them (cards, plots,
486
487
  * 3D); nothing in it acts. Newer than some Ta apps: `pi.ui.Conversation ?? …`.
@@ -58,6 +58,7 @@ export declare class WebExtensionContext {
58
58
  settings: TaSettings;
59
59
  }>;
60
60
  protected readonly listDirectory: (directory: string) => Promise<import("@celljs/ta-protocol").TaDirEntry[]>;
61
+ protected readonly createDirectory: (directory: string, name: string) => Promise<void>;
61
62
  /** The message box, whose button of the directory lists those of the server. */
62
63
  protected readonly composer: (props: WebComposerProps) => React.FunctionComponentElement<import("../components/web-composer.js").WebComposerHostProps>;
63
64
  /** The message box of an extension: its drafts under its name, apart from those of the others. */
@@ -5,6 +5,7 @@ import { TaskIcon } from '../assistant/task-views.js';
5
5
  import { webVoice } from '../assistant/web-voice.js';
6
6
  import { useBusy } from '../components/busy.js';
7
7
  import { ChatAskUtil, LET_GO_ASKS } from '../components/chat-asks.js';
8
+ import { EmojiText } from '../components/chat-emoji.js';
8
9
  import { PINNED } from '../components/chat-list-util.js';
9
10
  import { CodeEditor } from '../components/code-editor.js';
10
11
  import { ComposerTarget } from '../components/composer-target.js';
@@ -73,12 +74,14 @@ export class WebExtensionContext {
73
74
  this.codeEditor = (props) => React.createElement(CodeEditor, { ...props, settings: this.host.settings });
74
75
  this.diffEditor = (props) => React.createElement(DiffEditor, { ...props, settings: this.host.settings });
75
76
  this.listDirectory = (directory) => this.host.workbench.workspace.listDirectory('.', directory);
77
+ this.createDirectory = (directory, name) => this.host.workbench.workspace.createDirectory(name, directory);
76
78
  /** The message box, whose button of the directory lists those of the server. */
77
79
  this.composer = (props) => { var _a; return React.createElement(WebComposer, {
78
80
  ...props,
79
81
  notices: this.host.notices,
80
82
  server: this.host.workbench.server,
81
83
  listDirectory: this.listDirectory,
84
+ createDirectory: this.createDirectory,
82
85
  serverCwd: (_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd,
83
86
  remote: this.host.workbench,
84
87
  }); };
@@ -87,6 +90,7 @@ export class WebExtensionContext {
87
90
  this.modelPicker = (props) => React.createElement(SettingsModelPicker, { ...props, settings: this.host.workbench.settings });
88
91
  this.folderPicker = ({ initial, onPick, onClose }) => { var _a; return React.createElement(FolderPicker, {
89
92
  list: this.listDirectory,
93
+ create: this.createDirectory,
90
94
  initial: initial || ((_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.',
91
95
  remote: this.host.workbench,
92
96
  onPick: async (path) => onPick(path),
@@ -340,11 +344,13 @@ export class WebExtensionContext {
340
344
  return React.useSyncExternalStore(host.subscribePages, () => host.extensions.pages());
341
345
  },
342
346
  useContextMenu: () => {
343
- const [menu, open] = useContextMenu();
344
- const openSections = React.useCallback((event, sections) => open(event, sections
347
+ const [menu, open, openAt] = useContextMenu();
348
+ const items = React.useCallback((sections) => sections
345
349
  .filter(section => section.length > 0)
346
- .flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])), [open]);
347
- return [menu, openSections];
350
+ .flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section]), []);
351
+ const openSections = React.useCallback((event, sections) => open(event, items(sections)), [open, items]);
352
+ const openSectionsAt = React.useCallback((at, sections, caption) => openAt(at, items(sections), caption), [openAt, items]);
353
+ return [menu, openSections, openSectionsAt];
348
354
  },
349
355
  attachMenu: ContextMenuUtil.attach,
350
356
  scanCode: CodeScan.readable()
@@ -413,8 +419,9 @@ export class WebExtensionContext {
413
419
  voice: WebExtensionRunUtil.voice(run, this.voice),
414
420
  // Let go as the extension stops, whether or not it did; nothing held once stopped.
415
421
  keepAwake: () => WebExtensionRunUtil.track(run, () => KeepAwake.shared.hold()),
416
- apps: TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: WEB_ICONS.Puzzle, stopped: () => run.stopped }),
422
+ apps: TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: WEB_ICONS.Blocks, stopped: () => run.stopped }),
417
423
  Markdown,
424
+ EmojiText,
418
425
  Conversation: ConversationView,
419
426
  useChatScroll: (sent, key) => useConversationScroll(sent, { sentTo: 'bottom', key }),
420
427
  Empty: EmptyState,
@@ -68,6 +68,7 @@ export var WebExtensionRunUtil;
68
68
  label: way.label,
69
69
  icon: way.icon,
70
70
  order: way.order,
71
+ forward: way.forward,
71
72
  accepts: item => {
72
73
  try {
73
74
  return !run.stopped && way.accepts(item);
@@ -4,4 +4,4 @@ import type { WebExtensionContextHost } from './web-extension-context.js';
4
4
  * What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
5
5
  * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
6
6
  */
7
- export declare function shareUI(host: Pick<WebExtensionContextHost, 'extensions' | 'notices' | 'workbench'>, stopped: () => boolean): Pick<WebExtensionUI, 'shareExtension' | 'share' | 'ShareSheet'>;
7
+ export declare function shareUI(host: Pick<WebExtensionContextHost, 'extensions' | 'notices' | 'workbench'>, stopped: () => boolean): Pick<WebExtensionUI, 'shareExtension' | 'share' | 'shrinkImage' | 'ShareSheet'>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ShareSheet } from '../components/share-sheet.js';
3
+ import { ImageShrink } from '../util/image-shrink.js';
3
4
  /**
4
5
  * What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
5
6
  * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
@@ -15,6 +16,7 @@ export function shareUI(host, stopped) {
15
16
  return {
16
17
  shareExtension: target => !stopped() && host.extensions.share(target),
17
18
  share: item => !stopped() && host.extensions.shareItem(item),
19
+ shrinkImage: (image, limits) => ImageShrink.shrink(image, limits),
18
20
  ShareSheet: sheet,
19
21
  };
20
22
  }
@@ -8,6 +8,19 @@ export declare namespace WebShareUtil {
8
8
  function ofBlock(block: WebCodeRef): WebShareItem | undefined;
9
9
  /** A file; none for a folder. */
10
10
  function ofFile(file: WebFileRef): WebShareItem | undefined;
11
+ /**
12
+ * A picture or a video at `url`, called `name` when given, else as the end of its path says (a file of the
13
+ * workspace, of the web), else by its kind and the type a data: URL says.
14
+ */
15
+ function ofMedia(media: 'image' | 'video', url: string, name?: string): WebShareItem;
16
+ /**
17
+ * The ways that take a picture or a video (`accepts` reads `media`, not its URL, known only once picked): Forward
18
+ * goes straight to the one that sends into chats (WebShareWay.forward), Share to the sheet when any other takes it.
19
+ */
20
+ function mediaWays(all: readonly WebShareWay[], media: 'image' | 'video'): {
21
+ forward?: WebShareWay;
22
+ others: WebShareWay[];
23
+ };
11
24
  /** The ways that take it, in their order. */
12
25
  function ways(all: readonly WebShareWay[], item: WebShareItem): WebShareWay[];
13
26
  /** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
@@ -17,6 +17,27 @@ export var WebShareUtil;
17
17
  return file.kind === 'file' ? { kind: 'file', file } : undefined;
18
18
  }
19
19
  WebShareUtil.ofFile = ofFile;
20
+ /**
21
+ * A picture or a video at `url`, called `name` when given, else as the end of its path says (a file of the
22
+ * workspace, of the web), else by its kind and the type a data: URL says.
23
+ */
24
+ function ofMedia(media, url, name) {
25
+ var _a;
26
+ const data = /^data:(image|video)\/([\w.+-]+)[;,]/i.exec(url);
27
+ const last = data || url.startsWith('blob:') ? '' : decodeURIComponent((_a = url.split(/[?#]/)[0].split('/').pop()) !== null && _a !== void 0 ? _a : '');
28
+ const extension = data ? `.${data[2].toLowerCase() === 'jpeg' ? 'jpg' : data[2].toLowerCase()}` : '';
29
+ return { kind: 'media', media, url, name: name || last || `${media}${extension}` };
30
+ }
31
+ WebShareUtil.ofMedia = ofMedia;
32
+ /**
33
+ * The ways that take a picture or a video (`accepts` reads `media`, not its URL, known only once picked): Forward
34
+ * goes straight to the one that sends into chats (WebShareWay.forward), Share to the sheet when any other takes it.
35
+ */
36
+ function mediaWays(all, media) {
37
+ const taking = ways(all, { kind: 'media', media, url: '', name: '' });
38
+ return { forward: taking.find(way => way.forward), others: taking.filter(way => !way.forward) };
39
+ }
40
+ WebShareUtil.mediaWays = mediaWays;
20
41
  /** The ways that take it, in their order. */
21
42
  function ways(all, item) {
22
43
  return all.filter(way => way.accepts(item));
@@ -25,13 +46,27 @@ export var WebShareUtil;
25
46
  /** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
26
47
  function name(item) {
27
48
  var _a;
28
- return item.kind === 'file' ? item.file.name : item.kind === 'link' ? item.title : ((_a = TaWorkTitle.of(item.language, item.code)) !== null && _a !== void 0 ? _a : '');
49
+ return item.kind === 'file'
50
+ ? item.file.name
51
+ : item.kind === 'link'
52
+ ? item.title
53
+ : item.kind === 'media'
54
+ ? item.name
55
+ : ((_a = TaWorkTitle.of(item.language, item.code)) !== null && _a !== void 0 ? _a : '');
29
56
  }
30
57
  WebShareUtil.name = name;
31
58
  /** The name of its icon (WEB_ICONS): that of the kind of work, a file's. */
32
59
  function icon(item) {
33
60
  var _a, _b;
34
- return item.kind === 'file' ? 'FileText' : item.kind === 'link' ? ((_a = item.icon) !== null && _a !== void 0 ? _a : 'Link') : ((_b = TA_WORK_BLOCKS[item.language]) !== null && _b !== void 0 ? _b : 'Sparkles');
61
+ return item.kind === 'file'
62
+ ? 'FileText'
63
+ : item.kind === 'link'
64
+ ? ((_a = item.icon) !== null && _a !== void 0 ? _a : 'Link')
65
+ : item.kind === 'media'
66
+ ? item.media === 'image'
67
+ ? 'Image'
68
+ : 'Film'
69
+ : ((_b = TA_WORK_BLOCKS[item.language]) !== null && _b !== void 0 ? _b : 'Sparkles');
35
70
  }
36
71
  WebShareUtil.icon = icon;
37
72
  function label(way) {
@@ -95,6 +95,24 @@ export declare const ACCOUNT_EN: {
95
95
  'ta.auth.hintRemote': string;
96
96
  'ta.auth.later': string;
97
97
  'ta.myDevices.title': string;
98
+ 'ta.recovery.title': string;
99
+ 'ta.recovery.hint': string;
100
+ 'ta.recovery.make': string;
101
+ 'ta.recovery.makeHint': string;
102
+ 'ta.recovery.show': string;
103
+ 'ta.recovery.saved': string;
104
+ 'ta.recovery.made': string;
105
+ 'ta.recovery.none': string;
106
+ 'ta.recovery.drop': string;
107
+ 'ta.recovery.dropConfirm': string;
108
+ 'ta.recovery.replaced': string;
109
+ 'ta.recovery.restore': string;
110
+ 'ta.recovery.code': string;
111
+ 'ta.recovery.placeholder': string;
112
+ 'ta.recovery.restoreNow': string;
113
+ 'ta.recovery.restored': string;
114
+ 'ta.recovery.failed': string;
115
+ 'ta.recovery.kept': string;
98
116
  'ta.myDevices.hint': string;
99
117
  'ta.myDevices.signInWith': string;
100
118
  'ta.myDevices.enterCode': string;
@@ -97,6 +97,24 @@ export const ACCOUNT_EN = {
97
97
  'ta.auth.hintRemote': 'Credentials stay on the machine that runs Ta.',
98
98
  'ta.auth.later': 'Later',
99
99
  'ta.myDevices.title': 'My devices',
100
+ 'ta.recovery.title': 'Recovery code',
101
+ 'ta.recovery.hint': 'If this computer is lost, sign in to your account on a new one and enter this code: your friends and group chats come back as they were.',
102
+ 'ta.recovery.make': 'Make a recovery code',
103
+ 'ta.recovery.makeHint': 'Made now, it replaces the one before it.',
104
+ 'ta.recovery.show': 'Write it down and keep it away from this computer: {code}',
105
+ 'ta.recovery.saved': 'I saved it',
106
+ 'ta.recovery.made': 'Made {time}. Kept in your account, sealed: Ta cannot read it.',
107
+ 'ta.recovery.none': 'No recovery code yet: the friends and group chats of this computer would be lost with it.',
108
+ 'ta.recovery.drop': 'Take it away',
109
+ 'ta.recovery.dropConfirm': 'Take away the recovery code? Your friends and group chats stop being kept in your account.',
110
+ 'ta.recovery.replaced': 'A recovery code was made on another computer, which this one no longer opens. Make a new one here.',
111
+ 'ta.recovery.restore': 'Got a recovery code?',
112
+ 'ta.recovery.code': 'Recovery code',
113
+ 'ta.recovery.placeholder': 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
114
+ 'ta.recovery.restoreNow': 'Bring back friends and group chats',
115
+ 'ta.recovery.restored': '{friends} friends and {rooms} group chats are back.',
116
+ 'ta.recovery.failed': 'That code does not open a backup of this account.',
117
+ 'ta.recovery.kept': 'Kept {time}',
100
118
  'ta.myDevices.hint': 'Sign in to one account on your computers and phone: they show up on each other, no code to scan.',
101
119
  'ta.myDevices.signInWith': 'Sign in with {name}',
102
120
  'ta.myDevices.enterCode': 'Enter this code on {name}',
@@ -23,7 +23,7 @@ export const CALL_EN = {
23
23
  'ta.call.speaking': 'Ta is speaking',
24
24
  'ta.call.me': 'Me',
25
25
  'ta.call.onScreen': 'The rest is on the screen.',
26
- 'ta.call.waitsDialog': 'Ta waits for you: {title}',
26
+ 'ta.call.waitsDialog': 'Ta waits for you: {title}. Say yes or no.',
27
27
  'ta.call.waitsAsk': 'Waiting for you to decide: {title}',
28
28
  'ta.call.taskDone': 'Task done: {title}',
29
29
  'ta.call.taskFailed': 'Task did not finish: {title}',
@@ -16,6 +16,8 @@ export declare const CHAT_EN: {
16
16
  'ta.chat.draft': string;
17
17
  'ta.chat.asksCount': string;
18
18
  'ta.chat.unseenCount': string;
19
+ 'ta.tab.todo': string;
20
+ 'ta.tab.urgent': string;
19
21
  'ta.chat.letGo': string;
20
22
  'ta.chat.toAsk': string;
21
23
  'ta.chat.removed': string;
@@ -80,6 +82,8 @@ export declare const CHAT_EN: {
80
82
  'ta.message.pictureSeen': string;
81
83
  'ta.message.steered': string;
82
84
  'ta.message.steeredTitle': string;
85
+ 'ta.message.wentOn': string;
86
+ 'ta.message.wentOnTitle': string;
83
87
  'ta.message.queued': string;
84
88
  'ta.message.queuedTitle': string;
85
89
  'ta.message.branch': string;
@@ -123,6 +127,11 @@ export declare const CHAT_EN: {
123
127
  'ta.folder.up': string;
124
128
  'ta.folder.type': string;
125
129
  'ta.folder.empty': string;
130
+ 'ta.folder.new': string;
131
+ 'ta.folder.newName': string;
132
+ 'ta.folder.newConfirm': string;
133
+ 'ta.folder.newInvalid': string;
134
+ 'ta.folder.newExists': string;
126
135
  'ta.folder.failed': string;
127
136
  'ta.folder.open': string;
128
137
  'ta.chat.search': string;
@@ -203,6 +212,8 @@ export declare const CHAT_EN: {
203
212
  'ta.composer.camera': string;
204
213
  'ta.composer.more': string;
205
214
  'ta.composer.emoji': string;
215
+ 'ta.composer.emojiRecent': string;
216
+ 'ta.composer.emojiAll': string;
206
217
  'ta.composer.deleteBack': string;
207
218
  'ta.composer.page': string;
208
219
  'ta.composer.mentionFile': string;
@@ -216,6 +227,10 @@ export declare const CHAT_EN: {
216
227
  'ta.composer.image.type': string;
217
228
  'ta.composer.image.size': string;
218
229
  'ta.composer.image.count': string;
230
+ 'ta.composer.addFile': string;
231
+ 'ta.composer.removeFile': string;
232
+ 'ta.composer.file.noDir': string;
233
+ 'ta.composer.file.size': string;
219
234
  'ta.composer.filesUnavailable': string;
220
235
  'ta.composer.filter': string;
221
236
  'ta.composer.noMatch': string;
@@ -16,6 +16,8 @@ export const CHAT_EN = {
16
16
  'ta.chat.draft': 'Draft',
17
17
  'ta.chat.asksCount': '{count} waiting for you to decide',
18
18
  'ta.chat.unseenCount': '{count} new messages',
19
+ 'ta.tab.todo': '{count, plural, one {# to do} other {# to do}}',
20
+ 'ta.tab.urgent': '{count, plural, one {# urgent} other {# urgent}}',
19
21
  'ta.chat.letGo': 'Skip this decision',
20
22
  'ta.chat.toAsk': 'Waiting for you: {question}',
21
23
  'ta.chat.removed': 'Removed ({count})',
@@ -80,6 +82,8 @@ export const CHAT_EN = {
80
82
  'ta.message.pictureSeen': 'Picture {n} · {what}',
81
83
  'ta.message.steered': 'Said on the way',
82
84
  'ta.message.steeredTitle': 'Written while it worked: it read this after its tools and went on with it',
85
+ 'ta.message.wentOn': 'Said after it stopped',
86
+ 'ta.message.wentOnTitle': 'Written once it had stopped: the work goes on from here, in the same context',
83
87
  'ta.message.queued': 'Waited for the reply',
84
88
  'ta.message.queuedTitle': 'Written while it worked: sent once it had answered',
85
89
  'ta.message.branch': 'Summary of the other branch',
@@ -122,7 +126,12 @@ export const CHAT_EN = {
122
126
  'ta.folder.path': 'Path of a directory; Enter to go there',
123
127
  'ta.folder.up': 'Up one level',
124
128
  'ta.folder.type': 'Type a path',
125
- 'ta.folder.empty': 'No folders here',
129
+ 'ta.folder.empty': 'An empty folder: use it as it is, or make a folder in it',
130
+ 'ta.folder.new': 'New folder',
131
+ 'ta.folder.newName': 'Name of the folder',
132
+ 'ta.folder.newConfirm': 'Create',
133
+ 'ta.folder.newInvalid': 'A name has no / or \\, and is not . or ..',
134
+ 'ta.folder.newExists': '{name} is already here',
126
135
  'ta.folder.failed': 'Cannot open {path}.',
127
136
  'ta.folder.open': 'Use this directory',
128
137
  'ta.chat.search': 'Search chats',
@@ -203,6 +212,8 @@ export const CHAT_EN = {
203
212
  'ta.composer.camera': 'Camera',
204
213
  'ta.composer.more': 'Add and settings',
205
214
  'ta.composer.emoji': 'Emoji',
215
+ 'ta.composer.emojiRecent': 'Recently used',
216
+ 'ta.composer.emojiAll': 'All emoji',
206
217
  'ta.composer.deleteBack': 'Delete',
207
218
  'ta.composer.page': 'Page {page}',
208
219
  'ta.composer.mentionFile': 'Mention a file',
@@ -216,6 +227,10 @@ export const CHAT_EN = {
216
227
  'ta.composer.image.type': '{name} is not an image Ta can send: PNG, JPEG, GIF or WebP.',
217
228
  'ta.composer.image.size': '{name} is larger than 5 MB.',
218
229
  'ta.composer.image.count': 'At most 8 images per message.',
230
+ 'ta.composer.addFile': 'Add files',
231
+ 'ta.composer.removeFile': 'Remove the file',
232
+ 'ta.composer.file.noDir': 'Files go to the directory of the conversation: pick one first.',
233
+ 'ta.composer.file.size': '{name} is larger than {mb} MB.',
219
234
  'ta.composer.filesUnavailable': 'File search is not available on this server yet',
220
235
  'ta.composer.filter': 'Search',
221
236
  'ta.composer.noMatch': 'Nothing matches',