@celljs/ta-web 4.10.0 → 4.11.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 (525) hide show
  1. package/README.en.md +7 -7
  2. package/README.md +7 -7
  3. package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
  4. package/esm/browser/assistant/assistant-chat-list.js +12 -0
  5. package/esm/browser/assistant/assistant-extension.js +5 -0
  6. package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
  7. package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
  8. package/esm/browser/assistant/assistant-task-book.js +23 -4
  9. package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
  10. package/esm/browser/assistant/assistant-task-source.js +5 -10
  11. package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
  12. package/esm/browser/assistant/assistant-task-util.js +59 -12
  13. package/esm/browser/assistant/assistant-view.js +44 -23
  14. package/esm/browser/assistant/assistant.d.ts +18 -4
  15. package/esm/browser/assistant/assistant.js +52 -17
  16. package/esm/browser/avatar/dino-face.js +1 -2
  17. package/esm/browser/chat/chat-protocol.d.ts +5 -0
  18. package/esm/browser/chat/chat-stores.d.ts +8 -5
  19. package/esm/browser/chat/chat-stores.js +17 -9
  20. package/esm/browser/chat/chat-view.js +18 -11
  21. package/esm/browser/chat/chat.d.ts +16 -8
  22. package/esm/browser/chat/chat.js +86 -51
  23. package/esm/browser/components/account-menu.d.ts +0 -2
  24. package/esm/browser/components/account-menu.js +1 -27
  25. package/esm/browser/components/agent-settings-view.d.ts +3 -2
  26. package/esm/browser/components/agent-settings-view.js +2 -1
  27. package/esm/browser/components/app-nav.d.ts +5 -2
  28. package/esm/browser/components/app-nav.js +22 -9
  29. package/esm/browser/components/app-shell-hooks.js +5 -3
  30. package/esm/browser/components/app-view.js +76 -16
  31. package/esm/browser/components/busy.d.ts +25 -0
  32. package/esm/browser/components/busy.js +52 -0
  33. package/esm/browser/components/chat-icon.d.ts +29 -0
  34. package/esm/browser/components/chat-icon.js +78 -0
  35. package/esm/browser/components/chat-list.d.ts +73 -6
  36. package/esm/browser/components/chat-list.js +295 -60
  37. package/esm/browser/components/chat-seen.d.ts +53 -0
  38. package/esm/browser/components/chat-seen.js +101 -0
  39. package/esm/browser/components/composer-box.d.ts +14 -4
  40. package/esm/browser/components/composer-box.js +104 -64
  41. package/esm/browser/components/composer.d.ts +6 -6
  42. package/esm/browser/components/composer.js +5 -3
  43. package/esm/browser/components/conversation-scroll.d.ts +7 -0
  44. package/esm/browser/components/conversation-scroll.js +46 -7
  45. package/esm/browser/components/custom-host.d.ts +3 -0
  46. package/esm/browser/components/custom-host.js +14 -0
  47. package/esm/browser/components/directory-commands.d.ts +6 -0
  48. package/esm/browser/components/directory-commands.js +34 -0
  49. package/esm/browser/components/discover-view.d.ts +11 -4
  50. package/esm/browser/components/discover-view.js +20 -11
  51. package/esm/browser/components/dismiss.d.ts +3 -0
  52. package/esm/browser/components/dismiss.js +29 -0
  53. package/esm/browser/components/earlier-messages.d.ts +34 -3
  54. package/esm/browser/components/earlier-messages.js +42 -8
  55. package/esm/browser/components/editor-area.d.ts +6 -22
  56. package/esm/browser/components/editor-area.js +10 -97
  57. package/esm/browser/components/fold-text.d.ts +20 -0
  58. package/esm/browser/components/fold-text.js +66 -0
  59. package/esm/browser/components/folder-picker.d.ts +1 -1
  60. package/esm/browser/components/folder-picker.js +1 -1
  61. package/esm/browser/components/full-screen.d.ts +9 -0
  62. package/esm/browser/components/full-screen.js +26 -0
  63. package/esm/browser/components/grow-box.d.ts +9 -0
  64. package/esm/browser/components/grow-box.js +50 -0
  65. package/esm/browser/components/hold-to-talk.d.ts +22 -0
  66. package/esm/browser/components/hold-to-talk.js +29 -0
  67. package/esm/browser/components/host-view.d.ts +1 -1
  68. package/esm/browser/components/icon.d.ts +3 -1
  69. package/esm/browser/components/icon.js +4 -3
  70. package/esm/browser/components/image-viewer.d.ts +10 -2
  71. package/esm/browser/components/image-viewer.js +48 -11
  72. package/esm/browser/components/launcher-search-util.d.ts +4 -3
  73. package/esm/browser/components/launcher-search-util.js +12 -4
  74. package/esm/browser/components/lightbox.d.ts +5 -2
  75. package/esm/browser/components/lightbox.js +4 -3
  76. package/esm/browser/components/list-rows.d.ts +9 -1
  77. package/esm/browser/components/list-rows.js +17 -3
  78. package/esm/browser/components/markdown.js +36 -4
  79. package/esm/browser/components/media.js +19 -2
  80. package/esm/browser/components/message-actions.js +2 -0
  81. package/esm/browser/components/message-footer.d.ts +6 -0
  82. package/esm/browser/components/message-footer.js +20 -3
  83. package/esm/browser/components/message-list.d.ts +57 -6
  84. package/esm/browser/components/message-list.js +152 -36
  85. package/esm/browser/components/message-menu.js +6 -1
  86. package/esm/browser/components/model-picker.js +1 -0
  87. package/esm/browser/components/nav-places.d.ts +21 -2
  88. package/esm/browser/components/nav-places.js +20 -4
  89. package/esm/browser/components/notice-center.js +34 -0
  90. package/esm/browser/components/notice-face.d.ts +10 -0
  91. package/esm/browser/components/notice-face.js +28 -0
  92. package/esm/browser/components/phone-shell.d.ts +23 -1
  93. package/esm/browser/components/phone-shell.js +96 -9
  94. package/esm/browser/components/picture.d.ts +8 -1
  95. package/esm/browser/components/picture.js +12 -1
  96. package/esm/browser/components/plus-menu.d.ts +23 -0
  97. package/esm/browser/components/plus-menu.js +90 -0
  98. package/esm/browser/components/recent-shot.d.ts +15 -0
  99. package/esm/browser/components/recent-shot.js +174 -0
  100. package/esm/browser/components/relay-view.js +10 -3
  101. package/esm/browser/components/run-status.d.ts +1 -1
  102. package/esm/browser/components/run-status.js +17 -29
  103. package/esm/browser/components/said-text.d.ts +6 -0
  104. package/esm/browser/components/said-text.js +14 -0
  105. package/esm/browser/components/scan-screen.d.ts +10 -0
  106. package/esm/browser/components/scan-screen.js +230 -0
  107. package/esm/browser/components/search-page.js +10 -6
  108. package/esm/browser/components/session-settings.d.ts +2 -3
  109. package/esm/browser/components/session-settings.js +1 -0
  110. package/esm/browser/components/session-view.js +29 -19
  111. package/esm/browser/components/settings-choices.d.ts +1 -0
  112. package/esm/browser/components/settings-choices.js +3 -2
  113. package/esm/browser/components/settings-controls.d.ts +5 -3
  114. package/esm/browser/components/settings-controls.js +10 -1
  115. package/esm/browser/components/settings-parts.js +45 -14
  116. package/esm/browser/components/tool-view.js +7 -2
  117. package/esm/browser/components/unseen-drop.d.ts +39 -0
  118. package/esm/browser/components/unseen-drop.js +219 -0
  119. package/esm/browser/components/use-seen-chats.d.ts +8 -0
  120. package/esm/browser/components/use-seen-chats.js +49 -0
  121. package/esm/browser/components/voice-button.d.ts +7 -1
  122. package/esm/browser/components/voice-button.js +15 -2
  123. package/esm/browser/components/voice-picker.d.ts +6 -0
  124. package/esm/browser/components/voice-picker.js +53 -0
  125. package/esm/browser/components/voice-talk.d.ts +11 -3
  126. package/esm/browser/components/voice-talk.js +24 -4
  127. package/esm/browser/components/web-composer.d.ts +4 -2
  128. package/esm/browser/components/web-composer.js +8 -4
  129. package/esm/browser/components/workbench-tabs.d.ts +41 -0
  130. package/esm/browser/components/workbench-tabs.js +193 -0
  131. package/esm/browser/components/workbench-toggle.d.ts +0 -13
  132. package/esm/browser/components/workbench-toggle.js +1 -28
  133. package/esm/browser/device/code-scan.d.ts +55 -0
  134. package/esm/browser/device/code-scan.js +137 -0
  135. package/esm/browser/device/code-vision.d.ts +51 -0
  136. package/esm/browser/device/code-vision.js +100 -0
  137. package/esm/browser/device/hold.js +4 -6
  138. package/esm/browser/device/long-press.d.ts +10 -0
  139. package/esm/browser/device/long-press.js +28 -12
  140. package/esm/browser/device/own-gestures.d.ts +25 -0
  141. package/esm/browser/device/own-gestures.js +39 -0
  142. package/esm/browser/device/pull-down.js +3 -2
  143. package/esm/browser/device/recent-shots.d.ts +45 -0
  144. package/esm/browser/device/recent-shots.js +142 -0
  145. package/esm/browser/device/row-swipe.js +6 -1
  146. package/esm/browser/device/sheet-swipe.js +8 -1
  147. package/esm/browser/extension/extension-view.d.ts +10 -0
  148. package/esm/browser/extension/extension-view.js +6 -0
  149. package/esm/browser/extension/icons.js +15 -2
  150. package/esm/browser/extension/web-api-components.d.ts +269 -0
  151. package/esm/browser/extension/web-api-components.js +2 -0
  152. package/esm/browser/extension/web-api-contributions.d.ts +385 -0
  153. package/esm/browser/extension/web-api-contributions.js +2 -0
  154. package/esm/browser/extension/web-api-desktop.d.ts +55 -0
  155. package/esm/browser/extension/web-api-desktop.js +2 -0
  156. package/esm/browser/extension/web-api-terminal.d.ts +71 -0
  157. package/esm/browser/extension/web-api-terminal.js +2 -0
  158. package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
  159. package/esm/browser/extension/web-editor-tabs.js +137 -0
  160. package/esm/browser/extension/web-extension-api.d.ts +166 -565
  161. package/esm/browser/extension/web-extension-context.d.ts +78 -0
  162. package/esm/browser/extension/web-extension-context.js +346 -0
  163. package/esm/browser/extension/web-extension-protocol.d.ts +44 -6
  164. package/esm/browser/extension/web-extension-protocol.js +33 -0
  165. package/esm/browser/extension/web-extension-run.d.ts +54 -0
  166. package/esm/browser/extension/web-extension-run.js +120 -0
  167. package/esm/browser/extension/web-extensions.d.ts +29 -69
  168. package/esm/browser/extension/web-extensions.js +118 -516
  169. package/esm/browser/extension/web-home.d.ts +19 -0
  170. package/esm/browser/extension/web-home.js +72 -0
  171. package/esm/browser/extension/web-pages.d.ts +13 -3
  172. package/esm/browser/extension/web-pages.js +23 -3
  173. package/esm/browser/extension/web-session-notices.d.ts +36 -0
  174. package/esm/browser/extension/web-session-notices.js +174 -0
  175. package/esm/browser/extension/web-sharing.d.ts +2 -0
  176. package/esm/browser/extension/web-sharing.js +4 -0
  177. package/esm/browser/game/game-host.d.ts +27 -0
  178. package/esm/browser/game/game-host.js +127 -0
  179. package/esm/browser/game/game-loader.d.ts +10 -0
  180. package/esm/browser/game/game-loader.js +28 -0
  181. package/esm/browser/game/game-protocol.d.ts +49 -0
  182. package/esm/browser/game/game-protocol.js +2 -0
  183. package/esm/browser/game/game-runner.d.ts +27 -0
  184. package/esm/browser/game/game-runner.js +60 -0
  185. package/esm/browser/game/game-util.d.ts +29 -0
  186. package/esm/browser/game/game-util.js +180 -0
  187. package/esm/browser/game/game-view.d.ts +12 -0
  188. package/esm/browser/game/game-view.js +31 -0
  189. package/esm/browser/game/game3d-protocol.d.ts +51 -0
  190. package/esm/browser/game/game3d-protocol.js +2 -0
  191. package/esm/browser/game/game3d-runner.d.ts +27 -0
  192. package/esm/browser/game/game3d-runner.js +149 -0
  193. package/esm/browser/hooks.d.ts +5 -1
  194. package/esm/browser/hooks.js +13 -2
  195. package/esm/browser/i18n/locales.d.ts +82 -2
  196. package/esm/browser/i18n/messages.d.ts +81 -1
  197. package/esm/browser/i18n/messages.js +167 -7
  198. package/esm/browser/index.d.ts +9 -0
  199. package/esm/browser/index.js +9 -0
  200. package/esm/browser/links/links-protocol.d.ts +5 -0
  201. package/esm/browser/links/links.d.ts +19 -7
  202. package/esm/browser/links/links.js +57 -11
  203. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  204. package/esm/browser/markdown/code-renderers.js +4 -0
  205. package/esm/browser/notices/notices-protocol.d.ts +17 -0
  206. package/esm/browser/notices/notices.d.ts +1 -1
  207. package/esm/browser/notices/notices.js +6 -2
  208. package/esm/browser/notices/session-notices.d.ts +69 -0
  209. package/esm/browser/notices/session-notices.js +92 -0
  210. package/esm/browser/offline/device-values.js +12 -3
  211. package/esm/browser/offline/offline-reads.js +3 -1
  212. package/esm/browser/settings/navigation.d.ts +3 -2
  213. package/esm/browser/settings/navigation.js +4 -3
  214. package/esm/browser/settings/settings-protocol.d.ts +15 -0
  215. package/esm/browser/settings/settings-protocol.js +18 -4
  216. package/esm/browser/state/state-protocol.d.ts +8 -1
  217. package/esm/browser/state/state.d.ts +2 -0
  218. package/esm/browser/state/state.js +21 -2
  219. package/esm/browser/style/base.d.ts +1 -1
  220. package/esm/browser/style/base.js +27 -1
  221. package/esm/browser/style/conversation.d.ts +1 -1
  222. package/esm/browser/style/conversation.js +43 -5
  223. package/esm/browser/style/device.js +15 -1
  224. package/esm/browser/style/layout.d.ts +1 -1
  225. package/esm/browser/style/layout.js +189 -56
  226. package/esm/browser/style/pages.d.ts +1 -1
  227. package/esm/browser/style/pages.js +36 -1
  228. package/esm/browser/style/phone.d.ts +1 -1
  229. package/esm/browser/style/phone.js +15 -0
  230. package/esm/browser/style/shell.d.ts +1 -1
  231. package/esm/browser/style/shell.js +30 -6
  232. package/esm/browser/style/surfaces.d.ts +1 -1
  233. package/esm/browser/style/surfaces.js +2 -2
  234. package/esm/browser/style/tints.d.ts +27 -0
  235. package/esm/browser/style/tints.js +56 -0
  236. package/esm/browser/style.js +13 -1
  237. package/esm/browser/util/composer.d.ts +6 -0
  238. package/esm/browser/util/composer.js +16 -0
  239. package/esm/browser/util/desktop.d.ts +19 -1
  240. package/esm/browser/util/desktop.js +15 -0
  241. package/esm/browser/util/link.d.ts +18 -0
  242. package/esm/browser/util/link.js +66 -1
  243. package/esm/browser/util/markdown.d.ts +4 -1
  244. package/esm/browser/util/markdown.js +1 -1
  245. package/esm/browser/util/message.d.ts +5 -0
  246. package/esm/browser/util/message.js +30 -0
  247. package/esm/browser/util/process.d.ts +14 -2
  248. package/esm/browser/util/process.js +39 -8
  249. package/esm/browser/util/progress.d.ts +19 -1
  250. package/esm/browser/util/progress.js +57 -4
  251. package/esm/browser/util/quote.d.ts +19 -0
  252. package/esm/browser/util/quote.js +58 -0
  253. package/esm/browser/util/tool.d.ts +19 -2
  254. package/esm/browser/util/tool.js +70 -2
  255. package/esm/browser/util/voice.d.ts +47 -7
  256. package/esm/browser/util/voice.js +269 -27
  257. package/esm/browser/workbench-calls.d.ts +6 -4
  258. package/esm/browser/workbench-calls.js +15 -10
  259. package/esm/browser/workbench-protocol.d.ts +31 -2
  260. package/esm/browser/workbench-util.d.ts +15 -4
  261. package/esm/browser/workbench-util.js +28 -5
  262. package/esm/browser/workbench.d.ts +33 -1
  263. package/esm/browser/workbench.js +142 -14
  264. package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
  265. package/lib/browser/assistant/assistant-chat-list.js +13 -0
  266. package/lib/browser/assistant/assistant-extension.js +5 -0
  267. package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
  268. package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
  269. package/lib/browser/assistant/assistant-task-book.js +23 -4
  270. package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
  271. package/lib/browser/assistant/assistant-task-source.js +5 -10
  272. package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
  273. package/lib/browser/assistant/assistant-task-util.js +59 -12
  274. package/lib/browser/assistant/assistant-view.js +42 -21
  275. package/lib/browser/assistant/assistant.d.ts +18 -4
  276. package/lib/browser/assistant/assistant.js +52 -17
  277. package/lib/browser/avatar/dino-face.js +1 -2
  278. package/lib/browser/chat/chat-protocol.d.ts +5 -0
  279. package/lib/browser/chat/chat-stores.d.ts +8 -5
  280. package/lib/browser/chat/chat-stores.js +17 -9
  281. package/lib/browser/chat/chat-view.js +17 -10
  282. package/lib/browser/chat/chat.d.ts +16 -8
  283. package/lib/browser/chat/chat.js +86 -51
  284. package/lib/browser/components/account-menu.d.ts +0 -2
  285. package/lib/browser/components/account-menu.js +2 -29
  286. package/lib/browser/components/agent-settings-view.d.ts +3 -2
  287. package/lib/browser/components/agent-settings-view.js +2 -1
  288. package/lib/browser/components/app-nav.d.ts +5 -2
  289. package/lib/browser/components/app-nav.js +18 -5
  290. package/lib/browser/components/app-shell-hooks.js +5 -3
  291. package/lib/browser/components/app-view.js +72 -12
  292. package/lib/browser/components/busy.d.ts +26 -0
  293. package/lib/browser/components/busy.js +91 -0
  294. package/lib/browser/components/chat-icon.d.ts +30 -0
  295. package/lib/browser/components/chat-icon.js +117 -0
  296. package/lib/browser/components/chat-list.d.ts +73 -6
  297. package/lib/browser/components/chat-list.js +295 -59
  298. package/lib/browser/components/chat-seen.d.ts +54 -0
  299. package/lib/browser/components/chat-seen.js +104 -0
  300. package/lib/browser/components/composer-box.d.ts +14 -4
  301. package/lib/browser/components/composer-box.js +102 -62
  302. package/lib/browser/components/composer.d.ts +6 -6
  303. package/lib/browser/components/composer.js +4 -2
  304. package/lib/browser/components/conversation-scroll.d.ts +7 -0
  305. package/lib/browser/components/conversation-scroll.js +46 -7
  306. package/lib/browser/components/custom-host.d.ts +4 -0
  307. package/lib/browser/components/custom-host.js +50 -0
  308. package/lib/browser/components/directory-commands.d.ts +7 -0
  309. package/lib/browser/components/directory-commands.js +70 -0
  310. package/lib/browser/components/discover-view.d.ts +11 -4
  311. package/lib/browser/components/discover-view.js +19 -10
  312. package/lib/browser/components/dismiss.d.ts +4 -0
  313. package/lib/browser/components/dismiss.js +65 -0
  314. package/lib/browser/components/earlier-messages.d.ts +34 -3
  315. package/lib/browser/components/earlier-messages.js +44 -9
  316. package/lib/browser/components/editor-area.d.ts +6 -22
  317. package/lib/browser/components/editor-area.js +11 -98
  318. package/lib/browser/components/fold-text.d.ts +21 -0
  319. package/lib/browser/components/fold-text.js +103 -0
  320. package/lib/browser/components/folder-picker.d.ts +1 -1
  321. package/lib/browser/components/folder-picker.js +1 -1
  322. package/lib/browser/components/full-screen.d.ts +10 -0
  323. package/lib/browser/components/full-screen.js +62 -0
  324. package/lib/browser/components/grow-box.d.ts +10 -0
  325. package/lib/browser/components/grow-box.js +86 -0
  326. package/lib/browser/components/hold-to-talk.d.ts +23 -0
  327. package/lib/browser/components/hold-to-talk.js +65 -0
  328. package/lib/browser/components/host-view.d.ts +1 -1
  329. package/lib/browser/components/icon.d.ts +3 -1
  330. package/lib/browser/components/icon.js +4 -3
  331. package/lib/browser/components/image-viewer.d.ts +10 -2
  332. package/lib/browser/components/image-viewer.js +47 -10
  333. package/lib/browser/components/launcher-search-util.d.ts +4 -3
  334. package/lib/browser/components/launcher-search-util.js +12 -4
  335. package/lib/browser/components/lightbox.d.ts +5 -2
  336. package/lib/browser/components/lightbox.js +4 -3
  337. package/lib/browser/components/list-rows.d.ts +9 -1
  338. package/lib/browser/components/list-rows.js +18 -3
  339. package/lib/browser/components/markdown.js +36 -4
  340. package/lib/browser/components/media.js +19 -2
  341. package/lib/browser/components/message-actions.js +2 -0
  342. package/lib/browser/components/message-footer.d.ts +6 -0
  343. package/lib/browser/components/message-footer.js +20 -2
  344. package/lib/browser/components/message-list.d.ts +57 -6
  345. package/lib/browser/components/message-list.js +153 -34
  346. package/lib/browser/components/message-menu.js +6 -1
  347. package/lib/browser/components/model-picker.js +1 -0
  348. package/lib/browser/components/nav-places.d.ts +21 -2
  349. package/lib/browser/components/nav-places.js +22 -4
  350. package/lib/browser/components/notice-center.js +34 -0
  351. package/lib/browser/components/notice-face.d.ts +11 -0
  352. package/lib/browser/components/notice-face.js +64 -0
  353. package/lib/browser/components/phone-shell.d.ts +23 -1
  354. package/lib/browser/components/phone-shell.js +97 -10
  355. package/lib/browser/components/picture.d.ts +8 -1
  356. package/lib/browser/components/picture.js +13 -1
  357. package/lib/browser/components/plus-menu.d.ts +24 -0
  358. package/lib/browser/components/plus-menu.js +126 -0
  359. package/lib/browser/components/recent-shot.d.ts +16 -0
  360. package/lib/browser/components/recent-shot.js +210 -0
  361. package/lib/browser/components/relay-view.js +10 -3
  362. package/lib/browser/components/run-status.d.ts +1 -1
  363. package/lib/browser/components/run-status.js +17 -29
  364. package/lib/browser/components/said-text.d.ts +7 -0
  365. package/lib/browser/components/said-text.js +50 -0
  366. package/lib/browser/components/scan-screen.d.ts +11 -0
  367. package/lib/browser/components/scan-screen.js +266 -0
  368. package/lib/browser/components/search-page.js +10 -6
  369. package/lib/browser/components/session-settings.d.ts +2 -3
  370. package/lib/browser/components/session-settings.js +1 -0
  371. package/lib/browser/components/session-view.js +26 -16
  372. package/lib/browser/components/settings-choices.d.ts +1 -0
  373. package/lib/browser/components/settings-choices.js +2 -1
  374. package/lib/browser/components/settings-controls.d.ts +5 -3
  375. package/lib/browser/components/settings-controls.js +10 -1
  376. package/lib/browser/components/settings-parts.js +43 -12
  377. package/lib/browser/components/tool-view.js +7 -2
  378. package/lib/browser/components/unseen-drop.d.ts +40 -0
  379. package/lib/browser/components/unseen-drop.js +256 -0
  380. package/lib/browser/components/use-seen-chats.d.ts +9 -0
  381. package/lib/browser/components/use-seen-chats.js +85 -0
  382. package/lib/browser/components/voice-button.d.ts +7 -1
  383. package/lib/browser/components/voice-button.js +16 -2
  384. package/lib/browser/components/voice-picker.d.ts +7 -0
  385. package/lib/browser/components/voice-picker.js +89 -0
  386. package/lib/browser/components/voice-talk.d.ts +11 -3
  387. package/lib/browser/components/voice-talk.js +25 -4
  388. package/lib/browser/components/web-composer.d.ts +4 -2
  389. package/lib/browser/components/web-composer.js +7 -3
  390. package/lib/browser/components/workbench-tabs.d.ts +42 -0
  391. package/lib/browser/components/workbench-tabs.js +232 -0
  392. package/lib/browser/components/workbench-toggle.d.ts +0 -13
  393. package/lib/browser/components/workbench-toggle.js +1 -29
  394. package/lib/browser/device/code-scan.d.ts +56 -0
  395. package/lib/browser/device/code-scan.js +141 -0
  396. package/lib/browser/device/code-vision.d.ts +52 -0
  397. package/lib/browser/device/code-vision.js +103 -0
  398. package/lib/browser/device/hold.js +4 -6
  399. package/lib/browser/device/long-press.d.ts +10 -0
  400. package/lib/browser/device/long-press.js +28 -12
  401. package/lib/browser/device/own-gestures.d.ts +26 -0
  402. package/lib/browser/device/own-gestures.js +42 -0
  403. package/lib/browser/device/pull-down.js +3 -2
  404. package/lib/browser/device/recent-shots.d.ts +46 -0
  405. package/lib/browser/device/recent-shots.js +145 -0
  406. package/lib/browser/device/row-swipe.js +6 -1
  407. package/lib/browser/device/sheet-swipe.js +8 -1
  408. package/lib/browser/extension/extension-view.d.ts +10 -0
  409. package/lib/browser/extension/extension-view.js +7 -1
  410. package/lib/browser/extension/icons.js +14 -1
  411. package/lib/browser/extension/web-api-components.d.ts +270 -0
  412. package/lib/browser/extension/web-api-components.js +3 -0
  413. package/lib/browser/extension/web-api-contributions.d.ts +386 -0
  414. package/lib/browser/extension/web-api-contributions.js +3 -0
  415. package/lib/browser/extension/web-api-desktop.d.ts +56 -0
  416. package/lib/browser/extension/web-api-desktop.js +3 -0
  417. package/lib/browser/extension/web-api-terminal.d.ts +72 -0
  418. package/lib/browser/extension/web-api-terminal.js +3 -0
  419. package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
  420. package/lib/browser/extension/web-editor-tabs.js +141 -0
  421. package/lib/browser/extension/web-extension-api.d.ts +166 -565
  422. package/lib/browser/extension/web-extension-context.d.ts +79 -0
  423. package/lib/browser/extension/web-extension-context.js +383 -0
  424. package/lib/browser/extension/web-extension-protocol.d.ts +44 -6
  425. package/lib/browser/extension/web-extension-protocol.js +34 -1
  426. package/lib/browser/extension/web-extension-run.d.ts +55 -0
  427. package/lib/browser/extension/web-extension-run.js +123 -0
  428. package/lib/browser/extension/web-extensions.d.ts +29 -69
  429. package/lib/browser/extension/web-extensions.js +114 -545
  430. package/lib/browser/extension/web-home.d.ts +20 -0
  431. package/lib/browser/extension/web-home.js +76 -0
  432. package/lib/browser/extension/web-pages.d.ts +13 -3
  433. package/lib/browser/extension/web-pages.js +23 -3
  434. package/lib/browser/extension/web-session-notices.d.ts +37 -0
  435. package/lib/browser/extension/web-session-notices.js +177 -0
  436. package/lib/browser/extension/web-sharing.d.ts +2 -0
  437. package/lib/browser/extension/web-sharing.js +4 -0
  438. package/lib/browser/game/game-host.d.ts +28 -0
  439. package/lib/browser/game/game-host.js +163 -0
  440. package/lib/browser/game/game-loader.d.ts +11 -0
  441. package/lib/browser/game/game-loader.js +31 -0
  442. package/lib/browser/game/game-protocol.d.ts +50 -0
  443. package/lib/browser/game/game-protocol.js +3 -0
  444. package/lib/browser/game/game-runner.d.ts +28 -0
  445. package/lib/browser/game/game-runner.js +64 -0
  446. package/lib/browser/game/game-util.d.ts +30 -0
  447. package/lib/browser/game/game-util.js +183 -0
  448. package/lib/browser/game/game-view.d.ts +13 -0
  449. package/lib/browser/game/game-view.js +68 -0
  450. package/lib/browser/game/game3d-protocol.d.ts +52 -0
  451. package/lib/browser/game/game3d-protocol.js +3 -0
  452. package/lib/browser/game/game3d-runner.d.ts +28 -0
  453. package/lib/browser/game/game3d-runner.js +153 -0
  454. package/lib/browser/hooks.d.ts +5 -1
  455. package/lib/browser/hooks.js +14 -2
  456. package/lib/browser/i18n/locales.d.ts +82 -2
  457. package/lib/browser/i18n/messages.d.ts +81 -1
  458. package/lib/browser/i18n/messages.js +167 -7
  459. package/lib/browser/index.d.ts +9 -0
  460. package/lib/browser/index.js +9 -0
  461. package/lib/browser/links/links-protocol.d.ts +5 -0
  462. package/lib/browser/links/links.d.ts +19 -7
  463. package/lib/browser/links/links.js +57 -11
  464. package/lib/browser/markdown/code-renderers.d.ts +5 -0
  465. package/lib/browser/markdown/code-renderers.js +40 -0
  466. package/lib/browser/notices/notices-protocol.d.ts +17 -0
  467. package/lib/browser/notices/notices.d.ts +1 -1
  468. package/lib/browser/notices/notices.js +6 -2
  469. package/lib/browser/notices/session-notices.d.ts +70 -0
  470. package/lib/browser/notices/session-notices.js +96 -0
  471. package/lib/browser/offline/device-values.js +12 -3
  472. package/lib/browser/offline/offline-reads.js +3 -1
  473. package/lib/browser/settings/navigation.d.ts +3 -2
  474. package/lib/browser/settings/navigation.js +4 -3
  475. package/lib/browser/settings/settings-protocol.d.ts +15 -0
  476. package/lib/browser/settings/settings-protocol.js +19 -5
  477. package/lib/browser/state/state-protocol.d.ts +8 -1
  478. package/lib/browser/state/state.d.ts +2 -0
  479. package/lib/browser/state/state.js +21 -2
  480. package/lib/browser/style/base.d.ts +1 -1
  481. package/lib/browser/style/base.js +27 -1
  482. package/lib/browser/style/conversation.d.ts +1 -1
  483. package/lib/browser/style/conversation.js +43 -5
  484. package/lib/browser/style/device.js +15 -1
  485. package/lib/browser/style/layout.d.ts +1 -1
  486. package/lib/browser/style/layout.js +189 -56
  487. package/lib/browser/style/pages.d.ts +1 -1
  488. package/lib/browser/style/pages.js +36 -1
  489. package/lib/browser/style/phone.d.ts +1 -1
  490. package/lib/browser/style/phone.js +15 -0
  491. package/lib/browser/style/shell.d.ts +1 -1
  492. package/lib/browser/style/shell.js +30 -6
  493. package/lib/browser/style/surfaces.d.ts +1 -1
  494. package/lib/browser/style/surfaces.js +2 -2
  495. package/lib/browser/style/tints.d.ts +28 -0
  496. package/lib/browser/style/tints.js +59 -0
  497. package/lib/browser/style.js +13 -1
  498. package/lib/browser/util/composer.d.ts +6 -0
  499. package/lib/browser/util/composer.js +16 -0
  500. package/lib/browser/util/desktop.d.ts +19 -1
  501. package/lib/browser/util/desktop.js +15 -0
  502. package/lib/browser/util/link.d.ts +18 -0
  503. package/lib/browser/util/link.js +66 -1
  504. package/lib/browser/util/markdown.d.ts +4 -1
  505. package/lib/browser/util/markdown.js +1 -1
  506. package/lib/browser/util/message.d.ts +5 -0
  507. package/lib/browser/util/message.js +30 -0
  508. package/lib/browser/util/process.d.ts +14 -2
  509. package/lib/browser/util/process.js +39 -8
  510. package/lib/browser/util/progress.d.ts +19 -1
  511. package/lib/browser/util/progress.js +57 -4
  512. package/lib/browser/util/quote.d.ts +20 -0
  513. package/lib/browser/util/quote.js +61 -0
  514. package/lib/browser/util/tool.d.ts +19 -2
  515. package/lib/browser/util/tool.js +70 -2
  516. package/lib/browser/util/voice.d.ts +47 -7
  517. package/lib/browser/util/voice.js +269 -27
  518. package/lib/browser/workbench-calls.d.ts +6 -4
  519. package/lib/browser/workbench-calls.js +15 -10
  520. package/lib/browser/workbench-protocol.d.ts +31 -2
  521. package/lib/browser/workbench-util.d.ts +15 -4
  522. package/lib/browser/workbench-util.js +28 -5
  523. package/lib/browser/workbench.d.ts +33 -1
  524. package/lib/browser/workbench.js +140 -12
  525. package/package.json +11 -8
@@ -31,12 +31,12 @@ export var VoiceTalkUtil;
31
31
  })(VoiceTalkUtil || (VoiceTalkUtil = {}));
32
32
  const IDLE = { phase: 'idle', words: '', zone: 'send' };
33
33
  /**
34
- * A conversation by voice as WeChat's: a finger held on the message box (or on an entry of the navigation) dims the
35
- * page and a green bubble listens, the words coming as they are said. Let go on the bottom, they are sent; slid
34
+ * A conversation by voice as WeChat's: a finger held on the bar of the message box held to talk (TalkBar, or on an
35
+ * entry of the navigation) dims the page and a green bubble listens, the words coming as they are said. Let go on the bottom, they are sent; slid
36
36
  * over 取消 they are dropped, over 编辑 they stay in the box to be read over. A talk too short to be meant, which a
37
37
  * wrong touch is, says so and gives nothing, as one where nothing was heard does.
38
38
  */
39
- export function useVoiceTalk(onGive, onError) {
39
+ export function useVoiceTalk(onGive, onError, hints) {
40
40
  const t = useT();
41
41
  const language = useLanguage();
42
42
  const [state, setState] = React.useState(IDLE);
@@ -128,7 +128,7 @@ export function useVoiceTalk(onGive, onError) {
128
128
  }
129
129
  },
130
130
  // A finger held goes on past a pause: it stops when it lets go.
131
- true);
131
+ { continuous: true, hints });
132
132
  if (session) {
133
133
  listening.current = session;
134
134
  go('listening', { words: '', zone: 'send' });
@@ -180,6 +180,26 @@ export function useVoiceTalk(onGive, onError) {
180
180
  };
181
181
  return { ...state, active: state.phase === 'listening' || state.phase === 'released', start, point, release, cancel };
182
182
  }
183
+ /**
184
+ * The field of a message box on a touch screen once its microphone is tapped, as WeChat's: 按住 说话. The finger
185
+ * talks as soon as it lands (no wait, the bar is for nothing else), and is the bar's until it lets go, wherever it
186
+ * slides: onto 取消 or 编辑 of the overlay.
187
+ */
188
+ export function TalkBar({ talk }) {
189
+ const t = useT();
190
+ return (React.createElement("button", { type: "button", className: `ta-talk-bar${talk.active ? ' ta-on' : ''}`, "data-held": "", onPointerDown: event => {
191
+ var _a, _b;
192
+ if (!event.isPrimary || event.button !== 0) {
193
+ return;
194
+ }
195
+ event.preventDefault();
196
+ (_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
197
+ talk.start();
198
+ talk.point(event.clientX, event.clientY);
199
+ }, onPointerMove: event => talk.point(event.clientX, event.clientY), onPointerUp: () => talk.release(), onPointerCancel: () => talk.cancel(),
200
+ // A finger held is the bar's: no menu (device/long-press.ts sends one), no selection.
201
+ onContextMenu: event => event.preventDefault() }, t(talk.active ? 'ta.talk.releaseSend' : 'ta.talk.hold')));
202
+ }
183
203
  /**
184
204
  * What a talk shows, over the whole page (above the keyboard): the page dimmed, a green bubble with the words as
185
205
  * they come, 取消 and 编辑 to slide the finger onto, and the bottom it starts on, which says what letting go does.
@@ -1,4 +1,4 @@
1
- import type { TaDirEntry } from '@celljs/ta-protocol';
1
+ import type { TaDirEntry, TaServer } from '@celljs/ta-protocol';
2
2
  import * as React from 'react';
3
3
  import type { WebComposerProps } from '../extension/web-extension-api.js';
4
4
  import type { TaNotices } from '../notices/notices-protocol.js';
@@ -6,6 +6,8 @@ import { type FolderPickerRemote } from './folder-picker.js';
6
6
  export interface WebComposerHostProps extends WebComposerProps {
7
7
  /** Where a failure to send goes. */
8
8
  notices: TaNotices;
9
+ /** Where the commands of `commands` are read. */
10
+ server: Pick<TaServer, 'getDirectoryCommands'>;
9
11
  /** The entries of a directory of the server, for the button of `onPickCwd`. */
10
12
  listDirectory?(directory: string): Promise<TaDirEntry[]>;
11
13
  /** The directory of ta serve: that of a `cwd` left empty. */
@@ -14,4 +16,4 @@ export interface WebComposerHostProps extends WebComposerProps {
14
16
  remote?: FolderPickerRemote;
15
17
  }
16
18
  /** The message box as web extensions get it (`pi.ui.Composer`): text only, `@` for the names they give; a failure is a notice of the page. */
17
- export declare function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
19
+ export declare function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, server, listDirectory, serverCwd, remote, }: WebComposerHostProps): React.JSX.Element;
@@ -1,15 +1,19 @@
1
1
  import * as React from 'react';
2
- import { useT } from '../i18n/use-t.js';
2
+ import { useLanguage, useT } from '../i18n/use-t.js';
3
3
  import { ComposerUtil } from '../util/composer.js';
4
4
  import { ComposerBox } from './composer-box.js';
5
+ import { useDirectoryCommands } from './directory-commands.js';
5
6
  import { DirectoryButton } from './folder-picker.js';
6
7
  /** The message box as web extensions get it (`pi.ui.Composer`): text only, `@` for the names they give; a failure is a notice of the page. */
7
- export function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, listDirectory, serverCwd, remote, }) {
8
+ export function WebComposer({ notices, placeholder, onSend, mentions, mentionLabel, actions, cwd, onPickCwd, commands, working, onStop, voiceSends, onTalkSent, onListening, after, server, listDirectory, serverCwd, remote, }) {
8
9
  const t = useT();
10
+ const language = useLanguage();
9
11
  const [query, setQuery] = React.useState();
12
+ const found = useDirectoryCommands(server, commands ? cwd || serverCwd : undefined);
13
+ const listed = React.useMemo(() => found.map(command => ({ name: command.name, description: ComposerUtil.commandDescription(command, language, t) })), [found, language, t]);
10
14
  return (React.createElement(ComposerBox, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('ta.composer.label'), onSend: async (text) => {
11
15
  await onSend(text);
12
- }, onMentionQuery: mentions ? setQuery : undefined, mentions: mentions && query !== undefined
16
+ }, commands: listed, onMentionQuery: mentions ? setQuery : undefined, mentions: mentions && query !== undefined
13
17
  ? {
14
18
  items: ComposerUtil.commands(mentions, query).map(mention => ({
15
19
  key: mention.name,
@@ -17,6 +21,6 @@ export function WebComposer({ notices, placeholder, onSend, mentions, mentionLab
17
21
  detail: mention.detail,
18
22
  })),
19
23
  }
20
- : undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions, beside: onPickCwd && listDirectory && React.createElement(DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, remote: remote, onPick: onPickCwd }), cwd: cwd || serverCwd, onError: cause => notices.error(cause) }));
24
+ : undefined, mentionLabel: mentions ? mentionLabel : undefined, actions: actions, head: onPickCwd && listDirectory && React.createElement(DirectoryButton, { cwd: cwd || serverCwd || '', list: listDirectory, remote: remote, onPick: onPickCwd }), cwd: cwd || serverCwd, working: working, onStop: onStop, voiceSends: voiceSends, onTalkSent: onTalkSent, onListening: onListening, after: after, onError: cause => notices.error(cause) }));
21
25
  }
22
26
  //# sourceMappingURL=web-composer.js.map
@@ -0,0 +1,41 @@
1
+ import * as React from 'react';
2
+ import { type WebEditorEntry, type WebViewEntry } from '../extension/web-extension-protocol.js';
3
+ /** What the head of the workbench shows and does: its tabs, the tools it opens, its place. */
4
+ export interface WorkbenchTabsProps {
5
+ editors: WebEditorEntry[];
6
+ active?: string;
7
+ /** The `panel` views: what `+` and the empty workbench open. */
8
+ views: WebViewEntry[];
9
+ onShow(id: string): void;
10
+ /** Closes tabs: one, or several at once from the menu of a tab. */
11
+ onClose(ids: string[]): void;
12
+ /** Keeps a preview tab (a double click on it). */
13
+ onPin(id: string): void;
14
+ onOpenView(id: string): void;
15
+ onHide(): void;
16
+ /** Where its tools are (`ui.useCwd`): that of the conversation in front, else the default directory. */
17
+ cwd?: string;
18
+ /** Whether the workbench takes the place of the conversation too; none on narrow screens, where it always does. */
19
+ maximized?: boolean;
20
+ onMaximize?(): void;
21
+ }
22
+ export declare function ViewGlyph({ view, size }: {
23
+ view: WebViewEntry;
24
+ size: number;
25
+ }): React.JSX.Element;
26
+ /**
27
+ * The tabs of a wide workbench, as those of a browser or an editor: the one shown is a card joined to what it
28
+ * shows, the others lie on the strip with a line between them, `+` follows the last one.
29
+ */
30
+ export declare function TabStrip({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd, maximized, onMaximize }: WorkbenchTabsProps): React.JSX.Element;
31
+ /**
32
+ * The head of the workbench on a phone, as a browser's there: back to the conversation, the tab shown with how
33
+ * many are open, which opens the list of them (TabSwitcher), and `+`. A row of tabs a finger scrolls and
34
+ * closes by their small crosses is neither seen nor hit well on a phone.
35
+ */
36
+ export declare function CompactHead({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd }: WorkbenchTabsProps): React.JSX.Element;
37
+ /** The tabs open on a phone, as rows of a finger's height under its head: a tap shows one, its cross closes it, a long press opens its menu. */
38
+ export declare function TabSwitcher({ editors, active, onShow, onClose, onMenu, onDismiss, }: Pick<WorkbenchTabsProps, 'editors' | 'active' | 'onShow' | 'onClose'> & {
39
+ onMenu(event: React.MouseEvent, editor: WebEditorEntry): void;
40
+ onDismiss(): void;
41
+ }): React.JSX.Element;
@@ -0,0 +1,193 @@
1
+ import { ChevronDown, ChevronLeft, Folder, Maximize2, Minimize2, PanelTop, Plus, X } from 'lucide-react';
2
+ import * as React from 'react';
3
+ import { WebLabelUtil } from '../extension/web-extension-protocol.js';
4
+ import { useT } from '../i18n/use-t.js';
5
+ import { MessageUtil } from '../util/message.js';
6
+ import { useContextMenu } from './context-menu.js';
7
+ import { useDismiss } from './dismiss.js';
8
+ import { Icon, IconButton, SidebarRight } from './icon.js';
9
+ export function ViewGlyph({ view, size }) {
10
+ var _a;
11
+ const Glyph = (_a = view.icon) !== null && _a !== void 0 ? _a : PanelTop;
12
+ return React.createElement(Glyph, { size: size, strokeWidth: 1.6 });
13
+ }
14
+ /** How far a menu keeps from the edges of the window. */
15
+ const MENU_MARGIN = 8;
16
+ /** `+` of the workbench, after its tabs as a browser's: the tools it opens, under the directory they open in. */
17
+ function OpenMenu({ views, onOpenView, cwd, align = 'start' }) {
18
+ const t = useT();
19
+ const [open, setOpen] = React.useState(false);
20
+ const root = React.useRef(null);
21
+ const button = React.useRef(null);
22
+ const menu = React.useRef(null);
23
+ const id = React.useId();
24
+ const close = React.useCallback(() => setOpen(false), []);
25
+ useDismiss(open, close, root, button);
26
+ // Under +, kept inside the window: + follows the tabs, and may be near its right edge.
27
+ React.useLayoutEffect(() => {
28
+ var _a;
29
+ const element = menu.current;
30
+ if (!open || !element) {
31
+ return;
32
+ }
33
+ const box = element.getBoundingClientRect();
34
+ const over = box.right - (document.documentElement.clientWidth - MENU_MARGIN);
35
+ if (over > 0) {
36
+ element.style.transform = `translateX(${-Math.min(over, box.left - MENU_MARGIN)}px)`;
37
+ }
38
+ (_a = element.querySelector('[role="menuitem"]')) === null || _a === void 0 ? void 0 : _a.focus();
39
+ }, [open]);
40
+ const onKeyDown = (event) => {
41
+ var _a, _b;
42
+ var _c;
43
+ if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') {
44
+ return;
45
+ }
46
+ event.preventDefault();
47
+ const items = [...((_c = (_a = menu.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[role="menuitem"]')) !== null && _c !== void 0 ? _c : [])];
48
+ const at = items.indexOf(document.activeElement);
49
+ (_b = items[(at + (event.key === 'ArrowDown' ? 1 : items.length - 1)) % items.length]) === null || _b === void 0 ? void 0 : _b.focus();
50
+ };
51
+ return (React.createElement("div", { className: "ta-workbench-open", ref: root },
52
+ React.createElement("button", { ref: button, type: "button", className: `ta-icon-button ${open ? 'ta-on' : ''}`, title: t('ta.workbench.open'), "aria-label": t('ta.workbench.open'), "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": open ? id : undefined, onClick: () => setOpen(!open) },
53
+ React.createElement(Icon, { icon: Plus })),
54
+ open && (React.createElement("div", { className: `ta-workbench-menu ta-${align}`, id: id, role: "menu", ref: menu, "aria-label": t('ta.workbench.open'), onKeyDown: onKeyDown },
55
+ cwd && (React.createElement("div", { className: "ta-workbench-menu-cwd", title: t('ta.workbench.cwd', { path: cwd }) },
56
+ React.createElement(Folder, { size: 13, strokeWidth: 1.7, "aria-hidden": "true" }),
57
+ React.createElement("span", { className: "ta-ellipsis" }, MessageUtil.basename(cwd)))),
58
+ views.map(view => (React.createElement("button", { key: view.id, type: "button", role: "menuitem", className: "ta-account-item", onClick: () => {
59
+ close();
60
+ onOpenView(view.id);
61
+ } },
62
+ React.createElement(ViewGlyph, { view: view, size: 15 }),
63
+ React.createElement("span", { className: "ta-ellipsis" }, WebLabelUtil.text(view.title)))))))));
64
+ }
65
+ /** The menu of a tab: closing it, the others, those to a side, the saved ones, all; keeping a preview. */
66
+ function useTabMenu(editors, onClose, onPin) {
67
+ const t = useT();
68
+ return (editor) => {
69
+ const at = editors.indexOf(editor);
70
+ const ids = (list) => list.map(candidate => candidate.id);
71
+ const others = editors.filter(candidate => candidate !== editor);
72
+ const left = editors.slice(0, at);
73
+ const right = editors.slice(at + 1);
74
+ const saved = editors.filter(candidate => !candidate.dirty);
75
+ const items = [
76
+ { label: t('ta.tab.close'), run: () => onClose([editor.id]) },
77
+ { label: t('ta.tab.closeOthers'), run: () => onClose(ids(others)), disabled: others.length === 0 },
78
+ { label: t('ta.tab.closeLeft'), run: () => onClose(ids(left)), disabled: left.length === 0 },
79
+ { label: t('ta.tab.closeRight'), run: () => onClose(ids(right)), disabled: right.length === 0 },
80
+ '-',
81
+ { label: t('ta.tab.closeSaved'), run: () => onClose(ids(saved)), disabled: saved.length === 0 },
82
+ { label: t('ta.tab.closeAll'), run: () => onClose(ids(editors)) },
83
+ ];
84
+ if (editor.preview) {
85
+ items.push('-', { label: t('ta.tab.keepOpen'), run: () => onPin(editor.id) });
86
+ }
87
+ return items;
88
+ };
89
+ }
90
+ /** The close of a tab, or of a row of the tabs of a phone; the dot of a tab not saved, which it shows under a pointer. */
91
+ function CloseTab({ editor, title, onClose, onContextMenu, }) {
92
+ const t = useT();
93
+ return (React.createElement("button", { type: "button", className: "ta-editor-tab-close", "aria-label": t('ta.editor.close', { title }), onClick: onClose, onContextMenu: onContextMenu },
94
+ React.createElement(Icon, { icon: X, size: 13 }),
95
+ editor.dirty && React.createElement("span", { className: "ta-editor-tab-dirty", "aria-hidden": "true" })));
96
+ }
97
+ /**
98
+ * The tabs of a wide workbench, as those of a browser or an editor: the one shown is a card joined to what it
99
+ * shows, the others lie on the strip with a line between them, `+` follows the last one.
100
+ */
101
+ export function TabStrip({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd, maximized, onMaximize }) {
102
+ const t = useT();
103
+ const [menu, openMenu] = useContextMenu();
104
+ const menuFor = useTabMenu(editors, onClose, onPin);
105
+ const list = React.useRef(null);
106
+ // The tab shown is in sight, also one opened past the edge of a strip that scrolls.
107
+ // biome-ignore lint/correctness/useExhaustiveDependencies: run again when another tab is shown or one opens
108
+ React.useEffect(() => {
109
+ var _a, _b;
110
+ (_b = (_a = list.current) === null || _a === void 0 ? void 0 : _a.querySelector('.ta-editor-tab.ta-active')) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'nearest', inline: 'nearest' });
111
+ }, [active, editors.length]);
112
+ return (React.createElement("header", { className: "ta-editor-tabs" },
113
+ React.createElement("div", { className: "ta-editor-tablist", role: "tablist", ref: list },
114
+ editors.length === 0 && React.createElement("span", { className: "ta-workbench-title" }, t('ta.workbench')),
115
+ editors.map(editor => {
116
+ const title = WebLabelUtil.text(editor.title);
117
+ const Glyph = editor.icon;
118
+ const selected = editor.id === active;
119
+ return (React.createElement("div", { key: editor.id, className: `ta-editor-tab ${selected ? 'ta-active' : ''} ${editor.preview ? 'ta-preview' : ''} ${editor.dirty ? 'ta-dirty' : ''}`, title: title },
120
+ React.createElement("button", { type: "button", role: "tab", "aria-selected": selected, className: "ta-editor-tab-button", onClick: () => onShow(editor.id), onDoubleClick: () => onPin(editor.id), onAuxClick: event => event.button === 1 && onClose([editor.id]), onContextMenu: event => openMenu(event, menuFor(editor)) },
121
+ Glyph && React.createElement(Glyph, { size: 14 }),
122
+ React.createElement("span", null, title)),
123
+ React.createElement(CloseTab, { editor: editor, title: title, onClose: () => onClose([editor.id]), onContextMenu: event => openMenu(event, menuFor(editor)) })));
124
+ })),
125
+ views.length > 0 && React.createElement(OpenMenu, { views: views, onOpenView: onOpenView, cwd: cwd }),
126
+ menu,
127
+ React.createElement("div", { className: "ta-workbench-actions" },
128
+ onMaximize && (React.createElement(IconButton, { icon: maximized ? Minimize2 : Maximize2, label: t(maximized ? 'ta.workbench.restore' : 'ta.workbench.maximize'), className: "ta-wide-only", "aria-pressed": maximized, onClick: onMaximize })),
129
+ React.createElement(IconButton, { icon: SidebarRight, label: t('ta.panel.hide'), onClick: onHide }))));
130
+ }
131
+ /**
132
+ * The head of the workbench on a phone, as a browser's there: back to the conversation, the tab shown with how
133
+ * many are open, which opens the list of them (TabSwitcher), and `+`. A row of tabs a finger scrolls and
134
+ * closes by their small crosses is neither seen nor hit well on a phone.
135
+ */
136
+ export function CompactHead({ editors, active, views, onShow, onClose, onPin, onOpenView, onHide, cwd }) {
137
+ const t = useT();
138
+ const [open, setOpen] = React.useState(false);
139
+ const [menu, openMenu] = useContextMenu();
140
+ const menuFor = useTabMenu(editors, onClose, onPin);
141
+ const root = React.useRef(null);
142
+ const button = React.useRef(null);
143
+ const close = React.useCallback(() => setOpen(false), []);
144
+ useDismiss(open, close, root, button);
145
+ const shown = editors.find(editor => editor.id === active);
146
+ // Nothing left to list: the list goes with the last tab.
147
+ React.useEffect(() => {
148
+ if (editors.length === 0) {
149
+ setOpen(false);
150
+ }
151
+ }, [editors.length]);
152
+ const Glyph = shown === null || shown === void 0 ? void 0 : shown.icon;
153
+ const title = shown ? WebLabelUtil.text(shown.title) : t('ta.workbench');
154
+ return (React.createElement("div", { className: "ta-editor-head-compact", ref: root },
155
+ React.createElement("header", { className: "ta-editor-tabs" },
156
+ React.createElement(IconButton, { icon: ChevronLeft, label: t('ta.panel.hide'), className: "ta-workbench-back", onClick: onHide }),
157
+ shown ? (React.createElement("button", { ref: button, type: "button", className: `ta-workbench-switch ${open ? 'ta-on' : ''}`, "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": `${title}, ${t('ta.workbench.tabs', { count: editors.length })}`, onClick: () => setOpen(!open), onContextMenu: event => openMenu(event, menuFor(shown)) },
158
+ Glyph && React.createElement(Glyph, { size: 16 }),
159
+ React.createElement("span", { className: "ta-workbench-switch-title" }, title),
160
+ editors.length > 1 && React.createElement("span", { className: "ta-workbench-count" }, editors.length),
161
+ React.createElement(ChevronDown, { className: "ta-workbench-switch-caret", size: 15, strokeWidth: 1.8, "aria-hidden": "true" }))) : (React.createElement("span", { className: "ta-workbench-title" }, title)),
162
+ views.length > 0 && React.createElement(OpenMenu, { views: views, onOpenView: onOpenView, cwd: cwd, align: "end" })),
163
+ menu,
164
+ open && (React.createElement(TabSwitcher, { editors: editors, active: active, onShow: id => {
165
+ close();
166
+ onShow(id);
167
+ }, onClose: onClose, onMenu: (event, editor) => openMenu(event, menuFor(editor)), onDismiss: close }))));
168
+ }
169
+ /** The tabs open on a phone, as rows of a finger's height under its head: a tap shows one, its cross closes it, a long press opens its menu. */
170
+ export function TabSwitcher({ editors, active, onShow, onClose, onMenu, onDismiss, }) {
171
+ const t = useT();
172
+ return (React.createElement(React.Fragment, null,
173
+ React.createElement("button", { type: "button", className: "ta-tab-switcher-scrim", tabIndex: -1, "aria-label": t('ta.close'), onClick: onDismiss }),
174
+ React.createElement("div", { className: "ta-tab-switcher" },
175
+ React.createElement("div", { className: "ta-tab-switcher-head" },
176
+ React.createElement("span", { className: "ta-tab-switcher-count" }, t('ta.workbench.tabs', { count: editors.length })),
177
+ editors.length > 1 && (React.createElement("button", { type: "button", className: "ta-tab-switcher-all", onClick: () => onClose(editors.map(editor => editor.id)) }, t('ta.tab.closeAll')))),
178
+ React.createElement("div", { className: "ta-tab-switcher-list", role: "listbox", "aria-label": t('ta.workbench.tabs', { count: editors.length }) }, editors.map(editor => {
179
+ var _a;
180
+ const title = WebLabelUtil.text(editor.title);
181
+ const Glyph = (_a = editor.icon) !== null && _a !== void 0 ? _a : PanelTop;
182
+ const selected = editor.id === active;
183
+ return (React.createElement("div", { key: editor.id, className: `ta-tab-switcher-row ${selected ? 'ta-active' : ''} ${editor.dirty ? 'ta-dirty' : ''}` },
184
+ React.createElement("button", { type: "button", role: "option", "aria-selected": selected, className: "ta-tab-switcher-main", onClick: () => onShow(editor.id), onContextMenu: event => onMenu(event, editor) },
185
+ React.createElement("span", { className: "ta-tab-switcher-glyph" },
186
+ React.createElement(Glyph, { size: 16 })),
187
+ React.createElement("span", { className: `ta-tab-switcher-title ${editor.preview ? 'ta-preview' : ''}` }, title),
188
+ editor.dirty && React.createElement("span", { className: "ta-tab-switcher-dirty", "aria-hidden": "true" })),
189
+ React.createElement("button", { type: "button", className: "ta-tab-switcher-close", "aria-label": t('ta.editor.close', { title }), onClick: () => onClose([editor.id]) },
190
+ React.createElement(Icon, { icon: X, size: 16 }))));
191
+ })))));
192
+ }
193
+ //# sourceMappingURL=workbench-tabs.js.map
@@ -1,12 +1,8 @@
1
1
  import * as React from 'react';
2
- import { type Translate } from '../i18n/use-t.js';
3
- import type { ComposerAction } from './composer-box.js';
4
2
  /** The workbench on the right is the page's, one for all of it: whether it shows, and the button that shows or hides it. */
5
3
  export interface WorkbenchToggleState {
6
4
  open: boolean;
7
5
  toggle(): void;
8
- /** The tabs open in it. */
9
- tabs: number;
10
6
  }
11
7
  export declare const WorkbenchToggleContext: React.Context<WorkbenchToggleState | undefined>;
12
8
  /**
@@ -14,12 +10,3 @@ export declare const WorkbenchToggleContext: React.Context<WorkbenchToggleState
14
10
  * hidden: once shown, the same button on top of the workbench hides it.
15
11
  */
16
12
  export declare function WorkbenchToggle(): React.JSX.Element | null;
17
- /**
18
- * The same, as an entry of the + menu of the message box, on a phone only: held in one hand, the head is out
19
- * of reach of the thumb, and a swipe to the left across the conversation is not easy either.
20
- */
21
- export declare function useWorkbenchAction(): ComposerAction | undefined;
22
- export declare namespace WorkbenchToggleUtil {
23
- /** The entry of the + menu that shows the workbench: on a phone, while it is hidden. */
24
- function action(state: WorkbenchToggleState | undefined, handheld: boolean, t: Translate): ComposerAction | undefined;
25
- }
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { useDevice } from '../device/device.js';
3
2
  import { useT } from '../i18n/use-t.js';
4
- import { Icon, IconButton, SidebarRight } from './icon.js';
3
+ import { IconButton, SidebarRight } from './icon.js';
5
4
  export const WorkbenchToggleContext = React.createContext(undefined);
6
5
  /**
7
6
  * The button that shows the workbench, for the head of the conversation or of a page. Only while it is
@@ -15,30 +14,4 @@ export function WorkbenchToggle() {
15
14
  }
16
15
  return React.createElement(IconButton, { icon: SidebarRight, label: t('ta.panel.show'), onClick: state.toggle });
17
16
  }
18
- /**
19
- * The same, as an entry of the + menu of the message box, on a phone only: held in one hand, the head is out
20
- * of reach of the thumb, and a swipe to the left across the conversation is not easy either.
21
- */
22
- export function useWorkbenchAction() {
23
- const t = useT();
24
- const { handheld } = useDevice();
25
- return WorkbenchToggleUtil.action(React.useContext(WorkbenchToggleContext), handheld, t);
26
- }
27
- export var WorkbenchToggleUtil;
28
- (function (WorkbenchToggleUtil) {
29
- /** The entry of the + menu that shows the workbench: on a phone, while it is hidden. */
30
- function action(state, handheld, t) {
31
- if (!handheld || !state || state.open) {
32
- return undefined;
33
- }
34
- return {
35
- key: 'workbench',
36
- label: t('ta.workbench'),
37
- icon: React.createElement(Icon, { icon: SidebarRight, size: 16 }),
38
- detail: state.tabs ? t('ta.workbench.tabs', { count: state.tabs }) : undefined,
39
- run: state.toggle,
40
- };
41
- }
42
- WorkbenchToggleUtil.action = action;
43
- })(WorkbenchToggleUtil || (WorkbenchToggleUtil = {}));
44
17
  //# sourceMappingURL=workbench-toggle.js.map
@@ -0,0 +1,55 @@
1
+ import type { TaWebExtensions } from '../extension/web-extension-protocol.js';
2
+ import { type MessageId } from '../i18n/messages.js';
3
+ import type { TaLinks } from '../links/links-protocol.js';
4
+ import type { TaNotices } from '../notices/notices-protocol.js';
5
+ import type { TaSettings } from '../settings/settings-protocol.js';
6
+ import type { TaWorkbench } from '../workbench-protocol.js';
7
+ /** Whether the scan screen of the page is open: ScanHost (components/scan-screen.tsx) draws it, CodeScan opens it. */
8
+ export declare namespace ScanScreen {
9
+ const isOpen: () => boolean;
10
+ const show: () => void;
11
+ const hide: () => void;
12
+ function subscribe(listener: () => void): () => void;
13
+ }
14
+ /** What a scanned code carries, as WeChat's Scan reads it: a computer to pair with, a link of an extension, a page of the web, or text. */
15
+ export type ScannedCode = {
16
+ kind: 'pairing';
17
+ } | {
18
+ kind: 'extension';
19
+ } | {
20
+ kind: 'web';
21
+ url: string;
22
+ } | {
23
+ kind: 'text';
24
+ text: string;
25
+ };
26
+ export declare namespace CodeScanUtil {
27
+ /** Pure, for the tests. A plain URL of a page is a page, not an extension of Git: only a link of Ta names one. */
28
+ function read(text: string): ScannedCode;
29
+ }
30
+ /** What the scan of the page uses (the services of the page; a web extension's context has them). */
31
+ export interface CodeScanHost {
32
+ readonly workbench: TaWorkbench;
33
+ readonly notices: TaNotices;
34
+ readonly links: TaLinks;
35
+ readonly extensions: Pick<TaWebExtensions, 'openShared'>;
36
+ readonly settings: TaSettings;
37
+ }
38
+ /**
39
+ * Scan, as WeChat's: the scan screen of the page where the app reads codes (CodeVision), else the scanner of the
40
+ * app's plugin (an app built before); then what the code carries opens. A computer is connected to and
41
+ * switched to once the user said so, an extension opens as its link does (asking first), a page of the web
42
+ * after the question of every link going out of Ta, other text shows to copy.
43
+ */
44
+ export declare class CodeScan {
45
+ protected readonly host: CodeScanHost;
46
+ constructor(host: CodeScanHost);
47
+ /** Only the Ta app has a camera to scan with. */
48
+ static available(): boolean;
49
+ scan(): Promise<void>;
50
+ /** What a code scanned carries. */
51
+ open(text: string): Promise<void>;
52
+ protected pair(link: string): Promise<void>;
53
+ protected show(text: string): Promise<void>;
54
+ protected say(id: MessageId): string;
55
+ }
@@ -0,0 +1,137 @@
1
+ import { message } from '../i18n/messages.js';
2
+ import { ShareLinkUtil } from '../util/share-link.js';
3
+ import { pageHost, WorkbenchError, WorkbenchUtil } from '../workbench-util.js';
4
+ import { CodeVision } from './code-vision.js';
5
+ import { ScanError, Scanner } from './scanner.js';
6
+ /** Whether the scan screen of the page is open: ScanHost (components/scan-screen.tsx) draws it, CodeScan opens it. */
7
+ export var ScanScreen;
8
+ (function (ScanScreen) {
9
+ let open = false;
10
+ const listeners = new Set();
11
+ const set = (value) => {
12
+ open = value;
13
+ for (const listener of listeners) {
14
+ listener();
15
+ }
16
+ };
17
+ ScanScreen.isOpen = () => open;
18
+ ScanScreen.show = () => set(true);
19
+ ScanScreen.hide = () => set(false);
20
+ function subscribe(listener) {
21
+ listeners.add(listener);
22
+ return () => listeners.delete(listener);
23
+ }
24
+ ScanScreen.subscribe = subscribe;
25
+ })(ScanScreen || (ScanScreen = {}));
26
+ const WEB = /^https?:\/\/\S+$/i;
27
+ export var CodeScanUtil;
28
+ (function (CodeScanUtil) {
29
+ /** Pure, for the tests. A plain URL of a page is a page, not an extension of Git: only a link of Ta names one. */
30
+ function read(text) {
31
+ const trimmed = text.trim();
32
+ if ('pairing' in WorkbenchUtil.credential(trimmed)) {
33
+ return { kind: 'pairing' };
34
+ }
35
+ const source = ShareLinkUtil.sourceOf(trimmed);
36
+ if (source && (source !== trimmed || !WEB.test(trimmed) || ShareLinkUtil.relayed(trimmed))) {
37
+ return { kind: 'extension' };
38
+ }
39
+ if (WEB.test(trimmed)) {
40
+ try {
41
+ return { kind: 'web', url: new URL(trimmed).href };
42
+ }
43
+ catch (_a) {
44
+ // Not a URL after all: text.
45
+ }
46
+ }
47
+ return { kind: 'text', text: trimmed };
48
+ }
49
+ CodeScanUtil.read = read;
50
+ })(CodeScanUtil || (CodeScanUtil = {}));
51
+ /**
52
+ * Scan, as WeChat's: the scan screen of the page where the app reads codes (CodeVision), else the scanner of the
53
+ * app's plugin (an app built before); then what the code carries opens. A computer is connected to and
54
+ * switched to once the user said so, an extension opens as its link does (asking first), a page of the web
55
+ * after the question of every link going out of Ta, other text shows to copy.
56
+ */
57
+ export class CodeScan {
58
+ constructor(host) {
59
+ this.host = host;
60
+ }
61
+ /** Only the Ta app has a camera to scan with. */
62
+ static available() {
63
+ return CodeVision.available() || Scanner.available();
64
+ }
65
+ async scan() {
66
+ if (CodeVision.available()) {
67
+ ScanScreen.show();
68
+ return;
69
+ }
70
+ let text;
71
+ try {
72
+ text = await Scanner.scan(this.say('ta.scan.instructions'), this.say('ta.cancel'));
73
+ }
74
+ catch (failure) {
75
+ const denied = failure instanceof ScanError && failure.reason === 'denied';
76
+ this.host.notices.notify(this.say(denied ? 'ta.hosts.cameraDenied' : 'ta.scan.failed'), { level: 'error' });
77
+ return;
78
+ }
79
+ if (text) {
80
+ await this.open(text);
81
+ }
82
+ }
83
+ /** What a code scanned carries. */
84
+ async open(text) {
85
+ const code = CodeScanUtil.read(text);
86
+ switch (code.kind) {
87
+ case 'pairing':
88
+ return this.pair(text.trim());
89
+ case 'extension':
90
+ await this.host.extensions.openShared(text);
91
+ return;
92
+ case 'web':
93
+ return this.host.links.open({ type: 'url', url: code.url }, { external: true });
94
+ case 'text':
95
+ return this.show(code.text);
96
+ }
97
+ }
98
+ async pair(link) {
99
+ const { workbench, notices } = this.host;
100
+ const id = WorkbenchUtil.serverOf(WorkbenchUtil.credential(link), pageHost());
101
+ if (id === workbench.state.host && workbench.state.status !== 'signed-out') {
102
+ notices.notify(this.say('ta.scan.sameHost'));
103
+ return;
104
+ }
105
+ const yes = await notices.confirm({
106
+ title: this.say('ta.scan.pairTitle'),
107
+ message: this.say('ta.scan.pairMessage'),
108
+ confirmLabel: this.say('ta.signin.connect'),
109
+ });
110
+ if (!yes) {
111
+ return;
112
+ }
113
+ try {
114
+ await workbench.signIn(link);
115
+ }
116
+ catch (failure) {
117
+ const refused = failure instanceof WorkbenchError && failure.reason === 'refused';
118
+ notices.notify(this.say(refused ? 'ta.hosts.refused' : 'ta.hosts.unreachable'), { level: 'error' });
119
+ }
120
+ }
121
+ async show(text) {
122
+ const { notices } = this.host;
123
+ if (await notices.confirm({ title: this.say('ta.scan.result'), message: text, confirmLabel: this.say('ta.copy') })) {
124
+ try {
125
+ await navigator.clipboard.writeText(text);
126
+ notices.notify(this.say('ta.copied'), { level: 'success' });
127
+ }
128
+ catch (_a) {
129
+ notices.notify(this.say('ta.scan.copyFailed'), { level: 'error' });
130
+ }
131
+ }
132
+ }
133
+ say(id) {
134
+ return message(this.host.settings.state.language, id);
135
+ }
136
+ }
137
+ //# sourceMappingURL=code-scan.js.map
@@ -0,0 +1,51 @@
1
+ /** A code found in a picture: its text, and where it is, as fractions of the picture (0 to 1 from its top left). */
2
+ export interface FoundCode {
3
+ text: string;
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /** Where a picture of `width` by `height` is drawn to cover a box of `boxWidth` by `boxHeight` (`object-fit: cover`). */
10
+ export interface CoverPlace {
11
+ scale: number;
12
+ left: number;
13
+ top: number;
14
+ }
15
+ /**
16
+ * Codes read from pictures by the Ta app (Apple's Vision, which reads a QR code from any angle and in poor light),
17
+ * for the camera of the scan screen and the pictures of the album: no decoder bundled in the page. Pure helpers
18
+ * besides, for the tests.
19
+ */
20
+ export declare namespace CodeVision {
21
+ /** The window event the Ta app answers with. */
22
+ const EVENT = "ta-vision";
23
+ /** The app reads codes and the page has a camera: the scan screen of the page. */
24
+ function available(): boolean;
25
+ /** The codes of a picture (a data URL of a JPEG); none where the app cannot read them. */
26
+ function detect(image: string): Promise<FoundCode[]>;
27
+ /** What the app answered, only codes with text and a place inside the picture. */
28
+ function codesOf(codes: unknown): FoundCode[];
29
+ function cover(width: number, height: number, boxWidth: number, boxHeight: number): CoverPlace;
30
+ /**
31
+ * The middle of a code on the screen, the picture (`width` by `height`) covering a box of `boxWidth` by
32
+ * `boxHeight`, `mirrored` as the front camera shows; where the green dot goes, as in WeChat.
33
+ */
34
+ function centre(code: FoundCode, width: number, height: number, boxWidth: number, boxHeight: number, mirrored?: boolean): {
35
+ x: number;
36
+ y: number;
37
+ };
38
+ /** The size of a picture whose longer side is at most `longest`, its shape kept. */
39
+ function fit(width: number, height: number, longest: number): {
40
+ width: number;
41
+ height: number;
42
+ };
43
+ /** A JPEG of what `source` shows (a frame of the camera, a picture), its longer side at most `longest`. */
44
+ function jpeg(source: CanvasImageSource, width: number, height: number, longest: number, quality: number): string;
45
+ /** A data URL as an image of a message: its base64 and its type. */
46
+ function image(dataUrl: string): {
47
+ type: 'image';
48
+ data: string;
49
+ mimeType: string;
50
+ };
51
+ }