@dxos/plugin-thread 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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-VPPFFLFL.mjs +97 -0
- package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +37 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-MESW3R4Q.mjs +61 -0
- package/dist/lib/browser/chunk-MESW3R4Q.mjs.map +7 -0
- package/dist/lib/browser/chunk-VPM44Z35.mjs +259 -0
- package/dist/lib/browser/chunk-VPM44Z35.mjs.map +7 -0
- package/dist/lib/browser/create-OQKG4S47.mjs +55 -0
- package/dist/lib/browser/create-OQKG4S47.mjs.map +7 -0
- package/dist/lib/browser/create-channel-EF67LCS6.mjs +21 -0
- package/dist/lib/browser/create-channel-EF67LCS6.mjs.map +7 -0
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs +28 -0
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +7 -0
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs +57 -0
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs.map +7 -0
- package/dist/lib/browser/delete-FSFVU6ZA.mjs +59 -0
- package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +7 -0
- package/dist/lib/browser/delete-message-XL5M5J33.mjs +64 -0
- package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2253 -233
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-VYS2JGVT.mjs +25 -0
- package/dist/lib/browser/on-create-space-VYS2JGVT.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-2ZGMKUSD.mjs +33 -0
- package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +7 -0
- package/dist/lib/browser/restore-message-OYEGWPII.mjs +42 -0
- package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +7 -0
- package/dist/lib/browser/select-VG2XLULE.mjs +26 -0
- package/dist/lib/browser/select-VG2XLULE.mjs.map +7 -0
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs +45 -0
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -12
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs +98 -0
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +38 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs +260 -0
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs +62 -0
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs.map +7 -0
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs +56 -0
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs +22 -0
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs +29 -0
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +7 -0
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs +58 -0
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs.map +7 -0
- package/dist/lib/node-esm/delete-WRODXR3E.mjs +60 -0
- package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +7 -0
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs +65 -0
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2253 -233
- 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-XDY2YXPV.mjs +26 -0
- package/dist/lib/node-esm/on-create-space-XDY2YXPV.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-T3QA7TSL.mjs +34 -0
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +7 -0
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs +43 -0
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +7 -0
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs +27 -0
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs.map +7 -0
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs +46 -0
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -12
- package/dist/types/src/ThreadPlugin.d.ts +2 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
- package/dist/types/src/calls/call-manager.d.ts +40 -30
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +2 -2
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +5 -3
- package/dist/types/src/calls/util/calls-service.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 +2 -2
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +10 -9
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- 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 +3 -2
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +13 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -5
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/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/CommentsPanel/CommentsThread.d.ts +14 -0
- 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.d.ts +3 -3
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
- 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 +160 -5
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +15 -0
- 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/containers/ChatContainer/ChatContainer.d.ts +16 -0
- 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 +9 -4
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts +2 -3
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/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 +2804 -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/testing/data.d.ts +5 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/stories.d.ts +2 -1
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +142 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +715 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +5 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +24 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +4 -326
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +17 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +114 -67
- package/src/ThreadPlugin.tsx +107 -146
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +37 -0
- package/src/calls/call-manager.ts +78 -54
- package/src/calls/call-swarm-synchronizer.ts +3 -3
- package/src/calls/media-manager.ts +67 -38
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +65 -15
- package/src/calls/util/stub-media-streams.ts +64 -7
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +81 -67
- package/src/capabilities/app-graph-builder.ts +175 -162
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/call-manager.ts +19 -11
- package/src/capabilities/index.ts +15 -11
- package/src/capabilities/markdown.ts +51 -37
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +12 -9
- package/src/capabilities/react-surface.tsx +80 -77
- package/src/capabilities/settings.ts +28 -12
- package/src/capabilities/state.ts +14 -17
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +13 -8
- package/src/components/Call/Toolbar.tsx +62 -45
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +93 -0
- package/src/components/CommentsPanel/CommentsPanel.tsx +71 -0
- package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +66 -61
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +16 -13
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +37 -30
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessagePanel/MessagePanel.tsx +222 -0
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +35 -15
- package/src/components/Participant/ParticipantGrid.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +50 -49
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +14 -11
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +10 -11
- 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 -12
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +173 -0
- package/src/containers/CallDebugPanel/index.ts +5 -0
- package/src/containers/CallSidebar/CallSidebar.tsx +18 -0
- package/src/containers/CallSidebar/index.ts +5 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +61 -0
- package/src/{components → containers/ChannelContainer}/ChannelContainer.tsx +97 -74
- package/src/containers/ChannelContainer/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.stories.tsx +87 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +131 -0
- package/src/containers/ChatContainer/index.ts +8 -0
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +217 -0
- package/src/containers/ThreadCompanion/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/{components/command-extension.ts → extensions/command.ts} +7 -4
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +89 -44
- package/src/hooks/analytics.ts +22 -21
- package/src/hooks/index.ts +3 -1
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/hooks/useVideoStreamTrack.tsx +6 -3
- package/src/index.ts +1 -1
- package/src/meta.ts +11 -7
- 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/testing/data.ts +49 -0
- package/src/testing/stories.ts +18 -21
- package/src/translations.ts +74 -71
- package/src/types/Channel.ts +37 -0
- package/src/types/Settings.ts +10 -0
- package/src/types/capabilities.ts +36 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +5 -91
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/typings.d.ts +8 -0
- package/src/util.ts +2 -2
- package/dist/lib/browser/ChannelContainer-5YH4FTBL.mjs +0 -16
- package/dist/lib/browser/ChatContainer-2UYQ23KO.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-Q5V3KXE3.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-Q5V3KXE3.mjs.map +0 -7
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs +0 -24
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
- package/dist/lib/browser/chunk-5ZVJ4GAS.mjs +0 -21
- package/dist/lib/browser/chunk-5ZVJ4GAS.mjs.map +0 -7
- package/dist/lib/browser/chunk-6NSMBO3B.mjs +0 -56
- package/dist/lib/browser/chunk-6NSMBO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERWASUQK.mjs +0 -149
- package/dist/lib/browser/chunk-ERWASUQK.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs +0 -31
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-JVIKVYTI.mjs +0 -128
- package/dist/lib/browser/chunk-JVIKVYTI.mjs.map +0 -7
- package/dist/lib/browser/chunk-LCJD3NOB.mjs +0 -984
- package/dist/lib/browser/chunk-LCJD3NOB.mjs.map +0 -7
- package/dist/lib/browser/chunk-LGSDKXPF.mjs +0 -18
- package/dist/lib/browser/chunk-LGSDKXPF.mjs.map +0 -7
- package/dist/lib/browser/chunk-NCSFNWBZ.mjs +0 -479
- package/dist/lib/browser/chunk-NCSFNWBZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YD57K2SL.mjs +0 -367
- package/dist/lib/browser/chunk-YD57K2SL.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZE7KWN36.mjs +0 -1669
- package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MWE6XLPY.mjs +0 -353
- package/dist/lib/browser/intent-resolver-MWE6XLPY.mjs.map +0 -7
- package/dist/lib/browser/markdown-ZO34G7RM.mjs +0 -169
- package/dist/lib/browser/markdown-ZO34G7RM.mjs.map +0 -7
- package/dist/lib/browser/react-root-YNDNPODD.mjs +0 -28
- package/dist/lib/browser/react-root-YNDNPODD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2AXRNTCA.mjs +0 -109
- package/dist/lib/browser/react-surface-2AXRNTCA.mjs.map +0 -7
- package/dist/lib/browser/settings-XZGPZNAU.mjs +0 -22
- package/dist/lib/browser/settings-XZGPZNAU.mjs.map +0 -7
- package/dist/lib/browser/state-H6CYONWE.mjs +0 -34
- package/dist/lib/browser/state-H6CYONWE.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-O2LZKMRM.mjs +0 -17
- package/dist/lib/node-esm/ChannelContainer-O2LZKMRM.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-6N35MP5J.mjs +0 -16
- package/dist/lib/node-esm/ChatContainer-6N35MP5J.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-GAKBZNU3.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-GAKBZNU3.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs +0 -25
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-25ABSYP2.mjs +0 -150
- package/dist/lib/node-esm/chunk-25ABSYP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3X3YKRM2.mjs +0 -129
- package/dist/lib/node-esm/chunk-3X3YKRM2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs +0 -33
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5UQ4KKDE.mjs +0 -985
- package/dist/lib/node-esm/chunk-5UQ4KKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs +0 -19
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A6QLTZCY.mjs +0 -480
- package/dist/lib/node-esm/chunk-A6QLTZCY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs +0 -1670
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OU5BYIDO.mjs +0 -58
- package/dist/lib/node-esm/chunk-OU5BYIDO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RGTWAVEE.mjs +0 -368
- package/dist/lib/node-esm/chunk-RGTWAVEE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X62X3VOK.mjs +0 -23
- package/dist/lib/node-esm/chunk-X62X3VOK.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-B6PNTMPY.mjs +0 -354
- package/dist/lib/node-esm/intent-resolver-B6PNTMPY.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-ZJUFV2TA.mjs +0 -170
- package/dist/lib/node-esm/markdown-ZJUFV2TA.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-ZUVVTKWG.mjs +0 -29
- package/dist/lib/node-esm/react-root-ZUVVTKWG.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-OMEZTOU6.mjs +0 -110
- package/dist/lib/node-esm/react-surface-OMEZTOU6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-XECBSD6Q.mjs +0 -23
- package/dist/lib/node-esm/settings-XECBSD6Q.mjs.map +0 -7
- package/dist/lib/node-esm/state-D7WNDT3N.mjs +0 -35
- package/dist/lib/node-esm/state-D7WNDT3N.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -27
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +0 -8
- 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 -14
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -7
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -17
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -6
- 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 +0 -14
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/MessageContainer.d.ts +0 -11
- 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 -10
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
- package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings.d.ts +0 -6
- 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 +0 -4
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -133
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -296
- package/src/components/CallDebugPanel.tsx +0 -115
- package/src/components/CallSidebar.tsx +0 -17
- package/src/components/ChannelContainer.stories.tsx +0 -58
- package/src/components/Chat.stories.tsx +0 -88
- package/src/components/ChatContainer.tsx +0 -141
- package/src/components/Comments.stories.tsx +0 -92
- package/src/components/CommentsContainer.tsx +0 -71
- package/src/components/MessageContainer.tsx +0 -151
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/components/ThreadSettings.tsx +0 -17
- package/src/components/testing.ts +0 -29
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-5YH4FTBL.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/ChatContainer-2UYQ23KO.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { EditorView } from '@codemirror/view';
|
|
6
|
+
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { type Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { useObject } from '@dxos/echo-react';
|
|
12
|
+
import { PublicKey } from '@dxos/react-client';
|
|
13
|
+
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
14
|
+
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
15
|
+
import { IconButton, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
16
|
+
import { Card } from '@dxos/react-ui';
|
|
17
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
18
|
+
import { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';
|
|
19
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
20
|
+
import { createBasicExtensions, createThemeExtensions } from '@dxos/ui-editor';
|
|
21
|
+
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';
|
|
22
|
+
|
|
23
|
+
import { useOnEditAnalytics } from '#hooks';
|
|
24
|
+
import { meta } from '#meta';
|
|
25
|
+
|
|
26
|
+
import { command } from '../../extensions/command';
|
|
27
|
+
import { getMessageMetadata } from '../../util';
|
|
28
|
+
|
|
29
|
+
export const buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pe-2';
|
|
30
|
+
export const buttonClassNames = 'p-1! transition-opacity';
|
|
31
|
+
|
|
32
|
+
export type MessagePanelProps = {
|
|
33
|
+
message: Obj.OfShape<Message.Message> | Ref.Ref<Obj.OfShape<Message.Message>>;
|
|
34
|
+
members: SpaceMember[];
|
|
35
|
+
editable?: boolean;
|
|
36
|
+
onDelete?: (id: string) => void;
|
|
37
|
+
onAcceptProposal?: (id: string) => void;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const MessagePanel = ({
|
|
41
|
+
message: messageOrRef,
|
|
42
|
+
members,
|
|
43
|
+
editable = false,
|
|
44
|
+
onDelete,
|
|
45
|
+
onAcceptProposal,
|
|
46
|
+
}: MessagePanelProps) => {
|
|
47
|
+
const { t } = useTranslation(meta.id);
|
|
48
|
+
const [message, updateMessage] = useObject(messageOrRef);
|
|
49
|
+
const identity = useIdentity();
|
|
50
|
+
const [editing, setEditing] = useState(false);
|
|
51
|
+
|
|
52
|
+
const textBlockIndex = message?.blocks.findIndex((block) => block._tag === 'text') ?? -1;
|
|
53
|
+
|
|
54
|
+
const handleEdit = useCallback(() => setEditing((editing) => !editing), []);
|
|
55
|
+
const handleDelete = useCallback(() => message && onDelete?.(message.id), [message, onDelete]);
|
|
56
|
+
const handleAcceptProposal = useCallback(
|
|
57
|
+
() => message && onAcceptProposal?.(message.id),
|
|
58
|
+
[message, onAcceptProposal],
|
|
59
|
+
);
|
|
60
|
+
const handleTextBlockChange = useCallback(
|
|
61
|
+
(newText: string) => {
|
|
62
|
+
updateMessage((m) => {
|
|
63
|
+
const targetBlock = m.blocks[textBlockIndex];
|
|
64
|
+
if (targetBlock && targetBlock._tag === 'text') {
|
|
65
|
+
targetBlock.text = newText;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
[updateMessage, textBlockIndex],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const textBlock =
|
|
73
|
+
message && textBlockIndex !== -1 ? (message.blocks[textBlockIndex] as ContentBlock.Text) : undefined;
|
|
74
|
+
useOnEditAnalytics(message, textBlock, !!editing);
|
|
75
|
+
|
|
76
|
+
if (!message) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const senderIdentity = members.find(
|
|
81
|
+
(member) =>
|
|
82
|
+
(message.sender.identityDid && member.identity.did === message.sender.identityDid) ||
|
|
83
|
+
(message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),
|
|
84
|
+
)?.identity;
|
|
85
|
+
const messageMetadata = getMessageMetadata(message.id, senderIdentity);
|
|
86
|
+
const userIsAuthor = identity?.did === messageMetadata.authorId;
|
|
87
|
+
const proposalBlock = message.blocks.find((block) => block._tag === 'proposal');
|
|
88
|
+
const references = message.blocks.filter((block) => block._tag === 'reference').map((block) => block.reference);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>
|
|
92
|
+
<MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>
|
|
93
|
+
<div role='none' className={buttonGroupClassNames}>
|
|
94
|
+
{userIsAuthor && editable && (
|
|
95
|
+
<IconButton
|
|
96
|
+
data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}
|
|
97
|
+
variant='ghost'
|
|
98
|
+
icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}
|
|
99
|
+
iconOnly
|
|
100
|
+
label={t(editing ? 'save message label' : 'edit message label')}
|
|
101
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
102
|
+
onClick={handleEdit}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
{/* TODO(wittjosiah): Proposal controls should probably be hoisted to thread level. */}
|
|
106
|
+
{proposalBlock && onAcceptProposal && (
|
|
107
|
+
<IconButton
|
|
108
|
+
data-testid='thread.message.accept'
|
|
109
|
+
variant='ghost'
|
|
110
|
+
icon='ph--check--regular'
|
|
111
|
+
iconOnly
|
|
112
|
+
label={t('accept-proposal.label')}
|
|
113
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
114
|
+
onClick={handleAcceptProposal}
|
|
115
|
+
/>
|
|
116
|
+
)}
|
|
117
|
+
{onDelete && (
|
|
118
|
+
<IconButton
|
|
119
|
+
data-testid='thread.message.delete'
|
|
120
|
+
variant='ghost'
|
|
121
|
+
icon='ph--x--regular'
|
|
122
|
+
iconOnly
|
|
123
|
+
label={t('delete-message.label')}
|
|
124
|
+
classNames={[buttonClassNames, hoverableControlItem]}
|
|
125
|
+
onClick={handleDelete}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
</MessageHeading>
|
|
130
|
+
{textBlock && (
|
|
131
|
+
<TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} onSave={handleTextBlockChange} />
|
|
132
|
+
)}
|
|
133
|
+
{proposalBlock && <ProposalBlock block={proposalBlock} />}
|
|
134
|
+
{Ref.Array.targets(references).map((reference, index) => (
|
|
135
|
+
<MessagePart key={index} part={reference as Obj.Unknown} />
|
|
136
|
+
))}
|
|
137
|
+
</MessageRoot>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const MessagePart = ({ part }: { part: Obj.Unknown }) => {
|
|
142
|
+
return <MessageBlockObjectTile subject={part} />;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const TextboxBlock = ({
|
|
146
|
+
block,
|
|
147
|
+
isAuthor,
|
|
148
|
+
editing,
|
|
149
|
+
onSave,
|
|
150
|
+
}: {
|
|
151
|
+
block: ContentBlock.Text;
|
|
152
|
+
editing?: boolean;
|
|
153
|
+
isAuthor?: boolean;
|
|
154
|
+
identity?: Identity;
|
|
155
|
+
onSave?: (newText: string) => void;
|
|
156
|
+
}) => {
|
|
157
|
+
const { themeMode } = useThemeContext();
|
|
158
|
+
const inMemoryContentRef = useRef(block.text);
|
|
159
|
+
|
|
160
|
+
const handleDocumentChange = useCallback((newState: string) => {
|
|
161
|
+
inMemoryContentRef.current = newState;
|
|
162
|
+
}, []);
|
|
163
|
+
|
|
164
|
+
const saveDocumentChange = useCallback(() => {
|
|
165
|
+
onSave?.(inMemoryContentRef.current);
|
|
166
|
+
}, [onSave]);
|
|
167
|
+
|
|
168
|
+
useOnTransition(editing, true, false, saveDocumentChange);
|
|
169
|
+
|
|
170
|
+
const { parentRef, focusAttributes, view } = useTextEditor(
|
|
171
|
+
() => ({
|
|
172
|
+
initialValue: block.text,
|
|
173
|
+
extensions: [
|
|
174
|
+
createBasicExtensions({ readOnly: !isAuthor || !editing }),
|
|
175
|
+
createThemeExtensions({ themeMode }),
|
|
176
|
+
command,
|
|
177
|
+
EditorView.updateListener.of((update) => {
|
|
178
|
+
if (update.docChanged) {
|
|
179
|
+
handleDocumentChange(update.state.doc.toString());
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
],
|
|
183
|
+
}),
|
|
184
|
+
[block.text, editing, isAuthor, themeMode, handleDocumentChange],
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
editing && view?.focus();
|
|
189
|
+
}, [editing, view]);
|
|
190
|
+
|
|
191
|
+
return <div role='none' ref={parentRef} className='me-4' {...focusAttributes} />;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const ProposalBlock = ({ block }: { block: ContentBlock.Proposal }) => {
|
|
195
|
+
return (
|
|
196
|
+
<div role='none' className='me-4 italic'>
|
|
197
|
+
{block.text}
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Unknown }>(({ subject }, forwardedRef) => {
|
|
203
|
+
// TODO(burdon): Use annotation to get title.
|
|
204
|
+
let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';
|
|
205
|
+
if (typeof title !== 'string') {
|
|
206
|
+
title = title?.content ?? '';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<Card.Root
|
|
211
|
+
className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}
|
|
212
|
+
ref={forwardedRef}
|
|
213
|
+
>
|
|
214
|
+
<Surface.Surface
|
|
215
|
+
type={AppSurface.Card}
|
|
216
|
+
limit={1}
|
|
217
|
+
data={{ subject } satisfies AppSurface.ObjectCardData}
|
|
218
|
+
fallback={title}
|
|
219
|
+
/>
|
|
220
|
+
</Card.Root>
|
|
221
|
+
);
|
|
222
|
+
});
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
5
6
|
import React, { memo, useMemo } from 'react';
|
|
6
7
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
|
+
|
|
10
|
+
import { ThreadCapabilities } from '#types';
|
|
8
11
|
|
|
9
12
|
import { type EncodedTrackName, type UserState } from '../../calls';
|
|
10
|
-
import { ThreadCapabilities } from '../../capabilities';
|
|
11
13
|
import { VideoObject } from '../Media';
|
|
12
14
|
import { ResponsiveGridItem, type ResponsiveGridItemProps } from '../ResponsiveGrid';
|
|
13
15
|
|
|
@@ -15,21 +17,39 @@ export const SCREENSHARE_SUFFIX = '_screenshare';
|
|
|
15
17
|
|
|
16
18
|
export const Participant = memo(({ item: user, debug, ...props }: ResponsiveGridItemProps<UserState>) => {
|
|
17
19
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
18
|
-
const
|
|
20
|
+
const self = useAtomValue(call.selfAtom);
|
|
21
|
+
const media = useAtomValue(call.mediaAtom);
|
|
22
|
+
const isSelf: boolean = self.id !== undefined && user.id !== undefined && user.id.startsWith(self.id);
|
|
19
23
|
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)
|
|
24
|
+
|
|
25
|
+
// Get pulled video stream for non-self users.
|
|
26
|
+
const pulledVideoStream = useMemo<MediaStream | undefined>(() => {
|
|
27
|
+
if (isSelf) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const trackName =
|
|
31
|
+
isScreenshare && user.tracks?.screenshareEnabled
|
|
32
|
+
? (user.tracks?.screenshare as EncodedTrackName)
|
|
33
|
+
: !isScreenshare && user.tracks?.videoEnabled
|
|
34
|
+
? (user.tracks?.video as EncodedTrackName)
|
|
35
|
+
: undefined;
|
|
36
|
+
return trackName ? media.pulledVideoStreams[trackName]?.stream : undefined;
|
|
37
|
+
}, [
|
|
38
|
+
isSelf,
|
|
39
|
+
isScreenshare,
|
|
40
|
+
media.pulledVideoStreams,
|
|
41
|
+
user.tracks?.screenshare,
|
|
42
|
+
user.tracks?.video,
|
|
43
|
+
user.tracks?.screenshareEnabled,
|
|
44
|
+
user.tracks?.videoEnabled,
|
|
45
|
+
]);
|
|
23
46
|
|
|
24
47
|
const videoStream = useMemo<MediaStream | undefined>(() => {
|
|
25
|
-
if (isSelf
|
|
26
|
-
return
|
|
27
|
-
} else if (isSelf && isScreenshare) {
|
|
28
|
-
return call.media.screenshareVideoStream;
|
|
29
|
-
} else if (!isSelf) {
|
|
30
|
-
return pulledVideoStream;
|
|
48
|
+
if (isSelf) {
|
|
49
|
+
return isScreenshare ? media.screenshareVideoStream : media.videoStream;
|
|
31
50
|
}
|
|
32
|
-
|
|
51
|
+
return pulledVideoStream;
|
|
52
|
+
}, [isSelf, isScreenshare, media.videoStream, media.screenshareVideoStream, pulledVideoStream]);
|
|
33
53
|
|
|
34
54
|
return (
|
|
35
55
|
<ResponsiveGridItem
|
|
@@ -37,8 +57,8 @@ export const Participant = memo(({ item: user, debug, ...props }: ResponsiveGrid
|
|
|
37
57
|
item={user}
|
|
38
58
|
name={user.name}
|
|
39
59
|
self={isSelf}
|
|
40
|
-
screenshare={!!
|
|
41
|
-
video={
|
|
60
|
+
screenshare={!!media.screenshareVideoStream}
|
|
61
|
+
video={media.videoEnabled}
|
|
42
62
|
mute={user ? !user.tracks?.audioEnabled : false}
|
|
43
63
|
wave={user.raisedHand}
|
|
44
64
|
speaking={user.speaking}
|
|
@@ -6,9 +6,9 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
|
-
import { Participant, SCREENSHARE_SUFFIX } from './Participant';
|
|
10
9
|
import { type UserState } from '../../calls';
|
|
11
10
|
import { ResponsiveGrid } from '../ResponsiveGrid';
|
|
11
|
+
import { Participant, SCREENSHARE_SUFFIX } from './Participant';
|
|
12
12
|
|
|
13
13
|
const getId = (user: UserState): string => user.id!;
|
|
14
14
|
|
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { random } from '@dxos/random';
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
10
|
|
|
11
|
+
import { translations } from '../../translations';
|
|
13
12
|
import { ResponsiveGrid, type ResponsiveGridProps } from './ResponsiveGrid';
|
|
14
13
|
import { ResponsiveGridItem, type ResponsiveGridItemProps } from './ResponsiveGridItem';
|
|
15
|
-
import { translations } from '../../translations';
|
|
16
14
|
|
|
17
15
|
type TestItem = {
|
|
18
16
|
id: string;
|
|
@@ -54,48 +52,51 @@ const TestCell = ({ item, ...props }: ResponsiveGridItemProps<TestItem>) => {
|
|
|
54
52
|
);
|
|
55
53
|
};
|
|
56
54
|
|
|
57
|
-
type
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
55
|
+
type DefaultStoryProps = ResponsiveGridProps<TestItem> & { random?: boolean; autoHideGallery?: boolean };
|
|
56
|
+
|
|
57
|
+
const DefaultStory = (props: DefaultStoryProps) => {
|
|
58
|
+
const [pinned, setPinned] = useState<string | undefined>(
|
|
59
|
+
(props.pinned ?? props.items.length > 1) ? props.items[0]?.id : undefined,
|
|
60
|
+
);
|
|
61
|
+
const [items, setItems] = useState<TestItem[]>(props.items);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!props.random) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const interval = setInterval(() => {
|
|
68
|
+
setItems((items) => {
|
|
69
|
+
const p = Math.random();
|
|
70
|
+
if (p < 0.5) {
|
|
71
|
+
return items;
|
|
72
|
+
} else if (p < 0.99 && items.length > 1) {
|
|
73
|
+
return items.slice(0, -1);
|
|
74
|
+
} else {
|
|
75
|
+
return [...items, createItem(items[0]?.type)];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, 3_000);
|
|
79
|
+
|
|
80
|
+
return () => clearInterval(interval);
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div className='grid grow p-4'>
|
|
85
|
+
<ResponsiveGrid {...props} Cell={TestCell} items={items} pinned={pinned} onPinnedChange={setPinned} />
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const meta = {
|
|
91
|
+
title: 'plugins/plugin-thread/components/ResponsiveGrid',
|
|
92
|
+
component: ResponsiveGrid as any,
|
|
93
|
+
render: DefaultStory,
|
|
94
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
95
95
|
parameters: {
|
|
96
|
+
layout: 'fullscreen',
|
|
96
97
|
translations,
|
|
97
98
|
},
|
|
98
|
-
}
|
|
99
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
99
100
|
|
|
100
101
|
const videoUrls = [
|
|
101
102
|
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4',
|
|
@@ -105,19 +106,19 @@ const videoUrls = [
|
|
|
105
106
|
];
|
|
106
107
|
|
|
107
108
|
const createItem = (type?: 'image' | 'video') => {
|
|
108
|
-
const id =
|
|
109
|
+
const id = random.string.uuid();
|
|
109
110
|
return {
|
|
110
111
|
id,
|
|
111
112
|
type,
|
|
112
|
-
name:
|
|
113
|
+
name: random.person.fullName(),
|
|
113
114
|
imageUrl: `https://placehold.co/3200x1800/333/999?font=roboto&text=${id.slice(0, 2)}`,
|
|
114
|
-
videoUrl:
|
|
115
|
+
videoUrl: random.helpers.arrayElement(videoUrls),
|
|
115
116
|
};
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
export default meta;
|
|
119
120
|
|
|
120
|
-
type Story = StoryObj<
|
|
121
|
+
type Story = StoryObj<typeof meta>;
|
|
121
122
|
|
|
122
123
|
// TODO(burdon): Story to join/leave repeatedly to test stable position.
|
|
123
124
|
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type ComponentType, type FC,
|
|
5
|
+
import React, { type ComponentType, type FC, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { useResizeDetector } from 'react-resize-detector';
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
10
|
import { type Size } from '@dxos/react-ui-dnd';
|
|
11
|
-
import { mx } from '@dxos/
|
|
11
|
+
import { mx } from '@dxos/ui-theme';
|
|
12
12
|
|
|
13
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
14
13
|
import { type ResponsiveGridItemProps } from './ResponsiveGridItem';
|
|
14
|
+
import { ResponsivePanel } from './ResponsivePanel';
|
|
15
15
|
|
|
16
16
|
const ASPECT_RATIO = 16 / 9;
|
|
17
17
|
const MIN_GALLERY_HEIGHT = 250;
|
|
@@ -136,7 +136,7 @@ export const ResponsiveGrid = <T extends object = any>({
|
|
|
136
136
|
);
|
|
137
137
|
|
|
138
138
|
return (
|
|
139
|
-
<div ref={containerRef} className={mx('
|
|
139
|
+
<div ref={containerRef} className={mx('dx-expander relative', classNames)}>
|
|
140
140
|
{/* Placeholder elements to calculate layout. */}
|
|
141
141
|
<div className='absolute inset-0 flex flex-col grow gap-2'>
|
|
142
142
|
{/* Pinned item. */}
|
|
@@ -206,7 +206,7 @@ export const ResponsiveGrid = <T extends object = any>({
|
|
|
206
206
|
|
|
207
207
|
const SoloItem: FC<Pick<ResponsiveGridProps, 'debug'> & { id: string }> = ({ debug, id }) => {
|
|
208
208
|
return (
|
|
209
|
-
<
|
|
209
|
+
<ResponsivePanel>
|
|
210
210
|
<div
|
|
211
211
|
{...{ 'data-grid-item': id }}
|
|
212
212
|
className={mx('aspect-video overflow-hidden', debug && 'z-20 border-2 border-primary-500')}
|
|
@@ -214,7 +214,7 @@ const SoloItem: FC<Pick<ResponsiveGridProps, 'debug'> & { id: string }> = ({ deb
|
|
|
214
214
|
{/* Maximum size placeholder image forces aspect ratio. */}
|
|
215
215
|
<img alt='placeholder video' className={mx('opacity-0', maxImageSize)} />
|
|
216
216
|
</div>
|
|
217
|
-
</
|
|
217
|
+
</ResponsivePanel>
|
|
218
218
|
);
|
|
219
219
|
};
|
|
220
220
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { type CSSProperties, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Icon, IconButton,
|
|
7
|
+
import { Icon, IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
import { Waveform } from '@dxos/react-ui-sfx';
|
|
9
|
-
import { groupHoverControlItemWithTransition, mx } from '@dxos/
|
|
9
|
+
import { groupHoverControlItemWithTransition, mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
|
-
import { meta } from '
|
|
11
|
+
import { meta } from '#meta';
|
|
12
12
|
|
|
13
13
|
export type ResponsiveGridItemProps<T extends object = any> = PropsWithChildren<
|
|
14
14
|
ThemedClassName<{
|
|
@@ -49,12 +49,12 @@ export const ResponsiveGridItem = <T extends object = any>({
|
|
|
49
49
|
const iconProps: Record<string, { icon: string; label: string; classNames?: string }> = {
|
|
50
50
|
wave: {
|
|
51
51
|
icon: 'ph--hand-waving--duotone',
|
|
52
|
-
label: t('icon
|
|
52
|
+
label: t('icon-wave.label'),
|
|
53
53
|
classNames: 'animate-pulse bg-orange-500',
|
|
54
54
|
},
|
|
55
55
|
mute: {
|
|
56
56
|
icon: 'ph--microphone-slash--regular',
|
|
57
|
-
label: t('icon
|
|
57
|
+
label: t('icon-muted.label'),
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -76,7 +76,7 @@ export const ResponsiveGridItem = <T extends object = any>({
|
|
|
76
76
|
return (
|
|
77
77
|
<div
|
|
78
78
|
className={mx(
|
|
79
|
-
'
|
|
79
|
+
'dx-expander relative group',
|
|
80
80
|
'rounded-md outline outline-2 outline-neutral-900 transition-[outline-color] duration-500',
|
|
81
81
|
speakingIndicator ? 'outline-green-500' : !video && 'outline-separator',
|
|
82
82
|
classNames,
|
|
@@ -89,11 +89,11 @@ export const ResponsiveGridItem = <T extends object = any>({
|
|
|
89
89
|
{onClick && (
|
|
90
90
|
<div className='z-10 absolute top-1 right-1 flex'>
|
|
91
91
|
<IconButton
|
|
92
|
-
classNames={mx('p-1 min-
|
|
92
|
+
classNames={mx('p-1 min-h-1 rounded-sm', groupHoverControlItemWithTransition)}
|
|
93
93
|
iconOnly
|
|
94
94
|
icon={pinned ? 'ph--x--regular' : 'ph--arrows-out--regular'}
|
|
95
95
|
size={pinned ? 5 : 4}
|
|
96
|
-
label={pinned ? t('icon
|
|
96
|
+
label={pinned ? t('icon-unpin.label') : t('icon-pin.label')}
|
|
97
97
|
onClick={() => onClick?.(item)}
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
@@ -106,7 +106,10 @@ export const ResponsiveGridItem = <T extends object = any>({
|
|
|
106
106
|
{/* {self && <Icon icon='ph--asterisk--regular' size={pinned ? 5 : 4} />} */}
|
|
107
107
|
{screenshare && <Icon icon='ph--broadcast--regular' size={pinned ? 5 : 4} />}
|
|
108
108
|
<div
|
|
109
|
-
className={mx(
|
|
109
|
+
className={mx(
|
|
110
|
+
'bg-neutral-800 text-neutral-100 py-0.5 truncate rounded-sm',
|
|
111
|
+
pinned ? 'px-2' : 'px-1 text-xs',
|
|
112
|
+
)}
|
|
110
113
|
>
|
|
111
114
|
{name}
|
|
112
115
|
</div>
|
|
@@ -118,7 +121,7 @@ export const ResponsiveGridItem = <T extends object = any>({
|
|
|
118
121
|
{(speaking && <Waveform active size={pinned ? 5 : 4} />) ||
|
|
119
122
|
(props && (
|
|
120
123
|
<IconButton
|
|
121
|
-
classNames={mx('p-1 min-
|
|
124
|
+
classNames={mx('p-1 min-h-1 rounded-sm', props?.classNames)}
|
|
122
125
|
icon={props?.icon}
|
|
123
126
|
label={props?.label}
|
|
124
127
|
size={pinned ? 5 : 4}
|
|
@@ -2,29 +2,28 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
13
10
|
import { translations } from '../../translations';
|
|
14
11
|
import { VideoObject as VideoObjectComponent } from '../Media';
|
|
12
|
+
import { ResponsivePanel } from './ResponsivePanel';
|
|
15
13
|
|
|
16
|
-
const meta
|
|
17
|
-
title: 'plugins/plugin-thread/
|
|
18
|
-
component:
|
|
19
|
-
decorators: [withTheme, withLayout({
|
|
14
|
+
const meta = {
|
|
15
|
+
title: 'plugins/plugin-thread/components/ResponsivePanel',
|
|
16
|
+
component: ResponsivePanel,
|
|
17
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
20
18
|
parameters: {
|
|
19
|
+
layout: 'fullscreen',
|
|
21
20
|
translations,
|
|
22
21
|
},
|
|
23
|
-
}
|
|
22
|
+
} satisfies Meta<typeof ResponsivePanel>;
|
|
24
23
|
|
|
25
24
|
export default meta;
|
|
26
25
|
|
|
27
|
-
type Story = StoryObj<typeof
|
|
26
|
+
type Story = StoryObj<typeof ResponsivePanel>;
|
|
28
27
|
|
|
29
28
|
export const Image: Story = {
|
|
30
29
|
args: {
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
|
-
import { mx } from '@dxos/
|
|
7
|
+
import { mx } from '@dxos/ui-theme';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A container component that maintains the child's aspect ratio while centering its content.
|
|
11
11
|
* The container will scale to fit within its parent's bounds while preserving the aspect ratio.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* <
|
|
14
|
+
* <ResponsivePanel>
|
|
15
15
|
* <VideoObject />
|
|
16
|
-
* </
|
|
16
|
+
* </ResponsivePanel>
|
|
17
17
|
*/
|
|
18
|
-
export const
|
|
18
|
+
export const ResponsivePanel = ({ children }: PropsWithChildren) => {
|
|
19
19
|
return (
|
|
20
20
|
// Outer container that takes full size of parent.
|
|
21
|
-
<div role='none' className='relative flex
|
|
21
|
+
<div role='none' className='dx-expander relative flex'>
|
|
22
22
|
{/* Absolute positioning layer for centering content. */}
|
|
23
23
|
<div role='none' className='absolute inset-0 flex justify-center items-center'>
|
|
24
24
|
{/* Content container that maintains given aspect ratio and proper scaling. */}
|