@dxos/plugin-thread 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203

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 (406) hide show
  1. package/dist/lib/browser/app-graph-builder-XFGLMIGK.mjs +189 -0
  2. package/dist/lib/browser/app-graph-builder-XFGLMIGK.mjs.map +7 -0
  3. package/dist/lib/browser/blueprint-definition-ACPH22F7.mjs +18 -0
  4. package/dist/lib/browser/blueprint-definition-ACPH22F7.mjs.map +7 -0
  5. package/dist/lib/browser/blueprints/index.mjs +8 -0
  6. package/dist/lib/browser/call-manager-GDGIKJKN.mjs +26 -0
  7. package/dist/lib/browser/call-manager-GDGIKJKN.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-2FIHSX35.mjs +293 -0
  9. package/dist/lib/browser/chunk-2FIHSX35.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-4EUEMHNI.mjs +1817 -0
  11. package/dist/lib/browser/chunk-4EUEMHNI.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-GERVMFQW.mjs → chunk-CP7E2HRE.mjs} +2 -2
  13. package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-ZE7KWN36.mjs → chunk-ERK254BS.mjs} +381 -240
  15. package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-6NSMBO3B.mjs → chunk-ISCHODBV.mjs} +55 -5
  17. package/dist/lib/browser/chunk-ISCHODBV.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  19. package/dist/lib/browser/{chunk-ERWASUQK.mjs → chunk-JBB73URQ.mjs} +85 -50
  20. package/dist/lib/browser/chunk-JBB73URQ.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-RH7XTXSR.mjs +106 -0
  22. package/dist/lib/browser/chunk-RH7XTXSR.mjs.map +7 -0
  23. package/dist/lib/browser/index.mjs +151 -132
  24. package/dist/lib/browser/index.mjs.map +4 -4
  25. package/dist/lib/browser/markdown-YJCSOWXX.mjs +210 -0
  26. package/dist/lib/browser/markdown-YJCSOWXX.mjs.map +7 -0
  27. package/dist/lib/browser/meta.json +1 -1
  28. package/dist/lib/browser/operation-resolver-PROCP5L4.mjs +441 -0
  29. package/dist/lib/browser/operation-resolver-PROCP5L4.mjs.map +7 -0
  30. package/dist/lib/browser/react-root-FHK2SVPU.mjs +25 -0
  31. package/dist/lib/browser/react-root-FHK2SVPU.mjs.map +7 -0
  32. package/dist/lib/browser/react-surface-7MQA6VSH.mjs +111 -0
  33. package/dist/lib/browser/react-surface-7MQA6VSH.mjs.map +7 -0
  34. package/dist/lib/browser/repair-6OZ75AUU.mjs +38 -0
  35. package/dist/lib/browser/repair-6OZ75AUU.mjs.map +7 -0
  36. package/dist/lib/browser/settings-TWKOTGSU.mjs +33 -0
  37. package/dist/lib/browser/settings-TWKOTGSU.mjs.map +7 -0
  38. package/dist/lib/browser/state-SJR2GL5G.mjs +24 -0
  39. package/dist/lib/browser/state-SJR2GL5G.mjs.map +7 -0
  40. package/dist/lib/browser/types/index.mjs +10 -12
  41. package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs +190 -0
  42. package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs.map +7 -0
  43. package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs +19 -0
  44. package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs.map +7 -0
  45. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  46. package/dist/lib/node-esm/call-manager-36UAAQCJ.mjs +27 -0
  47. package/dist/lib/node-esm/call-manager-36UAAQCJ.mjs.map +7 -0
  48. package/dist/lib/node-esm/{chunk-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
  49. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
  50. package/dist/lib/node-esm/{chunk-25ABSYP2.mjs → chunk-G7PZNN3Z.mjs} +85 -50
  51. package/dist/lib/node-esm/chunk-G7PZNN3Z.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  53. package/dist/lib/node-esm/chunk-OKVE6CLS.mjs +107 -0
  54. package/dist/lib/node-esm/chunk-OKVE6CLS.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-IHDNQLLR.mjs → chunk-QP3KQOPQ.mjs} +381 -240
  56. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +7 -0
  57. package/dist/lib/node-esm/chunk-RBRWHRHE.mjs +1818 -0
  58. package/dist/lib/node-esm/chunk-RBRWHRHE.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-OU5BYIDO.mjs → chunk-VBI32FGI.mjs} +55 -5
  60. package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-WMWUXWAS.mjs +294 -0
  62. package/dist/lib/node-esm/chunk-WMWUXWAS.mjs.map +7 -0
  63. package/dist/lib/node-esm/index.mjs +151 -132
  64. package/dist/lib/node-esm/index.mjs.map +4 -4
  65. package/dist/lib/node-esm/markdown-6LRP3PAP.mjs +211 -0
  66. package/dist/lib/node-esm/markdown-6LRP3PAP.mjs.map +7 -0
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs +442 -0
  69. package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs.map +7 -0
  70. package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs +26 -0
  71. package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs.map +7 -0
  72. package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs +112 -0
  73. package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs.map +7 -0
  74. package/dist/lib/node-esm/repair-6777EPOM.mjs +39 -0
  75. package/dist/lib/node-esm/repair-6777EPOM.mjs.map +7 -0
  76. package/dist/lib/node-esm/settings-5O254B3Z.mjs +34 -0
  77. package/dist/lib/node-esm/settings-5O254B3Z.mjs.map +7 -0
  78. package/dist/lib/node-esm/state-5R3TZJQE.mjs +25 -0
  79. package/dist/lib/node-esm/state-5R3TZJQE.mjs.map +7 -0
  80. package/dist/lib/node-esm/types/index.mjs +10 -12
  81. package/dist/types/src/ThreadPlugin.d.ts +2 -1
  82. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  83. package/dist/types/src/blueprints/index.d.ts +2 -0
  84. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  85. package/dist/types/src/blueprints/thread-blueprint.d.ts +21 -0
  86. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
  87. package/dist/types/src/calls/call-manager.d.ts +40 -30
  88. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  89. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
  90. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  91. package/dist/types/src/calls/media-manager.d.ts +2 -2
  92. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  93. package/dist/types/src/calls/types.d.ts +1 -1
  94. package/dist/types/src/calls/types.d.ts.map +1 -1
  95. package/dist/types/src/calls/util/calls-service.d.ts +5 -3
  96. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  97. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  98. package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
  99. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  100. package/dist/types/src/calls-service.stories.d.ts +10 -9
  101. package/dist/types/src/calls-service.stories.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  103. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  104. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  105. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  106. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
  107. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  108. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  109. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  110. package/dist/types/src/capabilities/call-manager/call-manager.d.ts +6 -0
  111. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +1 -0
  112. package/dist/types/src/capabilities/call-manager/index.d.ts +3 -0
  113. package/dist/types/src/capabilities/call-manager/index.d.ts.map +1 -0
  114. package/dist/types/src/capabilities/index.d.ts +10 -15
  115. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  116. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  117. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  118. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  119. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  120. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  121. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  122. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  123. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  124. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  125. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  126. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  127. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  128. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  129. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  130. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  131. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  132. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  133. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  134. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  135. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  136. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  137. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  138. package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
  139. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  140. package/dist/types/src/capabilities/state/index.d.ts +3 -0
  141. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  142. package/dist/types/src/capabilities/state/state.d.ts +7 -0
  143. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  144. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  145. package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
  146. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  147. package/dist/types/src/components/CallDebugPanel.d.ts +7 -0
  148. package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
  149. package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
  150. package/dist/types/src/components/ChannelContainer.d.ts +5 -6
  151. package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
  152. package/dist/types/src/components/ChannelContainer.stories.d.ts +159 -5
  153. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
  154. package/dist/types/src/components/Chat.stories.d.ts +162 -5
  155. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/ChatContainer.d.ts +7 -6
  157. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  158. package/dist/types/src/components/Comments.stories.d.ts +160 -4
  159. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  160. package/dist/types/src/components/CommentsContainer.d.ts +2 -2
  161. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  162. package/dist/types/src/components/CommentsThreadContainer.d.ts +9 -9
  163. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
  164. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  165. package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
  166. package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
  167. package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
  168. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  169. package/dist/types/src/components/MessageContainer.d.ts +7 -3
  170. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  171. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  172. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  173. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +159 -3
  174. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
  175. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +161 -4
  176. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  177. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  178. package/dist/types/src/components/ThreadCompanion.d.ts +5 -0
  179. package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
  180. package/dist/types/src/components/ThreadSettings.d.ts +4 -2
  181. package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
  182. package/dist/types/src/components/command-extension.d.ts.map +1 -1
  183. package/dist/types/src/components/index.d.ts +3 -3
  184. package/dist/types/src/components/index.d.ts.map +1 -1
  185. package/dist/types/src/components/testing.d.ts +3 -2
  186. package/dist/types/src/components/testing.d.ts.map +1 -1
  187. package/dist/types/src/extensions/threads.d.ts +8 -3
  188. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  189. package/dist/types/src/functions/create-proposals.d.ts +13 -0
  190. package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
  191. package/dist/types/src/functions/index.d.ts +2 -0
  192. package/dist/types/src/functions/index.d.ts.map +1 -0
  193. package/dist/types/src/hooks/analytics.d.ts +2 -3
  194. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  195. package/dist/types/src/hooks/index.d.ts +2 -1
  196. package/dist/types/src/hooks/index.d.ts.map +1 -1
  197. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
  198. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
  199. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
  200. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
  201. package/dist/types/src/index.d.ts +1 -1
  202. package/dist/types/src/index.d.ts.map +1 -1
  203. package/dist/types/src/meta.d.ts +3 -4
  204. package/dist/types/src/meta.d.ts.map +1 -1
  205. package/dist/types/src/testing/stories.d.ts +2 -1
  206. package/dist/types/src/testing/stories.d.ts.map +1 -1
  207. package/dist/types/src/translations.d.ts +79 -7
  208. package/dist/types/src/translations.d.ts.map +1 -1
  209. package/dist/types/src/types/Channel.d.ts +695 -0
  210. package/dist/types/src/types/Channel.d.ts.map +1 -0
  211. package/dist/types/src/types/capabilities.d.ts +23 -0
  212. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  213. package/dist/types/src/types/index.d.ts +2 -1
  214. package/dist/types/src/types/index.d.ts.map +1 -1
  215. package/dist/types/src/types/types.d.ts +3223 -365
  216. package/dist/types/src/types/types.d.ts.map +1 -1
  217. package/dist/types/tsconfig.tsbuildinfo +1 -1
  218. package/package.json +93 -66
  219. package/src/ThreadPlugin.tsx +108 -129
  220. package/src/blueprints/index.ts +5 -0
  221. package/src/blueprints/thread-blueprint.ts +32 -0
  222. package/src/calls/call-manager.ts +78 -54
  223. package/src/calls/call-swarm-synchronizer.ts +3 -3
  224. package/src/calls/media-manager.ts +67 -38
  225. package/src/calls/types.ts +8 -4
  226. package/src/calls/util/calls-service.ts +66 -15
  227. package/src/calls/util/stub-media-streams.ts +64 -7
  228. package/src/calls/util/task-scheduling.ts +4 -4
  229. package/src/calls-service.stories.tsx +78 -65
  230. package/src/capabilities/app-graph-builder/app-graph-builder.ts +202 -0
  231. package/src/capabilities/app-graph-builder/index.ts +7 -0
  232. package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
  233. package/src/capabilities/blueprint-definition/index.ts +7 -0
  234. package/src/capabilities/call-manager/call-manager.ts +26 -0
  235. package/src/capabilities/call-manager/index.ts +7 -0
  236. package/src/capabilities/index.ts +10 -12
  237. package/src/capabilities/markdown/index.ts +7 -0
  238. package/src/capabilities/markdown/markdown.ts +83 -0
  239. package/src/capabilities/operation-resolver/index.ts +7 -0
  240. package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
  241. package/src/capabilities/react-root/index.ts +7 -0
  242. package/src/capabilities/react-root/react-root.tsx +20 -0
  243. package/src/capabilities/react-surface/index.ts +7 -0
  244. package/src/capabilities/react-surface/react-surface.tsx +98 -0
  245. package/src/capabilities/repair/index.ts +7 -0
  246. package/src/capabilities/repair/repair.ts +51 -0
  247. package/src/capabilities/settings/index.ts +7 -0
  248. package/src/capabilities/settings/settings.ts +34 -0
  249. package/src/capabilities/state/index.ts +7 -0
  250. package/src/capabilities/state/state.ts +22 -0
  251. package/src/components/Call/Call.tsx +11 -6
  252. package/src/components/Call/Toolbar.tsx +39 -30
  253. package/src/components/CallDebugPanel.tsx +112 -55
  254. package/src/components/CallSidebar.tsx +6 -3
  255. package/src/components/ChannelContainer.stories.tsx +21 -19
  256. package/src/components/ChannelContainer.tsx +43 -35
  257. package/src/components/Chat.stories.tsx +37 -39
  258. package/src/components/ChatContainer.tsx +52 -41
  259. package/src/components/Comments.stories.tsx +53 -52
  260. package/src/components/CommentsContainer.tsx +7 -8
  261. package/src/components/CommentsThreadContainer.tsx +47 -41
  262. package/src/components/Lobby/Lobby.tsx +10 -8
  263. package/src/components/Media/AudioStream.tsx +2 -2
  264. package/src/components/Media/VideoObject.stories.tsx +36 -28
  265. package/src/components/Media/VideoObject.tsx +2 -2
  266. package/src/components/MessageContainer.tsx +98 -33
  267. package/src/components/Participant/Participant.tsx +34 -15
  268. package/src/components/Participant/ParticipantGrid.tsx +2 -1
  269. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +8 -8
  270. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
  271. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +45 -43
  272. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +7 -7
  273. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +8 -5
  274. package/src/components/ThreadCompanion.tsx +194 -0
  275. package/src/components/ThreadSettings.tsx +11 -6
  276. package/src/components/command-extension.ts +7 -4
  277. package/src/components/index.ts +4 -7
  278. package/src/components/testing.ts +26 -6
  279. package/src/extensions/threads.ts +88 -44
  280. package/src/functions/create-proposals.ts +57 -0
  281. package/src/functions/index.ts +5 -0
  282. package/src/hooks/analytics.ts +21 -21
  283. package/src/hooks/index.ts +3 -1
  284. package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
  285. package/src/hooks/useDebugMode.ts +1 -1
  286. package/src/hooks/useVideoStreamTrack.tsx +6 -3
  287. package/src/index.ts +1 -1
  288. package/src/meta.ts +11 -7
  289. package/src/testing/stories.ts +18 -16
  290. package/src/translations.ts +9 -4
  291. package/src/types/Channel.ts +30 -0
  292. package/src/types/capabilities.ts +34 -0
  293. package/src/types/index.ts +2 -1
  294. package/src/types/types.ts +170 -82
  295. package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
  296. package/src/typings.d.ts +8 -0
  297. package/src/util.ts +1 -1
  298. package/dist/lib/browser/ChannelContainer-IY2UIRLF.mjs +0 -16
  299. package/dist/lib/browser/ChatContainer-AIGIWAUG.mjs +0 -15
  300. package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs +0 -171
  301. package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs.map +0 -7
  302. package/dist/lib/browser/call-manager-NIPDYUVD.mjs +0 -24
  303. package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
  304. package/dist/lib/browser/chunk-4OYAYON2.mjs +0 -21
  305. package/dist/lib/browser/chunk-4OYAYON2.mjs.map +0 -7
  306. package/dist/lib/browser/chunk-6NSMBO3B.mjs.map +0 -7
  307. package/dist/lib/browser/chunk-ERWASUQK.mjs.map +0 -7
  308. package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
  309. package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
  310. package/dist/lib/browser/chunk-GCLD5ESP.mjs +0 -137
  311. package/dist/lib/browser/chunk-GCLD5ESP.mjs.map +0 -7
  312. package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
  313. package/dist/lib/browser/chunk-KWPRNHTK.mjs +0 -984
  314. package/dist/lib/browser/chunk-KWPRNHTK.mjs.map +0 -7
  315. package/dist/lib/browser/chunk-LGSDKXPF.mjs +0 -18
  316. package/dist/lib/browser/chunk-LGSDKXPF.mjs.map +0 -7
  317. package/dist/lib/browser/chunk-VUWC4IJM.mjs +0 -479
  318. package/dist/lib/browser/chunk-VUWC4IJM.mjs.map +0 -7
  319. package/dist/lib/browser/chunk-XLPJXUKO.mjs +0 -367
  320. package/dist/lib/browser/chunk-XLPJXUKO.mjs.map +0 -7
  321. package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
  322. package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs +0 -369
  323. package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs.map +0 -7
  324. package/dist/lib/browser/markdown-GEXBVJYN.mjs +0 -169
  325. package/dist/lib/browser/markdown-GEXBVJYN.mjs.map +0 -7
  326. package/dist/lib/browser/react-root-X4UIVGTX.mjs +0 -28
  327. package/dist/lib/browser/react-root-X4UIVGTX.mjs.map +0 -7
  328. package/dist/lib/browser/react-surface-YCYEFBPM.mjs +0 -109
  329. package/dist/lib/browser/react-surface-YCYEFBPM.mjs.map +0 -7
  330. package/dist/lib/browser/settings-E32MTL7A.mjs +0 -22
  331. package/dist/lib/browser/settings-E32MTL7A.mjs.map +0 -7
  332. package/dist/lib/browser/state-H6CYONWE.mjs +0 -34
  333. package/dist/lib/browser/state-H6CYONWE.mjs.map +0 -7
  334. package/dist/lib/node-esm/ChannelContainer-DET6T5N2.mjs +0 -17
  335. package/dist/lib/node-esm/ChatContainer-IQUWU426.mjs +0 -16
  336. package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs +0 -172
  337. package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs.map +0 -7
  338. package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs +0 -25
  339. package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs.map +0 -7
  340. package/dist/lib/node-esm/chunk-25ABSYP2.mjs.map +0 -7
  341. package/dist/lib/node-esm/chunk-2MFNK53T.mjs +0 -480
  342. package/dist/lib/node-esm/chunk-2MFNK53T.mjs.map +0 -7
  343. package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
  344. package/dist/lib/node-esm/chunk-75RJ5DJI.mjs +0 -19
  345. package/dist/lib/node-esm/chunk-75RJ5DJI.mjs.map +0 -7
  346. package/dist/lib/node-esm/chunk-C3XFMUAY.mjs +0 -985
  347. package/dist/lib/node-esm/chunk-C3XFMUAY.mjs.map +0 -7
  348. package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
  349. package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
  350. package/dist/lib/node-esm/chunk-GW37AAM4.mjs +0 -23
  351. package/dist/lib/node-esm/chunk-GW37AAM4.mjs.map +0 -7
  352. package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
  353. package/dist/lib/node-esm/chunk-J4NSON5Q.mjs +0 -368
  354. package/dist/lib/node-esm/chunk-J4NSON5Q.mjs.map +0 -7
  355. package/dist/lib/node-esm/chunk-OU5BYIDO.mjs.map +0 -7
  356. package/dist/lib/node-esm/chunk-TDFHTCZZ.mjs +0 -138
  357. package/dist/lib/node-esm/chunk-TDFHTCZZ.mjs.map +0 -7
  358. package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs +0 -370
  359. package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs.map +0 -7
  360. package/dist/lib/node-esm/markdown-LIJZDK2J.mjs +0 -170
  361. package/dist/lib/node-esm/markdown-LIJZDK2J.mjs.map +0 -7
  362. package/dist/lib/node-esm/react-root-M7J6PZVW.mjs +0 -29
  363. package/dist/lib/node-esm/react-root-M7J6PZVW.mjs.map +0 -7
  364. package/dist/lib/node-esm/react-surface-IRSEKM42.mjs +0 -110
  365. package/dist/lib/node-esm/react-surface-IRSEKM42.mjs.map +0 -7
  366. package/dist/lib/node-esm/settings-SJ24YG7M.mjs +0 -23
  367. package/dist/lib/node-esm/settings-SJ24YG7M.mjs.map +0 -7
  368. package/dist/lib/node-esm/state-D7WNDT3N.mjs +0 -35
  369. package/dist/lib/node-esm/state-D7WNDT3N.mjs.map +0 -7
  370. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  371. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  372. package/dist/types/src/capabilities/call-manager.d.ts +0 -5
  373. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  374. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  375. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  376. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  377. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  378. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  379. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  380. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  381. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  382. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  383. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  384. package/dist/types/src/capabilities/settings.d.ts +0 -4
  385. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  386. package/dist/types/src/capabilities/state.d.ts +0 -7
  387. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  388. package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
  389. package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
  390. package/dist/types/src/types/schema.d.ts +0 -162
  391. package/dist/types/src/types/schema.d.ts.map +0 -1
  392. package/src/capabilities/app-graph-builder.ts +0 -180
  393. package/src/capabilities/call-manager.ts +0 -19
  394. package/src/capabilities/capabilities.ts +0 -33
  395. package/src/capabilities/intent-resolver.ts +0 -314
  396. package/src/capabilities/markdown.ts +0 -68
  397. package/src/capabilities/react-root.tsx +0 -17
  398. package/src/capabilities/react-surface.tsx +0 -88
  399. package/src/capabilities/settings.ts +0 -19
  400. package/src/capabilities/state.ts +0 -25
  401. package/src/components/ThreadComplementary.tsx +0 -151
  402. package/src/types/schema.ts +0 -33
  403. /package/dist/lib/browser/{ChannelContainer-IY2UIRLF.mjs.map → blueprints/index.mjs.map} +0 -0
  404. /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  405. /package/dist/lib/node-esm/{ChannelContainer-DET6T5N2.mjs.map → blueprints/index.mjs.map} +0 -0
  406. /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -2,42 +2,50 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import React, { useCallback, useEffect, useMemo, useState, type ChangeEvent } from 'react';
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
+ import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
7
7
 
8
- import { useCapabilities, useCapability } from '@dxos/app-framework';
8
+ import { useCapabilities, useCapability } from '@dxos/app-framework/ui';
9
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
9
10
  import { Context } from '@dxos/context';
10
11
  import { failUndefined } from '@dxos/debug';
12
+ import { Obj } from '@dxos/echo';
11
13
  import { log } from '@dxos/log';
12
14
  import { useClient } from '@dxos/react-client';
13
- import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
15
+ import { getSpace } from '@dxos/react-client/echo';
14
16
  import { useIdentity } from '@dxos/react-client/halo';
15
- import { useTranslation, Input, ElevationProvider, type ThemedClassName } from '@dxos/react-ui';
16
- import { ControlGroup, ControlItemInput, ControlGroupButton } from '@dxos/react-ui-form';
17
- import { ToolbarMenu, MenuProvider, createMenuAction, useMenuActions, createMenuItemGroup } from '@dxos/react-ui-menu';
17
+ import { ElevationProvider, Input, useTranslation } from '@dxos/react-ui';
18
+ import { Settings } from '@dxos/react-ui-form';
19
+ import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
18
20
  import { useSoundEffect } from '@dxos/react-ui-sfx';
19
21
  import { StackItem } from '@dxos/react-ui-stack';
20
22
 
23
+ import { meta } from '../meta';
24
+ import { ThreadCapabilities } from '../types';
25
+ import { type Channel } from '../types';
26
+
21
27
  import { Call } from './Call';
22
28
  import ChatContainer from './ChatContainer';
23
- import { ThreadCapabilities } from '../capabilities';
24
- import { meta } from '../meta';
25
- import { type ChannelType } from '../types';
26
29
 
27
- export type ChannelContainerProps = {
28
- channel?: ChannelType;
29
- roomId?: string;
30
- role?: string;
31
- fullscreen?: boolean;
32
- };
30
+ export type ChannelContainerProps = SurfaceComponentProps<
31
+ Channel.Channel | undefined,
32
+ {
33
+ roomId?: string;
34
+ fullscreen?: boolean;
35
+ }
36
+ >;
33
37
 
34
38
  /**
35
39
  * Renders a call when active, otherwise renders the channel chat.
36
40
  */
37
- export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
41
+ // TODO(burdon): Create Radix style layout.
42
+ export const ChannelContainer = ({ role, subject: channel, roomId: roomIdProp, fullscreen }: ChannelContainerProps) => {
38
43
  const space = getSpace(channel);
39
44
  const callManager = useCapability(ThreadCapabilities.CallManager);
40
- const roomId = _roomId ?? (channel ? fullyQualifiedId(channel) : failUndefined());
45
+ const joined = useAtomValue(callManager.joinedAtom);
46
+ const currentRoomId = useAtomValue(callManager.roomIdAtom);
47
+ const attendableId = channel ? Obj.getDXN(channel).toString() : undefined;
48
+ const roomId = roomIdProp ?? attendableId ?? failUndefined();
41
49
  const identity = useIdentity();
42
50
  const isNamed = !!identity?.profile?.displayName;
43
51
  const joinSound = useSoundEffect('JoinCall');
@@ -78,7 +86,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
78
86
  return;
79
87
  }
80
88
 
81
- if (callManager.joined) {
89
+ if (joined) {
82
90
  await callManager.leave();
83
91
  }
84
92
 
@@ -91,7 +99,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
91
99
  // TODO(burdon): Error sound.
92
100
  log.catch(err);
93
101
  }
94
- }, [extensions, channel, roomId]);
102
+ }, [extensions, channel, roomId, joined]);
95
103
 
96
104
  /**
97
105
  * Leave the call.
@@ -110,10 +118,10 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
110
118
  }
111
119
  }, [extensions, roomId]);
112
120
 
113
- const isJoined = callManager.joined && callManager.roomId === roomId;
121
+ const isJoined = joined && currentRoomId === roomId;
114
122
 
115
123
  return (
116
- <StackItem.Content toolbar={!isJoined} classNames={isJoined && 'h-full'}>
124
+ <StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
117
125
  {isJoined && !isNamed && <DisplayNameMissing />}
118
126
  {isJoined && isNamed && (
119
127
  <Call.Root>
@@ -123,8 +131,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
123
131
  )}
124
132
  {!isJoined && channel && channel.defaultThread.target && space && (
125
133
  <>
126
- <ChannelToolbar attendableId={fullyQualifiedId(channel)} role={role} onJoinCall={handleJoin} />
127
- <ChatContainer space={space} thread={channel.defaultThread.target} />
134
+ <ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
135
+ <ChatContainer space={space} thread={channel.defaultThread.target} classNames='container-max-width' />
128
136
  </>
129
137
  )}
130
138
  </StackItem.Content>
@@ -141,26 +149,26 @@ const DisplayNameMissing = () => {
141
149
  const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
142
150
 
143
151
  return (
144
- <ControlGroup classNames='p-4 place-content-center'>
145
- <ControlItemInput title={t('display name label')} description={t('display name description')}>
152
+ <Settings.Group classNames='p-4 place-content-center'>
153
+ <Settings.ItemInput title={t('display name label')} description={t('display name description')}>
146
154
  <Input.TextInput
147
155
  value={displayName}
148
156
  onChange={handleChange}
149
157
  placeholder={t('display name input placeholder')}
150
158
  classNames='md:min-is-64'
151
159
  />
152
- </ControlItemInput>
153
- <ControlGroupButton disabled={!displayName} onClick={handleSave}>
160
+ </Settings.ItemInput>
161
+ <Settings.GroupButton disabled={!displayName} onClick={handleSave}>
154
162
  {t('set display name label')}
155
- </ControlGroupButton>
156
- </ControlGroup>
163
+ </Settings.GroupButton>
164
+ </Settings.Group>
157
165
  );
158
166
  };
159
167
 
160
168
  const useChannelToolbarActions = (onJoinCall?: () => void) => {
161
169
  const creator = useMemo(
162
170
  () =>
163
- Rx.make(() => {
171
+ Atom.make(() => {
164
172
  return {
165
173
  nodes: [
166
174
  createMenuItemGroup('root', {
@@ -181,19 +189,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
181
189
  return useMenuActions(creator);
182
190
  };
183
191
 
184
- type ChannelToolbarProps = ThemedClassName<{
192
+ type ChannelToolbarProps = {
185
193
  attendableId?: string;
186
194
  role?: string;
187
195
  onJoinCall?: () => void;
188
- }>;
196
+ };
189
197
 
190
- const ChannelToolbar = ({ attendableId, role, onJoinCall, classNames }: ChannelToolbarProps) => {
198
+ const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
191
199
  const menuProps = useChannelToolbarActions(onJoinCall);
192
200
 
193
201
  return (
194
202
  <ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
195
203
  <MenuProvider {...menuProps} attendableId={attendableId}>
196
- <ToolbarMenu classNames={classNames} />
204
+ <ToolbarMenu textBlockWidth />
197
205
  </MenuProvider>
198
206
  </ElevationProvider>
199
207
  );
@@ -2,48 +2,42 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React, { useState } from 'react';
6
7
 
7
- import { type Meta } from '@storybook/react-vite';
8
- import React, { useEffect, useState } from 'react';
9
-
10
- import { Capabilities, contributes, createSurface, IntentPlugin } from '@dxos/app-framework';
8
+ import { Capabilities, Capability, OperationPlugin } from '@dxos/app-framework';
11
9
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { Obj, Ref } from '@dxos/echo';
10
+ import { Surface } from '@dxos/app-framework/ui';
13
11
  import { faker } from '@dxos/random';
14
12
  import { useClient } from '@dxos/react-client';
15
13
  import { type Space } from '@dxos/react-client/echo';
16
14
  import { useIdentity } from '@dxos/react-client/halo';
17
15
  import { withClientProvider } from '@dxos/react-client/testing';
18
- import { Thread } from '@dxos/react-ui-thread';
19
- import { DataType } from '@dxos/schema';
20
- import { withLayout, withTheme } from '@dxos/storybook-utils';
16
+ import { useAsyncEffect } from '@dxos/react-ui';
17
+ import { withTheme } from '@dxos/react-ui/testing';
18
+ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
19
+ import { render } from '@dxos/storybook-utils';
20
+ import { Message, Thread } from '@dxos/types';
21
21
 
22
- import { ChatContainer } from './ChatContainer';
23
22
  import { translations } from '../translations';
24
- import { ChannelType, ThreadType } from '../types';
23
+ import { Channel } from '../types';
24
+
25
+ import { ChatContainer } from './ChatContainer';
25
26
 
26
27
  faker.seed(1);
27
28
 
28
- const Story = () => {
29
+ const DefaultStory = () => {
29
30
  const client = useClient();
30
31
  const identity = useIdentity();
31
32
  const [space, setSpace] = useState<Space>();
32
- const [channel, setChannel] = useState<ChannelType | null>();
33
+ const [channel, setChannel] = useState<Channel.Channel | null>();
33
34
 
34
- useEffect(() => {
35
+ useAsyncEffect(async () => {
35
36
  if (identity) {
36
- setTimeout(async () => {
37
- const space = await client.spaces.create();
38
- const channel = space.db.add(
39
- Obj.make(ChannelType, {
40
- defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
41
- threads: [],
42
- }),
43
- );
44
- setSpace(space);
45
- setChannel(channel);
46
- });
37
+ const space = await client.spaces.create();
38
+ const channel = space.db.add(Channel.make());
39
+ setSpace(space);
40
+ setChannel(channel);
47
41
  }
48
42
  }, [identity]);
49
43
 
@@ -52,25 +46,24 @@ const Story = () => {
52
46
  }
53
47
 
54
48
  return (
55
- <main className='max-is-prose mli-auto bs-dvh overflow-hidden'>
49
+ <main className='is-full max-is-proseMaxWidth mli-auto bs-full overflow-hidden'>
56
50
  <ChatContainer space={space} thread={channel.defaultThread.target} />
57
51
  </main>
58
52
  );
59
53
  };
60
54
 
61
- export const Default = {};
62
-
63
- const meta: Meta<typeof Thread.Root> = {
55
+ const meta = {
64
56
  title: 'plugins/plugin-thread/Chat',
65
- component: Thread.Root,
66
- render: () => <Story />,
57
+ component: ThreadComponent.Root as any,
58
+ render: render(DefaultStory),
67
59
  decorators: [
60
+ withTheme(),
68
61
  withPluginManager({
69
- plugins: [IntentPlugin()],
62
+ plugins: [OperationPlugin()],
70
63
  capabilities: [
71
- contributes(
64
+ Capability.contributes(
72
65
  Capabilities.ReactSurface,
73
- createSurface({
66
+ Surface.create({
74
67
  id: 'test',
75
68
  role: 'card',
76
69
  component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
@@ -78,11 +71,16 @@ const meta: Meta<typeof Thread.Root> = {
78
71
  ),
79
72
  ],
80
73
  }),
81
- withTheme,
82
- withLayout({ fullscreen: true }),
83
- withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
74
+ withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
84
75
  ],
85
- parameters: { translations },
86
- };
76
+ parameters: {
77
+ layout: 'fullscreen',
78
+ translations,
79
+ },
80
+ } satisfies Meta<typeof DefaultStory>;
87
81
 
88
82
  export default meta;
83
+
84
+ type Story = StoryObj<typeof meta>;
85
+
86
+ export const Default: Story = {};
@@ -5,29 +5,29 @@
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, useMembers } from '@dxos/react-client/echo';
9
9
  import { useIdentity } from '@dxos/react-client/halo';
10
- import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
11
- import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
10
+ import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
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,
17
- Thread,
15
+ Thread as ThreadComponent,
18
16
  type ThreadRootProps,
19
17
  threadLayout,
20
18
  } from '@dxos/react-ui-thread';
21
- import { DataType } from '@dxos/schema';
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
- import { MessageContainer } from './MessageContainer';
25
- import { command } from './command-extension';
26
24
  import { useStatus } from '../hooks';
27
25
  import { meta } from '../meta';
28
- import { type ThreadType } from '../types';
29
26
  import { getMessageMetadata } from '../util';
30
27
 
28
+ import { command } from './command-extension';
29
+ import { MessageContainer } from './MessageContainer';
30
+
31
31
  export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
32
32
  const { t } = useTranslation(meta.id);
33
33
  return (
@@ -40,18 +40,27 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
40
40
  );
41
41
  };
42
42
 
43
- export type ChatContainerProps = {
44
- space: Space;
45
- thread: ThreadType;
46
- context?: Obj.Any;
47
- autoFocusTextbox?: boolean;
48
- } & Pick<ThreadRootProps, 'current'>;
49
-
50
- export const ChatContainer = ({ space, thread, context, current, autoFocusTextbox }: ChatContainerProps) => {
43
+ export type ChatContainerProps = ThemedClassName<
44
+ {
45
+ space: Space;
46
+ thread: Thread.Thread;
47
+ context?: Obj.Unknown;
48
+ autoFocusTextbox?: boolean;
49
+ } & Pick<ThreadRootProps, 'current'>
50
+ >;
51
+
52
+ export const ChatContainer = ({
53
+ classNames,
54
+ space,
55
+ thread,
56
+ context,
57
+ current,
58
+ autoFocusTextbox,
59
+ }: ChatContainerProps) => {
51
60
  const { t } = useTranslation(meta.id);
52
- const id = fullyQualifiedId(thread);
61
+ const id = Obj.getDXN(thread).toString();
53
62
  const identity = useIdentity()!;
54
- const members = useMembers(space?.key);
63
+ const members = useMembers(space?.id);
55
64
  const activity = useStatus(space, id);
56
65
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
57
66
  const [_count, _setCount] = useState(0);
@@ -66,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
66
75
  () => [
67
76
  createBasicExtensions({ placeholder: t('message placeholder') }),
68
77
  createThemeExtensions({ themeMode }),
69
- listener({ onChange: (text) => (messageRef.current = text) }),
78
+ listener({ onChange: ({ text }) => (messageRef.current = text) }),
70
79
  command,
71
80
  ],
72
81
  [themeMode, _count],
@@ -89,16 +98,18 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
89
98
  return false;
90
99
  }
91
100
 
92
- thread.messages.push(
93
- Ref.make(
94
- Obj.make(DataType.Message, {
95
- created: new Date().toISOString(),
96
- sender: { identityDid: identity.did },
97
- blocks: [{ _tag: 'text', text: messageRef.current }],
98
- properties: context ? { context: Ref.make(context) } : undefined,
99
- }),
100
- ),
101
- );
101
+ Obj.change(thread, (t) => {
102
+ t.messages.push(
103
+ Ref.make(
104
+ Obj.make(Message.Message, {
105
+ created: new Date().toISOString(),
106
+ sender: { identityDid: identity.did },
107
+ blocks: [{ _tag: 'text', text: messageRef.current }],
108
+ properties: context ? { context: Ref.make(context) } : undefined,
109
+ }),
110
+ ),
111
+ );
112
+ });
102
113
 
103
114
  messageRef.current = '';
104
115
  setAutoFocus(true);
@@ -108,13 +119,17 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
108
119
  };
109
120
 
110
121
  return (
111
- <Thread.Root
122
+ <ThreadComponent.Root
112
123
  current={current}
113
124
  id={id}
114
- 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'
125
+ classNames={[
126
+ 'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
127
+ 'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
128
+ classNames,
129
+ ]}
115
130
  >
116
- <ScrollArea.Root classNames='col-span-2'>
117
- <ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>
131
+ <ScrollArea.Root orientation='vertical'>
132
+ <ScrollArea.Viewport classNames='col-span-2'>
118
133
  <div role='none' className={mx(threadLayout, 'place-self-end')}>
119
134
  {thread.messages
120
135
  .map((message) => message.target)
@@ -123,18 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
123
138
  <MessageContainer key={message.id} message={message} members={members} />
124
139
  ))}
125
140
  </div>
126
- {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
141
+ {/* NOTE(thure): This can't also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref'd element. */}
127
142
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
128
- <ScrollArea.Scrollbar>
129
- <ScrollArea.Thumb />
130
- </ScrollArea.Scrollbar>
131
143
  </ScrollArea.Viewport>
132
144
  </ScrollArea.Root>
133
145
 
134
146
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
135
-
136
- <Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
137
- </Thread.Root>
147
+ <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
148
+ </ThreadComponent.Root>
138
149
  );
139
150
  };
140
151
 
@@ -2,82 +2,81 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import React from 'react';
6
8
 
7
- import { type Meta } from '@storybook/react-vite';
8
- import React, { useEffect } from 'react';
9
-
10
- import { IntentPlugin } from '@dxos/app-framework';
9
+ import { OperationPlugin } from '@dxos/app-framework';
11
10
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { Obj, Query, Relation, Type } from '@dxos/echo';
11
+ import { Obj, Query, Relation } from '@dxos/echo';
12
+ import { TestSchema } from '@dxos/echo/testing';
13
13
  import { ClientPlugin } from '@dxos/plugin-client';
14
14
  import { faker } from '@dxos/random';
15
- import { useQuery, useSpace } from '@dxos/react-client/echo';
15
+ import { useDatabase, useQuery } from '@dxos/react-client/echo';
16
16
  import { useIdentity } from '@dxos/react-client/halo';
17
- import { AnchoredTo, DataType } from '@dxos/schema';
18
- import { layoutCentered, render, withLayout, withTheme } from '@dxos/storybook-utils';
17
+ import { useAsyncEffect } from '@dxos/react-ui';
18
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
19
+ import { render } from '@dxos/storybook-utils';
20
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
19
21
 
20
- import { CommentsContainer } from './CommentsContainer';
21
- import { createCommentThread } from './testing';
22
22
  import { translations } from '../translations';
23
- import { ThreadType } from '../types';
23
+
24
+ import { CommentsContainer } from './CommentsContainer';
25
+ import { createCommentThread, createProposalThread } from './testing';
24
26
 
25
27
  faker.seed(1);
26
28
 
27
29
  const DefaultStory = () => {
28
30
  const identity = useIdentity();
29
- const space = useSpace();
30
- const anchors = useQuery(space, Query.type(AnchoredTo));
31
-
32
- useEffect(() => {
33
- if (identity && space) {
34
- const t = setTimeout(async () => {
35
- const object = space.db.add(Obj.make(Type.Expando, {}));
36
- const thread1 = space.db.add(createCommentThread(identity));
37
- const thread2 = space.db.add(createCommentThread(identity));
38
- space.db.add(
39
- Relation.make(AnchoredTo, {
40
- [Relation.Source]: thread1,
41
- [Relation.Target]: object,
42
- }),
43
- );
44
- space.db.add(
45
- Relation.make(AnchoredTo, {
46
- [Relation.Source]: thread2,
47
- [Relation.Target]: object,
48
- }),
49
- );
50
- });
31
+ const db = useDatabase();
32
+ const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
51
33
 
52
- return () => clearTimeout(t);
34
+ useAsyncEffect(async () => {
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(
40
+ Relation.make(AnchoredTo.AnchoredTo, {
41
+ [Relation.Source]: thread1,
42
+ [Relation.Target]: object,
43
+ anchor: 'test',
44
+ }),
45
+ );
46
+ db.add(
47
+ Relation.make(AnchoredTo.AnchoredTo, {
48
+ [Relation.Source]: thread2,
49
+ [Relation.Target]: object,
50
+ anchor: 'test',
51
+ }),
52
+ );
53
53
  }
54
- }, [identity, space]);
54
+ }, [identity, db]);
55
55
 
56
- if (!identity || !space || !anchors) {
56
+ if (!identity || !db || !anchors) {
57
57
  return null;
58
58
  }
59
59
 
60
- return (
61
- <div className='w-[30rem] overflow-y-auto bg-baseSurface'>
62
- <CommentsContainer anchors={anchors} onThreadDelete={console.log} />
63
- </div>
64
- );
60
+ return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
65
61
  };
66
62
 
67
- const meta: Meta = {
63
+ const meta = {
68
64
  title: 'plugins/plugin-thread/Comments',
69
65
  render: render(DefaultStory),
70
66
  decorators: [
71
- withTheme,
72
- withLayout({ fullscreen: true, classNames: layoutCentered }),
67
+ withTheme(),
68
+ withLayout({ layout: 'column', scroll: true }),
69
+ // TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
70
+ // Currently this is required due to useOnEditAnalytics.
73
71
  withPluginManager({
74
72
  plugins: [
75
- IntentPlugin(),
73
+ OperationPlugin(),
76
74
  ClientPlugin({
77
- types: [DataType.Message, ThreadType, AnchoredTo],
78
- onClientInitialized: async (_, client) => {
79
- await client.halo.createIdentity();
80
- },
75
+ types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
76
+ onClientInitialized: ({ client }) =>
77
+ Effect.gen(function* () {
78
+ yield* Effect.promise(() => client.halo.createIdentity());
79
+ }),
81
80
  }),
82
81
  ],
83
82
  }),
@@ -85,8 +84,10 @@ const meta: Meta = {
85
84
  parameters: {
86
85
  translations,
87
86
  },
88
- };
87
+ } satisfies Meta<typeof DefaultStory>;
89
88
 
90
89
  export default meta;
91
90
 
92
- export const Default = {};
91
+ type Story = StoryObj<typeof meta>;
92
+
93
+ export const Default: Story = {};
@@ -4,17 +4,16 @@
4
4
 
5
5
  import React, { useEffect } from 'react';
6
6
 
7
- import { Relation } from '@dxos/echo';
8
- import { fullyQualifiedId } from '@dxos/react-client/echo';
7
+ import { Obj, Relation } from '@dxos/echo';
9
8
  import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
10
- import { type AnchoredTo } from '@dxos/schema';
9
+ import { type AnchoredTo, type Thread } from '@dxos/types';
11
10
 
12
- import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
13
11
  import { meta } from '../meta';
14
- import { type ThreadType } from '../types';
12
+
13
+ import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
15
14
 
16
15
  export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
17
- anchors: AnchoredTo[];
16
+ anchors: AnchoredTo.AnchoredTo[];
18
17
  currentId?: string;
19
18
  showResolvedThreads?: boolean;
20
19
  };
@@ -62,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
62
61
  return (
63
62
  <div>
64
63
  {filteredAnchors.map((anchor) => {
65
- const thread = Relation.getSource(anchor) as ThreadType;
66
- const threadId = fullyQualifiedId(thread);
64
+ const thread = Relation.getSource(anchor) as Thread.Thread;
65
+ const threadId = Obj.getDXN(thread).toString();
67
66
  return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
68
67
  })}
69
68
  </div>