@dxos/plugin-thread 0.8.4-main.72ec0f3 → 0.8.4-main.937b3ca

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 (353) hide show
  1. package/dist/lib/browser/app-graph-builder-SPAZN5XL.mjs +188 -0
  2. package/dist/lib/browser/app-graph-builder-SPAZN5XL.mjs.map +7 -0
  3. package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs +17 -0
  4. package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs.map +7 -0
  5. package/dist/lib/browser/blueprints/index.mjs +8 -0
  6. package/dist/lib/browser/call-manager-YBRTG6T3.mjs +26 -0
  7. package/dist/lib/browser/call-manager-YBRTG6T3.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-KOBXMDCI.mjs → chunk-DLO2G3DM.mjs} +14 -12
  9. package/dist/lib/browser/chunk-DLO2G3DM.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-ZCW3NSDZ.mjs → chunk-ERK254BS.mjs} +68 -51
  11. package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  13. package/dist/lib/browser/chunk-TAWDJPMD.mjs +293 -0
  14. package/dist/lib/browser/chunk-TAWDJPMD.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-VZICDGBW.mjs +1813 -0
  16. package/dist/lib/browser/chunk-VZICDGBW.mjs.map +7 -0
  17. package/dist/lib/browser/{blueprint-definition-6BKYTMJS.mjs → chunk-ZFLSTQSE.mjs} +40 -38
  18. package/dist/lib/browser/chunk-ZFLSTQSE.mjs.map +7 -0
  19. package/dist/lib/browser/index.mjs +113 -105
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/markdown-TSXOA3GV.mjs +210 -0
  22. package/dist/lib/browser/markdown-TSXOA3GV.mjs.map +7 -0
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/operation-resolver-MDMEBYH2.mjs +441 -0
  25. package/dist/lib/browser/operation-resolver-MDMEBYH2.mjs.map +7 -0
  26. package/dist/lib/browser/react-root-Q7U5D3DA.mjs +25 -0
  27. package/dist/lib/browser/react-root-Q7U5D3DA.mjs.map +7 -0
  28. package/dist/lib/browser/{react-surface-BCD5ODQ6.mjs → react-surface-WDZQSDWH.mjs} +35 -35
  29. package/dist/lib/browser/react-surface-WDZQSDWH.mjs.map +7 -0
  30. package/dist/lib/browser/repair-TDKAFAGH.mjs +38 -0
  31. package/dist/lib/browser/repair-TDKAFAGH.mjs.map +7 -0
  32. package/dist/lib/browser/settings-OOKKVXV7.mjs +32 -0
  33. package/dist/lib/browser/settings-OOKKVXV7.mjs.map +7 -0
  34. package/dist/lib/browser/state-3LKZHDRI.mjs +24 -0
  35. package/dist/lib/browser/state-3LKZHDRI.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +7 -7
  37. package/dist/lib/node-esm/app-graph-builder-3LJAPDUW.mjs +189 -0
  38. package/dist/lib/node-esm/app-graph-builder-3LJAPDUW.mjs.map +7 -0
  39. package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs +18 -0
  40. package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs.map +7 -0
  41. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  42. package/dist/lib/node-esm/call-manager-MMCTNFOH.mjs +27 -0
  43. package/dist/lib/node-esm/call-manager-MMCTNFOH.mjs.map +7 -0
  44. package/dist/lib/node-esm/chunk-3RD3IVVD.mjs +1814 -0
  45. package/dist/lib/node-esm/chunk-3RD3IVVD.mjs.map +7 -0
  46. package/dist/lib/node-esm/{blueprint-definition-6LEAWSC7.mjs → chunk-AQHPP6ZX.mjs} +40 -38
  47. package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-ARTUUKTM.mjs +294 -0
  49. package/dist/lib/node-esm/chunk-ARTUUKTM.mjs.map +7 -0
  50. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  51. package/dist/lib/node-esm/{chunk-PZH2EDU5.mjs → chunk-KRBZBJRI.mjs} +14 -12
  52. package/dist/lib/node-esm/chunk-KRBZBJRI.mjs.map +7 -0
  53. package/dist/lib/node-esm/{chunk-7KZWZS2U.mjs → chunk-QP3KQOPQ.mjs} +68 -51
  54. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +7 -0
  55. package/dist/lib/node-esm/index.mjs +113 -105
  56. package/dist/lib/node-esm/index.mjs.map +4 -4
  57. package/dist/lib/node-esm/markdown-N2UJ3D6L.mjs +211 -0
  58. package/dist/lib/node-esm/markdown-N2UJ3D6L.mjs.map +7 -0
  59. package/dist/lib/node-esm/meta.json +1 -1
  60. package/dist/lib/node-esm/operation-resolver-7PHDJZA2.mjs +442 -0
  61. package/dist/lib/node-esm/operation-resolver-7PHDJZA2.mjs.map +7 -0
  62. package/dist/lib/node-esm/react-root-SZIGQRDZ.mjs +26 -0
  63. package/dist/lib/node-esm/react-root-SZIGQRDZ.mjs.map +7 -0
  64. package/dist/lib/node-esm/{react-surface-WZH7OAO3.mjs → react-surface-24PNWUDX.mjs} +35 -35
  65. package/dist/lib/node-esm/react-surface-24PNWUDX.mjs.map +7 -0
  66. package/dist/lib/node-esm/repair-LHLLGXKF.mjs +39 -0
  67. package/dist/lib/node-esm/repair-LHLLGXKF.mjs.map +7 -0
  68. package/dist/lib/node-esm/settings-LXZQXSPL.mjs +33 -0
  69. package/dist/lib/node-esm/settings-LXZQXSPL.mjs.map +7 -0
  70. package/dist/lib/node-esm/state-YYAK5ENM.mjs +25 -0
  71. package/dist/lib/node-esm/state-YYAK5ENM.mjs.map +7 -0
  72. package/dist/lib/node-esm/types/index.mjs +7 -7
  73. package/dist/types/src/ThreadPlugin.d.ts +2 -1
  74. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  75. package/dist/types/src/blueprints/index.d.ts +2 -0
  76. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  77. package/dist/types/src/blueprints/thread-blueprint.d.ts +21 -0
  78. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
  79. package/dist/types/src/calls/call-manager.d.ts +40 -30
  80. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  81. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
  82. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  83. package/dist/types/src/calls/media-manager.d.ts +1 -1
  84. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  85. package/dist/types/src/calls/util/calls-service.d.ts +1 -1
  86. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  87. package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
  88. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  90. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  92. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +9 -0
  94. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  96. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/call-manager/call-manager.d.ts +6 -0
  98. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/call-manager/index.d.ts +3 -0
  100. package/dist/types/src/capabilities/call-manager/index.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/index.d.ts +10 -16
  102. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  104. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  106. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  108. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  110. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  112. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  114. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  116. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  118. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  120. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  122. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  124. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/settings/settings.d.ts +5 -0
  126. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/state/index.d.ts +3 -0
  128. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/state/state.d.ts +7 -0
  130. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  131. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  132. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  133. package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
  134. package/dist/types/src/components/ChannelContainer.d.ts +4 -5
  135. package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
  136. package/dist/types/src/components/ChannelContainer.stories.d.ts +5 -1
  137. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
  138. package/dist/types/src/components/Chat.stories.d.ts +4 -0
  139. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  140. package/dist/types/src/components/ChatContainer.d.ts +2 -2
  141. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  142. package/dist/types/src/components/Comments.stories.d.ts +4 -0
  143. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  144. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  145. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
  146. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  147. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  148. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  149. package/dist/types/src/components/MessageContainer.d.ts +3 -2
  150. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  151. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  152. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +4 -0
  153. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
  154. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +4 -0
  155. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -1
  157. package/dist/types/src/components/ThreadSettings.d.ts +4 -2
  158. package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
  159. package/dist/types/src/components/index.d.ts +2 -2
  160. package/dist/types/src/components/index.d.ts.map +1 -1
  161. package/dist/types/src/components/testing.d.ts +1 -1
  162. package/dist/types/src/components/testing.d.ts.map +1 -1
  163. package/dist/types/src/extensions/threads.d.ts +7 -2
  164. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  165. package/dist/types/src/functions/create-proposals.d.ts.map +1 -1
  166. package/dist/types/src/hooks/analytics.d.ts +1 -2
  167. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  168. package/dist/types/src/index.d.ts +1 -1
  169. package/dist/types/src/index.d.ts.map +1 -1
  170. package/dist/types/src/meta.d.ts +2 -2
  171. package/dist/types/src/meta.d.ts.map +1 -1
  172. package/dist/types/src/testing/stories.d.ts +2 -1
  173. package/dist/types/src/testing/stories.d.ts.map +1 -1
  174. package/dist/types/src/translations.d.ts +4 -0
  175. package/dist/types/src/translations.d.ts.map +1 -1
  176. package/dist/types/src/types/Channel.d.ts +691 -12
  177. package/dist/types/src/types/Channel.d.ts.map +1 -1
  178. package/dist/types/src/types/capabilities.d.ts +23 -0
  179. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  180. package/dist/types/src/types/index.d.ts +1 -1
  181. package/dist/types/src/types/index.d.ts.map +1 -1
  182. package/dist/types/src/types/types.d.ts +3213 -354
  183. package/dist/types/src/types/types.d.ts.map +1 -1
  184. package/dist/types/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +86 -69
  186. package/src/ThreadPlugin.tsx +54 -90
  187. package/src/blueprints/index.ts +5 -0
  188. package/src/blueprints/thread-blueprint.ts +32 -0
  189. package/src/calls/call-manager.ts +76 -52
  190. package/src/calls/call-swarm-synchronizer.ts +2 -2
  191. package/src/calls/media-manager.ts +1 -1
  192. package/src/calls/util/calls-service.ts +1 -1
  193. package/src/calls/util/task-scheduling.ts +4 -4
  194. package/src/capabilities/app-graph-builder/app-graph-builder.ts +201 -0
  195. package/src/capabilities/app-graph-builder/index.ts +7 -0
  196. package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -0
  197. package/src/capabilities/blueprint-definition/index.ts +7 -0
  198. package/src/capabilities/call-manager/call-manager.ts +26 -0
  199. package/src/capabilities/call-manager/index.ts +7 -0
  200. package/src/capabilities/index.ts +10 -13
  201. package/src/capabilities/markdown/index.ts +7 -0
  202. package/src/capabilities/markdown/markdown.ts +83 -0
  203. package/src/capabilities/operation-resolver/index.ts +7 -0
  204. package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
  205. package/src/capabilities/react-root/index.ts +7 -0
  206. package/src/capabilities/react-root/react-root.tsx +20 -0
  207. package/src/capabilities/react-surface/index.ts +7 -0
  208. package/src/capabilities/react-surface/react-surface.tsx +97 -0
  209. package/src/capabilities/repair/index.ts +7 -0
  210. package/src/capabilities/repair/repair.ts +51 -0
  211. package/src/capabilities/settings/index.ts +7 -0
  212. package/src/capabilities/settings/settings.ts +33 -0
  213. package/src/capabilities/state/index.ts +7 -0
  214. package/src/capabilities/state/state.ts +22 -0
  215. package/src/components/Call/Call.tsx +7 -3
  216. package/src/components/Call/Toolbar.tsx +28 -20
  217. package/src/components/CallSidebar.tsx +4 -2
  218. package/src/components/ChannelContainer.stories.tsx +12 -10
  219. package/src/components/ChannelContainer.tsx +18 -16
  220. package/src/components/Chat.stories.tsx +8 -8
  221. package/src/components/ChatContainer.tsx +8 -9
  222. package/src/components/Comments.stories.tsx +22 -20
  223. package/src/components/CommentsContainer.tsx +1 -2
  224. package/src/components/CommentsThreadContainer.tsx +10 -11
  225. package/src/components/Lobby/Lobby.tsx +8 -6
  226. package/src/components/Media/AudioStream.tsx +2 -2
  227. package/src/components/Media/VideoObject.tsx +1 -1
  228. package/src/components/MessageContainer.tsx +54 -23
  229. package/src/components/Participant/Participant.tsx +31 -18
  230. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +1 -1
  231. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +1 -1
  232. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +1 -1
  233. package/src/components/ThreadCompanion.tsx +70 -65
  234. package/src/components/ThreadSettings.tsx +6 -1
  235. package/src/components/command-extension.ts +2 -2
  236. package/src/components/index.ts +2 -5
  237. package/src/components/testing.ts +1 -3
  238. package/src/extensions/threads.ts +78 -43
  239. package/src/functions/create-proposals.ts +6 -7
  240. package/src/hooks/analytics.ts +23 -20
  241. package/src/index.ts +1 -1
  242. package/src/meta.ts +2 -2
  243. package/src/testing/stories.ts +15 -11
  244. package/src/translations.ts +2 -0
  245. package/src/types/Channel.ts +13 -10
  246. package/src/types/capabilities.ts +34 -0
  247. package/src/types/index.ts +1 -1
  248. package/src/types/types.ts +161 -74
  249. package/dist/lib/browser/ChannelContainer-MX5ABVGC.mjs +0 -16
  250. package/dist/lib/browser/ChatContainer-7F5Y6GXJ.mjs +0 -15
  251. package/dist/lib/browser/app-graph-builder-HNYLII5E.mjs +0 -170
  252. package/dist/lib/browser/app-graph-builder-HNYLII5E.mjs.map +0 -7
  253. package/dist/lib/browser/blueprint-definition-6BKYTMJS.mjs.map +0 -7
  254. package/dist/lib/browser/call-manager-MAXQLMMS.mjs +0 -24
  255. package/dist/lib/browser/call-manager-MAXQLMMS.mjs.map +0 -7
  256. package/dist/lib/browser/chunk-BBTXGRIR.mjs +0 -18
  257. package/dist/lib/browser/chunk-BBTXGRIR.mjs.map +0 -7
  258. package/dist/lib/browser/chunk-BQWQFTWT.mjs +0 -612
  259. package/dist/lib/browser/chunk-BQWQFTWT.mjs.map +0 -7
  260. package/dist/lib/browser/chunk-FR6MEAZI.mjs +0 -377
  261. package/dist/lib/browser/chunk-FR6MEAZI.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-INQVAYPN.mjs +0 -989
  263. package/dist/lib/browser/chunk-INQVAYPN.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-K2DUJRFJ.mjs +0 -27
  265. package/dist/lib/browser/chunk-K2DUJRFJ.mjs.map +0 -7
  266. package/dist/lib/browser/chunk-KOBXMDCI.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-NMJEVD36.mjs +0 -168
  268. package/dist/lib/browser/chunk-NMJEVD36.mjs.map +0 -7
  269. package/dist/lib/browser/chunk-OOUDK7Q7.mjs +0 -23
  270. package/dist/lib/browser/chunk-OOUDK7Q7.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-ZCW3NSDZ.mjs.map +0 -7
  272. package/dist/lib/browser/intent-resolver-BOUT4WGY.mjs +0 -361
  273. package/dist/lib/browser/intent-resolver-BOUT4WGY.mjs.map +0 -7
  274. package/dist/lib/browser/markdown-74EUSQGV.mjs +0 -171
  275. package/dist/lib/browser/markdown-74EUSQGV.mjs.map +0 -7
  276. package/dist/lib/browser/react-root-BVG7B2LW.mjs +0 -28
  277. package/dist/lib/browser/react-root-BVG7B2LW.mjs.map +0 -7
  278. package/dist/lib/browser/react-surface-BCD5ODQ6.mjs.map +0 -7
  279. package/dist/lib/browser/settings-LGQUZITB.mjs +0 -22
  280. package/dist/lib/browser/settings-LGQUZITB.mjs.map +0 -7
  281. package/dist/lib/browser/state-36REWXO5.mjs +0 -34
  282. package/dist/lib/browser/state-36REWXO5.mjs.map +0 -7
  283. package/dist/lib/node-esm/ChannelContainer-2JJJ3IDK.mjs +0 -17
  284. package/dist/lib/node-esm/ChatContainer-C526R4DI.mjs +0 -16
  285. package/dist/lib/node-esm/app-graph-builder-SOCKP4ST.mjs +0 -171
  286. package/dist/lib/node-esm/app-graph-builder-SOCKP4ST.mjs.map +0 -7
  287. package/dist/lib/node-esm/blueprint-definition-6LEAWSC7.mjs.map +0 -7
  288. package/dist/lib/node-esm/call-manager-LC4OS2KD.mjs +0 -25
  289. package/dist/lib/node-esm/call-manager-LC4OS2KD.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-5DLH4MWN.mjs +0 -25
  291. package/dist/lib/node-esm/chunk-5DLH4MWN.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-7KZWZS2U.mjs.map +0 -7
  293. package/dist/lib/node-esm/chunk-JF7THR7F.mjs +0 -990
  294. package/dist/lib/node-esm/chunk-JF7THR7F.mjs.map +0 -7
  295. package/dist/lib/node-esm/chunk-JJW6YMLC.mjs +0 -613
  296. package/dist/lib/node-esm/chunk-JJW6YMLC.mjs.map +0 -7
  297. package/dist/lib/node-esm/chunk-PZH2EDU5.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-TJKM5JZT.mjs +0 -169
  299. package/dist/lib/node-esm/chunk-TJKM5JZT.mjs.map +0 -7
  300. package/dist/lib/node-esm/chunk-TWKGDFCS.mjs +0 -378
  301. package/dist/lib/node-esm/chunk-TWKGDFCS.mjs.map +0 -7
  302. package/dist/lib/node-esm/chunk-XI45H4IV.mjs +0 -28
  303. package/dist/lib/node-esm/chunk-XI45H4IV.mjs.map +0 -7
  304. package/dist/lib/node-esm/chunk-ZQAGII7M.mjs +0 -19
  305. package/dist/lib/node-esm/chunk-ZQAGII7M.mjs.map +0 -7
  306. package/dist/lib/node-esm/intent-resolver-45PLIFCJ.mjs +0 -362
  307. package/dist/lib/node-esm/intent-resolver-45PLIFCJ.mjs.map +0 -7
  308. package/dist/lib/node-esm/markdown-566XXB55.mjs +0 -172
  309. package/dist/lib/node-esm/markdown-566XXB55.mjs.map +0 -7
  310. package/dist/lib/node-esm/react-root-DCY6DKLC.mjs +0 -29
  311. package/dist/lib/node-esm/react-root-DCY6DKLC.mjs.map +0 -7
  312. package/dist/lib/node-esm/react-surface-WZH7OAO3.mjs.map +0 -7
  313. package/dist/lib/node-esm/settings-WKLJSP6R.mjs +0 -23
  314. package/dist/lib/node-esm/settings-WKLJSP6R.mjs.map +0 -7
  315. package/dist/lib/node-esm/state-X3W67GTL.mjs +0 -35
  316. package/dist/lib/node-esm/state-X3W67GTL.mjs.map +0 -7
  317. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  318. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  319. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
  320. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  321. package/dist/types/src/capabilities/call-manager.d.ts +0 -5
  322. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  323. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  324. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  325. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  326. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  327. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  328. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  329. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  330. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  331. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  332. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  333. package/dist/types/src/capabilities/settings.d.ts +0 -4
  334. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  335. package/dist/types/src/capabilities/state.d.ts +0 -7
  336. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  337. package/dist/types/src/types/Thread.d.ts +0 -167
  338. package/dist/types/src/types/Thread.d.ts.map +0 -1
  339. package/src/capabilities/app-graph-builder.ts +0 -194
  340. package/src/capabilities/blueprint-definition.ts +0 -38
  341. package/src/capabilities/call-manager.ts +0 -20
  342. package/src/capabilities/capabilities.ts +0 -33
  343. package/src/capabilities/intent-resolver.ts +0 -311
  344. package/src/capabilities/markdown.ts +0 -71
  345. package/src/capabilities/react-root.tsx +0 -17
  346. package/src/capabilities/react-surface.tsx +0 -90
  347. package/src/capabilities/settings.ts +0 -19
  348. package/src/capabilities/state.ts +0 -26
  349. package/src/types/Thread.ts +0 -26
  350. /package/dist/lib/browser/{ChannelContainer-MX5ABVGC.mjs.map → blueprints/index.mjs.map} +0 -0
  351. /package/dist/lib/browser/{ChatContainer-7F5Y6GXJ.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  352. /package/dist/lib/node-esm/{ChannelContainer-2JJJ3IDK.mjs.map → blueprints/index.mjs.map} +0 -0
  353. /package/dist/lib/node-esm/{ChatContainer-C526R4DI.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -2,13 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import React, { type FC, type PropsWithChildren } from 'react';
6
7
 
7
8
  import { useCapability } from '@dxos/app-framework/react';
8
9
  import { type ThemedClassName } from '@dxos/react-ui';
9
10
 
10
- import { ThreadCapabilities } from '../../capabilities';
11
11
  import { useDebugMode } from '../../hooks';
12
+ import { ThreadCapabilities } from '../../types';
12
13
  import { AudioStream } from '../Media';
13
14
  import { ParticipantGrid } from '../Participant';
14
15
 
@@ -34,8 +35,9 @@ type CallAudioProps = {};
34
35
 
35
36
  const CallAudio: FC<CallAudioProps> = () => {
36
37
  const call = useCapability(ThreadCapabilities.CallManager);
38
+ const audioTracksToPlay = useAtomValue(call.audioTracksToPlayAtom);
37
39
 
38
- return <AudioStream tracks={call.audioTracksToPlay} />;
40
+ return <AudioStream tracks={audioTracksToPlay} />;
39
41
  };
40
42
 
41
43
  CallAudio.displayName = 'CallAudio';
@@ -51,10 +53,12 @@ type CallGridProps = {
51
53
  const CallGrid: FC<CallGridProps> = ({ fullscreen }) => {
52
54
  const debug = useDebugMode();
53
55
  const call = useCapability(ThreadCapabilities.CallManager);
56
+ const self = useAtomValue(call.selfAtom);
57
+ const users = useAtomValue(call.usersAtom);
54
58
 
55
59
  return (
56
60
  <div className='grid grow p-4 dark:bg-neutral-900'>
57
- <ParticipantGrid self={call.self} users={call.users} debug={debug} fullscreen={fullscreen} />
61
+ <ParticipantGrid self={self} users={users} debug={debug} fullscreen={fullscreen} />
58
62
  </div>
59
63
  );
60
64
  };
@@ -2,10 +2,12 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import React from 'react';
6
7
 
7
8
  import { useAppGraph, useCapability } from '@dxos/app-framework/react';
8
9
  import { Obj } from '@dxos/echo';
10
+ import { Node, useActionRunner } from '@dxos/plugin-graph';
9
11
  import { useActions, useNode } from '@dxos/plugin-graph';
10
12
  import {
11
13
  Icon,
@@ -16,10 +18,10 @@ import {
16
18
  toLocalizedString,
17
19
  useTranslation,
18
20
  } from '@dxos/react-ui';
19
- import { groupHoverControlItemWithTransition, mx } from '@dxos/react-ui-theme';
21
+ import { groupHoverControlItemWithTransition, mx } from '@dxos/ui-theme';
20
22
 
21
- import { ThreadCapabilities } from '../../capabilities';
22
23
  import { meta } from '../../meta';
24
+ import { ThreadCapabilities } from '../../types';
23
25
  import { type Channel } from '../../types';
24
26
 
25
27
  export type ToolbarProps = ThemedClassName<{
@@ -42,14 +44,18 @@ export const Toolbar = ({
42
44
  }: ToolbarProps) => {
43
45
  const { t } = useTranslation(meta.id);
44
46
  const { graph } = useAppGraph();
47
+ const runAction = useActionRunner();
45
48
  const call = useCapability(ThreadCapabilities.CallManager);
49
+ const media = useAtomValue(call.mediaAtom);
50
+ const joined = useAtomValue(call.joinedAtom);
51
+ const raisedHand = useAtomValue(call.raisedHandAtom);
46
52
 
47
53
  // Channel app graph node.
48
54
  const node = useNode(graph, channel && Obj.getDXN(channel).toString());
49
55
  const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === 'toolbar');
50
56
 
51
57
  // Screen sharing.
52
- const isScreensharing = call.media.screenshareTrack !== undefined;
58
+ const isScreensharing = media.screenshareTrack !== undefined;
53
59
  const canSharescreen =
54
60
  typeof navigator.mediaDevices !== 'undefined' && navigator.mediaDevices.getDisplayMedia !== undefined;
55
61
 
@@ -58,7 +64,7 @@ export const Toolbar = ({
58
64
  <div className={mx('z-20 flex justify-center m-8', autoHideControls && groupHoverControlItemWithTransition)}>
59
65
  <NaturalToolbar.Root classNames={['p-2 bg-modalSurface rounded-md shadow-md', classNames]}>
60
66
  <ToggleButton
61
- active={call.media.audioEnabled}
67
+ active={media.audioEnabled}
62
68
  state={{
63
69
  on: {
64
70
  icon: 'ph--microphone--regular',
@@ -70,12 +76,12 @@ export const Toolbar = ({
70
76
  icon: 'ph--microphone-slash--duotone',
71
77
  label: t('mic on'),
72
78
  onClick: () => call.turnAudioOn(),
73
- classNames: [call.joined && 'bg-callAlert'],
79
+ classNames: [joined && 'bg-callAlert'],
74
80
  },
75
81
  }}
76
82
  />
77
83
  <ToggleButton
78
- active={call.media.videoEnabled}
84
+ active={media.videoEnabled}
79
85
  state={{
80
86
  on: {
81
87
  icon: 'ph--video-camera--regular',
@@ -97,7 +103,7 @@ export const Toolbar = ({
97
103
  </div>
98
104
  )) || <NaturalToolbar.Separator variant='gap' />}
99
105
 
100
- {call.joined && (
106
+ {joined && (
101
107
  <>
102
108
  <ToggleButton
103
109
  disabled={!canSharescreen}
@@ -117,25 +123,27 @@ export const Toolbar = ({
117
123
  />
118
124
 
119
125
  {/* Companion actions. */}
120
- {actions.map((action) => (
121
- <IconButton
122
- key={action.id}
123
- {...defaultButtonProps}
124
- icon={action.properties.icon}
125
- label={toLocalizedString(action.properties.label, t)}
126
- classNames={action.properties.classNames}
127
- onClick={() => action.data({ node })}
128
- />
129
- ))}
126
+ {actions
127
+ .filter((action): action is Node.Action => Node.isAction(action))
128
+ .map((action) => (
129
+ <IconButton
130
+ key={action.id}
131
+ {...defaultButtonProps}
132
+ icon={action.properties.icon}
133
+ label={toLocalizedString(action.properties.label, t)}
134
+ classNames={action.properties.classNames}
135
+ onClick={() => node && void runAction(action, { parent: node })}
136
+ />
137
+ ))}
130
138
 
131
139
  <ToggleButton
132
- active={call.raisedHand}
140
+ active={raisedHand}
133
141
  state={{
134
142
  on: {
135
143
  icon: 'ph--hand-waving--regular',
136
144
  label: t('lower hand'),
137
145
  onClick: () => call.setRaisedHand(false),
138
- classNames: [call.joined && 'bg-callAlert'],
146
+ classNames: [joined && 'bg-callAlert'],
139
147
  },
140
148
  off: {
141
149
  icon: 'ph--hand-palm--duotone',
@@ -146,7 +154,7 @@ export const Toolbar = ({
146
154
  />
147
155
  </>
148
156
  )}
149
- {call.joined ? (
157
+ {joined ? (
150
158
  <IconButton variant='destructive' icon='ph--phone-x--regular' label={t('leave call')} onClick={onLeave} />
151
159
  ) : (
152
160
  <IconButton variant='primary' icon='ph--phone-incoming--regular' label={t('join call')} onClick={onJoin} />
@@ -2,17 +2,19 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import React from 'react';
6
7
 
7
8
  import { useCapability } from '@dxos/app-framework/react';
8
9
 
9
- import { ThreadCapabilities } from '../capabilities';
10
+ import { ThreadCapabilities } from '../types';
10
11
 
11
12
  import { ChannelContainer } from './ChannelContainer';
12
13
 
13
14
  export const CallSidebar = () => {
14
15
  const call = useCapability(ThreadCapabilities.CallManager);
15
- return <ChannelContainer roomId={call.roomId} />;
16
+ const roomId = useAtomValue(call.roomIdAtom);
17
+ return <ChannelContainer subject={undefined} roomId={roomId} />;
16
18
  };
17
19
 
18
20
  export default CallSidebar;
@@ -5,29 +5,28 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React from 'react';
7
7
 
8
- import { contributes } from '@dxos/app-framework';
8
+ import { Capability, Common } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { ClientCapabilities } from '@dxos/plugin-client';
11
- import { Query, useQuery, useSpace } from '@dxos/react-client/echo';
10
+ import { Query, useDatabase, useQuery } from '@dxos/react-client/echo';
12
11
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
13
12
  import { render } from '@dxos/storybook-utils';
14
- import { Message } from '@dxos/types';
13
+ import { Message, Thread } from '@dxos/types';
15
14
 
16
15
  import { createThreadPlugins } from '../testing';
17
16
  import { translations } from '../translations';
18
- import { Channel, Thread } from '../types';
17
+ import { Channel } from '../types';
19
18
 
20
19
  import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
21
20
 
22
21
  // TODO(wittjosiah): Channel doesn't render full height.
23
22
  const DefaultStory = ({ roomId }: ChannelContainerProps) => {
24
- const space = useSpace();
25
- const [channel] = useQuery(space, Query.type(Channel.Channel));
23
+ const db = useDatabase();
24
+ const [channel] = useQuery(db, Query.type(Channel.Channel));
26
25
  if (!channel) {
27
26
  return null;
28
27
  }
29
28
 
30
- return <ChannelContainer channel={channel} roomId={roomId} />;
29
+ return <ChannelContainer subject={channel} roomId={roomId} />;
31
30
  };
32
31
 
33
32
  const meta = {
@@ -36,10 +35,12 @@ const meta = {
36
35
  render: render(DefaultStory),
37
36
  decorators: [
38
37
  withTheme,
39
- withLayout({ container: 'column' }),
38
+ withLayout({ layout: 'column' }),
40
39
  withPluginManager({
41
40
  plugins: [...(await createThreadPlugins())],
42
- capabilities: [contributes(ClientCapabilities.Schema, [Channel.Channel, Thread.Thread, Message.Message])],
41
+ capabilities: [
42
+ Capability.contributes(Common.Capability.Schema, [Channel.Channel, Thread.Thread, Message.Message]),
43
+ ],
43
44
  }),
44
45
  ],
45
46
  parameters: {
@@ -54,6 +55,7 @@ type Story = StoryObj<typeof meta>;
54
55
  export const Default: Story = {
55
56
  args: {
56
57
  // Fixed room for testing.
58
+ subject: undefined,
57
59
  roomId: '04a1d1911703b8e929d0649021a965',
58
60
  },
59
61
  };
@@ -2,10 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Atom } from '@effect-atom/atom-react';
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
6
  import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
7
7
 
8
- import { useCapabilities, useCapability } from '@dxos/app-framework/react';
8
+ import { type SurfaceComponentProps, useCapabilities, useCapability } from '@dxos/app-framework/react';
9
9
  import { Context } from '@dxos/context';
10
10
  import { failUndefined } from '@dxos/debug';
11
11
  import { Obj } from '@dxos/echo';
@@ -19,30 +19,32 @@ import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMe
19
19
  import { useSoundEffect } from '@dxos/react-ui-sfx';
20
20
  import { StackItem } from '@dxos/react-ui-stack';
21
21
 
22
- import { ThreadCapabilities } from '../capabilities';
23
22
  import { meta } from '../meta';
23
+ import { ThreadCapabilities } from '../types';
24
24
  import { type Channel } from '../types';
25
25
 
26
26
  import { Call } from './Call';
27
27
  import ChatContainer from './ChatContainer';
28
28
 
29
- // TODO(burdon): Create Radix style layout.
30
-
31
- export type ChannelContainerProps = {
32
- channel?: Channel.Channel;
33
- roomId?: string;
34
- role?: string;
35
- fullscreen?: boolean;
36
- };
29
+ export type ChannelContainerProps = SurfaceComponentProps<
30
+ Channel.Channel | undefined,
31
+ {
32
+ roomId?: string;
33
+ fullscreen?: boolean;
34
+ }
35
+ >;
37
36
 
38
37
  /**
39
38
  * Renders a call when active, otherwise renders the channel chat.
40
39
  */
41
- export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
40
+ // TODO(burdon): Create Radix style layout.
41
+ export const ChannelContainer = ({ role, subject: channel, roomId: roomIdProp, fullscreen }: ChannelContainerProps) => {
42
42
  const space = getSpace(channel);
43
43
  const callManager = useCapability(ThreadCapabilities.CallManager);
44
+ const joined = useAtomValue(callManager.joinedAtom);
45
+ const currentRoomId = useAtomValue(callManager.roomIdAtom);
44
46
  const attendableId = channel ? Obj.getDXN(channel).toString() : undefined;
45
- const roomId = _roomId ?? attendableId ?? failUndefined();
47
+ const roomId = roomIdProp ?? attendableId ?? failUndefined();
46
48
  const identity = useIdentity();
47
49
  const isNamed = !!identity?.profile?.displayName;
48
50
  const joinSound = useSoundEffect('JoinCall');
@@ -83,7 +85,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
83
85
  return;
84
86
  }
85
87
 
86
- if (callManager.joined) {
88
+ if (joined) {
87
89
  await callManager.leave();
88
90
  }
89
91
 
@@ -96,7 +98,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
96
98
  // TODO(burdon): Error sound.
97
99
  log.catch(err);
98
100
  }
99
- }, [extensions, channel, roomId]);
101
+ }, [extensions, channel, roomId, joined]);
100
102
 
101
103
  /**
102
104
  * Leave the call.
@@ -115,7 +117,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
115
117
  }
116
118
  }, [extensions, roomId]);
117
119
 
118
- const isJoined = callManager.joined && callManager.roomId === roomId;
120
+ const isJoined = joined && currentRoomId === roomId;
119
121
 
120
122
  return (
121
123
  <StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
@@ -5,7 +5,7 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
- import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
8
+ import { Capability, Common, OperationPlugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
10
  import { faker } from '@dxos/random';
11
11
  import { useClient } from '@dxos/react-client';
@@ -16,10 +16,10 @@ import { useAsyncEffect } from '@dxos/react-ui';
16
16
  import { withTheme } from '@dxos/react-ui/testing';
17
17
  import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
18
18
  import { render } from '@dxos/storybook-utils';
19
- import { Message } from '@dxos/types';
19
+ import { Message, Thread } from '@dxos/types';
20
20
 
21
21
  import { translations } from '../translations';
22
- import { Channel, Thread } from '../types';
22
+ import { Channel } from '../types';
23
23
 
24
24
  import { ChatContainer } from './ChatContainer';
25
25
 
@@ -45,7 +45,7 @@ const DefaultStory = () => {
45
45
  }
46
46
 
47
47
  return (
48
- <main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
48
+ <main className='is-full max-is-proseMaxWidth mli-auto bs-full overflow-hidden'>
49
49
  <ChatContainer space={space} thread={channel.defaultThread.target} />
50
50
  </main>
51
51
  );
@@ -58,11 +58,11 @@ const meta = {
58
58
  decorators: [
59
59
  withTheme,
60
60
  withPluginManager({
61
- plugins: [IntentPlugin()],
61
+ plugins: [OperationPlugin()],
62
62
  capabilities: [
63
- contributes(
64
- Capabilities.ReactSurface,
65
- createSurface({
63
+ Capability.contributes(
64
+ Common.Capability.ReactSurface,
65
+ Common.createSurface({
66
66
  id: 'test',
67
67
  role: 'card',
68
68
  component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
@@ -8,9 +8,7 @@ import { Obj, Ref } from '@dxos/echo';
8
8
  import { type Space, useMembers } from '@dxos/react-client/echo';
9
9
  import { useIdentity } from '@dxos/react-client/halo';
10
10
  import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
11
- import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
12
11
  import { StackItem } from '@dxos/react-ui-stack';
13
- import { mx } from '@dxos/react-ui-theme';
14
12
  import {
15
13
  MessageTextbox,
16
14
  type MessageTextboxProps,
@@ -18,12 +16,13 @@ import {
18
16
  type ThreadRootProps,
19
17
  threadLayout,
20
18
  } from '@dxos/react-ui-thread';
21
- import { Message } from '@dxos/types';
19
+ import { Message, type Thread } from '@dxos/types';
20
+ import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
21
+ import { mx } from '@dxos/ui-theme';
22
22
  import { isNonNullable } from '@dxos/util';
23
23
 
24
24
  import { useStatus } from '../hooks';
25
25
  import { meta } from '../meta';
26
- import { type Thread } from '../types';
27
26
  import { getMessageMetadata } from '../util';
28
27
 
29
28
  import { command } from './command-extension';
@@ -45,7 +44,7 @@ export type ChatContainerProps = ThemedClassName<
45
44
  {
46
45
  space: Space;
47
46
  thread: Thread.Thread;
48
- context?: Obj.Any;
47
+ context?: Obj.Unknown;
49
48
  autoFocusTextbox?: boolean;
50
49
  } & Pick<ThreadRootProps, 'current'>
51
50
  >;
@@ -61,7 +60,7 @@ export const ChatContainer = ({
61
60
  const { t } = useTranslation(meta.id);
62
61
  const id = Obj.getDXN(thread).toString();
63
62
  const identity = useIdentity()!;
64
- const members = useMembers(space?.key);
63
+ const members = useMembers(space?.id);
65
64
  const activity = useStatus(space, id);
66
65
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
67
66
  const [_count, _setCount] = useState(0);
@@ -139,10 +138,10 @@ export const ChatContainer = ({
139
138
  </div>
140
139
  {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
141
140
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
142
- <ScrollArea.Scrollbar>
143
- <ScrollArea.Thumb />
144
- </ScrollArea.Scrollbar>
145
141
  </ScrollArea.Viewport>
142
+ <ScrollArea.Scrollbar>
143
+ <ScrollArea.Thumb />
144
+ </ScrollArea.Scrollbar>
146
145
  </ScrollArea.Root>
147
146
 
148
147
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
@@ -3,22 +3,23 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
6
7
  import React from 'react';
7
8
 
8
- import { IntentPlugin } from '@dxos/app-framework';
9
+ import { OperationPlugin } from '@dxos/app-framework';
9
10
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { Obj, Query, Relation, Type } from '@dxos/echo';
11
+ import { Obj, Query, Relation } from '@dxos/echo';
12
+ import { TestSchema } from '@dxos/echo/testing';
11
13
  import { ClientPlugin } from '@dxos/plugin-client';
12
14
  import { faker } from '@dxos/random';
13
- import { useQuery, useSpace } from '@dxos/react-client/echo';
15
+ import { useDatabase, useQuery } from '@dxos/react-client/echo';
14
16
  import { useIdentity } from '@dxos/react-client/halo';
15
17
  import { useAsyncEffect } from '@dxos/react-ui';
16
18
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
19
  import { render } from '@dxos/storybook-utils';
18
- import { AnchoredTo, Message } from '@dxos/types';
20
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
19
21
 
20
22
  import { translations } from '../translations';
21
- import { Thread } from '../types';
22
23
 
23
24
  import { CommentsContainer } from './CommentsContainer';
24
25
  import { createCommentThread, createProposalThread } from './testing';
@@ -27,22 +28,22 @@ faker.seed(1);
27
28
 
28
29
  const DefaultStory = () => {
29
30
  const identity = useIdentity();
30
- const space = useSpace();
31
- const anchors = useQuery(space, Query.type(AnchoredTo.AnchoredTo));
31
+ const db = useDatabase();
32
+ const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
32
33
 
33
34
  useAsyncEffect(async () => {
34
- if (identity && space) {
35
- const object = space.db.add(Obj.make(Type.Expando, {}));
36
- const thread1 = space.db.add(createCommentThread(identity));
37
- const thread2 = space.db.add(createProposalThread(identity));
38
- space.db.add(
35
+ if (identity && db) {
36
+ const object = db.add(Obj.make(TestSchema.Expando, {}));
37
+ const thread1 = db.add(createCommentThread(identity));
38
+ const thread2 = db.add(createProposalThread(identity));
39
+ db.add(
39
40
  Relation.make(AnchoredTo.AnchoredTo, {
40
41
  [Relation.Source]: thread1,
41
42
  [Relation.Target]: object,
42
43
  anchor: 'test',
43
44
  }),
44
45
  );
45
- space.db.add(
46
+ db.add(
46
47
  Relation.make(AnchoredTo.AnchoredTo, {
47
48
  [Relation.Source]: thread2,
48
49
  [Relation.Target]: object,
@@ -50,9 +51,9 @@ const DefaultStory = () => {
50
51
  }),
51
52
  );
52
53
  }
53
- }, [identity, space]);
54
+ }, [identity, db]);
54
55
 
55
- if (!identity || !space || !anchors) {
56
+ if (!identity || !db || !anchors) {
56
57
  return null;
57
58
  }
58
59
 
@@ -64,17 +65,18 @@ const meta = {
64
65
  render: render(DefaultStory),
65
66
  decorators: [
66
67
  withTheme,
67
- withLayout({ container: 'column', scroll: true }),
68
+ withLayout({ layout: 'column', scroll: true }),
68
69
  // TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
69
70
  // Currently this is required due to useOnEditAnalytics.
70
71
  withPluginManager({
71
72
  plugins: [
72
- IntentPlugin(),
73
+ OperationPlugin(),
73
74
  ClientPlugin({
74
75
  types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
75
- onClientInitialized: async ({ client }) => {
76
- await client.halo.createIdentity();
77
- },
76
+ onClientInitialized: ({ client }) =>
77
+ Effect.gen(function* () {
78
+ yield* Effect.promise(() => client.halo.createIdentity());
79
+ }),
78
80
  }),
79
81
  ],
80
82
  }),
@@ -6,10 +6,9 @@ import React, { useEffect } from 'react';
6
6
 
7
7
  import { Obj, Relation } from '@dxos/echo';
8
8
  import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
9
- import { type AnchoredTo } from '@dxos/types';
9
+ import { type AnchoredTo, type Thread } from '@dxos/types';
10
10
 
11
11
  import { meta } from '../meta';
12
- import { type Thread } from '../types';
13
12
 
14
13
  import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
15
14
 
@@ -4,24 +4,23 @@
4
4
 
5
5
  import React, { useCallback, useMemo, useRef, useState } from 'react';
6
6
 
7
- import { Obj, Ref, Relation } from '@dxos/echo';
7
+ import { Obj, Relation } from '@dxos/echo';
8
+ import { useObject } from '@dxos/echo-react';
8
9
  import { getSpace, useMembers } from '@dxos/react-client/echo';
9
10
  import { useIdentity } from '@dxos/react-client/halo';
10
11
  import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
11
- import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
12
- import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
13
12
  import {
14
13
  MessageTextbox,
15
14
  type MessageTextboxProps,
16
15
  Thread as ThreadComponent,
17
16
  type ThreadRootProps,
18
17
  } from '@dxos/react-ui-thread';
19
- import { type AnchoredTo } from '@dxos/types';
20
- import { isNonNullable } from '@dxos/util';
18
+ import { type AnchoredTo, type Thread } from '@dxos/types';
19
+ import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
20
+ import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';
21
21
 
22
22
  import { useStatus } from '../hooks';
23
23
  import { meta } from '../meta';
24
- import { type Thread } from '../types';
25
24
  import { getMessageMetadata } from '../util';
26
25
 
27
26
  import { command } from './command-extension';
@@ -51,9 +50,10 @@ export const CommentsThreadContainer = ({
51
50
  const { t } = useTranslation(meta.id);
52
51
  const identity = useIdentity()!;
53
52
  const space = getSpace(anchor);
54
- const members = useMembers(space?.key);
53
+ const members = useMembers(space?.id);
55
54
  const detached = !anchor.anchor;
56
55
  const thread = Relation.getSource(anchor) as Thread.Thread;
56
+ const [messages] = useObject(thread, 'messages');
57
57
  const activity = useStatus(space, Obj.getDXN(thread).toString());
58
58
  const threadScrollRef = useRef<HTMLDivElement | null>(null);
59
59
 
@@ -145,12 +145,11 @@ export const CommentsThreadContainer = ({
145
145
  </div>
146
146
  </div>
147
147
 
148
- {/** TODO(dmaretskyi): How's `thread.messages` undefined? */}
149
- {Ref.Array.targets(thread.messages?.filter(isNonNullable) ?? []).map((message) => (
148
+ {messages?.map((ref) => (
150
149
  <MessageContainer
151
- key={message.id}
150
+ key={ref.dxn.toString()}
152
151
  editable
153
- message={message}
152
+ message={ref}
154
153
  members={members}
155
154
  onDelete={handleMessageDelete}
156
155
  onAcceptProposal={handleAcceptProposal}
@@ -2,14 +2,15 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
6
7
 
7
8
  import { useCapability } from '@dxos/app-framework/react';
8
9
  import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
10
+ import { mx } from '@dxos/ui-theme';
10
11
 
11
- import { ThreadCapabilities } from '../../capabilities';
12
12
  import { meta } from '../../meta';
13
+ import { ThreadCapabilities } from '../../types';
13
14
  import { Toolbar, type ToolbarProps } from '../Call';
14
15
  import { VideoObject } from '../Media';
15
16
  import { ResponsiveContainer } from '../ResponsiveGrid';
@@ -39,9 +40,10 @@ type LobbyPreviewProps = {};
39
40
  const LobbyPreview: FC<LobbyPreviewProps> = () => {
40
41
  const { t } = useTranslation(meta.id);
41
42
  const call = useCapability(ThreadCapabilities.CallManager);
43
+ const media = useAtomValue(call.mediaAtom);
42
44
  const [classNames, setClassNames] = useState('');
43
45
  useEffect(() => {
44
- if (!call.media.videoEnabled) {
46
+ if (!media.videoEnabled) {
45
47
  setClassNames('');
46
48
  return;
47
49
  }
@@ -52,14 +54,14 @@ const LobbyPreview: FC<LobbyPreviewProps> = () => {
52
54
  }, 500);
53
55
 
54
56
  return () => clearTimeout(timeout);
55
- }, [call.media.videoEnabled]);
57
+ }, [media.videoEnabled]);
56
58
 
57
59
  return (
58
60
  <div className='grid grow p-4'>
59
61
  <ResponsiveContainer>
60
- {(call.media.videoEnabled && (
62
+ {(media.videoEnabled && (
61
63
  <VideoObject
62
- videoStream={call.media.videoStream}
64
+ videoStream={media.videoStream}
63
65
  flip
64
66
  muted
65
67
  classNames={mx(