@dxos/plugin-thread 0.8.4-main.422d1c7879 → 0.8.4-main.43cb759274

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 (532) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +271 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/ChannelArticle-UJHPOUWA.mjs +28 -0
  5. package/dist/lib/neutral/ChannelArticle-UJHPOUWA.mjs.map +7 -0
  6. package/dist/lib/neutral/ChannelChat-LZEDFJVD.mjs +10 -0
  7. package/dist/lib/neutral/CommentsCompanion-FOUIGCEK.mjs +208 -0
  8. package/dist/lib/neutral/CommentsCompanion-FOUIGCEK.mjs.map +7 -0
  9. package/dist/lib/neutral/ThreadContainer-QWB6WRMI.mjs +61 -0
  10. package/dist/lib/neutral/ThreadContainer-QWB6WRMI.mjs.map +7 -0
  11. package/dist/lib/neutral/ThreadPlugin.mjs +109 -0
  12. package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
  13. package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
  14. package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
  15. package/dist/lib/neutral/ThreadPlugin.workerd.mjs +24 -0
  16. package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
  17. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs +15 -0
  18. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
  19. package/dist/lib/{browser/add-message-VPPFFLFL.mjs → neutral/add-message-RDIABSIX.mjs} +48 -23
  20. package/dist/lib/neutral/add-message-RDIABSIX.mjs.map +7 -0
  21. package/dist/lib/neutral/agent-runner-RB7N5HLD.mjs +244 -0
  22. package/dist/lib/neutral/agent-runner-RB7N5HLD.mjs.map +7 -0
  23. package/dist/lib/neutral/app-graph-builder-PDLRFYSI.mjs +120 -0
  24. package/dist/lib/neutral/app-graph-builder-PDLRFYSI.mjs.map +7 -0
  25. package/dist/lib/neutral/append-channel-message-TBBQUVMH.mjs +40 -0
  26. package/dist/lib/neutral/append-channel-message-TBBQUVMH.mjs.map +7 -0
  27. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs +15 -0
  28. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
  29. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  30. package/dist/lib/neutral/capabilities/index.mjs +27 -0
  31. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-35GUWXBB.mjs +48 -0
  33. package/dist/lib/neutral/chunk-35GUWXBB.mjs.map +7 -0
  34. package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +5 -6
  35. package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-BHEZLLXG.mjs +55 -0
  37. package/dist/lib/neutral/chunk-BHEZLLXG.mjs.map +7 -0
  38. package/dist/lib/neutral/chunk-HQZWTDJC.mjs +164 -0
  39. package/dist/lib/neutral/chunk-HQZWTDJC.mjs.map +7 -0
  40. package/dist/lib/neutral/chunk-IQBZZAMX.mjs +335 -0
  41. package/dist/lib/neutral/chunk-IQBZZAMX.mjs.map +7 -0
  42. package/dist/lib/neutral/chunk-JJETHBAZ.mjs +8 -0
  43. package/dist/lib/neutral/chunk-JJETHBAZ.mjs.map +7 -0
  44. package/dist/lib/neutral/chunk-JLY4NVTA.mjs +38 -0
  45. package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
  46. package/dist/lib/neutral/chunk-QFDT33VT.mjs +69 -0
  47. package/dist/lib/neutral/chunk-QFDT33VT.mjs.map +7 -0
  48. package/dist/lib/neutral/components/index.mjs +541 -0
  49. package/dist/lib/neutral/components/index.mjs.map +7 -0
  50. package/dist/lib/neutral/containers/index.mjs +15 -0
  51. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  52. package/dist/lib/{browser/create-UGT7V733.mjs → neutral/create-VXM6HJMN.mjs} +20 -14
  53. package/dist/lib/neutral/create-VXM6HJMN.mjs.map +7 -0
  54. package/dist/lib/neutral/create-channel-FSJOMRHF.mjs +19 -0
  55. package/dist/lib/neutral/create-channel-FSJOMRHF.mjs.map +7 -0
  56. package/dist/lib/neutral/create-object-D5XEG7MQ.mjs +28 -0
  57. package/dist/lib/neutral/create-object-D5XEG7MQ.mjs.map +7 -0
  58. package/dist/lib/{browser/create-proposals-CMK7S7VS.mjs → neutral/create-proposals-ILYIYJEN.mjs} +5 -6
  59. package/dist/lib/neutral/create-proposals-ILYIYJEN.mjs.map +7 -0
  60. package/dist/lib/{browser/delete-FSFVU6ZA.mjs → neutral/delete-6KZERY6K.mjs} +9 -11
  61. package/dist/lib/neutral/delete-6KZERY6K.mjs.map +7 -0
  62. package/dist/lib/{browser/delete-message-XL5M5J33.mjs → neutral/delete-message-PATSHW36.mjs} +9 -19
  63. package/dist/lib/neutral/delete-message-PATSHW36.mjs.map +7 -0
  64. package/dist/lib/neutral/hooks/index.mjs +10 -0
  65. package/dist/lib/neutral/index.mjs +32 -0
  66. package/dist/lib/neutral/index.mjs.map +7 -0
  67. package/dist/lib/neutral/markdown-5UHAAC5Z.mjs +83 -0
  68. package/dist/lib/neutral/markdown-5UHAAC5Z.mjs.map +7 -0
  69. package/dist/lib/neutral/meta.json +1 -0
  70. package/dist/lib/neutral/meta.mjs +10 -0
  71. package/dist/lib/neutral/meta.mjs.map +7 -0
  72. package/dist/lib/neutral/on-create-space-6NLTBGGD.mjs +23 -0
  73. package/dist/lib/neutral/on-create-space-6NLTBGGD.mjs.map +7 -0
  74. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
  75. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
  76. package/dist/lib/neutral/operations/index.mjs +8 -0
  77. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  78. package/dist/lib/neutral/plugin.mjs +16 -0
  79. package/dist/lib/neutral/plugin.mjs.map +7 -0
  80. package/dist/lib/neutral/react-surface-TUMXARMI.mjs +76 -0
  81. package/dist/lib/neutral/react-surface-TUMXARMI.mjs.map +7 -0
  82. package/dist/lib/neutral/respond-to-thread-ROQA3B6U.mjs +32 -0
  83. package/dist/lib/neutral/respond-to-thread-ROQA3B6U.mjs.map +7 -0
  84. package/dist/lib/{browser/restore-2ZGMKUSD.mjs → neutral/restore-SP4HADCE.mjs} +6 -7
  85. package/dist/lib/neutral/restore-SP4HADCE.mjs.map +7 -0
  86. package/dist/lib/{browser/restore-message-OYEGWPII.mjs → neutral/restore-message-TVIC66VL.mjs} +8 -17
  87. package/dist/lib/neutral/restore-message-TVIC66VL.mjs.map +7 -0
  88. package/dist/lib/{browser/select-VG2XLULE.mjs → neutral/select-DLHPEKEA.mjs} +7 -9
  89. package/dist/lib/neutral/select-DLHPEKEA.mjs.map +7 -0
  90. package/dist/lib/neutral/set-agent-config-7GEYCG7Y.mjs +20 -0
  91. package/dist/lib/neutral/set-agent-config-7GEYCG7Y.mjs.map +7 -0
  92. package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
  93. package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
  94. package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
  95. package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
  96. package/dist/lib/neutral/testing/index.mjs +58 -0
  97. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  98. package/dist/lib/{browser/toggle-resolved-MM6YC5BU.mjs → neutral/toggle-resolved-GMAD3SZ2.mjs} +8 -17
  99. package/dist/lib/neutral/toggle-resolved-GMAD3SZ2.mjs.map +7 -0
  100. package/dist/lib/neutral/translations.mjs +91 -0
  101. package/dist/lib/neutral/translations.mjs.map +7 -0
  102. package/dist/lib/neutral/types/index.mjs +16 -0
  103. package/dist/lib/neutral/types/index.mjs.map +7 -0
  104. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
  105. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
  106. package/dist/types/src/ThreadPlugin.d.ts +1 -0
  107. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  108. package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
  109. package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
  110. package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
  111. package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
  112. package/dist/types/src/ThreadPlugin.workerd.d.ts +4 -0
  113. package/dist/types/src/ThreadPlugin.workerd.d.ts.map +1 -0
  114. package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
  115. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
  116. package/dist/types/src/capabilities/agent-runner.d.ts +22 -0
  117. package/dist/types/src/capabilities/agent-runner.d.ts.map +1 -0
  118. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  119. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  120. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  121. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  122. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/index.d.ts +10 -8
  124. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  125. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  126. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  127. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  128. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  129. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  130. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  131. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
  132. package/dist/types/src/components/Chat/Chat.d.ts +51 -0
  133. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
  134. package/dist/types/src/components/Chat/index.d.ts +2 -0
  135. package/dist/types/src/components/Chat/index.d.ts.map +1 -0
  136. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  137. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
  138. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
  139. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
  140. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
  141. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
  142. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
  143. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
  144. package/dist/types/src/components/index.d.ts +1 -1
  145. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +13 -0
  146. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
  147. package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +162 -0
  148. package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
  149. package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
  150. package/dist/types/src/containers/{CallDebugPanel → ChannelArticle}/index.d.ts.map +1 -1
  151. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
  152. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
  153. package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
  154. package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
  155. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.d.ts +11 -0
  156. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.d.ts.map +1 -0
  157. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.stories.d.ts +198 -0
  158. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.stories.d.ts.map +1 -0
  159. package/dist/types/src/containers/CommentsCompanion/index.d.ts +2 -0
  160. package/dist/types/src/containers/CommentsCompanion/index.d.ts.map +1 -0
  161. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
  162. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
  163. package/dist/types/src/containers/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
  164. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
  165. package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
  166. package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
  167. package/dist/types/src/containers/index.d.ts +4 -5
  168. package/dist/types/src/containers/index.d.ts.map +1 -1
  169. package/dist/types/src/extensions/threads.d.ts +3 -3
  170. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  171. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  172. package/dist/types/src/hooks/index.d.ts +0 -4
  173. package/dist/types/src/hooks/index.d.ts.map +1 -1
  174. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  175. package/dist/types/src/index.d.ts +2 -3
  176. package/dist/types/src/index.d.ts.map +1 -1
  177. package/dist/types/src/meta.d.ts +1 -1
  178. package/dist/types/src/meta.d.ts.map +1 -1
  179. package/dist/types/src/operations/add-message.d.ts +3 -3
  180. package/dist/types/src/operations/add-message.d.ts.map +1 -1
  181. package/dist/types/src/operations/append-channel-message.d.ts +5 -0
  182. package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
  183. package/dist/types/src/operations/create-channel.d.ts +3 -3
  184. package/dist/types/src/operations/create-channel.d.ts.map +1 -1
  185. package/dist/types/src/operations/create-proposals.d.ts +3 -3
  186. package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
  187. package/dist/types/src/operations/create.d.ts +3 -3
  188. package/dist/types/src/operations/create.d.ts.map +1 -1
  189. package/dist/types/src/operations/delete-message.d.ts +3 -3
  190. package/dist/types/src/operations/delete-message.d.ts.map +1 -1
  191. package/dist/types/src/operations/delete.d.ts +3 -3
  192. package/dist/types/src/operations/delete.d.ts.map +1 -1
  193. package/dist/types/src/operations/index.d.ts +1 -2
  194. package/dist/types/src/operations/index.d.ts.map +1 -1
  195. package/dist/types/src/operations/on-create-space.d.ts +3 -3
  196. package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
  197. package/dist/types/src/operations/respond-to-thread.d.ts +5 -0
  198. package/dist/types/src/operations/respond-to-thread.d.ts.map +1 -0
  199. package/dist/types/src/operations/restore-message.d.ts +3 -3
  200. package/dist/types/src/operations/restore-message.d.ts.map +1 -1
  201. package/dist/types/src/operations/restore.d.ts +3 -3
  202. package/dist/types/src/operations/restore.d.ts.map +1 -1
  203. package/dist/types/src/operations/select.d.ts +3 -3
  204. package/dist/types/src/operations/select.d.ts.map +1 -1
  205. package/dist/types/src/operations/set-agent-config.d.ts +5 -0
  206. package/dist/types/src/operations/set-agent-config.d.ts.map +1 -0
  207. package/dist/types/src/operations/toggle-resolved.d.ts +3 -3
  208. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
  209. package/dist/types/src/plugin.d.ts +4 -0
  210. package/dist/types/src/plugin.d.ts.map +1 -0
  211. package/dist/types/src/should-trigger-agent.d.ts +22 -0
  212. package/dist/types/src/should-trigger-agent.d.ts.map +1 -0
  213. package/dist/types/src/should-trigger-agent.test.d.ts +2 -0
  214. package/dist/types/src/should-trigger-agent.test.d.ts.map +1 -0
  215. package/dist/types/src/testing/data.d.ts.map +1 -1
  216. package/dist/types/src/testing/index.d.ts +1 -1
  217. package/dist/types/src/testing/index.d.ts.map +1 -1
  218. package/dist/types/src/translations.d.ts +70 -70
  219. package/dist/types/src/translations.d.ts.map +1 -1
  220. package/dist/types/src/types/AgentIdentity.d.ts +27 -0
  221. package/dist/types/src/types/AgentIdentity.d.ts.map +1 -0
  222. package/dist/types/src/types/ThreadCapabilities.d.ts +34 -0
  223. package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
  224. package/dist/types/src/{operations/definitions.d.ts → types/ThreadOperation.d.ts} +1882 -1941
  225. package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
  226. package/dist/types/src/types/index.d.ts +4 -2
  227. package/dist/types/src/types/index.d.ts.map +1 -1
  228. package/dist/types/src/types/types.d.ts +1 -1
  229. package/dist/types/src/types/types.d.ts.map +1 -1
  230. package/dist/types/src/util.d.ts +6 -3
  231. package/dist/types/src/util.d.ts.map +1 -1
  232. package/dist/types/tsconfig.tsbuildinfo +1 -1
  233. package/package.json +133 -96
  234. package/src/ThreadPlugin.node.ts +39 -0
  235. package/src/ThreadPlugin.test.ts +37 -0
  236. package/src/ThreadPlugin.tsx +35 -65
  237. package/src/ThreadPlugin.workerd.ts +20 -0
  238. package/src/blueprints/thread-blueprint.ts +3 -4
  239. package/src/capabilities/agent-runner.ts +291 -0
  240. package/src/capabilities/app-graph-builder.ts +24 -74
  241. package/src/capabilities/blueprint-definition.ts +2 -0
  242. package/src/capabilities/create-object.ts +30 -0
  243. package/src/capabilities/index.ts +4 -3
  244. package/src/capabilities/markdown.ts +6 -2
  245. package/src/capabilities/operation-handler.ts +1 -1
  246. package/src/capabilities/react-surface.tsx +11 -27
  247. package/src/capabilities/settings.ts +1 -3
  248. package/src/capabilities/undo-mappings.ts +1 -1
  249. package/src/components/Chat/Chat.tsx +259 -0
  250. package/src/components/Chat/index.ts +5 -0
  251. package/src/components/CommentsPanel/CommentsPanel.stories.tsx +8 -7
  252. package/src/components/CommentsPanel/CommentsPanel.tsx +5 -5
  253. package/src/components/CommentsPanel/CommentsThread.tsx +16 -12
  254. package/src/components/MessagePanel/MessagePanel.tsx +8 -9
  255. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
  256. package/src/components/ThreadSettings/ThreadSettings.tsx +0 -1
  257. package/src/components/index.ts +1 -1
  258. package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +105 -0
  259. package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
  260. package/src/containers/ChannelArticle/index.ts +5 -0
  261. package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
  262. package/src/containers/ChannelChat/index.ts +8 -0
  263. package/src/containers/CommentsCompanion/CommentsCompanion.stories.tsx +355 -0
  264. package/src/containers/{ThreadCompanion/ThreadCompanion.tsx → CommentsCompanion/CommentsCompanion.tsx} +33 -34
  265. package/src/containers/CommentsCompanion/index.ts +5 -0
  266. package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
  267. package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
  268. package/src/containers/ThreadContainer/index.ts +8 -0
  269. package/src/containers/index.ts +4 -5
  270. package/src/extensions/command.ts +1 -1
  271. package/src/extensions/threads.ts +13 -13
  272. package/src/hooks/analytics.ts +1 -1
  273. package/src/hooks/index.ts +0 -5
  274. package/src/index.ts +4 -4
  275. package/src/meta.ts +34 -8
  276. package/src/operations/add-message.ts +22 -9
  277. package/src/operations/append-channel-message.ts +37 -0
  278. package/src/operations/create-channel.ts +4 -4
  279. package/src/operations/create-proposals.ts +3 -3
  280. package/src/operations/create.ts +21 -6
  281. package/src/operations/delete-message.ts +6 -6
  282. package/src/operations/delete.ts +5 -5
  283. package/src/operations/index.ts +4 -4
  284. package/src/operations/on-create-space.ts +4 -4
  285. package/src/operations/respond-to-thread.ts +32 -0
  286. package/src/operations/restore-message.ts +5 -5
  287. package/src/operations/restore.ts +4 -4
  288. package/src/operations/select.ts +3 -3
  289. package/src/operations/set-agent-config.ts +24 -0
  290. package/src/operations/toggle-resolved.ts +5 -5
  291. package/src/plugin.ts +11 -0
  292. package/src/should-trigger-agent.test.ts +72 -0
  293. package/src/should-trigger-agent.ts +50 -0
  294. package/src/testing/index.ts +1 -1
  295. package/src/translations.ts +2 -1
  296. package/src/types/AgentIdentity.ts +35 -0
  297. package/src/types/ThreadCapabilities.ts +46 -0
  298. package/src/types/ThreadOperation.ts +225 -0
  299. package/src/types/index.ts +5 -2
  300. package/src/types/types.ts +0 -2
  301. package/src/util.ts +36 -4
  302. package/src/vite-env.d.ts +10 -0
  303. package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +0 -7
  304. package/dist/lib/browser/blueprints/index.mjs.map +0 -7
  305. package/dist/lib/browser/chunk-MESW3R4Q.mjs +0 -61
  306. package/dist/lib/browser/chunk-MESW3R4Q.mjs.map +0 -7
  307. package/dist/lib/browser/chunk-VPM44Z35.mjs +0 -259
  308. package/dist/lib/browser/chunk-VPM44Z35.mjs.map +0 -7
  309. package/dist/lib/browser/create-UGT7V733.mjs.map +0 -7
  310. package/dist/lib/browser/create-channel-EF67LCS6.mjs +0 -21
  311. package/dist/lib/browser/create-channel-EF67LCS6.mjs.map +0 -7
  312. package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs +0 -28
  313. package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +0 -7
  314. package/dist/lib/browser/create-proposals-CMK7S7VS.mjs.map +0 -7
  315. package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +0 -7
  316. package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +0 -7
  317. package/dist/lib/browser/index.mjs +0 -2334
  318. package/dist/lib/browser/index.mjs.map +0 -7
  319. package/dist/lib/browser/meta.json +0 -1
  320. package/dist/lib/browser/on-create-space-VYS2JGVT.mjs +0 -25
  321. package/dist/lib/browser/on-create-space-VYS2JGVT.mjs.map +0 -7
  322. package/dist/lib/browser/operations/index.mjs +0 -14
  323. package/dist/lib/browser/operations/index.mjs.map +0 -7
  324. package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +0 -7
  325. package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +0 -7
  326. package/dist/lib/browser/select-VG2XLULE.mjs.map +0 -7
  327. package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +0 -7
  328. package/dist/lib/browser/types/index.mjs +0 -12
  329. package/dist/lib/node-esm/add-message-XWKHLNS6.mjs +0 -98
  330. package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +0 -7
  331. package/dist/lib/node-esm/blueprints/index.mjs +0 -38
  332. package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
  333. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  334. package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs +0 -260
  335. package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +0 -7
  336. package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs +0 -62
  337. package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs.map +0 -7
  338. package/dist/lib/node-esm/create-XAYNDVU2.mjs +0 -56
  339. package/dist/lib/node-esm/create-XAYNDVU2.mjs.map +0 -7
  340. package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs +0 -22
  341. package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs.map +0 -7
  342. package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs +0 -29
  343. package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +0 -7
  344. package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs +0 -58
  345. package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs.map +0 -7
  346. package/dist/lib/node-esm/delete-WRODXR3E.mjs +0 -60
  347. package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +0 -7
  348. package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs +0 -65
  349. package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +0 -7
  350. package/dist/lib/node-esm/index.mjs +0 -2335
  351. package/dist/lib/node-esm/index.mjs.map +0 -7
  352. package/dist/lib/node-esm/meta.json +0 -1
  353. package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs +0 -26
  354. package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs.map +0 -7
  355. package/dist/lib/node-esm/operations/index.mjs +0 -15
  356. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  357. package/dist/lib/node-esm/restore-T3QA7TSL.mjs +0 -34
  358. package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +0 -7
  359. package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs +0 -43
  360. package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +0 -7
  361. package/dist/lib/node-esm/select-Q4UDWJJF.mjs +0 -27
  362. package/dist/lib/node-esm/select-Q4UDWJJF.mjs.map +0 -7
  363. package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs +0 -46
  364. package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +0 -7
  365. package/dist/lib/node-esm/types/index.mjs +0 -13
  366. package/dist/types/src/calls/call-manager.d.ts +0 -87
  367. package/dist/types/src/calls/call-manager.d.ts.map +0 -1
  368. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
  369. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
  370. package/dist/types/src/calls/index.d.ts +0 -7
  371. package/dist/types/src/calls/index.d.ts.map +0 -1
  372. package/dist/types/src/calls/media-manager.d.ts +0 -60
  373. package/dist/types/src/calls/media-manager.d.ts.map +0 -1
  374. package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
  375. package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
  376. package/dist/types/src/calls/types.d.ts +0 -45
  377. package/dist/types/src/calls/types.d.ts.map +0 -1
  378. package/dist/types/src/calls/util/audio.d.ts +0 -6
  379. package/dist/types/src/calls/util/audio.d.ts.map +0 -1
  380. package/dist/types/src/calls/util/calls-service.d.ts +0 -77
  381. package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
  382. package/dist/types/src/calls/util/history-cache.d.ts +0 -11
  383. package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
  384. package/dist/types/src/calls/util/index.d.ts +0 -5
  385. package/dist/types/src/calls/util/index.d.ts.map +0 -1
  386. package/dist/types/src/calls/util/media.d.ts +0 -6
  387. package/dist/types/src/calls/util/media.d.ts.map +0 -1
  388. package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
  389. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
  390. package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
  391. package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
  392. package/dist/types/src/calls-service.stories.d.ts +0 -23
  393. package/dist/types/src/calls-service.stories.d.ts.map +0 -1
  394. package/dist/types/src/capabilities/call-manager.d.ts +0 -6
  395. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  396. package/dist/types/src/capabilities/react-root.d.ts +0 -9
  397. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  398. package/dist/types/src/components/Call/Call.d.ts +0 -17
  399. package/dist/types/src/components/Call/Call.d.ts.map +0 -1
  400. package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
  401. package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
  402. package/dist/types/src/components/Call/index.d.ts +0 -3
  403. package/dist/types/src/components/Call/index.d.ts.map +0 -1
  404. package/dist/types/src/components/Lobby/Lobby.d.ts +0 -15
  405. package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
  406. package/dist/types/src/components/Lobby/index.d.ts +0 -2
  407. package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
  408. package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
  409. package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
  410. package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
  411. package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
  412. package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -22
  413. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
  414. package/dist/types/src/components/Media/index.d.ts +0 -3
  415. package/dist/types/src/components/Media/index.d.ts.map +0 -1
  416. package/dist/types/src/components/Participant/Participant.d.ts +0 -6
  417. package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
  418. package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
  419. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
  420. package/dist/types/src/components/Participant/index.d.ts +0 -3
  421. package/dist/types/src/components/Participant/index.d.ts.map +0 -1
  422. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
  423. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
  424. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -178
  425. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
  426. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
  427. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
  428. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts +0 -12
  429. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +0 -1
  430. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +0 -164
  431. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +0 -1
  432. package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
  433. package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
  434. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
  435. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
  436. package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -2
  437. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
  438. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
  439. package/dist/types/src/containers/CallSidebar/index.d.ts +0 -2
  440. package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
  441. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
  442. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
  443. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +0 -162
  444. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
  445. package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
  446. package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
  447. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -16
  448. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
  449. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
  450. package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
  451. package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
  452. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +0 -8
  453. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +0 -1
  454. package/dist/types/src/containers/ThreadCompanion/index.d.ts +0 -2
  455. package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +0 -1
  456. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
  457. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
  458. package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
  459. package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
  460. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
  461. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
  462. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
  463. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
  464. package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
  465. package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
  466. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  467. package/dist/types/src/testing/stories.d.ts +0 -3
  468. package/dist/types/src/testing/stories.d.ts.map +0 -1
  469. package/dist/types/src/types/Channel.d.ts +0 -715
  470. package/dist/types/src/types/Channel.d.ts.map +0 -1
  471. package/dist/types/src/types/capabilities.d.ts +0 -24
  472. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  473. package/src/calls/call-manager.ts +0 -270
  474. package/src/calls/call-swarm-synchronizer.ts +0 -350
  475. package/src/calls/index.ts +0 -10
  476. package/src/calls/media-manager.ts +0 -378
  477. package/src/calls/speaking-monitor.ts +0 -85
  478. package/src/calls/types.ts +0 -74
  479. package/src/calls/util/audio.ts +0 -58
  480. package/src/calls/util/calls-service.ts +0 -580
  481. package/src/calls/util/history-cache.ts +0 -27
  482. package/src/calls/util/index.ts +0 -8
  483. package/src/calls/util/media.ts +0 -52
  484. package/src/calls/util/stub-media-streams.ts +0 -127
  485. package/src/calls/util/task-scheduling.ts +0 -92
  486. package/src/calls-service.stories.tsx +0 -230
  487. package/src/capabilities/call-manager.ts +0 -27
  488. package/src/capabilities/react-root.tsx +0 -20
  489. package/src/components/Call/Call.tsx +0 -93
  490. package/src/components/Call/Toolbar.tsx +0 -199
  491. package/src/components/Call/index.ts +0 -6
  492. package/src/components/Lobby/Lobby.tsx +0 -122
  493. package/src/components/Lobby/index.ts +0 -5
  494. package/src/components/Media/AudioStream.tsx +0 -67
  495. package/src/components/Media/VideoObject.stories.tsx +0 -59
  496. package/src/components/Media/VideoObject.tsx +0 -58
  497. package/src/components/Media/index.ts +0 -6
  498. package/src/components/Participant/Participant.tsx +0 -77
  499. package/src/components/Participant/ParticipantGrid.tsx +0 -88
  500. package/src/components/Participant/index.ts +0 -6
  501. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
  502. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
  503. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
  504. package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -53
  505. package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
  506. package/src/components/ResponsiveGrid/index.ts +0 -7
  507. package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
  508. package/src/containers/CallDebugPanel/index.ts +0 -5
  509. package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
  510. package/src/containers/CallSidebar/index.ts +0 -5
  511. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +0 -61
  512. package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
  513. package/src/containers/ChannelContainer/index.ts +0 -5
  514. package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
  515. package/src/containers/ChatContainer/index.ts +0 -8
  516. package/src/containers/ThreadCompanion/index.ts +0 -5
  517. package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
  518. package/src/hooks/useDebugMode.ts +0 -25
  519. package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
  520. package/src/hooks/useVideoStreamTrack.tsx +0 -36
  521. package/src/operations/create-channel-thread.ts +0 -26
  522. package/src/operations/definitions.ts +0 -177
  523. package/src/testing/stories.ts +0 -51
  524. package/src/types/Channel.ts +0 -37
  525. package/src/types/capabilities.ts +0 -36
  526. package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
  527. package/src/typings.d.ts +0 -8
  528. /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChannelChat-LZEDFJVD.mjs.map} +0 -0
  529. /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  530. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  531. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  532. /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
@@ -1,31 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren } from 'react';
6
-
7
- import { mx } from '@dxos/ui-theme';
8
-
9
- /**
10
- * A container component that maintains the child's aspect ratio while centering its content.
11
- * The container will scale to fit within its parent's bounds while preserving the aspect ratio.
12
- *
13
- * @example
14
- * <ResponsivePanel>
15
- * <VideoObject />
16
- * </ResponsivePanel>
17
- */
18
- export const ResponsivePanel = ({ children }: PropsWithChildren) => {
19
- return (
20
- // Outer container that takes full size of parent.
21
- <div role='none' className='dx-expander relative flex'>
22
- {/* Absolute positioning layer for centering content. */}
23
- <div role='none' className='absolute inset-0 flex justify-center items-center'>
24
- {/* Content container that maintains given aspect ratio and proper scaling. */}
25
- <div role='none' className={mx('max-h-full max-w-full w-auto h-auto aspect-video')}>
26
- {children}
27
- </div>
28
- </div>
29
- </div>
30
- );
31
- };
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './ResponsivePanel';
6
- export * from './ResponsiveGrid';
7
- export * from './ResponsiveGridItem';
@@ -1,173 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { WebRTCStats, type WebRTCStatsEvent } from '@peermetrics/webrtc-stats';
6
- import React, { useEffect, useMemo, useState } from 'react';
7
-
8
- import { truncateKey } from '@dxos/debug';
9
- import { JsonView, Panel } from '@dxos/devtools';
10
- import { log } from '@dxos/log';
11
- import { IconButton, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
12
-
13
- import { meta } from '#meta';
14
-
15
- import { type EncodedTrackName, type GlobalState } from '../../calls';
16
-
17
- export type CallDebugPanelProps = ThemedClassName<{ state?: GlobalState }>;
18
-
19
- export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
20
- const { t } = useTranslation(meta.id);
21
-
22
- const [open, setOpen] = useState(false);
23
- const handleToggle = () => setOpen(!open);
24
- const [showServiceHistory, setShowServiceHistory] = useState(false);
25
- const handleToggleServiceHistory = () => setShowServiceHistory(!showServiceHistory);
26
-
27
- const handleCopyRaw = async () => {
28
- await navigator.clipboard.writeText(JSON.stringify({ users: state?.call?.users, stats }, null, 2));
29
- };
30
-
31
- const [showDetailedWebRTCStats, setShowDetailedWebRTCStats] = useState(false);
32
- const handleShowDetailedWebRTCStats = () => setShowDetailedWebRTCStats(!showDetailedWebRTCStats);
33
-
34
- const webrtcStats = useMemo(
35
- () =>
36
- new WebRTCStats({
37
- getStatsInterval: 1000,
38
- }),
39
- [],
40
- );
41
- const [stats, setStats] = useState<WebRTCStatsEvent['data']>();
42
-
43
- useEffect(() => {
44
- const pc = state?.media.peer?.session?.peerConnection;
45
- const handleStats = (stats: WebRTCStatsEvent) => {
46
- setStats(stats.data);
47
- };
48
- let added = false;
49
- if (pc && showDetailedWebRTCStats) {
50
- webrtcStats.addConnection({ pc, peerId: 1, connectionId: '1' });
51
- webrtcStats.on('stats', handleStats as never);
52
- added = true;
53
- }
54
- return () => {
55
- try {
56
- if (pc && added) {
57
- webrtcStats.removeConnection({ pc });
58
- webrtcStats.removeListener('stats', handleStats as never);
59
- }
60
- } catch (error) {
61
- log.error('error removing webrtc stats', { error, pc, peerId: 1, connectionId: '1' });
62
- }
63
- };
64
- }, [state?.media.peer?.session?.peerConnection, showDetailedWebRTCStats]);
65
-
66
- const rows = useMemo(() => getCallStatusTable(state), [state?.call.users, state?.media.pulledAudioTracks]);
67
-
68
- return (
69
- <Panel
70
- id='meeting-status'
71
- icon='ph--video-conference--regular'
72
- open={open}
73
- onToggle={handleToggle}
74
- title={t('meeting-status.title')}
75
- info={<div className='flex items-center gap-2'> {state?.call.joined ? 'Active' : 'Inactive'}</div>}
76
- maxHeight={0}
77
- >
78
- <div className='flex flex-col w-full text-xs'>
79
- <div className='flex items-center gap-2 items-center'>
80
- <Input.Root>
81
- <Input.Switch checked={showDetailedWebRTCStats} onCheckedChange={handleShowDetailedWebRTCStats} />
82
- <Input.Label>{t('show-webrtc-stats.title')}</Input.Label>
83
- </Input.Root>
84
- </div>
85
- <div className='flex items-center gap-2 items-center'>
86
- <Input.Root>
87
- <Input.Switch checked={showServiceHistory} onCheckedChange={handleToggleServiceHistory} />
88
- <Input.Label>{t('show-calls-history.title')}</Input.Label>
89
- </Input.Root>
90
- </div>
91
- <div className='flex items-center gap-2 items-center'>
92
- <IconButton icon='ph--copy--regular' label={'copy raw'} onClick={handleCopyRaw} />
93
- </div>
94
- <Table rows={rows} />
95
- {showDetailedWebRTCStats && <JsonView data={{ stats }} />}
96
- {showServiceHistory && <JsonView data={{ history: state?.media.peer?.history.get() }} />}
97
- </div>
98
- </Panel>
99
- );
100
- };
101
-
102
- const getCallStatusTable = (state?: GlobalState): TableProps['rows'] => {
103
- if (!state || !state.call?.users) {
104
- return [];
105
- }
106
-
107
- const self = state.call.self;
108
- const users = state.call.users
109
- .filter((user) => user.id !== self!.id)
110
- .map((user) => {
111
- const isOk = {
112
- audio:
113
- user.tracks?.audio &&
114
- state.media.pulledAudioTracks[user.tracks?.audio as EncodedTrackName]?.ctx.disposed === false,
115
- video:
116
- user.tracks?.video &&
117
- state.media.pulledVideoStreams[user.tracks?.video as EncodedTrackName]?.ctx.disposed === false,
118
- screenshare:
119
- user.tracks?.screenshare &&
120
- state.media.pulledVideoStreams[user.tracks?.screenshare as EncodedTrackName]?.ctx.disposed === false,
121
- };
122
-
123
- return {
124
- ...user,
125
- isOk,
126
- };
127
- });
128
-
129
- return [
130
- ['users', state.call.users.length ?? 0],
131
- [
132
- '*self* ' + (self?.name ?? truncateKey(self!.id, 8)),
133
- self?.tracks?.audio && state.media.pushedAudioTrack ? 'AUD ✅' : 'AUD ❌',
134
- self?.tracks?.video && state.media.pushedVideoTrack ? 'VID ✅' : 'VID ❌',
135
- self?.tracks?.screenshareEnabled
136
- ? self.tracks.screenshareEnabled && state.media.pushedScreenshareTrack
137
- ? 'SCR ✅'
138
- : 'SCR ❌'
139
- : undefined,
140
- ],
141
-
142
- ...users.map((user) => [
143
- user.name ?? truncateKey(user.id, 8),
144
- user.isOk.audio ? 'AUD ✅' : 'AUD ❌',
145
- user.isOk.video ? 'VID ✅' : 'VID ❌',
146
- user.tracks?.screenshareEnabled ? (user.isOk.screenshare ? 'SCR ✅' : 'SCR ❌') : undefined,
147
- ]),
148
- ['ICE', state.media.peer?.session?.peerConnection.iceConnectionState ?? 'no connection'],
149
- ];
150
- };
151
-
152
- export namespace Unit {
153
- export const KB = (n?: number) => ((n ?? 0) / 1_000).toFixed(2);
154
- }
155
-
156
- export type TableProps = {
157
- rows: (string | number | undefined)[][];
158
- };
159
-
160
- export const Table = ({ rows }: TableProps) => {
161
- return (
162
- <div className='w-full text-xs font-mono'>
163
- {rows.map(([prefix, label, value, unit], i) => (
164
- <div key={i} className='grid grid-cols-[3fr_1fr_1fr_1fr]'>
165
- <div className='p-1'>{prefix}</div>
166
- <div className='p-1'>{label}</div>
167
- <div className='p-1'>{value}</div>
168
- <div className='p-1'>{unit}</div>
169
- </div>
170
- ))}
171
- </div>
172
- );
173
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export { CallDebugPanel as default } from './CallDebugPanel';
@@ -1,18 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { useAtomValue } from '@effect-atom/atom-react';
6
- import React from 'react';
7
-
8
- import { useCapability } from '@dxos/app-framework/ui';
9
-
10
- import { ThreadCapabilities } from '#types';
11
-
12
- import ChannelContainer from '../ChannelContainer';
13
-
14
- export const CallSidebar = () => {
15
- const call = useCapability(ThreadCapabilities.CallManager);
16
- const roomId = useAtomValue(call.roomIdAtom);
17
- return <ChannelContainer subject={undefined} attendableId={roomId ?? ''} roomId={roomId} role='article' />;
18
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export { CallSidebar as default } from './CallSidebar';
@@ -1,61 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React from 'react';
7
-
8
- import { Capability } from '@dxos/app-framework';
9
- import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { AppCapabilities } from '@dxos/app-toolkit';
11
- import { Query, useDatabase, useQuery } from '@dxos/react-client/echo';
12
- import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
13
- import { Message, Thread } from '@dxos/types';
14
-
15
- import { createThreadPlugins } from '#testing';
16
- import { Channel } from '#types';
17
-
18
- import { translations } from '../../translations';
19
- import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
20
-
21
- // TODO(wittjosiah): Channel doesn't render full height.
22
- const DefaultStory = ({ roomId }: ChannelContainerProps) => {
23
- const db = useDatabase();
24
- const [channel] = useQuery(db, Query.type(Channel.Channel));
25
- if (!channel) {
26
- return <Loading data={{ db: !!db, channel: !!channel }} />;
27
- }
28
-
29
- return <ChannelContainer subject={channel} attendableId='story' roomId={roomId} role='article' />;
30
- };
31
-
32
- const meta = {
33
- title: 'plugins/plugin-thread/containers/ChannelContainer',
34
- component: ChannelContainer,
35
- render: DefaultStory,
36
- decorators: [
37
- withTheme(),
38
- withLayout({ layout: 'column' }),
39
- withPluginManager({
40
- plugins: [...(await createThreadPlugins())],
41
- capabilities: [Capability.contributes(AppCapabilities.Schema, [Channel.Channel, Thread.Thread, Message.Message])],
42
- }),
43
- ],
44
- parameters: {
45
- translations,
46
- },
47
- } satisfies Meta<typeof ChannelContainer>;
48
-
49
- export default meta;
50
-
51
- type Story = StoryObj<typeof meta>;
52
-
53
- export const Default: Story = {
54
- args: {
55
- // Fixed room for testing.
56
- subject: undefined,
57
- attendableId: 'story',
58
- role: 'article',
59
- roomId: '04a1d1911703b8e929d0649021a965',
60
- },
61
- };
@@ -1,223 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
- import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
7
-
8
- import { useCapabilities, useCapability } from '@dxos/app-framework/ui';
9
- import { type AppSurface } from '@dxos/app-toolkit/ui';
10
- import { Context } from '@dxos/context';
11
- import { failUndefined } from '@dxos/debug';
12
- import { log } from '@dxos/log';
13
- import { useClient } from '@dxos/react-client';
14
- import { getSpace } from '@dxos/react-client/echo';
15
- import { useIdentity } from '@dxos/react-client/halo';
16
- import { Button, ElevationProvider, Input, Panel, useTranslation } from '@dxos/react-ui';
17
- import { Settings } from '@dxos/react-ui-form';
18
- import { Menu, MenuRootProps, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
19
- import { useSoundEffect } from '@dxos/react-ui-sfx';
20
- import { composable, composableProps } from '@dxos/ui-theme';
21
-
22
- import { Call } from '#components';
23
- import { meta } from '#meta';
24
- import { ThreadCapabilities } from '#types';
25
- import { type Channel } from '#types';
26
-
27
- import { ChatContainer } from '../ChatContainer';
28
-
29
- export type ChannelContainerProps = AppSurface.ObjectArticleProps<
30
- Channel.Channel | undefined,
31
- {
32
- roomId?: string;
33
- fullscreen?: boolean;
34
- }
35
- >;
36
-
37
- /**
38
- * Renders a call when active, otherwise renders the channel chat.
39
- */
40
- // TODO(burdon): Create Radix style layout.
41
- export const ChannelContainer = ({
42
- role,
43
- subject: channel,
44
- attendableId,
45
- roomId: roomIdProp,
46
- fullscreen,
47
- }: ChannelContainerProps) => {
48
- const space = getSpace(channel);
49
- const callManager = useCapability(ThreadCapabilities.CallManager);
50
- const extensions = useCapabilities(ThreadCapabilities.CallExtension);
51
- const joined = useAtomValue(callManager.joinedAtom);
52
- const currentRoomId = useAtomValue(callManager.roomIdAtom);
53
- const roomId = roomIdProp ?? attendableId ?? failUndefined();
54
- const identity = useIdentity();
55
- const isNamed = !!identity?.profile?.displayName;
56
- const joinSound = useSoundEffect('JoinCall');
57
- const leaveSound = useSoundEffect('LeaveCall');
58
-
59
- useEffect(() => {
60
- const ctx = new Context();
61
- callManager.left.on(ctx, (roomId) => {
62
- extensions.forEach((extension) => {
63
- void extension.onLeave?.(roomId);
64
- });
65
- });
66
-
67
- callManager.callStateUpdated.on(ctx, (state) => {
68
- extensions.forEach((extension) => {
69
- void extension.onCallStateUpdated?.(state);
70
- });
71
- });
72
-
73
- callManager.mediaStateUpdated.on(ctx, (state) => {
74
- extensions.forEach((extension) => {
75
- void extension.onMediaStateUpdated?.(state);
76
- });
77
- });
78
-
79
- return () => {
80
- void ctx.dispose();
81
- };
82
- }, [callManager, extensions]);
83
-
84
- /**
85
- * Join the call.
86
- */
87
- // TODO(wittjosiah): Show preview before joining?
88
- const handleJoin = useCallback(async () => {
89
- if (!roomId || !channel) {
90
- return;
91
- }
92
-
93
- if (joined) {
94
- await callManager.leave();
95
- }
96
-
97
- try {
98
- void joinSound.play();
99
- callManager.setRoomId(roomId);
100
- await callManager.join();
101
- await Promise.all(extensions.map((extension) => extension.onJoin?.({ channel, roomId })));
102
- } catch (err) {
103
- // TODO(burdon): Error sound.
104
- log.catch(err);
105
- }
106
- }, [extensions, channel, roomId, joined]);
107
-
108
- /**
109
- * Leave the call.
110
- */
111
- const handleLeave = useCallback(async () => {
112
- try {
113
- void leaveSound.play();
114
- } catch (err) {
115
- // TODO(burdon): Error sound.
116
- log.catch(err);
117
- } finally {
118
- void callManager.turnAudioOff();
119
- void callManager.turnVideoOff();
120
- void callManager.turnScreenshareOff();
121
- void callManager.leave();
122
- }
123
- }, [extensions, roomId]);
124
-
125
- const isJoined = joined && currentRoomId === roomId;
126
- if (isJoined) {
127
- return (
128
- <Panel.Root>
129
- <Panel.Content>
130
- {isNamed ? (
131
- <Call.Root>
132
- <Call.Grid fullscreen={fullscreen} />
133
- <Call.Toolbar channel={channel} onLeave={handleLeave} />
134
- </Call.Root>
135
- ) : (
136
- <DisplayNameMissing />
137
- )}
138
- </Panel.Content>
139
- </Panel.Root>
140
- );
141
- }
142
-
143
- if (channel && channel.defaultThread.target && space) {
144
- return (
145
- <Panel.Root classNames='dx-document'>
146
- <Panel.Toolbar asChild>
147
- <ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
148
- </Panel.Toolbar>
149
- <Panel.Content asChild>
150
- <ChatContainer space={space} thread={channel.defaultThread.target} />
151
- </Panel.Content>
152
- </Panel.Root>
153
- );
154
- }
155
-
156
- return null;
157
- };
158
-
159
- const DisplayNameMissing = () => {
160
- const { t } = useTranslation(meta.id);
161
- const client = useClient();
162
- const [displayName, setDisplayName] = useState('');
163
- const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
164
- const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
165
-
166
- return (
167
- <div className='space-y-trim-md p-4 place-content-center'>
168
- <Settings.Item title={t('display-name.label')} description={t('display-name.description')}>
169
- <Input.TextInput
170
- value={displayName}
171
- onChange={handleChange}
172
- placeholder={t('display-name-input.placeholder')}
173
- classNames='md:min-w-64'
174
- />
175
- </Settings.Item>
176
- <Button classNames='md:col-span-2' disabled={!displayName} onClick={handleSave}>
177
- {t('set-display-name.label')}
178
- </Button>
179
- </div>
180
- );
181
- };
182
-
183
- const useChannelToolbarActions = (onJoinCall?: () => void) => {
184
- const creator = useMemo(
185
- () =>
186
- Atom.make(() => {
187
- return {
188
- nodes: [
189
- createMenuItemGroup('root', {
190
- label: ['channel-toolbar.title', { ns: meta.id }],
191
- }),
192
- createMenuAction('video-call', () => onJoinCall?.(), {
193
- label: ['start-video-call.menu', { ns: meta.id }],
194
- icon: 'ph--video-camera--regular',
195
- type: 'video-call',
196
- }),
197
- ],
198
- edges: [{ source: 'root', target: 'video-call', relation: 'child' }],
199
- };
200
- }),
201
- [],
202
- );
203
-
204
- return useMenuActions(creator);
205
- };
206
-
207
- type ChannelToolbarProps = Pick<MenuRootProps, 'attendableId'> & {
208
- onJoinCall?: () => void;
209
- };
210
-
211
- const ChannelToolbar = composable<HTMLDivElement, ChannelToolbarProps>(
212
- ({ attendableId, role, onJoinCall, ...props }, forwardedRef) => {
213
- const menuActions = useChannelToolbarActions(onJoinCall);
214
-
215
- return (
216
- <ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
217
- <Menu.Root {...menuActions} attendableId={attendableId}>
218
- <Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
219
- </Menu.Root>
220
- </ElevationProvider>
221
- );
222
- },
223
- );
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export { ChannelContainer as default } from './ChannelContainer';
@@ -1,131 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { useLayoutEffect, useMemo, useRef, useState } 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 { ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
11
- import {
12
- MessageTextbox,
13
- type MessageTextboxProps,
14
- Thread as ThreadComponent,
15
- type ThreadRootProps,
16
- threadLayout,
17
- } from '@dxos/react-ui-thread';
18
- import { Message, type Thread } from '@dxos/types';
19
- import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
20
- import { composable, composableProps, mx } from '@dxos/ui-theme';
21
- import { isNonNullable } from '@dxos/util';
22
-
23
- import { MessagePanel } from '#components';
24
- import { useStatus } from '#hooks';
25
- import { meta } from '#meta';
26
-
27
- import { command } from '../../extensions';
28
- import { getMessageMetadata } from '../../util';
29
-
30
- export type ChatContainerProps = ThemedClassName<
31
- {
32
- space: Space;
33
- thread: Thread.Thread;
34
- context?: Obj.Unknown;
35
- autoFocusTextbox?: boolean;
36
- } & Pick<ThreadRootProps, 'current'>
37
- >;
38
-
39
- export const ChatContainer = composable<HTMLDivElement, ChatContainerProps>(
40
- ({ space, thread, context, autoFocusTextbox, current, ...props }, forwardedRef) => {
41
- const { t } = useTranslation(meta.id);
42
- const { themeMode } = useThemeContext();
43
-
44
- const id = Obj.getDXN(thread).toString();
45
- const identity = useIdentity()!;
46
- const members = useMembers(space?.id);
47
- const activity = useStatus(space, id);
48
- const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
49
- const threadScrollRef = useRef<HTMLDivElement | null>(null);
50
-
51
- // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
52
- const [_count, _setCount] = useState(0);
53
- const rerenderEditor = () => _setCount((count) => count + 1);
54
-
55
- const textboxMetadata = getMessageMetadata(id, identity);
56
- const messageRef = useRef('');
57
- const extensions = useMemo(
58
- () => [
59
- createBasicExtensions({ placeholder: t('message.placeholder') }),
60
- createThemeExtensions({ themeMode }),
61
- listener({ onChange: ({ text }) => (messageRef.current = text) }),
62
- command,
63
- ],
64
- [themeMode, _count],
65
- );
66
-
67
- // TODO(thure): Factor out.
68
- // TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using
69
- // `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient
70
- // for the desired effect; this is likely hardware-dependent and should be reevaluated.
71
- const scrollToEnd = (behavior: ScrollBehavior) =>
72
- setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
73
-
74
- useLayoutEffect(() => {
75
- scrollToEnd('instant');
76
- }, []);
77
-
78
- // TODO(burdon): Change to model.
79
- const handleCreate: MessageTextboxProps['onSend'] = () => {
80
- if (!messageRef.current?.length) {
81
- return false;
82
- }
83
-
84
- Obj.change(thread, (thread) => {
85
- thread.messages.push(
86
- Ref.make(
87
- Obj.make(Message.Message, {
88
- created: new Date().toISOString(),
89
- sender: { identityDid: identity.did },
90
- blocks: [{ _tag: 'text', text: messageRef.current }],
91
- properties: context ? { context: Ref.make(context) } : undefined,
92
- }),
93
- ),
94
- );
95
- });
96
-
97
- messageRef.current = '';
98
- setAutoFocus(true);
99
- scrollToEnd('smooth');
100
- rerenderEditor();
101
- return true;
102
- };
103
-
104
- return (
105
- <ThreadComponent.Root
106
- {...composableProps(props, {
107
- classNames: 'dx-container grid-rows-[1fr_min-content_min-content]',
108
- })}
109
- id={id}
110
- current={current}
111
- ref={forwardedRef}
112
- >
113
- <ScrollArea.Root classNames='col-span-2' orientation='vertical'>
114
- <ScrollArea.Viewport ref={threadScrollRef}>
115
- <div role='none' className={mx(threadLayout, 'place-self-end')}>
116
- {thread.messages
117
- .map((message) => message.target)
118
- .filter(isNonNullable)
119
- .map((message) => (
120
- <MessagePanel key={message.id} message={message} members={members} />
121
- ))}
122
- </div>
123
- </ScrollArea.Viewport>
124
- </ScrollArea.Root>
125
-
126
- <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
127
- <ThreadComponent.Status activity={activity}>{t('activity.message')}</ThreadComponent.Status>
128
- </ThreadComponent.Root>
129
- );
130
- },
131
- );
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { ChatContainer } from './ChatContainer';
6
-
7
- export { ChatContainer };
8
- export default ChatContainer;
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export { ThreadCompanion as default } from './ThreadCompanion';