@celljs/ta-web 4.9.0 → 4.10.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 (376) hide show
  1. package/README.en.md +4 -3
  2. package/README.md +4 -3
  3. package/esm/browser/assistant/assistant-chat-list.js +8 -2
  4. package/esm/browser/assistant/assistant-extension.d.ts +8 -1
  5. package/esm/browser/assistant/assistant-extension.js +33 -5
  6. package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
  7. package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
  8. package/esm/browser/assistant/assistant-task-source.js +2 -0
  9. package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
  10. package/esm/browser/assistant/assistant-task-util.js +13 -3
  11. package/esm/browser/assistant/assistant-tasks.js +3 -2
  12. package/esm/browser/assistant/assistant-view.js +81 -56
  13. package/esm/browser/assistant/assistant.d.ts +30 -1
  14. package/esm/browser/assistant/assistant.js +89 -6
  15. package/esm/browser/assistant/task-views.d.ts +40 -6
  16. package/esm/browser/assistant/task-views.js +73 -21
  17. package/esm/browser/avatar/dino-avatar.d.ts +3 -4
  18. package/esm/browser/avatar/dino-avatar.js +4 -178
  19. package/esm/browser/avatar/dino-face.d.ts +19 -0
  20. package/esm/browser/avatar/dino-face.js +142 -0
  21. package/esm/browser/avatar/dino-geometry.d.ts +11 -0
  22. package/esm/browser/avatar/dino-geometry.js +38 -0
  23. package/esm/browser/avatar/dino-kinds.d.ts +15 -0
  24. package/esm/browser/avatar/dino-kinds.js +544 -0
  25. package/esm/browser/avatar/dino-motion.js +1 -1
  26. package/esm/browser/avatar/dino-shape.d.ts +80 -0
  27. package/esm/browser/avatar/dino-shape.js +113 -0
  28. package/esm/browser/avatar/dino-species.d.ts +1 -61
  29. package/esm/browser/avatar/dino-species.js +2 -653
  30. package/esm/browser/chat/chat-packages.d.ts +39 -0
  31. package/esm/browser/chat/chat-packages.js +70 -0
  32. package/esm/browser/chat/chat-protocol.d.ts +23 -1
  33. package/esm/browser/chat/chat-stores.d.ts +59 -0
  34. package/esm/browser/chat/chat-stores.js +121 -0
  35. package/esm/browser/chat/chat-util.d.ts +17 -0
  36. package/esm/browser/chat/chat-util.js +61 -0
  37. package/esm/browser/chat/chat-view.js +33 -12
  38. package/esm/browser/chat/chat.d.ts +31 -39
  39. package/esm/browser/chat/chat.js +226 -175
  40. package/esm/browser/components/access-view.js +1 -1
  41. package/esm/browser/components/account-menu.js +1 -1
  42. package/esm/browser/components/app-nav.d.ts +6 -3
  43. package/esm/browser/components/app-nav.js +19 -10
  44. package/esm/browser/components/app-shell-hooks.d.ts +47 -0
  45. package/esm/browser/components/app-shell-hooks.js +169 -0
  46. package/esm/browser/components/app-view.js +81 -172
  47. package/esm/browser/components/auth-view.js +1 -1
  48. package/esm/browser/components/chat-list.d.ts +20 -2
  49. package/esm/browser/components/chat-list.js +138 -22
  50. package/esm/browser/components/composer-box.d.ts +5 -5
  51. package/esm/browser/components/composer-box.js +111 -4
  52. package/esm/browser/components/composer.d.ts +7 -0
  53. package/esm/browser/components/composer.js +22 -14
  54. package/esm/browser/components/connection-bar.js +50 -17
  55. package/esm/browser/components/context-menu.d.ts +30 -4
  56. package/esm/browser/components/context-menu.js +199 -37
  57. package/esm/browser/components/conversation-scroll.d.ts +129 -6
  58. package/esm/browser/components/conversation-scroll.js +429 -109
  59. package/esm/browser/components/dino.js +1 -1
  60. package/esm/browser/components/earlier-messages.d.ts +2 -1
  61. package/esm/browser/components/earlier-messages.js +2 -17
  62. package/esm/browser/components/editor-area.d.ts +3 -1
  63. package/esm/browser/components/editor-area.js +6 -5
  64. package/esm/browser/components/empty-pictures.d.ts +0 -2
  65. package/esm/browser/components/empty-pictures.js +0 -16
  66. package/esm/browser/components/folder-picker.d.ts +5 -2
  67. package/esm/browser/components/folder-picker.js +30 -9
  68. package/esm/browser/components/held-talk.d.ts +28 -0
  69. package/esm/browser/components/held-talk.js +76 -0
  70. package/esm/browser/components/host-view.d.ts +1 -1
  71. package/esm/browser/components/host-view.js +1 -1
  72. package/esm/browser/components/icon.d.ts +2 -2
  73. package/esm/browser/components/icon.js +5 -6
  74. package/esm/browser/components/image-viewer.d.ts +124 -0
  75. package/esm/browser/components/image-viewer.js +397 -0
  76. package/esm/browser/components/lightbox.d.ts +11 -0
  77. package/esm/browser/components/lightbox.js +24 -0
  78. package/esm/browser/components/markdown.d.ts +6 -2
  79. package/esm/browser/components/markdown.js +24 -10
  80. package/esm/browser/components/media.js +1 -10
  81. package/esm/browser/components/message-footer.d.ts +16 -2
  82. package/esm/browser/components/message-footer.js +29 -12
  83. package/esm/browser/components/message-list.d.ts +24 -3
  84. package/esm/browser/components/message-list.js +149 -20
  85. package/esm/browser/components/message-menu.d.ts +3 -1
  86. package/esm/browser/components/message-menu.js +18 -3
  87. package/esm/browser/components/nav-places.d.ts +16 -1
  88. package/esm/browser/components/nav-places.js +12 -3
  89. package/esm/browser/components/phone-shell.d.ts +4 -1
  90. package/esm/browser/components/phone-shell.js +3 -1
  91. package/esm/browser/components/run-status.js +3 -3
  92. package/esm/browser/components/select-bar.d.ts +9 -0
  93. package/esm/browser/components/select-bar.js +24 -0
  94. package/esm/browser/components/session-settings.d.ts +6 -0
  95. package/esm/browser/components/session-settings.js +14 -1
  96. package/esm/browser/components/session-view.js +8 -4
  97. package/esm/browser/components/settings-choices.d.ts +35 -0
  98. package/esm/browser/components/settings-choices.js +117 -0
  99. package/esm/browser/components/settings-parts.d.ts +21 -0
  100. package/esm/browser/components/settings-parts.js +323 -0
  101. package/esm/browser/components/settings-view.d.ts +0 -6
  102. package/esm/browser/components/settings-view.js +4 -406
  103. package/esm/browser/components/swipe-row.d.ts +2 -2
  104. package/esm/browser/components/swipe-row.js +7 -3
  105. package/esm/browser/components/tool-view.js +14 -12
  106. package/esm/browser/components/voice-button.d.ts +1 -1
  107. package/esm/browser/components/voice-button.js +1 -1
  108. package/esm/browser/components/voice-talk.d.ts +43 -0
  109. package/esm/browser/components/voice-talk.js +222 -0
  110. package/esm/browser/components/workbench-view.js +1 -1
  111. package/esm/browser/device/device.d.ts +3 -0
  112. package/esm/browser/device/device.js +11 -1
  113. package/esm/browser/device/hold.d.ts +42 -0
  114. package/esm/browser/device/hold.js +136 -0
  115. package/esm/browser/device/launch-screen.d.ts +1 -1
  116. package/esm/browser/device/launch-screen.js +1 -1
  117. package/esm/browser/device/long-press.d.ts +2 -0
  118. package/esm/browser/device/long-press.js +16 -1
  119. package/esm/browser/device/pull-down.d.ts +4 -2
  120. package/esm/browser/device/pull-down.js +64 -76
  121. package/esm/browser/device/row-swipe.d.ts +35 -10
  122. package/esm/browser/device/row-swipe.js +149 -71
  123. package/esm/browser/device/shake-undo.d.ts +16 -0
  124. package/esm/browser/device/shake-undo.js +59 -0
  125. package/esm/browser/device/sheet-swipe.d.ts +118 -18
  126. package/esm/browser/device/sheet-swipe.js +406 -107
  127. package/esm/browser/extension/icons.js +2 -1
  128. package/esm/browser/extension/web-extension-api.d.ts +135 -2
  129. package/esm/browser/extension/web-extension-code.d.ts +6 -0
  130. package/esm/browser/extension/web-extension-code.js +24 -0
  131. package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
  132. package/esm/browser/extension/web-extension-protocol.js +8 -0
  133. package/esm/browser/extension/web-extensions.d.ts +14 -1
  134. package/esm/browser/extension/web-extensions.js +128 -24
  135. package/esm/browser/extension/web-tasks.d.ts +9 -1
  136. package/esm/browser/extension/web-tasks.js +24 -0
  137. package/esm/browser/files/files-protocol.d.ts +25 -0
  138. package/esm/browser/files/files-protocol.js +2 -0
  139. package/esm/browser/files/files.d.ts +35 -0
  140. package/esm/browser/files/files.js +119 -0
  141. package/esm/browser/hooks.d.ts +3 -1
  142. package/esm/browser/hooks.js +8 -0
  143. package/esm/browser/i18n/locales.d.ts +29 -2
  144. package/esm/browser/i18n/messages.d.ts +28 -1
  145. package/esm/browser/i18n/messages.js +58 -4
  146. package/esm/browser/index.d.ts +6 -0
  147. package/esm/browser/index.js +6 -0
  148. package/esm/browser/notices/notices-protocol.d.ts +9 -1
  149. package/esm/browser/notices/notices.d.ts +2 -0
  150. package/esm/browser/notices/notices.js +20 -10
  151. package/esm/browser/offline/device-values.d.ts +55 -0
  152. package/esm/browser/offline/device-values.js +142 -0
  153. package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
  154. package/esm/browser/offline/kept-chats-protocol.js +2 -0
  155. package/esm/browser/offline/kept-chats.d.ts +47 -0
  156. package/esm/browser/offline/kept-chats.js +146 -0
  157. package/esm/browser/offline/offline-reads.d.ts +44 -0
  158. package/esm/browser/offline/offline-reads.js +107 -0
  159. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  160. package/esm/browser/settings/settings-protocol.js +2 -0
  161. package/esm/browser/style/conversation.d.ts +1 -1
  162. package/esm/browser/style/conversation.js +57 -17
  163. package/esm/browser/style/device.js +43 -4
  164. package/esm/browser/style/layout.d.ts +1 -1
  165. package/esm/browser/style/layout.js +67 -15
  166. package/esm/browser/style/pages.d.ts +1 -1
  167. package/esm/browser/style/pages.js +2 -1
  168. package/esm/browser/style/shell.d.ts +1 -1
  169. package/esm/browser/style/shell.js +47 -3
  170. package/esm/browser/style/tasks.d.ts +1 -1
  171. package/esm/browser/style/tasks.js +2 -0
  172. package/esm/browser/util/frame.d.ts +5 -4
  173. package/esm/browser/util/frame.js +5 -4
  174. package/esm/browser/util/markdown.d.ts +18 -1
  175. package/esm/browser/util/markdown.js +119 -5
  176. package/esm/browser/util/process.d.ts +21 -0
  177. package/esm/browser/util/process.js +45 -1
  178. package/esm/browser/util/voice.d.ts +5 -2
  179. package/esm/browser/util/voice.js +6 -3
  180. package/esm/browser/util/zoom.d.ts +46 -0
  181. package/esm/browser/util/zoom.js +96 -0
  182. package/esm/browser/workbench-calls.d.ts +59 -0
  183. package/esm/browser/workbench-calls.js +141 -0
  184. package/esm/browser/workbench-protocol.d.ts +5 -1
  185. package/esm/browser/workbench-util.d.ts +68 -0
  186. package/esm/browser/workbench-util.js +145 -0
  187. package/esm/browser/workbench.d.ts +15 -42
  188. package/esm/browser/workbench.js +53 -167
  189. package/lib/browser/assistant/assistant-chat-list.js +8 -2
  190. package/lib/browser/assistant/assistant-extension.d.ts +8 -1
  191. package/lib/browser/assistant/assistant-extension.js +33 -5
  192. package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
  193. package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
  194. package/lib/browser/assistant/assistant-task-source.js +2 -0
  195. package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
  196. package/lib/browser/assistant/assistant-task-util.js +13 -3
  197. package/lib/browser/assistant/assistant-tasks.js +2 -1
  198. package/lib/browser/assistant/assistant-view.js +78 -53
  199. package/lib/browser/assistant/assistant.d.ts +30 -1
  200. package/lib/browser/assistant/assistant.js +89 -6
  201. package/lib/browser/assistant/task-views.d.ts +40 -6
  202. package/lib/browser/assistant/task-views.js +74 -21
  203. package/lib/browser/avatar/dino-avatar.d.ts +3 -4
  204. package/lib/browser/avatar/dino-avatar.js +27 -202
  205. package/lib/browser/avatar/dino-face.d.ts +20 -0
  206. package/lib/browser/avatar/dino-face.js +148 -0
  207. package/lib/browser/avatar/dino-geometry.d.ts +12 -0
  208. package/lib/browser/avatar/dino-geometry.js +47 -0
  209. package/lib/browser/avatar/dino-kinds.d.ts +16 -0
  210. package/lib/browser/avatar/dino-kinds.js +547 -0
  211. package/lib/browser/avatar/dino-motion.js +2 -2
  212. package/lib/browser/avatar/dino-shape.d.ts +81 -0
  213. package/lib/browser/avatar/dino-shape.js +126 -0
  214. package/lib/browser/avatar/dino-species.d.ts +1 -61
  215. package/lib/browser/avatar/dino-species.js +34 -687
  216. package/lib/browser/chat/chat-packages.d.ts +40 -0
  217. package/lib/browser/chat/chat-packages.js +74 -0
  218. package/lib/browser/chat/chat-protocol.d.ts +23 -1
  219. package/lib/browser/chat/chat-stores.d.ts +60 -0
  220. package/lib/browser/chat/chat-stores.js +125 -0
  221. package/lib/browser/chat/chat-util.d.ts +18 -0
  222. package/lib/browser/chat/chat-util.js +64 -0
  223. package/lib/browser/chat/chat-view.js +33 -12
  224. package/lib/browser/chat/chat.d.ts +31 -39
  225. package/lib/browser/chat/chat.js +227 -176
  226. package/lib/browser/components/access-view.js +2 -2
  227. package/lib/browser/components/account-menu.js +2 -2
  228. package/lib/browser/components/app-nav.d.ts +6 -3
  229. package/lib/browser/components/app-nav.js +17 -8
  230. package/lib/browser/components/app-shell-hooks.d.ts +48 -0
  231. package/lib/browser/components/app-shell-hooks.js +211 -0
  232. package/lib/browser/components/app-view.js +89 -180
  233. package/lib/browser/components/auth-view.js +3 -3
  234. package/lib/browser/components/chat-list.d.ts +20 -2
  235. package/lib/browser/components/chat-list.js +137 -21
  236. package/lib/browser/components/composer-box.d.ts +5 -5
  237. package/lib/browser/components/composer-box.js +111 -4
  238. package/lib/browser/components/composer.d.ts +7 -0
  239. package/lib/browser/components/composer.js +22 -14
  240. package/lib/browser/components/connection-bar.js +48 -15
  241. package/lib/browser/components/context-menu.d.ts +30 -4
  242. package/lib/browser/components/context-menu.js +198 -36
  243. package/lib/browser/components/conversation-scroll.d.ts +129 -6
  244. package/lib/browser/components/conversation-scroll.js +431 -110
  245. package/lib/browser/components/dino.js +3 -3
  246. package/lib/browser/components/earlier-messages.d.ts +2 -1
  247. package/lib/browser/components/earlier-messages.js +2 -17
  248. package/lib/browser/components/editor-area.d.ts +3 -1
  249. package/lib/browser/components/editor-area.js +5 -4
  250. package/lib/browser/components/empty-pictures.d.ts +0 -2
  251. package/lib/browser/components/empty-pictures.js +0 -17
  252. package/lib/browser/components/folder-picker.d.ts +5 -2
  253. package/lib/browser/components/folder-picker.js +30 -9
  254. package/lib/browser/components/held-talk.d.ts +29 -0
  255. package/lib/browser/components/held-talk.js +79 -0
  256. package/lib/browser/components/host-view.d.ts +1 -1
  257. package/lib/browser/components/host-view.js +5 -5
  258. package/lib/browser/components/icon.d.ts +2 -2
  259. package/lib/browser/components/icon.js +7 -6
  260. package/lib/browser/components/image-viewer.d.ts +125 -0
  261. package/lib/browser/components/image-viewer.js +435 -0
  262. package/lib/browser/components/lightbox.d.ts +12 -0
  263. package/lib/browser/components/lightbox.js +60 -0
  264. package/lib/browser/components/markdown.d.ts +6 -2
  265. package/lib/browser/components/markdown.js +24 -10
  266. package/lib/browser/components/media.js +2 -11
  267. package/lib/browser/components/message-footer.d.ts +16 -2
  268. package/lib/browser/components/message-footer.js +31 -12
  269. package/lib/browser/components/message-list.d.ts +24 -3
  270. package/lib/browser/components/message-list.js +146 -16
  271. package/lib/browser/components/message-menu.d.ts +3 -1
  272. package/lib/browser/components/message-menu.js +17 -2
  273. package/lib/browser/components/nav-places.d.ts +16 -1
  274. package/lib/browser/components/nav-places.js +13 -3
  275. package/lib/browser/components/phone-shell.d.ts +4 -1
  276. package/lib/browser/components/phone-shell.js +3 -1
  277. package/lib/browser/components/run-status.js +3 -3
  278. package/lib/browser/components/select-bar.d.ts +10 -0
  279. package/lib/browser/components/select-bar.js +61 -0
  280. package/lib/browser/components/session-settings.d.ts +6 -0
  281. package/lib/browser/components/session-settings.js +14 -1
  282. package/lib/browser/components/session-view.js +7 -3
  283. package/lib/browser/components/settings-choices.d.ts +36 -0
  284. package/lib/browser/components/settings-choices.js +156 -0
  285. package/lib/browser/components/settings-parts.d.ts +22 -0
  286. package/lib/browser/components/settings-parts.js +359 -0
  287. package/lib/browser/components/settings-view.d.ts +0 -6
  288. package/lib/browser/components/settings-view.js +2 -405
  289. package/lib/browser/components/swipe-row.d.ts +2 -2
  290. package/lib/browser/components/swipe-row.js +7 -3
  291. package/lib/browser/components/tool-view.js +14 -12
  292. package/lib/browser/components/voice-button.d.ts +1 -1
  293. package/lib/browser/components/voice-button.js +1 -1
  294. package/lib/browser/components/voice-talk.d.ts +44 -0
  295. package/lib/browser/components/voice-talk.js +260 -0
  296. package/lib/browser/components/workbench-view.js +3 -3
  297. package/lib/browser/device/device.d.ts +3 -0
  298. package/lib/browser/device/device.js +11 -1
  299. package/lib/browser/device/hold.d.ts +43 -0
  300. package/lib/browser/device/hold.js +173 -0
  301. package/lib/browser/device/launch-screen.d.ts +1 -1
  302. package/lib/browser/device/launch-screen.js +1 -1
  303. package/lib/browser/device/long-press.d.ts +2 -0
  304. package/lib/browser/device/long-press.js +16 -1
  305. package/lib/browser/device/pull-down.d.ts +4 -2
  306. package/lib/browser/device/pull-down.js +63 -75
  307. package/lib/browser/device/row-swipe.d.ts +35 -10
  308. package/lib/browser/device/row-swipe.js +148 -70
  309. package/lib/browser/device/shake-undo.d.ts +17 -0
  310. package/lib/browser/device/shake-undo.js +63 -0
  311. package/lib/browser/device/sheet-swipe.d.ts +118 -18
  312. package/lib/browser/device/sheet-swipe.js +410 -108
  313. package/lib/browser/extension/icons.js +1 -0
  314. package/lib/browser/extension/web-extension-api.d.ts +135 -2
  315. package/lib/browser/extension/web-extension-code.d.ts +6 -0
  316. package/lib/browser/extension/web-extension-code.js +24 -0
  317. package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
  318. package/lib/browser/extension/web-extension-protocol.js +9 -1
  319. package/lib/browser/extension/web-extensions.d.ts +14 -1
  320. package/lib/browser/extension/web-extensions.js +125 -21
  321. package/lib/browser/extension/web-tasks.d.ts +9 -1
  322. package/lib/browser/extension/web-tasks.js +24 -0
  323. package/lib/browser/files/files-protocol.d.ts +26 -0
  324. package/lib/browser/files/files-protocol.js +5 -0
  325. package/lib/browser/files/files.d.ts +36 -0
  326. package/lib/browser/files/files.js +122 -0
  327. package/lib/browser/hooks.d.ts +3 -1
  328. package/lib/browser/hooks.js +9 -0
  329. package/lib/browser/i18n/locales.d.ts +29 -2
  330. package/lib/browser/i18n/messages.d.ts +28 -1
  331. package/lib/browser/i18n/messages.js +58 -4
  332. package/lib/browser/index.d.ts +6 -0
  333. package/lib/browser/index.js +6 -0
  334. package/lib/browser/notices/notices-protocol.d.ts +9 -1
  335. package/lib/browser/notices/notices.d.ts +2 -0
  336. package/lib/browser/notices/notices.js +20 -10
  337. package/lib/browser/offline/device-values.d.ts +56 -0
  338. package/lib/browser/offline/device-values.js +148 -0
  339. package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
  340. package/lib/browser/offline/kept-chats-protocol.js +5 -0
  341. package/lib/browser/offline/kept-chats.d.ts +48 -0
  342. package/lib/browser/offline/kept-chats.js +149 -0
  343. package/lib/browser/offline/offline-reads.d.ts +45 -0
  344. package/lib/browser/offline/offline-reads.js +111 -0
  345. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  346. package/lib/browser/settings/settings-protocol.js +2 -0
  347. package/lib/browser/style/conversation.d.ts +1 -1
  348. package/lib/browser/style/conversation.js +57 -17
  349. package/lib/browser/style/device.js +43 -4
  350. package/lib/browser/style/layout.d.ts +1 -1
  351. package/lib/browser/style/layout.js +67 -15
  352. package/lib/browser/style/pages.d.ts +1 -1
  353. package/lib/browser/style/pages.js +2 -1
  354. package/lib/browser/style/shell.d.ts +1 -1
  355. package/lib/browser/style/shell.js +47 -3
  356. package/lib/browser/style/tasks.d.ts +1 -1
  357. package/lib/browser/style/tasks.js +2 -0
  358. package/lib/browser/util/frame.d.ts +5 -4
  359. package/lib/browser/util/frame.js +5 -4
  360. package/lib/browser/util/markdown.d.ts +18 -1
  361. package/lib/browser/util/markdown.js +119 -5
  362. package/lib/browser/util/process.d.ts +21 -0
  363. package/lib/browser/util/process.js +46 -2
  364. package/lib/browser/util/voice.d.ts +5 -2
  365. package/lib/browser/util/voice.js +6 -3
  366. package/lib/browser/util/zoom.d.ts +47 -0
  367. package/lib/browser/util/zoom.js +99 -0
  368. package/lib/browser/workbench-calls.d.ts +60 -0
  369. package/lib/browser/workbench-calls.js +145 -0
  370. package/lib/browser/workbench-protocol.d.ts +5 -1
  371. package/lib/browser/workbench-util.d.ts +69 -0
  372. package/lib/browser/workbench-util.js +151 -0
  373. package/lib/browser/workbench.d.ts +15 -42
  374. package/lib/browser/workbench.js +74 -189
  375. package/package.json +10 -10
  376. package/public/launch.svg +46 -42
@@ -1,13 +1,15 @@
1
+ import { useInject } from '@celljs/react';
1
2
  import { ArrowDown } from 'lucide-react';
2
3
  import * as React from 'react';
3
4
  import { useKeyboardDismiss } from '../device/device.js';
5
+ import { TaFiles } from '../files/files-protocol.js';
4
6
  import { useNotices, useOpenLink, useSessionState, useSettingsServer } from '../hooks.js';
5
7
  import { useT } from '../i18n/use-t.js';
6
8
  import { MessageUtil } from '../util/message.js';
7
9
  import { TerminalText } from '../util/terminal-text.js';
8
10
  import { Composer } from './composer.js';
9
11
  import { useComposerAddons } from './composer-addons.js';
10
- import { useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
12
+ import { SCROLL_SKIP, useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
11
13
  import { DialogView } from './dialog-view.js';
12
14
  import { useAsked, useEarlierMessages } from './earlier-messages.js';
13
15
  import { OpenLink } from './link.js';
@@ -94,7 +96,8 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
94
96
  (_a = composer.current) === null || _a === void 0 ? void 0 : _a.setText(draftText);
95
97
  }
96
98
  }, [draftText]);
97
- const fileUrl = React.useCallback((path) => workspace.fileUrl(path, cwd), [workspace, cwd]);
99
+ const files = useInject(TaFiles);
100
+ const fileUrl = React.useCallback(async (path) => files.loadable(await workspace.fileUrl(path, cwd)), [workspace, cwd, files]);
98
101
  const openLink = useOpenLink(cwd);
99
102
  // biome-ignore lint/correctness/useExhaustiveDependencies: runs when a run starts or settles
100
103
  React.useEffect(() => onActivity(), [state.working, onActivity]);
@@ -110,6 +113,7 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
110
113
  const title = (info === null || info === void 0 ? void 0 : info.sessionName) || (info ? MessageUtil.basename(info.cwd) : t('ta.session.title'));
111
114
  const conversation = React.useMemo(() => ({ sessionId: store.sessionId, sessionFile: info === null || info === void 0 ? void 0 : info.sessionFile, cwd: info === null || info === void 0 ? void 0 : info.cwd, kind: 'chat', group: info === null || info === void 0 ? void 0 : info.group, title }), [store.sessionId, info === null || info === void 0 ? void 0 : info.sessionFile, info === null || info === void 0 ? void 0 : info.cwd, info === null || info === void 0 ? void 0 : info.group, title]);
112
115
  const addons = useComposerAddons(conversation);
116
+ const outbox = React.useMemo(() => ({ resend: id => void store.resend(id), discard: id => store.discard(id) }), [store]);
113
117
  return (React.createElement("section", { className: `ta-session ${compact ? 'ta-session-compact' : ''}` },
114
118
  !compact && (React.createElement("header", { className: "ta-session-header" },
115
119
  leading,
@@ -119,14 +123,14 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
119
123
  trailing)),
120
124
  React.createElement("div", { className: "ta-scroll ta-conversation", ref: scroller },
121
125
  React.createElement("div", { className: "ta-thread" },
122
- state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier') },
126
+ state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier'), ...SCROLL_SKIP },
123
127
  React.createElement("span", { className: "ta-spinner" }))),
124
128
  state.messages.length === 0 && (empty !== null && empty !== void 0 ? empty : React.createElement("div", { className: "ta-empty" }, t('ta.session.empty', { cwd: (_a = info === null || info === void 0 ? void 0 : info.cwd) !== null && _a !== void 0 ? _a : '.' }))),
125
129
  React.createElement(ConversationSession.Provider, { value: info },
126
130
  React.createElement(MessageActions.Provider, { value: messageActions },
127
131
  React.createElement(FileUrls.Provider, { value: fileUrl },
128
132
  React.createElement(OpenLink.Provider, { value: openLink },
129
- React.createElement(MessageList, { state: state }))))))),
133
+ React.createElement(MessageList, { state: state, outbox: outbox }))))))),
130
134
  React.createElement("div", { className: "ta-bottom" },
131
135
  away && (React.createElement("button", { type: "button", className: "ta-to-bottom", "aria-label": t('ta.session.toBottom'), title: t('ta.session.toBottom'), onClick: toBottom },
132
136
  React.createElement(ArrowDown, { size: 18 }))),
@@ -0,0 +1,35 @@
1
+ import { type TaPackageInfo } from '@celljs/ta-protocol';
2
+ import { type LucideIcon } from 'lucide-react';
3
+ import type { MessageId } from '../i18n/messages.js';
4
+ import type { useT } from '../i18n/use-t.js';
5
+ import type { FontSize, LanguageSetting, ThemeSetting } from '../settings/settings-protocol.js';
6
+ import type { Navigation } from './nav-places.js';
7
+ import { type Choice, type RowEntry } from './settings-controls.js';
8
+ export declare const THEMES: Choice<ThemeSetting>[];
9
+ export declare const FONT_SIZES: Choice<FontSize>[];
10
+ export declare const LANGUAGES: Choice<LanguageSetting>[];
11
+ export declare const GROUP_ICONS: Record<string, LucideIcon>;
12
+ /** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
13
+ export declare const SHORTCUTS: {
14
+ keys: string;
15
+ label: MessageId;
16
+ }[];
17
+ /**
18
+ * The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
19
+ * stay; the others turn off and on, and go.
20
+ */
21
+ export declare function usePackages(): {
22
+ packages: TaPackageInfo[];
23
+ toggle: (pkg: TaPackageInfo, on: boolean) => Promise<void>;
24
+ remove: (pkg: TaPackageInfo) => Promise<void>;
25
+ read: () => Promise<void>;
26
+ };
27
+ export declare const SLOTS: Choice<string>[];
28
+ /** The rows of the navigation: how many pages it shows, and where each page is. */
29
+ export declare function navigationRows(navigation: Navigation, t: ReturnType<typeof useT>): RowEntry[];
30
+ /** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
31
+ export declare function packageLabel(pkg: TaPackageInfo, language: string): {
32
+ title: string;
33
+ summary: string | undefined;
34
+ icon: import("../index.js").WebIcon;
35
+ };
@@ -0,0 +1,117 @@
1
+ import { TaPackageTextUtil } from '@celljs/ta-protocol';
2
+ import { Globe, Layers, MessagesSquare, Monitor, Moon, Puzzle, RefreshCw, Sparkles, Sun, Wrench } from 'lucide-react';
3
+ import * as React from 'react';
4
+ import { WEB_ICONS } from '../extension/icons.js';
5
+ import { WebLabelUtil } from '../extension/web-extension-protocol.js';
6
+ import { useWebExtensions, useWorkbench } from '../hooks.js';
7
+ import { NavigationUtil } from '../settings/navigation.js';
8
+ import { Icon } from './icon.js';
9
+ import { EmptyRow, Row, row, Segmented, Switch } from './settings-controls.js';
10
+ export const THEMES = [
11
+ { value: 'system', icon: Monitor, label: 'ta.settings.theme.system' },
12
+ { value: 'light', icon: Sun, label: 'ta.settings.theme.light' },
13
+ { value: 'dark', icon: Moon, label: 'ta.settings.theme.dark' },
14
+ ];
15
+ export const FONT_SIZES = [
16
+ { value: 'small', label: 'ta.settings.fontSize.small' },
17
+ { value: 'standard', label: 'ta.settings.fontSize.standard' },
18
+ { value: 'large', label: 'ta.settings.fontSize.large' },
19
+ { value: 'xlarge', label: 'ta.settings.fontSize.xlarge' },
20
+ ];
21
+ export const LANGUAGES = [
22
+ { value: 'system', icon: Globe, label: 'ta.settings.language.system' },
23
+ { value: 'zh-CN', label: '简体中文' },
24
+ { value: 'en-US', label: 'English' },
25
+ ];
26
+ export const GROUP_ICONS = { model: Sparkles, conversation: MessagesSquare, context: Layers, tools: Wrench };
27
+ /** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
28
+ export const SHORTCUTS = [
29
+ { keys: 'Mod+,', label: 'ta.shortcut.settings' },
30
+ { keys: 'Mod+B', label: 'ta.shortcut.sidebar' },
31
+ { keys: 'Enter', label: 'ta.shortcut.send' },
32
+ { keys: 'Shift+Enter', label: 'ta.shortcut.newline' },
33
+ { keys: 'Alt+Enter', label: 'ta.shortcut.followUp' },
34
+ { keys: 'Esc', label: 'ta.shortcut.stop' },
35
+ { keys: '/', label: 'ta.shortcut.commands' },
36
+ { keys: '@', label: 'ta.shortcut.files' },
37
+ { keys: 'Mod+S', label: 'ta.shortcut.save' },
38
+ ];
39
+ /**
40
+ * The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
41
+ * stay; the others turn off and on, and go.
42
+ */
43
+ export function usePackages() {
44
+ const [workbench, bench] = useWorkbench();
45
+ const [, host] = useWebExtensions();
46
+ const [packages, setPackages] = React.useState([]);
47
+ const read = React.useCallback(() => bench.packages.listPackages().then(setPackages), [bench]);
48
+ React.useEffect(() => {
49
+ if (workbench.status === 'online') {
50
+ read().catch(() => undefined);
51
+ }
52
+ }, [workbench.status, read]);
53
+ const changed = async () => {
54
+ await host.reloadPackages();
55
+ await read();
56
+ };
57
+ /** By the name of a built-in package, by the id of another. */
58
+ const toggle = async (pkg, on) => {
59
+ setPackages(current => current.map(other => (other.id === pkg.id ? { ...other, enabled: on } : other)));
60
+ await bench.packages.setPackageEnabled(pkg.origin === 'builtin' ? pkg.name : pkg.id, on);
61
+ await changed();
62
+ };
63
+ const remove = async (pkg) => {
64
+ await bench.packages.removePackage(pkg.id);
65
+ await changed();
66
+ };
67
+ return { packages, toggle, remove, read };
68
+ }
69
+ export const SLOTS = Array.from({ length: NavigationUtil.MAX_SLOTS - NavigationUtil.MIN_SLOTS + 1 }, (_, index) => {
70
+ const value = String(NavigationUtil.MIN_SLOTS + index);
71
+ return { value, label: value };
72
+ });
73
+ /** The rows of the navigation: how many pages it shows, and where each page is. */
74
+ export function navigationRows(navigation, t) {
75
+ const { setting } = navigation;
76
+ const where = (id, byDefault) => {
77
+ if (setting.pinned.includes(id) && navigation.nav.some(page => page.id === id)) {
78
+ return t('ta.settings.navigation.pinned');
79
+ }
80
+ if (navigation.nav.some(page => page.id === id)) {
81
+ return t('ta.settings.navigation.inNav');
82
+ }
83
+ return t(setting.discover.includes(id) || byDefault ? 'ta.settings.navigation.folded' : 'ta.settings.navigation.overflow');
84
+ };
85
+ return [
86
+ row('navigation-slots', [t('ta.settings.navigation.slots'), t('ta.settings.navigation.slotsHint'), t('ta.discover')], React.createElement(Row, { label: t('ta.settings.navigation.slots'), description: t('ta.settings.navigation.slotsHint'), stacked: true },
87
+ React.createElement(Segmented, { label: t('ta.settings.navigation.slots'), value: String(setting.slots), choices: SLOTS, onChange: slots => navigation.update({ ...setting, slots: Number(slots) }) }))),
88
+ ...navigation.pages.map(page => {
89
+ const title = WebLabelUtil.text(page.title);
90
+ const shown = navigation.nav.includes(page);
91
+ return row(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(Row, { label: title, description: where(page.id, page.discover) },
92
+ React.createElement(Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: shown, onChange: on => (on ? navigation.pin(page.id) : navigation.fold(page.id)) })));
93
+ }),
94
+ ...(navigation.pages.length === 0
95
+ ? [row('navigation:none', [t('ta.settings.navigation.none')], React.createElement(EmptyRow, { title: t('ta.settings.navigation.none') }))]
96
+ : []),
97
+ ...(NavigationUtil.moved(setting)
98
+ ? [
99
+ row('navigation-reset', [t('ta.settings.navigation.reset')], React.createElement(Row, { label: t('ta.settings.navigation.reset'), description: t('ta.settings.navigation.resetHint') },
100
+ React.createElement("button", { type: "button", className: "ta-button", onClick: () => navigation.update(NavigationUtil.reset(setting)) },
101
+ React.createElement(Icon, { icon: RefreshCw, size: 14 }),
102
+ " ",
103
+ t('ta.settings.navigation.resetButton')))),
104
+ ]
105
+ : []),
106
+ ];
107
+ }
108
+ /** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
109
+ export function packageLabel(pkg, language) {
110
+ var _a, _b;
111
+ return {
112
+ title: (_a = TaPackageTextUtil.pick(pkg.title, language)) !== null && _a !== void 0 ? _a : pkg.name,
113
+ summary: (_b = TaPackageTextUtil.pick(pkg.summary, language)) !== null && _b !== void 0 ? _b : pkg.description,
114
+ icon: (pkg.icon && WEB_ICONS[pkg.icon]) || Puzzle,
115
+ };
116
+ }
117
+ //# sourceMappingURL=settings-choices.js.map
@@ -0,0 +1,21 @@
1
+ import type { TaSettingsScope } from '@celljs/ta-protocol';
2
+ import * as React from 'react';
3
+ import { type Glyph } from './icon.js';
4
+ import { type RowEntry } from './settings-controls.js';
5
+ export interface SectionEntry {
6
+ id: string;
7
+ title: string;
8
+ icon: Glyph;
9
+ rows: RowEntry[];
10
+ }
11
+ export interface Part {
12
+ id: string;
13
+ title: string;
14
+ sections: SectionEntry[];
15
+ /** Drawn above its sections, whatever the search, and on a phone above each: the scope of the settings of ta. */
16
+ lead?: React.ReactNode;
17
+ }
18
+ /** What a row of the settings opens over them. */
19
+ export type SettingsDialog = 'accounts' | 'directory' | 'relay';
20
+ /** The sections of the page and of ta, by part, with their rows. */
21
+ export declare function useParts(scope: TaSettingsScope, onScope: (scope: TaSettingsScope) => void, onClose: () => void, onDialog: (dialog: SettingsDialog) => void): Part[];
@@ -0,0 +1,323 @@
1
+ import { Blocks, Bot, Cloud, Compass, FolderOpen, Info, Keyboard, KeyRound, Languages, Link2, LogOut, Palette, Puzzle, RefreshCw, Server, ShieldCheck, Smartphone, Trash2, Volume2, Wrench, } from 'lucide-react';
2
+ import * as React from 'react';
3
+ import { useDevice } from '../device/device.js';
4
+ import { ExtensionBoundary } from '../extension/extension-view.js';
5
+ import { WebLabelUtil } from '../extension/web-extension-protocol.js';
6
+ import { useNotices, useSettings, useSettingsServer, useWebExtensions, useWorkbench } from '../hooks.js';
7
+ import { useLanguage, useT } from '../i18n/use-t.js';
8
+ import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil } from '../settings/agent-settings.js';
9
+ import { MAX_TASKS_CHOICES } from '../settings/settings-protocol.js';
10
+ import { WorkbenchUtil } from '../workbench-util.js';
11
+ import { AccessSettings, useAccess } from './access-view.js';
12
+ import { AgentControl, ScopeBar, useAgentSettings } from './agent-settings-view.js';
13
+ import { useNavigation } from './app-nav.js';
14
+ import { EnvironmentSettings, useGateway } from './environment-view.js';
15
+ import { Icon, IconButton } from './icon.js';
16
+ import { useLaunchRows } from './launch-settings.js';
17
+ import { SettingsModelPicker } from './model-picker.js';
18
+ import { RemoteHosts } from './remote-hosts.js';
19
+ import { EmptyRow, Keys, Row, row, Segmented, Switch } from './settings-controls.js';
20
+ import { TrustedDomains } from './trusted-domains.js';
21
+ import { FONT_SIZES, GROUP_ICONS, LANGUAGES, navigationRows, packageLabel, SHORTCUTS, THEMES, usePackages } from './settings-choices.js';
22
+ /** The sections of the page and of ta, by part, with their rows. */
23
+ export function useParts(scope, onScope, onClose, onDialog) {
24
+ var _a;
25
+ const t = useT();
26
+ const language = useLanguage();
27
+ const [{ settings }, store] = useSettings();
28
+ const settingsServer = useSettingsServer();
29
+ const [workbench, bench] = useWorkbench();
30
+ const [{ extensions, cwd, views, settingsSections }, host] = useWebExtensions();
31
+ const navigation = useNavigation(views);
32
+ const packageList = usePackages();
33
+ const builtinPackages = packageList.packages.filter(pkg => pkg.origin === 'builtin');
34
+ const agent = useAgentSettings(cwd !== null && cwd !== void 0 ? cwd : (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd);
35
+ const [, notices] = useNotices();
36
+ const access = useAccess();
37
+ const gateway = useGateway();
38
+ // As the menu of the account (useAccountEntries): a finger has no keys to learn; a phone is not the computer
39
+ // that pairs phones, and signs out at the foot of Me.
40
+ const touch = useDevice(device => device.touch);
41
+ const handheld = useDevice(device => device.handheld);
42
+ const [busy, setBusy] = React.useState(false);
43
+ const run = (action, done) => {
44
+ setBusy(true);
45
+ action()
46
+ .then(() => done && notices.notify(done, { level: 'success' }))
47
+ .catch(error => notices.error(error))
48
+ .finally(() => setBusy(false));
49
+ };
50
+ const remove = async (pkg) => {
51
+ const confirmed = await notices.confirm({
52
+ title: t('ta.packages.removeConfirm', { name: pkg.name }),
53
+ message: t('ta.packages.removeDetail'),
54
+ confirmLabel: t('ta.packages.remove'),
55
+ danger: true,
56
+ });
57
+ if (confirmed) {
58
+ run(() => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
59
+ }
60
+ };
61
+ const toggleBuiltin = (name, on) => {
62
+ store.update({ builtinsOff: on ? settings.builtinsOff.filter(other => other !== name) : [...settings.builtinsOff, name] });
63
+ run(() => host.refresh());
64
+ };
65
+ const web = [
66
+ {
67
+ id: 'appearance',
68
+ title: t('ta.settings.appearance'),
69
+ icon: Palette,
70
+ rows: [
71
+ row('theme', [t('ta.settings.theme'), 'theme'], React.createElement(Row, { label: t('ta.settings.theme'), stacked: true },
72
+ React.createElement(Segmented, { label: t('ta.settings.theme'), value: settings.theme, choices: THEMES, onChange: theme => store.update({ theme }) }))),
73
+ row('font-size', [t('ta.settings.fontSize'), t('ta.settings.fontSizeHint'), 'font'], React.createElement(Row, { label: t('ta.settings.fontSize'), description: t('ta.settings.fontSizeHint'), stacked: true },
74
+ React.createElement(Segmented, { label: t('ta.settings.fontSize'), value: settings.fontSize, choices: FONT_SIZES, onChange: fontSize => store.update({ fontSize }) }))),
75
+ row('chat-font-size', [t('ta.settings.chatFontSize'), t('ta.settings.chatFontSizeHint'), 'font'], React.createElement(Row, { label: t('ta.settings.chatFontSize'), description: t('ta.settings.chatFontSizeHint'), stacked: true },
76
+ React.createElement(Segmented, { label: t('ta.settings.chatFontSize'), value: settings.chatFontSize, choices: FONT_SIZES, onChange: chatFontSize => store.update({ chatFontSize }) }))),
77
+ row('motion', [t('ta.settings.motion'), t('ta.settings.motionHint')], React.createElement(Row, { label: t('ta.settings.motion'), description: t('ta.settings.motionHint') },
78
+ React.createElement(Switch, { label: t('ta.settings.motion'), checked: settings.reduceMotion, onChange: reduceMotion => store.update({ reduceMotion }) }))),
79
+ ],
80
+ },
81
+ {
82
+ id: 'language',
83
+ title: t('ta.settings.language'),
84
+ icon: Languages,
85
+ rows: [
86
+ row('language', [t('ta.settings.displayLanguage'), 'language'], React.createElement(Row, { label: t('ta.settings.displayLanguage'), stacked: true },
87
+ React.createElement(Segmented, { label: t('ta.settings.displayLanguage'), value: settings.language, choices: LANGUAGES, onChange: language => store.update({ language }) }))),
88
+ ],
89
+ },
90
+ {
91
+ id: 'navigation',
92
+ title: t('ta.settings.navigation'),
93
+ icon: Compass,
94
+ rows: navigationRows(navigation, t),
95
+ },
96
+ {
97
+ id: 'links',
98
+ title: t('ta.settings.links'),
99
+ icon: Link2,
100
+ rows: [
101
+ row('trusted-domains', [t('ta.settings.trustedDomains'), t('ta.settings.trustedDomainsHint'), ...settings.trustedDomains], React.createElement(TrustedDomains, null)),
102
+ ],
103
+ },
104
+ {
105
+ id: 'assistant',
106
+ title: t('ta.settings.assistant'),
107
+ icon: Bot,
108
+ rows: [
109
+ row('assistant-model', [t('ta.settings.assistantModel'), t('ta.settings.assistantModelHint')], React.createElement(Row, { label: t('ta.settings.assistantModel'), description: t('ta.settings.assistantModelHint'), stacked: true },
110
+ React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.assistantModel'), value: settings.assistantModel, onChange: assistantModel => store.update({ assistantModel }) }))),
111
+ row('task-model', [t('ta.settings.taskModel'), t('ta.settings.taskModelHint')], React.createElement(Row, { label: t('ta.settings.taskModel'), description: t('ta.settings.taskModelHint'), stacked: true },
112
+ React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.taskModel'), value: settings.taskModel, onChange: taskModel => store.update({ taskModel }) }))),
113
+ row('confirm-tasks', [t('ta.settings.confirmTasks'), t('ta.settings.confirmTasksHint')], React.createElement(Row, { label: t('ta.settings.confirmTasks'), description: t('ta.settings.confirmTasksHint') },
114
+ React.createElement(Switch, { label: t('ta.settings.confirmTasks'), checked: settings.confirmTasks, onChange: confirmTasks => store.update({ confirmTasks }) }))),
115
+ row('max-tasks', [t('ta.settings.maxTasks'), t('ta.settings.maxTasksHint')], React.createElement(Row, { label: t('ta.settings.maxTasks'), description: t('ta.settings.maxTasksHint'), stacked: true },
116
+ React.createElement(Segmented, { label: t('ta.settings.maxTasks'), value: String(settings.maxTasks), choices: MAX_TASKS_CHOICES.map(count => ({
117
+ value: String(count),
118
+ label: count === 0 ? t('ta.settings.maxTasksAny') : String(count),
119
+ })), onChange: value => store.update({ maxTasks: Number(value) }) }))),
120
+ ],
121
+ },
122
+ {
123
+ id: 'voice',
124
+ title: t('ta.settings.voice'),
125
+ icon: Volume2,
126
+ rows: [
127
+ row('speak', [t('ta.settings.speak'), t('ta.settings.speakHint')], React.createElement(Row, { label: t('ta.settings.speak'), description: t('ta.settings.speakHint') },
128
+ React.createElement(Switch, { label: t('ta.settings.speak'), checked: settings.speak, onChange: speak => store.update({ speak }) }))),
129
+ row('speakTalk', [t('ta.settings.speakTalk'), t('ta.settings.speakTalkHint')], React.createElement(Row, { label: t('ta.settings.speakTalk'), description: t('ta.settings.speakTalkHint') },
130
+ React.createElement(Switch, { label: t('ta.settings.speakTalk'), checked: settings.speakTalk, onChange: speakTalk => store.update({ speakTalk }) }))),
131
+ ],
132
+ },
133
+ ];
134
+ const { snapshot } = agent;
135
+ const locked = !!snapshot && scope === 'project' && !snapshot.projectTrusted;
136
+ const lead = (React.createElement(React.Fragment, null,
137
+ React.createElement(ScopeBar, { scope: scope, onScope: onScope, snapshot: snapshot }),
138
+ agent.offline && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.offline')),
139
+ !agent.offline && !snapshot && !agent.error && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.loading')),
140
+ locked && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.untrusted')),
141
+ agent.error && React.createElement("div", { className: "ta-banner ta-banner-error" }, t('ta.settings.failed', { error: agent.error }))));
142
+ const ta = AGENT_SETTINGS_GROUPS.map(group => { var _a; return ({
143
+ id: group.id,
144
+ title: t(group.title),
145
+ icon: (_a = GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : Wrench,
146
+ rows: snapshot
147
+ ? group.keys.flatMap(key => {
148
+ const spec = AgentSettingsUtil.spec(key);
149
+ if (!spec) {
150
+ return [];
151
+ }
152
+ const label = t(AgentSettingsUtil.label(key));
153
+ const hint = AgentSettingsUtil.hint(key);
154
+ return [
155
+ row(key, [label, hint && t(hint), key], React.createElement(Row, { label: label, description: hint && t(hint), modified: snapshot[scope][key] !== undefined },
156
+ React.createElement(AgentControl, { spec: spec, scope: scope, snapshot: snapshot, disabled: locked, onChange: changes => agent.update(scope, changes) }))),
157
+ ];
158
+ })
159
+ : [],
160
+ }); });
161
+ // Those opened without installing are in Quick open, which installs or deletes them (ta-launcher.md).
162
+ const packages = packageList.packages.filter(pkg => pkg.origin !== 'builtin' && pkg.origin !== 'temporary');
163
+ const launchRows = useLaunchRows();
164
+ /** Why the web extension of a package did not load, if it did not. */
165
+ const failure = (pkg) => { var _a; return (_a = extensions.find(extension => { var _a; return ((_a = extension.info) === null || _a === void 0 ? void 0 : _a.source) === pkg.source && extension.error; })) === null || _a === void 0 ? void 0 : _a.error; };
166
+ const reload = async () => {
167
+ await host.refresh();
168
+ await packageList.read();
169
+ };
170
+ const more = [
171
+ {
172
+ id: 'packages',
173
+ title: t('ta.packages'),
174
+ icon: Puzzle,
175
+ rows: [
176
+ row('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
177
+ React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => run(reload, t('ta.packages.reloaded')) },
178
+ React.createElement(Icon, { icon: RefreshCw, size: 14 }),
179
+ " ",
180
+ t('ta.packages.reload')))),
181
+ ...packages.map(pkg => {
182
+ const error = failure(pkg);
183
+ const { title, summary, icon } = packageLabel(pkg, language);
184
+ return row(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(Row, { icon: icon, label: title, description: error
185
+ ? t('ta.packages.failed', { error })
186
+ : [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
187
+ React.createElement(IconButton, { icon: Trash2, label: t('ta.packages.remove'), disabled: busy, onClick: () => void remove(pkg) }),
188
+ React.createElement(Switch, { label: title, checked: pkg.enabled, disabled: busy, onChange: on => run(() => packageList.toggle(pkg, on)) })));
189
+ }),
190
+ ...(packages.length === 0
191
+ ? [row('packages:none', [t('ta.packages.none')], React.createElement(EmptyRow, { title: t('ta.packages.none'), hint: t('ta.packages.noneHint') }))]
192
+ : []),
193
+ ...launchRows,
194
+ ],
195
+ },
196
+ {
197
+ id: 'builtin',
198
+ title: t('ta.packages.builtinTitle'),
199
+ icon: Blocks,
200
+ rows: [
201
+ ...host.builtins.map(builtin => { var _a; return row(`web:${builtin.name}`, [t(builtin.title), t(builtin.description), t('ta.packages.builtinTitle')], React.createElement(Row, { icon: (_a = builtin.icon) !== null && _a !== void 0 ? _a : Puzzle, label: t(builtin.title), description: t(builtin.description) },
202
+ React.createElement(Switch, { label: t(builtin.title), checked: !settings.builtinsOff.includes(builtin.name), onChange: on => toggleBuiltin(builtin.name, on) }))); }),
203
+ ...builtinPackages.map(info => {
204
+ const { title, summary, icon } = packageLabel(info, language);
205
+ return row(`builtin:${info.name}`, [title, summary, info.name, t('ta.packages.builtinTitle')], React.createElement(Row, { icon: icon, label: title, description: summary },
206
+ React.createElement(Switch, { label: title, checked: info.enabled, onChange: on => run(() => packageList.toggle(info, on)) })));
207
+ }),
208
+ ],
209
+ },
210
+ ...settingsSections.map(extensionSection),
211
+ // Behind a gateway only: where the Ta of this account runs.
212
+ ...(gateway.info
213
+ ? [
214
+ {
215
+ id: 'environment',
216
+ title: t('ta.environment.title'),
217
+ icon: Cloud,
218
+ rows: [
219
+ row('environment', [t('ta.environment.title'), t('ta.environment.whereHint'), 'sandbox', 'docker'], React.createElement(EnvironmentSettings, { info: gateway.info, onChange: gateway.read })),
220
+ ],
221
+ },
222
+ ]
223
+ : []),
224
+ // Only where accounts can sign in, or could: a Ta of this computer has no need of it.
225
+ ...(access.info && (access.info.providers.length > 0 || access.info.accounts.length > 0)
226
+ ? [
227
+ {
228
+ id: 'access',
229
+ title: t('ta.access.title'),
230
+ icon: ShieldCheck,
231
+ rows: [
232
+ row('access', [t('ta.access.title'), t('ta.access.addHint'), 'github', 'google', 'wechat'], React.createElement(AccessSettings, { info: access.info, onChange: access.read })),
233
+ ],
234
+ },
235
+ ]
236
+ : []),
237
+ {
238
+ id: 'remote',
239
+ title: t('ta.remote.title'),
240
+ icon: Server,
241
+ rows: [row('remote', [t('ta.remote.title'), t('ta.remote.description'), 'ssh'], React.createElement(RemoteHosts, null))],
242
+ },
243
+ ...(touch
244
+ ? []
245
+ : [
246
+ {
247
+ id: 'shortcuts',
248
+ title: t('ta.settings.shortcuts'),
249
+ icon: Keyboard,
250
+ rows: SHORTCUTS.map(shortcut => row(`key:${shortcut.keys}`, [t(shortcut.label), shortcut.keys, t('ta.settings.shortcuts')], React.createElement(Row, { label: t(shortcut.label) },
251
+ React.createElement(Keys, { keys: shortcut.keys })))),
252
+ },
253
+ ]),
254
+ {
255
+ id: 'about',
256
+ title: t('ta.settings.about'),
257
+ icon: Info,
258
+ rows: workbench.server
259
+ ? [
260
+ row('version', [t('ta.settings.version'), 'version'], React.createElement(Row, { label: t('ta.settings.version') },
261
+ React.createElement("span", { className: "ta-path" },
262
+ "v",
263
+ workbench.server.version))),
264
+ row('cwd', [t('ta.settings.cwd'), workbench.server.cwd], React.createElement(Row, { label: t('ta.settings.cwd'), description: t('ta.settings.cwdDescription', { path: workbench.server.cwd }) },
265
+ React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('directory') },
266
+ React.createElement(Icon, { icon: FolderOpen, size: 15 }),
267
+ " ",
268
+ t('ta.settings.cwdChange')))),
269
+ row('accounts', [t('ta.settings.accounts'), t('ta.settings.accountsDescription')], React.createElement(Row, { label: t('ta.settings.accounts'), description: t('ta.settings.accountsDescription') },
270
+ React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('accounts') },
271
+ React.createElement(Icon, { icon: KeyRound, size: 15 }),
272
+ " ",
273
+ t('ta.settings.manageAccounts')))),
274
+ ...(WorkbenchUtil.isApp() || handheld
275
+ ? []
276
+ : [
277
+ row('relay', [t('ta.settings.relay'), t('ta.settings.relayDescription')], React.createElement(Row, { label: t('ta.settings.relay'), description: t('ta.settings.relayDescription') },
278
+ React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('relay') },
279
+ React.createElement(Icon, { icon: Smartphone, size: 15 }),
280
+ " ",
281
+ t('ta.settings.manageAccounts')))),
282
+ ]),
283
+ ...(handheld
284
+ ? []
285
+ : [
286
+ row('signOut', [t('ta.settings.signOut')], React.createElement(Row, { label: t('ta.settings.signOut') },
287
+ React.createElement("button", { type: "button", className: "ta-button ta-danger", onClick: () => {
288
+ onClose();
289
+ bench.signOut();
290
+ } },
291
+ React.createElement(Icon, { icon: LogOut, size: 15 }),
292
+ " ",
293
+ t('ta.settings.signOut')))),
294
+ ]),
295
+ ]
296
+ : [],
297
+ },
298
+ ];
299
+ return [
300
+ { id: 'web', title: t('ta.settings.web'), sections: web },
301
+ { id: 'agent', title: t('ta.settings.agent'), sections: ta, lead },
302
+ { id: 'more', title: t('ta.settings.more'), sections: more },
303
+ ];
304
+ }
305
+ /** A section an extension added (WebExtensionAPI.registerSettings): its rows as Ta's, each control in a boundary of its own. */
306
+ function extensionSection({ id, section }) {
307
+ var _a;
308
+ const title = WebLabelUtil.text(section.title);
309
+ return {
310
+ id: `extension-${id.replace(/[^\w-]+/g, '-')}`,
311
+ title,
312
+ icon: (_a = section.icon) !== null && _a !== void 0 ? _a : Puzzle,
313
+ rows: section.rows.map(item => {
314
+ const label = WebLabelUtil.text(item.label);
315
+ const description = item.description === undefined ? undefined : WebLabelUtil.text(item.description);
316
+ const Control = item.render;
317
+ return row(`${id}/${item.key}`, [label, description, title], React.createElement(Row, { label: label, description: description, stacked: item.stacked },
318
+ React.createElement(ExtensionBoundary, { name: title, resetKey: Control },
319
+ React.createElement(Control, null))));
320
+ }),
321
+ };
322
+ }
323
+ //# sourceMappingURL=settings-parts.js.map
@@ -1,12 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { MessageId } from '../i18n/messages.js';
3
2
  /** A section of the settings view: `appearance`, `model`, `packages`, ... */
4
3
  export type SettingsSection = string;
5
- /** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
6
- export declare const SHORTCUTS: {
7
- keys: string;
8
- label: MessageId;
9
- }[];
10
4
  export interface SettingsViewProps {
11
5
  /** The section to show first. */
12
6
  section?: SettingsSection;