@dxos/plugin-thread 0.6.12-main.5cc132e → 0.6.12-main.89e9959
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/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-4VU752F4.mjs} +3 -3
- package/dist/lib/{node-esm/ThreadMain-DU6LBSN3.mjs → browser/ThreadMain-ML3P4XSD.mjs} +3 -3
- package/dist/lib/browser/{chunk-5IBJO53M.mjs → chunk-7NUYW5IW.mjs} +2 -5
- package/dist/lib/browser/chunk-7NUYW5IW.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-U5UVX4ZP.mjs → browser/chunk-GJRBBPXI.mjs} +2 -2
- package/dist/lib/browser/{chunk-AVC4CGJM.mjs → chunk-XF5QKI75.mjs} +8 -6
- package/dist/lib/browser/chunk-XF5QKI75.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +46 -111
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs → ThreadArticle-ERUHPHVT.cjs} +7 -7
- package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs → ThreadMain-6DN7FDNB.cjs} +7 -7
- package/dist/lib/node/{chunk-BWBONZGU.cjs → chunk-6EVXCSDS.cjs} +5 -18
- package/dist/lib/node/chunk-6EVXCSDS.cjs.map +7 -0
- package/dist/lib/node/{chunk-4B2ARV7L.cjs → chunk-FXD3DYMO.cjs} +6 -6
- package/dist/lib/node/{chunk-T7TXCNHL.cjs → chunk-PZVUW4W2.cjs} +61 -59
- package/dist/lib/node/chunk-PZVUW4W2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +145 -210
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -4
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-NKI5F4W5.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-NKI5F4W5.mjs.map} +1 -1
- package/dist/lib/{browser/ThreadMain-DU6LBSN3.mjs → node-esm/ThreadMain-2A3VQLCW.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-2A3VQLCW.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-AVC4CGJM.mjs → chunk-A44C4MTQ.mjs} +9 -6
- package/dist/lib/node-esm/chunk-A44C4MTQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5IBJO53M.mjs → chunk-Y475KZTX.mjs} +4 -5
- package/dist/lib/node-esm/chunk-Y475KZTX.mjs.map +7 -0
- package/dist/lib/{browser/chunk-U5UVX4ZP.mjs → node-esm/chunk-YO46JGAE.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-U5UVX4ZP.mjs.map → chunk-YO46JGAE.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +47 -111
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -1
- package/dist/lib/node-esm/types.mjs +3 -2
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentContainer.d.ts +1 -1
- package/dist/types/src/components/CommentContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +1 -5
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +1 -2
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +2 -0
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/ThreadPlugin.tsx +31 -78
- package/src/components/ChatContainer.tsx +3 -4
- package/src/components/CommentContainer.tsx +8 -12
- package/src/components/CommentsContainer.tsx +1 -18
- package/src/components/ThreadComplementary.tsx +5 -12
- package/src/meta.tsx +1 -5
- package/dist/lib/browser/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/browser/chunk-AVC4CGJM.mjs.map +0 -7
- package/dist/lib/node/chunk-BWBONZGU.cjs.map +0 -7
- package/dist/lib/node/chunk-T7TXCNHL.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AVC4CGJM.mjs.map +0 -7
- /package/dist/lib/browser/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-4VU752F4.mjs.map} +0 -0
- /package/dist/lib/browser/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-ML3P4XSD.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-U5UVX4ZP.mjs.map → chunk-GJRBBPXI.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs.map → ThreadArticle-ERUHPHVT.cjs.map} +0 -0
- /package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs.map → ThreadMain-6DN7FDNB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-4B2ARV7L.cjs.map → chunk-FXD3DYMO.cjs.map} +0 -0
package/src/ThreadPlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Chat, type IconProps } from '@phosphor-icons/react';
|
|
6
5
|
import { computed, effect } from '@preact/signals-core';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
@@ -16,9 +15,6 @@ import {
|
|
|
16
15
|
parseIntentPlugin,
|
|
17
16
|
parseNavigationPlugin,
|
|
18
17
|
resolvePlugin,
|
|
19
|
-
parseGraphPlugin,
|
|
20
|
-
SLUG_PATH_SEPARATOR,
|
|
21
|
-
SLUG_COLLECTION_INDICATOR,
|
|
22
18
|
isLayoutParts,
|
|
23
19
|
parseMetadataResolverPlugin,
|
|
24
20
|
} from '@dxos/app-framework';
|
|
@@ -27,16 +23,14 @@ import { type EchoReactiveObject, getTypename } from '@dxos/echo-schema';
|
|
|
27
23
|
import { create } from '@dxos/echo-schema';
|
|
28
24
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
29
25
|
import { log } from '@dxos/log';
|
|
30
|
-
import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
|
|
31
26
|
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
32
|
-
import { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';
|
|
27
|
+
import { type ActionGroup, createExtension, isActionGroup, toSignal } from '@dxos/plugin-graph';
|
|
33
28
|
import { ObservabilityAction } from '@dxos/plugin-observability/meta';
|
|
34
29
|
import { SpaceAction } from '@dxos/plugin-space';
|
|
35
30
|
import { ThreadType, MessageType, ChannelType } from '@dxos/plugin-space/types';
|
|
36
31
|
import {
|
|
37
32
|
getSpace,
|
|
38
33
|
getTextInRange,
|
|
39
|
-
Filter,
|
|
40
34
|
createDocAccessor,
|
|
41
35
|
fullyQualifiedId,
|
|
42
36
|
loadObjectReferences,
|
|
@@ -55,7 +49,6 @@ type ThreadState = {
|
|
|
55
49
|
/** An in-memory staging area for threads that are being drafted. */
|
|
56
50
|
staging: Record<string, ThreadType[]>;
|
|
57
51
|
current?: string | undefined;
|
|
58
|
-
focus?: boolean;
|
|
59
52
|
};
|
|
60
53
|
|
|
61
54
|
type SubjectId = string;
|
|
@@ -77,7 +70,6 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
77
70
|
return viewStore[subjectId];
|
|
78
71
|
};
|
|
79
72
|
|
|
80
|
-
let attentionPlugin: Plugin<AttentionPluginProvides> | undefined;
|
|
81
73
|
let navigationPlugin: Plugin<LocationProvides> | undefined;
|
|
82
74
|
let intentPlugin: Plugin<IntentPluginProvides> | undefined;
|
|
83
75
|
|
|
@@ -88,47 +80,8 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
88
80
|
ready: async (plugins) => {
|
|
89
81
|
settings.prop({ key: 'standalone', type: LocalStorageStore.bool({ allowUndefined: true }) });
|
|
90
82
|
|
|
91
|
-
attentionPlugin = resolvePlugin(plugins, parseAttentionPlugin);
|
|
92
83
|
navigationPlugin = resolvePlugin(plugins, parseNavigationPlugin);
|
|
93
84
|
intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;
|
|
94
|
-
|
|
95
|
-
const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);
|
|
96
|
-
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
97
|
-
if (!client) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// TODO(wittjosiah): This is a hack to make standalone threads work in the c11y sidebar.
|
|
102
|
-
// This should have a better solution when deck is introduced.
|
|
103
|
-
const channelsQuery = client.spaces.query(Filter.schema(ChannelType));
|
|
104
|
-
const queryUnsubscribe = channelsQuery.subscribe();
|
|
105
|
-
const unsubscribe = effect(() => {
|
|
106
|
-
const attention = attentionPlugin?.provides.attention;
|
|
107
|
-
if (!attention?.attended) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const firstAttendedNodeWithComments = Array.from(attention.attended)
|
|
112
|
-
.map((id) => graphPlugin?.provides.graph.findNode(id))
|
|
113
|
-
.find((node) => {
|
|
114
|
-
const data = node?.data as { threads?: unknown };
|
|
115
|
-
return Array.isArray(data?.threads) && data.threads.length > 0;
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
if (firstAttendedNodeWithComments) {
|
|
119
|
-
void intentPlugin?.provides.intent.dispatch({
|
|
120
|
-
action: NavigationAction.OPEN,
|
|
121
|
-
data: {
|
|
122
|
-
activeParts: {
|
|
123
|
-
complementary: `${firstAttendedNodeWithComments.id}${SLUG_PATH_SEPARATOR}comments`,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
unsubscribeCallbacks.push(queryUnsubscribe);
|
|
131
|
-
unsubscribeCallbacks.push(unsubscribe);
|
|
132
85
|
},
|
|
133
86
|
unload: async () => {
|
|
134
87
|
unsubscribeCallbacks.forEach((unsubscribe) => unsubscribe());
|
|
@@ -139,8 +92,7 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
139
92
|
records: {
|
|
140
93
|
[ChannelType.typename]: {
|
|
141
94
|
placeholder: ['channel title placeholder', { ns: THREAD_PLUGIN }],
|
|
142
|
-
icon:
|
|
143
|
-
iconSymbol: 'ph--chat--regular',
|
|
95
|
+
icon: 'ph--chat--regular',
|
|
144
96
|
// TODO(wittjosiah): Move out of metadata.
|
|
145
97
|
loadReferences: (channel: ChannelType) => loadObjectReferences(channel, (channel) => channel.threads),
|
|
146
98
|
},
|
|
@@ -186,30 +138,42 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
186
138
|
return;
|
|
187
139
|
}
|
|
188
140
|
|
|
189
|
-
// TODO(Zan): Find util (or make one)
|
|
190
|
-
const
|
|
191
|
-
const [spaceId, objectId] =
|
|
141
|
+
// TODO(Zan): Find util (or make one).
|
|
142
|
+
const subjectId = id.split('~').at(0);
|
|
143
|
+
const [spaceId, objectId] = subjectId?.split(':') ?? [];
|
|
192
144
|
const space = client.spaces.get().find((space) => space.id === spaceId);
|
|
193
|
-
const
|
|
194
|
-
|
|
145
|
+
const object = toSignal(
|
|
146
|
+
(onChange) => {
|
|
147
|
+
const timeout = setTimeout(async () => {
|
|
148
|
+
await space?.db.loadObjectById(objectId);
|
|
149
|
+
onChange();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
return () => clearTimeout(timeout);
|
|
153
|
+
},
|
|
154
|
+
() => space?.db.getObjectById(objectId),
|
|
155
|
+
subjectId,
|
|
156
|
+
);
|
|
157
|
+
if (!object || !subjectId) {
|
|
195
158
|
return;
|
|
196
159
|
}
|
|
197
160
|
|
|
198
|
-
const
|
|
199
|
-
const label =
|
|
200
|
-
|
|
201
|
-
|
|
161
|
+
const meta = metadataResolver(getTypename(object) ?? '');
|
|
162
|
+
const label = meta.label?.(object) ||
|
|
163
|
+
object.name ||
|
|
164
|
+
meta.placeholder || ['unnamed object threads label', { ns: THREAD_PLUGIN }];
|
|
202
165
|
|
|
203
|
-
const viewState = getViewState(
|
|
166
|
+
const viewState = getViewState(subjectId);
|
|
204
167
|
|
|
205
168
|
return {
|
|
206
169
|
id,
|
|
207
170
|
type: 'orphan-comments-for-subject',
|
|
208
|
-
data:
|
|
171
|
+
data: null,
|
|
209
172
|
properties: {
|
|
210
|
-
icon:
|
|
173
|
+
icon: 'ph--chat-text--regular',
|
|
211
174
|
label,
|
|
212
175
|
showResolvedThreads: viewState.showResolvedThreads,
|
|
176
|
+
object,
|
|
213
177
|
},
|
|
214
178
|
};
|
|
215
179
|
},
|
|
@@ -243,7 +207,7 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
243
207
|
menuItemType: 'toggle',
|
|
244
208
|
isChecked: viewState.showResolvedThreads,
|
|
245
209
|
testId: 'threadPlugin.toggleShowResolved',
|
|
246
|
-
|
|
210
|
+
icon: viewState.showResolvedThreads ? 'ph--eye-slash--regular' : 'ph--eye--regular',
|
|
247
211
|
},
|
|
248
212
|
},
|
|
249
213
|
];
|
|
@@ -275,8 +239,7 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
275
239
|
},
|
|
276
240
|
properties: {
|
|
277
241
|
label: ['create channel label', { ns: THREAD_PLUGIN }],
|
|
278
|
-
icon:
|
|
279
|
-
iconSymbol: 'ph--chat--regular',
|
|
242
|
+
icon: 'ph--chat--regular',
|
|
280
243
|
testId: 'threadPlugin.createObject',
|
|
281
244
|
},
|
|
282
245
|
},
|
|
@@ -342,7 +305,6 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
342
305
|
subject={data.subject}
|
|
343
306
|
stagedThreads={state.staging[fullyQualifiedId(data.subject)]}
|
|
344
307
|
current={state.current}
|
|
345
|
-
focus
|
|
346
308
|
showResolvedThreads={showResolvedThreads}
|
|
347
309
|
/>
|
|
348
310
|
);
|
|
@@ -384,17 +346,9 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
384
346
|
data: thread,
|
|
385
347
|
intents: [
|
|
386
348
|
[
|
|
387
|
-
{
|
|
388
|
-
action: NavigationAction.OPEN,
|
|
389
|
-
data: {
|
|
390
|
-
activeParts: {
|
|
391
|
-
complementary: `${subjectId}${SLUG_PATH_SEPARATOR}comments${SLUG_COLLECTION_INDICATOR}`,
|
|
392
|
-
},
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
349
|
{
|
|
396
350
|
action: ThreadAction.SELECT,
|
|
397
|
-
data: { current: fullyQualifiedId(thread)
|
|
351
|
+
data: { current: fullyQualifiedId(thread) },
|
|
398
352
|
},
|
|
399
353
|
{
|
|
400
354
|
action: LayoutAction.SET_LAYOUT,
|
|
@@ -414,7 +368,6 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
414
368
|
}
|
|
415
369
|
|
|
416
370
|
case ThreadAction.SELECT: {
|
|
417
|
-
state.focus = intent.data?.current === state.current ? state.focus : intent.data?.focus;
|
|
418
371
|
state.current = intent.data?.current;
|
|
419
372
|
return { data: true };
|
|
420
373
|
}
|
|
@@ -663,7 +616,7 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
663
616
|
},
|
|
664
617
|
}),
|
|
665
618
|
createExternalCommentSync(
|
|
666
|
-
doc
|
|
619
|
+
fullyQualifiedId(doc),
|
|
667
620
|
(sink) => effect(() => sink()),
|
|
668
621
|
() =>
|
|
669
622
|
threads.value
|
|
@@ -671,7 +624,7 @@ export const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {
|
|
|
671
624
|
.map((thread) => ({ id: fullyQualifiedId(thread), cursor: thread.anchor! })),
|
|
672
625
|
),
|
|
673
626
|
comments({
|
|
674
|
-
id: doc
|
|
627
|
+
id: fullyQualifiedId(doc),
|
|
675
628
|
onCreate: ({ cursor }) => {
|
|
676
629
|
const [start, end] = cursor.split(':');
|
|
677
630
|
const name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Chat } from '@phosphor-icons/react';
|
|
6
5
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
6
|
|
|
8
7
|
import { create } from '@dxos/echo-schema';
|
|
9
8
|
import { MessageType } from '@dxos/plugin-space/types';
|
|
10
9
|
import { fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
11
10
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
|
-
import { ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
13
|
-
import { PlankHeading
|
|
11
|
+
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { PlankHeading } from '@dxos/react-ui-deck';
|
|
14
13
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
15
14
|
import { mx } from '@dxos/react-ui-theme';
|
|
16
15
|
import { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, threadLayout } from '@dxos/react-ui-thread';
|
|
@@ -28,7 +27,7 @@ export const ChatHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
|
28
27
|
return (
|
|
29
28
|
<div role='none' className='flex items-center'>
|
|
30
29
|
<PlankHeading.Button attendableId={attendableId}>
|
|
31
|
-
<
|
|
30
|
+
<Icon icon='ph--chat--regular' size={5} />
|
|
32
31
|
</PlankHeading.Button>
|
|
33
32
|
<PlankHeading.Label attendableId={attendableId}>{t('chat heading')}</PlankHeading.Label>
|
|
34
33
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { CheckCircle, X } from '@phosphor-icons/react';
|
|
6
|
-
import React, { useCallback,
|
|
6
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { create } from '@dxos/echo-schema';
|
|
9
9
|
import { MessageType } from '@dxos/plugin-space/types';
|
|
@@ -93,7 +93,6 @@ export const CommentContainer = ({
|
|
|
93
93
|
detached,
|
|
94
94
|
context,
|
|
95
95
|
current,
|
|
96
|
-
autoFocusTextbox,
|
|
97
96
|
onAttend,
|
|
98
97
|
onThreadDelete,
|
|
99
98
|
onMessageDelete,
|
|
@@ -106,7 +105,6 @@ export const CommentContainer = ({
|
|
|
106
105
|
const activity = useStatus(space, fullyQualifiedId(thread));
|
|
107
106
|
const { t } = useTranslation(THREAD_PLUGIN);
|
|
108
107
|
const threadScrollRef = useRef<HTMLDivElement | null>(null);
|
|
109
|
-
const [autoFocus, setAutoFocus] = useState(!!autoFocusTextbox);
|
|
110
108
|
const { themeMode } = useThemeContext();
|
|
111
109
|
|
|
112
110
|
const textboxMetadata = getMessageMetadata(fullyQualifiedId(thread), identity);
|
|
@@ -124,13 +122,6 @@ export const CommentContainer = ({
|
|
|
124
122
|
[_count],
|
|
125
123
|
);
|
|
126
124
|
|
|
127
|
-
// TODO(thure): Because of the way the `autoFocus` property is handled by TextEditor,
|
|
128
|
-
// this is the least-bad way of moving focus at the right time, though it is an anti-pattern.
|
|
129
|
-
// Refactor to behave more like <input/>’s `autoFocus` or `autofocus` (yes, they’re different).
|
|
130
|
-
useEffect(() => {
|
|
131
|
-
setAutoFocus(!!autoFocusTextbox);
|
|
132
|
-
}, [autoFocusTextbox]);
|
|
133
|
-
|
|
134
125
|
// TODO(thure): Factor out.
|
|
135
126
|
const scrollToEnd = (behavior: ScrollBehavior) =>
|
|
136
127
|
setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);
|
|
@@ -151,7 +142,6 @@ export const CommentContainer = ({
|
|
|
151
142
|
onComment?.(thread);
|
|
152
143
|
|
|
153
144
|
messageRef.current = '';
|
|
154
|
-
setAutoFocus(true);
|
|
155
145
|
scrollToEnd('instant');
|
|
156
146
|
rerenderEditor();
|
|
157
147
|
|
|
@@ -200,7 +190,13 @@ export const CommentContainer = ({
|
|
|
200
190
|
onDelete={(id: string) => onMessageDelete?.(id)}
|
|
201
191
|
/>
|
|
202
192
|
))}
|
|
203
|
-
|
|
193
|
+
{/*
|
|
194
|
+
TODO(wittjosiah): Can't autofocus this generally.
|
|
195
|
+
There can be multiple threads with inputs and they can't all be focused.
|
|
196
|
+
Also, it steals focus from documents when first rendered.
|
|
197
|
+
Need to find a way to autofocus in one scenario only: when a new thread is created.
|
|
198
|
+
*/}
|
|
199
|
+
<MessageTextbox extensions={extensions} onSend={handleCreate} {...textboxMetadata} />
|
|
204
200
|
<ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>
|
|
205
201
|
{/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}
|
|
206
202
|
<div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ChatText
|
|
5
|
+
import { ChatText } from '@phosphor-icons/react';
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type ThreadType } from '@dxos/plugin-space/types';
|
|
9
9
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
10
10
|
import { useTranslation, Trans } from '@dxos/react-ui';
|
|
11
|
-
import { PlankHeading, plankHeadingIconProps } from '@dxos/react-ui-deck';
|
|
12
11
|
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
13
12
|
|
|
14
13
|
import { CommentContainer } from './CommentContainer';
|
|
@@ -25,7 +24,6 @@ export type ThreadsContainerProps = Omit<
|
|
|
25
24
|
*/
|
|
26
25
|
detached?: string[];
|
|
27
26
|
currentId?: string;
|
|
28
|
-
autoFocusCurrentTextbox?: boolean;
|
|
29
27
|
showResolvedThreads?: boolean;
|
|
30
28
|
onThreadAttend?: (thread: ThreadType) => void;
|
|
31
29
|
onThreadDelete?: (thread: ThreadType) => void;
|
|
@@ -34,19 +32,6 @@ export type ThreadsContainerProps = Omit<
|
|
|
34
32
|
onComment?: (thread: ThreadType) => void;
|
|
35
33
|
};
|
|
36
34
|
|
|
37
|
-
export const CommentsHeading = ({ attendableId }: { attendableId?: string }) => {
|
|
38
|
-
const { t } = useTranslation(THREAD_PLUGIN);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div role='none' className='flex items-center'>
|
|
42
|
-
<PlankHeading.Button attendableId={attendableId}>
|
|
43
|
-
<Quotes {...plankHeadingIconProps} />
|
|
44
|
-
</PlankHeading.Button>
|
|
45
|
-
<PlankHeading.Label attendableId={attendableId}>{t('comments heading')}</PlankHeading.Label>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
35
|
/**
|
|
51
36
|
* Comment threads.
|
|
52
37
|
*/
|
|
@@ -54,7 +39,6 @@ export const CommentsContainer = ({
|
|
|
54
39
|
threads,
|
|
55
40
|
detached = [],
|
|
56
41
|
currentId,
|
|
57
|
-
autoFocusCurrentTextbox,
|
|
58
42
|
showResolvedThreads,
|
|
59
43
|
onThreadAttend,
|
|
60
44
|
onThreadDelete,
|
|
@@ -82,7 +66,6 @@ export const CommentsContainer = ({
|
|
|
82
66
|
thread={thread}
|
|
83
67
|
current={currentId === threadId}
|
|
84
68
|
detached={detached.includes(threadId)}
|
|
85
|
-
autoFocusTextbox={autoFocusCurrentTextbox && currentId === threadId}
|
|
86
69
|
{...(onThreadAttend && { onAttend: () => onThreadAttend(thread) })}
|
|
87
70
|
{...(onThreadDelete && { onThreadDelete: () => onThreadDelete(thread) })}
|
|
88
71
|
{...(onMessageDelete && { onMessageDelete: (messageId: string) => onMessageDelete(thread, messageId) })}
|
|
@@ -8,10 +8,10 @@ import { LayoutAction, type Plugin, useIntentDispatcher, useResolvePlugins } fro
|
|
|
8
8
|
import { type ThreadType } from '@dxos/plugin-space';
|
|
9
9
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
10
10
|
import { ScrollArea } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
11
|
+
import { useAttended } from '@dxos/react-ui-attention';
|
|
12
12
|
import { nonNullable } from '@dxos/util';
|
|
13
13
|
|
|
14
|
-
import { CommentsContainer
|
|
14
|
+
import { CommentsContainer } from '../components';
|
|
15
15
|
import { THREAD_PLUGIN } from '../meta';
|
|
16
16
|
import { ThreadAction, type ThreadProvides } from '../types';
|
|
17
17
|
|
|
@@ -23,14 +23,12 @@ export const ThreadComplementary = ({
|
|
|
23
23
|
subject,
|
|
24
24
|
stagedThreads,
|
|
25
25
|
current,
|
|
26
|
-
focus,
|
|
27
26
|
showResolvedThreads,
|
|
28
27
|
}: {
|
|
29
28
|
role: string;
|
|
30
29
|
subject: any;
|
|
31
30
|
stagedThreads: ThreadType[] | undefined;
|
|
32
31
|
current?: string;
|
|
33
|
-
focus?: boolean;
|
|
34
32
|
showResolvedThreads?: boolean;
|
|
35
33
|
}) => {
|
|
36
34
|
const dispatch = useIntentDispatcher();
|
|
@@ -58,22 +56,17 @@ export const ThreadComplementary = ({
|
|
|
58
56
|
threads.sort((a, b) => sort(a?.anchor, b?.anchor));
|
|
59
57
|
}, [sort, threads]);
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
const { attended } = useAttentionContext('Thread Complementary');
|
|
59
|
+
const attended = useAttended();
|
|
63
60
|
const qualifiedSubjectId = fullyQualifiedId(subject);
|
|
64
61
|
|
|
65
|
-
const attendableAttrs = createAttendableAttributes(qualifiedSubjectId);
|
|
66
|
-
|
|
67
62
|
return (
|
|
68
|
-
<div role='none' className='contents
|
|
69
|
-
{role === 'complementary' && <CommentsHeading attendableId={qualifiedSubjectId} />}
|
|
63
|
+
<div role='none' className='contents'>
|
|
70
64
|
<ScrollArea.Root classNames='row-span-2'>
|
|
71
65
|
<ScrollArea.Viewport>
|
|
72
66
|
<CommentsContainer
|
|
73
67
|
threads={threads}
|
|
74
68
|
detached={detachedIds}
|
|
75
|
-
currentId={attended.
|
|
76
|
-
autoFocusCurrentTextbox={focus}
|
|
69
|
+
currentId={attended.includes(qualifiedSubjectId) ? current : undefined}
|
|
77
70
|
showResolvedThreads={showResolvedThreads}
|
|
78
71
|
onThreadAttend={(thread) => {
|
|
79
72
|
const threadId = fullyQualifiedId(thread);
|
package/src/meta.tsx
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Chat, type IconProps } from '@phosphor-icons/react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
5
|
import { pluginMeta } from '@dxos/app-framework';
|
|
9
6
|
|
|
10
7
|
export const THREAD_PLUGIN = 'dxos.org/plugin/thread';
|
|
@@ -15,6 +12,5 @@ export default pluginMeta({
|
|
|
15
12
|
name: 'Threads',
|
|
16
13
|
// TODO(wittjosiah): Update once scope of threads expands.
|
|
17
14
|
description: 'Comment threads on documents.',
|
|
18
|
-
|
|
19
|
-
iconSymbol: 'ph--chat--regular',
|
|
15
|
+
icon: 'ph--chat--regular',
|
|
20
16
|
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Chat, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { pluginMeta } from '@dxos/app-framework';\n\nexport const THREAD_PLUGIN = 'dxos.org/plugin/thread';\nexport const THREAD_ITEM = `${THREAD_PLUGIN}/item`;\n\nexport default pluginMeta({\n id: THREAD_PLUGIN,\n name: 'Threads',\n // TODO(wittjosiah): Update once scope of threads expands.\n description: 'Comment threads on documents.',\n iconComponent: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,YAA4B;AACrC,OAAOC,WAAW;AAElB,SAASC,kBAAkB;AAEpB,IAAMC,gBAAgB;AACtB,IAAMC,cAAc,GAAGD,aAAAA;AAE9B,IAAA,eAAeE,WAAW;EACxBC,IAAIH;EACJI,MAAM;;EAENC,aAAa;EACbC,eAAe,CAACC,UAAqB,sBAAA,cAACC,MAASD,KAAAA;EAC/CE,YAAY;AACd,CAAA;",
|
|
6
|
-
"names": ["Chat", "React", "pluginMeta", "THREAD_PLUGIN", "THREAD_ITEM", "pluginMeta", "id", "name", "description", "iconComponent", "props", "Chat", "iconSymbol"]
|
|
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 { useIntentDispatcher } from '@dxos/app-framework';\nimport { type ReactiveObject } from '@dxos/echo-schema';\nimport { ObservabilityAction } from '@dxos/plugin-observability/meta';\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 dispatch = useIntentDispatcher();\n\n return useCallback(\n (dynamicMeta?: any) => {\n void dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name,\n properties: { ...meta, ...dynamicMeta, spaceId },\n },\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 { Chat } from '@phosphor-icons/react';\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { create } from '@dxos/echo-schema';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { PlankHeading, plankHeadingIconProps } from '@dxos/react-ui-deck';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\nimport { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, threadLayout } from '@dxos/react-ui-thread';\nimport { nonNullable } from '@dxos/util';\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 <PlankHeading.Button attendableId={attendableId}>\n <Chat {...plankHeadingIconProps} />\n </PlankHeading.Button>\n <PlankHeading.Label attendableId={attendableId}>{t('chat heading')}</PlankHeading.Label>\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 create(MessageType, {\n sender: { identityKey: identity.identityKey.toHex() },\n timestamp: new Date().toISOString(),\n text: messageRef.current,\n context,\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.filter(nonNullable).findIndex((message) => message.id === 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 {thread.messages.filter(nonNullable).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 { type Expando, type EchoReactiveObject } from '@dxos/echo-schema';\nimport { type MessageType } from '@dxos/plugin-space/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type SpaceMember } from '@dxos/react-client/echo';\nimport { useIdentity, type Identity } from '@dxos/react-client/halo';\nimport {\n Button,\n ButtonGroup,\n DensityProvider,\n Tooltip,\n useOnTransition,\n useThemeContext,\n useTranslation,\n} 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';\nimport { nonNullable } from '@dxos/util';\n\nimport { command } from './command-extension';\nimport { useOnEditAnalytics } from '../hooks';\nimport { THREAD_ITEM, THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nconst messageControlClassNames = ['p-1 min-bs-0 transition-opacity items-start', 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 classNames='z-[21]'>\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 classNames='z-[21]'>\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 {message.parts?.filter(nonNullable).map((part, index) => <MessagePart key={index} part={part} />)}\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<EchoReactiveObject<any>> = forwardRef(\n ({ draggableStyle, draggableProps, item, active, ...props }, forwardedRef) => {\n let title = item.name ?? item.title ?? item.__typename ?? '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 <DensityProvider density='fine'>\n <Surface\n role='card'\n limit={1}\n data={{ content: item }}\n draggableProps={draggableProps}\n fallback={title}\n {...props}\n />\n </DensityProvider>\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,KAAK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C2E,WAAWC,MAAI;IAACF,YAAW;KAC1B,gBAAA1E,OAAA,cAAC2E,WAAWE,UAAQ;IAACH,YAAW;KAC9B,gBAAA1E,OAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAW2E,IAAGC,cAAc,gBAAA;KAC1CrE,OAAO6C,SAASa,OAAOC,YAAAA,EAAaW,IAAI,CAACT,YACxC,gBAAAvE,OAAA,cAACiF,kBAAAA;IAAiB7D,KAAKmD,QAAQL;IAAIK;IAAkBrD;IAAkBgE,UAAUjB;QAIrF,gBAAAjE,OAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;IAAgBgF,KAAKpD;MAChD,gBAAA/B,OAAA,cAAC2E,WAAWS,WAAS,MACnB,gBAAApF,OAAA,cAAC2E,WAAWU,OAAK,IAAA,CAAA,CAAA,CAAA,GAIvB,gBAAArF,OAAA,cAACsF,gBAAAA;IAAehD;IAAwBT;IAAsB0D,QAAQlC;IAAe,GAAGlB;MACxF,gBAAAnC,OAAA,cAACwF,cAAAA;IAAanE;KAAqBxB,EAAE,kBAAA,CAAA,CAAA;AAG3C;",
|
|
6
|
-
"names": ["useEffect", "useState", "useStatus", "space", "channel", "processing", "setProcessing", "useState", "useEffect", "unsubscribe", "listen", "status", "event", "payload", "t", "setInterval", "prev", "ts", "Date", "now", "undefined", "clearInterval", "useCallback", "useIntentDispatcher", "ObservabilityAction", "getSpace", "useOnTransition", "useAnalyticsCallback", "spaceId", "name", "meta", "dispatch", "useIntentDispatcher", "useCallback", "dynamicMeta", "action", "ObservabilityAction", "SEND_EVENT", "data", "properties", "useOnEditAnalytics", "message", "editing", "space", "getSpace", "onEditAnalytics", "id", "messageId", "messageLength", "text", "length", "useOnTransition", "Chat", "React", "useLayoutEffect", "useMemo", "useRef", "useState", "create", "MessageType", "fullyQualifiedId", "getSpace", "useMembers", "useIdentity", "ScrollArea", "useThemeContext", "useTranslation", "PlankHeading", "plankHeadingIconProps", "createBasicExtensions", "createThemeExtensions", "listener", "mx", "MessageTextbox", "Thread", "ThreadFooter", "threadLayout", "nonNullable", "EditorView", "Check", "PencilSimple", "X", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "Surface", "PublicKey", "useIdentity", "Button", "ButtonGroup", "DensityProvider", "Tooltip", "useOnTransition", "useThemeContext", "useTranslation", "createBasicExtensions", "createThemeExtensions", "useTextEditor", "Mosaic", "getSize", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "MessageHeading", "MessageRoot", "nonNullable", "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", "parts", "filter", "nonNullable", "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", "props", "forwardedRef", "title", "name", "__typename", "content", "mx", "style", "DensityProvider", "density", "Surface", "limit", "data", "fallback", "ChatHeading", "attendableId", "t", "useTranslation", "THREAD_PLUGIN", "React", "div", "role", "className", "PlankHeading", "Button", "Chat", "plankHeadingIconProps", "Label", "ChatContainer", "thread", "context", "current", "autoFocusTextbox", "identity", "useIdentity", "space", "getSpace", "members", "useMembers", "key", "activity", "useStatus", "fullyQualifiedId", "_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", "create", "MessageType", "sender", "identityKey", "toHex", "timestamp", "Date", "toISOString", "handleDelete", "id", "messageIndex", "filter", "nonNullable", "findIndex", "message", "splice", "Thread", "classNames", "ScrollArea", "Root", "Viewport", "mx", "threadLayout", "map", "MessageContainer", "onDelete", "ref", "Scrollbar", "Thumb", "MessageTextbox", "onSend", "ThreadFooter"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Chat, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { pluginMeta } from '@dxos/app-framework';\n\nexport const THREAD_PLUGIN = 'dxos.org/plugin/thread';\nexport const THREAD_ITEM = `${THREAD_PLUGIN}/item`;\n\nexport default pluginMeta({\n id: THREAD_PLUGIN,\n name: 'Threads',\n // TODO(wittjosiah): Update once scope of threads expands.\n description: 'Comment threads on documents.',\n iconComponent: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n});\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqC;AACrC,IAAAA,gBAAkB;AAElB,2BAA2B;AAEpB,IAAMC,gBAAgB;AACtB,IAAMC,cAAc,GAAGD,aAAAA;AAE9B,IAAA,mBAAeE,iCAAW;EACxBC,IAAIH;EACJI,MAAM;;EAENC,aAAa;EACbC,eAAe,CAACC,UAAqB,8BAAAC,QAAA,cAACC,mBAASF,KAAAA;EAC/CG,YAAY;AACd,CAAA;",
|
|
6
|
-
"names": ["import_react", "THREAD_PLUGIN", "THREAD_ITEM", "pluginMeta", "id", "name", "description", "iconComponent", "props", "React", "Chat", "iconSymbol"]
|
|
7
|
-
}
|