@dxos/plugin-thread 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe
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/add-message-A33GVGQX.mjs +97 -0
- package/dist/lib/browser/add-message-A33GVGQX.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +33 -4
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-2QNKWX4H.mjs +259 -0
- package/dist/lib/browser/chunk-2QNKWX4H.mjs.map +7 -0
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs +61 -0
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs.map +7 -0
- package/dist/lib/browser/create-N2ZVTONJ.mjs +55 -0
- package/dist/lib/browser/create-N2ZVTONJ.mjs.map +7 -0
- package/dist/lib/browser/create-channel-Y4H3535D.mjs +21 -0
- package/dist/lib/browser/create-channel-Y4H3535D.mjs.map +7 -0
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs +28 -0
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs.map +7 -0
- package/dist/lib/browser/create-proposals-VTOSWUOX.mjs +57 -0
- package/dist/lib/browser/create-proposals-VTOSWUOX.mjs.map +7 -0
- package/dist/lib/browser/delete-QZZE655Y.mjs +59 -0
- package/dist/lib/browser/delete-QZZE655Y.mjs.map +7 -0
- package/dist/lib/browser/delete-message-WQAZLYBO.mjs +64 -0
- package/dist/lib/browser/delete-message-WQAZLYBO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2225 -211
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-2UGS234J.mjs +25 -0
- package/dist/lib/browser/on-create-space-2UGS234J.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/restore-KKQHFLYO.mjs +33 -0
- package/dist/lib/browser/restore-KKQHFLYO.mjs.map +7 -0
- package/dist/lib/browser/restore-message-VOP2UE7N.mjs +42 -0
- package/dist/lib/browser/restore-message-VOP2UE7N.mjs.map +7 -0
- package/dist/lib/browser/select-VBJ3MBLN.mjs +26 -0
- package/dist/lib/browser/select-VBJ3MBLN.mjs.map +7 -0
- package/dist/lib/browser/toggle-resolved-GIYF3KWJ.mjs +45 -0
- package/dist/lib/browser/toggle-resolved-GIYF3KWJ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +5 -7
- package/dist/lib/node-esm/add-message-E6XC6E3Z.mjs +98 -0
- package/dist/lib/node-esm/add-message-E6XC6E3Z.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +33 -4
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs +260 -0
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs +62 -0
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs.map +7 -0
- package/dist/lib/node-esm/create-A6XQZR7M.mjs +56 -0
- package/dist/lib/node-esm/create-A6XQZR7M.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs +22 -0
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs +29 -0
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs.map +7 -0
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs +58 -0
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs.map +7 -0
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs +60 -0
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs.map +7 -0
- package/dist/lib/node-esm/delete-message-W4XFE4KW.mjs +65 -0
- package/dist/lib/node-esm/delete-message-W4XFE4KW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2225 -211
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs +26 -0
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs +34 -0
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs.map +7 -0
- package/dist/lib/node-esm/restore-message-O5XC34MW.mjs +43 -0
- package/dist/lib/node-esm/restore-message-O5XC34MW.mjs.map +7 -0
- package/dist/lib/node-esm/select-6KETLVWY.mjs +27 -0
- package/dist/lib/node-esm/select-6KETLVWY.mjs.map +7 -0
- package/dist/lib/node-esm/toggle-resolved-QR3SOXR7.mjs +46 -0
- package/dist/lib/node-esm/toggle-resolved-QR3SOXR7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +5 -7
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/thread-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.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 +6 -0
- 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.d.ts +6 -0
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +15 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- 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/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +7 -0
- 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/Toolbar.d.ts +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +15 -0
- 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/{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 +4 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers/CallDebugPanel}/CallDebugPanel.d.ts +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +2 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/CallSidebar}/CallSidebar.d.ts +0 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts +2 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +12 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatContainer}/ChatContainer.d.ts +3 -5
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +8 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- 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 +1 -1
- 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/operations/add-message.d.ts +5 -0
- package/dist/types/src/operations/add-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel-thread.d.ts +5 -0
- package/dist/types/src/operations/create-channel-thread.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/definitions.d.ts +2789 -0
- package/dist/types/src/operations/definitions.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 +4 -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/{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/stories.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/Channel.d.ts +25 -9
- package/dist/types/src/types/Channel.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +4 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -3227
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +88 -66
- package/src/ThreadPlugin.tsx +54 -56
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/thread-blueprint.ts +13 -8
- package/src/calls/util/calls-service.ts +0 -1
- package/src/calls-service.stories.tsx +10 -9
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +42 -50
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/{call-manager/call-manager.ts → call-manager.ts} +6 -5
- package/src/capabilities/index.ts +16 -10
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +14 -15
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +4 -4
- package/src/capabilities/react-surface.tsx +90 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +9 -7
- package/src/capabilities/{state/state.ts → state.ts} +1 -1
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +5 -5
- package/src/components/Call/Toolbar.tsx +30 -21
- package/src/components/{Comments.stories.tsx → CommentsPanel/CommentsPanel.stories.tsx} +16 -16
- package/src/components/{CommentsContainer.tsx → CommentsPanel/CommentsPanel.tsx} +15 -14
- package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +19 -20
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +8 -7
- package/src/components/Media/VideoObject.stories.tsx +6 -7
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +24 -18
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +3 -2
- package/src/components/Participant/ParticipantGrid.tsx +0 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +10 -11
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +8 -8
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +9 -9
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +7 -8
- package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +5 -5
- package/src/components/ResponsiveGrid/index.ts +1 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +31 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +5 -9
- package/src/{components → containers/CallDebugPanel}/CallDebugPanel.tsx +8 -7
- package/src/containers/CallDebugPanel/index.ts +5 -0
- package/src/{components → containers/CallSidebar}/CallSidebar.tsx +4 -6
- package/src/containers/CallSidebar/index.ts +5 -0
- package/src/{components → containers/ChannelContainer}/ChannelContainer.stories.tsx +14 -14
- package/src/{components → containers/ChannelContainer}/ChannelContainer.tsx +75 -59
- package/src/containers/ChannelContainer/index.ts +5 -0
- package/src/{components/Chat.stories.tsx → containers/ChatContainer/ChatContainer.stories.tsx} +22 -20
- package/src/containers/ChatContainer/ChatContainer.tsx +131 -0
- package/src/containers/ChatContainer/index.ts +8 -0
- package/src/{components → containers/ThreadCompanion}/ThreadCompanion.tsx +74 -50
- package/src/containers/ThreadCompanion/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/{components/command-extension.ts → extensions/command.ts} +1 -1
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +14 -13
- package/src/hooks/analytics.ts +3 -2
- package/src/meta.ts +2 -2
- package/src/operations/add-message.ts +81 -0
- package/src/operations/create-channel-thread.ts +26 -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/definitions.ts +177 -0
- package/src/operations/delete-message.ts +53 -0
- package/src/operations/delete.ts +63 -0
- package/src/operations/index.ts +22 -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/{components/testing.ts → testing/data.ts} +7 -7
- package/src/testing/stories.ts +7 -11
- package/src/translations.ts +72 -76
- package/src/types/Channel.ts +11 -4
- package/src/types/Settings.ts +10 -0
- package/src/types/capabilities.ts +9 -7
- package/src/types/types.ts +2 -184
- package/src/util.ts +1 -1
- package/dist/lib/browser/app-graph-builder-7C2QW32W.mjs +0 -188
- package/dist/lib/browser/app-graph-builder-7C2QW32W.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs +0 -17
- package/dist/lib/browser/blueprint-definition-UQ63QKQG.mjs.map +0 -7
- package/dist/lib/browser/call-manager-4P536YNX.mjs +0 -26
- package/dist/lib/browser/call-manager-4P536YNX.mjs.map +0 -7
- package/dist/lib/browser/chunk-2FIHSX35.mjs +0 -293
- package/dist/lib/browser/chunk-2FIHSX35.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-DLO2G3DM.mjs +0 -184
- package/dist/lib/browser/chunk-DLO2G3DM.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERK254BS.mjs +0 -1810
- package/dist/lib/browser/chunk-ERK254BS.mjs.map +0 -7
- package/dist/lib/browser/chunk-ISCHODBV.mjs +0 -106
- package/dist/lib/browser/chunk-ISCHODBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-YSHXWAL3.mjs +0 -1815
- package/dist/lib/browser/chunk-YSHXWAL3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZFLSTQSE.mjs +0 -106
- package/dist/lib/browser/chunk-ZFLSTQSE.mjs.map +0 -7
- package/dist/lib/browser/markdown-QMJLRR6R.mjs +0 -210
- package/dist/lib/browser/markdown-QMJLRR6R.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-T63EP5TY.mjs +0 -441
- package/dist/lib/browser/operation-resolver-T63EP5TY.mjs.map +0 -7
- package/dist/lib/browser/react-root-56MJI77R.mjs +0 -25
- package/dist/lib/browser/react-root-56MJI77R.mjs.map +0 -7
- package/dist/lib/browser/react-surface-DMBHQOXJ.mjs +0 -110
- package/dist/lib/browser/react-surface-DMBHQOXJ.mjs.map +0 -7
- package/dist/lib/browser/repair-6OZ75AUU.mjs +0 -38
- package/dist/lib/browser/repair-6OZ75AUU.mjs.map +0 -7
- package/dist/lib/browser/settings-WZMJMML3.mjs +0 -32
- package/dist/lib/browser/settings-WZMJMML3.mjs.map +0 -7
- package/dist/lib/browser/state-SJR2GL5G.mjs +0 -24
- package/dist/lib/browser/state-SJR2GL5G.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-JCSVFRVY.mjs +0 -189
- package/dist/lib/node-esm/app-graph-builder-JCSVFRVY.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-MZZXXL37.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-FMLRR5S5.mjs +0 -27
- package/dist/lib/node-esm/call-manager-FMLRR5S5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7XQLXMX7.mjs +0 -1816
- package/dist/lib/node-esm/chunk-7XQLXMX7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs +0 -33
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs +0 -107
- package/dist/lib/node-esm/chunk-AQHPP6ZX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KRBZBJRI.mjs +0 -185
- package/dist/lib/node-esm/chunk-KRBZBJRI.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-VBI32FGI.mjs +0 -108
- package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WMWUXWAS.mjs +0 -294
- package/dist/lib/node-esm/chunk-WMWUXWAS.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-L6LLQLIN.mjs +0 -211
- package/dist/lib/node-esm/markdown-L6LLQLIN.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-G6GZPBRP.mjs +0 -442
- package/dist/lib/node-esm/operation-resolver-G6GZPBRP.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-V4W4X5GL.mjs +0 -26
- package/dist/lib/node-esm/react-root-V4W4X5GL.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ELDSTUA3.mjs +0 -111
- package/dist/lib/node-esm/react-surface-ELDSTUA3.mjs.map +0 -7
- package/dist/lib/node-esm/repair-6777EPOM.mjs +0 -39
- package/dist/lib/node-esm/repair-6777EPOM.mjs.map +0 -7
- package/dist/lib/node-esm/settings-37CO3SNR.mjs +0 -33
- package/dist/lib/node-esm/settings-37CO3SNR.mjs.map +0 -7
- package/dist/lib/node-esm/state-5R3TZJQE.mjs +0 -25
- package/dist/lib/node-esm/state-5R3TZJQE.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- 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 -9
- 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 +0 -6
- 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 +0 -5
- 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 +0 -5
- 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 +0 -5
- 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 +0 -7
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.d.ts +0 -13
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -164
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -164
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.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 +0 -15
- 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/ThreadCompanion.d.ts +0 -5
- package/dist/types/src/components/ThreadCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings.d.ts +0 -8
- package/dist/types/src/components/ThreadSettings.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/functions/create-proposals.d.ts +0 -6
- package/dist/types/src/functions/create-proposals.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -2
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -23
- 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 -400
- 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 -97
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -51
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/components/ChatContainer.tsx +0 -155
- package/src/components/ThreadSettings.tsx +0 -21
- package/src/functions/create-proposals.ts +0 -57
- package/src/functions/index.ts +0 -5
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
5
|
+
|
|
6
|
+
// src/types/capabilities.ts
|
|
7
|
+
import { Capability } from "@dxos/app-framework";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
(function(ThreadCapabilities2) {
|
|
10
|
+
ThreadCapabilities2.Settings = Capability.make(`${meta.id}.capability.settings`);
|
|
11
|
+
ThreadCapabilities2.CallManager = Capability.make(`${meta.id}.capability.call-manager`);
|
|
12
|
+
ThreadCapabilities2.CallExtension = Capability.make(`${meta.id}.capability.call-extension`);
|
|
13
|
+
ThreadCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
14
|
+
ThreadCapabilities2.ViewState = Capability.make(`${meta.id}.capability.view-state`);
|
|
15
|
+
})(ThreadCapabilities || (ThreadCapabilities = {}));
|
|
16
|
+
var ThreadCapabilities;
|
|
17
|
+
|
|
18
|
+
// src/types/Channel.ts
|
|
19
|
+
var Channel_exports = {};
|
|
20
|
+
__export(Channel_exports, {
|
|
21
|
+
Channel: () => Channel,
|
|
22
|
+
make: () => make
|
|
23
|
+
});
|
|
24
|
+
import * as Schema from "effect/Schema";
|
|
25
|
+
import { Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
26
|
+
import { FormInputAnnotation } from "@dxos/echo/internal";
|
|
27
|
+
import { Thread } from "@dxos/types";
|
|
28
|
+
var Channel = Schema.Struct({
|
|
29
|
+
name: Schema.optional(Schema.String),
|
|
30
|
+
defaultThread: Ref.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),
|
|
31
|
+
// TODO(wittjosiah): Should be an "ordered collection".
|
|
32
|
+
threads: Ref.Ref(Thread.Thread).pipe(Schema.Array, FormInputAnnotation.set(false))
|
|
33
|
+
}).pipe(Type.object({
|
|
34
|
+
typename: "org.dxos.type.channel",
|
|
35
|
+
version: "0.1.0"
|
|
36
|
+
}), Annotation.IconAnnotation.set({
|
|
37
|
+
icon: "ph--hash--regular",
|
|
38
|
+
hue: "rose"
|
|
39
|
+
}));
|
|
40
|
+
var make = (props = {}) => Obj.make(Channel, {
|
|
41
|
+
...props,
|
|
42
|
+
defaultThread: Ref.make(Obj.make(Thread.Thread, {
|
|
43
|
+
messages: [],
|
|
44
|
+
status: "active"
|
|
45
|
+
})),
|
|
46
|
+
threads: []
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// src/types/Settings.ts
|
|
50
|
+
var Settings_exports = {};
|
|
51
|
+
__export(Settings_exports, {
|
|
52
|
+
Settings: () => Settings
|
|
53
|
+
});
|
|
54
|
+
import * as Schema2 from "effect/Schema";
|
|
55
|
+
var Settings = Schema2.mutable(Schema2.Struct({}));
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
ThreadCapabilities,
|
|
59
|
+
Channel_exports,
|
|
60
|
+
Settings_exports
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=chunk-UGSMYQLZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/Channel.ts", "../../../src/types/Settings.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport { type CallManager, type CallState, type MediaState } from '../calls';\nimport { type Channel, type ThreadState, type ViewStore } from '../types';\nimport * as Settings from './Settings';\n\nexport namespace ThreadCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n export const CallManager = Capability.make<CallManager>(`${meta.id}.capability.call-manager`);\n\n // TODO(burdon): Better way to define specific extensions for meeting companions.\n // TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?\n // TODO(wittjosiah): These callbacks could be intents once we support broadcast.\n export type CallProperties = {\n onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;\n onLeave: (roomId?: string) => Promise<void>;\n onCallStateUpdated: (callState: CallState) => Promise<void>;\n onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;\n };\n\n export const CallExtension = Capability.make<CallProperties>(`${meta.id}.capability.call-extension`);\n\n /** Thread state (drafts, toolbar state, current selection). */\n export const State = Capability.make<Atom.Writable<ThreadState>>(`${meta.id}.capability.state`);\n\n /** Per-subject view state (e.g., showResolvedThreads). */\n export const ViewState = Capability.make<Atom.Writable<ViewStore>>(`${meta.id}.capability.view-state`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { Thread } from '@dxos/types';\n\n// TODO(burdon): What is the difference between Thread and Channel.\nexport const Channel = Schema.Struct({\n name: Schema.optional(Schema.String),\n defaultThread: Ref.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),\n // TODO(wittjosiah): Should be an \"ordered collection\".\n threads: Ref.Ref(Thread.Thread).pipe(Schema.Array, FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.channel',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--hash--regular',\n hue: 'rose',\n }),\n);\n\nexport interface Channel extends Schema.Schema.Type<typeof Channel> {}\n\nexport const make = (props: Pick<Obj.MakeProps<typeof Channel>, 'name'> = {}) =>\n Obj.make(Channel, {\n ...props,\n defaultThread: Ref.make(Obj.make(Thread.Thread, { messages: [], status: 'active' })),\n threads: [],\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(Schema.Struct({}));\nexport type Settings = Schema.Schema.Type<typeof Settings>;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAMA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAMJC,qBAAAA;sBACFC,WAAWC,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,sBAAsB;sBAC7FC,cAAcJ,WAAWC,KAAkB,GAAGC,KAAKC,EAAE,0BAA0B;sBAY/EE,gBAAgBL,WAAWC,KAAqB,GAAGC,KAAKC,EAAE,4BAA4B;sBAGtFG,QAAQN,WAAWC,KAAiC,GAAGC,KAAKC,EAAE,mBAAmB;sBAGjFI,YAAYP,WAAWC,KAA+B,GAAGC,KAAKC,EAAE,wBAAwB;AACvG,GArBiBL,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;ACdjB;;;;;AAMA,YAAYU,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,2BAA2B;AACpC,SAASC,cAAc;AAGhB,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,gBAAgBC,aAAM;EACnCC,eAAeC,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAKC,oBAAoBC,IAAI,KAAA,CAAA;;EAEnEC,SAASL,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAYI,cAAOH,oBAAoBC,IAAI,KAAA,CAAA;AAC7E,CAAA,EAAGF,KACDK,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeR,IAAI;EAC5BS,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAACC,QAAqD,CAAC,MACzEC,IAAIF,KAAKrB,SAAS;EAChB,GAAGsB;EACHjB,eAAeC,IAAIe,KAAKE,IAAIF,KAAKd,OAAOA,QAAQ;IAAEiB,UAAU,CAAA;IAAIC,QAAQ;EAAS,CAAA,CAAA;EACjFd,SAAS,CAAA;AACX,CAAA;;;ACpCF;;;;AAMA,YAAYe,aAAY;AAEjB,IAAMC,WAAkBC,gBAAeC,eAAO,CAAC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "meta", "ThreadCapabilities", "Settings", "Capability", "make", "meta", "id", "CallManager", "CallExtension", "State", "ViewState", "Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "Thread", "Channel", "Struct", "name", "optional", "String", "defaultThread", "Ref", "Thread", "pipe", "FormInputAnnotation", "set", "threads", "Array", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "icon", "hue", "make", "props", "Obj", "messages", "status", "Schema", "Settings", "mutable", "Struct"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Create,
|
|
4
|
+
Select
|
|
5
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
6
|
+
import {
|
|
7
|
+
ThreadCapabilities
|
|
8
|
+
} from "./chunk-UGSMYQLZ.mjs";
|
|
9
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
10
|
+
|
|
11
|
+
// src/operations/create.ts
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
|
+
import { Obj, Relation } from "@dxos/echo";
|
|
15
|
+
import { Operation } from "@dxos/operation";
|
|
16
|
+
import { DeckOperation } from "@dxos/plugin-deck/operations";
|
|
17
|
+
import { linkedSegment } from "@dxos/react-ui-attention";
|
|
18
|
+
import { AnchoredTo, Thread } from "@dxos/types";
|
|
19
|
+
var handler = Create.pipe(Operation.withHandler(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({
|
|
24
|
+
name
|
|
25
|
+
});
|
|
26
|
+
const anchor = Relation.make(AnchoredTo.AnchoredTo, {
|
|
27
|
+
[Relation.Source]: thread,
|
|
28
|
+
[Relation.Target]: subject,
|
|
29
|
+
anchor: _anchor
|
|
30
|
+
});
|
|
31
|
+
const state = registry.get(stateAtom);
|
|
32
|
+
const existingDrafts = state.drafts[subjectId];
|
|
33
|
+
registry.set(stateAtom, {
|
|
34
|
+
...state,
|
|
35
|
+
drafts: {
|
|
36
|
+
...state.drafts,
|
|
37
|
+
[subjectId]: existingDrafts ? [
|
|
38
|
+
...existingDrafts,
|
|
39
|
+
anchor
|
|
40
|
+
] : [
|
|
41
|
+
anchor
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
yield* Operation.invoke(Select, {
|
|
46
|
+
current: Obj.getDXN(thread).toString()
|
|
47
|
+
});
|
|
48
|
+
yield* Operation.invoke(DeckOperation.ChangeCompanion, {
|
|
49
|
+
companion: linkedSegment("comments")
|
|
50
|
+
});
|
|
51
|
+
})));
|
|
52
|
+
var create_default = handler;
|
|
53
|
+
export {
|
|
54
|
+
create_default as default
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=create-A6XQZR7M.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { DeckOperation } from '@dxos/plugin-deck/operations';\nimport { linkedSegment } from '@dxos/react-ui-attention';\nimport { AnchoredTo, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Create, Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const subjectId = Obj.getDXN(subject).toString();\n const thread = Thread.make({ name });\n const anchor = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: subject,\n anchor: _anchor,\n });\n\n const state = registry.get(stateAtom);\n const existingDrafts = state.drafts[subjectId];\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],\n },\n });\n\n yield* Operation.invoke(Select, { current: Obj.getDXN(thread).toString() });\n yield* Operation.invoke(DeckOperation.ChangeCompanion, {\n companion: linkedSegment('comments'),\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,YAAYC,cAAc;AAKnC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAMC,QAAQC,SAASC,QAAO,GAAE;AAC7D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,YAAYC,IAAIC,OAAOX,OAAAA,EAASY,SAAQ;AAC9C,QAAMC,SAASC,OAAOC,KAAK;IAAElB;EAAK,CAAA;AAClC,QAAMC,SAASkB,SAASD,KAAKE,WAAWA,YAAY;IAClD,CAACD,SAASE,MAAM,GAAGL;IACnB,CAACG,SAASG,MAAM,GAAGnB;IACnBF,QAAQC;EACV,CAAA;AAEA,QAAMqB,QAAQnB,SAASE,IAAIG,SAAAA;AAC3B,QAAMe,iBAAiBD,MAAME,OAAOb,SAAAA;AACpCR,WAASsB,IAAIjB,WAAW;IACtB,GAAGc;IACHE,QAAQ;MACN,GAAGF,MAAME;MACT,CAACb,SAAAA,GAAYY,iBAAiB;WAAIA;QAAgBvB;UAAU;QAACA;;IAC/D;EACF,CAAA;AAEA,SAAOJ,UAAU8B,OAAOC,QAAQ;IAAEC,SAAShB,IAAIC,OAAOE,MAAAA,EAAQD,SAAQ;EAAG,CAAA;AACzE,SAAOlB,UAAU8B,OAAOG,cAAcC,iBAAiB;IACrDC,WAAWC,cAAc,UAAA;EAC3B,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAevC;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "Obj", "Relation", "Operation", "DeckOperation", "linkedSegment", "AnchoredTo", "Thread", "handler", "Create", "pipe", "Operation", "withHandler", "fnUntraced", "name", "anchor", "_anchor", "subject", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "subjectId", "Obj", "getDXN", "toString", "thread", "Thread", "make", "Relation", "AnchoredTo", "Source", "Target", "state", "existingDrafts", "drafts", "set", "invoke", "Select", "current", "DeckOperation", "ChangeCompanion", "companion", "linkedSegment"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CreateChannel
|
|
4
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Channel_exports
|
|
7
|
+
} from "./chunk-UGSMYQLZ.mjs";
|
|
8
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
9
|
+
|
|
10
|
+
// src/operations/create-channel.ts
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Operation } from "@dxos/operation";
|
|
13
|
+
var handler = CreateChannel.pipe(Operation.withHandler((input) => Effect.sync(() => ({
|
|
14
|
+
object: Channel_exports.make({
|
|
15
|
+
name: input.name
|
|
16
|
+
})
|
|
17
|
+
}))));
|
|
18
|
+
var create_channel_default = handler;
|
|
19
|
+
export {
|
|
20
|
+
create_channel_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=create-channel-KA5T23ZS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create-channel.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/operation';\n\nimport { Channel } from '../types';\nimport { CreateChannel } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannel> = CreateChannel.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => ({\n object: Channel.make({ name: input.name }),\n })),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAK1B,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YAAY,CAACC,UACdC,YAAK,OAAO;EACjBC,QAAQC,gBAAQC,KAAK;IAAEC,MAAML,MAAMK;EAAK,CAAA;AAC1C,EAAA,CAAA,CAAA;AAIJ,IAAA,yBAAeV;",
|
|
6
|
+
"names": ["Effect", "Operation", "handler", "CreateChannel", "pipe", "Operation", "withHandler", "input", "sync", "object", "Channel", "make", "name"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CreateChannelThread
|
|
4
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
5
|
+
import "./chunk-UGSMYQLZ.mjs";
|
|
6
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
7
|
+
|
|
8
|
+
// src/operations/create-channel-thread.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import { Obj, Ref } from "@dxos/echo";
|
|
11
|
+
import { Operation } from "@dxos/operation";
|
|
12
|
+
import { Thread } from "@dxos/types";
|
|
13
|
+
var handler = CreateChannelThread.pipe(Operation.withHandler((input) => Effect.sync(() => {
|
|
14
|
+
const thread = Thread.make({
|
|
15
|
+
status: "active"
|
|
16
|
+
});
|
|
17
|
+
const threadRef = Ref.make(thread);
|
|
18
|
+
Obj.change(input.channel, (obj) => {
|
|
19
|
+
obj.threads.push(threadRef);
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
object: thread
|
|
23
|
+
};
|
|
24
|
+
})));
|
|
25
|
+
var create_channel_thread_default = handler;
|
|
26
|
+
export {
|
|
27
|
+
create_channel_thread_default as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=create-channel-thread-44PXAPGM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create-channel-thread.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Thread } from '@dxos/types';\n\nimport { CreateChannelThread } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannelThread> = CreateChannelThread.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => {\n const thread = Thread.make({ status: 'active' });\n const threadRef = Ref.make(thread);\n Obj.change(input.channel, (obj) => {\n obj.threads.push(threadRef);\n });\n return { object: thread };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,WAAW;AACzB,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AAIvB,IAAMC,UAA6DC,oBAAoBC,KACrFC,UAAUC,YAAY,CAACC,UACdC,YAAK,MAAA;AACV,QAAMC,SAASC,OAAOC,KAAK;IAAEC,QAAQ;EAAS,CAAA;AAC9C,QAAMC,YAAYC,IAAIH,KAAKF,MAAAA;AAC3BM,MAAIC,OAAOT,MAAMU,SAAS,CAACC,QAAAA;AACzBA,QAAIC,QAAQC,KAAKP,SAAAA;EACnB,CAAA;AACA,SAAO;IAAEQ,QAAQZ;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,gCAAeP;",
|
|
6
|
+
"names": ["Effect", "Obj", "Ref", "Operation", "Thread", "handler", "CreateChannelThread", "pipe", "Operation", "withHandler", "input", "sync", "thread", "Thread", "make", "status", "threadRef", "Ref", "Obj", "change", "channel", "obj", "threads", "push", "object"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CreateProposals
|
|
4
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
5
|
+
import "./chunk-UGSMYQLZ.mjs";
|
|
6
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
7
|
+
|
|
8
|
+
// src/operations/create-proposals.ts
|
|
9
|
+
import * as Array from "effect/Array";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Function from "effect/Function";
|
|
12
|
+
import { computeDiffsWithCursors } from "@dxos/assistant";
|
|
13
|
+
import { Database, Obj, Ref, Relation } from "@dxos/echo";
|
|
14
|
+
import { createDocAccessor } from "@dxos/echo-db";
|
|
15
|
+
import { Operation } from "@dxos/operation";
|
|
16
|
+
import { AnchoredTo, Message, Thread } from "@dxos/types";
|
|
17
|
+
var handler = CreateProposals.pipe(Operation.withHandler(Effect.fn(function* ({ doc, diffs }) {
|
|
18
|
+
const object = yield* Database.load(doc);
|
|
19
|
+
const content = yield* Effect.promise(() => object.content.load());
|
|
20
|
+
const accessor = createDocAccessor(content, [
|
|
21
|
+
"content"
|
|
22
|
+
]);
|
|
23
|
+
yield* Function.pipe(computeDiffsWithCursors(accessor, diffs), Array.map(Effect.fnUntraced(function* ({ cursor, text }) {
|
|
24
|
+
const proposal = Obj.make(Message.Message, {
|
|
25
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26
|
+
sender: {
|
|
27
|
+
role: "assistant"
|
|
28
|
+
},
|
|
29
|
+
blocks: [
|
|
30
|
+
{
|
|
31
|
+
_tag: "proposal",
|
|
32
|
+
text
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
const thread = Thread.make({
|
|
37
|
+
name: "Proposal",
|
|
38
|
+
messages: [
|
|
39
|
+
Ref.make(proposal)
|
|
40
|
+
],
|
|
41
|
+
status: "active"
|
|
42
|
+
});
|
|
43
|
+
const relation = Relation.make(AnchoredTo.AnchoredTo, {
|
|
44
|
+
[Relation.Source]: thread,
|
|
45
|
+
[Relation.Target]: object,
|
|
46
|
+
anchor: cursor
|
|
47
|
+
});
|
|
48
|
+
yield* Database.add(thread);
|
|
49
|
+
yield* Database.add(relation);
|
|
50
|
+
})), Effect.allWith({
|
|
51
|
+
concurrency: "unbounded"
|
|
52
|
+
}));
|
|
53
|
+
})));
|
|
54
|
+
var create_proposals_default = handler;
|
|
55
|
+
export {
|
|
56
|
+
create_proposals_default as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=create-proposals-HDBVDNUX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create-proposals.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport { Database, Obj, Ref, Relation } from '@dxos/echo';\nimport { createDocAccessor } from '@dxos/echo-db';\nimport { Operation } from '@dxos/operation';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { CreateProposals } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateProposals> = CreateProposals.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ doc, diffs }) {\n const object = yield* Database.load(doc);\n const content = yield* Effect.promise(() => object.content.load());\n const accessor = createDocAccessor(content, ['content']);\n\n yield* Function.pipe(\n computeDiffsWithCursors(accessor, diffs),\n Array.map(\n Effect.fnUntraced(function* ({ cursor, text }) {\n const proposal = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { role: 'assistant' },\n blocks: [{ _tag: 'proposal', text }],\n });\n const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });\n const relation = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: object,\n anchor: cursor,\n });\n yield* Database.add(thread);\n yield* Database.add(relation);\n }),\n ),\n Effect.allWith({ concurrency: 'unbounded' }),\n );\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,+BAA+B;AACxC,SAASC,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,SAASC,cAAc;AAI5C,IAAMC,UAAyDC,gBAAgBC,KAC7EC,UAAUC,YACDC,UAAG,WAAW,EAAEC,KAAKC,MAAK,GAAE;AACjC,QAAMC,SAAS,OAAOC,SAASC,KAAKJ,GAAAA;AACpC,QAAMK,UAAU,OAAcC,eAAQ,MAAMJ,OAAOG,QAAQD,KAAI,CAAA;AAC/D,QAAMG,WAAWC,kBAAkBH,SAAS;IAAC;GAAU;AAEvD,SAAgBT,cACda,wBAAwBF,UAAUN,KAAAA,GAC5BS,UACGC,kBAAW,WAAW,EAAEC,QAAQC,KAAI,GAAE;AAC3C,UAAMC,WAAWC,IAAIC,KAAKC,QAAQA,SAAS;MACzCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;MAC/BC,QAAQ;QAAEC,MAAM;MAAY;MAC5BC,QAAQ;QAAC;UAAEC,MAAM;UAAYX;QAAK;;IACpC,CAAA;AACA,UAAMY,SAASC,OAAOV,KAAK;MAAEW,MAAM;MAAYC,UAAU;QAACC,IAAIb,KAAKF,QAAAA;;MAAYgB,QAAQ;IAAS,CAAA;AAChG,UAAMC,WAAWC,SAAShB,KAAKiB,WAAWA,YAAY;MACpD,CAACD,SAASE,MAAM,GAAGT;MACnB,CAACO,SAASG,MAAM,GAAGjC;MACnBkC,QAAQxB;IACV,CAAA;AACA,WAAOT,SAASkC,IAAIZ,MAAAA;AACpB,WAAOtB,SAASkC,IAAIN,QAAAA;EACtB,CAAA,CAAA,GAEKO,eAAQ;IAAEC,aAAa;EAAY,CAAA,CAAA;AAE9C,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAe7C;",
|
|
6
|
+
"names": ["Array", "Effect", "Function", "computeDiffsWithCursors", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "Operation", "AnchoredTo", "Message", "Thread", "handler", "CreateProposals", "pipe", "Operation", "withHandler", "fn", "doc", "diffs", "object", "Database", "load", "content", "promise", "accessor", "createDocAccessor", "computeDiffsWithCursors", "map", "fnUntraced", "cursor", "text", "proposal", "Obj", "make", "Message", "created", "Date", "toISOString", "sender", "role", "blocks", "_tag", "thread", "Thread", "name", "messages", "Ref", "status", "relation", "Relation", "AnchoredTo", "Source", "Target", "anchor", "add", "allWith", "concurrency"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Delete
|
|
4
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
5
|
+
import {
|
|
6
|
+
ThreadCapabilities
|
|
7
|
+
} from "./chunk-UGSMYQLZ.mjs";
|
|
8
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
9
|
+
|
|
10
|
+
// src/operations/delete.ts
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
13
|
+
import { sleep } from "@dxos/async";
|
|
14
|
+
import { Obj, Relation } from "@dxos/echo";
|
|
15
|
+
import { Operation } from "@dxos/operation";
|
|
16
|
+
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
17
|
+
var handler = Delete.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
|
|
18
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
19
|
+
const stateAtom = yield* Capability.get(ThreadCapabilities.State);
|
|
20
|
+
const thread = _thread ?? Relation.getSource(anchor);
|
|
21
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
22
|
+
const state = registry.get(stateAtom);
|
|
23
|
+
const draft = state.drafts[subjectId];
|
|
24
|
+
if (draft) {
|
|
25
|
+
const index = draft.findIndex((a) => a.id === anchor.id);
|
|
26
|
+
if (index !== -1) {
|
|
27
|
+
registry.set(stateAtom, {
|
|
28
|
+
...state,
|
|
29
|
+
drafts: {
|
|
30
|
+
...state.drafts,
|
|
31
|
+
[subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index)
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const db = Obj.getDatabase(thread);
|
|
38
|
+
if (!db) {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
db.remove(anchor);
|
|
42
|
+
yield* Effect.promise(() => sleep(100));
|
|
43
|
+
db.remove(thread);
|
|
44
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
45
|
+
name: "threads.delete",
|
|
46
|
+
properties: {
|
|
47
|
+
spaceId: db.spaceId,
|
|
48
|
+
threadId: thread.id
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
thread,
|
|
53
|
+
anchor
|
|
54
|
+
};
|
|
55
|
+
})));
|
|
56
|
+
var delete_default = handler;
|
|
57
|
+
export {
|
|
58
|
+
delete_default as default
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=delete-3RAWD5GG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/delete.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { sleep } from '@dxos/async';\nimport { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Delete } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Delete> = Delete.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);\n const subjectId = Obj.getDXN(subject).toString();\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId];\n if (draft) {\n const index = draft.findIndex((a: { id: string }) => a.id === anchor.id);\n if (index !== -1) {\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index),\n },\n });\n return {};\n }\n }\n\n const db = Obj.getDatabase(thread);\n if (!db) {\n return {};\n }\n\n // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.\n db.remove(anchor);\n yield* Effect.promise(() => sleep(100));\n db.remove(thread);\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n\n return { thread, anchor };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,aAAa;AACtB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAMvC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,QAAQC,QAAO,GAAE;AAC/D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMT,SAASC,WAAYS,SAASC,UAAUZ,MAAAA;AAC9C,QAAMa,YAAYC,IAAIC,OAAOhB,OAAAA,EAASiB,SAAQ;AAC9C,QAAMC,QAAQd,SAASE,IAAIG,SAAAA;AAC3B,QAAMU,QAAQD,MAAME,OAAON,SAAAA;AAC3B,MAAIK,OAAO;AACT,UAAME,QAAQF,MAAMG,UAAU,CAACC,MAAsBA,EAAEC,OAAOvB,OAAOuB,EAAE;AACvE,QAAIH,UAAU,IAAI;AAChBjB,eAASqB,IAAIhB,WAAW;QACtB,GAAGS;QACHE,QAAQ;UACN,GAAGF,MAAME;UACT,CAACN,SAAAA,GAAYI,MAAME,OAAON,SAAAA,GAAYY,OAAO,CAACC,GAAGC,MAAMA,MAAMP,KAAAA;QAC/D;MACF,CAAA;AACA,aAAO,CAAC;IACV;EACF;AAEA,QAAMQ,KAAKd,IAAIe,YAAY5B,MAAAA;AAC3B,MAAI,CAAC2B,IAAI;AACP,WAAO,CAAC;EACV;AAGAA,KAAGE,OAAO9B,MAAAA;AACV,SAAc+B,eAAQ,MAAMC,MAAM,GAAA,CAAA;AAClCJ,KAAGE,OAAO7B,MAAAA;AAEV,SAAOL,UAAUqC,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASV,GAAGU;MACZC,UAAUtC,OAAOsB;IACnB;EACF,CAAA;AAEA,SAAO;IAAEtB;IAAQD;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeP;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "sleep", "Obj", "Relation", "Operation", "ObservabilityOperation", "handler", "Delete", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "thread", "_thread", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "state", "draft", "drafts", "index", "findIndex", "a", "id", "set", "filter", "_", "i", "db", "getDatabase", "remove", "promise", "sleep", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Delete,
|
|
4
|
+
DeleteMessage
|
|
5
|
+
} from "./chunk-I6LAZYVU.mjs";
|
|
6
|
+
import "./chunk-UGSMYQLZ.mjs";
|
|
7
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
8
|
+
|
|
9
|
+
// src/operations/delete-message.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Obj, Relation } from "@dxos/echo";
|
|
12
|
+
import { invariant } from "@dxos/invariant";
|
|
13
|
+
import { Operation } from "@dxos/operation";
|
|
14
|
+
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
15
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/delete-message.ts";
|
|
16
|
+
var handler = DeleteMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
|
|
17
|
+
const thread = Relation.getSource(anchor);
|
|
18
|
+
const db = Obj.getDatabase(subject);
|
|
19
|
+
invariant(db, "Database not found", {
|
|
20
|
+
F: __dxlog_file,
|
|
21
|
+
L: 20,
|
|
22
|
+
S: this,
|
|
23
|
+
A: [
|
|
24
|
+
"db",
|
|
25
|
+
"'Database not found'"
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);
|
|
29
|
+
const msg = thread.messages[msgIndex]?.target;
|
|
30
|
+
if (!msg) {
|
|
31
|
+
return {
|
|
32
|
+
messageIndex: -1
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (msgIndex === 0 && thread.messages.length === 1) {
|
|
36
|
+
yield* Operation.invoke(Delete, {
|
|
37
|
+
subject,
|
|
38
|
+
anchor
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
messageIndex: -1
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
Obj.change(thread, (thread2) => {
|
|
45
|
+
thread2.messages.splice(msgIndex, 1);
|
|
46
|
+
});
|
|
47
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
48
|
+
name: "threads.message.delete",
|
|
49
|
+
properties: {
|
|
50
|
+
spaceId: db.spaceId,
|
|
51
|
+
threadId: thread.id,
|
|
52
|
+
threadLength: thread.messages.length,
|
|
53
|
+
messageId
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
message: msg,
|
|
58
|
+
messageIndex: msgIndex
|
|
59
|
+
};
|
|
60
|
+
})));
|
|
61
|
+
var delete_message_default = handler;
|
|
62
|
+
export {
|
|
63
|
+
delete_message_default as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=delete-message-W4XFE4KW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/delete-message.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { Delete, DeleteMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, messageId }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);\n const msg = thread.messages[msgIndex]?.target;\n if (!msg) {\n return { messageIndex: -1 };\n }\n\n if (msgIndex === 0 && thread.messages.length === 1) {\n // TODO(wittjosiah): This doesn't support restoring the thread.\n yield* Operation.invoke(Delete, { subject, anchor });\n return { messageIndex: -1 };\n }\n\n Obj.change(thread, (thread) => {\n thread.messages.splice(msgIndex, 1);\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId,\n },\n });\n\n return { message: msg, messageIndex: msgIndex };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAKvC,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,UAAS,GAAE;AACzD,QAAMC,SAASC,SAASC,UAAUJ,MAAAA;AAClC,QAAMK,KAAKC,IAAIC,YAAYR,OAAAA;AAC3BS,YAAUH,IAAI,sBAAA;;;;;;;;;AAEd,QAAMI,WAAWP,OAAOQ,SAASC,UAAU,CAACC,QAAQA,IAAIC,QAAQC,OAAOb,SAAAA;AACvE,QAAMc,MAAMb,OAAOQ,SAASD,QAAAA,GAAWI;AACvC,MAAI,CAACE,KAAK;AACR,WAAO;MAAEC,cAAc;IAAG;EAC5B;AAEA,MAAIP,aAAa,KAAKP,OAAOQ,SAASO,WAAW,GAAG;AAElD,WAAOrB,UAAUsB,OAAOC,QAAQ;MAAEpB;MAASC;IAAO,CAAA;AAClD,WAAO;MAAEgB,cAAc;IAAG;EAC5B;AAEAV,MAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOQ,SAASW,OAAOZ,UAAU,CAAA;EACnC,CAAA;AAEA,SAAOb,UAAU0B,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAAStB,GAAGsB;MACZC,UAAU1B,OAAOY;MACjBe,cAAc3B,OAAOQ,SAASO;MAC9BhB;IACF;EACF,CAAA;AAEA,SAAO;IAAE6B,SAASf;IAAKC,cAAcP;EAAS;AAChD,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAehB;",
|
|
6
|
+
"names": ["Effect", "Obj", "Relation", "invariant", "Operation", "ObservabilityOperation", "handler", "DeleteMessage", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "messageId", "thread", "Relation", "getSource", "db", "Obj", "getDatabase", "invariant", "msgIndex", "messages", "findIndex", "ref", "target", "id", "msg", "messageIndex", "length", "invoke", "Delete", "change", "splice", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "message"]
|
|
7
|
+
}
|