@dxos/plugin-thread 0.8.3 → 0.8.4-main.1c7ec43d41

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 (558) hide show
  1. package/dist/lib/browser/add-message-3FTZANTW.mjs +89 -0
  2. package/dist/lib/browser/add-message-3FTZANTW.mjs.map +7 -0
  3. package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs +40 -0
  4. package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs.map +7 -0
  5. package/dist/lib/browser/blueprints/index.mjs +37 -0
  6. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  8. package/dist/lib/browser/chunk-MR4CWITF.mjs +31 -0
  9. package/dist/lib/browser/chunk-MR4CWITF.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-TPNZ43NB.mjs +258 -0
  11. package/dist/lib/browser/chunk-TPNZ43NB.mjs.map +7 -0
  12. package/dist/lib/browser/create-GMUAPFZM.mjs +55 -0
  13. package/dist/lib/browser/create-GMUAPFZM.mjs.map +7 -0
  14. package/dist/lib/browser/create-channel-ZXKSLHGN.mjs +19 -0
  15. package/dist/lib/browser/create-channel-ZXKSLHGN.mjs.map +7 -0
  16. package/dist/lib/browser/create-proposals-AV5CREPV.mjs +56 -0
  17. package/dist/lib/browser/create-proposals-AV5CREPV.mjs.map +7 -0
  18. package/dist/lib/browser/delete-673YOWCG.mjs +59 -0
  19. package/dist/lib/browser/delete-673YOWCG.mjs.map +7 -0
  20. package/dist/lib/browser/delete-message-RQ72ZY5D.mjs +55 -0
  21. package/dist/lib/browser/delete-message-RQ72ZY5D.mjs.map +7 -0
  22. package/dist/lib/browser/index.mjs +1783 -270
  23. package/dist/lib/browser/index.mjs.map +4 -4
  24. package/dist/lib/browser/meta.json +1 -1
  25. package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs +24 -0
  26. package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs.map +7 -0
  27. package/dist/lib/browser/operations/index.mjs +13 -0
  28. package/dist/lib/browser/operations/index.mjs.map +7 -0
  29. package/dist/lib/browser/restore-VX7FLZOZ.mjs +32 -0
  30. package/dist/lib/browser/restore-VX7FLZOZ.mjs.map +7 -0
  31. package/dist/lib/browser/restore-message-D65NSWUA.mjs +33 -0
  32. package/dist/lib/browser/restore-message-D65NSWUA.mjs.map +7 -0
  33. package/dist/lib/browser/select-DO4AYSCB.mjs +26 -0
  34. package/dist/lib/browser/select-DO4AYSCB.mjs.map +7 -0
  35. package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs +36 -0
  36. package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs.map +7 -0
  37. package/dist/lib/browser/translations.mjs +90 -0
  38. package/dist/lib/browser/translations.mjs.map +7 -0
  39. package/dist/lib/browser/types/index.mjs +6 -12
  40. package/dist/lib/node-esm/add-message-56J2HLJB.mjs +90 -0
  41. package/dist/lib/node-esm/add-message-56J2HLJB.mjs.map +7 -0
  42. package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs +41 -0
  43. package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs.map +7 -0
  44. package/dist/lib/node-esm/blueprints/index.mjs +38 -0
  45. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  46. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  47. package/dist/lib/node-esm/chunk-L6UL3NVS.mjs +32 -0
  48. package/dist/lib/node-esm/chunk-L6UL3NVS.mjs.map +7 -0
  49. package/dist/lib/node-esm/chunk-XKUMDYGR.mjs +259 -0
  50. package/dist/lib/node-esm/chunk-XKUMDYGR.mjs.map +7 -0
  51. package/dist/lib/node-esm/create-LEXHIPUT.mjs +56 -0
  52. package/dist/lib/node-esm/create-LEXHIPUT.mjs.map +7 -0
  53. package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs +20 -0
  54. package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs.map +7 -0
  55. package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs +57 -0
  56. package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs.map +7 -0
  57. package/dist/lib/node-esm/delete-4KSU4UEJ.mjs +60 -0
  58. package/dist/lib/node-esm/delete-4KSU4UEJ.mjs.map +7 -0
  59. package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs +56 -0
  60. package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs.map +7 -0
  61. package/dist/lib/node-esm/index.mjs +1783 -270
  62. package/dist/lib/node-esm/index.mjs.map +4 -4
  63. package/dist/lib/node-esm/meta.json +1 -1
  64. package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs +25 -0
  65. package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs.map +7 -0
  66. package/dist/lib/node-esm/operations/index.mjs +14 -0
  67. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  68. package/dist/lib/node-esm/restore-E27OAIFJ.mjs +33 -0
  69. package/dist/lib/node-esm/restore-E27OAIFJ.mjs.map +7 -0
  70. package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs +34 -0
  71. package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs.map +7 -0
  72. package/dist/lib/node-esm/select-NDHRM75K.mjs +27 -0
  73. package/dist/lib/node-esm/select-NDHRM75K.mjs.map +7 -0
  74. package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs +37 -0
  75. package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs.map +7 -0
  76. package/dist/lib/node-esm/translations.mjs +91 -0
  77. package/dist/lib/node-esm/translations.mjs.map +7 -0
  78. package/dist/lib/node-esm/types/index.mjs +6 -12
  79. package/dist/types/src/ThreadPlugin.d.ts +3 -1
  80. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  81. package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
  82. package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
  83. package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
  84. package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
  85. package/dist/types/src/blueprints/index.d.ts +2 -0
  86. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  87. package/dist/types/src/blueprints/thread-blueprint.d.ts +4 -0
  88. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
  89. package/dist/types/src/calls/call-manager.d.ts +40 -30
  90. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  91. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
  92. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  93. package/dist/types/src/calls/media-manager.d.ts +2 -2
  94. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  95. package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
  96. package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
  97. package/dist/types/src/calls/types.d.ts +1 -1
  98. package/dist/types/src/calls/types.d.ts.map +1 -1
  99. package/dist/types/src/calls/util/audio.d.ts.map +1 -1
  100. package/dist/types/src/calls/util/calls-service.d.ts +11 -6
  101. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  102. package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
  103. package/dist/types/src/calls/util/media.d.ts.map +1 -1
  104. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  105. package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
  106. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  107. package/dist/types/src/calls-service.stories.d.ts +23 -0
  108. package/dist/types/src/calls-service.stories.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  110. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  111. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  112. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/call-manager.d.ts +3 -2
  114. package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  116. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/index.d.ts +19 -13
  118. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  119. package/dist/types/src/capabilities/markdown.d.ts +3 -2
  120. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  121. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  122. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/react-root.d.ts +4 -2
  124. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  125. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  126. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  127. package/dist/types/src/capabilities/settings.d.ts +5 -2
  128. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  129. package/dist/types/src/capabilities/state.d.ts +5 -5
  130. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  131. package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
  132. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  133. package/dist/types/src/components/Call/Call.d.ts +32 -4
  134. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  135. package/dist/types/src/components/Call/Toolbar.d.ts +6 -6
  136. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  137. package/dist/types/src/components/Chat/Chat.d.ts +51 -0
  138. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
  139. package/dist/types/src/components/Chat/index.d.ts +2 -0
  140. package/dist/types/src/components/Chat/index.d.ts.map +1 -0
  141. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
  142. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
  143. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
  144. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
  145. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts +14 -0
  146. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
  147. package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
  148. package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
  149. package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
  150. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  151. package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
  152. package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
  153. package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
  154. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  155. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +15 -0
  156. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
  157. package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
  158. package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
  159. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  160. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  161. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
  162. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +160 -5
  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/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
  166. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
  167. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
  168. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
  169. package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
  170. package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
  171. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
  172. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
  173. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
  174. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
  175. package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
  176. package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
  177. package/dist/types/src/components/index.d.ts +5 -9
  178. package/dist/types/src/components/index.d.ts.map +1 -1
  179. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +15 -0
  180. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -0
  181. package/dist/types/src/containers/CallDebugPanel/index.d.ts +2 -0
  182. package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -0
  183. package/dist/types/src/{components → containers/CallSidebar}/CallSidebar.d.ts +0 -1
  184. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -0
  185. package/dist/types/src/containers/CallSidebar/index.d.ts +2 -0
  186. package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -0
  187. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
  188. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
  189. package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
  190. package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
  191. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +12 -0
  192. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -0
  193. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +162 -0
  194. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -0
  195. package/dist/types/src/containers/ChannelContainer/index.d.ts +2 -0
  196. package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -0
  197. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +8 -0
  198. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -0
  199. package/dist/types/src/containers/ThreadCompanion/index.d.ts +2 -0
  200. package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -0
  201. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
  202. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
  203. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts +162 -0
  204. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
  205. package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
  206. package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
  207. package/dist/types/src/containers/index.d.ts +8 -0
  208. package/dist/types/src/containers/index.d.ts.map +1 -0
  209. package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
  210. package/dist/types/src/extensions/command.d.ts.map +1 -0
  211. package/dist/types/src/extensions/index.d.ts +1 -0
  212. package/dist/types/src/extensions/index.d.ts.map +1 -1
  213. package/dist/types/src/extensions/threads.d.ts +9 -4
  214. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  215. package/dist/types/src/hooks/analytics.d.ts +2 -3
  216. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  217. package/dist/types/src/hooks/index.d.ts +3 -0
  218. package/dist/types/src/hooks/index.d.ts.map +1 -1
  219. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
  220. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
  221. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +2 -0
  222. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +1 -0
  223. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  224. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +3 -0
  225. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -0
  226. package/dist/types/src/index.d.ts +4 -3
  227. package/dist/types/src/index.d.ts.map +1 -1
  228. package/dist/types/src/meta.d.ts +3 -4
  229. package/dist/types/src/meta.d.ts.map +1 -1
  230. package/dist/types/src/operations/add-message.d.ts +5 -0
  231. package/dist/types/src/operations/add-message.d.ts.map +1 -0
  232. package/dist/types/src/operations/append-channel-message.d.ts +5 -0
  233. package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
  234. package/dist/types/src/operations/create-channel.d.ts +5 -0
  235. package/dist/types/src/operations/create-channel.d.ts.map +1 -0
  236. package/dist/types/src/operations/create-proposals.d.ts +5 -0
  237. package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
  238. package/dist/types/src/operations/create.d.ts +5 -0
  239. package/dist/types/src/operations/create.d.ts.map +1 -0
  240. package/dist/types/src/operations/definitions.d.ts +1995 -0
  241. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  242. package/dist/types/src/operations/delete-message.d.ts +5 -0
  243. package/dist/types/src/operations/delete-message.d.ts.map +1 -0
  244. package/dist/types/src/operations/delete.d.ts +5 -0
  245. package/dist/types/src/operations/delete.d.ts.map +1 -0
  246. package/dist/types/src/operations/index.d.ts +4 -0
  247. package/dist/types/src/operations/index.d.ts.map +1 -0
  248. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  249. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  250. package/dist/types/src/operations/restore-message.d.ts +5 -0
  251. package/dist/types/src/operations/restore-message.d.ts.map +1 -0
  252. package/dist/types/src/operations/restore.d.ts +5 -0
  253. package/dist/types/src/operations/restore.d.ts.map +1 -0
  254. package/dist/types/src/operations/select.d.ts +5 -0
  255. package/dist/types/src/operations/select.d.ts.map +1 -0
  256. package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
  257. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
  258. package/dist/types/src/testing/data.d.ts +5 -0
  259. package/dist/types/src/testing/data.d.ts.map +1 -0
  260. package/dist/types/src/testing/index.d.ts +1 -1
  261. package/dist/types/src/testing/index.d.ts.map +1 -1
  262. package/dist/types/src/translations.d.ts +144 -194
  263. package/dist/types/src/translations.d.ts.map +1 -1
  264. package/dist/types/src/types/Settings.d.ts +5 -0
  265. package/dist/types/src/types/Settings.d.ts.map +1 -0
  266. package/dist/types/src/types/capabilities.d.ts +29 -0
  267. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  268. package/dist/types/src/types/index.d.ts +1 -1
  269. package/dist/types/src/types/index.d.ts.map +1 -1
  270. package/dist/types/src/types/types.d.ts +4 -326
  271. package/dist/types/src/types/types.d.ts.map +1 -1
  272. package/dist/types/src/util.d.ts +21 -3
  273. package/dist/types/src/util.d.ts.map +1 -1
  274. package/dist/types/tsconfig.tsbuildinfo +1 -1
  275. package/package.json +119 -75
  276. package/src/ThreadPlugin.node.ts +39 -0
  277. package/src/ThreadPlugin.test.ts +37 -0
  278. package/src/ThreadPlugin.tsx +66 -149
  279. package/src/blueprints/index.ts +5 -0
  280. package/src/blueprints/thread-blueprint.ts +36 -0
  281. package/src/calls/call-manager.ts +78 -50
  282. package/src/calls/call-swarm-synchronizer.ts +3 -3
  283. package/src/calls/media-manager.ts +77 -41
  284. package/src/calls/types.ts +8 -4
  285. package/src/calls/util/calls-service.ts +74 -19
  286. package/src/calls/util/stub-media-streams.ts +65 -9
  287. package/src/calls/util/task-scheduling.ts +4 -4
  288. package/src/calls-service.stories.tsx +230 -0
  289. package/src/capabilities/app-graph-builder.ts +177 -162
  290. package/src/capabilities/blueprint-definition.ts +19 -0
  291. package/src/capabilities/call-manager.ts +19 -11
  292. package/src/capabilities/create-object.ts +29 -0
  293. package/src/capabilities/index.ts +17 -11
  294. package/src/capabilities/markdown.ts +55 -37
  295. package/src/capabilities/operation-handler.ts +16 -0
  296. package/src/capabilities/react-root.tsx +12 -9
  297. package/src/capabilities/react-surface.tsx +83 -74
  298. package/src/capabilities/settings.ts +28 -12
  299. package/src/capabilities/state.ts +14 -17
  300. package/src/capabilities/undo-mappings.ts +46 -0
  301. package/src/components/Call/Call.tsx +17 -12
  302. package/src/components/Call/Toolbar.tsx +63 -46
  303. package/src/components/Chat/Chat.tsx +258 -0
  304. package/src/components/Chat/index.ts +5 -0
  305. package/src/components/CommentsPanel/CommentsPanel.stories.tsx +95 -0
  306. package/src/components/CommentsPanel/CommentsPanel.tsx +71 -0
  307. package/src/components/CommentsPanel/CommentsThread.tsx +172 -0
  308. package/src/components/CommentsPanel/index.ts +6 -0
  309. package/src/components/Lobby/Lobby.tsx +21 -17
  310. package/src/components/Media/AudioStream.tsx +2 -2
  311. package/src/components/Media/VideoObject.stories.tsx +37 -30
  312. package/src/components/Media/VideoObject.tsx +1 -1
  313. package/src/components/MessagePanel/MessagePanel.tsx +225 -0
  314. package/src/components/MessagePanel/index.ts +5 -0
  315. package/src/components/Participant/Participant.tsx +35 -15
  316. package/src/components/Participant/ParticipantGrid.tsx +1 -1
  317. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +51 -49
  318. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
  319. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +15 -12
  320. package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +12 -12
  321. package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +5 -5
  322. package/src/components/ResponsiveGrid/index.ts +1 -1
  323. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
  324. package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
  325. package/src/components/ThreadSettings/index.ts +5 -0
  326. package/src/components/index.ts +6 -12
  327. package/src/containers/CallDebugPanel/CallDebugPanel.tsx +173 -0
  328. package/src/containers/CallDebugPanel/index.ts +5 -0
  329. package/src/containers/CallSidebar/CallSidebar.tsx +18 -0
  330. package/src/containers/CallSidebar/index.ts +5 -0
  331. package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
  332. package/src/containers/ChannelChat/index.ts +8 -0
  333. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +105 -0
  334. package/src/containers/ChannelContainer/ChannelContainer.tsx +223 -0
  335. package/src/containers/ChannelContainer/index.ts +5 -0
  336. package/src/containers/ThreadCompanion/ThreadCompanion.tsx +215 -0
  337. package/src/containers/ThreadCompanion/index.ts +5 -0
  338. package/src/containers/ThreadContainer/ThreadContainer.stories.tsx +86 -0
  339. package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
  340. package/src/containers/ThreadContainer/index.ts +8 -0
  341. package/src/containers/index.ts +12 -0
  342. package/src/{components/command-extension.ts → extensions/command.ts} +7 -4
  343. package/src/extensions/index.ts +1 -0
  344. package/src/extensions/threads.ts +89 -44
  345. package/src/hooks/analytics.ts +22 -21
  346. package/src/hooks/index.ts +4 -0
  347. package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
  348. package/src/hooks/useDebugMode.ts +1 -1
  349. package/src/hooks/useInaudibleAudioStreamTrack.tsx +27 -0
  350. package/src/hooks/useVideoStreamTrack.tsx +36 -0
  351. package/src/index.ts +11 -4
  352. package/src/meta.ts +11 -7
  353. package/src/operations/add-message.ts +81 -0
  354. package/src/operations/append-channel-message.ts +36 -0
  355. package/src/operations/create-channel.ts +20 -0
  356. package/src/operations/create-proposals.ts +49 -0
  357. package/src/operations/create.ts +48 -0
  358. package/src/operations/definitions.ts +177 -0
  359. package/src/operations/delete-message.ts +53 -0
  360. package/src/operations/delete.ts +63 -0
  361. package/src/operations/index.ts +22 -0
  362. package/src/operations/on-create-space.ts +27 -0
  363. package/src/operations/restore-message.ts +38 -0
  364. package/src/operations/restore.ts +38 -0
  365. package/src/operations/select.ts +24 -0
  366. package/src/operations/toggle-resolved.ts +41 -0
  367. package/src/testing/data.ts +49 -0
  368. package/src/testing/index.ts +1 -1
  369. package/src/translations.ts +77 -73
  370. package/src/types/Settings.ts +10 -0
  371. package/src/types/capabilities.ts +42 -0
  372. package/src/types/index.ts +1 -1
  373. package/src/types/types.ts +5 -91
  374. package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
  375. package/src/typings.d.ts +8 -0
  376. package/src/util.ts +38 -6
  377. package/dist/lib/browser/ChannelContainer-PKFBVENP.mjs +0 -15
  378. package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
  379. package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs +0 -171
  380. package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
  381. package/dist/lib/browser/call-manager-APQAZWHT.mjs +0 -23
  382. package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +0 -7
  383. package/dist/lib/browser/chunk-4H4A264L.mjs +0 -1708
  384. package/dist/lib/browser/chunk-4H4A264L.mjs.map +0 -7
  385. package/dist/lib/browser/chunk-5P5BH5GE.mjs +0 -88
  386. package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +0 -7
  387. package/dist/lib/browser/chunk-6NBVNXTM.mjs +0 -21
  388. package/dist/lib/browser/chunk-6NBVNXTM.mjs.map +0 -7
  389. package/dist/lib/browser/chunk-AEXWNS6Z.mjs +0 -128
  390. package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
  391. package/dist/lib/browser/chunk-IIUTBDVB.mjs +0 -17
  392. package/dist/lib/browser/chunk-IIUTBDVB.mjs.map +0 -7
  393. package/dist/lib/browser/chunk-JKQUJOTX.mjs +0 -31
  394. package/dist/lib/browser/chunk-JKQUJOTX.mjs.map +0 -7
  395. package/dist/lib/browser/chunk-PG5CTFKK.mjs +0 -550
  396. package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
  397. package/dist/lib/browser/chunk-R5MDLUPC.mjs +0 -18
  398. package/dist/lib/browser/chunk-R5MDLUPC.mjs.map +0 -7
  399. package/dist/lib/browser/chunk-TAFSCSUR.mjs +0 -351
  400. package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
  401. package/dist/lib/browser/chunk-XZKBN3NS.mjs +0 -983
  402. package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
  403. package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs +0 -353
  404. package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
  405. package/dist/lib/browser/markdown-TE5SWWNJ.mjs +0 -169
  406. package/dist/lib/browser/markdown-TE5SWWNJ.mjs.map +0 -7
  407. package/dist/lib/browser/react-root-NK3A4VG7.mjs +0 -27
  408. package/dist/lib/browser/react-root-NK3A4VG7.mjs.map +0 -7
  409. package/dist/lib/browser/react-surface-VXUJKSOG.mjs +0 -108
  410. package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
  411. package/dist/lib/browser/settings-RB2RSLXV.mjs +0 -22
  412. package/dist/lib/browser/settings-RB2RSLXV.mjs.map +0 -7
  413. package/dist/lib/browser/state-RKL5MSDP.mjs +0 -34
  414. package/dist/lib/browser/state-RKL5MSDP.mjs.map +0 -7
  415. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs +0 -36
  416. package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs.map +0 -7
  417. package/dist/lib/node/ChatContainer-GCOM3M56.cjs +0 -35
  418. package/dist/lib/node/ChatContainer-GCOM3M56.cjs.map +0 -7
  419. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs +0 -179
  420. package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs.map +0 -7
  421. package/dist/lib/node/call-manager-HV2XJW5O.cjs +0 -37
  422. package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +0 -7
  423. package/dist/lib/node/chunk-44I33JDT.cjs +0 -1731
  424. package/dist/lib/node/chunk-44I33JDT.cjs.map +0 -7
  425. package/dist/lib/node/chunk-4YSNVPWU.cjs +0 -37
  426. package/dist/lib/node/chunk-4YSNVPWU.cjs.map +0 -7
  427. package/dist/lib/node/chunk-E3WBZTTI.cjs +0 -371
  428. package/dist/lib/node/chunk-E3WBZTTI.cjs.map +0 -7
  429. package/dist/lib/node/chunk-ERG7G6FF.cjs +0 -59
  430. package/dist/lib/node/chunk-ERG7G6FF.cjs.map +0 -7
  431. package/dist/lib/node/chunk-FUXJAVFZ.cjs +0 -108
  432. package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +0 -7
  433. package/dist/lib/node/chunk-HLMCEE5K.cjs +0 -41
  434. package/dist/lib/node/chunk-HLMCEE5K.cjs.map +0 -7
  435. package/dist/lib/node/chunk-IP533AMV.cjs +0 -554
  436. package/dist/lib/node/chunk-IP533AMV.cjs.map +0 -7
  437. package/dist/lib/node/chunk-LR5NENBE.cjs +0 -54
  438. package/dist/lib/node/chunk-LR5NENBE.cjs.map +0 -7
  439. package/dist/lib/node/chunk-UM36TPCT.cjs +0 -984
  440. package/dist/lib/node/chunk-UM36TPCT.cjs.map +0 -7
  441. package/dist/lib/node/chunk-ZGDN3XBR.cjs +0 -149
  442. package/dist/lib/node/chunk-ZGDN3XBR.cjs.map +0 -7
  443. package/dist/lib/node/index.cjs +0 -310
  444. package/dist/lib/node/index.cjs.map +0 -7
  445. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs +0 -363
  446. package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs.map +0 -7
  447. package/dist/lib/node/markdown-GQIPJS2F.cjs +0 -178
  448. package/dist/lib/node/markdown-GQIPJS2F.cjs.map +0 -7
  449. package/dist/lib/node/meta.json +0 -1
  450. package/dist/lib/node/react-root-6HHDMULJ.cjs +0 -51
  451. package/dist/lib/node/react-root-6HHDMULJ.cjs.map +0 -7
  452. package/dist/lib/node/react-surface-NBH42NN2.cjs +0 -122
  453. package/dist/lib/node/react-surface-NBH42NN2.cjs.map +0 -7
  454. package/dist/lib/node/settings-4LQSFEDK.cjs +0 -36
  455. package/dist/lib/node/settings-4LQSFEDK.cjs.map +0 -7
  456. package/dist/lib/node/state-IY5XX3H2.cjs +0 -50
  457. package/dist/lib/node/state-IY5XX3H2.cjs.map +0 -7
  458. package/dist/lib/node/types/index.cjs +0 -38
  459. package/dist/lib/node/types/index.cjs.map +0 -7
  460. package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs +0 -16
  461. package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs.map +0 -7
  462. package/dist/lib/node-esm/ChatContainer-F6CSADV7.mjs +0 -15
  463. package/dist/lib/node-esm/ChatContainer-F6CSADV7.mjs.map +0 -7
  464. package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs +0 -172
  465. package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
  466. package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs +0 -24
  467. package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
  468. package/dist/lib/node-esm/chunk-2RNIPFDA.mjs +0 -984
  469. package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
  470. package/dist/lib/node-esm/chunk-ESQC6SYE.mjs +0 -19
  471. package/dist/lib/node-esm/chunk-ESQC6SYE.mjs.map +0 -7
  472. package/dist/lib/node-esm/chunk-K4KAUOKT.mjs +0 -19
  473. package/dist/lib/node-esm/chunk-K4KAUOKT.mjs.map +0 -7
  474. package/dist/lib/node-esm/chunk-O3V45YJP.mjs +0 -90
  475. package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +0 -7
  476. package/dist/lib/node-esm/chunk-O63QJPQX.mjs +0 -23
  477. package/dist/lib/node-esm/chunk-O63QJPQX.mjs.map +0 -7
  478. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs +0 -352
  479. package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
  480. package/dist/lib/node-esm/chunk-PGRP3O4O.mjs +0 -33
  481. package/dist/lib/node-esm/chunk-PGRP3O4O.mjs.map +0 -7
  482. package/dist/lib/node-esm/chunk-UJMPYKT3.mjs +0 -129
  483. package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
  484. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs +0 -551
  485. package/dist/lib/node-esm/chunk-UZWVVFT3.mjs.map +0 -7
  486. package/dist/lib/node-esm/chunk-WXNPD542.mjs +0 -1710
  487. package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +0 -7
  488. package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs +0 -354
  489. package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
  490. package/dist/lib/node-esm/markdown-HJUWNBLS.mjs +0 -170
  491. package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
  492. package/dist/lib/node-esm/react-root-RUXOAQNW.mjs +0 -28
  493. package/dist/lib/node-esm/react-root-RUXOAQNW.mjs.map +0 -7
  494. package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs +0 -109
  495. package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
  496. package/dist/lib/node-esm/settings-EA7DFSM6.mjs +0 -23
  497. package/dist/lib/node-esm/settings-EA7DFSM6.mjs.map +0 -7
  498. package/dist/lib/node-esm/state-6AUTNROZ.mjs +0 -35
  499. package/dist/lib/node-esm/state-6AUTNROZ.mjs.map +0 -7
  500. package/dist/types/src/capabilities/capabilities.d.ts +0 -27
  501. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  502. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  503. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  504. package/dist/types/src/components/CallDebugPanel.d.ts +0 -8
  505. package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
  506. package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
  507. package/dist/types/src/components/ChannelContainer.d.ts +0 -14
  508. package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
  509. package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -10
  510. package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
  511. package/dist/types/src/components/Chat.stories.d.ts +0 -6
  512. package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
  513. package/dist/types/src/components/ChatContainer.d.ts +0 -17
  514. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  515. package/dist/types/src/components/CommentContainer.d.ts +0 -13
  516. package/dist/types/src/components/CommentContainer.d.ts.map +0 -1
  517. package/dist/types/src/components/Comments.stories.d.ts +0 -6
  518. package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
  519. package/dist/types/src/components/CommentsContainer.d.ts +0 -13
  520. package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
  521. package/dist/types/src/components/MessageContainer.d.ts +0 -11
  522. package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
  523. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
  524. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -10
  525. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
  526. package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
  527. package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
  528. package/dist/types/src/components/ThreadSettings.d.ts +0 -6
  529. package/dist/types/src/components/ThreadSettings.d.ts.map +0 -1
  530. package/dist/types/src/components/command-extension.d.ts.map +0 -1
  531. package/dist/types/src/components/testing.d.ts +0 -4
  532. package/dist/types/src/components/testing.d.ts.map +0 -1
  533. package/dist/types/src/peers.stories.d.ts +0 -11
  534. package/dist/types/src/peers.stories.d.ts.map +0 -1
  535. package/dist/types/src/testing/stories.d.ts +0 -2
  536. package/dist/types/src/testing/stories.d.ts.map +0 -1
  537. package/dist/types/src/types/schema.d.ts +0 -133
  538. package/dist/types/src/types/schema.d.ts.map +0 -1
  539. package/src/capabilities/capabilities.ts +0 -33
  540. package/src/capabilities/intent-resolver.ts +0 -296
  541. package/src/components/CallDebugPanel.tsx +0 -115
  542. package/src/components/CallSidebar.tsx +0 -17
  543. package/src/components/ChannelContainer.stories.tsx +0 -58
  544. package/src/components/ChannelContainer.tsx +0 -199
  545. package/src/components/Chat.stories.tsx +0 -88
  546. package/src/components/ChatContainer.tsx +0 -140
  547. package/src/components/CommentContainer.tsx +0 -198
  548. package/src/components/Comments.stories.tsx +0 -85
  549. package/src/components/CommentsContainer.tsx +0 -66
  550. package/src/components/MessageContainer.tsx +0 -167
  551. package/src/components/ThreadComplementary.tsx +0 -151
  552. package/src/components/ThreadSettings.tsx +0 -17
  553. package/src/components/testing.ts +0 -29
  554. package/src/peers.stories.tsx +0 -189
  555. package/src/testing/stories.ts +0 -50
  556. package/src/types/schema.ts +0 -33
  557. /package/dist/lib/browser/{ChannelContainer-PKFBVENP.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  558. /package/dist/lib/{browser/ChatContainer-RSOKYAMK.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
@@ -0,0 +1,75 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React, { useMemo } from 'react';
6
+
7
+ import { Obj, Ref } from '@dxos/echo';
8
+ import { type Space, useMembers } from '@dxos/react-client/echo';
9
+ import { useIdentity } from '@dxos/react-client/halo';
10
+ import { type ThemedClassName } from '@dxos/react-ui';
11
+ import { type ThreadRootProps } from '@dxos/react-ui-thread';
12
+ import { Message, type Thread } from '@dxos/types';
13
+ import { composable, composableProps } from '@dxos/ui-theme';
14
+ import { isNonNullable } from '@dxos/util';
15
+
16
+ import { Chat } from '#components';
17
+ import { useStatus } from '#hooks';
18
+
19
+ export type ThreadContainerProps = ThemedClassName<
20
+ {
21
+ space: Space;
22
+ thread: Thread.Thread;
23
+ context?: Obj.Unknown;
24
+ autoFocusTextbox?: boolean;
25
+ } & Pick<ThreadRootProps, 'current'>
26
+ >;
27
+
28
+ /**
29
+ * Renders an AutoMerge {@link Thread} as a chat: appends new messages by pushing
30
+ * onto `thread.messages`. Used for comment threads and the meeting in-call chat.
31
+ */
32
+ export const ThreadContainer = composable<HTMLDivElement, ThreadContainerProps>(
33
+ ({ space, thread, context, autoFocusTextbox, current, ...props }, forwardedRef) => {
34
+ const id = Obj.getDXN(thread).toString();
35
+ const identity = useIdentity()!;
36
+ const members = useMembers(space?.id);
37
+ const activity = useStatus(space, id);
38
+
39
+ const messages = useMemo(
40
+ () => thread.messages.map((message) => message.target).filter(isNonNullable),
41
+ [thread.messages],
42
+ );
43
+
44
+ const handleSend = (text: string) => {
45
+ Obj.update(thread, (thread) => {
46
+ thread.messages.push(
47
+ Ref.make(
48
+ Obj.make(Message.Message, {
49
+ created: new Date().toISOString(),
50
+ sender: { identityDid: identity.did },
51
+ blocks: [{ _tag: 'text', text }],
52
+ properties: context ? { context: Ref.make(context) } : undefined,
53
+ }),
54
+ ),
55
+ );
56
+ });
57
+ return true;
58
+ };
59
+
60
+ return (
61
+ <Chat
62
+ {...composableProps(props)}
63
+ id={id}
64
+ identity={identity}
65
+ members={members}
66
+ messages={messages}
67
+ activity={activity}
68
+ onSend={handleSend}
69
+ autoFocusTextbox={autoFocusTextbox}
70
+ current={current}
71
+ ref={forwardedRef}
72
+ />
73
+ );
74
+ },
75
+ );
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { ThreadContainer } from './ThreadContainer';
6
+
7
+ export { ThreadContainer };
8
+ export default ThreadContainer;
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const CallDebugPanel: ComponentType<any> = lazy(() => import('./CallDebugPanel'));
8
+ export const CallSidebar: ComponentType<any> = lazy(() => import('./CallSidebar'));
9
+ export const ChannelChat: ComponentType<any> = lazy(() => import('./ChannelChat'));
10
+ export const ChannelContainer: ComponentType<any> = lazy(() => import('./ChannelContainer'));
11
+ export const ThreadContainer: ComponentType<any> = lazy(() => import('./ThreadContainer'));
12
+ export const ThreadCompanion: ComponentType<any> = lazy(() => import('./ThreadCompanion'));
@@ -2,11 +2,11 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { StreamLanguage, HighlightStyle, syntaxHighlighting } from '@codemirror/language';
5
+ import { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';
6
6
  import { type Extension } from '@codemirror/state';
7
7
 
8
- import { tags } from '@dxos/react-ui-editor';
9
- import { mx } from '@dxos/react-ui-theme';
8
+ import { tags } from '@dxos/ui-editor';
9
+ import { mx } from '@dxos/ui-theme';
10
10
 
11
11
  /**
12
12
  * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts
@@ -27,7 +27,10 @@ const parser = StreamLanguage.define<{ count: number }>({
27
27
  });
28
28
 
29
29
  const styles = HighlightStyle.define([
30
- { tag: tags.tagName, class: mx('dx-tag dx-tag--indigo text-baseText font-medium') },
30
+ {
31
+ tag: tags.tagName,
32
+ class: mx('dx-tag dx-tag--indigo text-base-surface-text font-medium'),
33
+ },
31
34
  ]);
32
35
 
33
36
  export const command: Extension = [parser, syntaxHighlighting(styles)];
@@ -2,4 +2,5 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ export * from './command';
5
6
  export * from './threads';
@@ -4,65 +4,78 @@
4
4
 
5
5
  import { type Extension } from '@codemirror/state';
6
6
  import { EditorView } from '@codemirror/view';
7
- import { computed, effect } from '@preact/signals-core';
7
+ import { type Atom, type Registry } from '@effect-atom/atom-react';
8
8
 
9
- import { createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
10
9
  import { Filter, Obj, Query, Relation } from '@dxos/echo';
11
- import { type DocumentType } from '@dxos/plugin-markdown/types';
12
- import { getSpace, getTextInRange, createDocAccessor, fullyQualifiedId, getSource } from '@dxos/react-client/echo';
13
- import { comments, createExternalCommentSync } from '@dxos/react-ui-editor';
14
- import { AnchoredTo } from '@dxos/schema';
10
+ import { createDocAccessor, getTextInRange } from '@dxos/echo-db';
11
+ import { OperationInvoker } from '@dxos/operation';
12
+ import { type Markdown } from '@dxos/plugin-markdown/types';
13
+ import { AnchoredTo, Thread } from '@dxos/types';
14
+ import { comments, createExternalCommentSync } from '@dxos/ui-editor';
15
15
 
16
- import { ThreadAction, ThreadType, type ThreadState } from '../types';
16
+ import { ThreadOperation } from '#operations';
17
+ import { type ThreadState } from '#types';
17
18
 
18
19
  // TODO(burdon): Factor out.
19
- const getName = (doc: DocumentType, anchor: string): string | undefined => {
20
+ const getName = (doc: Markdown.Document, anchor: string): string | undefined => {
20
21
  if (doc.content) {
21
22
  const [start, end] = anchor.split(':');
22
23
  return getTextInRange(createDocAccessor(doc.content.target!, ['content']), start, end);
23
24
  }
24
25
  };
25
26
 
27
+ export type ThreadStore = {
28
+ registry: Registry.Registry;
29
+ stateAtom: Atom.Writable<ThreadState>;
30
+ };
31
+
26
32
  /**
27
33
  * Construct plugins.
28
34
  */
29
- export const threads = (state: ThreadState, doc?: DocumentType, dispatch?: PromiseIntentDispatcher): Extension => {
30
- const space = doc && getSpace(doc);
31
- if (!doc || !space || !dispatch) {
35
+ export const threads = (
36
+ store: ThreadStore,
37
+ doc?: Markdown.Document,
38
+ invokePromise?: OperationInvoker.OperationInvoker['invokePromise'],
39
+ ): Extension => {
40
+ const db = doc && Obj.getDatabase(doc);
41
+ if (!doc || !db || !invokePromise) {
32
42
  // Include no-op comments extension here to ensure that the facets are always present when they are expected.
33
43
  // TODO(wittjosiah): The Editor should only look for these facets when comments are available.
34
44
  return [comments()];
35
45
  }
36
46
 
37
- const query = space.db.query(Query.select(Filter.ids(doc.id)).targetOf(AnchoredTo));
38
- const unsubscribe = query.subscribe();
47
+ const { registry, stateAtom } = store;
48
+ const objectId = Obj.getDXN(doc).toString();
49
+ const query = db.query(Query.select(Filter.id(doc.id)).targetOf(AnchoredTo.AnchoredTo));
39
50
 
40
- const anchors = computed(() =>
41
- query.objects
51
+ // Get current anchors by combining query results with store drafts.
52
+ const getAnchors = () =>
53
+ query.results
42
54
  .filter((anchor) => {
43
55
  const thread = Relation.getSource(anchor);
44
- return Obj.instanceOf(ThreadType, thread) && thread.status !== 'resolved';
56
+ return Obj.instanceOf(Thread.Thread, thread) && thread.status !== 'resolved';
45
57
  })
46
- .concat(state.drafts[fullyQualifiedId(doc)] ?? []),
47
- );
58
+ .concat(registry.get(stateAtom).drafts[objectId] ?? []);
48
59
 
49
60
  return [
50
61
  EditorView.domEventHandlers({
51
62
  destroy: () => {
52
- unsubscribe();
63
+ // Note: cleanup functions for subscriptions are handled by createExternalCommentSync.
53
64
  },
54
65
  }),
55
66
 
56
67
  EditorView.updateListener.of((update) => {
57
68
  if (update.docChanged) {
58
- anchors.value.forEach((anchor) => {
69
+ getAnchors().forEach((anchor) => {
59
70
  if (anchor.anchor) {
60
71
  // Only update if the name has changed, otherwise this will cause an infinite loop.
61
72
  // Skip if the name is empty; this means comment text was deleted, but thread name should remain.
62
73
  const name = getName(doc, anchor.anchor);
63
- const thread = Relation.getSource(anchor) as ThreadType;
74
+ const thread = Relation.getSource(anchor) as Thread.Thread;
64
75
  if (name && name !== thread.name) {
65
- thread.name = name;
76
+ Obj.update(thread, (thread) => {
77
+ thread.name = name;
78
+ });
66
79
  }
67
80
  }
68
81
  });
@@ -70,55 +83,87 @@ export const threads = (state: ThreadState, doc?: DocumentType, dispatch?: Promi
70
83
  }),
71
84
 
72
85
  createExternalCommentSync(
73
- fullyQualifiedId(doc),
74
- (sink) => effect(() => sink()),
86
+ objectId,
87
+ (sink) => {
88
+ // Subscribe to both query changes and store state changes.
89
+ const unsubQuery = query.subscribe(sink);
90
+ const unsubStore = registry.subscribe(stateAtom, sink);
91
+ return () => {
92
+ unsubQuery();
93
+ unsubStore();
94
+ };
95
+ },
75
96
  () =>
76
- anchors.value
97
+ getAnchors()
77
98
  .filter((anchor) => anchor.anchor)
78
- .map((anchor) => ({ id: fullyQualifiedId(Relation.getSource(anchor)), cursor: anchor.anchor })),
99
+ .map((anchor) => ({
100
+ id: Obj.getDXN(Relation.getSource(anchor)).toString(),
101
+ cursor: anchor.anchor,
102
+ })),
79
103
  ),
80
104
 
81
105
  comments({
82
- id: fullyQualifiedId(doc),
106
+ id: objectId,
83
107
  onCreate: ({ cursor }) => {
84
108
  const name = getName(doc, cursor);
85
- void dispatch(createIntent(ThreadAction.Create, { anchor: cursor, name, subject: doc }));
109
+ void invokePromise(ThreadOperation.Create, {
110
+ anchor: cursor,
111
+ name,
112
+ subject: doc,
113
+ });
86
114
  },
87
115
  onDelete: ({ id }) => {
88
- const draft = state.drafts[fullyQualifiedId(doc)];
89
- if (draft) {
90
- const index = draft.findIndex((thread) => fullyQualifiedId(thread) === id);
116
+ const drafts = registry.get(stateAtom).drafts[objectId];
117
+ if (drafts) {
118
+ const index = drafts.findIndex((draft) => Relation.getDXN(draft).toString() === id);
91
119
  if (index !== -1) {
92
- draft.splice(index, 1);
120
+ const current = registry.get(stateAtom);
121
+ registry.set(stateAtom, {
122
+ ...current,
123
+ drafts: {
124
+ ...current.drafts,
125
+ [objectId]: current.drafts[objectId]?.filter((_, i) => i !== index),
126
+ },
127
+ });
93
128
  }
94
129
  }
95
130
 
96
- const thread = query.objects.find((object) => getSource(object).id === id);
131
+ const thread = query.results.find((object) => Relation.getSource(object).id === id);
97
132
  if (thread) {
98
- thread.anchor = undefined;
133
+ Relation.update(thread, (thread) => {
134
+ thread.anchor = undefined;
135
+ });
99
136
  }
100
137
  },
101
138
  onUpdate: ({ id, cursor }) => {
102
- const draft = state.drafts[fullyQualifiedId(doc)]?.find((thread) => fullyQualifiedId(thread) === id);
139
+ const draft = registry.get(stateAtom).drafts[objectId]?.find((d) => Relation.getDXN(d).toString() === id);
103
140
  if (draft) {
104
- const thread = Relation.getSource(draft) as ThreadType;
105
- thread.name = getName(doc, cursor);
106
- draft.anchor = cursor;
141
+ const thread = Relation.getSource(draft) as Thread.Thread;
142
+ Obj.update(thread, (thread) => {
143
+ thread.name = getName(doc, cursor);
144
+ });
145
+ Relation.update(draft, (draft) => {
146
+ draft.anchor = cursor;
147
+ });
107
148
  }
108
149
 
109
- const relation = query.objects.find((object) => getSource(object).id === id);
150
+ const relation = query.results.find((object) => Relation.getSource(object).id === id);
110
151
  if (relation) {
111
- const thread = getSource(relation);
112
- if (Obj.instanceOf(ThreadType, thread)) {
113
- thread.name = getName(doc, cursor);
114
- relation.anchor = cursor;
152
+ const thread = Relation.getSource(relation);
153
+ if (Obj.instanceOf(Thread.Thread, thread)) {
154
+ Obj.update(thread, (thread) => {
155
+ thread.name = getName(doc, cursor);
156
+ });
157
+ Relation.update(relation, (relation) => {
158
+ relation.anchor = cursor;
159
+ });
115
160
  }
116
161
  }
117
162
  },
118
163
  onSelect: ({ selection }) => {
119
164
  const current = selection.current ?? selection.closest;
120
165
  if (current) {
121
- void dispatch(createIntent(ThreadAction.Select, { current }));
166
+ void invokePromise(ThreadOperation.Select, { current });
122
167
  }
123
168
  },
124
169
  }),
@@ -4,37 +4,38 @@
4
4
 
5
5
  import { useCallback } from 'react';
6
6
 
7
- import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
8
- import { type Live } from '@dxos/live-object';
9
- import { ObservabilityAction } from '@dxos/plugin-observability/types';
10
- import { getSpace } from '@dxos/react-client/echo';
7
+ import { useOperationInvoker } from '@dxos/app-framework/ui';
8
+ import { Obj } from '@dxos/echo';
9
+ import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
11
10
  import { useOnTransition } from '@dxos/react-ui';
12
- import { type DataType } from '@dxos/schema';
11
+ import { type ContentBlock } from '@dxos/types';
13
12
 
14
13
  export const useOnEditAnalytics = (
15
- message: Live<any>,
16
- textBlock: DataType.MessageBlock.Text | undefined,
14
+ message: any | undefined,
15
+ textBlock: ContentBlock.Text | undefined,
17
16
  editing: boolean,
18
17
  ) => {
19
- const { dispatchPromise: dispatch } = useIntentDispatcher();
18
+ const { invokePromise } = useOperationInvoker();
20
19
 
21
20
  const onEdit = useCallback(() => {
22
- const space = getSpace(message);
23
- if (!space || !textBlock) {
21
+ if (!message || !textBlock) {
24
22
  return;
25
23
  }
26
24
 
27
- void dispatch(
28
- createIntent(ObservabilityAction.SendEvent, {
29
- name: 'threads.message.update',
30
- properties: {
31
- spaceId: space.id,
32
- messageId: message.id,
33
- messageLength: textBlock?.text.length,
34
- },
35
- }),
36
- );
37
- }, [dispatch, message, textBlock]);
25
+ const db = Obj.getDatabase(message);
26
+ if (!db) {
27
+ return;
28
+ }
29
+
30
+ void invokePromise(ObservabilityOperation.SendEvent, {
31
+ name: 'threads.message.update',
32
+ properties: {
33
+ spaceId: db.spaceId,
34
+ messageId: message.id,
35
+ messageLength: textBlock?.text.length,
36
+ },
37
+ });
38
+ }, [invokePromise, message, textBlock]);
38
39
 
39
40
  useOnTransition(editing, true, false, onEdit);
40
41
  };
@@ -3,5 +3,9 @@
3
3
  //
4
4
 
5
5
  export * from './analytics';
6
+
7
+ export * from './useBlackCanvasStreamTrack';
6
8
  export * from './useDebugMode';
9
+ export * from './useInaudibleAudioStreamTrack';
7
10
  export * from './useStatus';
11
+ export * from './useVideoStreamTrack';
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useEffect, useState } from 'react';
6
+
7
+ import { scheduleTask } from '@dxos/async';
8
+ import { Context } from '@dxos/context';
9
+
10
+ import { createBlackCanvasStreamTrack } from '../calls/util/stub-media-streams';
11
+
12
+ export const useBlackCanvasStreamTrack = () => {
13
+ const [blackCanvasStreamTrack, setBlackCanvasStreamTrack] = useState<MediaStreamTrack | undefined>(undefined);
14
+ useEffect(() => {
15
+ const ctx = new Context();
16
+ scheduleTask(ctx, async () => {
17
+ const blackCanvasStreamTrack = await createBlackCanvasStreamTrack({ ctx, width: 720, height: 480 });
18
+ setBlackCanvasStreamTrack(blackCanvasStreamTrack);
19
+ });
20
+
21
+ return () => {
22
+ void ctx.dispose();
23
+ };
24
+ }, []);
25
+
26
+ return blackCanvasStreamTrack;
27
+ };
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useState, useEffect } from 'react';
5
+ import { useEffect, useState } from 'react';
6
6
 
7
7
  // TODO(burdon): Standardize across plugins/composer.
8
8
  export const useDebugMode = () => {
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useEffect, useState } from 'react';
6
+
7
+ import { scheduleTask } from '@dxos/async';
8
+ import { Context } from '@dxos/context';
9
+
10
+ import { createInaudibleAudioStreamTrack } from '../calls/util/stub-media-streams';
11
+
12
+ export const useInaudibleAudioStreamTrack = () => {
13
+ const [audioStreamTrack, setAudioStreamTrack] = useState<MediaStreamTrack | undefined>(undefined);
14
+ useEffect(() => {
15
+ const ctx = new Context();
16
+ scheduleTask(ctx, async () => {
17
+ const audioStreamTrack = await createInaudibleAudioStreamTrack({ ctx });
18
+ setAudioStreamTrack(audioStreamTrack);
19
+ });
20
+
21
+ return () => {
22
+ void ctx.dispose();
23
+ };
24
+ }, []);
25
+
26
+ return audioStreamTrack;
27
+ };
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type RefObject, useEffect, useRef, useState } from 'react';
6
+
7
+ export const useVideoStreamTrack = (videoElement: RefObject<HTMLVideoElement | null>, videoSrc: string) => {
8
+ // Get video stream track.
9
+ const [videoStreamTrack, setVideoStreamTrack] = useState<MediaStreamTrack | undefined>(undefined);
10
+ const hadRun = useRef(false);
11
+ useEffect(() => {
12
+ // This is done to capture only one video stream.
13
+ if (!videoElement.current || hadRun.current || !videoSrc) {
14
+ return;
15
+ }
16
+ hadRun.current = true;
17
+ videoElement.current.addEventListener('playing', () => {
18
+ if (videoStreamTrack) {
19
+ return;
20
+ }
21
+ const stream = (videoElement.current as any).captureStream();
22
+ const track = stream.getTracks()[0];
23
+ if (track && !videoStreamTrack) {
24
+ setVideoStreamTrack(track);
25
+ }
26
+ stream.onaddtrack = (event: MediaStreamTrackEvent) => {
27
+ if (event.track.kind === 'video' && !videoStreamTrack) {
28
+ setVideoStreamTrack(event.track);
29
+ }
30
+ };
31
+ });
32
+ videoElement.current.src = videoSrc;
33
+ }, [videoElement.current, videoSrc]);
34
+
35
+ return videoStreamTrack;
36
+ };
package/src/index.ts CHANGED
@@ -2,9 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { ThreadCapabilities } from './capabilities';
6
- export * from './calls';
7
- export * from './hooks';
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const ThreadPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
8
11
  export * from './meta';
9
12
 
10
- export * from './ThreadPlugin';
13
+ export { ThreadCapabilities } from './types';
14
+ export * from './calls';
15
+ // TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
16
+ // Either refactor callers to not need them or factor them out to a shared package.
17
+ export * from './hooks';
package/src/meta.ts CHANGED
@@ -2,16 +2,20 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const THREAD_PLUGIN = 'dxos.org/plugin/thread';
8
- export const THREAD_ITEM = `${THREAD_PLUGIN}/item`;
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
9
7
 
10
8
  // TODO(wittjosiah): Needs screenshots.
11
- export const meta: PluginMeta = {
12
- id: THREAD_PLUGIN,
9
+ export const meta: Plugin.Meta = {
10
+ id: 'org.dxos.plugin.thread',
13
11
  name: 'Chat',
14
- description: 'Chat via text, voice, and video in channels or create comment threads on objects.',
12
+ description: trim`
13
+ Multi-modal communication platform supporting text chat, voice, and video conferencing.
14
+ Create threaded conversations and add contextual comments directly on any workspace object.
15
+ `,
15
16
  icon: 'ph--video-conference--regular',
17
+ iconHue: 'rose',
16
18
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
17
19
  };
20
+
21
+ export const THREAD_ITEM = `${meta.id}.item`;
@@ -0,0 +1,81 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+ import { Obj, Ref, Relation } from '@dxos/echo';
10
+ import { invariant } from '@dxos/invariant';
11
+ import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
13
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
14
+
15
+ import { ThreadCapabilities } from '../types';
16
+ import { AddMessage } from './definitions';
17
+
18
+ const handler: Operation.WithHandler<typeof AddMessage> = AddMessage.pipe(
19
+ Operation.withHandler(
20
+ Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
21
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
22
+ const stateAtom = yield* Capability.get(ThreadCapabilities.State);
23
+ const thread = Relation.getSource(anchor) as Thread.Thread;
24
+ const subjectId = Obj.getDXN(subject).toString();
25
+ const db = Obj.getDatabase(subject);
26
+ invariant(db, 'Database not found');
27
+
28
+ const message = Obj.make(Message.Message, {
29
+ created: new Date().toISOString(),
30
+ sender,
31
+ blocks: [{ _tag: 'text', text }],
32
+ });
33
+ Obj.update(thread, (thread) => {
34
+ thread.messages.push(Ref.make(message));
35
+ });
36
+
37
+ const state = registry.get(stateAtom);
38
+ const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);
39
+ if (draft) {
40
+ Obj.update(thread, (thread) => {
41
+ thread.status = 'active';
42
+ });
43
+ registry.set(stateAtom, {
44
+ ...state,
45
+ drafts: {
46
+ ...state.drafts,
47
+ [subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),
48
+ },
49
+ });
50
+ yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });
51
+ yield* Operation.invoke(SpaceOperation.AddRelation, {
52
+ db,
53
+ schema: AnchoredTo.AnchoredTo,
54
+ source: thread,
55
+ target: subject,
56
+ fields: { anchor: draft.anchor },
57
+ });
58
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
59
+ name: 'threads.create',
60
+ properties: {
61
+ spaceId: db.spaceId,
62
+ threadId: thread.id,
63
+ },
64
+ });
65
+ }
66
+
67
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
68
+ name: 'threads.message.add',
69
+ properties: {
70
+ spaceId: db.spaceId,
71
+ threadId: thread.id,
72
+ threadLength: thread.messages.length,
73
+ messageId: message.id,
74
+ messageLength: text.length,
75
+ },
76
+ });
77
+ }),
78
+ ),
79
+ );
80
+
81
+ export default handler;