@univerjs/thread-comment-ui 0.1.12 → 0.1.13-nightly.202406041140
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/lib/cjs/index.js +3 -3
- package/lib/es/index.js +287 -329
- package/lib/locale/en-US.json +33 -0
- package/lib/locale/ru-RU.json +33 -0
- package/lib/locale/zh-CN.json +33 -0
- package/lib/types/controllers/thread-comment-ui.controller.d.ts +0 -1
- package/lib/types/plugin.d.ts +4 -5
- package/lib/types/types/const.d.ts +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +15 -14
- package/LICENSE +0 -176
- package/lib/types/locale/index.d.ts +0 -18
package/lib/es/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UniverThreadCommentPlugin as
|
|
5
|
-
import { Disposable as
|
|
6
|
-
import { Inject as te, createIdentifier as ze, Injector as
|
|
7
|
-
import { ISidebarService as
|
|
8
|
-
import { BehaviorSubject as re, filter as
|
|
9
|
-
import
|
|
10
|
-
import { useDependency as
|
|
11
|
-
import { Mentions as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
for (var
|
|
17
|
-
(s = t[i]) && (
|
|
18
|
-
return
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var He = (t, e, n) => e in t ? ke(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var H = (t, e, n) => (He(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { UniverThreadCommentPlugin as $e, ThreadCommentModel as de, AddCommentCommand as Oe, UpdateCommentCommand as Pe, ResolveCommentCommand as we, DeleteCommentTreeCommand as ce, DeleteCommentCommand as Re } from "@univerjs/thread-comment";
|
|
5
|
+
import { Disposable as ue, UniverInstanceType as he, IUniverInstanceService as De, CommandType as Ce, OnLifecycle as Le, LifecycleStages as Ae, LocaleService as J, Plugin as Ve, mergeOverrideWithDependencies as je, DependentOn as Be, ICommandService as Q, CustomRangeType as We, UserManagerService as ee, Tools as Fe } from "@univerjs/core";
|
|
6
|
+
import { Inject as te, createIdentifier as ze, Injector as Ze } from "@wendellhu/redi";
|
|
7
|
+
import { ISidebarService as ve, useObservable as A } from "@univerjs/ui";
|
|
8
|
+
import { BehaviorSubject as re, filter as Ye } from "rxjs";
|
|
9
|
+
import o, { forwardRef as O, useRef as X, createElement as D, useState as $, useImperativeHandle as Ge, useMemo as ae, useEffect as oe } from "react";
|
|
10
|
+
import { useDependency as E } from "@wendellhu/redi/react-bindings";
|
|
11
|
+
import { Mentions as Ke, Mention as qe, Button as G, Dropdown as Je, Menu as Qe, MenuItem as ie, Select as le } from "@univerjs/design";
|
|
12
|
+
import Xe from "dayjs";
|
|
13
|
+
import et from "clsx";
|
|
14
|
+
const tt = "thread-comment-panel", nt = "THREAD_COMMENT_UI_PLUGIN";
|
|
15
|
+
var rt = (t, e, n, r) => {
|
|
16
|
+
for (var a = e, i = t.length - 1, s; i >= 0; i--)
|
|
17
|
+
(s = t[i]) && (a = s(a) || a);
|
|
18
|
+
return a;
|
|
19
19
|
}, se = (t, e) => (n, r) => e(n, r, t);
|
|
20
|
-
let
|
|
20
|
+
let V = class extends ue {
|
|
21
21
|
constructor(e, n) {
|
|
22
22
|
super();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
H(this, "_panelVisible", !1);
|
|
24
|
+
H(this, "_panelVisible$", new re(!1));
|
|
25
|
+
H(this, "_activeCommentId");
|
|
26
|
+
H(this, "_activeCommentId$", new re(void 0));
|
|
27
|
+
H(this, "panelVisible$", this._panelVisible$.asObservable());
|
|
28
|
+
H(this, "activeCommentId$", this._activeCommentId$.asObservable());
|
|
29
29
|
this._sidebarService = e, this._univerInstanceService = n, this._init();
|
|
30
30
|
}
|
|
31
31
|
_init() {
|
|
@@ -34,7 +34,7 @@ let A = class extends he {
|
|
|
34
34
|
e.visible || this.setPanelVisible(!1);
|
|
35
35
|
})
|
|
36
36
|
), this.disposeWithMe(
|
|
37
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
37
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(Ye((e) => !e)).subscribe(() => {
|
|
38
38
|
this._sidebarService.close();
|
|
39
39
|
})
|
|
40
40
|
);
|
|
@@ -52,18 +52,18 @@ let A = class extends he {
|
|
|
52
52
|
this._activeCommentId = e, this._activeCommentId$.next(e);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
se(0, te(
|
|
57
|
-
se(1,
|
|
58
|
-
],
|
|
59
|
-
const
|
|
55
|
+
V = rt([
|
|
56
|
+
se(0, te(ve)),
|
|
57
|
+
se(1, De)
|
|
58
|
+
], V);
|
|
59
|
+
const at = {
|
|
60
60
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
61
61
|
type: Ce.OPERATION,
|
|
62
62
|
handler(t) {
|
|
63
|
-
const e = t.get(
|
|
63
|
+
const e = t.get(ve), n = t.get(V);
|
|
64
64
|
return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
|
|
65
65
|
header: { title: "threadCommentUI.panel.title" },
|
|
66
|
-
children: { label:
|
|
66
|
+
children: { label: tt },
|
|
67
67
|
width: 320
|
|
68
68
|
}), n.setPanelVisible(!0)), !0;
|
|
69
69
|
}
|
|
@@ -71,224 +71,182 @@ const ot = {
|
|
|
71
71
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
72
72
|
type: Ce.OPERATION,
|
|
73
73
|
handler(t, e) {
|
|
74
|
-
return t.get(
|
|
75
|
-
}
|
|
76
|
-
}, at = {
|
|
77
|
-
threadCommentUI: {
|
|
78
|
-
panel: {
|
|
79
|
-
title: "评论管理",
|
|
80
|
-
empty: "暂无评论",
|
|
81
|
-
filterEmpty: "没有匹配的结果",
|
|
82
|
-
reset: "重置",
|
|
83
|
-
addComment: "新建评论"
|
|
84
|
-
},
|
|
85
|
-
editor: {
|
|
86
|
-
placeholder: "回复",
|
|
87
|
-
reply: "回复",
|
|
88
|
-
cancel: "取消",
|
|
89
|
-
save: "保存"
|
|
90
|
-
},
|
|
91
|
-
item: {
|
|
92
|
-
edit: "编辑",
|
|
93
|
-
delete: "删除"
|
|
94
|
-
},
|
|
95
|
-
filter: {
|
|
96
|
-
sheet: {
|
|
97
|
-
all: "所有表格",
|
|
98
|
-
current: "当前表格"
|
|
99
|
-
},
|
|
100
|
-
status: {
|
|
101
|
-
all: "所有评论",
|
|
102
|
-
resolved: "已解决",
|
|
103
|
-
unsolved: "未解决",
|
|
104
|
-
concernMe: "与我有关"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
74
|
+
return t.get(V).setActiveComment(e), !0;
|
|
107
75
|
}
|
|
108
76
|
};
|
|
109
|
-
var
|
|
110
|
-
for (var
|
|
111
|
-
(s = t[i]) && (
|
|
112
|
-
return
|
|
113
|
-
},
|
|
114
|
-
let
|
|
77
|
+
var ot = (t, e, n, r) => {
|
|
78
|
+
for (var a = e, i = t.length - 1, s; i >= 0; i--)
|
|
79
|
+
(s = t[i]) && (a = s(a) || a);
|
|
80
|
+
return a;
|
|
81
|
+
}, it = (t, e) => (n, r) => e(n, r, t);
|
|
82
|
+
let Y = class extends ue {
|
|
115
83
|
constructor(t) {
|
|
116
|
-
super(), this._localeService = t
|
|
117
|
-
}
|
|
118
|
-
_initLocales() {
|
|
119
|
-
this._localeService.load({ zhCN: at });
|
|
84
|
+
super(), this._localeService = t;
|
|
120
85
|
}
|
|
121
86
|
};
|
|
122
|
-
|
|
123
|
-
Le(
|
|
124
|
-
|
|
125
|
-
],
|
|
126
|
-
class
|
|
87
|
+
Y = ot([
|
|
88
|
+
Le(Ae.Starting, Y),
|
|
89
|
+
it(0, te(J))
|
|
90
|
+
], Y);
|
|
91
|
+
class lt {
|
|
127
92
|
constructor() {
|
|
128
|
-
|
|
93
|
+
H(this, "trigger", "@");
|
|
129
94
|
}
|
|
130
95
|
async getMentions(e) {
|
|
131
96
|
return [];
|
|
132
97
|
}
|
|
133
98
|
}
|
|
134
|
-
const
|
|
135
|
-
var
|
|
136
|
-
for (var
|
|
137
|
-
(s = t[i]) && (
|
|
138
|
-
return
|
|
139
|
-
}, me = (t, e) => (n, r) => e(n, r, t),
|
|
140
|
-
let
|
|
141
|
-
constructor(e, n
|
|
142
|
-
super(
|
|
143
|
-
e,
|
|
144
|
-
n,
|
|
145
|
-
r
|
|
146
|
-
);
|
|
147
|
-
_(this, "_config1");
|
|
148
|
-
this._injector = n, this._commandService = r, this._config1 = e;
|
|
99
|
+
const fe = ze("thread-comment.mention-data.service");
|
|
100
|
+
var st = Object.defineProperty, mt = (t, e, n) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, dt = (t, e, n, r) => {
|
|
101
|
+
for (var a = e, i = t.length - 1, s; i >= 0; i--)
|
|
102
|
+
(s = t[i]) && (a = s(a) || a);
|
|
103
|
+
return a;
|
|
104
|
+
}, me = (t, e) => (n, r) => e(n, r, t), pe = (t, e, n) => (mt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
105
|
+
let K = class extends Ve {
|
|
106
|
+
constructor(t, e, n) {
|
|
107
|
+
super(), this._config = t, this._injector = e, this._commandService = n;
|
|
149
108
|
}
|
|
150
|
-
onStarting(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
109
|
+
onStarting(t) {
|
|
110
|
+
var e;
|
|
111
|
+
je([
|
|
112
|
+
[Y],
|
|
113
|
+
[V],
|
|
114
|
+
[fe, { useClass: lt }]
|
|
115
|
+
], (e = this._config) == null ? void 0 : e.overrides).forEach((n) => {
|
|
116
|
+
t.add(n);
|
|
117
|
+
}), [at, ge].forEach((n) => {
|
|
158
118
|
this._commandService.registerCommand(n);
|
|
159
119
|
});
|
|
160
120
|
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
121
|
+
};
|
|
122
|
+
pe(K, "pluginName", nt);
|
|
123
|
+
pe(K, "type", he.UNIVER_UNKNOWN);
|
|
124
|
+
K = dt([
|
|
125
|
+
Be($e),
|
|
126
|
+
me(1, te(Ze)),
|
|
164
127
|
me(2, Q)
|
|
165
|
-
],
|
|
128
|
+
], K);
|
|
166
129
|
var x = function() {
|
|
167
130
|
return x = Object.assign || function(t) {
|
|
168
131
|
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
169
132
|
e = arguments[n];
|
|
170
|
-
for (var
|
|
171
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
133
|
+
for (var a in e)
|
|
134
|
+
Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
|
|
172
135
|
}
|
|
173
136
|
return t;
|
|
174
137
|
}, x.apply(this, arguments);
|
|
175
|
-
},
|
|
138
|
+
}, ct = function(t, e) {
|
|
176
139
|
var n = {};
|
|
177
140
|
for (var r in t)
|
|
178
141
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
179
142
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
180
|
-
for (var
|
|
181
|
-
e.indexOf(r[
|
|
143
|
+
for (var a = 0, r = Object.getOwnPropertySymbols(t); a < r.length; a++)
|
|
144
|
+
e.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[a]) && (n[r[a]] = t[r[a]]);
|
|
182
145
|
return n;
|
|
183
|
-
}, L =
|
|
184
|
-
var n = t.icon, r = t.id,
|
|
146
|
+
}, L = O(function(t, e) {
|
|
147
|
+
var n = t.icon, r = t.id, a = t.className, i = t.extend, s = ct(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(a || "").trim(), d = X("_".concat(Ct()));
|
|
185
148
|
return Ie(n, "".concat(r), { defIds: n.defIds, idSuffix: d.current }, x({ ref: e, className: c }, s), i);
|
|
186
149
|
});
|
|
187
|
-
function Ie(t, e, n, r,
|
|
188
|
-
return
|
|
189
|
-
return Ie(i, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0,
|
|
150
|
+
function Ie(t, e, n, r, a) {
|
|
151
|
+
return D(t.tag, x(x({ key: e }, ut(t, n, a)), r), (ht(t, n).children || []).map(function(i, s) {
|
|
152
|
+
return Ie(i, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, a);
|
|
190
153
|
}));
|
|
191
154
|
}
|
|
192
|
-
function
|
|
155
|
+
function ut(t, e, n) {
|
|
193
156
|
var r = x({}, t.attrs);
|
|
194
157
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
195
|
-
var
|
|
196
|
-
return !
|
|
158
|
+
var a = e.defIds;
|
|
159
|
+
return !a || a.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
|
|
197
160
|
var s = i[0], c = i[1];
|
|
198
161
|
typeof c == "string" && (r[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
199
162
|
})), r;
|
|
200
163
|
}
|
|
201
|
-
function
|
|
164
|
+
function ht(t, e) {
|
|
202
165
|
var n, r = e.defIds;
|
|
203
|
-
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? x(x({}, t), { children: t.children.map(function(
|
|
204
|
-
return typeof
|
|
166
|
+
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? x(x({}, t), { children: t.children.map(function(a) {
|
|
167
|
+
return typeof a.attrs.id == "string" && r && r.indexOf(a.attrs.id) > -1 ? x(x({}, a), { attrs: x(x({}, a.attrs), { id: a.attrs.id + e.idSuffix }) }) : a;
|
|
205
168
|
}) }) : t;
|
|
206
169
|
}
|
|
207
|
-
function
|
|
170
|
+
function Ct() {
|
|
208
171
|
return Math.random().toString(36).substring(2, 8);
|
|
209
172
|
}
|
|
210
173
|
L.displayName = "UniverIcon";
|
|
211
|
-
var
|
|
212
|
-
return
|
|
174
|
+
var vt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ye = O(function(t, e) {
|
|
175
|
+
return D(L, Object.assign({}, t, {
|
|
213
176
|
id: "delete-single",
|
|
214
177
|
ref: e,
|
|
215
|
-
icon:
|
|
178
|
+
icon: vt
|
|
216
179
|
}));
|
|
217
180
|
});
|
|
218
181
|
ye.displayName = "DeleteSingle";
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return k(L, Object.assign({}, t, {
|
|
182
|
+
var gt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Ee = O(function(t, e) {
|
|
183
|
+
return D(L, Object.assign({}, t, {
|
|
222
184
|
id: "increase-single",
|
|
223
185
|
ref: e,
|
|
224
|
-
icon:
|
|
186
|
+
icon: gt
|
|
225
187
|
}));
|
|
226
188
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return k(L, Object.assign({}, t, {
|
|
189
|
+
Ee.displayName = "IncreaseSingle";
|
|
190
|
+
var ft = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z" } }] }, be = O(function(t, e) {
|
|
191
|
+
return D(L, Object.assign({}, t, {
|
|
231
192
|
id: "more-horizontal-single",
|
|
232
193
|
ref: e,
|
|
233
|
-
icon:
|
|
194
|
+
icon: ft
|
|
234
195
|
}));
|
|
235
196
|
});
|
|
236
197
|
be.displayName = "MoreHorizontalSingle";
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return k(L, Object.assign({}, t, {
|
|
198
|
+
var pt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { stroke: "currentColor", d: "M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252", strokeLinecap: "round", strokeWidth: 1.2 } }] }, Se = O(function(t, e) {
|
|
199
|
+
return D(L, Object.assign({}, t, {
|
|
240
200
|
id: "reply-to-comment-single",
|
|
241
201
|
ref: e,
|
|
242
|
-
icon:
|
|
202
|
+
icon: pt
|
|
243
203
|
}));
|
|
244
204
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return k(L, Object.assign({}, t, {
|
|
205
|
+
Se.displayName = "ReplyToCommentSingle";
|
|
206
|
+
var It = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, xe = O(function(t, e) {
|
|
207
|
+
return D(L, Object.assign({}, t, {
|
|
249
208
|
id: "resolved-single",
|
|
250
209
|
ref: e,
|
|
251
|
-
icon:
|
|
210
|
+
icon: It
|
|
252
211
|
}));
|
|
253
212
|
});
|
|
254
213
|
xe.displayName = "ResolvedSingle";
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return k(L, Object.assign({}, t, {
|
|
214
|
+
var yt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "circle", attrs: { cx: 8.73, cy: 8.4, r: 6.4, stroke: "currentColor", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }] }, _e = O(function(t, e) {
|
|
215
|
+
return D(L, Object.assign({}, t, {
|
|
258
216
|
id: "solve-single",
|
|
259
217
|
ref: e,
|
|
260
|
-
icon:
|
|
218
|
+
icon: yt
|
|
261
219
|
}));
|
|
262
220
|
});
|
|
263
221
|
_e.displayName = "SolveSingle";
|
|
264
|
-
const
|
|
265
|
-
threadCommentEditorButtons:
|
|
266
|
-
threadCommentEditorSuggestion:
|
|
267
|
-
threadCommentEditorSuggestionActive:
|
|
268
|
-
threadCommentEditorSuggestionIcon:
|
|
269
|
-
},
|
|
222
|
+
const Et = "univer-thread-comment-editor-buttons", bt = "univer-thread-comment-editor-suggestion", St = "univer-thread-comment-editor-suggestionActive", xt = "univer-thread-comment-editor-suggestion-icon", q = {
|
|
223
|
+
threadCommentEditorButtons: Et,
|
|
224
|
+
threadCommentEditorSuggestion: bt,
|
|
225
|
+
threadCommentEditorSuggestionActive: St,
|
|
226
|
+
threadCommentEditorSuggestionIcon: xt
|
|
227
|
+
}, _t = (t) => {
|
|
270
228
|
const e = /@\[(.*?)\]\((.*?)\)|(\w+)/g;
|
|
271
229
|
let n, r = 0;
|
|
272
|
-
const
|
|
230
|
+
const a = [];
|
|
273
231
|
for (; (n = e.exec(t)) !== null; )
|
|
274
|
-
n.index > r &&
|
|
232
|
+
n.index > r && a.push({
|
|
275
233
|
type: "text",
|
|
276
234
|
content: t.substring(r, n.index)
|
|
277
|
-
}), n[1] && n[2] ?
|
|
235
|
+
}), n[1] && n[2] ? a.push({
|
|
278
236
|
type: "mention",
|
|
279
237
|
content: {
|
|
280
238
|
label: n[1],
|
|
281
239
|
id: n[2]
|
|
282
240
|
}
|
|
283
|
-
}) : n[3] &&
|
|
241
|
+
}) : n[3] && a.push({
|
|
284
242
|
type: "text",
|
|
285
243
|
content: n[3]
|
|
286
244
|
}), r = e.lastIndex;
|
|
287
|
-
return r < t.length &&
|
|
245
|
+
return r < t.length && a.push({
|
|
288
246
|
type: "text",
|
|
289
247
|
content: t.substring(r)
|
|
290
|
-
}),
|
|
291
|
-
},
|
|
248
|
+
}), a;
|
|
249
|
+
}, Nt = (t) => t.map((e) => {
|
|
292
250
|
switch (e.type) {
|
|
293
251
|
case "mention":
|
|
294
252
|
return `@[${e.content.label}](${e.content.id})`;
|
|
@@ -296,23 +254,23 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
296
254
|
return e.content;
|
|
297
255
|
}
|
|
298
256
|
}).join(""), Ne = (t) => {
|
|
299
|
-
const { dataStream: e, customRanges: n } = t, r = e.length - 2,
|
|
257
|
+
const { dataStream: e, customRanges: n } = t, r = e.length - 2, a = [];
|
|
300
258
|
let i = 0;
|
|
301
259
|
return n == null || n.forEach((s) => {
|
|
302
|
-
i < s.startIndex &&
|
|
260
|
+
i < s.startIndex && a.push({
|
|
303
261
|
type: "text",
|
|
304
262
|
content: e.slice(i, s.startIndex)
|
|
305
|
-
}),
|
|
263
|
+
}), a.push({
|
|
306
264
|
type: "mention",
|
|
307
265
|
content: {
|
|
308
266
|
label: e.slice(s.startIndex, s.endIndex).slice(1, -1),
|
|
309
267
|
id: s.rangeId
|
|
310
268
|
}
|
|
311
269
|
}), i = s.endIndex;
|
|
312
|
-
}),
|
|
270
|
+
}), a.push({
|
|
313
271
|
type: "text",
|
|
314
272
|
content: e.slice(i, r)
|
|
315
|
-
}),
|
|
273
|
+
}), a;
|
|
316
274
|
}, Te = (t) => {
|
|
317
275
|
let e = "";
|
|
318
276
|
const n = [];
|
|
@@ -322,13 +280,13 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
322
280
|
e += r.content;
|
|
323
281
|
break;
|
|
324
282
|
case "mention": {
|
|
325
|
-
const
|
|
283
|
+
const a = e.length;
|
|
326
284
|
e += `${r.content.label}`;
|
|
327
285
|
const i = e.length;
|
|
328
286
|
n.push({
|
|
329
287
|
rangeId: r.content.id,
|
|
330
|
-
rangeType:
|
|
331
|
-
startIndex:
|
|
288
|
+
rangeType: We.MENTION,
|
|
289
|
+
startIndex: a,
|
|
332
290
|
endIndex: i
|
|
333
291
|
});
|
|
334
292
|
break;
|
|
@@ -351,185 +309,185 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
351
309
|
dataStream: e,
|
|
352
310
|
customRanges: n
|
|
353
311
|
};
|
|
354
|
-
},
|
|
312
|
+
}, Tt = (t) => ({
|
|
355
313
|
display: t.label,
|
|
356
314
|
id: `${t.id}`,
|
|
357
315
|
raw: t
|
|
358
|
-
}),
|
|
316
|
+
}), Mt = (t, e, n, r, a) => {
|
|
359
317
|
var s, c;
|
|
360
318
|
const i = (s = t.raw) == null ? void 0 : s.icon;
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
}, Me =
|
|
319
|
+
return /* @__PURE__ */ o.createElement("div", { className: q.threadCommentEditorSuggestion }, i ? /* @__PURE__ */ o.createElement("img", { className: q.threadCommentEditorSuggestionIcon, src: i }) : null, /* @__PURE__ */ o.createElement("div", null, (c = t.display) != null ? c : t.id));
|
|
320
|
+
}, Me = O((t, e) => {
|
|
363
321
|
var u;
|
|
364
|
-
const { comment: n, onSave: r, id:
|
|
365
|
-
return
|
|
322
|
+
const { comment: n, onSave: r, id: a, onCancel: i, autoFocus: s } = t, c = E(fe), d = E(J), [g, f] = $({ ...n }), [_, p] = $(!1), I = X(null);
|
|
323
|
+
return Ge(e, () => ({
|
|
366
324
|
reply(y) {
|
|
367
325
|
var h;
|
|
368
|
-
|
|
326
|
+
f({
|
|
369
327
|
...n,
|
|
370
328
|
text: y,
|
|
371
329
|
attachments: []
|
|
372
330
|
}), (h = I.current) == null || h.inputElement.focus();
|
|
373
331
|
}
|
|
374
|
-
})), /* @__PURE__ */
|
|
375
|
-
|
|
332
|
+
})), /* @__PURE__ */ o.createElement("div", { className: q.threadCommentEditor, onClick: (y) => y.preventDefault() }, /* @__PURE__ */ o.createElement(
|
|
333
|
+
Ke,
|
|
376
334
|
{
|
|
377
335
|
ref: I,
|
|
378
336
|
autoFocus: s,
|
|
379
337
|
style: { width: "100%" },
|
|
380
338
|
placeholder: d.t("threadCommentUI.editor.placeholder"),
|
|
381
|
-
value:
|
|
339
|
+
value: g != null && g.text ? Nt(Ne(g.text)) : "",
|
|
382
340
|
onChange: (y) => {
|
|
383
|
-
y.target.value ||
|
|
341
|
+
y.target.value || f({ ...n, text: void 0 }), f == null || f({ ...n, text: Te(_t(y.target.value)) });
|
|
384
342
|
},
|
|
385
343
|
onFocus: () => {
|
|
386
344
|
p(!0);
|
|
387
345
|
}
|
|
388
346
|
},
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
|
|
347
|
+
/* @__PURE__ */ o.createElement(
|
|
348
|
+
qe,
|
|
391
349
|
{
|
|
392
350
|
key: c.trigger,
|
|
393
351
|
trigger: c.trigger,
|
|
394
|
-
data: (y, h) => c.getMentions(y).then((
|
|
352
|
+
data: (y, h) => c.getMentions(y).then((N) => N.map(Tt)).then(h),
|
|
395
353
|
displayTransform: (y, h) => `@${h} `,
|
|
396
|
-
renderSuggestion: (u = c.renderSuggestion) != null ? u :
|
|
354
|
+
renderSuggestion: (u = c.renderSuggestion) != null ? u : Mt
|
|
397
355
|
}
|
|
398
356
|
)
|
|
399
|
-
),
|
|
357
|
+
), _ ? /* @__PURE__ */ o.createElement("div", { className: q.threadCommentEditorButtons }, /* @__PURE__ */ o.createElement(
|
|
400
358
|
G,
|
|
401
359
|
{
|
|
402
360
|
style: { marginRight: 12 },
|
|
403
361
|
onClick: () => {
|
|
404
|
-
i == null || i(), p(!1),
|
|
362
|
+
i == null || i(), p(!1), f({ text: void 0 });
|
|
405
363
|
}
|
|
406
364
|
},
|
|
407
365
|
d.t("threadCommentUI.editor.cancel")
|
|
408
|
-
), /* @__PURE__ */
|
|
366
|
+
), /* @__PURE__ */ o.createElement(
|
|
409
367
|
G,
|
|
410
368
|
{
|
|
411
369
|
type: "primary",
|
|
412
|
-
disabled: !
|
|
370
|
+
disabled: !g.text,
|
|
413
371
|
onClick: () => {
|
|
414
|
-
|
|
415
|
-
...
|
|
416
|
-
text:
|
|
417
|
-
}), p(!1),
|
|
372
|
+
g.text && (r == null || r({
|
|
373
|
+
...g,
|
|
374
|
+
text: g.text
|
|
375
|
+
}), p(!1), f({ text: void 0 }));
|
|
418
376
|
}
|
|
419
377
|
},
|
|
420
|
-
d.t(
|
|
378
|
+
d.t(a ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
421
379
|
)) : null);
|
|
422
|
-
}),
|
|
423
|
-
threadComment:
|
|
424
|
-
threadCommentActive:
|
|
425
|
-
threadCommentContent:
|
|
426
|
-
threadCommentHighlight:
|
|
427
|
-
threadCommentIconContainer:
|
|
428
|
-
threadCommentIcon:
|
|
429
|
-
threadCommentTitle:
|
|
430
|
-
threadCommentTitlePosition:
|
|
431
|
-
threadCommentTitleHighlight:
|
|
432
|
-
threadCommentUsername:
|
|
433
|
-
threadCommentItem:
|
|
434
|
-
threadCommentItemHead:
|
|
435
|
-
threadCommentItemTitle:
|
|
436
|
-
threadCommentItemTitlePosition:
|
|
437
|
-
threadCommentItemTitleHighlight:
|
|
438
|
-
threadCommentItemTime:
|
|
439
|
-
threadCommentItemContent:
|
|
440
|
-
threadCommentItemAt:
|
|
441
|
-
},
|
|
442
|
-
const { item: e, unitId: n, subUnitId: r, editing:
|
|
443
|
-
|
|
444
|
-
d ?
|
|
380
|
+
}), Ut = "univer-thread-comment", kt = "univer-thread-comment-active", Ht = "univer-thread-comment-content", $t = "univer-thread-comment-highlight", Ot = "univer-thread-comment-icon-container", Pt = "univer-thread-comment-icon", wt = "univer-thread-comment-title", Rt = "univer-thread-comment-title-position", Dt = "univer-thread-comment-title-highlight", Lt = "univer-thread-comment-username", At = "univer-thread-comment-item", Vt = "univer-thread-comment-item-head", jt = "univer-thread-comment-item-title", Bt = "univer-thread-comment-item-title-position", Wt = "univer-thread-comment-item-title-highlight", Ft = "univer-thread-comment-item-time", zt = "univer-thread-comment-item-content", Zt = "univer-thread-comment-item-at", v = {
|
|
381
|
+
threadComment: Ut,
|
|
382
|
+
threadCommentActive: kt,
|
|
383
|
+
threadCommentContent: Ht,
|
|
384
|
+
threadCommentHighlight: $t,
|
|
385
|
+
threadCommentIconContainer: Ot,
|
|
386
|
+
threadCommentIcon: Pt,
|
|
387
|
+
threadCommentTitle: wt,
|
|
388
|
+
threadCommentTitlePosition: Rt,
|
|
389
|
+
threadCommentTitleHighlight: Dt,
|
|
390
|
+
threadCommentUsername: Lt,
|
|
391
|
+
threadCommentItem: At,
|
|
392
|
+
threadCommentItemHead: Vt,
|
|
393
|
+
threadCommentItemTitle: jt,
|
|
394
|
+
threadCommentItemTitlePosition: Bt,
|
|
395
|
+
threadCommentItemTitleHighlight: Wt,
|
|
396
|
+
threadCommentItemTime: Ft,
|
|
397
|
+
threadCommentItemContent: zt,
|
|
398
|
+
threadCommentItemAt: Zt
|
|
399
|
+
}, Ue = "__mock__", Yt = (t) => {
|
|
400
|
+
const { item: e, unitId: n, subUnitId: r, editing: a, onEditingChange: i, onReply: s, resolved: c, isRoot: d, onClose: g } = t, f = E(Q), _ = E(J), p = E(ee), I = p.getUser(e.personId), u = A(p.currentUser$), y = (u == null ? void 0 : u.userID) === e.personId, h = e.id === Ue, [N, P] = $(!1), m = () => {
|
|
401
|
+
f.executeCommand(
|
|
402
|
+
d ? ce.id : Re.id,
|
|
445
403
|
{
|
|
446
404
|
unitId: n,
|
|
447
405
|
subUnitId: r,
|
|
448
406
|
commentId: e.id
|
|
449
407
|
}
|
|
450
|
-
), d && (
|
|
408
|
+
), d && (g == null || g());
|
|
451
409
|
};
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
|
|
410
|
+
return /* @__PURE__ */ o.createElement("div", { className: v.threadCommentItem, onMouseLeave: () => P(!1), onMouseEnter: () => P(!0) }, /* @__PURE__ */ o.createElement("img", { className: v.threadCommentItemHead, src: I == null ? void 0 : I.avatar }), /* @__PURE__ */ o.createElement("div", { className: v.threadCommentItemTitle }, /* @__PURE__ */ o.createElement("div", { className: v.threadCommentUsername }, (I == null ? void 0 : I.name) || " "), /* @__PURE__ */ o.createElement("div", null, h || c ? null : N ? /* @__PURE__ */ o.createElement("div", { className: v.threadCommentIcon, onClick: () => s(I) }, /* @__PURE__ */ o.createElement(Se, null)) : null, y && !h && !c ? /* @__PURE__ */ o.createElement(
|
|
411
|
+
Je,
|
|
454
412
|
{
|
|
455
|
-
overlay: /* @__PURE__ */
|
|
413
|
+
overlay: /* @__PURE__ */ o.createElement(Qe, null, /* @__PURE__ */ o.createElement(ie, { key: "edit", onClick: () => i == null ? void 0 : i(!0) }, _.t("threadCommentUI.item.edit")), /* @__PURE__ */ o.createElement(ie, { key: "delete", onClick: m }, _.t("threadCommentUI.item.delete")))
|
|
456
414
|
},
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
) : null)), /* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ o.createElement("div", { className: v.threadCommentIcon }, /* @__PURE__ */ o.createElement(be, null))
|
|
416
|
+
) : null)), /* @__PURE__ */ o.createElement("div", { className: v.threadCommentItemTime }, e.dT), a ? /* @__PURE__ */ o.createElement(
|
|
459
417
|
Me,
|
|
460
418
|
{
|
|
461
419
|
id: e.id,
|
|
462
420
|
comment: e,
|
|
463
421
|
onCancel: () => i == null ? void 0 : i(!1),
|
|
464
422
|
autoFocus: !0,
|
|
465
|
-
onSave: ({ text:
|
|
466
|
-
i == null || i(!1),
|
|
467
|
-
|
|
423
|
+
onSave: ({ text: C, attachments: w }) => {
|
|
424
|
+
i == null || i(!1), f.executeCommand(
|
|
425
|
+
Pe.id,
|
|
468
426
|
{
|
|
469
427
|
unitId: n,
|
|
470
428
|
subUnitId: r,
|
|
471
429
|
payload: {
|
|
472
430
|
commentId: e.id,
|
|
473
|
-
text:
|
|
474
|
-
attachments:
|
|
431
|
+
text: C,
|
|
432
|
+
attachments: w
|
|
475
433
|
}
|
|
476
434
|
}
|
|
477
435
|
);
|
|
478
436
|
}
|
|
479
437
|
}
|
|
480
|
-
) : /* @__PURE__ */
|
|
481
|
-
switch (
|
|
438
|
+
) : /* @__PURE__ */ o.createElement("div", { className: v.threadCommentItemContent }, Ne(e.text).map((C, w) => {
|
|
439
|
+
switch (C.type) {
|
|
482
440
|
case "mention":
|
|
483
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ o.createElement("a", { className: v.threadCommentItemAt, key: w }, "@", C.content.label, " ");
|
|
484
442
|
default:
|
|
485
|
-
return
|
|
443
|
+
return C.content;
|
|
486
444
|
}
|
|
487
445
|
})));
|
|
488
|
-
},
|
|
489
|
-
var R, B,
|
|
446
|
+
}, Gt = (t) => {
|
|
447
|
+
var R, B, z;
|
|
490
448
|
const {
|
|
491
449
|
id: e,
|
|
492
450
|
unitId: n,
|
|
493
451
|
subUnitId: r,
|
|
494
|
-
refStr:
|
|
452
|
+
refStr: a,
|
|
495
453
|
showEdit: i = !0,
|
|
496
454
|
onClick: s,
|
|
497
455
|
showHighlight: c,
|
|
498
456
|
onClose: d,
|
|
499
|
-
getSubUnitName:
|
|
500
|
-
prefix:
|
|
501
|
-
autoFocus:
|
|
457
|
+
getSubUnitName: g,
|
|
458
|
+
prefix: f,
|
|
459
|
+
autoFocus: _,
|
|
502
460
|
onMouseEnter: p,
|
|
503
461
|
onMouseLeave: I
|
|
504
|
-
} = t, u =
|
|
505
|
-
|
|
506
|
-
const m = e ? u.getCommentWithChildren(n, r, e) : null,
|
|
462
|
+
} = t, u = E(de), [y, h] = $(!1), [N, P] = $("");
|
|
463
|
+
A(u.commentMap$);
|
|
464
|
+
const m = e ? u.getCommentWithChildren(n, r, e) : null, C = E(Q), w = E(ee), U = m == null ? void 0 : m.root.resolved, b = A(w.currentUser$), T = X(null), j = [
|
|
507
465
|
...m ? [m.root] : (
|
|
508
466
|
// mock empty comment
|
|
509
467
|
[{
|
|
510
|
-
id:
|
|
468
|
+
id: Ue,
|
|
511
469
|
text: {
|
|
512
470
|
dataStream: `
|
|
513
471
|
\r`
|
|
514
472
|
},
|
|
515
473
|
personId: (R = b == null ? void 0 : b.userID) != null ? R : "",
|
|
516
|
-
ref:
|
|
474
|
+
ref: a != null ? a : "",
|
|
517
475
|
dT: "",
|
|
518
476
|
unitId: n,
|
|
519
477
|
subUnitId: r
|
|
520
478
|
}]
|
|
521
479
|
),
|
|
522
480
|
...(B = m == null ? void 0 : m.children) != null ? B : []
|
|
523
|
-
],
|
|
524
|
-
|
|
481
|
+
], F = () => {
|
|
482
|
+
C.executeCommand(we.id, {
|
|
525
483
|
unitId: n,
|
|
526
484
|
subUnitId: r,
|
|
527
485
|
commentId: e,
|
|
528
486
|
resolved: !U
|
|
529
487
|
}), d == null || d();
|
|
530
|
-
},
|
|
531
|
-
|
|
532
|
-
|
|
488
|
+
}, k = () => {
|
|
489
|
+
C.executeCommand(
|
|
490
|
+
ce.id,
|
|
533
491
|
{
|
|
534
492
|
unitId: n,
|
|
535
493
|
subUnitId: r,
|
|
@@ -537,14 +495,14 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
537
495
|
}
|
|
538
496
|
), d == null || d();
|
|
539
497
|
};
|
|
540
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ o.createElement(
|
|
541
499
|
"div",
|
|
542
500
|
{
|
|
543
|
-
className:
|
|
544
|
-
[
|
|
501
|
+
className: et(v.threadComment, {
|
|
502
|
+
[v.threadCommentActive]: !U && (c || y || f === "cell")
|
|
545
503
|
}),
|
|
546
504
|
onClick: s,
|
|
547
|
-
id: `${
|
|
505
|
+
id: `${f}-${n}-${r}-${e}`,
|
|
548
506
|
onMouseEnter: () => {
|
|
549
507
|
p == null || p(), h(!0);
|
|
550
508
|
},
|
|
@@ -552,19 +510,19 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
552
510
|
I == null || I(), h(!1);
|
|
553
511
|
}
|
|
554
512
|
},
|
|
555
|
-
!U && c ? /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
513
|
+
!U && c ? /* @__PURE__ */ o.createElement("div", { className: v.threadCommentHighlight }) : null,
|
|
514
|
+
/* @__PURE__ */ o.createElement("div", { className: v.threadCommentTitle }, /* @__PURE__ */ o.createElement("div", { className: v.threadCommentTitlePosition }, /* @__PURE__ */ o.createElement("div", { className: v.threadCommentTitleHighlight }), a || (m == null ? void 0 : m.root.ref), " · ", g((z = m == null ? void 0 : m.root.subUnitId) != null ? z : r)), m ? /* @__PURE__ */ o.createElement("div", { className: v.threadCommentIconContainer }, /* @__PURE__ */ o.createElement(
|
|
557
515
|
"div",
|
|
558
516
|
{
|
|
559
|
-
onClick:
|
|
560
|
-
className:
|
|
517
|
+
onClick: F,
|
|
518
|
+
className: v.threadCommentIcon,
|
|
561
519
|
style: { color: U ? "rgb(var(--green-500))" : "" }
|
|
562
520
|
},
|
|
563
|
-
U ? /* @__PURE__ */
|
|
564
|
-
), (b == null ? void 0 : b.userID) === m.root.personId ? /* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
(l) => /* @__PURE__ */
|
|
567
|
-
|
|
521
|
+
U ? /* @__PURE__ */ o.createElement(xe, null) : /* @__PURE__ */ o.createElement(_e, null)
|
|
522
|
+
), (b == null ? void 0 : b.userID) === m.root.personId ? /* @__PURE__ */ o.createElement("div", { className: v.threadCommentIcon, onClick: k }, /* @__PURE__ */ o.createElement(ye, null)) : null) : null),
|
|
523
|
+
/* @__PURE__ */ o.createElement("div", { className: v.threadCommentContent }, j.map(
|
|
524
|
+
(l) => /* @__PURE__ */ o.createElement(
|
|
525
|
+
Yt,
|
|
568
526
|
{
|
|
569
527
|
onClose: d,
|
|
570
528
|
unitId: n,
|
|
@@ -572,41 +530,41 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
572
530
|
item: l,
|
|
573
531
|
key: l.id,
|
|
574
532
|
isRoot: l.id === (m == null ? void 0 : m.root.id),
|
|
575
|
-
editing:
|
|
533
|
+
editing: N === l.id,
|
|
576
534
|
resolved: m == null ? void 0 : m.root.resolved,
|
|
577
|
-
onEditingChange: (
|
|
578
|
-
|
|
535
|
+
onEditingChange: (S) => {
|
|
536
|
+
P(S ? l.id : "");
|
|
579
537
|
},
|
|
580
|
-
onReply: (
|
|
581
|
-
var
|
|
582
|
-
|
|
538
|
+
onReply: (S) => {
|
|
539
|
+
var M;
|
|
540
|
+
S && ((M = T.current) == null || M.reply(Te([{
|
|
583
541
|
type: "mention",
|
|
584
542
|
content: {
|
|
585
|
-
id:
|
|
586
|
-
label:
|
|
543
|
+
id: S.userID,
|
|
544
|
+
label: S.name
|
|
587
545
|
}
|
|
588
546
|
}])));
|
|
589
547
|
}
|
|
590
548
|
}
|
|
591
549
|
)
|
|
592
550
|
)),
|
|
593
|
-
i && !
|
|
551
|
+
i && !N && !U ? /* @__PURE__ */ o.createElement("div", null, /* @__PURE__ */ o.createElement(
|
|
594
552
|
Me,
|
|
595
553
|
{
|
|
596
|
-
key: `${
|
|
597
|
-
ref:
|
|
598
|
-
onSave: ({ text: l, attachments:
|
|
599
|
-
|
|
600
|
-
|
|
554
|
+
key: `${_}`,
|
|
555
|
+
ref: T,
|
|
556
|
+
onSave: ({ text: l, attachments: S }) => {
|
|
557
|
+
C.executeCommand(
|
|
558
|
+
Oe.id,
|
|
601
559
|
{
|
|
602
560
|
unitId: n,
|
|
603
561
|
subUnitId: r,
|
|
604
562
|
comment: {
|
|
605
563
|
text: l,
|
|
606
|
-
attachments:
|
|
607
|
-
dT:
|
|
608
|
-
id:
|
|
609
|
-
ref:
|
|
564
|
+
attachments: S,
|
|
565
|
+
dT: Xe().format("YYYY/MM/DD HH:mm"),
|
|
566
|
+
id: Fe.generateRandomId(),
|
|
567
|
+
ref: a,
|
|
610
568
|
personId: b == null ? void 0 : b.userID,
|
|
611
569
|
parentId: m == null ? void 0 : m.root.id,
|
|
612
570
|
unitId: n,
|
|
@@ -615,51 +573,51 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
615
573
|
}
|
|
616
574
|
);
|
|
617
575
|
},
|
|
618
|
-
autoFocus:
|
|
576
|
+
autoFocus: _ || !m,
|
|
619
577
|
onCancel: () => {
|
|
620
578
|
m || d == null || d();
|
|
621
579
|
}
|
|
622
580
|
}
|
|
623
581
|
)) : null
|
|
624
582
|
);
|
|
625
|
-
},
|
|
626
|
-
threadCommentPanel:
|
|
627
|
-
threadComment:
|
|
628
|
-
threadCommentPanelForms:
|
|
629
|
-
select:
|
|
630
|
-
threadCommentPanelEmpty:
|
|
631
|
-
threadCommentPanelAdd:
|
|
632
|
-
},
|
|
633
|
-
const { unitId: e, subUnitId$: n, type: r, onAdd:
|
|
634
|
-
var l,
|
|
635
|
-
if (
|
|
636
|
-
const
|
|
637
|
-
return c ? c(
|
|
583
|
+
}, Kt = "univer-thread-comment-panel", qt = "univer-thread-comment", Jt = "univer-thread-comment-panel-forms", Qt = "univer-select", Xt = "univer-thread-comment-panel-empty", en = "univer-thread-comment-panel-add", Z = {
|
|
584
|
+
threadCommentPanel: Kt,
|
|
585
|
+
threadComment: qt,
|
|
586
|
+
threadCommentPanelForms: Jt,
|
|
587
|
+
select: Qt,
|
|
588
|
+
threadCommentPanelEmpty: Xt,
|
|
589
|
+
threadCommentPanelAdd: en
|
|
590
|
+
}, hn = (t) => {
|
|
591
|
+
const { unitId: e, subUnitId$: n, type: r, onAdd: a, getSubUnitName: i, onResolve: s, sortComments: c, onItemLeave: d, onItemEnter: g } = t, [f, _] = $("all"), [p, I] = $("all"), u = E(J), y = E(ee), h = E(de), [N, P] = $(() => h.getUnit(e)), m = E(V), C = A(m.activeCommentId$), w = A(h.commentUpdate$), U = E(Q), b = A(n), T = y.currentUser, j = X(!0), F = "panel", k = ae(() => {
|
|
592
|
+
var l, S;
|
|
593
|
+
if (f === "all") {
|
|
594
|
+
const M = N.map((W) => W[1]).flat().filter((W) => !W.parentId);
|
|
595
|
+
return c ? c(M) : M;
|
|
638
596
|
} else
|
|
639
|
-
return (
|
|
640
|
-
}, [
|
|
641
|
-
I("all"),
|
|
597
|
+
return (S = (l = N.find((M) => M[0] === b)) == null ? void 0 : l[1]) != null ? S : [];
|
|
598
|
+
}, [f, N, b, c]), R = ae(() => p === "resolved" ? k.filter((l) => l.resolved) : p === "unsolved" ? k.filter((l) => !l.resolved) : p === "concern_me" && T != null && T.userID ? k.map((l) => h.getCommentWithChildren(l.unitId, l.subUnitId, l.id)).map((l) => l != null && l.relativeUsers.has(T.userID) ? l.root : null).filter(Boolean) : k, [k, T == null ? void 0 : T.userID, p, h]), B = p !== "all" || f !== "all", z = () => {
|
|
599
|
+
I("all"), _("all");
|
|
642
600
|
};
|
|
643
|
-
return
|
|
644
|
-
e &&
|
|
601
|
+
return oe(() => {
|
|
602
|
+
e && P(
|
|
645
603
|
h.getUnit(e)
|
|
646
604
|
);
|
|
647
|
-
}, [e, h,
|
|
605
|
+
}, [e, h, w]), oe(() => {
|
|
648
606
|
var ne;
|
|
649
|
-
if (!
|
|
607
|
+
if (!C)
|
|
650
608
|
return;
|
|
651
|
-
if (!
|
|
652
|
-
|
|
609
|
+
if (!j.current) {
|
|
610
|
+
j.current = !0;
|
|
653
611
|
return;
|
|
654
612
|
}
|
|
655
|
-
const { unitId: l, subUnitId:
|
|
656
|
-
(ne = document.getElementById(
|
|
657
|
-
}, [
|
|
613
|
+
const { unitId: l, subUnitId: S, commentId: M } = C, W = `${F}-${l}-${S}-${M}`;
|
|
614
|
+
(ne = document.getElementById(W)) == null || ne.scrollIntoView({ block: "center" });
|
|
615
|
+
}, [C]), /* @__PURE__ */ o.createElement("div", { className: Z.threadCommentPanel }, /* @__PURE__ */ o.createElement("div", { className: Z.threadCommentPanelForms }, /* @__PURE__ */ o.createElement(
|
|
658
616
|
le,
|
|
659
617
|
{
|
|
660
618
|
borderless: !0,
|
|
661
|
-
value:
|
|
662
|
-
onChange: (l) =>
|
|
619
|
+
value: f,
|
|
620
|
+
onChange: (l) => _(l),
|
|
663
621
|
options: [
|
|
664
622
|
{
|
|
665
623
|
value: "current",
|
|
@@ -671,7 +629,7 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
671
629
|
}
|
|
672
630
|
]
|
|
673
631
|
}
|
|
674
|
-
), /* @__PURE__ */
|
|
632
|
+
), /* @__PURE__ */ o.createElement(
|
|
675
633
|
le,
|
|
676
634
|
{
|
|
677
635
|
borderless: !0,
|
|
@@ -696,20 +654,20 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
696
654
|
}
|
|
697
655
|
]
|
|
698
656
|
}
|
|
699
|
-
)), R == null ? void 0 : R.map((l) => /* @__PURE__ */
|
|
700
|
-
|
|
657
|
+
)), R == null ? void 0 : R.map((l) => /* @__PURE__ */ o.createElement(
|
|
658
|
+
Gt,
|
|
701
659
|
{
|
|
702
|
-
prefix:
|
|
660
|
+
prefix: F,
|
|
703
661
|
getSubUnitName: i,
|
|
704
662
|
key: l.id,
|
|
705
663
|
id: l.id,
|
|
706
664
|
unitId: l.unitId,
|
|
707
665
|
subUnitId: l.subUnitId,
|
|
708
666
|
type: r,
|
|
709
|
-
showEdit: (
|
|
710
|
-
showHighlight: (
|
|
667
|
+
showEdit: (C == null ? void 0 : C.commentId) === l.id,
|
|
668
|
+
showHighlight: (C == null ? void 0 : C.commentId) === l.id,
|
|
711
669
|
onClick: () => {
|
|
712
|
-
|
|
670
|
+
j.current = !1, U.executeCommand(ge.id, {
|
|
713
671
|
unitId: l.unitId,
|
|
714
672
|
subUnitId: l.subUnitId,
|
|
715
673
|
commentId: l.id,
|
|
@@ -717,35 +675,35 @@ const $t = _e, Ut = "univer-thread-comment-editor-buttons", Ot = "univer-thread-
|
|
|
717
675
|
});
|
|
718
676
|
},
|
|
719
677
|
onClose: () => s == null ? void 0 : s(l.id),
|
|
720
|
-
onMouseEnter: () =>
|
|
678
|
+
onMouseEnter: () => g == null ? void 0 : g(l),
|
|
721
679
|
onMouseLeave: () => d == null ? void 0 : d(l)
|
|
722
680
|
}
|
|
723
|
-
)), R.length ? null : /* @__PURE__ */
|
|
681
|
+
)), R.length ? null : /* @__PURE__ */ o.createElement("div", { className: Z.threadCommentPanelEmpty }, B ? u.t("threadCommentUI.panel.filterEmpty") : u.t("threadCommentUI.panel.empty"), B ? /* @__PURE__ */ o.createElement(
|
|
724
682
|
G,
|
|
725
683
|
{
|
|
726
|
-
onClick:
|
|
684
|
+
onClick: z,
|
|
727
685
|
type: "link"
|
|
728
686
|
},
|
|
729
687
|
u.t("threadCommentUI.panel.reset")
|
|
730
|
-
) : /* @__PURE__ */
|
|
688
|
+
) : /* @__PURE__ */ o.createElement(
|
|
731
689
|
G,
|
|
732
690
|
{
|
|
733
691
|
id: "thread-comment-add",
|
|
734
692
|
className: Z.threadCommentPanelAdd,
|
|
735
693
|
type: "primary",
|
|
736
|
-
onClick:
|
|
694
|
+
onClick: a
|
|
737
695
|
},
|
|
738
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ o.createElement(Ee, null),
|
|
739
697
|
u.t("threadCommentUI.panel.addComment")
|
|
740
698
|
)));
|
|
741
699
|
};
|
|
742
700
|
export {
|
|
743
|
-
|
|
701
|
+
fe as IThreadCommentMentionDataService,
|
|
744
702
|
ge as SetActiveCommentOperation,
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
703
|
+
tt as THREAD_COMMENT_PANEL,
|
|
704
|
+
hn as ThreadCommentPanel,
|
|
705
|
+
V as ThreadCommentPanelService,
|
|
706
|
+
Gt as ThreadCommentTree,
|
|
707
|
+
at as ToggleSheetCommentPanelOperation,
|
|
708
|
+
K as UniverThreadCommentUIPlugin
|
|
751
709
|
};
|