@dxos/plugin-thread 0.8.3 → 0.8.4-main.03d5cd7b56
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/dist/lib/neutral/CallDebugPanel-CXWTCS7A.mjs +172 -0
- package/dist/lib/neutral/CallDebugPanel-CXWTCS7A.mjs.map +7 -0
- package/dist/lib/neutral/CallSidebar-YVXU6BOQ.mjs +25 -0
- package/dist/lib/neutral/CallSidebar-YVXU6BOQ.mjs.map +7 -0
- package/dist/lib/neutral/ChannelChat-EKQYQQXZ.mjs +10 -0
- package/dist/lib/neutral/ChannelContainer-XXMX5X43.mjs +9 -0
- package/dist/lib/neutral/ThreadCompanion-YGA2ORTJ.mjs +208 -0
- package/dist/lib/neutral/ThreadCompanion-YGA2ORTJ.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 +89 -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-5Z5XIHG3.mjs +15 -0
- package/dist/lib/neutral/ThreadSettings-5Z5XIHG3.mjs.map +7 -0
- package/dist/lib/neutral/add-message-WX3LCGZC.mjs +87 -0
- package/dist/lib/neutral/add-message-WX3LCGZC.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-BBHAUCMZ.mjs +173 -0
- package/dist/lib/neutral/app-graph-builder-BBHAUCMZ.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-J7N6UEBL.mjs +40 -0
- package/dist/lib/neutral/append-channel-message-J7N6UEBL.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/call-manager-JFA4DLWR.mjs +24 -0
- package/dist/lib/neutral/call-manager-JFA4DLWR.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +29 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-44D7D4ZX.mjs +20 -0
- package/dist/lib/neutral/chunk-44D7D4ZX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4SVMVL4L.mjs +164 -0
- package/dist/lib/neutral/chunk-4SVMVL4L.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs +36 -0
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BFHJWC3L.mjs +276 -0
- package/dist/lib/neutral/chunk-BFHJWC3L.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CROE4U4O.mjs +100 -0
- package/dist/lib/neutral/chunk-CROE4U4O.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EACFR36K.mjs +55 -0
- package/dist/lib/neutral/chunk-EACFR36K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FWSMZWBO.mjs +178 -0
- package/dist/lib/neutral/chunk-FWSMZWBO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{node-esm/chunk-PGRP3O4O.mjs → neutral/chunk-JLY4NVTA.mjs} +14 -9
- package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NGZVEPJV.mjs +8 -0
- package/dist/lib/neutral/chunk-NGZVEPJV.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-WXNPD542.mjs → neutral/chunk-PZ7WTAA2.mjs} +317 -505
- package/dist/lib/neutral/chunk-PZ7WTAA2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UQFTL6TV.mjs +202 -0
- package/dist/lib/neutral/chunk-UQFTL6TV.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1230 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +19 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-DGJZRLG7.mjs +52 -0
- package/dist/lib/neutral/create-DGJZRLG7.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-RP646IAE.mjs +19 -0
- package/dist/lib/neutral/create-channel-RP646IAE.mjs.map +7 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
- package/dist/lib/neutral/create-proposals-CPLU4YC6.mjs +56 -0
- package/dist/lib/neutral/create-proposals-CPLU4YC6.mjs.map +7 -0
- package/dist/lib/neutral/delete-MKKME2FE.mjs +57 -0
- package/dist/lib/neutral/delete-MKKME2FE.mjs.map +7 -0
- package/dist/lib/neutral/delete-message-UBZH3SZA.mjs +54 -0
- package/dist/lib/neutral/delete-message-UBZH3SZA.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +19 -0
- package/dist/lib/neutral/index.mjs +68 -0
- package/dist/lib/neutral/markdown-XQLZYS2O.mjs +83 -0
- package/dist/lib/neutral/markdown-XQLZYS2O.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-MRLZYOJR.mjs +23 -0
- package/dist/lib/neutral/on-create-space-MRLZYOJR.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-root-VMMNUSSL.mjs +18 -0
- package/dist/lib/neutral/react-root-VMMNUSSL.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-WPSVOTVG.mjs +94 -0
- package/dist/lib/neutral/react-surface-WPSVOTVG.mjs.map +7 -0
- package/dist/lib/neutral/restore-SUXNC6GE.mjs +32 -0
- package/dist/lib/neutral/restore-SUXNC6GE.mjs.map +7 -0
- package/dist/lib/neutral/restore-message-2TPJB32Y.mjs +33 -0
- package/dist/lib/neutral/restore-message-2TPJB32Y.mjs.map +7 -0
- package/dist/lib/neutral/select-H5RMZH43.mjs +24 -0
- package/dist/lib/neutral/select-H5RMZH43.mjs.map +7 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +58 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/toggle-resolved-HKZ4IRHG.mjs +36 -0
- package/dist/lib/neutral/toggle-resolved-HKZ4IRHG.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +90 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts +3 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
- package/dist/types/src/calls/call-manager.d.ts +40 -30
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +2 -2
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
- package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/audio.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +11 -6
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
- package/dist/types/src/calls/util/media.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +23 -0
- package/dist/types/src/calls-service.stories.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/call-manager.d.ts +3 -2
- package/dist/types/src/capabilities/call-manager.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 +19 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -5
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts +32 -4
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +6 -6
- package/dist/types/src/components/Call/Toolbar.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 +13 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts +14 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +15 -0
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
- package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +160 -5
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +15 -0
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +2 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/CallSidebar}/CallSidebar.d.ts +0 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts +2 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +12 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +8 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +8 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
- package/dist/types/src/extensions/command.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +1 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +9 -4
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts +2 -3
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +3 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +5 -0
- package/dist/types/src/operations/add-message.d.ts.map +1 -0
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +5 -0
- package/dist/types/src/operations/create-channel.d.ts.map +1 -0
- package/dist/types/src/operations/create-proposals.d.ts +5 -0
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/delete-message.d.ts +5 -0
- package/dist/types/src/operations/delete-message.d.ts.map +1 -0
- package/dist/types/src/operations/delete.d.ts +5 -0
- package/dist/types/src/operations/delete.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/restore-message.d.ts +5 -0
- package/dist/types/src/operations/restore-message.d.ts.map +1 -0
- package/dist/types/src/operations/restore.d.ts +5 -0
- package/dist/types/src/operations/restore.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +5 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +144 -194
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +5 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts +26 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ThreadOperation.d.ts +1995 -0
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -325
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +21 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +150 -80
- package/src/ThreadPlugin.node.ts +39 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +64 -147
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +36 -0
- package/src/calls/call-manager.ts +78 -50
- package/src/calls/call-swarm-synchronizer.ts +3 -3
- package/src/calls/media-manager.ts +77 -41
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +74 -19
- package/src/calls/util/stub-media-streams.ts +65 -9
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +230 -0
- package/src/capabilities/app-graph-builder.ts +176 -161
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/call-manager.ts +18 -10
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +17 -11
- package/src/capabilities/markdown.ts +54 -36
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +12 -9
- package/src/capabilities/react-surface.tsx +83 -74
- package/src/capabilities/settings.ts +26 -12
- package/src/capabilities/state.ts +14 -17
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +17 -12
- package/src/components/Call/Toolbar.tsx +63 -46
- package/src/components/Chat/Chat.tsx +258 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +95 -0
- package/src/components/CommentsPanel/CommentsPanel.tsx +71 -0
- package/src/components/CommentsPanel/CommentsThread.tsx +171 -0
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +21 -17
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +37 -30
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessagePanel/MessagePanel.tsx +221 -0
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +35 -15
- package/src/components/Participant/ParticipantGrid.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +51 -49
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +6 -6
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +15 -12
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +12 -12
- package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +7 -9
- package/src/components/ResponsiveGrid/index.ts +1 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +6 -12
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +173 -0
- package/src/containers/CallDebugPanel/index.ts +5 -0
- package/src/containers/CallSidebar/CallSidebar.tsx +18 -0
- package/src/containers/CallSidebar/index.ts +5 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +105 -0
- package/src/containers/ChannelContainer/ChannelContainer.tsx +223 -0
- package/src/containers/ChannelContainer/index.ts +5 -0
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +215 -0
- package/src/containers/ThreadCompanion/index.ts +5 -0
- package/src/containers/ThreadContainer/ThreadContainer.stories.tsx +86 -0
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +12 -0
- package/src/{components/command-extension.ts → extensions/command.ts} +7 -4
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +89 -44
- package/src/hooks/analytics.ts +22 -21
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +27 -0
- package/src/hooks/useVideoStreamTrack.tsx +36 -0
- package/src/index.ts +4 -3
- package/src/meta.ts +11 -7
- package/src/operations/add-message.ts +81 -0
- package/src/operations/append-channel-message.ts +37 -0
- package/src/operations/create-channel.ts +20 -0
- package/src/operations/create-proposals.ts +49 -0
- package/src/operations/create.ts +48 -0
- package/src/operations/delete-message.ts +53 -0
- package/src/operations/delete.ts +63 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/on-create-space.ts +27 -0
- package/src/operations/restore-message.ts +38 -0
- package/src/operations/restore.ts +38 -0
- package/src/operations/select.ts +24 -0
- package/src/operations/toggle-resolved.ts +41 -0
- package/src/plugin.ts +11 -0
- package/src/testing/data.ts +49 -0
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +77 -73
- package/src/types/Settings.ts +10 -0
- package/src/types/ThreadCapabilities.ts +41 -0
- package/src/types/ThreadOperation.ts +179 -0
- package/src/types/index.ts +4 -1
- package/src/types/types.ts +4 -92
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/typings.d.ts +8 -0
- package/src/util.ts +38 -6
- package/dist/lib/browser/ChannelContainer-PKFBVENP.mjs +0 -15
- package/dist/lib/browser/ChatContainer-RSOKYAMK.mjs +0 -14
- package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-OY7R7EJP.mjs.map +0 -7
- package/dist/lib/browser/call-manager-APQAZWHT.mjs +0 -23
- package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +0 -7
- package/dist/lib/browser/chunk-4H4A264L.mjs +0 -1708
- package/dist/lib/browser/chunk-4H4A264L.mjs.map +0 -7
- package/dist/lib/browser/chunk-5P5BH5GE.mjs +0 -88
- package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +0 -7
- package/dist/lib/browser/chunk-6NBVNXTM.mjs +0 -21
- package/dist/lib/browser/chunk-6NBVNXTM.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEXWNS6Z.mjs +0 -128
- package/dist/lib/browser/chunk-AEXWNS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-IIUTBDVB.mjs +0 -17
- package/dist/lib/browser/chunk-IIUTBDVB.mjs.map +0 -7
- package/dist/lib/browser/chunk-JKQUJOTX.mjs +0 -31
- package/dist/lib/browser/chunk-JKQUJOTX.mjs.map +0 -7
- package/dist/lib/browser/chunk-PG5CTFKK.mjs +0 -550
- package/dist/lib/browser/chunk-PG5CTFKK.mjs.map +0 -7
- package/dist/lib/browser/chunk-R5MDLUPC.mjs +0 -18
- package/dist/lib/browser/chunk-R5MDLUPC.mjs.map +0 -7
- package/dist/lib/browser/chunk-TAFSCSUR.mjs +0 -351
- package/dist/lib/browser/chunk-TAFSCSUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-XZKBN3NS.mjs +0 -983
- package/dist/lib/browser/chunk-XZKBN3NS.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -308
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs +0 -353
- package/dist/lib/browser/intent-resolver-FK2MDVDT.mjs.map +0 -7
- package/dist/lib/browser/markdown-TE5SWWNJ.mjs +0 -169
- package/dist/lib/browser/markdown-TE5SWWNJ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-root-NK3A4VG7.mjs +0 -27
- package/dist/lib/browser/react-root-NK3A4VG7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VXUJKSOG.mjs +0 -108
- package/dist/lib/browser/react-surface-VXUJKSOG.mjs.map +0 -7
- package/dist/lib/browser/settings-RB2RSLXV.mjs +0 -22
- package/dist/lib/browser/settings-RB2RSLXV.mjs.map +0 -7
- package/dist/lib/browser/state-RKL5MSDP.mjs +0 -34
- package/dist/lib/browser/state-RKL5MSDP.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -16
- package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs +0 -36
- package/dist/lib/node/ChannelContainer-YS5YT2ML.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-GCOM3M56.cjs +0 -35
- package/dist/lib/node/ChatContainer-GCOM3M56.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs +0 -179
- package/dist/lib/node/app-graph-builder-PBHJNDQY.cjs.map +0 -7
- package/dist/lib/node/call-manager-HV2XJW5O.cjs +0 -37
- package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +0 -7
- package/dist/lib/node/chunk-44I33JDT.cjs +0 -1731
- package/dist/lib/node/chunk-44I33JDT.cjs.map +0 -7
- package/dist/lib/node/chunk-4YSNVPWU.cjs +0 -37
- package/dist/lib/node/chunk-4YSNVPWU.cjs.map +0 -7
- package/dist/lib/node/chunk-E3WBZTTI.cjs +0 -371
- package/dist/lib/node/chunk-E3WBZTTI.cjs.map +0 -7
- package/dist/lib/node/chunk-ERG7G6FF.cjs +0 -59
- package/dist/lib/node/chunk-ERG7G6FF.cjs.map +0 -7
- package/dist/lib/node/chunk-FUXJAVFZ.cjs +0 -108
- package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +0 -7
- package/dist/lib/node/chunk-HLMCEE5K.cjs +0 -41
- package/dist/lib/node/chunk-HLMCEE5K.cjs.map +0 -7
- package/dist/lib/node/chunk-IP533AMV.cjs +0 -554
- package/dist/lib/node/chunk-IP533AMV.cjs.map +0 -7
- package/dist/lib/node/chunk-LR5NENBE.cjs +0 -54
- package/dist/lib/node/chunk-LR5NENBE.cjs.map +0 -7
- package/dist/lib/node/chunk-UM36TPCT.cjs +0 -984
- package/dist/lib/node/chunk-UM36TPCT.cjs.map +0 -7
- package/dist/lib/node/chunk-ZGDN3XBR.cjs +0 -149
- package/dist/lib/node/chunk-ZGDN3XBR.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -310
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs +0 -363
- package/dist/lib/node/intent-resolver-SYSJ5SJG.cjs.map +0 -7
- package/dist/lib/node/markdown-GQIPJS2F.cjs +0 -178
- package/dist/lib/node/markdown-GQIPJS2F.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-6HHDMULJ.cjs +0 -51
- package/dist/lib/node/react-root-6HHDMULJ.cjs.map +0 -7
- package/dist/lib/node/react-surface-NBH42NN2.cjs +0 -122
- package/dist/lib/node/react-surface-NBH42NN2.cjs.map +0 -7
- package/dist/lib/node/settings-4LQSFEDK.cjs +0 -36
- package/dist/lib/node/settings-4LQSFEDK.cjs.map +0 -7
- package/dist/lib/node/state-IY5XX3H2.cjs +0 -50
- package/dist/lib/node/state-IY5XX3H2.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -38
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-O4QJII2P.mjs +0 -16
- package/dist/lib/node-esm/ChatContainer-F6CSADV7.mjs +0 -15
- package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-BAHBHYWI.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs +0 -24
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2RNIPFDA.mjs +0 -984
- package/dist/lib/node-esm/chunk-2RNIPFDA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ESQC6SYE.mjs +0 -19
- package/dist/lib/node-esm/chunk-ESQC6SYE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K4KAUOKT.mjs +0 -19
- package/dist/lib/node-esm/chunk-K4KAUOKT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O3V45YJP.mjs +0 -90
- package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O63QJPQX.mjs +0 -23
- package/dist/lib/node-esm/chunk-O63QJPQX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P6RLFCNT.mjs +0 -352
- package/dist/lib/node-esm/chunk-P6RLFCNT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PGRP3O4O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UJMPYKT3.mjs +0 -129
- package/dist/lib/node-esm/chunk-UJMPYKT3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UZWVVFT3.mjs +0 -551
- package/dist/lib/node-esm/chunk-UZWVVFT3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -309
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs +0 -354
- package/dist/lib/node-esm/intent-resolver-BU73VYW3.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-HJUWNBLS.mjs +0 -170
- package/dist/lib/node-esm/markdown-HJUWNBLS.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-root-RUXOAQNW.mjs +0 -28
- package/dist/lib/node-esm/react-root-RUXOAQNW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs +0 -109
- package/dist/lib/node-esm/react-surface-ELXFYKP6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-EA7DFSM6.mjs +0 -23
- package/dist/lib/node-esm/settings-EA7DFSM6.mjs.map +0 -7
- package/dist/lib/node-esm/state-6AUTNROZ.mjs +0 -35
- package/dist/lib/node-esm/state-6AUTNROZ.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts +0 -27
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +0 -8
- package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.d.ts +0 -14
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -6
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -17
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/CommentContainer.d.ts +0 -13
- package/dist/types/src/components/CommentContainer.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -6
- package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsContainer.d.ts +0 -13
- package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/components/MessageContainer.d.ts +0 -11
- package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
- package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
- package/dist/types/src/components/ThreadSettings.d.ts +0 -6
- package/dist/types/src/components/ThreadSettings.d.ts.map +0 -1
- package/dist/types/src/components/command-extension.d.ts.map +0 -1
- package/dist/types/src/components/testing.d.ts +0 -4
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/peers.stories.d.ts +0 -11
- package/dist/types/src/peers.stories.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -2
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -133
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -296
- package/src/components/CallDebugPanel.tsx +0 -115
- package/src/components/CallSidebar.tsx +0 -17
- package/src/components/ChannelContainer.stories.tsx +0 -58
- package/src/components/ChannelContainer.tsx +0 -199
- package/src/components/Chat.stories.tsx +0 -88
- package/src/components/ChatContainer.tsx +0 -140
- package/src/components/CommentContainer.tsx +0 -198
- package/src/components/Comments.stories.tsx +0 -85
- package/src/components/CommentsContainer.tsx +0 -66
- package/src/components/MessageContainer.tsx +0 -167
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/components/ThreadSettings.tsx +0 -17
- package/src/components/testing.ts +0 -29
- package/src/peers.stories.tsx +0 -189
- package/src/testing/stories.ts +0 -50
- package/src/types/schema.ts +0 -33
- /package/dist/lib/{browser/ChannelContainer-PKFBVENP.mjs.map → neutral/ChannelChat-EKQYQQXZ.mjs.map} +0 -0
- /package/dist/lib/{browser/ChatContainer-RSOKYAMK.mjs.map → neutral/ChannelContainer-XXMX5X43.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-O4QJII2P.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/ChatContainer-F6CSADV7.mjs.map → neutral/index.mjs.map} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { EditorView } from '@codemirror/view';
|
|
6
|
-
import { Check, PencilSimple, X } from '@phosphor-icons/react';
|
|
7
|
-
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { Surface } from '@dxos/app-framework';
|
|
10
|
-
import { type Obj, type Type } from '@dxos/echo';
|
|
11
|
-
import { RefArray } from '@dxos/live-object';
|
|
12
|
-
import { PublicKey } from '@dxos/react-client';
|
|
13
|
-
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
14
|
-
import { useIdentity, type Identity } from '@dxos/react-client/halo';
|
|
15
|
-
import { Button, ButtonGroup, Tooltip, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
16
|
-
import { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';
|
|
17
|
-
import {
|
|
18
|
-
getSize,
|
|
19
|
-
hoverableControlItem,
|
|
20
|
-
hoverableControls,
|
|
21
|
-
hoverableFocusedWithinControls,
|
|
22
|
-
mx,
|
|
23
|
-
} from '@dxos/react-ui-theme';
|
|
24
|
-
import { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';
|
|
25
|
-
import { type DataType } from '@dxos/schema';
|
|
26
|
-
|
|
27
|
-
import { command } from './command-extension';
|
|
28
|
-
import { useOnEditAnalytics } from '../hooks';
|
|
29
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
30
|
-
import { getMessageMetadata } from '../util';
|
|
31
|
-
|
|
32
|
-
// TODO(thure): #8149
|
|
33
|
-
const messageControlClassNames = ['!p-1 !min-bs-0 transition-opacity', hoverableControlItem];
|
|
34
|
-
|
|
35
|
-
export type MessageContainerProps = {
|
|
36
|
-
message: DataType.Message;
|
|
37
|
-
members: SpaceMember[];
|
|
38
|
-
editable?: boolean;
|
|
39
|
-
onDelete?: (id: string) => void;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const MessageContainer = ({ message, members, editable = false, onDelete }: MessageContainerProps) => {
|
|
43
|
-
const senderIdentity = members.find(
|
|
44
|
-
(member) =>
|
|
45
|
-
(message.sender.identityDid && member.identity.did === message.sender.identityDid) ||
|
|
46
|
-
(message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),
|
|
47
|
-
)?.identity;
|
|
48
|
-
const messageMetadata = getMessageMetadata(message.id, senderIdentity);
|
|
49
|
-
const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;
|
|
50
|
-
const [editing, setEditing] = useState(false);
|
|
51
|
-
const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);
|
|
52
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
53
|
-
const editLabel = t(editing ? 'save message label' : 'edit message label');
|
|
54
|
-
const deleteLabel = t('delete message label');
|
|
55
|
-
const textBlock = message.blocks.find((block) => block.type === 'text');
|
|
56
|
-
const references = message.blocks.filter((block) => block.type === 'reference').map((block) => block.reference);
|
|
57
|
-
|
|
58
|
-
useOnEditAnalytics(message, textBlock, !!editing);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>
|
|
62
|
-
<MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>
|
|
63
|
-
<ButtonGroup classNames='mie-1'>
|
|
64
|
-
{userIsAuthor && editable && (
|
|
65
|
-
<Tooltip.Trigger asChild content={editLabel}>
|
|
66
|
-
<Button
|
|
67
|
-
variant='ghost'
|
|
68
|
-
data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}
|
|
69
|
-
classNames={messageControlClassNames}
|
|
70
|
-
onClick={() => setEditing((editing) => !editing)}
|
|
71
|
-
>
|
|
72
|
-
<span className='sr-only'>{editLabel}</span>
|
|
73
|
-
{editing ? <Check className={getSize(4)} /> : <PencilSimple className={getSize(4)} />}
|
|
74
|
-
</Button>
|
|
75
|
-
</Tooltip.Trigger>
|
|
76
|
-
)}
|
|
77
|
-
{onDelete && (
|
|
78
|
-
<Tooltip.Trigger asChild content={deleteLabel}>
|
|
79
|
-
<Button
|
|
80
|
-
variant='ghost'
|
|
81
|
-
data-testid='thread.message.delete'
|
|
82
|
-
classNames={messageControlClassNames}
|
|
83
|
-
onClick={() => handleDelete()}
|
|
84
|
-
>
|
|
85
|
-
<span className='sr-only'>{deleteLabel}</span>
|
|
86
|
-
<X className={getSize(4)} />
|
|
87
|
-
</Button>
|
|
88
|
-
</Tooltip.Trigger>
|
|
89
|
-
)}
|
|
90
|
-
</ButtonGroup>
|
|
91
|
-
</MessageHeading>
|
|
92
|
-
{textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}
|
|
93
|
-
{RefArray.targets(references).map((reference, index) => (
|
|
94
|
-
<MessagePart key={index} part={reference} />
|
|
95
|
-
))}
|
|
96
|
-
</MessageRoot>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const MessagePart = ({ part }: { part: Type.Expando }) => {
|
|
101
|
-
return <MessageBlockObjectTile subject={part} />;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const TextboxBlock = ({
|
|
105
|
-
block,
|
|
106
|
-
isAuthor,
|
|
107
|
-
editing,
|
|
108
|
-
}: {
|
|
109
|
-
block: DataType.MessageBlock.Text;
|
|
110
|
-
editing?: boolean;
|
|
111
|
-
isAuthor?: boolean;
|
|
112
|
-
identity?: Identity;
|
|
113
|
-
}) => {
|
|
114
|
-
const { themeMode } = useThemeContext();
|
|
115
|
-
const inMemoryContentRef = useRef(block.text);
|
|
116
|
-
|
|
117
|
-
const handleDocumentChange = useCallback((newState: string) => {
|
|
118
|
-
inMemoryContentRef.current = newState;
|
|
119
|
-
}, []);
|
|
120
|
-
|
|
121
|
-
const saveDocumentChange = useCallback(() => {
|
|
122
|
-
block.text = inMemoryContentRef.current;
|
|
123
|
-
}, [block]);
|
|
124
|
-
|
|
125
|
-
useOnTransition(editing, true, false, saveDocumentChange);
|
|
126
|
-
|
|
127
|
-
const { parentRef, focusAttributes, view } = useTextEditor(
|
|
128
|
-
() => ({
|
|
129
|
-
initialValue: block.text,
|
|
130
|
-
extensions: [
|
|
131
|
-
createBasicExtensions({ readOnly: !isAuthor || !editing }),
|
|
132
|
-
createThemeExtensions({ themeMode }),
|
|
133
|
-
command,
|
|
134
|
-
EditorView.updateListener.of((update) => {
|
|
135
|
-
if (update.docChanged) {
|
|
136
|
-
handleDocumentChange(update.state.doc.toString());
|
|
137
|
-
}
|
|
138
|
-
}),
|
|
139
|
-
],
|
|
140
|
-
}),
|
|
141
|
-
[block.text, editing, isAuthor, themeMode, handleDocumentChange],
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
editing && view?.focus();
|
|
146
|
-
}, [editing, view]);
|
|
147
|
-
|
|
148
|
-
return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(({ subject }, forwardedRef) => {
|
|
152
|
-
// TODO(burdon): Use annotation to get title.
|
|
153
|
-
let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';
|
|
154
|
-
if (typeof title !== 'string') {
|
|
155
|
-
title = title?.content ?? '';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<div
|
|
160
|
-
role='group'
|
|
161
|
-
className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}
|
|
162
|
-
ref={forwardedRef}
|
|
163
|
-
>
|
|
164
|
-
<Surface role='card' limit={1} data={{ subject }} fallback={title} />
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Capabilities,
|
|
9
|
-
LayoutAction,
|
|
10
|
-
createIntent,
|
|
11
|
-
useCapability,
|
|
12
|
-
useCapabilities,
|
|
13
|
-
useIntentDispatcher,
|
|
14
|
-
} from '@dxos/app-framework';
|
|
15
|
-
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
16
|
-
import { fullyQualifiedId, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
17
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
|
-
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
19
|
-
import { useAttended } from '@dxos/react-ui-attention';
|
|
20
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
21
|
-
import { Tabs } from '@dxos/react-ui-tabs';
|
|
22
|
-
import { AnchoredTo } from '@dxos/schema';
|
|
23
|
-
|
|
24
|
-
import { ThreadCapabilities } from '../capabilities';
|
|
25
|
-
import { CommentsContainer } from '../components';
|
|
26
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
27
|
-
import { ThreadAction, ThreadType } from '../types';
|
|
28
|
-
|
|
29
|
-
export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
30
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
31
|
-
const identity = useIdentity();
|
|
32
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
33
|
-
const { tx } = useThemeContext();
|
|
34
|
-
const subjectId = fullyQualifiedId(subject);
|
|
35
|
-
|
|
36
|
-
const { state, getViewState } = useCapability(ThreadCapabilities.MutableState);
|
|
37
|
-
const drafts = state.drafts[subjectId];
|
|
38
|
-
const viewState = useMemo(() => getViewState(subjectId), [getViewState, subjectId]);
|
|
39
|
-
const { showResolvedThreads } = viewState;
|
|
40
|
-
const onChangeViewState = useCallback(
|
|
41
|
-
(nextValue: string) => {
|
|
42
|
-
viewState.showResolvedThreads = nextValue === 'all';
|
|
43
|
-
},
|
|
44
|
-
[viewState],
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const anchorSorts = useCapabilities(Capabilities.AnchorSort);
|
|
48
|
-
const sort = useMemo(
|
|
49
|
-
() => anchorSorts.find(({ key }) => key === Obj.getTypename(subject))?.sort,
|
|
50
|
-
[anchorSorts, subject],
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const space = getSpace(subject);
|
|
54
|
-
const objectsAnchoredTo = useQuery(space, Query.select(Filter.ids(subject.id)).targetOf(AnchoredTo));
|
|
55
|
-
const anchors = objectsAnchoredTo
|
|
56
|
-
.toSorted((a, b) => sort?.(a, b) ?? 0)
|
|
57
|
-
.filter((anchor) => Obj.instanceOf(ThreadType, Relation.getSource(anchor)))
|
|
58
|
-
.concat(drafts ?? []);
|
|
59
|
-
|
|
60
|
-
const attended = useAttended();
|
|
61
|
-
|
|
62
|
-
const handleAttend = useCallback(
|
|
63
|
-
(anchor: AnchoredTo) => {
|
|
64
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
65
|
-
const threadId = fullyQualifiedId(thread);
|
|
66
|
-
|
|
67
|
-
if (state.current !== threadId) {
|
|
68
|
-
state.current = threadId;
|
|
69
|
-
|
|
70
|
-
// TODO(wittjosiah): Should this be a thread-specific intent?
|
|
71
|
-
// The layout doesn't know about threads and this working depends on other plugins conditionally handling it.
|
|
72
|
-
// This may be overloading this intent or highjacking its intended purpose.
|
|
73
|
-
void dispatch(
|
|
74
|
-
createIntent(LayoutAction.ScrollIntoView, {
|
|
75
|
-
part: 'current',
|
|
76
|
-
subject: fullyQualifiedId(subject),
|
|
77
|
-
options: {
|
|
78
|
-
cursor: anchor.anchor,
|
|
79
|
-
ref: threadId,
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
[state.current, dispatch, subject],
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const handleComment = useCallback(
|
|
89
|
-
async (anchor: AnchoredTo, text: string) => {
|
|
90
|
-
await dispatch(
|
|
91
|
-
createIntent(ThreadAction.AddMessage, { anchor, subject, sender: { identityDid: identity?.did }, text }),
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
95
|
-
state.current = fullyQualifiedId(thread);
|
|
96
|
-
},
|
|
97
|
-
[dispatch, identity, subject],
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const handleResolve = useCallback(
|
|
101
|
-
(anchor: AnchoredTo) =>
|
|
102
|
-
dispatch(createIntent(ThreadAction.ToggleResolved, { thread: Relation.getSource(anchor) as ThreadType })),
|
|
103
|
-
[dispatch],
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
const handleThreadDelete = useCallback(
|
|
107
|
-
(anchor: AnchoredTo) => dispatch(createIntent(ThreadAction.Delete, { anchor, subject })),
|
|
108
|
-
[dispatch, subject],
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const handleMessageDelete = useCallback(
|
|
112
|
-
(anchor: AnchoredTo, messageId: string) =>
|
|
113
|
-
dispatch(createIntent(ThreadAction.DeleteMessage, { anchor, subject, messageId })),
|
|
114
|
-
[dispatch, subject],
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
const comments = (
|
|
118
|
-
<CommentsContainer
|
|
119
|
-
anchors={anchors}
|
|
120
|
-
currentId={attended.includes(subjectId) ? state.current : undefined}
|
|
121
|
-
showResolvedThreads={showResolvedThreads}
|
|
122
|
-
onAttend={handleAttend}
|
|
123
|
-
onComment={handleComment}
|
|
124
|
-
onResolve={handleResolve}
|
|
125
|
-
onMessageDelete={handleMessageDelete}
|
|
126
|
-
onThreadDelete={handleThreadDelete}
|
|
127
|
-
/>
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<StackItem.Content toolbar>
|
|
132
|
-
<Tabs.Root
|
|
133
|
-
value={showResolvedThreads ? 'all' : 'unresolved'}
|
|
134
|
-
orientation='horizontal'
|
|
135
|
-
classNames='contents [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:overflow-y-auto [&_[role="tabpanel"]]:scrollbar-thin'
|
|
136
|
-
onValueChange={onChangeViewState}
|
|
137
|
-
>
|
|
138
|
-
<Tabs.Tablist classNames={tx('toolbar.root', 'toolbar', {})}>
|
|
139
|
-
<Tabs.Tab value='unresolved' classNames='text-sm'>
|
|
140
|
-
{t('show unresolved label')}
|
|
141
|
-
</Tabs.Tab>
|
|
142
|
-
<Tabs.Tab value='all' classNames='text-sm'>
|
|
143
|
-
{t('show all label')}
|
|
144
|
-
</Tabs.Tab>
|
|
145
|
-
</Tabs.Tablist>
|
|
146
|
-
<Tabs.Tabpanel value='all'>{showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
147
|
-
<Tabs.Tabpanel value='unresolved'>{!showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
148
|
-
</Tabs.Root>
|
|
149
|
-
</StackItem.Content>
|
|
150
|
-
);
|
|
151
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
// import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { DeprecatedFormContainer } from '@dxos/react-ui-form';
|
|
9
|
-
|
|
10
|
-
// import { THREAD_PLUGIN } from '../meta';
|
|
11
|
-
import type { ThreadSettingsProps } from '../types';
|
|
12
|
-
|
|
13
|
-
export const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps }) => {
|
|
14
|
-
// const { t } = useTranslation(THREAD_PLUGIN);
|
|
15
|
-
|
|
16
|
-
return <DeprecatedFormContainer></DeprecatedFormContainer>;
|
|
17
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
6
|
-
import { IdentityDid } from '@dxos/keys';
|
|
7
|
-
import { faker } from '@dxos/random';
|
|
8
|
-
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import { DataType } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
-
import { ThreadType } from '../types';
|
|
12
|
-
|
|
13
|
-
export const createCommentThread = (identity: Identity): ThreadType => {
|
|
14
|
-
return Obj.make(ThreadType, {
|
|
15
|
-
messages: faker.helpers.multiple(
|
|
16
|
-
() =>
|
|
17
|
-
Ref.make(
|
|
18
|
-
Obj.make(DataType.Message, {
|
|
19
|
-
sender: {
|
|
20
|
-
identityDid: faker.datatype.boolean() ? identity.did : IdentityDid.random(),
|
|
21
|
-
},
|
|
22
|
-
created: new Date().toISOString(),
|
|
23
|
-
blocks: [{ type: 'text', text: faker.lorem.sentences(3) }],
|
|
24
|
-
}),
|
|
25
|
-
),
|
|
26
|
-
{ count: { min: 2, max: 3 } },
|
|
27
|
-
),
|
|
28
|
-
});
|
|
29
|
-
};
|
package/src/peers.stories.tsx
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { scheduleTask, sleep } from '@dxos/async';
|
|
11
|
-
import { Context } from '@dxos/context';
|
|
12
|
-
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import { log } from '@dxos/log';
|
|
14
|
-
import { Config, useConfig } from '@dxos/react-client';
|
|
15
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
16
|
-
import { Button } from '@dxos/react-ui';
|
|
17
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
18
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
|
-
|
|
20
|
-
import { type TrackObject, CallsServicePeer, CALLS_URL } from './calls';
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
import video from '../testing/video.mp4';
|
|
23
|
-
|
|
24
|
-
const useVideoStreamTrack = (videoElement: HTMLVideoElement | null) => {
|
|
25
|
-
// Get video stream track.
|
|
26
|
-
const [videoStreamTrack, setVideoStreamTrack] = useState<MediaStreamTrack | undefined>(undefined);
|
|
27
|
-
const hadRun = useRef(false);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
// This is done to capture only one video stream.
|
|
30
|
-
if (!videoElement || hadRun.current || !video) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
hadRun.current = true;
|
|
34
|
-
|
|
35
|
-
videoElement.src = video;
|
|
36
|
-
videoElement.addEventListener('playing', () => {
|
|
37
|
-
const stream = (videoElement as any).captureStream();
|
|
38
|
-
log.info('captured stream', { stream });
|
|
39
|
-
stream.onaddtrack = (event: MediaStreamTrackEvent) => {
|
|
40
|
-
if (event.track.kind === 'video') {
|
|
41
|
-
log.info('video stream track state', { state: event.track.readyState });
|
|
42
|
-
setVideoStreamTrack(event.track);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
}, [videoElement]);
|
|
47
|
-
|
|
48
|
-
return videoStreamTrack;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const DefaultStory = ({ videoSrc }: { videoSrc: string }) => {
|
|
52
|
-
const config = useConfig();
|
|
53
|
-
const callsConfig = {
|
|
54
|
-
iceServers: config.get('runtime.services.ice'),
|
|
55
|
-
apiBase: `${CALLS_URL}/api/calls`,
|
|
56
|
-
};
|
|
57
|
-
const peerPush = useMemo(() => new CallsServicePeer(callsConfig), []);
|
|
58
|
-
const peerPull = useMemo(() => new CallsServicePeer(callsConfig), []);
|
|
59
|
-
const pushVideoElement = useRef<HTMLVideoElement>(null);
|
|
60
|
-
const pullVideoElement = useRef<HTMLVideoElement>(null);
|
|
61
|
-
const [metrics, setMetrics] = useState<Record<string, any>>({});
|
|
62
|
-
// Get video stream track.
|
|
63
|
-
const videoStreamTrack = useVideoStreamTrack(pushVideoElement.current);
|
|
64
|
-
const pullCtx = useRef<Context | undefined>(undefined);
|
|
65
|
-
const trackInfo = useRef<TrackObject | undefined>(undefined);
|
|
66
|
-
const hadRun = useRef(false);
|
|
67
|
-
|
|
68
|
-
// Push/pull video stream track to cloudflare.
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (hadRun.current || !videoStreamTrack || !peerPush || !peerPull) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
hadRun.current = true;
|
|
74
|
-
const ctx = new Context();
|
|
75
|
-
scheduleTask(ctx, async () => {
|
|
76
|
-
log.info('starting push/pull', { videoStreamTrack });
|
|
77
|
-
await peerPush.open();
|
|
78
|
-
await peerPull.open();
|
|
79
|
-
ctx.onDispose(() => {
|
|
80
|
-
void peerPush.close();
|
|
81
|
-
void peerPull.close();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
// Push track to cloudflare.
|
|
85
|
-
performance.mark('push:begin');
|
|
86
|
-
const pushedTrack = await peerPush.pushTrack({ track: videoStreamTrack });
|
|
87
|
-
trackInfo.current = pushedTrack;
|
|
88
|
-
performance.mark('push:end');
|
|
89
|
-
const pushTime = performance.measure('push', 'push:begin', 'push:end').duration;
|
|
90
|
-
log.info('successfully pushed track', { pushTime, pushedTrack });
|
|
91
|
-
setMetrics((prev) => ({ ...prev, 'time to push track [ms]': Math.round(pushTime) }));
|
|
92
|
-
|
|
93
|
-
// Wait for cloudflare to process the track.
|
|
94
|
-
await sleep(500);
|
|
95
|
-
|
|
96
|
-
// Pull track from cloudflare.
|
|
97
|
-
performance.mark('pullTrack:begin');
|
|
98
|
-
pullCtx.current = new Context();
|
|
99
|
-
const pulledTrack = await peerPull.pullTrack({
|
|
100
|
-
trackData: { ...pushedTrack, mid: undefined },
|
|
101
|
-
ctx: pullCtx.current,
|
|
102
|
-
});
|
|
103
|
-
performance.mark('pullTrack:end');
|
|
104
|
-
const pullTime = performance.measure('pullTrack', 'pullTrack:begin', 'pullTrack:end').duration;
|
|
105
|
-
setMetrics((prev) => ({ ...prev, 'time to pull track [ms]': Math.round(pullTime) }));
|
|
106
|
-
log.info('successfully pulled track', { pullTime, pulledTrack });
|
|
107
|
-
|
|
108
|
-
invariant(pulledTrack);
|
|
109
|
-
invariant(pullVideoElement.current);
|
|
110
|
-
performance.mark('playVideo:begin');
|
|
111
|
-
pullVideoElement.current.srcObject = new MediaStream([pulledTrack]);
|
|
112
|
-
await pullVideoElement.current.play();
|
|
113
|
-
performance.mark('playVideo:end');
|
|
114
|
-
const playTime = performance.measure('playVideo', 'playVideo:begin', 'playVideo:end').duration;
|
|
115
|
-
setMetrics((prev) => ({ ...prev, 'time to play pulled video [ms]': Math.round(playTime) }));
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
return () => {
|
|
119
|
-
void ctx.dispose();
|
|
120
|
-
};
|
|
121
|
-
}, [videoStreamTrack, peerPush, peerPull]);
|
|
122
|
-
|
|
123
|
-
const handleRePullVideo = async () => {
|
|
124
|
-
performance.mark('rePullVideo:begin');
|
|
125
|
-
invariant(pullVideoElement.current);
|
|
126
|
-
invariant(pullVideoElement.current.srcObject instanceof MediaStream);
|
|
127
|
-
const pulledTrack = pullVideoElement.current.srcObject.getTracks()[0];
|
|
128
|
-
invariant(pulledTrack);
|
|
129
|
-
pullVideoElement.current.srcObject.removeTrack(pulledTrack);
|
|
130
|
-
await pullCtx.current!.dispose();
|
|
131
|
-
pulledTrack.stop();
|
|
132
|
-
pullCtx.current = new Context();
|
|
133
|
-
const newPulledTrack = await peerPull.pullTrack({
|
|
134
|
-
trackData: { ...trackInfo.current!, mid: undefined },
|
|
135
|
-
ctx: pullCtx.current,
|
|
136
|
-
});
|
|
137
|
-
invariant(newPulledTrack);
|
|
138
|
-
pullVideoElement.current.srcObject.addTrack(newPulledTrack);
|
|
139
|
-
performance.mark('rePullVideo:end');
|
|
140
|
-
const rePullTime = performance.measure('rePullVideo', 'rePullVideo:begin', 'rePullVideo:end').duration;
|
|
141
|
-
setMetrics((prev) => ({ ...prev, 'time to re-pull video [ms]': Math.round(rePullTime) }));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<div className='grid grid-cols-3 gap-4 items-center'>
|
|
146
|
-
<video ref={pushVideoElement} muted autoPlay src={video} loop />
|
|
147
|
-
<Json data={metrics} />
|
|
148
|
-
<div className='flex flex-col gap-4'>
|
|
149
|
-
<video ref={pullVideoElement} muted />
|
|
150
|
-
<Button
|
|
151
|
-
disabled={
|
|
152
|
-
!(
|
|
153
|
-
pullVideoElement?.current?.srcObject instanceof MediaStream &&
|
|
154
|
-
pullVideoElement.current.srcObject.getTracks()[0]
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
onClick={handleRePullVideo}
|
|
158
|
-
>
|
|
159
|
-
Re-pull video
|
|
160
|
-
</Button>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const meta: Meta<typeof DefaultStory> = {
|
|
167
|
-
title: 'plugins/plugin-thread/peers',
|
|
168
|
-
render: DefaultStory,
|
|
169
|
-
decorators: [
|
|
170
|
-
withClientProvider({
|
|
171
|
-
config: new Config({ runtime: { services: { iceProviders: [{ urls: 'https://edge.dxos.workers.dev/ice' }] } } }),
|
|
172
|
-
}),
|
|
173
|
-
withTheme,
|
|
174
|
-
withLayout(),
|
|
175
|
-
],
|
|
176
|
-
parameters: {
|
|
177
|
-
layout: 'centered',
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export default meta;
|
|
182
|
-
|
|
183
|
-
type Story = StoryObj<typeof DefaultStory>;
|
|
184
|
-
|
|
185
|
-
export const Default: Story = {
|
|
186
|
-
args: {
|
|
187
|
-
videoSrc: video,
|
|
188
|
-
},
|
|
189
|
-
};
|
package/src/testing/stories.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
6
|
-
import { Obj } from '@dxos/echo';
|
|
7
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
8
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
9
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
10
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
11
|
-
import { Config } from '@dxos/react-client';
|
|
12
|
-
import { Ref } from '@dxos/react-client/echo';
|
|
13
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
14
|
-
|
|
15
|
-
import { ThreadPlugin } from '../ThreadPlugin';
|
|
16
|
-
import { ChannelType, ThreadType } from '../types';
|
|
17
|
-
|
|
18
|
-
export const createThreadPlugins = async () => [
|
|
19
|
-
ThemePlugin({ tx: defaultTx }),
|
|
20
|
-
ClientPlugin({
|
|
21
|
-
onClientInitialized: async (_, client) => {
|
|
22
|
-
await client.halo.createIdentity({ displayName: 'Test User' });
|
|
23
|
-
},
|
|
24
|
-
onSpacesReady: async (_, client) => {
|
|
25
|
-
await client.spaces.default.waitUntilReady();
|
|
26
|
-
const thread = Obj.make(ThreadType, { messages: [] });
|
|
27
|
-
client.spaces.default.db.add(Obj.make(ChannelType, { defaultThread: Ref.make(thread), threads: [] }));
|
|
28
|
-
},
|
|
29
|
-
config: new Config({
|
|
30
|
-
runtime: {
|
|
31
|
-
client: { edgeFeatures: { signaling: true } },
|
|
32
|
-
services: {
|
|
33
|
-
edge: {
|
|
34
|
-
url: 'https://edge.dxos.workers.dev/',
|
|
35
|
-
},
|
|
36
|
-
iceProviders: [
|
|
37
|
-
{
|
|
38
|
-
urls: 'https://edge.dxos.workers.dev/ice',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
}),
|
|
45
|
-
SpacePlugin(),
|
|
46
|
-
IntentPlugin(),
|
|
47
|
-
SettingsPlugin(),
|
|
48
|
-
GraphPlugin(),
|
|
49
|
-
ThreadPlugin(),
|
|
50
|
-
];
|
package/src/types/schema.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
import { DataType } from '@dxos/schema';
|
|
9
|
-
|
|
10
|
-
export const ThreadStatus = Schema.Union(
|
|
11
|
-
Schema.Literal('staged'),
|
|
12
|
-
Schema.Literal('active'),
|
|
13
|
-
Schema.Literal('resolved'),
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const _ThreadType = Schema.Struct({
|
|
17
|
-
name: Schema.optional(Schema.String),
|
|
18
|
-
status: Schema.optional(ThreadStatus),
|
|
19
|
-
messages: Schema.mutable(Schema.Array(Type.Ref(DataType.Message))),
|
|
20
|
-
}).pipe(Type.Obj({ typename: 'dxos.org/type/Thread', version: '0.1.0' }));
|
|
21
|
-
export interface ThreadType extends Schema.Schema.Type<typeof _ThreadType> {}
|
|
22
|
-
export const ThreadType: Type.obj<Schema.Schema<ThreadType, Schema.Schema.Encoded<typeof _ThreadType>, never>> =
|
|
23
|
-
_ThreadType;
|
|
24
|
-
|
|
25
|
-
const _ChannelType = Schema.Struct({
|
|
26
|
-
name: Schema.optional(Schema.String),
|
|
27
|
-
defaultThread: Type.Ref(ThreadType),
|
|
28
|
-
// TODO(wittjosiah): Should be an "ordered collection".
|
|
29
|
-
threads: Schema.mutable(Schema.Array(Type.Ref(ThreadType))),
|
|
30
|
-
}).pipe(Type.Obj({ typename: 'dxos.org/type/Channel', version: '0.1.0' }));
|
|
31
|
-
export interface ChannelType extends Schema.Schema.Type<typeof _ChannelType> {}
|
|
32
|
-
export const ChannelType: Type.obj<Schema.Schema<ChannelType, Schema.Schema.Encoded<typeof _ChannelType>, never>> =
|
|
33
|
-
_ChannelType;
|
/package/dist/lib/{browser/ChannelContainer-PKFBVENP.mjs.map → neutral/ChannelChat-EKQYQQXZ.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{node-esm/ChannelContainer-O4QJII2P.mjs.map → neutral/chunk-J5LGTIGS.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|