@dxos/plugin-thread 0.8.4-main.1f223c7 → 0.8.4-main.2244d791bb
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-RWH6FTW7.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-RWH6FTW7.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-CBX65FMW.mjs +105 -0
- package/dist/lib/browser/chunk-CBX65FMW.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-ZCEU5K23.mjs → chunk-ERK254BS.mjs} +207 -287
- package/dist/lib/browser/chunk-ERK254BS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XYUJXHYV.mjs → chunk-ISCHODBV.mjs} +1 -1
- package/dist/lib/browser/{chunk-XYUJXHYV.mjs.map → chunk-ISCHODBV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/{chunk-RI3Z6MK3.mjs → chunk-JBB73URQ.mjs} +79 -76
- package/dist/lib/browser/chunk-JBB73URQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +147 -139
- 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-QZ3GXYAN.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-QZ3GXYAN.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-2UQ73JQJ.mjs +107 -0
- package/dist/lib/node-esm/chunk-2UQ73JQJ.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-JNPKMT7O.mjs → chunk-G7PZNN3Z.mjs} +79 -76
- 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-TIPIOH2J.mjs → chunk-QP3KQOPQ.mjs} +207 -287
- 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-2V3WSLUZ.mjs → chunk-VBI32FGI.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs.map → chunk-VBI32FGI.mjs.map} +2 -2
- 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 +147 -139
- 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 +4 -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 +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +1 -1
- package/dist/types/src/calls/util/calls-service.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 +0 -1
- 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 +6 -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 -16
- 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.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 +78 -9
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +77 -6
- 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 +5 -2
- 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 +8 -8
- 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 +6 -4
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +4 -3
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +6 -2
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +6 -2
- 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/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 -3
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +7 -2
- 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 +14 -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 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- 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 +76 -6
- 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 +3218 -445
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +90 -67
- package/src/ThreadPlugin.tsx +107 -135
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +40 -0
- package/src/calls/call-manager.ts +76 -52
- package/src/calls/call-swarm-synchronizer.ts +2 -2
- package/src/calls/media-manager.ts +10 -7
- package/src/calls/util/calls-service.ts +1 -1
- package/src/calls/util/stub-media-streams.ts +2 -2
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +2 -5
- 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 +17 -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 -13
- 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 +8 -4
- package/src/components/Call/Toolbar.tsx +34 -25
- package/src/components/CallDebugPanel.tsx +12 -14
- package/src/components/CallSidebar.tsx +5 -3
- package/src/components/ChannelContainer.stories.tsx +16 -15
- package/src/components/ChannelContainer.tsx +39 -32
- package/src/components/Chat.stories.tsx +20 -24
- package/src/components/ChatContainer.tsx +46 -39
- package/src/components/Comments.stories.tsx +31 -34
- package/src/components/CommentsContainer.tsx +5 -7
- package/src/components/CommentsThreadContainer.tsx +39 -35
- package/src/components/Lobby/Lobby.tsx +9 -7
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +12 -7
- package/src/components/Media/VideoObject.tsx +2 -2
- package/src/components/MessageContainer.tsx +59 -28
- package/src/components/Participant/Participant.tsx +32 -19
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +3 -4
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +3 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +4 -5
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +6 -3
- package/src/components/ThreadCompanion.tsx +194 -0
- package/src/components/ThreadSettings.tsx +11 -6
- package/src/components/command-extension.ts +2 -2
- package/src/components/index.ts +4 -7
- package/src/components/testing.ts +7 -9
- package/src/extensions/threads.ts +86 -42
- package/src/functions/create-proposals.ts +57 -0
- package/src/functions/index.ts +9 -0
- package/src/hooks/analytics.ts +21 -21
- package/src/hooks/index.ts +3 -2
- package/src/hooks/useVideoStreamTrack.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +11 -7
- package/src/testing/stories.ts +18 -16
- package/src/translations.ts +6 -3
- 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 +168 -89
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-4PYFOIDK.mjs +0 -16
- package/dist/lib/browser/ChatContainer-EXNNREYB.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-FHAOPO57.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-FHAOPO57.mjs.map +0 -7
- package/dist/lib/browser/call-manager-RMPTWSTF.mjs +0 -24
- package/dist/lib/browser/call-manager-RMPTWSTF.mjs.map +0 -7
- package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
- package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7QK5ZP.mjs +0 -986
- package/dist/lib/browser/chunk-7W7QK5ZP.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-G4CNILRR.mjs +0 -23
- package/dist/lib/browser/chunk-G4CNILRR.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KTWYVC5X.mjs +0 -147
- package/dist/lib/browser/chunk-KTWYVC5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-PBMNFG3B.mjs +0 -376
- package/dist/lib/browser/chunk-PBMNFG3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-RI3Z6MK3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZH2WPTNP.mjs +0 -618
- package/dist/lib/browser/chunk-ZH2WPTNP.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-J7OCP2P6.mjs +0 -427
- package/dist/lib/browser/intent-resolver-J7OCP2P6.mjs.map +0 -7
- package/dist/lib/browser/markdown-Z677YORA.mjs +0 -169
- package/dist/lib/browser/markdown-Z677YORA.mjs.map +0 -7
- package/dist/lib/browser/react-root-XKOD4KRB.mjs +0 -28
- package/dist/lib/browser/react-root-XKOD4KRB.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GVGZRBDK.mjs +0 -109
- package/dist/lib/browser/react-surface-GVGZRBDK.mjs.map +0 -7
- package/dist/lib/browser/settings-GRKEID73.mjs +0 -22
- package/dist/lib/browser/settings-GRKEID73.mjs.map +0 -7
- package/dist/lib/browser/state-2T4KDWBX.mjs +0 -34
- package/dist/lib/browser/state-2T4KDWBX.mjs.map +0 -7
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs +0 -80
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-KQQEZWUN.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-QVQKFBWA.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-XEYWX5FC.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-XEYWX5FC.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-QAREJFVX.mjs +0 -25
- package/dist/lib/node-esm/call-manager-QAREJFVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4T45PCKP.mjs +0 -25
- package/dist/lib/node-esm/chunk-4T45PCKP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DKCQCENK.mjs +0 -377
- package/dist/lib/node-esm/chunk-DKCQCENK.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-JNPKMT7O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LE2LIYGX.mjs +0 -619
- package/dist/lib/node-esm/chunk-LE2LIYGX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P6E247RF.mjs +0 -148
- package/dist/lib/node-esm/chunk-P6E247RF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SNKFZQST.mjs +0 -987
- package/dist/lib/node-esm/chunk-SNKFZQST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SR2LW4HF.mjs +0 -428
- package/dist/lib/node-esm/intent-resolver-SR2LW4HF.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-FL4IXLRP.mjs +0 -170
- package/dist/lib/node-esm/markdown-FL4IXLRP.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-4JWDRIQB.mjs +0 -29
- package/dist/lib/node-esm/react-root-4JWDRIQB.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-WLQUVRAX.mjs +0 -110
- package/dist/lib/node-esm/react-surface-WLQUVRAX.mjs.map +0 -7
- package/dist/lib/node-esm/settings-F2ODVNNW.mjs +0 -23
- package/dist/lib/node-esm/settings-F2ODVNNW.mjs.map +0 -7
- package/dist/lib/node-esm/state-62TQKQVB.mjs +0 -35
- package/dist/lib/node-esm/state-62TQKQVB.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs +0 -81
- package/dist/lib/node-esm/toolkit-KZIS7G36.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/capabilities/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.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 -177
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -183
- package/src/capabilities/call-manager.ts +0 -20
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -348
- package/src/capabilities/markdown.ts +0 -69
- package/src/capabilities/react-root.tsx +0 -17
- package/src/capabilities/react-surface.tsx +0 -89
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -26
- package/src/capabilities/toolkit.ts +0 -78
- package/src/components/ThreadComplementary.tsx +0 -181
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-4PYFOIDK.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-EXNNREYB.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-KQQEZWUN.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-QVQKFBWA.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { Capabilities,
|
|
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
16
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { render
|
|
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';
|
|
22
21
|
|
|
23
22
|
import { translations } from '../translations';
|
|
24
|
-
import {
|
|
23
|
+
import { Channel } from '../types';
|
|
25
24
|
|
|
26
25
|
import { ChatContainer } from './ChatContainer';
|
|
27
26
|
|
|
@@ -31,17 +30,12 @@ const DefaultStory = () => {
|
|
|
31
30
|
const client = useClient();
|
|
32
31
|
const identity = useIdentity();
|
|
33
32
|
const [space, setSpace] = useState<Space>();
|
|
34
|
-
const [channel, setChannel] = useState<
|
|
33
|
+
const [channel, setChannel] = useState<Channel.Channel | null>();
|
|
35
34
|
|
|
36
35
|
useAsyncEffect(async () => {
|
|
37
36
|
if (identity) {
|
|
38
37
|
const space = await client.spaces.create();
|
|
39
|
-
const channel = space.db.add(
|
|
40
|
-
Obj.make(ChannelType, {
|
|
41
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
42
|
-
threads: [],
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
38
|
+
const channel = space.db.add(Channel.make());
|
|
45
39
|
setSpace(space);
|
|
46
40
|
setChannel(channel);
|
|
47
41
|
}
|
|
@@ -52,7 +46,7 @@ const DefaultStory = () => {
|
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
return (
|
|
55
|
-
<main className='is-full 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
|
);
|
|
@@ -60,15 +54,16 @@ const DefaultStory = () => {
|
|
|
60
54
|
|
|
61
55
|
const meta = {
|
|
62
56
|
title: 'plugins/plugin-thread/Chat',
|
|
63
|
-
component:
|
|
57
|
+
component: ThreadComponent.Root as any,
|
|
64
58
|
render: render(DefaultStory),
|
|
65
59
|
decorators: [
|
|
60
|
+
withTheme(),
|
|
66
61
|
withPluginManager({
|
|
67
|
-
plugins: [
|
|
62
|
+
plugins: [OperationPlugin()],
|
|
68
63
|
capabilities: [
|
|
69
|
-
contributes(
|
|
64
|
+
Capability.contributes(
|
|
70
65
|
Capabilities.ReactSurface,
|
|
71
|
-
|
|
66
|
+
Surface.create({
|
|
72
67
|
id: 'test',
|
|
73
68
|
role: 'card',
|
|
74
69
|
component: ({ role }) => <span>{JSON.stringify({ role })}</span>,
|
|
@@ -76,11 +71,12 @@ const meta = {
|
|
|
76
71
|
),
|
|
77
72
|
],
|
|
78
73
|
}),
|
|
79
|
-
|
|
80
|
-
withLayout({ fullscreen: true }),
|
|
81
|
-
withClientProvider({ createSpace: true, types: [ThreadType, ChannelType, DataType.Message] }),
|
|
74
|
+
withClientProvider({ createSpace: true, types: [Thread.Thread, Channel.Channel, Message.Message] }),
|
|
82
75
|
],
|
|
83
|
-
parameters: {
|
|
76
|
+
parameters: {
|
|
77
|
+
layout: 'fullscreen',
|
|
78
|
+
translations,
|
|
79
|
+
},
|
|
84
80
|
} satisfies Meta<typeof DefaultStory>;
|
|
85
81
|
|
|
86
82
|
export default meta;
|
|
@@ -5,25 +5,24 @@
|
|
|
5
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { type Space,
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
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
24
|
import { useStatus } from '../hooks';
|
|
25
25
|
import { meta } from '../meta';
|
|
26
|
-
import { type ThreadType } from '../types';
|
|
27
26
|
import { getMessageMetadata } from '../util';
|
|
28
27
|
|
|
29
28
|
import { command } from './command-extension';
|
|
@@ -41,18 +40,27 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
41
40
|
);
|
|
42
41
|
};
|
|
43
42
|
|
|
44
|
-
export type ChatContainerProps =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
export type ChatContainerProps = ThemedClassName<
|
|
44
|
+
{
|
|
45
|
+
space: Space;
|
|
46
|
+
thread: Thread.Thread;
|
|
47
|
+
context?: Obj.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) => {
|
|
52
60
|
const { t } = useTranslation(meta.id);
|
|
53
|
-
const id =
|
|
61
|
+
const id = Obj.getDXN(thread).toString();
|
|
54
62
|
const identity = useIdentity()!;
|
|
55
|
-
const members = useMembers(space?.
|
|
63
|
+
const members = useMembers(space?.id);
|
|
56
64
|
const activity = useStatus(space, id);
|
|
57
65
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
58
66
|
const [_count, _setCount] = useState(0);
|
|
@@ -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,16 +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
125
|
classNames={[
|
|
116
|
-
'bs-full
|
|
126
|
+
'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
117
127
|
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
128
|
+
classNames,
|
|
118
129
|
]}
|
|
119
130
|
>
|
|
120
|
-
<ScrollArea.Root
|
|
121
|
-
<ScrollArea.Viewport classNames='
|
|
131
|
+
<ScrollArea.Root orientation='vertical'>
|
|
132
|
+
<ScrollArea.Viewport classNames='col-span-2'>
|
|
122
133
|
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
123
134
|
{thread.messages
|
|
124
135
|
.map((message) => message.target)
|
|
@@ -127,18 +138,14 @@ export const ChatContainer = ({ space, thread, context, current, autoFocusTextbo
|
|
|
127
138
|
<MessageContainer key={message.id} message={message} members={members} />
|
|
128
139
|
))}
|
|
129
140
|
</div>
|
|
130
|
-
{/* 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. */}
|
|
131
142
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
132
|
-
<ScrollArea.Scrollbar>
|
|
133
|
-
<ScrollArea.Thumb />
|
|
134
|
-
</ScrollArea.Scrollbar>
|
|
135
143
|
</ScrollArea.Viewport>
|
|
136
144
|
</ScrollArea.Root>
|
|
137
145
|
|
|
138
146
|
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</Thread.Root>
|
|
147
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
148
|
+
</ThreadComponent.Root>
|
|
142
149
|
);
|
|
143
150
|
};
|
|
144
151
|
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
|
-
import {
|
|
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
17
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
|
+
import { render } from '@dxos/storybook-utils';
|
|
20
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
20
21
|
|
|
21
22
|
import { translations } from '../translations';
|
|
22
|
-
import { ThreadType } from '../types';
|
|
23
23
|
|
|
24
24
|
import { CommentsContainer } from './CommentsContainer';
|
|
25
25
|
import { createCommentThread, createProposalThread } from './testing';
|
|
@@ -28,58 +28,55 @@ faker.seed(1);
|
|
|
28
28
|
|
|
29
29
|
const DefaultStory = () => {
|
|
30
30
|
const identity = useIdentity();
|
|
31
|
-
const
|
|
32
|
-
const anchors = useQuery(
|
|
31
|
+
const db = useDatabase();
|
|
32
|
+
const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
|
|
33
33
|
|
|
34
34
|
useAsyncEffect(async () => {
|
|
35
|
-
if (identity &&
|
|
36
|
-
const object =
|
|
37
|
-
const thread1 =
|
|
38
|
-
const thread2 =
|
|
39
|
-
|
|
40
|
-
Relation.make(AnchoredTo, {
|
|
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
41
|
[Relation.Source]: thread1,
|
|
42
42
|
[Relation.Target]: object,
|
|
43
43
|
anchor: 'test',
|
|
44
44
|
}),
|
|
45
45
|
);
|
|
46
|
-
|
|
47
|
-
Relation.make(AnchoredTo, {
|
|
46
|
+
db.add(
|
|
47
|
+
Relation.make(AnchoredTo.AnchoredTo, {
|
|
48
48
|
[Relation.Source]: thread2,
|
|
49
49
|
[Relation.Target]: object,
|
|
50
50
|
anchor: 'test',
|
|
51
51
|
}),
|
|
52
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} onAcceptProposal={console.log} />
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
60
|
+
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
65
61
|
};
|
|
66
62
|
|
|
67
63
|
const meta = {
|
|
68
64
|
title: 'plugins/plugin-thread/Comments',
|
|
69
65
|
render: render(DefaultStory),
|
|
70
66
|
decorators: [
|
|
71
|
-
withTheme,
|
|
72
|
-
withLayout({
|
|
73
|
-
// TODO(wittjosiah): This shouldn't depend on app framework
|
|
74
|
-
//
|
|
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.
|
|
75
71
|
withPluginManager({
|
|
76
72
|
plugins: [
|
|
77
|
-
|
|
73
|
+
OperationPlugin(),
|
|
78
74
|
ClientPlugin({
|
|
79
|
-
types: [
|
|
80
|
-
onClientInitialized:
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
types: [Message.Message, Thread.Thread, AnchoredTo.AnchoredTo],
|
|
76
|
+
onClientInitialized: ({ client }) =>
|
|
77
|
+
Effect.gen(function* () {
|
|
78
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
79
|
+
}),
|
|
83
80
|
}),
|
|
84
81
|
],
|
|
85
82
|
}),
|
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
7
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
9
8
|
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/
|
|
9
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
11
10
|
|
|
12
11
|
import { meta } from '../meta';
|
|
13
|
-
import { type ThreadType } from '../types';
|
|
14
12
|
|
|
15
13
|
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
16
14
|
|
|
17
15
|
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
18
|
-
anchors: AnchoredTo[];
|
|
16
|
+
anchors: AnchoredTo.AnchoredTo[];
|
|
19
17
|
currentId?: string;
|
|
20
18
|
showResolvedThreads?: boolean;
|
|
21
19
|
};
|
|
@@ -63,8 +61,8 @@ export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...
|
|
|
63
61
|
return (
|
|
64
62
|
<div>
|
|
65
63
|
{filteredAnchors.map((anchor) => {
|
|
66
|
-
const thread = Relation.getSource(anchor) as
|
|
67
|
-
const threadId =
|
|
64
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
65
|
+
const threadId = Obj.getDXN(thread).toString();
|
|
68
66
|
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
69
67
|
})}
|
|
70
68
|
</div>
|
|
@@ -4,32 +4,36 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
8
|
+
import { useObject } from '@dxos/echo-react';
|
|
9
|
+
import { getSpace, useMembers } from '@dxos/react-client/echo';
|
|
9
10
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
11
|
import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
import {
|
|
13
|
+
MessageTextbox,
|
|
14
|
+
type MessageTextboxProps,
|
|
15
|
+
Thread as ThreadComponent,
|
|
16
|
+
type ThreadRootProps,
|
|
17
|
+
} from '@dxos/react-ui-thread';
|
|
18
|
+
import { type AnchoredTo, type Thread } from '@dxos/types';
|
|
19
|
+
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
|
|
20
|
+
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';
|
|
16
21
|
|
|
17
22
|
import { useStatus } from '../hooks';
|
|
18
23
|
import { meta } from '../meta';
|
|
19
|
-
import { type ThreadType } from '../types';
|
|
20
24
|
import { getMessageMetadata } from '../util';
|
|
21
25
|
|
|
22
26
|
import { command } from './command-extension';
|
|
23
27
|
import { MessageContainer, buttonClassNames, buttonGroupClassNames } from './MessageContainer';
|
|
24
28
|
|
|
25
29
|
export type CommentsThreadContainerProps = {
|
|
26
|
-
anchor: AnchoredTo;
|
|
27
|
-
onAttend?: (anchor: AnchoredTo) => void;
|
|
28
|
-
onComment?: (anchor: AnchoredTo, message: string) => void;
|
|
29
|
-
onResolve?: (anchor: AnchoredTo) => void;
|
|
30
|
-
onMessageDelete?: (anchor: AnchoredTo, messageId: string) => void;
|
|
31
|
-
onThreadDelete?: (anchor: AnchoredTo) => void;
|
|
32
|
-
onAcceptProposal?: (anchor: AnchoredTo, messageId: string) => void;
|
|
30
|
+
anchor: AnchoredTo.AnchoredTo;
|
|
31
|
+
onAttend?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
32
|
+
onComment?: (anchor: AnchoredTo.AnchoredTo, message: string) => void;
|
|
33
|
+
onResolve?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
34
|
+
onMessageDelete?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
|
|
35
|
+
onThreadDelete?: (anchor: AnchoredTo.AnchoredTo) => void;
|
|
36
|
+
onAcceptProposal?: (anchor: AnchoredTo.AnchoredTo, messageId: string) => void;
|
|
33
37
|
} & Pick<ThreadRootProps, 'current'>;
|
|
34
38
|
|
|
35
39
|
export const CommentsThreadContainer = ({
|
|
@@ -42,29 +46,30 @@ export const CommentsThreadContainer = ({
|
|
|
42
46
|
onThreadDelete,
|
|
43
47
|
onAcceptProposal,
|
|
44
48
|
}: CommentsThreadContainerProps) => {
|
|
49
|
+
const { themeMode } = useThemeContext();
|
|
45
50
|
const { t } = useTranslation(meta.id);
|
|
46
51
|
const identity = useIdentity()!;
|
|
47
52
|
const space = getSpace(anchor);
|
|
48
|
-
const members = useMembers(space?.
|
|
53
|
+
const members = useMembers(space?.id);
|
|
49
54
|
const detached = !anchor.anchor;
|
|
50
|
-
const thread = Relation.getSource(anchor) as
|
|
51
|
-
const
|
|
55
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
56
|
+
const [messages] = useObject(thread, 'messages');
|
|
57
|
+
const activity = useStatus(space, Obj.getDXN(thread).toString());
|
|
52
58
|
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
53
|
-
const { themeMode } = useThemeContext();
|
|
54
59
|
|
|
55
|
-
const textboxMetadata = getMessageMetadata(
|
|
60
|
+
const textboxMetadata = getMessageMetadata(Obj.getDXN(thread).toString(), identity);
|
|
61
|
+
|
|
56
62
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
57
|
-
const [
|
|
58
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
63
|
+
const [state, setState] = useState({});
|
|
59
64
|
const messageRef = useRef('');
|
|
60
65
|
const extensions = useMemo(
|
|
61
66
|
() => [
|
|
62
67
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
63
68
|
createThemeExtensions({ themeMode }),
|
|
64
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
69
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
65
70
|
command,
|
|
66
71
|
],
|
|
67
|
-
[
|
|
72
|
+
[state],
|
|
68
73
|
);
|
|
69
74
|
|
|
70
75
|
// TODO(thure): Factor out.
|
|
@@ -85,14 +90,14 @@ export const CommentsThreadContainer = ({
|
|
|
85
90
|
onComment?.(anchor, messageRef.current);
|
|
86
91
|
messageRef.current = '';
|
|
87
92
|
scrollToEnd('instant');
|
|
88
|
-
|
|
93
|
+
setState({});
|
|
89
94
|
|
|
90
95
|
return true;
|
|
91
96
|
}, [anchor, identity]);
|
|
92
97
|
|
|
93
98
|
return (
|
|
94
|
-
<
|
|
95
|
-
id={
|
|
99
|
+
<ThreadComponent.Root
|
|
100
|
+
id={Obj.getDXN(thread).toString()}
|
|
96
101
|
classNames='pbs-2 border-be border-subduedSeparator last:border-none'
|
|
97
102
|
current={current}
|
|
98
103
|
onClickCapture={handleAttend}
|
|
@@ -108,10 +113,10 @@ export const CommentsThreadContainer = ({
|
|
|
108
113
|
>
|
|
109
114
|
{detached ? (
|
|
110
115
|
<Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
|
|
111
|
-
<
|
|
116
|
+
<ThreadComponent.Header detached>{thread.name}</ThreadComponent.Header>
|
|
112
117
|
</Tooltip.Trigger>
|
|
113
118
|
) : (
|
|
114
|
-
<
|
|
119
|
+
<ThreadComponent.Header>{thread.name}</ThreadComponent.Header>
|
|
115
120
|
)}
|
|
116
121
|
<div role='none' className={buttonGroupClassNames}>
|
|
117
122
|
{thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
|
|
@@ -140,12 +145,11 @@ export const CommentsThreadContainer = ({
|
|
|
140
145
|
</div>
|
|
141
146
|
</div>
|
|
142
147
|
|
|
143
|
-
{
|
|
144
|
-
{Ref.Array.targets(thread.messages?.filter(isNonNullable) ?? []).map((message) => (
|
|
148
|
+
{messages?.map((ref) => (
|
|
145
149
|
<MessageContainer
|
|
146
|
-
key={
|
|
150
|
+
key={ref.dxn.toString()}
|
|
147
151
|
editable
|
|
148
|
-
message={
|
|
152
|
+
message={ref}
|
|
149
153
|
members={members}
|
|
150
154
|
onDelete={handleMessageDelete}
|
|
151
155
|
onAcceptProposal={handleAcceptProposal}
|
|
@@ -160,10 +164,10 @@ export const CommentsThreadContainer = ({
|
|
|
160
164
|
*/}
|
|
161
165
|
<MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
|
|
162
166
|
|
|
163
|
-
<
|
|
167
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
164
168
|
|
|
165
169
|
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
166
170
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
167
|
-
</
|
|
171
|
+
</ThreadComponent.Root>
|
|
168
172
|
);
|
|
169
173
|
};
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
5
6
|
import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
8
9
|
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { mx } from '@dxos/
|
|
10
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
11
|
|
|
11
|
-
import { ThreadCapabilities } from '../../capabilities';
|
|
12
12
|
import { meta } from '../../meta';
|
|
13
|
+
import { ThreadCapabilities } from '../../types';
|
|
13
14
|
import { Toolbar, type ToolbarProps } from '../Call';
|
|
14
15
|
import { VideoObject } from '../Media';
|
|
15
16
|
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
@@ -39,9 +40,10 @@ type LobbyPreviewProps = {};
|
|
|
39
40
|
const LobbyPreview: FC<LobbyPreviewProps> = () => {
|
|
40
41
|
const { t } = useTranslation(meta.id);
|
|
41
42
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
43
|
+
const media = useAtomValue(call.mediaAtom);
|
|
42
44
|
const [classNames, setClassNames] = useState('');
|
|
43
45
|
useEffect(() => {
|
|
44
|
-
if (!
|
|
46
|
+
if (!media.videoEnabled) {
|
|
45
47
|
setClassNames('');
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
@@ -52,14 +54,14 @@ const LobbyPreview: FC<LobbyPreviewProps> = () => {
|
|
|
52
54
|
}, 500);
|
|
53
55
|
|
|
54
56
|
return () => clearTimeout(timeout);
|
|
55
|
-
}, [
|
|
57
|
+
}, [media.videoEnabled]);
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<div className='grid grow p-4'>
|
|
59
61
|
<ResponsiveContainer>
|
|
60
|
-
{(
|
|
62
|
+
{(media.videoEnabled && (
|
|
61
63
|
<VideoObject
|
|
62
|
-
videoStream={
|
|
64
|
+
videoStream={media.videoStream}
|
|
63
65
|
flip
|
|
64
66
|
muted
|
|
65
67
|
classNames={mx(
|
|
@@ -46,13 +46,13 @@ export const AudioStream: FC<AudioStreamProps> = ({ tracks }) => {
|
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
type
|
|
49
|
+
type AudioTrackParams = {
|
|
50
50
|
track: MediaStreamTrack;
|
|
51
51
|
mediaStream: MediaStream;
|
|
52
52
|
resetSrcObject: () => void;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const AudioTrack = ({ track, mediaStream, resetSrcObject }:
|
|
55
|
+
const AudioTrack = ({ track, mediaStream, resetSrcObject }: AudioTrackParams) => {
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
const currentTrack = track;
|
|
58
58
|
mediaStream.addTrack(currentTrack);
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { scheduleTask } from '@dxos/async';
|
|
11
9
|
import { Context } from '@dxos/context';
|
|
12
10
|
import { log } from '@dxos/log';
|
|
13
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
|
|
15
13
|
import { getUserMediaTrack } from '../../calls';
|
|
16
14
|
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
@@ -23,9 +21,13 @@ const DefaultStory = (props: VideoObjectProps) => {
|
|
|
23
21
|
useEffect(() => {
|
|
24
22
|
const ctx = new Context();
|
|
25
23
|
scheduleTask(ctx, async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
try {
|
|
25
|
+
const stream = new MediaStream();
|
|
26
|
+
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
27
|
+
setVideoStream(stream);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
log.catch(err);
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
return () => {
|
|
@@ -45,7 +47,10 @@ const meta = {
|
|
|
45
47
|
title: 'plugins/plugin-thread/VideoObject',
|
|
46
48
|
component: VideoObject,
|
|
47
49
|
render: DefaultStory,
|
|
48
|
-
decorators: [withTheme
|
|
50
|
+
decorators: [withTheme()],
|
|
51
|
+
parameters: {
|
|
52
|
+
layout: 'fullscreen',
|
|
53
|
+
},
|
|
49
54
|
};
|
|
50
55
|
|
|
51
56
|
export default meta;
|