@dxos/plugin-thread 0.8.4-main.fd6878d → 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-J5LGTIGS.mjs +10 -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/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/types/src/ThreadPlugin.d.ts +3 -1
- 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 +4 -2
- 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 +12 -14
- 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 +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- 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/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 -10
- 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/containers/ChannelArticle/ChannelArticle.stories.d.ts +162 -0
- 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/containers/ChannelArticle/index.d.ts.map +1 -0
- 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/ThreadArticle/ThreadArticle.stories.d.ts +162 -0
- 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 +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -4
- 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 +3 -4
- 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 +5 -0
- package/dist/types/src/operations/create-channel.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- 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 +142 -72
- 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 -2
- 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 +108 -81
- package/src/ThreadPlugin.node.ts +26 -0
- package/src/ThreadPlugin.test.ts +27 -0
- package/src/ThreadPlugin.tsx +38 -144
- package/src/ThreadPlugin.workerd.ts +25 -0
- package/src/capabilities/app-graph-builder.ts +44 -174
- package/src/capabilities/channel-backend-feed.ts +60 -0
- package/src/capabilities/create-object.ts +46 -0
- package/src/capabilities/index.ts +11 -11
- package/src/capabilities/navigation-resolver.ts +18 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +39 -79
- package/src/components/Chat/Chat.tsx +119 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/index.ts +1 -14
- 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/ThreadArticle/ThreadArticle.stories.tsx +86 -0
- package/src/containers/ThreadArticle/ThreadArticle.tsx +75 -0
- package/src/containers/ThreadArticle/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +1 -4
- package/src/hooks/useMessages.ts +37 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +27 -9
- package/src/operations/append-channel-message.ts +31 -0
- package/src/operations/create-channel.ts +30 -0
- package/src/operations/index.ts +10 -0
- package/src/paths.ts +10 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +75 -73
- 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 -2
- package/src/util.ts +35 -18
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ChannelContainer-O2SFQJU7.mjs +0 -16
- package/dist/lib/browser/ChatContainer-PVT3DUZJ.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs.map +0 -7
- package/dist/lib/browser/call-manager-XRRCAVLI.mjs +0 -24
- package/dist/lib/browser/call-manager-XRRCAVLI.mjs.map +0 -7
- package/dist/lib/browser/chunk-2CWJBXBH.mjs +0 -21
- package/dist/lib/browser/chunk-2CWJBXBH.mjs.map +0 -7
- package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
- package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
- package/dist/lib/browser/chunk-DW7JD64V.mjs +0 -137
- package/dist/lib/browser/chunk-DW7JD64V.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-FY4ZRD5X.mjs +0 -367
- package/dist/lib/browser/chunk-FY4ZRD5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs +0 -31
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-J3JO5NWO.mjs +0 -477
- package/dist/lib/browser/chunk-J3JO5NWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-JGKMMI65.mjs +0 -56
- package/dist/lib/browser/chunk-JGKMMI65.mjs.map +0 -7
- package/dist/lib/browser/chunk-TUFWPOVS.mjs +0 -1698
- package/dist/lib/browser/chunk-TUFWPOVS.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5PIP5YR.mjs +0 -149
- package/dist/lib/browser/chunk-X5PIP5YR.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs +0 -984
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -302
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs +0 -369
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs.map +0 -7
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs +0 -169
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-root-QXPALOUQ.mjs +0 -28
- package/dist/lib/browser/react-root-QXPALOUQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PYAMIADB.mjs +0 -109
- package/dist/lib/browser/react-surface-PYAMIADB.mjs.map +0 -7
- package/dist/lib/browser/settings-AC6YSASL.mjs +0 -22
- package/dist/lib/browser/settings-AC6YSASL.mjs.map +0 -7
- package/dist/lib/browser/state-2T4KDWBX.mjs +0 -34
- package/dist/lib/browser/state-2T4KDWBX.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -16
- package/dist/lib/node-esm/ChannelContainer-B2ZGAE4P.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-2CT4PJ7I.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs +0 -25
- package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs +0 -1699
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs +0 -33
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs +0 -23
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BF4UKS55.mjs +0 -368
- package/dist/lib/node-esm/chunk-BF4UKS55.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QBHKLWGR.mjs +0 -58
- package/dist/lib/node-esm/chunk-QBHKLWGR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SED3O2XO.mjs +0 -150
- package/dist/lib/node-esm/chunk-SED3O2XO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs +0 -478
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs +0 -138
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs +0 -985
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -303
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs +0 -370
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs +0 -170
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs +0 -29
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs +0 -110
- package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs.map +0 -7
- package/dist/lib/node-esm/settings-N52O7MLS.mjs +0 -23
- package/dist/lib/node-esm/settings-N52O7MLS.mjs.map +0 -7
- package/dist/lib/node-esm/state-62TQKQVB.mjs +0 -35
- package/dist/lib/node-esm/state-62TQKQVB.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -17
- package/dist/types/src/calls/call-manager.d.ts +0 -77
- 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 -75
- 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 -22
- package/dist/types/src/calls-service.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager.d.ts +0 -5
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- 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/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- 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/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/CallDebugPanel.d.ts +0 -8
- package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/CallSidebar.d.ts +0 -4
- package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.d.ts +0 -14
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -7
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -17
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -6
- package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsContainer.d.ts +0 -13
- package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +0 -14
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/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 -8
- 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/MessageContainer.d.ts +0 -11
- package/dist/types/src/components/MessageContainer.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/ResponsiveContainer.d.ts +0 -12
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/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 -23
- 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/index.d.ts +0 -4
- package/dist/types/src/components/ResponsiveGrid/index.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 +0 -3
- package/dist/types/src/components/command-extension.d.ts.map +0 -1
- package/dist/types/src/components/testing.d.ts +0 -4
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/dist/types/src/extensions/threads.d.ts +0 -9
- package/dist/types/src/extensions/threads.d.ts.map +0 -1
- package/dist/types/src/hooks/analytics.d.ts +0 -4
- package/dist/types/src/hooks/analytics.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/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 -2
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -164
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -388
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/calls/call-manager.ts +0 -246
- package/src/calls/call-swarm-synchronizer.ts +0 -350
- package/src/calls/index.ts +0 -10
- package/src/calls/media-manager.ts +0 -349
- package/src/calls/speaking-monitor.ts +0 -85
- package/src/calls/types.ts +0 -70
- package/src/calls/util/audio.ts +0 -58
- package/src/calls/util/calls-service.ts +0 -531
- 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 -70
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -216
- package/src/capabilities/call-manager.ts +0 -20
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -315
- package/src/capabilities/markdown.ts +0 -69
- package/src/capabilities/react-root.tsx +0 -17
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -26
- package/src/components/Call/Call.tsx +0 -89
- package/src/components/Call/Toolbar.tsx +0 -182
- package/src/components/Call/index.ts +0 -6
- package/src/components/CallDebugPanel.tsx +0 -115
- package/src/components/CallSidebar.tsx +0 -18
- package/src/components/ChannelContainer.stories.tsx +0 -59
- package/src/components/ChannelContainer.tsx +0 -201
- package/src/components/Chat.stories.tsx +0 -89
- package/src/components/ChatContainer.tsx +0 -142
- package/src/components/Comments.stories.tsx +0 -93
- package/src/components/CommentsContainer.tsx +0 -72
- package/src/components/CommentsThreadContainer.tsx +0 -168
- package/src/components/Lobby/Lobby.tsx +0 -119
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -53
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/MessageContainer.tsx +0 -152
- package/src/components/Participant/Participant.tsx +0 -57
- package/src/components/Participant/ParticipantGrid.tsx +0 -89
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +0 -55
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +0 -31
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -131
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/components/ThreadSettings.tsx +0 -17
- package/src/components/command-extension.ts +0 -33
- package/src/components/testing.ts +0 -29
- package/src/extensions/index.ts +0 -5
- package/src/extensions/threads.ts +0 -126
- package/src/hooks/analytics.ts +0 -40
- package/src/hooks/useDebugMode.ts +0 -25
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
- package/src/hooks/useVideoStreamTrack.tsx +0 -33
- package/src/testing/index.ts +0 -5
- package/src/testing/stories.ts +0 -54
- package/src/types/schema.ts +0 -33
- package/src/types/types.ts +0 -119
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -30
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser/ChannelContainer-O2SFQJU7.mjs.map → 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/{browser/ChatContainer-PVT3DUZJ.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-B2ZGAE4P.mjs.map → neutral/operations/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChatContainer-2CT4PJ7I.mjs.map → neutral/types/index.mjs.map} +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Ref, Relation } from '@dxos/echo';
|
|
8
|
-
import { fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
9
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
|
-
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
13
|
-
import { MessageTextbox, type MessageTextboxProps, Thread, type ThreadRootProps } from '@dxos/react-ui-thread';
|
|
14
|
-
import { type AnchoredTo } from '@dxos/schema';
|
|
15
|
-
import { isNonNullable } from '@dxos/util';
|
|
16
|
-
|
|
17
|
-
import { useStatus } from '../hooks';
|
|
18
|
-
import { meta } from '../meta';
|
|
19
|
-
import { type ThreadType } from '../types';
|
|
20
|
-
import { getMessageMetadata } from '../util';
|
|
21
|
-
|
|
22
|
-
import { command } from './command-extension';
|
|
23
|
-
import { MessageContainer } from './MessageContainer';
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Remove need for p-1.
|
|
26
|
-
export const commentControlClassNames = '!p-1 transition-opacity';
|
|
27
|
-
|
|
28
|
-
export type CommentsThreadContainerProps = {
|
|
29
|
-
anchor: AnchoredTo;
|
|
30
|
-
onAttend?: (anchor: AnchoredTo) => void;
|
|
31
|
-
onComment?: (anchor: AnchoredTo, message: string) => void;
|
|
32
|
-
onResolve?: (anchor: AnchoredTo) => void;
|
|
33
|
-
onMessageDelete?: (anchor: AnchoredTo, messageId: string) => void;
|
|
34
|
-
onThreadDelete?: (anchor: AnchoredTo) => void;
|
|
35
|
-
} & Pick<ThreadRootProps, 'current'>;
|
|
36
|
-
|
|
37
|
-
export const CommentsThreadContainer = ({
|
|
38
|
-
anchor,
|
|
39
|
-
current,
|
|
40
|
-
onAttend,
|
|
41
|
-
onComment,
|
|
42
|
-
onResolve,
|
|
43
|
-
onMessageDelete,
|
|
44
|
-
onThreadDelete,
|
|
45
|
-
}: CommentsThreadContainerProps) => {
|
|
46
|
-
const { t } = useTranslation(meta.id);
|
|
47
|
-
const identity = useIdentity()!;
|
|
48
|
-
const space = getSpace(anchor);
|
|
49
|
-
const members = useMembers(space?.key);
|
|
50
|
-
const detached = !anchor.anchor;
|
|
51
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
52
|
-
const activity = useStatus(space, fullyQualifiedId(thread));
|
|
53
|
-
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
54
|
-
const { themeMode } = useThemeContext();
|
|
55
|
-
|
|
56
|
-
const textboxMetadata = getMessageMetadata(fullyQualifiedId(thread), identity);
|
|
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 messageRef = useRef('');
|
|
61
|
-
const extensions = useMemo(
|
|
62
|
-
() => [
|
|
63
|
-
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
64
|
-
createThemeExtensions({ themeMode }),
|
|
65
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
66
|
-
command,
|
|
67
|
-
],
|
|
68
|
-
[_count],
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
// TODO(thure): Factor out.
|
|
72
|
-
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
73
|
-
setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
74
|
-
|
|
75
|
-
const handleAttend = useCallback(() => onAttend?.(anchor), [onAttend, anchor]);
|
|
76
|
-
const handleResolve = useCallback(() => onResolve?.(anchor), [onResolve, anchor]);
|
|
77
|
-
const handleMessageDelete = useCallback((id: string) => onMessageDelete?.(anchor, id), [onMessageDelete, anchor]);
|
|
78
|
-
const handleThreadDelete = useCallback(() => onThreadDelete?.(anchor), [onThreadDelete, anchor]);
|
|
79
|
-
|
|
80
|
-
const handleComment: MessageTextboxProps['onSend'] = useCallback(() => {
|
|
81
|
-
if (!messageRef.current) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
onComment?.(anchor, messageRef.current);
|
|
86
|
-
messageRef.current = '';
|
|
87
|
-
scrollToEnd('instant');
|
|
88
|
-
rerenderEditor();
|
|
89
|
-
|
|
90
|
-
return true;
|
|
91
|
-
}, [anchor, identity]);
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<Thread.Root
|
|
95
|
-
id={fullyQualifiedId(thread)}
|
|
96
|
-
classNames='pbs-2 border-be border-subduedSeparator last:border-none'
|
|
97
|
-
current={current}
|
|
98
|
-
onClickCapture={handleAttend}
|
|
99
|
-
onFocusCapture={handleAttend}
|
|
100
|
-
>
|
|
101
|
-
<div
|
|
102
|
-
role='none'
|
|
103
|
-
className={mx(
|
|
104
|
-
'col-span-2 grid grid-cols-[var(--rail-size)_1fr_min-content]',
|
|
105
|
-
hoverableControls,
|
|
106
|
-
hoverableFocusedWithinControls,
|
|
107
|
-
)}
|
|
108
|
-
>
|
|
109
|
-
{detached ? (
|
|
110
|
-
<Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
|
|
111
|
-
<Thread.Header detached>{thread.name}</Thread.Header>
|
|
112
|
-
</Tooltip.Trigger>
|
|
113
|
-
) : (
|
|
114
|
-
<Thread.Header>{thread.name}</Thread.Header>
|
|
115
|
-
)}
|
|
116
|
-
<div className='flex flex-row items-center gap-0.5'>
|
|
117
|
-
{thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
|
|
118
|
-
{onResolve && !(thread?.status === 'staged') && (
|
|
119
|
-
<IconButton
|
|
120
|
-
data-testid='thread.resolve'
|
|
121
|
-
variant='ghost'
|
|
122
|
-
icon={thread?.status === 'resolved' ? 'ph--check--fill' : 'ph--check--regular'}
|
|
123
|
-
iconOnly
|
|
124
|
-
label={t('resolve thread label')}
|
|
125
|
-
classNames={[commentControlClassNames, thread?.status !== 'resolved' && hoverableControlItem]}
|
|
126
|
-
onClick={handleResolve}
|
|
127
|
-
/>
|
|
128
|
-
)}
|
|
129
|
-
{onThreadDelete && (
|
|
130
|
-
<IconButton
|
|
131
|
-
data-testid='thread.delete'
|
|
132
|
-
variant='ghost'
|
|
133
|
-
icon='ph--x--regular'
|
|
134
|
-
iconOnly
|
|
135
|
-
label={t('delete thread label')}
|
|
136
|
-
classNames={[commentControlClassNames, hoverableControlItem]}
|
|
137
|
-
onClick={handleThreadDelete}
|
|
138
|
-
/>
|
|
139
|
-
)}
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
{/** TODO(dmaretskyi): How's `thread.messages` undefined? */}
|
|
144
|
-
{Ref.Array.targets(thread.messages?.filter(isNonNullable) ?? []).map((message) => (
|
|
145
|
-
<MessageContainer
|
|
146
|
-
key={message.id}
|
|
147
|
-
editable
|
|
148
|
-
message={message}
|
|
149
|
-
members={members}
|
|
150
|
-
onDelete={handleMessageDelete}
|
|
151
|
-
/>
|
|
152
|
-
))}
|
|
153
|
-
|
|
154
|
-
{/*
|
|
155
|
-
TODO(wittjosiah): Can't autofocus this generally.
|
|
156
|
-
There can be multiple threads with inputs and they can't all be focused.
|
|
157
|
-
Also, it steals focus from documents when first rendered.
|
|
158
|
-
Need to find a way to autofocus in one scenario only: when a new thread is created.
|
|
159
|
-
*/}
|
|
160
|
-
<MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
|
|
161
|
-
|
|
162
|
-
<Thread.Status activity={activity}>{t('activity message')}</Thread.Status>
|
|
163
|
-
|
|
164
|
-
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
165
|
-
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
166
|
-
</Thread.Root>
|
|
167
|
-
);
|
|
168
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
|
|
11
|
-
import { ThreadCapabilities } from '../../capabilities';
|
|
12
|
-
import { meta } from '../../meta';
|
|
13
|
-
import { Toolbar, type ToolbarProps } from '../Call';
|
|
14
|
-
import { VideoObject } from '../Media';
|
|
15
|
-
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
16
|
-
|
|
17
|
-
// TODO(wittjosiah): Repurpose lobby for preview.
|
|
18
|
-
|
|
19
|
-
const SWARM_PEEK_INTERVAL = 1_000;
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Root
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
type LobbyRootProps = PropsWithChildren<ThemedClassName>;
|
|
26
|
-
|
|
27
|
-
const LobbyRoot: FC<LobbyRootProps> = ({ children }) => {
|
|
28
|
-
return <div className='relative flex flex-col grow overflow-hidden group'>{children}</div>;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
LobbyRoot.displayName = 'LobbyRoot';
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
// Preview
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
type LobbyPreviewProps = {};
|
|
38
|
-
|
|
39
|
-
const LobbyPreview: FC<LobbyPreviewProps> = () => {
|
|
40
|
-
const { t } = useTranslation(meta.id);
|
|
41
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
42
|
-
const [classNames, setClassNames] = useState('');
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (!call.media.videoEnabled) {
|
|
45
|
-
setClassNames('');
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Video element will expand once the stream is available.
|
|
50
|
-
const timeout = setTimeout(() => {
|
|
51
|
-
setClassNames('outline-neutral-900 opacity-100');
|
|
52
|
-
}, 500);
|
|
53
|
-
|
|
54
|
-
return () => clearTimeout(timeout);
|
|
55
|
-
}, [call.media.videoEnabled]);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<div className='grid grow p-4'>
|
|
59
|
-
<ResponsiveContainer>
|
|
60
|
-
{(call.media.videoEnabled && (
|
|
61
|
-
<VideoObject
|
|
62
|
-
videoStream={call.media.videoStream}
|
|
63
|
-
flip
|
|
64
|
-
muted
|
|
65
|
-
classNames={mx(
|
|
66
|
-
'rounded-md outline outline-2 outline-transparent opacity-0 transition-all duration-500',
|
|
67
|
-
classNames,
|
|
68
|
-
)}
|
|
69
|
-
/>
|
|
70
|
-
)) || <div className='p-4 outline outline-separator rounded-md'>{t('camera off label')}</div>}
|
|
71
|
-
</ResponsiveContainer>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
LobbyPreview.displayName = 'LobbyPreview';
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
// Toolbar
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
type LobbyToolbarProps = ThemedClassName<
|
|
83
|
-
{
|
|
84
|
-
roomId: string;
|
|
85
|
-
} & Pick<ToolbarProps, 'onJoin'>
|
|
86
|
-
>;
|
|
87
|
-
|
|
88
|
-
const LobbyToolbar: FC<LobbyToolbarProps> = ({ roomId, ...props }) => {
|
|
89
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
90
|
-
const [count, setCount] = useState<number>(0);
|
|
91
|
-
|
|
92
|
-
// TODO(wittjosiah): Leaving the room doesn't remove you from the swarm.
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
void call.peek(roomId).then((count) => setCount(count));
|
|
95
|
-
const interval = setInterval(() => {
|
|
96
|
-
void call.peek(roomId).then((count) => setCount(count));
|
|
97
|
-
}, SWARM_PEEK_INTERVAL);
|
|
98
|
-
|
|
99
|
-
return () => clearInterval(interval);
|
|
100
|
-
}, [call, roomId]);
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<div className='absolute bottom-0 left-0 right-0 flex justify-center'>
|
|
104
|
-
<Toolbar participants={count} isInRoom={false} {...props} />
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
LobbyToolbar.displayName = 'LobbyToolbar';
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
// Export
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
export const Lobby = {
|
|
116
|
-
Root: LobbyRoot,
|
|
117
|
-
Preview: LobbyPreview,
|
|
118
|
-
Toolbar: LobbyToolbar,
|
|
119
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useEffect, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
export type AudioStreamProps = {
|
|
8
|
-
tracks: MediaStreamTrack[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const AudioStream: FC<AudioStreamProps> = ({ tracks }) => {
|
|
12
|
-
const mediaStreamRef = useRef(new MediaStream());
|
|
13
|
-
const ref = useRef<HTMLAudioElement>(null);
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const audio = ref.current;
|
|
17
|
-
if (!audio) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const mediaStream = mediaStreamRef.current;
|
|
22
|
-
audio.srcObject = mediaStream;
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
|
-
const resetSrcObject = () => {
|
|
26
|
-
const audio = ref.current;
|
|
27
|
-
const mediaStream = mediaStreamRef.current;
|
|
28
|
-
if (!audio || !mediaStream) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Need to set srcObject again in Chrome and call play() again for Safari
|
|
33
|
-
// https://www.youtube.com/live/Tkx3OGrwVk8?si=K--P_AzNnAGrjraV&t=2533
|
|
34
|
-
// Calling play() this way to make Chrome happy otherwise it throws an error.
|
|
35
|
-
audio.addEventListener('canplay', () => audio.play(), { once: true });
|
|
36
|
-
audio.srcObject = mediaStream;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<>
|
|
41
|
-
<audio ref={ref} autoPlay />
|
|
42
|
-
{tracks.map((track) => (
|
|
43
|
-
<AudioTrack key={track.id} track={track} mediaStream={mediaStreamRef.current} resetSrcObject={resetSrcObject} />
|
|
44
|
-
))}
|
|
45
|
-
</>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type AudioTrackProps = {
|
|
50
|
-
track: MediaStreamTrack;
|
|
51
|
-
mediaStream: MediaStream;
|
|
52
|
-
resetSrcObject: () => void;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const AudioTrack = ({ track, mediaStream, resetSrcObject }: AudioTrackProps) => {
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
const currentTrack = track;
|
|
58
|
-
mediaStream.addTrack(currentTrack);
|
|
59
|
-
resetSrcObject();
|
|
60
|
-
return () => {
|
|
61
|
-
mediaStream.removeTrack(currentTrack);
|
|
62
|
-
resetSrcObject();
|
|
63
|
-
};
|
|
64
|
-
}, [track, mediaStream]);
|
|
65
|
-
|
|
66
|
-
return null;
|
|
67
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
-
import React, { useEffect, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { scheduleTask } from '@dxos/async';
|
|
11
|
-
import { Context } from '@dxos/context';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
|
-
|
|
15
|
-
import { getUserMediaTrack } from '../../calls';
|
|
16
|
-
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
17
|
-
|
|
18
|
-
import { VideoObject } from './VideoObject';
|
|
19
|
-
|
|
20
|
-
const meta: Meta<typeof VideoObject> = {
|
|
21
|
-
title: 'plugins/plugin-thread/VideoObject',
|
|
22
|
-
component: VideoObject,
|
|
23
|
-
render: (args) => {
|
|
24
|
-
log.info('render');
|
|
25
|
-
const [videoStream, setVideoStream] = useState<MediaStream>();
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const ctx = new Context();
|
|
28
|
-
scheduleTask(ctx, async () => {
|
|
29
|
-
const stream = new MediaStream();
|
|
30
|
-
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
31
|
-
setVideoStream(stream);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return () => {
|
|
35
|
-
void ctx.dispose();
|
|
36
|
-
videoStream?.getTracks().forEach((track) => track.stop());
|
|
37
|
-
};
|
|
38
|
-
}, []);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<ResponsiveContainer>
|
|
42
|
-
<VideoObject videoStream={videoStream} {...args} flip />
|
|
43
|
-
</ResponsiveContainer>
|
|
44
|
-
);
|
|
45
|
-
},
|
|
46
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default meta;
|
|
50
|
-
|
|
51
|
-
type Story = StoryObj<typeof VideoObject>;
|
|
52
|
-
|
|
53
|
-
export const SelfView: Story = {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type JSX, forwardRef, memo, useEffect, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
-
|
|
10
|
-
export type VideoObjectProps = Omit<JSX.IntrinsicElements['video'], 'className' | 'ref'> &
|
|
11
|
-
ThemedClassName<{
|
|
12
|
-
videoStream?: MediaStream;
|
|
13
|
-
flip?: boolean;
|
|
14
|
-
// TODO(burdon): If screenshare then contain.
|
|
15
|
-
contain?: boolean;
|
|
16
|
-
}>;
|
|
17
|
-
|
|
18
|
-
export const VideoObject = memo(
|
|
19
|
-
forwardRef<HTMLVideoElement, VideoObjectProps>(({ videoStream, classNames, flip, contain, ...rest }, ref) => {
|
|
20
|
-
const internalRef = useRef<HTMLVideoElement | null>(null);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
const video = internalRef.current;
|
|
24
|
-
if (video && videoStream) {
|
|
25
|
-
video.srcObject = videoStream;
|
|
26
|
-
video.setAttribute('autoplay', 'true');
|
|
27
|
-
video.setAttribute('playsinline', 'true');
|
|
28
|
-
}
|
|
29
|
-
}, [videoStream, internalRef.current]);
|
|
30
|
-
|
|
31
|
-
// NOTE: The video element typically has a max size of 1280x720.
|
|
32
|
-
return (
|
|
33
|
-
<video
|
|
34
|
-
className={mx(
|
|
35
|
-
'w-full aspect-video',
|
|
36
|
-
flip && 'scale-x-[-1]',
|
|
37
|
-
contain ? 'object-contain' : 'object-cover',
|
|
38
|
-
classNames,
|
|
39
|
-
)}
|
|
40
|
-
ref={(v) => {
|
|
41
|
-
internalRef.current = v;
|
|
42
|
-
if (ref === null) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (typeof ref === 'function') {
|
|
47
|
-
ref(v);
|
|
48
|
-
} else {
|
|
49
|
-
ref.current = v;
|
|
50
|
-
}
|
|
51
|
-
}}
|
|
52
|
-
{...rest}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
VideoObject.displayName = 'VideoObject';
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { EditorView } from '@codemirror/view';
|
|
6
|
-
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { type Obj, Ref, type Type } from '@dxos/echo';
|
|
10
|
-
import { PublicKey } from '@dxos/react-client';
|
|
11
|
-
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
12
|
-
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
13
|
-
import { IconButton, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';
|
|
15
|
-
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
16
|
-
import { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';
|
|
17
|
-
import { type DataType } from '@dxos/schema';
|
|
18
|
-
|
|
19
|
-
import { useOnEditAnalytics } from '../hooks';
|
|
20
|
-
import { meta } from '../meta';
|
|
21
|
-
import { getMessageMetadata } from '../util';
|
|
22
|
-
|
|
23
|
-
import { command } from './command-extension';
|
|
24
|
-
import { commentControlClassNames } from './CommentsThreadContainer';
|
|
25
|
-
|
|
26
|
-
export type MessageContainerProps = {
|
|
27
|
-
message: DataType.Message;
|
|
28
|
-
members: SpaceMember[];
|
|
29
|
-
editable?: boolean;
|
|
30
|
-
onDelete?: (id: string) => void;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const MessageContainer = ({ message, members, editable = false, onDelete }: MessageContainerProps) => {
|
|
34
|
-
const { t } = useTranslation(meta.id);
|
|
35
|
-
const senderIdentity = members.find(
|
|
36
|
-
(member) =>
|
|
37
|
-
(message.sender.identityDid && member.identity.did === message.sender.identityDid) ||
|
|
38
|
-
(message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),
|
|
39
|
-
)?.identity;
|
|
40
|
-
const messageMetadata = getMessageMetadata(message.id, senderIdentity);
|
|
41
|
-
const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;
|
|
42
|
-
const [editing, setEditing] = useState(false);
|
|
43
|
-
const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);
|
|
44
|
-
const textBlock = message.blocks.find((block) => block._tag === 'text');
|
|
45
|
-
const references = message.blocks.filter((block) => block._tag === 'reference').map((block) => block.reference);
|
|
46
|
-
|
|
47
|
-
useOnEditAnalytics(message, textBlock, !!editing);
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>
|
|
51
|
-
<MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>
|
|
52
|
-
<div className='flex flex-row items-center gap-0.5'>
|
|
53
|
-
{userIsAuthor && editable && (
|
|
54
|
-
<IconButton
|
|
55
|
-
data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}
|
|
56
|
-
variant='ghost'
|
|
57
|
-
icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}
|
|
58
|
-
iconOnly
|
|
59
|
-
label={t(editing ? 'save message label' : 'edit message label')}
|
|
60
|
-
classNames={[commentControlClassNames, hoverableControlItem]}
|
|
61
|
-
onClick={() => setEditing((editing) => !editing)}
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
{onDelete && (
|
|
65
|
-
<IconButton
|
|
66
|
-
data-testid='thread.message.delete'
|
|
67
|
-
variant='ghost'
|
|
68
|
-
icon='ph--x--regular'
|
|
69
|
-
iconOnly
|
|
70
|
-
label={t('delete message label')}
|
|
71
|
-
classNames={[commentControlClassNames, hoverableControlItem]}
|
|
72
|
-
onClick={() => handleDelete()}
|
|
73
|
-
/>
|
|
74
|
-
)}
|
|
75
|
-
</div>
|
|
76
|
-
</MessageHeading>
|
|
77
|
-
{textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}
|
|
78
|
-
{Ref.Array.targets(references).map((reference, index) => (
|
|
79
|
-
<MessagePart key={index} part={reference} />
|
|
80
|
-
))}
|
|
81
|
-
</MessageRoot>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const MessagePart = ({ part }: { part: Type.Expando }) => {
|
|
86
|
-
return <MessageBlockObjectTile subject={part} />;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const TextboxBlock = ({
|
|
90
|
-
block,
|
|
91
|
-
isAuthor,
|
|
92
|
-
editing,
|
|
93
|
-
}: {
|
|
94
|
-
block: DataType.MessageBlock.Text;
|
|
95
|
-
editing?: boolean;
|
|
96
|
-
isAuthor?: boolean;
|
|
97
|
-
identity?: Identity;
|
|
98
|
-
}) => {
|
|
99
|
-
const { themeMode } = useThemeContext();
|
|
100
|
-
const inMemoryContentRef = useRef(block.text);
|
|
101
|
-
|
|
102
|
-
const handleDocumentChange = useCallback((newState: string) => {
|
|
103
|
-
inMemoryContentRef.current = newState;
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
|
-
const saveDocumentChange = useCallback(() => {
|
|
107
|
-
block.text = inMemoryContentRef.current;
|
|
108
|
-
}, [block]);
|
|
109
|
-
|
|
110
|
-
useOnTransition(editing, true, false, saveDocumentChange);
|
|
111
|
-
|
|
112
|
-
const { parentRef, focusAttributes, view } = useTextEditor(
|
|
113
|
-
() => ({
|
|
114
|
-
initialValue: block.text,
|
|
115
|
-
extensions: [
|
|
116
|
-
createBasicExtensions({ readOnly: !isAuthor || !editing }),
|
|
117
|
-
createThemeExtensions({ themeMode }),
|
|
118
|
-
command,
|
|
119
|
-
EditorView.updateListener.of((update) => {
|
|
120
|
-
if (update.docChanged) {
|
|
121
|
-
handleDocumentChange(update.state.doc.toString());
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
],
|
|
125
|
-
}),
|
|
126
|
-
[block.text, editing, isAuthor, themeMode, handleDocumentChange],
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
editing && view?.focus();
|
|
131
|
-
}, [editing, view]);
|
|
132
|
-
|
|
133
|
-
return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(({ subject }, forwardedRef) => {
|
|
137
|
-
// TODO(burdon): Use annotation to get title.
|
|
138
|
-
let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';
|
|
139
|
-
if (typeof title !== 'string') {
|
|
140
|
-
title = title?.content ?? '';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<div
|
|
145
|
-
role='group'
|
|
146
|
-
className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}
|
|
147
|
-
ref={forwardedRef}
|
|
148
|
-
>
|
|
149
|
-
<Surface role='card' limit={1} data={{ subject }} fallback={title} />
|
|
150
|
-
</div>
|
|
151
|
-
);
|
|
152
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { memo, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { type EncodedTrackName, type UserState } from '../../calls';
|
|
10
|
-
import { ThreadCapabilities } from '../../capabilities';
|
|
11
|
-
import { VideoObject } from '../Media';
|
|
12
|
-
import { ResponsiveGridItem, type ResponsiveGridItemProps } from '../ResponsiveGrid';
|
|
13
|
-
|
|
14
|
-
export const SCREENSHARE_SUFFIX = '_screenshare';
|
|
15
|
-
|
|
16
|
-
export const Participant = memo(({ item: user, debug, ...props }: ResponsiveGridItemProps<UserState>) => {
|
|
17
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
18
|
-
const isSelf: boolean = call.self.id !== undefined && user.id !== undefined && user.id.startsWith(call.self.id);
|
|
19
|
-
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
20
|
-
const pulledVideoStream = call.getVideoStream(
|
|
21
|
-
isScreenshare || !isSelf ? (user.tracks?.video as EncodedTrackName) : undefined,
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const videoStream = useMemo<MediaStream | undefined>(() => {
|
|
25
|
-
if (isSelf && !isScreenshare) {
|
|
26
|
-
return call.media.videoStream;
|
|
27
|
-
} else if (isSelf && isScreenshare) {
|
|
28
|
-
return call.media.screenshareVideoStream;
|
|
29
|
-
} else if (!isSelf) {
|
|
30
|
-
return pulledVideoStream;
|
|
31
|
-
}
|
|
32
|
-
}, [isSelf, isScreenshare, call.media.videoStream, call.media.screenshareVideoStream, pulledVideoStream]);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<ResponsiveGridItem
|
|
36
|
-
{...props}
|
|
37
|
-
item={user}
|
|
38
|
-
name={user.name}
|
|
39
|
-
self={isSelf}
|
|
40
|
-
screenshare={!!call.media.screenshareVideoStream}
|
|
41
|
-
video={call.media.videoEnabled}
|
|
42
|
-
mute={user ? !user.tracks?.audioEnabled : false}
|
|
43
|
-
wave={user.raisedHand}
|
|
44
|
-
speaking={user.speaking}
|
|
45
|
-
debug={debug}
|
|
46
|
-
>
|
|
47
|
-
<VideoObject
|
|
48
|
-
videoStream={videoStream}
|
|
49
|
-
flip={isSelf && !isScreenshare}
|
|
50
|
-
contain={!!isScreenshare}
|
|
51
|
-
classNames='rounded-md'
|
|
52
|
-
/>
|
|
53
|
-
</ResponsiveGridItem>
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
Participant.displayName = 'Participant';
|