@dxos/plugin-thread 0.8.4-main.abd8ff62ef → 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/{browser/add-message-LRVGIHDH.mjs → neutral/add-message-FBIROBEZ.mjs} +8 -10
- 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/{browser/append-channel-message-CO3M6FSA.mjs → neutral/append-channel-message-FTFAD3PK.mjs} +5 -5
- 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/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +4 -5
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7GHUS3IX.mjs +20 -0
- 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-JLY4NVTA.mjs +38 -0
- 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/{browser/chunk-TPNZ43NB.mjs → neutral/chunk-PE7IH7EL.mjs} +86 -73
- 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/{browser/create-BTGLHLBA.mjs → neutral/create-OAQJ6LXN.mjs} +7 -10
- package/dist/lib/neutral/create-OAQJ6LXN.mjs.map +7 -0
- package/dist/lib/{browser/create-channel-ZXKSLHGN.mjs → neutral/create-channel-3E4FJ662.mjs} +4 -4
- 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/{browser/create-proposals-AV5CREPV.mjs → neutral/create-proposals-GRYZXRMV.mjs} +4 -4
- package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs.map +7 -0
- package/dist/lib/{browser/delete-GLYEP7NE.mjs → neutral/delete-HCCG5RVR.mjs} +7 -9
- package/dist/lib/neutral/delete-HCCG5RVR.mjs.map +7 -0
- package/dist/lib/{browser/delete-message-RQ72ZY5D.mjs → neutral/delete-message-DHFRACB4.mjs} +6 -7
- 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/index.mjs.map +7 -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/meta.mjs.map +7 -0
- package/dist/lib/{browser/on-create-space-SPE3QVFZ.mjs → neutral/on-create-space-OEBRKOAM.mjs} +5 -6
- 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/{browser/restore-VX7FLZOZ.mjs → neutral/restore-P4ZLXLF7.mjs} +5 -5
- package/dist/lib/neutral/restore-P4ZLXLF7.mjs.map +7 -0
- package/dist/lib/{browser/restore-message-D65NSWUA.mjs → neutral/restore-message-AUBOP2DF.mjs} +5 -5
- package/dist/lib/neutral/restore-message-AUBOP2DF.mjs.map +7 -0
- package/dist/lib/{browser/select-AT4L7EBU.mjs → neutral/select-LIVAMBCE.mjs} +6 -8
- 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/{browser/toggle-resolved-JD3D4WBZ.mjs → neutral/toggle-resolved-RQBDQZSV.mjs} +5 -5
- package/dist/lib/neutral/toggle-resolved-RQBDQZSV.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/translations.mjs +2 -2
- 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.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -1
- 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/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 +7 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +8 -1
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- 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/{ChannelContainer/ChannelContainer.stories.d.ts → ChannelArticle/ChannelArticle.stories.d.ts} +4 -4
- 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/{CallDebugPanel → ChannelArticle}/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -3
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +1 -1
- package/dist/types/src/extensions/threads.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/index.d.ts +3 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +2 -2
- package/dist/types/src/operations/add-message.d.ts.map +1 -1
- package/dist/types/src/operations/append-channel-message.d.ts +2 -2
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -1
- package/dist/types/src/operations/create-channel.d.ts +2 -2
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/create-proposals.d.ts +2 -2
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +2 -2
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/delete-message.d.ts +2 -2
- package/dist/types/src/operations/delete-message.d.ts.map +1 -1
- package/dist/types/src/operations/delete.d.ts +2 -2
- package/dist/types/src/operations/delete.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +2 -2
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/restore-message.d.ts +2 -2
- package/dist/types/src/operations/restore-message.d.ts.map +1 -1
- package/dist/types/src/operations/restore.d.ts +2 -2
- package/dist/types/src/operations/restore.d.ts.map +1 -1
- package/dist/types/src/operations/select.d.ts +2 -2
- package/dist/types/src/operations/select.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +2 -2
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
- 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.map +1 -1
- 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/{operations/definitions.d.ts → types/ThreadOperation.d.ts} +1 -1
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +123 -99
- package/src/ThreadPlugin.node.ts +5 -50
- package/src/ThreadPlugin.test.ts +3 -3
- package/src/ThreadPlugin.tsx +6 -59
- package/src/ThreadPlugin.workerd.ts +20 -0
- package/src/blueprints/thread-blueprint.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +18 -69
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +1 -2
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/react-surface.tsx +4 -26
- package/src/capabilities/settings.ts +1 -3
- package/src/capabilities/undo-mappings.ts +1 -1
- package/src/components/Chat/Chat.tsx +52 -12
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +1 -1
- package/src/components/CommentsPanel/CommentsPanel.tsx +4 -4
- package/src/components/CommentsPanel/CommentsThread.tsx +2 -3
- package/src/components/MessagePanel/MessagePanel.tsx +7 -8
- package/src/components/ThreadSettings/ThreadSettings.tsx +0 -1
- package/src/components/index.ts +0 -1
- package/src/containers/{ChannelContainer/ChannelContainer.stories.tsx → ChannelArticle/ChannelArticle.stories.tsx} +10 -10
- package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
- package/src/containers/ChannelArticle/index.ts +5 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +12 -2
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +10 -12
- package/src/containers/index.ts +1 -3
- package/src/extensions/command.ts +1 -1
- package/src/extensions/threads.ts +2 -2
- package/src/hooks/analytics.ts +1 -1
- package/src/hooks/index.ts +0 -5
- package/src/index.ts +3 -10
- package/src/meta.ts +1 -2
- package/src/operations/add-message.ts +4 -4
- package/src/operations/append-channel-message.ts +20 -19
- package/src/operations/create-channel.ts +2 -2
- package/src/operations/create-proposals.ts +2 -2
- package/src/operations/create.ts +3 -3
- package/src/operations/delete-message.ts +4 -4
- package/src/operations/delete.ts +3 -3
- package/src/operations/index.ts +0 -2
- package/src/operations/on-create-space.ts +3 -3
- package/src/operations/restore-message.ts +3 -3
- package/src/operations/restore.ts +3 -3
- package/src/operations/select.ts +2 -2
- package/src/operations/toggle-resolved.ts +3 -3
- package/src/plugin.ts +11 -0
- package/src/translations.ts +2 -2
- package/src/types/ThreadCapabilities.ts +26 -0
- package/src/{operations/definitions.ts → types/ThreadOperation.ts} +5 -4
- package/src/types/index.ts +4 -1
- package/src/types/types.ts +0 -2
- package/src/util.ts +36 -4
- package/dist/lib/browser/add-message-LRVGIHDH.mjs.map +0 -7
- package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-E4GG3NX2.mjs +0 -29
- package/dist/lib/browser/chunk-E4GG3NX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-TPNZ43NB.mjs.map +0 -7
- package/dist/lib/browser/create-BTGLHLBA.mjs.map +0 -7
- package/dist/lib/browser/create-channel-ZXKSLHGN.mjs.map +0 -7
- package/dist/lib/browser/create-proposals-AV5CREPV.mjs.map +0 -7
- package/dist/lib/browser/delete-GLYEP7NE.mjs.map +0 -7
- package/dist/lib/browser/delete-message-RQ72ZY5D.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1821
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/restore-VX7FLZOZ.mjs.map +0 -7
- package/dist/lib/browser/restore-message-D65NSWUA.mjs.map +0 -7
- package/dist/lib/browser/select-AT4L7EBU.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs.map +0 -7
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs +0 -90
- package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs.map +0 -7
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs +0 -41
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -38
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs +0 -30
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-XKUMDYGR.mjs +0 -259
- package/dist/lib/node-esm/chunk-XKUMDYGR.mjs.map +0 -7
- package/dist/lib/node-esm/create-DEZFPN2Y.mjs +0 -56
- package/dist/lib/node-esm/create-DEZFPN2Y.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs +0 -20
- package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs +0 -57
- package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs.map +0 -7
- package/dist/lib/node-esm/delete-QG45QLPY.mjs +0 -60
- package/dist/lib/node-esm/delete-QG45QLPY.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs +0 -56
- package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -1822
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs +0 -25
- package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/restore-E27OAIFJ.mjs +0 -33
- package/dist/lib/node-esm/restore-E27OAIFJ.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs +0 -34
- package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs.map +0 -7
- package/dist/lib/node-esm/select-UU6Q2XAB.mjs +0 -27
- package/dist/lib/node-esm/select-UU6Q2XAB.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs +0 -37
- package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs.map +0 -7
- package/dist/lib/node-esm/translations.mjs +0 -91
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/calls/call-manager.d.ts +0 -87
- package/dist/types/src/calls/call-manager.d.ts.map +0 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
- package/dist/types/src/calls/index.d.ts +0 -7
- package/dist/types/src/calls/index.d.ts.map +0 -1
- package/dist/types/src/calls/media-manager.d.ts +0 -60
- package/dist/types/src/calls/media-manager.d.ts.map +0 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -21
- 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 -6
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -9
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/components/Call/Call.d.ts +0 -45
- 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/Lobby/Lobby.d.ts +0 -36
- 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/Participant/Participant.d.ts +0 -6
- package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
- package/dist/types/src/components/Participant/index.d.ts +0 -3
- package/dist/types/src/components/Participant/index.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -178
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts +0 -12
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +0 -164
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -2
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/containers/CallSidebar/index.d.ts +0 -2
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
- package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -25
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/calls/call-manager.ts +0 -270
- package/src/calls/call-swarm-synchronizer.ts +0 -350
- package/src/calls/index.ts +0 -10
- package/src/calls/media-manager.ts +0 -378
- package/src/calls/speaking-monitor.ts +0 -85
- package/src/calls/types.ts +0 -74
- package/src/calls/util/audio.ts +0 -58
- package/src/calls/util/calls-service.ts +0 -582
- 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 -129
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -230
- package/src/capabilities/call-manager.ts +0 -27
- package/src/capabilities/react-root.tsx +0 -20
- package/src/components/Call/Call.tsx +0 -93
- package/src/components/Call/Toolbar.tsx +0 -199
- package/src/components/Call/index.ts +0 -6
- package/src/components/Lobby/Lobby.tsx +0 -123
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -59
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/Participant/Participant.tsx +0 -77
- package/src/components/Participant/ParticipantGrid.tsx +0 -88
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -158
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -54
- package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
- package/src/containers/CallDebugPanel/index.ts +0 -5
- package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
- package/src/containers/CallSidebar/index.ts +0 -5
- package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
- package/src/containers/ChannelContainer/index.ts +0 -5
- 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/types/capabilities.ts +0 -37
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser/chunk-J5LGTIGS.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 → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
|
-
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { Node, useActionRunner } from '@dxos/plugin-graph';
|
|
12
|
-
import { useActions, useNode } from '@dxos/plugin-graph';
|
|
13
|
-
import {
|
|
14
|
-
Icon,
|
|
15
|
-
IconButton,
|
|
16
|
-
type IconButtonProps,
|
|
17
|
-
Toolbar as NaturalToolbar,
|
|
18
|
-
type ThemedClassName,
|
|
19
|
-
toLocalizedString,
|
|
20
|
-
useTranslation,
|
|
21
|
-
} from '@dxos/react-ui';
|
|
22
|
-
import { type Channel } from '@dxos/types';
|
|
23
|
-
import { groupHoverControlItemWithTransition, mx } from '@dxos/ui-theme';
|
|
24
|
-
|
|
25
|
-
import { meta } from '#meta';
|
|
26
|
-
import { ThreadCapabilities } from '#types';
|
|
27
|
-
|
|
28
|
-
export type ToolbarProps = ThemedClassName<{
|
|
29
|
-
channel?: Channel.Channel;
|
|
30
|
-
participants?: number;
|
|
31
|
-
autoHideControls?: boolean;
|
|
32
|
-
isInRoom?: boolean;
|
|
33
|
-
onJoin?: () => void;
|
|
34
|
-
onLeave?: () => void;
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
// TODO(wittjosiah): Use ToolbarMenu.
|
|
38
|
-
export const Toolbar = ({
|
|
39
|
-
classNames,
|
|
40
|
-
channel,
|
|
41
|
-
participants,
|
|
42
|
-
autoHideControls = true,
|
|
43
|
-
onJoin,
|
|
44
|
-
onLeave,
|
|
45
|
-
}: ToolbarProps) => {
|
|
46
|
-
const { t } = useTranslation(meta.id);
|
|
47
|
-
const { graph } = useAppGraph();
|
|
48
|
-
const runAction = useActionRunner();
|
|
49
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
50
|
-
const media = useAtomValue(call.mediaAtom);
|
|
51
|
-
const joined = useAtomValue(call.joinedAtom);
|
|
52
|
-
const raisedHand = useAtomValue(call.raisedHandAtom);
|
|
53
|
-
|
|
54
|
-
// Channel app graph node.
|
|
55
|
-
const node = useNode(graph, channel && Obj.getDXN(channel).toString());
|
|
56
|
-
const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === 'toolbar');
|
|
57
|
-
|
|
58
|
-
// Screen sharing.
|
|
59
|
-
const isScreensharing = media.screenshareTrack !== undefined;
|
|
60
|
-
const canSharescreen =
|
|
61
|
-
typeof navigator.mediaDevices !== 'undefined' && navigator.mediaDevices.getDisplayMedia !== undefined;
|
|
62
|
-
|
|
63
|
-
// TODO(wittjosiah): In order to use toolbar, need to update to actually use the graph action callbacks directly.
|
|
64
|
-
return (
|
|
65
|
-
<div className={mx('z-20 flex justify-center m-8', autoHideControls && groupHoverControlItemWithTransition)}>
|
|
66
|
-
<NaturalToolbar.Root classNames={['p-2 bg-modal-surface rounded-md shadow-md', classNames]}>
|
|
67
|
-
<ToggleButton
|
|
68
|
-
active={media.audioEnabled}
|
|
69
|
-
state={{
|
|
70
|
-
on: {
|
|
71
|
-
icon: 'ph--microphone--regular',
|
|
72
|
-
label: t('mic-off.button'),
|
|
73
|
-
onClick: () => call.turnAudioOff(),
|
|
74
|
-
classNames: 'bg-call-active',
|
|
75
|
-
},
|
|
76
|
-
off: {
|
|
77
|
-
icon: 'ph--microphone-slash--duotone',
|
|
78
|
-
label: t('mic-on.button'),
|
|
79
|
-
onClick: () => call.turnAudioOn(),
|
|
80
|
-
},
|
|
81
|
-
}}
|
|
82
|
-
/>
|
|
83
|
-
<ToggleButton
|
|
84
|
-
active={media.videoEnabled}
|
|
85
|
-
state={{
|
|
86
|
-
on: {
|
|
87
|
-
icon: 'ph--video-camera--regular',
|
|
88
|
-
label: t('camera-off.button'),
|
|
89
|
-
onClick: () => call.turnVideoOff(),
|
|
90
|
-
},
|
|
91
|
-
off: {
|
|
92
|
-
icon: 'ph--video-camera-slash--duotone',
|
|
93
|
-
label: t('camera-on.button'),
|
|
94
|
-
onClick: () => call.turnVideoOn(),
|
|
95
|
-
},
|
|
96
|
-
}}
|
|
97
|
-
/>
|
|
98
|
-
|
|
99
|
-
{(participants !== undefined && (
|
|
100
|
-
<div className='flex justify-center items-center gap-2 w-[5rem] text-xs text-subdued'>
|
|
101
|
-
<Icon icon='ph--users--regular' />
|
|
102
|
-
<div>{participants}</div>
|
|
103
|
-
</div>
|
|
104
|
-
)) || <NaturalToolbar.Separator variant='gap' />}
|
|
105
|
-
|
|
106
|
-
{joined && (
|
|
107
|
-
<>
|
|
108
|
-
<ToggleButton
|
|
109
|
-
disabled={!canSharescreen}
|
|
110
|
-
active={isScreensharing}
|
|
111
|
-
state={{
|
|
112
|
-
on: {
|
|
113
|
-
icon: 'ph--monitor--regular',
|
|
114
|
-
label: t('screenshare-off.button'),
|
|
115
|
-
onClick: () => call.turnScreenshareOff(),
|
|
116
|
-
},
|
|
117
|
-
off: {
|
|
118
|
-
icon: 'ph--monitor-arrow-up--duotone',
|
|
119
|
-
label: t('screenshare-on.button'),
|
|
120
|
-
onClick: () => call.turnScreenshareOn(),
|
|
121
|
-
},
|
|
122
|
-
}}
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
{/* Companion actions. */}
|
|
126
|
-
{actions
|
|
127
|
-
.filter((action): action is Node.Action => Node.isAction(action))
|
|
128
|
-
.map((action) => (
|
|
129
|
-
<IconButton
|
|
130
|
-
key={action.id}
|
|
131
|
-
{...defaultButtonProps}
|
|
132
|
-
icon={action.properties.icon}
|
|
133
|
-
label={toLocalizedString(action.properties.label, t)}
|
|
134
|
-
classNames={action.properties.classNames}
|
|
135
|
-
onClick={() => node && void runAction(action, { parent: node })}
|
|
136
|
-
/>
|
|
137
|
-
))}
|
|
138
|
-
|
|
139
|
-
<ToggleButton
|
|
140
|
-
active={raisedHand}
|
|
141
|
-
state={{
|
|
142
|
-
on: {
|
|
143
|
-
icon: 'ph--hand-waving--regular',
|
|
144
|
-
label: t('lower-hand.button'),
|
|
145
|
-
onClick: () => call.setRaisedHand(false),
|
|
146
|
-
},
|
|
147
|
-
off: {
|
|
148
|
-
icon: 'ph--hand-palm--duotone',
|
|
149
|
-
label: t('raise-hand.button'),
|
|
150
|
-
onClick: () => call.setRaisedHand(true),
|
|
151
|
-
},
|
|
152
|
-
}}
|
|
153
|
-
/>
|
|
154
|
-
</>
|
|
155
|
-
)}
|
|
156
|
-
{joined ? (
|
|
157
|
-
<IconButton
|
|
158
|
-
variant='destructive'
|
|
159
|
-
icon='ph--phone-x--regular'
|
|
160
|
-
label={t('leave-call.button')}
|
|
161
|
-
onClick={onLeave}
|
|
162
|
-
/>
|
|
163
|
-
) : (
|
|
164
|
-
<IconButton
|
|
165
|
-
variant='primary'
|
|
166
|
-
icon='ph--phone-incoming--regular'
|
|
167
|
-
label={t('join-call.button')}
|
|
168
|
-
onClick={onJoin}
|
|
169
|
-
/>
|
|
170
|
-
)}
|
|
171
|
-
</NaturalToolbar.Root>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
Toolbar.displayName = 'MeetingToolbar';
|
|
177
|
-
|
|
178
|
-
type ToolbarButtonProps = Pick<IconButtonProps, 'disabled'> & {
|
|
179
|
-
active?: boolean;
|
|
180
|
-
state: {
|
|
181
|
-
on: Pick<IconButtonProps, 'icon' | 'label' | 'onClick' | 'classNames'>;
|
|
182
|
-
off: Pick<IconButtonProps, 'icon' | 'label' | 'onClick' | 'classNames'>;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const defaultButtonProps: Partial<IconButtonProps> = {
|
|
187
|
-
size: 5,
|
|
188
|
-
iconOnly: true,
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const ToggleButton = ({ active, state }: ToolbarButtonProps) => (
|
|
192
|
-
<IconButton
|
|
193
|
-
{...defaultButtonProps}
|
|
194
|
-
classNames={[active ? (state.on.classNames ?? 'bg-call-active') : state.off.classNames]}
|
|
195
|
-
icon={active ? state.on.icon : state.off.icon}
|
|
196
|
-
label={active ? state.on.label : state.off.label}
|
|
197
|
-
onClick={active ? state.on.onClick : state.off.onClick}
|
|
198
|
-
/>
|
|
199
|
-
);
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import React, { type PropsWithChildren, useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
|
-
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { mx } from '@dxos/ui-theme';
|
|
11
|
-
|
|
12
|
-
import { meta } from '#meta';
|
|
13
|
-
import { ThreadCapabilities } from '#types';
|
|
14
|
-
|
|
15
|
-
import { Toolbar, type ToolbarProps } from '../Call';
|
|
16
|
-
import { VideoObject } from '../Media';
|
|
17
|
-
import { ResponsivePanel } from '../ResponsiveGrid';
|
|
18
|
-
|
|
19
|
-
// TODO(wittjosiah): Repurpose lobby for preview.
|
|
20
|
-
|
|
21
|
-
const SWARM_PEEK_INTERVAL = 1_000;
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
// Root
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
type LobbyRootProps = PropsWithChildren<ThemedClassName>;
|
|
28
|
-
|
|
29
|
-
// TODO(burdon): Make headless?
|
|
30
|
-
const LobbyRoot = ({ children }: LobbyRootProps) => {
|
|
31
|
-
return <div className='relative flex flex-col grow overflow-hidden group'>{children}</div>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
LobbyRoot.displayName = 'LobbyRoot';
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// Preview
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
type LobbyPreviewProps = {};
|
|
41
|
-
|
|
42
|
-
const LobbyPreview = (_props: LobbyPreviewProps) => {
|
|
43
|
-
const { t } = useTranslation(meta.id);
|
|
44
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
45
|
-
const media = useAtomValue(call.mediaAtom);
|
|
46
|
-
const [classNames, setClassNames] = useState('');
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (!media.videoEnabled) {
|
|
49
|
-
setClassNames('');
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Video element will expand once the stream is available.
|
|
54
|
-
const timeout = setTimeout(() => {
|
|
55
|
-
setClassNames('outline-neutral-900 opacity-100');
|
|
56
|
-
}, 500);
|
|
57
|
-
|
|
58
|
-
return () => clearTimeout(timeout);
|
|
59
|
-
}, [media.videoEnabled]);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<div className='grid grow p-4'>
|
|
63
|
-
<ResponsivePanel>
|
|
64
|
-
{(media.videoEnabled && (
|
|
65
|
-
<VideoObject
|
|
66
|
-
videoStream={media.videoStream}
|
|
67
|
-
flip
|
|
68
|
-
muted
|
|
69
|
-
classNames={mx(
|
|
70
|
-
'rounded-md outline outline-2 outline-transparent opacity-0 transition-all duration-500',
|
|
71
|
-
classNames,
|
|
72
|
-
)}
|
|
73
|
-
/>
|
|
74
|
-
)) || <div className='p-4 outline outline-separator rounded-md'>{t('camera-off.label')}</div>}
|
|
75
|
-
</ResponsivePanel>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
LobbyPreview.displayName = 'LobbyPreview';
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
// Toolbar
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
type LobbyToolbarProps = ThemedClassName<
|
|
87
|
-
{
|
|
88
|
-
roomId: string;
|
|
89
|
-
} & Pick<ToolbarProps, 'onJoin'>
|
|
90
|
-
>;
|
|
91
|
-
|
|
92
|
-
const LobbyToolbar = ({ roomId, ...props }: LobbyToolbarProps) => {
|
|
93
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
94
|
-
const [count, setCount] = useState<number>(0);
|
|
95
|
-
|
|
96
|
-
// TODO(wittjosiah): Leaving the room doesn't remove you from the swarm.
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
void call.peek(roomId).then((count) => setCount(count));
|
|
99
|
-
const interval = setInterval(() => {
|
|
100
|
-
void call.peek(roomId).then((count) => setCount(count));
|
|
101
|
-
}, SWARM_PEEK_INTERVAL);
|
|
102
|
-
|
|
103
|
-
return () => clearInterval(interval);
|
|
104
|
-
}, [call, roomId]);
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<div className='absolute bottom-0 left-0 right-0 flex justify-center'>
|
|
108
|
-
<Toolbar participants={count} isInRoom={false} {...props} />
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
LobbyToolbar.displayName = 'LobbyToolbar';
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
// Export
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
export const Lobby = {
|
|
120
|
-
Root: LobbyRoot,
|
|
121
|
-
Preview: LobbyPreview,
|
|
122
|
-
Toolbar: LobbyToolbar,
|
|
123
|
-
};
|
|
@@ -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 AudioTrackParams = {
|
|
50
|
-
track: MediaStreamTrack;
|
|
51
|
-
mediaStream: MediaStream;
|
|
52
|
-
resetSrcObject: () => void;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const AudioTrack = ({ track, mediaStream, resetSrcObject }: AudioTrackParams) => {
|
|
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,59 +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 { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
|
-
|
|
13
|
-
import { getUserMediaTrack } from '../../calls';
|
|
14
|
-
import { ResponsivePanel } from '../ResponsiveGrid';
|
|
15
|
-
import { VideoObject, type VideoObjectProps } from './VideoObject';
|
|
16
|
-
|
|
17
|
-
const DefaultStory = (props: VideoObjectProps) => {
|
|
18
|
-
log.info('render');
|
|
19
|
-
const [videoStream, setVideoStream] = useState<MediaStream>();
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
const ctx = new Context();
|
|
22
|
-
scheduleTask(ctx, async () => {
|
|
23
|
-
try {
|
|
24
|
-
const stream = new MediaStream();
|
|
25
|
-
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
26
|
-
setVideoStream(stream);
|
|
27
|
-
} catch (err) {
|
|
28
|
-
log.catch(err);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return () => {
|
|
33
|
-
void ctx.dispose();
|
|
34
|
-
videoStream?.getTracks().forEach((track) => track.stop());
|
|
35
|
-
};
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<ResponsivePanel>
|
|
40
|
-
<VideoObject videoStream={videoStream} flip {...props} />
|
|
41
|
-
</ResponsivePanel>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const meta = {
|
|
46
|
-
title: 'plugins/plugin-thread/components/VideoObject',
|
|
47
|
-
component: VideoObject,
|
|
48
|
-
render: DefaultStory,
|
|
49
|
-
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
50
|
-
parameters: {
|
|
51
|
-
layout: 'fullscreen',
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default meta;
|
|
56
|
-
|
|
57
|
-
type Story = StoryObj<typeof VideoObject>;
|
|
58
|
-
|
|
59
|
-
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/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,77 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import React, { memo, useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
|
-
|
|
10
|
-
import { ThreadCapabilities } from '#types';
|
|
11
|
-
|
|
12
|
-
import { type EncodedTrackName, type UserState } from '../../calls';
|
|
13
|
-
import { VideoObject } from '../Media';
|
|
14
|
-
import { ResponsiveGridItem, type ResponsiveGridItemProps } from '../ResponsiveGrid';
|
|
15
|
-
|
|
16
|
-
export const SCREENSHARE_SUFFIX = '_screenshare';
|
|
17
|
-
|
|
18
|
-
export const Participant = memo(({ item: user, debug, ...props }: ResponsiveGridItemProps<UserState>) => {
|
|
19
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
20
|
-
const self = useAtomValue(call.selfAtom);
|
|
21
|
-
const media = useAtomValue(call.mediaAtom);
|
|
22
|
-
const isSelf: boolean = self.id !== undefined && user.id !== undefined && user.id.startsWith(self.id);
|
|
23
|
-
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
24
|
-
|
|
25
|
-
// Get pulled video stream for non-self users.
|
|
26
|
-
const pulledVideoStream = useMemo<MediaStream | undefined>(() => {
|
|
27
|
-
if (isSelf) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
const trackName =
|
|
31
|
-
isScreenshare && user.tracks?.screenshareEnabled
|
|
32
|
-
? (user.tracks?.screenshare as EncodedTrackName)
|
|
33
|
-
: !isScreenshare && user.tracks?.videoEnabled
|
|
34
|
-
? (user.tracks?.video as EncodedTrackName)
|
|
35
|
-
: undefined;
|
|
36
|
-
return trackName ? media.pulledVideoStreams[trackName]?.stream : undefined;
|
|
37
|
-
}, [
|
|
38
|
-
isSelf,
|
|
39
|
-
isScreenshare,
|
|
40
|
-
media.pulledVideoStreams,
|
|
41
|
-
user.tracks?.screenshare,
|
|
42
|
-
user.tracks?.video,
|
|
43
|
-
user.tracks?.screenshareEnabled,
|
|
44
|
-
user.tracks?.videoEnabled,
|
|
45
|
-
]);
|
|
46
|
-
|
|
47
|
-
const videoStream = useMemo<MediaStream | undefined>(() => {
|
|
48
|
-
if (isSelf) {
|
|
49
|
-
return isScreenshare ? media.screenshareVideoStream : media.videoStream;
|
|
50
|
-
}
|
|
51
|
-
return pulledVideoStream;
|
|
52
|
-
}, [isSelf, isScreenshare, media.videoStream, media.screenshareVideoStream, pulledVideoStream]);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<ResponsiveGridItem
|
|
56
|
-
{...props}
|
|
57
|
-
item={user}
|
|
58
|
-
name={user.name}
|
|
59
|
-
self={isSelf}
|
|
60
|
-
screenshare={!!media.screenshareVideoStream}
|
|
61
|
-
video={media.videoEnabled}
|
|
62
|
-
mute={user ? !user.tracks?.audioEnabled : false}
|
|
63
|
-
wave={user.raisedHand}
|
|
64
|
-
speaking={user.speaking}
|
|
65
|
-
debug={debug}
|
|
66
|
-
>
|
|
67
|
-
<VideoObject
|
|
68
|
-
videoStream={videoStream}
|
|
69
|
-
flip={isSelf && !isScreenshare}
|
|
70
|
-
contain={!!isScreenshare}
|
|
71
|
-
classNames='rounded-md'
|
|
72
|
-
/>
|
|
73
|
-
</ResponsiveGridItem>
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
Participant.displayName = 'Participant';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
-
|
|
9
|
-
import { type UserState } from '../../calls';
|
|
10
|
-
import { ResponsiveGrid } from '../ResponsiveGrid';
|
|
11
|
-
import { Participant, SCREENSHARE_SUFFIX } from './Participant';
|
|
12
|
-
|
|
13
|
-
const getId = (user: UserState): string => user.id!;
|
|
14
|
-
|
|
15
|
-
export type ParticipantGridProps = ThemedClassName<{
|
|
16
|
-
self: UserState;
|
|
17
|
-
users: UserState[];
|
|
18
|
-
fullscreen?: boolean;
|
|
19
|
-
debug?: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
export const ParticipantGrid = ({ classNames, self, users, fullscreen, debug }: ParticipantGridProps) => {
|
|
23
|
-
const [pinned, setPinned] = useState<string | undefined>();
|
|
24
|
-
|
|
25
|
-
const allUsers = useMemo(() => {
|
|
26
|
-
const allUsers: (UserState & { isSelf?: boolean })[] = [];
|
|
27
|
-
users.forEach((user) => {
|
|
28
|
-
if (!user.joined) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
allUsers.push({ ...user, isSelf: user.id === self.id });
|
|
33
|
-
if (user.tracks?.screenshareEnabled) {
|
|
34
|
-
const screenshare: UserState = {
|
|
35
|
-
...user,
|
|
36
|
-
id: user.id + SCREENSHARE_SUFFIX,
|
|
37
|
-
tracks: {
|
|
38
|
-
...user.tracks,
|
|
39
|
-
video: user.tracks.screenshare,
|
|
40
|
-
videoEnabled: user.tracks.screenshareEnabled,
|
|
41
|
-
} as any, // TODO(burdon): Remove cast.
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
allUsers.push(screenshare);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
return allUsers;
|
|
49
|
-
}, [self, users]);
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (pinned) {
|
|
53
|
-
// Check expanded user is still in call.
|
|
54
|
-
if (!allUsers.find((user) => user.id === pinned)) {
|
|
55
|
-
setPinned(undefined);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}, [pinned, allUsers]);
|
|
59
|
-
|
|
60
|
-
// TODO(burdon): Put self last.
|
|
61
|
-
const sortedUsers: UserState[] = allUsers.sort((a, b) => {
|
|
62
|
-
if (a.isSelf) {
|
|
63
|
-
return 1;
|
|
64
|
-
} else if (b.isSelf) {
|
|
65
|
-
return -1;
|
|
66
|
-
} else if (a.tracks?.screenshareEnabled) {
|
|
67
|
-
return -1;
|
|
68
|
-
} else if (b.tracks?.screenshareEnabled) {
|
|
69
|
-
return 1;
|
|
70
|
-
} else {
|
|
71
|
-
return 0;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// TODO(burdon): Show ghost view of user for a second before leaving.
|
|
76
|
-
return (
|
|
77
|
-
<ResponsiveGrid<UserState>
|
|
78
|
-
classNames={classNames}
|
|
79
|
-
Cell={Participant}
|
|
80
|
-
debug={debug}
|
|
81
|
-
getId={getId}
|
|
82
|
-
items={sortedUsers}
|
|
83
|
-
pinned={pinned}
|
|
84
|
-
autoHideGallery={fullscreen}
|
|
85
|
-
onPinnedChange={setPinned}
|
|
86
|
-
/>
|
|
87
|
-
);
|
|
88
|
-
};
|