@dxos/plugin-thread 0.6.12-main.5cc132e → 0.6.12-main.7907542
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-4VU752F4.mjs} +3 -3
- package/dist/lib/{node-esm/ThreadMain-DU6LBSN3.mjs → browser/ThreadMain-ML3P4XSD.mjs} +3 -3
- package/dist/lib/browser/{chunk-5IBJO53M.mjs → chunk-7NUYW5IW.mjs} +2 -5
- package/dist/lib/browser/chunk-7NUYW5IW.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-U5UVX4ZP.mjs → browser/chunk-GJRBBPXI.mjs} +2 -2
- package/dist/lib/browser/{chunk-AVC4CGJM.mjs → chunk-XF5QKI75.mjs} +8 -6
- package/dist/lib/browser/chunk-XF5QKI75.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +46 -111
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs → ThreadArticle-ERUHPHVT.cjs} +7 -7
- package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs → ThreadMain-6DN7FDNB.cjs} +7 -7
- package/dist/lib/node/{chunk-BWBONZGU.cjs → chunk-6EVXCSDS.cjs} +5 -18
- package/dist/lib/node/chunk-6EVXCSDS.cjs.map +7 -0
- package/dist/lib/node/{chunk-4B2ARV7L.cjs → chunk-FXD3DYMO.cjs} +6 -6
- package/dist/lib/node/{chunk-T7TXCNHL.cjs → chunk-PZVUW4W2.cjs} +61 -59
- package/dist/lib/node/chunk-PZVUW4W2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +145 -210
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -4
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs → ThreadArticle-NKI5F4W5.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-NKI5F4W5.mjs.map} +1 -1
- package/dist/lib/{browser/ThreadMain-DU6LBSN3.mjs → node-esm/ThreadMain-2A3VQLCW.mjs} +4 -3
- package/dist/lib/node-esm/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-2A3VQLCW.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-AVC4CGJM.mjs → chunk-A44C4MTQ.mjs} +9 -6
- package/dist/lib/node-esm/chunk-A44C4MTQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5IBJO53M.mjs → chunk-Y475KZTX.mjs} +4 -5
- package/dist/lib/node-esm/chunk-Y475KZTX.mjs.map +7 -0
- package/dist/lib/{browser/chunk-U5UVX4ZP.mjs → node-esm/chunk-YO46JGAE.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-U5UVX4ZP.mjs.map → chunk-YO46JGAE.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +47 -111
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -1
- package/dist/lib/node-esm/types.mjs +3 -2
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentContainer.d.ts +1 -1
- package/dist/types/src/components/CommentContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +1 -5
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +1 -2
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +2 -0
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/ThreadPlugin.tsx +31 -78
- package/src/components/ChatContainer.tsx +3 -4
- package/src/components/CommentContainer.tsx +8 -12
- package/src/components/CommentsContainer.tsx +1 -18
- package/src/components/ThreadComplementary.tsx +5 -12
- package/src/meta.tsx +1 -5
- package/dist/lib/browser/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/browser/chunk-AVC4CGJM.mjs.map +0 -7
- package/dist/lib/node/chunk-BWBONZGU.cjs.map +0 -7
- package/dist/lib/node/chunk-T7TXCNHL.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-5IBJO53M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AVC4CGJM.mjs.map +0 -7
- /package/dist/lib/browser/{ThreadArticle-6L6BGE4Z.mjs.map → ThreadArticle-4VU752F4.mjs.map} +0 -0
- /package/dist/lib/browser/{ThreadMain-DU6LBSN3.mjs.map → ThreadMain-ML3P4XSD.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-U5UVX4ZP.mjs.map → chunk-GJRBBPXI.mjs.map} +0 -0
- /package/dist/lib/node/{ThreadArticle-7BWXVIJ4.cjs.map → ThreadArticle-ERUHPHVT.cjs.map} +0 -0
- /package/dist/lib/node/{ThreadMain-XSRB6NKJ.cjs.map → ThreadMain-6DN7FDNB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-4B2ARV7L.cjs.map → chunk-FXD3DYMO.cjs.map} +0 -0
package/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,33 @@ 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
|
-
var import_react_ui_deck = require("@dxos/react-ui-deck");
|
|
80
77
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
81
|
-
var
|
|
78
|
+
var import_react8 = __toESM(require("react"));
|
|
82
79
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
83
80
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
84
81
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
85
82
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
86
83
|
var import_util3 = require("@dxos/util");
|
|
87
84
|
var ThreadSettings = ({ settings }) => {
|
|
88
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
89
|
-
return /* @__PURE__ */
|
|
85
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
86
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(import_plugin_settings.SettingsValue, {
|
|
90
87
|
label: t("settings standalone label")
|
|
91
|
-
}, /* @__PURE__ */
|
|
88
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Switch, {
|
|
92
89
|
checked: settings.standalone,
|
|
93
90
|
onCheckedChange: (checked) => settings.standalone = !!checked
|
|
94
91
|
})));
|
|
95
92
|
};
|
|
96
93
|
var sizeClass = (0, import_react_ui_theme.getSize)(4);
|
|
97
94
|
var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
98
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
95
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
99
96
|
const label = t(isResolved ? "mark as unresolved label" : "mark as resolved label");
|
|
100
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
101
98
|
asChild: true
|
|
102
|
-
}, /* @__PURE__ */
|
|
99
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
103
100
|
variant: "ghost",
|
|
104
101
|
"data-testid": "thread.toggle-resolved",
|
|
105
102
|
onClick: onResolve,
|
|
@@ -107,23 +104,23 @@ var ToggleResolvedButton = ({ isResolved, onResolve }) => {
|
|
|
107
104
|
"min-bs-0 p-1",
|
|
108
105
|
!isResolved && import_react_ui_theme.hoverableControlItem
|
|
109
106
|
]
|
|
110
|
-
}, /* @__PURE__ */
|
|
107
|
+
}, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
111
108
|
className: "sr-only"
|
|
112
|
-
}, label), isResolved ? /* @__PURE__ */
|
|
109
|
+
}, label), isResolved ? /* @__PURE__ */ import_react5.default.createElement(import_react4.CheckCircle, {
|
|
113
110
|
className: sizeClass,
|
|
114
111
|
weight: "fill"
|
|
115
|
-
}) : /* @__PURE__ */
|
|
112
|
+
}) : /* @__PURE__ */ import_react5.default.createElement(import_react4.CheckCircle, {
|
|
116
113
|
className: sizeClass
|
|
117
|
-
}))), /* @__PURE__ */
|
|
114
|
+
}))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
118
115
|
classNames: "z-[21]"
|
|
119
|
-
}, label, /* @__PURE__ */
|
|
116
|
+
}, label, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Arrow, null))));
|
|
120
117
|
};
|
|
121
118
|
var DeleteThreadButton = ({ onDelete }) => {
|
|
122
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
119
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
123
120
|
const label = t("delete thread label");
|
|
124
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
125
122
|
asChild: true
|
|
126
|
-
}, /* @__PURE__ */
|
|
123
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
127
124
|
variant: "ghost",
|
|
128
125
|
"data-testid": "thread.delete",
|
|
129
126
|
onClick: onDelete,
|
|
@@ -131,28 +128,27 @@ var DeleteThreadButton = ({ onDelete }) => {
|
|
|
131
128
|
"min-bs-0 p-1",
|
|
132
129
|
import_react_ui_theme.hoverableControlItem
|
|
133
130
|
]
|
|
134
|
-
}, /* @__PURE__ */
|
|
131
|
+
}, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
135
132
|
className: "sr-only"
|
|
136
|
-
}, label), /* @__PURE__ */
|
|
133
|
+
}, label), /* @__PURE__ */ import_react5.default.createElement(import_react4.X, {
|
|
137
134
|
className: sizeClass
|
|
138
|
-
}))), /* @__PURE__ */
|
|
135
|
+
}))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
139
136
|
classNames: "z-[21]"
|
|
140
|
-
}, label, /* @__PURE__ */
|
|
137
|
+
}, label, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Arrow, null))));
|
|
141
138
|
};
|
|
142
|
-
var CommentContainer = ({ thread, detached, context, current,
|
|
139
|
+
var CommentContainer = ({ thread, detached, context, current, onAttend, onThreadDelete, onMessageDelete, onResolve, onComment }) => {
|
|
143
140
|
const identity = (0, import_halo.useIdentity)();
|
|
144
141
|
const space = (0, import_echo2.getSpace)(thread);
|
|
145
142
|
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, import_react6.useState)(!!autoFocusTextbox);
|
|
143
|
+
const activity = (0, import_chunk_PZVUW4W2.useStatus)(space, (0, import_echo2.fullyQualifiedId)(thread));
|
|
144
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
145
|
+
const threadScrollRef = (0, import_react5.useRef)(null);
|
|
150
146
|
const { themeMode } = (0, import_react_ui2.useThemeContext)();
|
|
151
|
-
const textboxMetadata = (0,
|
|
152
|
-
const [_count, _setCount] = (0,
|
|
147
|
+
const textboxMetadata = (0, import_chunk_PZVUW4W2.getMessageMetadata)((0, import_echo2.fullyQualifiedId)(thread), identity);
|
|
148
|
+
const [_count, _setCount] = (0, import_react5.useState)(0);
|
|
153
149
|
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
154
|
-
const messageRef = (0,
|
|
155
|
-
const extensions = (0,
|
|
150
|
+
const messageRef = (0, import_react5.useRef)("");
|
|
151
|
+
const extensions = (0, import_react5.useMemo)(() => [
|
|
156
152
|
(0, import_react_ui_editor2.createBasicExtensions)({
|
|
157
153
|
placeholder: t("message placeholder")
|
|
158
154
|
}),
|
|
@@ -162,20 +158,15 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
162
158
|
(0, import_react_ui_editor2.listener)({
|
|
163
159
|
onChange: (text) => messageRef.current = text
|
|
164
160
|
}),
|
|
165
|
-
|
|
161
|
+
import_chunk_PZVUW4W2.command
|
|
166
162
|
], [
|
|
167
163
|
_count
|
|
168
164
|
]);
|
|
169
|
-
(0, import_react6.useEffect)(() => {
|
|
170
|
-
setAutoFocus(!!autoFocusTextbox);
|
|
171
|
-
}, [
|
|
172
|
-
autoFocusTextbox
|
|
173
|
-
]);
|
|
174
165
|
const scrollToEnd = (behavior) => setTimeout(() => threadScrollRef.current?.scrollIntoView({
|
|
175
166
|
behavior,
|
|
176
167
|
block: "end"
|
|
177
168
|
}), 10);
|
|
178
|
-
const handleCreate = (0,
|
|
169
|
+
const handleCreate = (0, import_react5.useCallback)(() => {
|
|
179
170
|
if (!messageRef.current) {
|
|
180
171
|
return false;
|
|
181
172
|
}
|
|
@@ -189,7 +180,6 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
189
180
|
}));
|
|
190
181
|
onComment?.(thread);
|
|
191
182
|
messageRef.current = "";
|
|
192
|
-
setAutoFocus(true);
|
|
193
183
|
scrollToEnd("instant");
|
|
194
184
|
rerenderEditor();
|
|
195
185
|
return true;
|
|
@@ -197,63 +187,51 @@ var CommentContainer = ({ thread, detached, context, current, autoFocusTextbox,
|
|
|
197
187
|
thread,
|
|
198
188
|
identity
|
|
199
189
|
]);
|
|
200
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.Thread, {
|
|
201
191
|
onClickCapture: onAttend,
|
|
202
192
|
onFocusCapture: onAttend,
|
|
203
193
|
current,
|
|
204
194
|
id: (0, import_echo2.fullyQualifiedId)(thread)
|
|
205
|
-
}, /* @__PURE__ */
|
|
195
|
+
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
206
196
|
role: "none",
|
|
207
197
|
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__ */
|
|
198
|
+
}, detached ? /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
209
199
|
asChild: true
|
|
210
|
-
}, /* @__PURE__ */
|
|
200
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.ThreadHeading, {
|
|
211
201
|
detached: true
|
|
212
|
-
}, thread.name ?? t("thread title placeholder"))), /* @__PURE__ */
|
|
202
|
+
}, 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
203
|
classNames: "z-[21]",
|
|
214
204
|
side: "top"
|
|
215
|
-
}, t("detached thread label"), /* @__PURE__ */
|
|
205
|
+
}, 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
206
|
className: "flex flex-row items-center pli-1"
|
|
217
|
-
}, thread.status === "staged" && /* @__PURE__ */
|
|
207
|
+
}, thread.status === "staged" && /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Tag, {
|
|
218
208
|
palette: "neutral"
|
|
219
|
-
}, t("draft button")), onResolve && !(thread?.status === "staged") && /* @__PURE__ */
|
|
209
|
+
}, t("draft button")), onResolve && !(thread?.status === "staged") && /* @__PURE__ */ import_react5.default.createElement(ToggleResolvedButton, {
|
|
220
210
|
isResolved: thread?.status === "resolved",
|
|
221
211
|
onResolve
|
|
222
|
-
}), onThreadDelete && /* @__PURE__ */
|
|
212
|
+
}), onThreadDelete && /* @__PURE__ */ import_react5.default.createElement(DeleteThreadButton, {
|
|
223
213
|
onDelete: onThreadDelete
|
|
224
|
-
}))), thread.messages.filter(import_util2.nonNullable).map((message) => /* @__PURE__ */
|
|
214
|
+
}))), thread.messages.filter(import_util2.nonNullable).map((message) => /* @__PURE__ */ import_react5.default.createElement(import_chunk_PZVUW4W2.MessageContainer, {
|
|
225
215
|
key: message.id,
|
|
226
216
|
message,
|
|
227
217
|
members,
|
|
228
218
|
onDelete: (id) => onMessageDelete?.(id)
|
|
229
|
-
})), /* @__PURE__ */
|
|
219
|
+
})), /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.MessageTextbox, {
|
|
230
220
|
extensions,
|
|
231
|
-
autoFocus,
|
|
232
221
|
onSend: handleCreate,
|
|
233
222
|
...textboxMetadata
|
|
234
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui_thread2.ThreadFooter, {
|
|
235
224
|
activity
|
|
236
|
-
}, t("activity message")), /* @__PURE__ */
|
|
225
|
+
}, t("activity message")), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
237
226
|
role: "none",
|
|
238
227
|
className: "bs-px -mbs-px",
|
|
239
228
|
ref: threadScrollRef
|
|
240
229
|
}));
|
|
241
230
|
};
|
|
242
|
-
var
|
|
243
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
244
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
245
|
-
role: "none",
|
|
246
|
-
className: "flex items-center"
|
|
247
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_deck.PlankHeading.Button, {
|
|
248
|
-
attendableId
|
|
249
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react7.Quotes, import_react_ui_deck.plankHeadingIconProps)), /* @__PURE__ */ import_react8.default.createElement(import_react_ui_deck.PlankHeading.Label, {
|
|
250
|
-
attendableId
|
|
251
|
-
}, t("comments heading")));
|
|
252
|
-
};
|
|
253
|
-
var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTextbox, showResolvedThreads, onThreadAttend, onThreadDelete, onMessageDelete, onThreadToggleResolved, ...props }) => {
|
|
254
|
-
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_BWBONZGU.THREAD_PLUGIN);
|
|
231
|
+
var CommentsContainer = ({ threads, detached = [], currentId, showResolvedThreads, onThreadAttend, onThreadDelete, onMessageDelete, onThreadToggleResolved, ...props }) => {
|
|
232
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
255
233
|
const filteredThreads = showResolvedThreads ? threads : threads.filter((thread) => !(thread?.status === "resolved"));
|
|
256
|
-
(0,
|
|
234
|
+
(0, import_react7.useEffect)(() => {
|
|
257
235
|
if (currentId) {
|
|
258
236
|
document.getElementById(currentId)?.scrollIntoView({
|
|
259
237
|
behavior: "smooth",
|
|
@@ -263,14 +241,13 @@ var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTe
|
|
|
263
241
|
}, [
|
|
264
242
|
currentId
|
|
265
243
|
]);
|
|
266
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, filteredThreads.length > 0 ? filteredThreads.map((thread) => {
|
|
267
245
|
const threadId = (0, import_echo3.fullyQualifiedId)(thread);
|
|
268
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ import_react7.default.createElement(CommentContainer, {
|
|
269
247
|
key: threadId,
|
|
270
248
|
thread,
|
|
271
249
|
current: currentId === threadId,
|
|
272
250
|
detached: detached.includes(threadId),
|
|
273
|
-
autoFocusTextbox: autoFocusCurrentTextbox && currentId === threadId,
|
|
274
251
|
...onThreadAttend && {
|
|
275
252
|
onAttend: () => onThreadAttend(thread)
|
|
276
253
|
},
|
|
@@ -285,50 +262,50 @@ var CommentsContainer = ({ threads, detached = [], currentId, autoFocusCurrentTe
|
|
|
285
262
|
},
|
|
286
263
|
...props
|
|
287
264
|
});
|
|
288
|
-
}) : /* @__PURE__ */
|
|
265
|
+
}) : /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
289
266
|
role: "alert",
|
|
290
267
|
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__ */
|
|
268
|
+
}, /* @__PURE__ */ import_react7.default.createElement("h2", {
|
|
292
269
|
className: "mbe-2 font-medium text-baseText"
|
|
293
|
-
}, t("no comments title")), /* @__PURE__ */
|
|
270
|
+
}, t("no comments title")), /* @__PURE__ */ import_react7.default.createElement("p", null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Trans, {
|
|
294
271
|
t,
|
|
295
272
|
i18nKey: "no comments message",
|
|
296
273
|
components: {
|
|
297
|
-
commentIcon: /* @__PURE__ */
|
|
274
|
+
commentIcon: /* @__PURE__ */ import_react7.default.createElement(import_react6.ChatText, {
|
|
298
275
|
className: "inline-block"
|
|
299
276
|
})
|
|
300
277
|
}
|
|
301
278
|
}))));
|
|
302
279
|
};
|
|
303
|
-
var ThreadMain =
|
|
304
|
-
var ThreadArticle =
|
|
280
|
+
var ThreadMain = import_react2.default.lazy(() => import("./ThreadMain-6DN7FDNB.cjs"));
|
|
281
|
+
var ThreadArticle = import_react2.default.lazy(() => import("./ThreadArticle-ERUHPHVT.cjs"));
|
|
305
282
|
var providesThreadsConfig = (plugin) => "thread" in plugin.provides ? plugin : void 0;
|
|
306
|
-
var ThreadComplementary = ({ role, subject, stagedThreads, current,
|
|
283
|
+
var ThreadComplementary = ({ role, subject, stagedThreads, current, showResolvedThreads }) => {
|
|
307
284
|
const dispatch = (0, import_app_framework2.useIntentDispatcher)();
|
|
308
285
|
const threadsIntegrators = (0, import_app_framework2.useResolvePlugins)(providesThreadsConfig);
|
|
309
|
-
const threadProvides = (0,
|
|
286
|
+
const threadProvides = (0, import_react8.useMemo)(() => threadsIntegrators.map((p) => p.provides.thread), [
|
|
310
287
|
threadsIntegrators
|
|
311
288
|
]);
|
|
312
|
-
const createSort = (0,
|
|
289
|
+
const createSort = (0, import_react8.useMemo)(() => threadProvides.find((p) => p.predicate(subject))?.createSort, [
|
|
313
290
|
threadProvides,
|
|
314
291
|
subject
|
|
315
292
|
]);
|
|
316
|
-
const sort = (0,
|
|
293
|
+
const sort = (0, import_react8.useMemo)(() => createSort?.(subject), [
|
|
317
294
|
createSort,
|
|
318
295
|
subject
|
|
319
296
|
]);
|
|
320
|
-
const threads = (0,
|
|
297
|
+
const threads = (0, import_react8.useMemo)(() => {
|
|
321
298
|
return subject.threads.concat(stagedThreads ?? []).filter(import_util3.nonNullable);
|
|
322
299
|
}, [
|
|
323
300
|
JSON.stringify(subject.threads),
|
|
324
301
|
JSON.stringify(stagedThreads)
|
|
325
302
|
]);
|
|
326
|
-
const detachedIds = (0,
|
|
303
|
+
const detachedIds = (0, import_react8.useMemo)(() => {
|
|
327
304
|
return threads.filter(({ anchor }) => !anchor).map((thread) => (0, import_echo4.fullyQualifiedId)(thread));
|
|
328
305
|
}, [
|
|
329
306
|
threads
|
|
330
307
|
]);
|
|
331
|
-
(0,
|
|
308
|
+
(0, import_react8.useEffect)(() => {
|
|
332
309
|
if (!sort) {
|
|
333
310
|
return;
|
|
334
311
|
}
|
|
@@ -337,22 +314,17 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
337
314
|
sort,
|
|
338
315
|
threads
|
|
339
316
|
]);
|
|
340
|
-
const
|
|
317
|
+
const attended = (0, import_react_ui_attention.useAttended)();
|
|
341
318
|
const qualifiedSubjectId = (0, import_echo4.fullyQualifiedId)(subject);
|
|
342
|
-
|
|
343
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
319
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
344
320
|
role: "none",
|
|
345
|
-
className: "contents
|
|
346
|
-
|
|
347
|
-
}, role === "complementary" && /* @__PURE__ */ import_react9.default.createElement(CommentsHeading, {
|
|
348
|
-
attendableId: qualifiedSubjectId
|
|
349
|
-
}), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.ScrollArea.Root, {
|
|
321
|
+
className: "contents"
|
|
322
|
+
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Root, {
|
|
350
323
|
classNames: "row-span-2"
|
|
351
|
-
}, /* @__PURE__ */
|
|
324
|
+
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Viewport, null, /* @__PURE__ */ import_react8.default.createElement(CommentsContainer, {
|
|
352
325
|
threads,
|
|
353
326
|
detached: detachedIds,
|
|
354
|
-
currentId: attended.
|
|
355
|
-
autoFocusCurrentTextbox: focus,
|
|
327
|
+
currentId: attended.includes(qualifiedSubjectId) ? current : void 0,
|
|
356
328
|
showResolvedThreads,
|
|
357
329
|
onThreadAttend: (thread) => {
|
|
358
330
|
const threadId = (0, import_echo4.fullyQualifiedId)(thread);
|
|
@@ -372,8 +344,8 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
372
344
|
},
|
|
373
345
|
onThreadDelete: (thread) => {
|
|
374
346
|
return dispatch({
|
|
375
|
-
plugin:
|
|
376
|
-
action:
|
|
347
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
348
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE,
|
|
377
349
|
data: {
|
|
378
350
|
subject,
|
|
379
351
|
thread
|
|
@@ -381,8 +353,8 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
381
353
|
});
|
|
382
354
|
},
|
|
383
355
|
onMessageDelete: (thread, messageId) => dispatch({
|
|
384
|
-
plugin:
|
|
385
|
-
action:
|
|
356
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
357
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE_MESSAGE,
|
|
386
358
|
data: {
|
|
387
359
|
subject,
|
|
388
360
|
thread,
|
|
@@ -390,30 +362,30 @@ var ThreadComplementary = ({ role, subject, stagedThreads, current, focus, showR
|
|
|
390
362
|
}
|
|
391
363
|
}),
|
|
392
364
|
onThreadToggleResolved: (thread) => dispatch({
|
|
393
|
-
plugin:
|
|
394
|
-
action:
|
|
365
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
366
|
+
action: import_chunk_FXD3DYMO.ThreadAction.TOGGLE_RESOLVED,
|
|
395
367
|
data: {
|
|
396
368
|
thread
|
|
397
369
|
}
|
|
398
370
|
}),
|
|
399
371
|
onComment: (thread) => {
|
|
400
372
|
void dispatch({
|
|
401
|
-
action:
|
|
373
|
+
action: import_chunk_FXD3DYMO.ThreadAction.ON_MESSAGE_ADD,
|
|
402
374
|
data: {
|
|
403
375
|
thread,
|
|
404
376
|
subject
|
|
405
377
|
}
|
|
406
378
|
});
|
|
407
379
|
}
|
|
408
|
-
}), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
409
381
|
role: "none",
|
|
410
382
|
className: "bs-10"
|
|
411
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Scrollbar, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.ScrollArea.Thumb, null)))));
|
|
412
384
|
};
|
|
413
385
|
var translations_default = [
|
|
414
386
|
{
|
|
415
387
|
"en-US": {
|
|
416
|
-
[
|
|
388
|
+
[import_chunk_6EVXCSDS.THREAD_PLUGIN]: {
|
|
417
389
|
"plugin name": "Threads",
|
|
418
390
|
"channel name placeholder": "New channel",
|
|
419
391
|
"channel title label": "Title",
|
|
@@ -449,7 +421,7 @@ var initialViewState = {
|
|
|
449
421
|
showResolvedThreads: false
|
|
450
422
|
};
|
|
451
423
|
var ThreadPlugin = () => {
|
|
452
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
424
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_6EVXCSDS.THREAD_PLUGIN);
|
|
453
425
|
const state = (0, import_echo_schema2.create)({
|
|
454
426
|
staging: {}
|
|
455
427
|
});
|
|
@@ -462,12 +434,11 @@ var ThreadPlugin = () => {
|
|
|
462
434
|
}
|
|
463
435
|
return viewStore[subjectId];
|
|
464
436
|
};
|
|
465
|
-
let attentionPlugin;
|
|
466
437
|
let navigationPlugin;
|
|
467
438
|
let intentPlugin;
|
|
468
439
|
const unsubscribeCallbacks = [];
|
|
469
440
|
return {
|
|
470
|
-
meta:
|
|
441
|
+
meta: import_chunk_6EVXCSDS.meta_default,
|
|
471
442
|
ready: async (plugins) => {
|
|
472
443
|
settings.prop({
|
|
473
444
|
key: "standalone",
|
|
@@ -475,38 +446,8 @@ var ThreadPlugin = () => {
|
|
|
475
446
|
allowUndefined: true
|
|
476
447
|
})
|
|
477
448
|
});
|
|
478
|
-
attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
|
|
479
449
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
480
450
|
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
451
|
},
|
|
511
452
|
unload: async () => {
|
|
512
453
|
unsubscribeCallbacks.forEach((unsubscribe) => unsubscribe());
|
|
@@ -519,11 +460,10 @@ var ThreadPlugin = () => {
|
|
|
519
460
|
placeholder: [
|
|
520
461
|
"channel title placeholder",
|
|
521
462
|
{
|
|
522
|
-
ns:
|
|
463
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
523
464
|
}
|
|
524
465
|
],
|
|
525
|
-
icon:
|
|
526
|
-
iconSymbol: "ph--chat--regular",
|
|
466
|
+
icon: "ph--chat--regular",
|
|
527
467
|
// TODO(wittjosiah): Move out of metadata.
|
|
528
468
|
loadReferences: (channel) => (0, import_echo.loadObjectReferences)(channel, (channel2) => channel2.threads)
|
|
529
469
|
},
|
|
@@ -535,7 +475,7 @@ var ThreadPlugin = () => {
|
|
|
535
475
|
// TODO(wittjosiah): Move out of metadata.
|
|
536
476
|
loadReferences: (message) => []
|
|
537
477
|
},
|
|
538
|
-
[
|
|
478
|
+
[import_chunk_6EVXCSDS.THREAD_ITEM]: {
|
|
539
479
|
parse: (item, type) => {
|
|
540
480
|
switch (type) {
|
|
541
481
|
case "node":
|
|
@@ -577,34 +517,41 @@ var ThreadPlugin = () => {
|
|
|
577
517
|
}
|
|
578
518
|
return [
|
|
579
519
|
(0, import_plugin_graph.createExtension)({
|
|
580
|
-
id: `${
|
|
520
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/comments-for-subject`,
|
|
581
521
|
resolver: ({ id }) => {
|
|
582
522
|
if (!id.endsWith("~comments")) {
|
|
583
523
|
return;
|
|
584
524
|
}
|
|
585
|
-
const
|
|
586
|
-
const [spaceId, objectId] =
|
|
525
|
+
const subjectId = id.split("~").at(0);
|
|
526
|
+
const [spaceId, objectId] = subjectId?.split(":") ?? [];
|
|
587
527
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
588
|
-
const
|
|
589
|
-
|
|
528
|
+
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
529
|
+
const timeout = setTimeout(async () => {
|
|
530
|
+
await space?.db.loadObjectById(objectId);
|
|
531
|
+
onChange();
|
|
532
|
+
});
|
|
533
|
+
return () => clearTimeout(timeout);
|
|
534
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
535
|
+
if (!object || !subjectId) {
|
|
590
536
|
return;
|
|
591
537
|
}
|
|
592
|
-
const
|
|
593
|
-
const label =
|
|
538
|
+
const meta = metadataResolver((0, import_echo_schema.getTypename)(object) ?? "");
|
|
539
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
594
540
|
"unnamed object threads label",
|
|
595
541
|
{
|
|
596
|
-
ns:
|
|
542
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
597
543
|
}
|
|
598
544
|
];
|
|
599
|
-
const viewState = getViewState(
|
|
545
|
+
const viewState = getViewState(subjectId);
|
|
600
546
|
return {
|
|
601
547
|
id,
|
|
602
548
|
type: "orphan-comments-for-subject",
|
|
603
|
-
data:
|
|
549
|
+
data: null,
|
|
604
550
|
properties: {
|
|
605
|
-
icon:
|
|
551
|
+
icon: "ph--chat-text--regular",
|
|
606
552
|
label,
|
|
607
|
-
showResolvedThreads: viewState.showResolvedThreads
|
|
553
|
+
showResolvedThreads: viewState.showResolvedThreads,
|
|
554
|
+
object
|
|
608
555
|
}
|
|
609
556
|
};
|
|
610
557
|
},
|
|
@@ -632,26 +579,26 @@ var ThreadPlugin = () => {
|
|
|
632
579
|
};
|
|
633
580
|
return [
|
|
634
581
|
{
|
|
635
|
-
id: `${
|
|
582
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/toggle-show-resolved/${node.id}`,
|
|
636
583
|
data: toggle,
|
|
637
584
|
properties: {
|
|
638
585
|
label: [
|
|
639
586
|
"toggle show resolved",
|
|
640
587
|
{
|
|
641
|
-
ns:
|
|
588
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
642
589
|
}
|
|
643
590
|
],
|
|
644
591
|
menuItemType: "toggle",
|
|
645
592
|
isChecked: viewState.showResolvedThreads,
|
|
646
593
|
testId: "threadPlugin.toggleShowResolved",
|
|
647
|
-
|
|
594
|
+
icon: viewState.showResolvedThreads ? "ph--eye-slash--regular" : "ph--eye--regular"
|
|
648
595
|
}
|
|
649
596
|
}
|
|
650
597
|
];
|
|
651
598
|
}
|
|
652
599
|
}),
|
|
653
600
|
(0, import_plugin_graph.createExtension)({
|
|
654
|
-
id:
|
|
601
|
+
id: import_chunk_FXD3DYMO.ThreadAction.CREATE,
|
|
655
602
|
filter: (node) => !!settings.values.standalone && (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
|
|
656
603
|
actions: ({ node }) => {
|
|
657
604
|
const id = node.id.split("/").at(-1);
|
|
@@ -664,12 +611,12 @@ var ThreadPlugin = () => {
|
|
|
664
611
|
}
|
|
665
612
|
return [
|
|
666
613
|
{
|
|
667
|
-
id: `${
|
|
614
|
+
id: `${import_chunk_6EVXCSDS.THREAD_PLUGIN}/create/${node.id}`,
|
|
668
615
|
data: async () => {
|
|
669
616
|
await dispatch([
|
|
670
617
|
{
|
|
671
|
-
plugin:
|
|
672
|
-
action:
|
|
618
|
+
plugin: import_chunk_6EVXCSDS.THREAD_PLUGIN,
|
|
619
|
+
action: import_chunk_FXD3DYMO.ThreadAction.CREATE
|
|
673
620
|
},
|
|
674
621
|
{
|
|
675
622
|
action: import_plugin_space.SpaceAction.ADD_OBJECT,
|
|
@@ -686,11 +633,10 @@ var ThreadPlugin = () => {
|
|
|
686
633
|
label: [
|
|
687
634
|
"create channel label",
|
|
688
635
|
{
|
|
689
|
-
ns:
|
|
636
|
+
ns: import_chunk_6EVXCSDS.THREAD_PLUGIN
|
|
690
637
|
}
|
|
691
638
|
],
|
|
692
|
-
icon:
|
|
693
|
-
iconSymbol: "ph--chat--regular",
|
|
639
|
+
icon: "ph--chat--regular",
|
|
694
640
|
testId: "threadPlugin.createObject"
|
|
695
641
|
}
|
|
696
642
|
}
|
|
@@ -704,12 +650,12 @@ var ThreadPlugin = () => {
|
|
|
704
650
|
component: ({ data, role }) => {
|
|
705
651
|
switch (role) {
|
|
706
652
|
case "main": {
|
|
707
|
-
return data.active instanceof import_types.ChannelType && data.active.threads[0] ? /* @__PURE__ */
|
|
653
|
+
return data.active instanceof import_types.ChannelType && data.active.threads[0] ? /* @__PURE__ */ import_react.default.createElement(ThreadMain, {
|
|
708
654
|
thread: data.active.threads[0]
|
|
709
655
|
}) : null;
|
|
710
656
|
}
|
|
711
657
|
case "settings": {
|
|
712
|
-
return data.plugin ===
|
|
658
|
+
return data.plugin === import_chunk_6EVXCSDS.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(ThreadSettings, {
|
|
713
659
|
settings: settings.values
|
|
714
660
|
}) : null;
|
|
715
661
|
}
|
|
@@ -724,31 +670,30 @@ var ThreadPlugin = () => {
|
|
|
724
670
|
if (currentPosition > 0) {
|
|
725
671
|
const objectToTheLeft = layoutEntries[currentPosition - 1];
|
|
726
672
|
const context = (0, import_echo.getSpace)(data.object)?.db.getObjectById(objectToTheLeft.id);
|
|
727
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadArticle, {
|
|
728
674
|
thread: data.object.threads[0],
|
|
729
675
|
context
|
|
730
676
|
});
|
|
731
677
|
}
|
|
732
678
|
}
|
|
733
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadArticle, {
|
|
734
680
|
thread: data.object.threads[0]
|
|
735
681
|
});
|
|
736
682
|
}
|
|
737
683
|
if (data.subject instanceof import_types.ThreadType) {
|
|
738
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_chunk_PZVUW4W2.ChatHeading, {
|
|
739
685
|
attendableId: data.subject.id
|
|
740
|
-
}), /* @__PURE__ */
|
|
686
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_chunk_PZVUW4W2.ChatContainer, {
|
|
741
687
|
thread: data.subject
|
|
742
688
|
}));
|
|
743
689
|
}
|
|
744
690
|
if (data.subject && typeof data.subject === "object" && "threads" in data.subject && Array.isArray(data.subject.threads)) {
|
|
745
691
|
const { showResolvedThreads } = getViewState((0, import_echo.fullyQualifiedId)(data.subject));
|
|
746
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ import_react.default.createElement(ThreadComplementary, {
|
|
747
693
|
role,
|
|
748
694
|
subject: data.subject,
|
|
749
695
|
stagedThreads: state.staging[(0, import_echo.fullyQualifiedId)(data.subject)],
|
|
750
696
|
current: state.current,
|
|
751
|
-
focus: true,
|
|
752
697
|
showResolvedThreads
|
|
753
698
|
});
|
|
754
699
|
}
|
|
@@ -760,7 +705,7 @@ var ThreadPlugin = () => {
|
|
|
760
705
|
intent: {
|
|
761
706
|
resolver: async (intent) => {
|
|
762
707
|
switch (intent.action) {
|
|
763
|
-
case
|
|
708
|
+
case import_chunk_FXD3DYMO.ThreadAction.CREATE: {
|
|
764
709
|
if (intent.data && intent.data.cursor !== void 0) {
|
|
765
710
|
const { cursor, name, subject } = intent.data;
|
|
766
711
|
if (subject?.threads === void 0) {
|
|
@@ -769,7 +714,7 @@ var ThreadPlugin = () => {
|
|
|
769
714
|
} catch (e) {
|
|
770
715
|
import_log.log.error("Subject does not support threads array", subject?.typename, {
|
|
771
716
|
F: __dxlog_file,
|
|
772
|
-
L:
|
|
717
|
+
L: 331,
|
|
773
718
|
S: void 0,
|
|
774
719
|
C: (f, a) => f(...a)
|
|
775
720
|
});
|
|
@@ -796,18 +741,9 @@ var ThreadPlugin = () => {
|
|
|
796
741
|
intents: [
|
|
797
742
|
[
|
|
798
743
|
{
|
|
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,
|
|
744
|
+
action: import_chunk_FXD3DYMO.ThreadAction.SELECT,
|
|
808
745
|
data: {
|
|
809
|
-
current: (0, import_echo.fullyQualifiedId)(thread)
|
|
810
|
-
focus: true
|
|
746
|
+
current: (0, import_echo.fullyQualifiedId)(thread)
|
|
811
747
|
}
|
|
812
748
|
},
|
|
813
749
|
{
|
|
@@ -833,14 +769,13 @@ var ThreadPlugin = () => {
|
|
|
833
769
|
};
|
|
834
770
|
}
|
|
835
771
|
}
|
|
836
|
-
case
|
|
837
|
-
state.focus = intent.data?.current === state.current ? state.focus : intent.data?.focus;
|
|
772
|
+
case import_chunk_FXD3DYMO.ThreadAction.SELECT: {
|
|
838
773
|
state.current = intent.data?.current;
|
|
839
774
|
return {
|
|
840
775
|
data: true
|
|
841
776
|
};
|
|
842
777
|
}
|
|
843
|
-
case
|
|
778
|
+
case import_chunk_FXD3DYMO.ThreadAction.TOGGLE_RESOLVED: {
|
|
844
779
|
const { thread } = intent.data ?? {};
|
|
845
780
|
if (!(thread instanceof import_types.ThreadType)) {
|
|
846
781
|
return;
|
|
@@ -869,7 +804,7 @@ var ThreadPlugin = () => {
|
|
|
869
804
|
]
|
|
870
805
|
};
|
|
871
806
|
}
|
|
872
|
-
case
|
|
807
|
+
case import_chunk_FXD3DYMO.ThreadAction.DELETE: {
|
|
873
808
|
const { subject, thread } = intent.data ?? {};
|
|
874
809
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
875
810
|
return;
|
|
@@ -898,7 +833,7 @@ var ThreadPlugin = () => {
|
|
|
898
833
|
space.db.remove(thread);
|
|
899
834
|
return {
|
|
900
835
|
undoable: {
|
|
901
|
-
message: translations_default[0]["en-US"][
|
|
836
|
+
message: translations_default[0]["en-US"][import_chunk_6EVXCSDS.THREAD_PLUGIN]["thread deleted label"],
|
|
902
837
|
data: {
|
|
903
838
|
cursor
|
|
904
839
|
}
|
|
@@ -941,7 +876,7 @@ var ThreadPlugin = () => {
|
|
|
941
876
|
}
|
|
942
877
|
break;
|
|
943
878
|
}
|
|
944
|
-
case
|
|
879
|
+
case import_chunk_FXD3DYMO.ThreadAction.ON_MESSAGE_ADD: {
|
|
945
880
|
const { thread, subject } = intent.data ?? {};
|
|
946
881
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject && Array.isArray(subject.threads))) {
|
|
947
882
|
return;
|
|
@@ -984,7 +919,7 @@ var ThreadPlugin = () => {
|
|
|
984
919
|
]
|
|
985
920
|
};
|
|
986
921
|
}
|
|
987
|
-
case
|
|
922
|
+
case import_chunk_FXD3DYMO.ThreadAction.DELETE_MESSAGE: {
|
|
988
923
|
const { subject, thread, messageId } = intent.data ?? {};
|
|
989
924
|
const space = (0, import_echo.getSpace)(subject);
|
|
990
925
|
if (!(thread instanceof import_types.ThreadType) || !(subject && typeof subject === "object" && "threads" in subject)) {
|
|
@@ -1001,7 +936,7 @@ var ThreadPlugin = () => {
|
|
|
1001
936
|
intents: [
|
|
1002
937
|
[
|
|
1003
938
|
{
|
|
1004
|
-
action:
|
|
939
|
+
action: import_chunk_FXD3DYMO.ThreadAction.DELETE,
|
|
1005
940
|
data: {
|
|
1006
941
|
subject,
|
|
1007
942
|
thread
|
|
@@ -1015,7 +950,7 @@ var ThreadPlugin = () => {
|
|
|
1015
950
|
}
|
|
1016
951
|
return {
|
|
1017
952
|
undoable: {
|
|
1018
|
-
message: translations_default[0]["en-US"][
|
|
953
|
+
message: translations_default[0]["en-US"][import_chunk_6EVXCSDS.THREAD_PLUGIN]["message deleted label"],
|
|
1019
954
|
data: {
|
|
1020
955
|
message,
|
|
1021
956
|
messageIndex
|
|
@@ -1094,19 +1029,19 @@ var ThreadPlugin = () => {
|
|
|
1094
1029
|
});
|
|
1095
1030
|
}
|
|
1096
1031
|
}),
|
|
1097
|
-
(0, import_react_ui_editor.createExternalCommentSync)(doc
|
|
1032
|
+
(0, import_react_ui_editor.createExternalCommentSync)((0, import_echo.fullyQualifiedId)(doc), (sink) => (0, import_signals_core.effect)(() => sink()), () => threads.value.filter((thread) => thread?.anchor).map((thread) => ({
|
|
1098
1033
|
id: (0, import_echo.fullyQualifiedId)(thread),
|
|
1099
1034
|
cursor: thread.anchor
|
|
1100
1035
|
}))),
|
|
1101
1036
|
(0, import_react_ui_editor.comments)({
|
|
1102
|
-
id: doc
|
|
1037
|
+
id: (0, import_echo.fullyQualifiedId)(doc),
|
|
1103
1038
|
onCreate: ({ cursor }) => {
|
|
1104
1039
|
const [start, end] = cursor.split(":");
|
|
1105
1040
|
const name = doc.content && (0, import_echo.getTextInRange)((0, import_echo.createDocAccessor)(doc.content, [
|
|
1106
1041
|
"content"
|
|
1107
1042
|
]), start, end);
|
|
1108
1043
|
void intentPlugin?.provides.intent.dispatch({
|
|
1109
|
-
action:
|
|
1044
|
+
action: import_chunk_FXD3DYMO.ThreadAction.CREATE,
|
|
1110
1045
|
data: {
|
|
1111
1046
|
cursor,
|
|
1112
1047
|
name,
|
|
@@ -1142,7 +1077,7 @@ var ThreadPlugin = () => {
|
|
|
1142
1077
|
if (dispatch) {
|
|
1143
1078
|
void dispatch([
|
|
1144
1079
|
{
|
|
1145
|
-
action:
|
|
1080
|
+
action: import_chunk_FXD3DYMO.ThreadAction.SELECT,
|
|
1146
1081
|
data: {
|
|
1147
1082
|
current: current ?? closest
|
|
1148
1083
|
}
|