@celljs/ta-web 4.48.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,88 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.useComposerFiles = useComposerFiles;
37
+ const React = __importStar(require("react"));
38
+ const composer_files_1 = require("../util/composer-files");
39
+ /**
40
+ * Picks files of the box other than the pictures a model sees itself: each shows at once and is uploaded under
41
+ * `uploads/` of the directory of the conversation, where the message names it as an `@` reference (ComposerFileUtil).
42
+ * A file that fails to go takes its chip away, and says why.
43
+ */
44
+ function useComposerFiles(files, cwd, t, onError) {
45
+ const [picked, setPicked] = React.useState([]);
46
+ const add = React.useCallback((list) => {
47
+ const workspace = files === null || files === void 0 ? void 0 : files.workspace;
48
+ if (!workspace || !list.length) {
49
+ return;
50
+ }
51
+ if (!cwd) {
52
+ onError(new Error(t('ta.composer.file.noDir')));
53
+ return;
54
+ }
55
+ const refused = list.flatMap(file => {
56
+ const reason = composer_files_1.ComposerFileUtil.refuse(file);
57
+ return reason ? [{ file, reason }] : [];
58
+ });
59
+ for (const { file, reason } of refused) {
60
+ onError(new Error(t(`ta.composer.file.${reason}`, { name: file.name, mb: Math.round(composer_files_1.MAX_FILE_BYTES / (1024 * 1024)) })));
61
+ }
62
+ const accepted = list.filter(file => !composer_files_1.ComposerFileUtil.refuse(file));
63
+ if (!accepted.length) {
64
+ return;
65
+ }
66
+ void composer_files_1.ComposerFileUtil.taken(workspace, cwd).then(there => {
67
+ // Each place is taken at once, so that two files of a name picked together do not meet.
68
+ const shown = accepted.map(file => {
69
+ const path = composer_files_1.ComposerFileUtil.place(file.name, there);
70
+ there.add(path);
71
+ return { id: crypto.randomUUID(), name: file.name, path, size: file.size, done: 0 };
72
+ });
73
+ setPicked(previous => [...previous, ...shown]);
74
+ accepted.forEach((file, index) => {
75
+ const entry = shown[index];
76
+ void composer_files_1.ComposerFileUtil.upload(workspace, cwd, entry.path, file, done => setPicked(previous => previous.map(other => (other.id === entry.id ? { ...other, done } : other)))).catch(error => {
77
+ setPicked(previous => previous.filter(other => other.id !== entry.id));
78
+ onError(error);
79
+ });
80
+ });
81
+ }, error => onError(error));
82
+ }, [files, cwd, t, onError]);
83
+ const remove = React.useCallback((id) => setPicked(previous => previous.filter(file => file.id !== id)), []);
84
+ const clear = React.useCallback(() => setPicked([]), []);
85
+ const restore = React.useCallback((files) => setPicked(files), []);
86
+ return { files: picked, ready: picked.every(file => file.done >= 1), add, remove, clear, restore };
87
+ }
88
+ //# sourceMappingURL=use-composer-files.js.map
@@ -10,6 +10,8 @@ export interface WebComposerHostProps extends WebComposerProps {
10
10
  server: Pick<TaServer, 'getDirectoryCommands'>;
11
11
  /** The entries of a directory of the server, for the button of `onPickCwd`. */
12
12
  listDirectory?(directory: string): Promise<TaDirEntry[]>;
13
+ /** Makes the folder `name` in a directory of the server, for the button of `onPickCwd`. */
14
+ createDirectory?(directory: string, name: string): Promise<void>;
13
15
  /** The directory of ta serve: that of a `cwd` left empty. */
14
16
  serverCwd?: string;
15
17
  /** The hosts of ssh, which the button offers too. */
@@ -19,5 +21,5 @@ export interface WebComposerHostProps extends WebComposerProps {
19
21
  * The message box as web extensions get it (`pi.ui.Composer`): text, and pictures when it takes them (shrunk within
20
22
  * the limits given), `@` for the names they give; a failure is a notice of the page.
21
23
  */
22
- export declare function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
24
+ export declare function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, createDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
23
25
  //# sourceMappingURL=web-composer.d.ts.map
@@ -47,7 +47,7 @@ const folder_picker_1 = require("./folder-picker");
47
47
  * The message box as web extensions get it (`pi.ui.Composer`): text, and pictures when it takes them (shrunk within
48
48
  * the limits given), `@` for the names they give; a failure is a notice of the page.
49
49
  */
50
- function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, serverCwd, remote, }) {
50
+ function WebComposer({ notices, placeholder, onSend, images, videos, emoji, autoFocus, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, draft, server, listDirectory, createDirectory, serverCwd, remote, }) {
51
51
  const t = (0, use_t_1.useT)();
52
52
  const language = (0, use_t_1.useLanguage)();
53
53
  const [query, setQuery] = React.useState();
@@ -72,6 +72,7 @@ function WebComposer({ notices, placeholder, onSend, images, videos, emoji, auto
72
72
  detail: mention.detail,
73
73
  })),
74
74
  }
75
- : undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions === null || actions === void 0 ? void 0 : actions.map(section => section.map(composer_addon_util_1.ComposerAddonUtil.action)), head: onPickCwd && listDirectory && React.createElement(folder_picker_1.DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, remote: remote, onPick: onPickCwd }), cwd: cwd || serverCwd, working: working, onStop: onStop, voiceSends: voiceSends, draft: draft, onTalkSent: onTalkSent, onListening: onListening, after: after, onError: cause => notices.error(cause) }));
75
+ : undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions === null || actions === void 0 ? void 0 : actions.map(section => section.map(composer_addon_util_1.ComposerAddonUtil.action)), head: onPickCwd &&
76
+ listDirectory && (React.createElement(folder_picker_1.DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, create: createDirectory, remote: remote, onPick: onPickCwd })), cwd: cwd || serverCwd, working: working, onStop: onStop, voiceSends: voiceSends, draft: draft, onTalkSent: onTalkSent, onListening: onListening, after: after, onError: cause => notices.error(cause) }));
76
77
  }
77
78
  //# sourceMappingURL=web-composer.js.map
@@ -60,6 +60,7 @@ function useDocument() {
60
60
  // Before the browser draws what this commit made.
61
61
  React.useLayoutEffect(() => style_1.PageStyle.attach(), []);
62
62
  React.useEffect(() => {
63
+ // The name alone: the shell gives it with what waits for the user over this (TabTitleUtil).
63
64
  document.title = 'Ta';
64
65
  // Where the installed app's window is dragged when the page draws its title bar.
65
66
  const titlebar = document.createElement('div');
@@ -46,6 +46,7 @@ function WorkingDirectoryPicker({ onClose }) {
46
46
  const [workbench, bench] = (0, hooks_1.useWorkbench)();
47
47
  const [, notices] = (0, hooks_1.useNotices)();
48
48
  const list = React.useCallback((directory) => bench.workspace.listDirectory('.', directory), [bench]);
49
+ const create = React.useCallback((directory, name) => bench.workspace.createDirectory(name, directory), [bench]);
49
50
  const pick = async (path) => {
50
51
  try {
51
52
  await bench.setWorkingDirectory(path);
@@ -56,6 +57,6 @@ function WorkingDirectoryPicker({ onClose }) {
56
57
  notices.error(error);
57
58
  }
58
59
  };
59
- return React.createElement(folder_picker_1.FolderPicker, { list: list, initial: (_b = (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) !== null && _b !== void 0 ? _b : '.', remote: bench, onPick: pick, onClose: onClose });
60
+ return React.createElement(folder_picker_1.FolderPicker, { list: list, create: create, initial: (_b = (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd) !== null && _b !== void 0 ? _b : '.', remote: bench, onPick: pick, onClose: onClose });
60
61
  }
61
62
  //# sourceMappingURL=working-directory.js.map
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Moving a page of the navigation by dragging it, as the rail does with a mouse: a press that goes a few pixels
4
+ * drags the entry, faint where it was, and a line says where it lands (the place of the entry the pointer is
5
+ * nearest). The entries say which page they are (`attr`); the caller keeps the order (NavigationUtil.move).
6
+ */
7
+ export interface DragMove {
8
+ /** The attribute of an entry that says which page it is, its value the id. */
9
+ attr: string;
10
+ /** The page goes where that one was, or last (`target` none). */
11
+ onMove(page: string, target: string | undefined): void;
12
+ }
13
+ /** The drag as far as the caller draws it: the page on its way, and the entry whose place it would take (none: last). */
14
+ export interface Dragging {
15
+ page: string;
16
+ target?: string;
17
+ }
18
+ export declare function useDragMove(move: DragMove): {
19
+ onPointerDown(event: React.PointerEvent): void;
20
+ dragging: Dragging | undefined;
21
+ };
22
+ //# sourceMappingURL=drag-move.d.ts.map
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.useDragMove = useDragMove;
37
+ const React = __importStar(require("react"));
38
+ /** How far a press moves before it drags: less is a click. */
39
+ const MOVE_PX = 6;
40
+ /** Where the entries are: the rail of the desktop, the tabs at the bottom of a phone. */
41
+ const CONTAINER = '.ta-rail-items, .ta-tabbar';
42
+ /** Where a drop lands: the place of the entry whose middle is nearest the pointer, along the row or the column. */
43
+ function landing(target, x, y) {
44
+ var _a;
45
+ var _b;
46
+ const container = (_a = target === null || target === void 0 ? void 0 : target.closest) === null || _a === void 0 ? void 0 : _a.call(target, CONTAINER);
47
+ const entries = container ? [...container.querySelectorAll('[data-nav-page]')] : [];
48
+ const row = !!(container === null || container === void 0 ? void 0 : container.classList.contains('ta-tabbar'));
49
+ let nearest;
50
+ for (const entry of entries) {
51
+ const rect = entry.getBoundingClientRect();
52
+ const distance = row ? Math.abs(x - (rect.left + rect.width / 2)) : Math.abs(y - (rect.top + rect.height / 2));
53
+ if (!nearest || distance < nearest.distance) {
54
+ nearest = { id: (_b = entry.getAttribute('data-nav-page')) !== null && _b !== void 0 ? _b : '', distance };
55
+ }
56
+ }
57
+ return nearest ? { target: nearest.id } : {};
58
+ }
59
+ function useDragMove(move) {
60
+ const [dragging, setDragging] = React.useState(undefined);
61
+ const current = React.useRef(move);
62
+ current.current = move;
63
+ const stop = React.useRef(() => undefined);
64
+ React.useEffect(() => stop.current, []);
65
+ const onPointerDown = React.useCallback((event) => {
66
+ var _a, _b;
67
+ var _c;
68
+ const entry = (_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, `[${current.current.attr}]`);
69
+ if (!entry || !event.isPrimary || event.button !== 0 || event.pointerType === 'touch') {
70
+ return;
71
+ }
72
+ const page = (_c = entry.getAttribute(current.current.attr)) !== null && _c !== void 0 ? _c : '';
73
+ const from = { x: event.clientX, y: event.clientY };
74
+ let on = false;
75
+ let at = {};
76
+ const begin = (x, y) => {
77
+ on = true;
78
+ entry.setAttribute('data-dragging', '');
79
+ document.documentElement.setAttribute('data-dragging', '');
80
+ at = landing(document.elementFromPoint(x, y), x, y);
81
+ setDragging({ page, ...at });
82
+ };
83
+ const finish = (commit) => {
84
+ if (on) {
85
+ entry.removeAttribute('data-dragging');
86
+ document.documentElement.removeAttribute('data-dragging');
87
+ setDragging(undefined);
88
+ if (commit) {
89
+ current.current.onMove(page, at.target);
90
+ }
91
+ }
92
+ off();
93
+ };
94
+ const onMove = (moved) => {
95
+ var _a;
96
+ if (!on) {
97
+ if (Math.hypot(moved.clientX - from.x, moved.clientY - from.y) <= MOVE_PX) {
98
+ return;
99
+ }
100
+ // Past a few pixels it is a drag: no selection of the icon under it, no click of the press.
101
+ (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
102
+ begin(moved.clientX, moved.clientY);
103
+ return;
104
+ }
105
+ at = landing(document.elementFromPoint(moved.clientX, moved.clientY), moved.clientX, moved.clientY);
106
+ setDragging({ page, ...at });
107
+ };
108
+ const onUp = () => finish(true);
109
+ const onCancel = () => finish(false);
110
+ const off = () => {
111
+ document.removeEventListener('pointermove', onMove);
112
+ document.removeEventListener('pointerup', onUp);
113
+ document.removeEventListener('pointercancel', onCancel);
114
+ };
115
+ document.addEventListener('pointermove', onMove);
116
+ document.addEventListener('pointerup', onUp);
117
+ document.addEventListener('pointercancel', onCancel);
118
+ stop.current = off;
119
+ }, []);
120
+ return { onPointerDown, dragging };
121
+ }
122
+ //# sourceMappingURL=drag-move.js.map
@@ -16,8 +16,11 @@ exports.WEB_ICONS = Object.freeze({
16
16
  Eraser: lucide_react_1.Eraser,
17
17
  PaintBucket: lucide_react_1.PaintBucket,
18
18
  Sigma: lucide_react_1.Sigma,
19
+ SkipBack: lucide_react_1.SkipBack,
20
+ SkipForward: lucide_react_1.SkipForward,
19
21
  Snowflake: lucide_react_1.Snowflake,
20
22
  TableCellsMerge: lucide_react_1.TableCellsMerge,
23
+ Blocks: lucide_react_1.Blocks,
21
24
  AlarmClock: lucide_react_1.AlarmClock,
22
25
  Aperture: lucide_react_1.Aperture,
23
26
  AppWindow: lucide_react_1.AppWindow,
@@ -135,7 +138,9 @@ exports.WEB_ICONS = Object.freeze({
135
138
  Navigation: lucide_react_1.Navigation,
136
139
  Package: lucide_react_1.Package,
137
140
  PackageOpen: lucide_react_1.PackageOpen,
141
+ Palette: lucide_react_1.Palette,
138
142
  Paperclip: lucide_react_1.Paperclip,
143
+ Pause: lucide_react_1.Pause,
139
144
  Pencil: lucide_react_1.Pencil,
140
145
  Phone: lucide_react_1.Phone,
141
146
  Pin: lucide_react_1.Pin,
@@ -195,6 +200,7 @@ exports.WEB_ICONS = Object.freeze({
195
200
  UserPlus: lucide_react_1.UserPlus,
196
201
  Users: lucide_react_1.Users,
197
202
  Volume2: lucide_react_1.Volume2,
203
+ VolumeX: lucide_react_1.VolumeX,
198
204
  WholeWord: lucide_react_1.WholeWord,
199
205
  Wrench: lucide_react_1.Wrench,
200
206
  X: lucide_react_1.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';
3
4
  import type { WebMenuItem } from './web-api-contributions';
4
5
  import type { WebIcon } from './web-extension-api';
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 {
@@ -78,6 +78,7 @@ exports.WEB_UI_SPEC = {
78
78
  FullScreen: component(B),
79
79
  Stack: component(B),
80
80
  Markdown: component(B),
81
+ EmojiText: component(B),
81
82
  Empty: component(B),
82
83
  Loading: component(B),
83
84
  Skeleton: component(B),
@@ -110,6 +111,7 @@ exports.WEB_UI_SPEC = {
110
111
  saveFile: call(A),
111
112
  shareExtension: fire(A),
112
113
  share: fire(B),
114
+ shrinkImage: call(B),
113
115
  stopExtension: fire(A),
114
116
  forgetPage: fire(A),
115
117
  useView: hook(A),
@@ -7,7 +7,7 @@ import type { Language, Theme } from '../settings/settings-protocol';
7
7
  import type { WebCodeRendererOptions, WebCodeRendererProps, WebMarkdownProps } from './web-api-code';
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';
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';
10
- import type { WebDesktop, WebDeviceUI, WebFileDrag, WebviewTabEvent } from './web-api-desktop';
10
+ import type { WebDeviceUI, WebFileDrag } from './web-api-desktop';
11
11
  import type { WebEditorsUI } from './web-api-editors';
12
12
  import type { WebFileViews, WebFileViewsUI } from './web-api-file-views';
13
13
  import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home';
@@ -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").WebComposerHostProps>;
63
64
  /** The message box of an extension: its drafts under its name, apart from those of the others. */
@@ -41,6 +41,7 @@ const task_views_1 = require("../assistant/task-views");
41
41
  const web_voice_1 = require("../assistant/web-voice");
42
42
  const busy_1 = require("../components/busy");
43
43
  const chat_asks_1 = require("../components/chat-asks");
44
+ const chat_emoji_1 = require("../components/chat-emoji");
44
45
  const chat_list_util_1 = require("../components/chat-list-util");
45
46
  const code_editor_1 = require("../components/code-editor");
46
47
  const composer_target_1 = require("../components/composer-target");
@@ -109,12 +110,14 @@ class WebExtensionContext {
109
110
  this.codeEditor = (props) => React.createElement(code_editor_1.CodeEditor, { ...props, settings: this.host.settings });
110
111
  this.diffEditor = (props) => React.createElement(diff_editor_1.DiffEditor, { ...props, settings: this.host.settings });
111
112
  this.listDirectory = (directory) => this.host.workbench.workspace.listDirectory('.', directory);
113
+ this.createDirectory = (directory, name) => this.host.workbench.workspace.createDirectory(name, directory);
112
114
  /** The message box, whose button of the directory lists those of the server. */
113
115
  this.composer = (props) => { var _a; return React.createElement(web_composer_1.WebComposer, {
114
116
  ...props,
115
117
  notices: this.host.notices,
116
118
  server: this.host.workbench.server,
117
119
  listDirectory: this.listDirectory,
120
+ createDirectory: this.createDirectory,
118
121
  serverCwd: (_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd,
119
122
  remote: this.host.workbench,
120
123
  }); };
@@ -123,6 +126,7 @@ class WebExtensionContext {
123
126
  this.modelPicker = (props) => React.createElement(model_picker_1.SettingsModelPicker, { ...props, settings: this.host.workbench.settings });
124
127
  this.folderPicker = ({ initial, onPick, onClose }) => { var _a; return React.createElement(folder_picker_1.FolderPicker, {
125
128
  list: this.listDirectory,
129
+ create: this.createDirectory,
126
130
  initial: initial || ((_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.',
127
131
  remote: this.host.workbench,
128
132
  onPick: async (path) => onPick(path),
@@ -376,11 +380,13 @@ class WebExtensionContext {
376
380
  return React.useSyncExternalStore(host.subscribePages, () => host.extensions.pages());
377
381
  },
378
382
  useContextMenu: () => {
379
- const [menu, open] = (0, context_menu_1.useContextMenu)();
380
- const openSections = React.useCallback((event, sections) => open(event, sections
383
+ const [menu, open, openAt] = (0, context_menu_1.useContextMenu)();
384
+ const items = React.useCallback((sections) => sections
381
385
  .filter(section => section.length > 0)
382
- .flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])), [open]);
383
- return [menu, openSections];
386
+ .flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section]), []);
387
+ const openSections = React.useCallback((event, sections) => open(event, items(sections)), [open, items]);
388
+ const openSectionsAt = React.useCallback((at, sections, caption) => openAt(at, items(sections), caption), [openAt, items]);
389
+ return [menu, openSections, openSectionsAt];
384
390
  },
385
391
  attachMenu: context_menu_1.ContextMenuUtil.attach,
386
392
  scanCode: code_scan_1.CodeScan.readable()
@@ -449,8 +455,9 @@ class WebExtensionContext {
449
455
  voice: web_extension_run_1.WebExtensionRunUtil.voice(run, this.voice),
450
456
  // Let go as the extension stops, whether or not it did; nothing held once stopped.
451
457
  keepAwake: () => web_extension_run_1.WebExtensionRunUtil.track(run, () => screen_awake_1.KeepAwake.shared.hold()),
452
- apps: web_apps_1.TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: icons_1.WEB_ICONS.Puzzle, stopped: () => run.stopped }),
458
+ apps: web_apps_1.TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: icons_1.WEB_ICONS.Blocks, stopped: () => run.stopped }),
453
459
  Markdown: markdown_1.Markdown,
460
+ EmojiText: chat_emoji_1.EmojiText,
454
461
  Conversation: conversation_view_1.ConversationView,
455
462
  useChatScroll: (sent, key) => (0, conversation_scroll_hooks_1.useConversationScroll)(sent, { sentTo: 'bottom', key }),
456
463
  Empty: empty_state_1.EmptyState,
@@ -71,6 +71,7 @@ var WebExtensionRunUtil;
71
71
  label: way.label,
72
72
  icon: way.icon,
73
73
  order: way.order,
74
+ forward: way.forward,
74
75
  accepts: item => {
75
76
  try {
76
77
  return !run.stopped && way.accepts(item);
@@ -4,5 +4,5 @@ import type { WebExtensionContextHost } from './web-extension-context';
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'>;
8
8
  //# sourceMappingURL=web-share-ui.d.ts.map
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.shareUI = shareUI;
37
37
  const React = __importStar(require("react"));
38
38
  const share_sheet_1 = require("../components/share-sheet");
39
+ const image_shrink_1 = require("../util/image-shrink");
39
40
  /**
40
41
  * What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
41
42
  * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
@@ -51,6 +52,7 @@ function shareUI(host, stopped) {
51
52
  return {
52
53
  shareExtension: target => !stopped() && host.extensions.share(target),
53
54
  share: item => !stopped() && host.extensions.shareItem(item),
55
+ shrinkImage: (image, limits) => image_shrink_1.ImageShrink.shrink(image, limits),
54
56
  ShareSheet: sheet,
55
57
  };
56
58
  }
@@ -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. */