@dxos/plugin-thread 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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 → add-message-LRVGIHDH.mjs} +9 -17
- package/dist/lib/browser/add-message-LRVGIHDH.mjs.map +7 -0
- package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs +40 -0
- package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +1 -1
- package/dist/lib/browser/blueprints/index.mjs.map +3 -3
- package/dist/lib/browser/chunk-E4GG3NX2.mjs +29 -0
- package/dist/lib/browser/chunk-E4GG3NX2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2QNKWX4H.mjs → chunk-TPNZ43NB.mjs} +15 -16
- package/dist/lib/browser/chunk-TPNZ43NB.mjs.map +7 -0
- package/dist/lib/browser/{create-N2ZVTONJ.mjs → create-BTGLHLBA.mjs} +9 -9
- package/dist/lib/browser/create-BTGLHLBA.mjs.map +7 -0
- package/dist/lib/browser/{create-channel-Y4H3535D.mjs → create-channel-ZXKSLHGN.mjs} +5 -7
- package/dist/lib/browser/create-channel-ZXKSLHGN.mjs.map +7 -0
- package/dist/lib/browser/{create-proposals-VTOSWUOX.mjs → create-proposals-AV5CREPV.mjs} +3 -4
- package/dist/lib/browser/create-proposals-AV5CREPV.mjs.map +7 -0
- package/dist/lib/browser/{delete-QZZE655Y.mjs → delete-GLYEP7NE.mjs} +6 -6
- package/dist/lib/browser/delete-GLYEP7NE.mjs.map +7 -0
- package/dist/lib/browser/{delete-message-WQAZLYBO.mjs → delete-message-RQ72ZY5D.mjs} +5 -14
- package/dist/lib/browser/delete-message-RQ72ZY5D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +79 -592
- 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 → on-create-space-SPE3QVFZ.mjs} +3 -4
- package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +3 -4
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{restore-KKQHFLYO.mjs → restore-VX7FLZOZ.mjs} +3 -4
- package/dist/lib/browser/restore-VX7FLZOZ.mjs.map +7 -0
- package/dist/lib/browser/{restore-message-VOP2UE7N.mjs → restore-message-D65NSWUA.mjs} +5 -14
- package/dist/lib/browser/restore-message-D65NSWUA.mjs.map +7 -0
- package/dist/lib/browser/{select-VBJ3MBLN.mjs → select-AT4L7EBU.mjs} +6 -6
- package/dist/lib/browser/{select-VBJ3MBLN.mjs.map → select-AT4L7EBU.mjs.map} +1 -1
- package/dist/lib/browser/{toggle-resolved-GIYF3KWJ.mjs → toggle-resolved-JD3D4WBZ.mjs} +5 -14
- package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +90 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/node-esm/{add-message-E6XC6E3Z.mjs → add-message-4EAQ2ZPI.mjs} +9 -17
- package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs.map +7 -0
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs +41 -0
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +1 -1
- package/dist/lib/node-esm/blueprints/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs +30 -0
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-I6LAZYVU.mjs → chunk-XKUMDYGR.mjs} +15 -16
- package/dist/lib/node-esm/chunk-XKUMDYGR.mjs.map +7 -0
- package/dist/lib/node-esm/{create-A6XQZR7M.mjs → create-DEZFPN2Y.mjs} +9 -9
- package/dist/lib/node-esm/create-DEZFPN2Y.mjs.map +7 -0
- package/dist/lib/node-esm/{create-channel-KA5T23ZS.mjs → create-channel-6VHTC2OR.mjs} +5 -7
- package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs.map +7 -0
- package/dist/lib/node-esm/{create-proposals-HDBVDNUX.mjs → create-proposals-P5O2ICOL.mjs} +3 -4
- package/dist/lib/{browser/create-proposals-VTOSWUOX.mjs.map → node-esm/create-proposals-P5O2ICOL.mjs.map} +3 -3
- package/dist/lib/node-esm/{delete-3RAWD5GG.mjs → delete-QG45QLPY.mjs} +6 -6
- package/dist/lib/node-esm/delete-QG45QLPY.mjs.map +7 -0
- package/dist/lib/node-esm/{delete-message-W4XFE4KW.mjs → delete-message-PGNLB6TL.mjs} +5 -14
- package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +79 -592
- 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 → on-create-space-TFBSHWQ4.mjs} +3 -4
- package/dist/lib/{browser/on-create-space-2UGS234J.mjs.map → node-esm/on-create-space-TFBSHWQ4.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -4
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{restore-PDYEKDE3.mjs → restore-E27OAIFJ.mjs} +3 -4
- package/dist/lib/node-esm/restore-E27OAIFJ.mjs.map +7 -0
- package/dist/lib/node-esm/{restore-message-O5XC34MW.mjs → restore-message-J3CH6NGI.mjs} +5 -14
- package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs.map +7 -0
- package/dist/lib/node-esm/{select-6KETLVWY.mjs → select-UU6Q2XAB.mjs} +6 -6
- package/dist/lib/node-esm/{select-6KETLVWY.mjs.map → select-UU6Q2XAB.mjs.map} +1 -1
- package/dist/lib/node-esm/{toggle-resolved-QR3SOXR7.mjs → toggle-resolved-VS6NKXL3.mjs} +5 -14
- package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +91 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- 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.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- 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 +44 -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.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
- 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/MessagePanel/MessagePanel.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 +70 -70
- 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/ResponsivePanel.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +70 -70
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- 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/ChannelChat/ChannelChat.d.ts +16 -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 +1 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +70 -70
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.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/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
- 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 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +2 -2
- 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 +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +1 -1
- package/dist/types/src/operations/add-message.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/create-proposals.d.ts +1 -1
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +1 -1
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +855 -1649
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/delete-message.d.ts +1 -1
- package/dist/types/src/operations/delete-message.d.ts.map +1 -1
- package/dist/types/src/operations/delete.d.ts +1 -1
- package/dist/types/src/operations/delete.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +1 -1
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/restore-message.d.ts +1 -1
- package/dist/types/src/operations/restore-message.d.ts.map +1 -1
- package/dist/types/src/operations/restore.d.ts +1 -1
- package/dist/types/src/operations/restore.d.ts.map +1 -1
- package/dist/types/src/operations/select.d.ts +1 -1
- package/dist/types/src/operations/select.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -1
- 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 +70 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +2 -1
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +4 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -67
- package/src/ThreadPlugin.node.ts +84 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +8 -8
- package/src/blueprints/thread-blueprint.ts +2 -3
- package/src/calls/util/calls-service.ts +3 -1
- package/src/calls/util/stub-media-streams.ts +3 -1
- package/src/calls-service.stories.tsx +4 -4
- package/src/capabilities/app-graph-builder.ts +3 -2
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/markdown.ts +10 -6
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +24 -17
- package/src/components/Call/Call.tsx +5 -5
- package/src/components/Call/Toolbar.tsx +1 -1
- package/src/components/Chat/Chat.tsx +218 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +5 -3
- package/src/components/Lobby/Lobby.tsx +5 -4
- package/src/components/MessagePanel/MessagePanel.tsx +3 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +2 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +65 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +54 -10
- package/src/containers/ChannelContainer/ChannelContainer.tsx +4 -4
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +2 -1
- package/src/extensions/threads.ts +7 -7
- package/src/index.ts +10 -3
- package/src/operations/add-message.ts +3 -3
- package/src/operations/append-channel-message.ts +36 -0
- package/src/operations/create-channel.ts +2 -2
- package/src/operations/create-proposals.ts +1 -1
- package/src/operations/create.ts +4 -4
- package/src/operations/definitions.ts +9 -9
- package/src/operations/delete-message.ts +2 -2
- package/src/operations/delete.ts +1 -1
- package/src/operations/index.ts +2 -2
- package/src/operations/on-create-space.ts +1 -1
- package/src/operations/restore-message.ts +2 -2
- package/src/operations/restore.ts +1 -1
- package/src/operations/select.ts +1 -1
- package/src/operations/toggle-resolved.ts +2 -2
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +1 -1
- package/src/types/Settings.ts +1 -1
- package/src/types/capabilities.ts +2 -1
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/add-message-A33GVGQX.mjs.map +0 -7
- package/dist/lib/browser/chunk-2QNKWX4H.mjs.map +0 -7
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs +0 -61
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs.map +0 -7
- package/dist/lib/browser/create-N2ZVTONJ.mjs.map +0 -7
- package/dist/lib/browser/create-channel-Y4H3535D.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs +0 -28
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs.map +0 -7
- package/dist/lib/browser/delete-QZZE655Y.mjs.map +0 -7
- package/dist/lib/browser/delete-message-WQAZLYBO.mjs.map +0 -7
- package/dist/lib/browser/restore-KKQHFLYO.mjs.map +0 -7
- package/dist/lib/browser/restore-message-VOP2UE7N.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-GIYF3KWJ.mjs.map +0 -7
- package/dist/lib/node-esm/add-message-E6XC6E3Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs +0 -62
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs.map +0 -7
- package/dist/lib/node-esm/create-A6XQZR7M.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs +0 -29
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs.map +0 -7
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-W4XFE4KW.mjs.map +0 -7
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs.map +0 -7
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-O5XC34MW.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-QR3SOXR7.mjs.map +0 -7
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -16
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
- package/dist/types/src/operations/create-channel-thread.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/src/containers/ChatContainer/ChatContainer.tsx +0 -131
- package/src/containers/ChatContainer/index.ts +0 -8
- package/src/operations/create-channel-thread.ts +0 -26
- package/src/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -37
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
toLocalizedString,
|
|
20
20
|
useTranslation,
|
|
21
21
|
} from '@dxos/react-ui';
|
|
22
|
+
import { type Channel } from '@dxos/types';
|
|
22
23
|
import { groupHoverControlItemWithTransition, mx } from '@dxos/ui-theme';
|
|
23
24
|
|
|
24
25
|
import { meta } from '#meta';
|
|
25
26
|
import { ThreadCapabilities } from '#types';
|
|
26
|
-
import { type Channel } from '#types';
|
|
27
27
|
|
|
28
28
|
export type ToolbarProps = ThemedClassName<{
|
|
29
29
|
channel?: Channel.Channel;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type RefObject, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
8
|
+
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
+
import { ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import {
|
|
11
|
+
type MessageMetadata,
|
|
12
|
+
MessageTextbox,
|
|
13
|
+
Thread as ThreadComponent,
|
|
14
|
+
type ThreadRootProps,
|
|
15
|
+
threadLayout,
|
|
16
|
+
} from '@dxos/react-ui-thread';
|
|
17
|
+
import { type Message } from '@dxos/types';
|
|
18
|
+
import { createBasicExtensions, createThemeExtensions, listener, type Extension } from '@dxos/ui-editor';
|
|
19
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
20
|
+
import { isNonNullable } from '@dxos/util';
|
|
21
|
+
|
|
22
|
+
import { meta } from '#meta';
|
|
23
|
+
|
|
24
|
+
import { command } from '../../extensions';
|
|
25
|
+
import { getMessageMetadata } from '../../util';
|
|
26
|
+
import { MessagePanel } from '../MessagePanel';
|
|
27
|
+
|
|
28
|
+
export type ChatProps = ThemedClassName<
|
|
29
|
+
{
|
|
30
|
+
/** Stable id used for the underlying thread root and message metadata. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Identity used to attribute outgoing messages in the textbox metadata. */
|
|
33
|
+
identity?: Identity;
|
|
34
|
+
/** Space members for rendering sender names/avatars on incoming messages. */
|
|
35
|
+
members: SpaceMember[];
|
|
36
|
+
/** Messages to render in order. */
|
|
37
|
+
messages: readonly Message.Message[];
|
|
38
|
+
/** Activity indicator (e.g. processing) shown beneath the textbox. */
|
|
39
|
+
activity?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Called with the user's textbox content when they press send.
|
|
42
|
+
* Returning `true` signals the message was accepted; the textbox is then cleared.
|
|
43
|
+
*/
|
|
44
|
+
onSend: (text: string) => boolean;
|
|
45
|
+
autoFocusTextbox?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Where the composer sits relative to the messages.
|
|
48
|
+
* - `'top'` (default) — composer follows the messages at intrinsic height,
|
|
49
|
+
* suitable for inline comment threads.
|
|
50
|
+
* - `'bottom'` — composer pinned to the bottom of the panel, messages
|
|
51
|
+
* scrolling above it. Suitable for full-panel multi-party chat.
|
|
52
|
+
*/
|
|
53
|
+
orientation?: ChatOrientation;
|
|
54
|
+
} & Pick<ThreadRootProps, 'current'>
|
|
55
|
+
>;
|
|
56
|
+
|
|
57
|
+
export type ChatOrientation = 'top' | 'bottom';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Pure chat UI: scrollable message list + composer textbox + activity indicator.
|
|
61
|
+
* Owns its own UI state (textbox content, scroll position, editor extensions) but
|
|
62
|
+
* does not load data or invoke operations — the caller passes messages and an
|
|
63
|
+
* `onSend` callback. Used by both `ThreadContainer` (AutoMerge `Thread`) and
|
|
64
|
+
* `ChannelContainer`'s feed-backed channel chat.
|
|
65
|
+
*/
|
|
66
|
+
export const Chat = composable<HTMLDivElement, ChatProps>(
|
|
67
|
+
(
|
|
68
|
+
{ id, identity, members, messages, activity, onSend, autoFocusTextbox, current, orientation = 'top', ...props },
|
|
69
|
+
forwardedRef,
|
|
70
|
+
) => {
|
|
71
|
+
const { t } = useTranslation(meta.id);
|
|
72
|
+
const { themeMode } = useThemeContext();
|
|
73
|
+
|
|
74
|
+
const scrollRef = useRef<HTMLDivElement | null>(null);
|
|
75
|
+
const sentinelRef = useRef<HTMLDivElement | null>(null);
|
|
76
|
+
const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
|
|
77
|
+
|
|
78
|
+
// Force the editor to remount after a successful send so its content resets.
|
|
79
|
+
const [_count, _setCount] = useState(0);
|
|
80
|
+
|
|
81
|
+
const textboxMetadata = getMessageMetadata(id, identity);
|
|
82
|
+
const messageRef = useRef('');
|
|
83
|
+
const extensions = useMemo(
|
|
84
|
+
() => [
|
|
85
|
+
createBasicExtensions({ placeholder: t('message.placeholder') }),
|
|
86
|
+
createThemeExtensions({ themeMode }),
|
|
87
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
88
|
+
command,
|
|
89
|
+
],
|
|
90
|
+
[themeMode, _count],
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
94
|
+
setTimeout(() => sentinelRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
95
|
+
|
|
96
|
+
useLayoutEffect(() => {
|
|
97
|
+
scrollToEnd('instant');
|
|
98
|
+
}, []);
|
|
99
|
+
// NOTE: Auto-scroll on new messages is intentionally not implemented here. Smooth-scroll
|
|
100
|
+
// animations were causing ResizeObserver feedback loops with CodeMirror/ScrollArea. The
|
|
101
|
+
// proper fix is "scroll only if user is already at the bottom" — deferred to a follow-up.
|
|
102
|
+
|
|
103
|
+
const handleSend = () => {
|
|
104
|
+
const text = messageRef.current;
|
|
105
|
+
if (!text?.length) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const accepted = onSend(text);
|
|
110
|
+
if (!accepted) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
messageRef.current = '';
|
|
115
|
+
setAutoFocus(true);
|
|
116
|
+
scrollToEnd('smooth');
|
|
117
|
+
_setCount((count) => count + 1);
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const filteredMessages = messages.filter(isNonNullable);
|
|
122
|
+
const renderState: ChatRenderState = {
|
|
123
|
+
messages: filteredMessages,
|
|
124
|
+
members,
|
|
125
|
+
activity,
|
|
126
|
+
extensions,
|
|
127
|
+
autoFocus,
|
|
128
|
+
handleSend,
|
|
129
|
+
textboxMetadata,
|
|
130
|
+
scrollRef,
|
|
131
|
+
sentinelRef,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
return orientation === 'bottom' ? (
|
|
135
|
+
<ChannelLayout
|
|
136
|
+
{...composableProps(props, { classNames: 'flex flex-col bs-full min-h-0' })}
|
|
137
|
+
id={id}
|
|
138
|
+
ref={forwardedRef}
|
|
139
|
+
state={renderState}
|
|
140
|
+
/>
|
|
141
|
+
) : (
|
|
142
|
+
<ThreadLayout
|
|
143
|
+
{...composableProps(props, { classNames: 'dx-container grid-rows-[1fr_min-content_min-content]' })}
|
|
144
|
+
id={id}
|
|
145
|
+
current={current}
|
|
146
|
+
ref={forwardedRef}
|
|
147
|
+
state={renderState}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
//
|
|
154
|
+
// Internal layout helpers — share state via the ChatRenderState bag.
|
|
155
|
+
//
|
|
156
|
+
|
|
157
|
+
type ChatRenderState = {
|
|
158
|
+
messages: Message.Message[];
|
|
159
|
+
members: SpaceMember[];
|
|
160
|
+
activity?: boolean;
|
|
161
|
+
extensions: Extension[];
|
|
162
|
+
autoFocus?: boolean;
|
|
163
|
+
handleSend: () => boolean;
|
|
164
|
+
textboxMetadata: MessageMetadata;
|
|
165
|
+
scrollRef: RefObject<HTMLDivElement | null>;
|
|
166
|
+
sentinelRef: RefObject<HTMLDivElement | null>;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type LayoutProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
170
|
+
id: string;
|
|
171
|
+
state: ChatRenderState;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/** Thread layout — composer follows messages at intrinsic height. */
|
|
175
|
+
const ThreadLayout = React.forwardRef<HTMLDivElement, LayoutProps & Pick<ThreadRootProps, 'current'>>(
|
|
176
|
+
({ id, current, state, ...props }, ref) => {
|
|
177
|
+
const { t } = useTranslation(meta.id);
|
|
178
|
+
const { messages, members, activity, extensions, autoFocus, handleSend, textboxMetadata, sentinelRef } = state;
|
|
179
|
+
return (
|
|
180
|
+
<ThreadComponent.Root {...props} id={id} current={current} ref={ref}>
|
|
181
|
+
<ScrollArea.Root classNames='col-span-2' orientation='vertical'>
|
|
182
|
+
<ScrollArea.Viewport ref={sentinelRef}>
|
|
183
|
+
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
184
|
+
{messages.map((message) => (
|
|
185
|
+
<MessagePanel key={message.id} message={message} members={members} />
|
|
186
|
+
))}
|
|
187
|
+
</div>
|
|
188
|
+
</ScrollArea.Viewport>
|
|
189
|
+
</ScrollArea.Root>
|
|
190
|
+
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleSend} {...textboxMetadata} />
|
|
191
|
+
<ThreadComponent.Status activity={activity}>{t('activity.message')}</ThreadComponent.Status>
|
|
192
|
+
</ThreadComponent.Root>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
/** Channel layout — composer pinned to the bottom, messages scroll above it. */
|
|
198
|
+
const ChannelLayout = React.forwardRef<HTMLDivElement, LayoutProps>(({ id, state, ...props }, ref) => {
|
|
199
|
+
const { t } = useTranslation(meta.id);
|
|
200
|
+
const { messages, members, activity, extensions, autoFocus, handleSend, textboxMetadata, scrollRef, sentinelRef } =
|
|
201
|
+
state;
|
|
202
|
+
return (
|
|
203
|
+
<div {...props} id={id} ref={ref}>
|
|
204
|
+
<div ref={scrollRef} className='flex-1 min-h-0 overflow-y-auto'>
|
|
205
|
+
{messages.map((message) => (
|
|
206
|
+
<div key={message.id} className='grid grid-cols-[var(--dx-rail-size)_1fr] w-full'>
|
|
207
|
+
<MessagePanel message={message} members={members} />
|
|
208
|
+
</div>
|
|
209
|
+
))}
|
|
210
|
+
<div ref={sentinelRef} />
|
|
211
|
+
</div>
|
|
212
|
+
<div className='shrink-0 grid grid-cols-[var(--dx-rail-size)_1fr]'>
|
|
213
|
+
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleSend} {...textboxMetadata} />
|
|
214
|
+
</div>
|
|
215
|
+
<div className='shrink-0 px-2 pb-1 text-xs text-description'>{activity ? t('activity.message') : null}</div>
|
|
216
|
+
</div>
|
|
217
|
+
);
|
|
218
|
+
});
|
|
@@ -13,21 +13,23 @@ import { TestSchema } from '@dxos/echo/testing';
|
|
|
13
13
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
14
14
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
15
|
import { random } from '@dxos/random';
|
|
16
|
-
import {
|
|
16
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
17
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
19
|
import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
|
|
20
20
|
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
21
21
|
|
|
22
|
+
import { translations } from '#translations';
|
|
23
|
+
|
|
22
24
|
import { createCommentThread, createProposalThread } from '../../testing/data';
|
|
23
|
-
import { translations } from '../../translations';
|
|
24
25
|
import { CommentsPanel } from './CommentsPanel';
|
|
25
26
|
|
|
26
27
|
random.seed(1);
|
|
27
28
|
|
|
28
29
|
const DefaultStory = () => {
|
|
29
30
|
const identity = useIdentity();
|
|
30
|
-
const
|
|
31
|
+
const [space] = useSpaces();
|
|
32
|
+
const db = space?.db;
|
|
31
33
|
const anchors = useQuery(db, Query.type(AnchoredTo.AnchoredTo));
|
|
32
34
|
|
|
33
35
|
useAsyncEffect(async () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import React, { type
|
|
6
|
+
import React, { type PropsWithChildren, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
9
|
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
@@ -26,7 +26,8 @@ const SWARM_PEEK_INTERVAL = 1_000;
|
|
|
26
26
|
|
|
27
27
|
type LobbyRootProps = PropsWithChildren<ThemedClassName>;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// TODO(burdon): Make headless?
|
|
30
|
+
const LobbyRoot = ({ children }: LobbyRootProps) => {
|
|
30
31
|
return <div className='relative flex flex-col grow overflow-hidden group'>{children}</div>;
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -38,7 +39,7 @@ LobbyRoot.displayName = 'LobbyRoot';
|
|
|
38
39
|
|
|
39
40
|
type LobbyPreviewProps = {};
|
|
40
41
|
|
|
41
|
-
const LobbyPreview
|
|
42
|
+
const LobbyPreview = (_props: LobbyPreviewProps) => {
|
|
42
43
|
const { t } = useTranslation(meta.id);
|
|
43
44
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
44
45
|
const media = useAtomValue(call.mediaAtom);
|
|
@@ -88,7 +89,7 @@ type LobbyToolbarProps = ThemedClassName<
|
|
|
88
89
|
} & Pick<ToolbarProps, 'onJoin'>
|
|
89
90
|
>;
|
|
90
91
|
|
|
91
|
-
const LobbyToolbar
|
|
92
|
+
const LobbyToolbar = ({ roomId, ...props }: LobbyToolbarProps) => {
|
|
92
93
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
93
94
|
const [count, setCount] = useState<number>(0);
|
|
94
95
|
|
|
@@ -6,7 +6,7 @@ import { EditorView } from '@codemirror/view';
|
|
|
6
6
|
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
-
import {
|
|
9
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
10
|
import { type Obj, Ref } from '@dxos/echo';
|
|
11
11
|
import { useObject } from '@dxos/echo-react';
|
|
12
12
|
import { PublicKey } from '@dxos/react-client';
|
|
@@ -97,7 +97,7 @@ export const MessagePanel = ({
|
|
|
97
97
|
variant='ghost'
|
|
98
98
|
icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}
|
|
99
99
|
iconOnly
|
|
100
|
-
label={t(editing ? 'save
|
|
100
|
+
label={t(editing ? 'save-message.label' : 'edit-message.label')}
|
|
101
101
|
classNames={[buttonClassNames, hoverableControlItem]}
|
|
102
102
|
onClick={handleEdit}
|
|
103
103
|
/>
|
|
@@ -212,7 +212,7 @@ const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Unknown
|
|
|
212
212
|
ref={forwardedRef}
|
|
213
213
|
>
|
|
214
214
|
<Surface.Surface
|
|
215
|
-
|
|
215
|
+
type={AppSurface.Card}
|
|
216
216
|
limit={1}
|
|
217
217
|
data={{ subject } satisfies AppSurface.ObjectCardData}
|
|
218
218
|
fallback={title}
|
|
@@ -8,7 +8,8 @@ import React, { useEffect, useState } from 'react';
|
|
|
8
8
|
import { random } from '@dxos/random';
|
|
9
9
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
10
|
|
|
11
|
-
import { translations } from '
|
|
11
|
+
import { translations } from '#translations';
|
|
12
|
+
|
|
12
13
|
import { ResponsiveGrid, type ResponsiveGridProps } from './ResponsiveGrid';
|
|
13
14
|
import { ResponsiveGridItem, type ResponsiveGridItemProps } from './ResponsiveGridItem';
|
|
14
15
|
|
|
@@ -7,7 +7,8 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
|
|
10
|
-
import { translations } from '
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
11
12
|
import { VideoObject as VideoObjectComponent } from '../Media';
|
|
12
13
|
import { ResponsivePanel } from './ResponsivePanel';
|
|
13
14
|
|
|
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import { translations } from '
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
10
11
|
import { ThreadSettings } from './ThreadSettings';
|
|
11
12
|
|
|
12
13
|
const meta = {
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import { type Space, useMembers, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
11
|
+
import { type Channel, Message } from '@dxos/types';
|
|
12
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
13
|
+
|
|
14
|
+
import { Chat } from '#components';
|
|
15
|
+
import { useStatus } from '#hooks';
|
|
16
|
+
import { ThreadOperation } from '#operations';
|
|
17
|
+
|
|
18
|
+
export type ChannelChatProps = {
|
|
19
|
+
space: Space;
|
|
20
|
+
channel: Channel.Channel;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Channel chat: composer pinned to the bottom of the panel, messages scrolling
|
|
25
|
+
* above it (newest at the bottom). Threading via `Message.threadId` is
|
|
26
|
+
* intentionally not reconstructed in this round.
|
|
27
|
+
*/
|
|
28
|
+
export const ChannelChat = composable<HTMLDivElement, ChannelChatProps>(
|
|
29
|
+
({ space, channel, ...props }, forwardedRef) => {
|
|
30
|
+
const identity = useIdentity()!;
|
|
31
|
+
const members = useMembers(space.id);
|
|
32
|
+
const id = Obj.getDXN(channel).toString();
|
|
33
|
+
const activity = useStatus(space, id);
|
|
34
|
+
const { invokePromise } = useOperationInvoker();
|
|
35
|
+
|
|
36
|
+
const feed = channel.feed?.target;
|
|
37
|
+
const messages = useQuery(
|
|
38
|
+
space.db,
|
|
39
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
40
|
+
) as Message.Message[];
|
|
41
|
+
|
|
42
|
+
const handleSend = (text: string) => {
|
|
43
|
+
void invokePromise(ThreadOperation.AppendChannelMessage, {
|
|
44
|
+
channel,
|
|
45
|
+
sender: { identityDid: identity.did },
|
|
46
|
+
text,
|
|
47
|
+
});
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Chat
|
|
53
|
+
{...composableProps(props)}
|
|
54
|
+
id={id}
|
|
55
|
+
identity={identity}
|
|
56
|
+
members={members}
|
|
57
|
+
messages={messages}
|
|
58
|
+
activity={activity}
|
|
59
|
+
onSend={handleSend}
|
|
60
|
+
orientation='bottom'
|
|
61
|
+
ref={forwardedRef}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
);
|
|
@@ -3,27 +3,34 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
9
|
import { Capability } from '@dxos/app-framework';
|
|
9
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
-
import {
|
|
12
|
+
import { Feed } from '@dxos/echo';
|
|
13
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { SpacePlugin } from '@dxos/plugin-space';
|
|
17
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
18
|
+
import { Config } from '@dxos/react-client';
|
|
19
|
+
import { Query, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
12
20
|
import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
|
|
13
|
-
import { Message, Thread } from '@dxos/types';
|
|
21
|
+
import { Channel, Message, Thread } from '@dxos/types';
|
|
14
22
|
|
|
15
|
-
import {
|
|
16
|
-
import { Channel } from '#types';
|
|
23
|
+
import { translations } from '#translations';
|
|
17
24
|
|
|
18
|
-
import {
|
|
25
|
+
import { ThreadPlugin } from '../../ThreadPlugin';
|
|
19
26
|
import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
|
|
20
27
|
|
|
21
28
|
// TODO(wittjosiah): Channel doesn't render full height.
|
|
22
29
|
const DefaultStory = ({ roomId }: ChannelContainerProps) => {
|
|
23
|
-
const
|
|
24
|
-
const [channel] = useQuery(db, Query.type(Channel.Channel));
|
|
30
|
+
const [space] = useSpaces();
|
|
31
|
+
const [channel] = useQuery(space?.db, Query.type(Channel.Channel));
|
|
25
32
|
if (!channel) {
|
|
26
|
-
return <Loading data={{
|
|
33
|
+
return <Loading data={{ channel }} />;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
return <ChannelContainer subject={channel} attendableId='story' roomId={roomId} role='article' />;
|
|
@@ -37,8 +44,45 @@ const meta = {
|
|
|
37
44
|
withTheme(),
|
|
38
45
|
withLayout({ layout: 'column' }),
|
|
39
46
|
withPluginManager({
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
capabilities: [
|
|
48
|
+
Capability.contributes(AppCapabilities.Schema, [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message]),
|
|
49
|
+
],
|
|
50
|
+
plugins: [
|
|
51
|
+
...corePlugins(),
|
|
52
|
+
ClientPlugin({
|
|
53
|
+
types: [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message],
|
|
54
|
+
config: new Config({
|
|
55
|
+
runtime: {
|
|
56
|
+
services: {
|
|
57
|
+
edge: {
|
|
58
|
+
url: 'https://edge.dxos.workers.dev/',
|
|
59
|
+
},
|
|
60
|
+
iceProviders: [
|
|
61
|
+
{
|
|
62
|
+
urls: 'https://edge.dxos.workers.dev/ice',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
onClientInitialized: ({ client }) =>
|
|
69
|
+
Effect.gen(function* () {
|
|
70
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
71
|
+
const channel = personalSpace.db.add(Channel.make({ name: 'general' }));
|
|
72
|
+
const feed = yield* Effect.promise(() => channel.feed.load());
|
|
73
|
+
const seed = [
|
|
74
|
+
Message.make({ sender: { role: 'user' }, blocks: [{ _tag: 'text', text: 'Hello, channel.' }] }),
|
|
75
|
+
Message.make({
|
|
76
|
+
sender: { role: 'user' },
|
|
77
|
+
blocks: [{ _tag: 'text', text: 'Messages are stored in the feed.' }],
|
|
78
|
+
}),
|
|
79
|
+
];
|
|
80
|
+
yield* Feed.append(feed, seed).pipe(Effect.provide(createFeedServiceLayer(personalSpace.queues)));
|
|
81
|
+
}),
|
|
82
|
+
}),
|
|
83
|
+
SpacePlugin({}),
|
|
84
|
+
ThreadPlugin(),
|
|
85
|
+
],
|
|
42
86
|
}),
|
|
43
87
|
],
|
|
44
88
|
parameters: {
|
|
@@ -17,14 +17,14 @@ import { Button, ElevationProvider, Input, Panel, useTranslation } from '@dxos/r
|
|
|
17
17
|
import { Settings } from '@dxos/react-ui-form';
|
|
18
18
|
import { Menu, MenuRootProps, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
19
19
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
20
|
+
import { type Channel } from '@dxos/types';
|
|
20
21
|
import { composable, composableProps } from '@dxos/ui-theme';
|
|
21
22
|
|
|
22
23
|
import { Call } from '#components';
|
|
23
24
|
import { meta } from '#meta';
|
|
24
25
|
import { ThreadCapabilities } from '#types';
|
|
25
|
-
import { type Channel } from '#types';
|
|
26
26
|
|
|
27
|
-
import {
|
|
27
|
+
import { ChannelChat } from '../ChannelChat';
|
|
28
28
|
|
|
29
29
|
export type ChannelContainerProps = AppSurface.ObjectArticleProps<
|
|
30
30
|
Channel.Channel | undefined,
|
|
@@ -140,14 +140,14 @@ export const ChannelContainer = ({
|
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
if (channel &&
|
|
143
|
+
if (channel && space) {
|
|
144
144
|
return (
|
|
145
145
|
<Panel.Root classNames='dx-document'>
|
|
146
146
|
<Panel.Toolbar asChild>
|
|
147
147
|
<ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
|
|
148
148
|
</Panel.Toolbar>
|
|
149
149
|
<Panel.Content asChild>
|
|
150
|
-
<
|
|
150
|
+
<ChannelChat space={space} channel={channel} />
|
|
151
151
|
</Panel.Content>
|
|
152
152
|
</Panel.Root>
|
|
153
153
|
);
|
|
@@ -19,10 +19,9 @@ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
|
19
19
|
import { withLayout, Loading } from '@dxos/react-ui/testing';
|
|
20
20
|
import { Message, Thread } from '@dxos/types';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { translations } from '#translations';
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
import { ChatContainer } from './ChatContainer';
|
|
24
|
+
import { ThreadContainer } from './ThreadContainer';
|
|
26
25
|
|
|
27
26
|
random.seed(1);
|
|
28
27
|
|
|
@@ -30,26 +29,26 @@ const DefaultStory = () => {
|
|
|
30
29
|
const client = useClient();
|
|
31
30
|
const identity = useIdentity();
|
|
32
31
|
const [space, setSpace] = useState<Space>();
|
|
33
|
-
const [
|
|
32
|
+
const [thread, setThread] = useState<Thread.Thread | null>();
|
|
34
33
|
|
|
35
34
|
useAsyncEffect(async () => {
|
|
36
35
|
if (identity) {
|
|
37
36
|
const space = await client.spaces.create();
|
|
38
|
-
const
|
|
37
|
+
const thread = space.db.add(Thread.make({ status: 'active' }));
|
|
39
38
|
setSpace(space);
|
|
40
|
-
|
|
39
|
+
setThread(thread);
|
|
41
40
|
}
|
|
42
41
|
}, [identity]);
|
|
43
42
|
|
|
44
|
-
if (!identity || !
|
|
45
|
-
return <Loading data={{ identity: !!identity, space: !!space,
|
|
43
|
+
if (!identity || !thread || !space) {
|
|
44
|
+
return <Loading data={{ identity: !!identity, space: !!space, thread: !!thread }} />;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
return <
|
|
47
|
+
return <ThreadContainer space={space} thread={thread} />;
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
const meta = {
|
|
52
|
-
title: 'plugins/plugin-thread/containers/
|
|
51
|
+
title: 'plugins/plugin-thread/containers/ThreadContainer',
|
|
53
52
|
component: ThreadComponent.Root as any,
|
|
54
53
|
render: DefaultStory,
|
|
55
54
|
decorators: [
|
|
@@ -71,7 +70,7 @@ const meta = {
|
|
|
71
70
|
}),
|
|
72
71
|
withClientProvider({
|
|
73
72
|
createSpace: true,
|
|
74
|
-
types: [Thread.Thread,
|
|
73
|
+
types: [Thread.Thread, Message.Message],
|
|
75
74
|
}),
|
|
76
75
|
],
|
|
77
76
|
parameters: {
|