@dxos/plugin-thread 0.8.4-main.5acf9ea → 0.8.4-main.66e292d
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.
- package/dist/lib/browser/ChannelContainer-L7MKV7DS.mjs +17 -0
- package/dist/lib/browser/ChatContainer-KPY4BAUE.mjs +16 -0
- package/dist/lib/browser/{app-graph-builder-N7BE5TYW.mjs → app-graph-builder-TWJ2UCOZ.mjs} +33 -33
- package/dist/lib/browser/app-graph-builder-TWJ2UCOZ.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-TQ4JFMZZ.mjs +101 -0
- package/dist/lib/browser/blueprint-definition-TQ4JFMZZ.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-NIPDYUVD.mjs → call-manager-4YFT4XA6.mjs} +8 -7
- package/dist/lib/browser/call-manager-4YFT4XA6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KWPRNHTK.mjs → chunk-ALZKJOZK.mjs} +251 -246
- package/dist/lib/browser/chunk-ALZKJOZK.mjs.map +7 -0
- package/dist/lib/browser/chunk-ANTFU4JB.mjs +25 -0
- package/dist/lib/browser/chunk-ANTFU4JB.mjs.map +7 -0
- package/dist/lib/browser/chunk-CFC7LEPD.mjs +18 -0
- package/dist/lib/browser/chunk-CFC7LEPD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GERVMFQW.mjs → chunk-CP7E2HRE.mjs} +2 -2
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6NSMBO3B.mjs → chunk-ISCHODBV.mjs} +55 -5
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JDJPMI7V.mjs +143 -0
- package/dist/lib/browser/chunk-JDJPMI7V.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERWASUQK.mjs → chunk-KOBXMDCI.mjs} +74 -41
- package/dist/lib/browser/chunk-KOBXMDCI.mjs.map +7 -0
- package/dist/lib/browser/chunk-NPT5S6N4.mjs +611 -0
- package/dist/lib/browser/chunk-NPT5S6N4.mjs.map +7 -0
- package/dist/lib/browser/chunk-QM34EZQK.mjs +20 -0
- package/dist/lib/browser/chunk-QM34EZQK.mjs.map +7 -0
- package/dist/lib/browser/chunk-TLOOZTRD.mjs +377 -0
- package/dist/lib/browser/chunk-TLOOZTRD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZE7KWN36.mjs → chunk-ZCW3NSDZ.mjs} +310 -186
- package/dist/lib/browser/chunk-ZCW3NSDZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +61 -53
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-JFGLZ6VI.mjs → intent-resolver-G33FT3NO.mjs} +41 -55
- package/dist/lib/browser/intent-resolver-G33FT3NO.mjs.map +7 -0
- package/dist/lib/browser/{markdown-M3FMR7OD.mjs → markdown-WFZFYJBQ.mjs} +30 -27
- package/dist/lib/browser/markdown-WFZFYJBQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-ED7PHA44.mjs +29 -0
- package/dist/lib/browser/react-root-ED7PHA44.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-XWS6GIZY.mjs → react-surface-AUQQSQQC.mjs} +38 -36
- package/dist/lib/browser/react-surface-AUQQSQQC.mjs.map +7 -0
- package/dist/lib/browser/repair-JFJLEM2O.mjs +35 -0
- package/dist/lib/browser/repair-JFJLEM2O.mjs.map +7 -0
- package/dist/lib/browser/{settings-E32MTL7A.mjs → settings-E6IOLK46.mjs} +6 -5
- package/dist/lib/{node-esm/settings-SJ24YG7M.mjs.map → browser/settings-E6IOLK46.mjs.map} +1 -1
- package/dist/lib/browser/{state-H6CYONWE.mjs → state-UYPLBGZJ.mjs} +6 -5
- package/dist/lib/browser/state-UYPLBGZJ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -10
- package/dist/lib/node-esm/ChannelContainer-FYONOOZ6.mjs +18 -0
- package/dist/lib/node-esm/ChatContainer-TLQG23K7.mjs +17 -0
- package/dist/lib/node-esm/ChatContainer-TLQG23K7.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-VCW76Z6V.mjs → app-graph-builder-VD6I2V5H.mjs} +33 -33
- package/dist/lib/node-esm/app-graph-builder-VD6I2V5H.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-TSX5HHW7.mjs +102 -0
- package/dist/lib/node-esm/blueprint-definition-TSX5HHW7.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-D6O5ZJJ4.mjs → call-manager-UMUXEYH5.mjs} +8 -7
- package/dist/lib/node-esm/call-manager-UMUXEYH5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2AEIN5MI.mjs +22 -0
- package/dist/lib/node-esm/chunk-2AEIN5MI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IHDNQLLR.mjs → chunk-7KZWZS2U.mjs} +310 -186
- package/dist/lib/node-esm/chunk-7KZWZS2U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-C3XFMUAY.mjs → chunk-AB42KYF3.mjs} +251 -246
- package/dist/lib/node-esm/chunk-AB42KYF3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ATNY37UV.mjs +27 -0
- package/dist/lib/node-esm/chunk-ATNY37UV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-E5HNHFYH.mjs +378 -0
- package/dist/lib/node-esm/chunk-E5HNHFYH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FF3QVPY4.mjs +612 -0
- package/dist/lib/node-esm/chunk-FF3QVPY4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-P2M364TO.mjs +144 -0
- package/dist/lib/node-esm/chunk-P2M364TO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-25ABSYP2.mjs → chunk-PZH2EDU5.mjs} +74 -41
- package/dist/lib/node-esm/chunk-PZH2EDU5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RT6NRL2I.mjs +19 -0
- package/dist/lib/node-esm/chunk-RT6NRL2I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OU5BYIDO.mjs → chunk-VBI32FGI.mjs} +55 -5
- package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +61 -53
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OXGNQ44Y.mjs → intent-resolver-4PX3WXQG.mjs} +41 -55
- package/dist/lib/node-esm/intent-resolver-4PX3WXQG.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-INKTE4MH.mjs → markdown-CSR5MAPZ.mjs} +30 -27
- package/dist/lib/node-esm/markdown-CSR5MAPZ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-DZN324JA.mjs +30 -0
- package/dist/lib/node-esm/react-root-DZN324JA.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-MJ33KPYE.mjs → react-surface-AMVESEF4.mjs} +38 -36
- package/dist/lib/node-esm/react-surface-AMVESEF4.mjs.map +7 -0
- package/dist/lib/node-esm/repair-RMLR24YR.mjs +36 -0
- package/dist/lib/node-esm/repair-RMLR24YR.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs → settings-RGZHWDSO.mjs} +6 -5
- package/dist/lib/{browser/settings-E32MTL7A.mjs.map → node-esm/settings-RGZHWDSO.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-D7WNDT3N.mjs → state-XNWOLBNE.mjs} +6 -5
- package/dist/lib/node-esm/state-XNWOLBNE.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -10
- package/dist/types/src/ThreadPlugin.d.ts +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +4 -2
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +10 -9
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/call-manager.d.ts +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +3 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +12 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair.d.ts +4 -0
- package/dist/types/src/capabilities/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +7 -0
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.d.ts +2 -2
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +159 -5
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +162 -5
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +6 -5
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +160 -4
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +2 -2
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +9 -9
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +2 -2
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +8 -3
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +159 -3
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +161 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/components/ThreadCompanion.d.ts +5 -0
- package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings.d.ts +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/command-extension.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +3 -2
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/functions/create-proposals.d.ts +6 -0
- package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +2 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/hooks/analytics.d.ts +2 -2
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +79 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +16 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +236 -265
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +69 -63
- package/src/ThreadPlugin.tsx +137 -129
- package/src/calls/call-manager.ts +2 -2
- package/src/calls/call-swarm-synchronizer.ts +1 -1
- package/src/calls/media-manager.ts +66 -37
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +65 -14
- package/src/calls/util/stub-media-streams.ts +64 -7
- package/src/calls-service.stories.tsx +78 -65
- package/src/capabilities/app-graph-builder.ts +47 -33
- package/src/capabilities/blueprint-definition.ts +38 -0
- package/src/capabilities/call-manager.ts +3 -2
- package/src/capabilities/capabilities.ts +8 -8
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/intent-resolver.ts +32 -35
- package/src/capabilities/markdown.ts +9 -6
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +29 -26
- package/src/capabilities/repair.ts +40 -0
- package/src/capabilities/state.ts +2 -1
- package/src/components/Call/Call.tsx +4 -3
- package/src/components/Call/Toolbar.tsx +10 -10
- package/src/components/CallDebugPanel.tsx +112 -55
- package/src/components/CallSidebar.tsx +3 -2
- package/src/components/ChannelContainer.stories.tsx +15 -14
- package/src/components/ChannelContainer.tsx +25 -20
- package/src/components/Chat.stories.tsx +33 -36
- package/src/components/ChatContainer.tsx +35 -23
- package/src/components/Comments.stories.tsx +39 -41
- package/src/components/CommentsContainer.tsx +7 -8
- package/src/components/CommentsThreadContainer.tsx +39 -33
- package/src/components/Lobby/Lobby.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +36 -28
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessageContainer.tsx +53 -17
- package/src/components/Participant/Participant.tsx +14 -8
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +8 -8
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +2 -2
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +45 -43
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +7 -4
- package/src/components/{ThreadComplementary.tsx → ThreadCompanion.tsx} +72 -35
- package/src/components/ThreadSettings.tsx +6 -7
- package/src/components/command-extension.ts +5 -2
- package/src/components/index.ts +4 -4
- package/src/components/testing.ts +26 -6
- package/src/extensions/threads.ts +31 -21
- package/src/functions/create-proposals.ts +56 -0
- package/src/functions/index.ts +5 -0
- package/src/hooks/analytics.ts +4 -7
- package/src/hooks/index.ts +3 -1
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/hooks/useVideoStreamTrack.tsx +6 -3
- package/src/meta.ts +9 -5
- package/src/testing/stories.ts +5 -8
- package/src/translations.ts +9 -4
- package/src/types/Channel.ts +26 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.ts +31 -30
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/typings.d.ts +8 -0
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-3GIE7ASU.mjs +0 -16
- package/dist/lib/browser/ChatContainer-AIGIWAUG.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs.map +0 -7
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
- package/dist/lib/browser/chunk-3SGRT4NM.mjs +0 -367
- package/dist/lib/browser/chunk-3SGRT4NM.mjs.map +0 -7
- package/dist/lib/browser/chunk-6NSMBO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERWASUQK.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-FR7KJPNY.mjs +0 -21
- package/dist/lib/browser/chunk-FR7KJPNY.mjs.map +0 -7
- package/dist/lib/browser/chunk-GCLD5ESP.mjs +0 -137
- package/dist/lib/browser/chunk-GCLD5ESP.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KWPRNHTK.mjs.map +0 -7
- package/dist/lib/browser/chunk-LGSDKXPF.mjs +0 -18
- package/dist/lib/browser/chunk-LGSDKXPF.mjs.map +0 -7
- package/dist/lib/browser/chunk-VUWC4IJM.mjs +0 -479
- package/dist/lib/browser/chunk-VUWC4IJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs.map +0 -7
- package/dist/lib/browser/markdown-M3FMR7OD.mjs.map +0 -7
- package/dist/lib/browser/react-root-JEUSQXI6.mjs +0 -28
- package/dist/lib/browser/react-root-JEUSQXI6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XWS6GIZY.mjs.map +0 -7
- package/dist/lib/browser/state-H6CYONWE.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-7FXCKO7X.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-IQUWU426.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-25ABSYP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CXOK2TD.mjs +0 -23
- package/dist/lib/node-esm/chunk-2CXOK2TD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MFNK53T.mjs +0 -480
- package/dist/lib/node-esm/chunk-2MFNK53T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs +0 -19
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C3XFMUAY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FLBFYGBK.mjs +0 -368
- package/dist/lib/node-esm/chunk-FLBFYGBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OU5BYIDO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TDFHTCZZ.mjs +0 -138
- package/dist/lib/node-esm/chunk-TDFHTCZZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-INKTE4MH.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-XYYY2JXZ.mjs +0 -29
- package/dist/lib/node-esm/react-root-XYYY2JXZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-MJ33KPYE.mjs.map +0 -7
- package/dist/lib/node-esm/state-D7WNDT3N.mjs.map +0 -7
- package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
- package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -162
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-3GIE7ASU.mjs.map → ChannelContainer-L7MKV7DS.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → ChatContainer-KPY4BAUE.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-7FXCKO7X.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → ChannelContainer-FYONOOZ6.mjs.map} +0 -0
|
@@ -2,28 +2,31 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { WebRTCStats } from '@peermetrics/webrtc-stats';
|
|
5
|
+
import { WebRTCStats, type WebRTCStatsEvent } from '@peermetrics/webrtc-stats';
|
|
6
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { truncateKey } from '@dxos/debug';
|
|
9
|
+
import { JsonView, Panel } from '@dxos/devtools';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
|
-
import {
|
|
11
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
11
|
+
import { IconButton, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
|
|
13
|
-
import { type GlobalState } from '../calls';
|
|
13
|
+
import { type EncodedTrackName, type GlobalState } from '../calls';
|
|
14
14
|
import { meta } from '../meta';
|
|
15
15
|
|
|
16
|
-
export type CallDebugPanelProps = ThemedClassName<{
|
|
17
|
-
state?: GlobalState;
|
|
18
|
-
}>;
|
|
16
|
+
export type CallDebugPanelProps = ThemedClassName<{ state?: GlobalState }>;
|
|
19
17
|
|
|
20
18
|
export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
21
19
|
const { t } = useTranslation(meta.id);
|
|
22
|
-
const users = state?.call?.users;
|
|
23
|
-
const self = state?.call?.self;
|
|
24
20
|
|
|
25
21
|
const [open, setOpen] = useState(false);
|
|
26
22
|
const handleToggle = () => setOpen(!open);
|
|
23
|
+
const [showServiceHistory, setShowServiceHistory] = useState(false);
|
|
24
|
+
const handleToggleServiceHistory = () => setShowServiceHistory(!showServiceHistory);
|
|
25
|
+
|
|
26
|
+
const handleCopyRaw = async () => {
|
|
27
|
+
await navigator.clipboard.writeText(JSON.stringify({ users: state?.call?.users, stats }, null, 2));
|
|
28
|
+
};
|
|
29
|
+
|
|
27
30
|
const [showDetailedWebRTCStats, setShowDetailedWebRTCStats] = useState(false);
|
|
28
31
|
const handleShowDetailedWebRTCStats = () => setShowDetailedWebRTCStats(!showDetailedWebRTCStats);
|
|
29
32
|
|
|
@@ -34,22 +37,24 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
34
37
|
}),
|
|
35
38
|
[],
|
|
36
39
|
);
|
|
40
|
+
const [stats, setStats] = useState<WebRTCStatsEvent['data']>();
|
|
37
41
|
|
|
38
|
-
const [stats, setStats] = useState<Record<string, any>>({});
|
|
39
42
|
useEffect(() => {
|
|
40
43
|
const pc = state?.media.peer?.session?.peerConnection;
|
|
41
|
-
const handleStats = (stats:
|
|
44
|
+
const handleStats = (stats: WebRTCStatsEvent) => {
|
|
45
|
+
setStats(stats.data);
|
|
46
|
+
};
|
|
42
47
|
let added = false;
|
|
43
48
|
if (pc && showDetailedWebRTCStats) {
|
|
44
49
|
webrtcStats.addConnection({ pc, peerId: 1, connectionId: '1' });
|
|
45
|
-
webrtcStats.on('stats', handleStats);
|
|
50
|
+
webrtcStats.on('stats', handleStats as never);
|
|
46
51
|
added = true;
|
|
47
52
|
}
|
|
48
53
|
return () => {
|
|
49
54
|
try {
|
|
50
55
|
if (pc && added) {
|
|
51
56
|
webrtcStats.removeConnection({ pc });
|
|
52
|
-
webrtcStats.removeListener('stats', handleStats);
|
|
57
|
+
webrtcStats.removeListener('stats', handleStats as never);
|
|
53
58
|
}
|
|
54
59
|
} catch (error) {
|
|
55
60
|
log.error('error removing webrtc stats', { error, pc, peerId: 1, connectionId: '1' });
|
|
@@ -57,6 +62,8 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
57
62
|
};
|
|
58
63
|
}, [state?.media.peer?.session?.peerConnection, showDetailedWebRTCStats]);
|
|
59
64
|
|
|
65
|
+
const rows = useMemo(() => getCallStatusTable(state), [state?.call.users, state?.media.pulledAudioTracks]);
|
|
66
|
+
|
|
60
67
|
return (
|
|
61
68
|
<Panel
|
|
62
69
|
id='meeting-status'
|
|
@@ -64,52 +71,102 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
64
71
|
open={open}
|
|
65
72
|
onToggle={handleToggle}
|
|
66
73
|
title={t('meeting status title')}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<div className='flex items-center gap-2'>
|
|
70
|
-
<span title='Joined'>{self?.joined ? 'Active' : 'Inactive'}</span>
|
|
71
|
-
{users?.length !== undefined && <span title='Users'>{users?.length ?? 0} User(s)</span>}
|
|
72
|
-
</div>
|
|
73
|
-
}
|
|
74
|
+
info={<div className='flex items-center gap-2'> {state?.call.joined ? 'Active' : 'Inactive'}</div>}
|
|
75
|
+
maxHeight={0}
|
|
74
76
|
>
|
|
75
|
-
<div className='flex flex-col
|
|
76
|
-
<div className='flex items-
|
|
77
|
+
<div className='flex flex-col is-full text-xs'>
|
|
78
|
+
<div className='flex items-center gap-2 items-center'>
|
|
77
79
|
<Input.Root>
|
|
78
|
-
<Input.
|
|
79
|
-
<Input.
|
|
80
|
+
<Input.Switch checked={showDetailedWebRTCStats} onCheckedChange={handleShowDetailedWebRTCStats} />
|
|
81
|
+
<Input.Label>{t('show webrtc stats title')}</Input.Label>
|
|
80
82
|
</Input.Root>
|
|
81
83
|
</div>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
: {}),
|
|
96
|
-
tracks: state?.media.peer?.session?.peerConnection.getTransceivers().map((transceiver) => {
|
|
97
|
-
const track =
|
|
98
|
-
transceiver.direction === 'recvonly' ? transceiver.receiver.track : transceiver.sender.track;
|
|
99
|
-
return {
|
|
100
|
-
id: track?.id,
|
|
101
|
-
kind: track?.kind,
|
|
102
|
-
direction: transceiver.direction,
|
|
103
|
-
enabled: track?.enabled,
|
|
104
|
-
muted: track?.muted,
|
|
105
|
-
readyState: track?.readyState,
|
|
106
|
-
settings: track?.getSettings(),
|
|
107
|
-
};
|
|
108
|
-
}),
|
|
109
|
-
callsServiceHistory: state?.media.peer?.history.get(),
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
84
|
+
<div className='flex items-center gap-2 items-center'>
|
|
85
|
+
<Input.Root>
|
|
86
|
+
<Input.Switch checked={showServiceHistory} onCheckedChange={handleToggleServiceHistory} />
|
|
87
|
+
<Input.Label>{t('show calls history title')}</Input.Label>
|
|
88
|
+
</Input.Root>
|
|
89
|
+
</div>
|
|
90
|
+
<div className='flex items-center gap-2 items-center'>
|
|
91
|
+
<IconButton icon='ph--copy--regular' label={'copy raw'} onClick={handleCopyRaw} />
|
|
92
|
+
</div>
|
|
93
|
+
<Table rows={rows} />
|
|
94
|
+
{showDetailedWebRTCStats && <JsonView data={{ stats }} />}
|
|
95
|
+
{showServiceHistory && <JsonView data={{ history: state?.media.peer?.history.get() }} />}
|
|
112
96
|
</div>
|
|
113
97
|
</Panel>
|
|
114
98
|
);
|
|
115
99
|
};
|
|
100
|
+
|
|
101
|
+
const getCallStatusTable = (state?: GlobalState): TableProps['rows'] => {
|
|
102
|
+
if (!state || !state.call?.users) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const self = state.call.self;
|
|
107
|
+
const users = state.call.users
|
|
108
|
+
.filter((user) => user.id !== self!.id)
|
|
109
|
+
.map((user) => {
|
|
110
|
+
const isOk = {
|
|
111
|
+
audio:
|
|
112
|
+
user.tracks?.audio &&
|
|
113
|
+
state.media.pulledAudioTracks[user.tracks?.audio as EncodedTrackName]?.ctx.disposed === false,
|
|
114
|
+
video:
|
|
115
|
+
user.tracks?.video &&
|
|
116
|
+
state.media.pulledVideoStreams[user.tracks?.video as EncodedTrackName]?.ctx.disposed === false,
|
|
117
|
+
screenshare:
|
|
118
|
+
user.tracks?.screenshare &&
|
|
119
|
+
state.media.pulledVideoStreams[user.tracks?.screenshare as EncodedTrackName]?.ctx.disposed === false,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
...user,
|
|
124
|
+
isOk,
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return [
|
|
129
|
+
['users', state.call.users.length ?? 0],
|
|
130
|
+
[
|
|
131
|
+
'*self* ' + (self?.name ?? truncateKey(self!.id, 8)),
|
|
132
|
+
self?.tracks?.audio && state.media.pushedAudioTrack ? 'AUD ✅' : 'AUD ❌',
|
|
133
|
+
self?.tracks?.video && state.media.pushedVideoTrack ? 'VID ✅' : 'VID ❌',
|
|
134
|
+
self?.tracks?.screenshareEnabled
|
|
135
|
+
? self.tracks.screenshareEnabled && state.media.pushedScreenshareTrack
|
|
136
|
+
? 'SCR ✅'
|
|
137
|
+
: 'SCR ❌'
|
|
138
|
+
: undefined,
|
|
139
|
+
],
|
|
140
|
+
|
|
141
|
+
...users.map((user) => [
|
|
142
|
+
user.name ?? truncateKey(user.id, 8),
|
|
143
|
+
user.isOk.audio ? 'AUD ✅' : 'AUD ❌',
|
|
144
|
+
user.isOk.video ? 'VID ✅' : 'VID ❌',
|
|
145
|
+
user.tracks?.screenshareEnabled ? (user.isOk.screenshare ? 'SCR ✅' : 'SCR ❌') : undefined,
|
|
146
|
+
]),
|
|
147
|
+
['ICE', state.media.peer?.session?.peerConnection.iceConnectionState ?? 'no connection'],
|
|
148
|
+
];
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export namespace Unit {
|
|
152
|
+
export const KB = (n?: number) => ((n ?? 0) / 1_000).toFixed(2);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type TableProps = {
|
|
156
|
+
rows: (string | number | undefined)[][];
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const Table = ({ rows }: TableProps) => {
|
|
160
|
+
return (
|
|
161
|
+
<div className='is-full text-xs font-mono'>
|
|
162
|
+
{rows.map(([prefix, label, value, unit], i) => (
|
|
163
|
+
<div key={i} className='grid grid-cols-[3fr_1fr_1fr_1fr]'>
|
|
164
|
+
<div className='p-1'>{prefix}</div>
|
|
165
|
+
<div className='p-1'>{label}</div>
|
|
166
|
+
<div className='p-1'>{value}</div>
|
|
167
|
+
<div className='p-1'>{unit}</div>
|
|
168
|
+
</div>
|
|
169
|
+
))}
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
8
|
|
|
9
|
-
import { ChannelContainer } from './ChannelContainer';
|
|
10
9
|
import { ThreadCapabilities } from '../capabilities';
|
|
11
10
|
|
|
11
|
+
import { ChannelContainer } from './ChannelContainer';
|
|
12
|
+
|
|
12
13
|
export const CallSidebar = () => {
|
|
13
14
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
14
15
|
return <ChannelContainer roomId={call.roomId} />;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
@@ -11,18 +9,20 @@ import { contributes } from '@dxos/app-framework';
|
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
10
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
13
11
|
import { Query, useQuery, useSpace } from '@dxos/react-client/echo';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
|
+
import { render } from '@dxos/storybook-utils';
|
|
14
|
+
import { Message, Thread } from '@dxos/types';
|
|
16
15
|
|
|
17
|
-
import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
|
|
18
16
|
import { createThreadPlugins } from '../testing';
|
|
19
17
|
import { translations } from '../translations';
|
|
20
|
-
import {
|
|
18
|
+
import { Channel } from '../types';
|
|
19
|
+
|
|
20
|
+
import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
|
|
21
21
|
|
|
22
22
|
// TODO(wittjosiah): Channel doesn't render full height.
|
|
23
|
-
const
|
|
23
|
+
const DefaultStory = ({ roomId }: ChannelContainerProps) => {
|
|
24
24
|
const space = useSpace();
|
|
25
|
-
const [channel] = useQuery(space, Query.type(
|
|
25
|
+
const [channel] = useQuery(space, Query.type(Channel.Channel));
|
|
26
26
|
if (!channel) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
@@ -30,25 +30,26 @@ const Story = ({ roomId }: ChannelContainerProps) => {
|
|
|
30
30
|
return <ChannelContainer channel={channel} roomId={roomId} />;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const meta
|
|
33
|
+
const meta = {
|
|
34
34
|
title: 'plugins/plugin-thread/ChannelContainer',
|
|
35
35
|
component: ChannelContainer,
|
|
36
|
-
render: (
|
|
36
|
+
render: render(DefaultStory),
|
|
37
37
|
decorators: [
|
|
38
|
+
withTheme,
|
|
39
|
+
withLayout({ container: 'column' }),
|
|
38
40
|
withPluginManager({
|
|
39
41
|
plugins: [...(await createThreadPlugins())],
|
|
40
|
-
capabilities: [contributes(ClientCapabilities.Schema, [
|
|
42
|
+
capabilities: [contributes(ClientCapabilities.Schema, [Channel.Channel, Thread.Thread, Message.Message])],
|
|
41
43
|
}),
|
|
42
|
-
withLayout({ Container: ColumnContainer, classNames: 'w-[40rem] overflow-hidden' }),
|
|
43
44
|
],
|
|
44
45
|
parameters: {
|
|
45
46
|
translations,
|
|
46
47
|
},
|
|
47
|
-
}
|
|
48
|
+
} satisfies Meta<typeof ChannelContainer>;
|
|
48
49
|
|
|
49
50
|
export default meta;
|
|
50
51
|
|
|
51
|
-
type Story = StoryObj<
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
52
53
|
|
|
53
54
|
export const Default: Story = {
|
|
54
55
|
args: {
|
|
@@ -2,30 +2,34 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useCapabilities, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { useCapabilities, useCapability } from '@dxos/app-framework/react';
|
|
9
9
|
import { Context } from '@dxos/context';
|
|
10
10
|
import { failUndefined } from '@dxos/debug';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
import { useClient } from '@dxos/react-client';
|
|
13
|
-
import {
|
|
14
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
14
15
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
|
-
import {
|
|
16
|
-
import { ControlGroup,
|
|
17
|
-
import {
|
|
16
|
+
import { ElevationProvider, Input, useTranslation } from '@dxos/react-ui';
|
|
17
|
+
import { ControlGroup, ControlGroupButton, ControlItemInput } from '@dxos/react-ui-form';
|
|
18
|
+
import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
18
19
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
19
20
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
20
21
|
|
|
21
|
-
import { Call } from './Call';
|
|
22
|
-
import ChatContainer from './ChatContainer';
|
|
23
22
|
import { ThreadCapabilities } from '../capabilities';
|
|
24
23
|
import { meta } from '../meta';
|
|
25
|
-
import { type
|
|
24
|
+
import { type Channel } from '../types';
|
|
25
|
+
|
|
26
|
+
import { Call } from './Call';
|
|
27
|
+
import ChatContainer from './ChatContainer';
|
|
28
|
+
|
|
29
|
+
// TODO(burdon): Create Radix style layout.
|
|
26
30
|
|
|
27
31
|
export type ChannelContainerProps = {
|
|
28
|
-
channel?:
|
|
32
|
+
channel?: Channel.Channel;
|
|
29
33
|
roomId?: string;
|
|
30
34
|
role?: string;
|
|
31
35
|
fullscreen?: boolean;
|
|
@@ -37,7 +41,8 @@ export type ChannelContainerProps = {
|
|
|
37
41
|
export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
|
|
38
42
|
const space = getSpace(channel);
|
|
39
43
|
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
40
|
-
const
|
|
44
|
+
const attendableId = channel ? Obj.getDXN(channel).toString() : undefined;
|
|
45
|
+
const roomId = _roomId ?? attendableId ?? failUndefined();
|
|
41
46
|
const identity = useIdentity();
|
|
42
47
|
const isNamed = !!identity?.profile?.displayName;
|
|
43
48
|
const joinSound = useSoundEffect('JoinCall');
|
|
@@ -113,7 +118,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
113
118
|
const isJoined = callManager.joined && callManager.roomId === roomId;
|
|
114
119
|
|
|
115
120
|
return (
|
|
116
|
-
<StackItem.Content
|
|
121
|
+
<StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
|
|
117
122
|
{isJoined && !isNamed && <DisplayNameMissing />}
|
|
118
123
|
{isJoined && isNamed && (
|
|
119
124
|
<Call.Root>
|
|
@@ -123,8 +128,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
123
128
|
)}
|
|
124
129
|
{!isJoined && channel && channel.defaultThread.target && space && (
|
|
125
130
|
<>
|
|
126
|
-
<ChannelToolbar attendableId={
|
|
127
|
-
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
131
|
+
<ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
|
|
132
|
+
<ChatContainer space={space} thread={channel.defaultThread.target} classNames='container-max-width' />
|
|
128
133
|
</>
|
|
129
134
|
)}
|
|
130
135
|
</StackItem.Content>
|
|
@@ -160,7 +165,7 @@ const DisplayNameMissing = () => {
|
|
|
160
165
|
const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
161
166
|
const creator = useMemo(
|
|
162
167
|
() =>
|
|
163
|
-
|
|
168
|
+
Atom.make(() => {
|
|
164
169
|
return {
|
|
165
170
|
nodes: [
|
|
166
171
|
createMenuItemGroup('root', {
|
|
@@ -181,19 +186,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
|
181
186
|
return useMenuActions(creator);
|
|
182
187
|
};
|
|
183
188
|
|
|
184
|
-
type ChannelToolbarProps =
|
|
189
|
+
type ChannelToolbarProps = {
|
|
185
190
|
attendableId?: string;
|
|
186
191
|
role?: string;
|
|
187
192
|
onJoinCall?: () => void;
|
|
188
|
-
}
|
|
193
|
+
};
|
|
189
194
|
|
|
190
|
-
const ChannelToolbar = ({ attendableId, role, onJoinCall
|
|
195
|
+
const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
|
|
191
196
|
const menuProps = useChannelToolbarActions(onJoinCall);
|
|
192
197
|
|
|
193
198
|
return (
|
|
194
199
|
<ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
|
|
195
200
|
<MenuProvider {...menuProps} attendableId={attendableId}>
|
|
196
|
-
<ToolbarMenu
|
|
201
|
+
<ToolbarMenu textBlockWidth />
|
|
197
202
|
</MenuProvider>
|
|
198
203
|
</ElevationProvider>
|
|
199
204
|
);
|
|
@@ -2,48 +2,41 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import React, { useEffect, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, contributes, createSurface, IntentPlugin } from '@dxos/app-framework';
|
|
8
|
+
import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
13
10
|
import { faker } from '@dxos/random';
|
|
14
11
|
import { useClient } from '@dxos/react-client';
|
|
15
12
|
import { type Space } from '@dxos/react-client/echo';
|
|
16
13
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
14
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
|
+
import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
18
|
+
import { render } from '@dxos/storybook-utils';
|
|
19
|
+
import { Message, Thread } from '@dxos/types';
|
|
21
20
|
|
|
22
|
-
import { ChatContainer } from './ChatContainer';
|
|
23
21
|
import { translations } from '../translations';
|
|
24
|
-
import {
|
|
22
|
+
import { Channel } from '../types';
|
|
23
|
+
|
|
24
|
+
import { ChatContainer } from './ChatContainer';
|
|
25
25
|
|
|
26
26
|
faker.seed(1);
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const DefaultStory = () => {
|
|
29
29
|
const client = useClient();
|
|
30
30
|
const identity = useIdentity();
|
|
31
31
|
const [space, setSpace] = useState<Space>();
|
|
32
|
-
const [channel, setChannel] = useState<
|
|
32
|
+
const [channel, setChannel] = useState<Channel.Channel | null>();
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
useAsyncEffect(async () => {
|
|
35
35
|
if (identity) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
41
|
-
threads: [],
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
setSpace(space);
|
|
45
|
-
setChannel(channel);
|
|
46
|
-
});
|
|
36
|
+
const space = await client.spaces.create();
|
|
37
|
+
const channel = space.db.add(Channel.make());
|
|
38
|
+
setSpace(space);
|
|
39
|
+
setChannel(channel);
|
|
47
40
|
}
|
|
48
41
|
}, [identity]);
|
|
49
42
|
|
|
@@ -52,19 +45,18 @@ const Story = () => {
|
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
return (
|
|
55
|
-
<main className='max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
48
|
+
<main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
56
49
|
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
57
50
|
</main>
|
|
58
51
|
);
|
|
59
52
|
};
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const meta: Meta<typeof Thread.Root> = {
|
|
54
|
+
const meta = {
|
|
64
55
|
title: 'plugins/plugin-thread/Chat',
|
|
65
|
-
component:
|
|
66
|
-
render: ()
|
|
56
|
+
component: ThreadComponent.Root as any,
|
|
57
|
+
render: render(DefaultStory),
|
|
67
58
|
decorators: [
|
|
59
|
+
withTheme,
|
|
68
60
|
withPluginManager({
|
|
69
61
|
plugins: [IntentPlugin()],
|
|
70
62
|
capabilities: [
|
|
@@ -78,11 +70,16 @@ const meta: Meta<typeof Thread.Root> = {
|
|
|
78
70
|
),
|
|
79
71
|
],
|
|
80
72
|
}),
|
|
81
|
-
|
|
82
|
-
withLayout({ fullscreen: true }),
|
|
83
|
-
withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
|
|
73
|
+
withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
|
|
84
74
|
],
|
|
85
|
-
parameters: {
|
|
86
|
-
|
|
75
|
+
parameters: {
|
|
76
|
+
layout: 'fullscreen',
|
|
77
|
+
translations,
|
|
78
|
+
},
|
|
79
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
87
80
|
|
|
88
81
|
export default meta;
|
|
82
|
+
|
|
83
|
+
type Story = StoryObj<typeof meta>;
|
|
84
|
+
|
|
85
|
+
export const Default: Story = {};
|
|
@@ -5,29 +5,29 @@
|
|
|
5
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
12
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
13
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
14
|
import {
|
|
15
15
|
MessageTextbox,
|
|
16
16
|
type MessageTextboxProps,
|
|
17
|
-
Thread,
|
|
17
|
+
Thread as ThreadComponent,
|
|
18
18
|
type ThreadRootProps,
|
|
19
19
|
threadLayout,
|
|
20
20
|
} from '@dxos/react-ui-thread';
|
|
21
|
-
import {
|
|
21
|
+
import { Message, type Thread } from '@dxos/types';
|
|
22
22
|
import { isNonNullable } from '@dxos/util';
|
|
23
23
|
|
|
24
|
-
import { MessageContainer } from './MessageContainer';
|
|
25
|
-
import { command } from './command-extension';
|
|
26
24
|
import { useStatus } from '../hooks';
|
|
27
25
|
import { meta } from '../meta';
|
|
28
|
-
import { type ThreadType } from '../types';
|
|
29
26
|
import { getMessageMetadata } from '../util';
|
|
30
27
|
|
|
28
|
+
import { command } from './command-extension';
|
|
29
|
+
import { MessageContainer } from './MessageContainer';
|
|
30
|
+
|
|
31
31
|
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
32
32
|
const { t } = useTranslation(meta.id);
|
|
33
33
|
return (
|
|
@@ -40,16 +40,25 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export type ChatContainerProps =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
export type ChatContainerProps = ThemedClassName<
|
|
44
|
+
{
|
|
45
|
+
space: Space;
|
|
46
|
+
thread: Thread.Thread;
|
|
47
|
+
context?: Obj.Any;
|
|
48
|
+
autoFocusTextbox?: boolean;
|
|
49
|
+
} & Pick<ThreadRootProps, 'current'>
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
export const ChatContainer = ({
|
|
53
|
+
classNames,
|
|
54
|
+
space,
|
|
55
|
+
thread,
|
|
56
|
+
context,
|
|
57
|
+
current,
|
|
58
|
+
autoFocusTextbox,
|
|
59
|
+
}: ChatContainerProps) => {
|
|
51
60
|
const { t } = useTranslation(meta.id);
|
|
52
|
-
const id =
|
|
61
|
+
const id = Obj.getDXN(thread).toString();
|
|
53
62
|
const identity = useIdentity()!;
|
|
54
63
|
const members = useMembers(space?.key);
|
|
55
64
|
const activity = useStatus(space, id);
|
|
@@ -66,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
66
75
|
() => [
|
|
67
76
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
68
77
|
createThemeExtensions({ themeMode }),
|
|
69
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
78
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
70
79
|
command,
|
|
71
80
|
],
|
|
72
81
|
[themeMode, _count],
|
|
@@ -91,7 +100,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
91
100
|
|
|
92
101
|
thread.messages.push(
|
|
93
102
|
Ref.make(
|
|
94
|
-
Obj.make(
|
|
103
|
+
Obj.make(Message.Message, {
|
|
95
104
|
created: new Date().toISOString(),
|
|
96
105
|
sender: { identityDid: identity.did },
|
|
97
106
|
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
@@ -108,10 +117,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
108
117
|
};
|
|
109
118
|
|
|
110
119
|
return (
|
|
111
|
-
<
|
|
120
|
+
<ThreadComponent.Root
|
|
112
121
|
current={current}
|
|
113
122
|
id={id}
|
|
114
|
-
classNames=
|
|
123
|
+
classNames={[
|
|
124
|
+
'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
125
|
+
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
126
|
+
classNames,
|
|
127
|
+
]}
|
|
115
128
|
>
|
|
116
129
|
<ScrollArea.Root classNames='col-span-2'>
|
|
117
130
|
<ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>
|
|
@@ -132,9 +145,8 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
132
145
|
</ScrollArea.Root>
|
|
133
146
|
|
|
134
147
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</Thread.Root>
|
|
148
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
149
|
+
</ThreadComponent.Root>
|
|
138
150
|
);
|
|
139
151
|
};
|
|
140
152
|
|