@dxos/plugin-thread 0.8.4-main.4a85c3132b → 0.8.4-main.4f23b4e393
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/CallDebugPanel-FGCTY7Q4.mjs → neutral/CallDebugPanel-CXWTCS7A.mjs} +7 -17
- package/dist/lib/neutral/CallDebugPanel-CXWTCS7A.mjs.map +7 -0
- package/dist/lib/neutral/CallSidebar-4USJZ2SB.mjs +25 -0
- package/dist/lib/neutral/CallSidebar-4USJZ2SB.mjs.map +7 -0
- package/dist/lib/neutral/ChannelChat-6YTD5HWL.mjs +10 -0
- package/dist/lib/neutral/ChannelContainer-XHBF2NCK.mjs +9 -0
- package/dist/lib/{browser/ThreadCompanion-2CMLJH76.mjs → neutral/ThreadCompanion-NQWPS2H6.mjs} +44 -40
- package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs.map +7 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs +61 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +89 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ThreadSettings-5Z5XIHG3.mjs +15 -0
- package/dist/lib/neutral/ThreadSettings-5Z5XIHG3.mjs.map +7 -0
- package/dist/lib/neutral/add-message-HV5R66K4.mjs +87 -0
- package/dist/lib/neutral/add-message-HV5R66K4.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-builder-5LCAM746.mjs → neutral/app-graph-builder-JDLHZ4XO.mjs} +68 -86
- package/dist/lib/neutral/app-graph-builder-JDLHZ4XO.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-PO33DR5V.mjs +40 -0
- package/dist/lib/neutral/append-channel-message-PO33DR5V.mjs.map +7 -0
- package/dist/lib/{browser/blueprint-definition-42M2EJ2Y.mjs → neutral/blueprint-definition-S3EBOH4R.mjs} +4 -6
- package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
- package/dist/lib/{browser/call-manager-2PRP4QVZ.mjs → neutral/call-manager-JFA4DLWR.mjs} +5 -8
- package/dist/lib/neutral/call-manager-JFA4DLWR.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +29 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-LUK4UNFA.mjs → neutral/chunk-44D7D4ZX.mjs} +3 -3
- package/dist/lib/{browser/chunk-LUK4UNFA.mjs.map → neutral/chunk-44D7D4ZX.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs +36 -0
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ISCHODBV.mjs → neutral/chunk-CROE4U4O.mjs} +5 -11
- package/dist/lib/neutral/chunk-CROE4U4O.mjs.map +7 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs +55 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs.map +7 -0
- package/dist/lib/{browser/chunk-HDLDMR54.mjs → neutral/chunk-FWSMZWBO.mjs} +5 -11
- package/dist/lib/neutral/chunk-FWSMZWBO.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-ABUFOZVX.mjs → neutral/chunk-JLY4NVTA.mjs} +12 -7
- package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
- package/dist/lib/{browser/markdown-GRRPCZHJ.mjs → neutral/chunk-KRXHIW4P.mjs} +44 -90
- package/dist/lib/neutral/chunk-KRXHIW4P.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MXJYXUS2.mjs +8 -0
- package/dist/lib/neutral/chunk-MXJYXUS2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OZRSYMYO.mjs +275 -0
- package/dist/lib/neutral/chunk-OZRSYMYO.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ERK254BS.mjs → neutral/chunk-PZ7WTAA2.mjs} +54 -342
- package/dist/lib/neutral/chunk-PZ7WTAA2.mjs.map +7 -0
- package/dist/lib/{browser/chunk-PDHCY236.mjs → neutral/chunk-S2AKEA2K.mjs} +34 -55
- package/dist/lib/neutral/chunk-S2AKEA2K.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-IQUV7DR6.mjs → neutral/components/index.mjs} +259 -153
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +19 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-C3CICN35.mjs +52 -0
- package/dist/lib/neutral/create-C3CICN35.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-UEQESOFT.mjs +19 -0
- package/dist/lib/neutral/create-channel-UEQESOFT.mjs.map +7 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
- package/dist/lib/neutral/create-proposals-OZ4NCBBS.mjs +56 -0
- package/dist/lib/neutral/create-proposals-OZ4NCBBS.mjs.map +7 -0
- package/dist/lib/neutral/delete-AVFYFWMY.mjs +57 -0
- package/dist/lib/neutral/delete-AVFYFWMY.mjs.map +7 -0
- package/dist/lib/neutral/delete-message-EV2MKRTB.mjs +54 -0
- package/dist/lib/neutral/delete-message-EV2MKRTB.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +19 -0
- package/dist/lib/neutral/index.mjs +68 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs +83 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/on-create-space-NQF7WGEB.mjs +23 -0
- package/dist/lib/neutral/on-create-space-NQF7WGEB.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-root-7UFFPPRD.mjs → neutral/react-root-VMMNUSSL.mjs} +4 -12
- package/dist/lib/neutral/react-root-VMMNUSSL.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-WPSVOTVG.mjs +94 -0
- package/dist/lib/neutral/react-surface-WPSVOTVG.mjs.map +7 -0
- package/dist/lib/neutral/restore-MGLYOJ3Y.mjs +32 -0
- package/dist/lib/neutral/restore-MGLYOJ3Y.mjs.map +7 -0
- package/dist/lib/neutral/restore-message-ZIOA2MQJ.mjs +33 -0
- package/dist/lib/neutral/restore-message-ZIOA2MQJ.mjs.map +7 -0
- package/dist/lib/neutral/select-CVCGBDHA.mjs +24 -0
- package/dist/lib/neutral/select-CVCGBDHA.mjs.map +7 -0
- package/dist/lib/{browser/settings-Y75FG6XR.mjs → neutral/settings-HK4EB6TF.mjs} +6 -11
- package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
- package/dist/lib/{browser/state-OBTMMEUZ.mjs → neutral/state-UU7VEAKV.mjs} +3 -6
- package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +58 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/toggle-resolved-ZM4BHON5.mjs +36 -0
- package/dist/lib/neutral/toggle-resolved-ZM4BHON5.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +90 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts +1 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
- package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/audio.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +2 -2
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
- package/dist/types/src/calls/util/media.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +2 -2
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/{call-manager/call-manager.d.ts → call-manager.d.ts} +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +21 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts +32 -4
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +5 -5
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +51 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/{CommentsThreadContainer.d.ts → CommentsPanel/CommentsThread.d.ts} +3 -3
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
- 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/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/{MessageContainer.d.ts → MessagePanel/MessagePanel.d.ts} +3 -3
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
- package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +142 -144
- 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/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +1 -2
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -1
- package/dist/types/src/containers/CallSidebar/index.d.ts +1 -2
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +4 -4
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +142 -144
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelContainer/index.d.ts +1 -2
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +6 -3
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +1 -2
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
- package/dist/types/src/extensions/command.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +1 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +4 -4
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +5 -0
- package/dist/types/src/operations/add-message.d.ts.map +1 -0
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +5 -0
- package/dist/types/src/operations/create-channel.d.ts.map +1 -0
- package/dist/types/src/operations/create-proposals.d.ts +5 -0
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/delete-message.d.ts +5 -0
- package/dist/types/src/operations/delete-message.d.ts.map +1 -0
- package/dist/types/src/operations/delete.d.ts +5 -0
- package/dist/types/src/operations/delete.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/restore-message.d.ts +5 -0
- package/dist/types/src/operations/restore-message.d.ts.map +1 -0
- package/dist/types/src/operations/restore.d.ts +5 -0
- package/dist/types/src/operations/restore.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{components/testing.d.ts → testing/data.d.ts} +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +140 -142
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +5 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts +26 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ThreadOperation.d.ts +1995 -0
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +0 -3303
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +129 -84
- package/src/ThreadPlugin.node.ts +39 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +16 -51
- package/src/blueprints/thread-blueprint.ts +5 -9
- package/src/calls/util/calls-service.ts +3 -2
- package/src/calls/util/stub-media-streams.ts +3 -1
- package/src/calls-service.stories.tsx +8 -7
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +52 -59
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/{call-manager/call-manager.ts → call-manager.ts} +3 -2
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +18 -10
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +16 -12
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
- package/src/capabilities/react-surface.tsx +97 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
- package/src/capabilities/{state/state.ts → state.ts} +1 -1
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +9 -9
- package/src/components/Call/Toolbar.tsx +24 -14
- package/src/components/Chat/Chat.tsx +258 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/{Comments.stories.tsx → CommentsPanel/CommentsPanel.stories.tsx} +15 -14
- package/src/components/{CommentsContainer.tsx → CommentsPanel/CommentsPanel.tsx} +10 -10
- package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +18 -19
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +12 -10
- package/src/components/Media/VideoObject.stories.tsx +3 -4
- package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +24 -19
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +2 -1
- package/src/components/Participant/ParticipantGrid.tsx +0 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +7 -7
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +4 -4
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +5 -5
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +7 -7
- package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +6 -8
- package/src/components/ResponsiveGrid/index.ts +1 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +7 -3
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +5 -4
- package/src/containers/CallDebugPanel/index.ts +1 -3
- package/src/containers/CallSidebar/CallSidebar.tsx +3 -2
- package/src/containers/CallSidebar/index.ts +1 -3
- package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +59 -14
- package/src/containers/ChannelContainer/ChannelContainer.tsx +44 -38
- package/src/containers/ChannelContainer/index.ts +1 -3
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +47 -29
- package/src/containers/ThreadCompanion/index.ts +1 -3
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +17 -19
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +2 -2
- package/src/{components/command-extension.ts → extensions/command.ts} +1 -1
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +16 -15
- package/src/hooks/analytics.ts +1 -1
- package/src/index.ts +4 -3
- package/src/meta.ts +2 -2
- package/src/operations/add-message.ts +81 -0
- package/src/operations/append-channel-message.ts +37 -0
- package/src/operations/create-channel.ts +20 -0
- package/src/operations/create-proposals.ts +49 -0
- package/src/operations/create.ts +48 -0
- package/src/operations/delete-message.ts +53 -0
- package/src/operations/delete.ts +63 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/on-create-space.ts +27 -0
- package/src/operations/restore-message.ts +38 -0
- package/src/operations/restore.ts +38 -0
- package/src/operations/select.ts +24 -0
- package/src/operations/toggle-resolved.ts +41 -0
- package/src/plugin.ts +11 -0
- package/src/{components/testing.ts → testing/data.ts} +7 -7
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +72 -76
- package/src/types/Settings.ts +10 -0
- package/src/types/ThreadCapabilities.ts +41 -0
- package/src/types/ThreadOperation.ts +178 -0
- package/src/types/index.ts +4 -2
- package/src/types/types.ts +1 -185
- package/src/util.ts +37 -5
- package/dist/lib/browser/CallDebugPanel-FGCTY7Q4.mjs.map +0 -7
- package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs +0 -33
- package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs.map +0 -7
- package/dist/lib/browser/ChannelContainer-EPYG4QAC.mjs +0 -15
- package/dist/lib/browser/ChatContainer-2243UD2M.mjs +0 -14
- package/dist/lib/browser/ThreadCompanion-2CMLJH76.mjs.map +0 -7
- package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs +0 -20
- package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-5LCAM746.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-42M2EJ2Y.mjs.map +0 -7
- package/dist/lib/browser/call-manager-2PRP4QVZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-CP7E2HRE.mjs +0 -31
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERK254BS.mjs.map +0 -7
- package/dist/lib/browser/chunk-G6FJBSXX.mjs +0 -1123
- package/dist/lib/browser/chunk-G6FJBSXX.mjs.map +0 -7
- package/dist/lib/browser/chunk-HDLDMR54.mjs.map +0 -7
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-PDHCY236.mjs.map +0 -7
- package/dist/lib/browser/chunk-PL5LIVP4.mjs +0 -105
- package/dist/lib/browser/chunk-PL5LIVP4.mjs.map +0 -7
- package/dist/lib/browser/chunk-U32R23JO.mjs +0 -277
- package/dist/lib/browser/chunk-U32R23JO.mjs.map +0 -7
- package/dist/lib/browser/chunk-UVUCB7QO.mjs +0 -125
- package/dist/lib/browser/chunk-UVUCB7QO.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -308
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/markdown-GRRPCZHJ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs +0 -442
- package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs.map +0 -7
- package/dist/lib/browser/react-root-7UFFPPRD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TIHBSZPD.mjs +0 -113
- package/dist/lib/browser/react-surface-TIHBSZPD.mjs.map +0 -7
- package/dist/lib/browser/repair-TBU45SBG.mjs +0 -40
- package/dist/lib/browser/repair-TBU45SBG.mjs.map +0 -7
- package/dist/lib/browser/settings-Y75FG6XR.mjs.map +0 -7
- package/dist/lib/browser/state-OBTMMEUZ.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -15
- package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs +0 -183
- package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs.map +0 -7
- package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs +0 -34
- package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-NU4LSLB4.mjs +0 -16
- package/dist/lib/node-esm/ChatContainer-FPNIG33R.mjs +0 -15
- package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs +0 -205
- package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs.map +0 -7
- package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs +0 -21
- package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs +0 -192
- package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -9
- package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs +0 -28
- package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6K5ACCGB.mjs +0 -107
- package/dist/lib/node-esm/chunk-6K5ACCGB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7SZBKQUU.mjs +0 -224
- package/dist/lib/node-esm/chunk-7SZBKQUU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs +0 -22
- package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IQUV7DR6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs +0 -1811
- package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QYAVWNVM.mjs +0 -278
- package/dist/lib/node-esm/chunk-QYAVWNVM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs +0 -126
- package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VBI32FGI.mjs +0 -108
- package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs +0 -185
- package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -309
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-WHWUESF7.mjs +0 -211
- package/dist/lib/node-esm/markdown-WHWUESF7.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs +0 -443
- package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-D7CWS5XP.mjs +0 -27
- package/dist/lib/node-esm/react-root-D7CWS5XP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs +0 -114
- package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs.map +0 -7
- package/dist/lib/node-esm/repair-7JEKRNR3.mjs +0 -41
- package/dist/lib/node-esm/repair-7JEKRNR3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-W4JN2YKJ.mjs +0 -36
- package/dist/lib/node-esm/settings-W4JN2YKJ.mjs.map +0 -7
- package/dist/lib/node-esm/state-7UWCSIWQ.mjs +0 -26
- package/dist/lib/node-esm/state-7UWCSIWQ.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -16
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager/index.d.ts +0 -3
- package/dist/types/src/capabilities/call-manager/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
- package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -3
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -162
- package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsContainer.d.ts +0 -13
- package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -166
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/command-extension.d.ts.map +0 -1
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -17
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +0 -164
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -3
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts +0 -8
- package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts.map +0 -1
- package/dist/types/src/containers/ThreadSettings/index.d.ts +0 -3
- package/dist/types/src/containers/ThreadSettings/index.d.ts.map +0 -1
- package/dist/types/src/functions/create-proposals.d.ts +0 -13
- package/dist/types/src/functions/create-proposals.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -14
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -711
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -23
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/call-manager/index.ts +0 -7
- package/src/capabilities/markdown/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -399
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -98
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -55
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/containers/ChatContainer/ChatContainer.tsx +0 -149
- package/src/containers/ChatContainer/index.ts +0 -7
- package/src/containers/ThreadSettings/ThreadSettings.tsx +0 -22
- package/src/containers/ThreadSettings/index.ts +0 -7
- package/src/functions/create-proposals.ts +0 -57
- package/src/functions/index.ts +0 -9
- package/src/testing/stories.ts +0 -56
- package/src/types/Channel.ts +0 -30
- package/src/types/capabilities.ts +0 -34
- /package/dist/lib/{browser/ChannelContainer-EPYG4QAC.mjs.map → neutral/ChannelChat-6YTD5HWL.mjs.map} +0 -0
- /package/dist/lib/{browser/ChatContainer-2243UD2M.mjs.map → neutral/ChannelContainer-XHBF2NCK.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-NU4LSLB4.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/ChatContainer-FPNIG33R.mjs.map → neutral/types/index.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{markdown/markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -8,12 +8,13 @@ import { type Atom, type Registry } from '@effect-atom/atom-react';
|
|
|
8
8
|
|
|
9
9
|
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
10
10
|
import { createDocAccessor, getTextInRange } from '@dxos/echo-db';
|
|
11
|
-
import {
|
|
12
|
-
import { type Markdown } from '@dxos/plugin-markdown
|
|
11
|
+
import { OperationInvoker } from '@dxos/operation';
|
|
12
|
+
import { type Markdown } from '@dxos/plugin-markdown';
|
|
13
13
|
import { AnchoredTo, Thread } from '@dxos/types';
|
|
14
14
|
import { comments, createExternalCommentSync } from '@dxos/ui-editor';
|
|
15
15
|
|
|
16
|
-
import { ThreadOperation
|
|
16
|
+
import { ThreadOperation } from '#types';
|
|
17
|
+
import { type ThreadState } from '#types';
|
|
17
18
|
|
|
18
19
|
// TODO(burdon): Factor out.
|
|
19
20
|
const getName = (doc: Markdown.Document, anchor: string): string | undefined => {
|
|
@@ -72,8 +73,8 @@ export const threads = (
|
|
|
72
73
|
const name = getName(doc, anchor.anchor);
|
|
73
74
|
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
74
75
|
if (name && name !== thread.name) {
|
|
75
|
-
Obj.
|
|
76
|
-
|
|
76
|
+
Obj.update(thread, (thread) => {
|
|
77
|
+
thread.name = name;
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -129,8 +130,8 @@ export const threads = (
|
|
|
129
130
|
|
|
130
131
|
const thread = query.results.find((object) => Relation.getSource(object).id === id);
|
|
131
132
|
if (thread) {
|
|
132
|
-
Relation.
|
|
133
|
-
|
|
133
|
+
Relation.update(thread, (thread) => {
|
|
134
|
+
thread.anchor = undefined;
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
},
|
|
@@ -138,11 +139,11 @@ export const threads = (
|
|
|
138
139
|
const draft = registry.get(stateAtom).drafts[objectId]?.find((d) => Relation.getDXN(d).toString() === id);
|
|
139
140
|
if (draft) {
|
|
140
141
|
const thread = Relation.getSource(draft) as Thread.Thread;
|
|
141
|
-
Obj.
|
|
142
|
-
|
|
142
|
+
Obj.update(thread, (thread) => {
|
|
143
|
+
thread.name = getName(doc, cursor);
|
|
143
144
|
});
|
|
144
|
-
Relation.
|
|
145
|
-
|
|
145
|
+
Relation.update(draft, (draft) => {
|
|
146
|
+
draft.anchor = cursor;
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
|
|
@@ -150,11 +151,11 @@ export const threads = (
|
|
|
150
151
|
if (relation) {
|
|
151
152
|
const thread = Relation.getSource(relation);
|
|
152
153
|
if (Obj.instanceOf(Thread.Thread, thread)) {
|
|
153
|
-
Obj.
|
|
154
|
-
|
|
154
|
+
Obj.update(thread, (thread) => {
|
|
155
|
+
thread.name = getName(doc, cursor);
|
|
155
156
|
});
|
|
156
|
-
Relation.
|
|
157
|
-
|
|
157
|
+
Relation.update(relation, (relation) => {
|
|
158
|
+
relation.anchor = cursor;
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
161
|
}
|
package/src/hooks/analytics.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { useCallback } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { ObservabilityOperation } from '@dxos/plugin-observability
|
|
9
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
10
10
|
import { useOnTransition } from '@dxos/react-ui';
|
|
11
11
|
import { type ContentBlock } from '@dxos/types';
|
|
12
12
|
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export * from './blueprints';
|
|
6
6
|
export * from './calls';
|
|
7
|
+
// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
|
|
8
|
+
// Either refactor callers to not need them or factor them out to a shared package.
|
|
7
9
|
export * from './hooks';
|
|
8
10
|
export * from './meta';
|
|
9
|
-
|
|
10
|
-
export * from './ThreadPlugin';
|
|
11
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { trim } from '@dxos/util';
|
|
|
7
7
|
|
|
8
8
|
// TODO(wittjosiah): Needs screenshots.
|
|
9
9
|
export const meta: Plugin.Meta = {
|
|
10
|
-
id: 'dxos.
|
|
10
|
+
id: 'org.dxos.plugin.thread',
|
|
11
11
|
name: 'Chat',
|
|
12
12
|
description: trim`
|
|
13
13
|
Multi-modal communication platform supporting text chat, voice, and video conferencing.
|
|
@@ -18,4 +18,4 @@ export const meta: Plugin.Meta = {
|
|
|
18
18
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const THREAD_ITEM = `${meta.id}
|
|
21
|
+
export const THREAD_ITEM = `${meta.id}.item`;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj, Ref, Relation } from '@dxos/echo';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
12
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
13
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { ThreadCapabilities } from '../types';
|
|
16
|
+
import { ThreadOperation } from '../types';
|
|
17
|
+
|
|
18
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.AddMessage> = ThreadOperation.AddMessage.pipe(
|
|
19
|
+
Operation.withHandler(
|
|
20
|
+
Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
|
|
21
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
22
|
+
const stateAtom = yield* Capability.get(ThreadCapabilities.State);
|
|
23
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
24
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
25
|
+
const db = Obj.getDatabase(subject);
|
|
26
|
+
invariant(db, 'Database not found');
|
|
27
|
+
|
|
28
|
+
const message = Obj.make(Message.Message, {
|
|
29
|
+
created: new Date().toISOString(),
|
|
30
|
+
sender,
|
|
31
|
+
blocks: [{ _tag: 'text', text }],
|
|
32
|
+
});
|
|
33
|
+
Obj.update(thread, (thread) => {
|
|
34
|
+
thread.messages.push(Ref.make(message));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const state = registry.get(stateAtom);
|
|
38
|
+
const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);
|
|
39
|
+
if (draft) {
|
|
40
|
+
Obj.update(thread, (thread) => {
|
|
41
|
+
thread.status = 'active';
|
|
42
|
+
});
|
|
43
|
+
registry.set(stateAtom, {
|
|
44
|
+
...state,
|
|
45
|
+
drafts: {
|
|
46
|
+
...state.drafts,
|
|
47
|
+
[subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });
|
|
51
|
+
yield* Operation.invoke(SpaceOperation.AddRelation, {
|
|
52
|
+
db,
|
|
53
|
+
schema: AnchoredTo.AnchoredTo,
|
|
54
|
+
source: thread,
|
|
55
|
+
target: subject,
|
|
56
|
+
fields: { anchor: draft.anchor },
|
|
57
|
+
});
|
|
58
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
59
|
+
name: 'threads.create',
|
|
60
|
+
properties: {
|
|
61
|
+
spaceId: db.spaceId,
|
|
62
|
+
threadId: thread.id,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
68
|
+
name: 'threads.message.add',
|
|
69
|
+
properties: {
|
|
70
|
+
spaceId: db.spaceId,
|
|
71
|
+
threadId: thread.id,
|
|
72
|
+
threadLength: thread.messages.length,
|
|
73
|
+
messageId: message.id,
|
|
74
|
+
messageLength: text.length,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}),
|
|
78
|
+
),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export default handler;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Feed, Obj } from '@dxos/echo';
|
|
10
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
12
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
13
|
+
import { Message } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { ThreadOperation } from '../types';
|
|
16
|
+
|
|
17
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.AppendChannelMessage> =
|
|
18
|
+
ThreadOperation.AppendChannelMessage.pipe(
|
|
19
|
+
Operation.withHandler(
|
|
20
|
+
Effect.fnUntraced(function* ({ channel, sender, text }) {
|
|
21
|
+
const db = Obj.getDatabase(channel);
|
|
22
|
+
invariant(db, 'Database not found');
|
|
23
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
24
|
+
const space = client.spaces.get(db.spaceId);
|
|
25
|
+
invariant(space, 'Space not found');
|
|
26
|
+
|
|
27
|
+
const feed = yield* Database.load(channel.feed);
|
|
28
|
+
const message = Message.make({
|
|
29
|
+
sender,
|
|
30
|
+
blocks: [{ _tag: 'text', text }],
|
|
31
|
+
});
|
|
32
|
+
yield* Feed.append(feed, [message]).pipe(Effect.provide(createFeedServiceLayer(space.queues)));
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export default handler;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Channel } from '@dxos/types';
|
|
9
|
+
|
|
10
|
+
import { ThreadOperation } from '../types';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.CreateChannel> = ThreadOperation.CreateChannel.pipe(
|
|
13
|
+
Operation.withHandler((input) =>
|
|
14
|
+
Effect.sync(() => ({
|
|
15
|
+
object: Channel.make({ name: input.name }),
|
|
16
|
+
})),
|
|
17
|
+
),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default handler;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
|
|
9
|
+
import { computeDiffsWithCursors } from '@dxos/assistant';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Database, Obj, Ref, Relation } from '@dxos/echo';
|
|
12
|
+
import { createDocAccessor } from '@dxos/echo-db';
|
|
13
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { ThreadOperation } from '../types';
|
|
16
|
+
|
|
17
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.CreateProposals> = ThreadOperation.CreateProposals.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fn(function* ({ doc, diffs }) {
|
|
20
|
+
const object = yield* Database.load(doc);
|
|
21
|
+
const content = yield* Effect.promise(() => object.content.load());
|
|
22
|
+
const accessor = createDocAccessor(content, ['content']);
|
|
23
|
+
|
|
24
|
+
yield* Function.pipe(
|
|
25
|
+
computeDiffsWithCursors(accessor, diffs),
|
|
26
|
+
Array.map(
|
|
27
|
+
Effect.fnUntraced(function* ({ cursor, text }) {
|
|
28
|
+
const proposal = Obj.make(Message.Message, {
|
|
29
|
+
created: new Date().toISOString(),
|
|
30
|
+
sender: { role: 'assistant' },
|
|
31
|
+
blocks: [{ _tag: 'proposal', text }],
|
|
32
|
+
});
|
|
33
|
+
const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });
|
|
34
|
+
const relation = Relation.make(AnchoredTo.AnchoredTo, {
|
|
35
|
+
[Relation.Source]: thread,
|
|
36
|
+
[Relation.Target]: object,
|
|
37
|
+
anchor: cursor,
|
|
38
|
+
});
|
|
39
|
+
yield* Database.add(thread);
|
|
40
|
+
yield* Database.add(relation);
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
Effect.allWith({ concurrency: 'unbounded' }),
|
|
44
|
+
);
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export default handler;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
11
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
12
|
+
import { AnchoredTo, Thread } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { ThreadCapabilities } from '../types';
|
|
15
|
+
import { ThreadOperation } from '../types';
|
|
16
|
+
|
|
17
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.Create> = ThreadOperation.Create.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
|
|
20
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
21
|
+
const stateAtom = yield* Capability.get(ThreadCapabilities.State);
|
|
22
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
23
|
+
const thread = Thread.make({ name });
|
|
24
|
+
const anchor = Relation.make(AnchoredTo.AnchoredTo, {
|
|
25
|
+
[Relation.Source]: thread,
|
|
26
|
+
[Relation.Target]: subject,
|
|
27
|
+
anchor: _anchor,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const state = registry.get(stateAtom);
|
|
31
|
+
const existingDrafts = state.drafts[subjectId];
|
|
32
|
+
registry.set(stateAtom, {
|
|
33
|
+
...state,
|
|
34
|
+
drafts: {
|
|
35
|
+
...state.drafts,
|
|
36
|
+
[subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
yield* Operation.invoke(ThreadOperation.Select, { current: Obj.getDXN(thread).toString() });
|
|
41
|
+
yield* Operation.invoke(LayoutOperation.UpdateCompanion, {
|
|
42
|
+
subject: linkedSegment('comments'),
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export default handler;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
11
|
+
import { Thread } from '@dxos/types';
|
|
12
|
+
|
|
13
|
+
import { ThreadOperation } from '../types';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.DeleteMessage> = ThreadOperation.DeleteMessage.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
|
|
18
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
19
|
+
const db = Obj.getDatabase(subject);
|
|
20
|
+
invariant(db, 'Database not found');
|
|
21
|
+
|
|
22
|
+
const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);
|
|
23
|
+
const msg = thread.messages[msgIndex]?.target;
|
|
24
|
+
if (!msg) {
|
|
25
|
+
return { messageIndex: -1 };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (msgIndex === 0 && thread.messages.length === 1) {
|
|
29
|
+
// TODO(wittjosiah): This doesn't support restoring the thread.
|
|
30
|
+
yield* Operation.invoke(ThreadOperation.Delete, { subject, anchor });
|
|
31
|
+
return { messageIndex: -1 };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Obj.update(thread, (thread) => {
|
|
35
|
+
thread.messages.splice(msgIndex, 1);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
39
|
+
name: 'threads.message.delete',
|
|
40
|
+
properties: {
|
|
41
|
+
spaceId: db.spaceId,
|
|
42
|
+
threadId: thread.id,
|
|
43
|
+
threadLength: thread.messages.length,
|
|
44
|
+
messageId,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return { message: msg, messageIndex: msgIndex };
|
|
49
|
+
}),
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export default handler;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { sleep } from '@dxos/async';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
11
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
12
|
+
import { Thread } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { ThreadCapabilities } from '../types';
|
|
15
|
+
import { ThreadOperation } from '../types';
|
|
16
|
+
|
|
17
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.Delete> = ThreadOperation.Delete.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
|
|
20
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
21
|
+
const stateAtom = yield* Capability.get(ThreadCapabilities.State);
|
|
22
|
+
const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);
|
|
23
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
24
|
+
const state = registry.get(stateAtom);
|
|
25
|
+
const draft = state.drafts[subjectId];
|
|
26
|
+
if (draft) {
|
|
27
|
+
const index = draft.findIndex((a: { id: string }) => a.id === anchor.id);
|
|
28
|
+
if (index !== -1) {
|
|
29
|
+
registry.set(stateAtom, {
|
|
30
|
+
...state,
|
|
31
|
+
drafts: {
|
|
32
|
+
...state.drafts,
|
|
33
|
+
[subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const db = Obj.getDatabase(thread);
|
|
41
|
+
if (!db) {
|
|
42
|
+
return {};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
46
|
+
db.remove(anchor);
|
|
47
|
+
yield* Effect.promise(() => sleep(100));
|
|
48
|
+
db.remove(thread);
|
|
49
|
+
|
|
50
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
51
|
+
name: 'threads.delete',
|
|
52
|
+
properties: {
|
|
53
|
+
spaceId: db.spaceId,
|
|
54
|
+
threadId: thread.id,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return { thread, anchor };
|
|
59
|
+
}),
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export default handler;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export const ThreadOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./add-message'),
|
|
9
|
+
() => import('./append-channel-message'),
|
|
10
|
+
() => import('./create'),
|
|
11
|
+
() => import('./create-channel'),
|
|
12
|
+
() => import('./create-proposals'),
|
|
13
|
+
() => import('./delete'),
|
|
14
|
+
() => import('./delete-message'),
|
|
15
|
+
() => import('./on-create-space'),
|
|
16
|
+
() => import('./restore'),
|
|
17
|
+
() => import('./restore-message'),
|
|
18
|
+
() => import('./select'),
|
|
19
|
+
() => import('./toggle-resolved'),
|
|
20
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import { ThreadOperation } from '../types';
|
|
10
|
+
|
|
11
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.OnCreateSpace> = ThreadOperation.OnCreateSpace.pipe(
|
|
12
|
+
Operation.withHandler(
|
|
13
|
+
Effect.fnUntraced(function* ({ space, isDefault }) {
|
|
14
|
+
if (isDefault) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { object: channel } = yield* Operation.invoke(ThreadOperation.CreateChannel, {
|
|
19
|
+
name: 'General',
|
|
20
|
+
spaceId: space.id,
|
|
21
|
+
});
|
|
22
|
+
space.db.add(channel);
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default handler;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Obj, Ref, Relation } from '@dxos/echo';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
11
|
+
import { Thread } from '@dxos/types';
|
|
12
|
+
|
|
13
|
+
import { ThreadOperation } from '../types';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.RestoreMessage> = ThreadOperation.RestoreMessage.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* ({ anchor, message, messageIndex }) {
|
|
18
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
19
|
+
const db = Obj.getDatabase(thread);
|
|
20
|
+
invariant(db, 'Database not found');
|
|
21
|
+
|
|
22
|
+
Obj.update(thread, (thread) => {
|
|
23
|
+
thread.messages.splice(messageIndex, 0, Ref.make(message));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
27
|
+
name: 'threads.message.undo-delete',
|
|
28
|
+
properties: {
|
|
29
|
+
spaceId: db.spaceId,
|
|
30
|
+
threadId: thread.id,
|
|
31
|
+
messageId: message.id,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default handler;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { sleep } from '@dxos/async';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
11
|
+
|
|
12
|
+
import { ThreadOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.Restore> = ThreadOperation.Restore.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* ({ thread, anchor }) {
|
|
17
|
+
const db = Obj.getDatabase(thread);
|
|
18
|
+
if (!db) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
23
|
+
db.add(thread);
|
|
24
|
+
yield* Effect.promise(() => sleep(100));
|
|
25
|
+
db.add(anchor);
|
|
26
|
+
|
|
27
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
28
|
+
name: 'threads.undo-delete',
|
|
29
|
+
properties: {
|
|
30
|
+
spaceId: db.spaceId,
|
|
31
|
+
threadId: thread.id,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default handler;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ThreadCapabilities } from '../types';
|
|
11
|
+
import { ThreadOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.Select> = ThreadOperation.Select.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* (input) {
|
|
16
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
17
|
+
const stateAtom = yield* Capability.get(ThreadCapabilities.State);
|
|
18
|
+
const current = registry.get(stateAtom);
|
|
19
|
+
registry.set(stateAtom, { ...current, current: input.current });
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
11
|
+
|
|
12
|
+
import { ThreadOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.ToggleResolved> = ThreadOperation.ToggleResolved.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* (input) {
|
|
17
|
+
const thread = input.thread;
|
|
18
|
+
|
|
19
|
+
Obj.update(thread, (thread) => {
|
|
20
|
+
if (thread.status === 'active' || thread.status === undefined) {
|
|
21
|
+
thread.status = 'resolved';
|
|
22
|
+
} else if (thread.status === 'resolved') {
|
|
23
|
+
thread.status = 'active';
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const db = Obj.getDatabase(thread);
|
|
28
|
+
invariant(db, 'Database not found');
|
|
29
|
+
|
|
30
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
31
|
+
name: 'threads.toggle-resolved',
|
|
32
|
+
properties: {
|
|
33
|
+
spaceId: db.spaceId,
|
|
34
|
+
threadId: thread.id,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}),
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ThreadPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ThreadOperationHandlerSet } from './operations';
|