@dxos/plugin-thread 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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-7C2QW32W.mjs +188 -0
- package/dist/lib/browser/app-graph-builder-7C2QW32W.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/call-manager-4P536YNX.mjs +26 -0
- package/dist/lib/browser/call-manager-4P536YNX.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-HDEQRBOC.mjs → chunk-DLO2G3DM.mjs} +79 -76
- package/dist/lib/browser/chunk-DLO2G3DM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-US5ZQYC3.mjs → chunk-ERK254BS.mjs} +78 -61
- 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-YSHXWAL3.mjs +1815 -0
- package/dist/lib/browser/chunk-YSHXWAL3.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZFLSTQSE.mjs +106 -0
- package/dist/lib/browser/chunk-ZFLSTQSE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +121 -114
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/markdown-QMJLRR6R.mjs +210 -0
- package/dist/lib/browser/markdown-QMJLRR6R.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-T63EP5TY.mjs +441 -0
- package/dist/lib/browser/operation-resolver-T63EP5TY.mjs.map +7 -0
- package/dist/lib/browser/react-root-56MJI77R.mjs +25 -0
- package/dist/lib/browser/react-root-56MJI77R.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-IC576W2W.mjs → react-surface-DMBHQOXJ.mjs} +43 -42
- package/dist/lib/browser/react-surface-DMBHQOXJ.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-WZMJMML3.mjs +32 -0
- package/dist/lib/browser/settings-WZMJMML3.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 +7 -7
- package/dist/lib/node-esm/app-graph-builder-JCSVFRVY.mjs +189 -0
- package/dist/lib/node-esm/app-graph-builder-JCSVFRVY.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/call-manager-FMLRR5S5.mjs +27 -0
- package/dist/lib/node-esm/call-manager-FMLRR5S5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7XQLXMX7.mjs +1816 -0
- package/dist/lib/node-esm/chunk-7XQLXMX7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs +107 -0
- package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/{chunk-2MMJF7DW.mjs → chunk-KRBZBJRI.mjs} +79 -76
- package/dist/lib/node-esm/chunk-KRBZBJRI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KGYDYYKJ.mjs → chunk-QP3KQOPQ.mjs} +78 -61
- package/dist/lib/node-esm/chunk-QP3KQOPQ.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 +121 -114
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/markdown-L6LLQLIN.mjs +211 -0
- package/dist/lib/node-esm/markdown-L6LLQLIN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-G6GZPBRP.mjs +442 -0
- package/dist/lib/node-esm/operation-resolver-G6GZPBRP.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-V4W4X5GL.mjs +26 -0
- package/dist/lib/node-esm/react-root-V4W4X5GL.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-O4LGTAZ3.mjs → react-surface-ELDSTUA3.mjs} +43 -42
- package/dist/lib/node-esm/react-surface-ELDSTUA3.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-37CO3SNR.mjs +33 -0
- package/dist/lib/node-esm/settings-37CO3SNR.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 +7 -7
- 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 +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/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 +9 -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 +5 -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.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 +4 -5
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +6 -2
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +5 -1
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +2 -2
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +5 -1
- 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 +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +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 +5 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +5 -1
- 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 +1 -1
- 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 +6 -0
- package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +2 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/hooks/analytics.d.ts +2 -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/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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 +5 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +691 -12
- package/dist/types/src/types/Channel.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3216 -430
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +86 -65
- package/src/ThreadPlugin.tsx +56 -88
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +32 -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/capabilities/app-graph-builder/app-graph-builder.ts +201 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -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 +97 -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 +33 -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 +31 -23
- package/src/components/CallDebugPanel.tsx +12 -14
- package/src/components/CallSidebar.tsx +5 -3
- package/src/components/ChannelContainer.stories.tsx +12 -10
- package/src/components/ChannelContainer.tsx +22 -19
- package/src/components/Chat.stories.tsx +9 -9
- package/src/components/ChatContainer.tsx +22 -21
- package/src/components/Comments.stories.tsx +25 -23
- package/src/components/CommentsContainer.tsx +4 -6
- package/src/components/CommentsThreadContainer.tsx +21 -22
- package/src/components/Lobby/Lobby.tsx +9 -7
- package/src/components/Media/AudioStream.tsx +2 -2
- 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.tsx +3 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +6 -3
- package/src/components/{ThreadComplementary.tsx → ThreadCompanion.tsx} +79 -67
- package/src/components/ThreadSettings.tsx +6 -1
- package/src/components/command-extension.ts +2 -2
- package/src/components/index.ts +4 -7
- package/src/components/testing.ts +3 -5
- package/src/extensions/threads.ts +82 -38
- package/src/functions/create-proposals.ts +57 -0
- package/src/functions/index.ts +5 -0
- package/src/hooks/analytics.ts +21 -21
- package/src/hooks/index.ts +3 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -2
- package/src/testing/stories.ts +15 -11
- package/src/translations.ts +3 -1
- package/src/types/Channel.ts +13 -10
- package/src/types/capabilities.ts +34 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.ts +163 -85
- package/dist/lib/browser/ChannelContainer-SVV4ZX5T.mjs +0 -16
- package/dist/lib/browser/ChatContainer-ALFWQ65B.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-ACBXRBOS.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-ACBXRBOS.mjs.map +0 -7
- package/dist/lib/browser/call-manager-P3MYR2JS.mjs +0 -24
- package/dist/lib/browser/call-manager-P3MYR2JS.mjs.map +0 -7
- package/dist/lib/browser/chunk-6CUDBEYP.mjs +0 -377
- package/dist/lib/browser/chunk-6CUDBEYP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BBTXGRIR.mjs +0 -18
- package/dist/lib/browser/chunk-BBTXGRIR.mjs.map +0 -7
- package/dist/lib/browser/chunk-DJOUMWEL.mjs +0 -988
- package/dist/lib/browser/chunk-DJOUMWEL.mjs.map +0 -7
- package/dist/lib/browser/chunk-HDEQRBOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQSXEHOW.mjs +0 -618
- package/dist/lib/browser/chunk-IQSXEHOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-K2DUJRFJ.mjs +0 -27
- package/dist/lib/browser/chunk-K2DUJRFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L6F2AG6W.mjs +0 -23
- package/dist/lib/browser/chunk-L6F2AG6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-US5ZQYC3.mjs.map +0 -7
- package/dist/lib/browser/chunk-UTSLSZED.mjs +0 -178
- package/dist/lib/browser/chunk-UTSLSZED.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5POQTZ24.mjs +0 -419
- package/dist/lib/browser/intent-resolver-5POQTZ24.mjs.map +0 -7
- package/dist/lib/browser/markdown-L7LDNF56.mjs +0 -169
- package/dist/lib/browser/markdown-L7LDNF56.mjs.map +0 -7
- package/dist/lib/browser/react-root-RCJLK4EP.mjs +0 -28
- package/dist/lib/browser/react-root-RCJLK4EP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IC576W2W.mjs.map +0 -7
- package/dist/lib/browser/settings-5FYGBOGI.mjs +0 -22
- package/dist/lib/browser/settings-5FYGBOGI.mjs.map +0 -7
- package/dist/lib/browser/state-36REWXO5.mjs +0 -34
- package/dist/lib/browser/state-36REWXO5.mjs.map +0 -7
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs +0 -74
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-63GMQ753.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-MFKPXMIK.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-JXD7KY3G.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-JXD7KY3G.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-FCEFP7EJ.mjs +0 -25
- package/dist/lib/node-esm/call-manager-FCEFP7EJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AFDO2SUZ.mjs +0 -25
- package/dist/lib/node-esm/chunk-AFDO2SUZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KGYDYYKJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NWUUMKVQ.mjs +0 -378
- package/dist/lib/node-esm/chunk-NWUUMKVQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q7AKKZNY.mjs +0 -619
- package/dist/lib/node-esm/chunk-Q7AKKZNY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QCQAAU6J.mjs +0 -989
- package/dist/lib/node-esm/chunk-QCQAAU6J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs +0 -179
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs +0 -28
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs +0 -19
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-63NV3XD2.mjs +0 -420
- package/dist/lib/node-esm/intent-resolver-63NV3XD2.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-ZQW7MI5U.mjs +0 -170
- package/dist/lib/node-esm/markdown-ZQW7MI5U.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs +0 -29
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-O4LGTAZ3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-EOBQUZSW.mjs +0 -23
- package/dist/lib/node-esm/settings-EOBQUZSW.mjs.map +0 -7
- package/dist/lib/node-esm/state-X3W67GTL.mjs +0 -35
- package/dist/lib/node-esm/state-X3W67GTL.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-X2KA4FNC.mjs +0 -75
- package/dist/lib/node-esm/toolkit-X2KA4FNC.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 -24
- 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/Thread.d.ts +0 -167
- package/dist/types/src/types/Thread.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -186
- package/src/capabilities/call-manager.ts +0 -20
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -344
- 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 -85
- package/src/types/Thread.ts +0 -26
- /package/dist/lib/browser/{ChannelContainer-SVV4ZX5T.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-ALFWQ65B.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-63GMQ753.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-MFKPXMIK.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
13
|
-
import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
14
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
15
|
-
|
|
16
|
-
import { meta } from '../meta';
|
|
17
|
-
import { Channel, ThreadAction } from '../types';
|
|
18
|
-
import { getAnchor } from '../util';
|
|
19
|
-
|
|
20
|
-
import { ThreadCapabilities } from './capabilities';
|
|
21
|
-
|
|
22
|
-
// TODO(wittjosiah): Highlight active calls in L1.
|
|
23
|
-
// Track active meetings by subscribing to meetings query and polling the swarms of recent meetings in the space.
|
|
24
|
-
export default (context: PluginContext) => {
|
|
25
|
-
const resolve = (typename: string) =>
|
|
26
|
-
context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
27
|
-
|
|
28
|
-
return contributes(Capabilities.AppGraphBuilder, [
|
|
29
|
-
createExtension({
|
|
30
|
-
id: `${meta.id}/active-call`,
|
|
31
|
-
connector: (node) =>
|
|
32
|
-
Rx.make((get) =>
|
|
33
|
-
Function.pipe(
|
|
34
|
-
get(node),
|
|
35
|
-
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
36
|
-
Option.map((node) => {
|
|
37
|
-
const [call] = get(context.capabilities(ThreadCapabilities.CallManager));
|
|
38
|
-
return get(
|
|
39
|
-
rxFromSignal(() =>
|
|
40
|
-
call?.joined
|
|
41
|
-
? [
|
|
42
|
-
{
|
|
43
|
-
id: `${node.id}${ATTENDABLE_PATH_SEPARATOR}active-call`,
|
|
44
|
-
type: DECK_COMPANION_TYPE,
|
|
45
|
-
data: null,
|
|
46
|
-
properties: {
|
|
47
|
-
label: ['call panel label', { ns: meta.id }],
|
|
48
|
-
icon: 'ph--video-conference--regular',
|
|
49
|
-
position: 'hoist',
|
|
50
|
-
disposition: 'hidden',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
]
|
|
54
|
-
: [],
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
}),
|
|
58
|
-
Option.getOrElse(() => []),
|
|
59
|
-
),
|
|
60
|
-
),
|
|
61
|
-
}),
|
|
62
|
-
// TODO(wittjosiah): The channel shouldn't become the companion during a call.
|
|
63
|
-
// Alternative: the call/meeting/thread should be a child node of the channel and that should be opened.
|
|
64
|
-
createExtension({
|
|
65
|
-
id: `${meta.id}/channel-chat-companion`,
|
|
66
|
-
connector: (node) => {
|
|
67
|
-
return Rx.make((get) => {
|
|
68
|
-
return Function.pipe(
|
|
69
|
-
get(node),
|
|
70
|
-
Option.flatMap((node) =>
|
|
71
|
-
Obj.instanceOf(Channel.Channel, node.data) ? Option.some(node.data) : Option.none(),
|
|
72
|
-
),
|
|
73
|
-
Option.map((channel) => {
|
|
74
|
-
const callManager = context.getCapability(ThreadCapabilities.CallManager);
|
|
75
|
-
const joined = get(
|
|
76
|
-
rxFromSignal(() => callManager.joined && callManager.roomId === fullyQualifiedId(channel)),
|
|
77
|
-
);
|
|
78
|
-
if (!joined) {
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return [
|
|
83
|
-
{
|
|
84
|
-
id: `${fullyQualifiedId(channel)}${ATTENDABLE_PATH_SEPARATOR}chat`,
|
|
85
|
-
type: PLANK_COMPANION_TYPE,
|
|
86
|
-
data: 'chat',
|
|
87
|
-
properties: {
|
|
88
|
-
label: ['channel companion label', { ns: meta.id }],
|
|
89
|
-
icon: 'ph--hash--regular',
|
|
90
|
-
position: 'hoist',
|
|
91
|
-
disposition: 'hidden',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
}),
|
|
96
|
-
Option.getOrElse(() => []),
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
createExtension({
|
|
102
|
-
id: `${meta.id}/comments-companion`,
|
|
103
|
-
connector: (node) =>
|
|
104
|
-
Rx.make((get) =>
|
|
105
|
-
Function.pipe(
|
|
106
|
-
get(node),
|
|
107
|
-
Option.flatMap((node) => {
|
|
108
|
-
if (!Obj.isObject(node.data) || Obj.instanceOf(Channel.Channel, node.data)) {
|
|
109
|
-
return Option.none();
|
|
110
|
-
}
|
|
111
|
-
const metadata = resolve(Obj.getTypename(node.data)!);
|
|
112
|
-
return typeof metadata.comments === 'string' ? Option.some(node) : Option.none();
|
|
113
|
-
}),
|
|
114
|
-
Option.map((node) => [
|
|
115
|
-
{
|
|
116
|
-
id: [node.id, 'comments'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
117
|
-
type: PLANK_COMPANION_TYPE,
|
|
118
|
-
data: 'comments',
|
|
119
|
-
properties: {
|
|
120
|
-
label: ['comments label', { ns: meta.id }],
|
|
121
|
-
icon: 'ph--chat-text--regular',
|
|
122
|
-
disposition: 'hidden',
|
|
123
|
-
position: 'hoist',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
]),
|
|
127
|
-
Option.getOrElse(() => []),
|
|
128
|
-
),
|
|
129
|
-
),
|
|
130
|
-
}),
|
|
131
|
-
createExtension({
|
|
132
|
-
id: `${meta.id}/comment-toolbar`,
|
|
133
|
-
actions: (node) =>
|
|
134
|
-
Rx.make((get) =>
|
|
135
|
-
Function.pipe(
|
|
136
|
-
get(node),
|
|
137
|
-
Option.flatMap((node) => {
|
|
138
|
-
if (!Obj.isObject(node.data) || Obj.instanceOf(Channel.Channel, node.data)) {
|
|
139
|
-
return Option.none();
|
|
140
|
-
}
|
|
141
|
-
const metadata = resolve(Obj.getTypename(node.data)!);
|
|
142
|
-
return typeof metadata.comments === 'string' ? Option.some(node.data) : Option.none();
|
|
143
|
-
}),
|
|
144
|
-
Option.map((object) => {
|
|
145
|
-
const selectionManager = context.getCapability(AttentionCapabilities.Selection);
|
|
146
|
-
const toolbar = get(context.capabilities(ThreadCapabilities.State))[0]?.state.toolbar ?? {};
|
|
147
|
-
const disabled = get(
|
|
148
|
-
rxFromSignal(() => {
|
|
149
|
-
const metadata = resolve(Obj.getTypename(object)!);
|
|
150
|
-
const selection = selectionManager.getSelection(fullyQualifiedId(object), metadata.selectionMode);
|
|
151
|
-
const anchor = getAnchor(selection);
|
|
152
|
-
const invalidSelection = !anchor;
|
|
153
|
-
const overlappingComment = toolbar[fullyQualifiedId(object)];
|
|
154
|
-
return (metadata.comments === 'anchored' && invalidSelection) || overlappingComment;
|
|
155
|
-
}),
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
return [
|
|
159
|
-
{
|
|
160
|
-
id: `${fullyQualifiedId(object)}/comment`,
|
|
161
|
-
data: () => {
|
|
162
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
163
|
-
const metadata = resolve(Obj.getTypename(object)!);
|
|
164
|
-
const selection = selectionManager.getSelection(fullyQualifiedId(object));
|
|
165
|
-
// TODO(wittjosiah): Use presence of selection to determine if the comment should be anchored.
|
|
166
|
-
// Requires all components which support selection (e.g. table/kanban) to support anchored comments.
|
|
167
|
-
const anchor = metadata.comments === 'anchored' ? getAnchor(selection) : Date.now().toString();
|
|
168
|
-
const name = metadata.getAnchorLabel?.(object, anchor);
|
|
169
|
-
void dispatch(createIntent(ThreadAction.Create, { anchor, name, subject: object }));
|
|
170
|
-
},
|
|
171
|
-
properties: {
|
|
172
|
-
label: ['add comment label', { ns: meta.id }],
|
|
173
|
-
icon: 'ph--chat-text--regular',
|
|
174
|
-
disposition: 'toolbar',
|
|
175
|
-
disabled,
|
|
176
|
-
testId: 'thread.comment.add',
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
];
|
|
180
|
-
}),
|
|
181
|
-
Option.getOrElse(() => []),
|
|
182
|
-
),
|
|
183
|
-
),
|
|
184
|
-
}),
|
|
185
|
-
]);
|
|
186
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
|
|
8
|
-
import { CallManager } from '../calls';
|
|
9
|
-
|
|
10
|
-
import { ThreadCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
export default async (context: PluginContext) => {
|
|
13
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
14
|
-
const callManager = new CallManager(client);
|
|
15
|
-
await callManager.open();
|
|
16
|
-
|
|
17
|
-
return contributes(ThreadCapabilities.CallManager, callManager, () => {
|
|
18
|
-
void callManager.close();
|
|
19
|
-
});
|
|
20
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { type CallManager, type CallState, type MediaState } from '../calls';
|
|
9
|
-
import { meta } from '../meta';
|
|
10
|
-
import { type Channel, type ThreadState, type ViewState } from '../types';
|
|
11
|
-
|
|
12
|
-
export namespace ThreadCapabilities {
|
|
13
|
-
export const CallManager = defineCapability<CallManager>(`${meta.id}/capability/call-manager`);
|
|
14
|
-
|
|
15
|
-
// TODO(burdon): Better way to define specific extensions for meeting companions.
|
|
16
|
-
// TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?
|
|
17
|
-
// TODO(wittjosiah): These callbacks could be intents once we support broadcast.
|
|
18
|
-
export type CallProperties = {
|
|
19
|
-
onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;
|
|
20
|
-
onLeave: (roomId?: string) => Promise<void>;
|
|
21
|
-
onCallStateUpdated: (callState: CallState) => Promise<void>;
|
|
22
|
-
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
export const CallExtension = defineCapability<CallProperties>(`${meta.id}/capability/call-extension`);
|
|
25
|
-
|
|
26
|
-
type GetViewState = (subjectId: string) => ViewState;
|
|
27
|
-
export const State = defineCapability<{ state: DeepReadonly<ThreadState>; getViewState: GetViewState }>(
|
|
28
|
-
`${meta.id}/capability/state`,
|
|
29
|
-
);
|
|
30
|
-
export const MutableState = defineCapability<{ state: ThreadState; getViewState: GetViewState }>(
|
|
31
|
-
`${meta.id}/capability/state`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { sleep } from '@dxos/async';
|
|
9
|
-
import { Obj, Relation, Type } from '@dxos/echo';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
12
|
-
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
13
|
-
import { CollectionAction, SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
import { Ref, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
15
|
-
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
16
|
-
|
|
17
|
-
import { meta } from '../meta';
|
|
18
|
-
import { Channel, Thread, ThreadAction } from '../types';
|
|
19
|
-
|
|
20
|
-
import { ThreadCapabilities } from './capabilities';
|
|
21
|
-
|
|
22
|
-
export default (context: PluginContext) =>
|
|
23
|
-
contributes(Capabilities.IntentResolver, [
|
|
24
|
-
createResolver({
|
|
25
|
-
intent: ThreadAction.onCreateSpace,
|
|
26
|
-
resolve: ({ space, rootCollection }) =>
|
|
27
|
-
Effect.gen(function* () {
|
|
28
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
29
|
-
const { object: collection } = yield* dispatch(
|
|
30
|
-
createIntent(CollectionAction.CreateQueryCollection, { typename: Type.getTypename(Channel.Channel) }),
|
|
31
|
-
);
|
|
32
|
-
rootCollection.objects.push(Ref.make(collection));
|
|
33
|
-
|
|
34
|
-
const { object: channel } = yield* dispatch(
|
|
35
|
-
createIntent(ThreadAction.CreateChannel, { name: 'General', spaceId: space.id }),
|
|
36
|
-
);
|
|
37
|
-
space.db.add(channel);
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
createResolver({
|
|
41
|
-
intent: ThreadAction.CreateChannel,
|
|
42
|
-
resolve: ({ name }) => ({
|
|
43
|
-
data: {
|
|
44
|
-
object: Channel.make({ name }),
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
}),
|
|
48
|
-
createResolver({
|
|
49
|
-
intent: ThreadAction.CreateChannelThread,
|
|
50
|
-
resolve: ({ channel }) => {
|
|
51
|
-
const thread = Thread.make({ status: 'active' });
|
|
52
|
-
channel.threads.push(Ref.make(thread));
|
|
53
|
-
return {
|
|
54
|
-
data: {
|
|
55
|
-
object: thread,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
// TODO(wittjosiah): Break this up into more composable pieces.
|
|
61
|
-
createResolver({
|
|
62
|
-
intent: ThreadAction.Create,
|
|
63
|
-
resolve: ({ name, anchor: _anchor, subject }) => {
|
|
64
|
-
const space = getSpace(subject);
|
|
65
|
-
invariant(space, 'Space not found');
|
|
66
|
-
|
|
67
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
68
|
-
const subjectId = fullyQualifiedId(subject);
|
|
69
|
-
const thread = Thread.make({ name });
|
|
70
|
-
const anchor = Relation.make(AnchoredTo, {
|
|
71
|
-
[Relation.Source]: thread,
|
|
72
|
-
[Relation.Target]: subject,
|
|
73
|
-
anchor: _anchor,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const draft = state.drafts[subjectId];
|
|
77
|
-
if (draft) {
|
|
78
|
-
draft.push(anchor);
|
|
79
|
-
} else {
|
|
80
|
-
state.drafts[subjectId] = [anchor];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
intents: [
|
|
85
|
-
createIntent(ThreadAction.Select, { current: fullyQualifiedId(thread) }),
|
|
86
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
87
|
-
primary: subjectId,
|
|
88
|
-
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
89
|
-
}),
|
|
90
|
-
],
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
}),
|
|
94
|
-
createResolver({
|
|
95
|
-
intent: ThreadAction.AddProposal,
|
|
96
|
-
resolve: ({ text, anchor, sender, subject }) => {
|
|
97
|
-
const space = getSpace(subject);
|
|
98
|
-
invariant(space, 'Space not found');
|
|
99
|
-
|
|
100
|
-
const subjectId = fullyQualifiedId(subject);
|
|
101
|
-
const proposal = Obj.make(DataType.Message, {
|
|
102
|
-
created: new Date().toISOString(),
|
|
103
|
-
sender,
|
|
104
|
-
blocks: [{ _tag: 'proposal', text }],
|
|
105
|
-
});
|
|
106
|
-
const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });
|
|
107
|
-
|
|
108
|
-
return {
|
|
109
|
-
intents: [
|
|
110
|
-
createIntent(SpaceAction.AddObject, { object: thread, target: space, hidden: true }),
|
|
111
|
-
createIntent(SpaceAction.AddRelation, {
|
|
112
|
-
space,
|
|
113
|
-
schema: AnchoredTo,
|
|
114
|
-
source: thread,
|
|
115
|
-
target: subject,
|
|
116
|
-
fields: { anchor },
|
|
117
|
-
}),
|
|
118
|
-
createIntent(ThreadAction.Select, { current: fullyQualifiedId(thread) }),
|
|
119
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
120
|
-
primary: subjectId,
|
|
121
|
-
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
122
|
-
}),
|
|
123
|
-
],
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
}),
|
|
127
|
-
createResolver({
|
|
128
|
-
intent: ThreadAction.Select,
|
|
129
|
-
resolve: ({ current }) => {
|
|
130
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
131
|
-
state.current = current;
|
|
132
|
-
},
|
|
133
|
-
}),
|
|
134
|
-
createResolver({
|
|
135
|
-
intent: ThreadAction.ToggleResolved,
|
|
136
|
-
resolve: ({ thread }) => {
|
|
137
|
-
if (thread.status === 'active' || thread.status === undefined) {
|
|
138
|
-
thread.status = 'resolved';
|
|
139
|
-
} else if (thread.status === 'resolved') {
|
|
140
|
-
thread.status = 'active';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const space = getSpace(thread);
|
|
144
|
-
invariant(space, 'Space not found');
|
|
145
|
-
const spaceId = space.id;
|
|
146
|
-
|
|
147
|
-
return {
|
|
148
|
-
intents: [
|
|
149
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
150
|
-
name: 'threads.toggle-resolved',
|
|
151
|
-
properties: {
|
|
152
|
-
spaceId,
|
|
153
|
-
threadId: thread.id,
|
|
154
|
-
},
|
|
155
|
-
}),
|
|
156
|
-
],
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
}),
|
|
160
|
-
createResolver({
|
|
161
|
-
intent: ThreadAction.Delete,
|
|
162
|
-
resolve: async ({ subject, anchor, thread: _thread }, undo) => {
|
|
163
|
-
const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);
|
|
164
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
165
|
-
const subjectId = fullyQualifiedId(subject);
|
|
166
|
-
const draft = state.drafts[subjectId];
|
|
167
|
-
if (draft) {
|
|
168
|
-
// Check if we're deleting a draft; if so, remo ve it.
|
|
169
|
-
const index = draft.findIndex((a) => a.id === anchor.id);
|
|
170
|
-
if (index !== -1) {
|
|
171
|
-
draft.splice(index, 1);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const space = getSpace(anchor);
|
|
177
|
-
if (!space) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (!undo) {
|
|
182
|
-
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
183
|
-
space.db.remove(anchor);
|
|
184
|
-
await sleep(100);
|
|
185
|
-
space.db.remove(thread);
|
|
186
|
-
|
|
187
|
-
return {
|
|
188
|
-
undoable: {
|
|
189
|
-
message: ['thread deleted label', { ns: meta.id }],
|
|
190
|
-
data: { thread, anchor },
|
|
191
|
-
},
|
|
192
|
-
intents: [
|
|
193
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
194
|
-
name: 'threads.delete',
|
|
195
|
-
properties: {
|
|
196
|
-
spaceId: space.id,
|
|
197
|
-
threadId: thread.id,
|
|
198
|
-
},
|
|
199
|
-
}),
|
|
200
|
-
],
|
|
201
|
-
};
|
|
202
|
-
} else {
|
|
203
|
-
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
204
|
-
space.db.add(thread);
|
|
205
|
-
await sleep(100);
|
|
206
|
-
space.db.add(anchor);
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
intents: [
|
|
210
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
211
|
-
name: 'threads.undo-delete',
|
|
212
|
-
properties: {
|
|
213
|
-
spaceId: space.id,
|
|
214
|
-
threadId: thread.id,
|
|
215
|
-
},
|
|
216
|
-
}),
|
|
217
|
-
],
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
}),
|
|
222
|
-
createResolver({
|
|
223
|
-
intent: ThreadAction.AddMessage,
|
|
224
|
-
resolve: ({ anchor, subject, sender, text }) => {
|
|
225
|
-
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
226
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
227
|
-
const subjectId = fullyQualifiedId(subject);
|
|
228
|
-
const space = getSpace(subject);
|
|
229
|
-
invariant(space, 'Space not found');
|
|
230
|
-
|
|
231
|
-
const message = Obj.make(DataType.Message, {
|
|
232
|
-
created: new Date().toISOString(),
|
|
233
|
-
sender,
|
|
234
|
-
blocks: [{ _tag: 'text', text }],
|
|
235
|
-
// TODO(wittjosiah): Context based on attention.
|
|
236
|
-
// context: context ? Ref.make(context) : undefined,
|
|
237
|
-
});
|
|
238
|
-
thread.messages.push(Ref.make(message));
|
|
239
|
-
|
|
240
|
-
const intents = [];
|
|
241
|
-
const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
|
|
242
|
-
if (draft) {
|
|
243
|
-
// Move draft to document.
|
|
244
|
-
thread.status = 'active';
|
|
245
|
-
// TODO(wittjosiah): This causes the thread to flash as it transitions from draft to db.
|
|
246
|
-
state.drafts[subjectId] = state.drafts[subjectId]?.filter((a) => a.id !== anchor.id);
|
|
247
|
-
intents.push(createIntent(SpaceAction.AddObject, { object: thread, target: space, hidden: true }));
|
|
248
|
-
intents.push(
|
|
249
|
-
createIntent(SpaceAction.AddRelation, {
|
|
250
|
-
space,
|
|
251
|
-
schema: AnchoredTo,
|
|
252
|
-
source: thread,
|
|
253
|
-
target: subject,
|
|
254
|
-
fields: { anchor: draft.anchor },
|
|
255
|
-
}),
|
|
256
|
-
);
|
|
257
|
-
intents.push(
|
|
258
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
259
|
-
name: 'threads.create',
|
|
260
|
-
properties: {
|
|
261
|
-
spaceId: space.id,
|
|
262
|
-
threadId: thread.id,
|
|
263
|
-
},
|
|
264
|
-
}),
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
intents.push(
|
|
269
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
270
|
-
name: 'threads.message.add',
|
|
271
|
-
properties: {
|
|
272
|
-
spaceId: space.id,
|
|
273
|
-
threadId: thread.id,
|
|
274
|
-
threadLength: thread.messages.length,
|
|
275
|
-
messageId: message.id,
|
|
276
|
-
messageLength: text.length,
|
|
277
|
-
},
|
|
278
|
-
}),
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
return { intents };
|
|
282
|
-
},
|
|
283
|
-
}),
|
|
284
|
-
createResolver({
|
|
285
|
-
intent: ThreadAction.DeleteMessage,
|
|
286
|
-
resolve: ({ subject, anchor, messageId, message, messageIndex }, undo) => {
|
|
287
|
-
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
288
|
-
const space = getSpace(subject);
|
|
289
|
-
invariant(space, 'Space not found');
|
|
290
|
-
|
|
291
|
-
if (!undo) {
|
|
292
|
-
const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
|
|
293
|
-
const message = thread.messages[messageIndex]?.target;
|
|
294
|
-
if (!message) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (messageIndex === 0 && thread.messages.length === 1) {
|
|
299
|
-
// If the message is the only message in the thread, delete the thread.
|
|
300
|
-
return {
|
|
301
|
-
intents: [createIntent(ThreadAction.Delete, { subject, anchor })],
|
|
302
|
-
};
|
|
303
|
-
} else {
|
|
304
|
-
thread.messages.splice(messageIndex, 1);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return {
|
|
308
|
-
undoable: {
|
|
309
|
-
message: ['message deleted label', { ns: meta.id }],
|
|
310
|
-
data: { message, messageIndex },
|
|
311
|
-
},
|
|
312
|
-
intents: [
|
|
313
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
314
|
-
name: 'threads.message.delete',
|
|
315
|
-
properties: {
|
|
316
|
-
spaceId: space.id,
|
|
317
|
-
threadId: thread.id,
|
|
318
|
-
messageId: message.id,
|
|
319
|
-
},
|
|
320
|
-
}),
|
|
321
|
-
],
|
|
322
|
-
};
|
|
323
|
-
} else {
|
|
324
|
-
if (messageIndex === undefined || !message) {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
thread.messages.splice(messageIndex, 0, Ref.make(message));
|
|
329
|
-
return {
|
|
330
|
-
intents: [
|
|
331
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
332
|
-
name: 'threads.message.undo-delete',
|
|
333
|
-
properties: {
|
|
334
|
-
spaceId: space.id,
|
|
335
|
-
threadId: thread.id,
|
|
336
|
-
messageId: message.id,
|
|
337
|
-
},
|
|
338
|
-
}),
|
|
339
|
-
],
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
}),
|
|
344
|
-
]);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { EditorView } from '@codemirror/view';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
9
|
-
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
11
|
-
import { type EditorState, commentClickedEffect, commentsState, overlap } from '@dxos/react-ui-editor';
|
|
12
|
-
|
|
13
|
-
import { threads } from '../extensions';
|
|
14
|
-
|
|
15
|
-
import { ThreadCapabilities } from './capabilities';
|
|
16
|
-
|
|
17
|
-
export default (context: PluginContext) =>
|
|
18
|
-
contributes(MarkdownCapabilities.Extensions, [
|
|
19
|
-
({ document: doc }) => {
|
|
20
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
21
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
22
|
-
return threads(state, doc, dispatch);
|
|
23
|
-
},
|
|
24
|
-
({ document: doc }) => {
|
|
25
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
26
|
-
|
|
27
|
-
return EditorView.updateListener.of((update) => {
|
|
28
|
-
if (update.docChanged || update.selectionSet) {
|
|
29
|
-
state.toolbar[fullyQualifiedId(doc)] = selectionOverlapsComment(update.state);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
({ document: doc }) => {
|
|
34
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
35
|
-
const id = fullyQualifiedId(doc);
|
|
36
|
-
|
|
37
|
-
return EditorView.updateListener.of((update) => {
|
|
38
|
-
update.transactions.forEach((transaction) => {
|
|
39
|
-
transaction.effects.forEach(async (effect) => {
|
|
40
|
-
if (effect.is(commentClickedEffect)) {
|
|
41
|
-
void dispatch(
|
|
42
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
43
|
-
primary: id,
|
|
44
|
-
companion: `${id}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
45
|
-
}),
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
const selectionOverlapsComment = (state: EditorState): boolean => {
|
|
55
|
-
// May not be defined if thread plugin not installed.
|
|
56
|
-
const commentState = state.field(commentsState, false);
|
|
57
|
-
if (commentState === undefined) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const { selection } = state;
|
|
62
|
-
for (const range of selection.ranges) {
|
|
63
|
-
if (commentState.comments.some(({ range: commentRange }) => overlap(commentRange, range))) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return false;
|
|
69
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { Call } from '../components';
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
export default () => {
|
|
13
|
-
return contributes(Capabilities.ReactRoot, {
|
|
14
|
-
id: meta.id,
|
|
15
|
-
root: () => <Call.Audio />,
|
|
16
|
-
});
|
|
17
|
-
};
|