@celljs/ta-web 4.9.1 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/README.en.md +8 -7
  2. package/README.md +8 -7
  3. package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
  4. package/esm/browser/assistant/assistant-chat-list.js +20 -2
  5. package/esm/browser/assistant/assistant-extension.d.ts +8 -1
  6. package/esm/browser/assistant/assistant-extension.js +25 -0
  7. package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
  8. package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
  9. package/esm/browser/assistant/assistant-task-book.js +23 -4
  10. package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
  11. package/esm/browser/assistant/assistant-task-source.js +5 -10
  12. package/esm/browser/assistant/assistant-task-util.d.ts +14 -2
  13. package/esm/browser/assistant/assistant-task-util.js +62 -13
  14. package/esm/browser/assistant/assistant-view.js +117 -71
  15. package/esm/browser/assistant/assistant.d.ts +28 -5
  16. package/esm/browser/assistant/assistant.js +96 -22
  17. package/esm/browser/avatar/dino-face.js +1 -2
  18. package/esm/browser/chat/chat-packages.d.ts +39 -0
  19. package/esm/browser/chat/chat-packages.js +70 -0
  20. package/esm/browser/chat/chat-protocol.d.ts +28 -1
  21. package/esm/browser/chat/chat-stores.d.ts +62 -0
  22. package/esm/browser/chat/chat-stores.js +129 -0
  23. package/esm/browser/chat/chat-util.d.ts +17 -0
  24. package/esm/browser/chat/chat-util.js +61 -0
  25. package/esm/browser/chat/chat-view.js +45 -17
  26. package/esm/browser/chat/chat.d.ts +41 -41
  27. package/esm/browser/chat/chat.js +276 -190
  28. package/esm/browser/components/account-menu.d.ts +0 -2
  29. package/esm/browser/components/account-menu.js +1 -27
  30. package/esm/browser/components/agent-settings-view.d.ts +3 -2
  31. package/esm/browser/components/agent-settings-view.js +2 -1
  32. package/esm/browser/components/app-nav.d.ts +11 -5
  33. package/esm/browser/components/app-nav.js +39 -17
  34. package/esm/browser/components/app-shell-hooks.d.ts +2 -2
  35. package/esm/browser/components/app-shell-hooks.js +12 -6
  36. package/esm/browser/components/app-view.js +150 -36
  37. package/esm/browser/components/busy.d.ts +25 -0
  38. package/esm/browser/components/busy.js +52 -0
  39. package/esm/browser/components/chat-icon.d.ts +29 -0
  40. package/esm/browser/components/chat-icon.js +78 -0
  41. package/esm/browser/components/chat-list.d.ts +93 -8
  42. package/esm/browser/components/chat-list.js +411 -60
  43. package/esm/browser/components/chat-seen.d.ts +53 -0
  44. package/esm/browser/components/chat-seen.js +101 -0
  45. package/esm/browser/components/composer-box.d.ts +18 -8
  46. package/esm/browser/components/composer-box.js +199 -52
  47. package/esm/browser/components/composer.d.ts +13 -6
  48. package/esm/browser/components/composer.js +8 -5
  49. package/esm/browser/components/connection-bar.js +50 -17
  50. package/esm/browser/components/context-menu.d.ts +30 -4
  51. package/esm/browser/components/context-menu.js +199 -37
  52. package/esm/browser/components/conversation-scroll.d.ts +136 -6
  53. package/esm/browser/components/conversation-scroll.js +467 -108
  54. package/esm/browser/components/custom-host.d.ts +3 -0
  55. package/esm/browser/components/custom-host.js +14 -0
  56. package/esm/browser/components/directory-commands.d.ts +6 -0
  57. package/esm/browser/components/directory-commands.js +34 -0
  58. package/esm/browser/components/discover-view.d.ts +11 -4
  59. package/esm/browser/components/discover-view.js +20 -11
  60. package/esm/browser/components/dismiss.d.ts +3 -0
  61. package/esm/browser/components/dismiss.js +29 -0
  62. package/esm/browser/components/earlier-messages.d.ts +34 -2
  63. package/esm/browser/components/earlier-messages.js +42 -23
  64. package/esm/browser/components/editor-area.d.ts +6 -20
  65. package/esm/browser/components/editor-area.js +10 -96
  66. package/esm/browser/components/empty-pictures.d.ts +0 -2
  67. package/esm/browser/components/empty-pictures.js +0 -16
  68. package/esm/browser/components/fold-text.d.ts +20 -0
  69. package/esm/browser/components/fold-text.js +66 -0
  70. package/esm/browser/components/folder-picker.d.ts +6 -3
  71. package/esm/browser/components/folder-picker.js +27 -9
  72. package/esm/browser/components/full-screen.d.ts +9 -0
  73. package/esm/browser/components/full-screen.js +26 -0
  74. package/esm/browser/components/grow-box.d.ts +9 -0
  75. package/esm/browser/components/grow-box.js +50 -0
  76. package/esm/browser/components/held-talk.d.ts +28 -0
  77. package/esm/browser/components/held-talk.js +76 -0
  78. package/esm/browser/components/hold-to-talk.d.ts +22 -0
  79. package/esm/browser/components/hold-to-talk.js +29 -0
  80. package/esm/browser/components/host-view.d.ts +1 -1
  81. package/esm/browser/components/icon.d.ts +5 -3
  82. package/esm/browser/components/icon.js +9 -9
  83. package/esm/browser/components/image-viewer.d.ts +132 -0
  84. package/esm/browser/components/image-viewer.js +434 -0
  85. package/esm/browser/components/launcher-search-util.d.ts +4 -3
  86. package/esm/browser/components/launcher-search-util.js +12 -4
  87. package/esm/browser/components/lightbox.d.ts +14 -0
  88. package/esm/browser/components/lightbox.js +25 -0
  89. package/esm/browser/components/list-rows.d.ts +9 -1
  90. package/esm/browser/components/list-rows.js +17 -3
  91. package/esm/browser/components/markdown.d.ts +6 -2
  92. package/esm/browser/components/markdown.js +60 -14
  93. package/esm/browser/components/media.js +20 -12
  94. package/esm/browser/components/message-actions.js +2 -0
  95. package/esm/browser/components/message-footer.d.ts +22 -2
  96. package/esm/browser/components/message-footer.js +47 -13
  97. package/esm/browser/components/message-list.d.ts +78 -6
  98. package/esm/browser/components/message-list.js +281 -36
  99. package/esm/browser/components/message-menu.d.ts +3 -1
  100. package/esm/browser/components/message-menu.js +24 -4
  101. package/esm/browser/components/model-picker.js +1 -0
  102. package/esm/browser/components/nav-places.d.ts +37 -3
  103. package/esm/browser/components/nav-places.js +32 -7
  104. package/esm/browser/components/notice-center.js +34 -0
  105. package/esm/browser/components/notice-face.d.ts +10 -0
  106. package/esm/browser/components/notice-face.js +28 -0
  107. package/esm/browser/components/phone-shell.d.ts +27 -2
  108. package/esm/browser/components/phone-shell.js +98 -9
  109. package/esm/browser/components/picture.d.ts +8 -1
  110. package/esm/browser/components/picture.js +12 -1
  111. package/esm/browser/components/plus-menu.d.ts +23 -0
  112. package/esm/browser/components/plus-menu.js +90 -0
  113. package/esm/browser/components/recent-shot.d.ts +15 -0
  114. package/esm/browser/components/recent-shot.js +174 -0
  115. package/esm/browser/components/relay-view.js +10 -3
  116. package/esm/browser/components/run-status.d.ts +1 -1
  117. package/esm/browser/components/run-status.js +17 -29
  118. package/esm/browser/components/said-text.d.ts +6 -0
  119. package/esm/browser/components/said-text.js +14 -0
  120. package/esm/browser/components/scan-screen.d.ts +10 -0
  121. package/esm/browser/components/scan-screen.js +230 -0
  122. package/esm/browser/components/search-page.js +10 -6
  123. package/esm/browser/components/session-settings.d.ts +8 -3
  124. package/esm/browser/components/session-settings.js +15 -1
  125. package/esm/browser/components/session-view.js +36 -22
  126. package/esm/browser/components/settings-choices.d.ts +1 -0
  127. package/esm/browser/components/settings-choices.js +3 -2
  128. package/esm/browser/components/settings-controls.d.ts +5 -3
  129. package/esm/browser/components/settings-controls.js +10 -1
  130. package/esm/browser/components/settings-parts.d.ts +2 -2
  131. package/esm/browser/components/settings-parts.js +69 -15
  132. package/esm/browser/components/swipe-row.d.ts +2 -2
  133. package/esm/browser/components/swipe-row.js +7 -3
  134. package/esm/browser/components/tool-view.js +21 -14
  135. package/esm/browser/components/unseen-drop.d.ts +39 -0
  136. package/esm/browser/components/unseen-drop.js +219 -0
  137. package/esm/browser/components/use-seen-chats.d.ts +8 -0
  138. package/esm/browser/components/use-seen-chats.js +49 -0
  139. package/esm/browser/components/voice-button.d.ts +7 -1
  140. package/esm/browser/components/voice-button.js +15 -2
  141. package/esm/browser/components/voice-picker.d.ts +6 -0
  142. package/esm/browser/components/voice-picker.js +53 -0
  143. package/esm/browser/components/voice-talk.d.ts +51 -0
  144. package/esm/browser/components/voice-talk.js +242 -0
  145. package/esm/browser/components/web-composer.d.ts +4 -2
  146. package/esm/browser/components/web-composer.js +8 -4
  147. package/esm/browser/components/workbench-tabs.d.ts +41 -0
  148. package/esm/browser/components/workbench-tabs.js +193 -0
  149. package/esm/browser/components/workbench-toggle.d.ts +0 -13
  150. package/esm/browser/components/workbench-toggle.js +1 -28
  151. package/esm/browser/device/code-scan.d.ts +55 -0
  152. package/esm/browser/device/code-scan.js +137 -0
  153. package/esm/browser/device/code-vision.d.ts +51 -0
  154. package/esm/browser/device/code-vision.js +100 -0
  155. package/esm/browser/device/device.d.ts +3 -0
  156. package/esm/browser/device/device.js +11 -1
  157. package/esm/browser/device/hold.d.ts +42 -0
  158. package/esm/browser/device/hold.js +134 -0
  159. package/esm/browser/device/launch-screen.d.ts +1 -1
  160. package/esm/browser/device/launch-screen.js +1 -1
  161. package/esm/browser/device/long-press.d.ts +12 -0
  162. package/esm/browser/device/long-press.js +44 -13
  163. package/esm/browser/device/own-gestures.d.ts +25 -0
  164. package/esm/browser/device/own-gestures.js +39 -0
  165. package/esm/browser/device/pull-down.d.ts +4 -2
  166. package/esm/browser/device/pull-down.js +67 -78
  167. package/esm/browser/device/recent-shots.d.ts +45 -0
  168. package/esm/browser/device/recent-shots.js +142 -0
  169. package/esm/browser/device/row-swipe.d.ts +35 -10
  170. package/esm/browser/device/row-swipe.js +154 -71
  171. package/esm/browser/device/shake-undo.d.ts +16 -0
  172. package/esm/browser/device/shake-undo.js +59 -0
  173. package/esm/browser/device/sheet-swipe.d.ts +118 -18
  174. package/esm/browser/device/sheet-swipe.js +414 -108
  175. package/esm/browser/extension/extension-view.d.ts +10 -0
  176. package/esm/browser/extension/extension-view.js +6 -0
  177. package/esm/browser/extension/icons.js +15 -2
  178. package/esm/browser/extension/web-api-components.d.ts +269 -0
  179. package/esm/browser/extension/web-api-components.js +2 -0
  180. package/esm/browser/extension/web-api-contributions.d.ts +385 -0
  181. package/esm/browser/extension/web-api-contributions.js +2 -0
  182. package/esm/browser/extension/web-api-desktop.d.ts +55 -0
  183. package/esm/browser/extension/web-api-desktop.js +2 -0
  184. package/esm/browser/extension/web-api-terminal.d.ts +71 -0
  185. package/esm/browser/extension/web-api-terminal.js +2 -0
  186. package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
  187. package/esm/browser/extension/web-editor-tabs.js +137 -0
  188. package/esm/browser/extension/web-extension-api.d.ts +218 -521
  189. package/esm/browser/extension/web-extension-code.d.ts +6 -0
  190. package/esm/browser/extension/web-extension-code.js +24 -0
  191. package/esm/browser/extension/web-extension-context.d.ts +78 -0
  192. package/esm/browser/extension/web-extension-context.js +346 -0
  193. package/esm/browser/extension/web-extension-protocol.d.ts +66 -6
  194. package/esm/browser/extension/web-extension-protocol.js +41 -0
  195. package/esm/browser/extension/web-extension-run.d.ts +54 -0
  196. package/esm/browser/extension/web-extension-run.js +120 -0
  197. package/esm/browser/extension/web-extensions.d.ts +41 -68
  198. package/esm/browser/extension/web-extensions.js +188 -487
  199. package/esm/browser/extension/web-home.d.ts +19 -0
  200. package/esm/browser/extension/web-home.js +72 -0
  201. package/esm/browser/extension/web-pages.d.ts +13 -3
  202. package/esm/browser/extension/web-pages.js +23 -3
  203. package/esm/browser/extension/web-session-notices.d.ts +36 -0
  204. package/esm/browser/extension/web-session-notices.js +174 -0
  205. package/esm/browser/extension/web-sharing.d.ts +2 -0
  206. package/esm/browser/extension/web-sharing.js +4 -0
  207. package/esm/browser/files/files-protocol.d.ts +25 -0
  208. package/esm/browser/files/files-protocol.js +2 -0
  209. package/esm/browser/files/files.d.ts +35 -0
  210. package/esm/browser/files/files.js +119 -0
  211. package/esm/browser/game/game-host.d.ts +27 -0
  212. package/esm/browser/game/game-host.js +127 -0
  213. package/esm/browser/game/game-loader.d.ts +10 -0
  214. package/esm/browser/game/game-loader.js +28 -0
  215. package/esm/browser/game/game-protocol.d.ts +49 -0
  216. package/esm/browser/game/game-protocol.js +2 -0
  217. package/esm/browser/game/game-runner.d.ts +27 -0
  218. package/esm/browser/game/game-runner.js +60 -0
  219. package/esm/browser/game/game-util.d.ts +29 -0
  220. package/esm/browser/game/game-util.js +180 -0
  221. package/esm/browser/game/game-view.d.ts +12 -0
  222. package/esm/browser/game/game-view.js +31 -0
  223. package/esm/browser/game/game3d-protocol.d.ts +51 -0
  224. package/esm/browser/game/game3d-protocol.js +2 -0
  225. package/esm/browser/game/game3d-runner.d.ts +27 -0
  226. package/esm/browser/game/game3d-runner.js +149 -0
  227. package/esm/browser/hooks.d.ts +5 -1
  228. package/esm/browser/hooks.js +13 -2
  229. package/esm/browser/i18n/locales.d.ts +105 -3
  230. package/esm/browser/i18n/messages.d.ts +104 -2
  231. package/esm/browser/i18n/messages.js +215 -11
  232. package/esm/browser/index.d.ts +15 -0
  233. package/esm/browser/index.js +15 -0
  234. package/esm/browser/links/links-protocol.d.ts +5 -0
  235. package/esm/browser/links/links.d.ts +19 -7
  236. package/esm/browser/links/links.js +57 -11
  237. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  238. package/esm/browser/markdown/code-renderers.js +4 -0
  239. package/esm/browser/notices/notices-protocol.d.ts +26 -1
  240. package/esm/browser/notices/notices.d.ts +3 -1
  241. package/esm/browser/notices/notices.js +26 -12
  242. package/esm/browser/notices/session-notices.d.ts +69 -0
  243. package/esm/browser/notices/session-notices.js +92 -0
  244. package/esm/browser/offline/device-values.d.ts +55 -0
  245. package/esm/browser/offline/device-values.js +151 -0
  246. package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
  247. package/esm/browser/offline/kept-chats-protocol.js +2 -0
  248. package/esm/browser/offline/kept-chats.d.ts +47 -0
  249. package/esm/browser/offline/kept-chats.js +146 -0
  250. package/esm/browser/offline/offline-reads.d.ts +44 -0
  251. package/esm/browser/offline/offline-reads.js +109 -0
  252. package/esm/browser/settings/navigation.d.ts +3 -2
  253. package/esm/browser/settings/navigation.js +4 -3
  254. package/esm/browser/settings/settings-protocol.d.ts +17 -0
  255. package/esm/browser/settings/settings-protocol.js +20 -4
  256. package/esm/browser/state/state-protocol.d.ts +8 -1
  257. package/esm/browser/state/state.d.ts +2 -0
  258. package/esm/browser/state/state.js +21 -2
  259. package/esm/browser/style/base.d.ts +1 -1
  260. package/esm/browser/style/base.js +27 -1
  261. package/esm/browser/style/conversation.d.ts +1 -1
  262. package/esm/browser/style/conversation.js +95 -17
  263. package/esm/browser/style/device.js +42 -5
  264. package/esm/browser/style/layout.d.ts +1 -1
  265. package/esm/browser/style/layout.js +252 -67
  266. package/esm/browser/style/pages.d.ts +1 -1
  267. package/esm/browser/style/pages.js +38 -2
  268. package/esm/browser/style/phone.d.ts +1 -1
  269. package/esm/browser/style/phone.js +15 -0
  270. package/esm/browser/style/shell.d.ts +1 -1
  271. package/esm/browser/style/shell.js +76 -9
  272. package/esm/browser/style/surfaces.d.ts +1 -1
  273. package/esm/browser/style/surfaces.js +2 -2
  274. package/esm/browser/style/tints.d.ts +27 -0
  275. package/esm/browser/style/tints.js +56 -0
  276. package/esm/browser/style.js +13 -1
  277. package/esm/browser/util/composer.d.ts +6 -0
  278. package/esm/browser/util/composer.js +16 -0
  279. package/esm/browser/util/desktop.d.ts +19 -1
  280. package/esm/browser/util/desktop.js +15 -0
  281. package/esm/browser/util/frame.d.ts +5 -4
  282. package/esm/browser/util/frame.js +5 -4
  283. package/esm/browser/util/link.d.ts +18 -0
  284. package/esm/browser/util/link.js +66 -1
  285. package/esm/browser/util/markdown.d.ts +22 -2
  286. package/esm/browser/util/markdown.js +120 -6
  287. package/esm/browser/util/message.d.ts +5 -0
  288. package/esm/browser/util/message.js +30 -0
  289. package/esm/browser/util/process.d.ts +35 -2
  290. package/esm/browser/util/process.js +79 -4
  291. package/esm/browser/util/progress.d.ts +19 -1
  292. package/esm/browser/util/progress.js +57 -4
  293. package/esm/browser/util/quote.d.ts +19 -0
  294. package/esm/browser/util/quote.js +58 -0
  295. package/esm/browser/util/tool.d.ts +19 -2
  296. package/esm/browser/util/tool.js +70 -2
  297. package/esm/browser/util/voice.d.ts +49 -6
  298. package/esm/browser/util/voice.js +271 -26
  299. package/esm/browser/util/zoom.d.ts +46 -0
  300. package/esm/browser/util/zoom.js +96 -0
  301. package/esm/browser/workbench-calls.d.ts +61 -0
  302. package/esm/browser/workbench-calls.js +146 -0
  303. package/esm/browser/workbench-protocol.d.ts +36 -3
  304. package/esm/browser/workbench-util.d.ts +22 -4
  305. package/esm/browser/workbench-util.js +37 -7
  306. package/esm/browser/workbench.d.ts +47 -6
  307. package/esm/browser/workbench.js +191 -43
  308. package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
  309. package/lib/browser/assistant/assistant-chat-list.js +21 -2
  310. package/lib/browser/assistant/assistant-extension.d.ts +8 -1
  311. package/lib/browser/assistant/assistant-extension.js +25 -0
  312. package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
  313. package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
  314. package/lib/browser/assistant/assistant-task-book.js +23 -4
  315. package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
  316. package/lib/browser/assistant/assistant-task-source.js +5 -10
  317. package/lib/browser/assistant/assistant-task-util.d.ts +14 -2
  318. package/lib/browser/assistant/assistant-task-util.js +62 -13
  319. package/lib/browser/assistant/assistant-view.js +113 -67
  320. package/lib/browser/assistant/assistant.d.ts +28 -5
  321. package/lib/browser/assistant/assistant.js +96 -22
  322. package/lib/browser/avatar/dino-face.js +1 -2
  323. package/lib/browser/chat/chat-packages.d.ts +40 -0
  324. package/lib/browser/chat/chat-packages.js +74 -0
  325. package/lib/browser/chat/chat-protocol.d.ts +28 -1
  326. package/lib/browser/chat/chat-stores.d.ts +63 -0
  327. package/lib/browser/chat/chat-stores.js +133 -0
  328. package/lib/browser/chat/chat-util.d.ts +18 -0
  329. package/lib/browser/chat/chat-util.js +64 -0
  330. package/lib/browser/chat/chat-view.js +44 -16
  331. package/lib/browser/chat/chat.d.ts +41 -41
  332. package/lib/browser/chat/chat.js +277 -191
  333. package/lib/browser/components/account-menu.d.ts +0 -2
  334. package/lib/browser/components/account-menu.js +2 -29
  335. package/lib/browser/components/agent-settings-view.d.ts +3 -2
  336. package/lib/browser/components/agent-settings-view.js +2 -1
  337. package/lib/browser/components/app-nav.d.ts +11 -5
  338. package/lib/browser/components/app-nav.js +35 -13
  339. package/lib/browser/components/app-shell-hooks.d.ts +2 -2
  340. package/lib/browser/components/app-shell-hooks.js +12 -6
  341. package/lib/browser/components/app-view.js +145 -31
  342. package/lib/browser/components/busy.d.ts +26 -0
  343. package/lib/browser/components/busy.js +91 -0
  344. package/lib/browser/components/chat-icon.d.ts +30 -0
  345. package/lib/browser/components/chat-icon.js +117 -0
  346. package/lib/browser/components/chat-list.d.ts +93 -8
  347. package/lib/browser/components/chat-list.js +412 -60
  348. package/lib/browser/components/chat-seen.d.ts +54 -0
  349. package/lib/browser/components/chat-seen.js +104 -0
  350. package/lib/browser/components/composer-box.d.ts +18 -8
  351. package/lib/browser/components/composer-box.js +198 -51
  352. package/lib/browser/components/composer.d.ts +13 -6
  353. package/lib/browser/components/composer.js +7 -4
  354. package/lib/browser/components/connection-bar.js +48 -15
  355. package/lib/browser/components/context-menu.d.ts +30 -4
  356. package/lib/browser/components/context-menu.js +198 -36
  357. package/lib/browser/components/conversation-scroll.d.ts +136 -6
  358. package/lib/browser/components/conversation-scroll.js +469 -109
  359. package/lib/browser/components/custom-host.d.ts +4 -0
  360. package/lib/browser/components/custom-host.js +50 -0
  361. package/lib/browser/components/directory-commands.d.ts +7 -0
  362. package/lib/browser/components/directory-commands.js +70 -0
  363. package/lib/browser/components/discover-view.d.ts +11 -4
  364. package/lib/browser/components/discover-view.js +19 -10
  365. package/lib/browser/components/dismiss.d.ts +4 -0
  366. package/lib/browser/components/dismiss.js +65 -0
  367. package/lib/browser/components/earlier-messages.d.ts +34 -2
  368. package/lib/browser/components/earlier-messages.js +44 -24
  369. package/lib/browser/components/editor-area.d.ts +6 -20
  370. package/lib/browser/components/editor-area.js +11 -97
  371. package/lib/browser/components/empty-pictures.d.ts +0 -2
  372. package/lib/browser/components/empty-pictures.js +0 -17
  373. package/lib/browser/components/fold-text.d.ts +21 -0
  374. package/lib/browser/components/fold-text.js +103 -0
  375. package/lib/browser/components/folder-picker.d.ts +6 -3
  376. package/lib/browser/components/folder-picker.js +27 -9
  377. package/lib/browser/components/full-screen.d.ts +10 -0
  378. package/lib/browser/components/full-screen.js +62 -0
  379. package/lib/browser/components/grow-box.d.ts +10 -0
  380. package/lib/browser/components/grow-box.js +86 -0
  381. package/lib/browser/components/held-talk.d.ts +29 -0
  382. package/lib/browser/components/held-talk.js +79 -0
  383. package/lib/browser/components/hold-to-talk.d.ts +23 -0
  384. package/lib/browser/components/hold-to-talk.js +65 -0
  385. package/lib/browser/components/host-view.d.ts +1 -1
  386. package/lib/browser/components/icon.d.ts +5 -3
  387. package/lib/browser/components/icon.js +11 -9
  388. package/lib/browser/components/image-viewer.d.ts +133 -0
  389. package/lib/browser/components/image-viewer.js +472 -0
  390. package/lib/browser/components/launcher-search-util.d.ts +4 -3
  391. package/lib/browser/components/launcher-search-util.js +12 -4
  392. package/lib/browser/components/lightbox.d.ts +15 -0
  393. package/lib/browser/components/lightbox.js +61 -0
  394. package/lib/browser/components/list-rows.d.ts +9 -1
  395. package/lib/browser/components/list-rows.js +18 -3
  396. package/lib/browser/components/markdown.d.ts +6 -2
  397. package/lib/browser/components/markdown.js +60 -14
  398. package/lib/browser/components/media.js +21 -13
  399. package/lib/browser/components/message-actions.js +2 -0
  400. package/lib/browser/components/message-footer.d.ts +22 -2
  401. package/lib/browser/components/message-footer.js +49 -12
  402. package/lib/browser/components/message-list.d.ts +78 -6
  403. package/lib/browser/components/message-list.js +281 -32
  404. package/lib/browser/components/message-menu.d.ts +3 -1
  405. package/lib/browser/components/message-menu.js +23 -3
  406. package/lib/browser/components/model-picker.js +1 -0
  407. package/lib/browser/components/nav-places.d.ts +37 -3
  408. package/lib/browser/components/nav-places.js +35 -7
  409. package/lib/browser/components/notice-center.js +34 -0
  410. package/lib/browser/components/notice-face.d.ts +11 -0
  411. package/lib/browser/components/notice-face.js +64 -0
  412. package/lib/browser/components/phone-shell.d.ts +27 -2
  413. package/lib/browser/components/phone-shell.js +99 -10
  414. package/lib/browser/components/picture.d.ts +8 -1
  415. package/lib/browser/components/picture.js +13 -1
  416. package/lib/browser/components/plus-menu.d.ts +24 -0
  417. package/lib/browser/components/plus-menu.js +126 -0
  418. package/lib/browser/components/recent-shot.d.ts +16 -0
  419. package/lib/browser/components/recent-shot.js +210 -0
  420. package/lib/browser/components/relay-view.js +10 -3
  421. package/lib/browser/components/run-status.d.ts +1 -1
  422. package/lib/browser/components/run-status.js +17 -29
  423. package/lib/browser/components/said-text.d.ts +7 -0
  424. package/lib/browser/components/said-text.js +50 -0
  425. package/lib/browser/components/scan-screen.d.ts +11 -0
  426. package/lib/browser/components/scan-screen.js +266 -0
  427. package/lib/browser/components/search-page.js +10 -6
  428. package/lib/browser/components/session-settings.d.ts +8 -3
  429. package/lib/browser/components/session-settings.js +15 -1
  430. package/lib/browser/components/session-view.js +32 -18
  431. package/lib/browser/components/settings-choices.d.ts +1 -0
  432. package/lib/browser/components/settings-choices.js +2 -1
  433. package/lib/browser/components/settings-controls.d.ts +5 -3
  434. package/lib/browser/components/settings-controls.js +10 -1
  435. package/lib/browser/components/settings-parts.d.ts +2 -2
  436. package/lib/browser/components/settings-parts.js +67 -13
  437. package/lib/browser/components/swipe-row.d.ts +2 -2
  438. package/lib/browser/components/swipe-row.js +7 -3
  439. package/lib/browser/components/tool-view.js +21 -14
  440. package/lib/browser/components/unseen-drop.d.ts +40 -0
  441. package/lib/browser/components/unseen-drop.js +256 -0
  442. package/lib/browser/components/use-seen-chats.d.ts +9 -0
  443. package/lib/browser/components/use-seen-chats.js +85 -0
  444. package/lib/browser/components/voice-button.d.ts +7 -1
  445. package/lib/browser/components/voice-button.js +16 -2
  446. package/lib/browser/components/voice-picker.d.ts +7 -0
  447. package/lib/browser/components/voice-picker.js +89 -0
  448. package/lib/browser/components/voice-talk.d.ts +52 -0
  449. package/lib/browser/components/voice-talk.js +281 -0
  450. package/lib/browser/components/web-composer.d.ts +4 -2
  451. package/lib/browser/components/web-composer.js +7 -3
  452. package/lib/browser/components/workbench-tabs.d.ts +42 -0
  453. package/lib/browser/components/workbench-tabs.js +232 -0
  454. package/lib/browser/components/workbench-toggle.d.ts +0 -13
  455. package/lib/browser/components/workbench-toggle.js +1 -29
  456. package/lib/browser/device/code-scan.d.ts +56 -0
  457. package/lib/browser/device/code-scan.js +141 -0
  458. package/lib/browser/device/code-vision.d.ts +52 -0
  459. package/lib/browser/device/code-vision.js +103 -0
  460. package/lib/browser/device/device.d.ts +3 -0
  461. package/lib/browser/device/device.js +11 -1
  462. package/lib/browser/device/hold.d.ts +43 -0
  463. package/lib/browser/device/hold.js +171 -0
  464. package/lib/browser/device/launch-screen.d.ts +1 -1
  465. package/lib/browser/device/launch-screen.js +1 -1
  466. package/lib/browser/device/long-press.d.ts +12 -0
  467. package/lib/browser/device/long-press.js +44 -13
  468. package/lib/browser/device/own-gestures.d.ts +26 -0
  469. package/lib/browser/device/own-gestures.js +42 -0
  470. package/lib/browser/device/pull-down.d.ts +4 -2
  471. package/lib/browser/device/pull-down.js +66 -77
  472. package/lib/browser/device/recent-shots.d.ts +46 -0
  473. package/lib/browser/device/recent-shots.js +145 -0
  474. package/lib/browser/device/row-swipe.d.ts +35 -10
  475. package/lib/browser/device/row-swipe.js +153 -70
  476. package/lib/browser/device/shake-undo.d.ts +17 -0
  477. package/lib/browser/device/shake-undo.js +63 -0
  478. package/lib/browser/device/sheet-swipe.d.ts +118 -18
  479. package/lib/browser/device/sheet-swipe.js +418 -109
  480. package/lib/browser/extension/extension-view.d.ts +10 -0
  481. package/lib/browser/extension/extension-view.js +7 -1
  482. package/lib/browser/extension/icons.js +14 -1
  483. package/lib/browser/extension/web-api-components.d.ts +270 -0
  484. package/lib/browser/extension/web-api-components.js +3 -0
  485. package/lib/browser/extension/web-api-contributions.d.ts +386 -0
  486. package/lib/browser/extension/web-api-contributions.js +3 -0
  487. package/lib/browser/extension/web-api-desktop.d.ts +56 -0
  488. package/lib/browser/extension/web-api-desktop.js +3 -0
  489. package/lib/browser/extension/web-api-terminal.d.ts +72 -0
  490. package/lib/browser/extension/web-api-terminal.js +3 -0
  491. package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
  492. package/lib/browser/extension/web-editor-tabs.js +141 -0
  493. package/lib/browser/extension/web-extension-api.d.ts +218 -521
  494. package/lib/browser/extension/web-extension-code.d.ts +6 -0
  495. package/lib/browser/extension/web-extension-code.js +24 -0
  496. package/lib/browser/extension/web-extension-context.d.ts +79 -0
  497. package/lib/browser/extension/web-extension-context.js +383 -0
  498. package/lib/browser/extension/web-extension-protocol.d.ts +66 -6
  499. package/lib/browser/extension/web-extension-protocol.js +42 -1
  500. package/lib/browser/extension/web-extension-run.d.ts +55 -0
  501. package/lib/browser/extension/web-extension-run.js +123 -0
  502. package/lib/browser/extension/web-extensions.d.ts +41 -68
  503. package/lib/browser/extension/web-extensions.js +184 -516
  504. package/lib/browser/extension/web-home.d.ts +20 -0
  505. package/lib/browser/extension/web-home.js +76 -0
  506. package/lib/browser/extension/web-pages.d.ts +13 -3
  507. package/lib/browser/extension/web-pages.js +23 -3
  508. package/lib/browser/extension/web-session-notices.d.ts +37 -0
  509. package/lib/browser/extension/web-session-notices.js +177 -0
  510. package/lib/browser/extension/web-sharing.d.ts +2 -0
  511. package/lib/browser/extension/web-sharing.js +4 -0
  512. package/lib/browser/files/files-protocol.d.ts +26 -0
  513. package/lib/browser/files/files-protocol.js +5 -0
  514. package/lib/browser/files/files.d.ts +36 -0
  515. package/lib/browser/files/files.js +122 -0
  516. package/lib/browser/game/game-host.d.ts +28 -0
  517. package/lib/browser/game/game-host.js +163 -0
  518. package/lib/browser/game/game-loader.d.ts +11 -0
  519. package/lib/browser/game/game-loader.js +31 -0
  520. package/lib/browser/game/game-protocol.d.ts +50 -0
  521. package/lib/browser/game/game-protocol.js +3 -0
  522. package/lib/browser/game/game-runner.d.ts +28 -0
  523. package/lib/browser/game/game-runner.js +64 -0
  524. package/lib/browser/game/game-util.d.ts +30 -0
  525. package/lib/browser/game/game-util.js +183 -0
  526. package/lib/browser/game/game-view.d.ts +13 -0
  527. package/lib/browser/game/game-view.js +68 -0
  528. package/lib/browser/game/game3d-protocol.d.ts +52 -0
  529. package/lib/browser/game/game3d-protocol.js +3 -0
  530. package/lib/browser/game/game3d-runner.d.ts +28 -0
  531. package/lib/browser/game/game3d-runner.js +153 -0
  532. package/lib/browser/hooks.d.ts +5 -1
  533. package/lib/browser/hooks.js +14 -2
  534. package/lib/browser/i18n/locales.d.ts +105 -3
  535. package/lib/browser/i18n/messages.d.ts +104 -2
  536. package/lib/browser/i18n/messages.js +215 -11
  537. package/lib/browser/index.d.ts +15 -0
  538. package/lib/browser/index.js +15 -0
  539. package/lib/browser/links/links-protocol.d.ts +5 -0
  540. package/lib/browser/links/links.d.ts +19 -7
  541. package/lib/browser/links/links.js +57 -11
  542. package/lib/browser/markdown/code-renderers.d.ts +5 -0
  543. package/lib/browser/markdown/code-renderers.js +40 -0
  544. package/lib/browser/notices/notices-protocol.d.ts +26 -1
  545. package/lib/browser/notices/notices.d.ts +3 -1
  546. package/lib/browser/notices/notices.js +26 -12
  547. package/lib/browser/notices/session-notices.d.ts +70 -0
  548. package/lib/browser/notices/session-notices.js +96 -0
  549. package/lib/browser/offline/device-values.d.ts +56 -0
  550. package/lib/browser/offline/device-values.js +157 -0
  551. package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
  552. package/lib/browser/offline/kept-chats-protocol.js +5 -0
  553. package/lib/browser/offline/kept-chats.d.ts +48 -0
  554. package/lib/browser/offline/kept-chats.js +149 -0
  555. package/lib/browser/offline/offline-reads.d.ts +45 -0
  556. package/lib/browser/offline/offline-reads.js +113 -0
  557. package/lib/browser/settings/navigation.d.ts +3 -2
  558. package/lib/browser/settings/navigation.js +4 -3
  559. package/lib/browser/settings/settings-protocol.d.ts +17 -0
  560. package/lib/browser/settings/settings-protocol.js +21 -5
  561. package/lib/browser/state/state-protocol.d.ts +8 -1
  562. package/lib/browser/state/state.d.ts +2 -0
  563. package/lib/browser/state/state.js +21 -2
  564. package/lib/browser/style/base.d.ts +1 -1
  565. package/lib/browser/style/base.js +27 -1
  566. package/lib/browser/style/conversation.d.ts +1 -1
  567. package/lib/browser/style/conversation.js +95 -17
  568. package/lib/browser/style/device.js +42 -5
  569. package/lib/browser/style/layout.d.ts +1 -1
  570. package/lib/browser/style/layout.js +252 -67
  571. package/lib/browser/style/pages.d.ts +1 -1
  572. package/lib/browser/style/pages.js +38 -2
  573. package/lib/browser/style/phone.d.ts +1 -1
  574. package/lib/browser/style/phone.js +15 -0
  575. package/lib/browser/style/shell.d.ts +1 -1
  576. package/lib/browser/style/shell.js +76 -9
  577. package/lib/browser/style/surfaces.d.ts +1 -1
  578. package/lib/browser/style/surfaces.js +2 -2
  579. package/lib/browser/style/tints.d.ts +28 -0
  580. package/lib/browser/style/tints.js +59 -0
  581. package/lib/browser/style.js +13 -1
  582. package/lib/browser/util/composer.d.ts +6 -0
  583. package/lib/browser/util/composer.js +16 -0
  584. package/lib/browser/util/desktop.d.ts +19 -1
  585. package/lib/browser/util/desktop.js +15 -0
  586. package/lib/browser/util/frame.d.ts +5 -4
  587. package/lib/browser/util/frame.js +5 -4
  588. package/lib/browser/util/link.d.ts +18 -0
  589. package/lib/browser/util/link.js +66 -1
  590. package/lib/browser/util/markdown.d.ts +22 -2
  591. package/lib/browser/util/markdown.js +120 -6
  592. package/lib/browser/util/message.d.ts +5 -0
  593. package/lib/browser/util/message.js +30 -0
  594. package/lib/browser/util/process.d.ts +35 -2
  595. package/lib/browser/util/process.js +80 -5
  596. package/lib/browser/util/progress.d.ts +19 -1
  597. package/lib/browser/util/progress.js +57 -4
  598. package/lib/browser/util/quote.d.ts +20 -0
  599. package/lib/browser/util/quote.js +61 -0
  600. package/lib/browser/util/tool.d.ts +19 -2
  601. package/lib/browser/util/tool.js +70 -2
  602. package/lib/browser/util/voice.d.ts +49 -6
  603. package/lib/browser/util/voice.js +271 -26
  604. package/lib/browser/util/zoom.d.ts +47 -0
  605. package/lib/browser/util/zoom.js +99 -0
  606. package/lib/browser/workbench-calls.d.ts +62 -0
  607. package/lib/browser/workbench-calls.js +150 -0
  608. package/lib/browser/workbench-protocol.d.ts +36 -3
  609. package/lib/browser/workbench-util.d.ts +22 -4
  610. package/lib/browser/workbench-util.js +38 -8
  611. package/lib/browser/workbench.d.ts +47 -6
  612. package/lib/browser/workbench.js +189 -41
  613. package/package.json +14 -11
  614. package/public/launch.svg +46 -42
@@ -33,10 +33,14 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SwipeSettle = exports.SwipeVelocity = exports.SwipeUtil = void 0;
36
+ exports.SwipeFinger = exports.SwipeSettle = exports.SwipeVelocity = exports.SwipeSpring = exports.SwipeUtil = void 0;
37
+ exports.afterLetGo = afterLetGo;
38
+ exports.translated = translated;
37
39
  exports.useSheetSwipe = useSheetSwipe;
38
40
  const React = __importStar(require("react"));
41
+ const frame_1 = require("../util/frame");
39
42
  const device_protocol_1 = require("./device-protocol");
43
+ const own_gestures_1 = require("./own-gestures");
40
44
  /** It follows the finger and, let go, ends where it was flicked to, or the nearer side. Pure, for the tests. */
41
45
  var SwipeUtil;
42
46
  (function (SwipeUtil) {
@@ -92,24 +96,29 @@ var SwipeUtil;
92
96
  return claimed === undefined ? undefined : claimed && !sideways();
93
97
  }
94
98
  SwipeUtil.takes = takes;
95
- /** Where the sheet is, from 0 (out) to `∓width` (away on its side), when the finger moved `dx`. */
96
- function offset(sheet, dx, width, open) {
97
- const away = -outward(sheet) * width;
98
- return Math.min(Math.max(away, 0), Math.max(Math.min(away, 0), (open ? 0 : away) + dx));
99
- }
100
- SwipeUtil.offset = offset;
101
- /** Whether it ends out, let go at `speed` (pixels a millisecond, SwipeVelocity) after moving `dx`. */
102
- function settle(sheet, dx, width, open, speed) {
99
+ /** Where the sheet rests away: `∓width`, on its side; out, it rests at 0. */
100
+ function away(sheet, width) {
101
+ return -outward(sheet) * width;
102
+ }
103
+ SwipeUtil.away = away;
104
+ /** Where the sheet is, between 0 (out) and away, when the finger moved `dx` from where it took it (`from`). */
105
+ function position(sheet, from, dx, width) {
106
+ const rest = away(sheet, width);
107
+ return Math.min(Math.max(rest, 0), Math.max(Math.min(rest, 0), from + dx));
108
+ }
109
+ SwipeUtil.position = position;
110
+ /** Whether it ends out, let go at `x` at `speed` (pixels a millisecond, SwipeVelocity): the way it was flicked, or the nearer side. */
111
+ function settle(sheet, x, width, speed) {
103
112
  if (Math.abs(speed) > SwipeUtil.FLICK) {
104
113
  return speed * outward(sheet) > 0;
105
114
  }
106
- return Math.abs(offset(sheet, dx, width, open)) < width / 2;
115
+ return Math.abs(x) < width / 2;
107
116
  }
108
117
  SwipeUtil.settle = settle;
109
118
  /**
110
- * How long it slides on to where it rests, `distance` away (signed), let go at `speed`: as fast at first as
111
- * the finger was, so that a flick goes on at its speed rather than at that of the style; `longest` (the
112
- * style's) when the finger was slow, or going the other way.
119
+ * How long it slides on to where it rests, `distance` away (signed), let go at `speed`, where the curves of
120
+ * `linear()` are not (SwipeSpring): on CURVE, as fast at first as the finger was; `longest` (the style's)
121
+ * when the finger was slow, or going the other way.
113
122
  */
114
123
  function duration(distance, speed, longest) {
115
124
  const toward = Math.sign(distance) * speed;
@@ -119,12 +128,73 @@ var SwipeUtil;
119
128
  return Math.round(Math.min(longest, Math.max(SwipeUtil.SHORTEST_MS, (CURVE_START * Math.abs(distance)) / toward)));
120
129
  }
121
130
  SwipeUtil.duration = duration;
122
- /** The transitions of an element that slides on from where the finger left it, for `ms`; it hides at its end. */
123
- function transition(ms, property = 'transform') {
124
- return property === 'opacity' ? `opacity ${ms}ms ${SwipeUtil.CURVE}` : `transform ${ms}ms ${SwipeUtil.CURVE}, visibility 0s ${ms}ms`;
131
+ /** Whether the page draws the curves of `linear()` (iOS 17.2, Chrome 113 on): a spring then, else CURVE. */
132
+ SwipeUtil.springs = (() => {
133
+ try {
134
+ return typeof CSS !== 'undefined' && CSS.supports('transition-timing-function', 'linear(0, 1)');
135
+ }
136
+ catch (_a) {
137
+ return false;
138
+ }
139
+ })();
140
+ /**
141
+ * How what the finger let go at `from` at `speed` slides on to `to`, never past `bounds`: a spring that starts at
142
+ * the speed of the finger where the page draws it (SwipeSpring), else CURVE for `duration`. `longest` is how long
143
+ * its style slides it.
144
+ */
145
+ function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
146
+ if (SwipeUtil.springs) {
147
+ return SwipeSpring.motion(from, to, speed, longest, bounds);
148
+ }
149
+ return { ms: Math.abs(to - from) < SwipeSpring.REST_PX ? 0 : duration(to - from, speed, longest), easing: SwipeUtil.CURVE };
125
150
  }
126
- SwipeUtil.transition = transition;
151
+ SwipeUtil.motion = motion;
127
152
  })(SwipeUtil || (exports.SwipeUtil = SwipeUtil = {}));
153
+ /**
154
+ * What a finger lets go slides on as on a spring, as the sheets of iOS: at the speed the finger had, slowing
155
+ * down to where it rests, never past it; going the other way, it goes on a little that way first, as far as it
156
+ * may. A sheet let go near where it rests settles there quickly, one let go far away takes its time. Drawn by
157
+ * the compositor as a CSS transition, its curve a `linear()` of the spring's points. Pure, for the tests.
158
+ */
159
+ var SwipeSpring;
160
+ (function (SwipeSpring) {
161
+ /** How stiff, for what its style slides in `longest` ms: ω = STIFFNESS / longest, 95% of the way in about 0.6 × longest from rest. */
162
+ SwipeSpring.STIFFNESS = 8;
163
+ /** It rests once nearer than this, in pixels. */
164
+ SwipeSpring.REST_PX = 0.5;
165
+ /** A point of its curve this often, in milliseconds. */
166
+ const STEP_MS = 12;
167
+ /** How far it still is from where it rests, of the way, after `t` ms: critically damped, at `speed` (of the way a millisecond) at first. */
168
+ function left(t, omega, speed) {
169
+ return (1 + (omega - speed) * t) * Math.exp(-omega * t);
170
+ }
171
+ SwipeSpring.left = left;
172
+ function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
173
+ const distance = to - from;
174
+ const span = Math.abs(distance);
175
+ if (span < SwipeSpring.REST_PX) {
176
+ return { ms: 0, easing: 'linear' };
177
+ }
178
+ const toward = (Math.sign(distance) * speed) / span;
179
+ // Flicked faster than the spring goes, it is stiffer: it goes on at the finger's speed, and never past where it rests.
180
+ const omega = Math.max(SwipeSpring.STIFFNESS / longest, toward);
181
+ let ms = STEP_MS;
182
+ while (ms < longest * 2 && Math.abs(left(ms, omega, toward)) * span > SwipeSpring.REST_PX) {
183
+ ms += 4;
184
+ }
185
+ // The other way, it goes on only as far as it may.
186
+ const behind = distance > 0 ? from - bounds[0] : bounds[1] - from;
187
+ const lowest = -Math.max(0, behind) / span;
188
+ const count = Math.max(8, Math.ceil(ms / STEP_MS));
189
+ const points = [];
190
+ for (let i = 0; i <= count; i++) {
191
+ const progress = i === count ? 1 : Math.max(lowest, 1 - left((ms * i) / count, omega, toward));
192
+ points.push(String(Math.round(progress * 1000) / 1000));
193
+ }
194
+ return { ms, easing: `linear(${points.join(', ')})` };
195
+ }
196
+ SwipeSpring.motion = motion;
197
+ })(SwipeSpring || (exports.SwipeSpring = SwipeSpring = {}));
128
198
  /**
129
199
  * The speed of a finger along x, in pixels a millisecond, of its last moves (SwipeUtil.VELOCITY_MS): let go
130
200
  * after a slow drag and a flick it is the flick's, held still a moment it is none.
@@ -153,46 +223,258 @@ class SwipeVelocity {
153
223
  }
154
224
  }
155
225
  exports.SwipeVelocity = SwipeVelocity;
226
+ /** The settle that holds an element now: one at a time, so that a finger that takes it stops whatever slid it. */
227
+ const holders = new WeakMap();
156
228
  /**
157
- * What slides on, let go, at the speed of the finger (SwipeUtil.duration) rather than of its style; the
158
- * style's again once it rests, or as soon as a finger takes it again.
229
+ * The elements a finger moves, then lets go (SwipeMotion): while it moves them their styles do not slide
230
+ * them; let go, they slide on to where they rest with transitions of their own, and only once they are there,
231
+ * and the state has them there too (`ready`), they are their styles' again. So the slide starts in the frame
232
+ * the finger lets go, before the page draws what the state changed (which may take a while: a long
233
+ * conversation), and never jumps if it takes longer than the slide. A finger that takes one of them again, or
234
+ * another swipe that moves it, stops it where it is now.
159
235
  */
160
236
  class SwipeSettle {
161
237
  constructor() {
162
- this.elements = [];
238
+ this.elements = new Set();
163
239
  }
164
- run(ms, slides, fades = []) {
165
- this.clear();
166
- for (const element of slides) {
167
- this.set(element, SwipeUtil.transition(ms));
240
+ /** Whether some of its elements are still its own: moved, or sliding on. */
241
+ get busy() {
242
+ return this.elements.size > 0;
243
+ }
244
+ /** A finger moves these: each stops where it is, whatever slid it, and its style no longer slides it. */
245
+ hold(elements) {
246
+ clearTimeout(this.timer);
247
+ this.done = undefined;
248
+ for (const element of elements) {
249
+ if (element) {
250
+ this.take(element);
251
+ element.style.transition = 'none';
252
+ }
168
253
  }
169
- for (const element of fades) {
170
- this.set(element, SwipeUtil.transition(ms, 'opacity'));
254
+ }
255
+ /**
256
+ * Let go, each slides on to its target as `motion` says; once there and `ready()`, they are their styles'
257
+ * again and `done` runs.
258
+ */
259
+ run(motion, targets, ready, done) {
260
+ clearTimeout(this.timer);
261
+ const transition = motion.ms > 0 ? `transform ${motion.ms}ms ${motion.easing}, opacity ${motion.ms}ms ${motion.easing}` : 'none';
262
+ for (const { element, transform, opacity } of targets) {
263
+ if (!element) {
264
+ continue;
265
+ }
266
+ this.take(element);
267
+ element.style.transition = transition;
268
+ if (transform !== undefined) {
269
+ element.style.transform = transform;
270
+ }
271
+ if (opacity !== undefined) {
272
+ element.style.opacity = String(opacity);
273
+ }
171
274
  }
172
- this.timer = setTimeout(() => this.clear(), ms + 50);
275
+ this.done = done;
276
+ const until = Date.now() + motion.ms + SwipeSettle.READY_MS;
277
+ const check = () => {
278
+ if (ready() || Date.now() > until) {
279
+ this.finish();
280
+ }
281
+ else {
282
+ this.timer = setTimeout(check, 32);
283
+ }
284
+ };
285
+ this.timer = setTimeout(check, motion.ms + 16);
286
+ }
287
+ /** They are their styles' again at once, where those say they rest, without sliding there. */
288
+ finish() {
289
+ this.giveBack(false);
173
290
  }
174
- clear() {
291
+ /** They are their styles' again from where they are now: the styles slide them on to where they rest. */
292
+ release() {
293
+ this.giveBack(true);
294
+ }
295
+ giveBack(slide) {
175
296
  clearTimeout(this.timer);
176
- for (const element of this.elements) {
297
+ const elements = [...this.elements];
298
+ this.elements.clear();
299
+ const done = this.done;
300
+ this.done = undefined;
301
+ if (slide) {
302
+ for (const element of elements) {
303
+ this.freeze(element);
304
+ }
305
+ // Where they are now is where the styles slide them from.
306
+ if (elements.length) {
307
+ void getComputedStyle(elements[0]).transform;
308
+ }
309
+ done === null || done === void 0 ? void 0 : done();
310
+ for (const element of elements) {
311
+ SwipeSettle.clean(element, this);
312
+ element.style.removeProperty('transition');
313
+ }
314
+ return;
315
+ }
316
+ for (const element of elements) {
317
+ element.style.transition = 'none';
318
+ SwipeSettle.clean(element, this);
319
+ }
320
+ done === null || done === void 0 ? void 0 : done();
321
+ // Where they rest is drawn with no transition, then theirs are the styles' again.
322
+ if (elements.length) {
323
+ void getComputedStyle(elements[0]).transform;
324
+ }
325
+ for (const element of elements) {
177
326
  element.style.removeProperty('transition');
178
327
  }
179
- this.elements = [];
180
328
  }
181
- /** An element that both slides and fades takes both transitions. */
182
- set(element, transition) {
183
- if (!element) {
329
+ static clean(element, holder) {
330
+ if (holders.get(element) === holder) {
331
+ holders.delete(element);
332
+ }
333
+ element.style.removeProperty('transform');
334
+ element.style.removeProperty('opacity');
335
+ element.style.removeProperty('visibility');
336
+ }
337
+ /** Takes `element` from the settle that has it, stopped where it is. */
338
+ take(element) {
339
+ const holder = holders.get(element);
340
+ if (holder && holder !== this) {
341
+ holder.elements.delete(element);
342
+ }
343
+ if (holder) {
344
+ this.freeze(element);
345
+ }
346
+ holders.set(element, this);
347
+ this.elements.add(element);
348
+ }
349
+ /** What slides stops where it is now. */
350
+ freeze(element) {
351
+ const transition = element.style.transition;
352
+ if (!transition || transition === 'none') {
184
353
  return;
185
354
  }
186
- if (this.elements.includes(element)) {
187
- element.style.transition = `${element.style.transition}, ${transition}`;
355
+ const style = getComputedStyle(element);
356
+ if (element.style.transform) {
357
+ element.style.transform = style.transform;
188
358
  }
189
- else {
190
- element.style.transition = transition;
191
- this.elements.push(element);
359
+ if (element.style.opacity) {
360
+ element.style.opacity = style.opacity;
192
361
  }
362
+ element.style.transition = 'none';
193
363
  }
194
364
  }
195
365
  exports.SwipeSettle = SwipeSettle;
366
+ /** How long it waits for the state, past the slide, before giving the elements back anyway. */
367
+ SwipeSettle.READY_MS = 1000;
368
+ /**
369
+ * What a swipe let go changes in the state of the page, once the frame it was let go in is drawn and its slide
370
+ * set off (FrameUtil.painted), or after a while where frames are not drawn (a page out of sight); only if it
371
+ * changes something: the workbench is put away by the same call that brings it out.
372
+ */
373
+ function afterLetGo(open, current) {
374
+ let called = false;
375
+ const call = () => {
376
+ if (!called) {
377
+ called = true;
378
+ if (current().open !== open) {
379
+ current().setOpen(open);
380
+ }
381
+ }
382
+ };
383
+ void frame_1.FrameUtil.painted().then(call);
384
+ setTimeout(call, 100);
385
+ }
386
+ /** Where `element` is moved along `axis` now, by its transform: wherever a style or a slide has it. */
387
+ function translated(element, axis = 'x') {
388
+ const transform = getComputedStyle(element).transform;
389
+ if (!transform || transform === 'none') {
390
+ return 0;
391
+ }
392
+ const matrix = new DOMMatrixReadOnly(transform);
393
+ return axis === 'x' ? matrix.m41 : matrix.m42;
394
+ }
395
+ /**
396
+ * The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
397
+ * it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
398
+ * the finger) while the document no longer does, and on the document too, each event once. Another finger put
399
+ * down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
400
+ */
401
+ class SwipeFinger {
402
+ /** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
403
+ constructor(on, blocking = false) {
404
+ this.on = on;
405
+ this.blocking = blocking;
406
+ this.targets = [];
407
+ this.onMove = (event) => {
408
+ if (event === this.last) {
409
+ return;
410
+ }
411
+ this.last = event;
412
+ const touch = this.find(event.touches);
413
+ if (touch) {
414
+ this.on.move(event, touch);
415
+ }
416
+ };
417
+ this.onEnd = (event) => {
418
+ if (event === this.last) {
419
+ return;
420
+ }
421
+ this.last = event;
422
+ const touch = this.find(event.changedTouches);
423
+ if (touch) {
424
+ this.stop();
425
+ this.on.end(event, touch);
426
+ }
427
+ };
428
+ }
429
+ get down() {
430
+ return this.id !== undefined;
431
+ }
432
+ /**
433
+ * Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
434
+ * another, which is still down, or when several are.
435
+ */
436
+ follow(event, doc) {
437
+ if (this.down) {
438
+ if (this.find(event.touches)) {
439
+ return false;
440
+ }
441
+ const lost = event;
442
+ this.stop();
443
+ this.on.end(lost, undefined);
444
+ }
445
+ const touch = event.changedTouches[0];
446
+ if (event.touches.length !== 1 || !touch) {
447
+ return false;
448
+ }
449
+ this.id = touch.identifier;
450
+ const target = event.target;
451
+ this.targets = target && target !== doc ? [target, doc] : [doc];
452
+ for (const element of this.targets) {
453
+ element.addEventListener('touchmove', this.onMove, { passive: !this.blocking });
454
+ element.addEventListener('touchend', this.onEnd, { passive: true });
455
+ element.addEventListener('touchcancel', this.onEnd, { passive: true });
456
+ }
457
+ return true;
458
+ }
459
+ stop() {
460
+ for (const element of this.targets) {
461
+ element.removeEventListener('touchmove', this.onMove);
462
+ element.removeEventListener('touchend', this.onEnd);
463
+ element.removeEventListener('touchcancel', this.onEnd);
464
+ }
465
+ this.targets = [];
466
+ this.id = undefined;
467
+ }
468
+ find(touches) {
469
+ for (let i = 0; i < touches.length; i++) {
470
+ if (touches[i].identifier === this.id) {
471
+ return touches[i];
472
+ }
473
+ }
474
+ return undefined;
475
+ }
476
+ }
477
+ exports.SwipeFinger = SwipeFinger;
196
478
  /** How far what the sheet covers moves, of the width of the sheet (as the styles of the phone, style/phone.ts). */
197
479
  const UNDER = 0.3;
198
480
  /** How long the styles of the phone slide a sheet (style/phone.ts). */
@@ -268,8 +550,10 @@ class TouchSources {
268
550
  * Lets the finger move a sheet while `enabled`, then `setOpen` says where it ended; its style says where it
269
551
  * rests. Smooth on a long conversation: each move only sets transforms and an opacity, which the compositor
270
552
  * draws, never a style the page inherits; the page keeps scrolling on the compositor too, as the listener that
271
- * may hold a move back is only there while a touch may be the sheet's. A touch in a frame the page may read
272
- * moves it as well (TouchSources).
553
+ * may hold a move back is only there while a touch may be the sheet's. Let go, it slides on at once, as on a
554
+ * spring (SwipeSettle, SwipeSpring), and the state changes in the frames after, so that what the page draws
555
+ * for it never holds the sheet still half way. A sheet still sliding, the finger takes it where it is. A touch
556
+ * in a frame the page may read moves it as well (TouchSources).
273
557
  */
274
558
  function useSheetSwipe(options) {
275
559
  const latest = React.useRef(options);
@@ -281,53 +565,63 @@ function useSheetSwipe(options) {
281
565
  }
282
566
  const root = document.documentElement;
283
567
  let start;
568
+ let last;
284
569
  let claimed;
285
570
  let moved;
286
571
  let source;
287
572
  const velocity = new SwipeVelocity();
288
573
  const settle = new SwipeSettle();
289
- const point = (event, touch = event.touches[0]) => {
574
+ const point = (event, touch) => {
290
575
  var _a;
291
- var _b, _c, _d, _e;
576
+ var _b, _c;
292
577
  const box = (_a = source === null || source === void 0 ? void 0 : source.frame) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
293
- return { x: ((_b = touch === null || touch === void 0 ? void 0 : touch.clientX) !== null && _b !== void 0 ? _b : 0) + ((_c = box === null || box === void 0 ? void 0 : box.left) !== null && _c !== void 0 ? _c : 0), y: ((_d = touch === null || touch === void 0 ? void 0 : touch.clientY) !== null && _d !== void 0 ? _d : 0) + ((_e = box === null || box === void 0 ? void 0 : box.top) !== null && _e !== void 0 ? _e : 0), t: event.timeStamp };
578
+ return { x: touch.clientX + ((_b = box === null || box === void 0 ? void 0 : box.left) !== null && _b !== void 0 ? _b : 0), y: touch.clientY + ((_c = box === null || box === void 0 ? void 0 : box.top) !== null && _c !== void 0 ? _c : 0), t: event.timeStamp };
294
579
  };
295
580
  const find = (selector) => (selector ? document.querySelector(selector) : null);
296
- const release = (elements) => {
297
- var _a, _b, _c, _d;
298
- delete root.dataset.sheetDrag;
299
- (_a = elements === null || elements === void 0 ? void 0 : elements.sheet) === null || _a === void 0 ? void 0 : _a.style.removeProperty('transform');
300
- (_b = elements === null || elements === void 0 ? void 0 : elements.sheet) === null || _b === void 0 ? void 0 : _b.style.removeProperty('visibility');
301
- (_c = elements === null || elements === void 0 ? void 0 : elements.under) === null || _c === void 0 ? void 0 : _c.style.removeProperty('transform');
302
- (_d = elements === null || elements === void 0 ? void 0 : elements.scrim) === null || _d === void 0 ? void 0 : _d.style.removeProperty('opacity');
581
+ /** Where each is with the sheet at `x`. */
582
+ const targets = (elements, x) => {
583
+ const out = 1 - Math.abs(x) / elements.width;
584
+ return [
585
+ { element: elements.sheet, transform: `translate3d(${x}px, 0, 0)` },
586
+ { element: elements.under, transform: `translate3d(${SwipeUtil.outward(latest.current) * UNDER * elements.width * out}px, 0, 0)` },
587
+ { element: elements.scrim, opacity: out },
588
+ ];
303
589
  };
304
- const stop = () => {
305
- source === null || source === void 0 ? void 0 : source.doc.removeEventListener('touchmove', onMove);
590
+ const reset = () => {
306
591
  start = undefined;
592
+ last = undefined;
593
+ claimed = undefined;
594
+ moved = undefined;
307
595
  source = undefined;
308
596
  };
309
- const onMove = (event) => {
597
+ const onMove = (event, touch) => {
310
598
  var _a;
599
+ var _b;
311
600
  const current = latest.current;
312
601
  if (!start || claimed === false) {
313
602
  return;
314
603
  }
315
- const now = point(event);
604
+ const now = point(event, touch);
316
605
  if (claimed === undefined) {
317
606
  claimed = SwipeUtil.takes(current, start, now, current.open, () => scrollsSideways(event.target));
318
607
  if (claimed === undefined) {
319
608
  return;
320
609
  }
321
610
  if (!claimed) {
322
- stop();
611
+ finger.stop();
612
+ reset();
323
613
  return;
324
614
  }
325
- settle.clear();
326
615
  const sheet = find(current.sheet);
327
- moved = { sheet, under: find(current.under), scrim: find(current.scrim), width: (sheet === null || sheet === void 0 ? void 0 : sheet.getBoundingClientRect().width) || window.innerWidth };
328
- root.dataset.sheetDrag = (_a = current.name) !== null && _a !== void 0 ? _a : '';
329
- // Seen while it moves, whatever the styles say of where it rests.
616
+ const width = (sheet === null || sheet === void 0 ? void 0 : sheet.getBoundingClientRect().width) || window.innerWidth;
617
+ // From where it is: at rest, or still sliding.
618
+ const from = sheet ? translated(sheet) : current.open ? 0 : SwipeUtil.away(current, width);
619
+ moved = { sheet, under: find(current.under), scrim: find(current.scrim), width, from };
620
+ settle.hold([moved.sheet, moved.under, moved.scrim]);
621
+ root.dataset.sheetDrag = (_b = current.name) !== null && _b !== void 0 ? _b : '';
622
+ // Seen while it moves, and while it slides on, whatever the styles say of where they rest.
330
623
  sheet === null || sheet === void 0 ? void 0 : sheet.style.setProperty('visibility', 'visible');
624
+ (_a = moved.under) === null || _a === void 0 ? void 0 : _a.style.setProperty('visibility', 'visible');
331
625
  }
332
626
  if (!moved) {
333
627
  return;
@@ -335,71 +629,82 @@ function useSheetSwipe(options) {
335
629
  // The page does not scroll under a sheet being dragged.
336
630
  event.preventDefault();
337
631
  velocity.add(now);
338
- const x = SwipeUtil.offset(current, now.x - start.x, moved.width, current.open);
339
- const out = 1 - Math.abs(x) / moved.width;
340
- if (moved.sheet) {
341
- moved.sheet.style.transform = `translate3d(${x}px, 0, 0)`;
342
- }
343
- if (moved.under) {
344
- moved.under.style.transform = `translate3d(${SwipeUtil.outward(current) * UNDER * moved.width * out}px, 0, 0)`;
632
+ last = now;
633
+ const x = SwipeUtil.position(current, moved.from, now.x - start.x, moved.width);
634
+ for (const { element, transform, opacity } of targets(moved, x)) {
635
+ if (element && transform) {
636
+ element.style.transform = transform;
637
+ }
638
+ if (element && opacity !== undefined) {
639
+ element.style.opacity = String(opacity);
640
+ }
345
641
  }
346
- if (moved.scrim) {
347
- moved.scrim.style.opacity = String(out);
642
+ };
643
+ const onEnd = (event, touch) => {
644
+ var _a;
645
+ if (start && claimed && moved) {
646
+ const current = latest.current;
647
+ const end = touch ? point(event, touch) : (last !== null && last !== void 0 ? last : start);
648
+ if (touch) {
649
+ velocity.add(end);
650
+ }
651
+ const speed = touch ? velocity.speed : 0;
652
+ const x = SwipeUtil.position(current, moved.from, end.x - start.x, moved.width);
653
+ const out = SwipeUtil.settle(current, x, moved.width, speed);
654
+ const away = SwipeUtil.away(current, moved.width);
655
+ const rest = out ? 0 : away;
656
+ const motion = SwipeUtil.motion(x, rest, speed, (_a = current.settleMs) !== null && _a !== void 0 ? _a : SETTLE_MS, [Math.min(0, away), Math.max(0, away)]);
657
+ delete root.dataset.sheetDrag;
658
+ // It slides on now; the state follows once that is drawn, so that what it changes never holds it still.
659
+ settle.run(motion, targets(moved, rest), () => latest.current.open === out);
660
+ afterLetGo(out, () => latest.current);
348
661
  }
662
+ reset();
349
663
  };
664
+ const finger = new SwipeFinger({ move: onMove, end: onEnd }, true);
350
665
  const onStart = (event, from) => {
351
666
  var _a;
352
667
  const current = latest.current;
353
- stop();
354
- claimed = undefined;
668
+ // Another finger beside the one that moves it changes nothing; the end of that one never seen, it ends now.
669
+ if (finger.down) {
670
+ if (!finger.follow(event, from.doc)) {
671
+ // A second finger before the swipe was told from a scroll pinches (a picture): it is not the sheet's.
672
+ if (claimed === undefined && event.touches.length > 1) {
673
+ finger.stop();
674
+ reset();
675
+ }
676
+ return;
677
+ }
678
+ finger.stop();
679
+ }
680
+ reset();
355
681
  source = from;
356
- const at = point(event);
682
+ const touch = event.touches[0];
357
683
  const target = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.ELEMENT_NODE ? event.target : null;
684
+ // Over all of the page (ui.FullScreen), even the edges are its own.
685
+ if (own_gestures_1.OwnGestures.whole(target)) {
686
+ source = undefined;
687
+ return;
688
+ }
358
689
  const fromEdge = !current.open && !!current.edgeOver && !!(target === null || target === void 0 ? void 0 : target.closest(current.edgeOver));
359
- const sheet = fromEdge ? { ...current, opensFrom: 'edge' } : current;
360
- if (event.touches.length === 1 && SwipeUtil.starts(sheet, at, current.open, window.innerWidth)) {
690
+ // In a game (an element that takes its touches), the shell keeps only the edges of the screen.
691
+ const sheet = own_gestures_1.OwnGestures.within(target) ? own_gestures_1.OwnGestures.edgesOnly(current) : fromEdge ? { ...current, opensFrom: 'edge' } : current;
692
+ if (event.touches.length !== 1 || !touch) {
693
+ return;
694
+ }
695
+ const at = point(event, touch);
696
+ if (SwipeUtil.starts(sheet, at, current.open, window.innerWidth) && finger.follow(event, from.doc)) {
361
697
  start = at;
362
698
  velocity.start(at);
363
- from.doc.addEventListener('touchmove', onMove, { passive: false });
364
699
  }
365
700
  else {
366
- stop();
701
+ source = undefined;
367
702
  }
368
703
  };
369
- const onEnd = (event) => {
370
- var _a;
371
- if (start && claimed && moved) {
372
- const current = latest.current;
373
- const end = point(event, event.changedTouches[0]);
374
- const dx = end.x - start.x;
375
- velocity.add(end);
376
- const speed = velocity.speed;
377
- const out = SwipeUtil.settle(current, dx, moved.width, current.open, speed);
378
- const x = SwipeUtil.offset(current, dx, moved.width, current.open);
379
- const rest = out ? 0 : -SwipeUtil.outward(current) * moved.width;
380
- const ms = SwipeUtil.duration(rest - x, speed, (_a = current.settleMs) !== null && _a !== void 0 ? _a : SETTLE_MS);
381
- current.setOpen(out);
382
- // Released in the frame the sheet takes its place, so that it slides on from where the finger left it, at its speed.
383
- const elements = moved;
384
- requestAnimationFrame(() => {
385
- settle.run(ms, [elements.sheet, elements.under], [elements.scrim]);
386
- release(elements);
387
- });
388
- }
389
- moved = undefined;
390
- stop();
391
- claimed = undefined;
392
- };
393
704
  const sources = new TouchSources(from => {
394
705
  const begin = (event) => onStart(event, from);
395
706
  from.doc.addEventListener('touchstart', begin, { passive: true });
396
- from.doc.addEventListener('touchend', onEnd, { passive: true });
397
- from.doc.addEventListener('touchcancel', onEnd, { passive: true });
398
- return () => {
399
- from.doc.removeEventListener('touchstart', begin);
400
- from.doc.removeEventListener('touchend', onEnd);
401
- from.doc.removeEventListener('touchcancel', onEnd);
402
- };
707
+ return () => from.doc.removeEventListener('touchstart', begin);
403
708
  });
404
709
  const edge = !!latest.current.edgeOver;
405
710
  if (edge) {
@@ -410,9 +715,13 @@ function useSheetSwipe(options) {
410
715
  delete root.dataset.edgeSwipe;
411
716
  }
412
717
  sources.dispose();
413
- stop();
414
- release(moved);
415
- settle.clear();
718
+ finger.stop();
719
+ // A sheet still under the finger goes back to where it rests; one sliding on finishes its slide.
720
+ if (moved) {
721
+ delete root.dataset.sheetDrag;
722
+ settle.finish();
723
+ }
724
+ reset();
416
725
  };
417
726
  }, [enabled]);
418
727
  }