@dxos/plugin-thread 0.7.1 → 0.7.2-main.f1adc9f
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-IGDTPV3Y.mjs → ThreadArticle-Z6SU7SJW.mjs} +2 -2
- package/dist/lib/browser/{ThreadMain-ECGVEYNG.mjs → ThreadMain-SFTBLHNW.mjs} +2 -2
- package/dist/lib/browser/{chunk-OD3DA5BE.mjs → chunk-A5AARDTP.mjs} +1 -1
- package/dist/lib/browser/{chunk-OD3DA5BE.mjs.map → chunk-A5AARDTP.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +16 -29
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/{ThreadArticle-LV3HHHJT.cjs → ThreadArticle-QQMCCCH5.cjs} +6 -6
- package/dist/lib/node/{ThreadMain-ZS2PYBRX.cjs → ThreadMain-UYUGGUOM.cjs} +6 -6
- package/dist/lib/node/{chunk-GXREFXBX.cjs → chunk-AWJEBUB4.cjs} +4 -4
- package/dist/lib/node/{chunk-GXREFXBX.cjs.map → chunk-AWJEBUB4.cjs.map} +1 -1
- package/dist/lib/node/index.cjs +59 -72
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/{ThreadArticle-3GEYBQKP.mjs → ThreadArticle-VV37UVYP.mjs} +2 -2
- package/dist/lib/node-esm/{ThreadMain-7ZEIVEV6.mjs → ThreadMain-RXIKQI3K.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-7S5K2747.mjs → chunk-MANBTNSY.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-7S5K2747.mjs.map → chunk-MANBTNSY.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +16 -29
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/types.d.ts +2 -2
- package/package.json +29 -29
- package/src/ThreadPlugin.tsx +26 -24
- package/src/components/CommentsContainer.tsx +1 -1
- package/src/components/MessageContainer.tsx +2 -2
- package/src/components/ThreadComplementary.tsx +41 -49
- package/src/components/types.ts +2 -2
- /package/dist/lib/browser/{ThreadArticle-IGDTPV3Y.mjs.map → ThreadArticle-Z6SU7SJW.mjs.map} +0 -0
- /package/dist/lib/browser/{ThreadMain-ECGVEYNG.mjs.map → ThreadMain-SFTBLHNW.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadArticle-LV3HHHJT.cjs.map → ThreadArticle-QQMCCCH5.cjs.map} +0 -0
- /package/dist/lib/node/{ThreadMain-ZS2PYBRX.cjs.map → ThreadMain-UYUGGUOM.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ThreadArticle-3GEYBQKP.mjs.map → ThreadArticle-VV37UVYP.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ThreadMain-7ZEIVEV6.mjs.map → ThreadMain-RXIKQI3K.mjs.map} +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -31,13 +31,13 @@ __export(node_exports, {
|
|
|
31
31
|
ThreadAction: () => import_chunk_ANGUPCW3.ThreadAction,
|
|
32
32
|
ThreadPlugin: () => ThreadPlugin,
|
|
33
33
|
default: () => src_default,
|
|
34
|
-
useAnalyticsCallback: () =>
|
|
35
|
-
useOnEditAnalytics: () =>
|
|
36
|
-
useStatus: () =>
|
|
34
|
+
useAnalyticsCallback: () => import_chunk_AWJEBUB4.useAnalyticsCallback,
|
|
35
|
+
useOnEditAnalytics: () => import_chunk_AWJEBUB4.useOnEditAnalytics,
|
|
36
|
+
useStatus: () => import_chunk_AWJEBUB4.useStatus
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(node_exports);
|
|
39
39
|
var import_chunk_ANGUPCW3 = require("./chunk-ANGUPCW3.cjs");
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_AWJEBUB4 = require("./chunk-AWJEBUB4.cjs");
|
|
41
41
|
var import_chunk_IC2NICNC = require("./chunk-IC2NICNC.cjs");
|
|
42
42
|
var import_react = __toESM(require("react"));
|
|
43
43
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -49,14 +49,13 @@ var import_meta = require("@dxos/plugin-observability/meta");
|
|
|
49
49
|
var import_plugin_space = require("@dxos/plugin-space");
|
|
50
50
|
var import_types = require("@dxos/plugin-space/types");
|
|
51
51
|
var import_echo = require("@dxos/react-client/echo");
|
|
52
|
-
var import_echo2 = require("@dxos/react-client/echo");
|
|
53
52
|
var import_react_ui_thread = require("@dxos/react-ui-thread");
|
|
54
53
|
var import_react2 = require("react");
|
|
55
54
|
var import_react3 = require("@phosphor-icons/react");
|
|
56
55
|
var import_react4 = __toESM(require("react"));
|
|
57
56
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
58
57
|
var import_types2 = require("@dxos/plugin-space/types");
|
|
59
|
-
var
|
|
58
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
60
59
|
var import_halo = require("@dxos/react-client/halo");
|
|
61
60
|
var import_react_ui = require("@dxos/react-ui");
|
|
62
61
|
var import_react_ui_editor = require("@dxos/react-ui-editor");
|
|
@@ -65,22 +64,21 @@ var import_react_ui_thread2 = require("@dxos/react-ui-thread");
|
|
|
65
64
|
var import_util = require("@dxos/util");
|
|
66
65
|
var import_react5 = require("@phosphor-icons/react");
|
|
67
66
|
var import_react6 = __toESM(require("react"));
|
|
68
|
-
var
|
|
67
|
+
var import_echo3 = require("@dxos/react-client/echo");
|
|
69
68
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
70
69
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
71
70
|
var import_react7 = __toESM(require("react"));
|
|
72
71
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
73
|
-
var
|
|
74
|
-
var import_react_ui3 = require("@dxos/react-ui");
|
|
72
|
+
var import_echo4 = require("@dxos/react-client/echo");
|
|
75
73
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
76
74
|
var import_util2 = require("@dxos/util");
|
|
77
75
|
var import_react8 = __toESM(require("react"));
|
|
78
|
-
var
|
|
76
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
79
77
|
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
80
78
|
var import_view = require("@codemirror/view");
|
|
81
79
|
var import_signals_core = require("@preact/signals-core");
|
|
82
80
|
var import_types3 = require("@dxos/plugin-space/types");
|
|
83
|
-
var
|
|
81
|
+
var import_echo5 = require("@dxos/react-client/echo");
|
|
84
82
|
var import_react_ui_editor2 = require("@dxos/react-ui-editor");
|
|
85
83
|
var import_util3 = require("@dxos/util");
|
|
86
84
|
var sizeClass = (0, import_react_ui_theme.getSize)(4);
|
|
@@ -132,13 +130,13 @@ var DeleteThreadButton = ({ onDelete }) => {
|
|
|
132
130
|
};
|
|
133
131
|
var CommentContainer = ({ thread, detached, context, current, onAttend, onThreadDelete, onMessageDelete, onResolve, onComment }) => {
|
|
134
132
|
const identity = (0, import_halo.useIdentity)();
|
|
135
|
-
const space = (0,
|
|
136
|
-
const members = (0,
|
|
137
|
-
const activity = (0,
|
|
133
|
+
const space = (0, import_echo2.getSpace)(thread);
|
|
134
|
+
const members = (0, import_echo2.useMembers)(space?.key);
|
|
135
|
+
const activity = (0, import_chunk_AWJEBUB4.useStatus)(space, (0, import_echo2.fullyQualifiedId)(thread));
|
|
138
136
|
const { t } = (0, import_react_ui.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
139
137
|
const threadScrollRef = (0, import_react4.useRef)(null);
|
|
140
138
|
const { themeMode } = (0, import_react_ui.useThemeContext)();
|
|
141
|
-
const textboxMetadata = (0,
|
|
139
|
+
const textboxMetadata = (0, import_chunk_AWJEBUB4.getMessageMetadata)((0, import_echo2.fullyQualifiedId)(thread), identity);
|
|
142
140
|
const [_count, _setCount] = (0, import_react4.useState)(0);
|
|
143
141
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
144
142
|
const messageRef = (0, import_react4.useRef)("");
|
|
@@ -152,7 +150,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
152
150
|
(0, import_react_ui_editor.listener)({
|
|
153
151
|
onChange: (text) => messageRef.current = text
|
|
154
152
|
}),
|
|
155
|
-
|
|
153
|
+
import_chunk_AWJEBUB4.command
|
|
156
154
|
], [
|
|
157
155
|
_count
|
|
158
156
|
]);
|
|
@@ -185,7 +183,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
185
183
|
onClickCapture: onAttend,
|
|
186
184
|
onFocusCapture: onAttend,
|
|
187
185
|
current,
|
|
188
|
-
id: (0,
|
|
186
|
+
id: (0, import_echo2.fullyQualifiedId)(thread)
|
|
189
187
|
}, /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
190
188
|
role: "none",
|
|
191
189
|
className: (0, import_react_ui_theme.mx)("col-span-2 grid grid-cols-[var(--rail-size)_1fr_min-content]", import_react_ui_theme.hoverableControls, import_react_ui_theme.hoverableFocusedWithinControls)
|
|
@@ -205,7 +203,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
205
203
|
onResolve
|
|
206
204
|
}), onThreadDelete && /* @__PURE__ */ import_react4.default.createElement(DeleteThreadButton, {
|
|
207
205
|
onDelete: onThreadDelete
|
|
208
|
-
}))), thread.messages.filter(import_util.nonNullable).map((message) => /* @__PURE__ */ import_react4.default.createElement(
|
|
206
|
+
}))), thread.messages.filter(import_util.nonNullable).map((message) => /* @__PURE__ */ import_react4.default.createElement(import_chunk_AWJEBUB4.MessageContainer, {
|
|
209
207
|
key: message.id,
|
|
210
208
|
message,
|
|
211
209
|
members,
|
|
@@ -236,7 +234,7 @@ var CommentsContainer = ({ threads: threads2, detached = [], currentId, showReso
|
|
|
236
234
|
currentId
|
|
237
235
|
]);
|
|
238
236
|
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, filteredThreads.length > 0 ? filteredThreads.map((thread) => {
|
|
239
|
-
const threadId = (0,
|
|
237
|
+
const threadId = (0, import_echo3.fullyQualifiedId)(thread);
|
|
240
238
|
return /* @__PURE__ */ import_react6.default.createElement(CommentContainer, {
|
|
241
239
|
key: threadId,
|
|
242
240
|
thread,
|
|
@@ -258,7 +256,7 @@ var CommentsContainer = ({ threads: threads2, detached = [], currentId, showReso
|
|
|
258
256
|
});
|
|
259
257
|
}) : /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
260
258
|
role: "alert",
|
|
261
|
-
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "place-self-center border border-dashed border-
|
|
259
|
+
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "place-self-center border border-dashed border-unAccent rounded-lg text-center p-4 m-4")
|
|
262
260
|
}, /* @__PURE__ */ import_react6.default.createElement("h2", {
|
|
263
261
|
className: "mbe-2 font-medium text-baseText"
|
|
264
262
|
}, t("no comments title")), /* @__PURE__ */ import_react6.default.createElement("p", null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui2.Trans, {
|
|
@@ -293,7 +291,7 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
293
291
|
JSON.stringify(drafts)
|
|
294
292
|
]);
|
|
295
293
|
const detachedIds = (0, import_react7.useMemo)(() => {
|
|
296
|
-
return threads2.filter(({ anchor }) => !anchor).map((thread) => (0,
|
|
294
|
+
return threads2.filter(({ anchor }) => !anchor).map((thread) => (0, import_echo4.fullyQualifiedId)(thread));
|
|
297
295
|
}, [
|
|
298
296
|
threads2
|
|
299
297
|
]);
|
|
@@ -307,26 +305,21 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
307
305
|
threads2
|
|
308
306
|
]);
|
|
309
307
|
const attended = (0, import_react_ui_attention.useAttended)();
|
|
310
|
-
const qualifiedSubjectId = (0,
|
|
311
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
312
|
-
role: "none",
|
|
313
|
-
className: "contents"
|
|
314
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Root, {
|
|
315
|
-
classNames: "row-span-2"
|
|
316
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Viewport, null, /* @__PURE__ */ import_react7.default.createElement(CommentsContainer, {
|
|
308
|
+
const qualifiedSubjectId = (0, import_echo4.fullyQualifiedId)(subject);
|
|
309
|
+
return /* @__PURE__ */ import_react7.default.createElement(CommentsContainer, {
|
|
317
310
|
threads: threads2,
|
|
318
311
|
detached: detachedIds,
|
|
319
312
|
currentId: attended.includes(qualifiedSubjectId) ? current : void 0,
|
|
320
313
|
showResolvedThreads,
|
|
321
314
|
onThreadAttend: (thread) => {
|
|
322
|
-
const threadId = (0,
|
|
315
|
+
const threadId = (0, import_echo4.fullyQualifiedId)(thread);
|
|
323
316
|
if (current !== threadId) {
|
|
324
317
|
current = threadId;
|
|
325
318
|
void dispatch?.([
|
|
326
319
|
{
|
|
327
320
|
action: import_app_framework2.LayoutAction.SCROLL_INTO_VIEW,
|
|
328
321
|
data: {
|
|
329
|
-
id: (0,
|
|
322
|
+
id: (0, import_echo4.fullyQualifiedId)(subject),
|
|
330
323
|
thread: threadId,
|
|
331
324
|
cursor: thread.anchor
|
|
332
325
|
}
|
|
@@ -369,32 +362,29 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
369
362
|
}
|
|
370
363
|
});
|
|
371
364
|
}
|
|
372
|
-
})
|
|
373
|
-
role: "none",
|
|
374
|
-
className: "bs-10"
|
|
375
|
-
}), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Scrollbar, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Thumb, null)))));
|
|
365
|
+
});
|
|
376
366
|
};
|
|
377
367
|
var ThreadSettings = ({ settings }) => {
|
|
378
|
-
const { t } = (0,
|
|
368
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
379
369
|
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_form.DeprecatedFormInput, {
|
|
380
370
|
label: t("settings standalone label")
|
|
381
|
-
}, /* @__PURE__ */ import_react8.default.createElement(
|
|
371
|
+
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.Input.Switch, {
|
|
382
372
|
checked: settings.standalone,
|
|
383
373
|
onCheckedChange: (checked) => settings.standalone = !!checked
|
|
384
374
|
})));
|
|
385
375
|
};
|
|
386
|
-
var ThreadMain = (0, import_react2.lazy)(() => import("./ThreadMain-
|
|
387
|
-
var ThreadArticle = (0, import_react2.lazy)(() => import("./ThreadArticle-
|
|
376
|
+
var ThreadMain = (0, import_react2.lazy)(() => import("./ThreadMain-UYUGGUOM.cjs"));
|
|
377
|
+
var ThreadArticle = (0, import_react2.lazy)(() => import("./ThreadArticle-QQMCCCH5.cjs"));
|
|
388
378
|
var getName = (doc, anchor) => {
|
|
389
379
|
if (doc.content) {
|
|
390
380
|
const [start, end] = anchor.split(":");
|
|
391
|
-
return (0,
|
|
381
|
+
return (0, import_echo5.getTextInRange)((0, import_echo5.createDocAccessor)(doc.content, [
|
|
392
382
|
"content"
|
|
393
383
|
]), start, end);
|
|
394
384
|
}
|
|
395
385
|
};
|
|
396
386
|
var threads = (state, doc, dispatch) => {
|
|
397
|
-
const space = doc && (0,
|
|
387
|
+
const space = doc && (0, import_echo5.getSpace)(doc);
|
|
398
388
|
if (!doc || !space || !dispatch) {
|
|
399
389
|
return [
|
|
400
390
|
(0, import_react_ui_editor2.comments)()
|
|
@@ -402,7 +392,7 @@ var threads = (state, doc, dispatch) => {
|
|
|
402
392
|
}
|
|
403
393
|
const threads2 = (0, import_signals_core.computed)(() => [
|
|
404
394
|
...doc.threads.filter(import_util3.nonNullable),
|
|
405
|
-
...state.drafts[(0,
|
|
395
|
+
...state.drafts[(0, import_echo5.fullyQualifiedId)(doc)] ?? []
|
|
406
396
|
].filter((thread) => !(thread?.status === "resolved")));
|
|
407
397
|
return [
|
|
408
398
|
import_view.EditorView.updateListener.of((update) => {
|
|
@@ -417,12 +407,12 @@ var threads = (state, doc, dispatch) => {
|
|
|
417
407
|
});
|
|
418
408
|
}
|
|
419
409
|
}),
|
|
420
|
-
(0, import_react_ui_editor2.createExternalCommentSync)((0,
|
|
421
|
-
id: (0,
|
|
410
|
+
(0, import_react_ui_editor2.createExternalCommentSync)((0, import_echo5.fullyQualifiedId)(doc), (sink) => (0, import_signals_core.effect)(() => sink()), () => threads2.value.filter((thread) => thread?.anchor).map((thread) => ({
|
|
411
|
+
id: (0, import_echo5.fullyQualifiedId)(thread),
|
|
422
412
|
cursor: thread.anchor
|
|
423
413
|
}))),
|
|
424
414
|
(0, import_react_ui_editor2.comments)({
|
|
425
|
-
id: (0,
|
|
415
|
+
id: (0, import_echo5.fullyQualifiedId)(doc),
|
|
426
416
|
onCreate: ({ cursor }) => {
|
|
427
417
|
const name = getName(doc, cursor);
|
|
428
418
|
void dispatch({
|
|
@@ -435,9 +425,9 @@ var threads = (state, doc, dispatch) => {
|
|
|
435
425
|
});
|
|
436
426
|
},
|
|
437
427
|
onDelete: ({ id }) => {
|
|
438
|
-
const draft = state.drafts[(0,
|
|
428
|
+
const draft = state.drafts[(0, import_echo5.fullyQualifiedId)(doc)];
|
|
439
429
|
if (draft) {
|
|
440
|
-
const index = draft.findIndex((thread2) => (0,
|
|
430
|
+
const index = draft.findIndex((thread2) => (0, import_echo5.fullyQualifiedId)(thread2) === id);
|
|
441
431
|
if (index !== -1) {
|
|
442
432
|
draft.splice(index, 1);
|
|
443
433
|
}
|
|
@@ -448,7 +438,7 @@ var threads = (state, doc, dispatch) => {
|
|
|
448
438
|
}
|
|
449
439
|
},
|
|
450
440
|
onUpdate: ({ id, cursor }) => {
|
|
451
|
-
const thread = state.drafts[(0,
|
|
441
|
+
const thread = state.drafts[(0, import_echo5.fullyQualifiedId)(doc)]?.find((thread2) => (0, import_echo5.fullyQualifiedId)(thread2) === id) ?? doc.threads.find((thread2) => thread2?.id === id);
|
|
452
442
|
if (thread instanceof import_types3.ThreadType && thread.anchor) {
|
|
453
443
|
thread.name = getName(doc, thread.anchor);
|
|
454
444
|
thread.anchor = cursor;
|
|
@@ -550,11 +540,11 @@ var ThreadPlugin = () => {
|
|
|
550
540
|
],
|
|
551
541
|
icon: "ph--chat--regular",
|
|
552
542
|
// TODO(wittjosiah): Move out of metadata.
|
|
553
|
-
loadReferences: (channel) => (0,
|
|
543
|
+
loadReferences: (channel) => (0, import_echo.loadObjectReferences)(channel, (channel2) => channel2.threads)
|
|
554
544
|
},
|
|
555
545
|
[import_types.ThreadType.typename]: {
|
|
556
546
|
// TODO(wittjosiah): Move out of metadata.
|
|
557
|
-
loadReferences: (thread) => (0,
|
|
547
|
+
loadReferences: (thread) => (0, import_echo.loadObjectReferences)(thread, (thread2) => thread2.messages)
|
|
558
548
|
},
|
|
559
549
|
[import_types.MessageType.typename]: {
|
|
560
550
|
// TODO(wittjosiah): Move out of metadata.
|
|
@@ -624,8 +614,9 @@ var ThreadPlugin = () => {
|
|
|
624
614
|
return;
|
|
625
615
|
}
|
|
626
616
|
const [subjectId] = id.split("~");
|
|
627
|
-
const { spaceId, objectId } = (0,
|
|
628
|
-
const
|
|
617
|
+
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
618
|
+
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
619
|
+
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
|
|
629
620
|
if (!objectId) {
|
|
630
621
|
return {
|
|
631
622
|
id,
|
|
@@ -645,13 +636,9 @@ var ThreadPlugin = () => {
|
|
|
645
636
|
}
|
|
646
637
|
};
|
|
647
638
|
}
|
|
648
|
-
const object = (0,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
onChange();
|
|
652
|
-
});
|
|
653
|
-
return () => clearTimeout(timeout);
|
|
654
|
-
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
639
|
+
const [object] = (0, import_plugin_space.memoizeQuery)(space, {
|
|
640
|
+
id: objectId
|
|
641
|
+
});
|
|
655
642
|
if (!object || !subjectId) {
|
|
656
643
|
return;
|
|
657
644
|
}
|
|
@@ -788,7 +775,7 @@ var ThreadPlugin = () => {
|
|
|
788
775
|
const currentPosition = layoutEntries.findIndex((entry) => channel.id === entry.id);
|
|
789
776
|
if (currentPosition > 0) {
|
|
790
777
|
const objectToTheLeft = layoutEntries[currentPosition - 1];
|
|
791
|
-
const context = (0,
|
|
778
|
+
const context = (0, import_echo.getSpace)(data.object)?.db.getObjectById(objectToTheLeft.id);
|
|
792
779
|
return /* @__PURE__ */ import_react.default.createElement(ThreadArticle, {
|
|
793
780
|
thread: data.object.threads[0],
|
|
794
781
|
context
|
|
@@ -800,9 +787,9 @@ var ThreadPlugin = () => {
|
|
|
800
787
|
});
|
|
801
788
|
}
|
|
802
789
|
if (data.subject instanceof import_types.ThreadType) {
|
|
803
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
790
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_chunk_AWJEBUB4.ChatHeading, {
|
|
804
791
|
attendableId: data.subject.id
|
|
805
|
-
}), /* @__PURE__ */ import_react.default.createElement(
|
|
792
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_chunk_AWJEBUB4.ChatContainer, {
|
|
806
793
|
thread: data.subject
|
|
807
794
|
}));
|
|
808
795
|
}
|
|
@@ -810,11 +797,11 @@ var ThreadPlugin = () => {
|
|
|
810
797
|
}
|
|
811
798
|
case "complementary--comments": {
|
|
812
799
|
if (data.subject && typeof data.subject === "object" && "threads" in data.subject && Array.isArray(data.subject.threads) && !(data.subject instanceof import_types.ChannelType)) {
|
|
813
|
-
const { showResolvedThreads } = getViewState((0,
|
|
800
|
+
const { showResolvedThreads } = getViewState((0, import_echo.fullyQualifiedId)(data.subject));
|
|
814
801
|
return /* @__PURE__ */ import_react.default.createElement(ThreadComplementary, {
|
|
815
802
|
role,
|
|
816
803
|
subject: data.subject,
|
|
817
|
-
drafts: state.drafts[(0,
|
|
804
|
+
drafts: state.drafts[(0, import_echo.fullyQualifiedId)(data.subject)],
|
|
818
805
|
current: state.current,
|
|
819
806
|
showResolvedThreads
|
|
820
807
|
});
|
|
@@ -837,14 +824,14 @@ var ThreadPlugin = () => {
|
|
|
837
824
|
} catch (err) {
|
|
838
825
|
import_log.log.error("Subject does not support threads array", subject?.typename, {
|
|
839
826
|
F: __dxlog_file,
|
|
840
|
-
L:
|
|
827
|
+
L: 359,
|
|
841
828
|
S: void 0,
|
|
842
829
|
C: (f, a) => f(...a)
|
|
843
830
|
});
|
|
844
831
|
return;
|
|
845
832
|
}
|
|
846
833
|
}
|
|
847
|
-
const subjectId = (0,
|
|
834
|
+
const subjectId = (0, import_echo.fullyQualifiedId)(subject);
|
|
848
835
|
const thread = (0, import_echo.create)(import_types.ThreadType, {
|
|
849
836
|
name,
|
|
850
837
|
anchor: cursor,
|
|
@@ -866,7 +853,7 @@ var ThreadPlugin = () => {
|
|
|
866
853
|
{
|
|
867
854
|
action: import_chunk_ANGUPCW3.ThreadAction.SELECT,
|
|
868
855
|
data: {
|
|
869
|
-
current: (0,
|
|
856
|
+
current: (0, import_echo.fullyQualifiedId)(thread)
|
|
870
857
|
}
|
|
871
858
|
}
|
|
872
859
|
],
|
|
@@ -931,7 +918,7 @@ var ThreadPlugin = () => {
|
|
|
931
918
|
} else if (thread.status === "resolved") {
|
|
932
919
|
thread.status = "active";
|
|
933
920
|
}
|
|
934
|
-
const space = (0,
|
|
921
|
+
const space = (0, import_echo.getSpace)(thread);
|
|
935
922
|
const spaceId = space?.id;
|
|
936
923
|
return {
|
|
937
924
|
data: true,
|
|
@@ -956,7 +943,7 @@ var ThreadPlugin = () => {
|
|
|
956
943
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
957
944
|
return;
|
|
958
945
|
}
|
|
959
|
-
const subjectId = (0,
|
|
946
|
+
const subjectId = (0, import_echo.fullyQualifiedId)(subject);
|
|
960
947
|
const draft = state.drafts[subjectId];
|
|
961
948
|
if (draft) {
|
|
962
949
|
const index = draft.findIndex((t) => t.id === thread.id);
|
|
@@ -967,7 +954,7 @@ var ThreadPlugin = () => {
|
|
|
967
954
|
};
|
|
968
955
|
}
|
|
969
956
|
}
|
|
970
|
-
const space = (0,
|
|
957
|
+
const space = (0, import_echo.getSpace)(thread);
|
|
971
958
|
if (!space || !subject.threads) {
|
|
972
959
|
return;
|
|
973
960
|
}
|
|
@@ -1028,8 +1015,8 @@ var ThreadPlugin = () => {
|
|
|
1028
1015
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject && Array.isArray(subject.threads))) {
|
|
1029
1016
|
return;
|
|
1030
1017
|
}
|
|
1031
|
-
const subjectId = (0,
|
|
1032
|
-
const space = (0,
|
|
1018
|
+
const subjectId = (0, import_echo.fullyQualifiedId)(subject);
|
|
1019
|
+
const space = (0, import_echo.getSpace)(subject);
|
|
1033
1020
|
const intents = [];
|
|
1034
1021
|
const analyticsProperties = {
|
|
1035
1022
|
threadId: thread.id,
|
|
@@ -1068,7 +1055,7 @@ var ThreadPlugin = () => {
|
|
|
1068
1055
|
}
|
|
1069
1056
|
case import_chunk_ANGUPCW3.ThreadAction.DELETE_MESSAGE: {
|
|
1070
1057
|
const { subject, thread, messageId } = intent.data ?? {};
|
|
1071
|
-
const space = (0,
|
|
1058
|
+
const space = (0, import_echo.getSpace)(subject);
|
|
1072
1059
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
1073
1060
|
return;
|
|
1074
1061
|
}
|