@dxos/plugin-thread 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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/README.md +1 -1
- package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs +28 -0
- package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs.map +7 -0
- package/dist/lib/neutral/ChannelChat-6YTD5HWL.mjs +10 -0
- package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs +208 -0
- package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs.map +7 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs +61 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +80 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs +24 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs +15 -0
- package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
- package/dist/lib/neutral/add-message-FBIROBEZ.mjs +87 -0
- package/dist/lib/neutral/add-message-FBIROBEZ.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs +120 -0
- package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-FTFAD3PK.mjs +40 -0
- package/dist/lib/neutral/append-channel-message-FTFAD3PK.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs +36 -0
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-K2DUJRFJ.mjs → neutral/chunk-7GHUS3IX.mjs} +4 -11
- package/dist/lib/neutral/chunk-7GHUS3IX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs +55 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-CP7E2HRE.mjs → neutral/chunk-JLY4NVTA.mjs} +12 -5
- package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KRXHIW4P.mjs +164 -0
- package/dist/lib/neutral/chunk-KRXHIW4P.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PE7IH7EL.mjs +271 -0
- package/dist/lib/neutral/chunk-PE7IH7EL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QFDT33VT.mjs +69 -0
- package/dist/lib/neutral/chunk-QFDT33VT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QMLVLKE3.mjs +8 -0
- package/dist/lib/neutral/chunk-QMLVLKE3.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +539 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +15 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-OAQJ6LXN.mjs +52 -0
- package/dist/lib/neutral/create-OAQJ6LXN.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-3E4FJ662.mjs +19 -0
- package/dist/lib/neutral/create-channel-3E4FJ662.mjs.map +7 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
- package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs +56 -0
- package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs.map +7 -0
- package/dist/lib/neutral/delete-HCCG5RVR.mjs +57 -0
- package/dist/lib/neutral/delete-HCCG5RVR.mjs.map +7 -0
- package/dist/lib/neutral/delete-message-DHFRACB4.mjs +54 -0
- package/dist/lib/neutral/delete-message-DHFRACB4.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +10 -0
- package/dist/lib/neutral/index.mjs +28 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs +83 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/on-create-space-OEBRKOAM.mjs +23 -0
- package/dist/lib/neutral/on-create-space-OEBRKOAM.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-XY23GVZH.mjs +76 -0
- package/dist/lib/neutral/react-surface-XY23GVZH.mjs.map +7 -0
- package/dist/lib/neutral/restore-P4ZLXLF7.mjs +32 -0
- package/dist/lib/neutral/restore-P4ZLXLF7.mjs.map +7 -0
- package/dist/lib/neutral/restore-message-AUBOP2DF.mjs +33 -0
- package/dist/lib/neutral/restore-message-AUBOP2DF.mjs.map +7 -0
- package/dist/lib/neutral/select-LIVAMBCE.mjs +24 -0
- package/dist/lib/neutral/select-LIVAMBCE.mjs.map +7 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +58 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/toggle-resolved-RQBDQZSV.mjs +36 -0
- package/dist/lib/neutral/toggle-resolved-RQBDQZSV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +90 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -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/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/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 +15 -15
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -5
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +51 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts +14 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +15 -0
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
- package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +13 -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/ChannelChat/ChannelChat.d.ts +20 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +8 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
- package/dist/types/src/extensions/command.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +1 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +9 -4
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts +2 -3
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +5 -0
- package/dist/types/src/operations/add-message.d.ts.map +1 -0
- package/dist/types/src/operations/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/create-proposals.d.ts +5 -0
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/delete-message.d.ts +5 -0
- package/dist/types/src/operations/delete-message.d.ts.map +1 -0
- package/dist/types/src/operations/delete.d.ts +5 -0
- package/dist/types/src/operations/delete.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/restore-message.d.ts +5 -0
- package/dist/types/src/operations/restore-message.d.ts.map +1 -0
- package/dist/types/src/operations/restore.d.ts +5 -0
- package/dist/types/src/operations/restore.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{components/testing.d.ts → testing/data.d.ts} +2 -2
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +140 -138
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +5 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts +13 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ThreadOperation.d.ts +1995 -0
- package/dist/types/src/types/ThreadOperation.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/types/types.d.ts +2 -442
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +151 -86
- package/src/ThreadPlugin.node.ts +39 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +43 -130
- package/src/ThreadPlugin.workerd.ts +20 -0
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +36 -0
- package/src/capabilities/app-graph-builder.ts +124 -167
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +15 -12
- package/src/capabilities/markdown.ts +53 -36
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +64 -78
- package/src/capabilities/settings.ts +26 -12
- package/src/capabilities/state.ts +14 -18
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Chat/Chat.tsx +258 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +95 -0
- package/src/components/{CommentsContainer.tsx → CommentsPanel/CommentsPanel.tsx} +19 -20
- package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +44 -47
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +83 -47
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +19 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +5 -12
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +105 -0
- package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
- package/src/containers/ChannelArticle/index.ts +5 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +215 -0
- package/src/containers/ThreadCompanion/index.ts +5 -0
- package/src/{components/Chat.stories.tsx → containers/ThreadContainer/ThreadContainer.stories.tsx} +27 -26
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +10 -0
- package/src/{components/command-extension.ts → extensions/command.ts} +3 -3
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +84 -39
- package/src/hooks/analytics.ts +22 -21
- package/src/hooks/index.ts +0 -4
- package/src/index.ts +4 -4
- package/src/meta.ts +5 -6
- package/src/operations/add-message.ts +81 -0
- package/src/operations/append-channel-message.ts +37 -0
- package/src/operations/create-channel.ts +20 -0
- package/src/operations/create-proposals.ts +49 -0
- package/src/operations/create.ts +48 -0
- package/src/operations/delete-message.ts +53 -0
- package/src/operations/delete.ts +63 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/on-create-space.ts +27 -0
- package/src/operations/restore-message.ts +38 -0
- package/src/operations/restore.ts +38 -0
- package/src/operations/select.ts +24 -0
- package/src/operations/toggle-resolved.ts +41 -0
- package/src/plugin.ts +11 -0
- package/src/{components/testing.ts → testing/data.ts} +10 -12
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +74 -76
- package/src/types/Settings.ts +10 -0
- package/src/types/ThreadCapabilities.ts +26 -0
- package/src/types/ThreadOperation.ts +178 -0
- package/src/types/index.ts +4 -2
- package/src/types/types.ts +3 -109
- package/src/util.ts +37 -5
- package/dist/lib/browser/ChannelContainer-SVV4ZX5T.mjs +0 -16
- package/dist/lib/browser/ChatContainer-ALFWQ65B.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-ACBXRBOS.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-ACBXRBOS.mjs.map +0 -7
- package/dist/lib/browser/call-manager-P3MYR2JS.mjs +0 -24
- package/dist/lib/browser/call-manager-P3MYR2JS.mjs.map +0 -7
- package/dist/lib/browser/chunk-6CUDBEYP.mjs +0 -377
- package/dist/lib/browser/chunk-6CUDBEYP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BBTXGRIR.mjs +0 -18
- package/dist/lib/browser/chunk-BBTXGRIR.mjs.map +0 -7
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +0 -7
- package/dist/lib/browser/chunk-DJOUMWEL.mjs +0 -988
- package/dist/lib/browser/chunk-DJOUMWEL.mjs.map +0 -7
- package/dist/lib/browser/chunk-HDEQRBOC.mjs +0 -181
- package/dist/lib/browser/chunk-HDEQRBOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQSXEHOW.mjs +0 -618
- package/dist/lib/browser/chunk-IQSXEHOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-K2DUJRFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L6F2AG6W.mjs +0 -23
- package/dist/lib/browser/chunk-L6F2AG6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-US5ZQYC3.mjs +0 -1793
- package/dist/lib/browser/chunk-US5ZQYC3.mjs.map +0 -7
- package/dist/lib/browser/chunk-UTSLSZED.mjs +0 -178
- package/dist/lib/browser/chunk-UTSLSZED.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYUJXHYV.mjs +0 -106
- package/dist/lib/browser/chunk-XYUJXHYV.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -313
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5POQTZ24.mjs +0 -419
- package/dist/lib/browser/intent-resolver-5POQTZ24.mjs.map +0 -7
- package/dist/lib/browser/markdown-L7LDNF56.mjs +0 -169
- package/dist/lib/browser/markdown-L7LDNF56.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-root-RCJLK4EP.mjs +0 -28
- package/dist/lib/browser/react-root-RCJLK4EP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IC576W2W.mjs +0 -109
- package/dist/lib/browser/react-surface-IC576W2W.mjs.map +0 -7
- package/dist/lib/browser/settings-5FYGBOGI.mjs +0 -22
- package/dist/lib/browser/settings-5FYGBOGI.mjs.map +0 -7
- package/dist/lib/browser/state-36REWXO5.mjs +0 -34
- package/dist/lib/browser/state-36REWXO5.mjs.map +0 -7
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs +0 -74
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/ChannelContainer-63GMQ753.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-MFKPXMIK.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-JXD7KY3G.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-JXD7KY3G.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-FCEFP7EJ.mjs +0 -25
- package/dist/lib/node-esm/call-manager-FCEFP7EJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs +0 -182
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs +0 -108
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs +0 -33
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AFDO2SUZ.mjs +0 -25
- package/dist/lib/node-esm/chunk-AFDO2SUZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KGYDYYKJ.mjs +0 -1794
- package/dist/lib/node-esm/chunk-KGYDYYKJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NWUUMKVQ.mjs +0 -378
- package/dist/lib/node-esm/chunk-NWUUMKVQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q7AKKZNY.mjs +0 -619
- package/dist/lib/node-esm/chunk-Q7AKKZNY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QCQAAU6J.mjs +0 -989
- package/dist/lib/node-esm/chunk-QCQAAU6J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs +0 -179
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs +0 -28
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs +0 -19
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -314
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-63NV3XD2.mjs +0 -420
- package/dist/lib/node-esm/intent-resolver-63NV3XD2.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-ZQW7MI5U.mjs +0 -170
- package/dist/lib/node-esm/markdown-ZQW7MI5U.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs +0 -29
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-O4LGTAZ3.mjs +0 -110
- package/dist/lib/node-esm/react-surface-O4LGTAZ3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-EOBQUZSW.mjs +0 -23
- package/dist/lib/node-esm/settings-EOBQUZSW.mjs.map +0 -7
- package/dist/lib/node-esm/state-X3W67GTL.mjs +0 -35
- package/dist/lib/node-esm/state-X3W67GTL.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-X2KA4FNC.mjs +0 -75
- package/dist/lib/node-esm/toolkit-X2KA4FNC.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- 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 -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/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/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -24
- package/dist/types/src/capabilities/toolkit.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 -15
- 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 -160
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -160
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -18
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -158
- package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsContainer.d.ts +0 -13
- package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +0 -14
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/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/MessageContainer.d.ts +0 -14
- 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 -162
- 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 -176
- 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.map +0 -1
- package/dist/types/src/components/testing.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/testing/stories.d.ts +0 -2
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -16
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/dist/types/src/types/Thread.d.ts +0 -167
- package/dist/types/src/types/Thread.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 -375
- 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 -581
- 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 -229
- package/src/capabilities/call-manager.ts +0 -20
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -344
- package/src/capabilities/react-root.tsx +0 -17
- package/src/capabilities/toolkit.ts +0 -85
- 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 -174
- package/src/components/CallSidebar.tsx +0 -18
- package/src/components/ChannelContainer.stories.tsx +0 -59
- package/src/components/ChannelContainer.tsx +0 -204
- package/src/components/ChatContainer.tsx +0 -154
- package/src/components/Comments.stories.tsx +0 -91
- 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 -60
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/Participant/Participant.tsx +0 -63
- package/src/components/Participant/ParticipantGrid.tsx +0 -89
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +0 -54
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +0 -31
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -158
- 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 -181
- package/src/components/ThreadSettings.tsx +0 -16
- 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/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -27
- package/src/types/Thread.ts +0 -26
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser/ChannelContainer-SVV4ZX5T.mjs.map → neutral/ChannelChat-6YTD5HWL.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser/ChatContainer-ALFWQ65B.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-63GMQ753.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChatContainer-MFKPXMIK.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { type Space, fullyQualifiedId, useMembers } from '@dxos/react-client/echo';
|
|
9
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
-
import {
|
|
15
|
-
MessageTextbox,
|
|
16
|
-
type MessageTextboxProps,
|
|
17
|
-
Thread as ThreadComponent,
|
|
18
|
-
type ThreadRootProps,
|
|
19
|
-
threadLayout,
|
|
20
|
-
} from '@dxos/react-ui-thread';
|
|
21
|
-
import { DataType } from '@dxos/schema';
|
|
22
|
-
import { isNonNullable } from '@dxos/util';
|
|
23
|
-
|
|
24
|
-
import { useStatus } from '../hooks';
|
|
25
|
-
import { meta } from '../meta';
|
|
26
|
-
import { type Thread } from '../types';
|
|
27
|
-
import { getMessageMetadata } from '../util';
|
|
28
|
-
|
|
29
|
-
import { command } from './command-extension';
|
|
30
|
-
import { MessageContainer } from './MessageContainer';
|
|
31
|
-
|
|
32
|
-
export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
33
|
-
const { t } = useTranslation(meta.id);
|
|
34
|
-
return (
|
|
35
|
-
<div role='none' className='flex items-center'>
|
|
36
|
-
<StackItem.SigilButton attendableId={attendableId}>
|
|
37
|
-
<Icon icon='ph--chat--regular' size={5} />
|
|
38
|
-
</StackItem.SigilButton>
|
|
39
|
-
<StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type ChatContainerProps = ThemedClassName<
|
|
45
|
-
{
|
|
46
|
-
space: Space;
|
|
47
|
-
thread: Thread.Thread;
|
|
48
|
-
context?: Obj.Any;
|
|
49
|
-
autoFocusTextbox?: boolean;
|
|
50
|
-
} & Pick<ThreadRootProps, 'current'>
|
|
51
|
-
>;
|
|
52
|
-
|
|
53
|
-
export const ChatContainer = ({
|
|
54
|
-
classNames,
|
|
55
|
-
space,
|
|
56
|
-
thread,
|
|
57
|
-
context,
|
|
58
|
-
current,
|
|
59
|
-
autoFocusTextbox,
|
|
60
|
-
}: ChatContainerProps) => {
|
|
61
|
-
const { t } = useTranslation(meta.id);
|
|
62
|
-
const id = fullyQualifiedId(thread);
|
|
63
|
-
const identity = useIdentity()!;
|
|
64
|
-
const members = useMembers(space?.key);
|
|
65
|
-
const activity = useStatus(space, id);
|
|
66
|
-
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
67
|
-
const [_count, _setCount] = useState(0);
|
|
68
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
69
|
-
const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
|
|
70
|
-
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
71
|
-
const { themeMode } = useThemeContext();
|
|
72
|
-
|
|
73
|
-
const textboxMetadata = getMessageMetadata(id, identity);
|
|
74
|
-
const messageRef = useRef('');
|
|
75
|
-
const extensions = useMemo(
|
|
76
|
-
() => [
|
|
77
|
-
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
78
|
-
createThemeExtensions({ themeMode }),
|
|
79
|
-
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
80
|
-
command,
|
|
81
|
-
],
|
|
82
|
-
[themeMode, _count],
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
// TODO(thure): Factor out.
|
|
86
|
-
// TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using
|
|
87
|
-
// `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient
|
|
88
|
-
// for the desired effect; this is likely hardware-dependent and should be reevaluated.
|
|
89
|
-
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
90
|
-
setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
91
|
-
|
|
92
|
-
useLayoutEffect(() => {
|
|
93
|
-
scrollToEnd('instant');
|
|
94
|
-
}, []);
|
|
95
|
-
|
|
96
|
-
// TODO(burdon): Change to model.
|
|
97
|
-
const handleCreate: MessageTextboxProps['onSend'] = () => {
|
|
98
|
-
if (!messageRef.current?.length) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
thread.messages.push(
|
|
103
|
-
Ref.make(
|
|
104
|
-
Obj.make(DataType.Message, {
|
|
105
|
-
created: new Date().toISOString(),
|
|
106
|
-
sender: { identityDid: identity.did },
|
|
107
|
-
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
108
|
-
properties: context ? { context: Ref.make(context) } : undefined,
|
|
109
|
-
}),
|
|
110
|
-
),
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
messageRef.current = '';
|
|
114
|
-
setAutoFocus(true);
|
|
115
|
-
scrollToEnd('smooth');
|
|
116
|
-
rerenderEditor();
|
|
117
|
-
return true;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<ThreadComponent.Root
|
|
122
|
-
current={current}
|
|
123
|
-
id={id}
|
|
124
|
-
classNames={[
|
|
125
|
-
'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',
|
|
126
|
-
'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',
|
|
127
|
-
classNames,
|
|
128
|
-
]}
|
|
129
|
-
>
|
|
130
|
-
<ScrollArea.Root classNames='col-span-2'>
|
|
131
|
-
<ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>
|
|
132
|
-
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
133
|
-
{thread.messages
|
|
134
|
-
.map((message) => message.target)
|
|
135
|
-
.filter(isNonNullable)
|
|
136
|
-
.map((message) => (
|
|
137
|
-
<MessageContainer key={message.id} message={message} members={members} />
|
|
138
|
-
))}
|
|
139
|
-
</div>
|
|
140
|
-
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
141
|
-
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
142
|
-
<ScrollArea.Scrollbar>
|
|
143
|
-
<ScrollArea.Thumb />
|
|
144
|
-
</ScrollArea.Scrollbar>
|
|
145
|
-
</ScrollArea.Viewport>
|
|
146
|
-
</ScrollArea.Root>
|
|
147
|
-
|
|
148
|
-
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
149
|
-
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
150
|
-
</ThreadComponent.Root>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export default ChatContainer;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { Obj, Query, Relation, Type } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
-
import { faker } from '@dxos/random';
|
|
13
|
-
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
14
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
-
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
18
|
-
import { render } from '@dxos/storybook-utils';
|
|
19
|
-
|
|
20
|
-
import { translations } from '../translations';
|
|
21
|
-
import { Thread } from '../types';
|
|
22
|
-
|
|
23
|
-
import { CommentsContainer } from './CommentsContainer';
|
|
24
|
-
import { createCommentThread, createProposalThread } from './testing';
|
|
25
|
-
|
|
26
|
-
faker.seed(1);
|
|
27
|
-
|
|
28
|
-
const DefaultStory = () => {
|
|
29
|
-
const identity = useIdentity();
|
|
30
|
-
const space = useSpace();
|
|
31
|
-
const anchors = useQuery(space, Query.type(AnchoredTo));
|
|
32
|
-
|
|
33
|
-
useAsyncEffect(async () => {
|
|
34
|
-
if (identity && space) {
|
|
35
|
-
const object = space.db.add(Obj.make(Type.Expando, {}));
|
|
36
|
-
const thread1 = space.db.add(createCommentThread(identity));
|
|
37
|
-
const thread2 = space.db.add(createProposalThread(identity));
|
|
38
|
-
space.db.add(
|
|
39
|
-
Relation.make(AnchoredTo, {
|
|
40
|
-
[Relation.Source]: thread1,
|
|
41
|
-
[Relation.Target]: object,
|
|
42
|
-
anchor: 'test',
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
45
|
-
space.db.add(
|
|
46
|
-
Relation.make(AnchoredTo, {
|
|
47
|
-
[Relation.Source]: thread2,
|
|
48
|
-
[Relation.Target]: object,
|
|
49
|
-
anchor: 'test',
|
|
50
|
-
}),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}, [identity, space]);
|
|
54
|
-
|
|
55
|
-
if (!identity || !space || !anchors) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return <CommentsContainer anchors={anchors} onThreadDelete={console.log} onAcceptProposal={console.log} />;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const meta = {
|
|
63
|
-
title: 'plugins/plugin-thread/Comments',
|
|
64
|
-
render: render(DefaultStory),
|
|
65
|
-
decorators: [
|
|
66
|
-
withTheme,
|
|
67
|
-
withLayout({ container: 'column', scroll: true }),
|
|
68
|
-
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
69
|
-
// Currently this is required due to useOnEditAnalytics.
|
|
70
|
-
withPluginManager({
|
|
71
|
-
plugins: [
|
|
72
|
-
IntentPlugin(),
|
|
73
|
-
ClientPlugin({
|
|
74
|
-
types: [DataType.Message, Thread.Thread, AnchoredTo],
|
|
75
|
-
onClientInitialized: async ({ client }) => {
|
|
76
|
-
await client.halo.createIdentity();
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
|
-
],
|
|
80
|
-
}),
|
|
81
|
-
],
|
|
82
|
-
parameters: {
|
|
83
|
-
translations,
|
|
84
|
-
},
|
|
85
|
-
} satisfies Meta<typeof DefaultStory>;
|
|
86
|
-
|
|
87
|
-
export default meta;
|
|
88
|
-
|
|
89
|
-
type Story = StoryObj<typeof meta>;
|
|
90
|
-
|
|
91
|
-
export const Default: Story = {};
|
|
@@ -1,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,60 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React, { useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { scheduleTask } from '@dxos/async';
|
|
9
|
-
import { Context } from '@dxos/context';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
11
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
|
-
|
|
13
|
-
import { getUserMediaTrack } from '../../calls';
|
|
14
|
-
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
15
|
-
|
|
16
|
-
import { VideoObject, type VideoObjectProps } from './VideoObject';
|
|
17
|
-
|
|
18
|
-
const DefaultStory = (props: VideoObjectProps) => {
|
|
19
|
-
log.info('render');
|
|
20
|
-
const [videoStream, setVideoStream] = useState<MediaStream>();
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const ctx = new Context();
|
|
23
|
-
scheduleTask(ctx, async () => {
|
|
24
|
-
try {
|
|
25
|
-
const stream = new MediaStream();
|
|
26
|
-
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
27
|
-
setVideoStream(stream);
|
|
28
|
-
} catch (err) {
|
|
29
|
-
log.catch(err);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return () => {
|
|
34
|
-
void ctx.dispose();
|
|
35
|
-
videoStream?.getTracks().forEach((track) => track.stop());
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<ResponsiveContainer>
|
|
41
|
-
<VideoObject videoStream={videoStream} flip {...props} />
|
|
42
|
-
</ResponsiveContainer>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const meta = {
|
|
47
|
-
title: 'plugins/plugin-thread/VideoObject',
|
|
48
|
-
component: VideoObject,
|
|
49
|
-
render: DefaultStory,
|
|
50
|
-
decorators: [withTheme],
|
|
51
|
-
parameters: {
|
|
52
|
-
layout: 'fullscreen',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default meta;
|
|
57
|
-
|
|
58
|
-
type Story = StoryObj<typeof VideoObject>;
|
|
59
|
-
|
|
60
|
-
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,63 +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
|
-
|
|
21
|
-
const pulledVideoStream =
|
|
22
|
-
!isSelf && isScreenshare && user.tracks?.screenshareEnabled
|
|
23
|
-
? call.getVideoStream(user.tracks?.screenshare as EncodedTrackName)
|
|
24
|
-
: !isSelf && !isScreenshare && user.tracks?.videoEnabled
|
|
25
|
-
? call.getVideoStream(user.tracks?.video as EncodedTrackName)
|
|
26
|
-
: undefined;
|
|
27
|
-
|
|
28
|
-
const videoStream = useMemo<MediaStream | undefined>(() => {
|
|
29
|
-
if (isSelf) {
|
|
30
|
-
if (isScreenshare) {
|
|
31
|
-
return call.media.screenshareVideoStream;
|
|
32
|
-
} else if (!isScreenshare) {
|
|
33
|
-
return call.media.videoStream;
|
|
34
|
-
}
|
|
35
|
-
} else if (!isSelf) {
|
|
36
|
-
return pulledVideoStream;
|
|
37
|
-
}
|
|
38
|
-
}, [isSelf, isScreenshare, call.media.videoStream, call.media.screenshareVideoStream, pulledVideoStream]);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<ResponsiveGridItem
|
|
42
|
-
{...props}
|
|
43
|
-
item={user}
|
|
44
|
-
name={user.name}
|
|
45
|
-
self={isSelf}
|
|
46
|
-
screenshare={!!call.media.screenshareVideoStream}
|
|
47
|
-
video={call.media.videoEnabled}
|
|
48
|
-
mute={user ? !user.tracks?.audioEnabled : false}
|
|
49
|
-
wave={user.raisedHand}
|
|
50
|
-
speaking={user.speaking}
|
|
51
|
-
debug={debug}
|
|
52
|
-
>
|
|
53
|
-
<VideoObject
|
|
54
|
-
videoStream={videoStream}
|
|
55
|
-
flip={isSelf && !isScreenshare}
|
|
56
|
-
contain={!!isScreenshare}
|
|
57
|
-
classNames='rounded-md'
|
|
58
|
-
/>
|
|
59
|
-
</ResponsiveGridItem>
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
Participant.displayName = 'Participant';
|