@celljs/ta-web 4.15.2 → 4.17.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 (601) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-ask-book.d.ts +35 -0
  4. package/esm/browser/assistant/assistant-ask-book.js +96 -0
  5. package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
  6. package/esm/browser/assistant/assistant-conversation.js +351 -0
  7. package/esm/browser/assistant/assistant-export.js +6 -7
  8. package/esm/browser/assistant/assistant-extension.d.ts +3 -2
  9. package/esm/browser/assistant/assistant-extension.js +57 -4
  10. package/esm/browser/assistant/assistant-protocol.d.ts +17 -2
  11. package/esm/browser/assistant/assistant-role.d.ts +22 -4
  12. package/esm/browser/assistant/assistant-role.js +29 -7
  13. package/esm/browser/assistant/assistant-state.d.ts +5 -1
  14. package/esm/browser/assistant/assistant-state.js +11 -0
  15. package/esm/browser/assistant/assistant-task-source.js +7 -1
  16. package/esm/browser/assistant/assistant-task-util.d.ts +19 -7
  17. package/esm/browser/assistant/assistant-task-util.js +73 -20
  18. package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
  19. package/esm/browser/assistant/assistant-tasks.js +0 -2
  20. package/esm/browser/assistant/assistant-thread.d.ts +22 -0
  21. package/esm/browser/assistant/assistant-thread.js +108 -0
  22. package/esm/browser/assistant/assistant-view.js +77 -126
  23. package/esm/browser/assistant/assistant.d.ts +33 -105
  24. package/esm/browser/assistant/assistant.js +103 -356
  25. package/esm/browser/assistant/chat-task-source.d.ts +58 -0
  26. package/esm/browser/assistant/chat-task-source.js +107 -0
  27. package/esm/browser/assistant/read-aloud.d.ts +34 -0
  28. package/esm/browser/assistant/read-aloud.js +98 -0
  29. package/esm/browser/assistant/realtime-voice.d.ts +77 -0
  30. package/esm/browser/assistant/realtime-voice.js +320 -0
  31. package/esm/browser/assistant/task-views.d.ts +2 -3
  32. package/esm/browser/assistant/task-views.js +20 -16
  33. package/esm/browser/assistant/voice-call-bar.d.ts +60 -0
  34. package/esm/browser/assistant/voice-call-bar.js +260 -0
  35. package/esm/browser/assistant/voice-call.d.ts +175 -0
  36. package/esm/browser/assistant/voice-call.js +366 -0
  37. package/esm/browser/chat/chat-shown.d.ts +78 -0
  38. package/esm/browser/chat/chat-shown.js +262 -0
  39. package/esm/browser/chat/chat-view.js +2 -1
  40. package/esm/browser/chat/chat.d.ts +4 -68
  41. package/esm/browser/chat/chat.js +5 -253
  42. package/esm/browser/chat/draft-model.d.ts +1 -1
  43. package/esm/browser/components/access-view.js +1 -1
  44. package/esm/browser/components/account-menu.js +1 -1
  45. package/esm/browser/components/app-nav.d.ts +3 -1
  46. package/esm/browser/components/app-nav.js +7 -7
  47. package/esm/browser/components/app-shell-hooks.d.ts +11 -2
  48. package/esm/browser/components/app-shell-hooks.js +25 -4
  49. package/esm/browser/components/app-shell-state.d.ts +80 -0
  50. package/esm/browser/components/app-shell-state.js +466 -0
  51. package/esm/browser/components/app-view.js +128 -334
  52. package/esm/browser/components/asks-badge.d.ts +6 -2
  53. package/esm/browser/components/asks-badge.js +7 -3
  54. package/esm/browser/components/auth-pictures.d.ts +2 -2
  55. package/esm/browser/components/auth-pictures.js +13 -1
  56. package/esm/browser/components/auth-view.d.ts +4 -3
  57. package/esm/browser/components/auth-view.js +54 -5
  58. package/esm/browser/components/chat-asks.d.ts +2 -0
  59. package/esm/browser/components/chat-asks.js +8 -0
  60. package/esm/browser/components/chat-busy.d.ts +32 -0
  61. package/esm/browser/components/chat-busy.js +49 -0
  62. package/esm/browser/components/chat-icon.d.ts +6 -0
  63. package/esm/browser/components/chat-icon.js +17 -1
  64. package/esm/browser/components/chat-list-row.d.ts +84 -0
  65. package/esm/browser/components/chat-list-row.js +198 -0
  66. package/esm/browser/components/chat-list-util.d.ts +166 -0
  67. package/esm/browser/components/chat-list-util.js +335 -0
  68. package/esm/browser/components/chat-list.d.ts +11 -148
  69. package/esm/browser/components/chat-list.js +280 -511
  70. package/esm/browser/components/chat-seen.d.ts +7 -0
  71. package/esm/browser/components/chat-seen.js +58 -10
  72. package/esm/browser/components/composer-addon-util.d.ts +1 -1
  73. package/esm/browser/components/composer-addons.d.ts +1 -1
  74. package/esm/browser/components/composer-attachments.d.ts +11 -0
  75. package/esm/browser/components/composer-attachments.js +27 -0
  76. package/esm/browser/components/composer-box-hooks.d.ts +9 -0
  77. package/esm/browser/components/composer-box-hooks.js +138 -0
  78. package/esm/browser/components/composer-box-protocol.d.ts +108 -0
  79. package/esm/browser/components/composer-box-protocol.js +2 -0
  80. package/esm/browser/components/composer-box.d.ts +1 -95
  81. package/esm/browser/components/composer-box.js +49 -156
  82. package/esm/browser/components/composer-target.d.ts +21 -0
  83. package/esm/browser/components/composer-target.js +43 -0
  84. package/esm/browser/components/composer.d.ts +7 -1
  85. package/esm/browser/components/composer.js +13 -9
  86. package/esm/browser/components/context-menu.js +4 -0
  87. package/esm/browser/components/conversation-find.d.ts +27 -0
  88. package/esm/browser/components/conversation-find.js +151 -0
  89. package/esm/browser/components/conversation-scroll-hooks.js +2 -1
  90. package/esm/browser/components/conversation-scroll-util.d.ts +73 -0
  91. package/esm/browser/components/conversation-scroll-util.js +80 -0
  92. package/esm/browser/components/conversation-scroll.d.ts +1 -35
  93. package/esm/browser/components/conversation-scroll.js +2 -81
  94. package/esm/browser/components/conversation-view.d.ts +8 -0
  95. package/esm/browser/components/conversation-view.js +41 -0
  96. package/esm/browser/components/discover-view.d.ts +3 -2
  97. package/esm/browser/components/discover-view.js +31 -26
  98. package/esm/browser/components/dismiss.js +2 -0
  99. package/esm/browser/components/earlier-messages.d.ts +2 -0
  100. package/esm/browser/components/earlier-messages.js +2 -1
  101. package/esm/browser/components/environment-view.js +50 -1
  102. package/esm/browser/components/folder-picker.d.ts +7 -0
  103. package/esm/browser/components/folder-picker.js +90 -20
  104. package/esm/browser/components/gallery.d.ts +1 -1
  105. package/esm/browser/components/gallery.js +57 -14
  106. package/esm/browser/components/host-tag.js +2 -2
  107. package/esm/browser/components/host-view.d.ts +1 -1
  108. package/esm/browser/components/host-view.js +3 -1
  109. package/esm/browser/components/image-menu.d.ts +11 -0
  110. package/esm/browser/components/image-menu.js +29 -0
  111. package/esm/browser/components/image-viewer.d.ts +3 -2
  112. package/esm/browser/components/image-viewer.js +29 -4
  113. package/esm/browser/components/lightbox.js +2 -0
  114. package/esm/browser/components/link-dialog.js +2 -0
  115. package/esm/browser/components/list-rows.d.ts +3 -1
  116. package/esm/browser/components/list-rows.js +2 -1
  117. package/esm/browser/components/markdown.js +5 -0
  118. package/esm/browser/components/media.d.ts +2 -0
  119. package/esm/browser/components/media.js +16 -1
  120. package/esm/browser/components/message-actions.d.ts +1 -1
  121. package/esm/browser/components/message-actions.js +9 -0
  122. package/esm/browser/components/message-footer.d.ts +3 -1
  123. package/esm/browser/components/message-footer.js +3 -2
  124. package/esm/browser/components/message-images.d.ts +41 -0
  125. package/esm/browser/components/message-images.js +120 -0
  126. package/esm/browser/components/message-list.d.ts +4 -100
  127. package/esm/browser/components/message-list.js +10 -447
  128. package/esm/browser/components/message-menu.js +4 -0
  129. package/esm/browser/components/message-steps.d.ts +21 -0
  130. package/esm/browser/components/message-steps.js +182 -0
  131. package/esm/browser/components/message-user.d.ts +54 -0
  132. package/esm/browser/components/message-user.js +169 -0
  133. package/esm/browser/components/model-picker.d.ts +1 -1
  134. package/esm/browser/components/model-picker.js +2 -0
  135. package/esm/browser/components/moved-notice.d.ts +14 -0
  136. package/esm/browser/components/moved-notice.js +60 -0
  137. package/esm/browser/components/nav-places.d.ts +12 -1
  138. package/esm/browser/components/nav-places.js +10 -2
  139. package/esm/browser/components/notice-center.js +36 -1
  140. package/esm/browser/components/notice-face.js +2 -1
  141. package/esm/browser/components/phone-shell.d.ts +4 -3
  142. package/esm/browser/components/phone-shell.js +60 -68
  143. package/esm/browser/components/plus-menu.d.ts +1 -1
  144. package/esm/browser/components/relay-services.d.ts +6 -1
  145. package/esm/browser/components/relay-services.js +109 -2
  146. package/esm/browser/components/relay-view.js +2 -0
  147. package/esm/browser/components/remote-hosts.d.ts +10 -0
  148. package/esm/browser/components/remote-hosts.js +67 -5
  149. package/esm/browser/components/remote-prompts.js +2 -0
  150. package/esm/browser/components/scan-screen.js +7 -0
  151. package/esm/browser/components/screen-navigator-util.d.ts +28 -0
  152. package/esm/browser/components/screen-navigator-util.js +33 -0
  153. package/esm/browser/components/screen-navigator.d.ts +30 -0
  154. package/esm/browser/components/screen-navigator.js +47 -0
  155. package/esm/browser/components/session-settings.d.ts +1 -1
  156. package/esm/browser/components/session-view.js +157 -7
  157. package/esm/browser/components/settings-choices.d.ts +6 -0
  158. package/esm/browser/components/settings-choices.js +8 -0
  159. package/esm/browser/components/settings-more.d.ts +7 -0
  160. package/esm/browser/components/settings-more.js +263 -0
  161. package/esm/browser/components/settings-parts.d.ts +8 -3
  162. package/esm/browser/components/settings-parts.js +31 -249
  163. package/esm/browser/components/settings-view.js +43 -15
  164. package/esm/browser/components/stop-times.js +1 -0
  165. package/esm/browser/components/surface-flyout.js +2 -0
  166. package/esm/browser/components/unseen-drop.d.ts +10 -4
  167. package/esm/browser/components/unseen-drop.js +9 -8
  168. package/esm/browser/components/use-seen-chats.js +1 -1
  169. package/esm/browser/components/voice-services.d.ts +6 -0
  170. package/esm/browser/components/voice-services.js +137 -0
  171. package/esm/browser/components/voice-talk.d.ts +23 -6
  172. package/esm/browser/components/voice-talk.js +46 -11
  173. package/esm/browser/components/web-composer.d.ts +1 -1
  174. package/esm/browser/components/web-composer.js +2 -2
  175. package/esm/browser/components/web-dialog.js +2 -0
  176. package/esm/browser/device/back-stack.d.ts +89 -11
  177. package/esm/browser/device/back-stack.js +200 -29
  178. package/esm/browser/device/device-protocol.d.ts +1 -1
  179. package/esm/browser/device/device-protocol.js +1 -1
  180. package/esm/browser/device/own-gestures.d.ts +1 -1
  181. package/esm/browser/device/pull-down.js +3 -1
  182. package/esm/browser/device/row-swipe.js +3 -1
  183. package/esm/browser/device/sheet-swipe.d.ts +1 -179
  184. package/esm/browser/device/sheet-swipe.js +3 -433
  185. package/esm/browser/device/swipe-finger.d.ts +31 -0
  186. package/esm/browser/device/swipe-finger.js +83 -0
  187. package/esm/browser/device/swipe-settle.d.ts +52 -0
  188. package/esm/browser/device/swipe-settle.js +170 -0
  189. package/esm/browser/device/swipe-util.d.ts +97 -0
  190. package/esm/browser/device/swipe-util.js +183 -0
  191. package/esm/browser/drafts/drafts-protocol.d.ts +58 -0
  192. package/esm/browser/drafts/drafts-protocol.js +75 -0
  193. package/esm/browser/drafts/drafts.d.ts +21 -0
  194. package/esm/browser/drafts/drafts.js +91 -0
  195. package/esm/browser/drafts/use-composer-draft.d.ts +20 -0
  196. package/esm/browser/drafts/use-composer-draft.js +108 -0
  197. package/esm/browser/extension/icons.js +25 -4
  198. package/esm/browser/extension/web-api-components.d.ts +13 -0
  199. package/esm/browser/extension/web-api-contributions.d.ts +125 -0
  200. package/esm/browser/extension/web-extension-api.d.ts +88 -5
  201. package/esm/browser/extension/web-extension-context.d.ts +5 -0
  202. package/esm/browser/extension/web-extension-context.js +60 -7
  203. package/esm/browser/extension/web-extension-protocol.d.ts +19 -1
  204. package/esm/browser/extension/web-extension-protocol.js +3 -0
  205. package/esm/browser/extension/web-extension-run.d.ts +5 -2
  206. package/esm/browser/extension/web-extension-run.js +13 -1
  207. package/esm/browser/extension/web-extensions-running.d.ts +93 -0
  208. package/esm/browser/extension/web-extensions-running.js +339 -0
  209. package/esm/browser/extension/web-extensions.d.ts +6 -82
  210. package/esm/browser/extension/web-extensions.js +10 -319
  211. package/esm/browser/extension/web-pages.js +1 -0
  212. package/esm/browser/extension/web-session-notices.js +6 -1
  213. package/esm/browser/extension/web-tasks.d.ts +2 -0
  214. package/esm/browser/extension/web-tasks.js +6 -0
  215. package/esm/browser/extension/web-view-util.d.ts +2 -1
  216. package/esm/browser/extension/web-view-util.js +4 -1
  217. package/esm/browser/gateway/console-parts.d.ts +4 -12
  218. package/esm/browser/gateway/console-parts.js +42 -125
  219. package/esm/browser/gateway/console-tenant.js +3 -2
  220. package/esm/browser/gateway/console-trend.d.ts +11 -0
  221. package/esm/browser/gateway/console-trend.js +115 -0
  222. package/esm/browser/gateway/console-util.js +2 -2
  223. package/esm/browser/gateway/console-view.js +49 -3
  224. package/esm/browser/i18n/locales.d.ts +170 -6
  225. package/esm/browser/i18n/messages-ja.js +171 -7
  226. package/esm/browser/i18n/messages-zh-tw.js +171 -7
  227. package/esm/browser/i18n/messages.d.ts +167 -3
  228. package/esm/browser/i18n/messages.js +342 -14
  229. package/esm/browser/index.d.ts +17 -0
  230. package/esm/browser/index.js +17 -0
  231. package/esm/browser/notices/notices-protocol.d.ts +12 -0
  232. package/esm/browser/notices/notices.js +7 -4
  233. package/esm/browser/offline/device-values.d.ts +2 -0
  234. package/esm/browser/offline/device-values.js +6 -1
  235. package/esm/browser/screen/page-answers.d.ts +42 -0
  236. package/esm/browser/screen/page-answers.js +89 -0
  237. package/esm/browser/screen/screen-protocol.d.ts +112 -0
  238. package/esm/browser/screen/screen-protocol.js +45 -0
  239. package/esm/browser/screen/screen.d.ts +20 -0
  240. package/esm/browser/screen/screen.js +122 -0
  241. package/esm/browser/screen/use-screen-part.d.ts +6 -0
  242. package/esm/browser/screen/use-screen-part.js +14 -0
  243. package/esm/browser/settings/settings-protocol.d.ts +5 -1
  244. package/esm/browser/settings/settings-protocol.js +6 -2
  245. package/esm/browser/share/shared-extensions.d.ts +29 -0
  246. package/esm/browser/share/shared-extensions.js +145 -0
  247. package/esm/browser/share/shared-link.d.ts +11 -0
  248. package/esm/browser/share/shared-link.js +38 -0
  249. package/esm/browser/share/shared-page.d.ts +5 -0
  250. package/esm/browser/share/shared-page.js +137 -0
  251. package/esm/browser/state/state-protocol.d.ts +14 -0
  252. package/esm/browser/state/state-protocol.js +18 -0
  253. package/esm/browser/state/state.d.ts +10 -2
  254. package/esm/browser/state/state.js +19 -3
  255. package/esm/browser/style/base.d.ts +1 -1
  256. package/esm/browser/style/base.js +4 -0
  257. package/esm/browser/style/chat-list.d.ts +2 -0
  258. package/esm/browser/style/chat-list.js +153 -0
  259. package/esm/browser/style/conversation-column.d.ts +2 -0
  260. package/esm/browser/style/conversation-column.js +250 -0
  261. package/esm/browser/style/conversation.d.ts +1 -1
  262. package/esm/browser/style/conversation.js +24 -8
  263. package/esm/browser/style/dialogs.d.ts +2 -0
  264. package/esm/browser/style/dialogs.js +163 -0
  265. package/esm/browser/style/layout.d.ts +2 -2
  266. package/esm/browser/style/layout.js +1 -525
  267. package/esm/browser/style/pages.d.ts +1 -1
  268. package/esm/browser/style/pages.js +10 -3
  269. package/esm/browser/style/phone.d.ts +1 -1
  270. package/esm/browser/style/phone.js +6 -2
  271. package/esm/browser/style/shared.d.ts +2 -0
  272. package/esm/browser/style/shared.js +23 -0
  273. package/esm/browser/style/shell.d.ts +1 -1
  274. package/esm/browser/style/shell.js +47 -0
  275. package/esm/browser/style/tasks.d.ts +1 -1
  276. package/esm/browser/style/tasks.js +13 -8
  277. package/esm/browser/style.js +8 -0
  278. package/esm/browser/util/gallery.d.ts +24 -2
  279. package/esm/browser/util/gallery.js +82 -2
  280. package/esm/browser/util/image-copy.d.ts +16 -0
  281. package/esm/browser/util/image-copy.js +57 -0
  282. package/esm/browser/util/message.d.ts +5 -0
  283. package/esm/browser/util/message.js +14 -0
  284. package/esm/browser/util/process.d.ts +6 -2
  285. package/esm/browser/util/process.js +6 -2
  286. package/esm/browser/util/spoken.d.ts +24 -0
  287. package/esm/browser/util/spoken.js +83 -0
  288. package/esm/browser/util/transcript.d.ts +22 -0
  289. package/esm/browser/util/transcript.js +46 -0
  290. package/esm/browser/util/voice.d.ts +5 -1
  291. package/esm/browser/util/voice.js +6 -1
  292. package/esm/browser/workbench-hosts.d.ts +36 -0
  293. package/esm/browser/workbench-hosts.js +120 -0
  294. package/esm/browser/workbench-lists.d.ts +33 -0
  295. package/esm/browser/workbench-lists.js +128 -0
  296. package/esm/browser/workbench-protocol.d.ts +14 -1
  297. package/esm/browser/workbench-services.d.ts +49 -0
  298. package/esm/browser/workbench-services.js +120 -0
  299. package/esm/browser/workbench-util.d.ts +1 -1
  300. package/esm/browser/workbench.d.ts +6 -89
  301. package/esm/browser/workbench.js +26 -336
  302. package/lib/browser/assistant/assistant-ask-book.d.ts +36 -0
  303. package/lib/browser/assistant/assistant-ask-book.js +100 -0
  304. package/lib/browser/assistant/assistant-conversation.d.ts +111 -0
  305. package/lib/browser/assistant/assistant-conversation.js +355 -0
  306. package/lib/browser/assistant/assistant-export.js +6 -7
  307. package/lib/browser/assistant/assistant-extension.d.ts +3 -2
  308. package/lib/browser/assistant/assistant-extension.js +55 -2
  309. package/lib/browser/assistant/assistant-protocol.d.ts +17 -2
  310. package/lib/browser/assistant/assistant-role.d.ts +22 -4
  311. package/lib/browser/assistant/assistant-role.js +30 -8
  312. package/lib/browser/assistant/assistant-state.d.ts +5 -1
  313. package/lib/browser/assistant/assistant-state.js +11 -0
  314. package/lib/browser/assistant/assistant-task-source.js +7 -1
  315. package/lib/browser/assistant/assistant-task-util.d.ts +19 -7
  316. package/lib/browser/assistant/assistant-task-util.js +73 -20
  317. package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
  318. package/lib/browser/assistant/assistant-tasks.js +1 -3
  319. package/lib/browser/assistant/assistant-thread.d.ts +23 -0
  320. package/lib/browser/assistant/assistant-thread.js +144 -0
  321. package/lib/browser/assistant/assistant-view.js +74 -123
  322. package/lib/browser/assistant/assistant.d.ts +33 -105
  323. package/lib/browser/assistant/assistant.js +100 -353
  324. package/lib/browser/assistant/chat-task-source.d.ts +59 -0
  325. package/lib/browser/assistant/chat-task-source.js +111 -0
  326. package/lib/browser/assistant/read-aloud.d.ts +35 -0
  327. package/lib/browser/assistant/read-aloud.js +102 -0
  328. package/lib/browser/assistant/realtime-voice.d.ts +78 -0
  329. package/lib/browser/assistant/realtime-voice.js +324 -0
  330. package/lib/browser/assistant/task-views.d.ts +2 -3
  331. package/lib/browser/assistant/task-views.js +19 -15
  332. package/lib/browser/assistant/voice-call-bar.d.ts +61 -0
  333. package/lib/browser/assistant/voice-call-bar.js +306 -0
  334. package/lib/browser/assistant/voice-call.d.ts +176 -0
  335. package/lib/browser/assistant/voice-call.js +370 -0
  336. package/lib/browser/chat/chat-shown.d.ts +79 -0
  337. package/lib/browser/chat/chat-shown.js +266 -0
  338. package/lib/browser/chat/chat-view.js +2 -1
  339. package/lib/browser/chat/chat.d.ts +4 -68
  340. package/lib/browser/chat/chat.js +3 -251
  341. package/lib/browser/chat/draft-model.d.ts +1 -1
  342. package/lib/browser/components/access-view.js +2 -2
  343. package/lib/browser/components/account-menu.js +1 -1
  344. package/lib/browser/components/app-nav.d.ts +3 -1
  345. package/lib/browser/components/app-nav.js +7 -7
  346. package/lib/browser/components/app-shell-hooks.d.ts +11 -2
  347. package/lib/browser/components/app-shell-hooks.js +26 -5
  348. package/lib/browser/components/app-shell-state.d.ts +81 -0
  349. package/lib/browser/components/app-shell-state.js +502 -0
  350. package/lib/browser/components/app-view.js +120 -326
  351. package/lib/browser/components/asks-badge.d.ts +6 -2
  352. package/lib/browser/components/asks-badge.js +7 -3
  353. package/lib/browser/components/auth-pictures.d.ts +2 -2
  354. package/lib/browser/components/auth-pictures.js +13 -1
  355. package/lib/browser/components/auth-view.d.ts +4 -3
  356. package/lib/browser/components/auth-view.js +53 -4
  357. package/lib/browser/components/chat-asks.d.ts +2 -0
  358. package/lib/browser/components/chat-asks.js +8 -0
  359. package/lib/browser/components/chat-busy.d.ts +33 -0
  360. package/lib/browser/components/chat-busy.js +52 -0
  361. package/lib/browser/components/chat-icon.d.ts +6 -0
  362. package/lib/browser/components/chat-icon.js +17 -1
  363. package/lib/browser/components/chat-list-row.d.ts +85 -0
  364. package/lib/browser/components/chat-list-row.js +236 -0
  365. package/lib/browser/components/chat-list-util.d.ts +167 -0
  366. package/lib/browser/components/chat-list-util.js +338 -0
  367. package/lib/browser/components/chat-list.d.ts +11 -148
  368. package/lib/browser/components/chat-list.js +297 -530
  369. package/lib/browser/components/chat-seen.d.ts +7 -0
  370. package/lib/browser/components/chat-seen.js +58 -10
  371. package/lib/browser/components/composer-addon-util.d.ts +1 -1
  372. package/lib/browser/components/composer-addons.d.ts +1 -1
  373. package/lib/browser/components/composer-attachments.d.ts +12 -0
  374. package/lib/browser/components/composer-attachments.js +64 -0
  375. package/lib/browser/components/composer-box-hooks.d.ts +10 -0
  376. package/lib/browser/components/composer-box-hooks.js +178 -0
  377. package/lib/browser/components/composer-box-protocol.d.ts +109 -0
  378. package/lib/browser/components/composer-box-protocol.js +3 -0
  379. package/lib/browser/components/composer-box.d.ts +1 -95
  380. package/lib/browser/components/composer-box.js +51 -159
  381. package/lib/browser/components/composer-target.d.ts +22 -0
  382. package/lib/browser/components/composer-target.js +46 -0
  383. package/lib/browser/components/composer.d.ts +7 -1
  384. package/lib/browser/components/composer.js +15 -11
  385. package/lib/browser/components/context-menu.js +4 -0
  386. package/lib/browser/components/conversation-find.d.ts +28 -0
  387. package/lib/browser/components/conversation-find.js +188 -0
  388. package/lib/browser/components/conversation-scroll-hooks.js +3 -2
  389. package/lib/browser/components/conversation-scroll-util.d.ts +73 -0
  390. package/lib/browser/components/conversation-scroll-util.js +85 -1
  391. package/lib/browser/components/conversation-scroll.d.ts +1 -35
  392. package/lib/browser/components/conversation-scroll.js +20 -100
  393. package/lib/browser/components/conversation-view.d.ts +9 -0
  394. package/lib/browser/components/conversation-view.js +77 -0
  395. package/lib/browser/components/discover-view.d.ts +3 -2
  396. package/lib/browser/components/discover-view.js +30 -25
  397. package/lib/browser/components/dismiss.js +2 -0
  398. package/lib/browser/components/earlier-messages.d.ts +2 -0
  399. package/lib/browser/components/earlier-messages.js +2 -1
  400. package/lib/browser/components/environment-view.js +49 -0
  401. package/lib/browser/components/folder-picker.d.ts +7 -0
  402. package/lib/browser/components/folder-picker.js +89 -19
  403. package/lib/browser/components/gallery.d.ts +1 -1
  404. package/lib/browser/components/gallery.js +56 -13
  405. package/lib/browser/components/host-tag.js +1 -1
  406. package/lib/browser/components/host-view.d.ts +1 -1
  407. package/lib/browser/components/host-view.js +4 -2
  408. package/lib/browser/components/image-menu.d.ts +12 -0
  409. package/lib/browser/components/image-menu.js +65 -0
  410. package/lib/browser/components/image-viewer.d.ts +3 -2
  411. package/lib/browser/components/image-viewer.js +28 -3
  412. package/lib/browser/components/lightbox.js +2 -0
  413. package/lib/browser/components/link-dialog.js +2 -0
  414. package/lib/browser/components/list-rows.d.ts +3 -1
  415. package/lib/browser/components/list-rows.js +2 -1
  416. package/lib/browser/components/markdown.js +5 -0
  417. package/lib/browser/components/media.d.ts +2 -0
  418. package/lib/browser/components/media.js +17 -1
  419. package/lib/browser/components/message-actions.d.ts +1 -1
  420. package/lib/browser/components/message-actions.js +9 -0
  421. package/lib/browser/components/message-footer.d.ts +3 -1
  422. package/lib/browser/components/message-footer.js +2 -1
  423. package/lib/browser/components/message-images.d.ts +42 -0
  424. package/lib/browser/components/message-images.js +157 -0
  425. package/lib/browser/components/message-list.d.ts +4 -100
  426. package/lib/browser/components/message-list.js +11 -455
  427. package/lib/browser/components/message-menu.js +4 -0
  428. package/lib/browser/components/message-steps.d.ts +22 -0
  429. package/lib/browser/components/message-steps.js +218 -0
  430. package/lib/browser/components/message-user.d.ts +55 -0
  431. package/lib/browser/components/message-user.js +211 -0
  432. package/lib/browser/components/model-picker.d.ts +1 -1
  433. package/lib/browser/components/model-picker.js +2 -0
  434. package/lib/browser/components/moved-notice.d.ts +15 -0
  435. package/lib/browser/components/moved-notice.js +96 -0
  436. package/lib/browser/components/nav-places.d.ts +12 -1
  437. package/lib/browser/components/nav-places.js +12 -3
  438. package/lib/browser/components/notice-center.js +35 -0
  439. package/lib/browser/components/notice-face.js +7 -6
  440. package/lib/browser/components/phone-shell.d.ts +4 -3
  441. package/lib/browser/components/phone-shell.js +59 -67
  442. package/lib/browser/components/plus-menu.d.ts +1 -1
  443. package/lib/browser/components/relay-services.d.ts +6 -1
  444. package/lib/browser/components/relay-services.js +107 -0
  445. package/lib/browser/components/relay-view.js +2 -0
  446. package/lib/browser/components/remote-hosts.d.ts +10 -0
  447. package/lib/browser/components/remote-hosts.js +67 -4
  448. package/lib/browser/components/remote-prompts.js +2 -0
  449. package/lib/browser/components/scan-screen.js +7 -0
  450. package/lib/browser/components/screen-navigator-util.d.ts +29 -0
  451. package/lib/browser/components/screen-navigator-util.js +36 -0
  452. package/lib/browser/components/screen-navigator.d.ts +31 -0
  453. package/lib/browser/components/screen-navigator.js +83 -0
  454. package/lib/browser/components/session-settings.d.ts +1 -1
  455. package/lib/browser/components/session-view.js +157 -7
  456. package/lib/browser/components/settings-choices.d.ts +7 -1
  457. package/lib/browser/components/settings-choices.js +9 -1
  458. package/lib/browser/components/settings-more.d.ts +8 -0
  459. package/lib/browser/components/settings-more.js +299 -0
  460. package/lib/browser/components/settings-parts.d.ts +8 -3
  461. package/lib/browser/components/settings-parts.js +27 -245
  462. package/lib/browser/components/settings-view.js +43 -15
  463. package/lib/browser/components/stop-times.js +1 -0
  464. package/lib/browser/components/surface-flyout.js +2 -0
  465. package/lib/browser/components/unseen-drop.d.ts +10 -4
  466. package/lib/browser/components/unseen-drop.js +9 -8
  467. package/lib/browser/components/use-seen-chats.js +2 -2
  468. package/lib/browser/components/voice-services.d.ts +7 -0
  469. package/lib/browser/components/voice-services.js +173 -0
  470. package/lib/browser/components/voice-talk.d.ts +23 -6
  471. package/lib/browser/components/voice-talk.js +45 -10
  472. package/lib/browser/components/web-composer.d.ts +1 -1
  473. package/lib/browser/components/web-composer.js +2 -2
  474. package/lib/browser/components/web-dialog.js +2 -0
  475. package/lib/browser/device/back-stack.d.ts +89 -11
  476. package/lib/browser/device/back-stack.js +205 -31
  477. package/lib/browser/device/device-protocol.d.ts +1 -1
  478. package/lib/browser/device/device-protocol.js +1 -1
  479. package/lib/browser/device/own-gestures.d.ts +1 -1
  480. package/lib/browser/device/pull-down.js +8 -6
  481. package/lib/browser/device/row-swipe.js +11 -9
  482. package/lib/browser/device/sheet-swipe.d.ts +1 -179
  483. package/lib/browser/device/sheet-swipe.js +16 -452
  484. package/lib/browser/device/swipe-finger.d.ts +32 -0
  485. package/lib/browser/device/swipe-finger.js +87 -0
  486. package/lib/browser/device/swipe-settle.d.ts +53 -0
  487. package/lib/browser/device/swipe-settle.js +176 -0
  488. package/lib/browser/device/swipe-util.d.ts +98 -0
  489. package/lib/browser/device/swipe-util.js +187 -0
  490. package/lib/browser/drafts/drafts-protocol.d.ts +59 -0
  491. package/lib/browser/drafts/drafts-protocol.js +78 -0
  492. package/lib/browser/drafts/drafts.d.ts +22 -0
  493. package/lib/browser/drafts/drafts.js +94 -0
  494. package/lib/browser/drafts/use-composer-draft.d.ts +21 -0
  495. package/lib/browser/drafts/use-composer-draft.js +146 -0
  496. package/lib/browser/extension/icons.js +24 -3
  497. package/lib/browser/extension/web-api-components.d.ts +13 -0
  498. package/lib/browser/extension/web-api-contributions.d.ts +125 -0
  499. package/lib/browser/extension/web-extension-api.d.ts +88 -5
  500. package/lib/browser/extension/web-extension-context.d.ts +5 -0
  501. package/lib/browser/extension/web-extension-context.js +62 -9
  502. package/lib/browser/extension/web-extension-protocol.d.ts +19 -1
  503. package/lib/browser/extension/web-extension-protocol.js +3 -0
  504. package/lib/browser/extension/web-extension-run.d.ts +5 -2
  505. package/lib/browser/extension/web-extension-run.js +13 -1
  506. package/lib/browser/extension/web-extensions-running.d.ts +94 -0
  507. package/lib/browser/extension/web-extensions-running.js +343 -0
  508. package/lib/browser/extension/web-extensions.d.ts +6 -82
  509. package/lib/browser/extension/web-extensions.js +7 -316
  510. package/lib/browser/extension/web-pages.js +1 -0
  511. package/lib/browser/extension/web-session-notices.js +8 -3
  512. package/lib/browser/extension/web-tasks.d.ts +2 -0
  513. package/lib/browser/extension/web-tasks.js +6 -0
  514. package/lib/browser/extension/web-view-util.d.ts +2 -1
  515. package/lib/browser/extension/web-view-util.js +4 -1
  516. package/lib/browser/gateway/console-parts.d.ts +4 -12
  517. package/lib/browser/gateway/console-parts.js +42 -126
  518. package/lib/browser/gateway/console-tenant.js +3 -2
  519. package/lib/browser/gateway/console-trend.d.ts +12 -0
  520. package/lib/browser/gateway/console-trend.js +151 -0
  521. package/lib/browser/gateway/console-util.js +2 -2
  522. package/lib/browser/gateway/console-view.js +48 -2
  523. package/lib/browser/i18n/locales.d.ts +170 -6
  524. package/lib/browser/i18n/messages-ja.js +171 -7
  525. package/lib/browser/i18n/messages-zh-tw.js +171 -7
  526. package/lib/browser/i18n/messages.d.ts +167 -3
  527. package/lib/browser/i18n/messages.js +342 -14
  528. package/lib/browser/index.d.ts +17 -0
  529. package/lib/browser/index.js +17 -0
  530. package/lib/browser/notices/notices-protocol.d.ts +12 -0
  531. package/lib/browser/notices/notices.js +7 -4
  532. package/lib/browser/offline/device-values.d.ts +2 -0
  533. package/lib/browser/offline/device-values.js +6 -1
  534. package/lib/browser/screen/page-answers.d.ts +43 -0
  535. package/lib/browser/screen/page-answers.js +93 -0
  536. package/lib/browser/screen/screen-protocol.d.ts +113 -0
  537. package/lib/browser/screen/screen-protocol.js +48 -0
  538. package/lib/browser/screen/screen.d.ts +21 -0
  539. package/lib/browser/screen/screen.js +125 -0
  540. package/lib/browser/screen/use-screen-part.d.ts +7 -0
  541. package/lib/browser/screen/use-screen-part.js +50 -0
  542. package/lib/browser/settings/settings-protocol.d.ts +5 -1
  543. package/lib/browser/settings/settings-protocol.js +5 -1
  544. package/lib/browser/share/shared-extensions.d.ts +30 -0
  545. package/lib/browser/share/shared-extensions.js +181 -0
  546. package/lib/browser/share/shared-link.d.ts +12 -0
  547. package/lib/browser/share/shared-link.js +41 -0
  548. package/lib/browser/share/shared-page.d.ts +6 -0
  549. package/lib/browser/share/shared-page.js +173 -0
  550. package/lib/browser/state/state-protocol.d.ts +14 -0
  551. package/lib/browser/state/state-protocol.js +20 -1
  552. package/lib/browser/state/state.d.ts +10 -2
  553. package/lib/browser/state/state.js +18 -2
  554. package/lib/browser/style/base.d.ts +1 -1
  555. package/lib/browser/style/base.js +4 -0
  556. package/lib/browser/style/chat-list.d.ts +3 -0
  557. package/lib/browser/style/chat-list.js +156 -0
  558. package/lib/browser/style/conversation-column.d.ts +3 -0
  559. package/lib/browser/style/conversation-column.js +253 -0
  560. package/lib/browser/style/conversation.d.ts +1 -1
  561. package/lib/browser/style/conversation.js +24 -8
  562. package/lib/browser/style/dialogs.d.ts +3 -0
  563. package/lib/browser/style/dialogs.js +166 -0
  564. package/lib/browser/style/layout.d.ts +2 -2
  565. package/lib/browser/style/layout.js +1 -525
  566. package/lib/browser/style/pages.d.ts +1 -1
  567. package/lib/browser/style/pages.js +10 -3
  568. package/lib/browser/style/phone.d.ts +1 -1
  569. package/lib/browser/style/phone.js +7 -3
  570. package/lib/browser/style/shared.d.ts +3 -0
  571. package/lib/browser/style/shared.js +26 -0
  572. package/lib/browser/style/shell.d.ts +1 -1
  573. package/lib/browser/style/shell.js +47 -0
  574. package/lib/browser/style/tasks.d.ts +1 -1
  575. package/lib/browser/style/tasks.js +13 -8
  576. package/lib/browser/style.js +8 -0
  577. package/lib/browser/util/gallery.d.ts +24 -2
  578. package/lib/browser/util/gallery.js +82 -2
  579. package/lib/browser/util/image-copy.d.ts +17 -0
  580. package/lib/browser/util/image-copy.js +60 -0
  581. package/lib/browser/util/message.d.ts +5 -0
  582. package/lib/browser/util/message.js +14 -0
  583. package/lib/browser/util/process.d.ts +6 -2
  584. package/lib/browser/util/process.js +6 -2
  585. package/lib/browser/util/spoken.d.ts +25 -0
  586. package/lib/browser/util/spoken.js +86 -0
  587. package/lib/browser/util/transcript.d.ts +23 -0
  588. package/lib/browser/util/transcript.js +49 -0
  589. package/lib/browser/util/voice.d.ts +5 -1
  590. package/lib/browser/util/voice.js +6 -1
  591. package/lib/browser/workbench-hosts.d.ts +37 -0
  592. package/lib/browser/workbench-hosts.js +124 -0
  593. package/lib/browser/workbench-lists.d.ts +34 -0
  594. package/lib/browser/workbench-lists.js +132 -0
  595. package/lib/browser/workbench-protocol.d.ts +14 -1
  596. package/lib/browser/workbench-services.d.ts +50 -0
  597. package/lib/browser/workbench-services.js +124 -0
  598. package/lib/browser/workbench-util.d.ts +1 -1
  599. package/lib/browser/workbench.d.ts +6 -89
  600. package/lib/browser/workbench.js +23 -333
  601. package/package.json +7 -7
@@ -33,24 +33,35 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.BackStack = void 0;
37
- exports.useBackStack = useBackStack;
36
+ exports.BackLayerContext = exports.Back = exports.BackLayers = exports.BackStack = void 0;
37
+ exports.useBackActive = useBackActive;
38
+ exports.useBackLayer = useBackLayer;
39
+ exports.useNoBackLayer = useNoBackLayer;
38
40
  const React = __importStar(require("react"));
41
+ const device_1 = require("./device");
39
42
  /**
40
- * The layers open over the tabs of a phone (a conversation, the workbench over it) as entries of the
41
- * browser's history, so that its back closes the top one, as the back of an app does: the back button
42
- * and gesture of Android, the swipe back of Safari, the back of a browser. Closed by the app (its button,
43
- * a swipe), a layer takes its entry with it.
43
+ * The layers open as entries of the browser's history, so that its back closes the top one, as the back of an
44
+ * app does: the back button and gesture of Android, the swipe back of Safari, the back of a browser. Closed by
45
+ * the app (its button, a swipe), a layer takes its entry with it.
44
46
  *
45
- * Each entry says how many layers are open at it (`taLayers`), and the history, wherever it went, is read
46
- * from there: Safari may skip back over entries it thinks the user did not make.
47
+ * Each entry says how many layers are open at it (`taLayers`), and the history, wherever it went, is read from
48
+ * there: Safari and Chrome may skip back over entries the user did not touch while they were current (one opened by a
49
+ * long press, before the finger lifted). Such a back is one back of the user's, so it closes one layer and the entries
50
+ * of the others are pushed again; unless the browser slid to where it landed already (Safari's swipe, its picture
51
+ * of that entry), where the layers above it close to match. One move of the history at a time:
52
+ * `go` arrives later (popstate), and until it does the state is of before, so what changes meanwhile waits for it
53
+ * (a second `go` read from that state would go too far, out of the page). A move forward (Safari's swipe from the
54
+ * right edge) opens nothing: the history goes back to where the layers are.
47
55
  */
48
56
  class BackStack {
49
57
  constructor(history,
50
58
  /** Closes the layers above `depth`. */
51
- onBack) {
59
+ onBack,
60
+ /** Whether a back that skipped entries closes the layers down to where it landed (the browser slid there). */
61
+ landed = () => false) {
52
62
  this.history = history;
53
63
  this.onBack = onBack;
64
+ this.landed = landed;
54
65
  /** The layers open, as the app last said. */
55
66
  this.depth = 0;
56
67
  }
@@ -63,47 +74,210 @@ class BackStack {
63
74
  /** How many layers are open now. */
64
75
  sync(depth) {
65
76
  this.depth = depth;
77
+ if (this.going !== undefined) {
78
+ return;
79
+ }
66
80
  const at = this.at;
67
81
  for (let layers = at + 1; layers <= depth; layers++) {
68
82
  this.history.pushState({ taLayers: layers }, '');
69
83
  }
70
84
  if (depth < at) {
85
+ this.going = setTimeout(() => this.arrived(), BackStack.WAIT_MS);
71
86
  this.history.go(depth - at);
72
87
  }
73
88
  }
74
- /** The history moved (`popstate`): the layers above its entry close. A move forward opens none. */
89
+ /** The history moved (`popstate`): the user's back closes the layers above its entry; ours, or a move forward, only syncs. */
75
90
  popped() {
91
+ if (this.going !== undefined) {
92
+ this.arrived();
93
+ return;
94
+ }
76
95
  const at = this.at;
77
96
  if (at < this.depth) {
78
- this.depth = at;
79
- this.onBack(at);
97
+ const depth = this.landed() ? at : this.depth - 1;
98
+ this.depth = depth;
99
+ this.onBack(depth);
100
+ this.sync(depth);
101
+ }
102
+ else if (at > this.depth) {
103
+ this.sync(this.depth);
80
104
  }
81
105
  }
106
+ arrived() {
107
+ clearTimeout(this.going);
108
+ this.going = undefined;
109
+ this.sync(this.depth);
110
+ }
82
111
  }
83
112
  exports.BackStack = BackStack;
113
+ /** If a `go` of ours never arrives (no entry there), what changed meanwhile is synced after this. */
114
+ BackStack.WAIT_MS = 1000;
115
+ /**
116
+ * Every layer open on the page, the last opened on top, as Android's OnBackPressedDispatcher keeps its callbacks
117
+ * and Ionic its back button handlers: the back closes the top one, and only the top one has the swipe that closes
118
+ * it (as iOS gives the edge swipe to the navigation in front). One list for the shell and for what opens over it,
119
+ * so that a back never closes what is under a dialog, nor a layer that is no longer seen. A layer closed by its
120
+ * own takes those opened in it with it.
121
+ */
122
+ class BackLayers {
123
+ constructor(history,
124
+ /** Around the closes of a back of the browser: whether it slid them away itself (BackLayers.browserSlides). */
125
+ closing = close => close(), landed) {
126
+ this.closing = closing;
127
+ /** Bottom first. */
128
+ this.open = [];
129
+ this.listeners = new Set();
130
+ this.scheduled = false;
131
+ this.subscribe = (listener) => {
132
+ this.listeners.add(listener);
133
+ return () => this.listeners.delete(listener);
134
+ };
135
+ this.stack = history && new BackStack(history, at => this.back(at), landed);
136
+ }
137
+ /** The layer on top, if any. */
138
+ get top() {
139
+ return this.open[this.open.length - 1];
140
+ }
141
+ get size() {
142
+ return this.open.length;
143
+ }
144
+ /** `layer` is open: above those it was opened in, and above all else open unless one of them was opened in it. */
145
+ add(layer) {
146
+ if (this.open.includes(layer)) {
147
+ return;
148
+ }
149
+ const at = this.open.findIndex(other => BackLayers.within(other, layer));
150
+ this.open.splice(at < 0 ? this.open.length : at, 0, layer);
151
+ this.changed();
152
+ }
153
+ /** `layer` closed (or went): those opened in it close too. */
154
+ remove(layer) {
155
+ const at = this.open.indexOf(layer);
156
+ if (at < 0) {
157
+ return;
158
+ }
159
+ this.open.splice(at, 1);
160
+ const inside = this.open.filter(other => BackLayers.within(other, layer));
161
+ for (const other of inside) {
162
+ this.open.splice(this.open.indexOf(other), 1);
163
+ }
164
+ for (const other of inside.reverse()) {
165
+ other.close();
166
+ }
167
+ this.changed();
168
+ }
169
+ /** Opens a layer for what is not a component (a menu placed by ContextMenuUtil.attach); returns its close by itself. */
170
+ hold(close, parent) {
171
+ const layer = { parent, close };
172
+ this.add(layer);
173
+ return () => this.remove(layer);
174
+ }
175
+ /** The history moved (`popstate`). */
176
+ popped() {
177
+ var _a;
178
+ (_a = this.stack) === null || _a === void 0 ? void 0 : _a.popped();
179
+ }
180
+ /** The user went back to where `depth` layers are open: those above close, the top first. */
181
+ back(depth) {
182
+ const gone = this.open.splice(depth).reverse();
183
+ if (gone.length === 0) {
184
+ return;
185
+ }
186
+ this.closing(() => {
187
+ for (const layer of gone) {
188
+ layer.close();
189
+ }
190
+ });
191
+ this.notify();
192
+ }
193
+ changed() {
194
+ this.notify();
195
+ // Once for all that changed together (a menu closed as the page it chose opens): no entry pushed and taken back.
196
+ if (!this.scheduled && this.stack) {
197
+ this.scheduled = true;
198
+ queueMicrotask(() => {
199
+ var _a;
200
+ this.scheduled = false;
201
+ (_a = this.stack) === null || _a === void 0 ? void 0 : _a.sync(this.open.length);
202
+ });
203
+ }
204
+ }
205
+ notify() {
206
+ for (const listener of [...this.listeners]) {
207
+ listener();
208
+ }
209
+ }
210
+ /** Whether `layer` was opened in `parent`, or in one opened in it. */
211
+ static within(layer, parent) {
212
+ for (let up = layer.parent; up; up = up.parent) {
213
+ if (up === parent) {
214
+ return true;
215
+ }
216
+ }
217
+ return false;
218
+ }
219
+ /**
220
+ * Whether a back of the browser was slid by the browser already: Safari on iOS and iPadOS draws its swipe back
221
+ * itself, so what it closed goes without sliding again. Not in the Ta app (its web view has no such swipe), nor
222
+ * on Android, whose back key slides nothing: there the layer slides away as when its button closes it.
223
+ */
224
+ static browserSlides() {
225
+ var _a, _b;
226
+ if (typeof navigator === 'undefined') {
227
+ return false;
228
+ }
229
+ const app = (_b = (_a = globalThis.Capacitor) === null || _a === void 0 ? void 0 : _a.isNativePlatform) === null || _b === void 0 ? void 0 : _b.call(_a);
230
+ const ios = /iPhone|iPad|iPod/.test(navigator.userAgent) || (/Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1);
231
+ return ios && !app;
232
+ }
233
+ }
234
+ exports.BackLayers = BackLayers;
235
+ /** The layers of this page. */
236
+ exports.Back = typeof window === 'undefined'
237
+ ? new BackLayers()
238
+ : new BackLayers(window.history, close => {
239
+ if (!BackLayers.browserSlides()) {
240
+ close();
241
+ return;
242
+ }
243
+ const root = document.documentElement;
244
+ root.dataset.sheetDrag = '';
245
+ close();
246
+ requestAnimationFrame(() => requestAnimationFrame(() => delete root.dataset.sheetDrag));
247
+ }, BackLayers.browserSlides);
248
+ if (typeof window !== 'undefined') {
249
+ window.addEventListener('popstate', () => exports.Back.popped());
250
+ }
251
+ /** The layer the components under it are opened in. */
252
+ exports.BackLayerContext = React.createContext(undefined);
253
+ /** Whether the page keeps its layers in the history: on a touch screen, and in the layout of a phone. */
254
+ function useBackActive() {
255
+ return (0, device_1.useDevice)(device => device.touch || device.handheld);
256
+ }
84
257
  /**
85
- * Keeps `depth` layers in the history of the page; `onBack(depth)` closes those above `depth`. The browser
86
- * animated its own back already (Safari's swipe), so they go without sliding again.
258
+ * A React hook: while `open`, the back of the system or the browser closes this with `close`, the top layer first
259
+ * (BackLayers). `top`: whether it is the top one, the one whose swipe closes it. Give `layer` to what opens in it
260
+ * with BackLayerContext, so that it is above this and closes with it.
87
261
  */
88
- function useBackStack(depth, onBack) {
89
- const back = React.useRef(onBack);
90
- back.current = onBack;
91
- const [stack] = React.useState(() => typeof window === 'undefined'
92
- ? undefined
93
- : new BackStack(window.history, layers => {
94
- const root = document.documentElement;
95
- root.dataset.sheetDrag = '';
96
- back.current(layers);
97
- requestAnimationFrame(() => requestAnimationFrame(() => delete root.dataset.sheetDrag));
98
- }));
262
+ function useBackLayer(open, close) {
263
+ const parent = React.useContext(exports.BackLayerContext);
264
+ const latest = React.useRef(close);
265
+ latest.current = close;
266
+ const [layer] = React.useState(() => ({ close: () => latest.current() }));
267
+ layer.parent = parent;
268
+ const shown = useBackActive() && open;
99
269
  React.useEffect(() => {
100
- if (!stack) {
270
+ if (!shown) {
101
271
  return;
102
272
  }
103
- const popped = () => stack.popped();
104
- window.addEventListener('popstate', popped);
105
- return () => window.removeEventListener('popstate', popped);
106
- }, [stack]);
107
- React.useEffect(() => stack === null || stack === void 0 ? void 0 : stack.sync(depth), [stack, depth]);
273
+ exports.Back.add(layer);
274
+ return () => exports.Back.remove(layer);
275
+ }, [shown, layer]);
276
+ const top = React.useSyncExternalStore(exports.Back.subscribe, () => exports.Back.top === layer, () => false);
277
+ return { top: shown && top, layer };
278
+ }
279
+ /** A React hook: whether no layer is open, where a gesture of what is under them all may start (the pull down of the first tab). */
280
+ function useNoBackLayer() {
281
+ return React.useSyncExternalStore(exports.Back.subscribe, () => exports.Back.size === 0, () => true);
108
282
  }
109
283
  //# sourceMappingURL=back-stack.js.map
@@ -40,7 +40,7 @@ export declare namespace DeviceMotion {
40
40
  const KEYBOARD_MS = 450;
41
41
  const KEYBOARD_CURVE = "linear(0, 0.146 3.8%, 0.262 7.3%, 0.369 11.1%, 0.471 14.9%, 0.563 18.4%, 0.644 22.2%, 0.712 26%, 0.77 29.6%, 0.816 33.3%, 0.855 37.1%, 0.886 40.7%, 0.91 44.4%, 0.945 51.8%, 0.967 59.3%, 0.979 66.7%, 0.993 77.8%, 1)";
42
42
  const KEYBOARD_CURVE_FALLBACK = "cubic-bezier(0.15, 0.75, 0.2, 1)";
43
- /** The curve of the sheets of iOS: the screens, the workbench, the drawer and the rows a finger swipes, as they slide on (sheet-swipe.ts). */
43
+ /** The curve of the sheets of iOS: the screens, the workbench, the drawer and the rows a finger swipes, as they slide on (swipe-util.ts). */
44
44
  const SHEET_CURVE = "cubic-bezier(0.32, 0.72, 0, 1)";
45
45
  /** How long a sheet takes to slide on by itself (the 360ms of style/phone.ts and sheet-swipe.ts). */
46
46
  const SHEET_MS = 360;
@@ -27,7 +27,7 @@ var DeviceMotion;
27
27
  DeviceMotion.KEYBOARD_MS = 450;
28
28
  DeviceMotion.KEYBOARD_CURVE = 'linear(0, 0.146 3.8%, 0.262 7.3%, 0.369 11.1%, 0.471 14.9%, 0.563 18.4%, 0.644 22.2%, 0.712 26%, 0.77 29.6%, 0.816 33.3%, 0.855 37.1%, 0.886 40.7%, 0.91 44.4%, 0.945 51.8%, 0.967 59.3%, 0.979 66.7%, 0.993 77.8%, 1)';
29
29
  DeviceMotion.KEYBOARD_CURVE_FALLBACK = 'cubic-bezier(0.15, 0.75, 0.2, 1)';
30
- /** The curve of the sheets of iOS: the screens, the workbench, the drawer and the rows a finger swipes, as they slide on (sheet-swipe.ts). */
30
+ /** The curve of the sheets of iOS: the screens, the workbench, the drawer and the rows a finger swipes, as they slide on (swipe-util.ts). */
31
31
  DeviceMotion.SHEET_CURVE = 'cubic-bezier(0.32, 0.72, 0, 1)';
32
32
  /** How long a sheet takes to slide on by itself (the 360ms of style/phone.ts and sheet-swipe.ts). */
33
33
  DeviceMotion.SHEET_MS = 360;
@@ -1,4 +1,4 @@
1
- import type { SheetSwipe } from './sheet-swipe';
1
+ import type { SheetSwipe } from './swipe-util';
2
2
  /**
3
3
  * An element that takes the touches that start on it (a game, a canvas to draw on, a joystick of a web
4
4
  * extension): the shell lets it have them. `ui.Game` and `ui.Game3D` mark theirs; web extensions mark their
@@ -38,7 +38,9 @@ exports.usePullDown = usePullDown;
38
38
  const React = __importStar(require("react"));
39
39
  const device_1 = require("./device");
40
40
  const own_gestures_1 = require("./own-gestures");
41
- const sheet_swipe_1 = require("./sheet-swipe");
41
+ const swipe_finger_1 = require("./swipe-finger");
42
+ const swipe_settle_1 = require("./swipe-settle");
43
+ const swipe_util_1 = require("./swipe-util");
42
44
  /**
43
45
  * What a finger pulls down from the top of a list, as the launcher of WeChat over its chats (ta-launcher.md):
44
46
  * the list follows the finger, the launcher shows behind it, and let go far or fast enough the list goes down
@@ -139,8 +141,8 @@ function usePullDown(options) {
139
141
  let start;
140
142
  let claimed;
141
143
  let moved;
142
- const velocity = new sheet_swipe_1.SwipeVelocity('y');
143
- const settle = new sheet_swipe_1.SwipeSettle();
144
+ const velocity = new swipe_util_1.SwipeVelocity('y');
145
+ const settle = new swipe_settle_1.SwipeSettle();
144
146
  // The strip that shows while open, with the safe area under it, as the style sizes it.
145
147
  const peekOf = () => { var _a; return ((_a = document.querySelector(latest.current.peek)) === null || _a === void 0 ? void 0 : _a.offsetHeight) || PullUtil.PEEK_PX; };
146
148
  const reveal = (offset, height, peek) => {
@@ -213,16 +215,16 @@ function usePullDown(options) {
213
215
  const { sheet, height, peek, offset } = moved;
214
216
  const open = PullUtil.settle(offset, height, current.open, speed, peek);
215
217
  const rest = open ? height - peek : 0;
216
- const motion = sheet_swipe_1.SwipeUtil.motion(offset, rest, speed, PullUtil.SETTLE_MS, [0, height - peek]);
218
+ const motion = swipe_util_1.SwipeUtil.motion(offset, rest, speed, PullUtil.SETTLE_MS, [0, height - peek]);
217
219
  settle.run(motion, [
218
220
  { element: sheet, transform: `translate3d(0, ${rest}px, 0)` },
219
221
  { element: moved.reveal, ...reveal(rest, height, peek) },
220
222
  ], () => latest.current.open === open, () => delete root.dataset.pull);
221
- (0, sheet_swipe_1.afterLetGo)(open, () => latest.current);
223
+ (0, swipe_settle_1.afterLetGo)(open, () => latest.current);
222
224
  }
223
225
  reset();
224
226
  };
225
- const finger = new sheet_swipe_1.SwipeFinger({ move: onMove, end: onEnd }, true);
227
+ const finger = new swipe_finger_1.SwipeFinger({ move: onMove, end: onEnd }, true);
226
228
  const onStart = (event) => {
227
229
  const current = latest.current;
228
230
  // Another finger beside the one that pulls changes nothing.
@@ -37,7 +37,9 @@ exports.RowSwipeUtil = void 0;
37
37
  exports.useRowSwipe = useRowSwipe;
38
38
  const React = __importStar(require("react"));
39
39
  const own_gestures_1 = require("./own-gestures");
40
- const sheet_swipe_1 = require("./sheet-swipe");
40
+ const swipe_finger_1 = require("./swipe-finger");
41
+ const swipe_settle_1 = require("./swipe-settle");
42
+ const swipe_util_1 = require("./swipe-util");
41
43
  /**
42
44
  * A row of a list a finger swipes to the left to show its actions behind it, as the chats of WeChat: it
43
45
  * follows the finger, stays open past half of them or flicked, and closes on a swipe back, a tap on it or
@@ -79,7 +81,7 @@ var RowSwipeUtil;
79
81
  RowSwipeUtil.finger = finger;
80
82
  /** Whether it stays open, let go at `offset` at `speed` (pixels a millisecond, SwipeVelocity): flicked, the way it was; else where it is headed. */
81
83
  function settle(offset, width, speed) {
82
- if (Math.abs(speed) > sheet_swipe_1.SwipeUtil.FLICK) {
84
+ if (Math.abs(speed) > swipe_util_1.SwipeUtil.FLICK) {
83
85
  return speed < 0;
84
86
  }
85
87
  return offset + speed * RowSwipeUtil.PROJECT_MS < -width / 2;
@@ -107,12 +109,12 @@ var RowSwipeUtil;
107
109
  function atSheetEdge(sides, x, width) {
108
110
  var _a;
109
111
  const list = (_a = sides === null || sides === void 0 ? void 0 : sides.split(' ')) !== null && _a !== void 0 ? _a : [];
110
- return (list.includes('right') && x >= width - sheet_swipe_1.SwipeUtil.EDGE_PX) || (list.includes('left') && x <= sheet_swipe_1.SwipeUtil.EDGE_PX);
112
+ return (list.includes('right') && x >= width - swipe_util_1.SwipeUtil.EDGE_PX) || (list.includes('left') && x <= swipe_util_1.SwipeUtil.EDGE_PX);
111
113
  }
112
114
  RowSwipeUtil.atSheetEdge = atSheetEdge;
113
115
  /** Whether the move so far is the row's (more sideways than down, to the left unless open); undefined until it is told. */
114
116
  function claims(dx, dy, open) {
115
- if (Math.hypot(dx, dy) < sheet_swipe_1.SwipeUtil.SLOP_PX) {
117
+ if (Math.hypot(dx, dy) < swipe_util_1.SwipeUtil.SLOP_PX) {
116
118
  return undefined;
117
119
  }
118
120
  return Math.abs(dx) > Math.abs(dy) * 1.2 && (open || dx < 0);
@@ -160,8 +162,8 @@ function useRowSwipe(ref, enabled) {
160
162
  let claimed;
161
163
  let moved;
162
164
  let unclip;
163
- const velocity = new sheet_swipe_1.SwipeVelocity();
164
- const settle = new sheet_swipe_1.SwipeSettle();
165
+ const velocity = new swipe_util_1.SwipeVelocity();
166
+ const settle = new swipe_settle_1.SwipeSettle();
165
167
  const clip = (on, after = 0) => {
166
168
  clearTimeout(unclip);
167
169
  if (on) {
@@ -198,7 +200,7 @@ function useRowSwipe(ref, enabled) {
198
200
  content: element,
199
201
  buttons,
200
202
  width,
201
- from: RowSwipeUtil.finger((0, sheet_swipe_1.translated)(element), width),
203
+ from: RowSwipeUtil.finger((0, swipe_settle_1.translated)(element), width),
202
204
  x: touch.clientX,
203
205
  lag: touch.clientX - start.x,
204
206
  };
@@ -234,7 +236,7 @@ function useRowSwipe(ref, enabled) {
234
236
  const rest = next ? -width : 0;
235
237
  // Stretched past its actions, the row went slower than the finger: it goes back as fast as it went.
236
238
  const along = from < -width ? speed * RowSwipeUtil.RUBBER : speed;
237
- const motion = sheet_swipe_1.SwipeUtil.motion(from, rest, along, RowSwipeUtil.SETTLE_MS, [-width - RowSwipeUtil.BEYOND_PX, 0]);
239
+ const motion = swipe_util_1.SwipeUtil.motion(from, rest, along, RowSwipeUtil.SETTLE_MS, [-width - RowSwipeUtil.BEYOND_PX, 0]);
238
240
  settle.run(motion, [{ element: content, transform: `translate3d(${rest}px, 0, 0)` }, ...actionTargets(buttons, rest, width)], () => state.current === next, () => delete row.dataset.swiping);
239
241
  show(next, motion.ms);
240
242
  }
@@ -242,7 +244,7 @@ function useRowSwipe(ref, enabled) {
242
244
  last = undefined;
243
245
  moved = undefined;
244
246
  };
245
- const finger = new sheet_swipe_1.SwipeFinger({ move: onMove, end: onEnd });
247
+ const finger = new swipe_finger_1.SwipeFinger({ move: onMove, end: onEnd });
246
248
  const onStart = (event) => {
247
249
  // Another finger beside the one that swipes it changes nothing.
248
250
  if (finger.down && !finger.follow(event, row)) {
@@ -1,182 +1,4 @@
1
- /** Where and when a finger was. */
2
- export interface TouchPoint {
3
- x: number;
4
- y: number;
5
- t: number;
6
- }
7
- /**
8
- * A sheet the finger slides, as in the apps of a phone: the navigation drawer from the left, the screen of a
9
- * conversation and the workbench from the right. `side` is where it comes from; `opensFrom` and `closesFrom`
10
- * where a swipe may start: the edge the finger moves away from (the left edge for a swipe to the right, the
11
- * back of iOS), anywhere, or never.
12
- */
13
- export interface SheetSwipe {
14
- side: 'left' | 'right';
15
- opensFrom: 'edge' | 'anywhere' | 'never';
16
- closesFrom: 'edge' | 'anywhere' | 'never';
17
- }
18
- /** It follows the finger and, let go, ends where it was flicked to, or the nearer side. Pure, for the tests. */
19
- export declare namespace SwipeUtil {
20
- /** A swipe from an edge starts this close to it: the rest of the page scrolls and selects. */
21
- const EDGE_PX = 24;
22
- /** How far the finger moves before the swipe is told from a scroll. */
23
- const SLOP_PX = 10;
24
- /** A flick: faster than this, in pixels a millisecond, it goes the way it was flicked whatever the distance. */
25
- const FLICK = 0.4;
26
- /** How it slides on, let go: the curve of the sheets of iOS, as the styles slide them (style/phone.ts). */
27
- const CURVE = "cubic-bezier(0.32, 0.72, 0, 1)";
28
- /** The quickest it slides on, however fast it was flicked. */
29
- const SHORTEST_MS = 120;
30
- /** The speed of the finger let go is that of its last moves, this long. */
31
- const VELOCITY_MS = 80;
32
- /** 1 when the finger moves right to bring the sheet out, -1 when left. */
33
- function outward(sheet: SheetSwipe): 1 | -1;
34
- /** Whether a touch at `start` may move the sheet, on a screen `width` wide. */
35
- function starts(sheet: SheetSwipe, start: TouchPoint, open: boolean, width: number): boolean;
36
- /** Whether the move so far is the sheet's (more sideways than down, the right way); undefined until it is told. */
37
- function claims(sheet: SheetSwipe, start: TouchPoint, now: TouchPoint, open: boolean): boolean | undefined;
38
- /**
39
- * Whether the sheet takes the move so far: undefined while it is not told yet (a finger that sets off
40
- * slowly moves a pixel or two a move, and is waited for), false when it is not the sheet's or what is under
41
- * the finger scrolls sideways (`sideways`, asked only then: a tap or a scroll never reads the styles).
42
- */
43
- function takes(sheet: SheetSwipe, start: TouchPoint, now: TouchPoint, open: boolean, sideways: () => boolean): boolean | undefined;
44
- /** Where the sheet rests away: `∓width`, on its side; out, it rests at 0. */
45
- function away(sheet: SheetSwipe, width: number): number;
46
- /** Where the sheet is, between 0 (out) and away, when the finger moved `dx` from where it took it (`from`). */
47
- function position(sheet: SheetSwipe, from: number, dx: number, width: number): number;
48
- /** Whether it ends out, let go at `x` at `speed` (pixels a millisecond, SwipeVelocity): the way it was flicked, or the nearer side. */
49
- function settle(sheet: SheetSwipe, x: number, width: number, speed: number): boolean;
50
- /**
51
- * How long it slides on to where it rests, `distance` away (signed), let go at `speed`, where the curves of
52
- * `linear()` are not (SwipeSpring): on CURVE, as fast at first as the finger was; `longest` (the style's)
53
- * when the finger was slow, or going the other way.
54
- */
55
- function duration(distance: number, speed: number, longest: number): number;
56
- /** Whether the page draws the curves of `linear()` (iOS 17.2, Chrome 113 on): a spring then, else CURVE. */
57
- const springs: boolean;
58
- /**
59
- * How what the finger let go at `from` at `speed` slides on to `to`, never past `bounds`: a spring that starts at
60
- * the speed of the finger where the page draws it (SwipeSpring), else CURVE for `duration`. `longest` is how long
61
- * its style slides it.
62
- */
63
- function motion(from: number, to: number, speed: number, longest: number, bounds?: [number, number]): SwipeMotion;
64
- }
65
- /** How something let go slides on: for `ms`, on `easing`. */
66
- export interface SwipeMotion {
67
- ms: number;
68
- easing: string;
69
- }
70
- /**
71
- * What a finger lets go slides on as on a spring, as the sheets of iOS: at the speed the finger had, slowing
72
- * down to where it rests, never past it; going the other way, it goes on a little that way first, as far as it
73
- * may. A sheet let go near where it rests settles there quickly, one let go far away takes its time. Drawn by
74
- * the compositor as a CSS transition, its curve a `linear()` of the spring's points. Pure, for the tests.
75
- */
76
- export declare namespace SwipeSpring {
77
- /** How stiff, for what its style slides in `longest` ms: ω = STIFFNESS / longest, 95% of the way in about 0.6 × longest from rest. */
78
- const STIFFNESS = 8;
79
- /** It rests once nearer than this, in pixels. */
80
- const REST_PX = 0.5;
81
- /** 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. */
82
- function left(t: number, omega: number, speed: number): number;
83
- function motion(from: number, to: number, speed: number, longest: number, bounds?: [number, number]): SwipeMotion;
84
- }
85
- /**
86
- * The speed of a finger along x, in pixels a millisecond, of its last moves (SwipeUtil.VELOCITY_MS): let go
87
- * after a slow drag and a flick it is the flick's, held still a moment it is none.
88
- */
89
- export declare class SwipeVelocity {
90
- protected readonly axis: 'x' | 'y';
91
- protected points: TouchPoint[];
92
- /** Along `x` by default; `y` for what the finger pulls down. */
93
- constructor(axis?: 'x' | 'y');
94
- start(point: TouchPoint): void;
95
- add(point: TouchPoint): void;
96
- get speed(): number;
97
- }
98
- /** What an element let go goes to: a transform, an opacity. */
99
- export interface SettleTarget {
100
- element: HTMLElement | null | undefined;
101
- transform?: string;
102
- opacity?: number;
103
- }
104
- /**
105
- * The elements a finger moves, then lets go (SwipeMotion): while it moves them their styles do not slide
106
- * them; let go, they slide on to where they rest with transitions of their own, and only once they are there,
107
- * and the state has them there too (`ready`), they are their styles' again. So the slide starts in the frame
108
- * the finger lets go, before the page draws what the state changed (which may take a while: a long
109
- * conversation), and never jumps if it takes longer than the slide. A finger that takes one of them again, or
110
- * another swipe that moves it, stops it where it is now.
111
- */
112
- export declare class SwipeSettle {
113
- /** How long it waits for the state, past the slide, before giving the elements back anyway. */
114
- static readonly READY_MS = 1000;
115
- protected readonly elements: Set<HTMLElement>;
116
- protected timer?: ReturnType<typeof setTimeout>;
117
- protected done?: () => void;
118
- /** Whether some of its elements are still its own: moved, or sliding on. */
119
- get busy(): boolean;
120
- /** A finger moves these: each stops where it is, whatever slid it, and its style no longer slides it. */
121
- hold(elements: (HTMLElement | null | undefined)[]): void;
122
- /**
123
- * Let go, each slides on to its target as `motion` says; once there and `ready()`, they are their styles'
124
- * again and `done` runs.
125
- */
126
- run(motion: SwipeMotion, targets: SettleTarget[], ready: () => boolean, done?: () => void): void;
127
- /** They are their styles' again at once, where those say they rest, without sliding there. */
128
- finish(): void;
129
- /** They are their styles' again from where they are now: the styles slide them on to where they rest. */
130
- release(): void;
131
- protected giveBack(slide: boolean): void;
132
- protected static clean(element: HTMLElement, holder: SwipeSettle): void;
133
- /** Takes `element` from the settle that has it, stopped where it is. */
134
- protected take(element: HTMLElement): void;
135
- /** What slides stops where it is now. */
136
- protected freeze(element: HTMLElement): void;
137
- }
138
- /**
139
- * 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
140
- * set off (FrameUtil.painted), or after a while where frames are not drawn (a page out of sight); only if it
141
- * changes something: the workbench is put away by the same call that brings it out.
142
- */
143
- export declare function afterLetGo(open: boolean, current: () => {
144
- open: boolean;
145
- setOpen(open: boolean): void;
146
- }): void;
147
- /** Where `element` is moved along `axis` now, by its transform: wherever a style or a slide has it. */
148
- export declare function translated(element: HTMLElement, axis?: 'x' | 'y'): number;
149
- /** Where and when a finger is, of a touch. */
150
- export interface SwipeFingerHandlers {
151
- move(event: TouchEvent, touch: Touch): void;
152
- /** Lifted, or taken by the system; `touch` is none when its end was never seen (a finger put down after it). */
153
- end(event: TouchEvent, touch: Touch | undefined): void;
154
- }
155
- /**
156
- * The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
157
- * it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
158
- * the finger) while the document no longer does, and on the document too, each event once. Another finger put
159
- * down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
160
- */
161
- export declare class SwipeFinger {
162
- protected readonly on: SwipeFingerHandlers;
163
- protected readonly blocking: boolean;
164
- protected id?: number;
165
- protected targets: EventTarget[];
166
- protected last?: Event;
167
- /** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
168
- constructor(on: SwipeFingerHandlers, blocking?: boolean);
169
- get down(): boolean;
170
- /**
171
- * Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
172
- * another, which is still down, or when several are.
173
- */
174
- follow(event: TouchEvent, doc: EventTarget): boolean;
175
- stop(): void;
176
- protected find(touches: TouchList): Touch | undefined;
177
- protected readonly onMove: (event: TouchEvent) => void;
178
- protected readonly onEnd: (event: TouchEvent) => void;
179
- }
1
+ import { type SheetSwipe } from './swipe-util';
180
2
  export interface SheetSwipeOptions extends SheetSwipe {
181
3
  enabled: boolean;
182
4
  /** How long its style slides it, in milliseconds: the longest it takes let go. */