@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
|
@@ -0,0 +1,1230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
command
|
|
3
|
+
} from "../chunk-4SVMVL4L.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getMessageMetadata
|
|
6
|
+
} from "../chunk-JLY4NVTA.mjs";
|
|
7
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/components/index.ts
|
|
10
|
+
import { lazy } from "react";
|
|
11
|
+
|
|
12
|
+
// src/components/Call/Call.tsx
|
|
13
|
+
import { useAtomValue as useAtomValue3 } from "@effect-atom/atom-react";
|
|
14
|
+
import React9 from "react";
|
|
15
|
+
import { useCapability as useCapability3 } from "@dxos/app-framework/ui";
|
|
16
|
+
import { useDebugMode } from "#hooks";
|
|
17
|
+
import { ThreadCapabilities as ThreadCapabilities3 } from "#types";
|
|
18
|
+
|
|
19
|
+
// src/components/Media/AudioStream.tsx
|
|
20
|
+
import React, { useEffect, useRef } from "react";
|
|
21
|
+
var AudioStream = ({ tracks }) => {
|
|
22
|
+
const mediaStreamRef = useRef(new MediaStream());
|
|
23
|
+
const ref = useRef(null);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const audio = ref.current;
|
|
26
|
+
if (!audio) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const mediaStream = mediaStreamRef.current;
|
|
30
|
+
audio.srcObject = mediaStream;
|
|
31
|
+
}, []);
|
|
32
|
+
const resetSrcObject = () => {
|
|
33
|
+
const audio = ref.current;
|
|
34
|
+
const mediaStream = mediaStreamRef.current;
|
|
35
|
+
if (!audio || !mediaStream) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
audio.addEventListener("canplay", () => audio.play(), {
|
|
39
|
+
once: true
|
|
40
|
+
});
|
|
41
|
+
audio.srcObject = mediaStream;
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("audio", {
|
|
44
|
+
ref,
|
|
45
|
+
autoPlay: true
|
|
46
|
+
}), tracks.map((track) => /* @__PURE__ */ React.createElement(AudioTrack, {
|
|
47
|
+
key: track.id,
|
|
48
|
+
track,
|
|
49
|
+
mediaStream: mediaStreamRef.current,
|
|
50
|
+
resetSrcObject
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
53
|
+
var AudioTrack = ({ track, mediaStream, resetSrcObject }) => {
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const currentTrack = track;
|
|
56
|
+
mediaStream.addTrack(currentTrack);
|
|
57
|
+
resetSrcObject();
|
|
58
|
+
return () => {
|
|
59
|
+
mediaStream.removeTrack(currentTrack);
|
|
60
|
+
resetSrcObject();
|
|
61
|
+
};
|
|
62
|
+
}, [
|
|
63
|
+
track,
|
|
64
|
+
mediaStream
|
|
65
|
+
]);
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/components/Media/VideoObject.tsx
|
|
70
|
+
import React2, { forwardRef, memo, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
71
|
+
import { mx } from "@dxos/ui-theme";
|
|
72
|
+
var VideoObject = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ videoStream, classNames, flip, contain, ...rest }, ref) => {
|
|
73
|
+
const internalRef = useRef2(null);
|
|
74
|
+
useEffect2(() => {
|
|
75
|
+
const video = internalRef.current;
|
|
76
|
+
if (video && videoStream) {
|
|
77
|
+
video.srcObject = videoStream;
|
|
78
|
+
video.setAttribute("autoplay", "true");
|
|
79
|
+
video.setAttribute("playsinline", "true");
|
|
80
|
+
}
|
|
81
|
+
}, [
|
|
82
|
+
videoStream,
|
|
83
|
+
internalRef.current
|
|
84
|
+
]);
|
|
85
|
+
return /* @__PURE__ */ React2.createElement("video", {
|
|
86
|
+
className: mx("w-full aspect-video", flip && "scale-x-[-1]", contain ? "object-contain" : "object-cover", classNames),
|
|
87
|
+
ref: (v) => {
|
|
88
|
+
internalRef.current = v;
|
|
89
|
+
if (ref === null) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (typeof ref === "function") {
|
|
93
|
+
ref(v);
|
|
94
|
+
} else {
|
|
95
|
+
ref.current = v;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
...rest
|
|
99
|
+
});
|
|
100
|
+
}));
|
|
101
|
+
VideoObject.displayName = "VideoObject";
|
|
102
|
+
|
|
103
|
+
// src/components/Participant/Participant.tsx
|
|
104
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
105
|
+
import React6, { memo as memo2, useMemo as useMemo2 } from "react";
|
|
106
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
107
|
+
import { ThreadCapabilities } from "#types";
|
|
108
|
+
|
|
109
|
+
// src/components/ResponsiveGrid/ResponsivePanel.tsx
|
|
110
|
+
import React3 from "react";
|
|
111
|
+
import { mx as mx2 } from "@dxos/ui-theme";
|
|
112
|
+
var ResponsivePanel = ({ children }) => {
|
|
113
|
+
return (
|
|
114
|
+
// Outer container that takes full size of parent.
|
|
115
|
+
/* @__PURE__ */ React3.createElement("div", {
|
|
116
|
+
className: "dx-expander relative flex"
|
|
117
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
118
|
+
className: "absolute inset-0 flex justify-center items-center"
|
|
119
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
120
|
+
className: mx2("max-h-full max-w-full w-auto h-auto aspect-video")
|
|
121
|
+
}, children)))
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// src/components/ResponsiveGrid/ResponsiveGrid.tsx
|
|
126
|
+
import React4, { useCallback, useEffect as useEffect3, useLayoutEffect, useMemo, useState } from "react";
|
|
127
|
+
import { useResizeDetector } from "react-resize-detector";
|
|
128
|
+
import { invariant } from "@dxos/invariant";
|
|
129
|
+
import { mx as mx3 } from "@dxos/ui-theme";
|
|
130
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/components/ResponsiveGrid/ResponsiveGrid.tsx";
|
|
131
|
+
var ASPECT_RATIO = 16 / 9;
|
|
132
|
+
var MIN_GALLERY_HEIGHT = 250;
|
|
133
|
+
var DEFAULT_GAP = 8;
|
|
134
|
+
var maxImageSize = "w-[2560px] h-[1440px]";
|
|
135
|
+
var defaultGetId = (item) => item.id;
|
|
136
|
+
var ResponsiveGrid = ({ classNames, Cell, gap = DEFAULT_GAP, getId: getId2 = defaultGetId, items, pinned, autoHideGallery = false, debug, onPinnedChange }) => {
|
|
137
|
+
const { width: containerWidth = 0, height: containerHeight = 0, ref: containerRef } = useResizeDetector({
|
|
138
|
+
refreshRate: 100
|
|
139
|
+
});
|
|
140
|
+
const [dividerHeight, setDividerHeight] = useState(0);
|
|
141
|
+
useEffect3(() => {
|
|
142
|
+
if (containerWidth && containerHeight) {
|
|
143
|
+
const { height: height2 } = fitAspectRatio(containerWidth, containerHeight, ASPECT_RATIO);
|
|
144
|
+
setDividerHeight(Math.min(height2, containerHeight - MIN_GALLERY_HEIGHT));
|
|
145
|
+
}
|
|
146
|
+
}, [
|
|
147
|
+
containerWidth,
|
|
148
|
+
containerHeight
|
|
149
|
+
]);
|
|
150
|
+
const pinnedItem = useMemo(() => items.find((item) => getId2(item) === pinned), [
|
|
151
|
+
items,
|
|
152
|
+
pinned
|
|
153
|
+
]);
|
|
154
|
+
const mainItems = useMemo(() => items.filter((item) => getId2(item) !== pinned), [
|
|
155
|
+
items,
|
|
156
|
+
pinned
|
|
157
|
+
]);
|
|
158
|
+
const hideGallery = autoHideGallery && pinnedItem !== void 0;
|
|
159
|
+
const [{ time, columns, cellWidth }, setLayout] = useState({
|
|
160
|
+
time: 0,
|
|
161
|
+
columns: 0,
|
|
162
|
+
cellWidth: 0
|
|
163
|
+
});
|
|
164
|
+
const { width = 0, height = 0, ref: gridContainerRef } = useResizeDetector({
|
|
165
|
+
refreshRate: 200
|
|
166
|
+
});
|
|
167
|
+
useEffect3(() => {
|
|
168
|
+
if (containerHeight && width && height) {
|
|
169
|
+
const layout = calculateLayout(width, height, mainItems.length, gap);
|
|
170
|
+
setLayout({
|
|
171
|
+
time: Date.now(),
|
|
172
|
+
...layout
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}, [
|
|
176
|
+
containerHeight,
|
|
177
|
+
width,
|
|
178
|
+
height,
|
|
179
|
+
mainItems.length,
|
|
180
|
+
gap,
|
|
181
|
+
pinned
|
|
182
|
+
]);
|
|
183
|
+
const [bounds, setBounds] = useState([]);
|
|
184
|
+
useLayoutEffect(() => {
|
|
185
|
+
if (!hideGallery && !gridContainerRef.current || !containerHeight) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const t = setTimeout(() => {
|
|
189
|
+
setBounds(items.filter((item) => !hideGallery || item === pinnedItem).map((item) => {
|
|
190
|
+
invariant(containerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 79, S: void 0, A: ["containerRef.current", ""] });
|
|
191
|
+
const el = containerRef.current.querySelector(`[data-grid-item="${getId2(item)}"]`);
|
|
192
|
+
if (!el) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
const bounds2 = getRelativeBounds(containerRef.current, el);
|
|
196
|
+
return [
|
|
197
|
+
item,
|
|
198
|
+
bounds2
|
|
199
|
+
];
|
|
200
|
+
}).filter((item) => item !== null));
|
|
201
|
+
});
|
|
202
|
+
return () => clearTimeout(t);
|
|
203
|
+
}, [
|
|
204
|
+
containerHeight,
|
|
205
|
+
items,
|
|
206
|
+
pinnedItem,
|
|
207
|
+
hideGallery,
|
|
208
|
+
time
|
|
209
|
+
]);
|
|
210
|
+
const handleClick = useCallback((item) => onPinnedChange?.(getId2(item) === pinned ? void 0 : getId2(item)), [
|
|
211
|
+
pinned,
|
|
212
|
+
onPinnedChange
|
|
213
|
+
]);
|
|
214
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
215
|
+
ref: containerRef,
|
|
216
|
+
className: mx3("dx-expander relative", classNames)
|
|
217
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
218
|
+
className: "absolute inset-0 flex flex-col grow gap-2"
|
|
219
|
+
}, pinnedItem && /* @__PURE__ */ React4.createElement("div", {
|
|
220
|
+
className: mx3("flex grow-[2] shrink overflow-hidden justify-center items-center", hideGallery && "h-full"),
|
|
221
|
+
style: hideGallery ? {} : {
|
|
222
|
+
height: dividerHeight
|
|
223
|
+
}
|
|
224
|
+
}, /* @__PURE__ */ React4.createElement(SoloItem, {
|
|
225
|
+
id: getId2(pinnedItem),
|
|
226
|
+
debug
|
|
227
|
+
})), !hideGallery && /* @__PURE__ */ React4.createElement("div", {
|
|
228
|
+
ref: gridContainerRef,
|
|
229
|
+
className: "flex grow-[1] overflow-hidden justify-center items-center",
|
|
230
|
+
style: hideGallery ? {} : {
|
|
231
|
+
minHeight: MIN_GALLERY_HEIGHT
|
|
232
|
+
}
|
|
233
|
+
}, mainItems.length === 1 && /* @__PURE__ */ React4.createElement("div", {
|
|
234
|
+
style: {
|
|
235
|
+
width: cellWidth
|
|
236
|
+
},
|
|
237
|
+
className: "flex h-full"
|
|
238
|
+
}, /* @__PURE__ */ React4.createElement(SoloItem, {
|
|
239
|
+
id: getId2(mainItems[0]),
|
|
240
|
+
debug
|
|
241
|
+
})), mainItems.length > 1 && columns > 0 && /* @__PURE__ */ React4.createElement("div", {
|
|
242
|
+
role: "grid",
|
|
243
|
+
style: {
|
|
244
|
+
display: "grid",
|
|
245
|
+
gridTemplateColumns: `repeat(${columns}, ${cellWidth}px)`,
|
|
246
|
+
gap: `${gap}px`
|
|
247
|
+
}
|
|
248
|
+
}, mainItems.map((item) => /* @__PURE__ */ React4.createElement("div", {
|
|
249
|
+
key: getId2(item),
|
|
250
|
+
"data-grid-item": getId2(item),
|
|
251
|
+
className: mx3("aspect-video max-h-full max-w-full w-auto h-auto", debug && "border border-primary-500")
|
|
252
|
+
}))))), /* @__PURE__ */ React4.createElement("div", {
|
|
253
|
+
className: mx3(debug && "opacity-10")
|
|
254
|
+
}, bounds.map(([item, bounds2]) => /* @__PURE__ */ React4.createElement(Cell, {
|
|
255
|
+
key: getId2(item),
|
|
256
|
+
classNames: "absolute transition-all duration-500",
|
|
257
|
+
item,
|
|
258
|
+
style: bounds2,
|
|
259
|
+
pinned: getId2(item) === pinned,
|
|
260
|
+
onClick: items.length > 1 ? handleClick : void 0
|
|
261
|
+
}))));
|
|
262
|
+
};
|
|
263
|
+
var SoloItem = ({ debug, id }) => {
|
|
264
|
+
return /* @__PURE__ */ React4.createElement(ResponsivePanel, null, /* @__PURE__ */ React4.createElement("div", {
|
|
265
|
+
"data-grid-item": id,
|
|
266
|
+
className: mx3("aspect-video overflow-hidden", debug && "z-20 border-2 border-primary-500")
|
|
267
|
+
}, /* @__PURE__ */ React4.createElement("img", {
|
|
268
|
+
alt: "placeholder video",
|
|
269
|
+
className: mx3("opacity-0", maxImageSize)
|
|
270
|
+
})));
|
|
271
|
+
};
|
|
272
|
+
var getRelativeBounds = (container, el) => {
|
|
273
|
+
const containerRect = container.getBoundingClientRect();
|
|
274
|
+
const elementRect = el.getBoundingClientRect();
|
|
275
|
+
return {
|
|
276
|
+
top: elementRect.top - containerRect.top,
|
|
277
|
+
left: elementRect.left - containerRect.left,
|
|
278
|
+
width: elementRect.width,
|
|
279
|
+
height: elementRect.height
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
var calculateLayout = (containerWidth, containerHeight, count, gap, aspectRatio = ASPECT_RATIO) => {
|
|
283
|
+
if (count === 0) {
|
|
284
|
+
return {
|
|
285
|
+
columns: 1,
|
|
286
|
+
cellWidth: 1
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
let minWastedSpace = Infinity;
|
|
290
|
+
let bestColumns = 1;
|
|
291
|
+
let cellWidth = 0;
|
|
292
|
+
for (let rows = 1; rows <= count; rows++) {
|
|
293
|
+
const cols = Math.ceil(count / rows);
|
|
294
|
+
const { width: itemWidth, height: itemHeight } = fitItemsToGrid(containerWidth, containerHeight, cols, rows, aspectRatio, gap);
|
|
295
|
+
const usedWidth = itemWidth * cols + gap * cols - 1;
|
|
296
|
+
const usedHeight = itemHeight * rows + gap * rows - 1;
|
|
297
|
+
const wastedSpace = containerWidth * containerHeight - usedWidth * usedHeight;
|
|
298
|
+
if (wastedSpace < minWastedSpace) {
|
|
299
|
+
minWastedSpace = wastedSpace;
|
|
300
|
+
bestColumns = cols;
|
|
301
|
+
cellWidth = itemWidth;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
columns: bestColumns,
|
|
306
|
+
cellWidth
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
var fitItemsToGrid = (outerWidth, outerHeight, numCols, numRows, aspectRatio, gap) => {
|
|
310
|
+
const availableWidth = outerWidth - gap * (numCols - 1);
|
|
311
|
+
const availableHeight = outerHeight - gap * (numRows - 1);
|
|
312
|
+
const maxCellWidth = availableWidth / numCols;
|
|
313
|
+
const maxCellHeight = availableHeight / numRows;
|
|
314
|
+
return fitAspectRatio(maxCellWidth, maxCellHeight, aspectRatio);
|
|
315
|
+
};
|
|
316
|
+
var fitAspectRatio = (outerWidth, outerHeight, aspectRatio) => {
|
|
317
|
+
if (outerWidth <= 0 || outerHeight <= 0 || aspectRatio <= 0) {
|
|
318
|
+
return {
|
|
319
|
+
width: 0,
|
|
320
|
+
height: 0
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
let width = outerWidth;
|
|
324
|
+
let height = width / aspectRatio;
|
|
325
|
+
if (height > outerHeight) {
|
|
326
|
+
height = outerHeight;
|
|
327
|
+
width = height * aspectRatio;
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
width,
|
|
331
|
+
height
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// src/components/ResponsiveGrid/ResponsiveGridItem.tsx
|
|
336
|
+
import React5, { useEffect as useEffect4, useState as useState2 } from "react";
|
|
337
|
+
import { Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
338
|
+
import { Waveform } from "@dxos/react-ui-sfx";
|
|
339
|
+
import { groupHoverControlItemWithTransition, mx as mx4 } from "@dxos/ui-theme";
|
|
340
|
+
import { meta } from "#meta";
|
|
341
|
+
var ResponsiveGridItem = ({ children, classNames, item, style, name, self, pinned, screenshare, video, mute, wave, speaking, onClick }) => {
|
|
342
|
+
const { t } = useTranslation(meta.id);
|
|
343
|
+
const iconProps = {
|
|
344
|
+
wave: {
|
|
345
|
+
icon: "ph--hand-waving--duotone",
|
|
346
|
+
label: t("icon-wave.label"),
|
|
347
|
+
classNames: "animate-pulse bg-orange-500"
|
|
348
|
+
},
|
|
349
|
+
mute: {
|
|
350
|
+
icon: "ph--microphone-slash--regular",
|
|
351
|
+
label: t("icon-muted.label")
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
const props = wave && !pinned ? iconProps.wave : mute ? iconProps.mute : speaking ? iconProps.speaking : void 0;
|
|
355
|
+
const [speakingIndicator, setSpeakingIndicator] = useState2(speaking);
|
|
356
|
+
useEffect4(() => {
|
|
357
|
+
if (speaking) {
|
|
358
|
+
setSpeakingIndicator(true);
|
|
359
|
+
} else {
|
|
360
|
+
const timeout = setTimeout(() => {
|
|
361
|
+
setSpeakingIndicator(false);
|
|
362
|
+
}, 1e3);
|
|
363
|
+
return () => clearTimeout(timeout);
|
|
364
|
+
}
|
|
365
|
+
}, [
|
|
366
|
+
speaking
|
|
367
|
+
]);
|
|
368
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
369
|
+
className: mx4("dx-expander relative group", "rounded-md outline outline-2 outline-neutral-900 transition-[outline-color] duration-500", speakingIndicator ? "outline-green-500" : !video && "outline-separator", classNames),
|
|
370
|
+
style
|
|
371
|
+
}, children, onClick && /* @__PURE__ */ React5.createElement("div", {
|
|
372
|
+
className: "z-10 absolute top-1 right-1 flex"
|
|
373
|
+
}, /* @__PURE__ */ React5.createElement(IconButton, {
|
|
374
|
+
classNames: mx4("p-1 min-h-1 rounded-sm", groupHoverControlItemWithTransition),
|
|
375
|
+
iconOnly: true,
|
|
376
|
+
icon: pinned ? "ph--x--regular" : "ph--arrows-out--regular",
|
|
377
|
+
size: pinned ? 5 : 4,
|
|
378
|
+
label: pinned ? t("icon-unpin.label") : t("icon-pin.label"),
|
|
379
|
+
onClick: () => onClick?.(item)
|
|
380
|
+
})), name && /* @__PURE__ */ React5.createElement("div", {
|
|
381
|
+
className: "z-10 absolute bottom-1 left-8 right-1 flex justify-end gap-1 items-center"
|
|
382
|
+
}, screenshare && /* @__PURE__ */ React5.createElement(Icon, {
|
|
383
|
+
icon: "ph--broadcast--regular",
|
|
384
|
+
size: pinned ? 5 : 4
|
|
385
|
+
}), /* @__PURE__ */ React5.createElement("div", {
|
|
386
|
+
className: mx4("bg-neutral-800 text-neutral-100 py-0.5 truncate rounded-sm", pinned ? "px-2" : "px-1 text-xs")
|
|
387
|
+
}, name)), /* @__PURE__ */ React5.createElement("div", {
|
|
388
|
+
className: "z-10 absolute bottom-1 left-1 flex"
|
|
389
|
+
}, speaking && /* @__PURE__ */ React5.createElement(Waveform, {
|
|
390
|
+
active: true,
|
|
391
|
+
size: pinned ? 5 : 4
|
|
392
|
+
}) || props && /* @__PURE__ */ React5.createElement(IconButton, {
|
|
393
|
+
classNames: mx4("p-1 min-h-1 rounded-sm", props?.classNames),
|
|
394
|
+
icon: props?.icon,
|
|
395
|
+
label: props?.label,
|
|
396
|
+
size: pinned ? 5 : 4,
|
|
397
|
+
iconOnly: true
|
|
398
|
+
})));
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
// src/components/Participant/Participant.tsx
|
|
402
|
+
var SCREENSHARE_SUFFIX = "_screenshare";
|
|
403
|
+
var Participant = /* @__PURE__ */ memo2(({ item: user, debug, ...props }) => {
|
|
404
|
+
const call = useCapability(ThreadCapabilities.CallManager);
|
|
405
|
+
const self = useAtomValue(call.selfAtom);
|
|
406
|
+
const media = useAtomValue(call.mediaAtom);
|
|
407
|
+
const isSelf = self.id !== void 0 && user.id !== void 0 && user.id.startsWith(self.id);
|
|
408
|
+
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
409
|
+
const pulledVideoStream = useMemo2(() => {
|
|
410
|
+
if (isSelf) {
|
|
411
|
+
return void 0;
|
|
412
|
+
}
|
|
413
|
+
const trackName = isScreenshare && user.tracks?.screenshareEnabled ? user.tracks?.screenshare : !isScreenshare && user.tracks?.videoEnabled ? user.tracks?.video : void 0;
|
|
414
|
+
return trackName ? media.pulledVideoStreams[trackName]?.stream : void 0;
|
|
415
|
+
}, [
|
|
416
|
+
isSelf,
|
|
417
|
+
isScreenshare,
|
|
418
|
+
media.pulledVideoStreams,
|
|
419
|
+
user.tracks?.screenshare,
|
|
420
|
+
user.tracks?.video,
|
|
421
|
+
user.tracks?.screenshareEnabled,
|
|
422
|
+
user.tracks?.videoEnabled
|
|
423
|
+
]);
|
|
424
|
+
const videoStream = useMemo2(() => {
|
|
425
|
+
if (isSelf) {
|
|
426
|
+
return isScreenshare ? media.screenshareVideoStream : media.videoStream;
|
|
427
|
+
}
|
|
428
|
+
return pulledVideoStream;
|
|
429
|
+
}, [
|
|
430
|
+
isSelf,
|
|
431
|
+
isScreenshare,
|
|
432
|
+
media.videoStream,
|
|
433
|
+
media.screenshareVideoStream,
|
|
434
|
+
pulledVideoStream
|
|
435
|
+
]);
|
|
436
|
+
return /* @__PURE__ */ React6.createElement(ResponsiveGridItem, {
|
|
437
|
+
...props,
|
|
438
|
+
item: user,
|
|
439
|
+
name: user.name,
|
|
440
|
+
self: isSelf,
|
|
441
|
+
screenshare: !!media.screenshareVideoStream,
|
|
442
|
+
video: media.videoEnabled,
|
|
443
|
+
mute: user ? !user.tracks?.audioEnabled : false,
|
|
444
|
+
wave: user.raisedHand,
|
|
445
|
+
speaking: user.speaking,
|
|
446
|
+
debug
|
|
447
|
+
}, /* @__PURE__ */ React6.createElement(VideoObject, {
|
|
448
|
+
videoStream,
|
|
449
|
+
flip: isSelf && !isScreenshare,
|
|
450
|
+
contain: !!isScreenshare,
|
|
451
|
+
classNames: "rounded-md"
|
|
452
|
+
}));
|
|
453
|
+
});
|
|
454
|
+
Participant.displayName = "Participant";
|
|
455
|
+
|
|
456
|
+
// src/components/Participant/ParticipantGrid.tsx
|
|
457
|
+
import React7, { useEffect as useEffect5, useMemo as useMemo3, useState as useState3 } from "react";
|
|
458
|
+
var getId = (user) => user.id;
|
|
459
|
+
var ParticipantGrid = ({ classNames, self, users, fullscreen, debug }) => {
|
|
460
|
+
const [pinned, setPinned] = useState3();
|
|
461
|
+
const allUsers = useMemo3(() => {
|
|
462
|
+
const allUsers2 = [];
|
|
463
|
+
users.forEach((user) => {
|
|
464
|
+
if (!user.joined) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
allUsers2.push({
|
|
468
|
+
...user,
|
|
469
|
+
isSelf: user.id === self.id
|
|
470
|
+
});
|
|
471
|
+
if (user.tracks?.screenshareEnabled) {
|
|
472
|
+
const screenshare = {
|
|
473
|
+
...user,
|
|
474
|
+
id: user.id + SCREENSHARE_SUFFIX,
|
|
475
|
+
tracks: {
|
|
476
|
+
...user.tracks,
|
|
477
|
+
video: user.tracks.screenshare,
|
|
478
|
+
videoEnabled: user.tracks.screenshareEnabled
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
allUsers2.push(screenshare);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
return allUsers2;
|
|
485
|
+
}, [
|
|
486
|
+
self,
|
|
487
|
+
users
|
|
488
|
+
]);
|
|
489
|
+
useEffect5(() => {
|
|
490
|
+
if (pinned) {
|
|
491
|
+
if (!allUsers.find((user) => user.id === pinned)) {
|
|
492
|
+
setPinned(void 0);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}, [
|
|
496
|
+
pinned,
|
|
497
|
+
allUsers
|
|
498
|
+
]);
|
|
499
|
+
const sortedUsers = allUsers.sort((a, b) => {
|
|
500
|
+
if (a.isSelf) {
|
|
501
|
+
return 1;
|
|
502
|
+
} else if (b.isSelf) {
|
|
503
|
+
return -1;
|
|
504
|
+
} else if (a.tracks?.screenshareEnabled) {
|
|
505
|
+
return -1;
|
|
506
|
+
} else if (b.tracks?.screenshareEnabled) {
|
|
507
|
+
return 1;
|
|
508
|
+
} else {
|
|
509
|
+
return 0;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
return /* @__PURE__ */ React7.createElement(ResponsiveGrid, {
|
|
513
|
+
classNames,
|
|
514
|
+
Cell: Participant,
|
|
515
|
+
debug,
|
|
516
|
+
getId,
|
|
517
|
+
items: sortedUsers,
|
|
518
|
+
pinned,
|
|
519
|
+
autoHideGallery: fullscreen,
|
|
520
|
+
onPinnedChange: setPinned
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
// src/components/Call/Toolbar.tsx
|
|
525
|
+
import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
|
|
526
|
+
import React8 from "react";
|
|
527
|
+
import { useCapability as useCapability2 } from "@dxos/app-framework/ui";
|
|
528
|
+
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
529
|
+
import { Obj } from "@dxos/echo";
|
|
530
|
+
import { Node, useActionRunner } from "@dxos/plugin-graph";
|
|
531
|
+
import { useActions, useNode } from "@dxos/plugin-graph";
|
|
532
|
+
import { Icon as Icon2, IconButton as IconButton2, Toolbar as NaturalToolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
533
|
+
import { groupHoverControlItemWithTransition as groupHoverControlItemWithTransition2, mx as mx5 } from "@dxos/ui-theme";
|
|
534
|
+
import { meta as meta2 } from "#meta";
|
|
535
|
+
import { ThreadCapabilities as ThreadCapabilities2 } from "#types";
|
|
536
|
+
var Toolbar = ({ classNames, channel, participants, autoHideControls = true, onJoin, onLeave }) => {
|
|
537
|
+
const { t } = useTranslation2(meta2.id);
|
|
538
|
+
const { graph } = useAppGraph();
|
|
539
|
+
const runAction = useActionRunner();
|
|
540
|
+
const call = useCapability2(ThreadCapabilities2.CallManager);
|
|
541
|
+
const media = useAtomValue2(call.mediaAtom);
|
|
542
|
+
const joined = useAtomValue2(call.joinedAtom);
|
|
543
|
+
const raisedHand = useAtomValue2(call.raisedHandAtom);
|
|
544
|
+
const node = useNode(graph, channel && Obj.getDXN(channel).toString());
|
|
545
|
+
const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === "toolbar");
|
|
546
|
+
const isScreensharing = media.screenshareTrack !== void 0;
|
|
547
|
+
const canSharescreen = typeof navigator.mediaDevices !== "undefined" && navigator.mediaDevices.getDisplayMedia !== void 0;
|
|
548
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
549
|
+
className: mx5("z-20 flex justify-center m-8", autoHideControls && groupHoverControlItemWithTransition2)
|
|
550
|
+
}, /* @__PURE__ */ React8.createElement(NaturalToolbar.Root, {
|
|
551
|
+
classNames: [
|
|
552
|
+
"p-2 bg-modal-surface rounded-md shadow-md",
|
|
553
|
+
classNames
|
|
554
|
+
]
|
|
555
|
+
}, /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
556
|
+
active: media.audioEnabled,
|
|
557
|
+
state: {
|
|
558
|
+
on: {
|
|
559
|
+
icon: "ph--microphone--regular",
|
|
560
|
+
label: t("mic-off.button"),
|
|
561
|
+
onClick: () => call.turnAudioOff(),
|
|
562
|
+
classNames: "bg-call-active"
|
|
563
|
+
},
|
|
564
|
+
off: {
|
|
565
|
+
icon: "ph--microphone-slash--duotone",
|
|
566
|
+
label: t("mic-on.button"),
|
|
567
|
+
onClick: () => call.turnAudioOn()
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}), /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
571
|
+
active: media.videoEnabled,
|
|
572
|
+
state: {
|
|
573
|
+
on: {
|
|
574
|
+
icon: "ph--video-camera--regular",
|
|
575
|
+
label: t("camera-off.button"),
|
|
576
|
+
onClick: () => call.turnVideoOff()
|
|
577
|
+
},
|
|
578
|
+
off: {
|
|
579
|
+
icon: "ph--video-camera-slash--duotone",
|
|
580
|
+
label: t("camera-on.button"),
|
|
581
|
+
onClick: () => call.turnVideoOn()
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}), participants !== void 0 && /* @__PURE__ */ React8.createElement("div", {
|
|
585
|
+
className: "flex justify-center items-center gap-2 w-[5rem] text-xs text-subdued"
|
|
586
|
+
}, /* @__PURE__ */ React8.createElement(Icon2, {
|
|
587
|
+
icon: "ph--users--regular"
|
|
588
|
+
}), /* @__PURE__ */ React8.createElement("div", null, participants)) || /* @__PURE__ */ React8.createElement(NaturalToolbar.Separator, {
|
|
589
|
+
variant: "gap"
|
|
590
|
+
}), joined && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
591
|
+
disabled: !canSharescreen,
|
|
592
|
+
active: isScreensharing,
|
|
593
|
+
state: {
|
|
594
|
+
on: {
|
|
595
|
+
icon: "ph--monitor--regular",
|
|
596
|
+
label: t("screenshare-off.button"),
|
|
597
|
+
onClick: () => call.turnScreenshareOff()
|
|
598
|
+
},
|
|
599
|
+
off: {
|
|
600
|
+
icon: "ph--monitor-arrow-up--duotone",
|
|
601
|
+
label: t("screenshare-on.button"),
|
|
602
|
+
onClick: () => call.turnScreenshareOn()
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}), actions.filter((action) => Node.isAction(action)).map((action) => /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
606
|
+
key: action.id,
|
|
607
|
+
...defaultButtonProps,
|
|
608
|
+
icon: action.properties.icon,
|
|
609
|
+
label: toLocalizedString(action.properties.label, t),
|
|
610
|
+
classNames: action.properties.classNames,
|
|
611
|
+
onClick: () => node && void runAction(action, {
|
|
612
|
+
parent: node
|
|
613
|
+
})
|
|
614
|
+
})), /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
615
|
+
active: raisedHand,
|
|
616
|
+
state: {
|
|
617
|
+
on: {
|
|
618
|
+
icon: "ph--hand-waving--regular",
|
|
619
|
+
label: t("lower-hand.button"),
|
|
620
|
+
onClick: () => call.setRaisedHand(false)
|
|
621
|
+
},
|
|
622
|
+
off: {
|
|
623
|
+
icon: "ph--hand-palm--duotone",
|
|
624
|
+
label: t("raise-hand.button"),
|
|
625
|
+
onClick: () => call.setRaisedHand(true)
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
})), joined ? /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
629
|
+
variant: "destructive",
|
|
630
|
+
icon: "ph--phone-x--regular",
|
|
631
|
+
label: t("leave-call.button"),
|
|
632
|
+
onClick: onLeave
|
|
633
|
+
}) : /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
634
|
+
variant: "primary",
|
|
635
|
+
icon: "ph--phone-incoming--regular",
|
|
636
|
+
label: t("join-call.button"),
|
|
637
|
+
onClick: onJoin
|
|
638
|
+
})));
|
|
639
|
+
};
|
|
640
|
+
Toolbar.displayName = "MeetingToolbar";
|
|
641
|
+
var defaultButtonProps = {
|
|
642
|
+
size: 5,
|
|
643
|
+
iconOnly: true
|
|
644
|
+
};
|
|
645
|
+
var ToggleButton = ({ active, state }) => /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
646
|
+
...defaultButtonProps,
|
|
647
|
+
classNames: [
|
|
648
|
+
active ? state.on.classNames ?? "bg-call-active" : state.off.classNames
|
|
649
|
+
],
|
|
650
|
+
icon: active ? state.on.icon : state.off.icon,
|
|
651
|
+
label: active ? state.on.label : state.off.label,
|
|
652
|
+
onClick: active ? state.on.onClick : state.off.onClick
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
// src/components/Call/Call.tsx
|
|
656
|
+
var CallRoot = ({ children }) => {
|
|
657
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
658
|
+
className: "relative dx-container flex flex-col"
|
|
659
|
+
}, children);
|
|
660
|
+
};
|
|
661
|
+
CallRoot.displayName = "CallRoot";
|
|
662
|
+
var CallAudio = (_props) => {
|
|
663
|
+
const call = useCapability3(ThreadCapabilities3.CallManager);
|
|
664
|
+
const audioTracksToPlay = useAtomValue3(call.audioTracksToPlayAtom);
|
|
665
|
+
return /* @__PURE__ */ React9.createElement(AudioStream, {
|
|
666
|
+
tracks: audioTracksToPlay
|
|
667
|
+
});
|
|
668
|
+
};
|
|
669
|
+
CallAudio.displayName = "CallAudio";
|
|
670
|
+
var CallGrid = ({ fullscreen }) => {
|
|
671
|
+
const debug = useDebugMode();
|
|
672
|
+
const call = useCapability3(ThreadCapabilities3.CallManager);
|
|
673
|
+
const self = useAtomValue3(call.selfAtom);
|
|
674
|
+
const users = useAtomValue3(call.usersAtom);
|
|
675
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
676
|
+
className: "grid grow p-4 dark:bg-neutral-900"
|
|
677
|
+
}, /* @__PURE__ */ React9.createElement(ParticipantGrid, {
|
|
678
|
+
self,
|
|
679
|
+
users,
|
|
680
|
+
debug,
|
|
681
|
+
fullscreen
|
|
682
|
+
}));
|
|
683
|
+
};
|
|
684
|
+
CallGrid.displayName = "CallGrid";
|
|
685
|
+
var CallToolbar = (props) => {
|
|
686
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
687
|
+
className: "absolute bottom-0 left-0 right-0 flex justify-center"
|
|
688
|
+
}, /* @__PURE__ */ React9.createElement(Toolbar, {
|
|
689
|
+
isInRoom: true,
|
|
690
|
+
...props
|
|
691
|
+
}));
|
|
692
|
+
};
|
|
693
|
+
CallToolbar.displayName = "CallToolbar";
|
|
694
|
+
var Call = {
|
|
695
|
+
Root: CallRoot,
|
|
696
|
+
Grid: CallGrid,
|
|
697
|
+
Audio: CallAudio,
|
|
698
|
+
Toolbar: CallToolbar
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
// src/components/Chat/Chat.tsx
|
|
702
|
+
import React11, { useLayoutEffect as useLayoutEffect2, useMemo as useMemo4, useRef as useRef4, useState as useState5 } from "react";
|
|
703
|
+
import { ScrollArea, useThemeContext as useThemeContext2, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
704
|
+
import { MessageTextbox, Thread as ThreadComponent, threadLayout } from "@dxos/react-ui-thread";
|
|
705
|
+
import { createBasicExtensions as createBasicExtensions2, createThemeExtensions as createThemeExtensions2, listener } from "@dxos/ui-editor";
|
|
706
|
+
import { composable, composableProps, mx as mx7 } from "@dxos/ui-theme";
|
|
707
|
+
import { isNonNullable } from "@dxos/util";
|
|
708
|
+
import { meta as meta4 } from "#meta";
|
|
709
|
+
|
|
710
|
+
// src/components/MessagePanel/MessagePanel.tsx
|
|
711
|
+
import { EditorView } from "@codemirror/view";
|
|
712
|
+
import React10, { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect6, useRef as useRef3, useState as useState4 } from "react";
|
|
713
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
714
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
715
|
+
import { Ref } from "@dxos/echo";
|
|
716
|
+
import { useObject } from "@dxos/echo-react";
|
|
717
|
+
import { PublicKey } from "@dxos/react-client";
|
|
718
|
+
import { useIdentity } from "@dxos/react-client/halo";
|
|
719
|
+
import { IconButton as IconButton3, useOnTransition, useThemeContext, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
720
|
+
import { Card } from "@dxos/react-ui";
|
|
721
|
+
import { useTextEditor } from "@dxos/react-ui-editor";
|
|
722
|
+
import { MessageHeading, MessageRoot } from "@dxos/react-ui-thread";
|
|
723
|
+
import { createBasicExtensions, createThemeExtensions } from "@dxos/ui-editor";
|
|
724
|
+
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx as mx6 } from "@dxos/ui-theme";
|
|
725
|
+
import { useOnEditAnalytics } from "#hooks";
|
|
726
|
+
import { meta as meta3 } from "#meta";
|
|
727
|
+
var buttonGroupClassNames = "flex flex-row items-center gap-0.5 pe-2";
|
|
728
|
+
var buttonClassNames = "p-1! transition-opacity";
|
|
729
|
+
var MessagePanel = ({ message: messageOrRef, members, editable = false, onDelete, onAcceptProposal }) => {
|
|
730
|
+
const { t } = useTranslation3(meta3.id);
|
|
731
|
+
const [message, updateMessage] = useObject(messageOrRef);
|
|
732
|
+
const identity = useIdentity();
|
|
733
|
+
const [editing, setEditing] = useState4(false);
|
|
734
|
+
const textBlockIndex = message?.blocks.findIndex((block) => block._tag === "text") ?? -1;
|
|
735
|
+
const handleEdit = useCallback2(() => setEditing((editing2) => !editing2), []);
|
|
736
|
+
const handleDelete = useCallback2(() => message && onDelete?.(message.id), [
|
|
737
|
+
message,
|
|
738
|
+
onDelete
|
|
739
|
+
]);
|
|
740
|
+
const handleAcceptProposal = useCallback2(() => message && onAcceptProposal?.(message.id), [
|
|
741
|
+
message,
|
|
742
|
+
onAcceptProposal
|
|
743
|
+
]);
|
|
744
|
+
const handleTextBlockChange = useCallback2((newText) => {
|
|
745
|
+
updateMessage((m) => {
|
|
746
|
+
const targetBlock = m.blocks[textBlockIndex];
|
|
747
|
+
if (targetBlock && targetBlock._tag === "text") {
|
|
748
|
+
targetBlock.text = newText;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}, [
|
|
752
|
+
updateMessage,
|
|
753
|
+
textBlockIndex
|
|
754
|
+
]);
|
|
755
|
+
const textBlock = message && textBlockIndex !== -1 ? message.blocks[textBlockIndex] : void 0;
|
|
756
|
+
useOnEditAnalytics(message, textBlock, !!editing);
|
|
757
|
+
if (!message) {
|
|
758
|
+
return null;
|
|
759
|
+
}
|
|
760
|
+
const senderIdentity = members.find((member) => message.sender.identityDid && member.identity.did === message.sender.identityDid || message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey))?.identity;
|
|
761
|
+
const messageMetadata = getMessageMetadata(message.id, senderIdentity, message.sender);
|
|
762
|
+
const userIsAuthor = identity?.did === messageMetadata.authorId;
|
|
763
|
+
const proposalBlock = message.blocks.find((block) => block._tag === "proposal");
|
|
764
|
+
const references = message.blocks.filter((block) => block._tag === "reference").map((block) => block.reference);
|
|
765
|
+
return /* @__PURE__ */ React10.createElement(MessageRoot, {
|
|
766
|
+
...messageMetadata,
|
|
767
|
+
classNames: [
|
|
768
|
+
hoverableControls,
|
|
769
|
+
hoverableFocusedWithinControls
|
|
770
|
+
]
|
|
771
|
+
}, /* @__PURE__ */ React10.createElement(MessageHeading, {
|
|
772
|
+
authorName: messageMetadata.authorName,
|
|
773
|
+
timestamp: messageMetadata.timestamp
|
|
774
|
+
}, /* @__PURE__ */ React10.createElement("div", {
|
|
775
|
+
className: buttonGroupClassNames
|
|
776
|
+
}, userIsAuthor && editable && /* @__PURE__ */ React10.createElement(IconButton3, {
|
|
777
|
+
"data-testid": editing ? "thread.message.save" : "thread.message.edit",
|
|
778
|
+
variant: "ghost",
|
|
779
|
+
icon: editing ? "ph--check--regular" : "ph--pencil-simple--regular",
|
|
780
|
+
iconOnly: true,
|
|
781
|
+
label: t(editing ? "save-message.label" : "edit-message.label"),
|
|
782
|
+
classNames: [
|
|
783
|
+
buttonClassNames,
|
|
784
|
+
hoverableControlItem
|
|
785
|
+
],
|
|
786
|
+
onClick: handleEdit
|
|
787
|
+
}), proposalBlock && onAcceptProposal && /* @__PURE__ */ React10.createElement(IconButton3, {
|
|
788
|
+
"data-testid": "thread.message.accept",
|
|
789
|
+
variant: "ghost",
|
|
790
|
+
icon: "ph--check--regular",
|
|
791
|
+
iconOnly: true,
|
|
792
|
+
label: t("accept-proposal.label"),
|
|
793
|
+
classNames: [
|
|
794
|
+
buttonClassNames,
|
|
795
|
+
hoverableControlItem
|
|
796
|
+
],
|
|
797
|
+
onClick: handleAcceptProposal
|
|
798
|
+
}), onDelete && /* @__PURE__ */ React10.createElement(IconButton3, {
|
|
799
|
+
"data-testid": "thread.message.delete",
|
|
800
|
+
variant: "ghost",
|
|
801
|
+
icon: "ph--x--regular",
|
|
802
|
+
iconOnly: true,
|
|
803
|
+
label: t("delete-message.label"),
|
|
804
|
+
classNames: [
|
|
805
|
+
buttonClassNames,
|
|
806
|
+
hoverableControlItem
|
|
807
|
+
],
|
|
808
|
+
onClick: handleDelete
|
|
809
|
+
}))), textBlock && /* @__PURE__ */ React10.createElement(TextboxBlock, {
|
|
810
|
+
block: textBlock,
|
|
811
|
+
isAuthor: userIsAuthor,
|
|
812
|
+
editing,
|
|
813
|
+
onSave: handleTextBlockChange
|
|
814
|
+
}), proposalBlock && /* @__PURE__ */ React10.createElement(ProposalBlock, {
|
|
815
|
+
block: proposalBlock
|
|
816
|
+
}), Ref.Array.targets(references).map((reference, index) => /* @__PURE__ */ React10.createElement(MessagePart, {
|
|
817
|
+
key: index,
|
|
818
|
+
part: reference
|
|
819
|
+
})));
|
|
820
|
+
};
|
|
821
|
+
var MessagePart = ({ part }) => {
|
|
822
|
+
return /* @__PURE__ */ React10.createElement(MessageBlockObjectTile, {
|
|
823
|
+
subject: part
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
var TextboxBlock = ({ block, isAuthor, editing, onSave }) => {
|
|
827
|
+
const { themeMode } = useThemeContext();
|
|
828
|
+
const inMemoryContentRef = useRef3(block.text);
|
|
829
|
+
const handleDocumentChange = useCallback2((newState) => {
|
|
830
|
+
inMemoryContentRef.current = newState;
|
|
831
|
+
}, []);
|
|
832
|
+
const saveDocumentChange = useCallback2(() => {
|
|
833
|
+
onSave?.(inMemoryContentRef.current);
|
|
834
|
+
}, [
|
|
835
|
+
onSave
|
|
836
|
+
]);
|
|
837
|
+
useOnTransition(editing, true, false, saveDocumentChange);
|
|
838
|
+
const { parentRef, focusAttributes, view } = useTextEditor(() => ({
|
|
839
|
+
initialValue: block.text,
|
|
840
|
+
extensions: [
|
|
841
|
+
createBasicExtensions({
|
|
842
|
+
readOnly: !isAuthor || !editing
|
|
843
|
+
}),
|
|
844
|
+
createThemeExtensions({
|
|
845
|
+
themeMode
|
|
846
|
+
}),
|
|
847
|
+
command,
|
|
848
|
+
EditorView.updateListener.of((update) => {
|
|
849
|
+
if (update.docChanged) {
|
|
850
|
+
handleDocumentChange(update.state.doc.toString());
|
|
851
|
+
}
|
|
852
|
+
})
|
|
853
|
+
]
|
|
854
|
+
}), [
|
|
855
|
+
block.text,
|
|
856
|
+
editing,
|
|
857
|
+
isAuthor,
|
|
858
|
+
themeMode,
|
|
859
|
+
handleDocumentChange
|
|
860
|
+
]);
|
|
861
|
+
useEffect6(() => {
|
|
862
|
+
editing && view?.focus();
|
|
863
|
+
}, [
|
|
864
|
+
editing,
|
|
865
|
+
view
|
|
866
|
+
]);
|
|
867
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
868
|
+
ref: parentRef,
|
|
869
|
+
className: "me-4",
|
|
870
|
+
...focusAttributes
|
|
871
|
+
});
|
|
872
|
+
};
|
|
873
|
+
var ProposalBlock = ({ block }) => {
|
|
874
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
875
|
+
className: "me-4 italic"
|
|
876
|
+
}, block.text);
|
|
877
|
+
};
|
|
878
|
+
var MessageBlockObjectTile = /* @__PURE__ */ forwardRef2(({ subject }, forwardedRef) => {
|
|
879
|
+
let title = subject.name ?? subject.title ?? subject.type ?? "Object";
|
|
880
|
+
if (typeof title !== "string") {
|
|
881
|
+
title = title?.content ?? "";
|
|
882
|
+
}
|
|
883
|
+
return /* @__PURE__ */ React10.createElement(Card.Root, {
|
|
884
|
+
className: mx6("grid col-span-3 py-1 pr-4", hoverableControls, hoverableFocusedWithinControls),
|
|
885
|
+
ref: forwardedRef
|
|
886
|
+
}, /* @__PURE__ */ React10.createElement(Surface.Surface, {
|
|
887
|
+
type: AppSurface.Card,
|
|
888
|
+
limit: 1,
|
|
889
|
+
data: {
|
|
890
|
+
subject
|
|
891
|
+
},
|
|
892
|
+
fallback: title
|
|
893
|
+
}));
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
// src/components/Chat/Chat.tsx
|
|
897
|
+
var Chat = composable(({ id, identity, members, messages, activity, onSend, autoFocusTextbox, current, orientation = "top", readOnly, ...props }, forwardedRef) => {
|
|
898
|
+
const { t } = useTranslation4(meta4.id);
|
|
899
|
+
const { themeMode } = useThemeContext2();
|
|
900
|
+
const scrollRef = useRef4(null);
|
|
901
|
+
const sentinelRef = useRef4(null);
|
|
902
|
+
const [autoFocus, setAutoFocus] = useState5(autoFocusTextbox);
|
|
903
|
+
const [_count, _setCount] = useState5(0);
|
|
904
|
+
const textboxMetadata = getMessageMetadata(id, identity);
|
|
905
|
+
const messageRef = useRef4("");
|
|
906
|
+
const extensions = useMemo4(() => [
|
|
907
|
+
createBasicExtensions2({
|
|
908
|
+
placeholder: t("message.placeholder")
|
|
909
|
+
}),
|
|
910
|
+
createThemeExtensions2({
|
|
911
|
+
themeMode
|
|
912
|
+
}),
|
|
913
|
+
listener({
|
|
914
|
+
onChange: ({ text }) => messageRef.current = text
|
|
915
|
+
}),
|
|
916
|
+
command
|
|
917
|
+
], [
|
|
918
|
+
themeMode,
|
|
919
|
+
_count
|
|
920
|
+
]);
|
|
921
|
+
const scrollToEnd = (behavior) => setTimeout(() => sentinelRef.current?.scrollIntoView({
|
|
922
|
+
behavior,
|
|
923
|
+
block: "end"
|
|
924
|
+
}), 10);
|
|
925
|
+
useLayoutEffect2(() => {
|
|
926
|
+
scrollToEnd("instant");
|
|
927
|
+
}, []);
|
|
928
|
+
const handleSend = () => {
|
|
929
|
+
const text = messageRef.current;
|
|
930
|
+
if (!text?.length) {
|
|
931
|
+
return false;
|
|
932
|
+
}
|
|
933
|
+
const accepted = onSend(text);
|
|
934
|
+
if (!accepted) {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
messageRef.current = "";
|
|
938
|
+
setAutoFocus(true);
|
|
939
|
+
scrollToEnd("smooth");
|
|
940
|
+
_setCount((count) => count + 1);
|
|
941
|
+
return true;
|
|
942
|
+
};
|
|
943
|
+
const filteredMessages = messages.filter(isNonNullable);
|
|
944
|
+
const renderState = {
|
|
945
|
+
messages: filteredMessages,
|
|
946
|
+
members,
|
|
947
|
+
activity,
|
|
948
|
+
extensions,
|
|
949
|
+
autoFocus,
|
|
950
|
+
handleSend,
|
|
951
|
+
textboxMetadata,
|
|
952
|
+
scrollRef,
|
|
953
|
+
sentinelRef,
|
|
954
|
+
readOnly
|
|
955
|
+
};
|
|
956
|
+
return orientation === "bottom" ? /* @__PURE__ */ React11.createElement(ChannelLayout, {
|
|
957
|
+
...composableProps(props, {
|
|
958
|
+
classNames: "flex flex-col bs-full min-h-0"
|
|
959
|
+
}),
|
|
960
|
+
id,
|
|
961
|
+
ref: forwardedRef,
|
|
962
|
+
state: renderState
|
|
963
|
+
}) : /* @__PURE__ */ React11.createElement(ThreadLayout, {
|
|
964
|
+
...composableProps(props, {
|
|
965
|
+
classNames: "dx-container grid-rows-[1fr_min-content_min-content]"
|
|
966
|
+
}),
|
|
967
|
+
id,
|
|
968
|
+
current,
|
|
969
|
+
ref: forwardedRef,
|
|
970
|
+
state: renderState
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
var ThreadLayout = /* @__PURE__ */ React11.forwardRef(({ id, current, state, ...props }, ref) => {
|
|
974
|
+
const { t } = useTranslation4(meta4.id);
|
|
975
|
+
const { messages, members, activity, extensions, autoFocus, handleSend, textboxMetadata, sentinelRef, readOnly } = state;
|
|
976
|
+
return /* @__PURE__ */ React11.createElement(ThreadComponent.Root, {
|
|
977
|
+
...props,
|
|
978
|
+
id,
|
|
979
|
+
current,
|
|
980
|
+
ref
|
|
981
|
+
}, /* @__PURE__ */ React11.createElement(ScrollArea.Root, {
|
|
982
|
+
classNames: "col-span-2",
|
|
983
|
+
orientation: "vertical"
|
|
984
|
+
}, /* @__PURE__ */ React11.createElement(ScrollArea.Viewport, {
|
|
985
|
+
ref: sentinelRef
|
|
986
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
987
|
+
className: mx7(threadLayout, "place-self-end")
|
|
988
|
+
}, messages.map((message) => /* @__PURE__ */ React11.createElement(MessagePanel, {
|
|
989
|
+
key: message.id,
|
|
990
|
+
message,
|
|
991
|
+
members
|
|
992
|
+
}))))), !readOnly && /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(MessageTextbox, {
|
|
993
|
+
extensions,
|
|
994
|
+
autoFocus,
|
|
995
|
+
onSend: handleSend,
|
|
996
|
+
...textboxMetadata
|
|
997
|
+
}), /* @__PURE__ */ React11.createElement(ThreadComponent.Status, {
|
|
998
|
+
activity
|
|
999
|
+
}, t("activity.message"))));
|
|
1000
|
+
});
|
|
1001
|
+
var ChannelLayout = /* @__PURE__ */ React11.forwardRef(({ id, state, ...props }, ref) => {
|
|
1002
|
+
const { t } = useTranslation4(meta4.id);
|
|
1003
|
+
const { messages, members, activity, extensions, autoFocus, handleSend, textboxMetadata, scrollRef, sentinelRef, readOnly } = state;
|
|
1004
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1005
|
+
...props,
|
|
1006
|
+
id,
|
|
1007
|
+
ref
|
|
1008
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
1009
|
+
ref: scrollRef,
|
|
1010
|
+
className: "flex-1 min-h-0 overflow-y-auto"
|
|
1011
|
+
}, messages.map((message) => /* @__PURE__ */ React11.createElement("div", {
|
|
1012
|
+
key: message.id,
|
|
1013
|
+
className: "grid grid-cols-[var(--dx-rail-size)_1fr] w-full"
|
|
1014
|
+
}, /* @__PURE__ */ React11.createElement(MessagePanel, {
|
|
1015
|
+
message,
|
|
1016
|
+
members
|
|
1017
|
+
}))), /* @__PURE__ */ React11.createElement("div", {
|
|
1018
|
+
ref: sentinelRef
|
|
1019
|
+
})), !readOnly && /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("div", {
|
|
1020
|
+
className: "shrink-0 grid grid-cols-[var(--dx-rail-size)_1fr]"
|
|
1021
|
+
}, /* @__PURE__ */ React11.createElement(MessageTextbox, {
|
|
1022
|
+
extensions,
|
|
1023
|
+
autoFocus,
|
|
1024
|
+
onSend: handleSend,
|
|
1025
|
+
...textboxMetadata
|
|
1026
|
+
})), /* @__PURE__ */ React11.createElement("div", {
|
|
1027
|
+
className: "shrink-0 px-2 pb-1 text-xs text-description"
|
|
1028
|
+
}, activity ? t("activity.message") : null)));
|
|
1029
|
+
});
|
|
1030
|
+
|
|
1031
|
+
// src/components/CommentsPanel/CommentsPanel.tsx
|
|
1032
|
+
import React13, { useEffect as useEffect7 } from "react";
|
|
1033
|
+
import { Obj as Obj3, Relation as Relation2 } from "@dxos/echo";
|
|
1034
|
+
import { Icon as Icon3, Message, Trans, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
1035
|
+
import { meta as meta6 } from "#meta";
|
|
1036
|
+
|
|
1037
|
+
// src/components/CommentsPanel/CommentsThread.tsx
|
|
1038
|
+
import React12, { useCallback as useCallback3, useMemo as useMemo5, useRef as useRef5, useState as useState6 } from "react";
|
|
1039
|
+
import { Obj as Obj2, Relation } from "@dxos/echo";
|
|
1040
|
+
import { useObject as useObject2 } from "@dxos/echo-react";
|
|
1041
|
+
import { getSpace, useMembers } from "@dxos/react-client/echo";
|
|
1042
|
+
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1043
|
+
import { IconButton as IconButton4, Tag, Tooltip, useThemeContext as useThemeContext3, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
1044
|
+
import { MessageTextbox as MessageTextbox2, Thread as ThreadComponent2 } from "@dxos/react-ui-thread";
|
|
1045
|
+
import { createBasicExtensions as createBasicExtensions3, createThemeExtensions as createThemeExtensions3, listener as listener2 } from "@dxos/ui-editor";
|
|
1046
|
+
import { hoverableControlItem as hoverableControlItem2, hoverableControls as hoverableControls2, hoverableFocusedWithinControls as hoverableFocusedWithinControls2, mx as mx8 } from "@dxos/ui-theme";
|
|
1047
|
+
import { useStatus } from "#hooks";
|
|
1048
|
+
import { meta as meta5 } from "#meta";
|
|
1049
|
+
var CommentsThread = ({ anchor, current, onAttend, onComment, onResolve, onMessageDelete, onThreadDelete, onAcceptProposal }) => {
|
|
1050
|
+
const { themeMode } = useThemeContext3();
|
|
1051
|
+
const { t } = useTranslation5(meta5.id);
|
|
1052
|
+
const identity = useIdentity2();
|
|
1053
|
+
const space = getSpace(anchor);
|
|
1054
|
+
const members = useMembers(space?.id);
|
|
1055
|
+
const detached = !anchor.anchor;
|
|
1056
|
+
const thread = Relation.getSource(anchor);
|
|
1057
|
+
const [messages] = useObject2(thread, "messages");
|
|
1058
|
+
const activity = useStatus(space, Obj2.getDXN(thread).toString());
|
|
1059
|
+
const threadScrollRef = useRef5(null);
|
|
1060
|
+
const textboxMetadata = getMessageMetadata(Obj2.getDXN(thread).toString(), identity);
|
|
1061
|
+
const [state, setState] = useState6({});
|
|
1062
|
+
const messageRef = useRef5("");
|
|
1063
|
+
const extensions = useMemo5(() => [
|
|
1064
|
+
createBasicExtensions3({
|
|
1065
|
+
placeholder: t("message.placeholder")
|
|
1066
|
+
}),
|
|
1067
|
+
createThemeExtensions3({
|
|
1068
|
+
themeMode
|
|
1069
|
+
}),
|
|
1070
|
+
listener2({
|
|
1071
|
+
onChange: ({ text }) => messageRef.current = text
|
|
1072
|
+
}),
|
|
1073
|
+
command
|
|
1074
|
+
], [
|
|
1075
|
+
state
|
|
1076
|
+
]);
|
|
1077
|
+
const scrollToEnd = (behavior) => setTimeout(() => threadScrollRef.current?.scrollIntoView({
|
|
1078
|
+
behavior,
|
|
1079
|
+
block: "end"
|
|
1080
|
+
}), 10);
|
|
1081
|
+
const handleAttend = useCallback3(() => onAttend?.(anchor), [
|
|
1082
|
+
onAttend,
|
|
1083
|
+
anchor
|
|
1084
|
+
]);
|
|
1085
|
+
const handleResolve = useCallback3(() => onResolve?.(anchor), [
|
|
1086
|
+
onResolve,
|
|
1087
|
+
anchor
|
|
1088
|
+
]);
|
|
1089
|
+
const handleMessageDelete = useCallback3((id) => onMessageDelete?.(anchor, id), [
|
|
1090
|
+
onMessageDelete,
|
|
1091
|
+
anchor
|
|
1092
|
+
]);
|
|
1093
|
+
const handleThreadDelete = useCallback3(() => onThreadDelete?.(anchor), [
|
|
1094
|
+
onThreadDelete,
|
|
1095
|
+
anchor
|
|
1096
|
+
]);
|
|
1097
|
+
const handleAcceptProposal = useCallback3((id) => onAcceptProposal?.(anchor, id), [
|
|
1098
|
+
onAcceptProposal,
|
|
1099
|
+
anchor
|
|
1100
|
+
]);
|
|
1101
|
+
const handleComment = useCallback3(() => {
|
|
1102
|
+
if (!messageRef.current) {
|
|
1103
|
+
return false;
|
|
1104
|
+
}
|
|
1105
|
+
onComment?.(anchor, messageRef.current);
|
|
1106
|
+
messageRef.current = "";
|
|
1107
|
+
scrollToEnd("instant");
|
|
1108
|
+
setState({});
|
|
1109
|
+
return true;
|
|
1110
|
+
}, [
|
|
1111
|
+
anchor,
|
|
1112
|
+
identity
|
|
1113
|
+
]);
|
|
1114
|
+
return /* @__PURE__ */ React12.createElement(ThreadComponent2.Root, {
|
|
1115
|
+
id: Obj2.getDXN(thread).toString(),
|
|
1116
|
+
classNames: "pt-2 border-b border-subdued-separator last:border-none",
|
|
1117
|
+
current,
|
|
1118
|
+
onClickCapture: handleAttend,
|
|
1119
|
+
onFocusCapture: handleAttend
|
|
1120
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
1121
|
+
className: mx8("col-span-2 grid grid-cols-[var(--dx-rail-size)_1fr_min-content]", hoverableControls2, hoverableFocusedWithinControls2)
|
|
1122
|
+
}, detached ? /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
|
|
1123
|
+
asChild: true,
|
|
1124
|
+
content: t("detached-thread.label"),
|
|
1125
|
+
side: "top"
|
|
1126
|
+
}, /* @__PURE__ */ React12.createElement(ThreadComponent2.Header, {
|
|
1127
|
+
detached: true
|
|
1128
|
+
}, thread.name)) : /* @__PURE__ */ React12.createElement(ThreadComponent2.Header, null, thread.name), /* @__PURE__ */ React12.createElement("div", {
|
|
1129
|
+
className: buttonGroupClassNames
|
|
1130
|
+
}, thread.status === "staged" && /* @__PURE__ */ React12.createElement(Tag, {
|
|
1131
|
+
palette: "neutral"
|
|
1132
|
+
}, t("draft.button")), onResolve && !(thread?.status === "staged") && /* @__PURE__ */ React12.createElement(IconButton4, {
|
|
1133
|
+
"data-testid": "thread.resolve",
|
|
1134
|
+
variant: "ghost",
|
|
1135
|
+
icon: thread?.status === "resolved" ? "ph--check--fill" : "ph--check--regular",
|
|
1136
|
+
iconOnly: true,
|
|
1137
|
+
label: t("resolve-thread.label"),
|
|
1138
|
+
classNames: [
|
|
1139
|
+
buttonClassNames,
|
|
1140
|
+
thread?.status !== "resolved" && hoverableControlItem2
|
|
1141
|
+
],
|
|
1142
|
+
onClick: handleResolve
|
|
1143
|
+
}), onThreadDelete && /* @__PURE__ */ React12.createElement(IconButton4, {
|
|
1144
|
+
"data-testid": "thread.delete",
|
|
1145
|
+
variant: "ghost",
|
|
1146
|
+
icon: "ph--x--regular",
|
|
1147
|
+
iconOnly: true,
|
|
1148
|
+
label: t("delete-thread.label"),
|
|
1149
|
+
classNames: [
|
|
1150
|
+
buttonClassNames,
|
|
1151
|
+
hoverableControlItem2
|
|
1152
|
+
],
|
|
1153
|
+
onClick: handleThreadDelete
|
|
1154
|
+
}))), messages?.map((ref) => /* @__PURE__ */ React12.createElement(MessagePanel, {
|
|
1155
|
+
key: ref.dxn.toString(),
|
|
1156
|
+
editable: true,
|
|
1157
|
+
message: ref,
|
|
1158
|
+
members,
|
|
1159
|
+
onDelete: handleMessageDelete,
|
|
1160
|
+
onAcceptProposal: handleAcceptProposal
|
|
1161
|
+
})), /* @__PURE__ */ React12.createElement(MessageTextbox2, {
|
|
1162
|
+
extensions,
|
|
1163
|
+
onSend: handleComment,
|
|
1164
|
+
...textboxMetadata
|
|
1165
|
+
}), /* @__PURE__ */ React12.createElement(ThreadComponent2.Status, {
|
|
1166
|
+
activity
|
|
1167
|
+
}, t("activity.message")), /* @__PURE__ */ React12.createElement("div", {
|
|
1168
|
+
className: "h-px -mt-px",
|
|
1169
|
+
ref: threadScrollRef
|
|
1170
|
+
}));
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1173
|
+
// src/components/CommentsPanel/CommentsPanel.tsx
|
|
1174
|
+
var CommentsPanel = ({ anchors, currentId, showResolvedThreads, ...props }) => {
|
|
1175
|
+
const { t } = useTranslation6(meta6.id);
|
|
1176
|
+
const filteredAnchors = showResolvedThreads ? anchors.filter((anchor) => !!Relation2.getSource(anchor)) : anchors.filter((anchor) => {
|
|
1177
|
+
const thread = Relation2.getSource(anchor);
|
|
1178
|
+
return thread && thread.status !== "resolved";
|
|
1179
|
+
});
|
|
1180
|
+
useEffect7(() => {
|
|
1181
|
+
if (currentId) {
|
|
1182
|
+
document.getElementById(currentId)?.scrollIntoView({
|
|
1183
|
+
behavior: "smooth",
|
|
1184
|
+
block: "end"
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
}, [
|
|
1188
|
+
currentId
|
|
1189
|
+
]);
|
|
1190
|
+
if (filteredAnchors.length === 0) {
|
|
1191
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1192
|
+
className: "p-form-padding"
|
|
1193
|
+
}, /* @__PURE__ */ React13.createElement(Message.Root, null, /* @__PURE__ */ React13.createElement(Message.Content, null, /* @__PURE__ */ React13.createElement(Trans, {
|
|
1194
|
+
t,
|
|
1195
|
+
i18nKey: "no-comments.message",
|
|
1196
|
+
components: {
|
|
1197
|
+
commentIcon: /* @__PURE__ */ React13.createElement(Icon3, {
|
|
1198
|
+
icon: "ph--chat-text--regular",
|
|
1199
|
+
size: 4,
|
|
1200
|
+
classNames: "dx-icon-inline"
|
|
1201
|
+
})
|
|
1202
|
+
}
|
|
1203
|
+
}))));
|
|
1204
|
+
}
|
|
1205
|
+
return /* @__PURE__ */ React13.createElement("div", null, filteredAnchors.map((anchor) => {
|
|
1206
|
+
const thread = Relation2.getSource(anchor);
|
|
1207
|
+
const threadId = Obj3.getDXN(thread).toString();
|
|
1208
|
+
return /* @__PURE__ */ React13.createElement(CommentsThread, {
|
|
1209
|
+
key: threadId,
|
|
1210
|
+
anchor,
|
|
1211
|
+
current: currentId === threadId,
|
|
1212
|
+
...props
|
|
1213
|
+
});
|
|
1214
|
+
}));
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
// src/components/index.ts
|
|
1218
|
+
var ThreadSettings = lazy(() => import("../ThreadSettings-5Z5XIHG3.mjs"));
|
|
1219
|
+
export {
|
|
1220
|
+
Call,
|
|
1221
|
+
Chat,
|
|
1222
|
+
CommentsPanel,
|
|
1223
|
+
CommentsThread,
|
|
1224
|
+
MessagePanel,
|
|
1225
|
+
ThreadSettings,
|
|
1226
|
+
Toolbar,
|
|
1227
|
+
buttonClassNames,
|
|
1228
|
+
buttonGroupClassNames
|
|
1229
|
+
};
|
|
1230
|
+
//# sourceMappingURL=index.mjs.map
|