@dxos/plugin-thread 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d

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 (294) hide show
  1. package/dist/lib/browser/ChannelContainer-O2SFQJU7.mjs +16 -0
  2. package/dist/lib/browser/ChatContainer-PVT3DUZJ.mjs +15 -0
  3. package/dist/lib/browser/{app-graph-builder-OY7R7EJP.mjs → app-graph-builder-AF3M7UWN.mjs} +8 -8
  4. package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs.map +7 -0
  5. package/dist/lib/browser/{call-manager-APQAZWHT.mjs → call-manager-XRRCAVLI.mjs} +6 -5
  6. package/dist/lib/browser/call-manager-XRRCAVLI.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2CWJBXBH.mjs +21 -0
  8. package/dist/lib/browser/{chunk-R5MDLUPC.mjs → chunk-4APCDRSH.mjs} +3 -3
  9. package/dist/lib/browser/{chunk-R5MDLUPC.mjs.map → chunk-4APCDRSH.mjs.map} +1 -1
  10. package/dist/lib/browser/{chunk-AEXWNS6Z.mjs → chunk-DW7JD64V.mjs} +14 -5
  11. package/dist/lib/browser/chunk-DW7JD64V.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-IIUTBDVB.mjs → chunk-EV4JWI7L.mjs} +2 -2
  13. package/dist/lib/browser/chunk-FY4ZRD5X.mjs +367 -0
  14. package/dist/lib/browser/chunk-FY4ZRD5X.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-JKQUJOTX.mjs → chunk-GERVMFQW.mjs} +2 -2
  16. package/dist/lib/browser/chunk-J3JO5NWO.mjs +477 -0
  17. package/dist/lib/browser/chunk-J3JO5NWO.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-JGKMMI65.mjs +56 -0
  19. package/dist/lib/browser/chunk-JGKMMI65.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-4H4A264L.mjs → chunk-TUFWPOVS.mjs} +148 -158
  21. package/dist/lib/browser/chunk-TUFWPOVS.mjs.map +7 -0
  22. package/dist/lib/browser/{chunk-5P5BH5GE.mjs → chunk-X5PIP5YR.mjs} +67 -6
  23. package/dist/lib/browser/chunk-X5PIP5YR.mjs.map +7 -0
  24. package/dist/lib/browser/{chunk-XZKBN3NS.mjs → chunk-ZJ7QBXK6.mjs} +246 -245
  25. package/dist/lib/browser/chunk-ZJ7QBXK6.mjs.map +7 -0
  26. package/dist/lib/browser/index.mjs +36 -42
  27. package/dist/lib/browser/index.mjs.map +3 -3
  28. package/dist/lib/browser/{intent-resolver-FK2MDVDT.mjs → intent-resolver-DCY4P4OX.mjs} +31 -15
  29. package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs.map +7 -0
  30. package/dist/lib/browser/{markdown-TE5SWWNJ.mjs → markdown-WZSXCEZJ.mjs} +8 -8
  31. package/dist/lib/browser/markdown-WZSXCEZJ.mjs.map +7 -0
  32. package/dist/lib/browser/meta.json +1 -1
  33. package/dist/lib/browser/react-root-QXPALOUQ.mjs +28 -0
  34. package/dist/lib/browser/{react-surface-VXUJKSOG.mjs → react-surface-PYAMIADB.mjs} +12 -11
  35. package/dist/lib/browser/react-surface-PYAMIADB.mjs.map +7 -0
  36. package/dist/lib/browser/{settings-RB2RSLXV.mjs → settings-AC6YSASL.mjs} +4 -4
  37. package/dist/lib/browser/{state-RKL5MSDP.mjs → state-2T4KDWBX.mjs} +4 -4
  38. package/dist/lib/browser/{state-RKL5MSDP.mjs.map → state-2T4KDWBX.mjs.map} +2 -2
  39. package/dist/lib/browser/types/index.mjs +2 -2
  40. package/dist/lib/node-esm/ChannelContainer-B2ZGAE4P.mjs +17 -0
  41. package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs → ChatContainer-2CT4PJ7I.mjs} +6 -5
  42. package/dist/lib/node-esm/{app-graph-builder-BAHBHYWI.mjs → app-graph-builder-OLSJVCWY.mjs} +8 -8
  43. package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs.map +7 -0
  44. package/dist/lib/node-esm/{call-manager-UUYXLF4T.mjs → call-manager-EI7FXRAU.mjs} +6 -5
  45. package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs.map +7 -0
  46. package/dist/lib/node-esm/{chunk-WXNPD542.mjs → chunk-4TME3BR4.mjs} +147 -158
  47. package/dist/lib/node-esm/chunk-4TME3BR4.mjs.map +7 -0
  48. package/dist/lib/node-esm/{chunk-PGRP3O4O.mjs → chunk-57XR3LEF.mjs} +2 -2
  49. package/dist/lib/node-esm/chunk-6CRHHOST.mjs +23 -0
  50. package/dist/lib/node-esm/chunk-BF4UKS55.mjs +368 -0
  51. package/dist/lib/node-esm/chunk-BF4UKS55.mjs.map +7 -0
  52. package/dist/lib/node-esm/{chunk-ESQC6SYE.mjs → chunk-GRLRWTRU.mjs} +2 -2
  53. package/dist/lib/node-esm/{chunk-K4KAUOKT.mjs → chunk-PYTVBN5J.mjs} +3 -3
  54. package/dist/lib/node-esm/{chunk-K4KAUOKT.mjs.map → chunk-PYTVBN5J.mjs.map} +1 -1
  55. package/dist/lib/node-esm/chunk-QBHKLWGR.mjs +58 -0
  56. package/dist/lib/node-esm/chunk-QBHKLWGR.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-O3V45YJP.mjs → chunk-SED3O2XO.mjs} +66 -6
  58. package/dist/lib/node-esm/chunk-SED3O2XO.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-VNG6M2IY.mjs +478 -0
  60. package/dist/lib/node-esm/chunk-VNG6M2IY.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-UJMPYKT3.mjs → chunk-XVKWHTH4.mjs} +14 -5
  62. package/dist/lib/node-esm/chunk-XVKWHTH4.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-2RNIPFDA.mjs → chunk-YIDU3DXK.mjs} +246 -245
  64. package/dist/lib/node-esm/chunk-YIDU3DXK.mjs.map +7 -0
  65. package/dist/lib/node-esm/index.mjs +36 -42
  66. package/dist/lib/node-esm/index.mjs.map +3 -3
  67. package/dist/lib/node-esm/{intent-resolver-BU73VYW3.mjs → intent-resolver-QGTPU6QB.mjs} +31 -15
  68. package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs.map +7 -0
  69. package/dist/lib/node-esm/{markdown-HJUWNBLS.mjs → markdown-3MZXUGUA.mjs} +8 -8
  70. package/dist/lib/node-esm/markdown-3MZXUGUA.mjs.map +7 -0
  71. package/dist/lib/node-esm/meta.json +1 -1
  72. package/dist/lib/node-esm/{react-root-RUXOAQNW.mjs → react-root-7ZFJYVUZ.mjs} +12 -11
  73. package/dist/lib/{browser/react-root-NK3A4VG7.mjs.map → node-esm/react-root-7ZFJYVUZ.mjs.map} +1 -1
  74. package/dist/lib/node-esm/{react-surface-ELXFYKP6.mjs → react-surface-UJFCSFNO.mjs} +12 -11
  75. package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs.map +7 -0
  76. package/dist/lib/node-esm/{settings-EA7DFSM6.mjs → settings-N52O7MLS.mjs} +4 -4
  77. package/dist/lib/node-esm/{state-6AUTNROZ.mjs → state-62TQKQVB.mjs} +4 -4
  78. package/dist/lib/node-esm/{state-6AUTNROZ.mjs.map → state-62TQKQVB.mjs.map} +2 -2
  79. package/dist/lib/node-esm/types/index.mjs +2 -2
  80. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  81. package/dist/types/src/calls/call-manager.d.ts +1 -1
  82. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  83. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  84. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  85. package/dist/types/src/calls/types.d.ts +1 -1
  86. package/dist/types/src/calls/types.d.ts.map +1 -1
  87. package/dist/types/src/calls/util/calls-service.d.ts +5 -2
  88. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  89. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  90. package/dist/types/src/calls-service.stories.d.ts +22 -0
  91. package/dist/types/src/calls-service.stories.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
  94. package/dist/types/src/capabilities/capabilities.d.ts +2 -2
  95. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  96. package/dist/types/src/capabilities/index.d.ts +1 -1
  97. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  98. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/markdown.d.ts +1 -1
  100. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  103. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  104. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  105. package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
  106. package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
  107. package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
  108. package/dist/types/src/components/ChannelContainer.stories.d.ts +2 -2
  109. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
  110. package/dist/types/src/components/Chat.stories.d.ts +3 -2
  111. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  112. package/dist/types/src/components/ChatContainer.d.ts +2 -2
  113. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  114. package/dist/types/src/components/Comments.stories.d.ts +1 -1
  115. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  116. package/dist/types/src/components/CommentsContainer.d.ts +4 -4
  117. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  118. package/dist/types/src/components/CommentsThreadContainer.d.ts +14 -0
  119. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -0
  120. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  121. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  122. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  123. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  124. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  125. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  126. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +1 -1
  127. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
  128. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +1 -1
  129. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  130. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  131. package/dist/types/src/components/index.d.ts +1 -1
  132. package/dist/types/src/components/index.d.ts.map +1 -1
  133. package/dist/types/src/extensions/threads.d.ts +2 -2
  134. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  135. package/dist/types/src/hooks/index.d.ts +2 -0
  136. package/dist/types/src/hooks/index.d.ts.map +1 -1
  137. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +2 -0
  138. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +1 -0
  139. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +3 -0
  140. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -0
  141. package/dist/types/src/testing/stories.d.ts.map +1 -1
  142. package/dist/types/src/translations.d.ts +74 -194
  143. package/dist/types/src/translations.d.ts.map +1 -1
  144. package/dist/types/src/types/schema.d.ts +53 -22
  145. package/dist/types/src/types/schema.d.ts.map +1 -1
  146. package/dist/types/src/types/types.d.ts +72 -24
  147. package/dist/types/src/types/types.d.ts.map +1 -1
  148. package/dist/types/src/util.d.ts +17 -2
  149. package/dist/types/src/util.d.ts.map +1 -1
  150. package/dist/types/tsconfig.tsbuildinfo +1 -1
  151. package/package.json +49 -48
  152. package/src/ThreadPlugin.tsx +9 -24
  153. package/src/calls/call-manager.ts +7 -3
  154. package/src/calls/call-swarm-synchronizer.ts +1 -1
  155. package/src/calls/media-manager.ts +13 -6
  156. package/src/calls/types.ts +1 -1
  157. package/src/calls/util/calls-service.ts +12 -8
  158. package/src/calls/util/stub-media-streams.ts +5 -8
  159. package/src/calls-service.stories.tsx +216 -0
  160. package/src/capabilities/app-graph-builder.ts +6 -5
  161. package/src/capabilities/call-manager.ts +3 -2
  162. package/src/capabilities/capabilities.ts +2 -2
  163. package/src/capabilities/intent-resolver.ts +26 -7
  164. package/src/capabilities/markdown.ts +4 -3
  165. package/src/capabilities/react-surface.tsx +5 -4
  166. package/src/capabilities/state.ts +2 -1
  167. package/src/components/Call/Call.tsx +4 -3
  168. package/src/components/Call/Toolbar.tsx +5 -5
  169. package/src/components/CallDebugPanel.tsx +3 -3
  170. package/src/components/CallSidebar.tsx +2 -1
  171. package/src/components/ChannelContainer.stories.tsx +8 -7
  172. package/src/components/ChannelContainer.tsx +13 -11
  173. package/src/components/Chat.stories.tsx +7 -6
  174. package/src/components/ChatContainer.tsx +16 -14
  175. package/src/components/Comments.stories.tsx +24 -16
  176. package/src/components/CommentsContainer.tsx +17 -11
  177. package/src/components/{CommentContainer.tsx → CommentsThreadContainer.tsx} +51 -81
  178. package/src/components/Lobby/Lobby.tsx +1 -1
  179. package/src/components/Media/VideoObject.stories.tsx +4 -3
  180. package/src/components/MessageContainer.tsx +31 -46
  181. package/src/components/Participant/ParticipantGrid.tsx +2 -1
  182. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +5 -4
  183. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +5 -4
  184. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +1 -1
  185. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +4 -4
  186. package/src/components/ThreadComplementary.tsx +3 -3
  187. package/src/components/ThreadSettings.tsx +2 -2
  188. package/src/components/command-extension.ts +1 -1
  189. package/src/components/index.ts +1 -1
  190. package/src/components/testing.ts +2 -2
  191. package/src/extensions/threads.ts +6 -6
  192. package/src/hooks/index.ts +2 -0
  193. package/src/hooks/useDebugMode.ts +1 -1
  194. package/src/hooks/useInaudibleAudioStreamTrack.tsx +27 -0
  195. package/src/hooks/useVideoStreamTrack.tsx +33 -0
  196. package/src/testing/stories.ts +7 -3
  197. package/src/translations.ts +11 -8
  198. package/src/types/types.ts +11 -2
  199. package/src/typings.d.ts +8 -0
  200. package/dist/lib/browser/ChannelContainer-PKFBVENP.mjs +0 -15
  201. package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
  202. package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
  203. package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +0 -7
  204. package/dist/lib/browser/chunk-4H4A264L.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +0 -7
  206. package/dist/lib/browser/chunk-6NBVNXTM.mjs +0 -21
  207. package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
  208. package/dist/lib/browser/chunk-PG5CTFKK.mjs +0 -550
  209. package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
  210. package/dist/lib/browser/chunk-TAFSCSUR.mjs +0 -351
  211. package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
  212. package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
  213. package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
  214. package/dist/lib/browser/markdown-TE5SWWNJ.mjs.map +0 -7
  215. package/dist/lib/browser/react-root-NK3A4VG7.mjs +0 -27
  216. package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
  217. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs +0 -36
  218. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs.map +0 -7
  219. package/dist/lib/node/ChatContainer-GCOM3M56.cjs +0 -35
  220. package/dist/lib/node/ChatContainer-GCOM3M56.cjs.map +0 -7
  221. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs +0 -179
  222. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs.map +0 -7
  223. package/dist/lib/node/call-manager-HV2XJW5O.cjs +0 -37
  224. package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +0 -7
  225. package/dist/lib/node/chunk-44I33JDT.cjs +0 -1731
  226. package/dist/lib/node/chunk-44I33JDT.cjs.map +0 -7
  227. package/dist/lib/node/chunk-4YSNVPWU.cjs +0 -37
  228. package/dist/lib/node/chunk-4YSNVPWU.cjs.map +0 -7
  229. package/dist/lib/node/chunk-E3WBZTTI.cjs +0 -371
  230. package/dist/lib/node/chunk-E3WBZTTI.cjs.map +0 -7
  231. package/dist/lib/node/chunk-ERG7G6FF.cjs +0 -59
  232. package/dist/lib/node/chunk-ERG7G6FF.cjs.map +0 -7
  233. package/dist/lib/node/chunk-FUXJAVFZ.cjs +0 -108
  234. package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +0 -7
  235. package/dist/lib/node/chunk-HLMCEE5K.cjs +0 -41
  236. package/dist/lib/node/chunk-HLMCEE5K.cjs.map +0 -7
  237. package/dist/lib/node/chunk-IP533AMV.cjs +0 -554
  238. package/dist/lib/node/chunk-IP533AMV.cjs.map +0 -7
  239. package/dist/lib/node/chunk-LR5NENBE.cjs +0 -54
  240. package/dist/lib/node/chunk-LR5NENBE.cjs.map +0 -7
  241. package/dist/lib/node/chunk-UM36TPCT.cjs +0 -984
  242. package/dist/lib/node/chunk-UM36TPCT.cjs.map +0 -7
  243. package/dist/lib/node/chunk-ZGDN3XBR.cjs +0 -149
  244. package/dist/lib/node/chunk-ZGDN3XBR.cjs.map +0 -7
  245. package/dist/lib/node/index.cjs +0 -310
  246. package/dist/lib/node/index.cjs.map +0 -7
  247. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs +0 -363
  248. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs.map +0 -7
  249. package/dist/lib/node/markdown-GQIPJS2F.cjs +0 -178
  250. package/dist/lib/node/markdown-GQIPJS2F.cjs.map +0 -7
  251. package/dist/lib/node/meta.json +0 -1
  252. package/dist/lib/node/react-root-6HHDMULJ.cjs +0 -51
  253. package/dist/lib/node/react-root-6HHDMULJ.cjs.map +0 -7
  254. package/dist/lib/node/react-surface-NBH42NN2.cjs +0 -122
  255. package/dist/lib/node/react-surface-NBH42NN2.cjs.map +0 -7
  256. package/dist/lib/node/settings-4LQSFEDK.cjs +0 -36
  257. package/dist/lib/node/settings-4LQSFEDK.cjs.map +0 -7
  258. package/dist/lib/node/state-IY5XX3H2.cjs +0 -50
  259. package/dist/lib/node/state-IY5XX3H2.cjs.map +0 -7
  260. package/dist/lib/node/types/index.cjs +0 -38
  261. package/dist/lib/node/types/index.cjs.map +0 -7
  262. package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs +0 -16
  263. package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
  264. package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
  265. package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +0 -7
  267. package/dist/lib/node-esm/chunk-O63QJPQX.mjs +0 -23
  268. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs +0 -352
  269. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
  271. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs +0 -551
  272. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs.map +0 -7
  273. package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +0 -7
  274. package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
  275. package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
  276. package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
  277. package/dist/types/src/components/CommentContainer.d.ts +0 -13
  278. package/dist/types/src/components/CommentContainer.d.ts.map +0 -1
  279. package/dist/types/src/peers.stories.d.ts +0 -11
  280. package/dist/types/src/peers.stories.d.ts.map +0 -1
  281. package/src/peers.stories.tsx +0 -189
  282. /package/dist/lib/browser/{ChannelContainer-PKFBVENP.mjs.map → ChannelContainer-O2SFQJU7.mjs.map} +0 -0
  283. /package/dist/lib/browser/{ChatContainer-RSOKYAMK.mjs.map → ChatContainer-PVT3DUZJ.mjs.map} +0 -0
  284. /package/dist/lib/browser/{chunk-6NBVNXTM.mjs.map → chunk-2CWJBXBH.mjs.map} +0 -0
  285. /package/dist/lib/browser/{chunk-IIUTBDVB.mjs.map → chunk-EV4JWI7L.mjs.map} +0 -0
  286. /package/dist/lib/browser/{chunk-JKQUJOTX.mjs.map → chunk-GERVMFQW.mjs.map} +0 -0
  287. /package/dist/lib/{node-esm/react-root-RUXOAQNW.mjs.map → browser/react-root-QXPALOUQ.mjs.map} +0 -0
  288. /package/dist/lib/browser/{settings-RB2RSLXV.mjs.map → settings-AC6YSASL.mjs.map} +0 -0
  289. /package/dist/lib/node-esm/{ChannelContainer-O4QJII2P.mjs.map → ChannelContainer-B2ZGAE4P.mjs.map} +0 -0
  290. /package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs.map → ChatContainer-2CT4PJ7I.mjs.map} +0 -0
  291. /package/dist/lib/node-esm/{chunk-PGRP3O4O.mjs.map → chunk-57XR3LEF.mjs.map} +0 -0
  292. /package/dist/lib/node-esm/{chunk-O63QJPQX.mjs.map → chunk-6CRHHOST.mjs.map} +0 -0
  293. /package/dist/lib/node-esm/{chunk-ESQC6SYE.mjs.map → chunk-GRLRWTRU.mjs.map} +0 -0
  294. /package/dist/lib/node-esm/{settings-EA7DFSM6.mjs.map → settings-N52O7MLS.mjs.map} +0 -0
@@ -5,9 +5,9 @@
5
5
  import { defineCapability } from '@dxos/app-framework';
6
6
  import { type DeepReadonly } from '@dxos/util';
7
7
 
8
- import { type CallState, type MediaState, type CallManager } from '../calls';
8
+ import { type CallManager, type CallState, type MediaState } from '../calls';
9
9
  import { THREAD_PLUGIN } from '../meta';
10
- import { type ViewState, type ThreadState, type ChannelType } from '../types';
10
+ import { type ChannelType, type ThreadState, type ViewState } from '../types';
11
11
 
12
12
  export namespace ThreadCapabilities {
13
13
  export const CallManager = defineCapability<CallManager>(`${THREAD_PLUGIN}/capability/call-manager`);
@@ -2,22 +2,41 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, createIntent, createResolver, type PluginContext } from '@dxos/app-framework';
5
+ import { Effect } from 'effect';
6
+
7
+ import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
6
8
  import { sleep } from '@dxos/async';
7
- import { Obj, Relation } from '@dxos/echo';
9
+ import { Obj, Relation, Type } from '@dxos/echo';
8
10
  import { invariant } from '@dxos/invariant';
9
11
  import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
10
12
  import { ObservabilityAction } from '@dxos/plugin-observability/types';
11
- import { SpaceAction } from '@dxos/plugin-space/types';
12
- import { fullyQualifiedId, getSpace, Ref } from '@dxos/react-client/echo';
13
+ import { CollectionAction, SpaceAction } from '@dxos/plugin-space/types';
14
+ import { Ref, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
13
15
  import { AnchoredTo, DataType } from '@dxos/schema';
14
16
 
15
- import { ThreadCapabilities } from './capabilities';
16
17
  import { THREAD_PLUGIN } from '../meta';
17
18
  import { ChannelType, ThreadAction, ThreadType } from '../types';
18
19
 
20
+ import { ThreadCapabilities } from './capabilities';
21
+
19
22
  export default (context: PluginContext) =>
20
23
  contributes(Capabilities.IntentResolver, [
24
+ createResolver({
25
+ intent: ThreadAction.OnSpaceCreated,
26
+ resolve: ({ space, rootCollection }) =>
27
+ Effect.gen(function* () {
28
+ const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
29
+ const { object: collection } = yield* dispatch(
30
+ createIntent(CollectionAction.CreateQueryCollection, { typename: Type.getTypename(ChannelType) }),
31
+ );
32
+ rootCollection.objects.push(Ref.make(collection));
33
+
34
+ const { object: channel } = yield* dispatch(
35
+ createIntent(ThreadAction.CreateChannel, { name: 'General', spaceId: space.id }),
36
+ );
37
+ space.db.add(channel);
38
+ }),
39
+ }),
21
40
  createResolver({
22
41
  intent: ThreadAction.CreateChannel,
23
42
  resolve: ({ name }) => ({
@@ -182,9 +201,9 @@ export default (context: PluginContext) =>
182
201
  const intents = [];
183
202
 
184
203
  const message = Obj.make(DataType.Message, {
185
- sender,
186
204
  created: new Date().toISOString(),
187
- blocks: [{ type: 'text', text }],
205
+ sender,
206
+ blocks: [{ _tag: 'text', text }],
188
207
  // TODO(wittjosiah): Context based on attention.
189
208
  // context: context ? Ref.make(context) : undefined,
190
209
  });
@@ -4,15 +4,16 @@
4
4
 
5
5
  import { EditorView } from '@codemirror/view';
6
6
 
7
- import { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';
7
+ import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
8
8
  import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
9
9
  import { MarkdownCapabilities } from '@dxos/plugin-markdown';
10
10
  import { fullyQualifiedId } from '@dxos/react-client/echo';
11
- import { commentClickedEffect, commentsState, type EditorState, overlap } from '@dxos/react-ui-editor';
11
+ import { type EditorState, commentClickedEffect, commentsState, overlap } from '@dxos/react-ui-editor';
12
12
 
13
- import { ThreadCapabilities } from './capabilities';
14
13
  import { threads } from '../extensions';
15
14
 
15
+ import { ThreadCapabilities } from './capabilities';
16
+
16
17
  export default (context: PluginContext) =>
17
18
  contributes(MarkdownCapabilities.Extensions, [
18
19
  ({ document: doc }) => {
@@ -9,17 +9,18 @@ import { Obj, type Ref } from '@dxos/echo';
9
9
  import { SettingsStore } from '@dxos/local-storage';
10
10
  import { getSpace } from '@dxos/react-client/echo';
11
11
 
12
- import { ThreadCapabilities } from './capabilities';
13
12
  import {
14
- CallSidebar,
15
13
  CallDebugPanel,
14
+ CallSidebar,
16
15
  ChannelContainer,
16
+ ChatContainer,
17
17
  ThreadComplementary,
18
18
  ThreadSettings,
19
- ChatContainer,
20
19
  } from '../components';
21
20
  import { THREAD_PLUGIN } from '../meta';
22
- import { ChannelType, ThreadType, type ThreadSettingsProps } from '../types';
21
+ import { ChannelType, type ThreadSettingsProps, ThreadType } from '../types';
22
+
23
+ import { ThreadCapabilities } from './capabilities';
23
24
 
24
25
  export default () =>
25
26
  contributes(Capabilities.ReactSurface, [
@@ -5,9 +5,10 @@
5
5
  import { contributes } from '@dxos/app-framework';
6
6
  import { live } from '@dxos/live-object';
7
7
 
8
- import { ThreadCapabilities } from './capabilities';
9
8
  import { type ThreadState, type ViewStore } from '../types';
10
9
 
10
+ import { ThreadCapabilities } from './capabilities';
11
+
11
12
  const initialViewState = { showResolvedThreads: false };
12
13
 
13
14
  export default () => {
@@ -2,17 +2,18 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import React, { type PropsWithChildren, type FC } from 'react';
5
+ import React, { type FC, type PropsWithChildren } from 'react';
6
6
 
7
7
  import { useCapability } from '@dxos/app-framework';
8
8
  import { type ThemedClassName } from '@dxos/react-ui';
9
9
 
10
- import { Toolbar, type ToolbarProps } from './Toolbar';
11
10
  import { ThreadCapabilities } from '../../capabilities';
12
11
  import { useDebugMode } from '../../hooks';
13
12
  import { AudioStream } from '../Media';
14
13
  import { ParticipantGrid } from '../Participant';
15
14
 
15
+ import { Toolbar, type ToolbarProps } from './Toolbar';
16
+
16
17
  //
17
18
  // Root
18
19
  //
@@ -34,7 +35,7 @@ type CallAudioProps = {};
34
35
  const CallAudio: FC<CallAudioProps> = () => {
35
36
  const call = useCapability(ThreadCapabilities.CallManager);
36
37
 
37
- return <AudioStream tracks={call.pulledAudioTracks} />;
38
+ return <AudioStream tracks={call.audioTracksToPlay} />;
38
39
  };
39
40
 
40
41
  CallAudio.displayName = 'CallAudio';
@@ -5,21 +5,21 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { useAppGraph, useCapability } from '@dxos/app-framework';
8
- import { useNode, useActions } from '@dxos/plugin-graph';
8
+ import { useActions, useNode } from '@dxos/plugin-graph';
9
9
  import { fullyQualifiedId } from '@dxos/react-client/echo';
10
10
  import {
11
11
  Icon,
12
12
  IconButton,
13
13
  type IconButtonProps,
14
- type ThemedClassName,
15
14
  Toolbar as NativeToolbar,
15
+ type ThemedClassName,
16
16
  toLocalizedString,
17
17
  useTranslation,
18
18
  } from '@dxos/react-ui';
19
19
  import { groupHoverControlItemWithTransition, mx } from '@dxos/react-ui-theme';
20
20
 
21
21
  import { ThreadCapabilities } from '../../capabilities';
22
- import { THREAD_PLUGIN } from '../../meta';
22
+ import { meta } from '../../meta';
23
23
  import { type ChannelType } from '../../types';
24
24
 
25
25
  export type ToolbarProps = ThemedClassName<{
@@ -40,7 +40,7 @@ export const Toolbar = ({
40
40
  onJoin,
41
41
  onLeave,
42
42
  }: ToolbarProps) => {
43
- const { t } = useTranslation(THREAD_PLUGIN);
43
+ const { t } = useTranslation(meta.id);
44
44
  const { graph } = useAppGraph();
45
45
  const call = useCapability(ThreadCapabilities.CallManager);
46
46
 
@@ -174,7 +174,7 @@ const defaultButtonProps: Partial<IconButtonProps> = {
174
174
  const ToggleButton = ({ active, state }: ToolbarButtonProps) => (
175
175
  <IconButton
176
176
  {...defaultButtonProps}
177
- classNames={[active ? state.on.classNames ?? 'bg-callActive' : state.off.classNames]}
177
+ classNames={[active ? (state.on.classNames ?? 'bg-callActive') : state.off.classNames]}
178
178
  icon={active ? state.on.icon : state.off.icon}
179
179
  label={active ? state.on.label : state.off.label}
180
180
  onClick={active ? state.on.onClick : state.off.onClick}
@@ -7,20 +7,20 @@ import React, { useEffect, useMemo, useState } from 'react';
7
7
 
8
8
  import { Panel } from '@dxos/devtools';
9
9
  import { log } from '@dxos/log';
10
- import { Input, useTranslation, type ThemedClassName } from '@dxos/react-ui';
10
+ import { Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
11
11
  import { Json } from '@dxos/react-ui-syntax-highlighter';
12
12
 
13
13
  import { type GlobalState } from '../calls';
14
- import { THREAD_PLUGIN } from '../meta';
14
+ import { meta } from '../meta';
15
15
 
16
16
  export type CallDebugPanelProps = ThemedClassName<{
17
17
  state?: GlobalState;
18
18
  }>;
19
19
 
20
20
  export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
21
+ const { t } = useTranslation(meta.id);
21
22
  const users = state?.call?.users;
22
23
  const self = state?.call?.self;
23
- const { t } = useTranslation(THREAD_PLUGIN);
24
24
 
25
25
  const [open, setOpen] = useState(false);
26
26
  const handleToggle = () => setOpen(!open);
@@ -6,9 +6,10 @@ import React from 'react';
6
6
 
7
7
  import { useCapability } from '@dxos/app-framework';
8
8
 
9
- import { ChannelContainer } from './ChannelContainer';
10
9
  import { ThreadCapabilities } from '../capabilities';
11
10
 
11
+ import { ChannelContainer } from './ChannelContainer';
12
+
12
13
  export const CallSidebar = () => {
13
14
  const call = useCapability(ThreadCapabilities.CallManager);
14
15
  return <ChannelContainer roomId={call.roomId} />;
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta, type StoryObj } from '@storybook/react';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
  import React from 'react';
9
9
 
10
10
  import { contributes } from '@dxos/app-framework';
@@ -12,28 +12,29 @@ import { withPluginManager } from '@dxos/app-framework/testing';
12
12
  import { ClientCapabilities } from '@dxos/plugin-client';
13
13
  import { Query, useQuery, useSpace } from '@dxos/react-client/echo';
14
14
  import { DataType } from '@dxos/schema';
15
- import { withLayout, ColumnContainer } from '@dxos/storybook-utils';
15
+ import { ColumnContainer, withLayout } from '@dxos/storybook-utils';
16
16
 
17
- import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
18
17
  import { createThreadPlugins } from '../testing';
19
- import translations from '../translations';
18
+ import { translations } from '../translations';
20
19
  import { ChannelType, ThreadType } from '../types';
21
20
 
21
+ import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
22
+
22
23
  // TODO(wittjosiah): Channel doesn't render full height.
23
- const Story = () => {
24
+ const Story = ({ roomId }: ChannelContainerProps) => {
24
25
  const space = useSpace();
25
26
  const [channel] = useQuery(space, Query.type(ChannelType));
26
27
  if (!channel) {
27
28
  return null;
28
29
  }
29
30
 
30
- return <ChannelContainer channel={channel} />;
31
+ return <ChannelContainer channel={channel} roomId={roomId} />;
31
32
  };
32
33
 
33
34
  const meta: Meta<ChannelContainerProps> = {
34
35
  title: 'plugins/plugin-thread/ChannelContainer',
35
36
  component: ChannelContainer,
36
- render: () => <Story />,
37
+ render: (args) => <Story {...args} />,
37
38
  decorators: [
38
39
  withPluginManager({
39
40
  plugins: [...(await createThreadPlugins())],
@@ -3,26 +3,28 @@
3
3
  //
4
4
 
5
5
  import { Rx } from '@effect-rx/rx-react';
6
- import React, { useCallback, useEffect, useMemo, useState, type ChangeEvent } from 'react';
6
+ import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
7
7
 
8
8
  import { useCapabilities, useCapability } from '@dxos/app-framework';
9
9
  import { Context } from '@dxos/context';
10
+ import { failUndefined } from '@dxos/debug';
10
11
  import { log } from '@dxos/log';
11
12
  import { useClient } from '@dxos/react-client';
12
13
  import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
13
14
  import { useIdentity } from '@dxos/react-client/halo';
14
- import { useTranslation, Input, ElevationProvider, type ThemedClassName } from '@dxos/react-ui';
15
- import { ControlGroup, ControlItemInput, ControlGroupButton } from '@dxos/react-ui-form';
16
- import { ToolbarMenu, MenuProvider, createMenuAction, useMenuActions, createMenuItemGroup } from '@dxos/react-ui-menu';
15
+ import { ElevationProvider, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
16
+ import { ControlGroup, ControlGroupButton, ControlItemInput } from '@dxos/react-ui-form';
17
+ import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
17
18
  import { useSoundEffect } from '@dxos/react-ui-sfx';
18
19
  import { StackItem } from '@dxos/react-ui-stack';
19
20
 
20
- import { Call } from './Call';
21
- import ChatContainer from './ChatContainer';
22
21
  import { ThreadCapabilities } from '../capabilities';
23
- import { THREAD_PLUGIN } from '../meta';
22
+ import { meta } from '../meta';
24
23
  import { type ChannelType } from '../types';
25
24
 
25
+ import { Call } from './Call';
26
+ import ChatContainer from './ChatContainer';
27
+
26
28
  export type ChannelContainerProps = {
27
29
  channel?: ChannelType;
28
30
  roomId?: string;
@@ -36,7 +38,7 @@ export type ChannelContainerProps = {
36
38
  export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
37
39
  const space = getSpace(channel);
38
40
  const callManager = useCapability(ThreadCapabilities.CallManager);
39
- const roomId = channel ? fullyQualifiedId(channel) : _roomId;
41
+ const roomId = _roomId ?? (channel ? fullyQualifiedId(channel) : failUndefined());
40
42
  const identity = useIdentity();
41
43
  const isNamed = !!identity?.profile?.displayName;
42
44
  const joinSound = useSoundEffect('JoinCall');
@@ -133,7 +135,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
133
135
  export default ChannelContainer;
134
136
 
135
137
  const DisplayNameMissing = () => {
136
- const { t } = useTranslation(THREAD_PLUGIN);
138
+ const { t } = useTranslation(meta.id);
137
139
  const client = useClient();
138
140
  const [displayName, setDisplayName] = useState('');
139
141
  const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
@@ -163,10 +165,10 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
163
165
  return {
164
166
  nodes: [
165
167
  createMenuItemGroup('root', {
166
- label: ['channel toolbar title', { ns: THREAD_PLUGIN }],
168
+ label: ['channel toolbar title', { ns: meta.id }],
167
169
  }),
168
170
  createMenuAction('video-call', () => onJoinCall?.(), {
169
- label: ['start video call label', { ns: THREAD_PLUGIN }],
171
+ label: ['start video call label', { ns: meta.id }],
170
172
  icon: 'ph--video-camera--regular',
171
173
  type: 'video-call',
172
174
  }),
@@ -4,10 +4,10 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta } from '@storybook/react';
7
+ import { type Meta } from '@storybook/react-vite';
8
8
  import React, { useEffect, useState } from 'react';
9
9
 
10
- import { Capabilities, contributes, createSurface, IntentPlugin } from '@dxos/app-framework';
10
+ import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
11
11
  import { withPluginManager } from '@dxos/app-framework/testing';
12
12
  import { Obj, Ref } from '@dxos/echo';
13
13
  import { faker } from '@dxos/random';
@@ -19,10 +19,11 @@ import { Thread } from '@dxos/react-ui-thread';
19
19
  import { DataType } from '@dxos/schema';
20
20
  import { withLayout, withTheme } from '@dxos/storybook-utils';
21
21
 
22
- import { ChatContainer } from './ChatContainer';
23
- import translations from '../translations';
22
+ import { translations } from '../translations';
24
23
  import { ChannelType, ThreadType } from '../types';
25
24
 
25
+ import { ChatContainer } from './ChatContainer';
26
+
26
27
  faker.seed(1);
27
28
 
28
29
  const Story = () => {
@@ -60,9 +61,9 @@ const Story = () => {
60
61
 
61
62
  export const Default = {};
62
63
 
63
- const meta: Meta = {
64
+ const meta: Meta<typeof Thread.Root> = {
64
65
  title: 'plugins/plugin-thread/Chat',
65
- component: Thread,
66
+ component: Thread.Root,
66
67
  render: () => <Story />,
67
68
  decorators: [
68
69
  withPluginManager({
@@ -5,7 +5,7 @@
5
5
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
6
6
 
7
7
  import { Obj, Ref } from '@dxos/echo';
8
- import { fullyQualifiedId, type Space, useMembers } from '@dxos/react-client/echo';
8
+ import { type Space, fullyQualifiedId, useMembers } from '@dxos/react-client/echo';
9
9
  import { useIdentity } from '@dxos/react-client/halo';
10
10
  import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
11
11
  import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
@@ -15,22 +15,22 @@ import {
15
15
  MessageTextbox,
16
16
  type MessageTextboxProps,
17
17
  Thread,
18
- ThreadFooter,
18
+ type ThreadRootProps,
19
19
  threadLayout,
20
- type ThreadProps,
21
20
  } from '@dxos/react-ui-thread';
22
21
  import { DataType } from '@dxos/schema';
23
22
  import { isNonNullable } from '@dxos/util';
24
23
 
25
- import { MessageContainer } from './MessageContainer';
26
- import { command } from './command-extension';
27
24
  import { useStatus } from '../hooks';
28
- import { THREAD_PLUGIN } from '../meta';
25
+ import { meta } from '../meta';
29
26
  import { type ThreadType } from '../types';
30
27
  import { getMessageMetadata } from '../util';
31
28
 
29
+ import { command } from './command-extension';
30
+ import { MessageContainer } from './MessageContainer';
31
+
32
32
  export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
33
- const { t } = useTranslation(THREAD_PLUGIN);
33
+ const { t } = useTranslation(meta.id);
34
34
  return (
35
35
  <div role='none' className='flex items-center'>
36
36
  <StackItem.SigilButton attendableId={attendableId}>
@@ -46,14 +46,14 @@ export type ChatContainerProps = {
46
46
  thread: ThreadType;
47
47
  context?: Obj.Any;
48
48
  autoFocusTextbox?: boolean;
49
- } & Pick<ThreadProps, 'current'>;
49
+ } & Pick<ThreadRootProps, 'current'>;
50
50
 
51
51
  export const ChatContainer = ({ space, thread, context, current, autoFocusTextbox }: ChatContainerProps) => {
52
+ const { t } = useTranslation(meta.id);
52
53
  const id = fullyQualifiedId(thread);
53
54
  const identity = useIdentity()!;
54
55
  const members = useMembers(space?.key);
55
56
  const activity = useStatus(space, id);
56
- const { t } = useTranslation(THREAD_PLUGIN);
57
57
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
58
58
  const [_count, _setCount] = useState(0);
59
59
  const rerenderEditor = () => _setCount((count) => count + 1);
@@ -93,9 +93,9 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
93
93
  thread.messages.push(
94
94
  Ref.make(
95
95
  Obj.make(DataType.Message, {
96
- sender: { identityDid: identity.did },
97
96
  created: new Date().toISOString(),
98
- blocks: [{ type: 'text', text: messageRef.current }],
97
+ sender: { identityDid: identity.did },
98
+ blocks: [{ _tag: 'text', text: messageRef.current }],
99
99
  properties: context ? { context: Ref.make(context) } : undefined,
100
100
  }),
101
101
  ),
@@ -109,7 +109,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
109
109
  };
110
110
 
111
111
  return (
112
- <Thread
112
+ <Thread.Root
113
113
  current={current}
114
114
  id={id}
115
115
  classNames='bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0'
@@ -131,9 +131,11 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
131
131
  </ScrollArea.Scrollbar>
132
132
  </ScrollArea.Viewport>
133
133
  </ScrollArea.Root>
134
+
134
135
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
135
- <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>
136
- </Thread>
136
+
137
+ <Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
138
+ </Thread.Root>
137
139
  );
138
140
  };
139
141
 
@@ -4,29 +4,30 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta } from '@storybook/react';
7
+ import { type Meta } from '@storybook/react-vite';
8
8
  import React, { useEffect } from 'react';
9
9
 
10
10
  import { IntentPlugin } from '@dxos/app-framework';
11
11
  import { withPluginManager } from '@dxos/app-framework/testing';
12
12
  import { Obj, Query, Relation, Type } from '@dxos/echo';
13
+ import { ClientPlugin } from '@dxos/plugin-client';
13
14
  import { faker } from '@dxos/random';
14
15
  import { useQuery, useSpace } from '@dxos/react-client/echo';
15
16
  import { useIdentity } from '@dxos/react-client/halo';
16
- import { type ClientRepeatedComponentProps, ClientRepeater } from '@dxos/react-client/testing';
17
17
  import { AnchoredTo, DataType } from '@dxos/schema';
18
- import { withLayout, withTheme } from '@dxos/storybook-utils';
18
+ import { layoutCentered, render, withLayout, withTheme } from '@dxos/storybook-utils';
19
+
20
+ import { translations } from '../translations';
21
+ import { ThreadType } from '../types';
19
22
 
20
23
  import { CommentsContainer } from './CommentsContainer';
21
24
  import { createCommentThread } from './testing';
22
- import translations from '../translations';
23
- import { ThreadType } from '../types';
24
25
 
25
26
  faker.seed(1);
26
27
 
27
- const Story = ({ spaceKey }: ClientRepeatedComponentProps) => {
28
+ const DefaultStory = () => {
28
29
  const identity = useIdentity();
29
- const space = useSpace(spaceKey);
30
+ const space = useSpace();
30
31
  const anchors = useQuery(space, Query.type(AnchoredTo));
31
32
 
32
33
  useEffect(() => {
@@ -58,26 +59,33 @@ const Story = ({ spaceKey }: ClientRepeatedComponentProps) => {
58
59
  }
59
60
 
60
61
  return (
61
- <div className='flex justify-center overflow-y-auto bg-white dark:bg-black'>
62
- <div className='flex flex-col w-[30rem]'>
63
- <CommentsContainer anchors={anchors} onThreadDelete={console.log} />
64
- </div>
62
+ <div className='w-[30rem] overflow-y-auto bg-baseSurface'>
63
+ <CommentsContainer anchors={anchors} onThreadDelete={console.log} />
65
64
  </div>
66
65
  );
67
66
  };
68
67
 
69
68
  const meta: Meta = {
70
69
  title: 'plugins/plugin-thread/Comments',
71
- // TODO(wittjosiah): Use decorator.
72
- render: () => <ClientRepeater component={Story} createIdentity createSpace types={[ThreadType, DataType.Message]} />,
70
+ render: render(DefaultStory),
73
71
  decorators: [
74
72
  withTheme,
75
- withLayout({ fullscreen: true }),
73
+ withLayout({ fullscreen: true, classNames: layoutCentered }),
76
74
  withPluginManager({
77
- plugins: [IntentPlugin()],
75
+ plugins: [
76
+ IntentPlugin(),
77
+ ClientPlugin({
78
+ types: [DataType.Message, ThreadType, AnchoredTo],
79
+ onClientInitialized: async ({ client }) => {
80
+ await client.halo.createIdentity();
81
+ },
82
+ }),
83
+ ],
78
84
  }),
79
85
  ],
80
- parameters: { translations },
86
+ parameters: {
87
+ translations,
88
+ },
81
89
  };
82
90
 
83
91
  export default meta;
@@ -9,21 +9,23 @@ import { fullyQualifiedId } from '@dxos/react-client/echo';
9
9
  import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
10
10
  import { type AnchoredTo } from '@dxos/schema';
11
11
 
12
- import { CommentContainer, type CommentContainerProps } from './CommentContainer';
13
- import { THREAD_PLUGIN } from '../meta';
12
+ import { meta } from '../meta';
14
13
  import { type ThreadType } from '../types';
15
14
 
16
- export type ThreadsContainerProps = Omit<CommentContainerProps, 'anchor' | 'current'> & {
15
+ import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
16
+
17
+ export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
17
18
  anchors: AnchoredTo[];
18
19
  currentId?: string;
19
20
  showResolvedThreads?: boolean;
20
21
  };
21
22
 
22
23
  /**
23
- * Comment threads.
24
+ * Root container for collection of comment threads.
24
25
  */
25
- export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...props }: ThreadsContainerProps) => {
26
- const { t } = useTranslation(THREAD_PLUGIN);
26
+ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...props }: CommentsContainerProps) => {
27
+ const { t } = useTranslation(meta.id);
28
+
27
29
  // TODO(wittjosiah): There seems to be a race between thread and anchor being deleted.
28
30
  const filteredAnchors = showResolvedThreads
29
31
  ? anchors.filter((anchor) => !!Relation.getSource(anchor))
@@ -58,9 +60,13 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
58
60
  );
59
61
  }
60
62
 
61
- return filteredAnchors.map((anchor) => {
62
- const thread = Relation.getSource(anchor) as ThreadType;
63
- const threadId = fullyQualifiedId(thread);
64
- return <CommentContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
65
- });
63
+ return (
64
+ <div>
65
+ {filteredAnchors.map((anchor) => {
66
+ const thread = Relation.getSource(anchor) as ThreadType;
67
+ const threadId = fullyQualifiedId(thread);
68
+ return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
69
+ })}
70
+ </div>
71
+ );
66
72
  };