@dxos/plugin-thread 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (397) hide show
  1. package/dist/lib/browser/app-graph-builder-SPAZN5XL.mjs +188 -0
  2. package/dist/lib/browser/app-graph-builder-SPAZN5XL.mjs.map +7 -0
  3. package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs +17 -0
  4. package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs.map +7 -0
  5. package/dist/lib/browser/blueprints/index.mjs +8 -0
  6. package/dist/lib/browser/call-manager-YBRTG6T3.mjs +26 -0
  7. package/dist/lib/browser/call-manager-YBRTG6T3.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-GERVMFQW.mjs → chunk-CP7E2HRE.mjs} +2 -2
  9. package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-RI3Z6MK3.mjs → chunk-DLO2G3DM.mjs} +79 -76
  11. package/dist/lib/browser/chunk-DLO2G3DM.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-ZCEU5K23.mjs → chunk-ERK254BS.mjs} +207 -287
  13. package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-XYUJXHYV.mjs → chunk-ISCHODBV.mjs} +1 -1
  15. package/dist/lib/browser/{chunk-XYUJXHYV.mjs.map → chunk-ISCHODBV.mjs.map} +2 -2
  16. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  17. package/dist/lib/browser/chunk-TAWDJPMD.mjs +293 -0
  18. package/dist/lib/browser/chunk-TAWDJPMD.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-VZICDGBW.mjs +1813 -0
  20. package/dist/lib/browser/chunk-VZICDGBW.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-ZFLSTQSE.mjs +106 -0
  22. package/dist/lib/browser/chunk-ZFLSTQSE.mjs.map +7 -0
  23. package/dist/lib/browser/index.mjs +127 -120
  24. package/dist/lib/browser/index.mjs.map +4 -4
  25. package/dist/lib/browser/markdown-TSXOA3GV.mjs +210 -0
  26. package/dist/lib/browser/markdown-TSXOA3GV.mjs.map +7 -0
  27. package/dist/lib/browser/meta.json +1 -1
  28. package/dist/lib/browser/operation-resolver-MDMEBYH2.mjs +441 -0
  29. package/dist/lib/browser/operation-resolver-MDMEBYH2.mjs.map +7 -0
  30. package/dist/lib/browser/react-root-Q7U5D3DA.mjs +25 -0
  31. package/dist/lib/browser/react-root-Q7U5D3DA.mjs.map +7 -0
  32. package/dist/lib/browser/react-surface-WDZQSDWH.mjs +110 -0
  33. package/dist/lib/browser/react-surface-WDZQSDWH.mjs.map +7 -0
  34. package/dist/lib/browser/repair-TDKAFAGH.mjs +38 -0
  35. package/dist/lib/browser/repair-TDKAFAGH.mjs.map +7 -0
  36. package/dist/lib/browser/settings-OOKKVXV7.mjs +32 -0
  37. package/dist/lib/browser/settings-OOKKVXV7.mjs.map +7 -0
  38. package/dist/lib/browser/state-3LKZHDRI.mjs +24 -0
  39. package/dist/lib/browser/state-3LKZHDRI.mjs.map +7 -0
  40. package/dist/lib/browser/types/index.mjs +10 -12
  41. package/dist/lib/node-esm/app-graph-builder-3LJAPDUW.mjs +189 -0
  42. package/dist/lib/node-esm/app-graph-builder-3LJAPDUW.mjs.map +7 -0
  43. package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs +18 -0
  44. package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs.map +7 -0
  45. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  46. package/dist/lib/node-esm/call-manager-MMCTNFOH.mjs +27 -0
  47. package/dist/lib/node-esm/call-manager-MMCTNFOH.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-3RD3IVVD.mjs +1814 -0
  49. package/dist/lib/node-esm/chunk-3RD3IVVD.mjs.map +7 -0
  50. package/dist/lib/node-esm/{chunk-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
  51. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs +107 -0
  53. package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-ARTUUKTM.mjs +294 -0
  55. package/dist/lib/node-esm/chunk-ARTUUKTM.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  57. package/dist/lib/node-esm/{chunk-JNPKMT7O.mjs → chunk-KRBZBJRI.mjs} +79 -76
  58. package/dist/lib/node-esm/chunk-KRBZBJRI.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-TIPIOH2J.mjs → chunk-QP3KQOPQ.mjs} +207 -287
  60. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs → chunk-VBI32FGI.mjs} +1 -1
  62. package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs.map → chunk-VBI32FGI.mjs.map} +2 -2
  63. package/dist/lib/node-esm/index.mjs +127 -120
  64. package/dist/lib/node-esm/index.mjs.map +4 -4
  65. package/dist/lib/node-esm/markdown-N2UJ3D6L.mjs +211 -0
  66. package/dist/lib/node-esm/markdown-N2UJ3D6L.mjs.map +7 -0
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/operation-resolver-7PHDJZA2.mjs +442 -0
  69. package/dist/lib/node-esm/operation-resolver-7PHDJZA2.mjs.map +7 -0
  70. package/dist/lib/node-esm/react-root-SZIGQRDZ.mjs +26 -0
  71. package/dist/lib/node-esm/react-root-SZIGQRDZ.mjs.map +7 -0
  72. package/dist/lib/node-esm/react-surface-24PNWUDX.mjs +111 -0
  73. package/dist/lib/node-esm/react-surface-24PNWUDX.mjs.map +7 -0
  74. package/dist/lib/node-esm/repair-LHLLGXKF.mjs +39 -0
  75. package/dist/lib/node-esm/repair-LHLLGXKF.mjs.map +7 -0
  76. package/dist/lib/node-esm/settings-LXZQXSPL.mjs +33 -0
  77. package/dist/lib/node-esm/settings-LXZQXSPL.mjs.map +7 -0
  78. package/dist/lib/node-esm/state-YYAK5ENM.mjs +25 -0
  79. package/dist/lib/node-esm/state-YYAK5ENM.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 +1 -1
  92. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  93. package/dist/types/src/calls/util/calls-service.d.ts +1 -1
  94. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  95. package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
  96. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  97. package/dist/types/src/calls-service.stories.d.ts +0 -1
  98. package/dist/types/src/calls-service.stories.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  100. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  102. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +9 -0
  104. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/call-manager/call-manager.d.ts +6 -0
  108. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/call-manager/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/call-manager/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/index.d.ts +10 -16
  112. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  116. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  118. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  120. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  122. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  124. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  126. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  128. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  130. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  132. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  134. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/settings/settings.d.ts +5 -0
  136. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/state/index.d.ts +3 -0
  138. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/state/state.d.ts +7 -0
  140. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  141. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  142. package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
  143. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  144. package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
  145. package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
  146. package/dist/types/src/components/ChannelContainer.d.ts +5 -6
  147. package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
  148. package/dist/types/src/components/ChannelContainer.stories.d.ts +78 -9
  149. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
  150. package/dist/types/src/components/Chat.stories.d.ts +77 -6
  151. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  152. package/dist/types/src/components/ChatContainer.d.ts +7 -6
  153. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  154. package/dist/types/src/components/Comments.stories.d.ts +5 -2
  155. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/CommentsContainer.d.ts +2 -2
  157. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  158. package/dist/types/src/components/CommentsThreadContainer.d.ts +8 -8
  159. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
  160. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  161. package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
  162. package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
  163. package/dist/types/src/components/Media/VideoObject.stories.d.ts +6 -4
  164. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  165. package/dist/types/src/components/MessageContainer.d.ts +4 -3
  166. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  167. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  168. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +6 -2
  169. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
  170. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +6 -2
  171. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  172. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  173. package/dist/types/src/components/ThreadCompanion.d.ts +5 -0
  174. package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
  175. package/dist/types/src/components/ThreadSettings.d.ts +4 -2
  176. package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
  177. package/dist/types/src/components/index.d.ts +3 -3
  178. package/dist/types/src/components/index.d.ts.map +1 -1
  179. package/dist/types/src/components/testing.d.ts +3 -3
  180. package/dist/types/src/components/testing.d.ts.map +1 -1
  181. package/dist/types/src/extensions/threads.d.ts +7 -2
  182. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  183. package/dist/types/src/functions/create-proposals.d.ts +6 -0
  184. package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
  185. package/dist/types/src/functions/index.d.ts +2 -0
  186. package/dist/types/src/functions/index.d.ts.map +1 -0
  187. package/dist/types/src/hooks/analytics.d.ts +2 -3
  188. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  189. package/dist/types/src/hooks/index.d.ts +2 -2
  190. package/dist/types/src/hooks/index.d.ts.map +1 -1
  191. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
  192. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
  193. package/dist/types/src/index.d.ts +1 -1
  194. package/dist/types/src/index.d.ts.map +1 -1
  195. package/dist/types/src/meta.d.ts +3 -4
  196. package/dist/types/src/meta.d.ts.map +1 -1
  197. package/dist/types/src/testing/stories.d.ts +2 -1
  198. package/dist/types/src/testing/stories.d.ts.map +1 -1
  199. package/dist/types/src/translations.d.ts +76 -6
  200. package/dist/types/src/translations.d.ts.map +1 -1
  201. package/dist/types/src/types/Channel.d.ts +695 -0
  202. package/dist/types/src/types/Channel.d.ts.map +1 -0
  203. package/dist/types/src/types/capabilities.d.ts +23 -0
  204. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  205. package/dist/types/src/types/index.d.ts +2 -1
  206. package/dist/types/src/types/index.d.ts.map +1 -1
  207. package/dist/types/src/types/types.d.ts +3214 -441
  208. package/dist/types/src/types/types.d.ts.map +1 -1
  209. package/dist/types/tsconfig.tsbuildinfo +1 -1
  210. package/package.json +88 -67
  211. package/src/ThreadPlugin.tsx +106 -135
  212. package/src/blueprints/index.ts +5 -0
  213. package/src/blueprints/thread-blueprint.ts +32 -0
  214. package/src/calls/call-manager.ts +76 -52
  215. package/src/calls/call-swarm-synchronizer.ts +2 -2
  216. package/src/calls/media-manager.ts +10 -7
  217. package/src/calls/util/calls-service.ts +1 -1
  218. package/src/calls/util/stub-media-streams.ts +2 -2
  219. package/src/calls/util/task-scheduling.ts +4 -4
  220. package/src/calls-service.stories.tsx +2 -5
  221. package/src/capabilities/app-graph-builder/app-graph-builder.ts +201 -0
  222. package/src/capabilities/app-graph-builder/index.ts +7 -0
  223. package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -0
  224. package/src/capabilities/blueprint-definition/index.ts +7 -0
  225. package/src/capabilities/call-manager/call-manager.ts +26 -0
  226. package/src/capabilities/call-manager/index.ts +7 -0
  227. package/src/capabilities/index.ts +10 -13
  228. package/src/capabilities/markdown/index.ts +7 -0
  229. package/src/capabilities/markdown/markdown.ts +83 -0
  230. package/src/capabilities/operation-resolver/index.ts +7 -0
  231. package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
  232. package/src/capabilities/react-root/index.ts +7 -0
  233. package/src/capabilities/react-root/react-root.tsx +20 -0
  234. package/src/capabilities/react-surface/index.ts +7 -0
  235. package/src/capabilities/react-surface/react-surface.tsx +97 -0
  236. package/src/capabilities/repair/index.ts +7 -0
  237. package/src/capabilities/repair/repair.ts +51 -0
  238. package/src/capabilities/settings/index.ts +7 -0
  239. package/src/capabilities/settings/settings.ts +33 -0
  240. package/src/capabilities/state/index.ts +7 -0
  241. package/src/capabilities/state/state.ts +22 -0
  242. package/src/components/Call/Call.tsx +8 -4
  243. package/src/components/Call/Toolbar.tsx +33 -25
  244. package/src/components/CallDebugPanel.tsx +12 -14
  245. package/src/components/CallSidebar.tsx +5 -3
  246. package/src/components/ChannelContainer.stories.tsx +17 -15
  247. package/src/components/ChannelContainer.tsx +31 -25
  248. package/src/components/Chat.stories.tsx +20 -25
  249. package/src/components/ChatContainer.tsx +35 -27
  250. package/src/components/Comments.stories.tsx +30 -33
  251. package/src/components/CommentsContainer.tsx +5 -7
  252. package/src/components/CommentsThreadContainer.tsx +39 -35
  253. package/src/components/Lobby/Lobby.tsx +9 -7
  254. package/src/components/Media/AudioStream.tsx +2 -2
  255. package/src/components/Media/VideoObject.stories.tsx +12 -7
  256. package/src/components/Media/VideoObject.tsx +2 -2
  257. package/src/components/MessageContainer.tsx +59 -28
  258. package/src/components/Participant/Participant.tsx +32 -19
  259. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +3 -4
  260. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
  261. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +4 -5
  262. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
  263. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +6 -3
  264. package/src/components/ThreadCompanion.tsx +193 -0
  265. package/src/components/ThreadSettings.tsx +6 -1
  266. package/src/components/command-extension.ts +2 -2
  267. package/src/components/index.ts +4 -7
  268. package/src/components/testing.ts +7 -9
  269. package/src/extensions/threads.ts +86 -42
  270. package/src/functions/create-proposals.ts +57 -0
  271. package/src/functions/index.ts +5 -0
  272. package/src/hooks/analytics.ts +21 -21
  273. package/src/hooks/index.ts +3 -2
  274. package/src/hooks/useVideoStreamTrack.tsx +1 -1
  275. package/src/index.ts +1 -1
  276. package/src/meta.ts +11 -7
  277. package/src/testing/stories.ts +17 -16
  278. package/src/translations.ts +6 -3
  279. package/src/types/Channel.ts +30 -0
  280. package/src/types/capabilities.ts +34 -0
  281. package/src/types/index.ts +2 -1
  282. package/src/types/types.ts +168 -89
  283. package/src/util.ts +1 -1
  284. package/dist/lib/browser/ChannelContainer-EICZI7H6.mjs +0 -16
  285. package/dist/lib/browser/ChatContainer-EXNNREYB.mjs +0 -15
  286. package/dist/lib/browser/app-graph-builder-B5GYUSJ2.mjs +0 -171
  287. package/dist/lib/browser/app-graph-builder-B5GYUSJ2.mjs.map +0 -7
  288. package/dist/lib/browser/call-manager-ZXNHLSXU.mjs +0 -24
  289. package/dist/lib/browser/call-manager-ZXNHLSXU.mjs.map +0 -7
  290. package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
  291. package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
  292. package/dist/lib/browser/chunk-5GOEKXWF.mjs +0 -620
  293. package/dist/lib/browser/chunk-5GOEKXWF.mjs.map +0 -7
  294. package/dist/lib/browser/chunk-6L5JSXLF.mjs +0 -23
  295. package/dist/lib/browser/chunk-6L5JSXLF.mjs.map +0 -7
  296. package/dist/lib/browser/chunk-7W7QK5ZP.mjs +0 -986
  297. package/dist/lib/browser/chunk-7W7QK5ZP.mjs.map +0 -7
  298. package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
  299. package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
  300. package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
  301. package/dist/lib/browser/chunk-KTWYVC5X.mjs +0 -147
  302. package/dist/lib/browser/chunk-KTWYVC5X.mjs.map +0 -7
  303. package/dist/lib/browser/chunk-PBMNFG3B.mjs +0 -376
  304. package/dist/lib/browser/chunk-PBMNFG3B.mjs.map +0 -7
  305. package/dist/lib/browser/chunk-RI3Z6MK3.mjs.map +0 -7
  306. package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +0 -7
  307. package/dist/lib/browser/intent-resolver-UZNJ2YDK.mjs +0 -427
  308. package/dist/lib/browser/intent-resolver-UZNJ2YDK.mjs.map +0 -7
  309. package/dist/lib/browser/markdown-II2YTQDX.mjs +0 -169
  310. package/dist/lib/browser/markdown-II2YTQDX.mjs.map +0 -7
  311. package/dist/lib/browser/react-root-5SOWYI62.mjs +0 -28
  312. package/dist/lib/browser/react-root-5SOWYI62.mjs.map +0 -7
  313. package/dist/lib/browser/react-surface-3Z3WJYVP.mjs +0 -109
  314. package/dist/lib/browser/react-surface-3Z3WJYVP.mjs.map +0 -7
  315. package/dist/lib/browser/settings-OR2QP3OU.mjs +0 -22
  316. package/dist/lib/browser/settings-OR2QP3OU.mjs.map +0 -7
  317. package/dist/lib/browser/state-JAWCHYCK.mjs +0 -34
  318. package/dist/lib/browser/state-JAWCHYCK.mjs.map +0 -7
  319. package/dist/lib/browser/toolkit-AU6POUKA.mjs +0 -80
  320. package/dist/lib/browser/toolkit-AU6POUKA.mjs.map +0 -7
  321. package/dist/lib/node-esm/ChannelContainer-FLZZCFBA.mjs +0 -17
  322. package/dist/lib/node-esm/ChatContainer-QVQKFBWA.mjs +0 -16
  323. package/dist/lib/node-esm/app-graph-builder-MQ6T5HPO.mjs +0 -172
  324. package/dist/lib/node-esm/app-graph-builder-MQ6T5HPO.mjs.map +0 -7
  325. package/dist/lib/node-esm/call-manager-KUWBOOOE.mjs +0 -25
  326. package/dist/lib/node-esm/call-manager-KUWBOOOE.mjs.map +0 -7
  327. package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
  328. package/dist/lib/node-esm/chunk-DKCQCENK.mjs +0 -377
  329. package/dist/lib/node-esm/chunk-DKCQCENK.mjs.map +0 -7
  330. package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
  331. package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
  332. package/dist/lib/node-esm/chunk-JNPKMT7O.mjs.map +0 -7
  333. package/dist/lib/node-esm/chunk-LKQE2HID.mjs +0 -25
  334. package/dist/lib/node-esm/chunk-LKQE2HID.mjs.map +0 -7
  335. package/dist/lib/node-esm/chunk-P6E247RF.mjs +0 -148
  336. package/dist/lib/node-esm/chunk-P6E247RF.mjs.map +0 -7
  337. package/dist/lib/node-esm/chunk-PYTVBN5J.mjs +0 -19
  338. package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
  339. package/dist/lib/node-esm/chunk-SNKFZQST.mjs +0 -987
  340. package/dist/lib/node-esm/chunk-SNKFZQST.mjs.map +0 -7
  341. package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +0 -7
  342. package/dist/lib/node-esm/chunk-XXMQULU7.mjs +0 -621
  343. package/dist/lib/node-esm/chunk-XXMQULU7.mjs.map +0 -7
  344. package/dist/lib/node-esm/intent-resolver-HFCMCWWL.mjs +0 -428
  345. package/dist/lib/node-esm/intent-resolver-HFCMCWWL.mjs.map +0 -7
  346. package/dist/lib/node-esm/markdown-5ULETN3T.mjs +0 -170
  347. package/dist/lib/node-esm/markdown-5ULETN3T.mjs.map +0 -7
  348. package/dist/lib/node-esm/react-root-YNTMWDXR.mjs +0 -29
  349. package/dist/lib/node-esm/react-root-YNTMWDXR.mjs.map +0 -7
  350. package/dist/lib/node-esm/react-surface-QMNLDBFM.mjs +0 -110
  351. package/dist/lib/node-esm/react-surface-QMNLDBFM.mjs.map +0 -7
  352. package/dist/lib/node-esm/settings-WGHLJ37H.mjs +0 -23
  353. package/dist/lib/node-esm/settings-WGHLJ37H.mjs.map +0 -7
  354. package/dist/lib/node-esm/state-VN6GE5MY.mjs +0 -35
  355. package/dist/lib/node-esm/state-VN6GE5MY.mjs.map +0 -7
  356. package/dist/lib/node-esm/toolkit-TLMJIYXI.mjs +0 -81
  357. package/dist/lib/node-esm/toolkit-TLMJIYXI.mjs.map +0 -7
  358. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  359. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  360. package/dist/types/src/capabilities/call-manager.d.ts +0 -5
  361. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  362. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  363. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  364. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  365. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  366. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  367. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  368. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  369. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  370. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  371. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  372. package/dist/types/src/capabilities/settings.d.ts +0 -4
  373. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  374. package/dist/types/src/capabilities/state.d.ts +0 -7
  375. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  376. package/dist/types/src/capabilities/toolkit.d.ts +0 -5
  377. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  378. package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
  379. package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
  380. package/dist/types/src/types/schema.d.ts +0 -177
  381. package/dist/types/src/types/schema.d.ts.map +0 -1
  382. package/src/capabilities/app-graph-builder.ts +0 -183
  383. package/src/capabilities/call-manager.ts +0 -20
  384. package/src/capabilities/capabilities.ts +0 -33
  385. package/src/capabilities/intent-resolver.ts +0 -348
  386. package/src/capabilities/markdown.ts +0 -69
  387. package/src/capabilities/react-root.tsx +0 -17
  388. package/src/capabilities/react-surface.tsx +0 -89
  389. package/src/capabilities/settings.ts +0 -19
  390. package/src/capabilities/state.ts +0 -26
  391. package/src/capabilities/toolkit.ts +0 -78
  392. package/src/components/ThreadComplementary.tsx +0 -181
  393. package/src/types/schema.ts +0 -33
  394. /package/dist/lib/browser/{ChannelContainer-EICZI7H6.mjs.map → blueprints/index.mjs.map} +0 -0
  395. /package/dist/lib/browser/{ChatContainer-EXNNREYB.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  396. /package/dist/lib/node-esm/{ChannelContainer-FLZZCFBA.mjs.map → blueprints/index.mjs.map} +0 -0
  397. /package/dist/lib/node-esm/{ChatContainer-QVQKFBWA.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -2,26 +2,24 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useState } from 'react';
9
7
 
10
- import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
8
+ import { Capability, Common, OperationPlugin } from '@dxos/app-framework';
11
9
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { Obj, Ref } from '@dxos/echo';
13
10
  import { faker } from '@dxos/random';
14
11
  import { useClient } from '@dxos/react-client';
15
12
  import { type Space } from '@dxos/react-client/echo';
16
13
  import { useIdentity } from '@dxos/react-client/halo';
17
14
  import { withClientProvider } from '@dxos/react-client/testing';
18
15
  import { useAsyncEffect } from '@dxos/react-ui';
19
- import { Thread } from '@dxos/react-ui-thread';
20
- import { DataType } from '@dxos/schema';
21
- import { render, withLayout, withTheme } from '@dxos/storybook-utils';
16
+ import { withTheme } from '@dxos/react-ui/testing';
17
+ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
18
+ import { render } from '@dxos/storybook-utils';
19
+ import { Message, Thread } from '@dxos/types';
22
20
 
23
21
  import { translations } from '../translations';
24
- import { ChannelType, ThreadType } from '../types';
22
+ import { Channel } from '../types';
25
23
 
26
24
  import { ChatContainer } from './ChatContainer';
27
25
 
@@ -31,17 +29,12 @@ const DefaultStory = () => {
31
29
  const client = useClient();
32
30
  const identity = useIdentity();
33
31
  const [space, setSpace] = useState<Space>();
34
- const [channel, setChannel] = useState<ChannelType | null>();
32
+ const [channel, setChannel] = useState<Channel.Channel | null>();
35
33
 
36
34
  useAsyncEffect(async () => {
37
35
  if (identity) {
38
36
  const space = await client.spaces.create();
39
- const channel = space.db.add(
40
- Obj.make(ChannelType, {
41
- defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
42
- threads: [],
43
- }),
44
- );
37
+ const channel = space.db.add(Channel.make());
45
38
  setSpace(space);
46
39
  setChannel(channel);
47
40
  }
@@ -52,7 +45,7 @@ const DefaultStory = () => {
52
45
  }
53
46
 
54
47
  return (
55
- <main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
48
+ <main className='is-full max-is-proseMaxWidth mli-auto bs-full overflow-hidden'>
56
49
  <ChatContainer space={space} thread={channel.defaultThread.target} />
57
50
  </main>
58
51
  );
@@ -60,15 +53,16 @@ const DefaultStory = () => {
60
53
 
61
54
  const meta = {
62
55
  title: 'plugins/plugin-thread/Chat',
63
- component: Thread.Root as any,
56
+ component: ThreadComponent.Root as any,
64
57
  render: render(DefaultStory),
65
58
  decorators: [
59
+ withTheme,
66
60
  withPluginManager({
67
- plugins: [IntentPlugin()],
61
+ plugins: [OperationPlugin()],
68
62
  capabilities: [
69
- contributes(
70
- Capabilities.ReactSurface,
71
- createSurface({
63
+ Capability.contributes(
64
+ Common.Capability.ReactSurface,
65
+ Common.createSurface({
72
66
  id: 'test',
73
67
  role: 'card',
74
68
  component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
@@ -76,11 +70,12 @@ const meta = {
76
70
  ),
77
71
  ],
78
72
  }),
79
- withTheme,
80
- withLayout({ fullscreen: true }),
81
- withClientProvider({ createSpace: true, types: [ThreadType, ChannelType, DataType.Message] }),
73
+ withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
82
74
  ],
83
- parameters: { translations },
75
+ parameters: {
76
+ layout: 'fullscreen',
77
+ translations,
78
+ },
84
79
  } satisfies Meta<typeof DefaultStory>;
85
80
 
86
81
  export default meta;
@@ -5,25 +5,24 @@
5
5
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
6
6
 
7
7
  import { Obj, Ref } from '@dxos/echo';
8
- import { type Space, fullyQualifiedId, 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
24
  import { useStatus } from '../hooks';
25
25
  import { meta } from '../meta';
26
- import { type ThreadType } from '../types';
27
26
  import { getMessageMetadata } from '../util';
28
27
 
29
28
  import { command } from './command-extension';
@@ -41,18 +40,27 @@ 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<ThreadRootProps, 'current'>;
50
-
51
- 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) => {
52
60
  const { t } = useTranslation(meta.id);
53
- const id = fullyQualifiedId(thread);
61
+ const id = Obj.getDXN(thread).toString();
54
62
  const identity = useIdentity()!;
55
- const members = useMembers(space?.key);
63
+ const members = useMembers(space?.id);
56
64
  const activity = useStatus(space, id);
57
65
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
58
66
  const [_count, _setCount] = useState(0);
@@ -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],
@@ -92,7 +100,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
92
100
 
93
101
  thread.messages.push(
94
102
  Ref.make(
95
- Obj.make(DataType.Message, {
103
+ Obj.make(Message.Message, {
96
104
  created: new Date().toISOString(),
97
105
  sender: { identityDid: identity.did },
98
106
  blocks: [{ _tag: 'text', text: messageRef.current }],
@@ -109,12 +117,13 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
109
117
  };
110
118
 
111
119
  return (
112
- <Thread.Root
120
+ <ThreadComponent.Root
113
121
  current={current}
114
122
  id={id}
115
123
  classNames={[
116
- 'bs-full is-full max-is-prose mli-auto grid-rows-[1fr_min-content_min-content] overflow-hidden',
124
+ 'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
117
125
  'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
126
+ classNames,
118
127
  ]}
119
128
  >
120
129
  <ScrollArea.Root classNames='col-span-2'>
@@ -129,16 +138,15 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
129
138
  </div>
130
139
  {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
131
140
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
132
- <ScrollArea.Scrollbar>
133
- <ScrollArea.Thumb />
134
- </ScrollArea.Scrollbar>
135
141
  </ScrollArea.Viewport>
142
+ <ScrollArea.Scrollbar>
143
+ <ScrollArea.Thumb />
144
+ </ScrollArea.Scrollbar>
136
145
  </ScrollArea.Root>
137
146
 
138
147
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
139
-
140
- <Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
141
- </Thread.Root>
148
+ <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
149
+ </ThreadComponent.Root>
142
150
  );
143
151
  };
144
152
 
@@ -2,24 +2,24 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
8
7
  import React from 'react';
9
8
 
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
17
  import { useAsyncEffect } from '@dxos/react-ui';
18
- import { AnchoredTo, DataType } from '@dxos/schema';
19
- import { layoutCentered, render, withLayout, withTheme } from '@dxos/storybook-utils';
18
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
19
+ import { render } from '@dxos/storybook-utils';
20
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
20
21
 
21
22
  import { translations } from '../translations';
22
- import { ThreadType } from '../types';
23
23
 
24
24
  import { CommentsContainer } from './CommentsContainer';
25
25
  import { createCommentThread, createProposalThread } from './testing';
@@ -28,40 +28,36 @@ faker.seed(1);
28
28
 
29
29
  const DefaultStory = () => {
30
30
  const identity = useIdentity();
31
- const space = useSpace();
32
- const anchors = useQuery(space, Query.type(AnchoredTo));
31
+ const db = useDatabase();
32
+ const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
33
33
 
34
34
  useAsyncEffect(async () => {
35
- if (identity && space) {
36
- const object = space.db.add(Obj.make(Type.Expando, {}));
37
- const thread1 = space.db.add(createCommentThread(identity));
38
- const thread2 = space.db.add(createProposalThread(identity));
39
- space.db.add(
40
- Relation.make(AnchoredTo, {
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
41
  [Relation.Source]: thread1,
42
42
  [Relation.Target]: object,
43
43
  anchor: 'test',
44
44
  }),
45
45
  );
46
- space.db.add(
47
- Relation.make(AnchoredTo, {
46
+ db.add(
47
+ Relation.make(AnchoredTo.AnchoredTo, {
48
48
  [Relation.Source]: thread2,
49
49
  [Relation.Target]: object,
50
50
  anchor: 'test',
51
51
  }),
52
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} onAcceptProposal={console.log} />
63
- </div>
64
- );
60
+ return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
65
61
  };
66
62
 
67
63
  const meta = {
@@ -69,17 +65,18 @@ const meta = {
69
65
  render: render(DefaultStory),
70
66
  decorators: [
71
67
  withTheme,
72
- withLayout({ fullscreen: true, classNames: layoutCentered }),
73
- // TODO(wittjosiah): This shouldn't depend on app framework. Should use withClientProvider instead.
74
- // Currently this is required due to useOnEditAnalytics.
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.
75
71
  withPluginManager({
76
72
  plugins: [
77
- IntentPlugin(),
73
+ OperationPlugin(),
78
74
  ClientPlugin({
79
- types: [DataType.Message, ThreadType, AnchoredTo],
80
- onClientInitialized: async ({ client }) => {
81
- await client.halo.createIdentity();
82
- },
75
+ types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
76
+ onClientInitialized: ({ client }) =>
77
+ Effect.gen(function* () {
78
+ yield* Effect.promise(() => client.halo.createIdentity());
79
+ }),
83
80
  }),
84
81
  ],
85
82
  }),
@@ -4,18 +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
11
  import { meta } from '../meta';
13
- import { type ThreadType } from '../types';
14
12
 
15
13
  import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
16
14
 
17
15
  export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
18
- anchors: AnchoredTo[];
16
+ anchors: AnchoredTo.AnchoredTo[];
19
17
  currentId?: string;
20
18
  showResolvedThreads?: boolean;
21
19
  };
@@ -63,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
63
61
  return (
64
62
  <div>
65
63
  {filteredAnchors.map((anchor) => {
66
- const thread = Relation.getSource(anchor) as ThreadType;
67
- const threadId = fullyQualifiedId(thread);
64
+ const thread = Relation.getSource(anchor) as Thread.Thread;
65
+ const threadId = Obj.getDXN(thread).toString();
68
66
  return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
69
67
  })}
70
68
  </div>
@@ -4,32 +4,36 @@
4
4
 
5
5
  import React, { useCallback, useMemo, useRef, useState } from 'react';
6
6
 
7
- import { Ref, Relation } from '@dxos/echo';
8
- import { fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
7
+ import { Obj, Relation } from '@dxos/echo';
8
+ import { useObject } from '@dxos/echo-react';
9
+ import { getSpace, useMembers } from '@dxos/react-client/echo';
9
10
  import { useIdentity } from '@dxos/react-client/halo';
10
11
  import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
11
- import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
12
- import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
13
- import { MessageTextbox, type MessageTextboxProps, Thread, type ThreadRootProps } from '@dxos/react-ui-thread';
14
- import { type AnchoredTo } from '@dxos/schema';
15
- import { isNonNullable } from '@dxos/util';
12
+ import {
13
+ MessageTextbox,
14
+ type MessageTextboxProps,
15
+ Thread as ThreadComponent,
16
+ type ThreadRootProps,
17
+ } from '@dxos/react-ui-thread';
18
+ import { type AnchoredTo, type Thread } from '@dxos/types';
19
+ import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
20
+ import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';
16
21
 
17
22
  import { useStatus } from '../hooks';
18
23
  import { meta } from '../meta';
19
- import { type ThreadType } from '../types';
20
24
  import { getMessageMetadata } from '../util';
21
25
 
22
26
  import { command } from './command-extension';
23
27
  import { MessageContainer, buttonClassNames, buttonGroupClassNames } from './MessageContainer';
24
28
 
25
29
  export type CommentsThreadContainerProps = {
26
- anchor: AnchoredTo;
27
- onAttend?: (anchor: AnchoredTo) => void;
28
- onComment?: (anchor: AnchoredTo, message: string) => void;
29
- onResolve?: (anchor: AnchoredTo) => void;
30
- onMessageDelete?: (anchor: AnchoredTo, messageId: string) => void;
31
- onThreadDelete?: (anchor: AnchoredTo) => void;
32
- onAcceptProposal?: (anchor: AnchoredTo, messageId: string) => void;
30
+ anchor: AnchoredTo.AnchoredTo;
31
+ onAttend?: (anchor: AnchoredTo.AnchoredTo) => void;
32
+ onComment?: (anchor: AnchoredTo.AnchoredTo, message: string) => void;
33
+ onResolve?: (anchor: AnchoredTo.AnchoredTo) => void;
34
+ onMessageDelete?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
35
+ onThreadDelete?: (anchor: AnchoredTo.AnchoredTo) => void;
36
+ onAcceptProposal?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
33
37
  } & Pick<ThreadRootProps, 'current'>;
34
38
 
35
39
  export const CommentsThreadContainer = ({
@@ -42,29 +46,30 @@ export const CommentsThreadContainer = ({
42
46
  onThreadDelete,
43
47
  onAcceptProposal,
44
48
  }: CommentsThreadContainerProps) => {
49
+ const { themeMode } = useThemeContext();
45
50
  const { t } = useTranslation(meta.id);
46
51
  const identity = useIdentity()!;
47
52
  const space = getSpace(anchor);
48
- const members = useMembers(space?.key);
53
+ const members = useMembers(space?.id);
49
54
  const detached = !anchor.anchor;
50
- const thread = Relation.getSource(anchor) as ThreadType;
51
- const activity = useStatus(space, fullyQualifiedId(thread));
55
+ const thread = Relation.getSource(anchor) as Thread.Thread;
56
+ const [messages] = useObject(thread, 'messages');
57
+ const activity = useStatus(space, Obj.getDXN(thread).toString());
52
58
  const threadScrollRef = useRef<HTMLDivElement | null>(null);
53
- const { themeMode } = useThemeContext();
54
59
 
55
- const textboxMetadata = getMessageMetadata(fullyQualifiedId(thread), identity);
60
+ const textboxMetadata = getMessageMetadata(Obj.getDXN(thread).toString(), identity);
61
+
56
62
  // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
57
- const [_count, _setCount] = useState(0);
58
- const rerenderEditor = () => _setCount((count) => count + 1);
63
+ const [state, setState] = useState({});
59
64
  const messageRef = useRef('');
60
65
  const extensions = useMemo(
61
66
  () => [
62
67
  createBasicExtensions({ placeholder: t('message placeholder') }),
63
68
  createThemeExtensions({ themeMode }),
64
- listener({ onChange: (text) => (messageRef.current = text) }),
69
+ listener({ onChange: ({ text }) => (messageRef.current = text) }),
65
70
  command,
66
71
  ],
67
- [_count],
72
+ [state],
68
73
  );
69
74
 
70
75
  // TODO(thure): Factor out.
@@ -85,14 +90,14 @@ export const CommentsThreadContainer = ({
85
90
  onComment?.(anchor, messageRef.current);
86
91
  messageRef.current = '';
87
92
  scrollToEnd('instant');
88
- rerenderEditor();
93
+ setState({});
89
94
 
90
95
  return true;
91
96
  }, [anchor, identity]);
92
97
 
93
98
  return (
94
- <Thread.Root
95
- id={fullyQualifiedId(thread)}
99
+ <ThreadComponent.Root
100
+ id={Obj.getDXN(thread).toString()}
96
101
  classNames='pbs-2 border-be border-subduedSeparator last:border-none'
97
102
  current={current}
98
103
  onClickCapture={handleAttend}
@@ -108,10 +113,10 @@ export const CommentsThreadContainer = ({
108
113
  >
109
114
  {detached ? (
110
115
  <Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
111
- <Thread.Header detached>{thread.name}</Thread.Header>
116
+ <ThreadComponent.Header detached>{thread.name}</ThreadComponent.Header>
112
117
  </Tooltip.Trigger>
113
118
  ) : (
114
- <Thread.Header>{thread.name}</Thread.Header>
119
+ <ThreadComponent.Header>{thread.name}</ThreadComponent.Header>
115
120
  )}
116
121
  <div role='none' className={buttonGroupClassNames}>
117
122
  {thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
@@ -140,12 +145,11 @@ export const CommentsThreadContainer = ({
140
145
  </div>
141
146
  </div>
142
147
 
143
- {/** TODO(dmaretskyi): How's `thread.messages` undefined? */}
144
- {Ref.Array.targets(thread.messages?.filter(isNonNullable) ?? []).map((message) => (
148
+ {messages?.map((ref) => (
145
149
  <MessageContainer
146
- key={message.id}
150
+ key={ref.dxn.toString()}
147
151
  editable
148
- message={message}
152
+ message={ref}
149
153
  members={members}
150
154
  onDelete={handleMessageDelete}
151
155
  onAcceptProposal={handleAcceptProposal}
@@ -160,10 +164,10 @@ export const CommentsThreadContainer = ({
160
164
  */}
161
165
  <MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
162
166
 
163
- <Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
167
+ <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
164
168
 
165
169
  {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
166
170
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
167
- </Thread.Root>
171
+ </ThreadComponent.Root>
168
172
  );
169
173
  };
@@ -2,14 +2,15 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
6
7
 
7
- import { useCapability } from '@dxos/app-framework';
8
+ import { useCapability } from '@dxos/app-framework/react';
8
9
  import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
10
+ import { mx } from '@dxos/ui-theme';
10
11
 
11
- import { ThreadCapabilities } from '../../capabilities';
12
12
  import { meta } from '../../meta';
13
+ import { ThreadCapabilities } from '../../types';
13
14
  import { Toolbar, type ToolbarProps } from '../Call';
14
15
  import { VideoObject } from '../Media';
15
16
  import { ResponsiveContainer } from '../ResponsiveGrid';
@@ -39,9 +40,10 @@ type LobbyPreviewProps = {};
39
40
  const LobbyPreview: FC<LobbyPreviewProps> = () => {
40
41
  const { t } = useTranslation(meta.id);
41
42
  const call = useCapability(ThreadCapabilities.CallManager);
43
+ const media = useAtomValue(call.mediaAtom);
42
44
  const [classNames, setClassNames] = useState('');
43
45
  useEffect(() => {
44
- if (!call.media.videoEnabled) {
46
+ if (!media.videoEnabled) {
45
47
  setClassNames('');
46
48
  return;
47
49
  }
@@ -52,14 +54,14 @@ const LobbyPreview: FC<LobbyPreviewProps> = () => {
52
54
  }, 500);
53
55
 
54
56
  return () => clearTimeout(timeout);
55
- }, [call.media.videoEnabled]);
57
+ }, [media.videoEnabled]);
56
58
 
57
59
  return (
58
60
  <div className='grid grow p-4'>
59
61
  <ResponsiveContainer>
60
- {(call.media.videoEnabled && (
62
+ {(media.videoEnabled && (
61
63
  <VideoObject
62
- videoStream={call.media.videoStream}
64
+ videoStream={media.videoStream}
63
65
  flip
64
66
  muted
65
67
  classNames={mx(
@@ -46,13 +46,13 @@ export const AudioStream: FC<AudioStreamProps> = ({ tracks }) => {
46
46
  );
47
47
  };
48
48
 
49
- type AudioTrackProps = {
49
+ type AudioTrackParams = {
50
50
  track: MediaStreamTrack;
51
51
  mediaStream: MediaStream;
52
52
  resetSrcObject: () => void;
53
53
  };
54
54
 
55
- const AudioTrack = ({ track, mediaStream, resetSrcObject }: AudioTrackProps) => {
55
+ const AudioTrack = ({ track, mediaStream, resetSrcObject }: AudioTrackParams) => {
56
56
  useEffect(() => {
57
57
  const currentTrack = track;
58
58
  mediaStream.addTrack(currentTrack);
@@ -2,15 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useEffect, useState } from 'react';
9
7
 
10
8
  import { scheduleTask } from '@dxos/async';
11
9
  import { Context } from '@dxos/context';
12
10
  import { log } from '@dxos/log';
13
- import { withLayout, withTheme } from '@dxos/storybook-utils';
11
+ import { withTheme } from '@dxos/react-ui/testing';
14
12
 
15
13
  import { getUserMediaTrack } from '../../calls';
16
14
  import { ResponsiveContainer } from '../ResponsiveGrid';
@@ -23,9 +21,13 @@ const DefaultStory = (props: VideoObjectProps) => {
23
21
  useEffect(() => {
24
22
  const ctx = new Context();
25
23
  scheduleTask(ctx, async () => {
26
- const stream = new MediaStream();
27
- stream.addTrack(await getUserMediaTrack('videoinput'));
28
- setVideoStream(stream);
24
+ try {
25
+ const stream = new MediaStream();
26
+ stream.addTrack(await getUserMediaTrack('videoinput'));
27
+ setVideoStream(stream);
28
+ } catch (err) {
29
+ log.catch(err);
30
+ }
29
31
  });
30
32
 
31
33
  return () => {
@@ -45,7 +47,10 @@ const meta = {
45
47
  title: 'plugins/plugin-thread/VideoObject',
46
48
  component: VideoObject,
47
49
  render: DefaultStory,
48
- decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
50
+ decorators: [withTheme],
51
+ parameters: {
52
+ layout: 'fullscreen',
53
+ },
49
54
  };
50
55
 
51
56
  export default meta;
@@ -5,7 +5,7 @@
5
5
  import React, { type JSX, forwardRef, memo, useEffect, useRef } from 'react';
6
6
 
7
7
  import { type ThemedClassName } from '@dxos/react-ui';
8
- import { mx } from '@dxos/react-ui-theme';
8
+ import { mx } from '@dxos/ui-theme';
9
9
 
10
10
  export type VideoObjectProps = Omit<JSX.IntrinsicElements['video'], 'className' | 'ref'> &
11
11
  ThemedClassName<{
@@ -32,7 +32,7 @@ export const VideoObject = memo(
32
32
  return (
33
33
  <video
34
34
  className={mx(
35
- 'w-full aspect-video',
35
+ 'is-full aspect-video',
36
36
  flip && 'scale-x-[-1]',
37
37
  contain ? 'object-contain' : 'object-cover',
38
38
  classNames,