@dxos/plugin-thread 0.6.14-staging.e15392e → 0.7.0
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-2Y7UWZLA.mjs → ThreadArticle-IGDTPV3Y.mjs} +3 -3
- package/dist/lib/browser/{ThreadMain-VK5UEBQ7.mjs → ThreadMain-ECGVEYNG.mjs} +3 -3
- package/dist/lib/browser/{chunk-WKCIKGGW.mjs → chunk-3VHVY4H7.mjs} +2 -2
- package/dist/lib/browser/chunk-3VHVY4H7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5G3KL6TC.mjs → chunk-ENERBDYI.mjs} +4 -3
- package/dist/lib/browser/{chunk-5G3KL6TC.mjs.map → chunk-ENERBDYI.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-LHT42MTJ.mjs → chunk-OD3DA5BE.mjs} +7 -7
- package/dist/lib/browser/chunk-OD3DA5BE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +31 -15
- 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-CIYBYISR.cjs → ThreadArticle-LV3HHHJT.cjs} +7 -7
- package/dist/lib/node/{ThreadMain-V6KBUQLH.cjs → ThreadMain-ZS2PYBRX.cjs} +7 -7
- package/dist/lib/node/{chunk-A2IORKQK.cjs → chunk-ANGUPCW3.cjs} +6 -6
- package/dist/lib/node/chunk-ANGUPCW3.cjs.map +7 -0
- package/dist/lib/node/{chunk-HWN7Q5XK.cjs → chunk-GXREFXBX.cjs} +14 -14
- package/dist/lib/node/chunk-GXREFXBX.cjs.map +7 -0
- package/dist/lib/node/{chunk-JIJ7Z6NO.cjs → chunk-IC2NICNC.cjs} +7 -6
- package/dist/lib/node/{chunk-JIJ7Z6NO.cjs.map → chunk-IC2NICNC.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +80 -64
- 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-PXO4ZJFU.mjs → ThreadArticle-3GEYBQKP.mjs} +3 -3
- package/dist/lib/node-esm/{ThreadMain-U7R24CN3.mjs → ThreadMain-7ZEIVEV6.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-DC5ZA6H5.mjs → chunk-7QRGG25F.mjs} +4 -3
- package/dist/lib/node-esm/{chunk-DC5ZA6H5.mjs.map → chunk-7QRGG25F.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-SXXOBRAX.mjs → chunk-7S5K2747.mjs} +7 -7
- package/dist/lib/node-esm/chunk-7S5K2747.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KWNXG6FG.mjs → chunk-CWPZCZ2F.mjs} +2 -2
- package/dist/lib/node-esm/chunk-CWPZCZ2F.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +31 -15
- 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 +1 -1
- package/dist/lib/node-esm/types.mjs +2 -2
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/components/CommentContainer.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +29 -28
- package/src/ThreadPlugin.tsx +12 -2
- package/src/components/ChatContainer.tsx +4 -4
- package/src/components/CommentContainer.tsx +7 -4
- package/src/components/MessageContainer.tsx +3 -2
- package/src/components/ThreadSettings.tsx +3 -3
- package/src/meta.ts +2 -1
- package/src/translations.ts +1 -0
- package/src/types.ts +2 -0
- package/dist/lib/browser/chunk-LHT42MTJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WKCIKGGW.mjs.map +0 -7
- package/dist/lib/node/chunk-A2IORKQK.cjs.map +0 -7
- package/dist/lib/node/chunk-HWN7Q5XK.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-KWNXG6FG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SXXOBRAX.mjs.map +0 -7
- /package/dist/lib/browser/{ThreadArticle-2Y7UWZLA.mjs.map → ThreadArticle-IGDTPV3Y.mjs.map} +0 -0
- /package/dist/lib/browser/{ThreadMain-VK5UEBQ7.mjs.map → ThreadMain-ECGVEYNG.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadArticle-CIYBYISR.cjs.map → ThreadArticle-LV3HHHJT.cjs.map} +0 -0
- /package/dist/lib/node/{ThreadMain-V6KBUQLH.cjs.map → ThreadMain-ZS2PYBRX.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ThreadArticle-PXO4ZJFU.mjs.map → ThreadArticle-3GEYBQKP.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ThreadMain-U7R24CN3.mjs.map → ThreadMain-7ZEIVEV6.mjs.map} +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,17 +28,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
-
ThreadAction: () =>
|
|
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_GXREFXBX.useAnalyticsCallback,
|
|
35
|
+
useOnEditAnalytics: () => import_chunk_GXREFXBX.useOnEditAnalytics,
|
|
36
|
+
useStatus: () => import_chunk_GXREFXBX.useStatus
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(node_exports);
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
39
|
+
var import_chunk_ANGUPCW3 = require("./chunk-ANGUPCW3.cjs");
|
|
40
|
+
var import_chunk_GXREFXBX = require("./chunk-GXREFXBX.cjs");
|
|
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");
|
|
44
44
|
var import_local_storage = require("@dxos/local-storage");
|
|
@@ -84,8 +84,9 @@ var import_echo6 = require("@dxos/react-client/echo");
|
|
|
84
84
|
var import_react_ui_editor2 = require("@dxos/react-ui-editor");
|
|
85
85
|
var import_util3 = require("@dxos/util");
|
|
86
86
|
var sizeClass = (0, import_react_ui_theme.getSize)(4);
|
|
87
|
+
var commentControlClassNames = "!p-1 !min-bs-0 transition-opacity";
|
|
87
88
|
var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
88
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
89
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
89
90
|
const label = t(isResolved ? "mark as unresolved label" : "mark as resolved label");
|
|
90
91
|
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Root, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Trigger, {
|
|
91
92
|
asChild: true
|
|
@@ -94,7 +95,7 @@ var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
|
94
95
|
"data-testid": "thread.toggle-resolved",
|
|
95
96
|
onClick: onResolve,
|
|
96
97
|
classNames: [
|
|
97
|
-
|
|
98
|
+
commentControlClassNames,
|
|
98
99
|
!isResolved && import_react_ui_theme.hoverableControlItem
|
|
99
100
|
]
|
|
100
101
|
}, /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
@@ -109,7 +110,7 @@ var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
|
109
110
|
}, label, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Arrow, null))));
|
|
110
111
|
};
|
|
111
112
|
var DeleteThreadButton = ({ onDelete }) => {
|
|
112
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
113
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
113
114
|
const label = t("delete thread label");
|
|
114
115
|
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Root, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Trigger, {
|
|
115
116
|
asChild: true
|
|
@@ -118,7 +119,7 @@ var DeleteThreadButton = ({ onDelete }) => {
|
|
|
118
119
|
"data-testid": "thread.delete",
|
|
119
120
|
onClick: onDelete,
|
|
120
121
|
classNames: [
|
|
121
|
-
|
|
122
|
+
commentControlClassNames,
|
|
122
123
|
import_react_ui_theme.hoverableControlItem
|
|
123
124
|
]
|
|
124
125
|
}, /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
@@ -133,11 +134,11 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
133
134
|
const identity = (0, import_halo.useIdentity)();
|
|
134
135
|
const space = (0, import_echo3.getSpace)(thread);
|
|
135
136
|
const members = (0, import_echo3.useMembers)(space?.key);
|
|
136
|
-
const activity = (0,
|
|
137
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
137
|
+
const activity = (0, import_chunk_GXREFXBX.useStatus)(space, (0, import_echo3.fullyQualifiedId)(thread));
|
|
138
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
138
139
|
const threadScrollRef = (0, import_react4.useRef)(null);
|
|
139
140
|
const { themeMode } = (0, import_react_ui.useThemeContext)();
|
|
140
|
-
const textboxMetadata = (0,
|
|
141
|
+
const textboxMetadata = (0, import_chunk_GXREFXBX.getMessageMetadata)((0, import_echo3.fullyQualifiedId)(thread), identity);
|
|
141
142
|
const [_count, _setCount] = (0, import_react4.useState)(0);
|
|
142
143
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
143
144
|
const messageRef = (0, import_react4.useRef)("");
|
|
@@ -151,7 +152,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
151
152
|
(0, import_react_ui_editor.listener)({
|
|
152
153
|
onChange: (text) => messageRef.current = text
|
|
153
154
|
}),
|
|
154
|
-
|
|
155
|
+
import_chunk_GXREFXBX.command
|
|
155
156
|
], [
|
|
156
157
|
_count
|
|
157
158
|
]);
|
|
@@ -192,10 +193,10 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
192
193
|
asChild: true
|
|
193
194
|
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui_thread2.ThreadHeading, {
|
|
194
195
|
detached: true
|
|
195
|
-
}, thread.name
|
|
196
|
+
}, thread.name)), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Portal, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Content, {
|
|
196
197
|
classNames: "z-[21]",
|
|
197
198
|
side: "top"
|
|
198
|
-
}, t("detached thread label"), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Arrow, null)))) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui_thread2.ThreadHeading, null, thread.name
|
|
199
|
+
}, t("detached thread label"), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tooltip.Arrow, null)))) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui_thread2.ThreadHeading, null, thread.name), /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
199
200
|
className: "flex flex-row items-center pli-1"
|
|
200
201
|
}, thread.status === "staged" && /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Tag, {
|
|
201
202
|
palette: "neutral"
|
|
@@ -204,7 +205,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
204
205
|
onResolve
|
|
205
206
|
}), onThreadDelete && /* @__PURE__ */ import_react4.default.createElement(DeleteThreadButton, {
|
|
206
207
|
onDelete: onThreadDelete
|
|
207
|
-
}))), thread.messages.filter(import_util.nonNullable).map((message) => /* @__PURE__ */ import_react4.default.createElement(
|
|
208
|
+
}))), thread.messages.filter(import_util.nonNullable).map((message) => /* @__PURE__ */ import_react4.default.createElement(import_chunk_GXREFXBX.MessageContainer, {
|
|
208
209
|
key: message.id,
|
|
209
210
|
message,
|
|
210
211
|
members,
|
|
@@ -222,7 +223,7 @@ var CommentContainer = ({ thread, detached, context, current, onAttend, onThread
|
|
|
222
223
|
}));
|
|
223
224
|
};
|
|
224
225
|
var CommentsContainer = ({ threads: threads2, detached = [], currentId, showResolvedThreads, onThreadAttend, onThreadDelete, onMessageDelete, onThreadToggleResolved, ...props }) => {
|
|
225
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
226
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
226
227
|
const filteredThreads = showResolvedThreads ? threads2 : threads2.filter((thread) => !(thread?.status === "resolved"));
|
|
227
228
|
(0, import_react6.useEffect)(() => {
|
|
228
229
|
if (currentId) {
|
|
@@ -335,8 +336,8 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
335
336
|
},
|
|
336
337
|
onThreadDelete: (thread) => {
|
|
337
338
|
return dispatch({
|
|
338
|
-
plugin:
|
|
339
|
-
action:
|
|
339
|
+
plugin: import_chunk_IC2NICNC.THREAD_PLUGIN,
|
|
340
|
+
action: import_chunk_ANGUPCW3.ThreadAction.DELETE,
|
|
340
341
|
data: {
|
|
341
342
|
subject,
|
|
342
343
|
thread
|
|
@@ -344,8 +345,8 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
344
345
|
});
|
|
345
346
|
},
|
|
346
347
|
onMessageDelete: (thread, messageId) => dispatch({
|
|
347
|
-
plugin:
|
|
348
|
-
action:
|
|
348
|
+
plugin: import_chunk_IC2NICNC.THREAD_PLUGIN,
|
|
349
|
+
action: import_chunk_ANGUPCW3.ThreadAction.DELETE_MESSAGE,
|
|
349
350
|
data: {
|
|
350
351
|
subject,
|
|
351
352
|
thread,
|
|
@@ -353,15 +354,15 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
353
354
|
}
|
|
354
355
|
}),
|
|
355
356
|
onThreadToggleResolved: (thread) => dispatch({
|
|
356
|
-
plugin:
|
|
357
|
-
action:
|
|
357
|
+
plugin: import_chunk_IC2NICNC.THREAD_PLUGIN,
|
|
358
|
+
action: import_chunk_ANGUPCW3.ThreadAction.TOGGLE_RESOLVED,
|
|
358
359
|
data: {
|
|
359
360
|
thread
|
|
360
361
|
}
|
|
361
362
|
}),
|
|
362
363
|
onComment: (thread) => {
|
|
363
364
|
void dispatch({
|
|
364
|
-
action:
|
|
365
|
+
action: import_chunk_ANGUPCW3.ThreadAction.ON_MESSAGE_ADD,
|
|
365
366
|
data: {
|
|
366
367
|
thread,
|
|
367
368
|
subject
|
|
@@ -374,16 +375,16 @@ var ThreadComplementary = ({ role, subject, drafts, current, showResolvedThreads
|
|
|
374
375
|
}), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Scrollbar, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.ScrollArea.Thumb, null)))));
|
|
375
376
|
};
|
|
376
377
|
var ThreadSettings = ({ settings }) => {
|
|
377
|
-
const { t } = (0, import_react_ui4.useTranslation)(
|
|
378
|
-
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_data.
|
|
378
|
+
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
379
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_data.DeprecatedFormInput, {
|
|
379
380
|
label: t("settings standalone label")
|
|
380
381
|
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Input.Switch, {
|
|
381
382
|
checked: settings.standalone,
|
|
382
383
|
onCheckedChange: (checked) => settings.standalone = !!checked
|
|
383
384
|
})));
|
|
384
385
|
};
|
|
385
|
-
var ThreadMain = (0, import_react2.lazy)(() => import("./ThreadMain-
|
|
386
|
-
var ThreadArticle = (0, import_react2.lazy)(() => import("./ThreadArticle-
|
|
386
|
+
var ThreadMain = (0, import_react2.lazy)(() => import("./ThreadMain-ZS2PYBRX.cjs"));
|
|
387
|
+
var ThreadArticle = (0, import_react2.lazy)(() => import("./ThreadArticle-LV3HHHJT.cjs"));
|
|
387
388
|
var getName = (doc, anchor) => {
|
|
388
389
|
if (doc.content) {
|
|
389
390
|
const [start, end] = anchor.split(":");
|
|
@@ -425,7 +426,7 @@ var threads = (state, doc, dispatch) => {
|
|
|
425
426
|
onCreate: ({ cursor }) => {
|
|
426
427
|
const name = getName(doc, cursor);
|
|
427
428
|
void dispatch({
|
|
428
|
-
action:
|
|
429
|
+
action: import_chunk_ANGUPCW3.ThreadAction.CREATE,
|
|
429
430
|
data: {
|
|
430
431
|
cursor,
|
|
431
432
|
name,
|
|
@@ -455,7 +456,7 @@ var threads = (state, doc, dispatch) => {
|
|
|
455
456
|
},
|
|
456
457
|
onSelect: ({ selection: { current, closest } }) => {
|
|
457
458
|
void dispatch({
|
|
458
|
-
action:
|
|
459
|
+
action: import_chunk_ANGUPCW3.ThreadAction.SELECT,
|
|
459
460
|
data: {
|
|
460
461
|
current: current ?? closest,
|
|
461
462
|
skipOpen: true
|
|
@@ -468,7 +469,7 @@ var threads = (state, doc, dispatch) => {
|
|
|
468
469
|
var translations_default = [
|
|
469
470
|
{
|
|
470
471
|
"en-US": {
|
|
471
|
-
[
|
|
472
|
+
[import_chunk_IC2NICNC.THREAD_PLUGIN]: {
|
|
472
473
|
"plugin name": "Threads",
|
|
473
474
|
"channel name placeholder": "New channel",
|
|
474
475
|
"channel title label": "Title",
|
|
@@ -494,7 +495,8 @@ var translations_default = [
|
|
|
494
495
|
"mark as unresolved label": "Mark as unresolved",
|
|
495
496
|
"save message label": "Save",
|
|
496
497
|
"edit message label": "Edit",
|
|
497
|
-
"delete message label": "Delete message"
|
|
498
|
+
"delete message label": "Delete message",
|
|
499
|
+
"open comments panel label": "Show Comments"
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
502
|
}
|
|
@@ -504,7 +506,7 @@ var initialViewState = {
|
|
|
504
506
|
showResolvedThreads: false
|
|
505
507
|
};
|
|
506
508
|
var ThreadPlugin = () => {
|
|
507
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
509
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_IC2NICNC.THREAD_PLUGIN);
|
|
508
510
|
const state = (0, import_echo.create)({
|
|
509
511
|
drafts: {}
|
|
510
512
|
});
|
|
@@ -521,7 +523,7 @@ var ThreadPlugin = () => {
|
|
|
521
523
|
let intentPlugin;
|
|
522
524
|
const unsubscribeCallbacks = [];
|
|
523
525
|
return {
|
|
524
|
-
meta:
|
|
526
|
+
meta: import_chunk_IC2NICNC.meta_default,
|
|
525
527
|
ready: async (plugins) => {
|
|
526
528
|
settings.prop({
|
|
527
529
|
key: "standalone",
|
|
@@ -541,9 +543,9 @@ var ThreadPlugin = () => {
|
|
|
541
543
|
records: {
|
|
542
544
|
[import_types.ChannelType.typename]: {
|
|
543
545
|
placeholder: [
|
|
544
|
-
"channel
|
|
546
|
+
"channel name placeholder",
|
|
545
547
|
{
|
|
546
|
-
ns:
|
|
548
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
547
549
|
}
|
|
548
550
|
],
|
|
549
551
|
icon: "ph--chat--regular",
|
|
@@ -558,7 +560,7 @@ var ThreadPlugin = () => {
|
|
|
558
560
|
// TODO(wittjosiah): Move out of metadata.
|
|
559
561
|
loadReferences: (message) => []
|
|
560
562
|
},
|
|
561
|
-
[
|
|
563
|
+
[import_chunk_IC2NICNC.THREAD_ITEM]: {
|
|
562
564
|
parse: (item, type) => {
|
|
563
565
|
switch (type) {
|
|
564
566
|
case "node":
|
|
@@ -590,6 +592,20 @@ var ThreadPlugin = () => {
|
|
|
590
592
|
import_types.MessageType
|
|
591
593
|
]
|
|
592
594
|
},
|
|
595
|
+
complementary: {
|
|
596
|
+
panels: [
|
|
597
|
+
{
|
|
598
|
+
id: "comments",
|
|
599
|
+
label: [
|
|
600
|
+
"open comments panel label",
|
|
601
|
+
{
|
|
602
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
603
|
+
}
|
|
604
|
+
],
|
|
605
|
+
icon: "ph--chat-text--regular"
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
},
|
|
593
609
|
graph: {
|
|
594
610
|
builder: (plugins) => {
|
|
595
611
|
const client = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin)?.provides.client;
|
|
@@ -602,7 +618,7 @@ var ThreadPlugin = () => {
|
|
|
602
618
|
const icon = "ph--chat-text--regular";
|
|
603
619
|
return [
|
|
604
620
|
(0, import_plugin_graph.createExtension)({
|
|
605
|
-
id: `${
|
|
621
|
+
id: `${import_chunk_IC2NICNC.THREAD_PLUGIN}/comments-for-subject`,
|
|
606
622
|
resolver: ({ id }) => {
|
|
607
623
|
if (!id.endsWith("~comments")) {
|
|
608
624
|
return;
|
|
@@ -620,7 +636,7 @@ var ThreadPlugin = () => {
|
|
|
620
636
|
label: [
|
|
621
637
|
"unnamed object threads label",
|
|
622
638
|
{
|
|
623
|
-
ns:
|
|
639
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
624
640
|
}
|
|
625
641
|
],
|
|
626
642
|
showResolvedThreads: false,
|
|
@@ -643,7 +659,7 @@ var ThreadPlugin = () => {
|
|
|
643
659
|
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
644
660
|
"unnamed object threads label",
|
|
645
661
|
{
|
|
646
|
-
ns:
|
|
662
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
647
663
|
}
|
|
648
664
|
];
|
|
649
665
|
const viewState = getViewState(subjectId);
|
|
@@ -683,13 +699,13 @@ var ThreadPlugin = () => {
|
|
|
683
699
|
};
|
|
684
700
|
return [
|
|
685
701
|
{
|
|
686
|
-
id: `${
|
|
702
|
+
id: `${import_chunk_IC2NICNC.THREAD_PLUGIN}/toggle-show-resolved/${node.id}`,
|
|
687
703
|
data: toggle,
|
|
688
704
|
properties: {
|
|
689
705
|
label: [
|
|
690
706
|
"toggle show resolved",
|
|
691
707
|
{
|
|
692
|
-
ns:
|
|
708
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
693
709
|
}
|
|
694
710
|
],
|
|
695
711
|
menuItemType: "toggle",
|
|
@@ -702,7 +718,7 @@ var ThreadPlugin = () => {
|
|
|
702
718
|
}
|
|
703
719
|
}),
|
|
704
720
|
(0, import_plugin_graph.createExtension)({
|
|
705
|
-
id:
|
|
721
|
+
id: import_chunk_ANGUPCW3.ThreadAction.CREATE,
|
|
706
722
|
filter: (node) => !!settings.values.standalone && (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
|
|
707
723
|
actions: ({ node }) => {
|
|
708
724
|
const id = node.id.split("/").at(-1);
|
|
@@ -715,12 +731,12 @@ var ThreadPlugin = () => {
|
|
|
715
731
|
}
|
|
716
732
|
return [
|
|
717
733
|
{
|
|
718
|
-
id: `${
|
|
734
|
+
id: `${import_chunk_IC2NICNC.THREAD_PLUGIN}/create/${node.id}`,
|
|
719
735
|
data: async () => {
|
|
720
736
|
await dispatch([
|
|
721
737
|
{
|
|
722
|
-
plugin:
|
|
723
|
-
action:
|
|
738
|
+
plugin: import_chunk_IC2NICNC.THREAD_PLUGIN,
|
|
739
|
+
action: import_chunk_ANGUPCW3.ThreadAction.CREATE
|
|
724
740
|
},
|
|
725
741
|
{
|
|
726
742
|
action: import_plugin_space.SpaceAction.ADD_OBJECT,
|
|
@@ -737,7 +753,7 @@ var ThreadPlugin = () => {
|
|
|
737
753
|
label: [
|
|
738
754
|
"create channel label",
|
|
739
755
|
{
|
|
740
|
-
ns:
|
|
756
|
+
ns: import_chunk_IC2NICNC.THREAD_PLUGIN
|
|
741
757
|
}
|
|
742
758
|
],
|
|
743
759
|
icon: "ph--chat--regular",
|
|
@@ -759,7 +775,7 @@ var ThreadPlugin = () => {
|
|
|
759
775
|
}) : null;
|
|
760
776
|
}
|
|
761
777
|
case "settings": {
|
|
762
|
-
return data.plugin ===
|
|
778
|
+
return data.plugin === import_chunk_IC2NICNC.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(ThreadSettings, {
|
|
763
779
|
settings: settings.values
|
|
764
780
|
}) : null;
|
|
765
781
|
}
|
|
@@ -784,16 +800,16 @@ var ThreadPlugin = () => {
|
|
|
784
800
|
});
|
|
785
801
|
}
|
|
786
802
|
if (data.subject instanceof import_types.ThreadType) {
|
|
787
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
803
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_chunk_GXREFXBX.ChatHeading, {
|
|
788
804
|
attendableId: data.subject.id
|
|
789
|
-
}), /* @__PURE__ */ import_react.default.createElement(
|
|
805
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_chunk_GXREFXBX.ChatContainer, {
|
|
790
806
|
thread: data.subject
|
|
791
807
|
}));
|
|
792
808
|
}
|
|
793
809
|
break;
|
|
794
810
|
}
|
|
795
811
|
case "complementary--comments": {
|
|
796
|
-
if (data.subject && typeof data.subject === "object" && "threads" in data.subject && Array.isArray(data.subject.threads)) {
|
|
812
|
+
if (data.subject && typeof data.subject === "object" && "threads" in data.subject && Array.isArray(data.subject.threads) && !(data.subject instanceof import_types.ChannelType)) {
|
|
797
813
|
const { showResolvedThreads } = getViewState((0, import_echo2.fullyQualifiedId)(data.subject));
|
|
798
814
|
return /* @__PURE__ */ import_react.default.createElement(ThreadComplementary, {
|
|
799
815
|
role,
|
|
@@ -812,7 +828,7 @@ var ThreadPlugin = () => {
|
|
|
812
828
|
intent: {
|
|
813
829
|
resolver: async (intent) => {
|
|
814
830
|
switch (intent.action) {
|
|
815
|
-
case
|
|
831
|
+
case import_chunk_ANGUPCW3.ThreadAction.CREATE: {
|
|
816
832
|
if (intent.data && intent.data.cursor !== void 0) {
|
|
817
833
|
const { cursor, name, subject } = intent.data;
|
|
818
834
|
if (subject?.threads === void 0) {
|
|
@@ -821,7 +837,7 @@ var ThreadPlugin = () => {
|
|
|
821
837
|
} catch (err) {
|
|
822
838
|
import_log.log.error("Subject does not support threads array", subject?.typename, {
|
|
823
839
|
F: __dxlog_file,
|
|
824
|
-
L:
|
|
840
|
+
L: 357,
|
|
825
841
|
S: void 0,
|
|
826
842
|
C: (f, a) => f(...a)
|
|
827
843
|
});
|
|
@@ -848,7 +864,7 @@ var ThreadPlugin = () => {
|
|
|
848
864
|
intents: [
|
|
849
865
|
[
|
|
850
866
|
{
|
|
851
|
-
action:
|
|
867
|
+
action: import_chunk_ANGUPCW3.ThreadAction.SELECT,
|
|
852
868
|
data: {
|
|
853
869
|
current: (0, import_echo2.fullyQualifiedId)(thread)
|
|
854
870
|
}
|
|
@@ -887,7 +903,7 @@ var ThreadPlugin = () => {
|
|
|
887
903
|
};
|
|
888
904
|
}
|
|
889
905
|
}
|
|
890
|
-
case
|
|
906
|
+
case import_chunk_ANGUPCW3.ThreadAction.SELECT: {
|
|
891
907
|
state.current = intent.data?.current;
|
|
892
908
|
return {
|
|
893
909
|
data: true,
|
|
@@ -905,7 +921,7 @@ var ThreadPlugin = () => {
|
|
|
905
921
|
] : []
|
|
906
922
|
};
|
|
907
923
|
}
|
|
908
|
-
case
|
|
924
|
+
case import_chunk_ANGUPCW3.ThreadAction.TOGGLE_RESOLVED: {
|
|
909
925
|
const { thread } = intent.data ?? {};
|
|
910
926
|
if (!(thread instanceof import_types.ThreadType)) {
|
|
911
927
|
return;
|
|
@@ -935,7 +951,7 @@ var ThreadPlugin = () => {
|
|
|
935
951
|
]
|
|
936
952
|
};
|
|
937
953
|
}
|
|
938
|
-
case
|
|
954
|
+
case import_chunk_ANGUPCW3.ThreadAction.DELETE: {
|
|
939
955
|
const { subject, thread } = intent.data ?? {};
|
|
940
956
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
941
957
|
return;
|
|
@@ -964,7 +980,7 @@ var ThreadPlugin = () => {
|
|
|
964
980
|
space.db.remove(thread);
|
|
965
981
|
return {
|
|
966
982
|
undoable: {
|
|
967
|
-
message: translations_default[0]["en-US"][
|
|
983
|
+
message: translations_default[0]["en-US"][import_chunk_IC2NICNC.THREAD_PLUGIN]["thread deleted label"],
|
|
968
984
|
data: {
|
|
969
985
|
cursor
|
|
970
986
|
}
|
|
@@ -1007,7 +1023,7 @@ var ThreadPlugin = () => {
|
|
|
1007
1023
|
}
|
|
1008
1024
|
break;
|
|
1009
1025
|
}
|
|
1010
|
-
case
|
|
1026
|
+
case import_chunk_ANGUPCW3.ThreadAction.ON_MESSAGE_ADD: {
|
|
1011
1027
|
const { thread, subject } = intent.data ?? {};
|
|
1012
1028
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject && Array.isArray(subject.threads))) {
|
|
1013
1029
|
return;
|
|
@@ -1050,7 +1066,7 @@ var ThreadPlugin = () => {
|
|
|
1050
1066
|
]
|
|
1051
1067
|
};
|
|
1052
1068
|
}
|
|
1053
|
-
case
|
|
1069
|
+
case import_chunk_ANGUPCW3.ThreadAction.DELETE_MESSAGE: {
|
|
1054
1070
|
const { subject, thread, messageId } = intent.data ?? {};
|
|
1055
1071
|
const space = (0, import_echo2.getSpace)(subject);
|
|
1056
1072
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
@@ -1067,7 +1083,7 @@ var ThreadPlugin = () => {
|
|
|
1067
1083
|
intents: [
|
|
1068
1084
|
[
|
|
1069
1085
|
{
|
|
1070
|
-
action:
|
|
1086
|
+
action: import_chunk_ANGUPCW3.ThreadAction.DELETE,
|
|
1071
1087
|
data: {
|
|
1072
1088
|
subject,
|
|
1073
1089
|
thread
|
|
@@ -1081,7 +1097,7 @@ var ThreadPlugin = () => {
|
|
|
1081
1097
|
}
|
|
1082
1098
|
return {
|
|
1083
1099
|
undoable: {
|
|
1084
|
-
message: translations_default[0]["en-US"][
|
|
1100
|
+
message: translations_default[0]["en-US"][import_chunk_IC2NICNC.THREAD_PLUGIN]["message deleted label"],
|
|
1085
1101
|
data: {
|
|
1086
1102
|
message,
|
|
1087
1103
|
messageIndex
|