@dxos/plugin-thread 0.8.3 → 0.8.4-main.1f223c7
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-4PYFOIDK.mjs +16 -0
- package/dist/lib/browser/ChatContainer-EXNNREYB.mjs +15 -0
- package/dist/lib/browser/{app-graph-builder-OY7R7EJP.mjs → app-graph-builder-FHAOPO57.mjs} +8 -8
- package/dist/lib/browser/app-graph-builder-FHAOPO57.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-APQAZWHT.mjs → call-manager-RMPTWSTF.mjs} +6 -5
- package/dist/lib/browser/call-manager-RMPTWSTF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-R5MDLUPC.mjs → chunk-4APCDRSH.mjs} +3 -3
- package/dist/lib/browser/{chunk-R5MDLUPC.mjs.map → chunk-4APCDRSH.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-XZKBN3NS.mjs → chunk-7W7QK5ZP.mjs} +253 -250
- package/dist/lib/browser/chunk-7W7QK5ZP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IIUTBDVB.mjs → chunk-EV4JWI7L.mjs} +2 -2
- package/dist/lib/browser/chunk-G4CNILRR.mjs +23 -0
- package/dist/lib/browser/{chunk-6NBVNXTM.mjs.map → chunk-G4CNILRR.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-JKQUJOTX.mjs → chunk-GERVMFQW.mjs} +2 -2
- package/dist/lib/browser/{chunk-AEXWNS6Z.mjs → chunk-KTWYVC5X.mjs} +34 -15
- package/dist/lib/browser/chunk-KTWYVC5X.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TAFSCSUR.mjs → chunk-PBMNFG3B.mjs} +97 -72
- package/dist/lib/browser/chunk-PBMNFG3B.mjs.map +7 -0
- package/dist/lib/browser/chunk-RI3Z6MK3.mjs +181 -0
- package/dist/lib/browser/chunk-RI3Z6MK3.mjs.map +7 -0
- package/dist/lib/browser/chunk-XYUJXHYV.mjs +106 -0
- package/dist/lib/browser/chunk-XYUJXHYV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4H4A264L.mjs → chunk-ZCEU5K23.mjs} +490 -308
- package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PG5CTFKK.mjs → chunk-ZH2WPTNP.mjs} +226 -158
- package/dist/lib/browser/chunk-ZH2WPTNP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +49 -44
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-FK2MDVDT.mjs → intent-resolver-J7OCP2P6.mjs} +90 -16
- package/dist/lib/browser/intent-resolver-J7OCP2P6.mjs.map +7 -0
- package/dist/lib/browser/{markdown-TE5SWWNJ.mjs → markdown-Z677YORA.mjs} +8 -8
- package/dist/lib/browser/markdown-Z677YORA.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-XKOD4KRB.mjs +28 -0
- package/dist/lib/browser/{react-surface-VXUJKSOG.mjs → react-surface-GVGZRBDK.mjs} +12 -11
- package/dist/lib/browser/react-surface-GVGZRBDK.mjs.map +7 -0
- package/dist/lib/browser/{settings-RB2RSLXV.mjs → settings-GRKEID73.mjs} +4 -4
- package/dist/lib/browser/{state-RKL5MSDP.mjs → state-2T4KDWBX.mjs} +4 -4
- package/dist/lib/browser/{state-RKL5MSDP.mjs.map → state-2T4KDWBX.mjs.map} +2 -2
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs +80 -0
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/ChannelContainer-KQQEZWUN.mjs +17 -0
- package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs → ChatContainer-QVQKFBWA.mjs} +6 -5
- package/dist/lib/node-esm/{app-graph-builder-BAHBHYWI.mjs → app-graph-builder-XEYWX5FC.mjs} +8 -8
- package/dist/lib/node-esm/app-graph-builder-XEYWX5FC.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-UUYXLF4T.mjs → call-manager-QAREJFVX.mjs} +6 -5
- package/dist/lib/node-esm/call-manager-QAREJFVX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs +108 -0
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4T45PCKP.mjs +25 -0
- package/dist/lib/node-esm/{chunk-O63QJPQX.mjs.map → chunk-4T45PCKP.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-PGRP3O4O.mjs → chunk-57XR3LEF.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-P6RLFCNT.mjs → chunk-DKCQCENK.mjs} +97 -72
- package/dist/lib/node-esm/chunk-DKCQCENK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ESQC6SYE.mjs → chunk-GRLRWTRU.mjs} +2 -2
- package/dist/lib/node-esm/chunk-JNPKMT7O.mjs +182 -0
- package/dist/lib/node-esm/chunk-JNPKMT7O.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UZWVVFT3.mjs → chunk-LE2LIYGX.mjs} +226 -158
- package/dist/lib/node-esm/chunk-LE2LIYGX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UJMPYKT3.mjs → chunk-P6E247RF.mjs} +34 -15
- package/dist/lib/node-esm/chunk-P6E247RF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-K4KAUOKT.mjs → chunk-PYTVBN5J.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-K4KAUOKT.mjs.map → chunk-PYTVBN5J.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-2RNIPFDA.mjs → chunk-SNKFZQST.mjs} +253 -250
- package/dist/lib/node-esm/chunk-SNKFZQST.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WXNPD542.mjs → chunk-TIPIOH2J.mjs} +489 -308
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +49 -44
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-BU73VYW3.mjs → intent-resolver-SR2LW4HF.mjs} +90 -16
- package/dist/lib/node-esm/intent-resolver-SR2LW4HF.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-HJUWNBLS.mjs → markdown-FL4IXLRP.mjs} +8 -8
- package/dist/lib/node-esm/markdown-FL4IXLRP.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-RUXOAQNW.mjs → react-root-4JWDRIQB.mjs} +12 -11
- package/dist/lib/{browser/react-root-NK3A4VG7.mjs.map → node-esm/react-root-4JWDRIQB.mjs.map} +1 -1
- package/dist/lib/node-esm/{react-surface-ELXFYKP6.mjs → react-surface-WLQUVRAX.mjs} +12 -11
- package/dist/lib/node-esm/react-surface-WLQUVRAX.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-EA7DFSM6.mjs → settings-F2ODVNNW.mjs} +4 -4
- package/dist/lib/node-esm/{state-6AUTNROZ.mjs → state-62TQKQVB.mjs} +4 -4
- package/dist/lib/node-esm/{state-6AUTNROZ.mjs.map → state-62TQKQVB.mjs.map} +2 -2
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs +81 -0
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts +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 +8 -3
- 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 +24 -0
- package/dist/types/src/calls-service.stories.d.ts.map +1 -0
- 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/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 +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/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +89 -4
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +90 -3
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +2 -2
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +156 -3
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +4 -4
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +14 -0
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -0
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +15 -3
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +4 -1
- 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 +154 -2
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +156 -3
- 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/ThreadComplementary.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 +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +1 -0
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +2 -2
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +3 -0
- 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/useInaudibleAudioStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +3 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -0
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +76 -194
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +125 -81
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +270 -139
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +17 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +56 -53
- package/src/ThreadPlugin.tsx +16 -24
- package/src/calls/call-manager.ts +8 -4
- package/src/calls/call-swarm-synchronizer.ts +1 -1
- package/src/calls/media-manager.ts +70 -37
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +72 -18
- package/src/calls/util/stub-media-streams.ts +62 -8
- package/src/calls-service.stories.tsx +232 -0
- package/src/capabilities/app-graph-builder.ts +8 -5
- package/src/capabilities/call-manager.ts +3 -2
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +60 -8
- package/src/capabilities/markdown.ts +4 -3
- package/src/capabilities/react-surface.tsx +5 -4
- package/src/capabilities/state.ts +2 -1
- package/src/capabilities/toolkit.ts +78 -0
- package/src/components/Call/Call.tsx +4 -3
- package/src/components/Call/Toolbar.tsx +8 -8
- package/src/components/CallDebugPanel.tsx +110 -51
- package/src/components/CallSidebar.tsx +2 -1
- package/src/components/ChannelContainer.stories.tsx +11 -10
- package/src/components/ChannelContainer.tsx +13 -11
- package/src/components/Chat.stories.tsx +29 -27
- package/src/components/ChatContainer.tsx +20 -15
- package/src/components/Comments.stories.tsx +52 -41
- package/src/components/CommentsContainer.tsx +17 -11
- package/src/components/{CommentContainer.tsx → CommentsThreadContainer.tsx} +53 -82
- package/src/components/Lobby/Lobby.tsx +1 -1
- package/src/components/Media/VideoObject.stories.tsx +30 -27
- package/src/components/MessageContainer.tsx +65 -47
- package/src/components/Participant/Participant.tsx +13 -7
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +7 -6
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +42 -39
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +4 -4
- package/src/components/ThreadComplementary.tsx +40 -10
- package/src/components/ThreadSettings.tsx +4 -4
- package/src/components/command-extension.ts +5 -2
- package/src/components/index.ts +1 -1
- package/src/components/testing.ts +24 -2
- package/src/extensions/threads.ts +6 -6
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +27 -0
- package/src/hooks/useVideoStreamTrack.tsx +36 -0
- package/src/testing/stories.ts +7 -3
- package/src/translations.ts +14 -9
- package/src/types/types.ts +28 -11
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/ChannelContainer-PKFBVENP.mjs +0 -15
- package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
- package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
- package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +0 -7
- package/dist/lib/browser/chunk-4H4A264L.mjs.map +0 -7
- package/dist/lib/browser/chunk-5P5BH5GE.mjs +0 -88
- package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +0 -7
- package/dist/lib/browser/chunk-6NBVNXTM.mjs +0 -21
- package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
- package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
- package/dist/lib/browser/markdown-TE5SWWNJ.mjs.map +0 -7
- package/dist/lib/browser/react-root-NK3A4VG7.mjs +0 -27
- package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
- package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs +0 -36
- package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-GCOM3M56.cjs +0 -35
- package/dist/lib/node/ChatContainer-GCOM3M56.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs +0 -179
- package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs.map +0 -7
- package/dist/lib/node/call-manager-HV2XJW5O.cjs +0 -37
- package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +0 -7
- package/dist/lib/node/chunk-44I33JDT.cjs +0 -1731
- package/dist/lib/node/chunk-44I33JDT.cjs.map +0 -7
- package/dist/lib/node/chunk-4YSNVPWU.cjs +0 -37
- package/dist/lib/node/chunk-4YSNVPWU.cjs.map +0 -7
- package/dist/lib/node/chunk-E3WBZTTI.cjs +0 -371
- package/dist/lib/node/chunk-E3WBZTTI.cjs.map +0 -7
- package/dist/lib/node/chunk-ERG7G6FF.cjs +0 -59
- package/dist/lib/node/chunk-ERG7G6FF.cjs.map +0 -7
- package/dist/lib/node/chunk-FUXJAVFZ.cjs +0 -108
- package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +0 -7
- package/dist/lib/node/chunk-HLMCEE5K.cjs +0 -41
- package/dist/lib/node/chunk-HLMCEE5K.cjs.map +0 -7
- package/dist/lib/node/chunk-IP533AMV.cjs +0 -554
- package/dist/lib/node/chunk-IP533AMV.cjs.map +0 -7
- package/dist/lib/node/chunk-LR5NENBE.cjs +0 -54
- package/dist/lib/node/chunk-LR5NENBE.cjs.map +0 -7
- package/dist/lib/node/chunk-UM36TPCT.cjs +0 -984
- package/dist/lib/node/chunk-UM36TPCT.cjs.map +0 -7
- package/dist/lib/node/chunk-ZGDN3XBR.cjs +0 -149
- package/dist/lib/node/chunk-ZGDN3XBR.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -310
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs +0 -363
- package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs.map +0 -7
- package/dist/lib/node/markdown-GQIPJS2F.cjs +0 -178
- package/dist/lib/node/markdown-GQIPJS2F.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-6HHDMULJ.cjs +0 -51
- package/dist/lib/node/react-root-6HHDMULJ.cjs.map +0 -7
- package/dist/lib/node/react-surface-NBH42NN2.cjs +0 -122
- package/dist/lib/node/react-surface-NBH42NN2.cjs.map +0 -7
- package/dist/lib/node/settings-4LQSFEDK.cjs +0 -36
- package/dist/lib/node/settings-4LQSFEDK.cjs.map +0 -7
- package/dist/lib/node/state-IY5XX3H2.cjs +0 -50
- package/dist/lib/node/state-IY5XX3H2.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -38
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O3V45YJP.mjs +0 -90
- package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O63QJPQX.mjs +0 -23
- package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UZWVVFT3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
- package/dist/types/src/components/CommentContainer.d.ts +0 -13
- package/dist/types/src/components/CommentContainer.d.ts.map +0 -1
- package/dist/types/src/peers.stories.d.ts +0 -11
- package/dist/types/src/peers.stories.d.ts.map +0 -1
- package/src/peers.stories.tsx +0 -189
- /package/dist/lib/browser/{ChannelContainer-PKFBVENP.mjs.map → ChannelContainer-4PYFOIDK.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-RSOKYAMK.mjs.map → ChatContainer-EXNNREYB.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-IIUTBDVB.mjs.map → chunk-EV4JWI7L.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-JKQUJOTX.mjs.map → chunk-GERVMFQW.mjs.map} +0 -0
- /package/dist/lib/{node-esm/react-root-RUXOAQNW.mjs.map → browser/react-root-XKOD4KRB.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-RB2RSLXV.mjs.map → settings-GRKEID73.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-O4QJII2P.mjs.map → ChannelContainer-KQQEZWUN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs.map → ChatContainer-QVQKFBWA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-PGRP3O4O.mjs.map → chunk-57XR3LEF.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-ESQC6SYE.mjs.map → chunk-GRLRWTRU.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-EA7DFSM6.mjs.map → settings-F2ODVNNW.mjs.map} +0 -0
|
@@ -3,26 +3,28 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useCapabilities, useCapability } from '@dxos/app-framework';
|
|
9
9
|
import { Context } from '@dxos/context';
|
|
10
|
+
import { failUndefined } from '@dxos/debug';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
12
|
import { useClient } from '@dxos/react-client';
|
|
12
13
|
import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
13
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
14
|
-
import {
|
|
15
|
-
import { ControlGroup,
|
|
16
|
-
import {
|
|
15
|
+
import { ElevationProvider, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
16
|
+
import { ControlGroup, ControlGroupButton, ControlItemInput } from '@dxos/react-ui-form';
|
|
17
|
+
import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
17
18
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
18
19
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
19
20
|
|
|
20
|
-
import { Call } from './Call';
|
|
21
|
-
import ChatContainer from './ChatContainer';
|
|
22
21
|
import { ThreadCapabilities } from '../capabilities';
|
|
23
|
-
import {
|
|
22
|
+
import { meta } from '../meta';
|
|
24
23
|
import { type ChannelType } from '../types';
|
|
25
24
|
|
|
25
|
+
import { Call } from './Call';
|
|
26
|
+
import ChatContainer from './ChatContainer';
|
|
27
|
+
|
|
26
28
|
export type ChannelContainerProps = {
|
|
27
29
|
channel?: ChannelType;
|
|
28
30
|
roomId?: string;
|
|
@@ -36,7 +38,7 @@ export type ChannelContainerProps = {
|
|
|
36
38
|
export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }: ChannelContainerProps) => {
|
|
37
39
|
const space = getSpace(channel);
|
|
38
40
|
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
39
|
-
const roomId = channel ? fullyQualifiedId(channel) :
|
|
41
|
+
const roomId = _roomId ?? (channel ? fullyQualifiedId(channel) : failUndefined());
|
|
40
42
|
const identity = useIdentity();
|
|
41
43
|
const isNamed = !!identity?.profile?.displayName;
|
|
42
44
|
const joinSound = useSoundEffect('JoinCall');
|
|
@@ -133,7 +135,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
133
135
|
export default ChannelContainer;
|
|
134
136
|
|
|
135
137
|
const DisplayNameMissing = () => {
|
|
136
|
-
const { t } = useTranslation(
|
|
138
|
+
const { t } = useTranslation(meta.id);
|
|
137
139
|
const client = useClient();
|
|
138
140
|
const [displayName, setDisplayName] = useState('');
|
|
139
141
|
const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
|
|
@@ -163,10 +165,10 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
|
163
165
|
return {
|
|
164
166
|
nodes: [
|
|
165
167
|
createMenuItemGroup('root', {
|
|
166
|
-
label: ['channel toolbar title', { ns:
|
|
168
|
+
label: ['channel toolbar title', { ns: meta.id }],
|
|
167
169
|
}),
|
|
168
170
|
createMenuAction('video-call', () => onJoinCall?.(), {
|
|
169
|
-
label: ['start video call label', { ns:
|
|
171
|
+
label: ['start video call label', { ns: meta.id }],
|
|
170
172
|
icon: 'ph--video-camera--regular',
|
|
171
173
|
type: 'video-call',
|
|
172
174
|
}),
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
8
|
-
import React, {
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { Capabilities, contributes, createSurface
|
|
10
|
+
import { Capabilities, IntentPlugin, contributes, createSurface } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { Obj, Ref } from '@dxos/echo';
|
|
13
13
|
import { faker } from '@dxos/random';
|
|
@@ -15,35 +15,35 @@ import { useClient } from '@dxos/react-client';
|
|
|
15
15
|
import { type Space } from '@dxos/react-client/echo';
|
|
16
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
17
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
18
19
|
import { Thread } from '@dxos/react-ui-thread';
|
|
19
20
|
import { DataType } from '@dxos/schema';
|
|
20
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
21
|
+
import { render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
21
22
|
|
|
22
|
-
import {
|
|
23
|
-
import translations from '../translations';
|
|
23
|
+
import { translations } from '../translations';
|
|
24
24
|
import { ChannelType, ThreadType } from '../types';
|
|
25
25
|
|
|
26
|
+
import { ChatContainer } from './ChatContainer';
|
|
27
|
+
|
|
26
28
|
faker.seed(1);
|
|
27
29
|
|
|
28
|
-
const
|
|
30
|
+
const DefaultStory = () => {
|
|
29
31
|
const client = useClient();
|
|
30
32
|
const identity = useIdentity();
|
|
31
33
|
const [space, setSpace] = useState<Space>();
|
|
32
34
|
const [channel, setChannel] = useState<ChannelType | null>();
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
useAsyncEffect(async () => {
|
|
35
37
|
if (identity) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Obj.make(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setChannel(channel);
|
|
46
|
-
});
|
|
38
|
+
const space = await client.spaces.create();
|
|
39
|
+
const channel = space.db.add(
|
|
40
|
+
Obj.make(ChannelType, {
|
|
41
|
+
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
42
|
+
threads: [],
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
setSpace(space);
|
|
46
|
+
setChannel(channel);
|
|
47
47
|
}
|
|
48
48
|
}, [identity]);
|
|
49
49
|
|
|
@@ -52,18 +52,16 @@ const Story = () => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
|
-
<main className='max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
55
|
+
<main className='is-full max-is-prose mli-auto bs-dvh overflow-hidden'>
|
|
56
56
|
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
57
57
|
</main>
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const meta: Meta = {
|
|
61
|
+
const meta = {
|
|
64
62
|
title: 'plugins/plugin-thread/Chat',
|
|
65
|
-
component: Thread,
|
|
66
|
-
render: ()
|
|
63
|
+
component: Thread.Root as any,
|
|
64
|
+
render: render(DefaultStory),
|
|
67
65
|
decorators: [
|
|
68
66
|
withPluginManager({
|
|
69
67
|
plugins: [IntentPlugin()],
|
|
@@ -80,9 +78,13 @@ const meta: Meta = {
|
|
|
80
78
|
}),
|
|
81
79
|
withTheme,
|
|
82
80
|
withLayout({ fullscreen: true }),
|
|
83
|
-
withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
|
|
81
|
+
withClientProvider({ createSpace: true, types: [ThreadType, ChannelType, DataType.Message] }),
|
|
84
82
|
],
|
|
85
83
|
parameters: { translations },
|
|
86
|
-
}
|
|
84
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
87
85
|
|
|
88
86
|
export default meta;
|
|
87
|
+
|
|
88
|
+
type Story = StoryObj<typeof meta>;
|
|
89
|
+
|
|
90
|
+
export const Default: Story = {};
|
|
@@ -5,7 +5,7 @@
|
|
|
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, fullyQualifiedId, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
10
|
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
@@ -15,22 +15,22 @@ import {
|
|
|
15
15
|
MessageTextbox,
|
|
16
16
|
type MessageTextboxProps,
|
|
17
17
|
Thread,
|
|
18
|
-
|
|
18
|
+
type ThreadRootProps,
|
|
19
19
|
threadLayout,
|
|
20
|
-
type ThreadProps,
|
|
21
20
|
} from '@dxos/react-ui-thread';
|
|
22
21
|
import { DataType } from '@dxos/schema';
|
|
23
22
|
import { isNonNullable } from '@dxos/util';
|
|
24
23
|
|
|
25
|
-
import { MessageContainer } from './MessageContainer';
|
|
26
|
-
import { command } from './command-extension';
|
|
27
24
|
import { useStatus } from '../hooks';
|
|
28
|
-
import {
|
|
25
|
+
import { meta } from '../meta';
|
|
29
26
|
import { type ThreadType } from '../types';
|
|
30
27
|
import { getMessageMetadata } from '../util';
|
|
31
28
|
|
|
29
|
+
import { command } from './command-extension';
|
|
30
|
+
import { MessageContainer } from './MessageContainer';
|
|
31
|
+
|
|
32
32
|
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
33
|
-
const { t } = useTranslation(
|
|
33
|
+
const { t } = useTranslation(meta.id);
|
|
34
34
|
return (
|
|
35
35
|
<div role='none' className='flex items-center'>
|
|
36
36
|
<StackItem.SigilButton attendableId={attendableId}>
|
|
@@ -46,14 +46,14 @@ export type ChatContainerProps = {
|
|
|
46
46
|
thread: ThreadType;
|
|
47
47
|
context?: Obj.Any;
|
|
48
48
|
autoFocusTextbox?: boolean;
|
|
49
|
-
} & Pick<
|
|
49
|
+
} & Pick<ThreadRootProps, 'current'>;
|
|
50
50
|
|
|
51
51
|
export const ChatContainer = ({ space, thread, context, current, autoFocusTextbox }: ChatContainerProps) => {
|
|
52
|
+
const { t } = useTranslation(meta.id);
|
|
52
53
|
const id = fullyQualifiedId(thread);
|
|
53
54
|
const identity = useIdentity()!;
|
|
54
55
|
const members = useMembers(space?.key);
|
|
55
56
|
const activity = useStatus(space, id);
|
|
56
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
57
57
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
58
58
|
const [_count, _setCount] = useState(0);
|
|
59
59
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
@@ -93,9 +93,9 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
93
93
|
thread.messages.push(
|
|
94
94
|
Ref.make(
|
|
95
95
|
Obj.make(DataType.Message, {
|
|
96
|
-
sender: { identityDid: identity.did },
|
|
97
96
|
created: new Date().toISOString(),
|
|
98
|
-
|
|
97
|
+
sender: { identityDid: identity.did },
|
|
98
|
+
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
99
99
|
properties: context ? { context: Ref.make(context) } : undefined,
|
|
100
100
|
}),
|
|
101
101
|
),
|
|
@@ -109,10 +109,13 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
return (
|
|
112
|
-
<Thread
|
|
112
|
+
<Thread.Root
|
|
113
113
|
current={current}
|
|
114
114
|
id={id}
|
|
115
|
-
classNames=
|
|
115
|
+
classNames={[
|
|
116
|
+
'bs-full is-full max-is-prose mli-auto grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
117
|
+
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
118
|
+
]}
|
|
116
119
|
>
|
|
117
120
|
<ScrollArea.Root classNames='col-span-2'>
|
|
118
121
|
<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]'>
|
|
@@ -131,9 +134,11 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
131
134
|
</ScrollArea.Scrollbar>
|
|
132
135
|
</ScrollArea.Viewport>
|
|
133
136
|
</ScrollArea.Root>
|
|
137
|
+
|
|
134
138
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
|
|
140
|
+
<Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
|
|
141
|
+
</Thread.Root>
|
|
137
142
|
);
|
|
138
143
|
};
|
|
139
144
|
|
|
@@ -4,52 +4,52 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
8
|
-
import React
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { Obj, Query, Relation, Type } from '@dxos/echo';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
14
|
import { faker } from '@dxos/random';
|
|
14
15
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
15
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
16
|
-
import {
|
|
17
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
17
18
|
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
18
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
|
+
import { layoutCentered, render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
20
|
|
|
20
|
-
import {
|
|
21
|
-
import { createCommentThread } from './testing';
|
|
22
|
-
import translations from '../translations';
|
|
21
|
+
import { translations } from '../translations';
|
|
23
22
|
import { ThreadType } from '../types';
|
|
24
23
|
|
|
24
|
+
import { CommentsContainer } from './CommentsContainer';
|
|
25
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
26
|
+
|
|
25
27
|
faker.seed(1);
|
|
26
28
|
|
|
27
|
-
const
|
|
29
|
+
const DefaultStory = () => {
|
|
28
30
|
const identity = useIdentity();
|
|
29
|
-
const space = useSpace(
|
|
31
|
+
const space = useSpace();
|
|
30
32
|
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
useAsyncEffect(async () => {
|
|
33
35
|
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);
|
|
36
|
+
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
37
|
+
const thread1 = space.db.add(createCommentThread(identity));
|
|
38
|
+
const thread2 = space.db.add(createProposalThread(identity));
|
|
39
|
+
space.db.add(
|
|
40
|
+
Relation.make(AnchoredTo, {
|
|
41
|
+
[Relation.Source]: thread1,
|
|
42
|
+
[Relation.Target]: object,
|
|
43
|
+
anchor: 'test',
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
space.db.add(
|
|
47
|
+
Relation.make(AnchoredTo, {
|
|
48
|
+
[Relation.Source]: thread2,
|
|
49
|
+
[Relation.Target]: object,
|
|
50
|
+
anchor: 'test',
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
53
|
}
|
|
54
54
|
}, [identity, space]);
|
|
55
55
|
|
|
@@ -58,28 +58,39 @@ const Story = ({ spaceKey }: ClientRepeatedComponentProps) => {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
|
-
<div className='
|
|
62
|
-
<
|
|
63
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
64
|
-
</div>
|
|
61
|
+
<div className='w-[30rem] overflow-y-auto bg-baseSurface'>
|
|
62
|
+
<CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />
|
|
65
63
|
</div>
|
|
66
64
|
);
|
|
67
65
|
};
|
|
68
66
|
|
|
69
|
-
const meta
|
|
67
|
+
const meta = {
|
|
70
68
|
title: 'plugins/plugin-thread/Comments',
|
|
71
|
-
|
|
72
|
-
render: () => <ClientRepeater component={Story} createIdentity createSpace types={[ThreadType, DataType.Message]} />,
|
|
69
|
+
render: render(DefaultStory),
|
|
73
70
|
decorators: [
|
|
74
71
|
withTheme,
|
|
75
|
-
withLayout({ fullscreen: true }),
|
|
72
|
+
withLayout({ fullscreen: true, classNames: layoutCentered }),
|
|
73
|
+
// TODO(wittjosiah): This shouldn't depend on app framework. Should use withClientProvider instead.
|
|
74
|
+
// Currently this is required due to useOnEditAnalytics.
|
|
76
75
|
withPluginManager({
|
|
77
|
-
plugins: [
|
|
76
|
+
plugins: [
|
|
77
|
+
IntentPlugin(),
|
|
78
|
+
ClientPlugin({
|
|
79
|
+
types: [DataType.Message, ThreadType, AnchoredTo],
|
|
80
|
+
onClientInitialized: async ({ client }) => {
|
|
81
|
+
await client.halo.createIdentity();
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
],
|
|
78
85
|
}),
|
|
79
86
|
],
|
|
80
|
-
parameters: {
|
|
81
|
-
|
|
87
|
+
parameters: {
|
|
88
|
+
translations,
|
|
89
|
+
},
|
|
90
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
82
91
|
|
|
83
92
|
export default meta;
|
|
84
93
|
|
|
85
|
-
|
|
94
|
+
type Story = StoryObj<typeof meta>;
|
|
95
|
+
|
|
96
|
+
export const Default: Story = {};
|
|
@@ -9,21 +9,23 @@ import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { type AnchoredTo } from '@dxos/schema';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
12
|
+
import { meta } from '../meta';
|
|
14
13
|
import { type ThreadType } from '../types';
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
16
|
+
|
|
17
|
+
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
17
18
|
anchors: AnchoredTo[];
|
|
18
19
|
currentId?: string;
|
|
19
20
|
showResolvedThreads?: boolean;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Root container for collection of comment threads.
|
|
24
25
|
*/
|
|
25
|
-
export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...props }:
|
|
26
|
-
const { t } = useTranslation(
|
|
26
|
+
export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...props }: CommentsContainerProps) => {
|
|
27
|
+
const { t } = useTranslation(meta.id);
|
|
28
|
+
|
|
27
29
|
// TODO(wittjosiah): There seems to be a race between thread and anchor being deleted.
|
|
28
30
|
const filteredAnchors = showResolvedThreads
|
|
29
31
|
? anchors.filter((anchor) => !!Relation.getSource(anchor))
|
|
@@ -58,9 +60,13 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
58
60
|
);
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
{filteredAnchors.map((anchor) => {
|
|
66
|
+
const thread = Relation.getSource(anchor) as ThreadType;
|
|
67
|
+
const threadId = fullyQualifiedId(thread);
|
|
68
|
+
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
69
|
+
})}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
66
72
|
};
|