@dxos/plugin-thread 0.8.3 → 0.8.4-main.1068cf700f
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-JKQUJOTX.mjs → chunk-CP7E2HRE.mjs} +3 -3
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4H4A264L.mjs → chunk-ERK254BS.mjs} +407 -305
- package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
- package/dist/lib/browser/chunk-ISCHODBV.mjs +106 -0
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JBB73URQ.mjs +184 -0
- 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 +164 -151
- 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-PGRP3O4O.mjs → chunk-ABUFOZVX.mjs} +3 -3
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-G7PZNN3Z.mjs +185 -0
- 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-WXNPD542.mjs → chunk-QP3KQOPQ.mjs} +406 -305
- 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-VBI32FGI.mjs +108 -0
- 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 +164 -151
- 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 +9 -4
- 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 +23 -0
- package/dist/types/src/calls-service.stories.d.ts.map +1 -0
- 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 -4
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +8 -7
- 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 +6 -6
- 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 +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 +4 -4
- 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 +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/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 +146 -194
- 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 +3224 -320
- 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 +93 -67
- package/src/ThreadPlugin.tsx +107 -143
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +32 -0
- package/src/calls/call-manager.ts +78 -50
- package/src/calls/call-swarm-synchronizer.ts +3 -3
- package/src/calls/media-manager.ts +77 -41
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +73 -19
- package/src/calls/util/stub-media-streams.ts +63 -9
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +229 -0
- 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 +42 -33
- package/src/components/CallDebugPanel.tsx +114 -57
- package/src/components/CallSidebar.tsx +6 -3
- package/src/components/ChannelContainer.stories.tsx +23 -21
- package/src/components/ChannelContainer.tsx +47 -38
- package/src/components/Chat.stories.tsx +37 -39
- package/src/components/ChatContainer.tsx +56 -44
- package/src/components/Comments.stories.tsx +63 -55
- package/src/components/CommentsContainer.tsx +20 -16
- package/src/components/CommentsThreadContainer.tsx +173 -0
- 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 +117 -68
- package/src/components/Participant/Participant.tsx +34 -15
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +9 -9
- 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 +10 -7
- 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 +5 -8
- package/src/components/testing.ts +28 -8
- 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 +4 -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/index.ts +1 -1
- package/src/meta.ts +11 -7
- package/src/testing/stories.ts +23 -17
- package/src/translations.ts +18 -10
- 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 +171 -75
- 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-PKFBVENP.mjs +0 -15
- package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
- package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
- package/dist/lib/browser/call-manager-APQAZWHT.mjs +0 -23
- 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-6NBVNXTM.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEXWNS6Z.mjs +0 -128
- package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-IIUTBDVB.mjs +0 -17
- package/dist/lib/browser/chunk-IIUTBDVB.mjs.map +0 -7
- package/dist/lib/browser/chunk-JKQUJOTX.mjs.map +0 -7
- package/dist/lib/browser/chunk-PG5CTFKK.mjs +0 -550
- package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
- package/dist/lib/browser/chunk-R5MDLUPC.mjs +0 -18
- package/dist/lib/browser/chunk-R5MDLUPC.mjs.map +0 -7
- package/dist/lib/browser/chunk-TAFSCSUR.mjs +0 -351
- package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-XZKBN3NS.mjs +0 -983
- package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs +0 -353
- package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
- package/dist/lib/browser/markdown-TE5SWWNJ.mjs +0 -169
- 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-root-NK3A4VG7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VXUJKSOG.mjs +0 -108
- package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
- package/dist/lib/browser/settings-RB2RSLXV.mjs +0 -22
- package/dist/lib/browser/settings-RB2RSLXV.mjs.map +0 -7
- package/dist/lib/browser/state-RKL5MSDP.mjs +0 -34
- package/dist/lib/browser/state-RKL5MSDP.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/ChatContainer-F6CSADV7.mjs +0 -15
- package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs +0 -24
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2RNIPFDA.mjs +0 -984
- package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ESQC6SYE.mjs +0 -19
- package/dist/lib/node-esm/chunk-ESQC6SYE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K4KAUOKT.mjs +0 -19
- package/dist/lib/node-esm/chunk-K4KAUOKT.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-O63QJPQX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P6RLFCNT.mjs +0 -352
- package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PGRP3O4O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UJMPYKT3.mjs +0 -129
- package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UZWVVFT3.mjs +0 -551
- 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 +0 -354
- package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-HJUWNBLS.mjs +0 -170
- package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-RUXOAQNW.mjs +0 -28
- package/dist/lib/node-esm/react-root-RUXOAQNW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs +0 -109
- package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-EA7DFSM6.mjs +0 -23
- package/dist/lib/node-esm/settings-EA7DFSM6.mjs.map +0 -7
- package/dist/lib/node-esm/state-6AUTNROZ.mjs +0 -35
- package/dist/lib/node-esm/state-6AUTNROZ.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/CommentContainer.d.ts +0 -13
- package/dist/types/src/components/CommentContainer.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/peers.stories.d.ts +0 -11
- package/dist/types/src/peers.stories.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -133
- 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 -296
- 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/CommentContainer.tsx +0 -198
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/peers.stories.tsx +0 -189
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-PKFBVENP.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-RSOKYAMK.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-O4QJII2P.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-F6CSADV7.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -2,41 +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';
|
|
11
|
+
import { failUndefined } from '@dxos/debug';
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
10
13
|
import { log } from '@dxos/log';
|
|
11
14
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
13
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
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';
|
|
17
20
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
18
21
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
19
22
|
|
|
23
|
+
import { meta } from '../meta';
|
|
24
|
+
import { ThreadCapabilities } from '../types';
|
|
25
|
+
import { type Channel } from '../types';
|
|
26
|
+
|
|
20
27
|
import { Call } from './Call';
|
|
21
28
|
import ChatContainer from './ChatContainer';
|
|
22
|
-
import { ThreadCapabilities } from '../capabilities';
|
|
23
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
24
|
-
import { type ChannelType } from '../types';
|
|
25
29
|
|
|
26
|
-
export type ChannelContainerProps =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
30
|
+
export type ChannelContainerProps = SurfaceComponentProps<
|
|
31
|
+
Channel.Channel | undefined,
|
|
32
|
+
{
|
|
33
|
+
roomId?: string;
|
|
34
|
+
fullscreen?: boolean;
|
|
35
|
+
}
|
|
36
|
+
>;
|
|
32
37
|
|
|
33
38
|
/**
|
|
34
39
|
* Renders a call when active, otherwise renders the channel chat.
|
|
35
40
|
*/
|
|
36
|
-
|
|
41
|
+
// TODO(burdon): Create Radix style layout.
|
|
42
|
+
export const ChannelContainer = ({ role, subject: channel, roomId: roomIdProp, fullscreen }: ChannelContainerProps) => {
|
|
37
43
|
const space = getSpace(channel);
|
|
38
44
|
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
39
|
-
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();
|
|
40
49
|
const identity = useIdentity();
|
|
41
50
|
const isNamed = !!identity?.profile?.displayName;
|
|
42
51
|
const joinSound = useSoundEffect('JoinCall');
|
|
@@ -77,7 +86,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
77
86
|
return;
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
if (
|
|
89
|
+
if (joined) {
|
|
81
90
|
await callManager.leave();
|
|
82
91
|
}
|
|
83
92
|
|
|
@@ -90,7 +99,7 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
90
99
|
// TODO(burdon): Error sound.
|
|
91
100
|
log.catch(err);
|
|
92
101
|
}
|
|
93
|
-
}, [extensions, channel, roomId]);
|
|
102
|
+
}, [extensions, channel, roomId, joined]);
|
|
94
103
|
|
|
95
104
|
/**
|
|
96
105
|
* Leave the call.
|
|
@@ -109,10 +118,10 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
109
118
|
}
|
|
110
119
|
}, [extensions, roomId]);
|
|
111
120
|
|
|
112
|
-
const isJoined =
|
|
121
|
+
const isJoined = joined && currentRoomId === roomId;
|
|
113
122
|
|
|
114
123
|
return (
|
|
115
|
-
<StackItem.Content
|
|
124
|
+
<StackItem.Content classNames={isJoined && 'bs-full'} toolbar={!isJoined}>
|
|
116
125
|
{isJoined && !isNamed && <DisplayNameMissing />}
|
|
117
126
|
{isJoined && isNamed && (
|
|
118
127
|
<Call.Root>
|
|
@@ -122,8 +131,8 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
122
131
|
)}
|
|
123
132
|
{!isJoined && channel && channel.defaultThread.target && space && (
|
|
124
133
|
<>
|
|
125
|
-
<ChannelToolbar attendableId={
|
|
126
|
-
<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' />
|
|
127
136
|
</>
|
|
128
137
|
)}
|
|
129
138
|
</StackItem.Content>
|
|
@@ -133,40 +142,40 @@ export const ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }:
|
|
|
133
142
|
export default ChannelContainer;
|
|
134
143
|
|
|
135
144
|
const DisplayNameMissing = () => {
|
|
136
|
-
const { t } = useTranslation(
|
|
145
|
+
const { t } = useTranslation(meta.id);
|
|
137
146
|
const client = useClient();
|
|
138
147
|
const [displayName, setDisplayName] = useState('');
|
|
139
148
|
const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
|
|
140
149
|
const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
|
|
141
150
|
|
|
142
151
|
return (
|
|
143
|
-
<
|
|
144
|
-
<
|
|
152
|
+
<Settings.Group classNames='p-4 place-content-center'>
|
|
153
|
+
<Settings.ItemInput title={t('display name label')} description={t('display name description')}>
|
|
145
154
|
<Input.TextInput
|
|
146
155
|
value={displayName}
|
|
147
156
|
onChange={handleChange}
|
|
148
157
|
placeholder={t('display name input placeholder')}
|
|
149
158
|
classNames='md:min-is-64'
|
|
150
159
|
/>
|
|
151
|
-
</
|
|
152
|
-
<
|
|
160
|
+
</Settings.ItemInput>
|
|
161
|
+
<Settings.GroupButton disabled={!displayName} onClick={handleSave}>
|
|
153
162
|
{t('set display name label')}
|
|
154
|
-
</
|
|
155
|
-
</
|
|
163
|
+
</Settings.GroupButton>
|
|
164
|
+
</Settings.Group>
|
|
156
165
|
);
|
|
157
166
|
};
|
|
158
167
|
|
|
159
168
|
const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
160
169
|
const creator = useMemo(
|
|
161
170
|
() =>
|
|
162
|
-
|
|
171
|
+
Atom.make(() => {
|
|
163
172
|
return {
|
|
164
173
|
nodes: [
|
|
165
174
|
createMenuItemGroup('root', {
|
|
166
|
-
label: ['channel toolbar title', { ns:
|
|
175
|
+
label: ['channel toolbar title', { ns: meta.id }],
|
|
167
176
|
}),
|
|
168
177
|
createMenuAction('video-call', () => onJoinCall?.(), {
|
|
169
|
-
label: ['start video call label', { ns:
|
|
178
|
+
label: ['start video call label', { ns: meta.id }],
|
|
170
179
|
icon: 'ph--video-camera--regular',
|
|
171
180
|
type: 'video-call',
|
|
172
181
|
}),
|
|
@@ -180,19 +189,19 @@ const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
|
180
189
|
return useMenuActions(creator);
|
|
181
190
|
};
|
|
182
191
|
|
|
183
|
-
type ChannelToolbarProps =
|
|
192
|
+
type ChannelToolbarProps = {
|
|
184
193
|
attendableId?: string;
|
|
185
194
|
role?: string;
|
|
186
195
|
onJoinCall?: () => void;
|
|
187
|
-
}
|
|
196
|
+
};
|
|
188
197
|
|
|
189
|
-
const ChannelToolbar = ({ attendableId, role, onJoinCall
|
|
198
|
+
const ChannelToolbar = ({ attendableId, role, onJoinCall }: ChannelToolbarProps) => {
|
|
190
199
|
const menuProps = useChannelToolbarActions(onJoinCall);
|
|
191
200
|
|
|
192
201
|
return (
|
|
193
202
|
<ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
|
|
194
203
|
<MenuProvider {...menuProps} attendableId={attendableId}>
|
|
195
|
-
<ToolbarMenu
|
|
204
|
+
<ToolbarMenu textBlockWidth />
|
|
196
205
|
</MenuProvider>
|
|
197
206
|
</ElevationProvider>
|
|
198
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
|
+
|
|
22
|
+
import { translations } from '../translations';
|
|
23
|
+
import { Channel } from '../types';
|
|
21
24
|
|
|
22
25
|
import { ChatContainer } from './ChatContainer';
|
|
23
|
-
import translations from '../translations';
|
|
24
|
-
import { ChannelType, ThreadType } from '../types';
|
|
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 = {
|
|
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 = {
|
|
|
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,32 +5,31 @@
|
|
|
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,
|
|
18
|
-
|
|
15
|
+
Thread as ThreadComponent,
|
|
16
|
+
type ThreadRootProps,
|
|
19
17
|
threadLayout,
|
|
20
|
-
type ThreadProps,
|
|
21
18
|
} from '@dxos/react-ui-thread';
|
|
22
|
-
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';
|
|
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 {
|
|
29
|
-
import { type ThreadType } from '../types';
|
|
25
|
+
import { meta } from '../meta';
|
|
30
26
|
import { getMessageMetadata } from '../util';
|
|
31
27
|
|
|
28
|
+
import { command } from './command-extension';
|
|
29
|
+
import { MessageContainer } from './MessageContainer';
|
|
30
|
+
|
|
32
31
|
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
33
|
-
const { t } = useTranslation(
|
|
32
|
+
const { t } = useTranslation(meta.id);
|
|
34
33
|
return (
|
|
35
34
|
<div role='none' className='flex items-center'>
|
|
36
35
|
<StackItem.SigilButton attendableId={attendableId}>
|
|
@@ -41,19 +40,28 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
41
40
|
);
|
|
42
41
|
};
|
|
43
42
|
|
|
44
|
-
export type ChatContainerProps =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
>;
|
|
50
51
|
|
|
51
|
-
export const ChatContainer = ({
|
|
52
|
-
|
|
52
|
+
export const ChatContainer = ({
|
|
53
|
+
classNames,
|
|
54
|
+
space,
|
|
55
|
+
thread,
|
|
56
|
+
context,
|
|
57
|
+
current,
|
|
58
|
+
autoFocusTextbox,
|
|
59
|
+
}: ChatContainerProps) => {
|
|
60
|
+
const { t } = useTranslation(meta.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
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
57
65
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
58
66
|
const [_count, _setCount] = useState(0);
|
|
59
67
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
@@ -67,7 +75,7 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
67
75
|
() => [
|
|
68
76
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
69
77
|
createThemeExtensions({ themeMode }),
|
|
70
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
78
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
71
79
|
command,
|
|
72
80
|
],
|
|
73
81
|
[themeMode, _count],
|
|
@@ -90,16 +98,18 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
90
98
|
return false;
|
|
91
99
|
}
|
|
92
100
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
+
});
|
|
103
113
|
|
|
104
114
|
messageRef.current = '';
|
|
105
115
|
setAutoFocus(true);
|
|
@@ -109,13 +119,17 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
109
119
|
};
|
|
110
120
|
|
|
111
121
|
return (
|
|
112
|
-
<
|
|
122
|
+
<ThreadComponent.Root
|
|
113
123
|
current={current}
|
|
114
124
|
id={id}
|
|
115
|
-
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
|
+
]}
|
|
116
130
|
>
|
|
117
|
-
<ScrollArea.Root
|
|
118
|
-
<ScrollArea.Viewport classNames='
|
|
131
|
+
<ScrollArea.Root orientation='vertical'>
|
|
132
|
+
<ScrollArea.Viewport classNames='col-span-2'>
|
|
119
133
|
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
120
134
|
{thread.messages
|
|
121
135
|
.map((message) => message.target)
|
|
@@ -124,16 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
124
138
|
<MessageContainer key={message.id} message={message} members={members} />
|
|
125
139
|
))}
|
|
126
140
|
</div>
|
|
127
|
-
{/* 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. */}
|
|
128
142
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
129
|
-
<ScrollArea.Scrollbar>
|
|
130
|
-
<ScrollArea.Thumb />
|
|
131
|
-
</ScrollArea.Scrollbar>
|
|
132
143
|
</ScrollArea.Viewport>
|
|
133
144
|
</ScrollArea.Root>
|
|
145
|
+
|
|
134
146
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
135
|
-
<
|
|
136
|
-
</
|
|
147
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
148
|
+
</ThreadComponent.Root>
|
|
137
149
|
);
|
|
138
150
|
};
|
|
139
151
|
|
|
@@ -2,84 +2,92 @@
|
|
|
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
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
14
|
import { faker } from '@dxos/random';
|
|
14
|
-
import {
|
|
15
|
+
import { useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
15
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
16
|
-
import {
|
|
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';
|
|
21
|
+
|
|
22
|
+
import { translations } from '../translations';
|
|
19
23
|
|
|
20
24
|
import { CommentsContainer } from './CommentsContainer';
|
|
21
|
-
import { createCommentThread } from './testing';
|
|
22
|
-
import translations from '../translations';
|
|
23
|
-
import { ThreadType } from '../types';
|
|
25
|
+
import { createCommentThread, createProposalThread } from './testing';
|
|
24
26
|
|
|
25
27
|
faker.seed(1);
|
|
26
28
|
|
|
27
|
-
const
|
|
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='flex justify-center overflow-y-auto bg-white dark:bg-black'>
|
|
62
|
-
<div className='flex flex-col w-[30rem]'>
|
|
63
|
-
<CommentsContainer anchors={anchors} onThreadDelete={console.log} />
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
60
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
67
61
|
};
|
|
68
62
|
|
|
69
|
-
const meta
|
|
63
|
+
const meta = {
|
|
70
64
|
title: 'plugins/plugin-thread/Comments',
|
|
71
|
-
|
|
72
|
-
render: () => <ClientRepeater component={Story} createIdentity createSpace types={[ThreadType, DataType.Message]} />,
|
|
65
|
+
render: render(DefaultStory),
|
|
73
66
|
decorators: [
|
|
74
|
-
withTheme,
|
|
75
|
-
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.
|
|
76
71
|
withPluginManager({
|
|
77
|
-
plugins: [
|
|
72
|
+
plugins: [
|
|
73
|
+
OperationPlugin(),
|
|
74
|
+
ClientPlugin({
|
|
75
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
76
|
+
onClientInitialized: ({ client }) =>
|
|
77
|
+
Effect.gen(function* () {
|
|
78
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
79
|
+
}),
|
|
80
|
+
}),
|
|
81
|
+
],
|
|
78
82
|
}),
|
|
79
83
|
],
|
|
80
|
-
parameters: {
|
|
81
|
-
|
|
84
|
+
parameters: {
|
|
85
|
+
translations,
|
|
86
|
+
},
|
|
87
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
82
88
|
|
|
83
89
|
export default meta;
|
|
84
90
|
|
|
85
|
-
|
|
91
|
+
type Story = StoryObj<typeof meta>;
|
|
92
|
+
|
|
93
|
+
export const Default: Story = {};
|