@dxos/plugin-thread 0.6.12-main.5cc132e → 0.6.12-main.78ddbdf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-4VU752F4.mjs} +3 -3
- package/dist/lib/{node-esm/ThreadMain-DU6LBSN3.mjs → browser/ThreadMain-ML3P4XSD.mjs} +3 -3
- package/dist/lib/browser/{chunk-5IBJO53M.mjs → chunk-7NUYW5IW.mjs} +2 -5
- package/dist/lib/browser/chunk-7NUYW5IW.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-U5UVX4ZP.mjs → browser/chunk-GJRBBPXI.mjs} +2 -2
- package/dist/lib/browser/{chunk-AVC4CGJM.mjs → chunk-XF5QKI75.mjs} +8 -6
- package/dist/lib/browser/chunk-XF5QKI75.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +34 -68
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs → ThreadArticle-ERUHPHVT.cjs} +7 -7
- package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs → ThreadMain-6DN7FDNB.cjs} +7 -7
- package/dist/lib/node/{chunk-BWBONZGU.cjs → chunk-6EVXCSDS.cjs} +5 -18
- package/dist/lib/node/chunk-6EVXCSDS.cjs.map +7 -0
- package/dist/lib/node/{chunk-4B2ARV7L.cjs → chunk-FXD3DYMO.cjs} +6 -6
- package/dist/lib/node/{chunk-T7TXCNHL.cjs → chunk-PZVUW4W2.cjs} +61 -59
- package/dist/lib/node/chunk-PZVUW4W2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +144 -178
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -4
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-NKI5F4W5.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-NKI5F4W5.mjs.map} +1 -1
- package/dist/lib/{browser/ThreadMain-DU6LBSN3.mjs → node-esm/ThreadMain-2A3VQLCW.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-2A3VQLCW.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-AVC4CGJM.mjs → chunk-A44C4MTQ.mjs} +9 -6
- package/dist/lib/node-esm/chunk-A44C4MTQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5IBJO53M.mjs → chunk-Y475KZTX.mjs} +4 -5
- package/dist/lib/node-esm/chunk-Y475KZTX.mjs.map +7 -0
- package/dist/lib/{browser/chunk-U5UVX4ZP.mjs → node-esm/chunk-YO46JGAE.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-U5UVX4ZP.mjs.map → chunk-YO46JGAE.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +35 -68
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -1
- package/dist/lib/node-esm/types.mjs +3 -2
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +2 -0
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/ThreadPlugin.tsx +27 -72
- package/src/components/ChatContainer.tsx +3 -4
- package/src/components/CommentsContainer.tsx +4 -4
- package/src/meta.tsx +1 -5
- package/dist/lib/browser/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/browser/chunk-AVC4CGJM.mjs.map +0 -7
- package/dist/lib/node/chunk-BWBONZGU.cjs.map +0 -7
- package/dist/lib/node/chunk-T7TXCNHL.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AVC4CGJM.mjs.map +0 -7
- /package/dist/lib/browser/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-4VU752F4.mjs.map} +0 -0
- /package/dist/lib/browser/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-ML3P4XSD.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-U5UVX4ZP.mjs.map → chunk-GJRBBPXI.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs.map → ThreadArticle-ERUHPHVT.cjs.map} +0 -0
- /package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs.map → ThreadMain-6DN7FDNB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-4B2ARV7L.cjs.map → chunk-FXD3DYMO.cjs.map} +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,26 +28,24 @@ 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_FXD3DYMO.ThreadAction,
|
|
32
32
|
ThreadPlugin: () => ThreadPlugin,
|
|
33
33
|
default: () => src_default,
|
|
34
|
-
useAnalyticsCallback: () =>
|
|
35
|
-
useOnEditAnalytics: () =>
|
|
36
|
-
useStatus: () =>
|
|
34
|
+
useAnalyticsCallback: () => import_chunk_PZVUW4W2.useAnalyticsCallback,
|
|
35
|
+
useOnEditAnalytics: () => import_chunk_PZVUW4W2.useOnEditAnalytics,
|
|
36
|
+
useStatus: () => import_chunk_PZVUW4W2.useStatus
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(node_exports);
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var import_react = require("@phosphor-icons/react");
|
|
39
|
+
var import_chunk_FXD3DYMO = require("./chunk-FXD3DYMO.cjs");
|
|
40
|
+
var import_chunk_PZVUW4W2 = require("./chunk-PZVUW4W2.cjs");
|
|
41
|
+
var import_chunk_6EVXCSDS = require("./chunk-6EVXCSDS.cjs");
|
|
43
42
|
var import_signals_core = require("@preact/signals-core");
|
|
44
|
-
var
|
|
43
|
+
var import_react = __toESM(require("react"));
|
|
45
44
|
var import_app_framework = require("@dxos/app-framework");
|
|
46
45
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
47
46
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
48
47
|
var import_local_storage = require("@dxos/local-storage");
|
|
49
48
|
var import_log = require("@dxos/log");
|
|
50
|
-
var import_plugin_attention = require("@dxos/plugin-attention");
|
|
51
49
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
52
50
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
53
51
|
var import_meta = require("@dxos/plugin-observability/meta");
|
|
@@ -57,12 +55,12 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
57
55
|
var import_react_ui_editor = require("@dxos/react-ui-editor");
|
|
58
56
|
var import_react_ui_thread = require("@dxos/react-ui-thread");
|
|
59
57
|
var import_util = require("@dxos/util");
|
|
58
|
+
var import_react2 = __toESM(require("react"));
|
|
60
59
|
var import_react3 = __toESM(require("react"));
|
|
61
|
-
var import_react4 = __toESM(require("react"));
|
|
62
60
|
var import_plugin_settings = require("@dxos/plugin-settings");
|
|
63
61
|
var import_react_ui = require("@dxos/react-ui");
|
|
64
|
-
var
|
|
65
|
-
var
|
|
62
|
+
var import_react4 = require("@phosphor-icons/react");
|
|
63
|
+
var import_react5 = __toESM(require("react"));
|
|
66
64
|
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
67
65
|
var import_types2 = require("@dxos/plugin-space/types");
|
|
68
66
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
@@ -72,34 +70,34 @@ var import_react_ui_editor2 = require("@dxos/react-ui-editor");
|
|
|
72
70
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
73
71
|
var import_react_ui_thread2 = require("@dxos/react-ui-thread");
|
|
74
72
|
var import_util2 = require("@dxos/util");
|
|
75
|
-
var
|
|
76
|
-
var
|
|
73
|
+
var import_react6 = require("@phosphor-icons/react");
|
|
74
|
+
var import_react7 = __toESM(require("react"));
|
|
77
75
|
var import_echo3 = require("@dxos/react-client/echo");
|
|
78
76
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
79
77
|
var import_react_ui_deck = require("@dxos/react-ui-deck");
|
|
80
78
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
81
|
-
var
|
|
79
|
+
var import_react8 = __toESM(require("react"));
|
|
82
80
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
83
81
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
84
82
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
85
83
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
86
84
|
var import_util3 = require("@dxos/util");
|
|
87
85
|
var ThreadSettings = ({ settings }) => {
|
|
88
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
89
|
-
return /* @__PURE__ */
|
|
86
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
87
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(import_plugin_settings.SettingsValue, {
|
|
90
88
|
label: t("settings standalone label")
|
|
91
|
-
}, /* @__PURE__ */
|
|
89
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Switch, {
|
|
92
90
|
checked: settings.standalone,
|
|
93
91
|
onCheckedChange: (checked) => settings.standalone = !!checked
|
|
94
92
|
})));
|
|
95
93
|
};
|
|
96
94
|
var sizeClass = (0, import_react_ui_theme.getSize)(4);
|
|
97
95
|
var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
98
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
96
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
99
97
|
const label = t(isResolved ? "mark as unresolved label" : "mark as resolved label");
|
|
100
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
101
99
|
asChild: true
|
|
102
|
-
}, /* @__PURE__ */
|
|
100
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
103
101
|
variant: "ghost",
|
|
104
102
|
"data-testid": "thread.toggle-resolved",
|
|
105
103
|
onClick: onResolve,
|
|
@@ -107,23 +105,23 @@ var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
|
107
105
|
"min-bs-0 p-1",
|
|
108
106
|
!isResolved && import_react_ui_theme.hoverableControlItem
|
|
109
107
|
]
|
|
110
|
-
}, /* @__PURE__ */
|
|
108
|
+
}, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
111
109
|
className: "sr-only"
|
|
112
|
-
}, label), isResolved ? /* @__PURE__ */
|
|
110
|
+
}, label), isResolved ? /* @__PURE__ */ import_react5.default.createElement(import_react4.CheckCircle, {
|
|
113
111
|
className: sizeClass,
|
|
114
112
|
weight: "fill"
|
|
115
|
-
}) : /* @__PURE__ */
|
|
113
|
+
}) : /* @__PURE__ */ import_react5.default.createElement(import_react4.CheckCircle, {
|
|
116
114
|
className: sizeClass
|
|
117
|
-
}))), /* @__PURE__ */
|
|
115
|
+
}))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
118
116
|
classNames: "z-[21]"
|
|
119
|
-
}, label, /* @__PURE__ */
|
|
117
|
+
}, label, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Arrow, null))));
|
|
120
118
|
};
|
|
121
119
|
var DeleteThreadButton = ({ onDelete }) => {
|
|
122
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
120
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
123
121
|
const label = t("delete thread label");
|
|
124
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
125
123
|
asChild: true
|
|
126
|
-
}, /* @__PURE__ */
|
|
124
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
127
125
|
variant: "ghost",
|
|
128
126
|
"data-testid": "thread.delete",
|
|
129
127
|
onClick: onDelete,
|
|
@@ -131,28 +129,28 @@ var DeleteThreadButton = ({ onDelete }) => {
|
|
|
131
129
|
"min-bs-0 p-1",
|
|
132
130
|
import_react_ui_theme.hoverableControlItem
|
|
133
131
|
]
|
|
134
|
-
}, /* @__PURE__ */
|
|
132
|
+
}, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
135
133
|
className: "sr-only"
|
|
136
|
-
}, label), /* @__PURE__ */
|
|
134
|
+
}, label), /* @__PURE__ */ import_react5.default.createElement(import_react4.X, {
|
|
137
135
|
className: sizeClass
|
|
138
|
-
}))), /* @__PURE__ */
|
|
136
|
+
}))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
139
137
|
classNames: "z-[21]"
|
|
140
|
-
}, label, /* @__PURE__ */
|
|
138
|
+
}, label, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Arrow, null))));
|
|
141
139
|
};
|
|
142
140
|
var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox, onAttend, onThreadDelete, onMessageDelete, onResolve, onComment }) => {
|
|
143
141
|
const identity = (0, import_halo.useIdentity)();
|
|
144
142
|
const space = (0, import_echo2.getSpace)(thread);
|
|
145
143
|
const members = (0, import_echo2.useMembers)(space?.key);
|
|
146
|
-
const activity = (0,
|
|
147
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
148
|
-
const threadScrollRef = (0,
|
|
149
|
-
const [autoFocus, setAutoFocus] = (0,
|
|
144
|
+
const activity = (0, import_chunk_PZVUW4W2.useStatus)(space, (0, import_echo2.fullyQualifiedId)(thread));
|
|
145
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
146
|
+
const threadScrollRef = (0, import_react5.useRef)(null);
|
|
147
|
+
const [autoFocus, setAutoFocus] = (0, import_react5.useState)(!!autoFocusTextbox);
|
|
150
148
|
const { themeMode } = (0, import_react_ui2.useThemeContext)();
|
|
151
|
-
const textboxMetadata = (0,
|
|
152
|
-
const [_count, _setCount] = (0,
|
|
149
|
+
const textboxMetadata = (0, import_chunk_PZVUW4W2.getMessageMetadata)((0, import_echo2.fullyQualifiedId)(thread), identity);
|
|
150
|
+
const [_count, _setCount] = (0, import_react5.useState)(0);
|
|
153
151
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
154
|
-
const messageRef = (0,
|
|
155
|
-
const extensions = (0,
|
|
152
|
+
const messageRef = (0, import_react5.useRef)("");
|
|
153
|
+
const extensions = (0, import_react5.useMemo)(() => [
|
|
156
154
|
(0, import_react_ui_editor2.createBasicExtensions)({
|
|
157
155
|
placeholder: t("message placeholder")
|
|
158
156
|
}),
|
|
@@ -162,11 +160,11 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
162
160
|
(0, import_react_ui_editor2.listener)({
|
|
163
161
|
onChange: (text) => messageRef.current = text
|
|
164
162
|
}),
|
|
165
|
-
|
|
163
|
+
import_chunk_PZVUW4W2.command
|
|
166
164
|
], [
|
|
167
165
|
_count
|
|
168
166
|
]);
|
|
169
|
-
(0,
|
|
167
|
+
(0, import_react5.useEffect)(() => {
|
|
170
168
|
setAutoFocus(!!autoFocusTextbox);
|
|
171
169
|
}, [
|
|
172
170
|
autoFocusTextbox
|
|
@@ -175,7 +173,7 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
175
173
|
behavior,
|
|
176
174
|
block: "end"
|
|
177
175
|
}), 10);
|
|
178
|
-
const handleCreate = (0,
|
|
176
|
+
const handleCreate = (0, import_react5.useCallback)(() => {
|
|
179
177
|
if (!messageRef.current) {
|
|
180
178
|
return false;
|
|
181
179
|
}
|
|
@@ -197,63 +195,66 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
197
195
|
thread,
|
|
198
196
|
identity
|
|
199
197
|
]);
|
|
200
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.Thread, {
|
|
201
199
|
onClickCapture: onAttend,
|
|
202
200
|
onFocusCapture: onAttend,
|
|
203
201
|
current,
|
|
204
202
|
id: (0, import_echo2.fullyQualifiedId)(thread)
|
|
205
|
-
}, /* @__PURE__ */
|
|
203
|
+
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
206
204
|
role: "none",
|
|
207
205
|
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)
|
|
208
|
-
}, detached ? /* @__PURE__ */
|
|
206
|
+
}, detached ? /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
209
207
|
asChild: true
|
|
210
|
-
}, /* @__PURE__ */
|
|
208
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.ThreadHeading, {
|
|
211
209
|
detached: true
|
|
212
|
-
}, thread.name ?? t("thread title placeholder"))), /* @__PURE__ */
|
|
210
|
+
}, thread.name ?? t("thread title placeholder"))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
213
211
|
classNames: "z-[21]",
|
|
214
212
|
side: "top"
|
|
215
|
-
}, t("detached thread label"), /* @__PURE__ */
|
|
213
|
+
}, t("detached thread label"), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Arrow, null)))) : /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.ThreadHeading, null, thread.name ?? t("thread title placeholder")), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
216
214
|
className: "flex flex-row items-center pli-1"
|
|
217
|
-
}, thread.status === "staged" && /* @__PURE__ */
|
|
215
|
+
}, thread.status === "staged" && /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tag, {
|
|
218
216
|
palette: "neutral"
|
|
219
|
-
}, t("draft button")), onResolve && !(thread?.status === "staged") && /* @__PURE__ */
|
|
217
|
+
}, t("draft button")), onResolve && !(thread?.status === "staged") && /* @__PURE__ */ import_react5.default.createElement(ToggleResolvedButton, {
|
|
220
218
|
isResolved: thread?.status === "resolved",
|
|
221
219
|
onResolve
|
|
222
|
-
}), onThreadDelete && /* @__PURE__ */
|
|
220
|
+
}), onThreadDelete && /* @__PURE__ */ import_react5.default.createElement(DeleteThreadButton, {
|
|
223
221
|
onDelete: onThreadDelete
|
|
224
|
-
}))), thread.messages.filter(import_util2.nonNullable).map((message) => /* @__PURE__ */
|
|
222
|
+
}))), thread.messages.filter(import_util2.nonNullable).map((message) => /* @__PURE__ */ import_react5.default.createElement(import_chunk_PZVUW4W2.MessageContainer, {
|
|
225
223
|
key: message.id,
|
|
226
224
|
message,
|
|
227
225
|
members,
|
|
228
226
|
onDelete: (id) => onMessageDelete?.(id)
|
|
229
|
-
})), /* @__PURE__ */
|
|
227
|
+
})), /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.MessageTextbox, {
|
|
230
228
|
extensions,
|
|
231
229
|
autoFocus,
|
|
232
230
|
onSend: handleCreate,
|
|
233
231
|
...textboxMetadata
|
|
234
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.ThreadFooter, {
|
|
235
233
|
activity
|
|
236
|
-
}, t("activity message")), /* @__PURE__ */
|
|
234
|
+
}, t("activity message")), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
237
235
|
role: "none",
|
|
238
236
|
className: "bs-px -mbs-px",
|
|
239
237
|
ref: threadScrollRef
|
|
240
238
|
}));
|
|
241
239
|
};
|
|
242
240
|
var CommentsHeading = ({ attendableId }) => {
|
|
243
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
244
|
-
return /* @__PURE__ */
|
|
241
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
242
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
245
243
|
role: "none",
|
|
246
244
|
className: "flex items-center"
|
|
247
|
-
}, /* @__PURE__ */
|
|
245
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_deck.PlankHeading.Button, {
|
|
248
246
|
attendableId
|
|
249
|
-
}, /* @__PURE__ */
|
|
247
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Icon, {
|
|
248
|
+
icon: "ph--quotes--regular",
|
|
249
|
+
size: 5
|
|
250
|
+
})), /* @__PURE__ */ import_react7.default.createElement(import_react_ui_deck.PlankHeading.Label, {
|
|
250
251
|
attendableId
|
|
251
252
|
}, t("comments heading")));
|
|
252
253
|
};
|
|
253
254
|
var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTextbox, showResolvedThreads, onThreadAttend, onThreadDelete, onMessageDelete, onThreadToggleResolved, ...props }) => {
|
|
254
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
255
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
255
256
|
const filteredThreads = showResolvedThreads ? threads : threads.filter((thread) => !(thread?.status === "resolved"));
|
|
256
|
-
(0,
|
|
257
|
+
(0, import_react7.useEffect)(() => {
|
|
257
258
|
if (currentId) {
|
|
258
259
|
document.getElementById(currentId)?.scrollIntoView({
|
|
259
260
|
behavior: "smooth",
|
|
@@ -263,9 +264,9 @@ var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTe
|
|
|
263
264
|
}, [
|
|
264
265
|
currentId
|
|
265
266
|
]);
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, filteredThreads.length > 0 ? filteredThreads.map((thread) => {
|
|
267
268
|
const threadId = (0, import_echo3.fullyQualifiedId)(thread);
|
|
268
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ import_react7.default.createElement(CommentContainer, {
|
|
269
270
|
key: threadId,
|
|
270
271
|
thread,
|
|
271
272
|
current: currentId === threadId,
|
|
@@ -285,50 +286,50 @@ var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTe
|
|
|
285
286
|
},
|
|
286
287
|
...props
|
|
287
288
|
});
|
|
288
|
-
}) : /* @__PURE__ */
|
|
289
|
+
}) : /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
289
290
|
role: "alert",
|
|
290
291
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "place-self-center border border-dashed border-neutral-400/50 rounded-lg text-center p-4 m-4")
|
|
291
|
-
}, /* @__PURE__ */
|
|
292
|
+
}, /* @__PURE__ */ import_react7.default.createElement("h2", {
|
|
292
293
|
className: "mbe-2 font-medium text-baseText"
|
|
293
|
-
}, t("no comments title")), /* @__PURE__ */
|
|
294
|
+
}, t("no comments title")), /* @__PURE__ */ import_react7.default.createElement("p", null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Trans, {
|
|
294
295
|
t,
|
|
295
296
|
i18nKey: "no comments message",
|
|
296
297
|
components: {
|
|
297
|
-
commentIcon: /* @__PURE__ */
|
|
298
|
+
commentIcon: /* @__PURE__ */ import_react7.default.createElement(import_react6.ChatText, {
|
|
298
299
|
className: "inline-block"
|
|
299
300
|
})
|
|
300
301
|
}
|
|
301
302
|
}))));
|
|
302
303
|
};
|
|
303
|
-
var ThreadMain =
|
|
304
|
-
var ThreadArticle =
|
|
304
|
+
var ThreadMain = import_react2.default.lazy(() => import("./ThreadMain-6DN7FDNB.cjs"));
|
|
305
|
+
var ThreadArticle = import_react2.default.lazy(() => import("./ThreadArticle-ERUHPHVT.cjs"));
|
|
305
306
|
var providesThreadsConfig = (plugin) => "thread" in plugin.provides ? plugin : void 0;
|
|
306
307
|
var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showResolvedThreads }) => {
|
|
307
308
|
const dispatch = (0, import_app_framework2.useIntentDispatcher)();
|
|
308
309
|
const threadsIntegrators = (0, import_app_framework2.useResolvePlugins)(providesThreadsConfig);
|
|
309
|
-
const threadProvides = (0,
|
|
310
|
+
const threadProvides = (0, import_react8.useMemo)(() => threadsIntegrators.map((p) => p.provides.thread), [
|
|
310
311
|
threadsIntegrators
|
|
311
312
|
]);
|
|
312
|
-
const createSort = (0,
|
|
313
|
+
const createSort = (0, import_react8.useMemo)(() => threadProvides.find((p) => p.predicate(subject))?.createSort, [
|
|
313
314
|
threadProvides,
|
|
314
315
|
subject
|
|
315
316
|
]);
|
|
316
|
-
const sort = (0,
|
|
317
|
+
const sort = (0, import_react8.useMemo)(() => createSort?.(subject), [
|
|
317
318
|
createSort,
|
|
318
319
|
subject
|
|
319
320
|
]);
|
|
320
|
-
const threads = (0,
|
|
321
|
+
const threads = (0, import_react8.useMemo)(() => {
|
|
321
322
|
return subject.threads.concat(stagedThreads ?? []).filter(import_util3.nonNullable);
|
|
322
323
|
}, [
|
|
323
324
|
JSON.stringify(subject.threads),
|
|
324
325
|
JSON.stringify(stagedThreads)
|
|
325
326
|
]);
|
|
326
|
-
const detachedIds = (0,
|
|
327
|
+
const detachedIds = (0, import_react8.useMemo)(() => {
|
|
327
328
|
return threads.filter(({ anchor }) => !anchor).map((thread) => (0, import_echo4.fullyQualifiedId)(thread));
|
|
328
329
|
}, [
|
|
329
330
|
threads
|
|
330
331
|
]);
|
|
331
|
-
(0,
|
|
332
|
+
(0, import_react8.useEffect)(() => {
|
|
332
333
|
if (!sort) {
|
|
333
334
|
return;
|
|
334
335
|
}
|
|
@@ -340,15 +341,15 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
340
341
|
const { attended } = (0, import_react_ui_attention.useAttentionContext)("Thread Complementary");
|
|
341
342
|
const qualifiedSubjectId = (0, import_echo4.fullyQualifiedId)(subject);
|
|
342
343
|
const attendableAttrs = (0, import_react_ui_attention.createAttendableAttributes)(qualifiedSubjectId);
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
344
345
|
role: "none",
|
|
345
346
|
className: "contents group/attention",
|
|
346
347
|
...attendableAttrs
|
|
347
|
-
}, role === "complementary" && /* @__PURE__ */
|
|
348
|
+
}, role === "complementary" && /* @__PURE__ */ import_react8.default.createElement(CommentsHeading, {
|
|
348
349
|
attendableId: qualifiedSubjectId
|
|
349
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Root, {
|
|
350
351
|
classNames: "row-span-2"
|
|
351
|
-
}, /* @__PURE__ */
|
|
352
|
+
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Viewport, null, /* @__PURE__ */ import_react8.default.createElement(CommentsContainer, {
|
|
352
353
|
threads,
|
|
353
354
|
detached: detachedIds,
|
|
354
355
|
currentId: attended.has(qualifiedSubjectId) ? current : void 0,
|
|
@@ -372,8 +373,8 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
372
373
|
},
|
|
373
374
|
onThreadDelete: (thread) => {
|
|
374
375
|
return dispatch({
|
|
375
|
-
plugin:
|
|
376
|
-
action:
|
|
376
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
377
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE,
|
|
377
378
|
data: {
|
|
378
379
|
subject,
|
|
379
380
|
thread
|
|
@@ -381,8 +382,8 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
381
382
|
});
|
|
382
383
|
},
|
|
383
384
|
onMessageDelete: (thread, messageId) => dispatch({
|
|
384
|
-
plugin:
|
|
385
|
-
action:
|
|
385
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
386
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE_MESSAGE,
|
|
386
387
|
data: {
|
|
387
388
|
subject,
|
|
388
389
|
thread,
|
|
@@ -390,30 +391,30 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
390
391
|
}
|
|
391
392
|
}),
|
|
392
393
|
onThreadToggleResolved: (thread) => dispatch({
|
|
393
|
-
plugin:
|
|
394
|
-
action:
|
|
394
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
395
|
+
action: import_chunk_FXD3DYMO.ThreadAction.TOGGLE_RESOLVED,
|
|
395
396
|
data: {
|
|
396
397
|
thread
|
|
397
398
|
}
|
|
398
399
|
}),
|
|
399
400
|
onComment: (thread) => {
|
|
400
401
|
void dispatch({
|
|
401
|
-
action:
|
|
402
|
+
action: import_chunk_FXD3DYMO.ThreadAction.ON_MESSAGE_ADD,
|
|
402
403
|
data: {
|
|
403
404
|
thread,
|
|
404
405
|
subject
|
|
405
406
|
}
|
|
406
407
|
});
|
|
407
408
|
}
|
|
408
|
-
}), /* @__PURE__ */
|
|
409
|
+
}), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
409
410
|
role: "none",
|
|
410
411
|
className: "bs-10"
|
|
411
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Scrollbar, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Thumb, null)))));
|
|
412
413
|
};
|
|
413
414
|
var translations_default = [
|
|
414
415
|
{
|
|
415
416
|
"en-US": {
|
|
416
|
-
[
|
|
417
|
+
[import_chunk_6EVXCSDS.THREAD_PLUGIN]: {
|
|
417
418
|
"plugin name": "Threads",
|
|
418
419
|
"channel name placeholder": "New channel",
|
|
419
420
|
"channel title label": "Title",
|
|
@@ -449,7 +450,7 @@ var initialViewState = {
|
|
|
449
450
|
showResolvedThreads: false
|
|
450
451
|
};
|
|
451
452
|
var ThreadPlugin = () => {
|
|
452
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
453
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
453
454
|
const state = (0, import_echo_schema2.create)({
|
|
454
455
|
staging: {}
|
|
455
456
|
});
|
|
@@ -462,12 +463,11 @@ var ThreadPlugin = () => {
|
|
|
462
463
|
}
|
|
463
464
|
return viewStore[subjectId];
|
|
464
465
|
};
|
|
465
|
-
let attentionPlugin;
|
|
466
466
|
let navigationPlugin;
|
|
467
467
|
let intentPlugin;
|
|
468
468
|
const unsubscribeCallbacks = [];
|
|
469
469
|
return {
|
|
470
|
-
meta:
|
|
470
|
+
meta: import_chunk_6EVXCSDS.meta_default,
|
|
471
471
|
ready: async (plugins) => {
|
|
472
472
|
settings.prop({
|
|
473
473
|
key: "standalone",
|
|
@@ -475,38 +475,8 @@ var ThreadPlugin = () => {
|
|
|
475
475
|
allowUndefined: true
|
|
476
476
|
})
|
|
477
477
|
});
|
|
478
|
-
attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
|
|
479
478
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
480
479
|
intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
|
|
481
|
-
const graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
482
|
-
const client = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin)?.provides.client;
|
|
483
|
-
if (!client) {
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
const channelsQuery = client.spaces.query(import_echo.Filter.schema(import_types.ChannelType));
|
|
487
|
-
const queryUnsubscribe = channelsQuery.subscribe();
|
|
488
|
-
const unsubscribe = (0, import_signals_core.effect)(() => {
|
|
489
|
-
const attention = attentionPlugin?.provides.attention;
|
|
490
|
-
if (!attention?.attended) {
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
const firstAttendedNodeWithComments = Array.from(attention.attended).map((id) => graphPlugin?.provides.graph.findNode(id)).find((node) => {
|
|
494
|
-
const data = node?.data;
|
|
495
|
-
return Array.isArray(data?.threads) && data.threads.length > 0;
|
|
496
|
-
});
|
|
497
|
-
if (firstAttendedNodeWithComments) {
|
|
498
|
-
void intentPlugin?.provides.intent.dispatch({
|
|
499
|
-
action: import_app_framework.NavigationAction.OPEN,
|
|
500
|
-
data: {
|
|
501
|
-
activeParts: {
|
|
502
|
-
complementary: `${firstAttendedNodeWithComments.id}${import_app_framework.SLUG_PATH_SEPARATOR}comments`
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
unsubscribeCallbacks.push(queryUnsubscribe);
|
|
509
|
-
unsubscribeCallbacks.push(unsubscribe);
|
|
510
480
|
},
|
|
511
481
|
unload: async () => {
|
|
512
482
|
unsubscribeCallbacks.forEach((unsubscribe) => unsubscribe());
|
|
@@ -519,11 +489,10 @@ var ThreadPlugin = () => {
|
|
|
519
489
|
placeholder: [
|
|
520
490
|
"channel title placeholder",
|
|
521
491
|
{
|
|
522
|
-
ns:
|
|
492
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
523
493
|
}
|
|
524
494
|
],
|
|
525
|
-
icon:
|
|
526
|
-
iconSymbol: "ph--chat--regular",
|
|
495
|
+
icon: "ph--chat--regular",
|
|
527
496
|
// TODO(wittjosiah): Move out of metadata.
|
|
528
497
|
loadReferences: (channel) => (0, import_echo.loadObjectReferences)(channel, (channel2) => channel2.threads)
|
|
529
498
|
},
|
|
@@ -535,7 +504,7 @@ var ThreadPlugin = () => {
|
|
|
535
504
|
// TODO(wittjosiah): Move out of metadata.
|
|
536
505
|
loadReferences: (message) => []
|
|
537
506
|
},
|
|
538
|
-
[
|
|
507
|
+
[import_chunk_6EVXCSDS.THREAD_ITEM]: {
|
|
539
508
|
parse: (item, type) => {
|
|
540
509
|
switch (type) {
|
|
541
510
|
case "node":
|
|
@@ -577,32 +546,38 @@ var ThreadPlugin = () => {
|
|
|
577
546
|
}
|
|
578
547
|
return [
|
|
579
548
|
(0, import_plugin_graph.createExtension)({
|
|
580
|
-
id: `${
|
|
549
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/comments-for-subject`,
|
|
581
550
|
resolver: ({ id }) => {
|
|
582
551
|
if (!id.endsWith("~comments")) {
|
|
583
552
|
return;
|
|
584
553
|
}
|
|
585
|
-
const
|
|
586
|
-
const [spaceId, objectId] =
|
|
554
|
+
const subjectId = id.split("~").at(0);
|
|
555
|
+
const [spaceId, objectId] = subjectId?.split(":") ?? [];
|
|
587
556
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
588
|
-
const
|
|
589
|
-
|
|
557
|
+
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
558
|
+
const timeout = setTimeout(async () => {
|
|
559
|
+
await space?.db.loadObjectById(objectId);
|
|
560
|
+
onChange();
|
|
561
|
+
});
|
|
562
|
+
return () => clearTimeout(timeout);
|
|
563
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
564
|
+
if (!object || !subjectId) {
|
|
590
565
|
return;
|
|
591
566
|
}
|
|
592
|
-
const
|
|
593
|
-
const label =
|
|
567
|
+
const meta = metadataResolver((0, import_echo_schema.getTypename)(object) ?? "");
|
|
568
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
594
569
|
"unnamed object threads label",
|
|
595
570
|
{
|
|
596
|
-
ns:
|
|
571
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
597
572
|
}
|
|
598
573
|
];
|
|
599
|
-
const viewState = getViewState(
|
|
574
|
+
const viewState = getViewState(subjectId);
|
|
600
575
|
return {
|
|
601
576
|
id,
|
|
602
577
|
type: "orphan-comments-for-subject",
|
|
603
|
-
data:
|
|
578
|
+
data: object,
|
|
604
579
|
properties: {
|
|
605
|
-
icon:
|
|
580
|
+
icon: meta.icon,
|
|
606
581
|
label,
|
|
607
582
|
showResolvedThreads: viewState.showResolvedThreads
|
|
608
583
|
}
|
|
@@ -632,26 +607,26 @@ var ThreadPlugin = () => {
|
|
|
632
607
|
};
|
|
633
608
|
return [
|
|
634
609
|
{
|
|
635
|
-
id: `${
|
|
610
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/toggle-show-resolved/${node.id}`,
|
|
636
611
|
data: toggle,
|
|
637
612
|
properties: {
|
|
638
613
|
label: [
|
|
639
614
|
"toggle show resolved",
|
|
640
615
|
{
|
|
641
|
-
ns:
|
|
616
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
642
617
|
}
|
|
643
618
|
],
|
|
644
619
|
menuItemType: "toggle",
|
|
645
620
|
isChecked: viewState.showResolvedThreads,
|
|
646
621
|
testId: "threadPlugin.toggleShowResolved",
|
|
647
|
-
|
|
622
|
+
icon: viewState.showResolvedThreads ? "ph--eye-slash--regular" : "ph--eye--regular"
|
|
648
623
|
}
|
|
649
624
|
}
|
|
650
625
|
];
|
|
651
626
|
}
|
|
652
627
|
}),
|
|
653
628
|
(0, import_plugin_graph.createExtension)({
|
|
654
|
-
id:
|
|
629
|
+
id: import_chunk_FXD3DYMO.ThreadAction.CREATE,
|
|
655
630
|
filter: (node) => !!settings.values.standalone && (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
|
|
656
631
|
actions: ({ node }) => {
|
|
657
632
|
const id = node.id.split("/").at(-1);
|
|
@@ -664,12 +639,12 @@ var ThreadPlugin = () => {
|
|
|
664
639
|
}
|
|
665
640
|
return [
|
|
666
641
|
{
|
|
667
|
-
id: `${
|
|
642
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/create/${node.id}`,
|
|
668
643
|
data: async () => {
|
|
669
644
|
await dispatch([
|
|
670
645
|
{
|
|
671
|
-
plugin:
|
|
672
|
-
action:
|
|
646
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
647
|
+
action: import_chunk_FXD3DYMO.ThreadAction.CREATE
|
|
673
648
|
},
|
|
674
649
|
{
|
|
675
650
|
action: import_plugin_space.SpaceAction.ADD_OBJECT,
|
|
@@ -686,11 +661,10 @@ var ThreadPlugin = () => {
|
|
|
686
661
|
label: [
|
|
687
662
|
"create channel label",
|
|
688
663
|
{
|
|
689
|
-
ns:
|
|
664
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
690
665
|
}
|
|
691
666
|
],
|
|
692
|
-
icon:
|
|
693
|
-
iconSymbol: "ph--chat--regular",
|
|
667
|
+
icon: "ph--chat--regular",
|
|
694
668
|
testId: "threadPlugin.createObject"
|
|
695
669
|
}
|
|
696
670
|
}
|
|
@@ -704,12 +678,12 @@ var ThreadPlugin = () => {
|
|
|
704
678
|
component: ({ data, role }) => {
|
|
705
679
|
switch (role) {
|
|
706
680
|
case "main": {
|
|
707
|
-
return data.active instanceof import_types.ChannelType && data.active.threads[0] ? /* @__PURE__ */
|
|
681
|
+
return data.active instanceof import_types.ChannelType && data.active.threads[0] ? /* @__PURE__ */ import_react.default.createElement(ThreadMain, {
|
|
708
682
|
thread: data.active.threads[0]
|
|
709
683
|
}) : null;
|
|
710
684
|
}
|
|
711
685
|
case "settings": {
|
|
712
|
-
return data.plugin ===
|
|
686
|
+
return data.plugin === import_chunk_6EVXCSDS.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(ThreadSettings, {
|
|
713
687
|
settings: settings.values
|
|
714
688
|
}) : null;
|
|
715
689
|
}
|
|
@@ -724,26 +698,26 @@ var ThreadPlugin = () => {
|
|
|
724
698
|
if (currentPosition > 0) {
|
|
725
699
|
const objectToTheLeft = layoutEntries[currentPosition - 1];
|
|
726
700
|
const context = (0, import_echo.getSpace)(data.object)?.db.getObjectById(objectToTheLeft.id);
|
|
727
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadArticle, {
|
|
728
702
|
thread: data.object.threads[0],
|
|
729
703
|
context
|
|
730
704
|
});
|
|
731
705
|
}
|
|
732
706
|
}
|
|
733
|
-
return /* @__PURE__ */
|
|
707
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadArticle, {
|
|
734
708
|
thread: data.object.threads[0]
|
|
735
709
|
});
|
|
736
710
|
}
|
|
737
711
|
if (data.subject instanceof import_types.ThreadType) {
|
|
738
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_chunk_PZVUW4W2.ChatHeading, {
|
|
739
713
|
attendableId: data.subject.id
|
|
740
|
-
}), /* @__PURE__ */
|
|
714
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_chunk_PZVUW4W2.ChatContainer, {
|
|
741
715
|
thread: data.subject
|
|
742
716
|
}));
|
|
743
717
|
}
|
|
744
718
|
if (data.subject && typeof data.subject === "object" && "threads" in data.subject && Array.isArray(data.subject.threads)) {
|
|
745
719
|
const { showResolvedThreads } = getViewState((0, import_echo.fullyQualifiedId)(data.subject));
|
|
746
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadComplementary, {
|
|
747
721
|
role,
|
|
748
722
|
subject: data.subject,
|
|
749
723
|
stagedThreads: state.staging[(0, import_echo.fullyQualifiedId)(data.subject)],
|
|
@@ -760,7 +734,7 @@ var ThreadPlugin = () => {
|
|
|
760
734
|
intent: {
|
|
761
735
|
resolver: async (intent) => {
|
|
762
736
|
switch (intent.action) {
|
|
763
|
-
case
|
|
737
|
+
case import_chunk_FXD3DYMO.ThreadAction.CREATE: {
|
|
764
738
|
if (intent.data && intent.data.cursor !== void 0) {
|
|
765
739
|
const { cursor, name, subject } = intent.data;
|
|
766
740
|
if (subject?.threads === void 0) {
|
|
@@ -769,7 +743,7 @@ var ThreadPlugin = () => {
|
|
|
769
743
|
} catch (e) {
|
|
770
744
|
import_log.log.error("Subject does not support threads array", subject?.typename, {
|
|
771
745
|
F: __dxlog_file,
|
|
772
|
-
L:
|
|
746
|
+
L: 332,
|
|
773
747
|
S: void 0,
|
|
774
748
|
C: (f, a) => f(...a)
|
|
775
749
|
});
|
|
@@ -796,15 +770,7 @@ var ThreadPlugin = () => {
|
|
|
796
770
|
intents: [
|
|
797
771
|
[
|
|
798
772
|
{
|
|
799
|
-
action:
|
|
800
|
-
data: {
|
|
801
|
-
activeParts: {
|
|
802
|
-
complementary: `${subjectId}${import_app_framework.SLUG_PATH_SEPARATOR}comments${import_app_framework.SLUG_COLLECTION_INDICATOR}`
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
action: import_chunk_4B2ARV7L.ThreadAction.SELECT,
|
|
773
|
+
action: import_chunk_FXD3DYMO.ThreadAction.SELECT,
|
|
808
774
|
data: {
|
|
809
775
|
current: (0, import_echo.fullyQualifiedId)(thread),
|
|
810
776
|
focus: true
|
|
@@ -833,14 +799,14 @@ var ThreadPlugin = () => {
|
|
|
833
799
|
};
|
|
834
800
|
}
|
|
835
801
|
}
|
|
836
|
-
case
|
|
802
|
+
case import_chunk_FXD3DYMO.ThreadAction.SELECT: {
|
|
837
803
|
state.focus = intent.data?.current === state.current ? state.focus : intent.data?.focus;
|
|
838
804
|
state.current = intent.data?.current;
|
|
839
805
|
return {
|
|
840
806
|
data: true
|
|
841
807
|
};
|
|
842
808
|
}
|
|
843
|
-
case
|
|
809
|
+
case import_chunk_FXD3DYMO.ThreadAction.TOGGLE_RESOLVED: {
|
|
844
810
|
const { thread } = intent.data ?? {};
|
|
845
811
|
if (!(thread instanceof import_types.ThreadType)) {
|
|
846
812
|
return;
|
|
@@ -869,7 +835,7 @@ var ThreadPlugin = () => {
|
|
|
869
835
|
]
|
|
870
836
|
};
|
|
871
837
|
}
|
|
872
|
-
case
|
|
838
|
+
case import_chunk_FXD3DYMO.ThreadAction.DELETE: {
|
|
873
839
|
const { subject, thread } = intent.data ?? {};
|
|
874
840
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
875
841
|
return;
|
|
@@ -898,7 +864,7 @@ var ThreadPlugin = () => {
|
|
|
898
864
|
space.db.remove(thread);
|
|
899
865
|
return {
|
|
900
866
|
undoable: {
|
|
901
|
-
message: translations_default[0]["en-US"][
|
|
867
|
+
message: translations_default[0]["en-US"][import_chunk_6EVXCSDS.THREAD_PLUGIN]["thread deleted label"],
|
|
902
868
|
data: {
|
|
903
869
|
cursor
|
|
904
870
|
}
|
|
@@ -941,7 +907,7 @@ var ThreadPlugin = () => {
|
|
|
941
907
|
}
|
|
942
908
|
break;
|
|
943
909
|
}
|
|
944
|
-
case
|
|
910
|
+
case import_chunk_FXD3DYMO.ThreadAction.ON_MESSAGE_ADD: {
|
|
945
911
|
const { thread, subject } = intent.data ?? {};
|
|
946
912
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject && Array.isArray(subject.threads))) {
|
|
947
913
|
return;
|
|
@@ -984,7 +950,7 @@ var ThreadPlugin = () => {
|
|
|
984
950
|
]
|
|
985
951
|
};
|
|
986
952
|
}
|
|
987
|
-
case
|
|
953
|
+
case import_chunk_FXD3DYMO.ThreadAction.DELETE_MESSAGE: {
|
|
988
954
|
const { subject, thread, messageId } = intent.data ?? {};
|
|
989
955
|
const space = (0, import_echo.getSpace)(subject);
|
|
990
956
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
@@ -1001,7 +967,7 @@ var ThreadPlugin = () => {
|
|
|
1001
967
|
intents: [
|
|
1002
968
|
[
|
|
1003
969
|
{
|
|
1004
|
-
action:
|
|
970
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE,
|
|
1005
971
|
data: {
|
|
1006
972
|
subject,
|
|
1007
973
|
thread
|
|
@@ -1015,7 +981,7 @@ var ThreadPlugin = () => {
|
|
|
1015
981
|
}
|
|
1016
982
|
return {
|
|
1017
983
|
undoable: {
|
|
1018
|
-
message: translations_default[0]["en-US"][
|
|
984
|
+
message: translations_default[0]["en-US"][import_chunk_6EVXCSDS.THREAD_PLUGIN]["message deleted label"],
|
|
1019
985
|
data: {
|
|
1020
986
|
message,
|
|
1021
987
|
messageIndex
|
|
@@ -1106,7 +1072,7 @@ var ThreadPlugin = () => {
|
|
|
1106
1072
|
"content"
|
|
1107
1073
|
]), start, end);
|
|
1108
1074
|
void intentPlugin?.provides.intent.dispatch({
|
|
1109
|
-
action:
|
|
1075
|
+
action: import_chunk_FXD3DYMO.ThreadAction.CREATE,
|
|
1110
1076
|
data: {
|
|
1111
1077
|
cursor,
|
|
1112
1078
|
name,
|
|
@@ -1142,7 +1108,7 @@ var ThreadPlugin = () => {
|
|
|
1142
1108
|
if (dispatch) {
|
|
1143
1109
|
void dispatch([
|
|
1144
1110
|
{
|
|
1145
|
-
action:
|
|
1111
|
+
action: import_chunk_FXD3DYMO.ThreadAction.SELECT,
|
|
1146
1112
|
data: {
|
|
1147
1113
|
current: current ?? closest
|
|
1148
1114
|
}
|