@dxos/plugin-thread 0.8.2-main.f11618f → 0.8.2-staging.42af850
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/browser/ChannelContainer-LGYSQMC7.mjs +15 -0
- package/dist/lib/browser/ChatContainer-JWRI73OG.mjs +14 -0
- package/dist/lib/browser/app-graph-builder-K3CFBN7V.mjs +171 -0
- package/dist/lib/browser/app-graph-builder-K3CFBN7V.mjs.map +7 -0
- package/dist/lib/browser/call-manager-APQAZWHT.mjs +23 -0
- package/dist/lib/browser/call-manager-APQAZWHT.mjs.map +7 -0
- package/dist/lib/browser/chunk-4H4A264L.mjs +1708 -0
- package/dist/lib/browser/chunk-4H4A264L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AYNXYEKP.mjs → chunk-5P5BH5GE.mjs} +57 -35
- package/dist/lib/browser/chunk-5P5BH5GE.mjs.map +7 -0
- package/dist/lib/browser/chunk-5PGLGDIP.mjs +983 -0
- package/dist/lib/browser/chunk-5PGLGDIP.mjs.map +7 -0
- package/dist/lib/browser/chunk-CF2MXRCH.mjs +21 -0
- package/dist/lib/browser/chunk-CF2MXRCH.mjs.map +7 -0
- package/dist/lib/browser/chunk-G3TS64FP.mjs +351 -0
- package/dist/lib/browser/chunk-G3TS64FP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBJLUUOK.mjs → chunk-IIUTBDVB.mjs} +4 -4
- package/dist/lib/browser/chunk-IIUTBDVB.mjs.map +7 -0
- package/dist/lib/browser/chunk-JKQUJOTX.mjs +31 -0
- package/dist/lib/browser/chunk-JKQUJOTX.mjs.map +7 -0
- package/dist/lib/browser/chunk-KMVGJG23.mjs +545 -0
- package/dist/lib/browser/chunk-KMVGJG23.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EP6MRLY7.mjs → chunk-R5MDLUPC.mjs} +5 -3
- package/dist/lib/browser/chunk-R5MDLUPC.mjs.map +7 -0
- package/dist/lib/browser/chunk-WDOQXTI2.mjs +126 -0
- package/dist/lib/browser/chunk-WDOQXTI2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +107 -41
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-3UW6ROYT.mjs → intent-resolver-YUYZCTLF.mjs} +100 -72
- package/dist/lib/browser/intent-resolver-YUYZCTLF.mjs.map +7 -0
- package/dist/lib/browser/markdown-4EC3OCF2.mjs +169 -0
- package/dist/lib/browser/markdown-4EC3OCF2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-EECCWHCW.mjs +27 -0
- package/dist/lib/browser/react-root-EECCWHCW.mjs.map +7 -0
- package/dist/lib/browser/react-surface-5QLZAFDL.mjs +108 -0
- package/dist/lib/browser/react-surface-5QLZAFDL.mjs.map +7 -0
- package/dist/lib/browser/{settings-2VZ7S4SK.mjs → settings-KVBQQSO5.mjs} +3 -3
- package/dist/lib/browser/{state-KBGI3QTR.mjs → state-RKL5MSDP.mjs} +4 -4
- package/dist/lib/browser/{state-KBGI3QTR.mjs.map → state-RKL5MSDP.mjs.map} +3 -3
- package/dist/lib/browser/types/index.mjs +16 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node/ChannelContainer-5EKNEH56.cjs +36 -0
- package/dist/lib/node/ChannelContainer-5EKNEH56.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-EE3FPSYO.cjs +35 -0
- package/dist/lib/node/ChatContainer-EE3FPSYO.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-IRE3GYKE.cjs +179 -0
- package/dist/lib/node/app-graph-builder-IRE3GYKE.cjs.map +7 -0
- package/dist/lib/node/call-manager-HV2XJW5O.cjs +37 -0
- package/dist/lib/node/call-manager-HV2XJW5O.cjs.map +7 -0
- package/dist/lib/node/chunk-44I33JDT.cjs +1731 -0
- package/dist/lib/node/chunk-44I33JDT.cjs.map +7 -0
- package/dist/lib/node/chunk-4B3PPXA6.cjs +371 -0
- package/dist/lib/node/chunk-4B3PPXA6.cjs.map +7 -0
- package/dist/lib/node/{chunk-NQ5DTPOY.cjs → chunk-4YSNVPWU.cjs} +10 -8
- package/dist/lib/node/chunk-4YSNVPWU.cjs.map +7 -0
- package/dist/lib/node/chunk-6B3M6XRE.cjs +984 -0
- package/dist/lib/node/chunk-6B3M6XRE.cjs.map +7 -0
- package/dist/lib/node/{chunk-W25MBII2.cjs → chunk-FUXJAVFZ.cjs} +50 -29
- package/dist/lib/node/chunk-FUXJAVFZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-ONLWOUYZ.cjs → chunk-HLMCEE5K.cjs} +7 -7
- package/dist/lib/node/{chunk-ONLWOUYZ.cjs.map → chunk-HLMCEE5K.cjs.map} +2 -2
- package/dist/lib/node/chunk-JLHENFGK.cjs +549 -0
- package/dist/lib/node/chunk-JLHENFGK.cjs.map +7 -0
- package/dist/lib/node/chunk-LR5NENBE.cjs +54 -0
- package/dist/lib/node/chunk-LR5NENBE.cjs.map +7 -0
- package/dist/lib/node/chunk-TKHJVC2C.cjs +147 -0
- package/dist/lib/node/chunk-TKHJVC2C.cjs.map +7 -0
- package/dist/lib/node/{chunk-IX63EKGL.cjs → chunk-U7NOIXN6.cjs} +16 -10
- package/dist/lib/node/chunk-U7NOIXN6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +142 -80
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-DC6HDNTX.cjs → intent-resolver-MZ3HADNY.cjs} +108 -82
- package/dist/lib/node/intent-resolver-MZ3HADNY.cjs.map +7 -0
- package/dist/lib/node/markdown-NJDPXIKD.cjs +178 -0
- package/dist/lib/node/markdown-NJDPXIKD.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-root-IAYQ2DBO.cjs +51 -0
- package/dist/lib/node/react-root-IAYQ2DBO.cjs.map +7 -0
- package/dist/lib/node/react-surface-AVC5VVIS.cjs +122 -0
- package/dist/lib/node/react-surface-AVC5VVIS.cjs.map +7 -0
- package/dist/lib/node/{settings-7MGTJ46L.cjs → settings-H45P5YO2.cjs} +8 -8
- package/dist/lib/node/{state-FOHMAVSU.cjs → state-IY5XX3H2.cjs} +8 -8
- package/dist/lib/node/{state-FOHMAVSU.cjs.map → state-IY5XX3H2.cjs.map} +3 -3
- package/dist/lib/node/{types.cjs → types/index.cjs} +12 -6
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/ChannelContainer-KFS2RWWW.mjs +16 -0
- package/dist/lib/node-esm/ChannelContainer-KFS2RWWW.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-UJYPQMLV.mjs +15 -0
- package/dist/lib/node-esm/ChatContainer-UJYPQMLV.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-I5VMPLE4.mjs +172 -0
- package/dist/lib/node-esm/app-graph-builder-I5VMPLE4.mjs.map +7 -0
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs +24 -0
- package/dist/lib/node-esm/call-manager-UUYXLF4T.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-42F2DTMM.mjs → chunk-ESQC6SYE.mjs} +4 -4
- package/dist/lib/node-esm/chunk-ESQC6SYE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-J323VQ4P.mjs +127 -0
- package/dist/lib/node-esm/chunk-J323VQ4P.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WLY2HMDB.mjs → chunk-K4KAUOKT.mjs} +5 -3
- package/dist/lib/node-esm/chunk-K4KAUOKT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MNJ3V4XM.mjs +546 -0
- package/dist/lib/node-esm/chunk-MNJ3V4XM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-T6E5EY7Z.mjs → chunk-O3V45YJP.mjs} +57 -35
- package/dist/lib/node-esm/chunk-O3V45YJP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ODUB4GAB.mjs +23 -0
- package/dist/lib/node-esm/chunk-ODUB4GAB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PGRP3O4O.mjs +33 -0
- package/dist/lib/node-esm/chunk-PGRP3O4O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POKXRTII.mjs +352 -0
- package/dist/lib/node-esm/chunk-POKXRTII.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WXNPD542.mjs +1710 -0
- package/dist/lib/node-esm/chunk-WXNPD542.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X6AUQDTE.mjs +984 -0
- package/dist/lib/node-esm/chunk-X6AUQDTE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +107 -41
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-OAMDKGAA.mjs → intent-resolver-CU22OPAH.mjs} +100 -72
- package/dist/lib/node-esm/intent-resolver-CU22OPAH.mjs.map +7 -0
- package/dist/lib/node-esm/markdown-HRGGO7IA.mjs +170 -0
- package/dist/lib/node-esm/markdown-HRGGO7IA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-NQMUEI6Z.mjs +28 -0
- package/dist/lib/node-esm/react-root-NQMUEI6Z.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-Z4X5VLMY.mjs +109 -0
- package/dist/lib/node-esm/react-surface-Z4X5VLMY.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-AJAZ3O47.mjs → settings-IJGUOU3F.mjs} +3 -3
- package/dist/lib/node-esm/{state-IRLEO2SB.mjs → state-6AUTNROZ.mjs} +4 -4
- package/dist/lib/node-esm/{state-IRLEO2SB.mjs.map → state-6AUTNROZ.mjs.map} +3 -3
- package/dist/lib/node-esm/types/index.mjs +17 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts +77 -0
- package/dist/types/src/calls/call-manager.d.ts.map +1 -0
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +66 -0
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -0
- package/dist/types/src/calls/index.d.ts +7 -0
- package/dist/types/src/calls/index.d.ts.map +1 -0
- package/dist/types/src/calls/media-manager.d.ts +60 -0
- package/dist/types/src/calls/media-manager.d.ts.map +1 -0
- package/dist/types/src/calls/speaking-monitor.d.ts +24 -0
- package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -0
- package/dist/types/src/calls/types.d.ts +45 -0
- package/dist/types/src/calls/types.d.ts.map +1 -0
- package/dist/types/src/calls/util/audio.d.ts +6 -0
- package/dist/types/src/calls/util/audio.d.ts.map +1 -0
- package/dist/types/src/calls/util/calls-service.d.ts +72 -0
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -0
- package/dist/types/src/calls/util/history-cache.d.ts +11 -0
- package/dist/types/src/calls/util/history-cache.d.ts.map +1 -0
- package/dist/types/src/calls/util/index.d.ts +5 -0
- package/dist/types/src/calls/util/index.d.ts.map +1 -0
- package/dist/types/src/calls/util/media.d.ts +6 -0
- package/dist/types/src/calls/util/media.d.ts.map +1 -0
- package/dist/types/src/calls/util/stub-media-streams.d.ts +18 -0
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -0
- package/dist/types/src/calls/util/task-scheduling.d.ts +17 -0
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts +5 -0
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +13 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -179
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +2 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +7 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Call/Call.d.ts +17 -0
- package/dist/types/src/components/Call/Call.d.ts.map +1 -0
- package/dist/types/src/components/Call/Toolbar.d.ts +16 -0
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Call/index.d.ts +3 -0
- package/dist/types/src/components/Call/index.d.ts.map +1 -0
- package/dist/types/src/components/CallDebugPanel.d.ts +8 -0
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -0
- package/dist/types/src/components/CallSidebar.d.ts +4 -0
- package/dist/types/src/components/CallSidebar.d.ts.map +1 -0
- package/dist/types/src/components/ChannelContainer.d.ts +14 -0
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -0
- package/dist/types/src/components/ChannelContainer.stories.d.ts +10 -0
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +9 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentContainer.d.ts +11 -2
- package/dist/types/src/components/CommentContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +1 -1
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +5 -9
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts +15 -0
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -0
- package/dist/types/src/components/Lobby/index.d.ts +2 -0
- package/dist/types/src/components/Lobby/index.d.ts.map +1 -0
- package/dist/types/src/components/Media/AudioStream.d.ts +6 -0
- package/dist/types/src/components/Media/AudioStream.d.ts.map +1 -0
- package/dist/types/src/components/Media/VideoObject.d.ts +15 -0
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -0
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +8 -0
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -0
- package/dist/types/src/components/Media/index.d.ts +3 -0
- package/dist/types/src/components/Media/index.d.ts.map +1 -0
- package/dist/types/src/components/MessageContainer.d.ts +5 -4
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/Participant.d.ts +6 -0
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -0
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts +11 -0
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -0
- package/dist/types/src/components/Participant/index.d.ts +3 -0
- package/dist/types/src/components/Participant/index.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts +12 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +10 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +32 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +23 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +21 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +4 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -0
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +54 -119
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts +2 -2
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebugMode.d.ts +2 -0
- package/dist/types/src/hooks/useDebugMode.d.ts.map +1 -0
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/peers.stories.d.ts +11 -0
- package/dist/types/src/peers.stories.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/stories.d.ts +2 -0
- package/dist/types/src/testing/stories.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +35 -56
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +317 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +1015 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util.d.ts +2 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -40
- package/src/ThreadPlugin.tsx +33 -14
- package/src/calls/call-manager.ts +242 -0
- package/src/calls/call-swarm-synchronizer.ts +350 -0
- package/src/calls/index.ts +10 -0
- package/src/calls/media-manager.ts +342 -0
- package/src/calls/speaking-monitor.ts +85 -0
- package/src/calls/types.ts +70 -0
- package/src/calls/util/audio.ts +58 -0
- package/src/calls/util/calls-service.ts +527 -0
- package/src/calls/util/history-cache.ts +27 -0
- package/src/calls/util/index.ts +8 -0
- package/src/calls/util/media.ts +52 -0
- package/src/calls/util/stub-media-streams.ts +73 -0
- package/src/calls/util/task-scheduling.ts +92 -0
- package/src/capabilities/app-graph-builder.ts +171 -25
- package/src/capabilities/call-manager.ts +19 -0
- package/src/capabilities/capabilities.ts +15 -1
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/intent-resolver.ts +76 -55
- package/src/capabilities/markdown.ts +54 -4
- package/src/capabilities/react-root.tsx +17 -0
- package/src/capabilities/react-surface.tsx +52 -27
- package/src/capabilities/state.ts +1 -1
- package/src/components/Call/Call.tsx +88 -0
- package/src/components/Call/Toolbar.tsx +182 -0
- package/src/components/Call/index.ts +6 -0
- package/src/components/CallDebugPanel.tsx +115 -0
- package/src/components/CallSidebar.tsx +17 -0
- package/src/components/ChannelContainer.stories.tsx +58 -0
- package/src/components/ChannelContainer.tsx +203 -0
- package/src/components/Chat.stories.tsx +9 -10
- package/src/components/ChatContainer.tsx +37 -25
- package/src/components/CommentContainer.tsx +56 -61
- package/src/components/Comments.stories.tsx +20 -16
- package/src/components/CommentsContainer.tsx +18 -28
- package/src/components/Lobby/Lobby.tsx +119 -0
- package/src/components/Lobby/index.ts +5 -0
- package/src/components/Media/AudioStream.tsx +67 -0
- package/src/components/Media/VideoObject.stories.tsx +52 -0
- package/src/components/Media/VideoObject.tsx +58 -0
- package/src/components/Media/index.ts +6 -0
- package/src/components/MessageContainer.tsx +31 -50
- package/src/components/Participant/Participant.tsx +57 -0
- package/src/components/Participant/ParticipantGrid.tsx +88 -0
- package/src/components/Participant/index.ts +6 -0
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +54 -0
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +31 -0
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +156 -0
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +341 -0
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +131 -0
- package/src/components/ResponsiveGrid/index.ts +7 -0
- package/src/components/ThreadComplementary.tsx +37 -42
- package/src/components/index.ts +4 -0
- package/src/components/testing.ts +4 -3
- package/src/extensions/threads.ts +42 -24
- package/src/hooks/analytics.ts +6 -2
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useDebugMode.ts +25 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +4 -3
- package/src/peers.stories.tsx +189 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/stories.ts +50 -0
- package/src/translations.ts +46 -5
- package/src/types/index.ts +6 -0
- package/src/types/schema.ts +29 -0
- package/src/types/types.ts +110 -0
- package/src/typings/peermetrics-webrtc-stats.d.ts +30 -0
- package/src/util.ts +12 -0
- package/dist/lib/browser/ChatContainer-WC6KQDDU.mjs +0 -138
- package/dist/lib/browser/ChatContainer-WC6KQDDU.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-6W4UKJDI.mjs +0 -41
- package/dist/lib/browser/app-graph-builder-6W4UKJDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-AYNXYEKP.mjs.map +0 -7
- package/dist/lib/browser/chunk-EP6MRLY7.mjs.map +0 -7
- package/dist/lib/browser/chunk-FY5OCUP6.mjs +0 -207
- package/dist/lib/browser/chunk-FY5OCUP6.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q66FBBJD.mjs +0 -17
- package/dist/lib/browser/chunk-Q66FBBJD.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBJLUUOK.mjs.map +0 -7
- package/dist/lib/browser/chunk-WOG72DWE.mjs +0 -93
- package/dist/lib/browser/chunk-WOG72DWE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UW6ROYT.mjs.map +0 -7
- package/dist/lib/browser/markdown-7KXBXCUS.mjs +0 -111
- package/dist/lib/browser/markdown-7KXBXCUS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-F2AIYIUH.mjs +0 -437
- package/dist/lib/browser/react-surface-F2AIYIUH.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -10
- package/dist/lib/node/ChatContainer-LVYQ67PJ.cjs +0 -163
- package/dist/lib/node/ChatContainer-LVYQ67PJ.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-HZNWT4QU.cjs +0 -57
- package/dist/lib/node/app-graph-builder-HZNWT4QU.cjs.map +0 -7
- package/dist/lib/node/chunk-46BSFPBV.cjs +0 -113
- package/dist/lib/node/chunk-46BSFPBV.cjs.map +0 -7
- package/dist/lib/node/chunk-IX63EKGL.cjs.map +0 -7
- package/dist/lib/node/chunk-NQ5DTPOY.cjs.map +0 -7
- package/dist/lib/node/chunk-RIYLEDQ7.cjs +0 -232
- package/dist/lib/node/chunk-RIYLEDQ7.cjs.map +0 -7
- package/dist/lib/node/chunk-W25MBII2.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-DC6HDNTX.cjs.map +0 -7
- package/dist/lib/node/markdown-L2WMCQKM.cjs +0 -121
- package/dist/lib/node/markdown-L2WMCQKM.cjs.map +0 -7
- package/dist/lib/node/react-surface-GP5IH5LN.cjs +0 -439
- package/dist/lib/node/react-surface-GP5IH5LN.cjs.map +0 -7
- package/dist/lib/node/types.cjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-WMOPMK5H.mjs +0 -139
- package/dist/lib/node-esm/ChatContainer-WMOPMK5H.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-M3KK5QJH.mjs +0 -42
- package/dist/lib/node-esm/app-graph-builder-M3KK5QJH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-42F2DTMM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7DOPZH6Y.mjs +0 -208
- package/dist/lib/node-esm/chunk-7DOPZH6Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E446MGLP.mjs +0 -94
- package/dist/lib/node-esm/chunk-E446MGLP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QUTIMZJ4.mjs +0 -19
- package/dist/lib/node-esm/chunk-QUTIMZJ4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T6E5EY7Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WLY2HMDB.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OAMDKGAA.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-ZKU23UVD.mjs +0 -112
- package/dist/lib/node-esm/markdown-ZKU23UVD.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-45GRKLWG.mjs +0 -438
- package/dist/lib/node-esm/react-surface-45GRKLWG.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -11
- package/dist/types/src/components/types.d.ts +0 -28
- package/dist/types/src/components/types.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -231
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/types.ts +0 -32
- package/src/events.ts +0 -11
- package/src/types.ts +0 -100
- /package/dist/lib/browser/{types.mjs.map → ChannelContainer-LGYSQMC7.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types.mjs.map → browser/ChatContainer-JWRI73OG.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2VZ7S4SK.mjs.map → settings-KVBQQSO5.mjs.map} +0 -0
- /package/dist/lib/node/{settings-7MGTJ46L.cjs.map → settings-H45P5YO2.cjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-AJAZ3O47.mjs.map → settings-IJGUOU3F.mjs.map} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
6
|
+
import { live } from '@dxos/live-object';
|
|
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 = live(ThreadType, { messages: [] });
|
|
27
|
+
client.spaces.default.db.add(live(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/translations.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ChannelType } from '@dxos/plugin-space/types';
|
|
6
|
-
|
|
7
5
|
import { THREAD_PLUGIN } from './meta';
|
|
6
|
+
import { ChannelType } from './types';
|
|
8
7
|
|
|
9
8
|
export default [
|
|
10
9
|
{
|
|
@@ -14,7 +13,7 @@ export default [
|
|
|
14
13
|
'object name placeholder': 'New channel',
|
|
15
14
|
},
|
|
16
15
|
[THREAD_PLUGIN]: {
|
|
17
|
-
'plugin name': '
|
|
16
|
+
'plugin name': 'Chat',
|
|
18
17
|
'channel title label': 'Title',
|
|
19
18
|
'message placeholder': 'Reply…',
|
|
20
19
|
'activity message': 'Processing…',
|
|
@@ -27,9 +26,9 @@ export default [
|
|
|
27
26
|
'comments heading': 'Comments',
|
|
28
27
|
'chat heading': 'Chat',
|
|
29
28
|
'draft button': 'DRAFT',
|
|
30
|
-
'no comments title': '
|
|
29
|
+
'no comments title': 'Comments',
|
|
31
30
|
'no comments message':
|
|
32
|
-
'
|
|
31
|
+
'Click on the <commentIcon></commentIcon> button in the document toolbar to create a comment thread on the selected text.',
|
|
33
32
|
'toggle show resolved': 'Show resolved',
|
|
34
33
|
'unnamed object threads label': 'Threads',
|
|
35
34
|
'mark as resolved label': 'Mark as resolved',
|
|
@@ -41,6 +40,48 @@ export default [
|
|
|
41
40
|
'comments label': 'Comments',
|
|
42
41
|
'show all label': 'All comments',
|
|
43
42
|
'show unresolved label': 'Unresolved only',
|
|
43
|
+
|
|
44
|
+
'channel companion label': 'Channel',
|
|
45
|
+
'call panel label': 'Active Call',
|
|
46
|
+
|
|
47
|
+
'display name label': 'Display name',
|
|
48
|
+
'display name description': 'Set your display name before joining a meeting.',
|
|
49
|
+
'display name input placeholder': 'Enter your name',
|
|
50
|
+
'set display name label': 'Continue',
|
|
51
|
+
|
|
52
|
+
'call tab label': 'Call',
|
|
53
|
+
'meeting status title': 'Meeting',
|
|
54
|
+
'share meeting link label': 'Share meeting',
|
|
55
|
+
'show webrtc stats title': 'Detailed WebRTC Stats',
|
|
56
|
+
|
|
57
|
+
'meeting summary label': 'Summary',
|
|
58
|
+
'summarize label': 'Summarize',
|
|
59
|
+
'summarizing label': 'Creating summary...',
|
|
60
|
+
'create summary message': 'A summary doesn’t exist for this meeting yet. Create one now?',
|
|
61
|
+
|
|
62
|
+
'join call': 'Join',
|
|
63
|
+
'leave call': 'Leave',
|
|
64
|
+
|
|
65
|
+
'lobby participants_zero': 'No participants',
|
|
66
|
+
'lobby participants_one': '1 participant',
|
|
67
|
+
'lobby participants_other': '{{count}} participants',
|
|
68
|
+
|
|
69
|
+
'icon pin': 'Pin video',
|
|
70
|
+
'icon unpin': 'Unpin video',
|
|
71
|
+
'icon wave': 'Waving',
|
|
72
|
+
'icon muted': 'Muted',
|
|
73
|
+
'icon speaking': 'Speaking',
|
|
74
|
+
|
|
75
|
+
'mic on': 'Unmute',
|
|
76
|
+
'mic off': 'Mute',
|
|
77
|
+
'camera on': 'Turn camera on',
|
|
78
|
+
'camera off': 'Turn camera off',
|
|
79
|
+
'camera off label': 'Camera off',
|
|
80
|
+
|
|
81
|
+
'raise hand': 'Raise hand',
|
|
82
|
+
'lower hand': 'Lower hand',
|
|
83
|
+
'screenshare on': 'Share screen',
|
|
84
|
+
'screenshare off': 'Stop streaming',
|
|
44
85
|
},
|
|
45
86
|
},
|
|
46
87
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export 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 type ThreadType = Schema.Schema.Type<typeof ThreadType>;
|
|
22
|
+
|
|
23
|
+
export const ChannelType = Schema.Struct({
|
|
24
|
+
name: Schema.optional(Schema.String),
|
|
25
|
+
defaultThread: Type.Ref(ThreadType),
|
|
26
|
+
// TODO(wittjosiah): Should be an "ordered collection".
|
|
27
|
+
threads: Schema.mutable(Schema.Array(Type.Ref(ThreadType))),
|
|
28
|
+
}).pipe(Type.Obj({ typename: 'dxos.org/type/Channel', version: '0.1.0' }));
|
|
29
|
+
export type ChannelType = Schema.Schema.Type<typeof ChannelType>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Type } from '@dxos/echo';
|
|
8
|
+
import { EchoObjectSchema } from '@dxos/react-client/echo';
|
|
9
|
+
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
10
|
+
|
|
11
|
+
import { ChannelType, ThreadType } from './schema';
|
|
12
|
+
import { THREAD_PLUGIN } from '../meta';
|
|
13
|
+
|
|
14
|
+
export namespace ThreadAction {
|
|
15
|
+
const THREAD_ACTION = `${THREAD_PLUGIN}/action`;
|
|
16
|
+
|
|
17
|
+
export class CreateChannel extends Schema.TaggedClass<CreateChannel>()(`${THREAD_ACTION}/create-channel`, {
|
|
18
|
+
input: Schema.Struct({
|
|
19
|
+
spaceId: Type.SpaceId,
|
|
20
|
+
name: Schema.optional(Schema.String),
|
|
21
|
+
}),
|
|
22
|
+
output: Schema.Struct({
|
|
23
|
+
object: ChannelType,
|
|
24
|
+
}),
|
|
25
|
+
}) {}
|
|
26
|
+
|
|
27
|
+
export class CreateChannelThread extends Schema.TaggedClass<CreateChannelThread>()(
|
|
28
|
+
`${THREAD_ACTION}/create-channel-thread`,
|
|
29
|
+
{
|
|
30
|
+
input: Schema.Struct({
|
|
31
|
+
channel: ChannelType,
|
|
32
|
+
}),
|
|
33
|
+
output: Schema.Struct({
|
|
34
|
+
object: ThreadType,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
) {}
|
|
38
|
+
|
|
39
|
+
export class Create extends Schema.TaggedClass<Create>()(`${THREAD_ACTION}/create`, {
|
|
40
|
+
input: Schema.Struct({
|
|
41
|
+
name: Schema.optional(Schema.String),
|
|
42
|
+
anchor: Schema.optional(Schema.String),
|
|
43
|
+
subject: EchoObjectSchema,
|
|
44
|
+
}),
|
|
45
|
+
output: Schema.Void,
|
|
46
|
+
}) {}
|
|
47
|
+
|
|
48
|
+
export class Delete extends Schema.TaggedClass<Delete>()(`${THREAD_ACTION}/delete`, {
|
|
49
|
+
input: Schema.Struct({
|
|
50
|
+
anchor: AnchoredTo,
|
|
51
|
+
subject: EchoObjectSchema,
|
|
52
|
+
thread: Schema.optional(ThreadType),
|
|
53
|
+
}),
|
|
54
|
+
output: Schema.Void,
|
|
55
|
+
}) {}
|
|
56
|
+
|
|
57
|
+
export class Select extends Schema.TaggedClass<Select>()(`${THREAD_ACTION}/select`, {
|
|
58
|
+
input: Schema.Struct({
|
|
59
|
+
current: Schema.String,
|
|
60
|
+
}),
|
|
61
|
+
output: Schema.Void,
|
|
62
|
+
}) {}
|
|
63
|
+
|
|
64
|
+
export class ToggleResolved extends Schema.TaggedClass<ToggleResolved>()(`${THREAD_ACTION}/toggle-resolved`, {
|
|
65
|
+
input: Schema.Struct({
|
|
66
|
+
thread: ThreadType,
|
|
67
|
+
}),
|
|
68
|
+
output: Schema.Void,
|
|
69
|
+
}) {}
|
|
70
|
+
|
|
71
|
+
export class AddMessage extends Schema.TaggedClass<AddMessage>()(`${THREAD_ACTION}/add-message`, {
|
|
72
|
+
input: Schema.Struct({
|
|
73
|
+
subject: EchoObjectSchema,
|
|
74
|
+
anchor: AnchoredTo,
|
|
75
|
+
sender: DataType.Actor,
|
|
76
|
+
text: Schema.String,
|
|
77
|
+
}),
|
|
78
|
+
output: Schema.Void,
|
|
79
|
+
}) {}
|
|
80
|
+
|
|
81
|
+
export class DeleteMessage extends Schema.TaggedClass<DeleteMessage>()(`${THREAD_ACTION}/delete-message`, {
|
|
82
|
+
input: Schema.Struct({
|
|
83
|
+
anchor: AnchoredTo,
|
|
84
|
+
subject: EchoObjectSchema,
|
|
85
|
+
messageId: Schema.String,
|
|
86
|
+
message: Schema.optional(DataType.Message),
|
|
87
|
+
messageIndex: Schema.optional(Schema.Number),
|
|
88
|
+
}),
|
|
89
|
+
output: Schema.Void,
|
|
90
|
+
}) {}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const ThreadSettingsSchema = Schema.mutable(Schema.Struct({}));
|
|
94
|
+
export type ThreadSettingsProps = Schema.Schema.Type<typeof ThreadSettingsSchema>;
|
|
95
|
+
|
|
96
|
+
export interface ThreadModel {
|
|
97
|
+
root: ThreadType;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
type SubjectId = string;
|
|
101
|
+
export type ViewState = { showResolvedThreads: boolean };
|
|
102
|
+
export type ViewStore = Record<SubjectId, ViewState>;
|
|
103
|
+
|
|
104
|
+
export type ThreadState = {
|
|
105
|
+
/** Object toolbar state. */
|
|
106
|
+
toolbar: Record<string, boolean>;
|
|
107
|
+
/** In-memory draft threads. */
|
|
108
|
+
drafts: Record<string, AnchoredTo[]>;
|
|
109
|
+
current?: string | undefined;
|
|
110
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
declare module '@peermetrics/webrtc-stats' {
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
|
+
|
|
8
|
+
export interface WebRTCStatsConstructorOptions {
|
|
9
|
+
getStatsInterval?: number;
|
|
10
|
+
rawStats?: boolean;
|
|
11
|
+
statsObject?: boolean;
|
|
12
|
+
filteredStats?: boolean;
|
|
13
|
+
wrapGetUserMedia?: boolean;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
remote?: boolean;
|
|
16
|
+
logLevel?: LogLevel;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ConnectionInfo {
|
|
20
|
+
pc: RTCPeerConnection;
|
|
21
|
+
peerId: number | string;
|
|
22
|
+
connectionId: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class WebRTCStats extends EventEmitter {
|
|
26
|
+
constructor(options: WebRTCStatsConstructorOptions);
|
|
27
|
+
addConnection(info: ConnectionInfo): void;
|
|
28
|
+
removeConnection(info: Pick<ConnectionInfo, 'pc'>): void;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/util.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Match } from 'effect';
|
|
6
|
+
|
|
5
7
|
import { generateName } from '@dxos/display-name';
|
|
8
|
+
import { type Selection } from '@dxos/plugin-attention';
|
|
6
9
|
import { type PublicKey } from '@dxos/react-client';
|
|
7
10
|
import { type Identity } from '@dxos/react-client/halo';
|
|
8
11
|
import { type MessageMetadata } from '@dxos/react-ui-thread';
|
|
@@ -24,3 +27,12 @@ export const getMessageMetadata = (id: string, identity?: Identity): MessageMeta
|
|
|
24
27
|
},
|
|
25
28
|
};
|
|
26
29
|
};
|
|
30
|
+
|
|
31
|
+
export const getAnchor = Match.type<Selection | undefined>().pipe(
|
|
32
|
+
Match.when({ mode: 'single' }, (s) => s.id),
|
|
33
|
+
Match.when({ mode: 'multi' }, (s) => (s.ids.length > 0 ? s.ids.join(',') : undefined)),
|
|
34
|
+
Match.when({ mode: 'range' }, (s) => (s.from && s.to ? `${s.from}:${s.to}` : undefined)),
|
|
35
|
+
Match.when({ mode: 'multi-range' }, (s) => s.ranges[0] && `${s.ranges[0].from}:${s.ranges[0].to}`),
|
|
36
|
+
Match.when(undefined, () => undefined),
|
|
37
|
+
Match.exhaustive,
|
|
38
|
+
);
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MessageContainer,
|
|
3
|
-
command,
|
|
4
|
-
getMessageMetadata
|
|
5
|
-
} from "./chunk-FY5OCUP6.mjs";
|
|
6
|
-
import {
|
|
7
|
-
useStatus
|
|
8
|
-
} from "./chunk-AYNXYEKP.mjs";
|
|
9
|
-
import {
|
|
10
|
-
THREAD_PLUGIN
|
|
11
|
-
} from "./chunk-WBJLUUOK.mjs";
|
|
12
|
-
|
|
13
|
-
// packages/plugins/plugin-thread/src/components/ChatContainer.tsx
|
|
14
|
-
import React, { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
15
|
-
import { create } from "@dxos/echo-schema";
|
|
16
|
-
import { makeRef } from "@dxos/live-object";
|
|
17
|
-
import { useMembers, useQueue } from "@dxos/react-client/echo";
|
|
18
|
-
import { useIdentity } from "@dxos/react-client/halo";
|
|
19
|
-
import { Icon, ScrollArea, useThemeContext, useTranslation } from "@dxos/react-ui";
|
|
20
|
-
import { createBasicExtensions, createThemeExtensions, listener } from "@dxos/react-ui-editor";
|
|
21
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
22
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
23
|
-
import { MessageTextbox, Thread, ThreadFooter, threadLayout } from "@dxos/react-ui-thread";
|
|
24
|
-
import { MessageType } from "@dxos/schema";
|
|
25
|
-
var ChatHeading = ({ attendableId }) => {
|
|
26
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
27
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
28
|
-
role: "none",
|
|
29
|
-
className: "flex items-center"
|
|
30
|
-
}, /* @__PURE__ */ React.createElement(StackItem.SigilButton, {
|
|
31
|
-
attendableId
|
|
32
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
33
|
-
icon: "ph--chat--regular",
|
|
34
|
-
size: 5
|
|
35
|
-
})), /* @__PURE__ */ React.createElement(StackItem.HeadingLabel, {
|
|
36
|
-
attendableId
|
|
37
|
-
}, t("chat heading")));
|
|
38
|
-
};
|
|
39
|
-
var ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }) => {
|
|
40
|
-
const id = dxn.toString();
|
|
41
|
-
const identity = useIdentity();
|
|
42
|
-
const members = useMembers(space?.key);
|
|
43
|
-
const queue = useQueue(dxn, {
|
|
44
|
-
pollInterval: 1e3
|
|
45
|
-
});
|
|
46
|
-
const activity = useStatus(space, id);
|
|
47
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
48
|
-
const [_count, _setCount] = useState(0);
|
|
49
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
50
|
-
const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);
|
|
51
|
-
const threadScrollRef = useRef(null);
|
|
52
|
-
const { themeMode } = useThemeContext();
|
|
53
|
-
const textboxMetadata = getMessageMetadata(id, identity);
|
|
54
|
-
const messageRef = useRef("");
|
|
55
|
-
const extensions = useMemo(() => [
|
|
56
|
-
createBasicExtensions({
|
|
57
|
-
placeholder: t("message placeholder")
|
|
58
|
-
}),
|
|
59
|
-
createThemeExtensions({
|
|
60
|
-
themeMode
|
|
61
|
-
}),
|
|
62
|
-
listener({
|
|
63
|
-
onChange: (text) => messageRef.current = text
|
|
64
|
-
}),
|
|
65
|
-
command
|
|
66
|
-
], [
|
|
67
|
-
themeMode,
|
|
68
|
-
_count
|
|
69
|
-
]);
|
|
70
|
-
const scrollToEnd = (behavior) => setTimeout(() => threadScrollRef.current?.scrollIntoView({
|
|
71
|
-
behavior,
|
|
72
|
-
block: "end"
|
|
73
|
-
}), 10);
|
|
74
|
-
useLayoutEffect(() => {
|
|
75
|
-
scrollToEnd("instant");
|
|
76
|
-
}, []);
|
|
77
|
-
const handleCreate = () => {
|
|
78
|
-
if (!messageRef.current?.length || !queue) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
queue.append([
|
|
82
|
-
create(MessageType, {
|
|
83
|
-
sender: {
|
|
84
|
-
identityDid: identity.did
|
|
85
|
-
},
|
|
86
|
-
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
87
|
-
blocks: [
|
|
88
|
-
{
|
|
89
|
-
type: "text",
|
|
90
|
-
text: messageRef.current
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
properties: context ? {
|
|
94
|
-
context: makeRef(context)
|
|
95
|
-
} : void 0
|
|
96
|
-
})
|
|
97
|
-
]);
|
|
98
|
-
messageRef.current = "";
|
|
99
|
-
setAutoFocus(true);
|
|
100
|
-
scrollToEnd("smooth");
|
|
101
|
-
rerenderEditor();
|
|
102
|
-
return true;
|
|
103
|
-
};
|
|
104
|
-
return /* @__PURE__ */ React.createElement(Thread, {
|
|
105
|
-
current,
|
|
106
|
-
id,
|
|
107
|
-
classNames: "bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0"
|
|
108
|
-
}, /* @__PURE__ */ React.createElement(ScrollArea.Root, {
|
|
109
|
-
classNames: "col-span-2"
|
|
110
|
-
}, /* @__PURE__ */ React.createElement(ScrollArea.Viewport, {
|
|
111
|
-
classNames: "overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]"
|
|
112
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
113
|
-
role: "none",
|
|
114
|
-
className: mx(threadLayout, "place-self-end")
|
|
115
|
-
}, (queue?.items ?? []).map((message) => /* @__PURE__ */ React.createElement(MessageContainer, {
|
|
116
|
-
key: message.id,
|
|
117
|
-
message,
|
|
118
|
-
members
|
|
119
|
-
}))), /* @__PURE__ */ React.createElement("div", {
|
|
120
|
-
role: "none",
|
|
121
|
-
className: "bs-px -mbs-px",
|
|
122
|
-
ref: threadScrollRef
|
|
123
|
-
}), /* @__PURE__ */ React.createElement(ScrollArea.Scrollbar, null, /* @__PURE__ */ React.createElement(ScrollArea.Thumb, null)))), /* @__PURE__ */ React.createElement(MessageTextbox, {
|
|
124
|
-
extensions,
|
|
125
|
-
autoFocus,
|
|
126
|
-
onSend: handleCreate,
|
|
127
|
-
...textboxMetadata
|
|
128
|
-
}), /* @__PURE__ */ React.createElement(ThreadFooter, {
|
|
129
|
-
activity
|
|
130
|
-
}, t("activity message")));
|
|
131
|
-
};
|
|
132
|
-
var ChatContainer_default = ChatContainer;
|
|
133
|
-
export {
|
|
134
|
-
ChatContainer,
|
|
135
|
-
ChatHeading,
|
|
136
|
-
ChatContainer_default as default
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=ChatContainer-WC6KQDDU.mjs.map
|