@dxos/plugin-thread 0.8.4-main.67995b8 → 0.8.4-main.72ec0f3
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-MX5ABVGC.mjs +16 -0
- package/dist/lib/browser/ChatContainer-7F5Y6GXJ.mjs +15 -0
- package/dist/lib/browser/{app-graph-builder-N7BE5TYW.mjs → app-graph-builder-HNYLII5E.mjs} +32 -33
- package/dist/lib/browser/app-graph-builder-HNYLII5E.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-6BKYTMJS.mjs +104 -0
- package/dist/lib/browser/blueprint-definition-6BKYTMJS.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-NIPDYUVD.mjs → call-manager-MAXQLMMS.mjs} +7 -7
- package/dist/lib/browser/call-manager-MAXQLMMS.mjs.map +7 -0
- package/dist/lib/browser/chunk-BBTXGRIR.mjs +18 -0
- package/dist/lib/browser/chunk-BBTXGRIR.mjs.map +7 -0
- package/dist/lib/browser/chunk-BQWQFTWT.mjs +612 -0
- package/dist/lib/browser/chunk-BQWQFTWT.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-FR6MEAZI.mjs +377 -0
- package/dist/lib/browser/chunk-FR6MEAZI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KWPRNHTK.mjs → chunk-INQVAYPN.mjs} +251 -246
- package/dist/lib/browser/chunk-INQVAYPN.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-K2DUJRFJ.mjs +27 -0
- package/dist/lib/browser/chunk-K2DUJRFJ.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-NMJEVD36.mjs +168 -0
- package/dist/lib/browser/chunk-NMJEVD36.mjs.map +7 -0
- package/dist/lib/browser/chunk-OOUDK7Q7.mjs +23 -0
- package/dist/lib/browser/chunk-OOUDK7Q7.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 +48 -38
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-JFGLZ6VI.mjs → intent-resolver-BOUT4WGY.mjs} +33 -41
- package/dist/lib/browser/intent-resolver-BOUT4WGY.mjs.map +7 -0
- package/dist/lib/browser/{markdown-M3FMR7OD.mjs → markdown-74EUSQGV.mjs} +24 -22
- package/dist/lib/browser/markdown-74EUSQGV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-BVG7B2LW.mjs +28 -0
- package/dist/lib/browser/react-root-BVG7B2LW.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-XWS6GIZY.mjs → react-surface-BCD5ODQ6.mjs} +37 -36
- package/dist/lib/browser/react-surface-BCD5ODQ6.mjs.map +7 -0
- package/dist/lib/browser/{settings-E32MTL7A.mjs → settings-LGQUZITB.mjs} +5 -5
- package/dist/lib/browser/{settings-E32MTL7A.mjs.map → settings-LGQUZITB.mjs.map} +1 -1
- package/dist/lib/browser/{state-H6CYONWE.mjs → state-36REWXO5.mjs} +5 -5
- package/dist/lib/browser/state-36REWXO5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -9
- package/dist/lib/node-esm/ChannelContainer-2JJJ3IDK.mjs +17 -0
- package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs → ChatContainer-C526R4DI.mjs} +6 -6
- package/dist/lib/node-esm/{app-graph-builder-VCW76Z6V.mjs → app-graph-builder-SOCKP4ST.mjs} +32 -33
- package/dist/lib/node-esm/app-graph-builder-SOCKP4ST.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-6LEAWSC7.mjs +105 -0
- package/dist/lib/node-esm/blueprint-definition-6LEAWSC7.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-D6O5ZJJ4.mjs → call-manager-LC4OS2KD.mjs} +7 -7
- package/dist/lib/node-esm/call-manager-LC4OS2KD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5DLH4MWN.mjs +25 -0
- package/dist/lib/node-esm/chunk-5DLH4MWN.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-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-C3XFMUAY.mjs → chunk-JF7THR7F.mjs} +251 -246
- package/dist/lib/node-esm/chunk-JF7THR7F.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JJW6YMLC.mjs +613 -0
- package/dist/lib/node-esm/chunk-JJW6YMLC.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-TJKM5JZT.mjs +169 -0
- package/dist/lib/node-esm/chunk-TJKM5JZT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TWKGDFCS.mjs +378 -0
- package/dist/lib/node-esm/chunk-TWKGDFCS.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/chunk-XI45H4IV.mjs +28 -0
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs +19 -0
- package/dist/lib/node-esm/chunk-ZQAGII7M.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-OXGNQ44Y.mjs → intent-resolver-45PLIFCJ.mjs} +33 -41
- package/dist/lib/node-esm/intent-resolver-45PLIFCJ.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-INKTE4MH.mjs → markdown-566XXB55.mjs} +24 -22
- package/dist/lib/node-esm/markdown-566XXB55.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-DCY6DKLC.mjs +29 -0
- package/dist/lib/node-esm/react-root-DCY6DKLC.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-MJ33KPYE.mjs → react-surface-WZH7OAO3.mjs} +37 -36
- package/dist/lib/node-esm/react-surface-WZH7OAO3.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs → settings-WKLJSP6R.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs.map → settings-WKLJSP6R.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-D7WNDT3N.mjs → state-X3W67GTL.mjs} +5 -5
- package/dist/lib/node-esm/state-X3W67GTL.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -9
- 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 +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/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 +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/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 +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/Participant/ParticipantGrid.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/Thread.d.ts +167 -0
- package/dist/types/src/types/Thread.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +207 -208
- 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 +141 -127
- 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 +1 -0
- package/src/capabilities/intent-resolver.ts +25 -28
- package/src/capabilities/markdown.ts +9 -6
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +28 -26
- 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 +36 -23
- package/src/components/Comments.stories.tsx +40 -41
- package/src/components/CommentsContainer.tsx +8 -8
- package/src/components/CommentsThreadContainer.tsx +40 -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 +48 -14
- 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 +27 -5
- package/src/extensions/threads.ts +26 -17
- package/src/functions/create-proposals.ts +58 -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 +7 -4
- package/src/types/Channel.ts +27 -0
- package/src/types/Thread.ts +26 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +29 -28
- 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/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-MX5ABVGC.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → ChatContainer-7F5Y6GXJ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-7FXCKO7X.mjs.map → ChannelContainer-2JJJ3IDK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → ChatContainer-C526R4DI.mjs.map} +0 -0
|
@@ -2,30 +2,34 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useCapabilities, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { useCapabilities, useCapability } from '@dxos/app-framework/react';
|
|
9
9
|
import { Context } from '@dxos/context';
|
|
10
10
|
import { failUndefined } from '@dxos/debug';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
import { useClient } from '@dxos/react-client';
|
|
13
|
-
import {
|
|
14
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
14
15
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
|
-
import {
|
|
16
|
-
import { ControlGroup,
|
|
17
|
-
import {
|
|
16
|
+
import { ElevationProvider, Input, useTranslation } from '@dxos/react-ui';
|
|
17
|
+
import { ControlGroup, ControlGroupButton, ControlItemInput } from '@dxos/react-ui-form';
|
|
18
|
+
import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
18
19
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
19
20
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
20
21
|
|
|
21
|
-
import { Call } from './Call';
|
|
22
|
-
import ChatContainer from './ChatContainer';
|
|
23
22
|
import { ThreadCapabilities } from '../capabilities';
|
|
24
23
|
import { meta } from '../meta';
|
|
25
|
-
import { type
|
|
24
|
+
import { type Channel } from '../types';
|
|
25
|
+
|
|
26
|
+
import { Call } from './Call';
|
|
27
|
+
import ChatContainer from './ChatContainer';
|
|
28
|
+
|
|
29
|
+
// TODO(burdon): Create Radix style layout.
|
|
26
30
|
|
|
27
31
|
export type ChannelContainerProps = {
|
|
28
|
-
channel?:
|
|
32
|
+
channel?: Channel.Channel;
|
|
29
33
|
roomId?: string;
|
|
30
34
|
role?: string;
|
|
31
35
|
fullscreen?: boolean;
|
|
@@ -37,7 +41,8 @@ export type ChannelContainerProps = {
|
|
|
37
41
|
export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
|
|
38
42
|
const space = getSpace(channel);
|
|
39
43
|
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
40
|
-
const
|
|
44
|
+
const attendableId = channel ? Obj.getDXN(channel).toString() : undefined;
|
|
45
|
+
const roomId = _roomId ?? attendableId ?? failUndefined();
|
|
41
46
|
const identity = useIdentity();
|
|
42
47
|
const isNamed = !!identity?.profile?.displayName;
|
|
43
48
|
const joinSound = useSoundEffect('JoinCall');
|
|
@@ -113,7 +118,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
113
118
|
const isJoined = callManager.joined && callManager.roomId === roomId;
|
|
114
119
|
|
|
115
120
|
return (
|
|
116
|
-
<StackItem.Content
|
|
121
|
+
<StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
|
|
117
122
|
{isJoined && !isNamed && <DisplayNameMissing />}
|
|
118
123
|
{isJoined && isNamed && (
|
|
119
124
|
<Call.Root>
|
|
@@ -123,8 +128,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
123
128
|
)}
|
|
124
129
|
{!isJoined && channel && channel.defaultThread.target && space && (
|
|
125
130
|
<>
|
|
126
|
-
<ChannelToolbar attendableId={
|
|
127
|
-
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
131
|
+
<ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
|
|
132
|
+
<ChatContainer space={space} thread={channel.defaultThread.target} classNames='container-max-width' />
|
|
128
133
|
</>
|
|
129
134
|
)}
|
|
130
135
|
</StackItem.Content>
|
|
@@ -160,7 +165,7 @@ const DisplayNameMissing = () => {
|
|
|
160
165
|
const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
161
166
|
const creator = useMemo(
|
|
162
167
|
() =>
|
|
163
|
-
|
|
168
|
+
Atom.make(() => {
|
|
164
169
|
return {
|
|
165
170
|
nodes: [
|
|
166
171
|
createMenuItemGroup('root', {
|
|
@@ -181,19 +186,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
|
181
186
|
return useMenuActions(creator);
|
|
182
187
|
};
|
|
183
188
|
|
|
184
|
-
type ChannelToolbarProps =
|
|
189
|
+
type ChannelToolbarProps = {
|
|
185
190
|
attendableId?: string;
|
|
186
191
|
role?: string;
|
|
187
192
|
onJoinCall?: () => void;
|
|
188
|
-
}
|
|
193
|
+
};
|
|
189
194
|
|
|
190
|
-
const ChannelToolbar = ({ attendableId, role, onJoinCall
|
|
195
|
+
const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
|
|
191
196
|
const menuProps = useChannelToolbarActions(onJoinCall);
|
|
192
197
|
|
|
193
198
|
return (
|
|
194
199
|
<ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
|
|
195
200
|
<MenuProvider {...menuProps} attendableId={attendableId}>
|
|
196
|
-
<ToolbarMenu
|
|
201
|
+
<ToolbarMenu textBlockWidth />
|
|
197
202
|
</MenuProvider>
|
|
198
203
|
</ElevationProvider>
|
|
199
204
|
);
|
|
@@ -2,48 +2,41 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import React, { useEffect, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, contributes, createSurface, IntentPlugin } from '@dxos/app-framework';
|
|
8
|
+
import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
13
10
|
import { faker } from '@dxos/random';
|
|
14
11
|
import { useClient } from '@dxos/react-client';
|
|
15
12
|
import { type Space } from '@dxos/react-client/echo';
|
|
16
13
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
14
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
|
+
import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
18
|
+
import { render } from '@dxos/storybook-utils';
|
|
19
|
+
import { Message } from '@dxos/types';
|
|
21
20
|
|
|
22
|
-
import { ChatContainer } from './ChatContainer';
|
|
23
21
|
import { translations } from '../translations';
|
|
24
|
-
import {
|
|
22
|
+
import { Channel, Thread } from '../types';
|
|
23
|
+
|
|
24
|
+
import { ChatContainer } from './ChatContainer';
|
|
25
25
|
|
|
26
26
|
faker.seed(1);
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const DefaultStory = () => {
|
|
29
29
|
const client = useClient();
|
|
30
30
|
const identity = useIdentity();
|
|
31
31
|
const [space, setSpace] = useState<Space>();
|
|
32
|
-
const [channel, setChannel] = useState<
|
|
32
|
+
const [channel, setChannel] = useState<Channel.Channel | null>();
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
useAsyncEffect(async () => {
|
|
35
35
|
if (identity) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
41
|
-
threads: [],
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
setSpace(space);
|
|
45
|
-
setChannel(channel);
|
|
46
|
-
});
|
|
36
|
+
const space = await client.spaces.create();
|
|
37
|
+
const channel = space.db.add(Channel.make());
|
|
38
|
+
setSpace(space);
|
|
39
|
+
setChannel(channel);
|
|
47
40
|
}
|
|
48
41
|
}, [identity]);
|
|
49
42
|
|
|
@@ -52,19 +45,18 @@ const Story = () => {
|
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
return (
|
|
55
|
-
<main className='max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
48
|
+
<main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
56
49
|
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
57
50
|
</main>
|
|
58
51
|
);
|
|
59
52
|
};
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const meta: Meta<typeof Thread.Root> = {
|
|
54
|
+
const meta = {
|
|
64
55
|
title: 'plugins/plugin-thread/Chat',
|
|
65
|
-
component:
|
|
66
|
-
render: ()
|
|
56
|
+
component: ThreadComponent.Root as any,
|
|
57
|
+
render: render(DefaultStory),
|
|
67
58
|
decorators: [
|
|
59
|
+
withTheme,
|
|
68
60
|
withPluginManager({
|
|
69
61
|
plugins: [IntentPlugin()],
|
|
70
62
|
capabilities: [
|
|
@@ -78,11 +70,16 @@ const meta: Meta<typeof Thread.Root> = {
|
|
|
78
70
|
),
|
|
79
71
|
],
|
|
80
72
|
}),
|
|
81
|
-
|
|
82
|
-
withLayout({ fullscreen: true }),
|
|
83
|
-
withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
|
|
73
|
+
withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
|
|
84
74
|
],
|
|
85
|
-
parameters: {
|
|
86
|
-
|
|
75
|
+
parameters: {
|
|
76
|
+
layout: 'fullscreen',
|
|
77
|
+
translations,
|
|
78
|
+
},
|
|
79
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
87
80
|
|
|
88
81
|
export default meta;
|
|
82
|
+
|
|
83
|
+
type Story = StoryObj<typeof meta>;
|
|
84
|
+
|
|
85
|
+
export const Default: Story = {};
|
|
@@ -5,29 +5,30 @@
|
|
|
5
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
12
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
13
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
14
|
import {
|
|
15
15
|
MessageTextbox,
|
|
16
16
|
type MessageTextboxProps,
|
|
17
|
-
Thread,
|
|
17
|
+
Thread as ThreadComponent,
|
|
18
18
|
type ThreadRootProps,
|
|
19
19
|
threadLayout,
|
|
20
20
|
} from '@dxos/react-ui-thread';
|
|
21
|
-
import {
|
|
21
|
+
import { Message } from '@dxos/types';
|
|
22
22
|
import { isNonNullable } from '@dxos/util';
|
|
23
23
|
|
|
24
|
-
import { MessageContainer } from './MessageContainer';
|
|
25
|
-
import { command } from './command-extension';
|
|
26
24
|
import { useStatus } from '../hooks';
|
|
27
25
|
import { meta } from '../meta';
|
|
28
|
-
import { type
|
|
26
|
+
import { type Thread } from '../types';
|
|
29
27
|
import { getMessageMetadata } from '../util';
|
|
30
28
|
|
|
29
|
+
import { command } from './command-extension';
|
|
30
|
+
import { MessageContainer } from './MessageContainer';
|
|
31
|
+
|
|
31
32
|
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
32
33
|
const { t } = useTranslation(meta.id);
|
|
33
34
|
return (
|
|
@@ -40,16 +41,25 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
43
|
|
|
43
|
-
export type ChatContainerProps =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
export type ChatContainerProps = ThemedClassName<
|
|
45
|
+
{
|
|
46
|
+
space: Space;
|
|
47
|
+
thread: Thread.Thread;
|
|
48
|
+
context?: Obj.Any;
|
|
49
|
+
autoFocusTextbox?: boolean;
|
|
50
|
+
} & Pick<ThreadRootProps, 'current'>
|
|
51
|
+
>;
|
|
52
|
+
|
|
53
|
+
export const ChatContainer = ({
|
|
54
|
+
classNames,
|
|
55
|
+
space,
|
|
56
|
+
thread,
|
|
57
|
+
context,
|
|
58
|
+
current,
|
|
59
|
+
autoFocusTextbox,
|
|
60
|
+
}: ChatContainerProps) => {
|
|
51
61
|
const { t } = useTranslation(meta.id);
|
|
52
|
-
const id =
|
|
62
|
+
const id = Obj.getDXN(thread).toString();
|
|
53
63
|
const identity = useIdentity()!;
|
|
54
64
|
const members = useMembers(space?.key);
|
|
55
65
|
const activity = useStatus(space, id);
|
|
@@ -66,7 +76,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
66
76
|
() => [
|
|
67
77
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
68
78
|
createThemeExtensions({ themeMode }),
|
|
69
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
79
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
70
80
|
command,
|
|
71
81
|
],
|
|
72
82
|
[themeMode, _count],
|
|
@@ -91,7 +101,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
91
101
|
|
|
92
102
|
thread.messages.push(
|
|
93
103
|
Ref.make(
|
|
94
|
-
Obj.make(
|
|
104
|
+
Obj.make(Message.Message, {
|
|
95
105
|
created: new Date().toISOString(),
|
|
96
106
|
sender: { identityDid: identity.did },
|
|
97
107
|
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
@@ -108,10 +118,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
108
118
|
};
|
|
109
119
|
|
|
110
120
|
return (
|
|
111
|
-
<
|
|
121
|
+
<ThreadComponent.Root
|
|
112
122
|
current={current}
|
|
113
123
|
id={id}
|
|
114
|
-
classNames=
|
|
124
|
+
classNames={[
|
|
125
|
+
'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
126
|
+
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
127
|
+
classNames,
|
|
128
|
+
]}
|
|
115
129
|
>
|
|
116
130
|
<ScrollArea.Root classNames='col-span-2'>
|
|
117
131
|
<ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>
|
|
@@ -132,9 +146,8 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
132
146
|
</ScrollArea.Root>
|
|
133
147
|
|
|
134
148
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</Thread.Root>
|
|
149
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
150
|
+
</ThreadComponent.Root>
|
|
138
151
|
);
|
|
139
152
|
};
|
|
140
153
|
|
|
@@ -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,43 @@ 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 } from '@dxos/types';
|
|
19
19
|
|
|
20
|
-
import { CommentsContainer } from './CommentsContainer';
|
|
21
|
-
import { createCommentThread } from './testing';
|
|
22
20
|
import { translations } from '../translations';
|
|
23
|
-
import {
|
|
21
|
+
import { Thread } from '../types';
|
|
22
|
+
|
|
23
|
+
import { CommentsContainer } from './CommentsContainer';
|
|
24
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
24
25
|
|
|
25
26
|
faker.seed(1);
|
|
26
27
|
|
|
27
28
|
const DefaultStory = () => {
|
|
28
29
|
const identity = useIdentity();
|
|
29
30
|
const space = useSpace();
|
|
30
|
-
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
31
|
+
const anchors = useQuery(space, Query.type(AnchoredTo.AnchoredTo));
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
useAsyncEffect(async () => {
|
|
33
34
|
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);
|
|
35
|
+
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
36
|
+
const thread1 = space.db.add(createCommentThread(identity));
|
|
37
|
+
const thread2 = space.db.add(createProposalThread(identity));
|
|
38
|
+
space.db.add(
|
|
39
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
40
|
+
[Relation.Source]: thread1,
|
|
41
|
+
[Relation.Target]: object,
|
|
42
|
+
anchor: 'test',
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
space.db.add(
|
|
46
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
47
|
+
[Relation.Source]: thread2,
|
|
48
|
+
[Relation.Target]: object,
|
|
49
|
+
anchor: 'test',
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
53
52
|
}
|
|
54
53
|
}, [identity, space]);
|
|
55
54
|
|
|
@@ -57,25 +56,23 @@ const DefaultStory = () => {
|
|
|
57
56
|
return null;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
return
|
|
61
|
-
<div className='w-[30rem] overflow-y-auto bg-baseSurface'>
|
|
62
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
59
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
65
60
|
};
|
|
66
61
|
|
|
67
|
-
const meta
|
|
62
|
+
const meta = {
|
|
68
63
|
title: 'plugins/plugin-thread/Comments',
|
|
69
64
|
render: render(DefaultStory),
|
|
70
65
|
decorators: [
|
|
71
66
|
withTheme,
|
|
72
|
-
withLayout({
|
|
67
|
+
withLayout({ container: 'column', scroll: true }),
|
|
68
|
+
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
69
|
+
// Currently this is required due to useOnEditAnalytics.
|
|
73
70
|
withPluginManager({
|
|
74
71
|
plugins: [
|
|
75
72
|
IntentPlugin(),
|
|
76
73
|
ClientPlugin({
|
|
77
|
-
types: [
|
|
78
|
-
onClientInitialized: async (
|
|
74
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
75
|
+
onClientInitialized: async ({ client }) => {
|
|
79
76
|
await client.halo.createIdentity();
|
|
80
77
|
},
|
|
81
78
|
}),
|
|
@@ -85,8 +82,10 @@ const meta: Meta = {
|
|
|
85
82
|
parameters: {
|
|
86
83
|
translations,
|
|
87
84
|
},
|
|
88
|
-
}
|
|
85
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
89
86
|
|
|
90
87
|
export default meta;
|
|
91
88
|
|
|
92
|
-
|
|
89
|
+
type Story = StoryObj<typeof meta>;
|
|
90
|
+
|
|
91
|
+
export const Default: Story = {};
|
|
@@ -4,17 +4,17 @@
|
|
|
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 } from '@dxos/types';
|
|
11
10
|
|
|
12
|
-
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
13
11
|
import { meta } from '../meta';
|
|
14
|
-
import { type
|
|
12
|
+
import { type Thread } from '../types';
|
|
13
|
+
|
|
14
|
+
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
15
15
|
|
|
16
16
|
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
17
|
-
anchors: AnchoredTo[];
|
|
17
|
+
anchors: AnchoredTo.AnchoredTo[];
|
|
18
18
|
currentId?: string;
|
|
19
19
|
showResolvedThreads?: boolean;
|
|
20
20
|
};
|
|
@@ -62,8 +62,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
62
62
|
return (
|
|
63
63
|
<div>
|
|
64
64
|
{filteredAnchors.map((anchor) => {
|
|
65
|
-
const thread = Relation.getSource(anchor) as
|
|
66
|
-
const threadId =
|
|
65
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
66
|
+
const threadId = Obj.getDXN(thread).toString();
|
|
67
67
|
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
68
68
|
})}
|
|
69
69
|
</div>
|