@dxos/plugin-thread 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203
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/app-graph-builder-XFGLMIGK.mjs +189 -0
- package/dist/lib/browser/app-graph-builder-XFGLMIGK.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-ACPH22F7.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-ACPH22F7.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/call-manager-GDGIKJKN.mjs +26 -0
- package/dist/lib/browser/call-manager-GDGIKJKN.mjs.map +7 -0
- package/dist/lib/browser/chunk-2FIHSX35.mjs +293 -0
- package/dist/lib/browser/chunk-2FIHSX35.mjs.map +7 -0
- package/dist/lib/browser/chunk-4EUEMHNI.mjs +1817 -0
- package/dist/lib/browser/chunk-4EUEMHNI.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-ZE7KWN36.mjs → chunk-ERK254BS.mjs} +381 -240
- package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6NSMBO3B.mjs → chunk-ISCHODBV.mjs} +55 -5
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/{chunk-ERWASUQK.mjs → chunk-JBB73URQ.mjs} +85 -50
- package/dist/lib/browser/chunk-JBB73URQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-RH7XTXSR.mjs +106 -0
- package/dist/lib/browser/chunk-RH7XTXSR.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +151 -132
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/markdown-YJCSOWXX.mjs +210 -0
- package/dist/lib/browser/markdown-YJCSOWXX.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-PROCP5L4.mjs +441 -0
- package/dist/lib/browser/operation-resolver-PROCP5L4.mjs.map +7 -0
- package/dist/lib/browser/react-root-FHK2SVPU.mjs +25 -0
- package/dist/lib/browser/react-root-FHK2SVPU.mjs.map +7 -0
- package/dist/lib/browser/react-surface-7MQA6VSH.mjs +111 -0
- package/dist/lib/browser/react-surface-7MQA6VSH.mjs.map +7 -0
- package/dist/lib/browser/repair-6OZ75AUU.mjs +38 -0
- package/dist/lib/browser/repair-6OZ75AUU.mjs.map +7 -0
- package/dist/lib/browser/settings-TWKOTGSU.mjs +33 -0
- package/dist/lib/browser/settings-TWKOTGSU.mjs.map +7 -0
- package/dist/lib/browser/state-SJR2GL5G.mjs +24 -0
- package/dist/lib/browser/state-SJR2GL5G.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -12
- package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs +190 -0
- package/dist/lib/node-esm/app-graph-builder-IN6VLJBO.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-SXVKFUNV.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/call-manager-36UAAQCJ.mjs +27 -0
- package/dist/lib/node-esm/call-manager-36UAAQCJ.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-25ABSYP2.mjs → chunk-G7PZNN3Z.mjs} +85 -50
- package/dist/lib/node-esm/chunk-G7PZNN3Z.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-OKVE6CLS.mjs +107 -0
- package/dist/lib/node-esm/chunk-OKVE6CLS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IHDNQLLR.mjs → chunk-QP3KQOPQ.mjs} +381 -240
- package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RBRWHRHE.mjs +1818 -0
- package/dist/lib/node-esm/chunk-RBRWHRHE.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-WMWUXWAS.mjs +294 -0
- package/dist/lib/node-esm/chunk-WMWUXWAS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +151 -132
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/markdown-6LRP3PAP.mjs +211 -0
- package/dist/lib/node-esm/markdown-6LRP3PAP.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs +442 -0
- package/dist/lib/node-esm/operation-resolver-LPEPV5BF.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs +26 -0
- package/dist/lib/node-esm/react-root-P5P4VGQJ.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs +112 -0
- package/dist/lib/node-esm/react-surface-M7VI5XG2.mjs.map +7 -0
- package/dist/lib/node-esm/repair-6777EPOM.mjs +39 -0
- package/dist/lib/node-esm/repair-6777EPOM.mjs.map +7 -0
- package/dist/lib/node-esm/settings-5O254B3Z.mjs +34 -0
- package/dist/lib/node-esm/settings-5O254B3Z.mjs.map +7 -0
- package/dist/lib/node-esm/state-5R3TZJQE.mjs +25 -0
- package/dist/lib/node-esm/state-5R3TZJQE.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -12
- package/dist/types/src/ThreadPlugin.d.ts +2 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +21 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
- package/dist/types/src/calls/call-manager.d.ts +40 -30
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +2 -2
- 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 +5 -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/util/task-scheduling.d.ts +2 -2
- package/dist/types/src/calls/util/task-scheduling.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/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/call-manager/call-manager.d.ts +6 -0
- package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +1 -0
- package/dist/types/src/capabilities/call-manager/index.d.ts +3 -0
- package/dist/types/src/capabilities/call-manager/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -15
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +3 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +7 -0
- package/dist/types/src/capabilities/state/state.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 +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 +5 -6
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +159 -5
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +162 -5
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +7 -6
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +160 -4
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +2 -2
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +9 -9
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
- 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 +7 -3
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +159 -3
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +161 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/components/ThreadCompanion.d.ts +5 -0
- package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings.d.ts +4 -2
- 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 +8 -3
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/functions/create-proposals.d.ts +13 -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 -3
- 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/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/stories.d.ts +2 -1
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +79 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +695 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +23 -0
- package/dist/types/src/types/capabilities.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 +3223 -365
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +93 -66
- package/src/ThreadPlugin.tsx +108 -129
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +32 -0
- package/src/calls/call-manager.ts +78 -54
- package/src/calls/call-swarm-synchronizer.ts +3 -3
- package/src/calls/media-manager.ts +67 -38
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +66 -15
- package/src/calls/util/stub-media-streams.ts +64 -7
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +78 -65
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +202 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/call-manager/call-manager.ts +26 -0
- package/src/capabilities/call-manager/index.ts +7 -0
- package/src/capabilities/index.ts +10 -12
- package/src/capabilities/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +83 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +400 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +20 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +98 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +51 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +34 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +22 -0
- package/src/components/Call/Call.tsx +11 -6
- package/src/components/Call/Toolbar.tsx +39 -30
- package/src/components/CallDebugPanel.tsx +112 -55
- package/src/components/CallSidebar.tsx +6 -3
- package/src/components/ChannelContainer.stories.tsx +21 -19
- package/src/components/ChannelContainer.tsx +43 -35
- package/src/components/Chat.stories.tsx +37 -39
- package/src/components/ChatContainer.tsx +52 -41
- package/src/components/Comments.stories.tsx +53 -52
- package/src/components/CommentsContainer.tsx +7 -8
- package/src/components/CommentsThreadContainer.tsx +47 -41
- package/src/components/Lobby/Lobby.tsx +10 -8
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +36 -28
- package/src/components/Media/VideoObject.tsx +2 -2
- package/src/components/MessageContainer.tsx +98 -33
- package/src/components/Participant/Participant.tsx +34 -15
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +8 -8
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +45 -43
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +7 -7
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +8 -5
- package/src/components/ThreadCompanion.tsx +194 -0
- package/src/components/ThreadSettings.tsx +11 -6
- package/src/components/command-extension.ts +7 -4
- package/src/components/index.ts +4 -7
- package/src/components/testing.ts +26 -6
- package/src/extensions/threads.ts +88 -44
- package/src/functions/create-proposals.ts +57 -0
- package/src/functions/index.ts +5 -0
- package/src/hooks/analytics.ts +21 -21
- 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/index.ts +1 -1
- package/src/meta.ts +11 -7
- package/src/testing/stories.ts +18 -16
- package/src/translations.ts +9 -4
- package/src/types/Channel.ts +30 -0
- package/src/types/capabilities.ts +34 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +170 -82
- 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-IY2UIRLF.mjs +0 -16
- package/dist/lib/browser/ChatContainer-AIGIWAUG.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs.map +0 -7
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs +0 -24
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
- package/dist/lib/browser/chunk-4OYAYON2.mjs +0 -21
- package/dist/lib/browser/chunk-4OYAYON2.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-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 +0 -984
- 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-XLPJXUKO.mjs +0 -367
- package/dist/lib/browser/chunk-XLPJXUKO.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs +0 -369
- package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs.map +0 -7
- package/dist/lib/browser/markdown-GEXBVJYN.mjs +0 -169
- package/dist/lib/browser/markdown-GEXBVJYN.mjs.map +0 -7
- package/dist/lib/browser/react-root-X4UIVGTX.mjs +0 -28
- package/dist/lib/browser/react-root-X4UIVGTX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YCYEFBPM.mjs +0 -109
- package/dist/lib/browser/react-surface-YCYEFBPM.mjs.map +0 -7
- package/dist/lib/browser/settings-E32MTL7A.mjs +0 -22
- package/dist/lib/browser/settings-E32MTL7A.mjs.map +0 -7
- package/dist/lib/browser/state-H6CYONWE.mjs +0 -34
- package/dist/lib/browser/state-H6CYONWE.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-DET6T5N2.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-IQUWU426.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs +0 -25
- 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-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 +0 -985
- package/dist/lib/node-esm/chunk-C3XFMUAY.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-GW37AAM4.mjs +0 -23
- package/dist/lib/node-esm/chunk-GW37AAM4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J4NSON5Q.mjs +0 -368
- package/dist/lib/node-esm/chunk-J4NSON5Q.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 +0 -370
- package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-LIJZDK2J.mjs +0 -170
- package/dist/lib/node-esm/markdown-LIJZDK2J.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-M7J6PZVW.mjs +0 -29
- package/dist/lib/node-esm/react-root-M7J6PZVW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IRSEKM42.mjs +0 -110
- package/dist/lib/node-esm/react-surface-IRSEKM42.mjs.map +0 -7
- package/dist/lib/node-esm/settings-SJ24YG7M.mjs +0 -23
- package/dist/lib/node-esm/settings-SJ24YG7M.mjs.map +0 -7
- package/dist/lib/node-esm/state-D7WNDT3N.mjs +0 -35
- package/dist/lib/node-esm/state-D7WNDT3N.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager.d.ts +0 -5
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -27
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -7
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- 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/capabilities/app-graph-builder.ts +0 -180
- package/src/capabilities/call-manager.ts +0 -19
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -314
- package/src/capabilities/markdown.ts +0 -68
- package/src/capabilities/react-root.tsx +0 -17
- package/src/capabilities/react-surface.tsx +0 -88
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -25
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-IY2UIRLF.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-DET6T5N2.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -2,42 +2,50 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
5
|
+
import { Atom, useAtomValue } 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/ui';
|
|
9
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
9
10
|
import { Context } from '@dxos/context';
|
|
10
11
|
import { failUndefined } from '@dxos/debug';
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
11
13
|
import { log } from '@dxos/log';
|
|
12
14
|
import { useClient } from '@dxos/react-client';
|
|
13
|
-
import {
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
14
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
17
|
+
import { ElevationProvider, Input, useTranslation } from '@dxos/react-ui';
|
|
18
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
19
|
+
import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
18
20
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
19
21
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
20
22
|
|
|
23
|
+
import { meta } from '../meta';
|
|
24
|
+
import { ThreadCapabilities } from '../types';
|
|
25
|
+
import { type Channel } from '../types';
|
|
26
|
+
|
|
21
27
|
import { Call } from './Call';
|
|
22
28
|
import ChatContainer from './ChatContainer';
|
|
23
|
-
import { ThreadCapabilities } from '../capabilities';
|
|
24
|
-
import { meta } from '../meta';
|
|
25
|
-
import { type ChannelType } from '../types';
|
|
26
29
|
|
|
27
|
-
export type ChannelContainerProps =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
export type ChannelContainerProps = SurfaceComponentProps<
|
|
31
|
+
Channel.Channel | undefined,
|
|
32
|
+
{
|
|
33
|
+
roomId?: string;
|
|
34
|
+
fullscreen?: boolean;
|
|
35
|
+
}
|
|
36
|
+
>;
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* Renders a call when active, otherwise renders the channel chat.
|
|
36
40
|
*/
|
|
37
|
-
|
|
41
|
+
// TODO(burdon): Create Radix style layout.
|
|
42
|
+
export const ChannelContainer = ({ role, subject: channel, roomId: roomIdProp, fullscreen }: ChannelContainerProps) => {
|
|
38
43
|
const space = getSpace(channel);
|
|
39
44
|
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
40
|
-
const
|
|
45
|
+
const joined = useAtomValue(callManager.joinedAtom);
|
|
46
|
+
const currentRoomId = useAtomValue(callManager.roomIdAtom);
|
|
47
|
+
const attendableId = channel ? Obj.getDXN(channel).toString() : undefined;
|
|
48
|
+
const roomId = roomIdProp ?? attendableId ?? failUndefined();
|
|
41
49
|
const identity = useIdentity();
|
|
42
50
|
const isNamed = !!identity?.profile?.displayName;
|
|
43
51
|
const joinSound = useSoundEffect('JoinCall');
|
|
@@ -78,7 +86,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
78
86
|
return;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
|
-
if (
|
|
89
|
+
if (joined) {
|
|
82
90
|
await callManager.leave();
|
|
83
91
|
}
|
|
84
92
|
|
|
@@ -91,7 +99,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
91
99
|
// TODO(burdon): Error sound.
|
|
92
100
|
log.catch(err);
|
|
93
101
|
}
|
|
94
|
-
}, [extensions, channel, roomId]);
|
|
102
|
+
}, [extensions, channel, roomId, joined]);
|
|
95
103
|
|
|
96
104
|
/**
|
|
97
105
|
* Leave the call.
|
|
@@ -110,10 +118,10 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
110
118
|
}
|
|
111
119
|
}, [extensions, roomId]);
|
|
112
120
|
|
|
113
|
-
const isJoined =
|
|
121
|
+
const isJoined = joined && currentRoomId === roomId;
|
|
114
122
|
|
|
115
123
|
return (
|
|
116
|
-
<StackItem.Content
|
|
124
|
+
<StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
|
|
117
125
|
{isJoined && !isNamed && <DisplayNameMissing />}
|
|
118
126
|
{isJoined && isNamed && (
|
|
119
127
|
<Call.Root>
|
|
@@ -123,8 +131,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
123
131
|
)}
|
|
124
132
|
{!isJoined && channel && channel.defaultThread.target && space && (
|
|
125
133
|
<>
|
|
126
|
-
<ChannelToolbar attendableId={
|
|
127
|
-
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
134
|
+
<ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
|
|
135
|
+
<ChatContainer space={space} thread={channel.defaultThread.target} classNames='container-max-width' />
|
|
128
136
|
</>
|
|
129
137
|
)}
|
|
130
138
|
</StackItem.Content>
|
|
@@ -141,26 +149,26 @@ const DisplayNameMissing = () => {
|
|
|
141
149
|
const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
|
|
142
150
|
|
|
143
151
|
return (
|
|
144
|
-
<
|
|
145
|
-
<
|
|
152
|
+
<Settings.Group classNames='p-4 place-content-center'>
|
|
153
|
+
<Settings.ItemInput title={t('display name label')} description={t('display name description')}>
|
|
146
154
|
<Input.TextInput
|
|
147
155
|
value={displayName}
|
|
148
156
|
onChange={handleChange}
|
|
149
157
|
placeholder={t('display name input placeholder')}
|
|
150
158
|
classNames='md:min-is-64'
|
|
151
159
|
/>
|
|
152
|
-
</
|
|
153
|
-
<
|
|
160
|
+
</Settings.ItemInput>
|
|
161
|
+
<Settings.GroupButton disabled={!displayName} onClick={handleSave}>
|
|
154
162
|
{t('set display name label')}
|
|
155
|
-
</
|
|
156
|
-
</
|
|
163
|
+
</Settings.GroupButton>
|
|
164
|
+
</Settings.Group>
|
|
157
165
|
);
|
|
158
166
|
};
|
|
159
167
|
|
|
160
168
|
const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
161
169
|
const creator = useMemo(
|
|
162
170
|
() =>
|
|
163
|
-
|
|
171
|
+
Atom.make(() => {
|
|
164
172
|
return {
|
|
165
173
|
nodes: [
|
|
166
174
|
createMenuItemGroup('root', {
|
|
@@ -181,19 +189,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
|
181
189
|
return useMenuActions(creator);
|
|
182
190
|
};
|
|
183
191
|
|
|
184
|
-
type ChannelToolbarProps =
|
|
192
|
+
type ChannelToolbarProps = {
|
|
185
193
|
attendableId?: string;
|
|
186
194
|
role?: string;
|
|
187
195
|
onJoinCall?: () => void;
|
|
188
|
-
}
|
|
196
|
+
};
|
|
189
197
|
|
|
190
|
-
const ChannelToolbar = ({ attendableId, role, onJoinCall
|
|
198
|
+
const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
|
|
191
199
|
const menuProps = useChannelToolbarActions(onJoinCall);
|
|
192
200
|
|
|
193
201
|
return (
|
|
194
202
|
<ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
|
|
195
203
|
<MenuProvider {...menuProps} attendableId={attendableId}>
|
|
196
|
-
<ToolbarMenu
|
|
204
|
+
<ToolbarMenu textBlockWidth />
|
|
197
205
|
</MenuProvider>
|
|
198
206
|
</ElevationProvider>
|
|
199
207
|
);
|
|
@@ -2,48 +2,42 @@
|
|
|
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, Capability, OperationPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import {
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
13
11
|
import { faker } from '@dxos/random';
|
|
14
12
|
import { useClient } from '@dxos/react-client';
|
|
15
13
|
import { type Space } from '@dxos/react-client/echo';
|
|
16
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
15
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
16
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
17
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
18
|
+
import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
19
|
+
import { render } from '@dxos/storybook-utils';
|
|
20
|
+
import { Message, Thread } from '@dxos/types';
|
|
21
21
|
|
|
22
|
-
import { ChatContainer } from './ChatContainer';
|
|
23
22
|
import { translations } from '../translations';
|
|
24
|
-
import {
|
|
23
|
+
import { Channel } from '../types';
|
|
24
|
+
|
|
25
|
+
import { ChatContainer } from './ChatContainer';
|
|
25
26
|
|
|
26
27
|
faker.seed(1);
|
|
27
28
|
|
|
28
|
-
const
|
|
29
|
+
const DefaultStory = () => {
|
|
29
30
|
const client = useClient();
|
|
30
31
|
const identity = useIdentity();
|
|
31
32
|
const [space, setSpace] = useState<Space>();
|
|
32
|
-
const [channel, setChannel] = useState<
|
|
33
|
+
const [channel, setChannel] = useState<Channel.Channel | null>();
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
useAsyncEffect(async () => {
|
|
35
36
|
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
|
-
});
|
|
37
|
+
const space = await client.spaces.create();
|
|
38
|
+
const channel = space.db.add(Channel.make());
|
|
39
|
+
setSpace(space);
|
|
40
|
+
setChannel(channel);
|
|
47
41
|
}
|
|
48
42
|
}, [identity]);
|
|
49
43
|
|
|
@@ -52,25 +46,24 @@ const Story = () => {
|
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
return (
|
|
55
|
-
<main className='max-is-
|
|
49
|
+
<main className='is-full max-is-proseMaxWidth mli-auto bs-full overflow-hidden'>
|
|
56
50
|
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
57
51
|
</main>
|
|
58
52
|
);
|
|
59
53
|
};
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const meta: Meta<typeof Thread.Root> = {
|
|
55
|
+
const meta = {
|
|
64
56
|
title: 'plugins/plugin-thread/Chat',
|
|
65
|
-
component:
|
|
66
|
-
render: ()
|
|
57
|
+
component: ThreadComponent.Root as any,
|
|
58
|
+
render: render(DefaultStory),
|
|
67
59
|
decorators: [
|
|
60
|
+
withTheme(),
|
|
68
61
|
withPluginManager({
|
|
69
|
-
plugins: [
|
|
62
|
+
plugins: [OperationPlugin()],
|
|
70
63
|
capabilities: [
|
|
71
|
-
contributes(
|
|
64
|
+
Capability.contributes(
|
|
72
65
|
Capabilities.ReactSurface,
|
|
73
|
-
|
|
66
|
+
Surface.create({
|
|
74
67
|
id: 'test',
|
|
75
68
|
role: 'card',
|
|
76
69
|
component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
|
|
@@ -78,11 +71,16 @@ const meta: Meta<typeof Thread.Root> = {
|
|
|
78
71
|
),
|
|
79
72
|
],
|
|
80
73
|
}),
|
|
81
|
-
|
|
82
|
-
withLayout({ fullscreen: true }),
|
|
83
|
-
withClientProvider({ createSpace: true, types: [ThreadType, DataType.Message] }),
|
|
74
|
+
withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
|
|
84
75
|
],
|
|
85
|
-
parameters: {
|
|
86
|
-
|
|
76
|
+
parameters: {
|
|
77
|
+
layout: 'fullscreen',
|
|
78
|
+
translations,
|
|
79
|
+
},
|
|
80
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
87
81
|
|
|
88
82
|
export default meta;
|
|
83
|
+
|
|
84
|
+
type Story = StoryObj<typeof meta>;
|
|
85
|
+
|
|
86
|
+
export const Default: Story = {};
|
|
@@ -5,29 +5,29 @@
|
|
|
5
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
10
|
+
import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
14
12
|
import {
|
|
15
13
|
MessageTextbox,
|
|
16
14
|
type MessageTextboxProps,
|
|
17
|
-
Thread,
|
|
15
|
+
Thread as ThreadComponent,
|
|
18
16
|
type ThreadRootProps,
|
|
19
17
|
threadLayout,
|
|
20
18
|
} from '@dxos/react-ui-thread';
|
|
21
|
-
import {
|
|
19
|
+
import { Message, type Thread } from '@dxos/types';
|
|
20
|
+
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
|
|
21
|
+
import { mx } from '@dxos/ui-theme';
|
|
22
22
|
import { isNonNullable } from '@dxos/util';
|
|
23
23
|
|
|
24
|
-
import { MessageContainer } from './MessageContainer';
|
|
25
|
-
import { command } from './command-extension';
|
|
26
24
|
import { useStatus } from '../hooks';
|
|
27
25
|
import { meta } from '../meta';
|
|
28
|
-
import { type ThreadType } from '../types';
|
|
29
26
|
import { getMessageMetadata } from '../util';
|
|
30
27
|
|
|
28
|
+
import { command } from './command-extension';
|
|
29
|
+
import { MessageContainer } from './MessageContainer';
|
|
30
|
+
|
|
31
31
|
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
32
32
|
const { t } = useTranslation(meta.id);
|
|
33
33
|
return (
|
|
@@ -40,18 +40,27 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export type ChatContainerProps =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
export type ChatContainerProps = ThemedClassName<
|
|
44
|
+
{
|
|
45
|
+
space: Space;
|
|
46
|
+
thread: Thread.Thread;
|
|
47
|
+
context?: Obj.Unknown;
|
|
48
|
+
autoFocusTextbox?: boolean;
|
|
49
|
+
} & Pick<ThreadRootProps, 'current'>
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
export const ChatContainer = ({
|
|
53
|
+
classNames,
|
|
54
|
+
space,
|
|
55
|
+
thread,
|
|
56
|
+
context,
|
|
57
|
+
current,
|
|
58
|
+
autoFocusTextbox,
|
|
59
|
+
}: ChatContainerProps) => {
|
|
51
60
|
const { t } = useTranslation(meta.id);
|
|
52
|
-
const id =
|
|
61
|
+
const id = Obj.getDXN(thread).toString();
|
|
53
62
|
const identity = useIdentity()!;
|
|
54
|
-
const members = useMembers(space?.
|
|
63
|
+
const members = useMembers(space?.id);
|
|
55
64
|
const activity = useStatus(space, id);
|
|
56
65
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
57
66
|
const [_count, _setCount] = useState(0);
|
|
@@ -66,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
66
75
|
() => [
|
|
67
76
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
68
77
|
createThemeExtensions({ themeMode }),
|
|
69
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
78
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
70
79
|
command,
|
|
71
80
|
],
|
|
72
81
|
[themeMode, _count],
|
|
@@ -89,16 +98,18 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
89
98
|
return false;
|
|
90
99
|
}
|
|
91
100
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
Obj.change(thread, (t) => {
|
|
102
|
+
t.messages.push(
|
|
103
|
+
Ref.make(
|
|
104
|
+
Obj.make(Message.Message, {
|
|
105
|
+
created: new Date().toISOString(),
|
|
106
|
+
sender: { identityDid: identity.did },
|
|
107
|
+
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
108
|
+
properties: context ? { context: Ref.make(context) } : undefined,
|
|
109
|
+
}),
|
|
110
|
+
),
|
|
111
|
+
);
|
|
112
|
+
});
|
|
102
113
|
|
|
103
114
|
messageRef.current = '';
|
|
104
115
|
setAutoFocus(true);
|
|
@@ -108,13 +119,17 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
108
119
|
};
|
|
109
120
|
|
|
110
121
|
return (
|
|
111
|
-
<
|
|
122
|
+
<ThreadComponent.Root
|
|
112
123
|
current={current}
|
|
113
124
|
id={id}
|
|
114
|
-
classNames=
|
|
125
|
+
classNames={[
|
|
126
|
+
'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
127
|
+
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
128
|
+
classNames,
|
|
129
|
+
]}
|
|
115
130
|
>
|
|
116
|
-
<ScrollArea.Root
|
|
117
|
-
<ScrollArea.Viewport classNames='
|
|
131
|
+
<ScrollArea.Root orientation='vertical'>
|
|
132
|
+
<ScrollArea.Viewport classNames='col-span-2'>
|
|
118
133
|
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
119
134
|
{thread.messages
|
|
120
135
|
.map((message) => message.target)
|
|
@@ -123,18 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
123
138
|
<MessageContainer key={message.id} message={message} members={members} />
|
|
124
139
|
))}
|
|
125
140
|
</div>
|
|
126
|
-
{/* NOTE(thure): This can
|
|
141
|
+
{/* NOTE(thure): This can't also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref'd element. */}
|
|
127
142
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
128
|
-
<ScrollArea.Scrollbar>
|
|
129
|
-
<ScrollArea.Thumb />
|
|
130
|
-
</ScrollArea.Scrollbar>
|
|
131
143
|
</ScrollArea.Viewport>
|
|
132
144
|
</ScrollArea.Root>
|
|
133
145
|
|
|
134
146
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</Thread.Root>
|
|
147
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
148
|
+
</ThreadComponent.Root>
|
|
138
149
|
);
|
|
139
150
|
};
|
|
140
151
|
|
|
@@ -2,82 +2,81 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
6
8
|
|
|
7
|
-
import {
|
|
8
|
-
import React, { useEffect } from 'react';
|
|
9
|
-
|
|
10
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { OperationPlugin } from '@dxos/app-framework';
|
|
11
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { Obj, Query, Relation
|
|
11
|
+
import { Obj, Query, Relation } from '@dxos/echo';
|
|
12
|
+
import { TestSchema } from '@dxos/echo/testing';
|
|
13
13
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
14
14
|
import { faker } from '@dxos/random';
|
|
15
|
-
import {
|
|
15
|
+
import { useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
16
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
18
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
|
+
import { render } from '@dxos/storybook-utils';
|
|
20
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
19
21
|
|
|
20
|
-
import { CommentsContainer } from './CommentsContainer';
|
|
21
|
-
import { createCommentThread } from './testing';
|
|
22
22
|
import { translations } from '../translations';
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
import { CommentsContainer } from './CommentsContainer';
|
|
25
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
24
26
|
|
|
25
27
|
faker.seed(1);
|
|
26
28
|
|
|
27
29
|
const DefaultStory = () => {
|
|
28
30
|
const identity = useIdentity();
|
|
29
|
-
const
|
|
30
|
-
const anchors = useQuery(
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (identity && space) {
|
|
34
|
-
const t = setTimeout(async () => {
|
|
35
|
-
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
36
|
-
const thread1 = space.db.add(createCommentThread(identity));
|
|
37
|
-
const thread2 = space.db.add(createCommentThread(identity));
|
|
38
|
-
space.db.add(
|
|
39
|
-
Relation.make(AnchoredTo, {
|
|
40
|
-
[Relation.Source]: thread1,
|
|
41
|
-
[Relation.Target]: object,
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
space.db.add(
|
|
45
|
-
Relation.make(AnchoredTo, {
|
|
46
|
-
[Relation.Source]: thread2,
|
|
47
|
-
[Relation.Target]: object,
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
});
|
|
31
|
+
const db = useDatabase();
|
|
32
|
+
const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
|
|
51
33
|
|
|
52
|
-
|
|
34
|
+
useAsyncEffect(async () => {
|
|
35
|
+
if (identity && db) {
|
|
36
|
+
const object = db.add(Obj.make(TestSchema.Expando, {}));
|
|
37
|
+
const thread1 = db.add(createCommentThread(identity));
|
|
38
|
+
const thread2 = db.add(createProposalThread(identity));
|
|
39
|
+
db.add(
|
|
40
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
41
|
+
[Relation.Source]: thread1,
|
|
42
|
+
[Relation.Target]: object,
|
|
43
|
+
anchor: 'test',
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
db.add(
|
|
47
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
48
|
+
[Relation.Source]: thread2,
|
|
49
|
+
[Relation.Target]: object,
|
|
50
|
+
anchor: 'test',
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
53
|
}
|
|
54
|
-
}, [identity,
|
|
54
|
+
}, [identity, db]);
|
|
55
55
|
|
|
56
|
-
if (!identity || !
|
|
56
|
+
if (!identity || !db || !anchors) {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
return
|
|
61
|
-
<div className='w-[30rem] overflow-y-auto bg-baseSurface'>
|
|
62
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
60
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
65
61
|
};
|
|
66
62
|
|
|
67
|
-
const meta
|
|
63
|
+
const meta = {
|
|
68
64
|
title: 'plugins/plugin-thread/Comments',
|
|
69
65
|
render: render(DefaultStory),
|
|
70
66
|
decorators: [
|
|
71
|
-
withTheme,
|
|
72
|
-
withLayout({
|
|
67
|
+
withTheme(),
|
|
68
|
+
withLayout({ layout: 'column', scroll: true }),
|
|
69
|
+
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
70
|
+
// Currently this is required due to useOnEditAnalytics.
|
|
73
71
|
withPluginManager({
|
|
74
72
|
plugins: [
|
|
75
|
-
|
|
73
|
+
OperationPlugin(),
|
|
76
74
|
ClientPlugin({
|
|
77
|
-
types: [
|
|
78
|
-
onClientInitialized:
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
76
|
+
onClientInitialized: ({ client }) =>
|
|
77
|
+
Effect.gen(function* () {
|
|
78
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
79
|
+
}),
|
|
81
80
|
}),
|
|
82
81
|
],
|
|
83
82
|
}),
|
|
@@ -85,8 +84,10 @@ const meta: Meta = {
|
|
|
85
84
|
parameters: {
|
|
86
85
|
translations,
|
|
87
86
|
},
|
|
88
|
-
}
|
|
87
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
89
88
|
|
|
90
89
|
export default meta;
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
type Story = StoryObj<typeof meta>;
|
|
92
|
+
|
|
93
|
+
export const Default: Story = {};
|
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
7
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
9
8
|
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/
|
|
9
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
11
10
|
|
|
12
|
-
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
13
11
|
import { meta } from '../meta';
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
15
14
|
|
|
16
15
|
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
17
|
-
anchors: AnchoredTo[];
|
|
16
|
+
anchors: AnchoredTo.AnchoredTo[];
|
|
18
17
|
currentId?: string;
|
|
19
18
|
showResolvedThreads?: boolean;
|
|
20
19
|
};
|
|
@@ -62,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
62
61
|
return (
|
|
63
62
|
<div>
|
|
64
63
|
{filteredAnchors.map((anchor) => {
|
|
65
|
-
const thread = Relation.getSource(anchor) as
|
|
66
|
-
const threadId =
|
|
64
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
65
|
+
const threadId = Obj.getDXN(thread).toString();
|
|
67
66
|
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
68
67
|
})}
|
|
69
68
|
</div>
|