@dxos/plugin-thread 0.8.4-main.406dc2a → 0.8.4-main.422d1c7879
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-UGT7V733.mjs +55 -0
- package/dist/lib/browser/create-UGT7V733.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 +2251 -228
- 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-XAYNDVU2.mjs +56 -0
- package/dist/lib/node-esm/create-XAYNDVU2.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 +2251 -228
- 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 +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +2 -2
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +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 -14
- 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 +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 +15 -0
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
- package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +142 -140
- 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/{components → containers/CallDebugPanel}/CallDebugPanel.d.ts +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +2 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/CallSidebar}/CallSidebar.d.ts +0 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts +2 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +12 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -0
- package/dist/types/src/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 +8 -3
- 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 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/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/{components/testing.d.ts → testing/data.d.ts} +4 -4
- 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 -74
- 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 -459
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +102 -72
- package/src/ThreadPlugin.tsx +81 -111
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +37 -0
- package/src/calls/call-manager.ts +76 -52
- package/src/calls/call-swarm-synchronizer.ts +2 -2
- package/src/calls/media-manager.ts +10 -7
- package/src/calls/util/calls-service.ts +1 -2
- package/src/calls/util/stub-media-streams.ts +2 -2
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +10 -9
- package/src/capabilities/app-graph-builder.ts +172 -163
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/call-manager.ts +19 -12
- package/src/capabilities/index.ts +15 -12
- package/src/capabilities/markdown.ts +50 -37
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +12 -9
- package/src/capabilities/react-surface.tsx +80 -78
- package/src/capabilities/settings.ts +28 -12
- package/src/capabilities/state.ts +14 -18
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +11 -7
- package/src/components/Call/Toolbar.tsx +58 -41
- 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} +60 -57
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +15 -12
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +6 -7
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +77 -40
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +33 -19
- package/src/components/Participant/ParticipantGrid.tsx +0 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +9 -10
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +5 -5
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +12 -9
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +7 -8
- package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +5 -5
- package/src/components/ResponsiveGrid/index.ts +1 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +31 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +5 -12
- package/src/{components → containers/CallDebugPanel}/CallDebugPanel.tsx +15 -16
- 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 +93 -71
- package/src/containers/ChannelContainer/index.ts +5 -0
- package/src/{components/Chat.stories.tsx → containers/ChatContainer/ChatContainer.stories.tsx} +27 -31
- 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} +3 -3
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +87 -42
- package/src/hooks/analytics.ts +22 -21
- package/src/hooks/index.ts +3 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +10 -5
- 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 +17 -20
- package/src/translations.ts +74 -75
- 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 -108
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-BGDGZHV4.mjs +0 -16
- package/dist/lib/browser/ChatContainer-75KJZ4XR.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-ODKIAXR7.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-ODKIAXR7.mjs.map +0 -7
- package/dist/lib/browser/call-manager-BCKLI4QD.mjs +0 -24
- package/dist/lib/browser/call-manager-BCKLI4QD.mjs.map +0 -7
- package/dist/lib/browser/chunk-2MUYQOQE.mjs +0 -23
- package/dist/lib/browser/chunk-2MUYQOQE.mjs.map +0 -7
- package/dist/lib/browser/chunk-B7YQ7QR2.mjs +0 -376
- package/dist/lib/browser/chunk-B7YQ7QR2.mjs.map +0 -7
- package/dist/lib/browser/chunk-CMCVHULC.mjs +0 -986
- package/dist/lib/browser/chunk-CMCVHULC.mjs.map +0 -7
- package/dist/lib/browser/chunk-CP7E2HRE.mjs +0 -31
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +0 -7
- package/dist/lib/browser/chunk-HDEQRBOC.mjs +0 -181
- package/dist/lib/browser/chunk-HDEQRBOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-L326LSNS.mjs +0 -18
- package/dist/lib/browser/chunk-L326LSNS.mjs.map +0 -7
- package/dist/lib/browser/chunk-T4KJ5JR4.mjs +0 -15
- package/dist/lib/browser/chunk-T4KJ5JR4.mjs.map +0 -7
- package/dist/lib/browser/chunk-VJMKS4CZ.mjs +0 -619
- package/dist/lib/browser/chunk-VJMKS4CZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VTYX3SIM.mjs +0 -147
- package/dist/lib/browser/chunk-VTYX3SIM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYUJXHYV.mjs +0 -106
- package/dist/lib/browser/chunk-XYUJXHYV.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZCEU5K23.mjs +0 -1890
- package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-VOQD3TQ2.mjs +0 -427
- package/dist/lib/browser/intent-resolver-VOQD3TQ2.mjs.map +0 -7
- package/dist/lib/browser/markdown-R6MGRIA6.mjs +0 -169
- package/dist/lib/browser/markdown-R6MGRIA6.mjs.map +0 -7
- package/dist/lib/browser/react-root-UMSBTN6H.mjs +0 -28
- package/dist/lib/browser/react-root-UMSBTN6H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SXMQEWKE.mjs +0 -109
- package/dist/lib/browser/react-surface-SXMQEWKE.mjs.map +0 -7
- package/dist/lib/browser/settings-TCNF54PN.mjs +0 -22
- package/dist/lib/browser/settings-TCNF54PN.mjs.map +0 -7
- package/dist/lib/browser/state-ZQ4IPOJT.mjs +0 -34
- package/dist/lib/browser/state-ZQ4IPOJT.mjs.map +0 -7
- package/dist/lib/browser/toolkit-JF4B4QIO.mjs +0 -84
- package/dist/lib/browser/toolkit-JF4B4QIO.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-OXC6BTU7.mjs +0 -17
- package/dist/lib/node-esm/ChannelContainer-OXC6BTU7.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-SH6LTFQL.mjs +0 -16
- package/dist/lib/node-esm/ChatContainer-SH6LTFQL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-DMPT3MY6.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-DMPT3MY6.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-Q7RY2YP4.mjs +0 -25
- package/dist/lib/node-esm/call-manager-Q7RY2YP4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2KZ4ODHU.mjs +0 -987
- package/dist/lib/node-esm/chunk-2KZ4ODHU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs +0 -182
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs +0 -108
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs +0 -33
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BAMZXJS4.mjs +0 -148
- package/dist/lib/node-esm/chunk-BAMZXJS4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BTGKI5IK.mjs +0 -377
- package/dist/lib/node-esm/chunk-BTGKI5IK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GZ4WL2IS.mjs +0 -25
- package/dist/lib/node-esm/chunk-GZ4WL2IS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LCHTNRK7.mjs +0 -19
- package/dist/lib/node-esm/chunk-LCHTNRK7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NHSIAEDW.mjs +0 -620
- package/dist/lib/node-esm/chunk-NHSIAEDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OBVAURUU.mjs +0 -17
- package/dist/lib/node-esm/chunk-OBVAURUU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs +0 -1891
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-AKVH66PH.mjs +0 -428
- package/dist/lib/node-esm/intent-resolver-AKVH66PH.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-MYGTDXT6.mjs +0 -170
- package/dist/lib/node-esm/markdown-MYGTDXT6.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-W6AVTL5M.mjs +0 -29
- package/dist/lib/node-esm/react-root-W6AVTL5M.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NLSZJGMO.mjs +0 -110
- package/dist/lib/node-esm/react-surface-NLSZJGMO.mjs.map +0 -7
- package/dist/lib/node-esm/settings-ZQHGVFBY.mjs +0 -23
- package/dist/lib/node-esm/settings-ZQHGVFBY.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSLLJ5TZ.mjs +0 -35
- package/dist/lib/node-esm/state-FSLLJ5TZ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-DHPKJITO.mjs +0 -85
- package/dist/lib/node-esm/toolkit-DHPKJITO.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/capabilities/toolkit.d.ts +0 -6
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.d.ts +0 -14
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -94
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -93
- 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 -158
- 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 -14
- 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 -162
- 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.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -179
- 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 -348
- package/src/capabilities/toolkit.ts +0 -82
- package/src/components/CallSidebar.tsx +0 -18
- package/src/components/ChannelContainer.stories.tsx +0 -59
- package/src/components/ChatContainer.tsx +0 -145
- package/src/components/Comments.stories.tsx +0 -91
- package/src/components/CommentsContainer.tsx +0 -72
- package/src/components/ThreadComplementary.tsx +0 -181
- package/src/components/ThreadSettings.tsx +0 -16
- package/src/components/testing.ts +0 -51
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-BGDGZHV4.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/ChatContainer-75KJZ4XR.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { contributes } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
11
|
-
import { Query, useQuery, useSpace } from '@dxos/react-client/echo';
|
|
12
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
|
-
import { DataType } from '@dxos/schema';
|
|
14
|
-
import { render } from '@dxos/storybook-utils';
|
|
15
|
-
|
|
16
|
-
import { createThreadPlugins } from '../testing';
|
|
17
|
-
import { translations } from '../translations';
|
|
18
|
-
import { ChannelType, ThreadType } from '../types';
|
|
19
|
-
|
|
20
|
-
import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
|
|
21
|
-
|
|
22
|
-
// TODO(wittjosiah): Channel doesn't render full height.
|
|
23
|
-
const DefaultStory = ({ roomId }: ChannelContainerProps) => {
|
|
24
|
-
const space = useSpace();
|
|
25
|
-
const [channel] = useQuery(space, Query.type(ChannelType));
|
|
26
|
-
if (!channel) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return <ChannelContainer channel={channel} roomId={roomId} />;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const meta = {
|
|
34
|
-
title: 'plugins/plugin-thread/ChannelContainer',
|
|
35
|
-
component: ChannelContainer,
|
|
36
|
-
render: render(DefaultStory),
|
|
37
|
-
decorators: [
|
|
38
|
-
withTheme,
|
|
39
|
-
withPluginManager({
|
|
40
|
-
plugins: [...(await createThreadPlugins())],
|
|
41
|
-
capabilities: [contributes(ClientCapabilities.Schema, [ChannelType, ThreadType, DataType.Message])],
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
44
|
-
parameters: {
|
|
45
|
-
layout: 'column',
|
|
46
|
-
translations,
|
|
47
|
-
},
|
|
48
|
-
} satisfies Meta<typeof ChannelContainer>;
|
|
49
|
-
|
|
50
|
-
export default meta;
|
|
51
|
-
|
|
52
|
-
type Story = StoryObj<typeof meta>;
|
|
53
|
-
|
|
54
|
-
export const Default: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
// Fixed room for testing.
|
|
57
|
-
roomId: '04a1d1911703b8e929d0649021a965',
|
|
58
|
-
},
|
|
59
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { type Space, fullyQualifiedId, useMembers } from '@dxos/react-client/echo';
|
|
9
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
-
import {
|
|
15
|
-
MessageTextbox,
|
|
16
|
-
type MessageTextboxProps,
|
|
17
|
-
Thread,
|
|
18
|
-
type ThreadRootProps,
|
|
19
|
-
threadLayout,
|
|
20
|
-
} from '@dxos/react-ui-thread';
|
|
21
|
-
import { DataType } from '@dxos/schema';
|
|
22
|
-
import { isNonNullable } from '@dxos/util';
|
|
23
|
-
|
|
24
|
-
import { useStatus } from '../hooks';
|
|
25
|
-
import { meta } from '../meta';
|
|
26
|
-
import { type ThreadType } from '../types';
|
|
27
|
-
import { getMessageMetadata } from '../util';
|
|
28
|
-
|
|
29
|
-
import { command } from './command-extension';
|
|
30
|
-
import { MessageContainer } from './MessageContainer';
|
|
31
|
-
|
|
32
|
-
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
33
|
-
const { t } = useTranslation(meta.id);
|
|
34
|
-
return (
|
|
35
|
-
<div role='none' className='flex items-center'>
|
|
36
|
-
<StackItem.SigilButton attendableId={attendableId}>
|
|
37
|
-
<Icon icon='ph--chat--regular' size={5} />
|
|
38
|
-
</StackItem.SigilButton>
|
|
39
|
-
<StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type ChatContainerProps = {
|
|
45
|
-
space: Space;
|
|
46
|
-
thread: ThreadType;
|
|
47
|
-
context?: Obj.Any;
|
|
48
|
-
autoFocusTextbox?: boolean;
|
|
49
|
-
} & Pick<ThreadRootProps, 'current'>;
|
|
50
|
-
|
|
51
|
-
export const ChatContainer = ({ space, thread, context, current, autoFocusTextbox }: ChatContainerProps) => {
|
|
52
|
-
const { t } = useTranslation(meta.id);
|
|
53
|
-
const id = fullyQualifiedId(thread);
|
|
54
|
-
const identity = useIdentity()!;
|
|
55
|
-
const members = useMembers(space?.key);
|
|
56
|
-
const activity = useStatus(space, id);
|
|
57
|
-
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
58
|
-
const [_count, _setCount] = useState(0);
|
|
59
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
60
|
-
const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
|
|
61
|
-
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
62
|
-
const { themeMode } = useThemeContext();
|
|
63
|
-
|
|
64
|
-
const textboxMetadata = getMessageMetadata(id, identity);
|
|
65
|
-
const messageRef = useRef('');
|
|
66
|
-
const extensions = useMemo(
|
|
67
|
-
() => [
|
|
68
|
-
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
69
|
-
createThemeExtensions({ themeMode }),
|
|
70
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
71
|
-
command,
|
|
72
|
-
],
|
|
73
|
-
[themeMode, _count],
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
// TODO(thure): Factor out.
|
|
77
|
-
// TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using
|
|
78
|
-
// `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient
|
|
79
|
-
// for the desired effect; this is likely hardware-dependent and should be reevaluated.
|
|
80
|
-
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
81
|
-
setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
82
|
-
|
|
83
|
-
useLayoutEffect(() => {
|
|
84
|
-
scrollToEnd('instant');
|
|
85
|
-
}, []);
|
|
86
|
-
|
|
87
|
-
// TODO(burdon): Change to model.
|
|
88
|
-
const handleCreate: MessageTextboxProps['onSend'] = () => {
|
|
89
|
-
if (!messageRef.current?.length) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
thread.messages.push(
|
|
94
|
-
Ref.make(
|
|
95
|
-
Obj.make(DataType.Message, {
|
|
96
|
-
created: new Date().toISOString(),
|
|
97
|
-
sender: { identityDid: identity.did },
|
|
98
|
-
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
99
|
-
properties: context ? { context: Ref.make(context) } : undefined,
|
|
100
|
-
}),
|
|
101
|
-
),
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
messageRef.current = '';
|
|
105
|
-
setAutoFocus(true);
|
|
106
|
-
scrollToEnd('smooth');
|
|
107
|
-
rerenderEditor();
|
|
108
|
-
return true;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<Thread.Root
|
|
113
|
-
current={current}
|
|
114
|
-
id={id}
|
|
115
|
-
classNames={[
|
|
116
|
-
'bs-full is-full max-is-prose mli-auto grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
117
|
-
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
118
|
-
]}
|
|
119
|
-
>
|
|
120
|
-
<ScrollArea.Root classNames='col-span-2'>
|
|
121
|
-
<ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>
|
|
122
|
-
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
123
|
-
{thread.messages
|
|
124
|
-
.map((message) => message.target)
|
|
125
|
-
.filter(isNonNullable)
|
|
126
|
-
.map((message) => (
|
|
127
|
-
<MessageContainer key={message.id} message={message} members={members} />
|
|
128
|
-
))}
|
|
129
|
-
</div>
|
|
130
|
-
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
131
|
-
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
132
|
-
<ScrollArea.Scrollbar>
|
|
133
|
-
<ScrollArea.Thumb />
|
|
134
|
-
</ScrollArea.Scrollbar>
|
|
135
|
-
</ScrollArea.Viewport>
|
|
136
|
-
</ScrollArea.Root>
|
|
137
|
-
|
|
138
|
-
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
139
|
-
|
|
140
|
-
<Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
|
|
141
|
-
</Thread.Root>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export default ChatContainer;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { Obj, Query, Relation, Type } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
-
import { faker } from '@dxos/random';
|
|
13
|
-
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
14
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
-
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
18
|
-
import { render } from '@dxos/storybook-utils';
|
|
19
|
-
|
|
20
|
-
import { translations } from '../translations';
|
|
21
|
-
import { ThreadType } from '../types';
|
|
22
|
-
|
|
23
|
-
import { CommentsContainer } from './CommentsContainer';
|
|
24
|
-
import { createCommentThread, createProposalThread } from './testing';
|
|
25
|
-
|
|
26
|
-
faker.seed(1);
|
|
27
|
-
|
|
28
|
-
const DefaultStory = () => {
|
|
29
|
-
const identity = useIdentity();
|
|
30
|
-
const space = useSpace();
|
|
31
|
-
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
32
|
-
|
|
33
|
-
useAsyncEffect(async () => {
|
|
34
|
-
if (identity && space) {
|
|
35
|
-
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
36
|
-
const thread1 = space.db.add(createCommentThread(identity));
|
|
37
|
-
const thread2 = space.db.add(createProposalThread(identity));
|
|
38
|
-
space.db.add(
|
|
39
|
-
Relation.make(AnchoredTo, {
|
|
40
|
-
[Relation.Source]: thread1,
|
|
41
|
-
[Relation.Target]: object,
|
|
42
|
-
anchor: 'test',
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
45
|
-
space.db.add(
|
|
46
|
-
Relation.make(AnchoredTo, {
|
|
47
|
-
[Relation.Source]: thread2,
|
|
48
|
-
[Relation.Target]: object,
|
|
49
|
-
anchor: 'test',
|
|
50
|
-
}),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}, [identity, space]);
|
|
54
|
-
|
|
55
|
-
if (!identity || !space || !anchors) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const meta = {
|
|
63
|
-
title: 'plugins/plugin-thread/Comments',
|
|
64
|
-
render: render(DefaultStory),
|
|
65
|
-
decorators: [
|
|
66
|
-
withTheme,
|
|
67
|
-
withLayout({ container: 'column', scroll: true }),
|
|
68
|
-
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
69
|
-
// Currently this is required due to useOnEditAnalytics.
|
|
70
|
-
withPluginManager({
|
|
71
|
-
plugins: [
|
|
72
|
-
IntentPlugin(),
|
|
73
|
-
ClientPlugin({
|
|
74
|
-
types: [DataType.Message, ThreadType, AnchoredTo],
|
|
75
|
-
onClientInitialized: async ({ client }) => {
|
|
76
|
-
await client.halo.createIdentity();
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
|
-
],
|
|
80
|
-
}),
|
|
81
|
-
],
|
|
82
|
-
parameters: {
|
|
83
|
-
translations,
|
|
84
|
-
},
|
|
85
|
-
} satisfies Meta<typeof DefaultStory>;
|
|
86
|
-
|
|
87
|
-
export default meta;
|
|
88
|
-
|
|
89
|
-
type Story = StoryObj<typeof meta>;
|
|
90
|
-
|
|
91
|
-
export const Default: Story = {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useEffect } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
9
|
-
import { Callout, Icon, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/schema';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
import { type ThreadType } from '../types';
|
|
14
|
-
|
|
15
|
-
import { CommentsThreadContainer, type CommentsThreadContainerProps } from './CommentsThreadContainer';
|
|
16
|
-
|
|
17
|
-
export type CommentsContainerProps = Omit<CommentsThreadContainerProps, 'anchor' | 'current'> & {
|
|
18
|
-
anchors: AnchoredTo[];
|
|
19
|
-
currentId?: string;
|
|
20
|
-
showResolvedThreads?: boolean;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Root container for collection of comment threads.
|
|
25
|
-
*/
|
|
26
|
-
export const CommentsContainer = ({ anchors, currentId, showResolvedThreads, ...props }: CommentsContainerProps) => {
|
|
27
|
-
const { t } = useTranslation(meta.id);
|
|
28
|
-
|
|
29
|
-
// TODO(wittjosiah): There seems to be a race between thread and anchor being deleted.
|
|
30
|
-
const filteredAnchors = showResolvedThreads
|
|
31
|
-
? anchors.filter((anchor) => !!Relation.getSource(anchor))
|
|
32
|
-
: anchors.filter((anchor) => {
|
|
33
|
-
const thread = Relation.getSource(anchor);
|
|
34
|
-
return thread && thread.status !== 'resolved';
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (currentId) {
|
|
39
|
-
document.getElementById(currentId)?.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
40
|
-
}
|
|
41
|
-
}, [currentId]);
|
|
42
|
-
|
|
43
|
-
if (filteredAnchors.length === 0) {
|
|
44
|
-
return (
|
|
45
|
-
<div role='none' className='plb-cardSpacingBlock pli-cardSpacingInline'>
|
|
46
|
-
<Callout.Root>
|
|
47
|
-
<Callout.Title>
|
|
48
|
-
<Trans
|
|
49
|
-
{...{
|
|
50
|
-
t,
|
|
51
|
-
i18nKey: 'no comments message',
|
|
52
|
-
components: {
|
|
53
|
-
commentIcon: <Icon icon='ph--chat-text--regular' size={4} classNames='inline-block' />,
|
|
54
|
-
},
|
|
55
|
-
}}
|
|
56
|
-
/>
|
|
57
|
-
</Callout.Title>
|
|
58
|
-
</Callout.Root>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div>
|
|
65
|
-
{filteredAnchors.map((anchor) => {
|
|
66
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
67
|
-
const threadId = fullyQualifiedId(thread);
|
|
68
|
-
return <CommentsThreadContainer key={threadId} anchor={anchor} current={currentId === threadId} {...props} />;
|
|
69
|
-
})}
|
|
70
|
-
</div>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Capabilities,
|
|
9
|
-
CollaborationActions,
|
|
10
|
-
LayoutAction,
|
|
11
|
-
createIntent,
|
|
12
|
-
useCapabilities,
|
|
13
|
-
useCapability,
|
|
14
|
-
useIntentDispatcher,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
16
|
-
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
17
|
-
import { Ref, fullyQualifiedId, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
18
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
19
|
-
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
20
|
-
import { useAttended } from '@dxos/react-ui-attention';
|
|
21
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
22
|
-
import { Tabs } from '@dxos/react-ui-tabs';
|
|
23
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
24
|
-
import { AnchoredTo } from '@dxos/schema';
|
|
25
|
-
|
|
26
|
-
import { ThreadCapabilities } from '../capabilities';
|
|
27
|
-
import { CommentsContainer, type CommentsContainerProps } from '../components';
|
|
28
|
-
import { meta } from '../meta';
|
|
29
|
-
import { ThreadAction, ThreadType } from '../types';
|
|
30
|
-
|
|
31
|
-
export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
32
|
-
const { t } = useTranslation(meta.id);
|
|
33
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
34
|
-
const identity = useIdentity();
|
|
35
|
-
const { tx } = useThemeContext();
|
|
36
|
-
const subjectId = fullyQualifiedId(subject);
|
|
37
|
-
|
|
38
|
-
const { state, getViewState } = useCapability(ThreadCapabilities.MutableState);
|
|
39
|
-
const drafts = state.drafts[subjectId];
|
|
40
|
-
const viewState = useMemo(() => getViewState(subjectId), [getViewState, subjectId]);
|
|
41
|
-
const { showResolvedThreads } = viewState;
|
|
42
|
-
const onChangeViewState = useCallback(
|
|
43
|
-
(nextValue: string) => {
|
|
44
|
-
viewState.showResolvedThreads = nextValue === 'all';
|
|
45
|
-
},
|
|
46
|
-
[viewState],
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const anchorSorts = useCapabilities(Capabilities.AnchorSort);
|
|
50
|
-
const sort = useMemo(
|
|
51
|
-
() => anchorSorts.find(({ key }) => key === Obj.getTypename(subject))?.sort,
|
|
52
|
-
[anchorSorts, subject],
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const space = getSpace(subject);
|
|
56
|
-
const objectsAnchoredTo = useQuery(space, Query.select(Filter.ids(subject.id)).targetOf(AnchoredTo));
|
|
57
|
-
const anchors = objectsAnchoredTo
|
|
58
|
-
.toSorted((a, b) => sort?.(a, b) ?? 0)
|
|
59
|
-
.filter((anchor) => Obj.instanceOf(ThreadType, Relation.getSource(anchor)))
|
|
60
|
-
.concat(drafts ?? []);
|
|
61
|
-
|
|
62
|
-
const attended = useAttended();
|
|
63
|
-
|
|
64
|
-
const handleAttend = useCallback(
|
|
65
|
-
(anchor: AnchoredTo) => {
|
|
66
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
67
|
-
const threadId = fullyQualifiedId(thread);
|
|
68
|
-
|
|
69
|
-
if (state.current !== threadId) {
|
|
70
|
-
state.current = threadId;
|
|
71
|
-
|
|
72
|
-
// TODO(wittjosiah): Should this be a thread-specific intent?
|
|
73
|
-
// The layout doesn't know about threads and this working depends on other plugins conditionally handling it.
|
|
74
|
-
// This may be overloading this intent or highjacking its intended purpose.
|
|
75
|
-
void dispatch(
|
|
76
|
-
createIntent(LayoutAction.ScrollIntoView, {
|
|
77
|
-
part: 'current',
|
|
78
|
-
subject: fullyQualifiedId(subject),
|
|
79
|
-
options: {
|
|
80
|
-
cursor: anchor.anchor,
|
|
81
|
-
ref: threadId,
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
[state.current, dispatch, subject],
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const handleComment = useCallback(
|
|
91
|
-
async (anchor: AnchoredTo, text: string) => {
|
|
92
|
-
await dispatch(
|
|
93
|
-
createIntent(ThreadAction.AddMessage, { anchor, subject, sender: { identityDid: identity?.did }, text }),
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
97
|
-
state.current = fullyQualifiedId(thread);
|
|
98
|
-
},
|
|
99
|
-
[dispatch, identity, subject],
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const handleResolve = useCallback(
|
|
103
|
-
(anchor: AnchoredTo) =>
|
|
104
|
-
dispatch(createIntent(ThreadAction.ToggleResolved, { thread: Relation.getSource(anchor) as ThreadType })),
|
|
105
|
-
[dispatch],
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
const handleThreadDelete = useCallback(
|
|
109
|
-
(anchor: AnchoredTo) => dispatch(createIntent(ThreadAction.Delete, { anchor, subject })),
|
|
110
|
-
[dispatch, subject],
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const handleMessageDelete = useCallback(
|
|
114
|
-
(anchor: AnchoredTo, messageId: string) =>
|
|
115
|
-
dispatch(createIntent(ThreadAction.DeleteMessage, { anchor, subject, messageId })),
|
|
116
|
-
[dispatch, subject],
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
const handleAcceptProposal = useCallback<NonNullable<CommentsContainerProps['onAcceptProposal']>>(
|
|
120
|
-
async (anchor, messageId) => {
|
|
121
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
122
|
-
const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
|
|
123
|
-
const message = thread.messages[messageIndex]?.target;
|
|
124
|
-
const proposal = message?.blocks.find((block) => block._tag === 'proposal');
|
|
125
|
-
if (!proposal || !anchor.anchor) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
await dispatch(
|
|
130
|
-
createIntent(CollaborationActions.AcceptProposal, {
|
|
131
|
-
subject,
|
|
132
|
-
anchor: anchor.anchor,
|
|
133
|
-
proposal,
|
|
134
|
-
}),
|
|
135
|
-
);
|
|
136
|
-
await dispatch(createIntent(ThreadAction.ToggleResolved, { thread }));
|
|
137
|
-
},
|
|
138
|
-
[dispatch, subject],
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
const comments = (
|
|
142
|
-
<CommentsContainer
|
|
143
|
-
anchors={anchors}
|
|
144
|
-
currentId={attended.includes(subjectId) ? state.current : undefined}
|
|
145
|
-
showResolvedThreads={showResolvedThreads}
|
|
146
|
-
onAttend={handleAttend}
|
|
147
|
-
onComment={handleComment}
|
|
148
|
-
onResolve={handleResolve}
|
|
149
|
-
onMessageDelete={handleMessageDelete}
|
|
150
|
-
onThreadDelete={handleThreadDelete}
|
|
151
|
-
onAcceptProposal={handleAcceptProposal}
|
|
152
|
-
/>
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
return (
|
|
156
|
-
<StackItem.Content toolbar>
|
|
157
|
-
<Tabs.Root
|
|
158
|
-
value={showResolvedThreads ? 'all' : 'unresolved'}
|
|
159
|
-
orientation='horizontal'
|
|
160
|
-
classNames={[
|
|
161
|
-
'contents [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:overflow-y-auto [&_[role="tabpanel"]]:scrollbar-thin',
|
|
162
|
-
]}
|
|
163
|
-
onValueChange={onChangeViewState}
|
|
164
|
-
>
|
|
165
|
-
{/* TODO(burdon): Standardize (like Tollbar). */}
|
|
166
|
-
<Tabs.Tablist classNames={mx('bg-toolbarSurface border-b border-subduedSeparator')}>
|
|
167
|
-
<Tabs.Tab value='unresolved' classNames='text-sm'>
|
|
168
|
-
{t('show unresolved label')}
|
|
169
|
-
</Tabs.Tab>
|
|
170
|
-
<Tabs.Tab value='all' classNames='text-sm'>
|
|
171
|
-
{t('show all label')}
|
|
172
|
-
</Tabs.Tab>
|
|
173
|
-
</Tabs.Tablist>
|
|
174
|
-
<div className='overflow-y-auto'>
|
|
175
|
-
<Tabs.Tabpanel value='all'>{showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
176
|
-
<Tabs.Tabpanel value='unresolved'>{!showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
177
|
-
</div>
|
|
178
|
-
</Tabs.Root>
|
|
179
|
-
</StackItem.Content>
|
|
180
|
-
);
|
|
181
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { ControlPage } from '@dxos/react-ui-form';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
import type { ThreadSettingsProps } from '../types';
|
|
12
|
-
|
|
13
|
-
export const ThreadSettings = ({ settings: _settings }: { settings: ThreadSettingsProps }) => {
|
|
14
|
-
const { t: _t } = useTranslation(meta.id);
|
|
15
|
-
return <ControlPage></ControlPage>;
|
|
16
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
6
|
-
import { IdentityDid } from '@dxos/keys';
|
|
7
|
-
import { faker } from '@dxos/random';
|
|
8
|
-
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import { DataType } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
-
import { ThreadType } from '../types';
|
|
12
|
-
|
|
13
|
-
export const createCommentThread = (identity: Identity): ThreadType => {
|
|
14
|
-
return Obj.make(ThreadType, {
|
|
15
|
-
name: 'Comment',
|
|
16
|
-
messages: faker.helpers.multiple(
|
|
17
|
-
() =>
|
|
18
|
-
Ref.make(
|
|
19
|
-
Obj.make(DataType.Message, {
|
|
20
|
-
created: new Date().toISOString(),
|
|
21
|
-
sender: {
|
|
22
|
-
identityDid: faker.datatype.boolean() ? identity.did : IdentityDid.random(),
|
|
23
|
-
},
|
|
24
|
-
blocks: [{ _tag: 'text', text: faker.lorem.sentences(3) }],
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
|
-
{ count: { min: 2, max: 3 } },
|
|
28
|
-
),
|
|
29
|
-
status: 'active',
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const createProposalThread = (identity: Identity): ThreadType => {
|
|
34
|
-
return Obj.make(ThreadType, {
|
|
35
|
-
name: 'Proposal',
|
|
36
|
-
messages: faker.helpers.multiple(
|
|
37
|
-
() =>
|
|
38
|
-
Ref.make(
|
|
39
|
-
Obj.make(DataType.Message, {
|
|
40
|
-
created: new Date().toISOString(),
|
|
41
|
-
sender: {
|
|
42
|
-
identityDid: faker.datatype.boolean() ? identity.did : IdentityDid.random(),
|
|
43
|
-
},
|
|
44
|
-
blocks: [{ _tag: 'proposal', text: faker.lorem.sentences(3) }],
|
|
45
|
-
}),
|
|
46
|
-
),
|
|
47
|
-
{ count: { min: 1, max: 1 } },
|
|
48
|
-
),
|
|
49
|
-
status: 'active',
|
|
50
|
-
});
|
|
51
|
-
};
|
package/src/types/schema.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
import { DataType } from '@dxos/schema';
|
|
9
|
-
|
|
10
|
-
export const ThreadStatus = Schema.Union(
|
|
11
|
-
Schema.Literal('staged'),
|
|
12
|
-
Schema.Literal('active'),
|
|
13
|
-
Schema.Literal('resolved'),
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const _ThreadType = Schema.Struct({
|
|
17
|
-
name: Schema.optional(Schema.String),
|
|
18
|
-
status: Schema.optional(ThreadStatus),
|
|
19
|
-
messages: Schema.mutable(Schema.Array(Type.Ref(DataType.Message))),
|
|
20
|
-
}).pipe(Type.Obj({ typename: 'dxos.org/type/Thread', version: '0.1.0' }));
|
|
21
|
-
export interface ThreadType extends Schema.Schema.Type<typeof _ThreadType> {}
|
|
22
|
-
export const ThreadType: Type.obj<Schema.Schema<ThreadType, Schema.Schema.Encoded<typeof _ThreadType>, never>> =
|
|
23
|
-
_ThreadType;
|
|
24
|
-
|
|
25
|
-
const _ChannelType = Schema.Struct({
|
|
26
|
-
name: Schema.optional(Schema.String),
|
|
27
|
-
defaultThread: Type.Ref(ThreadType),
|
|
28
|
-
// TODO(wittjosiah): Should be an "ordered collection".
|
|
29
|
-
threads: Schema.mutable(Schema.Array(Type.Ref(ThreadType))),
|
|
30
|
-
}).pipe(Type.Obj({ typename: 'dxos.org/type/Channel', version: '0.1.0' }));
|
|
31
|
-
export interface ChannelType extends Schema.Schema.Type<typeof _ChannelType> {}
|
|
32
|
-
export const ChannelType: Type.obj<Schema.Schema<ChannelType, Schema.Schema.Encoded<typeof _ChannelType>, never>> =
|
|
33
|
-
_ChannelType;
|
|
File without changes
|
/package/dist/lib/{browser/ChatContainer-75KJZ4XR.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map}
RENAMED
|
File without changes
|