@dxos/plugin-thread 0.7.5-labs.5f04cf6 → 0.7.5-labs.8a82073
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-4VLBSBI7.mjs → ThreadContainer-T4WIBHY6.mjs} +2 -2
- package/dist/lib/browser/{app-graph-builder-Q7A2ZRUA.mjs → app-graph-builder-IANFWFYN.mjs} +1 -1
- package/dist/lib/browser/{app-graph-builder-Q7A2ZRUA.mjs.map → app-graph-builder-IANFWFYN.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-GQONSZ3J.mjs → chunk-5EQVG4L3.mjs} +4 -6
- package/dist/lib/browser/chunk-5EQVG4L3.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2B3EXYZ7.mjs → chunk-L4QHQNDC.mjs} +4 -4
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-QFP6L3AF.mjs +287 -0
- package/dist/lib/browser/intent-resolver-QFP6L3AF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-CHCZO4TI.mjs → react-surface-LDPZN456.mjs} +44 -32
- package/dist/lib/browser/react-surface-LDPZN456.mjs.map +7 -0
- package/dist/lib/node/{ThreadContainer-VOYLV4UL.cjs → ThreadContainer-4XACAVGV.cjs} +6 -6
- package/dist/lib/node/{app-graph-builder-ZXW5KUDK.cjs → app-graph-builder-LFEDPJLK.cjs} +4 -4
- package/dist/lib/node/{app-graph-builder-ZXW5KUDK.cjs.map → app-graph-builder-LFEDPJLK.cjs.map} +2 -2
- package/dist/lib/node/{chunk-ZRN7B26W.cjs → chunk-346YIZVL.cjs} +7 -7
- package/dist/lib/node/{chunk-6PUGKCPR.cjs → chunk-VAZ3BCTU.cjs} +6 -8
- package/dist/lib/node/chunk-VAZ3BCTU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +10 -10
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-ZSOQILPJ.cjs +299 -0
- package/dist/lib/node/intent-resolver-ZSOQILPJ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-LO7S2HPR.cjs → react-surface-MCQUT7BC.cjs} +47 -35
- package/dist/lib/node/react-surface-MCQUT7BC.cjs.map +7 -0
- package/dist/lib/node-esm/{ThreadContainer-7DZY2MWA.mjs → ThreadContainer-FGFB25TQ.mjs} +2 -2
- package/dist/lib/node-esm/{app-graph-builder-ATS6HGE6.mjs → app-graph-builder-IXHFRMCY.mjs} +1 -1
- package/dist/lib/node-esm/{app-graph-builder-ATS6HGE6.mjs.map → app-graph-builder-IXHFRMCY.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-GS2OILYF.mjs → chunk-3INUK3A6.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-DYFIKKDT.mjs → chunk-DKCH2H5C.mjs} +4 -6
- package/dist/lib/node-esm/chunk-DKCH2H5C.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-MHP4C2NZ.mjs +288 -0
- package/dist/lib/node-esm/intent-resolver-MHP4C2NZ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-LAF3QIPB.mjs → react-surface-6JMVZUDM.mjs} +44 -32
- package/dist/lib/node-esm/react-surface-6JMVZUDM.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +30 -30
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/command-extension.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -30
- package/src/ThreadPlugin.tsx +3 -4
- package/src/capabilities/app-graph-builder.ts +0 -1
- package/src/capabilities/intent-resolver.ts +180 -164
- package/src/capabilities/react-surface.tsx +19 -18
- package/src/components/ChatContainer.tsx +2 -2
- package/src/components/ThreadComplementary.tsx +7 -4
- package/src/components/ThreadSettings.tsx +3 -3
- package/src/components/command-extension.ts +2 -5
- package/dist/lib/browser/chunk-GQONSZ3J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-PIEZ3LKQ.mjs +0 -275
- package/dist/lib/browser/intent-resolver-PIEZ3LKQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-CHCZO4TI.mjs.map +0 -7
- package/dist/lib/node/chunk-6PUGKCPR.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-X5O3SVLF.cjs +0 -287
- package/dist/lib/node/intent-resolver-X5O3SVLF.cjs.map +0 -7
- package/dist/lib/node/react-surface-LO7S2HPR.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DYFIKKDT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-XJWT5X6T.mjs +0 -276
- package/dist/lib/node-esm/intent-resolver-XJWT5X6T.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-LAF3QIPB.mjs.map +0 -7
- /package/dist/lib/browser/{ThreadContainer-4VLBSBI7.mjs.map → ThreadContainer-T4WIBHY6.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-2B3EXYZ7.mjs.map → chunk-L4QHQNDC.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadContainer-VOYLV4UL.cjs.map → ThreadContainer-4XACAVGV.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-ZRN7B26W.cjs.map → chunk-346YIZVL.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ThreadContainer-7DZY2MWA.mjs.map → ThreadContainer-FGFB25TQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-GS2OILYF.mjs.map → chunk-3INUK3A6.mjs.map} +0 -0
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
createIntent,
|
|
9
9
|
createResolver,
|
|
10
10
|
LayoutAction,
|
|
11
|
-
NavigationAction,
|
|
12
11
|
type PluginsContext,
|
|
13
12
|
} from '@dxos/app-framework';
|
|
14
13
|
import { Ref } from '@dxos/echo-schema';
|
|
@@ -23,201 +22,218 @@ import { ThreadAction } from '../types';
|
|
|
23
22
|
|
|
24
23
|
export default (context: PluginsContext) =>
|
|
25
24
|
contributes(Capabilities.IntentResolver, [
|
|
26
|
-
createResolver(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
createResolver({
|
|
26
|
+
intent: ThreadAction.Create,
|
|
27
|
+
resolve: ({ name, cursor, subject }) => {
|
|
28
|
+
if (cursor && subject) {
|
|
29
|
+
// Seed the threads array if it does not exist.
|
|
30
|
+
if (subject?.threads === undefined) {
|
|
31
|
+
try {
|
|
32
|
+
// Static schema will throw an error if subject does not support threads array property.
|
|
33
|
+
subject.threads = [];
|
|
34
|
+
} catch (err) {
|
|
35
|
+
log.error('Subject does not support threads array', { typename: subject?.typename });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
|
-
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
41
|
+
const subjectId = fullyQualifiedId(subject);
|
|
42
|
+
const thread = create(ThreadType, { name, anchor: cursor, messages: [], status: 'staged' });
|
|
43
|
+
const draft = state.drafts[subjectId];
|
|
44
|
+
if (draft) {
|
|
45
|
+
draft.push(thread);
|
|
46
|
+
} else {
|
|
47
|
+
state.drafts[subjectId] = [thread];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
data: { object: thread },
|
|
52
|
+
intents: [
|
|
53
|
+
createIntent(ThreadAction.Select, { current: fullyQualifiedId(thread) }),
|
|
54
|
+
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', subject: 'comments' }),
|
|
55
|
+
],
|
|
56
|
+
};
|
|
45
57
|
} else {
|
|
46
|
-
|
|
58
|
+
// NOTE: This is the standalone thread creation case.
|
|
59
|
+
return {
|
|
60
|
+
data: { object: create(ChannelType, { threads: [makeRef(create(ThreadType, { messages: [] }))] }) },
|
|
61
|
+
};
|
|
47
62
|
}
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
createResolver({
|
|
66
|
+
intent: ThreadAction.Select,
|
|
67
|
+
resolve: ({ current, skipOpen }) => {
|
|
68
|
+
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
69
|
+
state.current = current;
|
|
48
70
|
|
|
49
71
|
return {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
createIntent(NavigationAction.Open, { activeParts: { complementary: 'comments' } }),
|
|
54
|
-
createIntent(LayoutAction.SetLayout, { element: 'complementary', state: true }),
|
|
55
|
-
],
|
|
56
|
-
};
|
|
57
|
-
} else {
|
|
58
|
-
// NOTE: This is the standalone thread creation case.
|
|
59
|
-
return {
|
|
60
|
-
data: { object: create(ChannelType, { threads: [makeRef(create(ThreadType, { messages: [] }))] }) },
|
|
72
|
+
intents: !skipOpen
|
|
73
|
+
? [createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', subject: 'comments' })]
|
|
74
|
+
: undefined,
|
|
61
75
|
};
|
|
62
|
-
}
|
|
63
|
-
}),
|
|
64
|
-
createResolver(ThreadAction.Select, ({ current, skipOpen }) => {
|
|
65
|
-
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
66
|
-
state.current = current;
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
intents: !skipOpen
|
|
70
|
-
? [createIntent(NavigationAction.Open, { activeParts: { complementary: 'comments' } })]
|
|
71
|
-
: undefined,
|
|
72
|
-
};
|
|
73
|
-
}),
|
|
74
|
-
createResolver(ThreadAction.ToggleResolved, ({ thread }) => {
|
|
75
|
-
if (thread.status === 'active' || thread.status === undefined) {
|
|
76
|
-
thread.status = 'resolved';
|
|
77
|
-
} else if (thread.status === 'resolved') {
|
|
78
|
-
thread.status = 'active';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const space = getSpace(thread);
|
|
82
|
-
const spaceId = space?.id;
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
intents: [
|
|
86
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
87
|
-
name: 'threads.toggle-resolved',
|
|
88
|
-
properties: { threadId: thread.id, spaceId },
|
|
89
|
-
}),
|
|
90
|
-
],
|
|
91
|
-
};
|
|
76
|
+
},
|
|
92
77
|
}),
|
|
93
|
-
createResolver(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (index !== -1) {
|
|
101
|
-
draft.splice(index, 1);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const space = getSpace(thread);
|
|
107
|
-
if (!space || !subject.threads) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!undo) {
|
|
112
|
-
const index = subject.threads.findIndex((t: any) => t?.id === thread.id);
|
|
113
|
-
const cursor = subject.threads[index]?.anchor;
|
|
114
|
-
if (index !== -1) {
|
|
115
|
-
subject.threads?.splice(index, 1);
|
|
78
|
+
createResolver({
|
|
79
|
+
intent: ThreadAction.ToggleResolved,
|
|
80
|
+
resolve: ({ thread }) => {
|
|
81
|
+
if (thread.status === 'active' || thread.status === undefined) {
|
|
82
|
+
thread.status = 'resolved';
|
|
83
|
+
} else if (thread.status === 'resolved') {
|
|
84
|
+
thread.status = 'active';
|
|
116
85
|
}
|
|
117
86
|
|
|
118
|
-
space
|
|
87
|
+
const space = getSpace(thread);
|
|
88
|
+
const spaceId = space?.id;
|
|
119
89
|
|
|
120
90
|
return {
|
|
121
|
-
undoable: {
|
|
122
|
-
message: ['thread deleted label', { ns: THREAD_PLUGIN }],
|
|
123
|
-
data: { cursor },
|
|
124
|
-
},
|
|
125
91
|
intents: [
|
|
126
92
|
createIntent(ObservabilityAction.SendEvent, {
|
|
127
|
-
name: 'threads.
|
|
128
|
-
properties: { threadId: thread.id, spaceId
|
|
93
|
+
name: 'threads.toggle-resolved',
|
|
94
|
+
properties: { threadId: thread.id, spaceId },
|
|
129
95
|
}),
|
|
130
96
|
],
|
|
131
97
|
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
createResolver({
|
|
101
|
+
intent: ThreadAction.Delete,
|
|
102
|
+
resolve: ({ subject, thread }, undo) => {
|
|
103
|
+
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
104
|
+
const subjectId = fullyQualifiedId(subject);
|
|
105
|
+
const draft = state.drafts[subjectId];
|
|
106
|
+
if (draft) {
|
|
107
|
+
// Check if we're deleting a draft; if so, remove it.
|
|
108
|
+
const index = draft.findIndex((t) => t.id === thread.id);
|
|
109
|
+
if (index !== -1) {
|
|
110
|
+
draft.splice(index, 1);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
136
114
|
|
|
137
|
-
|
|
138
|
-
|
|
115
|
+
const space = getSpace(thread);
|
|
116
|
+
if (!space || !subject.threads) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!undo) {
|
|
121
|
+
const index = subject.threads.findIndex((t: any) => t?.id === thread.id);
|
|
122
|
+
const cursor = subject.threads[index]?.anchor;
|
|
123
|
+
if (index !== -1) {
|
|
124
|
+
subject.threads?.splice(index, 1);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
space.db.remove(thread);
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
undoable: {
|
|
131
|
+
message: ['thread deleted label', { ns: THREAD_PLUGIN }],
|
|
132
|
+
data: { cursor },
|
|
133
|
+
},
|
|
134
|
+
intents: [
|
|
135
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
136
|
+
name: 'threads.delete',
|
|
137
|
+
properties: { threadId: thread.id, spaceId: space.id },
|
|
138
|
+
}),
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
} else {
|
|
142
|
+
// TODO(wittjosiah): SDK should do this automatically.
|
|
143
|
+
const savedThread = space.db.add(thread);
|
|
144
|
+
subject.threads.push(savedThread);
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
intents: [
|
|
148
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
149
|
+
name: 'threads.undo-delete',
|
|
150
|
+
properties: { threadId: thread.id, spaceId: space.id },
|
|
151
|
+
}),
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
createResolver({
|
|
158
|
+
intent: ThreadAction.OnMessageAdd,
|
|
159
|
+
resolve: ({ thread, subject }) => {
|
|
160
|
+
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
161
|
+
const subjectId = fullyQualifiedId(subject);
|
|
162
|
+
const space = getSpace(subject);
|
|
163
|
+
const intents = [];
|
|
164
|
+
const analyticsProperties = { threadId: thread.id, spaceId: space?.id };
|
|
165
|
+
|
|
166
|
+
if (state.drafts[subjectId]?.find((t) => t === thread)) {
|
|
167
|
+
// Move draft to document.
|
|
168
|
+
thread.status = 'active';
|
|
169
|
+
subject.threads ? subject.threads.push(makeRef(thread)) : (subject.threads = [makeRef(thread)]);
|
|
170
|
+
state.drafts[subjectId] = state.drafts[subjectId]?.filter(({ id }) => id !== thread.id);
|
|
171
|
+
intents.push(
|
|
139
172
|
createIntent(ObservabilityAction.SendEvent, {
|
|
140
|
-
name: 'threads.
|
|
141
|
-
properties:
|
|
173
|
+
name: 'threads.thread-created',
|
|
174
|
+
properties: analyticsProperties,
|
|
142
175
|
}),
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
}),
|
|
147
|
-
createResolver(ThreadAction.OnMessageAdd, ({ thread, subject }) => {
|
|
148
|
-
const { state } = context.requestCapability(ThreadCapabilities.MutableState);
|
|
149
|
-
const subjectId = fullyQualifiedId(subject);
|
|
150
|
-
const space = getSpace(subject);
|
|
151
|
-
const intents = [];
|
|
152
|
-
const analyticsProperties = { threadId: thread.id, spaceId: space?.id };
|
|
153
|
-
|
|
154
|
-
if (state.drafts[subjectId]?.find((t) => t === thread)) {
|
|
155
|
-
// Move draft to document.
|
|
156
|
-
thread.status = 'active';
|
|
157
|
-
subject.threads ? subject.threads.push(makeRef(thread)) : (subject.threads = [makeRef(thread)]);
|
|
158
|
-
state.drafts[subjectId] = state.drafts[subjectId]?.filter(({ id }) => id !== thread.id);
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
159
179
|
intents.push(
|
|
160
180
|
createIntent(ObservabilityAction.SendEvent, {
|
|
161
|
-
name: 'threads.
|
|
162
|
-
properties: analyticsProperties,
|
|
181
|
+
name: 'threads.message-added',
|
|
182
|
+
properties: { ...analyticsProperties, threadLength: thread.messages.length },
|
|
163
183
|
}),
|
|
164
184
|
);
|
|
165
|
-
}
|
|
166
185
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
name: 'threads.message-added',
|
|
170
|
-
properties: { ...analyticsProperties, threadLength: thread.messages.length },
|
|
171
|
-
}),
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
return { intents };
|
|
186
|
+
return { intents };
|
|
187
|
+
},
|
|
175
188
|
}),
|
|
176
|
-
createResolver(
|
|
177
|
-
|
|
189
|
+
createResolver({
|
|
190
|
+
intent: ThreadAction.DeleteMessage,
|
|
191
|
+
resolve: ({ subject, thread, messageId, message, messageIndex }, undo) => {
|
|
192
|
+
const space = getSpace(subject);
|
|
193
|
+
|
|
194
|
+
if (!undo) {
|
|
195
|
+
const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
|
|
196
|
+
const message = thread.messages[messageIndex]?.target;
|
|
197
|
+
if (!message) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
178
200
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
201
|
+
if (messageIndex === 0 && thread.messages.length === 1) {
|
|
202
|
+
// If the message is the only message in the thread, delete the thread.
|
|
203
|
+
return {
|
|
204
|
+
intents: [createIntent(ThreadAction.Delete, { subject, thread })],
|
|
205
|
+
};
|
|
206
|
+
} else {
|
|
207
|
+
thread.messages.splice(messageIndex, 1);
|
|
208
|
+
}
|
|
185
209
|
|
|
186
|
-
if (messageIndex === 0 && thread.messages.length === 1) {
|
|
187
|
-
// If the message is the only message in the thread, delete the thread.
|
|
188
210
|
return {
|
|
189
|
-
|
|
211
|
+
undoable: {
|
|
212
|
+
message: ['message deleted label', { ns: THREAD_PLUGIN }],
|
|
213
|
+
data: { message, messageIndex },
|
|
214
|
+
},
|
|
215
|
+
intents: [
|
|
216
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
217
|
+
name: 'threads.message.delete',
|
|
218
|
+
properties: { threadId: thread.id, spaceId: space?.id },
|
|
219
|
+
}),
|
|
220
|
+
],
|
|
190
221
|
};
|
|
191
222
|
} else {
|
|
192
|
-
|
|
193
|
-
|
|
223
|
+
if (!messageIndex || !message) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
194
226
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}),
|
|
205
|
-
],
|
|
206
|
-
};
|
|
207
|
-
} else {
|
|
208
|
-
if (!messageIndex || !message) {
|
|
209
|
-
return;
|
|
227
|
+
thread.messages.splice(messageIndex, 0, makeRef(message));
|
|
228
|
+
return {
|
|
229
|
+
intents: [
|
|
230
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
231
|
+
name: 'threads.message.undo-delete',
|
|
232
|
+
properties: { threadId: thread.id, spaceId: space?.id },
|
|
233
|
+
}),
|
|
234
|
+
],
|
|
235
|
+
};
|
|
210
236
|
}
|
|
211
|
-
|
|
212
|
-
thread.messages.splice(messageIndex, 0, makeRef(message));
|
|
213
|
-
return {
|
|
214
|
-
intents: [
|
|
215
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
216
|
-
name: 'threads.message.undo-delete',
|
|
217
|
-
properties: { threadId: thread.id, spaceId: space?.id },
|
|
218
|
-
}),
|
|
219
|
-
],
|
|
220
|
-
};
|
|
221
|
-
}
|
|
237
|
+
},
|
|
222
238
|
}),
|
|
223
239
|
]);
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createSurface,
|
|
7
|
+
import { Capabilities, contributes, createSurface, useLayout } from '@dxos/app-framework';
|
|
8
8
|
import { type Ref } from '@dxos/echo-schema';
|
|
9
|
+
import { SettingsStore } from '@dxos/local-storage';
|
|
10
|
+
import { log } from '@dxos/log';
|
|
9
11
|
import { ChannelType, type ThreadType } from '@dxos/plugin-space/types';
|
|
10
12
|
import { getSpace } from '@dxos/react-client/echo';
|
|
11
13
|
|
|
@@ -21,18 +23,19 @@ export default () =>
|
|
|
21
23
|
filter: (data): data is { subject: ChannelType } =>
|
|
22
24
|
data.subject instanceof ChannelType && !!data.subject.threads[0],
|
|
23
25
|
component: ({ data, role }) => {
|
|
24
|
-
const
|
|
26
|
+
const layout = useLayout();
|
|
25
27
|
const channel = data.subject;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
void channel.threads[0].load();
|
|
29
|
+
const thread = channel.threads[0].target;
|
|
30
|
+
if (!thread) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
log.info('thread', { thread });
|
|
34
|
+
const currentPosition = layout.active.findIndex((id) => id === channel.id);
|
|
35
|
+
if (currentPosition > 0) {
|
|
36
|
+
const objectToTheLeft = layout.active[currentPosition - 1];
|
|
37
|
+
const context = getSpace(channel)?.db.getObjectById(objectToTheLeft);
|
|
38
|
+
return <ThreadContainer role={role} thread={thread} context={context} />;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
return <ThreadContainer role={role} thread={thread} />;
|
|
@@ -51,11 +54,9 @@ export default () =>
|
|
|
51
54
|
}),
|
|
52
55
|
createSurface({
|
|
53
56
|
id: `${THREAD_PLUGIN}/settings`,
|
|
54
|
-
role: '
|
|
55
|
-
filter: (data): data is
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return <ThreadSettings settings={settings} />;
|
|
59
|
-
},
|
|
57
|
+
role: 'article',
|
|
58
|
+
filter: (data): data is { subject: SettingsStore<ThreadSettingsProps> } =>
|
|
59
|
+
data.subject instanceof SettingsStore && data.subject.prefix === THREAD_PLUGIN,
|
|
60
|
+
component: ({ data: { subject } }) => <ThreadSettings settings={subject.value} />,
|
|
60
61
|
}),
|
|
61
62
|
]);
|
|
@@ -7,7 +7,7 @@ import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
|
7
7
|
import { Ref } from '@dxos/echo-schema';
|
|
8
8
|
import { create, makeRef, RefArray } from '@dxos/live-object';
|
|
9
9
|
import { MessageType } from '@dxos/plugin-space/types';
|
|
10
|
-
import { fullyQualifiedId, getSpace, useMembers
|
|
10
|
+
import { fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
11
11
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
12
|
import { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';
|
|
@@ -82,7 +82,7 @@ export const ChatContainer = ({ thread, context, current, autoFocusTextbox }: Th
|
|
|
82
82
|
sender: { identityKey: identity.identityKey.toHex() },
|
|
83
83
|
timestamp: new Date().toISOString(),
|
|
84
84
|
text: messageRef.current,
|
|
85
|
-
context: makeRef(context
|
|
85
|
+
context: context ? makeRef(context) : undefined,
|
|
86
86
|
}),
|
|
87
87
|
),
|
|
88
88
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { createIntent, LayoutAction,
|
|
7
|
+
import { createIntent, LayoutAction, useCapability, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { ThreadCapabilities } from '@dxos/plugin-space';
|
|
9
9
|
import { MessageType, type ThreadType } from '@dxos/plugin-space/types';
|
|
10
10
|
import { create, fullyQualifiedId, makeRef, RefArray } from '@dxos/react-client/echo';
|
|
@@ -62,9 +62,12 @@ export const ThreadComplementary = ({ subject }: { subject: any }) => {
|
|
|
62
62
|
// This may be overloading this intent or highjacking its intended purpose.
|
|
63
63
|
void dispatch(
|
|
64
64
|
createIntent(LayoutAction.ScrollIntoView, {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
part: 'current',
|
|
66
|
+
subject: fullyQualifiedId(subject),
|
|
67
|
+
options: {
|
|
68
|
+
cursor: thread.anchor,
|
|
69
|
+
ref: threadId,
|
|
70
|
+
},
|
|
68
71
|
}),
|
|
69
72
|
);
|
|
70
73
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
8
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { THREAD_PLUGIN } from '../meta';
|
|
11
11
|
import type { ThreadSettingsProps } from '../types';
|
|
@@ -14,10 +14,10 @@ export const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps })
|
|
|
14
14
|
const { t } = useTranslation(THREAD_PLUGIN);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
|
|
17
|
+
<DeprecatedFormContainer>
|
|
18
18
|
<DeprecatedFormInput label={t('settings standalone label')}>
|
|
19
19
|
<Input.Switch checked={settings.standalone} onCheckedChange={(checked) => (settings.standalone = !!checked)} />
|
|
20
20
|
</DeprecatedFormInput>
|
|
21
|
-
|
|
21
|
+
</DeprecatedFormContainer>
|
|
22
22
|
);
|
|
23
23
|
};
|
|
@@ -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)];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ChatContainer.tsx", "../../../src/components/MessageContainer.tsx", "../../../src/components/command-extension.ts", "../../../src/util.ts"],
|
|
4
|
-
"sourcesContent": ["//\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": ";;;;;;;;;;AA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WE,UAAQ;IAACH,YAAW;KAC9B,gBAAAF,OAAA,cAACM,OAAAA;IAAIC,MAAK;IAAOC,WAAWC,IAAGC,cAAc,gBAAA;KAC1CC,UAASC,mBAAmB9E,OAAOgD,YAAY,CAAA,CAAE,EAAE+B,IAAI,CAACC,YACvD,gBAAAd,OAAA,cAACe,kBAAAA;IAAiBvE,KAAKsE,QAAQpB;IAAIoB;IAAkBxE;IAAkB0E,UAAUvB;QAIrF,gBAAAO,OAAA,cAACM,OAAAA;IAAIC,MAAK;IAAOC,WAAU;IAAgBS,KAAK3D;MAChD,gBAAA0C,OAAA,cAACG,WAAWe,WAAS,MACnB,gBAAAlB,OAAA,cAACG,WAAWgB,OAAK,IAAA,CAAA,CAAA,CAAA,GAIvB,gBAAAnB,OAAA,cAACoB,gBAAAA;IAAevD;IAAwBT;IAAsBiE,QAAQzC;IAAe,GAAGlB;MACxF,gBAAAsC,OAAA,cAACsB,cAAAA;IAAa7E;KAAqBG,EAAE,kBAAA,CAAA,CAAA;AAG3C;",
|
|
6
|
-
"names": ["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
|
-
}
|