@dxos/plugin-thread 0.8.4-main.67995b8 → 0.8.4-main.70d3990
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,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React, { useEffect } from 'react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
@@ -14,42 +12,42 @@ import { ClientPlugin } from '@dxos/plugin-client';
|
|
|
14
12
|
import { faker } from '@dxos/random';
|
|
15
13
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
16
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
15
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
+
import { render } from '@dxos/storybook-utils';
|
|
18
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
19
19
|
|
|
20
|
-
import { CommentsContainer } from './CommentsContainer';
|
|
21
|
-
import { createCommentThread } from './testing';
|
|
22
20
|
import { translations } from '../translations';
|
|
23
|
-
|
|
21
|
+
|
|
22
|
+
import { CommentsContainer } from './CommentsContainer';
|
|
23
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
24
24
|
|
|
25
25
|
faker.seed(1);
|
|
26
26
|
|
|
27
27
|
const DefaultStory = () => {
|
|
28
28
|
const identity = useIdentity();
|
|
29
29
|
const space = useSpace();
|
|
30
|
-
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
30
|
+
const anchors = useQuery(space, Query.type(AnchoredTo.AnchoredTo));
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
useAsyncEffect(async () => {
|
|
33
33
|
if (identity && space) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Relation.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return () => clearTimeout(t);
|
|
34
|
+
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
35
|
+
const thread1 = space.db.add(createCommentThread(identity));
|
|
36
|
+
const thread2 = space.db.add(createProposalThread(identity));
|
|
37
|
+
space.db.add(
|
|
38
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
39
|
+
[Relation.Source]: thread1,
|
|
40
|
+
[Relation.Target]: object,
|
|
41
|
+
anchor: 'test',
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
space.db.add(
|
|
45
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
46
|
+
[Relation.Source]: thread2,
|
|
47
|
+
[Relation.Target]: object,
|
|
48
|
+
anchor: 'test',
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
53
51
|
}
|
|
54
52
|
}, [identity, space]);
|
|
55
53
|
|
|
@@ -57,25 +55,23 @@ const DefaultStory = () => {
|
|
|
57
55
|
return null;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
return
|
|
61
|
-
<div className='w-[30rem] overflow-y-auto bg-baseSurface'>
|
|
62
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
58
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
65
59
|
};
|
|
66
60
|
|
|
67
|
-
const meta
|
|
61
|
+
const meta = {
|
|
68
62
|
title: 'plugins/plugin-thread/Comments',
|
|
69
63
|
render: render(DefaultStory),
|
|
70
64
|
decorators: [
|
|
71
65
|
withTheme,
|
|
72
|
-
withLayout({
|
|
66
|
+
withLayout({ container: 'column', scroll: true }),
|
|
67
|
+
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
68
|
+
// Currently this is required due to useOnEditAnalytics.
|
|
73
69
|
withPluginManager({
|
|
74
70
|
plugins: [
|
|
75
71
|
IntentPlugin(),
|
|
76
72
|
ClientPlugin({
|
|
77
|
-
types: [
|
|
78
|
-
onClientInitialized: async (
|
|
73
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
74
|
+
onClientInitialized: async ({ client }) => {
|
|
79
75
|
await client.halo.createIdentity();
|
|
80
76
|
},
|
|
81
77
|
}),
|
|
@@ -85,8 +81,10 @@ const meta: Meta = {
|
|
|
85
81
|
parameters: {
|
|
86
82
|
translations,
|
|
87
83
|
},
|
|
88
|
-
}
|
|
84
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
89
85
|
|
|
90
86
|
export default meta;
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
type Story = StoryObj<typeof meta>;
|
|
89
|
+
|
|
90
|
+
export const Default: Story = {};
|
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
7
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
9
8
|
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/
|
|
9
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
11
10
|
|
|
12
|
-
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
13
11
|
import { meta } from '../meta';
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
15
14
|
|
|
16
15
|
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
17
|
-
anchors: AnchoredTo[];
|
|
16
|
+
anchors: AnchoredTo.AnchoredTo[];
|
|
18
17
|
currentId?: string;
|
|
19
18
|
showResolvedThreads?: boolean;
|
|
20
19
|
};
|
|
@@ -62,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
62
61
|
return (
|
|
63
62
|
<div>
|
|
64
63
|
{filteredAnchors.map((anchor) => {
|
|
65
|
-
const thread = Relation.getSource(anchor) as
|
|
66
|
-
const threadId =
|
|
64
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
65
|
+
const threadId = Obj.getDXN(thread).toString();
|
|
67
66
|
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
68
67
|
})}
|
|
69
68
|
</div>
|
|
@@ -4,33 +4,36 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Ref, Relation } from '@dxos/echo';
|
|
8
|
-
import {
|
|
7
|
+
import { Obj, Ref, Relation } from '@dxos/echo';
|
|
8
|
+
import { getSpace, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
10
|
import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
12
|
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
MessageTextbox,
|
|
15
|
+
type MessageTextboxProps,
|
|
16
|
+
Thread as ThreadComponent,
|
|
17
|
+
type ThreadRootProps,
|
|
18
|
+
} from '@dxos/react-ui-thread';
|
|
19
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
15
20
|
import { isNonNullable } from '@dxos/util';
|
|
16
21
|
|
|
17
|
-
import { MessageContainer } from './MessageContainer';
|
|
18
|
-
import { command } from './command-extension';
|
|
19
22
|
import { useStatus } from '../hooks';
|
|
20
23
|
import { meta } from '../meta';
|
|
21
|
-
import { type ThreadType } from '../types';
|
|
22
24
|
import { getMessageMetadata } from '../util';
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
import { command } from './command-extension';
|
|
27
|
+
import { MessageContainer, buttonClassNames, buttonGroupClassNames } from './MessageContainer';
|
|
26
28
|
|
|
27
29
|
export type CommentsThreadContainerProps = {
|
|
28
|
-
anchor: AnchoredTo;
|
|
29
|
-
onAttend?: (anchor: AnchoredTo) => void;
|
|
30
|
-
onComment?: (anchor: AnchoredTo, message: string) => void;
|
|
31
|
-
onResolve?: (anchor: AnchoredTo) => void;
|
|
32
|
-
onMessageDelete?: (anchor: AnchoredTo, messageId: string) => void;
|
|
33
|
-
onThreadDelete?: (anchor: AnchoredTo) => void;
|
|
30
|
+
anchor: AnchoredTo.AnchoredTo;
|
|
31
|
+
onAttend?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
32
|
+
onComment?: (anchor: AnchoredTo.AnchoredTo, message: string) => void;
|
|
33
|
+
onResolve?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
34
|
+
onMessageDelete?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
|
|
35
|
+
onThreadDelete?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
36
|
+
onAcceptProposal?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
|
|
34
37
|
} & Pick<ThreadRootProps, 'current'>;
|
|
35
38
|
|
|
36
39
|
export const CommentsThreadContainer = ({
|
|
@@ -41,30 +44,31 @@ export const CommentsThreadContainer = ({
|
|
|
41
44
|
onResolve,
|
|
42
45
|
onMessageDelete,
|
|
43
46
|
onThreadDelete,
|
|
47
|
+
onAcceptProposal,
|
|
44
48
|
}: CommentsThreadContainerProps) => {
|
|
49
|
+
const { themeMode } = useThemeContext();
|
|
45
50
|
const { t } = useTranslation(meta.id);
|
|
46
51
|
const identity = useIdentity()!;
|
|
47
52
|
const space = getSpace(anchor);
|
|
48
53
|
const members = useMembers(space?.key);
|
|
49
54
|
const detached = !anchor.anchor;
|
|
50
|
-
const thread = Relation.getSource(anchor) as
|
|
51
|
-
const activity = useStatus(space,
|
|
55
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
56
|
+
const activity = useStatus(space, Obj.getDXN(thread).toString());
|
|
52
57
|
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
53
|
-
const { themeMode } = useThemeContext();
|
|
54
58
|
|
|
55
|
-
const textboxMetadata = getMessageMetadata(
|
|
59
|
+
const textboxMetadata = getMessageMetadata(Obj.getDXN(thread).toString(), identity);
|
|
60
|
+
|
|
56
61
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
57
|
-
const [
|
|
58
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
62
|
+
const [state, setState] = useState({});
|
|
59
63
|
const messageRef = useRef('');
|
|
60
64
|
const extensions = useMemo(
|
|
61
65
|
() => [
|
|
62
66
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
63
67
|
createThemeExtensions({ themeMode }),
|
|
64
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
68
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
65
69
|
command,
|
|
66
70
|
],
|
|
67
|
-
[
|
|
71
|
+
[state],
|
|
68
72
|
);
|
|
69
73
|
|
|
70
74
|
// TODO(thure): Factor out.
|
|
@@ -75,6 +79,7 @@ export const CommentsThreadContainer = ({
|
|
|
75
79
|
const handleResolve = useCallback(() => onResolve?.(anchor), [onResolve, anchor]);
|
|
76
80
|
const handleMessageDelete = useCallback((id: string) => onMessageDelete?.(anchor, id), [onMessageDelete, anchor]);
|
|
77
81
|
const handleThreadDelete = useCallback(() => onThreadDelete?.(anchor), [onThreadDelete, anchor]);
|
|
82
|
+
const handleAcceptProposal = useCallback((id: string) => onAcceptProposal?.(anchor, id), [onAcceptProposal, anchor]);
|
|
78
83
|
|
|
79
84
|
const handleComment: MessageTextboxProps['onSend'] = useCallback(() => {
|
|
80
85
|
if (!messageRef.current) {
|
|
@@ -84,14 +89,14 @@ export const CommentsThreadContainer = ({
|
|
|
84
89
|
onComment?.(anchor, messageRef.current);
|
|
85
90
|
messageRef.current = '';
|
|
86
91
|
scrollToEnd('instant');
|
|
87
|
-
|
|
92
|
+
setState({});
|
|
88
93
|
|
|
89
94
|
return true;
|
|
90
95
|
}, [anchor, identity]);
|
|
91
96
|
|
|
92
97
|
return (
|
|
93
|
-
<
|
|
94
|
-
id={
|
|
98
|
+
<ThreadComponent.Root
|
|
99
|
+
id={Obj.getDXN(thread).toString()}
|
|
95
100
|
classNames='pbs-2 border-be border-subduedSeparator last:border-none'
|
|
96
101
|
current={current}
|
|
97
102
|
onClickCapture={handleAttend}
|
|
@@ -107,12 +112,12 @@ export const CommentsThreadContainer = ({
|
|
|
107
112
|
>
|
|
108
113
|
{detached ? (
|
|
109
114
|
<Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
|
|
110
|
-
<
|
|
115
|
+
<ThreadComponent.Header detached>{thread.name}</ThreadComponent.Header>
|
|
111
116
|
</Tooltip.Trigger>
|
|
112
117
|
) : (
|
|
113
|
-
<
|
|
118
|
+
<ThreadComponent.Header>{thread.name}</ThreadComponent.Header>
|
|
114
119
|
)}
|
|
115
|
-
<div
|
|
120
|
+
<div role='none' className={buttonGroupClassNames}>
|
|
116
121
|
{thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
|
|
117
122
|
{onResolve && !(thread?.status === 'staged') && (
|
|
118
123
|
<IconButton
|
|
@@ -121,7 +126,7 @@ export const CommentsThreadContainer = ({
|
|
|
121
126
|
icon={thread?.status === 'resolved' ? 'ph--check--fill' : 'ph--check--regular'}
|
|
122
127
|
iconOnly
|
|
123
128
|
label={t('resolve thread label')}
|
|
124
|
-
classNames={[
|
|
129
|
+
classNames={[buttonClassNames, thread?.status !== 'resolved' && hoverableControlItem]}
|
|
125
130
|
onClick={handleResolve}
|
|
126
131
|
/>
|
|
127
132
|
)}
|
|
@@ -132,7 +137,7 @@ export const CommentsThreadContainer = ({
|
|
|
132
137
|
icon='ph--x--regular'
|
|
133
138
|
iconOnly
|
|
134
139
|
label={t('delete thread label')}
|
|
135
|
-
classNames={[
|
|
140
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
136
141
|
onClick={handleThreadDelete}
|
|
137
142
|
/>
|
|
138
143
|
)}
|
|
@@ -147,6 +152,7 @@ export const CommentsThreadContainer = ({
|
|
|
147
152
|
message={message}
|
|
148
153
|
members={members}
|
|
149
154
|
onDelete={handleMessageDelete}
|
|
155
|
+
onAcceptProposal={handleAcceptProposal}
|
|
150
156
|
/>
|
|
151
157
|
))}
|
|
152
158
|
|
|
@@ -158,10 +164,10 @@ export const CommentsThreadContainer = ({
|
|
|
158
164
|
*/}
|
|
159
165
|
<MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
|
|
160
166
|
|
|
161
|
-
<
|
|
167
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
162
168
|
|
|
163
169
|
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
164
170
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
165
|
-
</
|
|
171
|
+
</ThreadComponent.Root>
|
|
166
172
|
);
|
|
167
173
|
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
|
+
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
11
|
import { ThreadCapabilities } from '../../capabilities';
|
|
@@ -2,47 +2,55 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { scheduleTask } from '@dxos/async';
|
|
11
9
|
import { Context } from '@dxos/context';
|
|
12
10
|
import { log } from '@dxos/log';
|
|
13
|
-
import { withTheme
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
|
|
15
|
-
import { VideoObject } from './VideoObject';
|
|
16
13
|
import { getUserMediaTrack } from '../../calls';
|
|
17
14
|
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
render
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
import { VideoObject, type VideoObjectProps } from './VideoObject';
|
|
17
|
+
|
|
18
|
+
const DefaultStory = (props: VideoObjectProps) => {
|
|
19
|
+
log.info('render');
|
|
20
|
+
const [videoStream, setVideoStream] = useState<MediaStream>();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const ctx = new Context();
|
|
23
|
+
scheduleTask(ctx, async () => {
|
|
24
|
+
try {
|
|
28
25
|
const stream = new MediaStream();
|
|
29
26
|
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
30
27
|
setVideoStream(stream);
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
} catch (err) {
|
|
29
|
+
log.catch(err);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
void ctx.dispose();
|
|
35
|
+
videoStream?.getTracks().forEach((track) => track.stop());
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<ResponsiveContainer>
|
|
41
|
+
<VideoObject videoStream={videoStream} flip {...props} />
|
|
42
|
+
</ResponsiveContainer>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const meta = {
|
|
47
|
+
title: 'plugins/plugin-thread/VideoObject',
|
|
48
|
+
component: VideoObject,
|
|
49
|
+
render: DefaultStory,
|
|
50
|
+
decorators: [withTheme],
|
|
51
|
+
parameters: {
|
|
52
|
+
layout: 'fullscreen',
|
|
44
53
|
},
|
|
45
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
|
|
46
54
|
};
|
|
47
55
|
|
|
48
56
|
export default meta;
|
|
@@ -3,33 +3,45 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { EditorView } from '@codemirror/view';
|
|
6
|
+
import type * as Schema from 'effect/Schema';
|
|
6
7
|
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
8
|
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { type Obj, Ref
|
|
9
|
+
import { Surface } from '@dxos/app-framework/react';
|
|
10
|
+
import { type Obj, Ref } from '@dxos/echo';
|
|
10
11
|
import { PublicKey } from '@dxos/react-client';
|
|
11
12
|
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
12
|
-
import {
|
|
13
|
+
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
13
14
|
import { IconButton, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
14
15
|
import { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';
|
|
15
16
|
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
16
17
|
import { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';
|
|
17
|
-
import { type
|
|
18
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
18
19
|
|
|
19
|
-
import { commentControlClassNames } from './CommentsThreadContainer';
|
|
20
|
-
import { command } from './command-extension';
|
|
21
20
|
import { useOnEditAnalytics } from '../hooks';
|
|
22
21
|
import { meta } from '../meta';
|
|
23
22
|
import { getMessageMetadata } from '../util';
|
|
24
23
|
|
|
24
|
+
import { command } from './command-extension';
|
|
25
|
+
|
|
26
|
+
export const buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pie-2';
|
|
27
|
+
export const buttonClassNames = '!p-1 transition-opacity';
|
|
28
|
+
|
|
25
29
|
export type MessageContainerProps = {
|
|
26
|
-
|
|
30
|
+
// TODO(wittjosiah): Find a simpler way to define this type.
|
|
31
|
+
message: Obj.Obj<Schema.Schema.Type<typeof Message.Message>>;
|
|
27
32
|
members: SpaceMember[];
|
|
28
33
|
editable?: boolean;
|
|
29
34
|
onDelete?: (id: string) => void;
|
|
35
|
+
onAcceptProposal?: (id: string) => void;
|
|
30
36
|
};
|
|
31
37
|
|
|
32
|
-
export const MessageContainer = ({
|
|
38
|
+
export const MessageContainer = ({
|
|
39
|
+
message,
|
|
40
|
+
members,
|
|
41
|
+
editable = false,
|
|
42
|
+
onDelete,
|
|
43
|
+
onAcceptProposal,
|
|
44
|
+
}: MessageContainerProps) => {
|
|
33
45
|
const { t } = useTranslation(meta.id);
|
|
34
46
|
const senderIdentity = members.find(
|
|
35
47
|
(member) =>
|
|
@@ -39,8 +51,11 @@ export const MessageContainer = ({ message, members, editable = false, onDelete
|
|
|
39
51
|
const messageMetadata = getMessageMetadata(message.id, senderIdentity);
|
|
40
52
|
const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;
|
|
41
53
|
const [editing, setEditing] = useState(false);
|
|
54
|
+
const handleEdit = useCallback(() => setEditing((editing) => !editing), []);
|
|
42
55
|
const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);
|
|
56
|
+
const handleAcceptProposal = useCallback(() => onAcceptProposal?.(message.id), [message, onAcceptProposal]);
|
|
43
57
|
const textBlock = message.blocks.find((block) => block._tag === 'text');
|
|
58
|
+
const proposalBlock = message.blocks.find((block) => block._tag === 'proposal');
|
|
44
59
|
const references = message.blocks.filter((block) => block._tag === 'reference').map((block) => block.reference);
|
|
45
60
|
|
|
46
61
|
useOnEditAnalytics(message, textBlock, !!editing);
|
|
@@ -48,7 +63,7 @@ export const MessageContainer = ({ message, members, editable = false, onDelete
|
|
|
48
63
|
return (
|
|
49
64
|
<MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>
|
|
50
65
|
<MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>
|
|
51
|
-
<div
|
|
66
|
+
<div role='none' className={buttonGroupClassNames}>
|
|
52
67
|
{userIsAuthor && editable && (
|
|
53
68
|
<IconButton
|
|
54
69
|
data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}
|
|
@@ -56,8 +71,20 @@ export const MessageContainer = ({ message, members, editable = false, onDelete
|
|
|
56
71
|
icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}
|
|
57
72
|
iconOnly
|
|
58
73
|
label={t(editing ? 'save message label' : 'edit message label')}
|
|
59
|
-
classNames={[
|
|
60
|
-
onClick={
|
|
74
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
75
|
+
onClick={handleEdit}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
{/* TODO(wittjosiah): Proposal controls should probably be hoisted to thread level. */}
|
|
79
|
+
{proposalBlock && onAcceptProposal && (
|
|
80
|
+
<IconButton
|
|
81
|
+
data-testid='thread.message.accept'
|
|
82
|
+
variant='ghost'
|
|
83
|
+
icon='ph--check--regular'
|
|
84
|
+
iconOnly
|
|
85
|
+
label={t('accept proposal label')}
|
|
86
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
87
|
+
onClick={handleAcceptProposal}
|
|
61
88
|
/>
|
|
62
89
|
)}
|
|
63
90
|
{onDelete && (
|
|
@@ -67,21 +94,22 @@ export const MessageContainer = ({ message, members, editable = false, onDelete
|
|
|
67
94
|
icon='ph--x--regular'
|
|
68
95
|
iconOnly
|
|
69
96
|
label={t('delete message label')}
|
|
70
|
-
classNames={[
|
|
71
|
-
onClick={
|
|
97
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
98
|
+
onClick={handleDelete}
|
|
72
99
|
/>
|
|
73
100
|
)}
|
|
74
101
|
</div>
|
|
75
102
|
</MessageHeading>
|
|
76
103
|
{textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}
|
|
104
|
+
{proposalBlock && <ProposalBlock block={proposalBlock} />}
|
|
77
105
|
{Ref.Array.targets(references).map((reference, index) => (
|
|
78
|
-
<MessagePart key={index} part={reference} />
|
|
106
|
+
<MessagePart key={index} part={reference as Obj.Any} />
|
|
79
107
|
))}
|
|
80
108
|
</MessageRoot>
|
|
81
109
|
);
|
|
82
110
|
};
|
|
83
111
|
|
|
84
|
-
const MessagePart = ({ part }: { part:
|
|
112
|
+
const MessagePart = ({ part }: { part: Obj.Any }) => {
|
|
85
113
|
return <MessageBlockObjectTile subject={part} />;
|
|
86
114
|
};
|
|
87
115
|
|
|
@@ -90,7 +118,7 @@ const TextboxBlock = ({
|
|
|
90
118
|
isAuthor,
|
|
91
119
|
editing,
|
|
92
120
|
}: {
|
|
93
|
-
block:
|
|
121
|
+
block: ContentBlock.Text;
|
|
94
122
|
editing?: boolean;
|
|
95
123
|
isAuthor?: boolean;
|
|
96
124
|
identity?: Identity;
|
|
@@ -132,6 +160,14 @@ const TextboxBlock = ({
|
|
|
132
160
|
return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;
|
|
133
161
|
};
|
|
134
162
|
|
|
163
|
+
const ProposalBlock = ({ block }: { block: ContentBlock.Proposal }) => {
|
|
164
|
+
return (
|
|
165
|
+
<div role='none' className='mie-4 italic'>
|
|
166
|
+
{block.text}
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
135
171
|
const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(({ subject }, forwardedRef) => {
|
|
136
172
|
// TODO(burdon): Use annotation to get title.
|
|
137
173
|
let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';
|
|
@@ -142,7 +178,7 @@ const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(
|
|
|
142
178
|
return (
|
|
143
179
|
<div
|
|
144
180
|
role='group'
|
|
145
|
-
className={mx('grid col-span-3
|
|
181
|
+
className={mx('grid col-span-3 plb-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}
|
|
146
182
|
ref={forwardedRef}
|
|
147
183
|
>
|
|
148
184
|
<Surface role='card' limit={1} data={{ subject }} fallback={title} />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { memo, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
8
|
|
|
9
9
|
import { type EncodedTrackName, type UserState } from '../../calls';
|
|
10
10
|
import { ThreadCapabilities } from '../../capabilities';
|
|
@@ -17,15 +17,21 @@ export const Participant = memo(({ item: user, debug, ...props }: ResponsiveGrid
|
|
|
17
17
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
18
18
|
const isSelf: boolean = call.self.id !== undefined && user.id !== undefined && user.id.startsWith(call.self.id);
|
|
19
19
|
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
const pulledVideoStream =
|
|
22
|
+
!isSelf && isScreenshare && user.tracks?.screenshareEnabled
|
|
23
|
+
? call.getVideoStream(user.tracks?.screenshare as EncodedTrackName)
|
|
24
|
+
: !isSelf && !isScreenshare && user.tracks?.videoEnabled
|
|
25
|
+
? call.getVideoStream(user.tracks?.video as EncodedTrackName)
|
|
26
|
+
: undefined;
|
|
23
27
|
|
|
24
28
|
const videoStream = useMemo<MediaStream | undefined>(() => {
|
|
25
|
-
if (isSelf
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
if (isSelf) {
|
|
30
|
+
if (isScreenshare) {
|
|
31
|
+
return call.media.screenshareVideoStream;
|
|
32
|
+
} else if (!isScreenshare) {
|
|
33
|
+
return call.media.videoStream;
|
|
34
|
+
}
|
|
29
35
|
} else if (!isSelf) {
|
|
30
36
|
return pulledVideoStream;
|
|
31
37
|
}
|
|
@@ -6,10 +6,11 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
|
-
import { Participant, SCREENSHARE_SUFFIX } from './Participant';
|
|
10
9
|
import { type UserState } from '../../calls';
|
|
11
10
|
import { ResponsiveGrid } from '../ResponsiveGrid';
|
|
12
11
|
|
|
12
|
+
import { Participant, SCREENSHARE_SUFFIX } from './Participant';
|
|
13
|
+
|
|
13
14
|
const getId = (user: UserState): string => user.id!;
|
|
14
15
|
|
|
15
16
|
export type ParticipantGridProps = ThemedClassName<{
|