@dxos/plugin-thread 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51

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 (383) 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-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-HDEQRBOC.mjs → chunk-JBB73URQ.mjs} +79 -76
  18. package/dist/lib/browser/chunk-JBB73URQ.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-RH7XTXSR.mjs +106 -0
  20. package/dist/lib/browser/chunk-RH7XTXSR.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +147 -137
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/markdown-YJCSOWXX.mjs +210 -0
  24. package/dist/lib/browser/markdown-YJCSOWXX.mjs.map +7 -0
  25. package/dist/lib/browser/meta.json +1 -1
  26. package/dist/lib/browser/operation-resolver-PROCP5L4.mjs +441 -0
  27. package/dist/lib/browser/operation-resolver-PROCP5L4.mjs.map +7 -0
  28. package/dist/lib/browser/react-root-FHK2SVPU.mjs +25 -0
  29. package/dist/lib/browser/react-root-FHK2SVPU.mjs.map +7 -0
  30. package/dist/lib/browser/react-surface-7MQA6VSH.mjs +111 -0
  31. package/dist/lib/browser/react-surface-7MQA6VSH.mjs.map +7 -0
  32. package/dist/lib/browser/repair-6OZ75AUU.mjs +38 -0
  33. package/dist/lib/browser/repair-6OZ75AUU.mjs.map +7 -0
  34. package/dist/lib/browser/settings-TWKOTGSU.mjs +33 -0
  35. package/dist/lib/browser/settings-TWKOTGSU.mjs.map +7 -0
  36. package/dist/lib/browser/state-SJR2GL5G.mjs +24 -0
  37. package/dist/lib/browser/state-SJR2GL5G.mjs.map +7 -0
  38. package/dist/lib/browser/types/index.mjs +10 -12
  39. package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs +190 -0
  40. package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs.map +7 -0
  41. package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs +19 -0
  42. package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs.map +7 -0
  43. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  44. package/dist/lib/node-esm/call-manager-36UAAQCJ.mjs +27 -0
  45. package/dist/lib/node-esm/call-manager-36UAAQCJ.mjs.map +7 -0
  46. package/dist/lib/node-esm/{chunk-2MMJF7DW.mjs → chunk-G7PZNN3Z.mjs} +79 -76
  47. package/dist/lib/node-esm/chunk-G7PZNN3Z.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  49. package/dist/lib/node-esm/chunk-OKVE6CLS.mjs +107 -0
  50. package/dist/lib/node-esm/chunk-OKVE6CLS.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-TIPIOH2J.mjs → chunk-QP3KQOPQ.mjs} +207 -287
  52. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-RBRWHRHE.mjs +1818 -0
  54. package/dist/lib/node-esm/chunk-RBRWHRHE.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs → chunk-VBI32FGI.mjs} +1 -1
  56. package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs.map → chunk-VBI32FGI.mjs.map} +2 -2
  57. package/dist/lib/node-esm/chunk-WMWUXWAS.mjs +294 -0
  58. package/dist/lib/node-esm/chunk-WMWUXWAS.mjs.map +7 -0
  59. package/dist/lib/node-esm/index.mjs +147 -137
  60. package/dist/lib/node-esm/index.mjs.map +4 -4
  61. package/dist/lib/node-esm/markdown-6LRP3PAP.mjs +211 -0
  62. package/dist/lib/node-esm/markdown-6LRP3PAP.mjs.map +7 -0
  63. package/dist/lib/node-esm/meta.json +1 -1
  64. package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs +442 -0
  65. package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs.map +7 -0
  66. package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs +26 -0
  67. package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs.map +7 -0
  68. package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs +112 -0
  69. package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs.map +7 -0
  70. package/dist/lib/node-esm/repair-6777EPOM.mjs +39 -0
  71. package/dist/lib/node-esm/repair-6777EPOM.mjs.map +7 -0
  72. package/dist/lib/node-esm/settings-5O254B3Z.mjs +34 -0
  73. package/dist/lib/node-esm/settings-5O254B3Z.mjs.map +7 -0
  74. package/dist/lib/node-esm/state-5R3TZJQE.mjs +25 -0
  75. package/dist/lib/node-esm/state-5R3TZJQE.mjs.map +7 -0
  76. package/dist/lib/node-esm/types/index.mjs +10 -12
  77. package/dist/types/src/ThreadPlugin.d.ts +2 -1
  78. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  79. package/dist/types/src/blueprints/index.d.ts +2 -0
  80. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  81. package/dist/types/src/blueprints/thread-blueprint.d.ts +21 -0
  82. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
  83. package/dist/types/src/calls/call-manager.d.ts +40 -30
  84. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  85. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
  86. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  87. package/dist/types/src/calls/media-manager.d.ts +1 -1
  88. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  89. package/dist/types/src/calls/util/calls-service.d.ts +1 -1
  90. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  91. package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
  92. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  94. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  96. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
  98. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  100. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/call-manager/call-manager.d.ts +6 -0
  102. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/call-manager/index.d.ts +3 -0
  104. package/dist/types/src/capabilities/call-manager/index.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/index.d.ts +10 -16
  106. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  108. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  110. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  112. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  114. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  116. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  118. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  120. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  122. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  124. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  126. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  128. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
  130. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/state/index.d.ts +3 -0
  132. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/state/state.d.ts +7 -0
  134. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  135. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  136. package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
  137. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  138. package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
  139. package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
  140. package/dist/types/src/components/ChannelContainer.d.ts +5 -6
  141. package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
  142. package/dist/types/src/components/ChannelContainer.stories.d.ts +77 -7
  143. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
  144. package/dist/types/src/components/Chat.stories.d.ts +76 -5
  145. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  146. package/dist/types/src/components/ChatContainer.d.ts +7 -6
  147. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  148. package/dist/types/src/components/Comments.stories.d.ts +5 -1
  149. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  150. package/dist/types/src/components/CommentsContainer.d.ts +2 -2
  151. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  152. package/dist/types/src/components/CommentsThreadContainer.d.ts +8 -8
  153. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
  154. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  155. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  156. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  157. package/dist/types/src/components/MessageContainer.d.ts +4 -3
  158. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  159. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  160. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +5 -1
  161. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
  162. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +5 -1
  163. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  164. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  165. package/dist/types/src/components/ThreadCompanion.d.ts +5 -0
  166. package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
  167. package/dist/types/src/components/ThreadSettings.d.ts +4 -2
  168. package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
  169. package/dist/types/src/components/index.d.ts +3 -3
  170. package/dist/types/src/components/index.d.ts.map +1 -1
  171. package/dist/types/src/components/testing.d.ts +3 -3
  172. package/dist/types/src/components/testing.d.ts.map +1 -1
  173. package/dist/types/src/extensions/threads.d.ts +7 -2
  174. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  175. package/dist/types/src/functions/create-proposals.d.ts +13 -0
  176. package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
  177. package/dist/types/src/functions/index.d.ts +2 -0
  178. package/dist/types/src/functions/index.d.ts.map +1 -0
  179. package/dist/types/src/hooks/analytics.d.ts +2 -3
  180. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  181. package/dist/types/src/hooks/index.d.ts +2 -2
  182. package/dist/types/src/hooks/index.d.ts.map +1 -1
  183. package/dist/types/src/index.d.ts +1 -1
  184. package/dist/types/src/index.d.ts.map +1 -1
  185. package/dist/types/src/meta.d.ts +2 -2
  186. package/dist/types/src/meta.d.ts.map +1 -1
  187. package/dist/types/src/testing/stories.d.ts +2 -1
  188. package/dist/types/src/testing/stories.d.ts.map +1 -1
  189. package/dist/types/src/translations.d.ts +76 -6
  190. package/dist/types/src/translations.d.ts.map +1 -1
  191. package/dist/types/src/types/Channel.d.ts +695 -0
  192. package/dist/types/src/types/Channel.d.ts.map +1 -0
  193. package/dist/types/src/types/capabilities.d.ts +23 -0
  194. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  195. package/dist/types/src/types/index.d.ts +2 -1
  196. package/dist/types/src/types/index.d.ts.map +1 -1
  197. package/dist/types/src/types/types.d.ts +3217 -446
  198. package/dist/types/src/types/types.d.ts.map +1 -1
  199. package/dist/types/tsconfig.tsbuildinfo +1 -1
  200. package/package.json +88 -65
  201. package/src/ThreadPlugin.tsx +75 -102
  202. package/src/blueprints/index.ts +5 -0
  203. package/src/blueprints/thread-blueprint.ts +32 -0
  204. package/src/calls/call-manager.ts +76 -52
  205. package/src/calls/call-swarm-synchronizer.ts +2 -2
  206. package/src/calls/media-manager.ts +10 -7
  207. package/src/calls/util/calls-service.ts +1 -1
  208. package/src/calls/util/stub-media-streams.ts +2 -2
  209. package/src/calls/util/task-scheduling.ts +4 -4
  210. package/src/calls-service.stories.tsx +1 -1
  211. package/src/capabilities/app-graph-builder/app-graph-builder.ts +202 -0
  212. package/src/capabilities/app-graph-builder/index.ts +7 -0
  213. package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
  214. package/src/capabilities/blueprint-definition/index.ts +7 -0
  215. package/src/capabilities/call-manager/call-manager.ts +26 -0
  216. package/src/capabilities/call-manager/index.ts +7 -0
  217. package/src/capabilities/index.ts +10 -13
  218. package/src/capabilities/markdown/index.ts +7 -0
  219. package/src/capabilities/markdown/markdown.ts +83 -0
  220. package/src/capabilities/operation-resolver/index.ts +7 -0
  221. package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
  222. package/src/capabilities/react-root/index.ts +7 -0
  223. package/src/capabilities/react-root/react-root.tsx +20 -0
  224. package/src/capabilities/react-surface/index.ts +7 -0
  225. package/src/capabilities/react-surface/react-surface.tsx +98 -0
  226. package/src/capabilities/repair/index.ts +7 -0
  227. package/src/capabilities/repair/repair.ts +51 -0
  228. package/src/capabilities/settings/index.ts +7 -0
  229. package/src/capabilities/settings/settings.ts +34 -0
  230. package/src/capabilities/state/index.ts +7 -0
  231. package/src/capabilities/state/state.ts +22 -0
  232. package/src/components/Call/Call.tsx +8 -4
  233. package/src/components/Call/Toolbar.tsx +34 -25
  234. package/src/components/CallDebugPanel.tsx +12 -14
  235. package/src/components/CallSidebar.tsx +5 -3
  236. package/src/components/ChannelContainer.stories.tsx +13 -12
  237. package/src/components/ChannelContainer.tsx +38 -31
  238. package/src/components/Chat.stories.tsx +14 -19
  239. package/src/components/ChatContainer.tsx +46 -39
  240. package/src/components/Comments.stories.tsx +26 -24
  241. package/src/components/CommentsContainer.tsx +5 -7
  242. package/src/components/CommentsThreadContainer.tsx +39 -35
  243. package/src/components/Lobby/Lobby.tsx +9 -7
  244. package/src/components/Media/AudioStream.tsx +2 -2
  245. package/src/components/Media/VideoObject.stories.tsx +1 -1
  246. package/src/components/Media/VideoObject.tsx +2 -2
  247. package/src/components/MessageContainer.tsx +59 -28
  248. package/src/components/Participant/Participant.tsx +32 -19
  249. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +1 -1
  250. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
  251. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +2 -2
  252. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
  253. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +6 -3
  254. package/src/components/ThreadCompanion.tsx +194 -0
  255. package/src/components/ThreadSettings.tsx +9 -3
  256. package/src/components/command-extension.ts +2 -2
  257. package/src/components/index.ts +4 -7
  258. package/src/components/testing.ts +7 -9
  259. package/src/extensions/threads.ts +86 -42
  260. package/src/functions/create-proposals.ts +57 -0
  261. package/src/functions/index.ts +5 -0
  262. package/src/hooks/analytics.ts +21 -21
  263. package/src/hooks/index.ts +3 -2
  264. package/src/index.ts +1 -1
  265. package/src/meta.ts +8 -3
  266. package/src/testing/stories.ts +17 -15
  267. package/src/translations.ts +6 -3
  268. package/src/types/Channel.ts +30 -0
  269. package/src/types/capabilities.ts +34 -0
  270. package/src/types/index.ts +2 -1
  271. package/src/types/types.ts +167 -88
  272. package/dist/lib/browser/ChannelContainer-BGDGZHV4.mjs +0 -16
  273. package/dist/lib/browser/ChatContainer-75KJZ4XR.mjs +0 -15
  274. package/dist/lib/browser/app-graph-builder-ODKIAXR7.mjs +0 -171
  275. package/dist/lib/browser/app-graph-builder-ODKIAXR7.mjs.map +0 -7
  276. package/dist/lib/browser/call-manager-BCKLI4QD.mjs +0 -24
  277. package/dist/lib/browser/call-manager-BCKLI4QD.mjs.map +0 -7
  278. package/dist/lib/browser/chunk-2MUYQOQE.mjs +0 -23
  279. package/dist/lib/browser/chunk-2MUYQOQE.mjs.map +0 -7
  280. package/dist/lib/browser/chunk-B7YQ7QR2.mjs +0 -376
  281. package/dist/lib/browser/chunk-B7YQ7QR2.mjs.map +0 -7
  282. package/dist/lib/browser/chunk-CMCVHULC.mjs +0 -986
  283. package/dist/lib/browser/chunk-CMCVHULC.mjs.map +0 -7
  284. package/dist/lib/browser/chunk-HDEQRBOC.mjs.map +0 -7
  285. package/dist/lib/browser/chunk-L326LSNS.mjs +0 -18
  286. package/dist/lib/browser/chunk-L326LSNS.mjs.map +0 -7
  287. package/dist/lib/browser/chunk-T4KJ5JR4.mjs +0 -15
  288. package/dist/lib/browser/chunk-T4KJ5JR4.mjs.map +0 -7
  289. package/dist/lib/browser/chunk-VJMKS4CZ.mjs +0 -619
  290. package/dist/lib/browser/chunk-VJMKS4CZ.mjs.map +0 -7
  291. package/dist/lib/browser/chunk-VTYX3SIM.mjs +0 -147
  292. package/dist/lib/browser/chunk-VTYX3SIM.mjs.map +0 -7
  293. package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +0 -7
  294. package/dist/lib/browser/intent-resolver-VOQD3TQ2.mjs +0 -427
  295. package/dist/lib/browser/intent-resolver-VOQD3TQ2.mjs.map +0 -7
  296. package/dist/lib/browser/markdown-R6MGRIA6.mjs +0 -169
  297. package/dist/lib/browser/markdown-R6MGRIA6.mjs.map +0 -7
  298. package/dist/lib/browser/react-root-UMSBTN6H.mjs +0 -28
  299. package/dist/lib/browser/react-root-UMSBTN6H.mjs.map +0 -7
  300. package/dist/lib/browser/react-surface-SXMQEWKE.mjs +0 -109
  301. package/dist/lib/browser/react-surface-SXMQEWKE.mjs.map +0 -7
  302. package/dist/lib/browser/settings-TCNF54PN.mjs +0 -22
  303. package/dist/lib/browser/settings-TCNF54PN.mjs.map +0 -7
  304. package/dist/lib/browser/state-ZQ4IPOJT.mjs +0 -34
  305. package/dist/lib/browser/state-ZQ4IPOJT.mjs.map +0 -7
  306. package/dist/lib/browser/toolkit-JF4B4QIO.mjs +0 -84
  307. package/dist/lib/browser/toolkit-JF4B4QIO.mjs.map +0 -7
  308. package/dist/lib/node-esm/ChannelContainer-OXC6BTU7.mjs +0 -17
  309. package/dist/lib/node-esm/ChatContainer-SH6LTFQL.mjs +0 -16
  310. package/dist/lib/node-esm/app-graph-builder-DMPT3MY6.mjs +0 -172
  311. package/dist/lib/node-esm/app-graph-builder-DMPT3MY6.mjs.map +0 -7
  312. package/dist/lib/node-esm/call-manager-Q7RY2YP4.mjs +0 -25
  313. package/dist/lib/node-esm/call-manager-Q7RY2YP4.mjs.map +0 -7
  314. package/dist/lib/node-esm/chunk-2KZ4ODHU.mjs +0 -987
  315. package/dist/lib/node-esm/chunk-2KZ4ODHU.mjs.map +0 -7
  316. package/dist/lib/node-esm/chunk-2MMJF7DW.mjs.map +0 -7
  317. package/dist/lib/node-esm/chunk-BAMZXJS4.mjs +0 -148
  318. package/dist/lib/node-esm/chunk-BAMZXJS4.mjs.map +0 -7
  319. package/dist/lib/node-esm/chunk-BTGKI5IK.mjs +0 -377
  320. package/dist/lib/node-esm/chunk-BTGKI5IK.mjs.map +0 -7
  321. package/dist/lib/node-esm/chunk-GZ4WL2IS.mjs +0 -25
  322. package/dist/lib/node-esm/chunk-GZ4WL2IS.mjs.map +0 -7
  323. package/dist/lib/node-esm/chunk-LCHTNRK7.mjs +0 -19
  324. package/dist/lib/node-esm/chunk-LCHTNRK7.mjs.map +0 -7
  325. package/dist/lib/node-esm/chunk-NHSIAEDW.mjs +0 -620
  326. package/dist/lib/node-esm/chunk-NHSIAEDW.mjs.map +0 -7
  327. package/dist/lib/node-esm/chunk-OBVAURUU.mjs +0 -17
  328. package/dist/lib/node-esm/chunk-OBVAURUU.mjs.map +0 -7
  329. package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +0 -7
  330. package/dist/lib/node-esm/intent-resolver-AKVH66PH.mjs +0 -428
  331. package/dist/lib/node-esm/intent-resolver-AKVH66PH.mjs.map +0 -7
  332. package/dist/lib/node-esm/markdown-MYGTDXT6.mjs +0 -170
  333. package/dist/lib/node-esm/markdown-MYGTDXT6.mjs.map +0 -7
  334. package/dist/lib/node-esm/react-root-W6AVTL5M.mjs +0 -29
  335. package/dist/lib/node-esm/react-root-W6AVTL5M.mjs.map +0 -7
  336. package/dist/lib/node-esm/react-surface-NLSZJGMO.mjs +0 -110
  337. package/dist/lib/node-esm/react-surface-NLSZJGMO.mjs.map +0 -7
  338. package/dist/lib/node-esm/settings-ZQHGVFBY.mjs +0 -23
  339. package/dist/lib/node-esm/settings-ZQHGVFBY.mjs.map +0 -7
  340. package/dist/lib/node-esm/state-FSLLJ5TZ.mjs +0 -35
  341. package/dist/lib/node-esm/state-FSLLJ5TZ.mjs.map +0 -7
  342. package/dist/lib/node-esm/toolkit-DHPKJITO.mjs +0 -85
  343. package/dist/lib/node-esm/toolkit-DHPKJITO.mjs.map +0 -7
  344. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  345. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  346. package/dist/types/src/capabilities/call-manager.d.ts +0 -5
  347. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  348. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  349. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  350. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  351. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  352. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  353. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  354. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  355. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  356. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  357. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  358. package/dist/types/src/capabilities/settings.d.ts +0 -4
  359. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  360. package/dist/types/src/capabilities/state.d.ts +0 -7
  361. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  362. package/dist/types/src/capabilities/toolkit.d.ts +0 -6
  363. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  364. package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
  365. package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
  366. package/dist/types/src/types/schema.d.ts +0 -179
  367. package/dist/types/src/types/schema.d.ts.map +0 -1
  368. package/src/capabilities/app-graph-builder.ts +0 -184
  369. package/src/capabilities/call-manager.ts +0 -20
  370. package/src/capabilities/capabilities.ts +0 -33
  371. package/src/capabilities/intent-resolver.ts +0 -348
  372. package/src/capabilities/markdown.ts +0 -69
  373. package/src/capabilities/react-root.tsx +0 -17
  374. package/src/capabilities/react-surface.tsx +0 -89
  375. package/src/capabilities/settings.ts +0 -19
  376. package/src/capabilities/state.ts +0 -26
  377. package/src/capabilities/toolkit.ts +0 -82
  378. package/src/components/ThreadComplementary.tsx +0 -181
  379. package/src/types/schema.ts +0 -33
  380. /package/dist/lib/browser/{ChannelContainer-BGDGZHV4.mjs.map → blueprints/index.mjs.map} +0 -0
  381. /package/dist/lib/browser/{ChatContainer-75KJZ4XR.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  382. /package/dist/lib/node-esm/{ChannelContainer-OXC6BTU7.mjs.map → blueprints/index.mjs.map} +0 -0
  383. /package/dist/lib/node-esm/{ChatContainer-SH6LTFQL.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -5,9 +5,9 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
- import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
8
+ import { Capabilities, Capability, OperationPlugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { Obj, Ref } from '@dxos/echo';
10
+ import { Surface } from '@dxos/app-framework/ui';
11
11
  import { faker } from '@dxos/random';
12
12
  import { useClient } from '@dxos/react-client';
13
13
  import { type Space } from '@dxos/react-client/echo';
@@ -15,12 +15,12 @@ import { useIdentity } from '@dxos/react-client/halo';
15
15
  import { withClientProvider } from '@dxos/react-client/testing';
16
16
  import { useAsyncEffect } from '@dxos/react-ui';
17
17
  import { withTheme } from '@dxos/react-ui/testing';
18
- import { Thread } from '@dxos/react-ui-thread';
19
- import { DataType } from '@dxos/schema';
18
+ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
20
19
  import { render } from '@dxos/storybook-utils';
20
+ import { Message, Thread } from '@dxos/types';
21
21
 
22
22
  import { translations } from '../translations';
23
- import { ChannelType, ThreadType } from '../types';
23
+ import { Channel } from '../types';
24
24
 
25
25
  import { ChatContainer } from './ChatContainer';
26
26
 
@@ -30,17 +30,12 @@ const DefaultStory = () => {
30
30
  const client = useClient();
31
31
  const identity = useIdentity();
32
32
  const [space, setSpace] = useState<Space>();
33
- const [channel, setChannel] = useState<ChannelType | null>();
33
+ const [channel, setChannel] = useState<Channel.Channel | null>();
34
34
 
35
35
  useAsyncEffect(async () => {
36
36
  if (identity) {
37
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
- );
38
+ const channel = space.db.add(Channel.make());
44
39
  setSpace(space);
45
40
  setChannel(channel);
46
41
  }
@@ -51,7 +46,7 @@ const DefaultStory = () => {
51
46
  }
52
47
 
53
48
  return (
54
- <main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
49
+ <main className='is-full max-is-proseMaxWidth mli-auto bs-full overflow-hidden'>
55
50
  <ChatContainer space={space} thread={channel.defaultThread.target} />
56
51
  </main>
57
52
  );
@@ -59,16 +54,16 @@ const DefaultStory = () => {
59
54
 
60
55
  const meta = {
61
56
  title: 'plugins/plugin-thread/Chat',
62
- component: Thread.Root as any,
57
+ component: ThreadComponent.Root as any,
63
58
  render: render(DefaultStory),
64
59
  decorators: [
65
- withTheme,
60
+ withTheme(),
66
61
  withPluginManager({
67
- plugins: [IntentPlugin()],
62
+ plugins: [OperationPlugin()],
68
63
  capabilities: [
69
- contributes(
64
+ Capability.contributes(
70
65
  Capabilities.ReactSurface,
71
- createSurface({
66
+ Surface.create({
72
67
  id: 'test',
73
68
  role: 'card',
74
69
  component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
@@ -76,7 +71,7 @@ const meta = {
76
71
  ),
77
72
  ],
78
73
  }),
79
- withClientProvider({ createSpace: true, types: [ThreadType, ChannelType, DataType.Message] }),
74
+ withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
80
75
  ],
81
76
  parameters: {
82
77
  layout: 'fullscreen',
@@ -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],
@@ -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
- created: new Date().toISOString(),
97
- sender: { identityDid: identity.did },
98
- blocks: [{ _tag: '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,16 +119,17 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
109
119
  };
110
120
 
111
121
  return (
112
- <Thread.Root
122
+ <ThreadComponent.Root
113
123
  current={current}
114
124
  id={id}
115
125
  classNames={[
116
- 'bs-full is-full max-is-prose mli-auto grid-rows-[1fr_min-content_min-content] overflow-hidden',
126
+ 'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
117
127
  'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
128
+ classNames,
118
129
  ]}
119
130
  >
120
- <ScrollArea.Root classNames='col-span-2'>
121
- <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'>
122
133
  <div role='none' className={mx(threadLayout, 'place-self-end')}>
123
134
  {thread.messages
124
135
  .map((message) => message.target)
@@ -127,18 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
127
138
  <MessageContainer key={message.id} message={message} members={members} />
128
139
  ))}
129
140
  </div>
130
- {/* 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. */}
131
142
  <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
132
- <ScrollArea.Scrollbar>
133
- <ScrollArea.Thumb />
134
- </ScrollArea.Scrollbar>
135
143
  </ScrollArea.Viewport>
136
144
  </ScrollArea.Root>
137
145
 
138
146
  <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
139
-
140
- <Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
141
- </Thread.Root>
147
+ <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
148
+ </ThreadComponent.Root>
142
149
  );
143
150
  };
144
151
 
@@ -3,22 +3,23 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
6
7
  import React from 'react';
7
8
 
8
- import { IntentPlugin } from '@dxos/app-framework';
9
+ import { OperationPlugin } from '@dxos/app-framework';
9
10
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { Obj, Query, Relation, Type } from '@dxos/echo';
11
+ import { Obj, Query, Relation } from '@dxos/echo';
12
+ import { TestSchema } from '@dxos/echo/testing';
11
13
  import { ClientPlugin } from '@dxos/plugin-client';
12
14
  import { faker } from '@dxos/random';
13
- import { useQuery, useSpace } from '@dxos/react-client/echo';
15
+ import { useDatabase, useQuery } from '@dxos/react-client/echo';
14
16
  import { useIdentity } from '@dxos/react-client/halo';
15
17
  import { useAsyncEffect } from '@dxos/react-ui';
16
18
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { AnchoredTo, DataType } from '@dxos/schema';
18
19
  import { render } from '@dxos/storybook-utils';
20
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
19
21
 
20
22
  import { translations } from '../translations';
21
- import { ThreadType } from '../types';
22
23
 
23
24
  import { CommentsContainer } from './CommentsContainer';
24
25
  import { createCommentThread, createProposalThread } from './testing';
@@ -27,32 +28,32 @@ faker.seed(1);
27
28
 
28
29
  const DefaultStory = () => {
29
30
  const identity = useIdentity();
30
- const space = useSpace();
31
- const anchors = useQuery(space, Query.type(AnchoredTo));
31
+ const db = useDatabase();
32
+ const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
32
33
 
33
34
  useAsyncEffect(async () => {
34
- if (identity && space) {
35
- const object = space.db.add(Obj.make(Type.Expando, {}));
36
- const thread1 = space.db.add(createCommentThread(identity));
37
- const thread2 = space.db.add(createProposalThread(identity));
38
- space.db.add(
39
- 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, {
40
41
  [Relation.Source]: thread1,
41
42
  [Relation.Target]: object,
42
43
  anchor: 'test',
43
44
  }),
44
45
  );
45
- space.db.add(
46
- Relation.make(AnchoredTo, {
46
+ db.add(
47
+ Relation.make(AnchoredTo.AnchoredTo, {
47
48
  [Relation.Source]: thread2,
48
49
  [Relation.Target]: object,
49
50
  anchor: 'test',
50
51
  }),
51
52
  );
52
53
  }
53
- }, [identity, space]);
54
+ }, [identity, db]);
54
55
 
55
- if (!identity || !space || !anchors) {
56
+ if (!identity || !db || !anchors) {
56
57
  return null;
57
58
  }
58
59
 
@@ -63,18 +64,19 @@ const meta = {
63
64
  title: 'plugins/plugin-thread/Comments',
64
65
  render: render(DefaultStory),
65
66
  decorators: [
66
- withTheme,
67
- withLayout({ container: 'column', scroll: true }),
67
+ withTheme(),
68
+ withLayout({ layout: 'column', scroll: true }),
68
69
  // TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
69
70
  // Currently this is required due to useOnEditAnalytics.
70
71
  withPluginManager({
71
72
  plugins: [
72
- IntentPlugin(),
73
+ OperationPlugin(),
73
74
  ClientPlugin({
74
- types: [DataType.Message, ThreadType, AnchoredTo],
75
- onClientInitialized: async ({ client }) => {
76
- await client.halo.createIdentity();
77
- },
75
+ types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
76
+ onClientInitialized: ({ client }) =>
77
+ Effect.gen(function* () {
78
+ yield* Effect.promise(() => client.halo.createIdentity());
79
+ }),
78
80
  }),
79
81
  ],
80
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/ui';
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);
@@ -47,7 +47,7 @@ const meta = {
47
47
  title: 'plugins/plugin-thread/VideoObject',
48
48
  component: VideoObject,
49
49
  render: DefaultStory,
50
- decorators: [withTheme],
50
+ decorators: [withTheme()],
51
51
  parameters: {
52
52
  layout: 'fullscreen',
53
53
  },
@@ -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,