@dxos/plugin-thread 0.7.5-main.499c70c → 0.7.5-main.6a330ac
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/ThreadContainer-6OP5AG2W.mjs +19 -0
- package/dist/lib/browser/ThreadContainer-6OP5AG2W.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ENERBDYI.mjs → chunk-636QDHE3.mjs} +3 -3
- package/dist/lib/browser/chunk-636QDHE3.mjs.map +7 -0
- package/dist/lib/browser/chunk-BNEWNQBO.mjs +71 -0
- package/dist/lib/browser/chunk-BNEWNQBO.mjs.map +7 -0
- package/dist/lib/browser/chunk-NAO3LZMZ.mjs +16 -0
- package/dist/lib/browser/chunk-NAO3LZMZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OD2IZKRP.mjs → chunk-UPKU23DA.mjs} +29 -105
- package/dist/lib/browser/chunk-UPKU23DA.mjs.map +7 -0
- package/dist/lib/browser/chunk-VOMIDDNO.mjs +15 -0
- package/dist/lib/browser/chunk-VOMIDDNO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6KTMQPL4.mjs → chunk-YK3ICB7G.mjs} +5 -3
- package/dist/lib/browser/chunk-YK3ICB7G.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +150 -942
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-FAFQ54NP.mjs +287 -0
- package/dist/lib/browser/intent-resolver-FAFQ54NP.mjs.map +7 -0
- package/dist/lib/browser/markdown-RPYOUBVR.mjs +112 -0
- package/dist/lib/browser/markdown-RPYOUBVR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-Y4MUSICN.mjs +433 -0
- package/dist/lib/browser/react-surface-Y4MUSICN.mjs.map +7 -0
- package/dist/lib/browser/settings-WQTE5AEZ.mjs +22 -0
- package/dist/lib/browser/settings-WQTE5AEZ.mjs.map +7 -0
- package/dist/lib/browser/state-GNFUURIC.mjs +33 -0
- package/dist/lib/browser/state-GNFUURIC.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +6 -4
- package/dist/lib/node/{ThreadArticle-ZCNMFBAO.cjs → ThreadContainer-LTKKLPXX.cjs} +14 -13
- package/dist/lib/node/ThreadContainer-LTKKLPXX.cjs.map +7 -0
- package/dist/lib/node/chunk-AWSTZ2KN.cjs +93 -0
- package/dist/lib/node/chunk-AWSTZ2KN.cjs.map +7 -0
- package/dist/lib/node/{ThreadMain-5AYGCXXP.cjs → chunk-BHFHFTHO.cjs} +21 -23
- package/dist/lib/node/chunk-BHFHFTHO.cjs.map +7 -0
- package/dist/lib/node/{chunk-VW2P26MZ.cjs → chunk-CMEMMYDL.cjs} +11 -8
- package/dist/lib/node/chunk-CMEMMYDL.cjs.map +7 -0
- package/dist/lib/node/{chunk-IC2NICNC.cjs → chunk-F735VMTN.cjs} +7 -7
- package/dist/lib/node/chunk-F735VMTN.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → chunk-FPWNZ6TB.cjs} +13 -10
- package/dist/lib/node/chunk-FPWNZ6TB.cjs.map +7 -0
- package/dist/lib/node/{chunk-2CB5AVBL.cjs → chunk-RQR5Z23G.cjs} +74 -151
- package/dist/lib/node/chunk-RQR5Z23G.cjs.map +7 -0
- package/dist/lib/node/index.cjs +149 -935
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-DVBEXJ33.cjs +299 -0
- package/dist/lib/node/intent-resolver-DVBEXJ33.cjs.map +7 -0
- package/dist/lib/node/markdown-ELRGISXE.cjs +122 -0
- package/dist/lib/node/markdown-ELRGISXE.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-7HLTN5XS.cjs +435 -0
- package/dist/lib/node/react-surface-7HLTN5XS.cjs.map +7 -0
- package/dist/lib/node/settings-7VQYARM5.cjs +36 -0
- package/dist/lib/node/settings-7VQYARM5.cjs.map +7 -0
- package/dist/lib/node/state-TQWEZ6B3.cjs +49 -0
- package/dist/lib/node/state-TQWEZ6B3.cjs.map +7 -0
- package/dist/lib/node/types.cjs +6 -4
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/ThreadContainer-SV74JFRH.mjs +20 -0
- package/dist/lib/node-esm/ThreadContainer-SV74JFRH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RMYATBXM.mjs → chunk-33NDMQQQ.mjs} +5 -3
- package/dist/lib/node-esm/chunk-33NDMQQQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AQ74G3GY.mjs → chunk-CISLDOH7.mjs} +29 -105
- package/dist/lib/node-esm/chunk-CISLDOH7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7QRGG25F.mjs → chunk-FXUATCLW.mjs} +3 -3
- package/dist/lib/node-esm/chunk-FXUATCLW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HLWJTUWZ.mjs +73 -0
- package/dist/lib/node-esm/chunk-HLWJTUWZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PJPVEO7E.mjs +17 -0
- package/dist/lib/node-esm/chunk-PJPVEO7E.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZJITX3TO.mjs +17 -0
- package/dist/lib/node-esm/chunk-ZJITX3TO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +150 -942
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-DHVLBNCC.mjs +288 -0
- package/dist/lib/node-esm/intent-resolver-DHVLBNCC.mjs.map +7 -0
- package/dist/lib/node-esm/markdown-23OB7EZG.mjs +113 -0
- package/dist/lib/node-esm/markdown-23OB7EZG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-AZHTTR6J.mjs +434 -0
- package/dist/lib/node-esm/react-surface-AZHTTR6J.mjs.map +7 -0
- package/dist/lib/node-esm/settings-SGMM7UDT.mjs +23 -0
- package/dist/lib/node-esm/settings-SGMM7UDT.mjs.map +7 -0
- package/dist/lib/node-esm/state-7MLR27YG.mjs +34 -0
- package/dist/lib/node-esm/state-7MLR27YG.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +6 -4
- package/dist/types/src/ThreadPlugin.d.ts +1 -3
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +15 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown.d.ts +4 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +7 -0
- package/dist/types/src/capabilities/state.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 +2 -3
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentContainer.d.ts +1 -2
- package/dist/types/src/components/CommentContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +2 -8
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +1 -2
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +2 -7
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/ThreadContainer.d.ts +7 -0
- package/dist/types/src/components/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings.d.ts +1 -2
- package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/command-extension.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -15
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +12 -12
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +5 -5
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.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/translations.d.ts +9 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +12 -18
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -38
- package/src/ThreadPlugin.tsx +106 -475
- package/src/capabilities/capabilities.ts +19 -0
- package/src/capabilities/index.ts +13 -0
- package/src/capabilities/intent-resolver.ts +239 -0
- package/src/capabilities/markdown.ts +18 -0
- package/src/capabilities/react-surface.tsx +61 -0
- package/src/capabilities/settings.ts +14 -0
- package/src/capabilities/state.ts +25 -0
- package/src/components/Chat.stories.tsx +22 -24
- package/src/components/ChatContainer.tsx +2 -2
- package/src/components/CommentContainer.tsx +18 -32
- package/src/components/Comments.stories.tsx +8 -2
- package/src/components/CommentsContainer.tsx +1 -17
- package/src/components/MessageContainer.tsx +6 -19
- package/src/components/ThreadComplementary.tsx +118 -51
- package/src/components/ThreadContainer.tsx +22 -0
- package/src/components/ThreadSettings.tsx +5 -11
- package/src/components/command-extension.ts +2 -5
- package/src/components/index.ts +1 -2
- package/src/components/types.ts +5 -5
- package/src/index.ts +1 -5
- package/src/meta.ts +1 -1
- package/src/translations.ts +3 -1
- package/src/types.ts +6 -29
- package/dist/lib/browser/ThreadArticle-EWLTNU6Z.mjs +0 -18
- package/dist/lib/browser/ThreadArticle-EWLTNU6Z.mjs.map +0 -7
- package/dist/lib/browser/ThreadMain-ABEDFWHC.mjs +0 -26
- package/dist/lib/browser/ThreadMain-ABEDFWHC.mjs.map +0 -7
- package/dist/lib/browser/chunk-6KTMQPL4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ENERBDYI.mjs.map +0 -7
- package/dist/lib/browser/chunk-OD2IZKRP.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/ThreadArticle-ZCNMFBAO.cjs.map +0 -7
- package/dist/lib/node/ThreadMain-5AYGCXXP.cjs.map +0 -7
- package/dist/lib/node/chunk-2CB5AVBL.cjs.map +0 -7
- package/dist/lib/node/chunk-IC2NICNC.cjs.map +0 -7
- package/dist/lib/node/chunk-VW2P26MZ.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/ThreadArticle-F37HYTOU.mjs +0 -19
- package/dist/lib/node-esm/ThreadArticle-F37HYTOU.mjs.map +0 -7
- package/dist/lib/node-esm/ThreadMain-OL6ZHNZY.mjs +0 -27
- package/dist/lib/node-esm/ThreadMain-OL6ZHNZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7QRGG25F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AQ74G3GY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RMYATBXM.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -12
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/components/ThreadArticle.d.ts +0 -5
- package/dist/types/src/components/ThreadArticle.d.ts.map +0 -1
- package/dist/types/src/components/ThreadMain.d.ts +0 -7
- package/dist/types/src/components/ThreadMain.d.ts.map +0 -1
- package/src/components/ThreadArticle.tsx +0 -18
- package/src/components/ThreadMain.tsx +0 -27
|
@@ -14,7 +14,6 @@ import { type ReactiveEchoObject, type Expando, type SpaceMember } from '@dxos/r
|
|
|
14
14
|
import { useIdentity, type Identity } from '@dxos/react-client/halo';
|
|
15
15
|
import { Button, ButtonGroup, Tooltip, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
16
16
|
import { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';
|
|
17
|
-
import { Mosaic, type MosaicTileComponent } from '@dxos/react-ui-mosaic';
|
|
18
17
|
import {
|
|
19
18
|
getSize,
|
|
20
19
|
hoverableControlItem,
|
|
@@ -26,7 +25,7 @@ import { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';
|
|
|
26
25
|
|
|
27
26
|
import { command } from './command-extension';
|
|
28
27
|
import { useOnEditAnalytics } from '../hooks';
|
|
29
|
-
import {
|
|
28
|
+
import { THREAD_PLUGIN } from '../meta';
|
|
30
29
|
import { getMessageMetadata } from '../util';
|
|
31
30
|
|
|
32
31
|
// TODO(thure): #8149
|
|
@@ -109,11 +108,7 @@ export const MessageContainer = ({
|
|
|
109
108
|
};
|
|
110
109
|
|
|
111
110
|
const MessagePart = ({ part }: { part: Expando }) => {
|
|
112
|
-
return
|
|
113
|
-
<Mosaic.Container id={part.id}>
|
|
114
|
-
<Mosaic.DraggableTile type={THREAD_ITEM} path={part.id} item={part} Component={MessageBlockObjectTile} />
|
|
115
|
-
</Mosaic.Container>
|
|
116
|
-
);
|
|
111
|
+
return <MessageBlockObjectTile subject={part} />;
|
|
117
112
|
};
|
|
118
113
|
|
|
119
114
|
const TextboxBlock = ({
|
|
@@ -165,9 +160,9 @@ const TextboxBlock = ({
|
|
|
165
160
|
return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;
|
|
166
161
|
};
|
|
167
162
|
|
|
168
|
-
const MessageBlockObjectTile:
|
|
169
|
-
({
|
|
170
|
-
let title =
|
|
163
|
+
const MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: ReactiveEchoObject<any> }>(
|
|
164
|
+
({ subject }, forwardedRef) => {
|
|
165
|
+
let title = subject.name ?? subject.title ?? subject.type ?? 'Object';
|
|
171
166
|
if (typeof title !== 'string') {
|
|
172
167
|
title = title?.content ?? '';
|
|
173
168
|
}
|
|
@@ -176,17 +171,9 @@ const MessageBlockObjectTile: MosaicTileComponent<ReactiveEchoObject<any>> = for
|
|
|
176
171
|
<div
|
|
177
172
|
role='group'
|
|
178
173
|
className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}
|
|
179
|
-
style={draggableStyle}
|
|
180
174
|
ref={forwardedRef}
|
|
181
175
|
>
|
|
182
|
-
<Surface
|
|
183
|
-
role='card'
|
|
184
|
-
limit={1}
|
|
185
|
-
data={{ subject: item }}
|
|
186
|
-
draggableProps={draggableProps}
|
|
187
|
-
fallback={title}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
176
|
+
<Surface role='card' limit={1} data={{ subject }} fallback={title} />
|
|
190
177
|
</div>
|
|
191
178
|
);
|
|
192
179
|
},
|
|
@@ -2,45 +2,50 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useEffect, useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { createIntent, LayoutAction,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { createIntent, LayoutAction, useCapability, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { ThreadCapabilities } from '@dxos/plugin-space';
|
|
9
|
+
import { MessageType, type ThreadType } from '@dxos/plugin-space/types';
|
|
10
|
+
import { create, fullyQualifiedId, makeRef, RefArray } from '@dxos/react-client/echo';
|
|
11
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
10
13
|
import { useAttended } from '@dxos/react-ui-attention';
|
|
11
|
-
import {
|
|
14
|
+
import { Tabs } from '@dxos/react-ui-tabs';
|
|
15
|
+
import { isNonNullable } from '@dxos/util';
|
|
12
16
|
|
|
17
|
+
import { ThreadCapabilities as LocalThreadCapabilities } from '../capabilities';
|
|
13
18
|
import { CommentsContainer } from '../components';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export const ThreadComplementary = ({
|
|
20
|
-
subject,
|
|
21
|
-
drafts,
|
|
22
|
-
current,
|
|
23
|
-
showResolvedThreads,
|
|
24
|
-
}: {
|
|
25
|
-
subject: any;
|
|
26
|
-
drafts: ThreadType[] | undefined;
|
|
27
|
-
current?: string;
|
|
28
|
-
showResolvedThreads?: boolean;
|
|
29
|
-
}) => {
|
|
19
|
+
import { THREAD_PLUGIN } from '../meta';
|
|
20
|
+
import { ThreadAction } from '../types';
|
|
21
|
+
|
|
22
|
+
export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
30
23
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
|
+
const identity = useIdentity();
|
|
25
|
+
const { t } = useTranslation(THREAD_PLUGIN);
|
|
26
|
+
|
|
27
|
+
const { state, getViewState } = useCapability(LocalThreadCapabilities.MutableState);
|
|
28
|
+
const viewState = getViewState(fullyQualifiedId(subject));
|
|
29
|
+
const { showResolvedThreads } = viewState;
|
|
30
|
+
const onChangeViewState = useCallback(
|
|
31
|
+
(nextValue: string) => {
|
|
32
|
+
viewState.showResolvedThreads = nextValue === 'all';
|
|
33
|
+
},
|
|
34
|
+
[viewState],
|
|
35
|
+
);
|
|
36
|
+
const drafts = state.drafts[fullyQualifiedId(subject)];
|
|
31
37
|
|
|
32
|
-
const threadsIntegrators =
|
|
33
|
-
const threadProvides = useMemo(() => threadsIntegrators.map((p) => p.provides.thread), [threadsIntegrators]);
|
|
38
|
+
const threadsIntegrators = useCapabilities(ThreadCapabilities.Thread);
|
|
34
39
|
const createSort = useMemo(
|
|
35
|
-
() =>
|
|
36
|
-
[
|
|
40
|
+
() => threadsIntegrators.find((p) => p.predicate(subject))?.createSort,
|
|
41
|
+
[threadsIntegrators, subject],
|
|
37
42
|
);
|
|
38
43
|
const sort = useMemo(() => createSort?.(subject), [createSort, subject]);
|
|
39
44
|
|
|
40
45
|
const threadObjects = RefArray.allResolvedTargets(subject.threads ?? []);
|
|
41
46
|
|
|
42
47
|
const threads = useMemo(() => {
|
|
43
|
-
return threadObjects.concat(drafts ?? []).filter(
|
|
48
|
+
return threadObjects.concat(drafts ?? []).filter(isNonNullable) as ThreadType[];
|
|
44
49
|
}, [JSON.stringify(threadObjects), JSON.stringify(drafts)]);
|
|
45
50
|
|
|
46
51
|
const detachedIds = useMemo(() => {
|
|
@@ -57,35 +62,97 @@ export const ThreadComplementary = ({
|
|
|
57
62
|
const attended = useAttended();
|
|
58
63
|
const qualifiedSubjectId = fullyQualifiedId(subject);
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
const handleAttend = useCallback(
|
|
66
|
+
(thread: ThreadType) => {
|
|
67
|
+
const threadId = fullyQualifiedId(thread);
|
|
68
|
+
if (state.current !== threadId) {
|
|
69
|
+
state.current = threadId;
|
|
70
|
+
|
|
71
|
+
// TODO(wittjosiah): Should this be a thread-specific intent?
|
|
72
|
+
// The layout doesn't know about threads and this working depends on other plugins conditionally handling it.
|
|
73
|
+
// This may be overloading this intent or highjacking its intended purpose.
|
|
74
|
+
void dispatch(
|
|
75
|
+
createIntent(LayoutAction.ScrollIntoView, {
|
|
76
|
+
part: 'current',
|
|
77
|
+
subject: fullyQualifiedId(subject),
|
|
78
|
+
options: {
|
|
79
|
+
cursor: thread.anchor,
|
|
80
|
+
ref: threadId,
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[state.current, dispatch, subject],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const handleComment = useCallback(
|
|
90
|
+
async (thread: ThreadType, message: string) => {
|
|
91
|
+
thread.messages.push(
|
|
92
|
+
makeRef(
|
|
93
|
+
create(MessageType, {
|
|
94
|
+
sender: { identityKey: identity?.identityKey.toHex() },
|
|
95
|
+
timestamp: new Date().toISOString(),
|
|
96
|
+
text: message,
|
|
97
|
+
// TODO(wittjosiah): Context based on attention.
|
|
98
|
+
// context: context ? makeRef(context) : undefined,
|
|
99
|
+
}),
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
await dispatch(createIntent(ThreadAction.OnMessageAdd, { thread, subject }));
|
|
104
|
+
|
|
105
|
+
state.current = fullyQualifiedId(thread);
|
|
106
|
+
},
|
|
107
|
+
[dispatch, identity, subject],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const handleResolve = useCallback(
|
|
111
|
+
(thread: ThreadType) => dispatch(createIntent(ThreadAction.ToggleResolved, { thread })),
|
|
112
|
+
[dispatch],
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const handleThreadDelete = useCallback(
|
|
116
|
+
(thread: ThreadType) => dispatch(createIntent(ThreadAction.Delete, { thread, subject })),
|
|
117
|
+
[dispatch, subject],
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const handleMessageDelete = useCallback(
|
|
121
|
+
(thread: ThreadType, messageId: string) =>
|
|
122
|
+
dispatch(createIntent(ThreadAction.DeleteMessage, { thread, subject, messageId })),
|
|
123
|
+
[dispatch, subject],
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const comments = (
|
|
61
127
|
<CommentsContainer
|
|
62
128
|
threads={threads}
|
|
63
129
|
detached={detachedIds}
|
|
64
|
-
currentId={attended.includes(qualifiedSubjectId) ? current : undefined}
|
|
130
|
+
currentId={attended.includes(qualifiedSubjectId) ? state.current : undefined}
|
|
65
131
|
showResolvedThreads={showResolvedThreads}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// TODO(wittjosiah): Should this be a thread-specific intent?
|
|
72
|
-
// The layout doesn't know about threads and this working depends on other plugins conditionally handling it.
|
|
73
|
-
// This may be overloading this intent or highjacking its intended purpose.
|
|
74
|
-
void dispatch?.(
|
|
75
|
-
createIntent(LayoutAction.ScrollIntoView, {
|
|
76
|
-
id: fullyQualifiedId(subject),
|
|
77
|
-
cursor: thread.anchor,
|
|
78
|
-
ref: threadId,
|
|
79
|
-
}),
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}}
|
|
83
|
-
onThreadDelete={(thread) => dispatch(createIntent(ThreadAction.Delete, { thread, subject }))}
|
|
84
|
-
onMessageDelete={(thread, messageId) =>
|
|
85
|
-
dispatch(createIntent(ThreadAction.DeleteMessage, { thread, subject, messageId }))
|
|
86
|
-
}
|
|
87
|
-
onThreadToggleResolved={(thread) => dispatch(createIntent(ThreadAction.ToggleResolved, { thread }))}
|
|
88
|
-
onComment={(thread) => dispatch(createIntent(ThreadAction.OnMessageAdd, { thread, subject }))}
|
|
132
|
+
onAttend={handleAttend}
|
|
133
|
+
onComment={handleComment}
|
|
134
|
+
onResolve={handleResolve}
|
|
135
|
+
onMessageDelete={handleMessageDelete}
|
|
136
|
+
onThreadDelete={handleThreadDelete}
|
|
89
137
|
/>
|
|
90
138
|
);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<Tabs.Root
|
|
142
|
+
value={showResolvedThreads ? 'all' : 'unresolved'}
|
|
143
|
+
onValueChange={onChangeViewState}
|
|
144
|
+
orientation='horizontal'
|
|
145
|
+
>
|
|
146
|
+
<Tabs.Tablist classNames='p-1 gap-1 bs-[--rail-action] border-be border-separator'>
|
|
147
|
+
<Tabs.Tab value='unresolved' classNames='text-sm'>
|
|
148
|
+
{t('show unresolved label')}
|
|
149
|
+
</Tabs.Tab>
|
|
150
|
+
<Tabs.Tab value='all' classNames='text-sm'>
|
|
151
|
+
{t('show all label')}
|
|
152
|
+
</Tabs.Tab>
|
|
153
|
+
</Tabs.Tablist>
|
|
154
|
+
<Tabs.Tabpanel value='all'>{showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
155
|
+
<Tabs.Tabpanel value='unresolved'>{!showResolvedThreads && comments}</Tabs.Tabpanel>
|
|
156
|
+
</Tabs.Root>
|
|
157
|
+
);
|
|
91
158
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ComponentProps } from 'react';
|
|
6
|
+
|
|
7
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
8
|
+
|
|
9
|
+
import { ChatContainer } from './ChatContainer';
|
|
10
|
+
|
|
11
|
+
const ThreadContainer = ({
|
|
12
|
+
role,
|
|
13
|
+
...props
|
|
14
|
+
}: Pick<ComponentProps<typeof ChatContainer>, 'thread' | 'context'> & { role: string }) => {
|
|
15
|
+
return (
|
|
16
|
+
<StackItem.Content toolbar={false}>
|
|
17
|
+
<ChatContainer {...props} />
|
|
18
|
+
</StackItem.Content>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default ThreadContainer;
|
|
@@ -4,20 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
// import { useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { DeprecatedFormContainer } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
10
|
+
// import { THREAD_PLUGIN } from '../meta';
|
|
11
11
|
import type { ThreadSettingsProps } from '../types';
|
|
12
12
|
|
|
13
13
|
export const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps }) => {
|
|
14
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
14
|
+
// const { t } = useTranslation(THREAD_PLUGIN);
|
|
15
15
|
|
|
16
|
-
return
|
|
17
|
-
<>
|
|
18
|
-
<DeprecatedFormInput label={t('settings standalone label')}>
|
|
19
|
-
<Input.Switch checked={settings.standalone} onCheckedChange={(checked) => (settings.standalone = !!checked)} />
|
|
20
|
-
</DeprecatedFormInput>
|
|
21
|
-
</>
|
|
22
|
-
);
|
|
16
|
+
return <DeprecatedFormContainer></DeprecatedFormContainer>;
|
|
23
17
|
};
|
|
@@ -6,7 +6,7 @@ import { StreamLanguage, HighlightStyle, syntaxHighlighting } from '@codemirror/
|
|
|
6
6
|
import { type Extension } from '@codemirror/state';
|
|
7
7
|
|
|
8
8
|
import { tags } from '@dxos/react-ui-editor';
|
|
9
|
-
import { mx
|
|
9
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts
|
|
@@ -27,10 +27,7 @@ const parser = StreamLanguage.define<{ count: number }>({
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const styles = HighlightStyle.define([
|
|
30
|
-
{
|
|
31
|
-
tag: tags.tagName,
|
|
32
|
-
class: mx(tagRoot({ palette: 'cyan' }), 'text-baseText font-medium'),
|
|
33
|
-
},
|
|
30
|
+
{ tag: tags.tagName, class: mx('dx-tag dx-tag--indigo text-baseText font-medium') },
|
|
34
31
|
]);
|
|
35
32
|
|
|
36
33
|
export const command: Extension = [parser, syntaxHighlighting(styles)];
|
package/src/components/index.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const ThreadArticle = lazy(() => import('./ThreadArticle'));
|
|
7
|
+
export const ThreadContainer = lazy(() => import('./ThreadContainer'));
|
|
9
8
|
|
|
10
9
|
// TODO(wittjosiah): Suspense boundary for sidebar?
|
|
11
10
|
export * from './CommentContainer';
|
package/src/components/types.ts
CHANGED
|
@@ -24,9 +24,9 @@ export type ThreadContainerProps = {
|
|
|
24
24
|
autoFocusTextbox?: boolean;
|
|
25
25
|
onTextboxFocus?: () => void;
|
|
26
26
|
detached?: boolean;
|
|
27
|
-
onAttend?: () => void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
onMessageDelete?: (messageId: string) => void;
|
|
31
|
-
|
|
27
|
+
onAttend?: (thread: ThreadType) => void;
|
|
28
|
+
onComment?: (thread: ThreadType, message: string) => void;
|
|
29
|
+
onResolve?: (thread: ThreadType) => void;
|
|
30
|
+
onMessageDelete?: (thread: ThreadType, messageId: string) => void;
|
|
31
|
+
onThreadDelete?: (thread: ThreadType) => void;
|
|
32
32
|
} & Pick<ThreadProps, 'current'>;
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -7,7 +7,7 @@ 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
|
-
export
|
|
10
|
+
export const meta = {
|
|
11
11
|
id: THREAD_PLUGIN,
|
|
12
12
|
name: 'Threads',
|
|
13
13
|
description: 'Add comment threads to objects.',
|
package/src/translations.ts
CHANGED
|
@@ -19,7 +19,6 @@ export default [
|
|
|
19
19
|
'delete channel label': 'Delete channel',
|
|
20
20
|
'create channel label': 'Create channel',
|
|
21
21
|
'message placeholder': 'Reply…',
|
|
22
|
-
'settings standalone label': 'Enable channel creation (experimental)',
|
|
23
22
|
'activity message': 'Processing…',
|
|
24
23
|
'anonymous label': 'Anonymous',
|
|
25
24
|
'delete message block label': 'Delete message block',
|
|
@@ -41,6 +40,9 @@ export default [
|
|
|
41
40
|
'edit message label': 'Edit',
|
|
42
41
|
'delete message label': 'Delete message',
|
|
43
42
|
'open comments panel label': 'Show Comments',
|
|
43
|
+
'comments panel label': 'Comments',
|
|
44
|
+
'show all label': 'All comments',
|
|
45
|
+
'show unresolved label': 'Unresolved only',
|
|
44
46
|
},
|
|
45
47
|
},
|
|
46
48
|
},
|
package/src/types.ts
CHANGED
|
@@ -2,18 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
GraphBuilderProvides,
|
|
7
|
-
IntentResolverProvides,
|
|
8
|
-
MetadataRecordsProvides,
|
|
9
|
-
SettingsProvides,
|
|
10
|
-
SurfaceProvides,
|
|
11
|
-
TranslationsProvides,
|
|
12
|
-
} from '@dxos/app-framework';
|
|
13
5
|
import { S } from '@dxos/echo-schema';
|
|
14
|
-
import { type PanelProvides } from '@dxos/plugin-deck/types';
|
|
15
|
-
import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';
|
|
16
|
-
import { type SchemaProvides } from '@dxos/plugin-space';
|
|
17
6
|
import { ChannelType, MessageType, ThreadType } from '@dxos/plugin-space/types';
|
|
18
7
|
import { EchoObjectSchema } from '@dxos/react-client/echo';
|
|
19
8
|
|
|
@@ -78,30 +67,18 @@ export namespace ThreadAction {
|
|
|
78
67
|
}) {}
|
|
79
68
|
}
|
|
80
69
|
|
|
81
|
-
|
|
82
|
-
export type ThreadProvides<T> = {
|
|
83
|
-
thread: {
|
|
84
|
-
predicate: (obj: any) => obj is T;
|
|
85
|
-
createSort: (obj: T) => (anchorA: string | undefined, anchorB: string | undefined) => number;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type ThreadPluginProvides = SurfaceProvides &
|
|
90
|
-
IntentResolverProvides &
|
|
91
|
-
GraphBuilderProvides &
|
|
92
|
-
MetadataRecordsProvides &
|
|
93
|
-
SettingsProvides<ThreadSettingsProps> &
|
|
94
|
-
TranslationsProvides &
|
|
95
|
-
SchemaProvides &
|
|
96
|
-
PanelProvides &
|
|
97
|
-
MarkdownExtensionProvides;
|
|
70
|
+
export const ThreadSettingsSchema = S.mutable(S.Struct({}));
|
|
98
71
|
|
|
99
|
-
export type ThreadSettingsProps =
|
|
72
|
+
export type ThreadSettingsProps = S.Schema.Type<typeof ThreadSettingsSchema>;
|
|
100
73
|
|
|
101
74
|
export interface ThreadModel {
|
|
102
75
|
root: ThreadType;
|
|
103
76
|
}
|
|
104
77
|
|
|
78
|
+
type SubjectId = string;
|
|
79
|
+
export type ViewState = { showResolvedThreads: boolean };
|
|
80
|
+
export type ViewStore = Record<SubjectId, ViewState>;
|
|
81
|
+
|
|
105
82
|
export type ThreadState = {
|
|
106
83
|
/** In-memory draft threads. */
|
|
107
84
|
drafts: Record<string, ThreadType[]>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer
|
|
3
|
-
} from "./chunk-OD2IZKRP.mjs";
|
|
4
|
-
import "./chunk-ENERBDYI.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/plugin-thread/src/components/ThreadArticle.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
var ThreadArticle = (props) => {
|
|
9
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
10
|
-
role: "none",
|
|
11
|
-
className: "row-span-2"
|
|
12
|
-
}, /* @__PURE__ */ React.createElement(ChatContainer, props));
|
|
13
|
-
};
|
|
14
|
-
var ThreadArticle_default = ThreadArticle;
|
|
15
|
-
export {
|
|
16
|
-
ThreadArticle_default as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=ThreadArticle-EWLTNU6Z.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ThreadArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentProps, type FC } from 'react';\n\nimport { ChatContainer } from './ChatContainer';\n\nconst ThreadArticle: FC<Pick<ComponentProps<typeof ChatContainer>, 'thread' | 'context'>> = (props) => {\n // TODO(burdon): Factor out Main container across plugins?\n return (\n <div role='none' className='row-span-2'>\n <ChatContainer {...props} />\n </div>\n );\n};\n\nexport default ThreadArticle;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAA6C;AAIpD,IAAMC,gBAAsF,CAACC,UAAAA;AAE3F,SACE,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,sBAAA,cAACC,eAAkBJ,KAAAA,CAAAA;AAGzB;AAEA,IAAA,wBAAeD;",
|
|
6
|
-
"names": ["React", "ThreadArticle", "props", "div", "role", "className", "ChatContainer"]
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer
|
|
3
|
-
} from "./chunk-OD2IZKRP.mjs";
|
|
4
|
-
import "./chunk-ENERBDYI.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/plugin-thread/src/components/ThreadMain.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { Main } from "@dxos/react-ui";
|
|
9
|
-
import { baseSurface, topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from "@dxos/react-ui-theme";
|
|
10
|
-
var ThreadMain = ({ thread }) => {
|
|
11
|
-
return /* @__PURE__ */ React.createElement(Main.Content, {
|
|
12
|
-
classNames: [
|
|
13
|
-
baseSurface,
|
|
14
|
-
fixedInsetFlexLayout,
|
|
15
|
-
topbarBlockPaddingStart,
|
|
16
|
-
bottombarBlockPaddingEnd
|
|
17
|
-
]
|
|
18
|
-
}, /* @__PURE__ */ React.createElement(ChatContainer, {
|
|
19
|
-
thread
|
|
20
|
-
}));
|
|
21
|
-
};
|
|
22
|
-
var ThreadMain_default = ThreadMain;
|
|
23
|
-
export {
|
|
24
|
-
ThreadMain_default as default
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=ThreadMain-ABEDFWHC.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ThreadMain.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { type ThreadType } from '@dxos/plugin-space/types';\nimport { Main } from '@dxos/react-ui';\nimport {\n baseSurface,\n topbarBlockPaddingStart,\n fixedInsetFlexLayout,\n bottombarBlockPaddingEnd,\n} from '@dxos/react-ui-theme';\n\nimport { ChatContainer } from './ChatContainer';\n\nconst ThreadMain: FC<{ thread: ThreadType }> = ({ thread }) => {\n // TODO(burdon): Factor out Main container across plugins?\n return (\n <Main.Content classNames={[baseSurface, fixedInsetFlexLayout, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}>\n <ChatContainer thread={thread} />\n </Main.Content>\n );\n};\n\nexport default ThreadMain;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAwB;AAG/B,SAASC,YAAY;AACrB,SACEC,aACAC,yBACAC,sBACAC,gCACK;AAIP,IAAMC,aAAyC,CAAC,EAAEC,OAAM,MAAE;AAExD,SACE,sBAAA,cAACC,KAAKC,SAAO;IAACC,YAAY;MAACC;MAAaC;MAAsBC;MAAyBC;;KACrF,sBAAA,cAACC,eAAAA;IAAcR;;AAGrB;AAEA,IAAA,qBAAeD;",
|
|
6
|
-
"names": ["React", "Main", "baseSurface", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "ThreadMain", "thread", "Main", "Content", "classNames", "baseSurface", "fixedInsetFlexLayout", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "ChatContainer"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type PanelProvides } from '@dxos/plugin-deck/types';\nimport { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';\nimport { type SchemaProvides } from '@dxos/plugin-space';\nimport { ChannelType, MessageType, ThreadType } from '@dxos/plugin-space/types';\nimport { EchoObjectSchema } from '@dxos/react-client/echo';\n\nimport { THREAD_PLUGIN } from './meta';\n\nexport namespace ThreadAction {\n const THREAD_ACTION = `${THREAD_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${THREAD_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n cursor: S.optional(S.String),\n subject: S.optional(EchoObjectSchema),\n }),\n output: S.Struct({\n object: S.Union(ChannelType, ThreadType),\n }),\n }) {}\n\n export class Select extends S.TaggedClass<Select>()(`${THREAD_ACTION}/select`, {\n input: S.Struct({\n current: S.String,\n skipOpen: S.optional(S.Boolean),\n }),\n output: S.Void,\n }) {}\n\n export class ToggleResolved extends S.TaggedClass<ToggleResolved>()(`${THREAD_ACTION}/toggle-resolved`, {\n input: S.Struct({\n thread: ThreadType,\n }),\n output: S.Void,\n }) {}\n\n export class Delete extends S.TaggedClass<Delete>()(`${THREAD_ACTION}/delete`, {\n input: S.Struct({\n thread: ThreadType,\n subject: EchoObjectSchema,\n cursor: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n // TODO(wittjosiah): Rename?\n export class OnMessageAdd extends S.TaggedClass<OnMessageAdd>()(`${THREAD_ACTION}/on-message-add`, {\n input: S.Struct({\n thread: ThreadType,\n subject: EchoObjectSchema,\n }),\n output: S.Void,\n }) {}\n\n export class DeleteMessage extends S.TaggedClass<DeleteMessage>()(`${THREAD_ACTION}/delete-message`, {\n input: S.Struct({\n thread: ThreadType,\n subject: EchoObjectSchema,\n messageId: S.String,\n message: S.optional(MessageType),\n messageIndex: S.optional(S.Number),\n }),\n output: S.Void,\n }) {}\n}\n\n// TODO(Zan): Move this to the plugin-space plugin or another common location when we implement threads in sheets.\nexport type ThreadProvides<T> = {\n thread: {\n predicate: (obj: any) => obj is T;\n createSort: (obj: T) => (anchorA: string | undefined, anchorB: string | undefined) => number;\n };\n};\n\nexport type ThreadPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n MetadataRecordsProvides &\n SettingsProvides<ThreadSettingsProps> &\n TranslationsProvides &\n SchemaProvides &\n PanelProvides &\n MarkdownExtensionProvides;\n\nexport type ThreadSettingsProps = { standalone?: boolean };\n\nexport interface ThreadModel {\n root: ThreadType;\n}\n\nexport type ThreadState = {\n /** In-memory draft threads. */\n drafts: Record<string, ThreadType[]>;\n current?: string | undefined;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAYA,SAASA,SAAS;AAIlB,SAASC,aAAaC,aAAaC,kBAAkB;AACrD,SAASC,wBAAwB;;UAIhBC,eAAAA;AACf,QAAMC,gBAAgB,GAAGC,aAAAA;EAElB,MAAMC,eAAeC,EAAEC,YAAW,EAAW,GAAGJ,aAAAA,WAAwB;IAC7EK,OAAOF,EAAEG,OAAO;MACdC,MAAMJ,EAAEK,SAASL,EAAEM,MAAM;MACzBC,QAAQP,EAAEK,SAASL,EAAEM,MAAM;MAC3BE,SAASR,EAAEK,SAASI,gBAAAA;IACtB,CAAA;IACAC,QAAQV,EAAEG,OAAO;MACfQ,QAAQX,EAAEY,MAAMC,aAAaC,UAAAA;IAC/B,CAAA;EACF,CAAA,EAAA;EAAI;gBATSf,SAAAA;EAWN,MAAMgB,eAAef,EAAEC,YAAW,EAAW,GAAGJ,aAAAA,WAAwB;IAC7EK,OAAOF,EAAEG,OAAO;MACda,SAAShB,EAAEM;MACXW,UAAUjB,EAAEK,SAASL,EAAEkB,OAAO;IAChC,CAAA;IACAR,QAAQV,EAAEmB;EACZ,CAAA,EAAA;EAAI;gBANSJ,SAAAA;EAQN,MAAMK,uBAAuBpB,EAAEC,YAAW,EAAmB,GAAGJ,aAAAA,oBAAiC;IACtGK,OAAOF,EAAEG,OAAO;MACdkB,QAAQP;IACV,CAAA;IACAJ,QAAQV,EAAEmB;EACZ,CAAA,EAAA;EAAI;gBALSC,iBAAAA;EAON,MAAME,eAAetB,EAAEC,YAAW,EAAW,GAAGJ,aAAAA,WAAwB;IAC7EK,OAAOF,EAAEG,OAAO;MACdkB,QAAQP;MACRN,SAASC;MACTF,QAAQP,EAAEK,SAASL,EAAEM,MAAM;IAC7B,CAAA;IACAI,QAAQV,EAAEmB;EACZ,CAAA,EAAA;EAAI;gBAPSG,SAAAA;EAUN,MAAMC,qBAAqBvB,EAAEC,YAAW,EAAiB,GAAGJ,aAAAA,mBAAgC;IACjGK,OAAOF,EAAEG,OAAO;MACdkB,QAAQP;MACRN,SAASC;IACX,CAAA;IACAC,QAAQV,EAAEmB;EACZ,CAAA,EAAA;EAAI;gBANSI,eAAAA;EAQN,MAAMC,sBAAsBxB,EAAEC,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOF,EAAEG,OAAO;MACdkB,QAAQP;MACRN,SAASC;MACTgB,WAAWzB,EAAEM;MACboB,SAAS1B,EAAEK,SAASsB,WAAAA;MACpBC,cAAc5B,EAAEK,SAASL,EAAE6B,MAAM;IACnC,CAAA;IACAnB,QAAQV,EAAEmB;EACZ,CAAA,EAAA;EAAI;gBATSK,gBAAAA;AAUf,GAzDiB5B,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["S", "ChannelType", "MessageType", "ThreadType", "EchoObjectSchema", "ThreadAction", "THREAD_ACTION", "THREAD_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "cursor", "subject", "EchoObjectSchema", "output", "object", "Union", "ChannelType", "ThreadType", "Select", "current", "skipOpen", "Boolean", "Void", "ToggleResolved", "thread", "Delete", "OnMessageAdd", "DeleteMessage", "messageId", "message", "MessageType", "messageIndex", "Number"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const THREAD_PLUGIN = 'dxos.org/plugin/thread';\nexport const THREAD_ITEM = `${THREAD_PLUGIN}/item`;\n\nexport default {\n id: THREAD_PLUGIN,\n name: 'Threads',\n description: 'Add comment threads to objects.',\n icon: 'ph--chat--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,gBAAgB;AACtB,IAAMC,cAAc,GAAGD,aAAAA;AAE9B,IAAA,eAAe;EACbE,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["THREAD_PLUGIN", "THREAD_ITEM", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useStatus.ts", "../../../src/hooks/analytics.ts", "../../../src/components/ChatContainer.tsx", "../../../src/components/MessageContainer.tsx", "../../../src/components/command-extension.ts", "../../../src/util.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\n\n// TODO(burdon): Generalize and factor out.\nexport const useStatus = (space?: Space, channel?: string) => {\n const [processing, setProcessing] = useState(false);\n useEffect(() => {\n if (!space || !channel) {\n return;\n }\n\n const unsubscribe = space.listen(`status/${channel}`, (status) => {\n const { event } = status.payload ?? {};\n setProcessing(event === 'processing');\n });\n\n const t = setInterval(() => {\n setProcessing((prev: any) => {\n if (typeof prev?.ts === 'number' && Date.now() - prev.ts > 30_000) {\n return undefined;\n } else {\n return prev;\n }\n });\n }, 1_000);\n\n return () => {\n unsubscribe();\n clearInterval(t);\n };\n }, [space, channel]);\n\n return processing;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { type ReactiveObject } from '@dxos/live-object';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { useOnTransition } from '@dxos/react-ui';\n\nexport const useAnalyticsCallback = (spaceId: string | undefined, name: string, meta?: any) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n return useCallback(\n (dynamicMeta?: any) => {\n void dispatch(\n createIntent(ObservabilityAction.SendEvent, { name, properties: { ...meta, ...dynamicMeta, spaceId } }),\n );\n },\n [dispatch, name, meta, spaceId],\n );\n};\n\nexport const useOnEditAnalytics = (message: ReactiveObject<any>, editing: boolean) => {\n const space = getSpace(message);\n\n const onEditAnalytics = useAnalyticsCallback(space?.id, 'threads.comment-edited', {\n messageId: message.id,\n messageLength: message.text.length,\n });\n\n useOnTransition(editing, true, false, onEditAnalytics);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Ref } from '@dxos/echo-schema';\nimport { create, makeRef, RefArray } from '@dxos/live-object';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { fullyQualifiedId, getSpace, useMembers, type Expando } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, threadLayout } from '@dxos/react-ui-thread';\n\nimport { MessageContainer } from './MessageContainer';\nimport { command } from './command-extension';\nimport { type ThreadContainerProps } from './types';\nimport { useStatus } from '../hooks';\nimport { THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nexport const ChatHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n return (\n <div role='none' className='flex items-center'>\n <StackItem.SigilButton attendableId={attendableId}>\n <Icon icon='ph--chat--regular' size={5} />\n </StackItem.SigilButton>\n <StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>\n </div>\n );\n};\n\nexport const ChatContainer = ({ thread, context, current, autoFocusTextbox }: ThreadContainerProps) => {\n const identity = useIdentity()!;\n const space = getSpace(thread);\n const members = useMembers(space?.key);\n const activity = useStatus(space, fullyQualifiedId(thread));\n const { t } = useTranslation(THREAD_PLUGIN);\n // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.\n const [_count, _setCount] = useState(0);\n const rerenderEditor = () => _setCount((count) => count + 1);\n const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(fullyQualifiedId(thread), identity);\n const messageRef = useRef('');\n const extensions = useMemo(\n () => [\n createBasicExtensions({ placeholder: t('message placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: (text) => (messageRef.current = text) }),\n command,\n ],\n [themeMode, _count],\n );\n\n // TODO(thure): Factor out.\n // TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using\n // `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient\n // for the desired effect; this is likely hardware-dependent and should be reevaluated.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n useLayoutEffect(() => {\n scrollToEnd('instant');\n }, []);\n\n // TODO(burdon): Change to model.\n const handleCreate: MessageTextboxProps['onSend'] = () => {\n if (!messageRef.current?.length) {\n return false;\n }\n\n thread.messages.push(\n makeRef(\n create(MessageType, {\n sender: { identityKey: identity.identityKey.toHex() },\n timestamp: new Date().toISOString(),\n text: messageRef.current,\n context: makeRef(context as Expando),\n }),\n ),\n );\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('smooth');\n rerenderEditor();\n return true;\n };\n\n const handleDelete = (id: string) => {\n const messageIndex = thread.messages.findIndex(Ref.hasObjectId(id));\n if (messageIndex !== -1) {\n thread.messages.splice(messageIndex, 1);\n }\n };\n\n return (\n <Thread\n current={current}\n id={fullyQualifiedId(thread)}\n 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'\n >\n <ScrollArea.Root classNames='col-span-2'>\n <ScrollArea.Viewport 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]'>\n <div role='none' className={mx(threadLayout, 'place-self-end')}>\n {RefArray.allResolvedTargets(thread.messages ?? []).map((message) => (\n <MessageContainer key={message.id} message={message} members={members} onDelete={handleDelete} />\n ))}\n </div>\n {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}\n <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>\n </Thread>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { Check, PencilSimple, X } from '@phosphor-icons/react';\nimport React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { RefArray } from '@dxos/live-object';\nimport { type MessageType } from '@dxos/plugin-space/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type ReactiveEchoObject, type Expando, type SpaceMember } from '@dxos/react-client/echo';\nimport { useIdentity, type Identity } from '@dxos/react-client/halo';\nimport { Button, ButtonGroup, Tooltip, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';\nimport { Mosaic, type MosaicTileComponent } from '@dxos/react-ui-mosaic';\nimport {\n getSize,\n hoverableControlItem,\n hoverableControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/react-ui-theme';\nimport { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';\n\nimport { command } from './command-extension';\nimport { useOnEditAnalytics } from '../hooks';\nimport { THREAD_ITEM, THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\n// TODO(thure): #8149\nconst messageControlClassNames = ['!p-1 !min-bs-0 transition-opacity', hoverableControlItem];\n\nexport const MessageContainer = ({\n message,\n members,\n onDelete,\n}: {\n message: MessageType;\n members: SpaceMember[];\n onDelete?: (id: string) => void;\n}) => {\n const senderIdentity = members.find(\n (member) => message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey),\n )?.identity;\n const messageMetadata = getMessageMetadata(message.id, senderIdentity);\n const userIsAuthor = useIdentity()?.identityKey.toHex() === messageMetadata.authorId;\n const [editing, setEditing] = useState(false);\n const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);\n const { t } = useTranslation(THREAD_PLUGIN);\n const editLabel = t(editing ? 'save message label' : 'edit message label');\n const deleteLabel = t('delete message label');\n\n return (\n <MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>\n <MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>\n <ButtonGroup classNames='mie-1'>\n {userIsAuthor && (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n classNames={messageControlClassNames}\n onClick={() => setEditing((editing) => !editing)}\n >\n <span className='sr-only'>{editLabel}</span>\n {editing ? <Check className={getSize(4)} /> : <PencilSimple className={getSize(4)} />}\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n {editLabel}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n )}\n {onDelete && (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.message.delete'\n classNames={messageControlClassNames}\n onClick={() => handleDelete()}\n >\n <span className='sr-only'>{deleteLabel}</span>\n <X className={getSize(4)} />\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n {deleteLabel}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n )}\n </ButtonGroup>\n </MessageHeading>\n <TextboxBlock message={message} isAuthor={userIsAuthor} editing={editing} />\n {RefArray.allResolvedTargets(message.parts ?? []).map((part, index) => (\n <MessagePart key={index} part={part} />\n ))}\n </MessageRoot>\n );\n};\n\nconst MessagePart = ({ part }: { part: Expando }) => {\n return (\n <Mosaic.Container id={part.id}>\n <Mosaic.DraggableTile type={THREAD_ITEM} path={part.id} item={part} Component={MessageBlockObjectTile} />\n </Mosaic.Container>\n );\n};\n\nconst TextboxBlock = ({\n message,\n isAuthor,\n editing,\n}: {\n message: MessageType;\n editing?: boolean;\n isAuthor?: boolean;\n identity?: Identity;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(message.text);\n\n const handleDocumentChange = useCallback((newState: string) => {\n inMemoryContentRef.current = newState;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n message.text = inMemoryContentRef.current;\n }, [message]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: message.text,\n extensions: [\n createBasicExtensions({ readonly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [message.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n editing && view?.focus();\n }, [editing, view]);\n\n useOnEditAnalytics(message, !!editing);\n\n return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;\n};\n\nconst MessageBlockObjectTile: MosaicTileComponent<ReactiveEchoObject<any>> = forwardRef(\n ({ draggableStyle, draggableProps, item, active, ref: _ref, ...props }, forwardedRef) => {\n let title = item.name ?? item.title ?? item.type ?? 'Object';\n if (typeof title !== 'string') {\n title = title?.content ?? '';\n }\n\n return (\n <div\n role='group'\n className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}\n style={draggableStyle}\n ref={forwardedRef}\n >\n <Surface\n role='card'\n limit={1}\n data={{ subject: item }}\n draggableProps={draggableProps}\n fallback={title}\n {...props}\n />\n </div>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { StreamLanguage, HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { mx, tagRoot } from '@dxos/react-ui-theme';\n\n/**\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n if (state.count === 1 && stream.match(/^(\\/\\w+)/)) {\n return 'tagName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: mx(tagRoot({ palette: 'cyan' }), 'text-baseText font-medium'),\n },\n]);\n\nexport const command: Extension = [parser, syntaxHighlighting(styles)];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { generateName } from '@dxos/display-name';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Identity } from '@dxos/react-client/halo';\nimport { type MessageMetadata } from '@dxos/react-ui-thread';\nimport { hexToFallback } from '@dxos/util';\n\nexport type MessagePropertiesProvider = (identityKey: PublicKey | undefined) => MessageMetadata;\n\nexport const getMessageMetadata = (id: string, identity?: Identity): MessageMetadata => {\n const fallback = hexToFallback(identity?.identityKey.toHex() ?? '0');\n return {\n id,\n authorId: identity?.identityKey.toHex(),\n authorName:\n identity?.profile?.displayName ??\n (identity?.identityKey ? generateName(identity.identityKey.toHex()) : undefined),\n authorAvatarProps: {\n hue: identity?.profile?.data?.hue ?? fallback.hue,\n emoji: identity?.profile?.data?.emoji ?? fallback.emoji,\n },\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,WAAWC,gBAAgB;AAK7B,IAAMC,YAAY,CAACC,OAAeC,YAAAA;AACvC,QAAM,CAACC,YAAYC,aAAAA,IAAiBC,SAAS,KAAA;AAC7CC,YAAU,MAAA;AACR,QAAI,CAACL,SAAS,CAACC,SAAS;AACtB;IACF;AAEA,UAAMK,cAAcN,MAAMO,OAAO,UAAUN,OAAAA,IAAW,CAACO,WAAAA;AACrD,YAAM,EAAEC,MAAK,IAAKD,OAAOE,WAAW,CAAC;AACrCP,oBAAcM,UAAU,YAAA;IAC1B,CAAA;AAEA,UAAME,IAAIC,YAAY,MAAA;AACpBT,oBAAc,CAACU,SAAAA;AACb,YAAI,OAAOA,MAAMC,OAAO,YAAYC,KAAKC,IAAG,IAAKH,KAAKC,KAAK,KAAQ;AACjE,iBAAOG;QACT,OAAO;AACL,iBAAOJ;QACT;MACF,CAAA;IACF,GAAG,GAAA;AAEH,WAAO,MAAA;AACLP,kBAAAA;AACAY,oBAAcP,CAAAA;IAChB;EACF,GAAG;IAACX;IAAOC;GAAQ;AAEnB,SAAOC;AACT;;;AClCA,SAASiB,mBAAmB;AAE5B,SAASC,cAAcC,2BAA2B;AAElD,SAASC,2BAA2B;AACpC,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAEzB,IAAMC,uBAAuB,CAACC,SAA6BC,MAA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useEffect", "useState", "useStatus", "space", "channel", "processing", "setProcessing", "useState", "useEffect", "unsubscribe", "listen", "status", "event", "payload", "t", "setInterval", "prev", "ts", "Date", "now", "undefined", "clearInterval", "useCallback", "createIntent", "useIntentDispatcher", "ObservabilityAction", "getSpace", "useOnTransition", "useAnalyticsCallback", "spaceId", "name", "meta", "dispatchPromise", "dispatch", "useIntentDispatcher", "useCallback", "dynamicMeta", "createIntent", "ObservabilityAction", "SendEvent", "properties", "useOnEditAnalytics", "message", "editing", "space", "getSpace", "onEditAnalytics", "id", "messageId", "messageLength", "text", "length", "useOnTransition", "React", "useLayoutEffect", "useMemo", "useRef", "useState", "Ref", "create", "makeRef", "RefArray", "MessageType", "fullyQualifiedId", "getSpace", "useMembers", "useIdentity", "Icon", "ScrollArea", "useThemeContext", "useTranslation", "createBasicExtensions", "createThemeExtensions", "listener", "StackItem", "mx", "MessageTextbox", "Thread", "ThreadFooter", "threadLayout", "EditorView", "Check", "PencilSimple", "X", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "Surface", "RefArray", "PublicKey", "useIdentity", "Button", "ButtonGroup", "Tooltip", "useOnTransition", "useThemeContext", "useTranslation", "createBasicExtensions", "createThemeExtensions", "useTextEditor", "Mosaic", "getSize", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "MessageHeading", "MessageRoot", "StreamLanguage", "HighlightStyle", "syntaxHighlighting", "tags", "mx", "tagRoot", "parser", "StreamLanguage", "define", "startState", "count", "token", "stream", "state", "eatSpace", "match", "next", "styles", "HighlightStyle", "tag", "tags", "tagName", "class", "mx", "tagRoot", "palette", "command", "syntaxHighlighting", "generateName", "hexToFallback", "getMessageMetadata", "id", "identity", "fallback", "hexToFallback", "identityKey", "toHex", "authorId", "authorName", "profile", "displayName", "generateName", "undefined", "authorAvatarProps", "hue", "data", "emoji", "messageControlClassNames", "hoverableControlItem", "MessageContainer", "message", "members", "onDelete", "senderIdentity", "find", "member", "sender", "identityKey", "PublicKey", "equals", "identity", "messageMetadata", "getMessageMetadata", "id", "userIsAuthor", "useIdentity", "toHex", "authorId", "editing", "setEditing", "useState", "handleDelete", "useCallback", "t", "useTranslation", "THREAD_PLUGIN", "editLabel", "deleteLabel", "MessageRoot", "classNames", "hoverableControls", "hoverableFocusedWithinControls", "MessageHeading", "authorName", "timestamp", "ButtonGroup", "Tooltip", "Root", "Trigger", "asChild", "Button", "variant", "data-testid", "onClick", "span", "className", "Check", "getSize", "PencilSimple", "Portal", "Content", "Arrow", "X", "TextboxBlock", "isAuthor", "RefArray", "allResolvedTargets", "parts", "map", "part", "index", "MessagePart", "key", "Mosaic", "Container", "DraggableTile", "type", "THREAD_ITEM", "path", "item", "Component", "MessageBlockObjectTile", "themeMode", "useThemeContext", "inMemoryContentRef", "useRef", "text", "handleDocumentChange", "newState", "current", "saveDocumentChange", "useOnTransition", "parentRef", "focusAttributes", "view", "useTextEditor", "initialValue", "extensions", "createBasicExtensions", "readonly", "createThemeExtensions", "command", "EditorView", "updateListener", "of", "update", "docChanged", "state", "doc", "toString", "useEffect", "focus", "useOnEditAnalytics", "div", "role", "ref", "forwardRef", "draggableStyle", "draggableProps", "active", "_ref", "props", "forwardedRef", "title", "name", "content", "mx", "style", "Surface", "limit", "data", "subject", "fallback", "ChatContainer", "thread", "context", "current", "autoFocusTextbox", "identity", "useIdentity", "space", "getSpace", "members", "useMembers", "key", "activity", "useStatus", "fullyQualifiedId", "t", "useTranslation", "THREAD_PLUGIN", "_count", "_setCount", "useState", "rerenderEditor", "count", "autoFocus", "setAutoFocus", "threadScrollRef", "useRef", "themeMode", "useThemeContext", "textboxMetadata", "getMessageMetadata", "messageRef", "extensions", "useMemo", "createBasicExtensions", "placeholder", "createThemeExtensions", "listener", "onChange", "text", "command", "scrollToEnd", "behavior", "setTimeout", "scrollIntoView", "block", "useLayoutEffect", "handleCreate", "length", "messages", "push", "makeRef", "create", "MessageType", "sender", "identityKey", "toHex", "timestamp", "Date", "toISOString", "handleDelete", "id", "messageIndex", "findIndex", "Ref", "hasObjectId", "splice", "React", "Thread", "classNames", "ScrollArea", "Root", "Viewport", "div", "role", "className", "mx", "threadLayout", "RefArray", "allResolvedTargets", "map", "message", "MessageContainer", "onDelete", "ref", "Scrollbar", "Thumb", "MessageTextbox", "onSend", "ThreadFooter"]
|
|
7
|
-
}
|