@dxos/plugin-thread 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea
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-SVV4ZX5T.mjs +16 -0
- package/dist/lib/browser/ChatContainer-ALFWQ65B.mjs +15 -0
- package/dist/lib/browser/{app-graph-builder-FHAOPO57.mjs → app-graph-builder-ACBXRBOS.mjs} +20 -20
- package/dist/lib/browser/app-graph-builder-ACBXRBOS.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-EW2QC6Q4.mjs → call-manager-P3MYR2JS.mjs} +7 -7
- package/dist/lib/browser/{call-manager-EW2QC6Q4.mjs.map → call-manager-P3MYR2JS.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-H63NDV62.mjs → chunk-6CUDBEYP.mjs} +12 -11
- package/dist/lib/browser/chunk-6CUDBEYP.mjs.map +7 -0
- package/dist/lib/browser/chunk-BBTXGRIR.mjs +18 -0
- package/dist/lib/browser/chunk-BBTXGRIR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GERVMFQW.mjs → chunk-CP7E2HRE.mjs} +2 -2
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TQJYDFBU.mjs → chunk-DJOUMWEL.mjs} +20 -18
- package/dist/lib/browser/chunk-DJOUMWEL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2P3GVRHP.mjs → chunk-HDEQRBOC.mjs} +2 -2
- package/dist/lib/browser/{chunk-2P3GVRHP.mjs.map → chunk-HDEQRBOC.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-J26C57ZY.mjs → chunk-IQSXEHOW.mjs} +139 -69
- package/dist/lib/browser/chunk-IQSXEHOW.mjs.map +7 -0
- package/dist/lib/browser/chunk-K2DUJRFJ.mjs +27 -0
- package/dist/lib/browser/chunk-K2DUJRFJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-L6F2AG6W.mjs +23 -0
- package/dist/lib/browser/{chunk-TUSBPMNU.mjs → chunk-US5ZQYC3.mjs} +267 -367
- package/dist/lib/browser/chunk-US5ZQYC3.mjs.map +7 -0
- package/dist/lib/browser/chunk-UTSLSZED.mjs +178 -0
- package/dist/lib/browser/chunk-UTSLSZED.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KEXJGF2R.mjs → chunk-XYUJXHYV.mjs} +53 -3
- package/dist/lib/browser/chunk-XYUJXHYV.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -22
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-IB5GYU2D.mjs → intent-resolver-5POQTZ24.mjs} +25 -34
- package/dist/lib/browser/intent-resolver-5POQTZ24.mjs.map +7 -0
- package/dist/lib/browser/{markdown-Z677YORA.mjs → markdown-L7LDNF56.mjs} +9 -9
- package/dist/lib/browser/markdown-L7LDNF56.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-RCJLK4EP.mjs +28 -0
- package/dist/lib/browser/react-root-RCJLK4EP.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-X2VB6P37.mjs → react-surface-IC576W2W.mjs} +27 -27
- package/dist/lib/browser/react-surface-IC576W2W.mjs.map +7 -0
- package/dist/lib/browser/{settings-GRKEID73.mjs → settings-5FYGBOGI.mjs} +5 -5
- package/dist/lib/browser/{settings-GRKEID73.mjs.map → settings-5FYGBOGI.mjs.map} +1 -1
- package/dist/lib/browser/{state-2T4KDWBX.mjs → state-36REWXO5.mjs} +5 -5
- package/dist/lib/browser/{state-2T4KDWBX.mjs.map → state-36REWXO5.mjs.map} +1 -1
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs +74 -0
- package/dist/lib/browser/toolkit-PXASLYEQ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -9
- package/dist/lib/node-esm/ChannelContainer-63GMQ753.mjs +17 -0
- package/dist/lib/node-esm/{ChatContainer-4EGHKHIU.mjs → ChatContainer-MFKPXMIK.mjs} +6 -6
- package/dist/lib/node-esm/{app-graph-builder-XEYWX5FC.mjs → app-graph-builder-JXD7KY3G.mjs} +20 -20
- package/dist/lib/node-esm/app-graph-builder-JXD7KY3G.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-N3KASRDQ.mjs → call-manager-FCEFP7EJ.mjs} +7 -7
- package/dist/lib/node-esm/{call-manager-N3KASRDQ.mjs.map → call-manager-FCEFP7EJ.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-CTZ75IFK.mjs → chunk-2MMJF7DW.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-CTZ75IFK.mjs.map → chunk-2MMJF7DW.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-S3D7DTBF.mjs → chunk-2V3WSLUZ.mjs} +53 -3
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AFDO2SUZ.mjs +25 -0
- package/dist/lib/node-esm/{chunk-JR7KESLL.mjs → chunk-KGYDYYKJ.mjs} +267 -367
- package/dist/lib/node-esm/chunk-KGYDYYKJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UHZQTPXU.mjs → chunk-NWUUMKVQ.mjs} +12 -11
- package/dist/lib/node-esm/chunk-NWUUMKVQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NNKKNW57.mjs → chunk-Q7AKKZNY.mjs} +139 -69
- package/dist/lib/node-esm/chunk-Q7AKKZNY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CCE5LHBE.mjs → chunk-QCQAAU6J.mjs} +20 -18
- package/dist/lib/node-esm/chunk-QCQAAU6J.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs +179 -0
- package/dist/lib/node-esm/chunk-TYLLHI46.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs +28 -0
- package/dist/lib/node-esm/chunk-XI45H4IV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs +19 -0
- package/dist/lib/node-esm/chunk-ZQAGII7M.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -22
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-VIMI5VLH.mjs → intent-resolver-63NV3XD2.mjs} +25 -34
- package/dist/lib/node-esm/intent-resolver-63NV3XD2.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-FL4IXLRP.mjs → markdown-ZQW7MI5U.mjs} +9 -9
- package/dist/lib/node-esm/markdown-ZQW7MI5U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs +29 -0
- package/dist/lib/node-esm/react-root-4IDB2SN2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-OLN3XNND.mjs → react-surface-O4LGTAZ3.mjs} +27 -27
- package/dist/lib/node-esm/react-surface-O4LGTAZ3.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-F2ODVNNW.mjs → settings-EOBQUZSW.mjs} +5 -5
- package/dist/lib/node-esm/{settings-F2ODVNNW.mjs.map → settings-EOBQUZSW.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-62TQKQVB.mjs → state-X3W67GTL.mjs} +5 -5
- package/dist/lib/node-esm/{state-62TQKQVB.mjs.map → state-X3W67GTL.mjs.map} +1 -1
- package/dist/lib/node-esm/toolkit-X2KA4FNC.mjs +75 -0
- package/dist/lib/node-esm/toolkit-X2KA4FNC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -9
- package/dist/types/src/ThreadPlugin.d.ts +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +2 -0
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -1
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +21 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +7 -0
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.d.ts +2 -2
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +74 -8
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +74 -6
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +6 -5
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +3 -2
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +2 -2
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +5 -3
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +4 -2
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +4 -2
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +3 -3
- 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/useVideoStreamTrack.d.ts +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +73 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +16 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/{schema.d.ts → Thread.d.ts} +18 -28
- package/dist/types/src/types/Thread.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +37 -50
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -59
- package/src/ThreadPlugin.tsx +133 -130
- package/src/calls/call-manager.ts +1 -1
- package/src/calls/media-manager.ts +2 -1
- package/src/calls/types.ts +7 -3
- package/src/calls/util/calls-service.ts +12 -7
- package/src/calls/util/stub-media-streams.ts +60 -2
- package/src/calls-service.stories.tsx +2 -5
- package/src/capabilities/app-graph-builder.ts +17 -14
- package/src/capabilities/capabilities.ts +7 -7
- package/src/capabilities/intent-resolver.ts +14 -19
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +15 -15
- package/src/capabilities/toolkit.ts +18 -11
- package/src/components/Call/Toolbar.tsx +6 -6
- package/src/components/CallDebugPanel.tsx +108 -49
- package/src/components/ChannelContainer.stories.tsx +9 -9
- package/src/components/ChannelContainer.tsx +14 -11
- package/src/components/Chat.stories.tsx +13 -18
- package/src/components/ChatContainer.tsx +26 -17
- package/src/components/Comments.stories.tsx +8 -13
- package/src/components/CommentsContainer.tsx +2 -2
- package/src/components/CommentsThreadContainer.tsx +19 -14
- package/src/components/Media/VideoObject.stories.tsx +12 -7
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +3 -4
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +3 -4
- package/src/components/ThreadComplementary.tsx +7 -7
- package/src/components/ThreadSettings.tsx +4 -5
- package/src/components/testing.ts +5 -5
- package/src/extensions/threads.ts +5 -5
- package/src/hooks/useVideoStreamTrack.tsx +1 -1
- package/src/meta.ts +9 -5
- package/src/testing/stories.ts +3 -6
- package/src/translations.ts +5 -3
- package/src/types/Channel.ts +27 -0
- package/src/types/Thread.ts +26 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +10 -9
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-GHDNEZT2.mjs +0 -16
- package/dist/lib/browser/ChatContainer-42ALOWUA.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-FHAOPO57.mjs.map +0 -7
- package/dist/lib/browser/chunk-2I277V52.mjs +0 -23
- package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
- package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-H63NDV62.mjs.map +0 -7
- package/dist/lib/browser/chunk-J26C57ZY.mjs.map +0 -7
- package/dist/lib/browser/chunk-KEXJGF2R.mjs.map +0 -7
- package/dist/lib/browser/chunk-KTWYVC5X.mjs +0 -147
- package/dist/lib/browser/chunk-KTWYVC5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-TQJYDFBU.mjs.map +0 -7
- package/dist/lib/browser/chunk-TUSBPMNU.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-IB5GYU2D.mjs.map +0 -7
- package/dist/lib/browser/markdown-Z677YORA.mjs.map +0 -7
- package/dist/lib/browser/react-root-PTTTW2MO.mjs +0 -28
- package/dist/lib/browser/react-root-PTTTW2MO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-X2VB6P37.mjs.map +0 -7
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs +0 -80
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-D5E2S6AI.mjs +0 -17
- package/dist/lib/node-esm/app-graph-builder-XEYWX5FC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CCE5LHBE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JR7KESLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NNKKNW57.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P6E247RF.mjs +0 -148
- package/dist/lib/node-esm/chunk-P6E247RF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S3D7DTBF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UHZQTPXU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UJ2QNRLS.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-VIMI5VLH.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-FL4IXLRP.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-2HHRRUME.mjs +0 -29
- package/dist/lib/node-esm/react-root-2HHRRUME.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-OLN3XNND.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs +0 -81
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs.map +0 -7
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-GHDNEZT2.mjs.map → ChannelContainer-SVV4ZX5T.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-42ALOWUA.mjs.map → ChatContainer-ALFWQ65B.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-2I277V52.mjs.map → chunk-L6F2AG6W.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-D5E2S6AI.mjs.map → ChannelContainer-63GMQ753.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-4EGHKHIU.mjs.map → ChatContainer-MFKPXMIK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-UJ2QNRLS.mjs.map → chunk-AFDO2SUZ.mjs.map} +0 -0
|
@@ -10,13 +10,18 @@ import { useIdentity } from '@dxos/react-client/halo';
|
|
|
10
10
|
import { IconButton, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
12
12
|
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
MessageTextbox,
|
|
15
|
+
type MessageTextboxProps,
|
|
16
|
+
Thread as ThreadComponent,
|
|
17
|
+
type ThreadRootProps,
|
|
18
|
+
} from '@dxos/react-ui-thread';
|
|
14
19
|
import { type AnchoredTo } from '@dxos/schema';
|
|
15
20
|
import { isNonNullable } from '@dxos/util';
|
|
16
21
|
|
|
17
22
|
import { useStatus } from '../hooks';
|
|
18
23
|
import { meta } from '../meta';
|
|
19
|
-
import { type
|
|
24
|
+
import { type Thread } from '../types';
|
|
20
25
|
import { getMessageMetadata } from '../util';
|
|
21
26
|
|
|
22
27
|
import { command } from './command-extension';
|
|
@@ -42,29 +47,29 @@ export const CommentsThreadContainer = ({
|
|
|
42
47
|
onThreadDelete,
|
|
43
48
|
onAcceptProposal,
|
|
44
49
|
}: CommentsThreadContainerProps) => {
|
|
50
|
+
const { themeMode } = useThemeContext();
|
|
45
51
|
const { t } = useTranslation(meta.id);
|
|
46
52
|
const identity = useIdentity()!;
|
|
47
53
|
const space = getSpace(anchor);
|
|
48
54
|
const members = useMembers(space?.key);
|
|
49
55
|
const detached = !anchor.anchor;
|
|
50
|
-
const thread = Relation.getSource(anchor) as
|
|
56
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
51
57
|
const activity = useStatus(space, fullyQualifiedId(thread));
|
|
52
58
|
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
53
|
-
const { themeMode } = useThemeContext();
|
|
54
59
|
|
|
55
60
|
const textboxMetadata = getMessageMetadata(fullyQualifiedId(thread), identity);
|
|
61
|
+
|
|
56
62
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
57
|
-
const [
|
|
58
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
63
|
+
const [state, setState] = useState({});
|
|
59
64
|
const messageRef = useRef('');
|
|
60
65
|
const extensions = useMemo(
|
|
61
66
|
() => [
|
|
62
67
|
createBasicExtensions({ placeholder: t('message placeholder') }),
|
|
63
68
|
createThemeExtensions({ themeMode }),
|
|
64
|
-
listener({ onChange: (text) => (messageRef.current = text) }),
|
|
69
|
+
listener({ onChange: ({ text }) => (messageRef.current = text) }),
|
|
65
70
|
command,
|
|
66
71
|
],
|
|
67
|
-
[
|
|
72
|
+
[state],
|
|
68
73
|
);
|
|
69
74
|
|
|
70
75
|
// TODO(thure): Factor out.
|
|
@@ -85,13 +90,13 @@ export const CommentsThreadContainer = ({
|
|
|
85
90
|
onComment?.(anchor, messageRef.current);
|
|
86
91
|
messageRef.current = '';
|
|
87
92
|
scrollToEnd('instant');
|
|
88
|
-
|
|
93
|
+
setState({});
|
|
89
94
|
|
|
90
95
|
return true;
|
|
91
96
|
}, [anchor, identity]);
|
|
92
97
|
|
|
93
98
|
return (
|
|
94
|
-
<
|
|
99
|
+
<ThreadComponent.Root
|
|
95
100
|
id={fullyQualifiedId(thread)}
|
|
96
101
|
classNames='pbs-2 border-be border-subduedSeparator last:border-none'
|
|
97
102
|
current={current}
|
|
@@ -108,10 +113,10 @@ export const CommentsThreadContainer = ({
|
|
|
108
113
|
>
|
|
109
114
|
{detached ? (
|
|
110
115
|
<Tooltip.Trigger asChild content={t('detached thread label')} side='top'>
|
|
111
|
-
<
|
|
116
|
+
<ThreadComponent.Header detached>{thread.name}</ThreadComponent.Header>
|
|
112
117
|
</Tooltip.Trigger>
|
|
113
118
|
) : (
|
|
114
|
-
<
|
|
119
|
+
<ThreadComponent.Header>{thread.name}</ThreadComponent.Header>
|
|
115
120
|
)}
|
|
116
121
|
<div role='none' className={buttonGroupClassNames}>
|
|
117
122
|
{thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}
|
|
@@ -160,10 +165,10 @@ export const CommentsThreadContainer = ({
|
|
|
160
165
|
*/}
|
|
161
166
|
<MessageTextbox extensions={extensions} onSend={handleComment} {...textboxMetadata} />
|
|
162
167
|
|
|
163
|
-
<
|
|
168
|
+
<ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>
|
|
164
169
|
|
|
165
170
|
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
166
171
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
167
|
-
</
|
|
172
|
+
</ThreadComponent.Root>
|
|
168
173
|
);
|
|
169
174
|
};
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { scheduleTask } from '@dxos/async';
|
|
11
9
|
import { Context } from '@dxos/context';
|
|
12
10
|
import { log } from '@dxos/log';
|
|
13
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
|
|
15
13
|
import { getUserMediaTrack } from '../../calls';
|
|
16
14
|
import { ResponsiveContainer } from '../ResponsiveGrid';
|
|
@@ -23,9 +21,13 @@ const DefaultStory = (props: VideoObjectProps) => {
|
|
|
23
21
|
useEffect(() => {
|
|
24
22
|
const ctx = new Context();
|
|
25
23
|
scheduleTask(ctx, async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
try {
|
|
25
|
+
const stream = new MediaStream();
|
|
26
|
+
stream.addTrack(await getUserMediaTrack('videoinput'));
|
|
27
|
+
setVideoStream(stream);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
log.catch(err);
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
return () => {
|
|
@@ -45,7 +47,10 @@ const meta = {
|
|
|
45
47
|
title: 'plugins/plugin-thread/VideoObject',
|
|
46
48
|
component: VideoObject,
|
|
47
49
|
render: DefaultStory,
|
|
48
|
-
decorators: [withTheme
|
|
50
|
+
decorators: [withTheme],
|
|
51
|
+
parameters: {
|
|
52
|
+
layout: 'fullscreen',
|
|
53
|
+
},
|
|
49
54
|
};
|
|
50
55
|
|
|
51
56
|
export default meta;
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { translations } from '../../translations';
|
|
13
11
|
import { VideoObject as VideoObjectComponent } from '../Media';
|
|
@@ -17,8 +15,9 @@ import { ResponsiveContainer } from './ResponsiveContainer';
|
|
|
17
15
|
const meta = {
|
|
18
16
|
title: 'plugins/plugin-thread/ResponsiveContainer',
|
|
19
17
|
component: ResponsiveContainer,
|
|
20
|
-
decorators: [withTheme
|
|
18
|
+
decorators: [withTheme],
|
|
21
19
|
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
22
21
|
translations,
|
|
23
22
|
},
|
|
24
23
|
} satisfies Meta<typeof ResponsiveContainer>;
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { faker } from '@dxos/random';
|
|
11
|
-
import {
|
|
9
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
10
|
|
|
13
11
|
import { translations } from '../../translations';
|
|
14
12
|
|
|
@@ -94,8 +92,9 @@ const meta = {
|
|
|
94
92
|
title: 'plugins/plugin-thread/ResponsiveGrid',
|
|
95
93
|
component: ResponsiveGrid as any,
|
|
96
94
|
render: DefaultStory,
|
|
97
|
-
decorators: [withTheme
|
|
95
|
+
decorators: [withTheme],
|
|
98
96
|
parameters: {
|
|
97
|
+
layout: 'fullscreen',
|
|
99
98
|
translations,
|
|
100
99
|
},
|
|
101
100
|
} satisfies Meta<typeof DefaultStory>;
|
|
@@ -26,7 +26,7 @@ import { AnchoredTo } from '@dxos/schema';
|
|
|
26
26
|
import { ThreadCapabilities } from '../capabilities';
|
|
27
27
|
import { CommentsContainer, type CommentsContainerProps } from '../components';
|
|
28
28
|
import { meta } from '../meta';
|
|
29
|
-
import {
|
|
29
|
+
import { Thread, ThreadAction } from '../types';
|
|
30
30
|
|
|
31
31
|
export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
32
32
|
const { t } = useTranslation(meta.id);
|
|
@@ -56,14 +56,14 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
56
56
|
const objectsAnchoredTo = useQuery(space, Query.select(Filter.ids(subject.id)).targetOf(AnchoredTo));
|
|
57
57
|
const anchors = objectsAnchoredTo
|
|
58
58
|
.toSorted((a, b) => sort?.(a, b) ?? 0)
|
|
59
|
-
.filter((anchor) => Obj.instanceOf(
|
|
59
|
+
.filter((anchor) => Obj.instanceOf(Thread.Thread, Relation.getSource(anchor)))
|
|
60
60
|
.concat(drafts ?? []);
|
|
61
61
|
|
|
62
62
|
const attended = useAttended();
|
|
63
63
|
|
|
64
64
|
const handleAttend = useCallback(
|
|
65
65
|
(anchor: AnchoredTo) => {
|
|
66
|
-
const thread = Relation.getSource(anchor) as
|
|
66
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
67
67
|
const threadId = fullyQualifiedId(thread);
|
|
68
68
|
|
|
69
69
|
if (state.current !== threadId) {
|
|
@@ -93,7 +93,7 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
93
93
|
createIntent(ThreadAction.AddMessage, { anchor, subject, sender: { identityDid: identity?.did }, text }),
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
const thread = Relation.getSource(anchor) as
|
|
96
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
97
97
|
state.current = fullyQualifiedId(thread);
|
|
98
98
|
},
|
|
99
99
|
[dispatch, identity, subject],
|
|
@@ -101,7 +101,7 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
101
101
|
|
|
102
102
|
const handleResolve = useCallback(
|
|
103
103
|
(anchor: AnchoredTo) =>
|
|
104
|
-
dispatch(createIntent(ThreadAction.ToggleResolved, { thread: Relation.getSource(anchor) as
|
|
104
|
+
dispatch(createIntent(ThreadAction.ToggleResolved, { thread: Relation.getSource(anchor) as Thread.Thread })),
|
|
105
105
|
[dispatch],
|
|
106
106
|
);
|
|
107
107
|
|
|
@@ -118,7 +118,7 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
118
118
|
|
|
119
119
|
const handleAcceptProposal = useCallback<NonNullable<CommentsContainerProps['onAcceptProposal']>>(
|
|
120
120
|
async (anchor, messageId) => {
|
|
121
|
-
const thread = Relation.getSource(anchor) as
|
|
121
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
122
122
|
const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
|
|
123
123
|
const message = thread.messages[messageIndex]?.target;
|
|
124
124
|
const proposal = message?.blocks.find((block) => block._tag === 'proposal');
|
|
@@ -153,7 +153,7 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
153
153
|
);
|
|
154
154
|
|
|
155
155
|
return (
|
|
156
|
-
<StackItem.Content toolbar
|
|
156
|
+
<StackItem.Content toolbar>
|
|
157
157
|
<Tabs.Root
|
|
158
158
|
value={showResolvedThreads ? 'all' : 'unresolved'}
|
|
159
159
|
orientation='horizontal'
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
8
8
|
import { ControlPage } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
import type { ThreadSettingsProps } from '../types';
|
|
12
12
|
|
|
13
|
-
export const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps }) => {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const ThreadSettings = ({ settings: _settings }: { settings: ThreadSettingsProps }) => {
|
|
14
|
+
const { t: _t } = useTranslation(meta.id);
|
|
16
15
|
return <ControlPage></ControlPage>;
|
|
17
16
|
};
|
|
@@ -8,10 +8,10 @@ import { faker } from '@dxos/random';
|
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
9
|
import { DataType } from '@dxos/schema';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Thread } from '../types';
|
|
12
12
|
|
|
13
|
-
export const createCommentThread = (identity: Identity):
|
|
14
|
-
return
|
|
13
|
+
export const createCommentThread = (identity: Identity): Thread.Thread => {
|
|
14
|
+
return Thread.make({
|
|
15
15
|
name: 'Comment',
|
|
16
16
|
messages: faker.helpers.multiple(
|
|
17
17
|
() =>
|
|
@@ -30,8 +30,8 @@ export const createCommentThread = (identity: Identity): ThreadType => {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export const createProposalThread = (identity: Identity):
|
|
34
|
-
return
|
|
33
|
+
export const createProposalThread = (identity: Identity): Thread.Thread => {
|
|
34
|
+
return Thread.make({
|
|
35
35
|
name: 'Proposal',
|
|
36
36
|
messages: faker.helpers.multiple(
|
|
37
37
|
() =>
|
|
@@ -13,7 +13,7 @@ import { createDocAccessor, fullyQualifiedId, getSource, getSpace, getTextInRang
|
|
|
13
13
|
import { comments, createExternalCommentSync } from '@dxos/react-ui-editor';
|
|
14
14
|
import { AnchoredTo } from '@dxos/schema';
|
|
15
15
|
|
|
16
|
-
import { ThreadAction, type ThreadState
|
|
16
|
+
import { Thread, ThreadAction, type ThreadState } from '../types';
|
|
17
17
|
|
|
18
18
|
// TODO(burdon): Factor out.
|
|
19
19
|
const getName = (doc: Markdown.Document, anchor: string): string | undefined => {
|
|
@@ -41,7 +41,7 @@ export const threads = (state: ThreadState, doc?: Markdown.Document, dispatch?:
|
|
|
41
41
|
query.objects
|
|
42
42
|
.filter((anchor) => {
|
|
43
43
|
const thread = Relation.getSource(anchor);
|
|
44
|
-
return Obj.instanceOf(
|
|
44
|
+
return Obj.instanceOf(Thread.Thread, thread) && thread.status !== 'resolved';
|
|
45
45
|
})
|
|
46
46
|
.concat(state.drafts[fullyQualifiedId(doc)] ?? []),
|
|
47
47
|
);
|
|
@@ -60,7 +60,7 @@ export const threads = (state: ThreadState, doc?: Markdown.Document, dispatch?:
|
|
|
60
60
|
// Only update if the name has changed, otherwise this will cause an infinite loop.
|
|
61
61
|
// Skip if the name is empty; this means comment text was deleted, but thread name should remain.
|
|
62
62
|
const name = getName(doc, anchor.anchor);
|
|
63
|
-
const thread = Relation.getSource(anchor) as
|
|
63
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
64
64
|
if (name && name !== thread.name) {
|
|
65
65
|
thread.name = name;
|
|
66
66
|
}
|
|
@@ -101,7 +101,7 @@ export const threads = (state: ThreadState, doc?: Markdown.Document, dispatch?:
|
|
|
101
101
|
onUpdate: ({ id, cursor }) => {
|
|
102
102
|
const draft = state.drafts[fullyQualifiedId(doc)]?.find((thread) => fullyQualifiedId(thread) === id);
|
|
103
103
|
if (draft) {
|
|
104
|
-
const thread = Relation.getSource(draft) as
|
|
104
|
+
const thread = Relation.getSource(draft) as Thread.Thread;
|
|
105
105
|
thread.name = getName(doc, cursor);
|
|
106
106
|
draft.anchor = cursor;
|
|
107
107
|
}
|
|
@@ -109,7 +109,7 @@ export const threads = (state: ThreadState, doc?: Markdown.Document, dispatch?:
|
|
|
109
109
|
const relation = query.objects.find((object) => getSource(object).id === id);
|
|
110
110
|
if (relation) {
|
|
111
111
|
const thread = getSource(relation);
|
|
112
|
-
if (Obj.instanceOf(
|
|
112
|
+
if (Obj.instanceOf(Thread.Thread, thread)) {
|
|
113
113
|
thread.name = getName(doc, cursor);
|
|
114
114
|
relation.anchor = cursor;
|
|
115
115
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type RefObject, useEffect, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
export const useVideoStreamTrack = (videoElement: RefObject<HTMLVideoElement>, videoSrc: string) => {
|
|
7
|
+
export const useVideoStreamTrack = (videoElement: RefObject<HTMLVideoElement | null>, videoSrc: string) => {
|
|
8
8
|
// Get video stream track.
|
|
9
9
|
const [videoStreamTrack, setVideoStreamTrack] = useState<MediaStreamTrack | undefined>(undefined);
|
|
10
10
|
const hadRun = useRef(false);
|
package/src/meta.ts
CHANGED
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const THREAD_PLUGIN = 'dxos.org/plugin/thread';
|
|
8
|
-
export const THREAD_ITEM = `${THREAD_PLUGIN}/item`;
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
9
7
|
|
|
10
8
|
// TODO(wittjosiah): Needs screenshots.
|
|
11
9
|
export const meta: PluginMeta = {
|
|
12
|
-
id:
|
|
10
|
+
id: 'dxos.org/plugin/thread',
|
|
13
11
|
name: 'Chat',
|
|
14
|
-
description:
|
|
12
|
+
description: trim`
|
|
13
|
+
Multi-modal communication platform supporting text chat, voice, and video conferencing.
|
|
14
|
+
Create threaded conversations and add contextual comments directly on any workspace object.
|
|
15
|
+
`,
|
|
15
16
|
icon: 'ph--video-conference--regular',
|
|
17
|
+
iconHue: 'rose',
|
|
16
18
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
|
|
17
19
|
};
|
|
20
|
+
|
|
21
|
+
export const THREAD_ITEM = `${meta.id}/item`;
|
package/src/testing/stories.ts
CHANGED
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
6
|
-
import { Obj } from '@dxos/echo';
|
|
7
6
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
8
7
|
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
9
8
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
10
9
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
11
10
|
import { Config } from '@dxos/react-client';
|
|
12
|
-
import { Ref } from '@dxos/react-client/echo';
|
|
13
11
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
14
12
|
|
|
15
13
|
import { ThreadPlugin } from '../ThreadPlugin';
|
|
16
|
-
import {
|
|
14
|
+
import { Channel } from '../types';
|
|
17
15
|
|
|
18
16
|
export const createThreadPlugins = async () => [
|
|
19
17
|
ThemePlugin({ tx: defaultTx }),
|
|
@@ -23,8 +21,7 @@ export const createThreadPlugins = async () => [
|
|
|
23
21
|
},
|
|
24
22
|
onSpacesReady: async ({ client }) => {
|
|
25
23
|
await client.spaces.default.waitUntilReady();
|
|
26
|
-
|
|
27
|
-
client.spaces.default.db.add(Obj.make(ChannelType, { defaultThread: Ref.make(thread), threads: [] }));
|
|
24
|
+
client.spaces.default.db.add(Channel.make());
|
|
28
25
|
},
|
|
29
26
|
config: new Config({
|
|
30
27
|
runtime: {
|
|
@@ -46,7 +43,7 @@ export const createThreadPlugins = async () => [
|
|
|
46
43
|
},
|
|
47
44
|
}),
|
|
48
45
|
}),
|
|
49
|
-
SpacePlugin(),
|
|
46
|
+
SpacePlugin({}),
|
|
50
47
|
IntentPlugin(),
|
|
51
48
|
SettingsPlugin(),
|
|
52
49
|
GraphPlugin(),
|
package/src/translations.ts
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
7
|
|
|
7
8
|
import { meta } from './meta';
|
|
8
|
-
import {
|
|
9
|
+
import { Channel } from './types';
|
|
9
10
|
|
|
10
11
|
export const translations = [
|
|
11
12
|
{
|
|
12
13
|
'en-US': {
|
|
13
|
-
[
|
|
14
|
+
[Type.getTypename(Channel.Channel)]: {
|
|
14
15
|
'typename label': 'Channel',
|
|
15
16
|
'typename label_zero': 'Channels',
|
|
16
17
|
'typename label_one': 'Channel',
|
|
@@ -61,7 +62,8 @@ export const translations = [
|
|
|
61
62
|
'call tab label': 'Call',
|
|
62
63
|
'meeting status title': 'Meeting',
|
|
63
64
|
'share meeting link label': 'Share meeting',
|
|
64
|
-
'show webrtc stats title': '
|
|
65
|
+
'show webrtc stats title': 'WebRTC Stats',
|
|
66
|
+
'show calls history title': 'Service History',
|
|
65
67
|
|
|
66
68
|
'meeting summary label': 'Summary',
|
|
67
69
|
'summarize label': 'Summarize',
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
8
|
+
import { FormAnnotation } from '@dxos/echo/internal';
|
|
9
|
+
|
|
10
|
+
import * as Thread from './Thread';
|
|
11
|
+
|
|
12
|
+
const _Channel = Schema.Struct({
|
|
13
|
+
name: Schema.optional(Schema.String),
|
|
14
|
+
defaultThread: Type.Ref(Thread.Thread).pipe(FormAnnotation.set(false)),
|
|
15
|
+
// TODO(wittjosiah): Should be an "ordered collection".
|
|
16
|
+
threads: Type.Ref(Thread.Thread).pipe(Schema.Array, Schema.mutable, FormAnnotation.set(false)),
|
|
17
|
+
}).pipe(Type.Obj({ typename: 'dxos.org/type/Channel', version: '0.1.0' }));
|
|
18
|
+
export interface Channel extends Schema.Schema.Type<typeof _Channel> {}
|
|
19
|
+
export interface ChannelEncoded extends Schema.Schema.Encoded<typeof _Channel> {}
|
|
20
|
+
export const Channel: Schema.Schema<Channel, ChannelEncoded> = _Channel;
|
|
21
|
+
|
|
22
|
+
export const make = (props: Pick<Obj.MakeProps<typeof Channel>, 'name'> = {}) =>
|
|
23
|
+
Obj.make(Channel, {
|
|
24
|
+
...props,
|
|
25
|
+
defaultThread: Ref.make(Obj.make(Thread.Thread, { messages: [], status: 'active' })),
|
|
26
|
+
threads: [],
|
|
27
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { DataType } from '@dxos/schema';
|
|
9
|
+
|
|
10
|
+
export const ThreadStatus = Schema.Union(
|
|
11
|
+
Schema.Literal('staged'),
|
|
12
|
+
Schema.Literal('active'),
|
|
13
|
+
Schema.Literal('resolved'),
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const _Thread = Schema.Struct({
|
|
17
|
+
name: Schema.String.pipe(Schema.optional),
|
|
18
|
+
status: ThreadStatus.pipe(Schema.optional),
|
|
19
|
+
messages: Schema.mutable(Schema.Array(Type.Ref(DataType.Message))),
|
|
20
|
+
}).pipe(Type.Obj({ typename: 'dxos.org/type/Thread', version: '0.1.0' }));
|
|
21
|
+
export interface Thread extends Schema.Schema.Type<typeof _Thread> {}
|
|
22
|
+
export interface ThreadEncoded extends Schema.Schema.Encoded<typeof _Thread> {}
|
|
23
|
+
export const Thread: Schema.Schema<Thread, ThreadEncoded> = _Thread;
|
|
24
|
+
|
|
25
|
+
export const make = ({ status = 'staged', messages = [], ...props }: Partial<Obj.MakeProps<typeof Thread>> = {}) =>
|
|
26
|
+
Obj.make(Thread, { status, messages, ...props });
|
package/src/types/index.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { Type } from '@dxos/echo';
|
|
8
8
|
import { EchoObjectSchema, SpaceSchema } from '@dxos/react-client/echo';
|
|
@@ -10,10 +10,11 @@ import { AnchoredTo, DataType } from '@dxos/schema';
|
|
|
10
10
|
|
|
11
11
|
import { meta } from '../meta';
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import * as Channel from './Channel';
|
|
14
|
+
import * as Thread from './Thread';
|
|
14
15
|
|
|
15
16
|
export namespace ThreadAction {
|
|
16
|
-
export class
|
|
17
|
+
export class onCreateSpace extends Schema.TaggedClass<onCreateSpace>()(`${meta.id}/action/on-space-created`, {
|
|
17
18
|
input: Schema.Struct({
|
|
18
19
|
space: SpaceSchema,
|
|
19
20
|
rootCollection: DataType.Collection,
|
|
@@ -27,7 +28,7 @@ export namespace ThreadAction {
|
|
|
27
28
|
name: Schema.optional(Schema.String),
|
|
28
29
|
}),
|
|
29
30
|
output: Schema.Struct({
|
|
30
|
-
object:
|
|
31
|
+
object: Channel.Channel,
|
|
31
32
|
}),
|
|
32
33
|
}) {}
|
|
33
34
|
|
|
@@ -35,10 +36,10 @@ export namespace ThreadAction {
|
|
|
35
36
|
`${meta.id}/action/create-channel-thread`,
|
|
36
37
|
{
|
|
37
38
|
input: Schema.Struct({
|
|
38
|
-
channel:
|
|
39
|
+
channel: Channel.Channel,
|
|
39
40
|
}),
|
|
40
41
|
output: Schema.Struct({
|
|
41
|
-
object:
|
|
42
|
+
object: Thread.Thread,
|
|
42
43
|
}),
|
|
43
44
|
},
|
|
44
45
|
) {}
|
|
@@ -56,7 +57,7 @@ export namespace ThreadAction {
|
|
|
56
57
|
input: Schema.Struct({
|
|
57
58
|
anchor: AnchoredTo,
|
|
58
59
|
subject: EchoObjectSchema,
|
|
59
|
-
thread: Schema.optional(
|
|
60
|
+
thread: Schema.optional(Thread.Thread),
|
|
60
61
|
}),
|
|
61
62
|
output: Schema.Void,
|
|
62
63
|
}) {}
|
|
@@ -70,7 +71,7 @@ export namespace ThreadAction {
|
|
|
70
71
|
|
|
71
72
|
export class ToggleResolved extends Schema.TaggedClass<ToggleResolved>()(`${meta.id}/action/toggle-resolved`, {
|
|
72
73
|
input: Schema.Struct({
|
|
73
|
-
thread:
|
|
74
|
+
thread: Thread.Thread,
|
|
74
75
|
}),
|
|
75
76
|
output: Schema.Void,
|
|
76
77
|
}) {}
|
|
@@ -111,7 +112,7 @@ export const ThreadSettingsSchema = Schema.mutable(Schema.Struct({}));
|
|
|
111
112
|
export type ThreadSettingsProps = Schema.Schema.Type<typeof ThreadSettingsSchema>;
|
|
112
113
|
|
|
113
114
|
export interface ThreadModel {
|
|
114
|
-
root:
|
|
115
|
+
root: Thread.Thread;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
type SubjectId = string;
|
|
@@ -22,7 +22,23 @@ declare module '@peermetrics/webrtc-stats' {
|
|
|
22
22
|
connectionId: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
type TrackStats = {
|
|
26
|
+
id: string;
|
|
27
|
+
kind: 'audio' | 'video';
|
|
28
|
+
codecId: string;
|
|
29
|
+
mid: string;
|
|
30
|
+
bytesSent: number;
|
|
31
|
+
bytesReceived: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type WebRTCStatsEvent = {
|
|
35
|
+
data: {
|
|
36
|
+
audio: { inbound: TrackStats[]; outbound: TrackStats[] };
|
|
37
|
+
video: { inbound: TrackStats[]; outbound: TrackStats[] };
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export class WebRTCStats extends EventEmitter<{ stats: WebRTCStatsEvent }> {
|
|
26
42
|
constructor(options: WebRTCStatsConstructorOptions);
|
|
27
43
|
addConnection(info: ConnectionInfo): void;
|
|
28
44
|
removeConnection(info: Pick<ConnectionInfo, 'pc'>): void;
|
package/src/util.ts
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChannelContainer,
|
|
3
|
-
ChannelContainer_default
|
|
4
|
-
} from "./chunk-TQJYDFBU.mjs";
|
|
5
|
-
import "./chunk-2I277V52.mjs";
|
|
6
|
-
import "./chunk-4APCDRSH.mjs";
|
|
7
|
-
import "./chunk-H63NDV62.mjs";
|
|
8
|
-
import "./chunk-2P3GVRHP.mjs";
|
|
9
|
-
import "./chunk-GERVMFQW.mjs";
|
|
10
|
-
import "./chunk-KEXJGF2R.mjs";
|
|
11
|
-
import "./chunk-EV4JWI7L.mjs";
|
|
12
|
-
export {
|
|
13
|
-
ChannelContainer,
|
|
14
|
-
ChannelContainer_default as default
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=ChannelContainer-GHDNEZT2.mjs.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer,
|
|
3
|
-
ChatContainer_default,
|
|
4
|
-
ChatHeading
|
|
5
|
-
} from "./chunk-H63NDV62.mjs";
|
|
6
|
-
import "./chunk-2P3GVRHP.mjs";
|
|
7
|
-
import "./chunk-GERVMFQW.mjs";
|
|
8
|
-
import "./chunk-KEXJGF2R.mjs";
|
|
9
|
-
import "./chunk-EV4JWI7L.mjs";
|
|
10
|
-
export {
|
|
11
|
-
ChatContainer,
|
|
12
|
-
ChatHeading,
|
|
13
|
-
ChatContainer_default as default
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=ChatContainer-42ALOWUA.mjs.map
|