@dxos/plugin-thread 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/PLUGIN.mdl +75 -0
- package/README.md +1 -1
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs +57 -0
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs.map +7 -0
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs +38 -0
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs.map +7 -0
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs +57 -0
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +67 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs +29 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs +27 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs +50 -0
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-J6DXDPBH.mjs +34 -0
- package/dist/lib/neutral/append-channel-message-J6DXDPBH.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +19 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/channel-backend-feed-FCXGAIEC.mjs +58 -0
- package/dist/lib/neutral/channel-backend-feed-FCXGAIEC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs +10 -0
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HJHK5O6F.mjs +109 -0
- package/dist/lib/neutral/chunk-HJHK5O6F.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs +36 -0
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P4RSGFS4.mjs +69 -0
- package/dist/lib/neutral/chunk-P4RSGFS4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SZXFLBZL.mjs +8 -0
- package/dist/lib/neutral/chunk-SZXFLBZL.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +93 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-UW2LSL4G.mjs +41 -0
- package/dist/lib/neutral/create-channel-UW2LSL4G.mjs.map +7 -0
- package/dist/lib/neutral/create-object-RLCOUVAW.mjs +46 -0
- package/dist/lib/neutral/create-object-RLCOUVAW.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +11 -0
- package/dist/lib/neutral/index.mjs +34 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/navigation-resolver-4X4HCQYX.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-4X4HCQYX.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-G6KT7TSU.mjs +48 -0
- package/dist/lib/neutral/react-surface-G6KT7TSU.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +91 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts +1 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts +13 -0
- package/dist/types/src/capabilities/channel-backend-feed.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +43 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +19 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
- package/dist/types/src/{components/CommentsPanel/CommentsPanel.stories.d.ts → containers/ChannelArticle/ChannelArticle.stories.d.ts} +74 -72
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
- package/dist/types/src/{components/ThreadSettings → containers/ChannelArticle}/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts +11 -0
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelCreatePanel/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelCreatePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts +20 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts.map +1 -0
- package/dist/types/src/containers/{ChatContainer/ChatContainer.stories.d.ts → ThreadArticle/ThreadArticle.stories.d.ts} +71 -71
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -5
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useMessages.d.ts +4 -0
- package/dist/types/src/hooks/useMessages.d.ts.map +1 -0
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +3 -3
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts +3 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +70 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ThreadCapabilities.d.ts +37 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ThreadOperation.d.ts +91 -0
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/channel-backend.d.ts +16 -0
- package/dist/types/src/types/channel-backend.d.ts.map +1 -0
- package/dist/types/src/types/channel-backend.test.d.ts +2 -0
- package/dist/types/src/types/channel-backend.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -20
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +96 -114
- package/src/ThreadPlugin.node.ts +26 -0
- package/src/ThreadPlugin.test.ts +27 -0
- package/src/ThreadPlugin.tsx +23 -105
- package/src/ThreadPlugin.workerd.ts +25 -0
- package/src/capabilities/app-graph-builder.ts +25 -167
- package/src/capabilities/channel-backend-feed.ts +60 -0
- package/src/capabilities/create-object.ts +46 -0
- package/src/capabilities/index.ts +4 -8
- package/src/capabilities/navigation-resolver.ts +18 -0
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +8 -50
- package/src/components/Chat/Chat.tsx +119 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/index.ts +1 -7
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +108 -0
- package/src/containers/ChannelArticle/ChannelArticle.tsx +83 -0
- package/src/containers/ChannelArticle/index.ts +5 -0
- package/src/containers/ChannelCreatePanel/ChannelCreatePanel.tsx +52 -0
- package/src/containers/ChannelCreatePanel/index.ts +5 -0
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadArticle/ThreadArticle.stories.tsx} +11 -12
- package/src/containers/ThreadArticle/ThreadArticle.tsx +75 -0
- package/src/containers/ThreadArticle/index.ts +5 -0
- package/src/containers/index.ts +3 -5
- package/src/hooks/index.ts +1 -6
- package/src/hooks/useMessages.ts +37 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +22 -8
- package/src/operations/append-channel-message.ts +31 -0
- package/src/operations/create-channel.ts +18 -8
- package/src/operations/index.ts +2 -14
- package/src/paths.ts +10 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +2 -1
- package/src/types/ThreadCapabilities.ts +47 -0
- package/src/types/ThreadOperation.ts +49 -0
- package/src/types/channel-backend.test.ts +48 -0
- package/src/types/channel-backend.ts +54 -0
- package/src/types/index.ts +3 -3
- package/src/util.ts +35 -18
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/add-message-VPPFFLFL.mjs +0 -97
- package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs +0 -37
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-MESW3R4Q.mjs +0 -61
- package/dist/lib/browser/chunk-MESW3R4Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-VPM44Z35.mjs +0 -259
- package/dist/lib/browser/chunk-VPM44Z35.mjs.map +0 -7
- package/dist/lib/browser/create-OQKG4S47.mjs +0 -55
- package/dist/lib/browser/create-OQKG4S47.mjs.map +0 -7
- package/dist/lib/browser/create-channel-EF67LCS6.mjs +0 -21
- package/dist/lib/browser/create-channel-EF67LCS6.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs +0 -28
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +0 -7
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs +0 -57
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs.map +0 -7
- package/dist/lib/browser/delete-FSFVU6ZA.mjs +0 -59
- package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +0 -7
- package/dist/lib/browser/delete-message-XL5M5J33.mjs +0 -64
- package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -2334
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-VYS2JGVT.mjs +0 -25
- package/dist/lib/browser/on-create-space-VYS2JGVT.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -14
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/restore-2ZGMKUSD.mjs +0 -33
- package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +0 -7
- package/dist/lib/browser/restore-message-OYEGWPII.mjs +0 -42
- package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +0 -7
- package/dist/lib/browser/select-VG2XLULE.mjs +0 -26
- package/dist/lib/browser/select-VG2XLULE.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs +0 -45
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs +0 -98
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -38
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs +0 -260
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs +0 -62
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs.map +0 -7
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs +0 -56
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs +0 -22
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs +0 -29
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs +0 -58
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs.map +0 -7
- package/dist/lib/node-esm/delete-WRODXR3E.mjs +0 -60
- package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs +0 -65
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -2335
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs +0 -26
- package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -15
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs +0 -34
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs +0 -43
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +0 -7
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs +0 -27
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs +0 -46
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -13
- package/dist/types/src/blueprints/index.d.ts +0 -2
- package/dist/types/src/blueprints/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/thread-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +0 -1
- package/dist/types/src/calls/call-manager.d.ts +0 -87
- package/dist/types/src/calls/call-manager.d.ts.map +0 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
- package/dist/types/src/calls/index.d.ts +0 -7
- package/dist/types/src/calls/index.d.ts.map +0 -1
- package/dist/types/src/calls/media-manager.d.ts +0 -60
- package/dist/types/src/calls/media-manager.d.ts.map +0 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
- package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
- package/dist/types/src/calls/types.d.ts +0 -45
- package/dist/types/src/calls/types.d.ts.map +0 -1
- package/dist/types/src/calls/util/audio.d.ts +0 -6
- package/dist/types/src/calls/util/audio.d.ts.map +0 -1
- package/dist/types/src/calls/util/calls-service.d.ts +0 -77
- package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
- package/dist/types/src/calls/util/history-cache.d.ts +0 -11
- package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
- package/dist/types/src/calls/util/index.d.ts +0 -5
- package/dist/types/src/calls/util/index.d.ts.map +0 -1
- package/dist/types/src/calls/util/media.d.ts +0 -6
- package/dist/types/src/calls/util/media.d.ts.map +0 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -23
- package/dist/types/src/calls-service.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager.d.ts +0 -6
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -5
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -9
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -7
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -7
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +0 -5
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +0 -1
- package/dist/types/src/components/Call/Call.d.ts +0 -17
- package/dist/types/src/components/Call/Call.d.ts.map +0 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
- package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Call/index.d.ts +0 -3
- package/dist/types/src/components/Call/index.d.ts.map +0 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +0 -13
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +0 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts +0 -14
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +0 -1
- package/dist/types/src/components/CommentsPanel/index.d.ts +0 -3
- package/dist/types/src/components/CommentsPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts +0 -15
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/index.d.ts +0 -2
- package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
- package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
- package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
- package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -22
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
- package/dist/types/src/components/Media/index.d.ts +0 -3
- package/dist/types/src/components/Media/index.d.ts.map +0 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +0 -15
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +0 -1
- package/dist/types/src/components/MessagePanel/index.d.ts +0 -2
- package/dist/types/src/components/MessagePanel/index.d.ts.map +0 -1
- package/dist/types/src/components/Participant/Participant.d.ts +0 -6
- package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
- package/dist/types/src/components/Participant/index.d.ts +0 -3
- package/dist/types/src/components/Participant/index.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -178
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts +0 -12
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +0 -164
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +0 -6
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +0 -161
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings/index.d.ts +0 -2
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -2
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +0 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/containers/CallSidebar/index.d.ts +0 -2
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +0 -162
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -16
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +0 -8
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +0 -1
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +0 -2
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +0 -1
- package/dist/types/src/extensions/command.d.ts +0 -3
- package/dist/types/src/extensions/command.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -3
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/dist/types/src/extensions/threads.d.ts +0 -14
- package/dist/types/src/extensions/threads.d.ts.map +0 -1
- package/dist/types/src/hooks/analytics.d.ts +0 -3
- package/dist/types/src/hooks/analytics.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
- package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
- package/dist/types/src/operations/add-message.d.ts +0 -5
- package/dist/types/src/operations/add-message.d.ts.map +0 -1
- package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
- package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
- package/dist/types/src/operations/create-proposals.d.ts +0 -5
- package/dist/types/src/operations/create-proposals.d.ts.map +0 -1
- package/dist/types/src/operations/create.d.ts +0 -5
- package/dist/types/src/operations/create.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts +0 -2804
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/operations/delete-message.d.ts +0 -5
- package/dist/types/src/operations/delete-message.d.ts.map +0 -1
- package/dist/types/src/operations/delete.d.ts +0 -5
- package/dist/types/src/operations/delete.d.ts.map +0 -1
- package/dist/types/src/operations/on-create-space.d.ts +0 -5
- package/dist/types/src/operations/on-create-space.d.ts.map +0 -1
- package/dist/types/src/operations/restore-message.d.ts +0 -5
- package/dist/types/src/operations/restore-message.d.ts.map +0 -1
- package/dist/types/src/operations/restore.d.ts +0 -5
- package/dist/types/src/operations/restore.d.ts.map +0 -1
- package/dist/types/src/operations/select.d.ts +0 -5
- package/dist/types/src/operations/select.d.ts.map +0 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +0 -5
- package/dist/types/src/operations/toggle-resolved.d.ts.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -5
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -715
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/dist/types/src/types/Settings.d.ts +0 -5
- package/dist/types/src/types/Settings.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -24
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/blueprints/index.ts +0 -5
- package/src/blueprints/thread-blueprint.ts +0 -37
- package/src/calls/call-manager.ts +0 -270
- package/src/calls/call-swarm-synchronizer.ts +0 -350
- package/src/calls/index.ts +0 -10
- package/src/calls/media-manager.ts +0 -378
- package/src/calls/speaking-monitor.ts +0 -85
- package/src/calls/types.ts +0 -74
- package/src/calls/util/audio.ts +0 -58
- package/src/calls/util/calls-service.ts +0 -580
- package/src/calls/util/history-cache.ts +0 -27
- package/src/calls/util/index.ts +0 -8
- package/src/calls/util/media.ts +0 -52
- package/src/calls/util/stub-media-streams.ts +0 -127
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -230
- package/src/capabilities/blueprint-definition.ts +0 -17
- package/src/capabilities/call-manager.ts +0 -27
- package/src/capabilities/markdown.ts +0 -82
- package/src/capabilities/react-root.tsx +0 -20
- package/src/capabilities/settings.ts +0 -35
- package/src/capabilities/state.ts +0 -22
- package/src/capabilities/undo-mappings.ts +0 -46
- package/src/components/Call/Call.tsx +0 -93
- package/src/components/Call/Toolbar.tsx +0 -199
- package/src/components/Call/index.ts +0 -6
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +0 -93
- package/src/components/CommentsPanel/CommentsPanel.tsx +0 -71
- package/src/components/CommentsPanel/CommentsThread.tsx +0 -172
- package/src/components/CommentsPanel/index.ts +0 -6
- package/src/components/Lobby/Lobby.tsx +0 -122
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -59
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/MessagePanel/MessagePanel.tsx +0 -222
- package/src/components/MessagePanel/index.ts +0 -5
- package/src/components/Participant/Participant.tsx +0 -77
- package/src/components/Participant/ParticipantGrid.tsx +0 -88
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -53
- package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +0 -31
- package/src/components/ThreadSettings/ThreadSettings.tsx +0 -20
- package/src/components/ThreadSettings/index.ts +0 -5
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
- package/src/containers/CallDebugPanel/index.ts +0 -5
- package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
- package/src/containers/CallSidebar/index.ts +0 -5
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +0 -61
- package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
- package/src/containers/ChannelContainer/index.ts +0 -5
- package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
- package/src/containers/ChatContainer/index.ts +0 -8
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +0 -217
- package/src/containers/ThreadCompanion/index.ts +0 -5
- package/src/extensions/command.ts +0 -36
- package/src/extensions/index.ts +0 -6
- package/src/extensions/threads.ts +0 -171
- package/src/hooks/analytics.ts +0 -41
- package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
- package/src/hooks/useDebugMode.ts +0 -25
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
- package/src/hooks/useVideoStreamTrack.tsx +0 -36
- package/src/operations/add-message.ts +0 -81
- package/src/operations/create-channel-thread.ts +0 -26
- package/src/operations/create-proposals.ts +0 -49
- package/src/operations/create.ts +0 -48
- package/src/operations/definitions.ts +0 -177
- package/src/operations/delete-message.ts +0 -53
- package/src/operations/delete.ts +0 -63
- package/src/operations/on-create-space.ts +0 -27
- package/src/operations/restore-message.ts +0 -38
- package/src/operations/restore.ts +0 -38
- package/src/operations/select.ts +0 -24
- package/src/operations/toggle-resolved.ts +0 -41
- package/src/testing/data.ts +0 -49
- package/src/testing/index.ts +0 -5
- package/src/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -37
- package/src/types/Settings.ts +0 -10
- package/src/types/capabilities.ts +0 -36
- package/src/types/types.ts +0 -24
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
|
+
import { Feed, Query } from '@dxos/echo';
|
|
13
|
+
import { createFeedServiceLayer } from '@dxos/echo-client';
|
|
14
|
+
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
+
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
18
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
19
|
+
import { Config } from '@dxos/react-client';
|
|
20
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
|
+
import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
|
|
22
|
+
import { Channel, Message, Thread } from '@dxos/types';
|
|
23
|
+
|
|
24
|
+
import { translations } from '#translations';
|
|
25
|
+
|
|
26
|
+
import { ThreadPlugin } from '../../ThreadPlugin';
|
|
27
|
+
import { ChannelArticle, type ChannelArticleProps } from './ChannelArticle';
|
|
28
|
+
|
|
29
|
+
// TODO(wittjosiah): Channel doesn't render full height.
|
|
30
|
+
const DefaultStory = ({ roomId }: ChannelArticleProps) => {
|
|
31
|
+
const [space] = useSpaces();
|
|
32
|
+
const [channel] = useQuery(space?.db, Query.type(Channel.Channel));
|
|
33
|
+
if (!channel) {
|
|
34
|
+
return <Loading data={{ channel }} />;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <ChannelArticle subject={channel} attendableId='story' roomId={roomId} role='article' />;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const meta = {
|
|
41
|
+
title: 'plugins/plugin-thread/containers/ChannelArticle',
|
|
42
|
+
component: ChannelArticle,
|
|
43
|
+
render: DefaultStory,
|
|
44
|
+
decorators: [
|
|
45
|
+
withTheme(),
|
|
46
|
+
withLayout({ layout: 'column' }),
|
|
47
|
+
withPluginManager({
|
|
48
|
+
capabilities: [
|
|
49
|
+
Capability.contributes(AppCapabilities.Schema, [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message]),
|
|
50
|
+
],
|
|
51
|
+
plugins: [
|
|
52
|
+
...corePlugins(),
|
|
53
|
+
ClientPlugin({
|
|
54
|
+
types: [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message],
|
|
55
|
+
config: new Config({
|
|
56
|
+
runtime: {
|
|
57
|
+
services: {
|
|
58
|
+
edge: {
|
|
59
|
+
url: 'https://edge.dxos.workers.dev/',
|
|
60
|
+
},
|
|
61
|
+
iceProviders: [
|
|
62
|
+
{
|
|
63
|
+
urls: 'https://edge.dxos.workers.dev/ice',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
onClientInitialized: ({ client }) =>
|
|
70
|
+
Effect.gen(function* () {
|
|
71
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
72
|
+
const channel = personalSpace.db.add(Channel.make({ name: 'general' }));
|
|
73
|
+
yield* Effect.promise(() => channel.backend.config.load());
|
|
74
|
+
const feed = Channel.getFeed(channel);
|
|
75
|
+
invariant(feed, 'Channel is not feed-backed');
|
|
76
|
+
const seed = [
|
|
77
|
+
Message.make({ sender: { role: 'user' }, blocks: [{ _tag: 'text', text: 'Hello, channel.' }] }),
|
|
78
|
+
Message.make({
|
|
79
|
+
sender: { role: 'user' },
|
|
80
|
+
blocks: [{ _tag: 'text', text: 'Messages are stored in the feed.' }],
|
|
81
|
+
}),
|
|
82
|
+
];
|
|
83
|
+
yield* Feed.append(feed, seed).pipe(Effect.provide(createFeedServiceLayer(personalSpace.queues)));
|
|
84
|
+
}),
|
|
85
|
+
}),
|
|
86
|
+
SpacePlugin({}),
|
|
87
|
+
ThreadPlugin(),
|
|
88
|
+
],
|
|
89
|
+
}),
|
|
90
|
+
],
|
|
91
|
+
parameters: {
|
|
92
|
+
translations,
|
|
93
|
+
},
|
|
94
|
+
} satisfies Meta<typeof ChannelArticle>;
|
|
95
|
+
|
|
96
|
+
export default meta;
|
|
97
|
+
|
|
98
|
+
type Story = StoryObj<typeof meta>;
|
|
99
|
+
|
|
100
|
+
export const Default: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
// Fixed room for testing.
|
|
103
|
+
subject: undefined,
|
|
104
|
+
attendableId: 'story',
|
|
105
|
+
role: 'article',
|
|
106
|
+
roomId: '04a1d1911703b8e929d0649021a965',
|
|
107
|
+
},
|
|
108
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { getSpace, useMembers } from '@dxos/react-client/echo';
|
|
11
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
|
+
import { Panel } from '@dxos/react-ui';
|
|
13
|
+
import { type Channel } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { Chat } from '#components';
|
|
16
|
+
import { useMessages, useStatus } from '#hooks';
|
|
17
|
+
import { ThreadCapabilities, ThreadOperation, resolveProvider } from '#types';
|
|
18
|
+
|
|
19
|
+
export type ChannelArticleProps = AppSurface.ObjectArticleProps<
|
|
20
|
+
Channel.Channel | undefined,
|
|
21
|
+
{
|
|
22
|
+
roomId?: string;
|
|
23
|
+
fullscreen?: boolean;
|
|
24
|
+
}
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Channel article: renders the channel chat inside a document panel. Messages
|
|
29
|
+
* are read and written through the channel's backend provider (resolved by
|
|
30
|
+
* `channel.backend.kind`), so the container is agnostic to where messages are
|
|
31
|
+
* stored. Read-only state defaults to the provider's policy, or to "channel
|
|
32
|
+
* carries foreign-key `Obj.Meta`" when the provider has none.
|
|
33
|
+
*
|
|
34
|
+
* The "Start video call" action and the in-call surface are contributed by
|
|
35
|
+
* plugin-calls — this container is call-agnostic.
|
|
36
|
+
*/
|
|
37
|
+
export const ChannelArticle = ({ subject: channel }: ChannelArticleProps) => {
|
|
38
|
+
const identity = useIdentity();
|
|
39
|
+
const space = channel ? getSpace(channel) : undefined;
|
|
40
|
+
const members = useMembers(space?.id);
|
|
41
|
+
const id = channel ? Obj.getURI(channel) : undefined;
|
|
42
|
+
const activity = useStatus(space, id);
|
|
43
|
+
const { invokePromise } = useOperationInvoker();
|
|
44
|
+
|
|
45
|
+
const providers = useCapabilities(ThreadCapabilities.ChannelBackend);
|
|
46
|
+
const provider = channel ? resolveProvider(providers, channel.backend.kind) : undefined;
|
|
47
|
+
const messages = useMessages(channel);
|
|
48
|
+
const readOnly = channel ? (provider?.readOnly?.(channel) ?? Obj.getMeta(channel).keys.length > 0) : false;
|
|
49
|
+
|
|
50
|
+
const handleSend = (text: string) => {
|
|
51
|
+
if (!channel || !identity || readOnly) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
void invokePromise(ThreadOperation.AppendChannelMessage, {
|
|
56
|
+
channel,
|
|
57
|
+
sender: { identityDid: identity.did },
|
|
58
|
+
text,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return true;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
if (!space || !channel || !id) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Panel.Root classNames='dx-document'>
|
|
70
|
+
<Panel.Content asChild>
|
|
71
|
+
<Chat
|
|
72
|
+
id={id}
|
|
73
|
+
identity={identity ?? undefined}
|
|
74
|
+
members={members}
|
|
75
|
+
messages={messages}
|
|
76
|
+
activity={activity}
|
|
77
|
+
onSend={handleSend}
|
|
78
|
+
readOnly={readOnly}
|
|
79
|
+
/>
|
|
80
|
+
</Panel.Content>
|
|
81
|
+
</Panel.Root>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { type SpaceCapabilities } from '@dxos/plugin-space';
|
|
10
|
+
import { Column } from '@dxos/react-ui';
|
|
11
|
+
import { Form } from '@dxos/react-ui-form';
|
|
12
|
+
|
|
13
|
+
import { ThreadCapabilities, buildChannelFormSchema } from '#types';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Provider-driven create panel for channels. Reads the registered
|
|
17
|
+
* `ChannelBackend` providers and renders a react-ui-form whose schema is the
|
|
18
|
+
* assembled `{ name?, backend: Union(...) }` — a backend selector plus the
|
|
19
|
+
* selected provider's create fields (just a name field when there is a single
|
|
20
|
+
* field-less provider).
|
|
21
|
+
*/
|
|
22
|
+
export const ChannelCreatePanel = ({ target, onCreateObject }: SpaceCapabilities.CreateObjectCustomPanelProps) => {
|
|
23
|
+
const providers = useCapabilities(ThreadCapabilities.ChannelBackend);
|
|
24
|
+
const schema = useMemo(() => buildChannelFormSchema(providers), [providers]);
|
|
25
|
+
|
|
26
|
+
const handleSave = useCallback(
|
|
27
|
+
(values: { name?: string; backend?: { kind: string } & Record<string, unknown> }) => {
|
|
28
|
+
const { name, backend } = values;
|
|
29
|
+
const { kind, ...options } = backend ?? {};
|
|
30
|
+
void onCreateObject({ name, kind, options });
|
|
31
|
+
},
|
|
32
|
+
[onCreateObject],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Form.Root
|
|
37
|
+
autoFocus
|
|
38
|
+
db={Obj.isObject(target) ? Obj.getDatabase(target) : target}
|
|
39
|
+
schema={schema}
|
|
40
|
+
defaultValues={{}}
|
|
41
|
+
onSave={handleSave}
|
|
42
|
+
testId='create-channel-form'
|
|
43
|
+
>
|
|
44
|
+
<Column.Center>
|
|
45
|
+
<Form.Content>
|
|
46
|
+
<Form.FieldSet />
|
|
47
|
+
<Form.Submit />
|
|
48
|
+
</Form.Content>
|
|
49
|
+
</Column.Center>
|
|
50
|
+
</Form.Root>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -19,10 +19,9 @@ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
|
19
19
|
import { withLayout, Loading } from '@dxos/react-ui/testing';
|
|
20
20
|
import { Message, Thread } from '@dxos/types';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { translations } from '#translations';
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
import { ChatContainer } from './ChatContainer';
|
|
24
|
+
import { ThreadArticle } from './ThreadArticle';
|
|
26
25
|
|
|
27
26
|
random.seed(1);
|
|
28
27
|
|
|
@@ -30,32 +29,32 @@ const DefaultStory = () => {
|
|
|
30
29
|
const client = useClient();
|
|
31
30
|
const identity = useIdentity();
|
|
32
31
|
const [space, setSpace] = useState<Space>();
|
|
33
|
-
const [
|
|
32
|
+
const [thread, setThread] = useState<Thread.Thread | null>();
|
|
34
33
|
|
|
35
34
|
useAsyncEffect(async () => {
|
|
36
35
|
if (identity) {
|
|
37
36
|
const space = await client.spaces.create();
|
|
38
|
-
const
|
|
37
|
+
const thread = space.db.add(Thread.make({ status: 'active' }));
|
|
39
38
|
setSpace(space);
|
|
40
|
-
|
|
39
|
+
setThread(thread);
|
|
41
40
|
}
|
|
42
41
|
}, [identity]);
|
|
43
42
|
|
|
44
|
-
if (!identity || !
|
|
45
|
-
return <Loading data={{ identity: !!identity, space: !!space,
|
|
43
|
+
if (!identity || !thread || !space) {
|
|
44
|
+
return <Loading data={{ identity: !!identity, space: !!space, thread: !!thread }} />;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
return <
|
|
47
|
+
return <ThreadArticle space={space} thread={thread} />;
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
const meta = {
|
|
52
|
-
title: 'plugins/plugin-thread/containers/
|
|
51
|
+
title: 'plugins/plugin-thread/containers/ThreadArticle',
|
|
53
52
|
component: ThreadComponent.Root as any,
|
|
54
53
|
render: DefaultStory,
|
|
55
54
|
decorators: [
|
|
56
55
|
withLayout({ layout: 'column' }),
|
|
57
56
|
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
58
|
-
// Currently this is required
|
|
57
|
+
// Currently this is required because Chat renders an object tile via a Surface.
|
|
59
58
|
withPluginManager({
|
|
60
59
|
plugins: corePlugins(),
|
|
61
60
|
capabilities: [
|
|
@@ -71,7 +70,7 @@ const meta = {
|
|
|
71
70
|
}),
|
|
72
71
|
withClientProvider({
|
|
73
72
|
createSpace: true,
|
|
74
|
-
types: [Thread.Thread,
|
|
73
|
+
types: [Thread.Thread, Message.Message],
|
|
75
74
|
}),
|
|
76
75
|
],
|
|
77
76
|
parameters: {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
11
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
12
|
+
import { type ThreadContentProps } from '@dxos/react-ui-thread';
|
|
13
|
+
import { Message, type Thread } from '@dxos/types';
|
|
14
|
+
import { isNonNullable } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { Chat } from '#components';
|
|
17
|
+
import { useStatus } from '#hooks';
|
|
18
|
+
|
|
19
|
+
export type ThreadArticleProps = ThemedClassName<
|
|
20
|
+
{
|
|
21
|
+
space: Space;
|
|
22
|
+
thread: Thread.Thread;
|
|
23
|
+
context?: Obj.Unknown;
|
|
24
|
+
autoFocus?: boolean;
|
|
25
|
+
} & Pick<ThreadContentProps, 'current'>
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Renders an AutoMerge {@link Thread} as a chat: appends new messages by pushing
|
|
30
|
+
* onto `thread.messages`. Used for comment threads and the meeting in-call chat.
|
|
31
|
+
*/
|
|
32
|
+
export const ThreadArticle = composable<HTMLDivElement, ThreadArticleProps>(
|
|
33
|
+
({ space, thread, context, autoFocus, current, ...props }, forwardedRef) => {
|
|
34
|
+
const id = Obj.getURI(thread);
|
|
35
|
+
const identity = useIdentity()!;
|
|
36
|
+
const members = useMembers(space?.id);
|
|
37
|
+
const activity = useStatus(space, id);
|
|
38
|
+
|
|
39
|
+
const messages = useMemo(
|
|
40
|
+
() => thread.messages.map((message) => message.target).filter(isNonNullable),
|
|
41
|
+
[thread.messages],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const handleSend = (text: string) => {
|
|
45
|
+
Obj.update(thread, (thread) => {
|
|
46
|
+
thread.messages.push(
|
|
47
|
+
Ref.make(
|
|
48
|
+
Obj.make(Message.Message, {
|
|
49
|
+
created: new Date().toISOString(),
|
|
50
|
+
sender: { identityDid: identity.did },
|
|
51
|
+
blocks: [{ _tag: 'text', text }],
|
|
52
|
+
properties: context ? { context: Ref.make(context) } : undefined,
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Chat
|
|
62
|
+
{...composableProps(props)}
|
|
63
|
+
id={id}
|
|
64
|
+
identity={identity}
|
|
65
|
+
members={members}
|
|
66
|
+
messages={messages}
|
|
67
|
+
activity={activity}
|
|
68
|
+
onSend={handleSend}
|
|
69
|
+
autoFocus={autoFocus}
|
|
70
|
+
current={current}
|
|
71
|
+
ref={forwardedRef}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
package/src/containers/index.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const ChatContainer: ComponentType<any> = lazy(() => import('./ChatContainer'));
|
|
11
|
-
export const ThreadCompanion: ComponentType<any> = lazy(() => import('./ThreadCompanion'));
|
|
7
|
+
export const ChannelCreatePanel: ComponentType<any> = lazy(() => import('./ChannelCreatePanel'));
|
|
8
|
+
export const ChannelArticle: ComponentType<any> = lazy(() => import('./ChannelArticle'));
|
|
9
|
+
export const ThreadArticle: ComponentType<any> = lazy(() => import('./ThreadArticle'));
|
package/src/hooks/index.ts
CHANGED
|
@@ -2,10 +2,5 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
|
|
7
|
-
export * from './useBlackCanvasStreamTrack';
|
|
8
|
-
export * from './useDebugMode';
|
|
9
|
-
export * from './useInaudibleAudioStreamTrack';
|
|
5
|
+
export * from './useMessages';
|
|
10
6
|
export * from './useStatus';
|
|
11
|
-
export * from './useVideoStreamTrack';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type Channel, type Message } from '@dxos/types';
|
|
9
|
+
|
|
10
|
+
import { ThreadCapabilities, resolveProvider } from '../types';
|
|
11
|
+
|
|
12
|
+
const EMPTY: readonly Message.Message[] = [];
|
|
13
|
+
|
|
14
|
+
/** Reactive message list for a channel, resolved through its backend provider. */
|
|
15
|
+
export const useMessages = (channel: Channel.Channel | undefined): readonly Message.Message[] => {
|
|
16
|
+
const providers = useCapabilities(ThreadCapabilities.ChannelBackend);
|
|
17
|
+
const provider = useMemo(
|
|
18
|
+
() => (channel ? resolveProvider(providers, channel.backend.kind) : undefined),
|
|
19
|
+
[providers, channel],
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const ref = useRef<readonly Message.Message[]>(EMPTY);
|
|
23
|
+
const subscribe = useCallback(
|
|
24
|
+
(onChange: () => void) => {
|
|
25
|
+
if (!provider || !channel) {
|
|
26
|
+
return () => {};
|
|
27
|
+
}
|
|
28
|
+
return provider.subscribe(channel, (messages) => {
|
|
29
|
+
ref.current = messages;
|
|
30
|
+
onChange();
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
[provider, channel],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return useSyncExternalStore(subscribe, () => ref.current);
|
|
37
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
|
|
6
|
+
// Either refactor callers to not need them or factor them out to a shared package.
|
|
7
7
|
export * from './hooks';
|
|
8
8
|
export * from './meta';
|
|
9
|
-
|
|
10
|
-
export * from './
|
|
9
|
+
export * from './paths';
|
|
10
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -2,20 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.thread'),
|
|
11
|
+
name: 'Threads',
|
|
12
|
+
author: 'DXOS',
|
|
12
13
|
description: trim`
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
ThreadPlugin provides chat: channels backed by an ECHO feed and free-standing
|
|
15
|
+
message threads. It renders the channel article and companion surfaces plus a
|
|
16
|
+
thread surface, and contributes the operations that create a default channel on
|
|
17
|
+
space creation, create new channels, and append messages.
|
|
18
|
+
|
|
19
|
+
Channel messages are stored in the channel's feed queue and rendered newest-last
|
|
20
|
+
with a pinned composer; externally-synced channels (carrying foreign-key
|
|
21
|
+
metadata, e.g. Slack/Discord-sourced rooms) render read-only because there is no
|
|
22
|
+
local-write path back to the source. Free-standing threads render their messages
|
|
23
|
+
and append by pushing onto the thread's message list.
|
|
24
|
+
|
|
25
|
+
The shared message and thread UI comes from @dxos/react-ui-thread; the Channel,
|
|
26
|
+
Message, and Thread schema come from @dxos/types. Document comments and the
|
|
27
|
+
comment-thread AI agent live in the @dxos/plugin-comments plugin.
|
|
15
28
|
`,
|
|
16
29
|
icon: 'ph--video-conference--regular',
|
|
17
30
|
iconHue: 'rose',
|
|
18
31
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
|
|
19
|
-
|
|
32
|
+
spec: 'PLUGIN.mdl',
|
|
33
|
+
});
|
|
20
34
|
|
|
21
35
|
export const THREAD_ITEM = `${meta.id}.item`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { Message } from '@dxos/types';
|
|
11
|
+
|
|
12
|
+
import { ThreadCapabilities, ThreadOperation, resolveProvider } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.AppendChannelMessage> =
|
|
15
|
+
ThreadOperation.AppendChannelMessage.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* ({ channel, sender, text }) {
|
|
18
|
+
const providers = yield* Capability.getAll(ThreadCapabilities.ChannelBackend);
|
|
19
|
+
const provider = resolveProvider(providers, channel.backend.kind);
|
|
20
|
+
invariant(provider, `No channel backend for kind: ${channel.backend.kind}`);
|
|
21
|
+
|
|
22
|
+
const message = Message.make({
|
|
23
|
+
sender,
|
|
24
|
+
blocks: [{ _tag: 'text', text }],
|
|
25
|
+
});
|
|
26
|
+
yield* provider.send(channel, message);
|
|
27
|
+
}),
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export default handler;
|
|
@@ -4,16 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { Channel } from '@dxos/types';
|
|
8
11
|
|
|
9
|
-
import {
|
|
10
|
-
import { CreateChannel } from './definitions';
|
|
12
|
+
import { ThreadCapabilities, ThreadOperation, resolveProvider } from '../types';
|
|
11
13
|
|
|
12
|
-
const handler: Operation.WithHandler<typeof CreateChannel> = CreateChannel.pipe(
|
|
13
|
-
Operation.withHandler(
|
|
14
|
-
Effect.
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.CreateChannel> = ThreadOperation.CreateChannel.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* ({ name, kind, options }) {
|
|
17
|
+
if (!kind || kind === Channel.FeedBackendKind) {
|
|
18
|
+
return { object: Channel.make({ name }) };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const providers = yield* Capability.getAll(ThreadCapabilities.ChannelBackend);
|
|
22
|
+
const provider = resolveProvider(providers, kind);
|
|
23
|
+
invariant(provider, `No channel backend for kind: ${kind}`);
|
|
24
|
+
const config = provider.makeConfig(options ?? {});
|
|
25
|
+
return { object: Channel.make({ name, backend: { kind, config } }) };
|
|
26
|
+
}),
|
|
17
27
|
),
|
|
18
28
|
);
|
|
19
29
|
|
package/src/operations/index.ts
CHANGED
|
@@ -2,21 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { OperationHandlerSet } from '@dxos/
|
|
6
|
-
|
|
7
|
-
export * as ThreadOperation from './definitions';
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
8
6
|
|
|
9
7
|
export const ThreadOperationHandlerSet = OperationHandlerSet.lazy(
|
|
10
|
-
() => import('./
|
|
11
|
-
() => import('./create'),
|
|
8
|
+
() => import('./append-channel-message'),
|
|
12
9
|
() => import('./create-channel'),
|
|
13
|
-
() => import('./create-channel-thread'),
|
|
14
|
-
() => import('./create-proposals'),
|
|
15
|
-
() => import('./delete'),
|
|
16
|
-
() => import('./delete-message'),
|
|
17
|
-
() => import('./on-create-space'),
|
|
18
|
-
() => import('./restore'),
|
|
19
|
-
() => import('./restore-message'),
|
|
20
|
-
() => import('./select'),
|
|
21
|
-
() => import('./toggle-resolved'),
|
|
22
10
|
);
|
package/src/paths.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createTypeSectionPaths } from '@dxos/app-toolkit';
|
|
6
|
+
import { Channel } from '@dxos/types';
|
|
7
|
+
|
|
8
|
+
const { getSectionPath: getChannelsPath, getObjectPath: getChannelPath } = createTypeSectionPaths(Channel.Channel);
|
|
9
|
+
|
|
10
|
+
export { getChannelsPath, getChannelPath };
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ThreadPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ThreadOperationHandlerSet } from './operations';
|
package/src/translations.ts
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { Type } from '@dxos/echo';
|
|
6
6
|
import { type Resource } from '@dxos/react-ui';
|
|
7
|
+
import { Channel } from '@dxos/types';
|
|
7
8
|
|
|
8
9
|
import { meta } from '#meta';
|
|
9
|
-
import { Channel } from '#types';
|
|
10
10
|
|
|
11
11
|
export const translations = [
|
|
12
12
|
{
|
|
13
13
|
'en-US': {
|
|
14
|
+
// TODO(burdon): Thread.
|
|
14
15
|
[Type.getTypename(Channel.Channel)]: {
|
|
15
16
|
'typename.label': 'Channel',
|
|
16
17
|
'typename.label_zero': 'Channels',
|