@celljs/ta-web 4.10.0 → 4.12.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 (559) hide show
  1. package/README.en.md +7 -7
  2. package/README.md +7 -7
  3. package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
  4. package/esm/browser/assistant/assistant-chat-list.js +12 -0
  5. package/esm/browser/assistant/assistant-extension.js +5 -0
  6. package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
  7. package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
  8. package/esm/browser/assistant/assistant-task-book.js +23 -4
  9. package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
  10. package/esm/browser/assistant/assistant-task-source.js +5 -10
  11. package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
  12. package/esm/browser/assistant/assistant-task-util.js +59 -12
  13. package/esm/browser/assistant/assistant-view.js +48 -24
  14. package/esm/browser/assistant/assistant.d.ts +18 -4
  15. package/esm/browser/assistant/assistant.js +52 -17
  16. package/esm/browser/avatar/dino-face.js +1 -2
  17. package/esm/browser/chat/chat-protocol.d.ts +5 -0
  18. package/esm/browser/chat/chat-stores.d.ts +8 -5
  19. package/esm/browser/chat/chat-stores.js +17 -9
  20. package/esm/browser/chat/chat-view.js +23 -15
  21. package/esm/browser/chat/chat.d.ts +16 -8
  22. package/esm/browser/chat/chat.js +86 -51
  23. package/esm/browser/components/account-menu.d.ts +0 -2
  24. package/esm/browser/components/account-menu.js +1 -27
  25. package/esm/browser/components/agent-settings-view.d.ts +3 -2
  26. package/esm/browser/components/agent-settings-view.js +2 -1
  27. package/esm/browser/components/app-nav.d.ts +5 -2
  28. package/esm/browser/components/app-nav.js +22 -9
  29. package/esm/browser/components/app-shell-hooks.js +5 -3
  30. package/esm/browser/components/app-view.js +84 -20
  31. package/esm/browser/components/busy.d.ts +25 -0
  32. package/esm/browser/components/busy.js +52 -0
  33. package/esm/browser/components/chat-icon.d.ts +29 -0
  34. package/esm/browser/components/chat-icon.js +78 -0
  35. package/esm/browser/components/chat-list.d.ts +73 -6
  36. package/esm/browser/components/chat-list.js +295 -60
  37. package/esm/browser/components/chat-seen.d.ts +53 -0
  38. package/esm/browser/components/chat-seen.js +101 -0
  39. package/esm/browser/components/composer-box.d.ts +15 -4
  40. package/esm/browser/components/composer-box.js +139 -77
  41. package/esm/browser/components/composer.d.ts +9 -6
  42. package/esm/browser/components/composer.js +32 -4
  43. package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
  44. package/esm/browser/components/conversation-scroll-hooks.js +98 -0
  45. package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
  46. package/esm/browser/components/conversation-scroll-util.js +56 -0
  47. package/esm/browser/components/conversation-scroll.d.ts +52 -31
  48. package/esm/browser/components/conversation-scroll.js +170 -129
  49. package/esm/browser/components/custom-host.d.ts +3 -0
  50. package/esm/browser/components/custom-host.js +14 -0
  51. package/esm/browser/components/directory-commands.d.ts +6 -0
  52. package/esm/browser/components/directory-commands.js +34 -0
  53. package/esm/browser/components/discover-view.d.ts +11 -4
  54. package/esm/browser/components/discover-view.js +20 -11
  55. package/esm/browser/components/dismiss.d.ts +3 -0
  56. package/esm/browser/components/dismiss.js +29 -0
  57. package/esm/browser/components/earlier-messages.d.ts +34 -3
  58. package/esm/browser/components/earlier-messages.js +42 -8
  59. package/esm/browser/components/editor-area.d.ts +6 -22
  60. package/esm/browser/components/editor-area.js +10 -97
  61. package/esm/browser/components/face.d.ts +24 -0
  62. package/esm/browser/components/face.js +42 -0
  63. package/esm/browser/components/fold-text.d.ts +20 -0
  64. package/esm/browser/components/fold-text.js +66 -0
  65. package/esm/browser/components/folder-picker.d.ts +1 -1
  66. package/esm/browser/components/folder-picker.js +1 -1
  67. package/esm/browser/components/full-screen.d.ts +9 -0
  68. package/esm/browser/components/full-screen.js +26 -0
  69. package/esm/browser/components/grow-box.d.ts +9 -0
  70. package/esm/browser/components/grow-box.js +50 -0
  71. package/esm/browser/components/hold-to-talk.d.ts +22 -0
  72. package/esm/browser/components/hold-to-talk.js +29 -0
  73. package/esm/browser/components/host-view.d.ts +1 -1
  74. package/esm/browser/components/icon.d.ts +3 -1
  75. package/esm/browser/components/icon.js +4 -3
  76. package/esm/browser/components/image-viewer.d.ts +10 -2
  77. package/esm/browser/components/image-viewer.js +48 -11
  78. package/esm/browser/components/launcher-search-util.d.ts +4 -3
  79. package/esm/browser/components/launcher-search-util.js +12 -4
  80. package/esm/browser/components/lightbox.d.ts +5 -2
  81. package/esm/browser/components/lightbox.js +4 -3
  82. package/esm/browser/components/list-rows.d.ts +9 -1
  83. package/esm/browser/components/list-rows.js +17 -3
  84. package/esm/browser/components/markdown.js +36 -4
  85. package/esm/browser/components/media.js +73 -7
  86. package/esm/browser/components/message-actions.js +3 -0
  87. package/esm/browser/components/message-footer.d.ts +8 -0
  88. package/esm/browser/components/message-footer.js +20 -3
  89. package/esm/browser/components/message-list.d.ts +60 -7
  90. package/esm/browser/components/message-list.js +206 -58
  91. package/esm/browser/components/message-menu.js +6 -1
  92. package/esm/browser/components/model-picker.js +1 -0
  93. package/esm/browser/components/nav-places.d.ts +21 -2
  94. package/esm/browser/components/nav-places.js +20 -4
  95. package/esm/browser/components/notice-center.js +34 -0
  96. package/esm/browser/components/notice-face.d.ts +10 -0
  97. package/esm/browser/components/notice-face.js +28 -0
  98. package/esm/browser/components/phone-shell.d.ts +23 -1
  99. package/esm/browser/components/phone-shell.js +98 -9
  100. package/esm/browser/components/picture.d.ts +8 -1
  101. package/esm/browser/components/picture.js +12 -1
  102. package/esm/browser/components/plus-menu.d.ts +23 -0
  103. package/esm/browser/components/plus-menu.js +90 -0
  104. package/esm/browser/components/recent-shot.d.ts +15 -0
  105. package/esm/browser/components/recent-shot.js +174 -0
  106. package/esm/browser/components/relay-view.js +10 -3
  107. package/esm/browser/components/run-status.d.ts +1 -1
  108. package/esm/browser/components/run-status.js +17 -29
  109. package/esm/browser/components/said-text.d.ts +6 -0
  110. package/esm/browser/components/said-text.js +14 -0
  111. package/esm/browser/components/scan-screen.d.ts +10 -0
  112. package/esm/browser/components/scan-screen.js +230 -0
  113. package/esm/browser/components/search-page.js +10 -6
  114. package/esm/browser/components/session-settings.d.ts +2 -3
  115. package/esm/browser/components/session-settings.js +1 -0
  116. package/esm/browser/components/session-view.d.ts +3 -1
  117. package/esm/browser/components/session-view.js +35 -21
  118. package/esm/browser/components/settings-choices.d.ts +1 -0
  119. package/esm/browser/components/settings-choices.js +3 -2
  120. package/esm/browser/components/settings-controls.d.ts +5 -3
  121. package/esm/browser/components/settings-controls.js +10 -1
  122. package/esm/browser/components/settings-parts.js +45 -14
  123. package/esm/browser/components/stop-times.d.ts +47 -0
  124. package/esm/browser/components/stop-times.js +81 -0
  125. package/esm/browser/components/tool-view.js +7 -2
  126. package/esm/browser/components/unseen-drop.d.ts +39 -0
  127. package/esm/browser/components/unseen-drop.js +219 -0
  128. package/esm/browser/components/use-seen-chats.d.ts +8 -0
  129. package/esm/browser/components/use-seen-chats.js +49 -0
  130. package/esm/browser/components/use-stop-times.d.ts +3 -0
  131. package/esm/browser/components/use-stop-times.js +17 -0
  132. package/esm/browser/components/voice-button.d.ts +7 -1
  133. package/esm/browser/components/voice-button.js +15 -2
  134. package/esm/browser/components/voice-picker.d.ts +6 -0
  135. package/esm/browser/components/voice-picker.js +53 -0
  136. package/esm/browser/components/voice-talk.d.ts +11 -3
  137. package/esm/browser/components/voice-talk.js +24 -4
  138. package/esm/browser/components/web-composer.d.ts +4 -2
  139. package/esm/browser/components/web-composer.js +8 -4
  140. package/esm/browser/components/workbench-tabs.d.ts +41 -0
  141. package/esm/browser/components/workbench-tabs.js +193 -0
  142. package/esm/browser/components/workbench-toggle.d.ts +0 -13
  143. package/esm/browser/components/workbench-toggle.js +1 -28
  144. package/esm/browser/device/code-scan.d.ts +55 -0
  145. package/esm/browser/device/code-scan.js +137 -0
  146. package/esm/browser/device/code-vision.d.ts +51 -0
  147. package/esm/browser/device/code-vision.js +100 -0
  148. package/esm/browser/device/hold.js +4 -6
  149. package/esm/browser/device/long-press.d.ts +10 -0
  150. package/esm/browser/device/long-press.js +28 -12
  151. package/esm/browser/device/own-gestures.d.ts +25 -0
  152. package/esm/browser/device/own-gestures.js +39 -0
  153. package/esm/browser/device/photo-picker.d.ts +14 -0
  154. package/esm/browser/device/photo-picker.js +48 -0
  155. package/esm/browser/device/pull-down.js +3 -2
  156. package/esm/browser/device/recent-shots.d.ts +45 -0
  157. package/esm/browser/device/recent-shots.js +142 -0
  158. package/esm/browser/device/row-swipe.d.ts +2 -0
  159. package/esm/browser/device/row-swipe.js +14 -3
  160. package/esm/browser/device/sheet-swipe.d.ts +1 -1
  161. package/esm/browser/device/sheet-swipe.js +25 -4
  162. package/esm/browser/extension/extension-view.d.ts +10 -0
  163. package/esm/browser/extension/extension-view.js +6 -0
  164. package/esm/browser/extension/icons.js +16 -2
  165. package/esm/browser/extension/web-api-components.d.ts +287 -0
  166. package/esm/browser/extension/web-api-components.js +2 -0
  167. package/esm/browser/extension/web-api-contributions.d.ts +394 -0
  168. package/esm/browser/extension/web-api-contributions.js +2 -0
  169. package/esm/browser/extension/web-api-desktop.d.ts +55 -0
  170. package/esm/browser/extension/web-api-desktop.js +2 -0
  171. package/esm/browser/extension/web-api-terminal.d.ts +71 -0
  172. package/esm/browser/extension/web-api-terminal.js +2 -0
  173. package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
  174. package/esm/browser/extension/web-editor-tabs.js +137 -0
  175. package/esm/browser/extension/web-extension-api.d.ts +186 -565
  176. package/esm/browser/extension/web-extension-context.d.ts +78 -0
  177. package/esm/browser/extension/web-extension-context.js +354 -0
  178. package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
  179. package/esm/browser/extension/web-extension-protocol.js +34 -0
  180. package/esm/browser/extension/web-extension-run.d.ts +54 -0
  181. package/esm/browser/extension/web-extension-run.js +120 -0
  182. package/esm/browser/extension/web-extensions.d.ts +29 -69
  183. package/esm/browser/extension/web-extensions.js +121 -516
  184. package/esm/browser/extension/web-home.d.ts +19 -0
  185. package/esm/browser/extension/web-home.js +72 -0
  186. package/esm/browser/extension/web-pages.d.ts +13 -3
  187. package/esm/browser/extension/web-pages.js +23 -3
  188. package/esm/browser/extension/web-session-notices.d.ts +36 -0
  189. package/esm/browser/extension/web-session-notices.js +174 -0
  190. package/esm/browser/extension/web-sharing.d.ts +2 -0
  191. package/esm/browser/extension/web-sharing.js +4 -0
  192. package/esm/browser/game/game-host.d.ts +27 -0
  193. package/esm/browser/game/game-host.js +127 -0
  194. package/esm/browser/game/game-loader.d.ts +10 -0
  195. package/esm/browser/game/game-loader.js +28 -0
  196. package/esm/browser/game/game-protocol.d.ts +49 -0
  197. package/esm/browser/game/game-protocol.js +2 -0
  198. package/esm/browser/game/game-runner.d.ts +27 -0
  199. package/esm/browser/game/game-runner.js +60 -0
  200. package/esm/browser/game/game-util.d.ts +29 -0
  201. package/esm/browser/game/game-util.js +180 -0
  202. package/esm/browser/game/game-view.d.ts +12 -0
  203. package/esm/browser/game/game-view.js +31 -0
  204. package/esm/browser/game/game3d-protocol.d.ts +51 -0
  205. package/esm/browser/game/game3d-protocol.js +2 -0
  206. package/esm/browser/game/game3d-runner.d.ts +27 -0
  207. package/esm/browser/game/game3d-runner.js +149 -0
  208. package/esm/browser/hooks.d.ts +5 -1
  209. package/esm/browser/hooks.js +13 -2
  210. package/esm/browser/i18n/locales.d.ts +92 -2
  211. package/esm/browser/i18n/messages.d.ts +91 -1
  212. package/esm/browser/i18n/messages.js +187 -7
  213. package/esm/browser/index.d.ts +9 -0
  214. package/esm/browser/index.js +9 -0
  215. package/esm/browser/links/links-protocol.d.ts +7 -0
  216. package/esm/browser/links/links.d.ts +24 -7
  217. package/esm/browser/links/links.js +64 -11
  218. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  219. package/esm/browser/markdown/code-renderers.js +4 -0
  220. package/esm/browser/notices/notices-protocol.d.ts +17 -0
  221. package/esm/browser/notices/notices.d.ts +1 -1
  222. package/esm/browser/notices/notices.js +6 -2
  223. package/esm/browser/notices/session-notices.d.ts +69 -0
  224. package/esm/browser/notices/session-notices.js +92 -0
  225. package/esm/browser/offline/device-values.js +12 -3
  226. package/esm/browser/offline/offline-reads.js +3 -1
  227. package/esm/browser/settings/navigation.d.ts +3 -2
  228. package/esm/browser/settings/navigation.js +4 -3
  229. package/esm/browser/settings/settings-protocol.d.ts +15 -0
  230. package/esm/browser/settings/settings-protocol.js +18 -4
  231. package/esm/browser/state/state-protocol.d.ts +8 -1
  232. package/esm/browser/state/state.d.ts +2 -0
  233. package/esm/browser/state/state.js +21 -2
  234. package/esm/browser/style/base.d.ts +1 -1
  235. package/esm/browser/style/base.js +27 -1
  236. package/esm/browser/style/conversation.d.ts +1 -1
  237. package/esm/browser/style/conversation.js +45 -5
  238. package/esm/browser/style/device.js +15 -1
  239. package/esm/browser/style/layout.d.ts +1 -1
  240. package/esm/browser/style/layout.js +192 -56
  241. package/esm/browser/style/pages.d.ts +1 -1
  242. package/esm/browser/style/pages.js +39 -1
  243. package/esm/browser/style/phone.d.ts +1 -1
  244. package/esm/browser/style/phone.js +15 -0
  245. package/esm/browser/style/shell.d.ts +1 -1
  246. package/esm/browser/style/shell.js +32 -6
  247. package/esm/browser/style/surfaces.d.ts +1 -1
  248. package/esm/browser/style/surfaces.js +21 -2
  249. package/esm/browser/style/tints.d.ts +27 -0
  250. package/esm/browser/style/tints.js +56 -0
  251. package/esm/browser/style.js +13 -1
  252. package/esm/browser/util/composer.d.ts +6 -0
  253. package/esm/browser/util/composer.js +16 -0
  254. package/esm/browser/util/desktop.d.ts +19 -1
  255. package/esm/browser/util/desktop.js +15 -0
  256. package/esm/browser/util/frame.d.ts +2 -0
  257. package/esm/browser/util/frame.js +2 -0
  258. package/esm/browser/util/link.d.ts +18 -0
  259. package/esm/browser/util/link.js +66 -1
  260. package/esm/browser/util/markdown.d.ts +4 -1
  261. package/esm/browser/util/markdown.js +1 -1
  262. package/esm/browser/util/message.d.ts +5 -0
  263. package/esm/browser/util/message.js +30 -0
  264. package/esm/browser/util/process.d.ts +57 -3
  265. package/esm/browser/util/process.js +123 -11
  266. package/esm/browser/util/progress.d.ts +19 -1
  267. package/esm/browser/util/progress.js +57 -4
  268. package/esm/browser/util/quote.d.ts +19 -0
  269. package/esm/browser/util/quote.js +58 -0
  270. package/esm/browser/util/tool.d.ts +19 -2
  271. package/esm/browser/util/tool.js +70 -2
  272. package/esm/browser/util/voice.d.ts +47 -7
  273. package/esm/browser/util/voice.js +269 -27
  274. package/esm/browser/workbench-calls.d.ts +6 -4
  275. package/esm/browser/workbench-calls.js +15 -10
  276. package/esm/browser/workbench-protocol.d.ts +31 -2
  277. package/esm/browser/workbench-util.d.ts +15 -4
  278. package/esm/browser/workbench-util.js +28 -5
  279. package/esm/browser/workbench.d.ts +33 -1
  280. package/esm/browser/workbench.js +142 -14
  281. package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
  282. package/lib/browser/assistant/assistant-chat-list.js +13 -0
  283. package/lib/browser/assistant/assistant-extension.js +5 -0
  284. package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
  285. package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
  286. package/lib/browser/assistant/assistant-task-book.js +23 -4
  287. package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
  288. package/lib/browser/assistant/assistant-task-source.js +5 -10
  289. package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
  290. package/lib/browser/assistant/assistant-task-util.js +59 -12
  291. package/lib/browser/assistant/assistant-view.js +46 -22
  292. package/lib/browser/assistant/assistant.d.ts +18 -4
  293. package/lib/browser/assistant/assistant.js +52 -17
  294. package/lib/browser/avatar/dino-face.js +1 -2
  295. package/lib/browser/chat/chat-protocol.d.ts +5 -0
  296. package/lib/browser/chat/chat-stores.d.ts +8 -5
  297. package/lib/browser/chat/chat-stores.js +17 -9
  298. package/lib/browser/chat/chat-view.js +22 -14
  299. package/lib/browser/chat/chat.d.ts +16 -8
  300. package/lib/browser/chat/chat.js +86 -51
  301. package/lib/browser/components/account-menu.d.ts +0 -2
  302. package/lib/browser/components/account-menu.js +2 -29
  303. package/lib/browser/components/agent-settings-view.d.ts +3 -2
  304. package/lib/browser/components/agent-settings-view.js +2 -1
  305. package/lib/browser/components/app-nav.d.ts +5 -2
  306. package/lib/browser/components/app-nav.js +18 -5
  307. package/lib/browser/components/app-shell-hooks.js +5 -3
  308. package/lib/browser/components/app-view.js +80 -16
  309. package/lib/browser/components/busy.d.ts +26 -0
  310. package/lib/browser/components/busy.js +91 -0
  311. package/lib/browser/components/chat-icon.d.ts +30 -0
  312. package/lib/browser/components/chat-icon.js +117 -0
  313. package/lib/browser/components/chat-list.d.ts +73 -6
  314. package/lib/browser/components/chat-list.js +295 -59
  315. package/lib/browser/components/chat-seen.d.ts +54 -0
  316. package/lib/browser/components/chat-seen.js +104 -0
  317. package/lib/browser/components/composer-box.d.ts +15 -4
  318. package/lib/browser/components/composer-box.js +136 -74
  319. package/lib/browser/components/composer.d.ts +9 -6
  320. package/lib/browser/components/composer.js +31 -3
  321. package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
  322. package/lib/browser/components/conversation-scroll-hooks.js +135 -0
  323. package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
  324. package/lib/browser/components/conversation-scroll-util.js +60 -0
  325. package/lib/browser/components/conversation-scroll.d.ts +52 -31
  326. package/lib/browser/components/conversation-scroll.js +171 -164
  327. package/lib/browser/components/custom-host.d.ts +4 -0
  328. package/lib/browser/components/custom-host.js +50 -0
  329. package/lib/browser/components/directory-commands.d.ts +7 -0
  330. package/lib/browser/components/directory-commands.js +70 -0
  331. package/lib/browser/components/discover-view.d.ts +11 -4
  332. package/lib/browser/components/discover-view.js +19 -10
  333. package/lib/browser/components/dismiss.d.ts +4 -0
  334. package/lib/browser/components/dismiss.js +65 -0
  335. package/lib/browser/components/earlier-messages.d.ts +34 -3
  336. package/lib/browser/components/earlier-messages.js +44 -9
  337. package/lib/browser/components/editor-area.d.ts +6 -22
  338. package/lib/browser/components/editor-area.js +11 -98
  339. package/lib/browser/components/face.d.ts +25 -0
  340. package/lib/browser/components/face.js +79 -0
  341. package/lib/browser/components/fold-text.d.ts +21 -0
  342. package/lib/browser/components/fold-text.js +103 -0
  343. package/lib/browser/components/folder-picker.d.ts +1 -1
  344. package/lib/browser/components/folder-picker.js +1 -1
  345. package/lib/browser/components/full-screen.d.ts +10 -0
  346. package/lib/browser/components/full-screen.js +62 -0
  347. package/lib/browser/components/grow-box.d.ts +10 -0
  348. package/lib/browser/components/grow-box.js +86 -0
  349. package/lib/browser/components/hold-to-talk.d.ts +23 -0
  350. package/lib/browser/components/hold-to-talk.js +65 -0
  351. package/lib/browser/components/host-view.d.ts +1 -1
  352. package/lib/browser/components/icon.d.ts +3 -1
  353. package/lib/browser/components/icon.js +4 -3
  354. package/lib/browser/components/image-viewer.d.ts +10 -2
  355. package/lib/browser/components/image-viewer.js +47 -10
  356. package/lib/browser/components/launcher-search-util.d.ts +4 -3
  357. package/lib/browser/components/launcher-search-util.js +12 -4
  358. package/lib/browser/components/lightbox.d.ts +5 -2
  359. package/lib/browser/components/lightbox.js +4 -3
  360. package/lib/browser/components/list-rows.d.ts +9 -1
  361. package/lib/browser/components/list-rows.js +18 -3
  362. package/lib/browser/components/markdown.js +36 -4
  363. package/lib/browser/components/media.js +73 -7
  364. package/lib/browser/components/message-actions.js +3 -0
  365. package/lib/browser/components/message-footer.d.ts +8 -0
  366. package/lib/browser/components/message-footer.js +20 -2
  367. package/lib/browser/components/message-list.d.ts +60 -7
  368. package/lib/browser/components/message-list.js +206 -55
  369. package/lib/browser/components/message-menu.js +6 -1
  370. package/lib/browser/components/model-picker.js +1 -0
  371. package/lib/browser/components/nav-places.d.ts +21 -2
  372. package/lib/browser/components/nav-places.js +22 -4
  373. package/lib/browser/components/notice-center.js +34 -0
  374. package/lib/browser/components/notice-face.d.ts +11 -0
  375. package/lib/browser/components/notice-face.js +64 -0
  376. package/lib/browser/components/phone-shell.d.ts +23 -1
  377. package/lib/browser/components/phone-shell.js +99 -10
  378. package/lib/browser/components/picture.d.ts +8 -1
  379. package/lib/browser/components/picture.js +13 -1
  380. package/lib/browser/components/plus-menu.d.ts +24 -0
  381. package/lib/browser/components/plus-menu.js +126 -0
  382. package/lib/browser/components/recent-shot.d.ts +16 -0
  383. package/lib/browser/components/recent-shot.js +210 -0
  384. package/lib/browser/components/relay-view.js +10 -3
  385. package/lib/browser/components/run-status.d.ts +1 -1
  386. package/lib/browser/components/run-status.js +17 -29
  387. package/lib/browser/components/said-text.d.ts +7 -0
  388. package/lib/browser/components/said-text.js +50 -0
  389. package/lib/browser/components/scan-screen.d.ts +11 -0
  390. package/lib/browser/components/scan-screen.js +266 -0
  391. package/lib/browser/components/search-page.js +10 -6
  392. package/lib/browser/components/session-settings.d.ts +2 -3
  393. package/lib/browser/components/session-settings.js +1 -0
  394. package/lib/browser/components/session-view.d.ts +3 -1
  395. package/lib/browser/components/session-view.js +32 -18
  396. package/lib/browser/components/settings-choices.d.ts +1 -0
  397. package/lib/browser/components/settings-choices.js +2 -1
  398. package/lib/browser/components/settings-controls.d.ts +5 -3
  399. package/lib/browser/components/settings-controls.js +10 -1
  400. package/lib/browser/components/settings-parts.js +43 -12
  401. package/lib/browser/components/stop-times.d.ts +48 -0
  402. package/lib/browser/components/stop-times.js +85 -0
  403. package/lib/browser/components/tool-view.js +7 -2
  404. package/lib/browser/components/unseen-drop.d.ts +40 -0
  405. package/lib/browser/components/unseen-drop.js +256 -0
  406. package/lib/browser/components/use-seen-chats.d.ts +9 -0
  407. package/lib/browser/components/use-seen-chats.js +85 -0
  408. package/lib/browser/components/use-stop-times.d.ts +4 -0
  409. package/lib/browser/components/use-stop-times.js +53 -0
  410. package/lib/browser/components/voice-button.d.ts +7 -1
  411. package/lib/browser/components/voice-button.js +16 -2
  412. package/lib/browser/components/voice-picker.d.ts +7 -0
  413. package/lib/browser/components/voice-picker.js +89 -0
  414. package/lib/browser/components/voice-talk.d.ts +11 -3
  415. package/lib/browser/components/voice-talk.js +25 -4
  416. package/lib/browser/components/web-composer.d.ts +4 -2
  417. package/lib/browser/components/web-composer.js +7 -3
  418. package/lib/browser/components/workbench-tabs.d.ts +42 -0
  419. package/lib/browser/components/workbench-tabs.js +232 -0
  420. package/lib/browser/components/workbench-toggle.d.ts +0 -13
  421. package/lib/browser/components/workbench-toggle.js +1 -29
  422. package/lib/browser/device/code-scan.d.ts +56 -0
  423. package/lib/browser/device/code-scan.js +141 -0
  424. package/lib/browser/device/code-vision.d.ts +52 -0
  425. package/lib/browser/device/code-vision.js +103 -0
  426. package/lib/browser/device/hold.js +4 -6
  427. package/lib/browser/device/long-press.d.ts +10 -0
  428. package/lib/browser/device/long-press.js +28 -12
  429. package/lib/browser/device/own-gestures.d.ts +26 -0
  430. package/lib/browser/device/own-gestures.js +42 -0
  431. package/lib/browser/device/photo-picker.d.ts +15 -0
  432. package/lib/browser/device/photo-picker.js +51 -0
  433. package/lib/browser/device/pull-down.js +3 -2
  434. package/lib/browser/device/recent-shots.d.ts +46 -0
  435. package/lib/browser/device/recent-shots.js +145 -0
  436. package/lib/browser/device/row-swipe.d.ts +2 -0
  437. package/lib/browser/device/row-swipe.js +14 -3
  438. package/lib/browser/device/sheet-swipe.d.ts +1 -1
  439. package/lib/browser/device/sheet-swipe.js +25 -4
  440. package/lib/browser/extension/extension-view.d.ts +10 -0
  441. package/lib/browser/extension/extension-view.js +7 -1
  442. package/lib/browser/extension/icons.js +15 -1
  443. package/lib/browser/extension/web-api-components.d.ts +288 -0
  444. package/lib/browser/extension/web-api-components.js +3 -0
  445. package/lib/browser/extension/web-api-contributions.d.ts +395 -0
  446. package/lib/browser/extension/web-api-contributions.js +3 -0
  447. package/lib/browser/extension/web-api-desktop.d.ts +56 -0
  448. package/lib/browser/extension/web-api-desktop.js +3 -0
  449. package/lib/browser/extension/web-api-terminal.d.ts +72 -0
  450. package/lib/browser/extension/web-api-terminal.js +3 -0
  451. package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
  452. package/lib/browser/extension/web-editor-tabs.js +141 -0
  453. package/lib/browser/extension/web-extension-api.d.ts +186 -565
  454. package/lib/browser/extension/web-extension-context.d.ts +79 -0
  455. package/lib/browser/extension/web-extension-context.js +391 -0
  456. package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
  457. package/lib/browser/extension/web-extension-protocol.js +35 -1
  458. package/lib/browser/extension/web-extension-run.d.ts +55 -0
  459. package/lib/browser/extension/web-extension-run.js +123 -0
  460. package/lib/browser/extension/web-extensions.d.ts +29 -69
  461. package/lib/browser/extension/web-extensions.js +117 -545
  462. package/lib/browser/extension/web-home.d.ts +20 -0
  463. package/lib/browser/extension/web-home.js +76 -0
  464. package/lib/browser/extension/web-pages.d.ts +13 -3
  465. package/lib/browser/extension/web-pages.js +23 -3
  466. package/lib/browser/extension/web-session-notices.d.ts +37 -0
  467. package/lib/browser/extension/web-session-notices.js +177 -0
  468. package/lib/browser/extension/web-sharing.d.ts +2 -0
  469. package/lib/browser/extension/web-sharing.js +4 -0
  470. package/lib/browser/game/game-host.d.ts +28 -0
  471. package/lib/browser/game/game-host.js +163 -0
  472. package/lib/browser/game/game-loader.d.ts +11 -0
  473. package/lib/browser/game/game-loader.js +31 -0
  474. package/lib/browser/game/game-protocol.d.ts +50 -0
  475. package/lib/browser/game/game-protocol.js +3 -0
  476. package/lib/browser/game/game-runner.d.ts +28 -0
  477. package/lib/browser/game/game-runner.js +64 -0
  478. package/lib/browser/game/game-util.d.ts +30 -0
  479. package/lib/browser/game/game-util.js +183 -0
  480. package/lib/browser/game/game-view.d.ts +13 -0
  481. package/lib/browser/game/game-view.js +68 -0
  482. package/lib/browser/game/game3d-protocol.d.ts +52 -0
  483. package/lib/browser/game/game3d-protocol.js +3 -0
  484. package/lib/browser/game/game3d-runner.d.ts +28 -0
  485. package/lib/browser/game/game3d-runner.js +153 -0
  486. package/lib/browser/hooks.d.ts +5 -1
  487. package/lib/browser/hooks.js +14 -2
  488. package/lib/browser/i18n/locales.d.ts +92 -2
  489. package/lib/browser/i18n/messages.d.ts +91 -1
  490. package/lib/browser/i18n/messages.js +187 -7
  491. package/lib/browser/index.d.ts +9 -0
  492. package/lib/browser/index.js +9 -0
  493. package/lib/browser/links/links-protocol.d.ts +7 -0
  494. package/lib/browser/links/links.d.ts +24 -7
  495. package/lib/browser/links/links.js +64 -11
  496. package/lib/browser/markdown/code-renderers.d.ts +5 -0
  497. package/lib/browser/markdown/code-renderers.js +40 -0
  498. package/lib/browser/notices/notices-protocol.d.ts +17 -0
  499. package/lib/browser/notices/notices.d.ts +1 -1
  500. package/lib/browser/notices/notices.js +6 -2
  501. package/lib/browser/notices/session-notices.d.ts +70 -0
  502. package/lib/browser/notices/session-notices.js +96 -0
  503. package/lib/browser/offline/device-values.js +12 -3
  504. package/lib/browser/offline/offline-reads.js +3 -1
  505. package/lib/browser/settings/navigation.d.ts +3 -2
  506. package/lib/browser/settings/navigation.js +4 -3
  507. package/lib/browser/settings/settings-protocol.d.ts +15 -0
  508. package/lib/browser/settings/settings-protocol.js +19 -5
  509. package/lib/browser/state/state-protocol.d.ts +8 -1
  510. package/lib/browser/state/state.d.ts +2 -0
  511. package/lib/browser/state/state.js +21 -2
  512. package/lib/browser/style/base.d.ts +1 -1
  513. package/lib/browser/style/base.js +27 -1
  514. package/lib/browser/style/conversation.d.ts +1 -1
  515. package/lib/browser/style/conversation.js +45 -5
  516. package/lib/browser/style/device.js +15 -1
  517. package/lib/browser/style/layout.d.ts +1 -1
  518. package/lib/browser/style/layout.js +192 -56
  519. package/lib/browser/style/pages.d.ts +1 -1
  520. package/lib/browser/style/pages.js +39 -1
  521. package/lib/browser/style/phone.d.ts +1 -1
  522. package/lib/browser/style/phone.js +15 -0
  523. package/lib/browser/style/shell.d.ts +1 -1
  524. package/lib/browser/style/shell.js +32 -6
  525. package/lib/browser/style/surfaces.d.ts +1 -1
  526. package/lib/browser/style/surfaces.js +21 -2
  527. package/lib/browser/style/tints.d.ts +28 -0
  528. package/lib/browser/style/tints.js +59 -0
  529. package/lib/browser/style.js +13 -1
  530. package/lib/browser/util/composer.d.ts +6 -0
  531. package/lib/browser/util/composer.js +16 -0
  532. package/lib/browser/util/desktop.d.ts +19 -1
  533. package/lib/browser/util/desktop.js +15 -0
  534. package/lib/browser/util/frame.d.ts +2 -0
  535. package/lib/browser/util/frame.js +2 -0
  536. package/lib/browser/util/link.d.ts +18 -0
  537. package/lib/browser/util/link.js +66 -1
  538. package/lib/browser/util/markdown.d.ts +4 -1
  539. package/lib/browser/util/markdown.js +1 -1
  540. package/lib/browser/util/message.d.ts +5 -0
  541. package/lib/browser/util/message.js +30 -0
  542. package/lib/browser/util/process.d.ts +57 -3
  543. package/lib/browser/util/process.js +125 -12
  544. package/lib/browser/util/progress.d.ts +19 -1
  545. package/lib/browser/util/progress.js +57 -4
  546. package/lib/browser/util/quote.d.ts +20 -0
  547. package/lib/browser/util/quote.js +61 -0
  548. package/lib/browser/util/tool.d.ts +19 -2
  549. package/lib/browser/util/tool.js +70 -2
  550. package/lib/browser/util/voice.d.ts +47 -7
  551. package/lib/browser/util/voice.js +269 -27
  552. package/lib/browser/workbench-calls.d.ts +6 -4
  553. package/lib/browser/workbench-calls.js +15 -10
  554. package/lib/browser/workbench-protocol.d.ts +31 -2
  555. package/lib/browser/workbench-util.d.ts +15 -4
  556. package/lib/browser/workbench-util.js +28 -5
  557. package/lib/browser/workbench.d.ts +33 -1
  558. package/lib/browser/workbench.js +140 -12
  559. package/package.json +11 -8
@@ -0,0 +1,137 @@
1
+ import { message } from '../i18n/messages.js';
2
+ import { ShareLinkUtil } from '../util/share-link.js';
3
+ import { pageHost, WorkbenchError, WorkbenchUtil } from '../workbench-util.js';
4
+ import { CodeVision } from './code-vision.js';
5
+ import { ScanError, Scanner } from './scanner.js';
6
+ /** Whether the scan screen of the page is open: ScanHost (components/scan-screen.tsx) draws it, CodeScan opens it. */
7
+ export var ScanScreen;
8
+ (function (ScanScreen) {
9
+ let open = false;
10
+ const listeners = new Set();
11
+ const set = (value) => {
12
+ open = value;
13
+ for (const listener of listeners) {
14
+ listener();
15
+ }
16
+ };
17
+ ScanScreen.isOpen = () => open;
18
+ ScanScreen.show = () => set(true);
19
+ ScanScreen.hide = () => set(false);
20
+ function subscribe(listener) {
21
+ listeners.add(listener);
22
+ return () => listeners.delete(listener);
23
+ }
24
+ ScanScreen.subscribe = subscribe;
25
+ })(ScanScreen || (ScanScreen = {}));
26
+ const WEB = /^https?:\/\/\S+$/i;
27
+ export var CodeScanUtil;
28
+ (function (CodeScanUtil) {
29
+ /** Pure, for the tests. A plain URL of a page is a page, not an extension of Git: only a link of Ta names one. */
30
+ function read(text) {
31
+ const trimmed = text.trim();
32
+ if ('pairing' in WorkbenchUtil.credential(trimmed)) {
33
+ return { kind: 'pairing' };
34
+ }
35
+ const source = ShareLinkUtil.sourceOf(trimmed);
36
+ if (source && (source !== trimmed || !WEB.test(trimmed) || ShareLinkUtil.relayed(trimmed))) {
37
+ return { kind: 'extension' };
38
+ }
39
+ if (WEB.test(trimmed)) {
40
+ try {
41
+ return { kind: 'web', url: new URL(trimmed).href };
42
+ }
43
+ catch (_a) {
44
+ // Not a URL after all: text.
45
+ }
46
+ }
47
+ return { kind: 'text', text: trimmed };
48
+ }
49
+ CodeScanUtil.read = read;
50
+ })(CodeScanUtil || (CodeScanUtil = {}));
51
+ /**
52
+ * Scan, as WeChat's: the scan screen of the page where the app reads codes (CodeVision), else the scanner of the
53
+ * app's plugin (an app built before); then what the code carries opens. A computer is connected to and
54
+ * switched to once the user said so, an extension opens as its link does (asking first), a page of the web
55
+ * after the question of every link going out of Ta, other text shows to copy.
56
+ */
57
+ export class CodeScan {
58
+ constructor(host) {
59
+ this.host = host;
60
+ }
61
+ /** Only the Ta app has a camera to scan with. */
62
+ static available() {
63
+ return CodeVision.available() || Scanner.available();
64
+ }
65
+ async scan() {
66
+ if (CodeVision.available()) {
67
+ ScanScreen.show();
68
+ return;
69
+ }
70
+ let text;
71
+ try {
72
+ text = await Scanner.scan(this.say('ta.scan.instructions'), this.say('ta.cancel'));
73
+ }
74
+ catch (failure) {
75
+ const denied = failure instanceof ScanError && failure.reason === 'denied';
76
+ this.host.notices.notify(this.say(denied ? 'ta.hosts.cameraDenied' : 'ta.scan.failed'), { level: 'error' });
77
+ return;
78
+ }
79
+ if (text) {
80
+ await this.open(text);
81
+ }
82
+ }
83
+ /** What a code scanned carries. */
84
+ async open(text) {
85
+ const code = CodeScanUtil.read(text);
86
+ switch (code.kind) {
87
+ case 'pairing':
88
+ return this.pair(text.trim());
89
+ case 'extension':
90
+ await this.host.extensions.openShared(text);
91
+ return;
92
+ case 'web':
93
+ return this.host.links.open({ type: 'url', url: code.url }, { external: true });
94
+ case 'text':
95
+ return this.show(code.text);
96
+ }
97
+ }
98
+ async pair(link) {
99
+ const { workbench, notices } = this.host;
100
+ const id = WorkbenchUtil.serverOf(WorkbenchUtil.credential(link), pageHost());
101
+ if (id === workbench.state.host && workbench.state.status !== 'signed-out') {
102
+ notices.notify(this.say('ta.scan.sameHost'));
103
+ return;
104
+ }
105
+ const yes = await notices.confirm({
106
+ title: this.say('ta.scan.pairTitle'),
107
+ message: this.say('ta.scan.pairMessage'),
108
+ confirmLabel: this.say('ta.signin.connect'),
109
+ });
110
+ if (!yes) {
111
+ return;
112
+ }
113
+ try {
114
+ await workbench.signIn(link);
115
+ }
116
+ catch (failure) {
117
+ const refused = failure instanceof WorkbenchError && failure.reason === 'refused';
118
+ notices.notify(this.say(refused ? 'ta.hosts.refused' : 'ta.hosts.unreachable'), { level: 'error' });
119
+ }
120
+ }
121
+ async show(text) {
122
+ const { notices } = this.host;
123
+ if (await notices.confirm({ title: this.say('ta.scan.result'), message: text, confirmLabel: this.say('ta.copy') })) {
124
+ try {
125
+ await navigator.clipboard.writeText(text);
126
+ notices.notify(this.say('ta.copied'), { level: 'success' });
127
+ }
128
+ catch (_a) {
129
+ notices.notify(this.say('ta.scan.copyFailed'), { level: 'error' });
130
+ }
131
+ }
132
+ }
133
+ say(id) {
134
+ return message(this.host.settings.state.language, id);
135
+ }
136
+ }
137
+ //# sourceMappingURL=code-scan.js.map
@@ -0,0 +1,51 @@
1
+ /** A code found in a picture: its text, and where it is, as fractions of the picture (0 to 1 from its top left). */
2
+ export interface FoundCode {
3
+ text: string;
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /** Where a picture of `width` by `height` is drawn to cover a box of `boxWidth` by `boxHeight` (`object-fit: cover`). */
10
+ export interface CoverPlace {
11
+ scale: number;
12
+ left: number;
13
+ top: number;
14
+ }
15
+ /**
16
+ * Codes read from pictures by the Ta app (Apple's Vision, which reads a QR code from any angle and in poor light),
17
+ * for the camera of the scan screen and the pictures of the album: no decoder bundled in the page. Pure helpers
18
+ * besides, for the tests.
19
+ */
20
+ export declare namespace CodeVision {
21
+ /** The window event the Ta app answers with. */
22
+ const EVENT = "ta-vision";
23
+ /** The app reads codes and the page has a camera: the scan screen of the page. */
24
+ function available(): boolean;
25
+ /** The codes of a picture (a data URL of a JPEG); none where the app cannot read them. */
26
+ function detect(image: string): Promise<FoundCode[]>;
27
+ /** What the app answered, only codes with text and a place inside the picture. */
28
+ function codesOf(codes: unknown): FoundCode[];
29
+ function cover(width: number, height: number, boxWidth: number, boxHeight: number): CoverPlace;
30
+ /**
31
+ * The middle of a code on the screen, the picture (`width` by `height`) covering a box of `boxWidth` by
32
+ * `boxHeight`, `mirrored` as the front camera shows; where the green dot goes, as in WeChat.
33
+ */
34
+ function centre(code: FoundCode, width: number, height: number, boxWidth: number, boxHeight: number, mirrored?: boolean): {
35
+ x: number;
36
+ y: number;
37
+ };
38
+ /** The size of a picture whose longer side is at most `longest`, its shape kept. */
39
+ function fit(width: number, height: number, longest: number): {
40
+ width: number;
41
+ height: number;
42
+ };
43
+ /** A JPEG of what `source` shows (a frame of the camera, a picture), its longer side at most `longest`. */
44
+ function jpeg(source: CanvasImageSource, width: number, height: number, longest: number, quality: number): string;
45
+ /** A data URL as an image of a message: its base64 and its type. */
46
+ function image(dataUrl: string): {
47
+ type: 'image';
48
+ data: string;
49
+ mimeType: string;
50
+ };
51
+ }
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Codes read from pictures by the Ta app (Apple's Vision, which reads a QR code from any angle and in poor light),
3
+ * for the camera of the scan screen and the pictures of the album: no decoder bundled in the page. Pure helpers
4
+ * besides, for the tests.
5
+ */
6
+ export var CodeVision;
7
+ (function (CodeVision) {
8
+ /** The window event the Ta app answers with. */
9
+ CodeVision.EVENT = 'ta-vision';
10
+ /** A picture the app has not answered in this long has no code (an app that went to the background). */
11
+ const WAIT_MS = 5000;
12
+ let next = 0;
13
+ function native() {
14
+ var _a, _b;
15
+ return (_b = (_a = globalThis.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taVision;
16
+ }
17
+ /** The app reads codes and the page has a camera: the scan screen of the page. */
18
+ function available() {
19
+ var _a;
20
+ return native() !== undefined && typeof navigator !== 'undefined' && !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia);
21
+ }
22
+ CodeVision.available = available;
23
+ /** The codes of a picture (a data URL of a JPEG); none where the app cannot read them. */
24
+ function detect(image) {
25
+ const vision = native();
26
+ if (!vision) {
27
+ return Promise.resolve([]);
28
+ }
29
+ const id = `v${++next}`;
30
+ return new Promise(resolve => {
31
+ const done = (codes) => {
32
+ clearTimeout(timer);
33
+ globalThis.removeEventListener(CodeVision.EVENT, onEvent);
34
+ resolve(codes);
35
+ };
36
+ const onEvent = (event) => {
37
+ const detail = event.detail;
38
+ if ((detail === null || detail === void 0 ? void 0 : detail.id) === id) {
39
+ done(codesOf(detail.codes));
40
+ }
41
+ };
42
+ const timer = setTimeout(() => done([]), WAIT_MS);
43
+ globalThis.addEventListener(CodeVision.EVENT, onEvent);
44
+ vision.postMessage({ id, image });
45
+ });
46
+ }
47
+ CodeVision.detect = detect;
48
+ /** What the app answered, only codes with text and a place inside the picture. */
49
+ function codesOf(codes) {
50
+ if (!Array.isArray(codes)) {
51
+ return [];
52
+ }
53
+ return codes.filter((code) => typeof (code === null || code === void 0 ? void 0 : code.text) === 'string' &&
54
+ code.text.length > 0 &&
55
+ [code.x, code.y, code.width, code.height].every(value => typeof value === 'number' && Number.isFinite(value)));
56
+ }
57
+ CodeVision.codesOf = codesOf;
58
+ function cover(width, height, boxWidth, boxHeight) {
59
+ const scale = Math.max(boxWidth / width, boxHeight / height);
60
+ return { scale, left: (boxWidth - width * scale) / 2, top: (boxHeight - height * scale) / 2 };
61
+ }
62
+ CodeVision.cover = cover;
63
+ /**
64
+ * The middle of a code on the screen, the picture (`width` by `height`) covering a box of `boxWidth` by
65
+ * `boxHeight`, `mirrored` as the front camera shows; where the green dot goes, as in WeChat.
66
+ */
67
+ function centre(code, width, height, boxWidth, boxHeight, mirrored = false) {
68
+ const place = cover(width, height, boxWidth, boxHeight);
69
+ const x = code.x + code.width / 2;
70
+ return { x: place.left + (mirrored ? 1 - x : x) * width * place.scale, y: place.top + (code.y + code.height / 2) * height * place.scale };
71
+ }
72
+ CodeVision.centre = centre;
73
+ /** The size of a picture whose longer side is at most `longest`, its shape kept. */
74
+ function fit(width, height, longest) {
75
+ const scale = Math.min(1, longest / Math.max(width, height, 1));
76
+ return { width: Math.max(1, Math.round(width * scale)), height: Math.max(1, Math.round(height * scale)) };
77
+ }
78
+ CodeVision.fit = fit;
79
+ /** A JPEG of what `source` shows (a frame of the camera, a picture), its longer side at most `longest`. */
80
+ function jpeg(source, width, height, longest, quality) {
81
+ var _a;
82
+ const size = fit(width, height, longest);
83
+ const canvas = document.createElement('canvas');
84
+ canvas.width = size.width;
85
+ canvas.height = size.height;
86
+ (_a = canvas.getContext('2d')) === null || _a === void 0 ? void 0 : _a.drawImage(source, 0, 0, size.width, size.height);
87
+ return canvas.toDataURL('image/jpeg', quality);
88
+ }
89
+ CodeVision.jpeg = jpeg;
90
+ /** A data URL as an image of a message: its base64 and its type. */
91
+ function image(dataUrl) {
92
+ var _a;
93
+ var _b;
94
+ const comma = dataUrl.indexOf(',');
95
+ const mimeType = (_b = (_a = /^data:([^;,]+)/.exec(dataUrl)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : 'image/jpeg';
96
+ return { type: 'image', data: dataUrl.slice(comma + 1), mimeType };
97
+ }
98
+ CodeVision.image = image;
99
+ })(CodeVision || (CodeVision = {}));
100
+ //# sourceMappingURL=code-vision.js.map
@@ -36,6 +36,7 @@ export function useHeld() {
36
36
  current.current = undefined;
37
37
  clearTimeout(press.timer);
38
38
  press.off();
39
+ LongPressUtil.release(document);
39
40
  if (!press.held || how === 'none') {
40
41
  return;
41
42
  }
@@ -60,23 +61,21 @@ export function useHeld() {
60
61
  };
61
62
  // Held, the finger drags nothing: no scroll, which would take it from the hold (pointercancel).
62
63
  const onTouchMove = (touch) => press.held && touch.cancelable && touch.preventDefault();
63
- const onSelect = (select) => press.held && select.preventDefault();
64
64
  const press = {
65
65
  hold,
66
66
  held: false,
67
67
  timer: setTimeout(() => {
68
- var _a, _b;
68
+ var _a;
69
69
  press.held = true;
70
- (_a = document.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
70
+ LongPressUtil.take(document);
71
71
  hold.start();
72
- (_b = hold.move) === null || _b === void 0 ? void 0 : _b.call(hold, from.x, from.y);
72
+ (_a = hold.move) === null || _a === void 0 ? void 0 : _a.call(hold, from.x, from.y);
73
73
  }, LongPressUtil.PRESS_MS),
74
74
  off: () => {
75
75
  document.removeEventListener('pointerup', onUp);
76
76
  document.removeEventListener('pointercancel', onCancel);
77
77
  document.removeEventListener('pointermove', onMove);
78
78
  document.removeEventListener('touchmove', onTouchMove);
79
- document.removeEventListener('selectstart', onSelect, true);
80
79
  },
81
80
  };
82
81
  current.current = press;
@@ -84,7 +83,6 @@ export function useHeld() {
84
83
  document.addEventListener('pointercancel', onCancel);
85
84
  document.addEventListener('pointermove', onMove);
86
85
  document.addEventListener('touchmove', onTouchMove, { passive: false });
87
- document.addEventListener('selectstart', onSelect, true);
88
86
  },
89
87
  // The long press of a finger (the system's, or startLongPress's) is the hold's: no menu. Taken, it is
90
88
  // also what gives the light tap of the haptic engine in the app. A right click is the browser's.
@@ -20,6 +20,16 @@ export declare namespace LongPressUtil {
20
20
  x: number;
21
21
  y: number;
22
22
  }): boolean;
23
+ /**
24
+ * Set on the root while a press is the page's (a menu took it, a hold holds it): nothing on the page is
25
+ * selectable then (style/device.ts). iOS selects the word under a held finger some 200ms after the menu
26
+ * opened, firing no `selectstart`, and asks the styles of that moment: a selection cleared or a
27
+ * `selectstart` stopped does not keep it away, `user-select` does.
28
+ */
29
+ const TAKEN = "data-long-press";
30
+ function take(doc: Document): void;
31
+ /** The finger let go: the page is selectable again, and what the system selected meanwhile is let go too. */
32
+ function release(doc: Document): void;
23
33
  /** Where a held finger is the system's: it moves the caret, selects, and pastes there. Mark more with `data-native-press`. */
24
34
  function native(target: Element | null): boolean;
25
35
  }
@@ -1,3 +1,4 @@
1
+ import { OwnGestures } from './own-gestures.js';
1
2
  /** What a long press that opened a menu pressed, while the finger is still down: it may slide onto an entry (ContextMenuUtil.attach). */
2
3
  let holding;
3
4
  /**
@@ -22,6 +23,28 @@ export var LongPressUtil;
22
23
  return Math.hypot(to.x - from.x, to.y - from.y) > LongPressUtil.MOVE_PX;
23
24
  }
24
25
  LongPressUtil.moved = moved;
26
+ /**
27
+ * Set on the root while a press is the page's (a menu took it, a hold holds it): nothing on the page is
28
+ * selectable then (style/device.ts). iOS selects the word under a held finger some 200ms after the menu
29
+ * opened, firing no `selectstart`, and asks the styles of that moment: a selection cleared or a
30
+ * `selectstart` stopped does not keep it away, `user-select` does.
31
+ */
32
+ LongPressUtil.TAKEN = 'data-long-press';
33
+ function take(doc) {
34
+ var _a;
35
+ doc.documentElement.setAttribute(LongPressUtil.TAKEN, '');
36
+ (_a = doc.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
37
+ }
38
+ LongPressUtil.take = take;
39
+ /** The finger let go: the page is selectable again, and what the system selected meanwhile is let go too. */
40
+ function release(doc) {
41
+ var _a;
42
+ if (doc.documentElement.hasAttribute(LongPressUtil.TAKEN)) {
43
+ doc.documentElement.removeAttribute(LongPressUtil.TAKEN);
44
+ (_a = doc.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
45
+ }
46
+ }
47
+ LongPressUtil.release = release;
25
48
  /** Where a held finger is the system's: it moves the caret, selects, and pastes there. Mark more with `data-native-press`. */
26
49
  function native(target) {
27
50
  return !!(target === null || target === void 0 ? void 0 : target.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .monaco-editor, [data-native-press]'));
@@ -42,17 +65,11 @@ export function startLongPress(doc, native) {
42
65
  /** The press under way opened a menu: what the system does with it after is not wanted. */
43
66
  let taken = false;
44
67
  const end = () => {
45
- var _a;
46
68
  cancel();
47
69
  holding = undefined;
48
70
  if (taken) {
49
71
  taken = false;
50
- (_a = doc.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
51
- }
52
- };
53
- const onSelectStart = (event) => {
54
- if (taken) {
55
- event.preventDefault();
72
+ LongPressUtil.release(doc);
56
73
  }
57
74
  };
58
75
  const cancel = () => {
@@ -62,7 +79,6 @@ export function startLongPress(doc, native) {
62
79
  }
63
80
  };
64
81
  const fire = () => {
65
- var _a;
66
82
  const current = press;
67
83
  press = undefined;
68
84
  if (!(current === null || current === void 0 ? void 0 : current.target.isConnected)) {
@@ -77,7 +93,7 @@ export function startLongPress(doc, native) {
77
93
  guardUntil = Date.now() + LongPressUtil.CLICK_GUARD_MS;
78
94
  // The system selects the word under a held finger a moment later: not when a menu took the press.
79
95
  taken = true;
80
- (_a = doc.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
96
+ LongPressUtil.take(doc);
81
97
  native === null || native === void 0 ? void 0 : native('Haptics', 'impact', { style: 'LIGHT' }).catch(() => undefined);
82
98
  }
83
99
  else {
@@ -91,7 +107,8 @@ export function startLongPress(doc, native) {
91
107
  holding = undefined;
92
108
  const touch = event.touches[0];
93
109
  const target = event.target instanceof Element ? event.target : null;
94
- if (event.touches.length !== 1 || !touch || !target || LongPressUtil.native(target)) {
110
+ // A game holds a finger for itself (OwnGestures): no menu.
111
+ if (event.touches.length !== 1 || !touch || !target || LongPressUtil.native(target) || OwnGestures.within(target)) {
95
112
  return;
96
113
  }
97
114
  press = { x: touch.clientX, y: touch.clientY, target, timer: setTimeout(fire, LongPressUtil.PRESS_MS) };
@@ -128,17 +145,16 @@ export function startLongPress(doc, native) {
128
145
  doc.addEventListener('touchmove', onMove, { passive: true });
129
146
  doc.addEventListener('touchend', end, { passive: true });
130
147
  doc.addEventListener('touchcancel', end, { passive: true });
131
- doc.addEventListener('selectstart', onSelectStart, true);
132
148
  doc.addEventListener('scroll', cancel, { passive: true, capture: true });
133
149
  doc.addEventListener('contextmenu', onContextMenu, true);
134
150
  doc.addEventListener('click', onClick, true);
135
151
  return () => {
136
152
  cancel();
153
+ LongPressUtil.release(doc);
137
154
  doc.removeEventListener('touchstart', onStart);
138
155
  doc.removeEventListener('touchmove', onMove);
139
156
  doc.removeEventListener('touchend', end);
140
157
  doc.removeEventListener('touchcancel', end);
141
- doc.removeEventListener('selectstart', onSelectStart, true);
142
158
  doc.removeEventListener('scroll', cancel, { capture: true });
143
159
  doc.removeEventListener('contextmenu', onContextMenu, true);
144
160
  doc.removeEventListener('click', onClick, true);
@@ -0,0 +1,25 @@
1
+ import type { SheetSwipe } from './sheet-swipe.js';
2
+ /**
3
+ * An element that takes the touches that start on it (a game, a canvas to draw on, a joystick of a web
4
+ * extension): the shell lets it have them. `ui.Game` and `ui.Game3D` mark theirs; web extensions mark their
5
+ * own with the attribute. In it:
6
+ *
7
+ * - a sheet of the shell (back to the list, the workbench, the board, the drawer) moves only from an edge of
8
+ * the screen, as the system's gestures of a phone keep the edges: the rest of a slide is the element's;
9
+ * - a held finger is no menu, a pull from it does not open Quick open, a row around it does not swipe;
10
+ * - with the value `whole` (`ui.FullScreen`), no sheet moves from it at all, not even from an edge.
11
+ *
12
+ * What the browser does with a touch (scroll, zoom) the element says itself with `touch-action`.
13
+ */
14
+ export declare namespace OwnGestures {
15
+ const ATTRIBUTE = "data-own-gestures";
16
+ const SELECTOR = "[data-own-gestures]";
17
+ /** The value of an element that takes even the edges: what is shown over all of the page (`ui.FullScreen`). */
18
+ const WHOLE = "whole";
19
+ /** Whether a touch on `target` starts where even the edges are not the shell's. */
20
+ function whole(target: EventTarget | null): boolean;
21
+ /** Whether a touch on `target` starts in such an element. */
22
+ function within(target: EventTarget | null): boolean;
23
+ /** The sheet as it may move from such an element: from an edge, where it moved from anywhere. */
24
+ function edgesOnly<T extends SheetSwipe>(sheet: T): T;
25
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * An element that takes the touches that start on it (a game, a canvas to draw on, a joystick of a web
3
+ * extension): the shell lets it have them. `ui.Game` and `ui.Game3D` mark theirs; web extensions mark their
4
+ * own with the attribute. In it:
5
+ *
6
+ * - a sheet of the shell (back to the list, the workbench, the board, the drawer) moves only from an edge of
7
+ * the screen, as the system's gestures of a phone keep the edges: the rest of a slide is the element's;
8
+ * - a held finger is no menu, a pull from it does not open Quick open, a row around it does not swipe;
9
+ * - with the value `whole` (`ui.FullScreen`), no sheet moves from it at all, not even from an edge.
10
+ *
11
+ * What the browser does with a touch (scroll, zoom) the element says itself with `touch-action`.
12
+ */
13
+ export var OwnGestures;
14
+ (function (OwnGestures) {
15
+ OwnGestures.ATTRIBUTE = 'data-own-gestures';
16
+ OwnGestures.SELECTOR = `[${OwnGestures.ATTRIBUTE}]`;
17
+ /** The value of an element that takes even the edges: what is shown over all of the page (`ui.FullScreen`). */
18
+ OwnGestures.WHOLE = 'whole';
19
+ /** Whether a touch on `target` starts where even the edges are not the shell's. */
20
+ function whole(target) {
21
+ const element = (target === null || target === void 0 ? void 0 : target.nodeType) === 1 ? target : null;
22
+ return !!(element === null || element === void 0 ? void 0 : element.closest(`[${OwnGestures.ATTRIBUTE}="${OwnGestures.WHOLE}"]`));
23
+ }
24
+ OwnGestures.whole = whole;
25
+ /** Whether a touch on `target` starts in such an element. */
26
+ function within(target) {
27
+ // Node.ELEMENT_NODE; an element of a frame is of another window, not `instanceof Element` here.
28
+ const element = (target === null || target === void 0 ? void 0 : target.nodeType) === 1 ? target : null;
29
+ return !!(element === null || element === void 0 ? void 0 : element.closest(OwnGestures.SELECTOR));
30
+ }
31
+ OwnGestures.within = within;
32
+ /** The sheet as it may move from such an element: from an edge, where it moved from anywhere. */
33
+ function edgesOnly(sheet) {
34
+ const edge = (from) => (from === 'anywhere' ? 'edge' : from);
35
+ return { ...sheet, opensFrom: edge(sheet.opensFrom), closesFrom: edge(sheet.closesFrom) };
36
+ }
37
+ OwnGestures.edgesOnly = edgesOnly;
38
+ })(OwnGestures || (OwnGestures = {}));
39
+ //# sourceMappingURL=own-gestures.js.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The photos of the device, picked in the library itself as WeChat's Album does: the Ta app on iOS opens it at once
3
+ * (PHPicker, which asks for no permission), where a file field shows a menu first (Photo Library, Take Photo,
4
+ * Choose File). A browser has no such picker: the message box uses its file field there.
5
+ */
6
+ export declare namespace PhotoPicker {
7
+ /** Whether the library opens at once here. */
8
+ function available(): boolean;
9
+ /**
10
+ * Up to `limit` photos, in the order picked; none when the user cancels. Not timed out: the user takes the time
11
+ * they need, and a pick started again ends the one before with none.
12
+ */
13
+ function pick(limit: number): Promise<File[]>;
14
+ }
@@ -0,0 +1,48 @@
1
+ import { RecentShots } from './recent-shots.js';
2
+ /**
3
+ * The photos of the device, picked in the library itself as WeChat's Album does: the Ta app on iOS opens it at once
4
+ * (PHPicker, which asks for no permission), where a file field shows a menu first (Photo Library, Take Photo,
5
+ * Choose File). A browser has no such picker: the message box uses its file field there.
6
+ */
7
+ export var PhotoPicker;
8
+ (function (PhotoPicker) {
9
+ let next = 0;
10
+ function native() {
11
+ var _a, _b;
12
+ return (_b = (_a = globalThis.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taShots;
13
+ }
14
+ /** Whether the library opens at once here. */
15
+ function available() {
16
+ return native() !== undefined;
17
+ }
18
+ PhotoPicker.available = available;
19
+ /**
20
+ * Up to `limit` photos, in the order picked; none when the user cancels. Not timed out: the user takes the time
21
+ * they need, and a pick started again ends the one before with none.
22
+ */
23
+ function pick(limit) {
24
+ const photos = native();
25
+ if (!photos) {
26
+ return Promise.resolve([]);
27
+ }
28
+ const id = `p${++next}`;
29
+ return new Promise(resolve => {
30
+ const onEvent = (event) => {
31
+ const detail = event.detail;
32
+ if ((detail === null || detail === void 0 ? void 0 : detail.id) !== id) {
33
+ return;
34
+ }
35
+ globalThis.removeEventListener(RecentShots.EVENT, onEvent);
36
+ const images = Array.isArray(detail.images) ? detail.images : [];
37
+ resolve(images
38
+ .filter((image) => typeof image === 'string')
39
+ .map((image, index) => RecentShots.file(image, `photo-${index + 1}`))
40
+ .filter((file) => file !== undefined));
41
+ };
42
+ globalThis.addEventListener(RecentShots.EVENT, onEvent);
43
+ photos.postMessage({ id, action: 'pick', limit: Math.max(1, limit) });
44
+ });
45
+ }
46
+ PhotoPicker.pick = pick;
47
+ })(PhotoPicker || (PhotoPicker = {}));
48
+ //# sourceMappingURL=photo-picker.js.map
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { nativePlugin } from './device.js';
3
+ import { OwnGestures } from './own-gestures.js';
3
4
  import { afterLetGo, SwipeFinger, SwipeSettle, SwipeUtil, SwipeVelocity } from './sheet-swipe.js';
4
5
  /**
5
6
  * What a finger pulls down from the top of a list, as the launcher of WeChat over its chats (ta-launcher.md):
@@ -73,9 +74,9 @@ function atEnd(target, area) {
73
74
  }
74
75
  return true;
75
76
  }
76
- /** Inputs keep their own gestures (selecting, moving the caret). */
77
+ /** Inputs keep their own gestures (selecting, moving the caret), and so does a game (OwnGestures). */
77
78
  function editable(target) {
78
- return target instanceof Element && !!target.closest('input, textarea, [contenteditable="true"], [data-native-press]');
79
+ return target instanceof Element && (!!target.closest('input, textarea, [contenteditable="true"], [data-native-press]') || OwnGestures.within(target));
79
80
  }
80
81
  /** The light tap of the app when the pull passes where it opens. */
81
82
  function tick() {
@@ -0,0 +1,45 @@
1
+ import { type DesktopShot, type DesktopShots } from '../util/desktop.js';
2
+ /** The latest screenshot of this device: when it was taken and a small picture of it. */
3
+ export type RecentShot = DesktopShot;
4
+ /**
5
+ * Where the screenshots of this device are: Ta Desktop (the screenshot folder of the system), the Ta app on iOS
6
+ * (screenshots of the photo library). A browser has none.
7
+ */
8
+ export interface RecentShotSource extends DesktopShots {
9
+ /** Asks the user for what the source reads, where the system asks (the photos of iOS); nothing where it does not. */
10
+ ask?(): void;
11
+ }
12
+ /** What is kept of the screenshots offered, in this browser: each is offered once, wherever. */
13
+ interface ShotStorage {
14
+ getItem(key: string): string | null;
15
+ setItem(key: string, value: string): void;
16
+ }
17
+ /**
18
+ * The screenshot just taken, offered once above the message box as WeChat does: tapped, it goes into the box
19
+ * with what is typed. Offered once on this device, whatever box shows it first: it is marked offered as it shows
20
+ * (`claim`), so that the next conversation opened does not offer it again; a newer one is offered anew.
21
+ */
22
+ export declare namespace RecentShots {
23
+ /** A screenshot older than this is not offered. */
24
+ const WINDOW_MS: number;
25
+ /** How long the offer stays when nothing is done with it. */
26
+ const SHOWN_MS = 8000;
27
+ /** The window event the Ta app answers with, and the one it tells of a change of the photos with. */
28
+ const EVENT = "ta-shots";
29
+ const CHANGE_EVENT = "ta-shots-change";
30
+ /** Where the screenshots offered are kept (localStorage, of the device rather than of a computer). */
31
+ const KEY = "ta-recent-shots";
32
+ /** The screenshots of this device, where Ta can read them. */
33
+ function source(scope?: object): RecentShotSource | undefined;
34
+ /** Taken in the last `WINDOW_MS` (a clock a little ahead too). */
35
+ function fresh(shot: RecentShot, now?: number): boolean;
36
+ /** Whether `id` was offered on this device. */
37
+ function wasOffered(id: string, store?: ShotStorage | undefined): boolean;
38
+ /** Marks `id` offered; `false` when it already was, by this page or another. */
39
+ function claim(id: string, store?: ShotStorage | undefined): boolean;
40
+ /** A data URL as a file the message box takes. */
41
+ function file(dataUrl: string, name?: string): File | undefined;
42
+ /** What the app answered as a screenshot, only one with all its parts. */
43
+ function shotOf(shot: unknown): RecentShot | undefined;
44
+ }
45
+ export {};