@dxos/plugin-thread 0.8.3 → 0.8.4-main.1068cf700f

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 (462) 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-JKQUJOTX.mjs → chunk-CP7E2HRE.mjs} +3 -3
  13. package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-4H4A264L.mjs → chunk-ERK254BS.mjs} +407 -305
  15. package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-ISCHODBV.mjs +106 -0
  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-JBB73URQ.mjs +184 -0
  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 +164 -151
  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-PGRP3O4O.mjs → chunk-ABUFOZVX.mjs} +3 -3
  49. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
  50. package/dist/lib/node-esm/chunk-G7PZNN3Z.mjs +185 -0
  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-WXNPD542.mjs → chunk-QP3KQOPQ.mjs} +406 -305
  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-VBI32FGI.mjs +108 -0
  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 +164 -151
  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 +9 -4
  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 +23 -0
  101. package/dist/types/src/calls-service.stories.d.ts.map +1 -0
  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 -4
  155. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/ChatContainer.d.ts +8 -7
  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 +6 -6
  161. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  162. package/dist/types/src/components/CommentsThreadContainer.d.ts +14 -0
  163. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -0
  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 +4 -4
  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 +3 -0
  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/useInaudibleAudioStreamTrack.d.ts +2 -0
  200. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +1 -0
  201. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +3 -0
  202. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -0
  203. package/dist/types/src/index.d.ts +1 -1
  204. package/dist/types/src/index.d.ts.map +1 -1
  205. package/dist/types/src/meta.d.ts +3 -4
  206. package/dist/types/src/meta.d.ts.map +1 -1
  207. package/dist/types/src/testing/stories.d.ts +2 -1
  208. package/dist/types/src/testing/stories.d.ts.map +1 -1
  209. package/dist/types/src/translations.d.ts +146 -194
  210. package/dist/types/src/translations.d.ts.map +1 -1
  211. package/dist/types/src/types/Channel.d.ts +695 -0
  212. package/dist/types/src/types/Channel.d.ts.map +1 -0
  213. package/dist/types/src/types/capabilities.d.ts +23 -0
  214. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  215. package/dist/types/src/types/index.d.ts +2 -1
  216. package/dist/types/src/types/index.d.ts.map +1 -1
  217. package/dist/types/src/types/types.d.ts +3224 -320
  218. package/dist/types/src/types/types.d.ts.map +1 -1
  219. package/dist/types/src/util.d.ts +17 -2
  220. package/dist/types/src/util.d.ts.map +1 -1
  221. package/dist/types/tsconfig.tsbuildinfo +1 -1
  222. package/package.json +93 -67
  223. package/src/ThreadPlugin.tsx +107 -143
  224. package/src/blueprints/index.ts +5 -0
  225. package/src/blueprints/thread-blueprint.ts +32 -0
  226. package/src/calls/call-manager.ts +78 -50
  227. package/src/calls/call-swarm-synchronizer.ts +3 -3
  228. package/src/calls/media-manager.ts +77 -41
  229. package/src/calls/types.ts +8 -4
  230. package/src/calls/util/calls-service.ts +73 -19
  231. package/src/calls/util/stub-media-streams.ts +63 -9
  232. package/src/calls/util/task-scheduling.ts +4 -4
  233. package/src/calls-service.stories.tsx +229 -0
  234. package/src/capabilities/app-graph-builder/app-graph-builder.ts +202 -0
  235. package/src/capabilities/app-graph-builder/index.ts +7 -0
  236. package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
  237. package/src/capabilities/blueprint-definition/index.ts +7 -0
  238. package/src/capabilities/call-manager/call-manager.ts +26 -0
  239. package/src/capabilities/call-manager/index.ts +7 -0
  240. package/src/capabilities/index.ts +10 -12
  241. package/src/capabilities/markdown/index.ts +7 -0
  242. package/src/capabilities/markdown/markdown.ts +83 -0
  243. package/src/capabilities/operation-resolver/index.ts +7 -0
  244. package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
  245. package/src/capabilities/react-root/index.ts +7 -0
  246. package/src/capabilities/react-root/react-root.tsx +20 -0
  247. package/src/capabilities/react-surface/index.ts +7 -0
  248. package/src/capabilities/react-surface/react-surface.tsx +98 -0
  249. package/src/capabilities/repair/index.ts +7 -0
  250. package/src/capabilities/repair/repair.ts +51 -0
  251. package/src/capabilities/settings/index.ts +7 -0
  252. package/src/capabilities/settings/settings.ts +34 -0
  253. package/src/capabilities/state/index.ts +7 -0
  254. package/src/capabilities/state/state.ts +22 -0
  255. package/src/components/Call/Call.tsx +11 -6
  256. package/src/components/Call/Toolbar.tsx +42 -33
  257. package/src/components/CallDebugPanel.tsx +114 -57
  258. package/src/components/CallSidebar.tsx +6 -3
  259. package/src/components/ChannelContainer.stories.tsx +23 -21
  260. package/src/components/ChannelContainer.tsx +47 -38
  261. package/src/components/Chat.stories.tsx +37 -39
  262. package/src/components/ChatContainer.tsx +56 -44
  263. package/src/components/Comments.stories.tsx +63 -55
  264. package/src/components/CommentsContainer.tsx +20 -16
  265. package/src/components/CommentsThreadContainer.tsx +173 -0
  266. package/src/components/Lobby/Lobby.tsx +10 -8
  267. package/src/components/Media/AudioStream.tsx +2 -2
  268. package/src/components/Media/VideoObject.stories.tsx +36 -28
  269. package/src/components/Media/VideoObject.tsx +2 -2
  270. package/src/components/MessageContainer.tsx +117 -68
  271. package/src/components/Participant/Participant.tsx +34 -15
  272. package/src/components/Participant/ParticipantGrid.tsx +2 -1
  273. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +9 -9
  274. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
  275. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +45 -43
  276. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +7 -7
  277. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +10 -7
  278. package/src/components/ThreadCompanion.tsx +194 -0
  279. package/src/components/ThreadSettings.tsx +11 -6
  280. package/src/components/command-extension.ts +7 -4
  281. package/src/components/index.ts +5 -8
  282. package/src/components/testing.ts +28 -8
  283. package/src/extensions/threads.ts +88 -44
  284. package/src/functions/create-proposals.ts +57 -0
  285. package/src/functions/index.ts +5 -0
  286. package/src/hooks/analytics.ts +21 -21
  287. package/src/hooks/index.ts +4 -0
  288. package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
  289. package/src/hooks/useDebugMode.ts +1 -1
  290. package/src/hooks/useInaudibleAudioStreamTrack.tsx +27 -0
  291. package/src/hooks/useVideoStreamTrack.tsx +36 -0
  292. package/src/index.ts +1 -1
  293. package/src/meta.ts +11 -7
  294. package/src/testing/stories.ts +23 -17
  295. package/src/translations.ts +18 -10
  296. package/src/types/Channel.ts +30 -0
  297. package/src/types/capabilities.ts +34 -0
  298. package/src/types/index.ts +2 -1
  299. package/src/types/types.ts +171 -75
  300. package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
  301. package/src/typings.d.ts +8 -0
  302. package/src/util.ts +1 -1
  303. package/dist/lib/browser/ChannelContainer-PKFBVENP.mjs +0 -15
  304. package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
  305. package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs +0 -171
  306. package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
  307. package/dist/lib/browser/call-manager-APQAZWHT.mjs +0 -23
  308. package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +0 -7
  309. package/dist/lib/browser/chunk-4H4A264L.mjs.map +0 -7
  310. package/dist/lib/browser/chunk-5P5BH5GE.mjs +0 -88
  311. package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +0 -7
  312. package/dist/lib/browser/chunk-6NBVNXTM.mjs +0 -21
  313. package/dist/lib/browser/chunk-6NBVNXTM.mjs.map +0 -7
  314. package/dist/lib/browser/chunk-AEXWNS6Z.mjs +0 -128
  315. package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
  316. package/dist/lib/browser/chunk-IIUTBDVB.mjs +0 -17
  317. package/dist/lib/browser/chunk-IIUTBDVB.mjs.map +0 -7
  318. package/dist/lib/browser/chunk-JKQUJOTX.mjs.map +0 -7
  319. package/dist/lib/browser/chunk-PG5CTFKK.mjs +0 -550
  320. package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
  321. package/dist/lib/browser/chunk-R5MDLUPC.mjs +0 -18
  322. package/dist/lib/browser/chunk-R5MDLUPC.mjs.map +0 -7
  323. package/dist/lib/browser/chunk-TAFSCSUR.mjs +0 -351
  324. package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
  325. package/dist/lib/browser/chunk-XZKBN3NS.mjs +0 -983
  326. package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
  327. package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs +0 -353
  328. package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
  329. package/dist/lib/browser/markdown-TE5SWWNJ.mjs +0 -169
  330. package/dist/lib/browser/markdown-TE5SWWNJ.mjs.map +0 -7
  331. package/dist/lib/browser/react-root-NK3A4VG7.mjs +0 -27
  332. package/dist/lib/browser/react-root-NK3A4VG7.mjs.map +0 -7
  333. package/dist/lib/browser/react-surface-VXUJKSOG.mjs +0 -108
  334. package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
  335. package/dist/lib/browser/settings-RB2RSLXV.mjs +0 -22
  336. package/dist/lib/browser/settings-RB2RSLXV.mjs.map +0 -7
  337. package/dist/lib/browser/state-RKL5MSDP.mjs +0 -34
  338. package/dist/lib/browser/state-RKL5MSDP.mjs.map +0 -7
  339. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs +0 -36
  340. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs.map +0 -7
  341. package/dist/lib/node/ChatContainer-GCOM3M56.cjs +0 -35
  342. package/dist/lib/node/ChatContainer-GCOM3M56.cjs.map +0 -7
  343. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs +0 -179
  344. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs.map +0 -7
  345. package/dist/lib/node/call-manager-HV2XJW5O.cjs +0 -37
  346. package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +0 -7
  347. package/dist/lib/node/chunk-44I33JDT.cjs +0 -1731
  348. package/dist/lib/node/chunk-44I33JDT.cjs.map +0 -7
  349. package/dist/lib/node/chunk-4YSNVPWU.cjs +0 -37
  350. package/dist/lib/node/chunk-4YSNVPWU.cjs.map +0 -7
  351. package/dist/lib/node/chunk-E3WBZTTI.cjs +0 -371
  352. package/dist/lib/node/chunk-E3WBZTTI.cjs.map +0 -7
  353. package/dist/lib/node/chunk-ERG7G6FF.cjs +0 -59
  354. package/dist/lib/node/chunk-ERG7G6FF.cjs.map +0 -7
  355. package/dist/lib/node/chunk-FUXJAVFZ.cjs +0 -108
  356. package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +0 -7
  357. package/dist/lib/node/chunk-HLMCEE5K.cjs +0 -41
  358. package/dist/lib/node/chunk-HLMCEE5K.cjs.map +0 -7
  359. package/dist/lib/node/chunk-IP533AMV.cjs +0 -554
  360. package/dist/lib/node/chunk-IP533AMV.cjs.map +0 -7
  361. package/dist/lib/node/chunk-LR5NENBE.cjs +0 -54
  362. package/dist/lib/node/chunk-LR5NENBE.cjs.map +0 -7
  363. package/dist/lib/node/chunk-UM36TPCT.cjs +0 -984
  364. package/dist/lib/node/chunk-UM36TPCT.cjs.map +0 -7
  365. package/dist/lib/node/chunk-ZGDN3XBR.cjs +0 -149
  366. package/dist/lib/node/chunk-ZGDN3XBR.cjs.map +0 -7
  367. package/dist/lib/node/index.cjs +0 -310
  368. package/dist/lib/node/index.cjs.map +0 -7
  369. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs +0 -363
  370. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs.map +0 -7
  371. package/dist/lib/node/markdown-GQIPJS2F.cjs +0 -178
  372. package/dist/lib/node/markdown-GQIPJS2F.cjs.map +0 -7
  373. package/dist/lib/node/meta.json +0 -1
  374. package/dist/lib/node/react-root-6HHDMULJ.cjs +0 -51
  375. package/dist/lib/node/react-root-6HHDMULJ.cjs.map +0 -7
  376. package/dist/lib/node/react-surface-NBH42NN2.cjs +0 -122
  377. package/dist/lib/node/react-surface-NBH42NN2.cjs.map +0 -7
  378. package/dist/lib/node/settings-4LQSFEDK.cjs +0 -36
  379. package/dist/lib/node/settings-4LQSFEDK.cjs.map +0 -7
  380. package/dist/lib/node/state-IY5XX3H2.cjs +0 -50
  381. package/dist/lib/node/state-IY5XX3H2.cjs.map +0 -7
  382. package/dist/lib/node/types/index.cjs +0 -38
  383. package/dist/lib/node/types/index.cjs.map +0 -7
  384. package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs +0 -16
  385. package/dist/lib/node-esm/ChatContainer-F6CSADV7.mjs +0 -15
  386. package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs +0 -172
  387. package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
  388. package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs +0 -24
  389. package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
  390. package/dist/lib/node-esm/chunk-2RNIPFDA.mjs +0 -984
  391. package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
  392. package/dist/lib/node-esm/chunk-ESQC6SYE.mjs +0 -19
  393. package/dist/lib/node-esm/chunk-ESQC6SYE.mjs.map +0 -7
  394. package/dist/lib/node-esm/chunk-K4KAUOKT.mjs +0 -19
  395. package/dist/lib/node-esm/chunk-K4KAUOKT.mjs.map +0 -7
  396. package/dist/lib/node-esm/chunk-O3V45YJP.mjs +0 -90
  397. package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +0 -7
  398. package/dist/lib/node-esm/chunk-O63QJPQX.mjs +0 -23
  399. package/dist/lib/node-esm/chunk-O63QJPQX.mjs.map +0 -7
  400. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs +0 -352
  401. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
  402. package/dist/lib/node-esm/chunk-PGRP3O4O.mjs.map +0 -7
  403. package/dist/lib/node-esm/chunk-UJMPYKT3.mjs +0 -129
  404. package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
  405. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs +0 -551
  406. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs.map +0 -7
  407. package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +0 -7
  408. package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs +0 -354
  409. package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
  410. package/dist/lib/node-esm/markdown-HJUWNBLS.mjs +0 -170
  411. package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
  412. package/dist/lib/node-esm/react-root-RUXOAQNW.mjs +0 -28
  413. package/dist/lib/node-esm/react-root-RUXOAQNW.mjs.map +0 -7
  414. package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs +0 -109
  415. package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
  416. package/dist/lib/node-esm/settings-EA7DFSM6.mjs +0 -23
  417. package/dist/lib/node-esm/settings-EA7DFSM6.mjs.map +0 -7
  418. package/dist/lib/node-esm/state-6AUTNROZ.mjs +0 -35
  419. package/dist/lib/node-esm/state-6AUTNROZ.mjs.map +0 -7
  420. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  421. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  422. package/dist/types/src/capabilities/call-manager.d.ts +0 -5
  423. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  424. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  425. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  426. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  427. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  428. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  429. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  430. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  431. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  432. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  433. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  434. package/dist/types/src/capabilities/settings.d.ts +0 -4
  435. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  436. package/dist/types/src/capabilities/state.d.ts +0 -7
  437. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  438. package/dist/types/src/components/CommentContainer.d.ts +0 -13
  439. package/dist/types/src/components/CommentContainer.d.ts.map +0 -1
  440. package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
  441. package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
  442. package/dist/types/src/peers.stories.d.ts +0 -11
  443. package/dist/types/src/peers.stories.d.ts.map +0 -1
  444. package/dist/types/src/types/schema.d.ts +0 -133
  445. package/dist/types/src/types/schema.d.ts.map +0 -1
  446. package/src/capabilities/app-graph-builder.ts +0 -180
  447. package/src/capabilities/call-manager.ts +0 -19
  448. package/src/capabilities/capabilities.ts +0 -33
  449. package/src/capabilities/intent-resolver.ts +0 -296
  450. package/src/capabilities/markdown.ts +0 -68
  451. package/src/capabilities/react-root.tsx +0 -17
  452. package/src/capabilities/react-surface.tsx +0 -88
  453. package/src/capabilities/settings.ts +0 -19
  454. package/src/capabilities/state.ts +0 -25
  455. package/src/components/CommentContainer.tsx +0 -198
  456. package/src/components/ThreadComplementary.tsx +0 -151
  457. package/src/peers.stories.tsx +0 -189
  458. package/src/types/schema.ts +0 -33
  459. /package/dist/lib/browser/{ChannelContainer-PKFBVENP.mjs.map → blueprints/index.mjs.map} +0 -0
  460. /package/dist/lib/browser/{ChatContainer-RSOKYAMK.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  461. /package/dist/lib/node-esm/{ChannelContainer-O4QJII2P.mjs.map → blueprints/index.mjs.map} +0 -0
  462. /package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -2,41 +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';
11
+ import { failUndefined } from '@dxos/debug';
12
+ import { Obj } from '@dxos/echo';
10
13
  import { log } from '@dxos/log';
11
14
  import { useClient } from '@dxos/react-client';
12
- import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
15
+ import { getSpace } from '@dxos/react-client/echo';
13
16
  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';
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';
17
20
  import { useSoundEffect } from '@dxos/react-ui-sfx';
18
21
  import { StackItem } from '@dxos/react-ui-stack';
19
22
 
23
+ import { meta } from '../meta';
24
+ import { ThreadCapabilities } from '../types';
25
+ import { type Channel } from '../types';
26
+
20
27
  import { Call } from './Call';
21
28
  import ChatContainer from './ChatContainer';
22
- import { ThreadCapabilities } from '../capabilities';
23
- import { THREAD_PLUGIN } from '../meta';
24
- import { type ChannelType } from '../types';
25
29
 
26
- export type ChannelContainerProps = {
27
- channel?: ChannelType;
28
- roomId?: string;
29
- role?: string;
30
- fullscreen?: boolean;
31
- };
30
+ export type ChannelContainerProps = SurfaceComponentProps<
31
+ Channel.Channel | undefined,
32
+ {
33
+ roomId?: string;
34
+ fullscreen?: boolean;
35
+ }
36
+ >;
32
37
 
33
38
  /**
34
39
  * Renders a call when active, otherwise renders the channel chat.
35
40
  */
36
- 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) => {
37
43
  const space = getSpace(channel);
38
44
  const callManager = useCapability(ThreadCapabilities.CallManager);
39
- const roomId = channel ? fullyQualifiedId(channel) : _roomId;
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();
40
49
  const identity = useIdentity();
41
50
  const isNamed = !!identity?.profile?.displayName;
42
51
  const joinSound = useSoundEffect('JoinCall');
@@ -77,7 +86,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
77
86
  return;
78
87
  }
79
88
 
80
- if (callManager.joined) {
89
+ if (joined) {
81
90
  await callManager.leave();
82
91
  }
83
92
 
@@ -90,7 +99,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
90
99
  // TODO(burdon): Error sound.
91
100
  log.catch(err);
92
101
  }
93
- }, [extensions, channel, roomId]);
102
+ }, [extensions, channel, roomId, joined]);
94
103
 
95
104
  /**
96
105
  * Leave the call.
@@ -109,10 +118,10 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
109
118
  }
110
119
  }, [extensions, roomId]);
111
120
 
112
- const isJoined = callManager.joined && callManager.roomId === roomId;
121
+ const isJoined = joined && currentRoomId === roomId;
113
122
 
114
123
  return (
115
- <StackItem.Content toolbar={!isJoined} classNames={isJoined && 'h-full'}>
124
+ <StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
116
125
  {isJoined && !isNamed && <DisplayNameMissing />}
117
126
  {isJoined && isNamed && (
118
127
  <Call.Root>
@@ -122,8 +131,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
122
131
  )}
123
132
  {!isJoined && channel && channel.defaultThread.target && space && (
124
133
  <>
125
- <ChannelToolbar attendableId={fullyQualifiedId(channel)} role={role} onJoinCall={handleJoin} />
126
- <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' />
127
136
  </>
128
137
  )}
129
138
  </StackItem.Content>
@@ -133,40 +142,40 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
133
142
  export default ChannelContainer;
134
143
 
135
144
  const DisplayNameMissing = () => {
136
- const { t } = useTranslation(THREAD_PLUGIN);
145
+ const { t } = useTranslation(meta.id);
137
146
  const client = useClient();
138
147
  const [displayName, setDisplayName] = useState('');
139
148
  const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
140
149
  const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
141
150
 
142
151
  return (
143
- <ControlGroup classNames='p-4 place-content-center'>
144
- <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')}>
145
154
  <Input.TextInput
146
155
  value={displayName}
147
156
  onChange={handleChange}
148
157
  placeholder={t('display name input placeholder')}
149
158
  classNames='md:min-is-64'
150
159
  />
151
- </ControlItemInput>
152
- <ControlGroupButton disabled={!displayName} onClick={handleSave}>
160
+ </Settings.ItemInput>
161
+ <Settings.GroupButton disabled={!displayName} onClick={handleSave}>
153
162
  {t('set display name label')}
154
- </ControlGroupButton>
155
- </ControlGroup>
163
+ </Settings.GroupButton>
164
+ </Settings.Group>
156
165
  );
157
166
  };
158
167
 
159
168
  const useChannelToolbarActions = (onJoinCall?: () => void) => {
160
169
  const creator = useMemo(
161
170
  () =>
162
- Rx.make(() => {
171
+ Atom.make(() => {
163
172
  return {
164
173
  nodes: [
165
174
  createMenuItemGroup('root', {
166
- label: ['channel toolbar title', { ns: THREAD_PLUGIN }],
175
+ label: ['channel toolbar title', { ns: meta.id }],
167
176
  }),
168
177
  createMenuAction('video-call', () => onJoinCall?.(), {
169
- label: ['start video call label', { ns: THREAD_PLUGIN }],
178
+ label: ['start video call label', { ns: meta.id }],
170
179
  icon: 'ph--video-camera--regular',
171
180
  type: 'video-call',
172
181
  }),
@@ -180,19 +189,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
180
189
  return useMenuActions(creator);
181
190
  };
182
191
 
183
- type ChannelToolbarProps = ThemedClassName<{
192
+ type ChannelToolbarProps = {
184
193
  attendableId?: string;
185
194
  role?: string;
186
195
  onJoinCall?: () => void;
187
- }>;
196
+ };
188
197
 
189
- const ChannelToolbar = ({ attendableId, role, onJoinCall, classNames }: ChannelToolbarProps) => {
198
+ const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
190
199
  const menuProps = useChannelToolbarActions(onJoinCall);
191
200
 
192
201
  return (
193
202
  <ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
194
203
  <MenuProvider {...menuProps} attendableId={attendableId}>
195
- <ToolbarMenu classNames={classNames} />
204
+ <ToolbarMenu textBlockWidth />
196
205
  </MenuProvider>
197
206
  </ElevationProvider>
198
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';
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
+
22
+ import { translations } from '../translations';
23
+ import { Channel } from '../types';
21
24
 
22
25
  import { ChatContainer } from './ChatContainer';
23
- import translations from '../translations';
24
- import { ChannelType, ThreadType } from '../types';
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 = {
55
+ const meta = {
64
56
  title: 'plugins/plugin-thread/Chat',
65
- component: Thread,
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 = {
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,32 +5,31 @@
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,
18
- ThreadFooter,
15
+ Thread as ThreadComponent,
16
+ type ThreadRootProps,
19
17
  threadLayout,
20
- type ThreadProps,
21
18
  } from '@dxos/react-ui-thread';
22
- 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';
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';
29
- import { type ThreadType } from '../types';
25
+ import { meta } from '../meta';
30
26
  import { getMessageMetadata } from '../util';
31
27
 
28
+ import { command } from './command-extension';
29
+ import { MessageContainer } from './MessageContainer';
30
+
32
31
  export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
33
- const { t } = useTranslation(THREAD_PLUGIN);
32
+ const { t } = useTranslation(meta.id);
34
33
  return (
35
34
  <div role='none' className='flex items-center'>
36
35
  <StackItem.SigilButton attendableId={attendableId}>
@@ -41,19 +40,28 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
41
40
  );
42
41
  };
43
42
 
44
- export type ChatContainerProps = {
45
- space: Space;
46
- thread: ThreadType;
47
- context?: Obj.Any;
48
- autoFocusTextbox?: boolean;
49
- } & Pick<ThreadProps, 'current'>;
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
+ >;
50
51
 
51
- export const ChatContainer = ({ space, thread, context, current, autoFocusTextbox }: ChatContainerProps) => {
52
- const id = fullyQualifiedId(thread);
52
+ export const ChatContainer = ({
53
+ classNames,
54
+ space,
55
+ thread,
56
+ context,
57
+ current,
58
+ autoFocusTextbox,
59
+ }: ChatContainerProps) => {
60
+ const { t } = useTranslation(meta.id);
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
- const { t } = useTranslation(THREAD_PLUGIN);
57
65
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
58
66
  const [_count, _setCount] = useState(0);
59
67
  const rerenderEditor = () => _setCount((count) => count + 1);
@@ -67,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
67
75
  () => [
68
76
  createBasicExtensions({ placeholder: t('message placeholder') }),
69
77
  createThemeExtensions({ themeMode }),
70
- listener({ onChange: (text) => (messageRef.current = text) }),
78
+ listener({ onChange: ({ text }) => (messageRef.current = text) }),
71
79
  command,
72
80
  ],
73
81
  [themeMode, _count],
@@ -90,16 +98,18 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
90
98
  return false;
91
99
  }
92
100
 
93
- thread.messages.push(
94
- Ref.make(
95
- Obj.make(DataType.Message, {
96
- sender: { identityDid: identity.did },
97
- created: new Date().toISOString(),
98
- blocks: [{ type: 'text', text: messageRef.current }],
99
- properties: context ? { context: Ref.make(context) } : undefined,
100
- }),
101
- ),
102
- );
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
+ });
103
113
 
104
114
  messageRef.current = '';
105
115
  setAutoFocus(true);
@@ -109,13 +119,17 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
109
119
  };
110
120
 
111
121
  return (
112
- <Thread
122
+ <ThreadComponent.Root
113
123
  current={current}
114
124
  id={id}
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'
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
+ ]}
116
130
  >
117
- <ScrollArea.Root classNames='col-span-2'>
118
- <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'>
119
133
  <div role='none' className={mx(threadLayout, 'place-self-end')}>
120
134
  {thread.messages
121
135
  .map((message) => message.target)
@@ -124,16 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
124
138
  <MessageContainer key={message.id} message={message} members={members} />
125
139
  ))}
126
140
  </div>
127
- {/* 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. */}
128
142
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
129
- <ScrollArea.Scrollbar>
130
- <ScrollArea.Thumb />
131
- </ScrollArea.Scrollbar>
132
143
  </ScrollArea.Viewport>
133
144
  </ScrollArea.Root>
145
+
134
146
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
135
- <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>
136
- </Thread>
147
+ <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
148
+ </ThreadComponent.Root>
137
149
  );
138
150
  };
139
151
 
@@ -2,84 +2,92 @@
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';
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
+ import { ClientPlugin } from '@dxos/plugin-client';
13
14
  import { faker } from '@dxos/random';
14
- import { useQuery, useSpace } from '@dxos/react-client/echo';
15
+ import { useDatabase, useQuery } 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
- import { AnchoredTo, DataType } from '@dxos/schema';
18
- import { 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';
21
+
22
+ import { translations } from '../translations';
19
23
 
20
24
  import { CommentsContainer } from './CommentsContainer';
21
- import { createCommentThread } from './testing';
22
- import translations from '../translations';
23
- import { ThreadType } from '../types';
25
+ import { createCommentThread, createProposalThread } from './testing';
24
26
 
25
27
  faker.seed(1);
26
28
 
27
- const Story = ({ spaceKey }: ClientRepeatedComponentProps) => {
29
+ const DefaultStory = () => {
28
30
  const identity = useIdentity();
29
- const space = useSpace(spaceKey);
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='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>
65
- </div>
66
- );
60
+ return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
67
61
  };
68
62
 
69
- const meta: Meta = {
63
+ const meta = {
70
64
  title: 'plugins/plugin-thread/Comments',
71
- // TODO(wittjosiah): Use decorator.
72
- render: () => <ClientRepeater component={Story} createIdentity createSpace types={[ThreadType, DataType.Message]} />,
65
+ render: render(DefaultStory),
73
66
  decorators: [
74
- withTheme,
75
- withLayout({ fullscreen: true }),
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.
76
71
  withPluginManager({
77
- plugins: [IntentPlugin()],
72
+ plugins: [
73
+ OperationPlugin(),
74
+ ClientPlugin({
75
+ types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
76
+ onClientInitialized: ({ client }) =>
77
+ Effect.gen(function* () {
78
+ yield* Effect.promise(() => client.halo.createIdentity());
79
+ }),
80
+ }),
81
+ ],
78
82
  }),
79
83
  ],
80
- parameters: { translations },
81
- };
84
+ parameters: {
85
+ translations,
86
+ },
87
+ } satisfies Meta<typeof DefaultStory>;
82
88
 
83
89
  export default meta;
84
90
 
85
- export const Default = {};
91
+ type Story = StoryObj<typeof meta>;
92
+
93
+ export const Default: Story = {};