@dxos/plugin-thread 0.8.4-main.28f8d3d → 0.8.4-main.2c6827d
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-JI3ZRZ5S.mjs +17 -0
- package/dist/lib/browser/ChatContainer-6FVFME3R.mjs +16 -0
- package/dist/lib/browser/{app-graph-builder-AF3M7UWN.mjs → app-graph-builder-URVQHGMR.mjs} +32 -32
- package/dist/lib/browser/app-graph-builder-URVQHGMR.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-XRRCAVLI.mjs → call-manager-4YFT4XA6.mjs} +8 -7
- package/dist/lib/{node-esm/call-manager-EI7FXRAU.mjs.map → browser/call-manager-4YFT4XA6.mjs.map} +1 -1
- package/dist/lib/browser/chunk-6LWKNZUV.mjs +377 -0
- package/dist/lib/browser/chunk-6LWKNZUV.mjs.map +7 -0
- package/dist/lib/browser/chunk-CBUNHCOE.mjs +23 -0
- package/dist/lib/browser/chunk-CBUNHCOE.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-ZJ7QBXK6.mjs → chunk-F36NHPJG.mjs} +47 -42
- package/dist/lib/browser/chunk-F36NHPJG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JGKMMI65.mjs → chunk-ISCHODBV.mjs} +54 -4
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/{chunk-X5PIP5YR.mjs → chunk-KOBXMDCI.mjs} +74 -41
- package/dist/lib/browser/chunk-KOBXMDCI.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-R5UOPOO7.mjs +142 -0
- package/dist/lib/browser/chunk-R5UOPOO7.mjs.map +7 -0
- package/dist/lib/browser/chunk-VIRD2QSK.mjs +611 -0
- package/dist/lib/browser/chunk-VIRD2QSK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TUFWPOVS.mjs → chunk-ZCW3NSDZ.mjs} +256 -161
- package/dist/lib/browser/chunk-ZCW3NSDZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +48 -38
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-DCY4P4OX.mjs → intent-resolver-YR6W4CRP.mjs} +33 -51
- package/dist/lib/browser/intent-resolver-YR6W4CRP.mjs.map +7 -0
- package/dist/lib/browser/{markdown-WZSXCEZJ.mjs → markdown-GSOBOXA7.mjs} +26 -24
- package/dist/lib/browser/markdown-GSOBOXA7.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-RAWRPF7Z.mjs +29 -0
- package/dist/lib/browser/react-root-RAWRPF7Z.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-PYAMIADB.mjs → react-surface-GOEFSXQ6.mjs} +38 -36
- package/dist/lib/browser/react-surface-GOEFSXQ6.mjs.map +7 -0
- package/dist/lib/browser/{settings-AC6YSASL.mjs → settings-JN2HHORY.mjs} +6 -5
- package/dist/lib/{node-esm/settings-N52O7MLS.mjs.map → browser/settings-JN2HHORY.mjs.map} +1 -1
- package/dist/lib/browser/{state-2T4KDWBX.mjs → state-UYPLBGZJ.mjs} +6 -5
- package/dist/lib/{node-esm/state-62TQKQVB.mjs.map → browser/state-UYPLBGZJ.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +7 -10
- package/dist/lib/node-esm/ChannelContainer-RQY4PR4F.mjs +18 -0
- package/dist/lib/node-esm/ChatContainer-KWNON7EN.mjs +17 -0
- package/dist/lib/node-esm/ChatContainer-KWNON7EN.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OLSJVCWY.mjs → app-graph-builder-2IH5RPR7.mjs} +32 -32
- package/dist/lib/node-esm/app-graph-builder-2IH5RPR7.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-EI7FXRAU.mjs → call-manager-UMUXEYH5.mjs} +8 -7
- package/dist/lib/{browser/call-manager-XRRCAVLI.mjs.map → node-esm/call-manager-UMUXEYH5.mjs.map} +1 -1
- 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-4TME3BR4.mjs → chunk-7KZWZS2U.mjs} +256 -161
- package/dist/lib/node-esm/chunk-7KZWZS2U.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-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-I3O6NXMN.mjs +25 -0
- package/dist/lib/node-esm/chunk-I3O6NXMN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MEIWWPR2.mjs +143 -0
- package/dist/lib/node-esm/chunk-MEIWWPR2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SED3O2XO.mjs → chunk-PZH2EDU5.mjs} +74 -41
- package/dist/lib/node-esm/chunk-PZH2EDU5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QFCIKJOD.mjs +612 -0
- package/dist/lib/node-esm/chunk-QFCIKJOD.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-QBHKLWGR.mjs → chunk-VBI32FGI.mjs} +54 -4
- package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YIDU3DXK.mjs → chunk-Y3F2SGNH.mjs} +47 -42
- package/dist/lib/node-esm/chunk-Y3F2SGNH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z4GUSLWL.mjs +378 -0
- package/dist/lib/node-esm/chunk-Z4GUSLWL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +48 -38
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-QGTPU6QB.mjs → intent-resolver-SJFABEE7.mjs} +33 -51
- package/dist/lib/node-esm/intent-resolver-SJFABEE7.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-3MZXUGUA.mjs → markdown-GG5566TL.mjs} +26 -24
- package/dist/lib/node-esm/markdown-GG5566TL.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-K5OGECUS.mjs +30 -0
- package/dist/lib/node-esm/react-root-K5OGECUS.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-UJFCSFNO.mjs → react-surface-5QDQD7MN.mjs} +38 -36
- package/dist/lib/node-esm/react-surface-5QDQD7MN.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-N52O7MLS.mjs → settings-VSPM3BIM.mjs} +6 -5
- package/dist/lib/{browser/settings-AC6YSASL.mjs.map → node-esm/settings-VSPM3BIM.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-62TQKQVB.mjs → state-XNWOLBNE.mjs} +6 -5
- package/dist/lib/{browser/state-2T4KDWBX.mjs.map → node-esm/state-XNWOLBNE.mjs.map} +1 -1
- 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/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.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +3 -1
- 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/capabilities.d.ts +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -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/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- 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/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 +155 -5
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +158 -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 +156 -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/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 +6 -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/ResponsiveGrid/ResponsiveContainer.stories.d.ts +155 -3
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +157 -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 +75 -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 +206 -210
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -59
- package/src/ThreadPlugin.tsx +139 -125
- package/src/calls/call-manager.ts +1 -1
- package/src/calls/media-manager.ts +64 -35
- package/src/calls/types.ts +7 -3
- package/src/calls/util/calls-service.ts +61 -11
- package/src/calls/util/stub-media-streams.ts +62 -5
- package/src/calls-service.stories.tsx +76 -63
- package/src/capabilities/app-graph-builder.ts +43 -30
- package/src/capabilities/blueprint-definition.ts +38 -0
- package/src/capabilities/capabilities.ts +7 -7
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +23 -30
- package/src/capabilities/markdown.ts +5 -3
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +25 -23
- package/src/components/Call/Call.tsx +1 -1
- package/src/components/Call/Toolbar.tsx +9 -9
- package/src/components/CallDebugPanel.tsx +112 -55
- package/src/components/CallSidebar.tsx +1 -1
- package/src/components/ChannelContainer.stories.tsx +13 -13
- package/src/components/ChannelContainer.tsx +19 -15
- package/src/components/Chat.stories.tsx +30 -34
- package/src/components/ChatContainer.tsx +32 -21
- package/src/components/Comments.stories.tsx +36 -39
- package/src/components/CommentsContainer.tsx +5 -7
- package/src/components/CommentsThreadContainer.tsx +38 -33
- package/src/components/Lobby/Lobby.tsx +1 -1
- package/src/components/Media/VideoObject.stories.tsx +35 -28
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessageContainer.tsx +45 -12
- package/src/components/Participant/Participant.tsx +14 -8
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +5 -6
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +2 -2
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +42 -41
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +5 -5
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +5 -2
- package/src/components/{ThreadComplementary.tsx → ThreadCompanion.tsx} +72 -35
- package/src/components/ThreadSettings.tsx +6 -7
- package/src/components/command-extension.ts +4 -1
- package/src/components/index.ts +4 -4
- package/src/components/testing.ts +26 -6
- package/src/extensions/threads.ts +26 -17
- 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/useVideoStreamTrack.tsx +6 -3
- package/src/meta.ts +9 -5
- package/src/testing/stories.ts +3 -6
- package/src/translations.ts +7 -4
- package/src/types/Channel.ts +26 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.ts +27 -28
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-O2SFQJU7.mjs +0 -16
- package/dist/lib/browser/ChatContainer-PVT3DUZJ.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs.map +0 -7
- package/dist/lib/browser/chunk-2CWJBXBH.mjs +0 -21
- package/dist/lib/browser/chunk-2CWJBXBH.mjs.map +0 -7
- package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
- package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
- package/dist/lib/browser/chunk-DW7JD64V.mjs +0 -137
- package/dist/lib/browser/chunk-DW7JD64V.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-FY4ZRD5X.mjs +0 -367
- package/dist/lib/browser/chunk-FY4ZRD5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-J3JO5NWO.mjs +0 -477
- package/dist/lib/browser/chunk-J3JO5NWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-JGKMMI65.mjs.map +0 -7
- package/dist/lib/browser/chunk-TUFWPOVS.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5PIP5YR.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs.map +0 -7
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs.map +0 -7
- package/dist/lib/browser/react-root-QXPALOUQ.mjs +0 -28
- package/dist/lib/browser/react-root-QXPALOUQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PYAMIADB.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-B2ZGAE4P.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-2CT4PJ7I.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs +0 -23
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BF4UKS55.mjs +0 -368
- package/dist/lib/node-esm/chunk-BF4UKS55.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-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QBHKLWGR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SED3O2XO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs +0 -478
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs +0 -138
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs +0 -29
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UJFCSFNO.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 -164
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-O2SFQJU7.mjs.map → ChannelContainer-JI3ZRZ5S.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-PVT3DUZJ.mjs.map → ChatContainer-6FVFME3R.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-B2ZGAE4P.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-2CT4PJ7I.mjs.map → ChannelContainer-RQY4PR4F.mjs.map} +0 -0
|
@@ -2,49 +2,41 @@
|
|
|
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, useState } from 'react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
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
21
|
import { translations } from '../translations';
|
|
23
|
-
import {
|
|
22
|
+
import { Channel } from '../types';
|
|
24
23
|
|
|
25
24
|
import { ChatContainer } from './ChatContainer';
|
|
26
25
|
|
|
27
26
|
faker.seed(1);
|
|
28
27
|
|
|
29
|
-
const
|
|
28
|
+
const DefaultStory = () => {
|
|
30
29
|
const client = useClient();
|
|
31
30
|
const identity = useIdentity();
|
|
32
31
|
const [space, setSpace] = useState<Space>();
|
|
33
|
-
const [channel, setChannel] = useState<
|
|
32
|
+
const [channel, setChannel] = useState<Channel.Channel | null>();
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
useAsyncEffect(async () => {
|
|
36
35
|
if (identity) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
42
|
-
threads: [],
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
45
|
-
setSpace(space);
|
|
46
|
-
setChannel(channel);
|
|
47
|
-
});
|
|
36
|
+
const space = await client.spaces.create();
|
|
37
|
+
const channel = space.db.add(Channel.make());
|
|
38
|
+
setSpace(space);
|
|
39
|
+
setChannel(channel);
|
|
48
40
|
}
|
|
49
41
|
}, [identity]);
|
|
50
42
|
|
|
@@ -53,19 +45,18 @@ const Story = () => {
|
|
|
53
45
|
}
|
|
54
46
|
|
|
55
47
|
return (
|
|
56
|
-
<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'>
|
|
57
49
|
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
58
50
|
</main>
|
|
59
51
|
);
|
|
60
52
|
};
|
|
61
53
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const meta: Meta<typeof Thread.Root> = {
|
|
54
|
+
const meta = {
|
|
65
55
|
title: 'plugins/plugin-thread/Chat',
|
|
66
|
-
component:
|
|
67
|
-
render: ()
|
|
56
|
+
component: ThreadComponent.Root as any,
|
|
57
|
+
render: render(DefaultStory),
|
|
68
58
|
decorators: [
|
|
59
|
+
withTheme,
|
|
69
60
|
withPluginManager({
|
|
70
61
|
plugins: [IntentPlugin()],
|
|
71
62
|
capabilities: [
|
|
@@ -79,11 +70,16 @@ const meta: Meta<typeof Thread.Root> = {
|
|
|
79
70
|
),
|
|
80
71
|
],
|
|
81
72
|
}),
|
|
82
|
-
|
|
83
|
-
withLayout({ fullscreen: true }),
|
|
84
|
-
withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
|
|
73
|
+
withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
|
|
85
74
|
],
|
|
86
|
-
parameters: {
|
|
87
|
-
|
|
75
|
+
parameters: {
|
|
76
|
+
layout: 'fullscreen',
|
|
77
|
+
translations,
|
|
78
|
+
},
|
|
79
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
88
80
|
|
|
89
81
|
export default meta;
|
|
82
|
+
|
|
83
|
+
type Story = StoryObj<typeof meta>;
|
|
84
|
+
|
|
85
|
+
export const Default: Story = {};
|
|
@@ -5,25 +5,24 @@
|
|
|
5
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { type Space,
|
|
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
24
|
import { useStatus } from '../hooks';
|
|
25
25
|
import { meta } from '../meta';
|
|
26
|
-
import { type ThreadType } from '../types';
|
|
27
26
|
import { getMessageMetadata } from '../util';
|
|
28
27
|
|
|
29
28
|
import { command } from './command-extension';
|
|
@@ -41,16 +40,25 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
41
40
|
);
|
|
42
41
|
};
|
|
43
42
|
|
|
44
|
-
export type ChatContainerProps =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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) => {
|
|
52
60
|
const { t } = useTranslation(meta.id);
|
|
53
|
-
const id =
|
|
61
|
+
const id = Obj.getDXN(thread).toString();
|
|
54
62
|
const identity = useIdentity()!;
|
|
55
63
|
const members = useMembers(space?.key);
|
|
56
64
|
const activity = useStatus(space, id);
|
|
@@ -67,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
67
75
|
() => [
|
|
68
76
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
69
77
|
createThemeExtensions({ themeMode }),
|
|
70
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
78
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
71
79
|
command,
|
|
72
80
|
],
|
|
73
81
|
[themeMode, _count],
|
|
@@ -92,7 +100,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
92
100
|
|
|
93
101
|
thread.messages.push(
|
|
94
102
|
Ref.make(
|
|
95
|
-
Obj.make(
|
|
103
|
+
Obj.make(Message.Message, {
|
|
96
104
|
created: new Date().toISOString(),
|
|
97
105
|
sender: { identityDid: identity.did },
|
|
98
106
|
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
@@ -109,10 +117,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
109
117
|
};
|
|
110
118
|
|
|
111
119
|
return (
|
|
112
|
-
<
|
|
120
|
+
<ThreadComponent.Root
|
|
113
121
|
current={current}
|
|
114
122
|
id={id}
|
|
115
|
-
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
|
+
]}
|
|
116
128
|
>
|
|
117
129
|
<ScrollArea.Root classNames='col-span-2'>
|
|
118
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]'>
|
|
@@ -133,9 +145,8 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
133
145
|
</ScrollArea.Root>
|
|
134
146
|
|
|
135
147
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</Thread.Root>
|
|
148
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
149
|
+
</ThreadComponent.Root>
|
|
139
150
|
);
|
|
140
151
|
};
|
|
141
152
|
|
|
@@ -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,43 +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
20
|
import { translations } from '../translations';
|
|
21
|
-
import { ThreadType } from '../types';
|
|
22
21
|
|
|
23
22
|
import { CommentsContainer } from './CommentsContainer';
|
|
24
|
-
import { createCommentThread } from './testing';
|
|
23
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
25
24
|
|
|
26
25
|
faker.seed(1);
|
|
27
26
|
|
|
28
27
|
const DefaultStory = () => {
|
|
29
28
|
const identity = useIdentity();
|
|
30
29
|
const space = useSpace();
|
|
31
|
-
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
30
|
+
const anchors = useQuery(space, Query.type(AnchoredTo.AnchoredTo));
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
useAsyncEffect(async () => {
|
|
34
33
|
if (identity && space) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Relation.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
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
|
+
);
|
|
54
51
|
}
|
|
55
52
|
}, [identity, space]);
|
|
56
53
|
|
|
@@ -58,24 +55,22 @@ const DefaultStory = () => {
|
|
|
58
55
|
return null;
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
return
|
|
62
|
-
<div className='w-[30rem] overflow-y-auto bg-baseSurface'>
|
|
63
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
58
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
66
59
|
};
|
|
67
60
|
|
|
68
|
-
const meta
|
|
61
|
+
const meta = {
|
|
69
62
|
title: 'plugins/plugin-thread/Comments',
|
|
70
63
|
render: render(DefaultStory),
|
|
71
64
|
decorators: [
|
|
72
65
|
withTheme,
|
|
73
|
-
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.
|
|
74
69
|
withPluginManager({
|
|
75
70
|
plugins: [
|
|
76
71
|
IntentPlugin(),
|
|
77
72
|
ClientPlugin({
|
|
78
|
-
types: [
|
|
73
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
79
74
|
onClientInitialized: async ({ client }) => {
|
|
80
75
|
await client.halo.createIdentity();
|
|
81
76
|
},
|
|
@@ -86,8 +81,10 @@ const meta: Meta = {
|
|
|
86
81
|
parameters: {
|
|
87
82
|
translations,
|
|
88
83
|
},
|
|
89
|
-
}
|
|
84
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
90
85
|
|
|
91
86
|
export default meta;
|
|
92
87
|
|
|
93
|
-
|
|
88
|
+
type Story = StoryObj<typeof meta>;
|
|
89
|
+
|
|
90
|
+
export const Default: Story = {};
|
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
7
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
9
8
|
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/
|
|
9
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
11
10
|
|
|
12
11
|
import { meta } from '../meta';
|
|
13
|
-
import { type ThreadType } from '../types';
|
|
14
12
|
|
|
15
13
|
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
16
14
|
|
|
17
15
|
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
18
|
-
anchors: AnchoredTo[];
|
|
16
|
+
anchors: AnchoredTo.AnchoredTo[];
|
|
19
17
|
currentId?: string;
|
|
20
18
|
showResolvedThreads?: boolean;
|
|
21
19
|
};
|
|
@@ -63,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
63
61
|
return (
|
|
64
62
|
<div>
|
|
65
63
|
{filteredAnchors.map((anchor) => {
|
|
66
|
-
const thread = Relation.getSource(anchor) as
|
|
67
|
-
const threadId =
|
|
64
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
65
|
+
const threadId = Obj.getDXN(thread).toString();
|
|
68
66
|
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
69
67
|
})}
|
|
70
68
|
</div>
|
|
@@ -4,34 +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
22
|
import { useStatus } from '../hooks';
|
|
18
23
|
import { meta } from '../meta';
|
|
19
|
-
import { type ThreadType } from '../types';
|
|
20
24
|
import { getMessageMetadata } from '../util';
|
|
21
25
|
|
|
22
26
|
import { command } from './command-extension';
|
|
23
|
-
import { MessageContainer } from './MessageContainer';
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Remove need for p-1.
|
|
26
|
-
export const commentControlClassNames = '!p-1 transition-opacity';
|
|
27
|
+
import { MessageContainer, buttonClassNames, buttonGroupClassNames } from './MessageContainer';
|
|
27
28
|
|
|
28
29
|
export type CommentsThreadContainerProps = {
|
|
29
|
-
anchor: AnchoredTo;
|
|
30
|
-
onAttend?: (anchor: AnchoredTo) => void;
|
|
31
|
-
onComment?: (anchor: AnchoredTo, message: string) => void;
|
|
32
|
-
onResolve?: (anchor: AnchoredTo) => void;
|
|
33
|
-
onMessageDelete?: (anchor: AnchoredTo, messageId: string) => void;
|
|
34
|
-
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;
|
|
35
37
|
} & Pick<ThreadRootProps, 'current'>;
|
|
36
38
|
|
|
37
39
|
export const CommentsThreadContainer = ({
|
|
@@ -42,30 +44,31 @@ export const CommentsThreadContainer = ({
|
|
|
42
44
|
onResolve,
|
|
43
45
|
onMessageDelete,
|
|
44
46
|
onThreadDelete,
|
|
47
|
+
onAcceptProposal,
|
|
45
48
|
}: CommentsThreadContainerProps) => {
|
|
49
|
+
const { themeMode } = useThemeContext();
|
|
46
50
|
const { t } = useTranslation(meta.id);
|
|
47
51
|
const identity = useIdentity()!;
|
|
48
52
|
const space = getSpace(anchor);
|
|
49
53
|
const members = useMembers(space?.key);
|
|
50
54
|
const detached = !anchor.anchor;
|
|
51
|
-
const thread = Relation.getSource(anchor) as
|
|
52
|
-
const activity = useStatus(space,
|
|
55
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
56
|
+
const activity = useStatus(space, Obj.getDXN(thread).toString());
|
|
53
57
|
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
54
|
-
const { themeMode } = useThemeContext();
|
|
55
58
|
|
|
56
|
-
const textboxMetadata = getMessageMetadata(
|
|
59
|
+
const textboxMetadata = getMessageMetadata(Obj.getDXN(thread).toString(), identity);
|
|
60
|
+
|
|
57
61
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
58
|
-
const [
|
|
59
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
62
|
+
const [state, setState] = useState({});
|
|
60
63
|
const messageRef = useRef('');
|
|
61
64
|
const extensions = useMemo(
|
|
62
65
|
() => [
|
|
63
66
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
64
67
|
createThemeExtensions({ themeMode }),
|
|
65
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
68
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
66
69
|
command,
|
|
67
70
|
],
|
|
68
|
-
[
|
|
71
|
+
[state],
|
|
69
72
|
);
|
|
70
73
|
|
|
71
74
|
// TODO(thure): Factor out.
|
|
@@ -76,6 +79,7 @@ export const CommentsThreadContainer = ({
|
|
|
76
79
|
const handleResolve = useCallback(() => onResolve?.(anchor), [onResolve, anchor]);
|
|
77
80
|
const handleMessageDelete = useCallback((id: string) => onMessageDelete?.(anchor, id), [onMessageDelete, anchor]);
|
|
78
81
|
const handleThreadDelete = useCallback(() => onThreadDelete?.(anchor), [onThreadDelete, anchor]);
|
|
82
|
+
const handleAcceptProposal = useCallback((id: string) => onAcceptProposal?.(anchor, id), [onAcceptProposal, anchor]);
|
|
79
83
|
|
|
80
84
|
const handleComment: MessageTextboxProps['onSend'] = useCallback(() => {
|
|
81
85
|
if (!messageRef.current) {
|
|
@@ -85,14 +89,14 @@ export const CommentsThreadContainer = ({
|
|
|
85
89
|
onComment?.(anchor, messageRef.current);
|
|
86
90
|
messageRef.current = '';
|
|
87
91
|
scrollToEnd('instant');
|
|
88
|
-
|
|
92
|
+
setState({});
|
|
89
93
|
|
|
90
94
|
return true;
|
|
91
95
|
}, [anchor, identity]);
|
|
92
96
|
|
|
93
97
|
return (
|
|
94
|
-
<
|
|
95
|
-
id={
|
|
98
|
+
<ThreadComponent.Root
|
|
99
|
+
id={Obj.getDXN(thread).toString()}
|
|
96
100
|
classNames='pbs-2 border-be border-subduedSeparator last:border-none'
|
|
97
101
|
current={current}
|
|
98
102
|
onClickCapture={handleAttend}
|
|
@@ -108,12 +112,12 @@ export const CommentsThreadContainer = ({
|
|
|
108
112
|
>
|
|
109
113
|
{detached ? (
|
|
110
114
|
<Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
|
|
111
|
-
<
|
|
115
|
+
<ThreadComponent.Header detached>{thread.name}</ThreadComponent.Header>
|
|
112
116
|
</Tooltip.Trigger>
|
|
113
117
|
) : (
|
|
114
|
-
<
|
|
118
|
+
<ThreadComponent.Header>{thread.name}</ThreadComponent.Header>
|
|
115
119
|
)}
|
|
116
|
-
<div
|
|
120
|
+
<div role='none' className={buttonGroupClassNames}>
|
|
117
121
|
{thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
|
|
118
122
|
{onResolve && !(thread?.status === 'staged') && (
|
|
119
123
|
<IconButton
|
|
@@ -122,7 +126,7 @@ export const CommentsThreadContainer = ({
|
|
|
122
126
|
icon={thread?.status === 'resolved' ? 'ph--check--fill' : 'ph--check--regular'}
|
|
123
127
|
iconOnly
|
|
124
128
|
label={t('resolve thread label')}
|
|
125
|
-
classNames={[
|
|
129
|
+
classNames={[buttonClassNames, thread?.status !== 'resolved' && hoverableControlItem]}
|
|
126
130
|
onClick={handleResolve}
|
|
127
131
|
/>
|
|
128
132
|
)}
|
|
@@ -133,7 +137,7 @@ export const CommentsThreadContainer = ({
|
|
|
133
137
|
icon='ph--x--regular'
|
|
134
138
|
iconOnly
|
|
135
139
|
label={t('delete thread label')}
|
|
136
|
-
classNames={[
|
|
140
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
137
141
|
onClick={handleThreadDelete}
|
|
138
142
|
/>
|
|
139
143
|
)}
|
|
@@ -148,6 +152,7 @@ export const CommentsThreadContainer = ({
|
|
|
148
152
|
message={message}
|
|
149
153
|
members={members}
|
|
150
154
|
onDelete={handleMessageDelete}
|
|
155
|
+
onAcceptProposal={handleAcceptProposal}
|
|
151
156
|
/>
|
|
152
157
|
))}
|
|
153
158
|
|
|
@@ -159,10 +164,10 @@ export const CommentsThreadContainer = ({
|
|
|
159
164
|
*/}
|
|
160
165
|
<MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
|
|
161
166
|
|
|
162
|
-
<
|
|
167
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
163
168
|
|
|
164
169
|
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
165
170
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
166
|
-
</
|
|
171
|
+
</ThreadComponent.Root>
|
|
167
172
|
);
|
|
168
173
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
8
|
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
@@ -2,48 +2,55 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } 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 {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
|
|
15
13
|
import { getUserMediaTrack } from '../../calls';
|
|
16
14
|
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
17
15
|
|
|
18
|
-
import { VideoObject } from './VideoObject';
|
|
16
|
+
import { VideoObject, type VideoObjectProps } from './VideoObject';
|
|
19
17
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const ctx = new Context();
|
|
28
|
-
scheduleTask(ctx, async () => {
|
|
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 {
|
|
29
25
|
const stream = new MediaStream();
|
|
30
26
|
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
31
27
|
setVideoStream(stream);
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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',
|
|
45
53
|
},
|
|
46
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default meta;
|