@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,131 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useState, type CSSProperties, type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Icon, IconButton, useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { Waveform } from '@dxos/react-ui-sfx';
|
|
9
|
+
import { hoverableHidden, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
|
|
11
|
+
import { THREAD_PLUGIN } from '../../meta';
|
|
12
|
+
|
|
13
|
+
export type ResponsiveGridItemProps<T extends object = any> = PropsWithChildren<
|
|
14
|
+
ThemedClassName<{
|
|
15
|
+
item: T;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
pinned?: boolean;
|
|
18
|
+
name?: string;
|
|
19
|
+
self?: boolean;
|
|
20
|
+
screenshare?: boolean;
|
|
21
|
+
video?: boolean;
|
|
22
|
+
mute?: boolean;
|
|
23
|
+
wave?: boolean;
|
|
24
|
+
speaking?: boolean;
|
|
25
|
+
debug?: boolean;
|
|
26
|
+
onClick?: (item: T) => void;
|
|
27
|
+
}>
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Cell container.
|
|
32
|
+
*/
|
|
33
|
+
export const ResponsiveGridItem = <T extends object = any>({
|
|
34
|
+
children,
|
|
35
|
+
classNames,
|
|
36
|
+
item,
|
|
37
|
+
style,
|
|
38
|
+
name,
|
|
39
|
+
self,
|
|
40
|
+
pinned,
|
|
41
|
+
screenshare,
|
|
42
|
+
video,
|
|
43
|
+
mute,
|
|
44
|
+
wave,
|
|
45
|
+
speaking,
|
|
46
|
+
onClick,
|
|
47
|
+
}: ResponsiveGridItemProps<T>) => {
|
|
48
|
+
const { t } = useTranslation(THREAD_PLUGIN);
|
|
49
|
+
const iconProps: Record<string, { icon: string; label: string; classNames?: string }> = {
|
|
50
|
+
wave: {
|
|
51
|
+
icon: 'ph--hand-waving--duotone',
|
|
52
|
+
label: t('icon wave'),
|
|
53
|
+
classNames: 'animate-pulse bg-orange-500',
|
|
54
|
+
},
|
|
55
|
+
mute: {
|
|
56
|
+
icon: 'ph--microphone-slash--regular',
|
|
57
|
+
label: t('icon muted'),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const props = wave && !pinned ? iconProps.wave : mute ? iconProps.mute : speaking ? iconProps.speaking : undefined;
|
|
62
|
+
|
|
63
|
+
// Debounce speaking indicator.
|
|
64
|
+
const [speakingIndicator, setSpeakingIndicator] = useState(speaking);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (speaking) {
|
|
67
|
+
setSpeakingIndicator(true);
|
|
68
|
+
} else {
|
|
69
|
+
const timeout = setTimeout(() => {
|
|
70
|
+
setSpeakingIndicator(false);
|
|
71
|
+
}, 1_000);
|
|
72
|
+
return () => clearTimeout(timeout);
|
|
73
|
+
}
|
|
74
|
+
}, [speaking]);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={mx(
|
|
79
|
+
'relative w-full h-full group',
|
|
80
|
+
'rounded-md outline outline-2 outline-neutral-900 transition-[outline-color] duration-500',
|
|
81
|
+
speakingIndicator ? 'outline-green-500' : !video && 'outline-separator',
|
|
82
|
+
classNames,
|
|
83
|
+
)}
|
|
84
|
+
style={style}
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
|
|
88
|
+
{/* Action. */}
|
|
89
|
+
{onClick && (
|
|
90
|
+
<div className='z-10 absolute top-1 right-1 flex'>
|
|
91
|
+
<IconButton
|
|
92
|
+
classNames={mx('p-1 min-bs-1 rounded', hoverableHidden)}
|
|
93
|
+
iconOnly
|
|
94
|
+
icon={pinned ? 'ph--x--regular' : 'ph--arrows-out--regular'}
|
|
95
|
+
size={pinned ? 5 : 4}
|
|
96
|
+
label={pinned ? t('icon unpin') : t('icon pin')}
|
|
97
|
+
onClick={() => onClick?.(item)}
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
|
|
102
|
+
{/* Name. */}
|
|
103
|
+
{name && (
|
|
104
|
+
<div className='z-10 absolute bottom-1 left-8 right-1 flex justify-end gap-1 items-center'>
|
|
105
|
+
{/* TODO(burdon): Replace with avatar for everyone. */}
|
|
106
|
+
{/* {self && <Icon icon='ph--asterisk--regular' size={pinned ? 5 : 4} />} */}
|
|
107
|
+
{screenshare && <Icon icon='ph--broadcast--regular' size={pinned ? 5 : 4} />}
|
|
108
|
+
<div
|
|
109
|
+
className={mx('bg-neutral-800 text-neutral-100 py-0.5 truncate rounded', pinned ? 'px-2' : 'px-1 text-xs')}
|
|
110
|
+
>
|
|
111
|
+
{name}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
{/* Activity. */}
|
|
117
|
+
<div className='z-10 absolute bottom-1 left-1 flex'>
|
|
118
|
+
{(speaking && <Waveform active size={pinned ? 5 : 4} />) ||
|
|
119
|
+
(props && (
|
|
120
|
+
<IconButton
|
|
121
|
+
classNames={mx('p-1 min-bs-1 rounded', props?.classNames)}
|
|
122
|
+
icon={props?.icon}
|
|
123
|
+
label={props?.label}
|
|
124
|
+
size={pinned ? 5 : 4}
|
|
125
|
+
iconOnly
|
|
126
|
+
/>
|
|
127
|
+
))}
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
@@ -2,30 +2,36 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useCallback,
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
createIntent,
|
|
9
|
+
LayoutAction,
|
|
10
|
+
useCapability,
|
|
11
|
+
useCapabilities,
|
|
12
|
+
useIntentDispatcher,
|
|
13
|
+
Capabilities,
|
|
14
|
+
} from '@dxos/app-framework';
|
|
15
|
+
import { Filter, getTypename, isInstanceOf, Query, RelationSourceId } from '@dxos/echo-schema';
|
|
16
|
+
import { fullyQualifiedId, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
11
17
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
18
|
import { useTranslation } from '@dxos/react-ui';
|
|
13
19
|
import { useAttended } from '@dxos/react-ui-attention';
|
|
14
20
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
15
21
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
16
|
-
import {
|
|
22
|
+
import { AnchoredTo } from '@dxos/schema';
|
|
17
23
|
|
|
18
|
-
import { ThreadCapabilities
|
|
24
|
+
import { ThreadCapabilities } from '../capabilities';
|
|
19
25
|
import { CommentsContainer } from '../components';
|
|
20
26
|
import { THREAD_PLUGIN } from '../meta';
|
|
21
|
-
import { ThreadAction } from '../types';
|
|
27
|
+
import { ThreadAction, ThreadType } from '../types';
|
|
22
28
|
|
|
23
29
|
export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
24
30
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
25
31
|
const identity = useIdentity();
|
|
26
32
|
const { t } = useTranslation(THREAD_PLUGIN);
|
|
27
33
|
|
|
28
|
-
const { state, getViewState } = useCapability(
|
|
34
|
+
const { state, getViewState } = useCapability(ThreadCapabilities.MutableState);
|
|
29
35
|
const viewState = getViewState(fullyQualifiedId(subject));
|
|
30
36
|
const { showResolvedThreads } = viewState;
|
|
31
37
|
const onChangeViewState = useCallback(
|
|
@@ -36,36 +42,24 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
36
42
|
);
|
|
37
43
|
const drafts = state.drafts[fullyQualifiedId(subject)];
|
|
38
44
|
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
() => threadsIntegrators.find((p) => p.predicate(subject))?.createSort,
|
|
42
|
-
[threadsIntegrators, subject],
|
|
43
|
-
);
|
|
44
|
-
const sort = useMemo(() => createSort?.(subject), [createSort, subject]);
|
|
45
|
-
|
|
46
|
-
const threadObjects = RefArray.targets(subject.threads ?? []);
|
|
45
|
+
const anchorSorts = useCapabilities(Capabilities.AnchorSort);
|
|
46
|
+
const sort = useMemo(() => anchorSorts.find(({ key }) => key === getTypename(subject))?.sort, [anchorSorts, subject]);
|
|
47
47
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [threads]);
|
|
55
|
-
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (!sort) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
threads.sort((a, b) => sort(a?.anchor, b?.anchor));
|
|
61
|
-
}, [sort, threads]);
|
|
48
|
+
const space = getSpace(subject);
|
|
49
|
+
const objectsAnchoredTo = useQuery(space, Query.select(Filter.ids(subject.id)).targetOf(AnchoredTo));
|
|
50
|
+
const anchors = objectsAnchoredTo
|
|
51
|
+
.toSorted((a, b) => sort?.(a, b) ?? 0)
|
|
52
|
+
.filter((anchor) => isInstanceOf(ThreadType, anchor[RelationSourceId]))
|
|
53
|
+
.concat(drafts ?? []);
|
|
62
54
|
|
|
63
55
|
const attended = useAttended();
|
|
64
56
|
const qualifiedSubjectId = fullyQualifiedId(subject);
|
|
65
57
|
|
|
66
58
|
const handleAttend = useCallback(
|
|
67
|
-
(
|
|
59
|
+
(anchor: AnchoredTo) => {
|
|
60
|
+
const thread = anchor[RelationSourceId] as ThreadType;
|
|
68
61
|
const threadId = fullyQualifiedId(thread);
|
|
62
|
+
|
|
69
63
|
if (state.current !== threadId) {
|
|
70
64
|
state.current = threadId;
|
|
71
65
|
|
|
@@ -77,7 +71,7 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
77
71
|
part: 'current',
|
|
78
72
|
subject: fullyQualifiedId(subject),
|
|
79
73
|
options: {
|
|
80
|
-
cursor:
|
|
74
|
+
cursor: anchor.anchor,
|
|
81
75
|
ref: threadId,
|
|
82
76
|
},
|
|
83
77
|
}),
|
|
@@ -88,36 +82,37 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
88
82
|
);
|
|
89
83
|
|
|
90
84
|
const handleComment = useCallback(
|
|
91
|
-
async (
|
|
85
|
+
async (anchor: AnchoredTo, text: string) => {
|
|
92
86
|
await dispatch(
|
|
93
|
-
createIntent(ThreadAction.AddMessage, {
|
|
87
|
+
createIntent(ThreadAction.AddMessage, { anchor, subject, sender: { identityDid: identity?.did }, text }),
|
|
94
88
|
);
|
|
95
89
|
|
|
90
|
+
const thread = anchor[RelationSourceId] as ThreadType;
|
|
96
91
|
state.current = fullyQualifiedId(thread);
|
|
97
92
|
},
|
|
98
93
|
[dispatch, identity, subject],
|
|
99
94
|
);
|
|
100
95
|
|
|
101
96
|
const handleResolve = useCallback(
|
|
102
|
-
(
|
|
97
|
+
(anchor: AnchoredTo) =>
|
|
98
|
+
dispatch(createIntent(ThreadAction.ToggleResolved, { thread: anchor[RelationSourceId] as ThreadType })),
|
|
103
99
|
[dispatch],
|
|
104
100
|
);
|
|
105
101
|
|
|
106
102
|
const handleThreadDelete = useCallback(
|
|
107
|
-
(
|
|
103
|
+
(anchor: AnchoredTo) => dispatch(createIntent(ThreadAction.Delete, { anchor, subject })),
|
|
108
104
|
[dispatch, subject],
|
|
109
105
|
);
|
|
110
106
|
|
|
111
107
|
const handleMessageDelete = useCallback(
|
|
112
|
-
(
|
|
113
|
-
dispatch(createIntent(ThreadAction.DeleteMessage, {
|
|
108
|
+
(anchor: AnchoredTo, messageId: string) =>
|
|
109
|
+
dispatch(createIntent(ThreadAction.DeleteMessage, { anchor, subject, messageId })),
|
|
114
110
|
[dispatch, subject],
|
|
115
111
|
);
|
|
116
112
|
|
|
117
113
|
const comments = (
|
|
118
114
|
<CommentsContainer
|
|
119
|
-
|
|
120
|
-
detached={detachedIds}
|
|
115
|
+
anchors={anchors}
|
|
121
116
|
currentId={attended.includes(qualifiedSubjectId) ? state.current : undefined}
|
|
122
117
|
showResolvedThreads={showResolvedThreads}
|
|
123
118
|
onAttend={handleAttend}
|
package/src/components/index.ts
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
+
export const ChannelContainer = lazy(() => import('./ChannelContainer'));
|
|
7
8
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
8
9
|
|
|
9
10
|
// TODO(wittjosiah): Suspense boundary for sidebar?
|
|
11
|
+
export * from './Call';
|
|
12
|
+
export * from './CallDebugPanel';
|
|
13
|
+
export * from './CallSidebar';
|
|
10
14
|
export * from './CommentContainer';
|
|
11
15
|
export * from './CommentsContainer';
|
|
12
16
|
export * from './MessageContainer';
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import { IdentityDid } from '@dxos/keys';
|
|
6
6
|
import { live, makeRef } from '@dxos/live-object';
|
|
7
|
-
import { ThreadType } from '@dxos/plugin-space/types';
|
|
8
7
|
import { faker } from '@dxos/random';
|
|
9
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
10
|
-
import {
|
|
9
|
+
import { DataType } from '@dxos/schema';
|
|
10
|
+
|
|
11
|
+
import { ThreadType } from '../types';
|
|
11
12
|
|
|
12
13
|
export const createCommentThread = (identity: Identity) => {
|
|
13
14
|
return live(ThreadType, {
|
|
14
15
|
messages: faker.helpers.multiple(
|
|
15
16
|
() =>
|
|
16
17
|
makeRef(
|
|
17
|
-
live(
|
|
18
|
+
live(DataType.Message, {
|
|
18
19
|
sender: {
|
|
19
20
|
identityDid: faker.datatype.boolean() ? identity.did : IdentityDid.random(),
|
|
20
21
|
},
|
|
@@ -7,14 +7,13 @@ import { EditorView } from '@codemirror/view';
|
|
|
7
7
|
import { computed, effect } from '@preact/signals-core';
|
|
8
8
|
|
|
9
9
|
import { createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
10
|
-
import {
|
|
11
|
-
import { RefArray } from '@dxos/live-object';
|
|
10
|
+
import { Filter, isInstanceOf, Query, RelationSourceId } from '@dxos/echo-schema';
|
|
12
11
|
import { type DocumentType } from '@dxos/plugin-markdown/types';
|
|
13
|
-
import {
|
|
14
|
-
import { getSpace, getTextInRange, createDocAccessor, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
12
|
+
import { getSpace, getTextInRange, createDocAccessor, fullyQualifiedId, getSource } from '@dxos/react-client/echo';
|
|
15
13
|
import { comments, createExternalCommentSync } from '@dxos/react-ui-editor';
|
|
14
|
+
import { AnchoredTo } from '@dxos/schema';
|
|
16
15
|
|
|
17
|
-
import { ThreadAction, type ThreadState } from '../types';
|
|
16
|
+
import { ThreadAction, ThreadType, type ThreadState } from '../types';
|
|
18
17
|
|
|
19
18
|
// TODO(burdon): Factor out.
|
|
20
19
|
const getName = (doc: DocumentType, anchor: string): string | undefined => {
|
|
@@ -35,21 +34,33 @@ export const threads = (state: ThreadState, doc?: DocumentType, dispatch?: Promi
|
|
|
35
34
|
return [comments()];
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const query = space.db.query(Query.select(Filter.ids(doc.id)).targetOf(AnchoredTo));
|
|
38
|
+
const unsubscribe = query.subscribe();
|
|
39
|
+
|
|
40
|
+
const anchors = computed(() =>
|
|
41
|
+
query.objects
|
|
42
|
+
.filter((anchor) => {
|
|
43
|
+
const thread = anchor[RelationSourceId];
|
|
44
|
+
return isInstanceOf(ThreadType, thread) && thread.status !== 'resolved';
|
|
45
|
+
})
|
|
46
|
+
.concat(state.drafts[fullyQualifiedId(doc)] ?? []),
|
|
43
47
|
);
|
|
44
48
|
|
|
45
49
|
return [
|
|
50
|
+
EditorView.domEventHandlers({
|
|
51
|
+
destroy: () => {
|
|
52
|
+
unsubscribe();
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
|
|
46
56
|
EditorView.updateListener.of((update) => {
|
|
47
57
|
if (update.docChanged) {
|
|
48
|
-
|
|
49
|
-
if (
|
|
58
|
+
anchors.value.forEach((anchor) => {
|
|
59
|
+
if (anchor.anchor) {
|
|
50
60
|
// Only update if the name has changed, otherwise this will cause an infinite loop.
|
|
51
61
|
// Skip if the name is empty; this means comment text was deleted, but thread name should remain.
|
|
52
|
-
const name = getName(doc,
|
|
62
|
+
const name = getName(doc, anchor.anchor);
|
|
63
|
+
const thread = anchor[RelationSourceId] as ThreadType;
|
|
53
64
|
if (name && name !== thread.name) {
|
|
54
65
|
thread.name = name;
|
|
55
66
|
}
|
|
@@ -62,16 +73,16 @@ export const threads = (state: ThreadState, doc?: DocumentType, dispatch?: Promi
|
|
|
62
73
|
fullyQualifiedId(doc),
|
|
63
74
|
(sink) => effect(() => sink()),
|
|
64
75
|
() =>
|
|
65
|
-
|
|
66
|
-
.filter((
|
|
67
|
-
.map((
|
|
76
|
+
anchors.value
|
|
77
|
+
.filter((anchor) => anchor.anchor)
|
|
78
|
+
.map((anchor) => ({ id: fullyQualifiedId(anchor[RelationSourceId]), cursor: anchor.anchor })),
|
|
68
79
|
),
|
|
69
80
|
|
|
70
81
|
comments({
|
|
71
82
|
id: fullyQualifiedId(doc),
|
|
72
83
|
onCreate: ({ cursor }) => {
|
|
73
84
|
const name = getName(doc, cursor);
|
|
74
|
-
void dispatch(createIntent(ThreadAction.Create, { cursor, name, subject: doc }));
|
|
85
|
+
void dispatch(createIntent(ThreadAction.Create, { anchor: cursor, name, subject: doc }));
|
|
75
86
|
},
|
|
76
87
|
onDelete: ({ id }) => {
|
|
77
88
|
const draft = state.drafts[fullyQualifiedId(doc)];
|
|
@@ -82,19 +93,26 @@ export const threads = (state: ThreadState, doc?: DocumentType, dispatch?: Promi
|
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
95
|
|
|
85
|
-
const thread =
|
|
96
|
+
const thread = query.objects.find((object) => getSource(object).id === id);
|
|
86
97
|
if (thread) {
|
|
87
98
|
thread.anchor = undefined;
|
|
88
99
|
}
|
|
89
100
|
},
|
|
90
101
|
onUpdate: ({ id, cursor }) => {
|
|
91
|
-
const thread
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
const draft = state.drafts[fullyQualifiedId(doc)]?.find((thread) => fullyQualifiedId(thread) === id);
|
|
103
|
+
if (draft) {
|
|
104
|
+
const thread = draft[RelationSourceId] as ThreadType;
|
|
105
|
+
thread.name = getName(doc, cursor);
|
|
106
|
+
draft.anchor = cursor;
|
|
107
|
+
}
|
|
94
108
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
thread
|
|
109
|
+
const relation = query.objects.find((object) => getSource(object).id === id);
|
|
110
|
+
if (relation) {
|
|
111
|
+
const thread = getSource(relation);
|
|
112
|
+
if (isInstanceOf(ThreadType, thread)) {
|
|
113
|
+
thread.name = getName(doc, cursor);
|
|
114
|
+
relation.anchor = cursor;
|
|
115
|
+
}
|
|
98
116
|
}
|
|
99
117
|
},
|
|
100
118
|
onSelect: ({ selection }) => {
|
package/src/hooks/analytics.ts
CHANGED
|
@@ -9,9 +9,13 @@ import { type Live } from '@dxos/live-object';
|
|
|
9
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { getSpace } from '@dxos/react-client/echo';
|
|
11
11
|
import { useOnTransition } from '@dxos/react-ui';
|
|
12
|
-
import { type
|
|
12
|
+
import { type DataType } from '@dxos/schema';
|
|
13
13
|
|
|
14
|
-
export const useOnEditAnalytics = (
|
|
14
|
+
export const useOnEditAnalytics = (
|
|
15
|
+
message: Live<any>,
|
|
16
|
+
textBlock: DataType.MessageBlock.Text | undefined,
|
|
17
|
+
editing: boolean,
|
|
18
|
+
) => {
|
|
15
19
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
16
20
|
|
|
17
21
|
const onEdit = useCallback(() => {
|
package/src/hooks/index.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useState, useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
// TODO(burdon): Standardize across plugins/composer.
|
|
8
|
+
export const useDebugMode = () => {
|
|
9
|
+
const [enabled, setEnabled] = useState(false);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const handler = (ev: KeyboardEvent) => {
|
|
12
|
+
if (ev.key.toLowerCase() === 'd' && ev.ctrlKey) {
|
|
13
|
+
ev.preventDefault();
|
|
14
|
+
setEnabled(!enabled);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
document.addEventListener('keypress', handler);
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener('keypress', handler);
|
|
21
|
+
};
|
|
22
|
+
}, [enabled]);
|
|
23
|
+
|
|
24
|
+
return enabled;
|
|
25
|
+
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -7,10 +7,11 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
7
7
|
export const THREAD_PLUGIN = 'dxos.org/plugin/thread';
|
|
8
8
|
export const THREAD_ITEM = `${THREAD_PLUGIN}/item`;
|
|
9
9
|
|
|
10
|
+
// TODO(wittjosiah): Needs screenshots.
|
|
10
11
|
export const meta: PluginMeta = {
|
|
11
12
|
id: THREAD_PLUGIN,
|
|
12
|
-
name: '
|
|
13
|
-
description: '
|
|
14
|
-
icon: 'ph--
|
|
13
|
+
name: 'Chat',
|
|
14
|
+
description: 'Chat via text, voice, and video in channels or create comment threads on objects.',
|
|
15
|
+
icon: 'ph--video-conference--regular',
|
|
15
16
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
|
|
16
17
|
};
|