@celljs/ta-web 4.41.0 → 4.43.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 (318) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/apps/web-apps.d.ts +4 -0
  4. package/esm/browser/apps/web-apps.js +14 -3
  5. package/esm/browser/assistant/ta-hearing.d.ts +85 -0
  6. package/esm/browser/assistant/ta-hearing.js +272 -0
  7. package/esm/browser/components/auth-view.js +1 -1
  8. package/esm/browser/components/board.js +9 -1
  9. package/esm/browser/components/clipboard-link-host.d.ts +2 -0
  10. package/esm/browser/components/clipboard-link-host.js +27 -0
  11. package/esm/browser/components/cloud-network.js +1 -1
  12. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  13. package/esm/browser/components/custom-provider-advanced.js +8 -8
  14. package/esm/browser/components/custom-provider-view.js +12 -12
  15. package/esm/browser/components/empty-state.d.ts +2 -1
  16. package/esm/browser/components/empty-state.js +6 -2
  17. package/esm/browser/components/folder-picker.js +2 -2
  18. package/esm/browser/components/gallery.js +8 -9
  19. package/esm/browser/components/hearing-host.d.ts +5 -0
  20. package/esm/browser/components/hearing-host.js +58 -0
  21. package/esm/browser/components/host-view.d.ts +1 -1
  22. package/esm/browser/components/link-dialog.js +4 -0
  23. package/esm/browser/components/loading.d.ts +3 -2
  24. package/esm/browser/components/loading.js +7 -3
  25. package/esm/browser/components/markdown.d.ts +3 -1
  26. package/esm/browser/components/markdown.js +55 -10
  27. package/esm/browser/components/media.d.ts +10 -4
  28. package/esm/browser/components/media.js +60 -14
  29. package/esm/browser/components/people-picker.d.ts +17 -0
  30. package/esm/browser/components/people-picker.js +129 -0
  31. package/esm/browser/components/relay-view.js +1 -1
  32. package/esm/browser/components/settings-parts.js +2 -0
  33. package/esm/browser/components/share-dialog.d.ts +2 -2
  34. package/esm/browser/components/share-dialog.js +7 -4
  35. package/esm/browser/components/share-friends.js +3 -10
  36. package/esm/browser/components/share-item-sheet.d.ts +12 -0
  37. package/esm/browser/components/share-item-sheet.js +39 -0
  38. package/esm/browser/components/share-sheet.d.ts +9 -2
  39. package/esm/browser/components/share-sheet.js +5 -4
  40. package/esm/browser/components/sign-in-setup.js +4 -4
  41. package/esm/browser/components/trusted-domains.js +1 -1
  42. package/esm/browser/components/view-room.d.ts +25 -0
  43. package/esm/browser/components/view-room.js +136 -0
  44. package/esm/browser/components/voice-services.js +6 -6
  45. package/esm/browser/device/device-protocol.d.ts +9 -6
  46. package/esm/browser/device/device-protocol.js +7 -4
  47. package/esm/browser/device/launch-screen.d.ts +11 -1
  48. package/esm/browser/device/launch-screen.js +22 -4
  49. package/esm/browser/extension/share-sheet-compat.d.ts +2 -0
  50. package/esm/browser/extension/share-sheet-compat.js +12 -2
  51. package/esm/browser/extension/web-api-code.d.ts +11 -0
  52. package/esm/browser/extension/web-api-components.d.ts +8 -1
  53. package/esm/browser/extension/web-api-contributions.d.ts +30 -1
  54. package/esm/browser/extension/web-api-desktop.d.ts +2 -1
  55. package/esm/browser/extension/web-api-file-views.d.ts +38 -0
  56. package/esm/browser/extension/web-api-file-views.js +2 -0
  57. package/esm/browser/extension/web-api-host.d.ts +47 -0
  58. package/esm/browser/extension/web-api-host.js +3 -0
  59. package/esm/browser/extension/web-api-menus.d.ts +46 -0
  60. package/esm/browser/extension/web-api-partners.d.ts +58 -1
  61. package/esm/browser/extension/web-api-spec.js +7 -0
  62. package/esm/browser/extension/web-extension-api.d.ts +10 -10
  63. package/esm/browser/extension/web-extension-context.d.ts +2 -8
  64. package/esm/browser/extension/web-extension-context.js +14 -39
  65. package/esm/browser/extension/web-extension-marks.d.ts +10 -0
  66. package/esm/browser/extension/web-extension-marks.js +29 -0
  67. package/esm/browser/extension/web-extension-protocol.d.ts +11 -1
  68. package/esm/browser/extension/web-extension-protocol.js +3 -0
  69. package/esm/browser/extension/web-extension-run.d.ts +15 -2
  70. package/esm/browser/extension/web-extension-run.js +77 -0
  71. package/esm/browser/extension/web-extensions-running.d.ts +5 -1
  72. package/esm/browser/extension/web-extensions-running.js +16 -0
  73. package/esm/browser/extension/web-extensions.d.ts +2 -1
  74. package/esm/browser/extension/web-extensions.js +3 -0
  75. package/esm/browser/extension/web-home.js +3 -1
  76. package/esm/browser/extension/web-host-values.d.ts +66 -0
  77. package/esm/browser/extension/web-host-values.js +191 -0
  78. package/esm/browser/extension/web-hosts.d.ts +7 -2
  79. package/esm/browser/extension/web-hosts.js +16 -4
  80. package/esm/browser/extension/web-share-ui.d.ts +7 -0
  81. package/esm/browser/extension/web-share-ui.js +15 -0
  82. package/esm/browser/extension/web-share.d.ts +18 -0
  83. package/esm/browser/extension/web-share.js +42 -0
  84. package/esm/browser/i18n/en/chat.d.ts +10 -0
  85. package/esm/browser/i18n/en/chat.js +10 -0
  86. package/esm/browser/i18n/en/common.d.ts +23 -0
  87. package/esm/browser/i18n/en/common.js +23 -0
  88. package/esm/browser/i18n/en/discover.d.ts +7 -0
  89. package/esm/browser/i18n/en/discover.js +7 -0
  90. package/esm/browser/i18n/en/settings.d.ts +2 -0
  91. package/esm/browser/i18n/en/settings.js +2 -0
  92. package/esm/browser/i18n/ja/chat.js +10 -0
  93. package/esm/browser/i18n/ja/common.js +23 -0
  94. package/esm/browser/i18n/ja/discover.js +7 -0
  95. package/esm/browser/i18n/ja/settings.js +2 -0
  96. package/esm/browser/i18n/locales.d.ts +43 -1
  97. package/esm/browser/i18n/messages.d.ts +42 -0
  98. package/esm/browser/i18n/zh/chat.js +10 -0
  99. package/esm/browser/i18n/zh/common.js +23 -0
  100. package/esm/browser/i18n/zh/discover.js +7 -0
  101. package/esm/browser/i18n/zh/settings.js +2 -0
  102. package/esm/browser/i18n/zh-tw/chat.js +10 -0
  103. package/esm/browser/i18n/zh-tw/common.js +23 -0
  104. package/esm/browser/i18n/zh-tw/discover.js +7 -0
  105. package/esm/browser/i18n/zh-tw/settings.js +2 -0
  106. package/esm/browser/launch-art/art-palette.d.ts +41 -0
  107. package/esm/browser/launch-art/art-palette.js +72 -0
  108. package/esm/browser/launch-art/cyclic-automaton.d.ts +45 -0
  109. package/esm/browser/launch-art/cyclic-automaton.js +176 -0
  110. package/esm/browser/launch-art/fractal-tree.d.ts +43 -0
  111. package/esm/browser/launch-art/fractal-tree.js +48 -0
  112. package/esm/browser/launch-art/launch-art.d.ts +98 -0
  113. package/esm/browser/launch-art/launch-art.js +420 -0
  114. package/esm/browser/launch-art/launch-sky.d.ts +66 -0
  115. package/esm/browser/launch-art/launch-sky.js +153 -0
  116. package/esm/browser/links/clipboard-links.d.ts +89 -0
  117. package/esm/browser/links/clipboard-links.js +303 -0
  118. package/esm/browser/links/link-text.d.ts +29 -0
  119. package/esm/browser/links/link-text.js +97 -0
  120. package/esm/browser/links/links-protocol.d.ts +12 -1
  121. package/esm/browser/links/links.d.ts +8 -2
  122. package/esm/browser/links/links.js +33 -3
  123. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  124. package/esm/browser/markdown/code-renderers.js +4 -0
  125. package/esm/browser/partners/group-picker.js +23 -29
  126. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  127. package/esm/browser/sandbox/work/work-senses.js +1 -1
  128. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  129. package/esm/browser/settings/settings-protocol.js +2 -0
  130. package/esm/browser/style/base.d.ts +1 -1
  131. package/esm/browser/style/base.js +10 -6
  132. package/esm/browser/style/chat-list.d.ts +1 -1
  133. package/esm/browser/style/chat-list.js +28 -15
  134. package/esm/browser/style/conversation-column.d.ts +1 -1
  135. package/esm/browser/style/conversation.d.ts +1 -1
  136. package/esm/browser/style/conversation.js +29 -2
  137. package/esm/browser/style/dialogs.d.ts +1 -1
  138. package/esm/browser/style/dialogs.js +2 -5
  139. package/esm/browser/style/forms.d.ts +5 -0
  140. package/esm/browser/style/forms.js +65 -0
  141. package/esm/browser/style/layout.d.ts +1 -1
  142. package/esm/browser/style/pages.d.ts +1 -1
  143. package/esm/browser/style/pages.js +14 -24
  144. package/esm/browser/style/phone.d.ts +1 -1
  145. package/esm/browser/style/shared.d.ts +1 -1
  146. package/esm/browser/style/shell.d.ts +1 -1
  147. package/esm/browser/style/shell.js +1 -6
  148. package/esm/browser/style/surfaces.d.ts +1 -1
  149. package/esm/browser/style/surfaces.js +0 -6
  150. package/esm/browser/style/tasks.d.ts +1 -1
  151. package/esm/browser/style.js +2 -0
  152. package/esm/browser/util/markdown.d.ts +45 -3
  153. package/esm/browser/util/markdown.js +67 -11
  154. package/esm/browser/util/voice.d.ts +18 -0
  155. package/esm/browser/util/voice.js +111 -3
  156. package/esm/browser/workbench-protocol.d.ts +2 -0
  157. package/esm/browser/workbench-services.d.ts +2 -0
  158. package/esm/browser/workbench-services.js +5 -0
  159. package/esm/browser/workbench.js +5 -0
  160. package/lib/browser/apps/web-apps.d.ts +4 -0
  161. package/lib/browser/apps/web-apps.js +14 -3
  162. package/lib/browser/assistant/ta-hearing.d.ts +86 -0
  163. package/lib/browser/assistant/ta-hearing.js +277 -0
  164. package/lib/browser/components/auth-view.js +1 -1
  165. package/lib/browser/components/board.js +9 -1
  166. package/lib/browser/components/clipboard-link-host.d.ts +3 -0
  167. package/lib/browser/components/clipboard-link-host.js +63 -0
  168. package/lib/browser/components/cloud-network.js +1 -1
  169. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  170. package/lib/browser/components/custom-provider-advanced.js +8 -8
  171. package/lib/browser/components/custom-provider-view.js +12 -12
  172. package/lib/browser/components/empty-state.d.ts +2 -1
  173. package/lib/browser/components/empty-state.js +6 -2
  174. package/lib/browser/components/folder-picker.js +2 -2
  175. package/lib/browser/components/gallery.js +7 -8
  176. package/lib/browser/components/hearing-host.d.ts +6 -0
  177. package/lib/browser/components/hearing-host.js +94 -0
  178. package/lib/browser/components/host-view.d.ts +1 -1
  179. package/lib/browser/components/link-dialog.js +4 -0
  180. package/lib/browser/components/loading.d.ts +3 -2
  181. package/lib/browser/components/loading.js +7 -3
  182. package/lib/browser/components/markdown.d.ts +3 -1
  183. package/lib/browser/components/markdown.js +53 -8
  184. package/lib/browser/components/media.d.ts +10 -4
  185. package/lib/browser/components/media.js +61 -14
  186. package/lib/browser/components/people-picker.d.ts +18 -0
  187. package/lib/browser/components/people-picker.js +166 -0
  188. package/lib/browser/components/relay-view.js +1 -1
  189. package/lib/browser/components/settings-parts.js +2 -0
  190. package/lib/browser/components/share-dialog.d.ts +2 -2
  191. package/lib/browser/components/share-dialog.js +7 -4
  192. package/lib/browser/components/share-friends.js +3 -10
  193. package/lib/browser/components/share-item-sheet.d.ts +13 -0
  194. package/lib/browser/components/share-item-sheet.js +75 -0
  195. package/lib/browser/components/share-sheet.d.ts +9 -2
  196. package/lib/browser/components/share-sheet.js +5 -3
  197. package/lib/browser/components/sign-in-setup.js +4 -4
  198. package/lib/browser/components/trusted-domains.js +1 -1
  199. package/lib/browser/components/view-room.d.ts +26 -0
  200. package/lib/browser/components/view-room.js +173 -0
  201. package/lib/browser/components/voice-services.js +6 -6
  202. package/lib/browser/device/device-protocol.d.ts +9 -6
  203. package/lib/browser/device/device-protocol.js +7 -4
  204. package/lib/browser/device/launch-screen.d.ts +11 -1
  205. package/lib/browser/device/launch-screen.js +22 -4
  206. package/lib/browser/extension/share-sheet-compat.d.ts +2 -0
  207. package/lib/browser/extension/share-sheet-compat.js +13 -2
  208. package/lib/browser/extension/web-api-code.d.ts +11 -0
  209. package/lib/browser/extension/web-api-components.d.ts +8 -1
  210. package/lib/browser/extension/web-api-contributions.d.ts +30 -1
  211. package/lib/browser/extension/web-api-desktop.d.ts +2 -1
  212. package/lib/browser/extension/web-api-file-views.d.ts +39 -0
  213. package/lib/browser/extension/web-api-file-views.js +3 -0
  214. package/lib/browser/extension/web-api-host.d.ts +48 -0
  215. package/lib/browser/extension/web-api-host.js +4 -0
  216. package/lib/browser/extension/web-api-menus.d.ts +46 -0
  217. package/lib/browser/extension/web-api-partners.d.ts +58 -1
  218. package/lib/browser/extension/web-api-spec.js +7 -0
  219. package/lib/browser/extension/web-extension-api.d.ts +10 -10
  220. package/lib/browser/extension/web-extension-context.d.ts +2 -8
  221. package/lib/browser/extension/web-extension-context.js +14 -39
  222. package/lib/browser/extension/web-extension-marks.d.ts +11 -0
  223. package/lib/browser/extension/web-extension-marks.js +65 -0
  224. package/lib/browser/extension/web-extension-protocol.d.ts +11 -1
  225. package/lib/browser/extension/web-extension-protocol.js +3 -0
  226. package/lib/browser/extension/web-extension-run.d.ts +15 -2
  227. package/lib/browser/extension/web-extension-run.js +77 -0
  228. package/lib/browser/extension/web-extensions-running.d.ts +5 -1
  229. package/lib/browser/extension/web-extensions-running.js +16 -0
  230. package/lib/browser/extension/web-extensions.d.ts +2 -1
  231. package/lib/browser/extension/web-extensions.js +3 -0
  232. package/lib/browser/extension/web-home.js +3 -1
  233. package/lib/browser/extension/web-host-values.d.ts +67 -0
  234. package/lib/browser/extension/web-host-values.js +229 -0
  235. package/lib/browser/extension/web-hosts.d.ts +7 -2
  236. package/lib/browser/extension/web-hosts.js +16 -4
  237. package/lib/browser/extension/web-share-ui.d.ts +8 -0
  238. package/lib/browser/extension/web-share-ui.js +51 -0
  239. package/lib/browser/extension/web-share.d.ts +19 -0
  240. package/lib/browser/extension/web-share.js +45 -0
  241. package/lib/browser/i18n/en/chat.d.ts +10 -0
  242. package/lib/browser/i18n/en/chat.js +10 -0
  243. package/lib/browser/i18n/en/common.d.ts +23 -0
  244. package/lib/browser/i18n/en/common.js +23 -0
  245. package/lib/browser/i18n/en/discover.d.ts +7 -0
  246. package/lib/browser/i18n/en/discover.js +7 -0
  247. package/lib/browser/i18n/en/settings.d.ts +2 -0
  248. package/lib/browser/i18n/en/settings.js +2 -0
  249. package/lib/browser/i18n/ja/chat.js +10 -0
  250. package/lib/browser/i18n/ja/common.js +23 -0
  251. package/lib/browser/i18n/ja/discover.js +7 -0
  252. package/lib/browser/i18n/ja/settings.js +2 -0
  253. package/lib/browser/i18n/locales.d.ts +43 -1
  254. package/lib/browser/i18n/messages.d.ts +42 -0
  255. package/lib/browser/i18n/zh/chat.js +10 -0
  256. package/lib/browser/i18n/zh/common.js +23 -0
  257. package/lib/browser/i18n/zh/discover.js +7 -0
  258. package/lib/browser/i18n/zh/settings.js +2 -0
  259. package/lib/browser/i18n/zh-tw/chat.js +10 -0
  260. package/lib/browser/i18n/zh-tw/common.js +23 -0
  261. package/lib/browser/i18n/zh-tw/discover.js +7 -0
  262. package/lib/browser/i18n/zh-tw/settings.js +2 -0
  263. package/lib/browser/launch-art/art-palette.d.ts +42 -0
  264. package/lib/browser/launch-art/art-palette.js +76 -0
  265. package/lib/browser/launch-art/cyclic-automaton.d.ts +46 -0
  266. package/lib/browser/launch-art/cyclic-automaton.js +180 -0
  267. package/lib/browser/launch-art/fractal-tree.d.ts +44 -0
  268. package/lib/browser/launch-art/fractal-tree.js +52 -0
  269. package/lib/browser/launch-art/launch-art.d.ts +99 -0
  270. package/lib/browser/launch-art/launch-art.js +424 -0
  271. package/lib/browser/launch-art/launch-sky.d.ts +67 -0
  272. package/lib/browser/launch-art/launch-sky.js +157 -0
  273. package/lib/browser/links/clipboard-links.d.ts +90 -0
  274. package/lib/browser/links/clipboard-links.js +308 -0
  275. package/lib/browser/links/link-text.d.ts +30 -0
  276. package/lib/browser/links/link-text.js +100 -0
  277. package/lib/browser/links/links-protocol.d.ts +12 -1
  278. package/lib/browser/links/links.d.ts +8 -2
  279. package/lib/browser/links/links.js +33 -3
  280. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  281. package/lib/browser/markdown/code-renderers.js +5 -1
  282. package/lib/browser/partners/group-picker.js +23 -29
  283. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  284. package/lib/browser/sandbox/work/work-senses.js +1 -1
  285. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  286. package/lib/browser/settings/settings-protocol.js +2 -0
  287. package/lib/browser/style/base.d.ts +1 -1
  288. package/lib/browser/style/base.js +10 -6
  289. package/lib/browser/style/chat-list.d.ts +1 -1
  290. package/lib/browser/style/chat-list.js +28 -15
  291. package/lib/browser/style/conversation-column.d.ts +1 -1
  292. package/lib/browser/style/conversation.d.ts +1 -1
  293. package/lib/browser/style/conversation.js +29 -2
  294. package/lib/browser/style/dialogs.d.ts +1 -1
  295. package/lib/browser/style/dialogs.js +2 -5
  296. package/lib/browser/style/forms.d.ts +6 -0
  297. package/lib/browser/style/forms.js +68 -0
  298. package/lib/browser/style/layout.d.ts +1 -1
  299. package/lib/browser/style/pages.d.ts +1 -1
  300. package/lib/browser/style/pages.js +14 -24
  301. package/lib/browser/style/phone.d.ts +1 -1
  302. package/lib/browser/style/shared.d.ts +1 -1
  303. package/lib/browser/style/shell.d.ts +1 -1
  304. package/lib/browser/style/shell.js +1 -6
  305. package/lib/browser/style/surfaces.d.ts +1 -1
  306. package/lib/browser/style/surfaces.js +0 -6
  307. package/lib/browser/style/tasks.d.ts +1 -1
  308. package/lib/browser/style.js +2 -0
  309. package/lib/browser/util/markdown.d.ts +45 -3
  310. package/lib/browser/util/markdown.js +68 -12
  311. package/lib/browser/util/voice.d.ts +18 -0
  312. package/lib/browser/util/voice.js +111 -3
  313. package/lib/browser/workbench-protocol.d.ts +2 -0
  314. package/lib/browser/workbench-services.d.ts +2 -0
  315. package/lib/browser/workbench-services.js +5 -0
  316. package/lib/browser/workbench.js +5 -0
  317. package/package.json +8 -8
  318. package/public/launch.svg +3 -3
@@ -1,6 +1,36 @@
1
1
  const DEFAULT_ORDER = 100;
2
2
  export var WebExtensionRunUtil;
3
3
  (function (WebExtensionRunUtil) {
4
+ /**
5
+ * An opener of links (registerOpener), with what it says links of its own are (`describe`). One that fails, or of an
6
+ * extension that stopped, leaves the link to the next one, and names none.
7
+ */
8
+ function opener(run, opener, options) {
9
+ ((options === null || options === void 0 ? void 0 : options.specific) ? run.specificOpeners : run.openers).push(async (link) => {
10
+ try {
11
+ return !run.stopped && (await opener(link)) === true;
12
+ }
13
+ catch (error) {
14
+ console.error(`The web extension ${run.loaded.name} failed:`, error);
15
+ return false;
16
+ }
17
+ });
18
+ const describe = options === null || options === void 0 ? void 0 : options.describe;
19
+ if (!describe) {
20
+ return;
21
+ }
22
+ run.linkDescribers.push(url => {
23
+ try {
24
+ const kind = run.stopped ? undefined : describe({ type: 'url', url });
25
+ return typeof kind === 'string' && kind.trim() ? kind.trim() : undefined;
26
+ }
27
+ catch (error) {
28
+ console.error(`The web extension ${run.loaded.name} failed:`, error);
29
+ return undefined;
30
+ }
31
+ });
32
+ }
33
+ WebExtensionRunUtil.opener = opener;
4
34
  /** A menu of the extension (registerSessionMenu, registerFileMenu, registerCodeMenu): none once it stopped, nor when it throws. */
5
35
  function menu(run, menu) {
6
36
  return target => {
@@ -14,6 +44,47 @@ export var WebExtensionRunUtil;
14
44
  };
15
45
  }
16
46
  WebExtensionRunUtil.menu = menu;
47
+ /** How files of a kind look (registerFileView): it takes none once the extension stopped, nor when it throws. */
48
+ function fileView(run, view) {
49
+ return {
50
+ accepts: file => {
51
+ try {
52
+ return !run.stopped && view.accepts(file) === true;
53
+ }
54
+ catch (error) {
55
+ console.error(`The web extension ${run.loaded.name} failed:`, error);
56
+ return false;
57
+ }
58
+ },
59
+ render: view.render,
60
+ };
61
+ }
62
+ WebExtensionRunUtil.fileView = fileView;
63
+ /** A way to share of the extension: it takes nothing once it stopped, nor when it throws. */
64
+ function shareWay(run, way) {
65
+ const failed = (error) => console.error(`The web extension ${run.loaded.name} failed:`, error);
66
+ return {
67
+ key: `${run.loaded.name}/${way.key}`,
68
+ label: way.label,
69
+ icon: way.icon,
70
+ order: way.order,
71
+ accepts: item => {
72
+ try {
73
+ return !run.stopped && way.accepts(item);
74
+ }
75
+ catch (error) {
76
+ failed(error);
77
+ return false;
78
+ }
79
+ },
80
+ share: async (item) => {
81
+ if (!run.stopped) {
82
+ await way.share(item);
83
+ }
84
+ },
85
+ };
86
+ }
87
+ WebExtensionRunUtil.shareWay = shareWay;
17
88
  /** Nothing registered: the one list of what a run holds, so that a stop clears every kind of it. */
18
89
  function registrations() {
19
90
  return {
@@ -35,13 +106,16 @@ export var WebExtensionRunUtil;
35
106
  toolRenderers: [],
36
107
  openers: [],
37
108
  specificOpeners: [],
109
+ linkDescribers: [],
38
110
  sessionMenus: [],
39
111
  fileMenus: [],
40
112
  codeMenus: [],
113
+ shareWays: [],
41
114
  taskSources: [],
42
115
  searches: [],
43
116
  composerAddons: [],
44
117
  roomAddons: [],
118
+ fileViews: [],
45
119
  settingsSections: [],
46
120
  handlers: [],
47
121
  };
@@ -167,9 +241,12 @@ export var WebExtensionRunUtil;
167
241
  return {
168
242
  openers: [...runs.flatMap(run => run.specificOpeners), ...runs.flatMap(run => run.openers)],
169
243
  specificOpeners: runs.flatMap(run => run.specificOpeners),
244
+ linkDescribers: runs.flatMap(run => run.linkDescribers),
170
245
  sessionMenus: runs.flatMap(run => run.sessionMenus),
171
246
  fileMenus: runs.flatMap(run => run.fileMenus),
247
+ fileViews: runs.flatMap(run => run.fileViews),
172
248
  codeMenus: runs.flatMap(run => run.codeMenus),
249
+ shareWays: runs.flatMap(run => run.shareWays).sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : 100) - ((_b = b.order) !== null && _b !== void 0 ? _b : 100); }),
173
250
  extensions: runs.map(run => run.loaded),
174
251
  views,
175
252
  widgets: runs.flatMap(run => [...run.widgets].map(([key, { component, options }]) => { var _a; return ({
@@ -8,8 +8,9 @@ import { TaSettings } from '../settings/settings-protocol.js';
8
8
  import { TaState } from '../state/state-protocol.js';
9
9
  import { TaTargets } from '../targets/targets-protocol.js';
10
10
  import { TaWorkbench } from '../workbench-protocol.js';
11
+ import type { WebShareItem } from './web-api-menus.js';
11
12
  import { WebEditorTabs } from './web-editor-tabs.js';
12
- import type { WebExtensionFactory } from './web-extension-api.js';
13
+ import type { WebExtensionFactory, WebMenuItem } from './web-extension-api.js';
13
14
  import { WebExtensionCode } from './web-extension-code.js';
14
15
  import type { WebExtensionContext } from './web-extension-context.js';
15
16
  import { BuiltinWebExtension, type LoadedWebExtension, type WebExtensionConversation, type WebExtensionsState, type WebSessionSwitcher, type WebViewEntry } from './web-extension-protocol.js';
@@ -109,6 +110,9 @@ export declare abstract class WebExtensionsRunning {
109
110
  protected stop(run: WebExtensionRun): void;
110
111
  protected guard(run: WebExtensionRun, action: () => void): void;
111
112
  protected publish(): void;
113
+ /** Share, opening the share sheet, for what a way to share takes. */
114
+ protected shareMenu(item: WebShareItem | undefined): WebMenuItem[];
115
+ abstract shareItem(item: WebShareItem | undefined): void;
112
116
  protected update(change: Partial<WebExtensionsState>): void;
113
117
  abstract refresh(): Promise<boolean>;
114
118
  abstract openView(id: string, preserveFocus?: boolean): void;
@@ -8,6 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Autowired, Optional, PostConstruct } from '@celljs/core';
11
+ import { Share2 } from 'lucide-react';
11
12
  import { TaFiles } from '../files/files-protocol.js';
12
13
  import { message } from '../i18n/messages.js';
13
14
  import { TaLinks } from '../links/links-protocol.js';
@@ -32,6 +33,7 @@ import { WebOnDemand } from './web-on-demand.js';
32
33
  import { WebPageList } from './web-page-list.js';
33
34
  import { WebPagesUtil } from './web-pages.js';
34
35
  import { WebPartnerBoard } from './web-partners.js';
36
+ import { WebShareUtil } from './web-share.js';
35
37
  import { WebTaskBoard } from './web-tasks.js';
36
38
  import { WebExtensionUtil, WebViewUtil } from './web-view-util.js';
37
39
  /**
@@ -421,12 +423,26 @@ export class WebExtensionsRunning {
421
423
  }
422
424
  this.update({
423
425
  ...registered,
426
+ // The one Share, after what the extensions add, once there is a way to share: where it takes the block or the file.
427
+ ...(registered.shareWays.length
428
+ ? {
429
+ codeMenus: [...registered.codeMenus, block => this.shareMenu(WebShareUtil.ofBlock(block))],
430
+ fileMenus: [...registered.fileMenus, file => this.shareMenu(WebShareUtil.ofFile(file))],
431
+ }
432
+ : {}),
424
433
  views: views.sort((a, b) => a.order - b.order),
425
434
  onOpen: this.onDemand.list(),
426
435
  kept: this.onDemand.kept(),
427
436
  usage: this.onDemand.used,
428
437
  });
429
438
  }
439
+ /** Share, opening the share sheet, for what a way to share takes. */
440
+ shareMenu(item) {
441
+ if (!item || WebShareUtil.ways(this.current.shareWays, item).length === 0) {
442
+ return [];
443
+ }
444
+ return [{ key: 'ta-share', label: message(this.settings.state.language, 'ta.share.share'), icon: Share2, run: () => this.shareItem(item) }];
445
+ }
430
446
  update(change) {
431
447
  this.current = { ...this.current, ...change };
432
448
  for (const listener of this.listeners) {
@@ -1,6 +1,6 @@
1
1
  import type { TaEvent, TaTemporaryFrom } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
- import type { WebHomeEntry, WebShareTarget } from './web-extension-api.js';
3
+ import type { WebHomeEntry, WebShareItem, WebShareTarget } from './web-extension-api.js';
4
4
  import { WebExtensionContext, type WebExtensionContextHost } from './web-extension-context.js';
5
5
  import { TaWebExtensions, type WebEditorEntry, type WebExtensionConversation, type WebExtensionsState, type WebSessionSwitcher } from './web-extension-protocol.js';
6
6
  import { WebExtensionsRunning } from './web-extensions-running.js';
@@ -32,6 +32,7 @@ export declare class TaWebExtensionsImpl extends WebExtensionsRunning implements
32
32
  openTemporary(source: string, from: TaTemporaryFrom): Promise<string>;
33
33
  openShared(text: string): Promise<boolean>;
34
34
  share(target: WebShareTarget | undefined): void;
35
+ shareItem(item: WebShareItem | undefined): void;
35
36
  protected nextCustom: number;
36
37
  showCustom(extension: string, component: React.ComponentType<{
37
38
  close(): void;
@@ -173,6 +173,9 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl extends WebExtensionsRunning
173
173
  share(target) {
174
174
  this.update({ sharing: target });
175
175
  }
176
+ shareItem(item) {
177
+ this.update({ sharingItem: item });
178
+ }
176
179
  showCustom(extension, component) {
177
180
  const id = ++this.nextCustom;
178
181
  this.update({ customs: [...this.current.customs, { id, extension, component }] });
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { PeoplePicker } from '../components/people-picker.js';
2
3
  import { openGroupPicker } from '../partners/group-picker.js';
3
4
  import { WebRowBoard } from './web-row-board.js';
4
5
  export var WebHomeUtil;
@@ -27,13 +28,14 @@ export var WebHomeUtil;
27
28
  openGroupPicker(extensions, partner === undefined ? undefined : extensions.partners.partners().find(each => each.key === `${extension}/${partner}`));
28
29
  },
29
30
  openPartner: async (id, kind) => {
30
- const partner = extensions.partners.partners().find(each => each.id === id && (!kind || each.kind === kind));
31
+ const partner = extensions.partners.partners().find(each => (each.id === id || each.room === id) && (!kind || each.kind === kind));
31
32
  if (!partner || stopped()) {
32
33
  return false;
33
34
  }
34
35
  await partner.open();
35
36
  return true;
36
37
  },
38
+ PeoplePicker,
37
39
  };
38
40
  }
39
41
  WebHomeUtil.ui = ui;
@@ -0,0 +1,66 @@
1
+ import type { TaWorkbench } from '../workbench-protocol.js';
2
+ import type { WebHostOptions, WebHostValue } from './web-api-host.js';
3
+ import { type WebExtensionRun } from './web-extension-run.js';
4
+ /** What the values of one extension need of the page. */
5
+ export interface WebHostValuesDeps {
6
+ /** Calls a method of the package's host. */
7
+ call(method: string, params: readonly unknown[]): Promise<unknown>;
8
+ /** What the package's host says changed; how to stop. */
9
+ onChanged(listener: (topics: string[]) => void): () => void;
10
+ /** The connection came back: what the page read may have changed meanwhile, and the server forgot it reads it. */
11
+ onReconnect(listener: () => void): () => void;
12
+ /** Whether the page is hidden now, and when it shows again; none: always shown. */
13
+ hidden?(): boolean;
14
+ onShown?(listener: () => void): () => void;
15
+ }
16
+ interface Entry {
17
+ method: string;
18
+ params: readonly unknown[];
19
+ topics: ReadonlySet<string>;
20
+ every?: number;
21
+ listeners: Set<() => void>;
22
+ snapshot: WebHostValue<unknown>;
23
+ /** Of the value shown, to render nothing when an answer is the same. */
24
+ json?: string;
25
+ reading?: Promise<void>;
26
+ /** A change came during the read: read once more after it. */
27
+ again?: boolean;
28
+ /** A change came while the page was hidden: read as it shows. */
29
+ stale?: boolean;
30
+ timer?: ReturnType<typeof setInterval>;
31
+ }
32
+ /**
33
+ * What the methods of one package's host answer, for `ui.useHost`: one read for all who show the same, again only as
34
+ * the host says it changed (TaExtensionHost.changed), the connection comes back or the page shows after a change it
35
+ * missed; the same snapshot until an answer differs.
36
+ */
37
+ export declare class WebHostValues {
38
+ protected readonly deps: WebHostValuesDeps;
39
+ protected readonly entries: Map<string, Entry>;
40
+ protected stops: (() => void)[];
41
+ constructor(deps: WebHostValuesDeps);
42
+ /** What a method with its params is kept by. */
43
+ static key(method: string, params?: readonly unknown[]): string;
44
+ /** The snapshot of a method with its params (WebHostValues.key), the same object until it changes. */
45
+ get<T>(key: string): WebHostValue<T>;
46
+ /** Shows it: read now, and again as it changes, until the function returned. */
47
+ subscribe(key: string, options: WebHostOptions, listener: () => void): () => void;
48
+ /** Heard of the host: what reads one of the topics is read again, or marked to be once the page shows. */
49
+ changed(topics: readonly string[]): void;
50
+ dispose(): void;
51
+ protected entry(key: string): Entry;
52
+ protected listen(): void;
53
+ /** Reads again what shows; only what changed while hidden with `stale`. */
54
+ protected readShown(stale: boolean): void;
55
+ protected shown(): Entry[];
56
+ protected hidden(): boolean;
57
+ protected read(entry: Entry): Promise<void>;
58
+ protected show(entry: Entry, snapshot: WebHostValue<unknown>): void;
59
+ }
60
+ /** What `ui.useHost` and `onHostChanged` of an extension read: its package's host, on the connection of the page. */
61
+ export declare namespace WebHostValuesUtil {
62
+ function of(run: WebExtensionRun, workbench: Pick<TaWorkbench, 'packages' | 'onHostChanged' | 'onReconnect'>): WebHostValues;
63
+ }
64
+ /** `ui.useHost` on the values of one extension. */
65
+ export declare function useHostValue<T>(values: WebHostValues, method: string, params?: readonly unknown[], options?: WebHostOptions): WebHostValue<T>;
66
+ export {};
@@ -0,0 +1,191 @@
1
+ import * as React from 'react';
2
+ import { WebExtensionRunUtil } from './web-extension-run.js';
3
+ /**
4
+ * What the methods of one package's host answer, for `ui.useHost`: one read for all who show the same, again only as
5
+ * the host says it changed (TaExtensionHost.changed), the connection comes back or the page shows after a change it
6
+ * missed; the same snapshot until an answer differs.
7
+ */
8
+ export class WebHostValues {
9
+ constructor(deps) {
10
+ this.deps = deps;
11
+ this.entries = new Map();
12
+ this.stops = [];
13
+ }
14
+ /** What a method with its params is kept by. */
15
+ static key(method, params = []) {
16
+ return `${method}\n${JSON.stringify(params)}`;
17
+ }
18
+ /** The snapshot of a method with its params (WebHostValues.key), the same object until it changes. */
19
+ get(key) {
20
+ return this.entry(key).snapshot;
21
+ }
22
+ /** Shows it: read now, and again as it changes, until the function returned. */
23
+ subscribe(key, options, listener) {
24
+ var _a;
25
+ const entry = this.entry(key);
26
+ entry.topics = new Set((_a = options.topics) !== null && _a !== void 0 ? _a : [entry.method]);
27
+ entry.every = options.every;
28
+ entry.listeners.add(listener);
29
+ if (entry.listeners.size === 1) {
30
+ this.listen();
31
+ void this.read(entry);
32
+ if (entry.every) {
33
+ entry.timer = setInterval(() => !this.hidden() && void this.read(entry), entry.every);
34
+ }
35
+ }
36
+ return () => {
37
+ entry.listeners.delete(listener);
38
+ if (entry.listeners.size === 0) {
39
+ clearInterval(entry.timer);
40
+ entry.timer = undefined;
41
+ if (![...this.entries.values()].some(each => each.listeners.size)) {
42
+ this.dispose();
43
+ }
44
+ }
45
+ };
46
+ }
47
+ /** Heard of the host: what reads one of the topics is read again, or marked to be once the page shows. */
48
+ changed(topics) {
49
+ for (const entry of this.shown()) {
50
+ if (topics.some(topic => entry.topics.has(topic))) {
51
+ if (this.hidden()) {
52
+ entry.stale = true;
53
+ }
54
+ else {
55
+ void this.read(entry);
56
+ }
57
+ }
58
+ }
59
+ }
60
+ dispose() {
61
+ for (const stop of this.stops) {
62
+ stop();
63
+ }
64
+ this.stops = [];
65
+ }
66
+ entry(key) {
67
+ let entry = this.entries.get(key);
68
+ if (!entry) {
69
+ const at = key.indexOf('\n');
70
+ const method = key.slice(0, at);
71
+ const params = JSON.parse(key.slice(at + 1));
72
+ const created = {
73
+ method,
74
+ params,
75
+ topics: new Set([method]),
76
+ listeners: new Set(),
77
+ snapshot: { loading: true, read: () => this.read(created) },
78
+ };
79
+ this.entries.set(key, created);
80
+ entry = created;
81
+ }
82
+ return entry;
83
+ }
84
+ listen() {
85
+ var _a, _b;
86
+ if (this.stops.length) {
87
+ return;
88
+ }
89
+ this.stops.push(this.deps.onChanged(topics => this.changed(topics)));
90
+ this.stops.push(this.deps.onReconnect(() => this.readShown(false)));
91
+ const shows = (_b = (_a = this.deps).onShown) === null || _b === void 0 ? void 0 : _b.call(_a, () => this.readShown(true));
92
+ if (shows) {
93
+ this.stops.push(shows);
94
+ }
95
+ }
96
+ /** Reads again what shows; only what changed while hidden with `stale`. */
97
+ readShown(stale) {
98
+ for (const entry of this.shown()) {
99
+ if (!stale || entry.stale) {
100
+ void this.read(entry);
101
+ }
102
+ }
103
+ }
104
+ shown() {
105
+ return [...this.entries.values()].filter(entry => entry.listeners.size > 0);
106
+ }
107
+ hidden() {
108
+ var _a, _b;
109
+ var _c;
110
+ return (_c = (_b = (_a = this.deps).hidden) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : false;
111
+ }
112
+ read(entry) {
113
+ if (entry.reading) {
114
+ entry.again = true;
115
+ return entry.reading;
116
+ }
117
+ entry.stale = false;
118
+ entry.reading = (async () => {
119
+ do {
120
+ entry.again = false;
121
+ try {
122
+ const value = await this.deps.call(entry.method, entry.params);
123
+ const json = JSON.stringify(value !== null && value !== void 0 ? value : null);
124
+ if (json !== entry.json || entry.snapshot.loading || entry.snapshot.error !== undefined) {
125
+ entry.json = json;
126
+ this.show(entry, { value: value !== null && value !== void 0 ? value : undefined, loading: false, read: entry.snapshot.read });
127
+ }
128
+ }
129
+ catch (failure) {
130
+ const error = failure instanceof Error ? failure.message : String(failure);
131
+ if (error !== entry.snapshot.error || entry.snapshot.loading) {
132
+ this.show(entry, { value: entry.snapshot.value, error, loading: false, read: entry.snapshot.read });
133
+ }
134
+ }
135
+ } while (entry.again);
136
+ })().finally(() => {
137
+ entry.reading = undefined;
138
+ });
139
+ return entry.reading;
140
+ }
141
+ show(entry, snapshot) {
142
+ entry.snapshot = snapshot;
143
+ for (const listener of [...entry.listeners]) {
144
+ listener();
145
+ }
146
+ }
147
+ }
148
+ /** The values of each extension that runs, made as it first asks. */
149
+ const OF_RUN = new WeakMap();
150
+ /** What `ui.useHost` and `onHostChanged` of an extension read: its package's host, on the connection of the page. */
151
+ export var WebHostValuesUtil;
152
+ (function (WebHostValuesUtil) {
153
+ function of(run, workbench) {
154
+ let values = OF_RUN.get(run);
155
+ if (!values) {
156
+ const { name } = run.loaded;
157
+ const visible = typeof document !== 'undefined';
158
+ values = new WebHostValues({
159
+ call: (method, params) => run.stopped
160
+ ? Promise.reject(new Error(`The web extension ${name} has stopped.`))
161
+ : workbench.packages.callPackageHost(name, method, [...params]),
162
+ onChanged: listener => WebExtensionRunUtil.track(run, () => workbench.onHostChanged((changed, topics) => changed === name && listener(topics))),
163
+ onReconnect: listener => WebExtensionRunUtil.track(run, () => workbench.onReconnect(listener)),
164
+ hidden: () => visible && document.visibilityState === 'hidden',
165
+ onShown: listener => {
166
+ if (!visible) {
167
+ return () => undefined;
168
+ }
169
+ const shown = () => document.visibilityState === 'visible' && listener();
170
+ document.addEventListener('visibilitychange', shown);
171
+ return () => document.removeEventListener('visibilitychange', shown);
172
+ },
173
+ });
174
+ OF_RUN.set(run, values);
175
+ }
176
+ return values;
177
+ }
178
+ WebHostValuesUtil.of = of;
179
+ })(WebHostValuesUtil || (WebHostValuesUtil = {}));
180
+ /** `ui.useHost` on the values of one extension. */
181
+ export function useHostValue(values, method, params = [], options = {}) {
182
+ var _a;
183
+ const key = WebHostValues.key(method, params);
184
+ // By their values, not the arrays of each render.
185
+ const topics = ((_a = options.topics) !== null && _a !== void 0 ? _a : [method]).join('\n');
186
+ const { every } = options;
187
+ const subscribe = React.useCallback((listener) => values.subscribe(key, { topics: topics.split('\n'), every }, listener), [values, key, topics, every]);
188
+ const get = React.useCallback(() => values.get(key), [values, key]);
189
+ return React.useSyncExternalStore(subscribe, get, get);
190
+ }
191
+ //# sourceMappingURL=web-host-values.js.map
@@ -1,7 +1,12 @@
1
1
  import type { SavedHost, TaWorkbench } from '../workbench-protocol.js';
2
2
  import type { WebHost, WebHosts } from './web-api-hosts.js';
3
- /** The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. */
3
+ /**
4
+ * The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. Once the extension
5
+ * stopped, it keeps no computer and moves the page to none: what acts for the user fails (WebExtensionContext).
6
+ */
4
7
  export declare namespace WebHostsUtil {
5
- function of(workbench: () => TaWorkbench): WebHosts;
8
+ function of(workbench: () => TaWorkbench, extension?: {
9
+ readonly stopped: boolean;
10
+ }): WebHosts;
6
11
  function hostOf(saved: SavedHost): WebHost;
7
12
  }
@@ -1,8 +1,11 @@
1
1
  import { HostUtil } from '../hosts.js';
2
- /** The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. */
2
+ /**
3
+ * The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. Once the extension
4
+ * stopped, it keeps no computer and moves the page to none: what acts for the user fails (WebExtensionContext).
5
+ */
3
6
  export var WebHostsUtil;
4
7
  (function (WebHostsUtil) {
5
- function of(workbench) {
8
+ function of(workbench, extension = { stopped: false }) {
6
9
  return {
7
10
  current: () => {
8
11
  const { hosts, host } = workbench().state;
@@ -10,8 +13,17 @@ export var WebHostsUtil;
10
13
  return saved && hostOf(saved);
11
14
  },
12
15
  list: () => workbench().state.hosts.map(hostOf),
13
- keep: (link, name) => workbench().keepHost(link, name),
14
- switchTo: id => workbench().switchTo(id),
16
+ keep: (link, name) => {
17
+ if (extension.stopped) {
18
+ throw new Error('The web extension has stopped.');
19
+ }
20
+ return workbench().keepHost(link, name);
21
+ },
22
+ switchTo: id => {
23
+ if (!extension.stopped) {
24
+ workbench().switchTo(id);
25
+ }
26
+ },
15
27
  };
16
28
  }
17
29
  WebHostsUtil.of = of;
@@ -0,0 +1,7 @@
1
+ import type { WebExtensionUI } from './web-extension-api.js';
2
+ import type { WebExtensionContextHost } from './web-extension-context.js';
3
+ /**
4
+ * What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
5
+ * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
6
+ */
7
+ export declare function shareUI(host: Pick<WebExtensionContextHost, 'extensions' | 'notices' | 'workbench'>, stopped: () => boolean): Pick<WebExtensionUI, 'shareExtension' | 'share' | 'ShareSheet'>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { ShareSheet } from '../components/share-sheet.js';
3
+ /**
4
+ * What `ui` gives an extension to share with (docs/design/ta-links.md 4): the share sheet of a link, that of something
5
+ * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
6
+ */
7
+ export function shareUI(host, stopped) {
8
+ const sheet = (props) => React.createElement(ShareSheet, { ...props, notices: host.notices, rooms: host.workbench.rooms });
9
+ return {
10
+ shareExtension: target => !stopped() && host.extensions.share(target),
11
+ share: item => !stopped() && host.extensions.shareItem(item),
12
+ ShareSheet: sheet,
13
+ };
14
+ }
15
+ //# sourceMappingURL=web-share-ui.js.map
@@ -0,0 +1,18 @@
1
+ import type { WebCodeRef, WebFileRef, WebShareItem, WebShareWay } from './web-api-menus.js';
2
+ /**
3
+ * Sharing, one entry for all (docs/design/ta-links.md 4.2): the item a block or a file is, the ways that take it, and
4
+ * what the sheet says of it. The page adds the one Share under a block a renderer drew and in the menu of a file.
5
+ */
6
+ export declare namespace WebShareUtil {
7
+ /** A block a renderer drew; none for one drawn as code. */
8
+ function ofBlock(block: WebCodeRef): WebShareItem | undefined;
9
+ /** A file; none for a folder. */
10
+ function ofFile(file: WebFileRef): WebShareItem | undefined;
11
+ /** The ways that take it, in their order. */
12
+ function ways(all: readonly WebShareWay[], item: WebShareItem): WebShareWay[];
13
+ /** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
14
+ function name(item: WebShareItem): string;
15
+ /** The name of its icon (WEB_ICONS): that of the kind of work, a file's. */
16
+ function icon(item: WebShareItem): string;
17
+ function label(way: WebShareWay): string;
18
+ }
@@ -0,0 +1,42 @@
1
+ import { TA_WORK_BLOCKS, TaWorkTitle } from '@celljs/ta-protocol';
2
+ /**
3
+ * Sharing, one entry for all (docs/design/ta-links.md 4.2): the item a block or a file is, the ways that take it, and
4
+ * what the sheet says of it. The page adds the one Share under a block a renderer drew and in the menu of a file.
5
+ */
6
+ export var WebShareUtil;
7
+ (function (WebShareUtil) {
8
+ /** A block a renderer drew; none for one drawn as code. */
9
+ function ofBlock(block) {
10
+ return block.drawn
11
+ ? { kind: 'block', language: block.language, code: block.code, ...(block.conversation ? { conversation: block.conversation } : {}) }
12
+ : undefined;
13
+ }
14
+ WebShareUtil.ofBlock = ofBlock;
15
+ /** A file; none for a folder. */
16
+ function ofFile(file) {
17
+ return file.kind === 'file' ? { kind: 'file', file } : undefined;
18
+ }
19
+ WebShareUtil.ofFile = ofFile;
20
+ /** The ways that take it, in their order. */
21
+ function ways(all, item) {
22
+ return all.filter(way => way.accepts(item));
23
+ }
24
+ WebShareUtil.ways = ways;
25
+ /** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
26
+ function name(item) {
27
+ var _a;
28
+ return item.kind === 'file' ? item.file.name : ((_a = TaWorkTitle.of(item.language, item.code)) !== null && _a !== void 0 ? _a : '');
29
+ }
30
+ WebShareUtil.name = name;
31
+ /** The name of its icon (WEB_ICONS): that of the kind of work, a file's. */
32
+ function icon(item) {
33
+ var _a;
34
+ return item.kind === 'file' ? 'FileText' : ((_a = TA_WORK_BLOCKS[item.language]) !== null && _a !== void 0 ? _a : 'Sparkles');
35
+ }
36
+ WebShareUtil.icon = icon;
37
+ function label(way) {
38
+ return typeof way.label === 'function' ? way.label() : way.label;
39
+ }
40
+ WebShareUtil.label = label;
41
+ })(WebShareUtil || (WebShareUtil = {}));
42
+ //# sourceMappingURL=web-share.js.map
@@ -165,6 +165,16 @@ export declare const CHAT_EN: {
165
165
  'ta.composer.voiceDenied': string;
166
166
  'ta.composer.voiceUnavailable': string;
167
167
  'ta.composer.voiceFailed': string;
168
+ 'ta.hear.offer': string;
169
+ 'ta.hear.offerHint': string;
170
+ 'ta.hear.turnOn': string;
171
+ 'ta.hear.turnedOn': string;
172
+ 'ta.hear.getting': string;
173
+ 'ta.hear.failed': string;
174
+ 'ta.hear.retry': string;
175
+ 'ta.hear.unsupported': string;
176
+ 'ta.hear.unavailable': string;
177
+ 'ta.hear.unavailableHint': string;
168
178
  'ta.talk.listening': string;
169
179
  'ta.talk.edit': string;
170
180
  'ta.talk.releaseSend': string;
@@ -165,6 +165,16 @@ export const CHAT_EN = {
165
165
  'ta.composer.voiceDenied': 'Ta may not use the microphone or speech recognition. If they are allowed already, this browser may have no speech recognition: try Safari, Chrome or the Ta app.',
166
166
  'ta.composer.voiceUnavailable': 'Speech recognition is not available in this browser (on an iPhone, turn on Siri & Dictation). Try Safari, Chrome or the Ta app.',
167
167
  'ta.composer.voiceFailed': 'Speech recognition failed: {error}',
168
+ 'ta.hear.offer': 'This device cannot recognize speech: your computer can write it down instead',
169
+ 'ta.hear.offerHint': 'Downloads a model of about {size} to the computer; it needs only the microphone, and nothing goes online.',
170
+ 'ta.hear.turnOn': 'Download and turn on',
171
+ 'ta.hear.turnedOn': 'Downloading the speech model to your computer; speak again once it is ready',
172
+ 'ta.hear.getting': 'Your computer is downloading the speech model ({percent}%); speak again once it is ready',
173
+ 'ta.hear.failed': 'The speech recognition of your computer is not ready',
174
+ 'ta.hear.retry': 'Try again',
175
+ 'ta.hear.unsupported': "This device cannot recognize speech, nor can your computer run Ta's",
176
+ 'ta.hear.unavailable': "This device cannot recognize speech, and Ta's speech recognition is off",
177
+ 'ta.hear.unavailableHint': 'Turn on Real-time voice and Local models in Settings → Extensions.',
168
178
  'ta.talk.listening': 'Listening…',
169
179
  'ta.talk.edit': 'Edit',
170
180
  'ta.talk.releaseSend': 'Release to send',