@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
@@ -33,423 +33,20 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SHORTCUTS = void 0;
37
36
  exports.SettingsView = SettingsView;
38
- const ta_protocol_1 = require("@celljs/ta-protocol");
39
37
  const lucide_react_1 = require("lucide-react");
40
38
  const React = __importStar(require("react"));
41
39
  const device_1 = require("../device/device");
42
- const icons_1 = require("../extension/icons");
43
- const web_extension_protocol_1 = require("../extension/web-extension-protocol");
44
- const hooks_1 = require("../hooks");
45
40
  const use_t_1 = require("../i18n/use-t");
46
- const agent_settings_1 = require("../settings/agent-settings");
47
- const navigation_1 = require("../settings/navigation");
48
- const settings_protocol_1 = require("../settings/settings-protocol");
49
- const workbench_1 = require("../workbench");
50
- const access_view_1 = require("./access-view");
51
- const agent_settings_view_1 = require("./agent-settings-view");
52
- const app_nav_1 = require("./app-nav");
53
41
  const auth_view_1 = require("./auth-view");
54
42
  const empty_state_1 = require("./empty-state");
55
- const environment_view_1 = require("./environment-view");
56
43
  const icon_1 = require("./icon");
57
- const launch_settings_1 = require("./launch-settings");
58
44
  const list_rows_1 = require("./list-rows");
59
- const model_picker_1 = require("./model-picker");
60
45
  const phone_shell_1 = require("./phone-shell");
61
46
  const relay_view_1 = require("./relay-view");
62
- const remote_hosts_1 = require("./remote-hosts");
63
47
  const settings_controls_1 = require("./settings-controls");
64
- const trusted_domains_1 = require("./trusted-domains");
48
+ const settings_parts_1 = require("./settings-parts");
65
49
  const working_directory_1 = require("./working-directory");
66
- const THEMES = [
67
- { value: 'system', icon: lucide_react_1.Monitor, label: 'ta.settings.theme.system' },
68
- { value: 'light', icon: lucide_react_1.Sun, label: 'ta.settings.theme.light' },
69
- { value: 'dark', icon: lucide_react_1.Moon, label: 'ta.settings.theme.dark' },
70
- ];
71
- const FONT_SIZES = [
72
- { value: 'small', label: 'ta.settings.fontSize.small' },
73
- { value: 'standard', label: 'ta.settings.fontSize.standard' },
74
- { value: 'large', label: 'ta.settings.fontSize.large' },
75
- { value: 'xlarge', label: 'ta.settings.fontSize.xlarge' },
76
- ];
77
- const LANGUAGES = [
78
- { value: 'system', icon: lucide_react_1.Globe, label: 'ta.settings.language.system' },
79
- { value: 'zh-CN', label: '简体中文' },
80
- { value: 'en-US', label: 'English' },
81
- ];
82
- const GROUP_ICONS = { model: lucide_react_1.Sparkles, conversation: lucide_react_1.MessagesSquare, context: lucide_react_1.Layers, tools: lucide_react_1.Wrench };
83
- /** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
84
- exports.SHORTCUTS = [
85
- { keys: 'Mod+,', label: 'ta.shortcut.settings' },
86
- { keys: 'Mod+B', label: 'ta.shortcut.sidebar' },
87
- { keys: 'Enter', label: 'ta.shortcut.send' },
88
- { keys: 'Shift+Enter', label: 'ta.shortcut.newline' },
89
- { keys: 'Alt+Enter', label: 'ta.shortcut.followUp' },
90
- { keys: 'Esc', label: 'ta.shortcut.stop' },
91
- { keys: '/', label: 'ta.shortcut.commands' },
92
- { keys: '@', label: 'ta.shortcut.files' },
93
- { keys: 'Mod+S', label: 'ta.shortcut.save' },
94
- ];
95
- /**
96
- * The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
97
- * stay; the others turn off and on, and go.
98
- */
99
- function usePackages() {
100
- const [workbench, bench] = (0, hooks_1.useWorkbench)();
101
- const [, host] = (0, hooks_1.useWebExtensions)();
102
- const [packages, setPackages] = React.useState([]);
103
- const read = React.useCallback(() => bench.packages.listPackages().then(setPackages), [bench]);
104
- React.useEffect(() => {
105
- if (workbench.status === 'online') {
106
- read().catch(() => undefined);
107
- }
108
- }, [workbench.status, read]);
109
- const changed = async () => {
110
- await host.reloadPackages();
111
- await read();
112
- };
113
- /** By the name of a built-in package, by the id of another. */
114
- const toggle = async (pkg, on) => {
115
- setPackages(current => current.map(other => (other.id === pkg.id ? { ...other, enabled: on } : other)));
116
- await bench.packages.setPackageEnabled(pkg.origin === 'builtin' ? pkg.name : pkg.id, on);
117
- await changed();
118
- };
119
- const remove = async (pkg) => {
120
- await bench.packages.removePackage(pkg.id);
121
- await changed();
122
- };
123
- return { packages, toggle, remove, read };
124
- }
125
- const SLOTS = Array.from({ length: navigation_1.NavigationUtil.MAX_SLOTS - navigation_1.NavigationUtil.MIN_SLOTS + 1 }, (_, index) => {
126
- const value = String(navigation_1.NavigationUtil.MIN_SLOTS + index);
127
- return { value, label: value };
128
- });
129
- /** The rows of the navigation: how many pages it shows, and where each page is. */
130
- function navigationRows(navigation, t) {
131
- const { setting } = navigation;
132
- const where = (id, byDefault) => {
133
- if (setting.pinned.includes(id) && navigation.nav.some(page => page.id === id)) {
134
- return t('ta.settings.navigation.pinned');
135
- }
136
- if (navigation.nav.some(page => page.id === id)) {
137
- return t('ta.settings.navigation.inNav');
138
- }
139
- return t(setting.discover.includes(id) || byDefault ? 'ta.settings.navigation.folded' : 'ta.settings.navigation.overflow');
140
- };
141
- return [
142
- (0, settings_controls_1.row)('navigation-slots', [t('ta.settings.navigation.slots'), t('ta.settings.navigation.slotsHint'), t('ta.discover')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.navigation.slots'), description: t('ta.settings.navigation.slotsHint'), stacked: true },
143
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.navigation.slots'), value: String(setting.slots), choices: SLOTS, onChange: slots => navigation.update({ ...setting, slots: Number(slots) }) }))),
144
- ...navigation.pages.map(page => {
145
- const title = web_extension_protocol_1.WebLabelUtil.text(page.title);
146
- const shown = navigation.nav.includes(page);
147
- return (0, settings_controls_1.row)(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(settings_controls_1.Row, { label: title, description: where(page.id, page.discover) },
148
- React.createElement(settings_controls_1.Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: shown, onChange: on => (on ? navigation.pin(page.id) : navigation.fold(page.id)) })));
149
- }),
150
- ...(navigation.pages.length === 0
151
- ? [(0, settings_controls_1.row)('navigation:none', [t('ta.settings.navigation.none')], React.createElement(settings_controls_1.EmptyRow, { title: t('ta.settings.navigation.none') }))]
152
- : []),
153
- ...(navigation_1.NavigationUtil.moved(setting)
154
- ? [
155
- (0, settings_controls_1.row)('navigation-reset', [t('ta.settings.navigation.reset')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.navigation.reset'), description: t('ta.settings.navigation.resetHint') },
156
- React.createElement("button", { type: "button", className: "ta-button", onClick: () => navigation.update(navigation_1.NavigationUtil.reset(setting)) },
157
- React.createElement(icon_1.Icon, { icon: lucide_react_1.RefreshCw, size: 14 }),
158
- " ",
159
- t('ta.settings.navigation.resetButton')))),
160
- ]
161
- : []),
162
- ];
163
- }
164
- /** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
165
- function packageLabel(pkg, language) {
166
- var _a, _b;
167
- return {
168
- title: (_a = ta_protocol_1.TaPackageTextUtil.pick(pkg.title, language)) !== null && _a !== void 0 ? _a : pkg.name,
169
- summary: (_b = ta_protocol_1.TaPackageTextUtil.pick(pkg.summary, language)) !== null && _b !== void 0 ? _b : pkg.description,
170
- icon: (pkg.icon && icons_1.WEB_ICONS[pkg.icon]) || lucide_react_1.Puzzle,
171
- };
172
- }
173
- /** The sections of the page and of ta, by part, with their rows. */
174
- function useParts(scope, onScope, onClose, onDialog) {
175
- var _a;
176
- const t = (0, use_t_1.useT)();
177
- const language = (0, use_t_1.useLanguage)();
178
- const [{ settings }, store] = (0, hooks_1.useSettings)();
179
- const settingsServer = (0, hooks_1.useSettingsServer)();
180
- const [workbench, bench] = (0, hooks_1.useWorkbench)();
181
- const [{ extensions, cwd, views }, host] = (0, hooks_1.useWebExtensions)();
182
- const navigation = (0, app_nav_1.useNavigation)(views);
183
- const packageList = usePackages();
184
- const builtinPackages = packageList.packages.filter(pkg => pkg.origin === 'builtin');
185
- const agent = (0, agent_settings_view_1.useAgentSettings)(cwd !== null && cwd !== void 0 ? cwd : (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd);
186
- const [, notices] = (0, hooks_1.useNotices)();
187
- const access = (0, access_view_1.useAccess)();
188
- const gateway = (0, environment_view_1.useGateway)();
189
- // As the menu of the account (useAccountEntries): a finger has no keys to learn; a phone is not the computer
190
- // that pairs phones, and signs out at the foot of Me.
191
- const touch = (0, device_1.useDevice)(device => device.touch);
192
- const handheld = (0, device_1.useDevice)(device => device.handheld);
193
- const [busy, setBusy] = React.useState(false);
194
- const run = (action, done) => {
195
- setBusy(true);
196
- action()
197
- .then(() => done && notices.notify(done, { level: 'success' }))
198
- .catch(error => notices.error(error))
199
- .finally(() => setBusy(false));
200
- };
201
- const remove = async (pkg) => {
202
- const confirmed = await notices.confirm({
203
- title: t('ta.packages.removeConfirm', { name: pkg.name }),
204
- message: t('ta.packages.removeDetail'),
205
- confirmLabel: t('ta.packages.remove'),
206
- danger: true,
207
- });
208
- if (confirmed) {
209
- run(() => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
210
- }
211
- };
212
- const toggleBuiltin = (name, on) => {
213
- store.update({ builtinsOff: on ? settings.builtinsOff.filter(other => other !== name) : [...settings.builtinsOff, name] });
214
- run(() => host.refresh());
215
- };
216
- const web = [
217
- {
218
- id: 'appearance',
219
- title: t('ta.settings.appearance'),
220
- icon: lucide_react_1.Palette,
221
- rows: [
222
- (0, settings_controls_1.row)('theme', [t('ta.settings.theme'), 'theme'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.theme'), stacked: true },
223
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.theme'), value: settings.theme, choices: THEMES, onChange: theme => store.update({ theme }) }))),
224
- (0, settings_controls_1.row)('font-size', [t('ta.settings.fontSize'), t('ta.settings.fontSizeHint'), 'font'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.fontSize'), description: t('ta.settings.fontSizeHint'), stacked: true },
225
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.fontSize'), value: settings.fontSize, choices: FONT_SIZES, onChange: fontSize => store.update({ fontSize }) }))),
226
- (0, settings_controls_1.row)('chat-font-size', [t('ta.settings.chatFontSize'), t('ta.settings.chatFontSizeHint'), 'font'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.chatFontSize'), description: t('ta.settings.chatFontSizeHint'), stacked: true },
227
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.chatFontSize'), value: settings.chatFontSize, choices: FONT_SIZES, onChange: chatFontSize => store.update({ chatFontSize }) }))),
228
- (0, settings_controls_1.row)('motion', [t('ta.settings.motion'), t('ta.settings.motionHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.motion'), description: t('ta.settings.motionHint') },
229
- React.createElement(settings_controls_1.Switch, { label: t('ta.settings.motion'), checked: settings.reduceMotion, onChange: reduceMotion => store.update({ reduceMotion }) }))),
230
- ],
231
- },
232
- {
233
- id: 'language',
234
- title: t('ta.settings.language'),
235
- icon: lucide_react_1.Languages,
236
- rows: [
237
- (0, settings_controls_1.row)('language', [t('ta.settings.displayLanguage'), 'language'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.displayLanguage'), stacked: true },
238
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.displayLanguage'), value: settings.language, choices: LANGUAGES, onChange: language => store.update({ language }) }))),
239
- ],
240
- },
241
- {
242
- id: 'navigation',
243
- title: t('ta.settings.navigation'),
244
- icon: lucide_react_1.Compass,
245
- rows: navigationRows(navigation, t),
246
- },
247
- {
248
- id: 'links',
249
- title: t('ta.settings.links'),
250
- icon: lucide_react_1.Link2,
251
- rows: [
252
- (0, settings_controls_1.row)('trusted-domains', [t('ta.settings.trustedDomains'), t('ta.settings.trustedDomainsHint'), ...settings.trustedDomains], React.createElement(trusted_domains_1.TrustedDomains, null)),
253
- ],
254
- },
255
- {
256
- id: 'assistant',
257
- title: t('ta.settings.assistant'),
258
- icon: lucide_react_1.Bot,
259
- rows: [
260
- (0, settings_controls_1.row)('assistant-model', [t('ta.settings.assistantModel'), t('ta.settings.assistantModelHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.assistantModel'), description: t('ta.settings.assistantModelHint'), stacked: true },
261
- React.createElement(model_picker_1.SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.assistantModel'), value: settings.assistantModel, onChange: assistantModel => store.update({ assistantModel }) }))),
262
- (0, settings_controls_1.row)('task-model', [t('ta.settings.taskModel'), t('ta.settings.taskModelHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.taskModel'), description: t('ta.settings.taskModelHint'), stacked: true },
263
- React.createElement(model_picker_1.SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.taskModel'), value: settings.taskModel, onChange: taskModel => store.update({ taskModel }) }))),
264
- (0, settings_controls_1.row)('confirm-tasks', [t('ta.settings.confirmTasks'), t('ta.settings.confirmTasksHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.confirmTasks'), description: t('ta.settings.confirmTasksHint') },
265
- React.createElement(settings_controls_1.Switch, { label: t('ta.settings.confirmTasks'), checked: settings.confirmTasks, onChange: confirmTasks => store.update({ confirmTasks }) }))),
266
- (0, settings_controls_1.row)('max-tasks', [t('ta.settings.maxTasks'), t('ta.settings.maxTasksHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.maxTasks'), description: t('ta.settings.maxTasksHint'), stacked: true },
267
- React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.maxTasks'), value: String(settings.maxTasks), choices: settings_protocol_1.MAX_TASKS_CHOICES.map(count => ({
268
- value: String(count),
269
- label: count === 0 ? t('ta.settings.maxTasksAny') : String(count),
270
- })), onChange: value => store.update({ maxTasks: Number(value) }) }))),
271
- ],
272
- },
273
- {
274
- id: 'voice',
275
- title: t('ta.settings.voice'),
276
- icon: lucide_react_1.Volume2,
277
- rows: [
278
- (0, settings_controls_1.row)('speak', [t('ta.settings.speak'), t('ta.settings.speakHint')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.speak'), description: t('ta.settings.speakHint') },
279
- React.createElement(settings_controls_1.Switch, { label: t('ta.settings.speak'), checked: settings.speak, onChange: speak => store.update({ speak }) }))),
280
- ],
281
- },
282
- ];
283
- const { snapshot } = agent;
284
- const locked = !!snapshot && scope === 'project' && !snapshot.projectTrusted;
285
- const lead = (React.createElement(React.Fragment, null,
286
- React.createElement(agent_settings_view_1.ScopeBar, { scope: scope, onScope: onScope, snapshot: snapshot }),
287
- agent.offline && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.offline')),
288
- !agent.offline && !snapshot && !agent.error && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.loading')),
289
- locked && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.untrusted')),
290
- agent.error && React.createElement("div", { className: "ta-banner ta-banner-error" }, t('ta.settings.failed', { error: agent.error }))));
291
- const ta = agent_settings_1.AGENT_SETTINGS_GROUPS.map(group => { var _a; return ({
292
- id: group.id,
293
- title: t(group.title),
294
- icon: (_a = GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : lucide_react_1.Wrench,
295
- rows: snapshot
296
- ? group.keys.flatMap(key => {
297
- const spec = agent_settings_1.AgentSettingsUtil.spec(key);
298
- if (!spec) {
299
- return [];
300
- }
301
- const label = t(agent_settings_1.AgentSettingsUtil.label(key));
302
- const hint = agent_settings_1.AgentSettingsUtil.hint(key);
303
- return [
304
- (0, settings_controls_1.row)(key, [label, hint && t(hint), key], React.createElement(settings_controls_1.Row, { label: label, description: hint && t(hint), modified: snapshot[scope][key] !== undefined },
305
- React.createElement(agent_settings_view_1.AgentControl, { spec: spec, scope: scope, snapshot: snapshot, disabled: locked, onChange: changes => agent.update(scope, changes) }))),
306
- ];
307
- })
308
- : [],
309
- }); });
310
- // Those opened without installing are in Quick open, which installs or deletes them (ta-launcher.md).
311
- const packages = packageList.packages.filter(pkg => pkg.origin !== 'builtin' && pkg.origin !== 'temporary');
312
- const launchRows = (0, launch_settings_1.useLaunchRows)();
313
- /** Why the web extension of a package did not load, if it did not. */
314
- 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; };
315
- const reload = async () => {
316
- await host.refresh();
317
- await packageList.read();
318
- };
319
- const more = [
320
- {
321
- id: 'packages',
322
- title: t('ta.packages'),
323
- icon: lucide_react_1.Puzzle,
324
- rows: [
325
- (0, settings_controls_1.row)('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(settings_controls_1.Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
326
- React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => run(reload, t('ta.packages.reloaded')) },
327
- React.createElement(icon_1.Icon, { icon: lucide_react_1.RefreshCw, size: 14 }),
328
- " ",
329
- t('ta.packages.reload')))),
330
- ...packages.map(pkg => {
331
- const error = failure(pkg);
332
- const { title, summary, icon } = packageLabel(pkg, language);
333
- return (0, settings_controls_1.row)(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(settings_controls_1.Row, { icon: icon, label: title, description: error
334
- ? t('ta.packages.failed', { error })
335
- : [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
336
- React.createElement(icon_1.IconButton, { icon: lucide_react_1.Trash2, label: t('ta.packages.remove'), disabled: busy, onClick: () => void remove(pkg) }),
337
- React.createElement(settings_controls_1.Switch, { label: title, checked: pkg.enabled, disabled: busy, onChange: on => run(() => packageList.toggle(pkg, on)) })));
338
- }),
339
- ...(packages.length === 0
340
- ? [(0, settings_controls_1.row)('packages:none', [t('ta.packages.none')], React.createElement(settings_controls_1.EmptyRow, { title: t('ta.packages.none'), hint: t('ta.packages.noneHint') }))]
341
- : []),
342
- ...launchRows,
343
- ],
344
- },
345
- {
346
- id: 'builtin',
347
- title: t('ta.packages.builtinTitle'),
348
- icon: lucide_react_1.Blocks,
349
- rows: [
350
- ...host.builtins.map(builtin => { var _a; return (0, settings_controls_1.row)(`web:${builtin.name}`, [t(builtin.title), t(builtin.description), t('ta.packages.builtinTitle')], React.createElement(settings_controls_1.Row, { icon: (_a = builtin.icon) !== null && _a !== void 0 ? _a : lucide_react_1.Puzzle, label: t(builtin.title), description: t(builtin.description) },
351
- React.createElement(settings_controls_1.Switch, { label: t(builtin.title), checked: !settings.builtinsOff.includes(builtin.name), onChange: on => toggleBuiltin(builtin.name, on) }))); }),
352
- ...builtinPackages.map(info => {
353
- const { title, summary, icon } = packageLabel(info, language);
354
- return (0, settings_controls_1.row)(`builtin:${info.name}`, [title, summary, info.name, t('ta.packages.builtinTitle')], React.createElement(settings_controls_1.Row, { icon: icon, label: title, description: summary },
355
- React.createElement(settings_controls_1.Switch, { label: title, checked: info.enabled, onChange: on => run(() => packageList.toggle(info, on)) })));
356
- }),
357
- ],
358
- },
359
- // Behind a gateway only: where the Ta of this account runs.
360
- ...(gateway.info
361
- ? [
362
- {
363
- id: 'environment',
364
- title: t('ta.environment.title'),
365
- icon: lucide_react_1.Cloud,
366
- rows: [
367
- (0, settings_controls_1.row)('environment', [t('ta.environment.title'), t('ta.environment.whereHint'), 'sandbox', 'docker'], React.createElement(environment_view_1.EnvironmentSettings, { info: gateway.info, onChange: gateway.read })),
368
- ],
369
- },
370
- ]
371
- : []),
372
- // Only where accounts can sign in, or could: a Ta of this computer has no need of it.
373
- ...(access.info && (access.info.providers.length > 0 || access.info.accounts.length > 0)
374
- ? [
375
- {
376
- id: 'access',
377
- title: t('ta.access.title'),
378
- icon: lucide_react_1.ShieldCheck,
379
- rows: [
380
- (0, settings_controls_1.row)('access', [t('ta.access.title'), t('ta.access.addHint'), 'github', 'google', 'wechat'], React.createElement(access_view_1.AccessSettings, { info: access.info, onChange: access.read })),
381
- ],
382
- },
383
- ]
384
- : []),
385
- {
386
- id: 'remote',
387
- title: t('ta.remote.title'),
388
- icon: lucide_react_1.Server,
389
- rows: [(0, settings_controls_1.row)('remote', [t('ta.remote.title'), t('ta.remote.description'), 'ssh'], React.createElement(remote_hosts_1.RemoteHosts, null))],
390
- },
391
- ...(touch
392
- ? []
393
- : [
394
- {
395
- id: 'shortcuts',
396
- title: t('ta.settings.shortcuts'),
397
- icon: lucide_react_1.Keyboard,
398
- rows: exports.SHORTCUTS.map(shortcut => (0, settings_controls_1.row)(`key:${shortcut.keys}`, [t(shortcut.label), shortcut.keys, t('ta.settings.shortcuts')], React.createElement(settings_controls_1.Row, { label: t(shortcut.label) },
399
- React.createElement(settings_controls_1.Keys, { keys: shortcut.keys })))),
400
- },
401
- ]),
402
- {
403
- id: 'about',
404
- title: t('ta.settings.about'),
405
- icon: lucide_react_1.Info,
406
- rows: workbench.server
407
- ? [
408
- (0, settings_controls_1.row)('version', [t('ta.settings.version'), 'version'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.version') },
409
- React.createElement("span", { className: "ta-path" },
410
- "v",
411
- workbench.server.version))),
412
- (0, settings_controls_1.row)('cwd', [t('ta.settings.cwd'), workbench.server.cwd], React.createElement(settings_controls_1.Row, { label: t('ta.settings.cwd'), description: t('ta.settings.cwdDescription', { path: workbench.server.cwd }) },
413
- React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('directory') },
414
- React.createElement(icon_1.Icon, { icon: lucide_react_1.FolderOpen, size: 15 }),
415
- " ",
416
- t('ta.settings.cwdChange')))),
417
- (0, settings_controls_1.row)('accounts', [t('ta.settings.accounts'), t('ta.settings.accountsDescription')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.accounts'), description: t('ta.settings.accountsDescription') },
418
- React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('accounts') },
419
- React.createElement(icon_1.Icon, { icon: lucide_react_1.KeyRound, size: 15 }),
420
- " ",
421
- t('ta.settings.manageAccounts')))),
422
- ...(workbench_1.WorkbenchUtil.isApp() || handheld
423
- ? []
424
- : [
425
- (0, settings_controls_1.row)('relay', [t('ta.settings.relay'), t('ta.settings.relayDescription')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.relay'), description: t('ta.settings.relayDescription') },
426
- React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('relay') },
427
- React.createElement(icon_1.Icon, { icon: lucide_react_1.Smartphone, size: 15 }),
428
- " ",
429
- t('ta.settings.manageAccounts')))),
430
- ]),
431
- ...(handheld
432
- ? []
433
- : [
434
- (0, settings_controls_1.row)('signOut', [t('ta.settings.signOut')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.signOut') },
435
- React.createElement("button", { type: "button", className: "ta-button ta-danger", onClick: () => {
436
- onClose();
437
- bench.signOut();
438
- } },
439
- React.createElement(icon_1.Icon, { icon: lucide_react_1.LogOut, size: 15 }),
440
- " ",
441
- t('ta.settings.signOut')))),
442
- ]),
443
- ]
444
- : [],
445
- },
446
- ];
447
- return [
448
- { id: 'web', title: t('ta.settings.web'), sections: web },
449
- { id: 'agent', title: t('ta.settings.agent'), sections: ta, lead },
450
- { id: 'more', title: t('ta.settings.more'), sections: more },
451
- ];
452
- }
453
50
  const sectionId = (id) => `ta-settings-${id}`;
454
51
  /**
455
52
  * The settings, as a page of the main area: those of this page (kept in the browser) and those of ta
@@ -464,7 +61,7 @@ function SettingsView({ section, onClose, onMenu, onBack }) {
464
61
  const [scope, setScope] = React.useState('user');
465
62
  const [dialog, setDialog] = React.useState();
466
63
  const closeDialog = React.useCallback(() => setDialog(undefined), []);
467
- const parts = useParts(scope, setScope, onClose, setDialog);
64
+ const parts = (0, settings_parts_1.useParts)(scope, setScope, onClose, setDialog);
468
65
  React.useEffect(() => {
469
66
  const onKey = (event) => { var _a, _b; return event.key === 'Escape' && !((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'input, select, textarea')) && onClose(); };
470
67
  window.addEventListener('keydown', onKey);
@@ -11,7 +11,7 @@ export interface SwipeRowProps extends WebSwipeRowProps, Omit<React.HTMLAttribut
11
11
  * list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
12
12
  * it closes it rather than opening what it is.
13
13
  */
14
- export declare function SwipeRow({ as, actions, className, overlay, children, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
14
+ export declare function SwipeRow({ as, actions, className, overlay, children, style, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
15
15
  dangerouslySetInnerHTML?: {
16
16
  __html: string | TrustedHTML;
17
17
  } | undefined;
@@ -254,7 +254,6 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
254
254
  nonce?: string | undefined;
255
255
  slot?: string | undefined;
256
256
  spellCheck?: ("false" | "true" | boolean) | undefined;
257
- style?: React.CSSProperties | undefined;
258
257
  tabIndex?: number | undefined;
259
258
  title?: string | undefined;
260
259
  translate?: "yes" | "no" | undefined;
@@ -294,5 +293,6 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
294
293
  className: string;
295
294
  'data-swipeable': string | undefined;
296
295
  'data-swiped': string | undefined;
296
+ style: React.CSSProperties | undefined;
297
297
  }, HTMLElement>;
298
298
  //# sourceMappingURL=swipe-row.d.ts.map
@@ -44,7 +44,7 @@ const ACTION_PX = 84;
44
44
  * list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
45
45
  * it closes it rather than opening what it is.
46
46
  */
47
- function SwipeRow({ as = 'div', actions, className, overlay, children, ...rest }) {
47
+ function SwipeRow({ as = 'div', actions, className, overlay, children, style, ...rest }) {
48
48
  var _a;
49
49
  const row = React.useRef(null);
50
50
  const handheld = (0, device_1.useDevice)(device => device.handheld);
@@ -62,9 +62,13 @@ function SwipeRow({ as = 'div', actions, className, overlay, children, ...rest }
62
62
  className: className ? `ta-swipe-row ${className}` : 'ta-swipe-row',
63
63
  'data-swipeable': enabled ? '' : undefined,
64
64
  'data-swiped': open ? '' : undefined,
65
- }, enabled && (React.createElement("div", { className: "ta-swipe-actions", inert: !open }, actions === null || actions === void 0 ? void 0 : actions.map(action => (React.createElement("button", { key: action.key, type: "button", className: `ta-swipe-action${action.danger ? ' ta-danger' : ''}`, onClick: () => {
65
+ // How far the content slides open, and its actions come out from: theirs together.
66
+ style: enabled ? { ...style, '--ta-swipe-width': `${ACTION_PX * ((_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0)}px` } : style,
67
+ }, enabled && (React.createElement("div", { className: "ta-swipe-actions", inert: !open }, actions === null || actions === void 0 ? void 0 : actions.map((action, index) => (React.createElement("button", { key: action.key, type: "button", className: `ta-swipe-action${action.danger ? ' ta-danger' : ''}`,
68
+ // Of the way the row is shown, how far it is pushed out while closed (RowSwipeUtil.shift).
69
+ style: { '--ta-swipe-share': 1 - index / actions.length }, onClick: () => {
66
70
  unswipe();
67
71
  action.run();
68
- } }, action.label))))), React.createElement("div", { className: "ta-swipe-content", style: enabled ? { '--ta-swipe-width': `${ACTION_PX * ((_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0)}px` } : undefined, onClickCapture: open ? closeInstead : undefined }, children), overlay);
72
+ } }, action.label))))), React.createElement("div", { className: "ta-swipe-content", onClickCapture: open ? closeInstead : undefined }, children), overlay);
69
73
  }
70
74
  //# sourceMappingURL=swipe-row.js.map
@@ -69,10 +69,10 @@ function ToolRow({ name, args, status, trailing, details }) {
69
69
  React.createElement(StatusDot, { status: status }),
70
70
  React.createElement("span", { className: "ta-tool-verb" }, summary.verb ? t(summary.verb) : summary.name),
71
71
  summary.target && React.createElement("span", { className: `ta-tool-target ${summary.code ? 'ta-mono' : ''}` }, summary.target),
72
- details ? React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-tool-chevron" }) : React.createElement("span", { className: "ta-tool-chevron" })));
72
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-tool-chevron" })));
73
73
  return (React.createElement("div", { className: `ta-tool ta-tool-${status}` },
74
74
  React.createElement("div", { className: "ta-tool-line" },
75
- details ? (React.createElement("button", { type: "button", className: "ta-tool-title", "aria-expanded": open, onClick: () => setOpen(!open) }, line)) : (React.createElement("div", { className: "ta-tool-title" }, line)),
75
+ React.createElement("button", { type: "button", className: "ta-tool-title", disabled: !details, "aria-expanded": details ? open : undefined, onClick: () => setOpen(!open) }, line),
76
76
  React.createElement("span", { className: "ta-tool-trailing" }, trailing)),
77
77
  details && open && React.createElement("div", { className: "ta-tool-body" }, details)));
78
78
  }
@@ -124,23 +124,25 @@ function CodemodeView({ id, args, output, status, runs }) {
124
124
  const script = (React.createElement(React.Fragment, null,
125
125
  React.createElement(markdown_1.CodeBlock, { code: code, language: "js" }),
126
126
  result && React.createElement(Output, { text: result })));
127
- if (!calls.length) {
128
- return React.createElement(ToolRow, { name: "codemode", args: args, status: status, details: script });
129
- }
130
127
  const label = t(showScript ? 'ta.tool.hideScript' : 'ta.tool.showScript');
131
- const toggle = (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
128
+ const toggle = calls.length > 0 && (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
132
129
  React.createElement(icon_1.Icon, { icon: lucide_react_1.FileCode2, size: 13 })));
130
+ // Before its first call the script is the one step; its calls then take its place, the first in the same
131
+ // element, so that the line changes rather than comes again. By place: the calls are in order, live or
132
+ // kept, and their ids are not the same in both.
133
+ const rows = calls.length ? calls.map(nestedRow) : [{ name: 'codemode', args, status, details: script }];
133
134
  // A script that failed after its calls went well: one more step, the script, whose output says what went wrong.
134
- const failedAlone = status === 'error' && !calls.some(call => call.status === 'error');
135
+ if (calls.length && status === 'error' && !calls.some(call => call.status === 'error')) {
136
+ rows.push({ name: 'codemode', args: { code }, status: 'error', details: result ? React.createElement(Output, { text: result }) : undefined });
137
+ }
135
138
  return (React.createElement("div", { className: "ta-tool-group" },
136
- calls.map((call, index) => (React.createElement(NestedRow, { key: call.key, call: call, trailing: index === 0 ? toggle : undefined }))),
137
- failedAlone && React.createElement(ToolRow, { name: "codemode", args: { code }, status: "error", details: result && React.createElement(Output, { text: result }) }),
138
- showScript && React.createElement("div", { className: "ta-tool-body" }, script)));
139
+ rows.map((row, index) => (React.createElement(ToolRow, { key: index, ...row, trailing: index === 0 ? toggle || undefined : undefined }))),
140
+ showScript && calls.length > 0 && React.createElement("div", { className: "ta-tool-body" }, script)));
139
141
  }
140
- function NestedRow({ call, trailing }) {
142
+ function nestedRow(call) {
141
143
  var _a;
142
144
  const shown = details(call.name, call.args, (_a = call.run) === null || _a === void 0 ? void 0 : _a.result, call.status);
143
145
  const error = call.status === 'error' && call.error ? React.createElement(Output, { text: call.error }) : undefined;
144
- return React.createElement(ToolRow, { name: call.name, args: call.args, status: call.status, trailing: trailing, details: shown || error || undefined });
146
+ return { name: call.name, args: call.args, status: call.status, details: shown || error || undefined };
145
147
  }
146
148
  //# sourceMappingURL=tool-view.js.map
@@ -7,6 +7,6 @@ export interface VoiceButtonProps {
7
7
  onListening?(listening: boolean): void;
8
8
  onError(error: unknown): void;
9
9
  }
10
- /** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it. */
10
+ /** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it (a finger held on it talks, which is the box's: voice-talk.ts). */
11
11
  export declare function VoiceButton(props: VoiceButtonProps): React.JSX.Element;
12
12
  //# sourceMappingURL=voice-button.d.ts.map
@@ -39,7 +39,7 @@ const React = __importStar(require("react"));
39
39
  const use_t_1 = require("../i18n/use-t");
40
40
  const voice_1 = require("../util/voice");
41
41
  const icon_1 = require("./icon");
42
- /** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it. */
42
+ /** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it (a finger held on it talks, which is the box's: voice-talk.ts). */
43
43
  function VoiceButton(props) {
44
44
  const t = (0, use_t_1.useT)();
45
45
  const language = (0, use_t_1.useLanguage)();
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import type { TalkTarget } from './held-talk';
3
+ /** Where the finger is let go: on the bottom, the words go; over 取消 they are dropped; over 编辑 they stay in the box. */
4
+ export type TalkZone = 'send' | 'cancel' | 'edit';
5
+ export declare namespace VoiceTalkUtil {
6
+ /** How long a talk lasts for the words to count: shorter, a finger slipped on the box and nothing is given. */
7
+ const SHORT_MS = 600;
8
+ /** How long the end of a talk waits for recognition to say it ended before it ends anyway. */
9
+ const SETTLE_MS = 1500;
10
+ /** How long "too short" stays before the page comes back. */
11
+ const SHORT_NOTICE_MS = 700;
12
+ /** How long the overlay takes to fade out. */
13
+ const LEAVE_MS = 160;
14
+ /** What a talk gives; none when it was too short to be meant, or when nothing was heard. */
15
+ function given(words: string, heldMs: number): string | undefined;
16
+ /** The zone of the overlay under a point (`data-talk-zone`): the bottom, where the finger starts, sends. */
17
+ function zone(element: Element | null): TalkZone;
18
+ }
19
+ /** Where a talk is: listening, the finger let go and the last words coming, said too short, the page coming back. */
20
+ export type TalkPhase = 'idle' | 'listening' | 'released' | 'short' | 'leaving';
21
+ export interface VoiceTalk extends TalkTarget {
22
+ phase: TalkPhase;
23
+ /** Listening, or the finger let go and the last words still coming. */
24
+ active: boolean;
25
+ /** What has been heard so far. */
26
+ words: string;
27
+ /** Where the finger is. */
28
+ zone: TalkZone;
29
+ }
30
+ /**
31
+ * A conversation by voice as WeChat's: a finger held on the message box (or on an entry of the navigation) dims the
32
+ * page and a green bubble listens, the words coming as they are said. Let go on the bottom, they are sent; slid
33
+ * over 取消 they are dropped, over 编辑 they stay in the box to be read over. A talk too short to be meant, which a
34
+ * wrong touch is, says so and gives nothing, as one where nothing was heard does.
35
+ */
36
+ export declare function useVoiceTalk(onGive: (text: string, zone: 'send' | 'edit') => void, onError: (error: unknown) => void): VoiceTalk;
37
+ /**
38
+ * What a talk shows, over the whole page (above the keyboard): the page dimmed, a green bubble with the words as
39
+ * they come, 取消 and 编辑 to slide the finger onto, and the bottom it starts on, which says what letting go does.
40
+ */
41
+ export declare function VoiceTalkOverlay({ talk }: {
42
+ talk: VoiceTalk;
43
+ }): React.ReactPortal | null;
44
+ //# sourceMappingURL=voice-talk.d.ts.map