@dxos/plugin-thread 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934
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/ThreadSettings-5MKTDK3A.mjs +15 -0
- package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
- package/dist/lib/{browser/add-message-MJDIN4K4.mjs → neutral/add-message-FBIROBEZ.mjs} +14 -24
- 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/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +5 -6
- 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-2QNKWX4H.mjs → neutral/chunk-PE7IH7EL.mjs} +97 -85
- 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-QK4QZUR5.mjs +8 -0
- package/dist/lib/neutral/chunk-QK4QZUR5.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-N2ZVTONJ.mjs → neutral/create-OAQJ6LXN.mjs} +11 -14
- 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/{browser/create-proposals-VTOSWUOX.mjs → neutral/create-proposals-GRYZXRMV.mjs} +5 -6
- package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs.map +7 -0
- package/dist/lib/{browser/delete-QZZE655Y.mjs → neutral/delete-HCCG5RVR.mjs} +8 -10
- package/dist/lib/neutral/delete-HCCG5RVR.mjs.map +7 -0
- package/dist/lib/{browser/delete-message-JTBPACDE.mjs → neutral/delete-message-DHFRACB4.mjs} +10 -20
- 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/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/{browser/restore-KKQHFLYO.mjs → neutral/restore-P4ZLXLF7.mjs} +6 -7
- package/dist/lib/neutral/restore-P4ZLXLF7.mjs.map +7 -0
- package/dist/lib/{browser/restore-message-YN4BJQIZ.mjs → neutral/restore-message-AUBOP2DF.mjs} +9 -18
- package/dist/lib/neutral/restore-message-AUBOP2DF.mjs.map +7 -0
- package/dist/lib/{browser/select-VBJ3MBLN.mjs → neutral/select-LIVAMBCE.mjs} +7 -9
- 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-OX7UEZG5.mjs → neutral/toggle-resolved-RQBDQZSV.mjs} +12 -21
- 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 +1 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- 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 +10 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.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/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +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/{CallDebugPanel → ChannelArticle}/index.d.ts.map +1 -1
- 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.map +1 -1
- 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/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
- 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 +3 -4
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +3 -3
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +3 -3
- package/dist/types/src/operations/add-message.d.ts.map +1 -1
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +3 -3
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/create-proposals.d.ts +3 -3
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +3 -3
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/delete-message.d.ts +3 -3
- package/dist/types/src/operations/delete-message.d.ts.map +1 -1
- package/dist/types/src/operations/delete.d.ts +3 -3
- package/dist/types/src/operations/delete.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +3 -3
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/restore-message.d.ts +3 -3
- package/dist/types/src/operations/restore-message.d.ts.map +1 -1
- package/dist/types/src/operations/restore.d.ts +3 -3
- package/dist/types/src/operations/restore.d.ts.map +1 -1
- package/dist/types/src/operations/select.d.ts +3 -3
- package/dist/types/src/operations/select.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +3 -3
- 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/testing/data.d.ts.map +1 -1
- 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 +70 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +2 -1
- package/dist/types/src/types/Settings.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} +856 -1650
- 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 +1 -1
- 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 +126 -106
- package/src/ThreadPlugin.node.ts +39 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +12 -65
- package/src/blueprints/thread-blueprint.ts +3 -4
- package/src/capabilities/app-graph-builder.ts +21 -71
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/markdown.ts +9 -5
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +19 -34
- package/src/capabilities/settings.ts +1 -3
- package/src/capabilities/undo-mappings.ts +1 -1
- package/src/components/Chat/Chat.tsx +258 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +6 -4
- package/src/components/CommentsPanel/CommentsPanel.tsx +4 -4
- package/src/components/CommentsPanel/CommentsThread.tsx +2 -3
- package/src/components/MessagePanel/MessagePanel.tsx +10 -11
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
- package/src/components/ThreadSettings/ThreadSettings.tsx +0 -1
- package/src/components/index.ts +1 -1
- 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 +10 -12
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +3 -4
- package/src/extensions/command.ts +1 -1
- package/src/extensions/threads.ts +15 -15
- package/src/hooks/analytics.ts +1 -1
- package/src/hooks/index.ts +0 -5
- package/src/index.ts +4 -4
- package/src/meta.ts +1 -2
- package/src/operations/add-message.ts +9 -9
- package/src/operations/append-channel-message.ts +37 -0
- package/src/operations/create-channel.ts +4 -4
- package/src/operations/create-proposals.ts +3 -3
- package/src/operations/create.ts +7 -7
- package/src/operations/delete-message.ts +7 -7
- package/src/operations/delete.ts +4 -4
- package/src/operations/index.ts +2 -4
- package/src/operations/on-create-space.ts +4 -4
- package/src/operations/restore-message.ts +6 -6
- package/src/operations/restore.ts +4 -4
- package/src/operations/select.ts +3 -3
- package/src/operations/toggle-resolved.ts +9 -9
- package/src/plugin.ts +11 -0
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +3 -3
- package/src/types/Settings.ts +1 -1
- package/src/types/ThreadCapabilities.ts +26 -0
- package/src/{operations/definitions.ts → types/ThreadOperation.ts} +14 -13
- package/src/types/index.ts +4 -2
- package/src/types/types.ts +0 -2
- package/src/util.ts +36 -4
- package/dist/lib/browser/add-message-MJDIN4K4.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-2QNKWX4H.mjs.map +0 -7
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs +0 -61
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs.map +0 -7
- package/dist/lib/browser/create-N2ZVTONJ.mjs.map +0 -7
- package/dist/lib/browser/create-channel-Y4H3535D.mjs +0 -21
- package/dist/lib/browser/create-channel-Y4H3535D.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs +0 -28
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs.map +0 -7
- package/dist/lib/browser/create-proposals-VTOSWUOX.mjs.map +0 -7
- package/dist/lib/browser/delete-QZZE655Y.mjs.map +0 -7
- package/dist/lib/browser/delete-message-JTBPACDE.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -2334
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-2UGS234J.mjs +0 -25
- package/dist/lib/browser/on-create-space-2UGS234J.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -14
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/restore-KKQHFLYO.mjs.map +0 -7
- package/dist/lib/browser/restore-message-YN4BJQIZ.mjs.map +0 -7
- package/dist/lib/browser/select-VBJ3MBLN.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-OX7UEZG5.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/add-message-X6IRTANN.mjs +0 -98
- package/dist/lib/node-esm/add-message-X6IRTANN.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -38
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs +0 -260
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs +0 -62
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs.map +0 -7
- package/dist/lib/node-esm/create-A6XQZR7M.mjs +0 -56
- package/dist/lib/node-esm/create-A6XQZR7M.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs +0 -22
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs +0 -29
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs +0 -58
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs.map +0 -7
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs +0 -60
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-QQHNJBHY.mjs +0 -65
- package/dist/lib/node-esm/delete-message-QQHNJBHY.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -2335
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs +0 -26
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -15
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs +0 -34
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-OB32YYKF.mjs +0 -43
- package/dist/lib/node-esm/restore-message-OB32YYKF.mjs.map +0 -7
- package/dist/lib/node-esm/select-6KETLVWY.mjs +0 -27
- package/dist/lib/node-esm/select-6KETLVWY.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-V74EBRQZ.mjs +0 -46
- package/dist/lib/node-esm/toggle-resolved-V74EBRQZ.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -13
- package/dist/types/src/calls/call-manager.d.ts +0 -87
- package/dist/types/src/calls/call-manager.d.ts.map +0 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
- package/dist/types/src/calls/index.d.ts +0 -7
- package/dist/types/src/calls/index.d.ts.map +0 -1
- package/dist/types/src/calls/media-manager.d.ts +0 -60
- package/dist/types/src/calls/media-manager.d.ts.map +0 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
- package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
- package/dist/types/src/calls/types.d.ts +0 -45
- package/dist/types/src/calls/types.d.ts.map +0 -1
- package/dist/types/src/calls/util/audio.d.ts +0 -6
- package/dist/types/src/calls/util/audio.d.ts.map +0 -1
- package/dist/types/src/calls/util/calls-service.d.ts +0 -77
- package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
- package/dist/types/src/calls/util/history-cache.d.ts +0 -11
- package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
- package/dist/types/src/calls/util/index.d.ts +0 -5
- package/dist/types/src/calls/util/index.d.ts.map +0 -1
- package/dist/types/src/calls/util/media.d.ts +0 -6
- package/dist/types/src/calls/util/media.d.ts.map +0 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -23
- package/dist/types/src/calls-service.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/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 -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/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/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 +0 -162
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -20
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/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/create-channel-thread.d.ts +0 -5
- package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -711
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -23
- 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 -580
- package/src/calls/util/history-cache.ts +0 -27
- package/src/calls/util/index.ts +0 -8
- package/src/calls/util/media.ts +0 -52
- package/src/calls/util/stub-media-streams.ts +0 -127
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -230
- package/src/capabilities/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 -122
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -59
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/Participant/Participant.tsx +0 -77
- package/src/components/Participant/ParticipantGrid.tsx +0 -88
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -53
- package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
- package/src/containers/CallDebugPanel/index.ts +0 -5
- package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
- package/src/containers/CallSidebar/index.ts +0 -5
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +0 -61
- package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
- package/src/containers/ChannelContainer/index.ts +0 -5
- package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
- package/src/containers/ChatContainer/index.ts +0 -8
- package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
- package/src/hooks/useDebugMode.ts +0 -25
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
- package/src/hooks/useVideoStreamTrack.tsx +0 -36
- package/src/operations/create-channel-thread.ts +0 -26
- package/src/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -37
- package/src/types/capabilities.ts +0 -36
- 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,31 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { mx } from '@dxos/ui-theme';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A container component that maintains the child's aspect ratio while centering its content.
|
|
11
|
-
* The container will scale to fit within its parent's bounds while preserving the aspect ratio.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* <ResponsivePanel>
|
|
15
|
-
* <VideoObject />
|
|
16
|
-
* </ResponsivePanel>
|
|
17
|
-
*/
|
|
18
|
-
export const ResponsivePanel = ({ children }: PropsWithChildren) => {
|
|
19
|
-
return (
|
|
20
|
-
// Outer container that takes full size of parent.
|
|
21
|
-
<div role='none' className='dx-expander relative flex'>
|
|
22
|
-
{/* Absolute positioning layer for centering content. */}
|
|
23
|
-
<div role='none' className='absolute inset-0 flex justify-center items-center'>
|
|
24
|
-
{/* Content container that maintains given aspect ratio and proper scaling. */}
|
|
25
|
-
<div role='none' className={mx('max-h-full max-w-full w-auto h-auto aspect-video')}>
|
|
26
|
-
{children}
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { WebRTCStats, type WebRTCStatsEvent } from '@peermetrics/webrtc-stats';
|
|
6
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { truncateKey } from '@dxos/debug';
|
|
9
|
-
import { JsonView, Panel } from '@dxos/devtools';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
11
|
-
import { IconButton, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
|
|
13
|
-
import { meta } from '#meta';
|
|
14
|
-
|
|
15
|
-
import { type EncodedTrackName, type GlobalState } from '../../calls';
|
|
16
|
-
|
|
17
|
-
export type CallDebugPanelProps = ThemedClassName<{ state?: GlobalState }>;
|
|
18
|
-
|
|
19
|
-
export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
20
|
-
const { t } = useTranslation(meta.id);
|
|
21
|
-
|
|
22
|
-
const [open, setOpen] = useState(false);
|
|
23
|
-
const handleToggle = () => setOpen(!open);
|
|
24
|
-
const [showServiceHistory, setShowServiceHistory] = useState(false);
|
|
25
|
-
const handleToggleServiceHistory = () => setShowServiceHistory(!showServiceHistory);
|
|
26
|
-
|
|
27
|
-
const handleCopyRaw = async () => {
|
|
28
|
-
await navigator.clipboard.writeText(JSON.stringify({ users: state?.call?.users, stats }, null, 2));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const [showDetailedWebRTCStats, setShowDetailedWebRTCStats] = useState(false);
|
|
32
|
-
const handleShowDetailedWebRTCStats = () => setShowDetailedWebRTCStats(!showDetailedWebRTCStats);
|
|
33
|
-
|
|
34
|
-
const webrtcStats = useMemo(
|
|
35
|
-
() =>
|
|
36
|
-
new WebRTCStats({
|
|
37
|
-
getStatsInterval: 1000,
|
|
38
|
-
}),
|
|
39
|
-
[],
|
|
40
|
-
);
|
|
41
|
-
const [stats, setStats] = useState<WebRTCStatsEvent['data']>();
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
const pc = state?.media.peer?.session?.peerConnection;
|
|
45
|
-
const handleStats = (stats: WebRTCStatsEvent) => {
|
|
46
|
-
setStats(stats.data);
|
|
47
|
-
};
|
|
48
|
-
let added = false;
|
|
49
|
-
if (pc && showDetailedWebRTCStats) {
|
|
50
|
-
webrtcStats.addConnection({ pc, peerId: 1, connectionId: '1' });
|
|
51
|
-
webrtcStats.on('stats', handleStats as never);
|
|
52
|
-
added = true;
|
|
53
|
-
}
|
|
54
|
-
return () => {
|
|
55
|
-
try {
|
|
56
|
-
if (pc && added) {
|
|
57
|
-
webrtcStats.removeConnection({ pc });
|
|
58
|
-
webrtcStats.removeListener('stats', handleStats as never);
|
|
59
|
-
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
log.error('error removing webrtc stats', { error, pc, peerId: 1, connectionId: '1' });
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}, [state?.media.peer?.session?.peerConnection, showDetailedWebRTCStats]);
|
|
65
|
-
|
|
66
|
-
const rows = useMemo(() => getCallStatusTable(state), [state?.call.users, state?.media.pulledAudioTracks]);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<Panel
|
|
70
|
-
id='meeting-status'
|
|
71
|
-
icon='ph--video-conference--regular'
|
|
72
|
-
open={open}
|
|
73
|
-
onToggle={handleToggle}
|
|
74
|
-
title={t('meeting-status.title')}
|
|
75
|
-
info={<div className='flex items-center gap-2'> {state?.call.joined ? 'Active' : 'Inactive'}</div>}
|
|
76
|
-
maxHeight={0}
|
|
77
|
-
>
|
|
78
|
-
<div className='flex flex-col w-full text-xs'>
|
|
79
|
-
<div className='flex items-center gap-2 items-center'>
|
|
80
|
-
<Input.Root>
|
|
81
|
-
<Input.Switch checked={showDetailedWebRTCStats} onCheckedChange={handleShowDetailedWebRTCStats} />
|
|
82
|
-
<Input.Label>{t('show-webrtc-stats.title')}</Input.Label>
|
|
83
|
-
</Input.Root>
|
|
84
|
-
</div>
|
|
85
|
-
<div className='flex items-center gap-2 items-center'>
|
|
86
|
-
<Input.Root>
|
|
87
|
-
<Input.Switch checked={showServiceHistory} onCheckedChange={handleToggleServiceHistory} />
|
|
88
|
-
<Input.Label>{t('show-calls-history.title')}</Input.Label>
|
|
89
|
-
</Input.Root>
|
|
90
|
-
</div>
|
|
91
|
-
<div className='flex items-center gap-2 items-center'>
|
|
92
|
-
<IconButton icon='ph--copy--regular' label={'copy raw'} onClick={handleCopyRaw} />
|
|
93
|
-
</div>
|
|
94
|
-
<Table rows={rows} />
|
|
95
|
-
{showDetailedWebRTCStats && <JsonView data={{ stats }} />}
|
|
96
|
-
{showServiceHistory && <JsonView data={{ history: state?.media.peer?.history.get() }} />}
|
|
97
|
-
</div>
|
|
98
|
-
</Panel>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const getCallStatusTable = (state?: GlobalState): TableProps['rows'] => {
|
|
103
|
-
if (!state || !state.call?.users) {
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const self = state.call.self;
|
|
108
|
-
const users = state.call.users
|
|
109
|
-
.filter((user) => user.id !== self!.id)
|
|
110
|
-
.map((user) => {
|
|
111
|
-
const isOk = {
|
|
112
|
-
audio:
|
|
113
|
-
user.tracks?.audio &&
|
|
114
|
-
state.media.pulledAudioTracks[user.tracks?.audio as EncodedTrackName]?.ctx.disposed === false,
|
|
115
|
-
video:
|
|
116
|
-
user.tracks?.video &&
|
|
117
|
-
state.media.pulledVideoStreams[user.tracks?.video as EncodedTrackName]?.ctx.disposed === false,
|
|
118
|
-
screenshare:
|
|
119
|
-
user.tracks?.screenshare &&
|
|
120
|
-
state.media.pulledVideoStreams[user.tracks?.screenshare as EncodedTrackName]?.ctx.disposed === false,
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
...user,
|
|
125
|
-
isOk,
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
return [
|
|
130
|
-
['users', state.call.users.length ?? 0],
|
|
131
|
-
[
|
|
132
|
-
'*self* ' + (self?.name ?? truncateKey(self!.id, 8)),
|
|
133
|
-
self?.tracks?.audio && state.media.pushedAudioTrack ? 'AUD ✅' : 'AUD ❌',
|
|
134
|
-
self?.tracks?.video && state.media.pushedVideoTrack ? 'VID ✅' : 'VID ❌',
|
|
135
|
-
self?.tracks?.screenshareEnabled
|
|
136
|
-
? self.tracks.screenshareEnabled && state.media.pushedScreenshareTrack
|
|
137
|
-
? 'SCR ✅'
|
|
138
|
-
: 'SCR ❌'
|
|
139
|
-
: undefined,
|
|
140
|
-
],
|
|
141
|
-
|
|
142
|
-
...users.map((user) => [
|
|
143
|
-
user.name ?? truncateKey(user.id, 8),
|
|
144
|
-
user.isOk.audio ? 'AUD ✅' : 'AUD ❌',
|
|
145
|
-
user.isOk.video ? 'VID ✅' : 'VID ❌',
|
|
146
|
-
user.tracks?.screenshareEnabled ? (user.isOk.screenshare ? 'SCR ✅' : 'SCR ❌') : undefined,
|
|
147
|
-
]),
|
|
148
|
-
['ICE', state.media.peer?.session?.peerConnection.iceConnectionState ?? 'no connection'],
|
|
149
|
-
];
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export namespace Unit {
|
|
153
|
-
export const KB = (n?: number) => ((n ?? 0) / 1_000).toFixed(2);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export type TableProps = {
|
|
157
|
-
rows: (string | number | undefined)[][];
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const Table = ({ rows }: TableProps) => {
|
|
161
|
-
return (
|
|
162
|
-
<div className='w-full text-xs font-mono'>
|
|
163
|
-
{rows.map(([prefix, label, value, unit], i) => (
|
|
164
|
-
<div key={i} className='grid grid-cols-[3fr_1fr_1fr_1fr]'>
|
|
165
|
-
<div className='p-1'>{prefix}</div>
|
|
166
|
-
<div className='p-1'>{label}</div>
|
|
167
|
-
<div className='p-1'>{value}</div>
|
|
168
|
-
<div className='p-1'>{unit}</div>
|
|
169
|
-
</div>
|
|
170
|
-
))}
|
|
171
|
-
</div>
|
|
172
|
-
);
|
|
173
|
-
};
|
|
@@ -1,18 +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
|
-
|
|
10
|
-
import { ThreadCapabilities } from '#types';
|
|
11
|
-
|
|
12
|
-
import ChannelContainer from '../ChannelContainer';
|
|
13
|
-
|
|
14
|
-
export const CallSidebar = () => {
|
|
15
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
16
|
-
const roomId = useAtomValue(call.roomIdAtom);
|
|
17
|
-
return <ChannelContainer subject={undefined} attendableId={roomId ?? ''} roomId={roomId} role='article' />;
|
|
18
|
-
};
|
|
@@ -1,61 +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 { Capability } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
-
import { Query, useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
12
|
-
import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
|
|
13
|
-
import { Message, Thread } from '@dxos/types';
|
|
14
|
-
|
|
15
|
-
import { createThreadPlugins } from '#testing';
|
|
16
|
-
import { Channel } from '#types';
|
|
17
|
-
|
|
18
|
-
import { translations } from '../../translations';
|
|
19
|
-
import { ChannelContainer, type ChannelContainerProps } from './ChannelContainer';
|
|
20
|
-
|
|
21
|
-
// TODO(wittjosiah): Channel doesn't render full height.
|
|
22
|
-
const DefaultStory = ({ roomId }: ChannelContainerProps) => {
|
|
23
|
-
const db = useDatabase();
|
|
24
|
-
const [channel] = useQuery(db, Query.type(Channel.Channel));
|
|
25
|
-
if (!channel) {
|
|
26
|
-
return <Loading data={{ db: !!db, channel: !!channel }} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return <ChannelContainer subject={channel} attendableId='story' roomId={roomId} role='article' />;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const meta = {
|
|
33
|
-
title: 'plugins/plugin-thread/containers/ChannelContainer',
|
|
34
|
-
component: ChannelContainer,
|
|
35
|
-
render: DefaultStory,
|
|
36
|
-
decorators: [
|
|
37
|
-
withTheme(),
|
|
38
|
-
withLayout({ layout: 'column' }),
|
|
39
|
-
withPluginManager({
|
|
40
|
-
plugins: [...(await createThreadPlugins())],
|
|
41
|
-
capabilities: [Capability.contributes(AppCapabilities.Schema, [Channel.Channel, Thread.Thread, Message.Message])],
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
44
|
-
parameters: {
|
|
45
|
-
translations,
|
|
46
|
-
},
|
|
47
|
-
} satisfies Meta<typeof ChannelContainer>;
|
|
48
|
-
|
|
49
|
-
export default meta;
|
|
50
|
-
|
|
51
|
-
type Story = StoryObj<typeof meta>;
|
|
52
|
-
|
|
53
|
-
export const Default: Story = {
|
|
54
|
-
args: {
|
|
55
|
-
// Fixed room for testing.
|
|
56
|
-
subject: undefined,
|
|
57
|
-
attendableId: 'story',
|
|
58
|
-
role: 'article',
|
|
59
|
-
roomId: '04a1d1911703b8e929d0649021a965',
|
|
60
|
-
},
|
|
61
|
-
};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import React, { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { useCapabilities, useCapability } from '@dxos/app-framework/ui';
|
|
9
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
|
-
import { Context } from '@dxos/context';
|
|
11
|
-
import { failUndefined } from '@dxos/debug';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { useClient } from '@dxos/react-client';
|
|
14
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
15
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
16
|
-
import { Button, ElevationProvider, Input, Panel, useTranslation } from '@dxos/react-ui';
|
|
17
|
-
import { Settings } from '@dxos/react-ui-form';
|
|
18
|
-
import { Menu, MenuRootProps, createMenuAction, createMenuItemGroup, useMenuActions } from '@dxos/react-ui-menu';
|
|
19
|
-
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
20
|
-
import { composable, composableProps } from '@dxos/ui-theme';
|
|
21
|
-
|
|
22
|
-
import { Call } from '#components';
|
|
23
|
-
import { meta } from '#meta';
|
|
24
|
-
import { ThreadCapabilities } from '#types';
|
|
25
|
-
import { type Channel } from '#types';
|
|
26
|
-
|
|
27
|
-
import { ChatContainer } from '../ChatContainer';
|
|
28
|
-
|
|
29
|
-
export type ChannelContainerProps = AppSurface.ObjectArticleProps<
|
|
30
|
-
Channel.Channel | undefined,
|
|
31
|
-
{
|
|
32
|
-
roomId?: string;
|
|
33
|
-
fullscreen?: boolean;
|
|
34
|
-
}
|
|
35
|
-
>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Renders a call when active, otherwise renders the channel chat.
|
|
39
|
-
*/
|
|
40
|
-
// TODO(burdon): Create Radix style layout.
|
|
41
|
-
export const ChannelContainer = ({
|
|
42
|
-
role,
|
|
43
|
-
subject: channel,
|
|
44
|
-
attendableId,
|
|
45
|
-
roomId: roomIdProp,
|
|
46
|
-
fullscreen,
|
|
47
|
-
}: ChannelContainerProps) => {
|
|
48
|
-
const space = getSpace(channel);
|
|
49
|
-
const callManager = useCapability(ThreadCapabilities.CallManager);
|
|
50
|
-
const extensions = useCapabilities(ThreadCapabilities.CallExtension);
|
|
51
|
-
const joined = useAtomValue(callManager.joinedAtom);
|
|
52
|
-
const currentRoomId = useAtomValue(callManager.roomIdAtom);
|
|
53
|
-
const roomId = roomIdProp ?? attendableId ?? failUndefined();
|
|
54
|
-
const identity = useIdentity();
|
|
55
|
-
const isNamed = !!identity?.profile?.displayName;
|
|
56
|
-
const joinSound = useSoundEffect('JoinCall');
|
|
57
|
-
const leaveSound = useSoundEffect('LeaveCall');
|
|
58
|
-
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const ctx = new Context();
|
|
61
|
-
callManager.left.on(ctx, (roomId) => {
|
|
62
|
-
extensions.forEach((extension) => {
|
|
63
|
-
void extension.onLeave?.(roomId);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
callManager.callStateUpdated.on(ctx, (state) => {
|
|
68
|
-
extensions.forEach((extension) => {
|
|
69
|
-
void extension.onCallStateUpdated?.(state);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
callManager.mediaStateUpdated.on(ctx, (state) => {
|
|
74
|
-
extensions.forEach((extension) => {
|
|
75
|
-
void extension.onMediaStateUpdated?.(state);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return () => {
|
|
80
|
-
void ctx.dispose();
|
|
81
|
-
};
|
|
82
|
-
}, [callManager, extensions]);
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Join the call.
|
|
86
|
-
*/
|
|
87
|
-
// TODO(wittjosiah): Show preview before joining?
|
|
88
|
-
const handleJoin = useCallback(async () => {
|
|
89
|
-
if (!roomId || !channel) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (joined) {
|
|
94
|
-
await callManager.leave();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
void joinSound.play();
|
|
99
|
-
callManager.setRoomId(roomId);
|
|
100
|
-
await callManager.join();
|
|
101
|
-
await Promise.all(extensions.map((extension) => extension.onJoin?.({ channel, roomId })));
|
|
102
|
-
} catch (err) {
|
|
103
|
-
// TODO(burdon): Error sound.
|
|
104
|
-
log.catch(err);
|
|
105
|
-
}
|
|
106
|
-
}, [extensions, channel, roomId, joined]);
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Leave the call.
|
|
110
|
-
*/
|
|
111
|
-
const handleLeave = useCallback(async () => {
|
|
112
|
-
try {
|
|
113
|
-
void leaveSound.play();
|
|
114
|
-
} catch (err) {
|
|
115
|
-
// TODO(burdon): Error sound.
|
|
116
|
-
log.catch(err);
|
|
117
|
-
} finally {
|
|
118
|
-
void callManager.turnAudioOff();
|
|
119
|
-
void callManager.turnVideoOff();
|
|
120
|
-
void callManager.turnScreenshareOff();
|
|
121
|
-
void callManager.leave();
|
|
122
|
-
}
|
|
123
|
-
}, [extensions, roomId]);
|
|
124
|
-
|
|
125
|
-
const isJoined = joined && currentRoomId === roomId;
|
|
126
|
-
if (isJoined) {
|
|
127
|
-
return (
|
|
128
|
-
<Panel.Root>
|
|
129
|
-
<Panel.Content>
|
|
130
|
-
{isNamed ? (
|
|
131
|
-
<Call.Root>
|
|
132
|
-
<Call.Grid fullscreen={fullscreen} />
|
|
133
|
-
<Call.Toolbar channel={channel} onLeave={handleLeave} />
|
|
134
|
-
</Call.Root>
|
|
135
|
-
) : (
|
|
136
|
-
<DisplayNameMissing />
|
|
137
|
-
)}
|
|
138
|
-
</Panel.Content>
|
|
139
|
-
</Panel.Root>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (channel && channel.defaultThread.target && space) {
|
|
144
|
-
return (
|
|
145
|
-
<Panel.Root classNames='dx-document'>
|
|
146
|
-
<Panel.Toolbar asChild>
|
|
147
|
-
<ChannelToolbar attendableId={attendableId} role={role} onJoinCall={handleJoin} />
|
|
148
|
-
</Panel.Toolbar>
|
|
149
|
-
<Panel.Content asChild>
|
|
150
|
-
<ChatContainer space={space} thread={channel.defaultThread.target} />
|
|
151
|
-
</Panel.Content>
|
|
152
|
-
</Panel.Root>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return null;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const DisplayNameMissing = () => {
|
|
160
|
-
const { t } = useTranslation(meta.id);
|
|
161
|
-
const client = useClient();
|
|
162
|
-
const [displayName, setDisplayName] = useState('');
|
|
163
|
-
const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => setDisplayName(event.target.value), []);
|
|
164
|
-
const handleSave = useCallback(() => client.halo.updateProfile({ displayName }), [client, displayName]);
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<div className='space-y-trim-md p-4 place-content-center'>
|
|
168
|
-
<Settings.Item title={t('display-name.label')} description={t('display-name.description')}>
|
|
169
|
-
<Input.TextInput
|
|
170
|
-
value={displayName}
|
|
171
|
-
onChange={handleChange}
|
|
172
|
-
placeholder={t('display-name-input.placeholder')}
|
|
173
|
-
classNames='md:min-w-64'
|
|
174
|
-
/>
|
|
175
|
-
</Settings.Item>
|
|
176
|
-
<Button classNames='md:col-span-2' disabled={!displayName} onClick={handleSave}>
|
|
177
|
-
{t('set-display-name.label')}
|
|
178
|
-
</Button>
|
|
179
|
-
</div>
|
|
180
|
-
);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const useChannelToolbarActions = (onJoinCall?: () => void) => {
|
|
184
|
-
const creator = useMemo(
|
|
185
|
-
() =>
|
|
186
|
-
Atom.make(() => {
|
|
187
|
-
return {
|
|
188
|
-
nodes: [
|
|
189
|
-
createMenuItemGroup('root', {
|
|
190
|
-
label: ['channel-toolbar.title', { ns: meta.id }],
|
|
191
|
-
}),
|
|
192
|
-
createMenuAction('video-call', () => onJoinCall?.(), {
|
|
193
|
-
label: ['start-video-call.menu', { ns: meta.id }],
|
|
194
|
-
icon: 'ph--video-camera--regular',
|
|
195
|
-
type: 'video-call',
|
|
196
|
-
}),
|
|
197
|
-
],
|
|
198
|
-
edges: [{ source: 'root', target: 'video-call', relation: 'child' }],
|
|
199
|
-
};
|
|
200
|
-
}),
|
|
201
|
-
[],
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
return useMenuActions(creator);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
type ChannelToolbarProps = Pick<MenuRootProps, 'attendableId'> & {
|
|
208
|
-
onJoinCall?: () => void;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const ChannelToolbar = composable<HTMLDivElement, ChannelToolbarProps>(
|
|
212
|
-
({ attendableId, role, onJoinCall, ...props }, forwardedRef) => {
|
|
213
|
-
const menuActions = useChannelToolbarActions(onJoinCall);
|
|
214
|
-
|
|
215
|
-
return (
|
|
216
|
-
<ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>
|
|
217
|
-
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
218
|
-
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
|
|
219
|
-
</Menu.Root>
|
|
220
|
-
</ElevationProvider>
|
|
221
|
-
);
|
|
222
|
-
},
|
|
223
|
-
);
|
|
@@ -1,131 +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, useMembers } from '@dxos/react-client/echo';
|
|
9
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
12
|
-
MessageTextbox,
|
|
13
|
-
type MessageTextboxProps,
|
|
14
|
-
Thread as ThreadComponent,
|
|
15
|
-
type ThreadRootProps,
|
|
16
|
-
threadLayout,
|
|
17
|
-
} from '@dxos/react-ui-thread';
|
|
18
|
-
import { Message, type Thread } from '@dxos/types';
|
|
19
|
-
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';
|
|
20
|
-
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
21
|
-
import { isNonNullable } from '@dxos/util';
|
|
22
|
-
|
|
23
|
-
import { MessagePanel } from '#components';
|
|
24
|
-
import { useStatus } from '#hooks';
|
|
25
|
-
import { meta } from '#meta';
|
|
26
|
-
|
|
27
|
-
import { command } from '../../extensions';
|
|
28
|
-
import { getMessageMetadata } from '../../util';
|
|
29
|
-
|
|
30
|
-
export type ChatContainerProps = ThemedClassName<
|
|
31
|
-
{
|
|
32
|
-
space: Space;
|
|
33
|
-
thread: Thread.Thread;
|
|
34
|
-
context?: Obj.Unknown;
|
|
35
|
-
autoFocusTextbox?: boolean;
|
|
36
|
-
} & Pick<ThreadRootProps, 'current'>
|
|
37
|
-
>;
|
|
38
|
-
|
|
39
|
-
export const ChatContainer = composable<HTMLDivElement, ChatContainerProps>(
|
|
40
|
-
({ space, thread, context, autoFocusTextbox, current, ...props }, forwardedRef) => {
|
|
41
|
-
const { t } = useTranslation(meta.id);
|
|
42
|
-
const { themeMode } = useThemeContext();
|
|
43
|
-
|
|
44
|
-
const id = Obj.getDXN(thread).toString();
|
|
45
|
-
const identity = useIdentity()!;
|
|
46
|
-
const members = useMembers(space?.id);
|
|
47
|
-
const activity = useStatus(space, id);
|
|
48
|
-
const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
|
|
49
|
-
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
50
|
-
|
|
51
|
-
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
52
|
-
const [_count, _setCount] = useState(0);
|
|
53
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
54
|
-
|
|
55
|
-
const textboxMetadata = getMessageMetadata(id, identity);
|
|
56
|
-
const messageRef = useRef('');
|
|
57
|
-
const extensions = useMemo(
|
|
58
|
-
() => [
|
|
59
|
-
createBasicExtensions({ placeholder: t('message.placeholder') }),
|
|
60
|
-
createThemeExtensions({ themeMode }),
|
|
61
|
-
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
62
|
-
command,
|
|
63
|
-
],
|
|
64
|
-
[themeMode, _count],
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// TODO(thure): Factor out.
|
|
68
|
-
// TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using
|
|
69
|
-
// `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient
|
|
70
|
-
// for the desired effect; this is likely hardware-dependent and should be reevaluated.
|
|
71
|
-
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
72
|
-
setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
73
|
-
|
|
74
|
-
useLayoutEffect(() => {
|
|
75
|
-
scrollToEnd('instant');
|
|
76
|
-
}, []);
|
|
77
|
-
|
|
78
|
-
// TODO(burdon): Change to model.
|
|
79
|
-
const handleCreate: MessageTextboxProps['onSend'] = () => {
|
|
80
|
-
if (!messageRef.current?.length) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
Obj.change(thread, (obj) => {
|
|
85
|
-
obj.messages.push(
|
|
86
|
-
Ref.make(
|
|
87
|
-
Obj.make(Message.Message, {
|
|
88
|
-
created: new Date().toISOString(),
|
|
89
|
-
sender: { identityDid: identity.did },
|
|
90
|
-
blocks: [{ _tag: 'text', text: messageRef.current }],
|
|
91
|
-
properties: context ? { context: Ref.make(context) } : undefined,
|
|
92
|
-
}),
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
messageRef.current = '';
|
|
98
|
-
setAutoFocus(true);
|
|
99
|
-
scrollToEnd('smooth');
|
|
100
|
-
rerenderEditor();
|
|
101
|
-
return true;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<ThreadComponent.Root
|
|
106
|
-
{...composableProps(props, {
|
|
107
|
-
classNames: 'dx-container grid-rows-[1fr_min-content_min-content]',
|
|
108
|
-
})}
|
|
109
|
-
id={id}
|
|
110
|
-
current={current}
|
|
111
|
-
ref={forwardedRef}
|
|
112
|
-
>
|
|
113
|
-
<ScrollArea.Root classNames='col-span-2' orientation='vertical'>
|
|
114
|
-
<ScrollArea.Viewport ref={threadScrollRef}>
|
|
115
|
-
<div role='none' className={mx(threadLayout, 'place-self-end')}>
|
|
116
|
-
{thread.messages
|
|
117
|
-
.map((message) => message.target)
|
|
118
|
-
.filter(isNonNullable)
|
|
119
|
-
.map((message) => (
|
|
120
|
-
<MessagePanel key={message.id} message={message} members={members} />
|
|
121
|
-
))}
|
|
122
|
-
</div>
|
|
123
|
-
</ScrollArea.Viewport>
|
|
124
|
-
</ScrollArea.Root>
|
|
125
|
-
|
|
126
|
-
<MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />
|
|
127
|
-
<ThreadComponent.Status activity={activity}>{t('activity.message')}</ThreadComponent.Status>
|
|
128
|
-
</ThreadComponent.Root>
|
|
129
|
-
);
|
|
130
|
-
},
|
|
131
|
-
);
|