@univerjs/thread-comment-ui 0.4.2 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +11 -3
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +698 -921
- package/lib/es/locale/en-US.js +36 -0
- package/lib/es/locale/fa-IR.js +36 -0
- package/lib/es/locale/ru-RU.js +36 -0
- package/lib/es/locale/vi-VN.js +36 -0
- package/lib/es/locale/zh-CN.js +36 -0
- package/lib/es/locale/zh-TW.js +36 -0
- package/lib/types/index.d.ts +0 -1
- package/lib/types/views/thread-comment-editor/util.d.ts +1 -1
- package/lib/umd/index.js +11 -3
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +30 -23
- package/lib/locale/en-US.json +0 -33
- package/lib/locale/fa-IR.json +0 -33
- package/lib/locale/ru-RU.json +0 -33
- package/lib/locale/vi-VN.json +0 -33
- package/lib/locale/zh-CN.json +0 -33
- package/lib/locale/zh-TW.json +0 -33
- package/lib/types/common/utils.d.ts +0 -16
package/lib/es/index.js
CHANGED
|
@@ -1,330 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Mentions, Mention, Button, Tooltip, Dropdown, Menu, MenuItem, Select } from "@univerjs/design";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var dayjs_min = { exports: {} };
|
|
21
|
-
(function(module, exports) {
|
|
22
|
-
(function(t, e) {
|
|
23
|
-
module.exports = e();
|
|
24
|
-
})(commonjsGlobal, function() {
|
|
25
|
-
var t = 1e3, e = 6e4, n = 36e5, r2 = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t2) {
|
|
26
|
-
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
27
|
-
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
28
|
-
}, "ordinal") }, m = /* @__PURE__ */ __name(function(t2, e2, n2) {
|
|
29
|
-
var r3 = String(t2);
|
|
30
|
-
return !r3 || r3.length >= e2 ? t2 : "" + Array(e2 + 1 - r3.length).join(n2) + t2;
|
|
31
|
-
}, "m"), v = { s: m, z: /* @__PURE__ */ __name(function(t2) {
|
|
32
|
-
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r3 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
33
|
-
return (e2 <= 0 ? "+" : "-") + m(r3, 2, "0") + ":" + m(i2, 2, "0");
|
|
34
|
-
}, "z"), m: /* @__PURE__ */ __name(function t2(e2, n2) {
|
|
35
|
-
if (e2.date() < n2.date()) return -t2(n2, e2);
|
|
36
|
-
var r3 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r3, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r3 + (s2 ? -1 : 1), c);
|
|
37
|
-
return +(-(r3 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
38
|
-
}, "t"), a: /* @__PURE__ */ __name(function(t2) {
|
|
39
|
-
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
40
|
-
}, "a"), p: /* @__PURE__ */ __name(function(t2) {
|
|
41
|
-
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r2, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
42
|
-
}, "p"), u: /* @__PURE__ */ __name(function(t2) {
|
|
43
|
-
return t2 === void 0;
|
|
44
|
-
}, "u") }, g = "en", D = {};
|
|
45
|
-
D[g] = M;
|
|
46
|
-
var p = "$isDayjsObject", S = /* @__PURE__ */ __name(function(t2) {
|
|
47
|
-
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
48
|
-
}, "S"), w = /* @__PURE__ */ __name(function t2(e2, n2, r3) {
|
|
49
|
-
var i2;
|
|
50
|
-
if (!e2) return g;
|
|
51
|
-
if (typeof e2 == "string") {
|
|
52
|
-
var s2 = e2.toLowerCase();
|
|
53
|
-
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
54
|
-
var u2 = e2.split("-");
|
|
55
|
-
if (!i2 && u2.length > 1) return t2(u2[0]);
|
|
56
|
-
} else {
|
|
57
|
-
var a2 = e2.name;
|
|
58
|
-
D[a2] = e2, i2 = a2;
|
|
59
|
-
}
|
|
60
|
-
return !r3 && i2 && (g = i2), i2 || !r3 && g;
|
|
61
|
-
}, "t"), O = /* @__PURE__ */ __name(function(t2, e2) {
|
|
62
|
-
if (S(t2)) return t2.clone();
|
|
63
|
-
var n2 = typeof e2 == "object" ? e2 : {};
|
|
64
|
-
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
65
|
-
}, "O"), b = v;
|
|
66
|
-
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
67
|
-
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
68
|
-
};
|
|
69
|
-
var _ = function() {
|
|
70
|
-
function M2(t2) {
|
|
71
|
-
this.$L = w(t2.locale, null, !0), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = !0;
|
|
72
|
-
}
|
|
73
|
-
__name(M2, "M");
|
|
74
|
-
var m2 = M2.prototype;
|
|
75
|
-
return m2.parse = function(t2) {
|
|
76
|
-
this.$d = function(t3) {
|
|
77
|
-
var e2 = t3.date, n2 = t3.utc;
|
|
78
|
-
if (e2 === null) return /* @__PURE__ */ new Date(NaN);
|
|
79
|
-
if (b.u(e2)) return /* @__PURE__ */ new Date();
|
|
80
|
-
if (e2 instanceof Date) return new Date(e2);
|
|
81
|
-
if (typeof e2 == "string" && !/Z$/i.test(e2)) {
|
|
82
|
-
var r3 = e2.match($);
|
|
83
|
-
if (r3) {
|
|
84
|
-
var i2 = r3[2] - 1 || 0, s2 = (r3[7] || "0").substring(0, 3);
|
|
85
|
-
return n2 ? new Date(Date.UTC(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2)) : new Date(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return new Date(e2);
|
|
89
|
-
}(t2), this.init();
|
|
90
|
-
}, m2.init = function() {
|
|
91
|
-
var t2 = this.$d;
|
|
92
|
-
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
93
|
-
}, m2.$utils = function() {
|
|
94
|
-
return b;
|
|
95
|
-
}, m2.isValid = function() {
|
|
96
|
-
return this.$d.toString() !== l;
|
|
97
|
-
}, m2.isSame = function(t2, e2) {
|
|
98
|
-
var n2 = O(t2);
|
|
99
|
-
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
100
|
-
}, m2.isAfter = function(t2, e2) {
|
|
101
|
-
return O(t2) < this.startOf(e2);
|
|
102
|
-
}, m2.isBefore = function(t2, e2) {
|
|
103
|
-
return this.endOf(e2) < O(t2);
|
|
104
|
-
}, m2.$g = function(t2, e2, n2) {
|
|
105
|
-
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
106
|
-
}, m2.unix = function() {
|
|
107
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
108
|
-
}, m2.valueOf = function() {
|
|
109
|
-
return this.$d.getTime();
|
|
110
|
-
}, m2.startOf = function(t2, e2) {
|
|
111
|
-
var n2 = this, r3 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = /* @__PURE__ */ __name(function(t3, e3) {
|
|
112
|
-
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
113
|
-
return r3 ? i2 : i2.endOf(a);
|
|
114
|
-
}, "l"), $2 = /* @__PURE__ */ __name(function(t3, e3) {
|
|
115
|
-
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
116
|
-
}, "$"), y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
117
|
-
switch (f2) {
|
|
118
|
-
case h:
|
|
119
|
-
return r3 ? l2(1, 0) : l2(31, 11);
|
|
120
|
-
case c:
|
|
121
|
-
return r3 ? l2(1, M3) : l2(0, M3 + 1);
|
|
122
|
-
case o:
|
|
123
|
-
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
124
|
-
return l2(r3 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
125
|
-
case a:
|
|
126
|
-
case d:
|
|
127
|
-
return $2(v2 + "Hours", 0);
|
|
128
|
-
case u:
|
|
129
|
-
return $2(v2 + "Minutes", 1);
|
|
130
|
-
case s:
|
|
131
|
-
return $2(v2 + "Seconds", 2);
|
|
132
|
-
case i:
|
|
133
|
-
return $2(v2 + "Milliseconds", 3);
|
|
134
|
-
default:
|
|
135
|
-
return this.clone();
|
|
136
|
-
}
|
|
137
|
-
}, m2.endOf = function(t2) {
|
|
138
|
-
return this.startOf(t2, !1);
|
|
139
|
-
}, m2.$set = function(t2, e2) {
|
|
140
|
-
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r2] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
141
|
-
if (o2 === c || o2 === h) {
|
|
142
|
-
var y2 = this.clone().set(d, 1);
|
|
143
|
-
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
144
|
-
} else l2 && this.$d[l2]($2);
|
|
145
|
-
return this.init(), this;
|
|
146
|
-
}, m2.set = function(t2, e2) {
|
|
147
|
-
return this.clone().$set(t2, e2);
|
|
148
|
-
}, m2.get = function(t2) {
|
|
149
|
-
return this[b.p(t2)]();
|
|
150
|
-
}, m2.add = function(r3, f2) {
|
|
151
|
-
var d2, l2 = this;
|
|
152
|
-
r3 = Number(r3);
|
|
153
|
-
var $2 = b.p(f2), y2 = /* @__PURE__ */ __name(function(t2) {
|
|
154
|
-
var e2 = O(l2);
|
|
155
|
-
return b.w(e2.date(e2.date() + Math.round(t2 * r3)), l2);
|
|
156
|
-
}, "y");
|
|
157
|
-
if ($2 === c) return this.set(c, this.$M + r3);
|
|
158
|
-
if ($2 === h) return this.set(h, this.$y + r3);
|
|
159
|
-
if ($2 === a) return y2(1);
|
|
160
|
-
if ($2 === o) return y2(7);
|
|
161
|
-
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r3 * M3;
|
|
162
|
-
return b.w(m3, this);
|
|
163
|
-
}, m2.subtract = function(t2, e2) {
|
|
164
|
-
return this.add(-1 * t2, e2);
|
|
165
|
-
}, m2.format = function(t2) {
|
|
166
|
-
var e2 = this, n2 = this.$locale();
|
|
167
|
-
if (!this.isValid()) return n2.invalidDate || l;
|
|
168
|
-
var r3 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = /* @__PURE__ */ __name(function(t3, n3, i3, s3) {
|
|
169
|
-
return t3 && (t3[n3] || t3(e2, r3)) || i3[n3].slice(0, s3);
|
|
170
|
-
}, "h"), d2 = /* @__PURE__ */ __name(function(t3) {
|
|
171
|
-
return b.s(s2 % 12 || 12, t3, "0");
|
|
172
|
-
}, "d"), $2 = f2 || function(t3, e3, n3) {
|
|
173
|
-
var r4 = t3 < 12 ? "AM" : "PM";
|
|
174
|
-
return n3 ? r4.toLowerCase() : r4;
|
|
175
|
-
};
|
|
176
|
-
return r3.replace(y, function(t3, r4) {
|
|
177
|
-
return r4 || function(t4) {
|
|
178
|
-
switch (t4) {
|
|
179
|
-
case "YY":
|
|
180
|
-
return String(e2.$y).slice(-2);
|
|
181
|
-
case "YYYY":
|
|
182
|
-
return b.s(e2.$y, 4, "0");
|
|
183
|
-
case "M":
|
|
184
|
-
return a2 + 1;
|
|
185
|
-
case "MM":
|
|
186
|
-
return b.s(a2 + 1, 2, "0");
|
|
187
|
-
case "MMM":
|
|
188
|
-
return h2(n2.monthsShort, a2, c2, 3);
|
|
189
|
-
case "MMMM":
|
|
190
|
-
return h2(c2, a2);
|
|
191
|
-
case "D":
|
|
192
|
-
return e2.$D;
|
|
193
|
-
case "DD":
|
|
194
|
-
return b.s(e2.$D, 2, "0");
|
|
195
|
-
case "d":
|
|
196
|
-
return String(e2.$W);
|
|
197
|
-
case "dd":
|
|
198
|
-
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
199
|
-
case "ddd":
|
|
200
|
-
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
201
|
-
case "dddd":
|
|
202
|
-
return o2[e2.$W];
|
|
203
|
-
case "H":
|
|
204
|
-
return String(s2);
|
|
205
|
-
case "HH":
|
|
206
|
-
return b.s(s2, 2, "0");
|
|
207
|
-
case "h":
|
|
208
|
-
return d2(1);
|
|
209
|
-
case "hh":
|
|
210
|
-
return d2(2);
|
|
211
|
-
case "a":
|
|
212
|
-
return $2(s2, u2, !0);
|
|
213
|
-
case "A":
|
|
214
|
-
return $2(s2, u2, !1);
|
|
215
|
-
case "m":
|
|
216
|
-
return String(u2);
|
|
217
|
-
case "mm":
|
|
218
|
-
return b.s(u2, 2, "0");
|
|
219
|
-
case "s":
|
|
220
|
-
return String(e2.$s);
|
|
221
|
-
case "ss":
|
|
222
|
-
return b.s(e2.$s, 2, "0");
|
|
223
|
-
case "SSS":
|
|
224
|
-
return b.s(e2.$ms, 3, "0");
|
|
225
|
-
case "Z":
|
|
226
|
-
return i2;
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}(t3) || i2.replace(":", "");
|
|
230
|
-
});
|
|
231
|
-
}, m2.utcOffset = function() {
|
|
232
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
233
|
-
}, m2.diff = function(r3, d2, l2) {
|
|
234
|
-
var $2, y2 = this, M3 = b.p(d2), m3 = O(r3), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = /* @__PURE__ */ __name(function() {
|
|
235
|
-
return b.m(y2, m3);
|
|
236
|
-
}, "D");
|
|
237
|
-
switch (M3) {
|
|
238
|
-
case h:
|
|
239
|
-
$2 = D2() / 12;
|
|
240
|
-
break;
|
|
241
|
-
case c:
|
|
242
|
-
$2 = D2();
|
|
243
|
-
break;
|
|
244
|
-
case f:
|
|
245
|
-
$2 = D2() / 3;
|
|
246
|
-
break;
|
|
247
|
-
case o:
|
|
248
|
-
$2 = (g2 - v2) / 6048e5;
|
|
249
|
-
break;
|
|
250
|
-
case a:
|
|
251
|
-
$2 = (g2 - v2) / 864e5;
|
|
252
|
-
break;
|
|
253
|
-
case u:
|
|
254
|
-
$2 = g2 / n;
|
|
255
|
-
break;
|
|
256
|
-
case s:
|
|
257
|
-
$2 = g2 / e;
|
|
258
|
-
break;
|
|
259
|
-
case i:
|
|
260
|
-
$2 = g2 / t;
|
|
261
|
-
break;
|
|
262
|
-
default:
|
|
263
|
-
$2 = g2;
|
|
264
|
-
}
|
|
265
|
-
return l2 ? $2 : b.a($2);
|
|
266
|
-
}, m2.daysInMonth = function() {
|
|
267
|
-
return this.endOf(c).$D;
|
|
268
|
-
}, m2.$locale = function() {
|
|
269
|
-
return D[this.$L];
|
|
270
|
-
}, m2.locale = function(t2, e2) {
|
|
271
|
-
if (!t2) return this.$L;
|
|
272
|
-
var n2 = this.clone(), r3 = w(t2, e2, !0);
|
|
273
|
-
return r3 && (n2.$L = r3), n2;
|
|
274
|
-
}, m2.clone = function() {
|
|
275
|
-
return b.w(this.$d, this);
|
|
276
|
-
}, m2.toDate = function() {
|
|
277
|
-
return new Date(this.valueOf());
|
|
278
|
-
}, m2.toJSON = function() {
|
|
279
|
-
return this.isValid() ? this.toISOString() : null;
|
|
280
|
-
}, m2.toISOString = function() {
|
|
281
|
-
return this.$d.toISOString();
|
|
282
|
-
}, m2.toString = function() {
|
|
283
|
-
return this.$d.toUTCString();
|
|
284
|
-
}, M2;
|
|
285
|
-
}(), k = _.prototype;
|
|
286
|
-
return O.prototype = k, [["$ms", r2], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
287
|
-
k[t2[1]] = function(e2) {
|
|
288
|
-
return this.$g(e2, t2[0], t2[1]);
|
|
289
|
-
};
|
|
290
|
-
}), O.extend = function(t2, e2) {
|
|
291
|
-
return t2.$i || (t2(e2, _, O), t2.$i = !0), O;
|
|
292
|
-
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
293
|
-
return O(1e3 * t2);
|
|
294
|
-
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
295
|
-
});
|
|
296
|
-
})(dayjs_min);
|
|
297
|
-
var dayjs_minExports = dayjs_min.exports;
|
|
298
|
-
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
299
|
-
function getDT() {
|
|
300
|
-
return dayjs().format("YYYY/MM/DD HH:mm");
|
|
301
|
-
}
|
|
302
|
-
__name(getDT, "getDT");
|
|
303
|
-
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
304
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
305
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
306
|
-
return kind && result && __defProp$1(target, key, result), result;
|
|
307
|
-
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a;
|
|
308
|
-
let ThreadCommentPanelService = (_a = class extends Disposable {
|
|
309
|
-
constructor(_sidebarService, _univerInstanceService) {
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var ze = (t, e, r) => e in t ? We(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var w = (t, e, r) => ze(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Inject as Se, Disposable as Ze, UniverInstanceType as he, IUniverInstanceService as Ge, CommandType as ye, createIdentifier as qe, DependentOn as Ke, Injector as Ye, Plugin as Je, mergeOverrideWithDependencies as Qe, ICommandService as re, IConfigService as Xe, CustomRangeType as et, useDependency as x, LocaleService as fe, UserManagerService as ge, generateRandomId as tt } from "@univerjs/core";
|
|
5
|
+
import { UniverThreadCommentPlugin as nt, ThreadCommentModel as _e, getDT as rt, AddCommentCommand as ot, UpdateCommentCommand as it, ResolveCommentCommand as st, DeleteCommentTreeCommand as je, DeleteCommentCommand as at } from "@univerjs/thread-comment";
|
|
6
|
+
import { ISidebarService as Ne, useObservable as F } from "@univerjs/ui";
|
|
7
|
+
import { BehaviorSubject as pe, filter as lt, debounceTime as dt } from "rxjs";
|
|
8
|
+
import mt, { forwardRef as A, useRef as ne, createElement as z, useState as k, useImperativeHandle as ct, useMemo as le, useEffect as Ce } from "react";
|
|
9
|
+
import { Mentions as ht, Mention as ut, Button as de, Tooltip as vt, Dropdown as Ct, Menu as ft, MenuItem as Ie, Select as xe } from "@univerjs/design";
|
|
10
|
+
import { DocSelectionManagerService as gt } from "@univerjs/docs";
|
|
11
|
+
import { DocSelectionRenderService as pt } from "@univerjs/docs-ui";
|
|
12
|
+
import { IRenderManagerService as It } from "@univerjs/engine-render";
|
|
13
|
+
var xt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, St = (t, e, r, n) => {
|
|
14
|
+
for (var o = n > 1 ? void 0 : n ? bt(e, r) : e, a = t.length - 1, d; a >= 0; a--)
|
|
15
|
+
(d = t[a]) && (o = (n ? d(e, r, o) : d(o)) || o);
|
|
16
|
+
return n && o && xt(e, r, o), o;
|
|
17
|
+
}, be = (t, e) => (r, n) => e(r, n, t);
|
|
18
|
+
let q = class extends Ze {
|
|
19
|
+
constructor(e, r) {
|
|
310
20
|
super();
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
this._sidebarService =
|
|
21
|
+
w(this, "_panelVisible", !1);
|
|
22
|
+
w(this, "_panelVisible$", new pe(!1));
|
|
23
|
+
w(this, "_activeCommentId");
|
|
24
|
+
w(this, "_activeCommentId$", new pe(void 0));
|
|
25
|
+
w(this, "panelVisible$", this._panelVisible$.asObservable());
|
|
26
|
+
w(this, "activeCommentId$", this._activeCommentId$.asObservable());
|
|
27
|
+
this._sidebarService = e, this._univerInstanceService = r, this._init(), this.disposeWithMe(() => {
|
|
318
28
|
this._activeCommentId$.complete(), this._panelVisible$.complete();
|
|
319
29
|
});
|
|
320
30
|
}
|
|
321
31
|
_init() {
|
|
322
32
|
this.disposeWithMe(
|
|
323
|
-
this._sidebarService.sidebarOptions$.subscribe((
|
|
324
|
-
|
|
33
|
+
this._sidebarService.sidebarOptions$.subscribe((e) => {
|
|
34
|
+
e.visible || this.setPanelVisible(!1);
|
|
325
35
|
})
|
|
326
36
|
), this.disposeWithMe(
|
|
327
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
37
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(lt((e) => !e)).subscribe(() => {
|
|
328
38
|
this._sidebarService.close();
|
|
329
39
|
})
|
|
330
40
|
);
|
|
@@ -335,733 +45,800 @@ let ThreadCommentPanelService = (_a = class extends Disposable {
|
|
|
335
45
|
get activeCommentId() {
|
|
336
46
|
return this._activeCommentId;
|
|
337
47
|
}
|
|
338
|
-
setPanelVisible(
|
|
339
|
-
this._panelVisible =
|
|
48
|
+
setPanelVisible(e) {
|
|
49
|
+
this._panelVisible = e, this._panelVisible$.next(e);
|
|
340
50
|
}
|
|
341
|
-
setActiveComment(
|
|
342
|
-
this._activeCommentId =
|
|
51
|
+
setActiveComment(e) {
|
|
52
|
+
this._activeCommentId = e, this._activeCommentId$.next(e);
|
|
343
53
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
],
|
|
349
|
-
const
|
|
54
|
+
};
|
|
55
|
+
q = St([
|
|
56
|
+
be(0, Se(Ne)),
|
|
57
|
+
be(1, Ge)
|
|
58
|
+
], q);
|
|
59
|
+
const yt = "thread-comment-panel", _t = "UNIVER_THREAD_COMMENT_UI_PLUGIN", jt = {
|
|
350
60
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
351
|
-
type:
|
|
352
|
-
handler(
|
|
353
|
-
const
|
|
354
|
-
return
|
|
61
|
+
type: ye.OPERATION,
|
|
62
|
+
handler(t) {
|
|
63
|
+
const e = t.get(Ne), r = t.get(q);
|
|
64
|
+
return r.panelVisible ? (e.close(), r.setPanelVisible(!1)) : (e.open({
|
|
355
65
|
header: { title: "threadCommentUI.panel.title" },
|
|
356
|
-
children: { label:
|
|
66
|
+
children: { label: yt },
|
|
357
67
|
width: 330
|
|
358
|
-
}),
|
|
68
|
+
}), r.setPanelVisible(!0)), !0;
|
|
359
69
|
}
|
|
360
|
-
},
|
|
70
|
+
}, W = {
|
|
361
71
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
362
|
-
type:
|
|
363
|
-
handler(
|
|
364
|
-
return
|
|
72
|
+
type: ye.OPERATION,
|
|
73
|
+
handler(t, e) {
|
|
74
|
+
return t.get(q).setActiveComment(e), !0;
|
|
365
75
|
}
|
|
366
|
-
},
|
|
76
|
+
}, Nt = "thread-comment-ui.config", Tt = {};
|
|
77
|
+
class Ut {
|
|
367
78
|
constructor() {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
79
|
+
w(this, "dataSource");
|
|
80
|
+
w(this, "renderSuggestion");
|
|
81
|
+
w(this, "trigger", "@");
|
|
371
82
|
}
|
|
372
|
-
async getMentions(
|
|
373
|
-
return this.dataSource ? this.dataSource.getMentions(
|
|
83
|
+
async getMentions(e, r, n) {
|
|
84
|
+
return this.dataSource ? this.dataSource.getMentions(e, r, n) : [];
|
|
374
85
|
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const { menu, ...rest } = this._config;
|
|
388
|
-
menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
|
|
86
|
+
}
|
|
87
|
+
const Te = qe("thread-comment.mention-data.service");
|
|
88
|
+
var Ue = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, Mt = (t, e, r) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ot = (t, e, r, n) => {
|
|
89
|
+
for (var o = n > 1 ? void 0 : n ? Et(e, r) : e, a = t.length - 1, d; a >= 0; a--)
|
|
90
|
+
(d = t[a]) && (o = (n ? d(e, r, o) : d(o)) || o);
|
|
91
|
+
return n && o && Ue(e, r, o), o;
|
|
92
|
+
}, ve = (t, e) => (r, n) => e(r, n, t), Ee = (t, e, r) => Mt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
93
|
+
let me = class extends Je {
|
|
94
|
+
constructor(t = Tt, e, r, n) {
|
|
95
|
+
super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
|
|
96
|
+
const { menu: o, ...a } = this._config;
|
|
97
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Nt, a);
|
|
389
98
|
}
|
|
390
99
|
onStarting() {
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
[
|
|
394
|
-
[
|
|
395
|
-
], (
|
|
396
|
-
this._injector.add(
|
|
397
|
-
}), [
|
|
398
|
-
this._commandService.registerCommand(
|
|
100
|
+
var t;
|
|
101
|
+
Qe([
|
|
102
|
+
[q],
|
|
103
|
+
[Te, { useClass: Ut }]
|
|
104
|
+
], (t = this._config) == null ? void 0 : t.overrides).forEach((e) => {
|
|
105
|
+
this._injector.add(e);
|
|
106
|
+
}), [jt, W].forEach((e) => {
|
|
107
|
+
this._commandService.registerCommand(e);
|
|
399
108
|
});
|
|
400
109
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
],
|
|
410
|
-
var
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
110
|
+
};
|
|
111
|
+
Ee(me, "pluginName", _t);
|
|
112
|
+
Ee(me, "type", he.UNIVER_UNKNOWN);
|
|
113
|
+
me = Ot([
|
|
114
|
+
Ke(nt),
|
|
115
|
+
ve(1, Se(Ye)),
|
|
116
|
+
ve(2, re),
|
|
117
|
+
ve(3, Xe)
|
|
118
|
+
], me);
|
|
119
|
+
var Me = { exports: {} }, ue = {};
|
|
120
|
+
/**
|
|
121
|
+
* @license React
|
|
122
|
+
* react-jsx-runtime.production.min.js
|
|
123
|
+
*
|
|
124
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the MIT license found in the
|
|
127
|
+
* LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/
|
|
129
|
+
var Pt = mt, $t = Symbol.for("react.element"), wt = Symbol.for("react.fragment"), Rt = Object.prototype.hasOwnProperty, Ht = Pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Dt = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
130
|
+
function Oe(t, e, r) {
|
|
131
|
+
var n, o = {}, a = null, d = null;
|
|
132
|
+
r !== void 0 && (a = "" + r), e.key !== void 0 && (a = "" + e.key), e.ref !== void 0 && (d = e.ref);
|
|
133
|
+
for (n in e) Rt.call(e, n) && !Dt.hasOwnProperty(n) && (o[n] = e[n]);
|
|
134
|
+
if (t && t.defaultProps) for (n in e = t.defaultProps, e) o[n] === void 0 && (o[n] = e[n]);
|
|
135
|
+
return { $$typeof: $t, type: t, key: a, ref: d, props: o, _owner: Ht.current };
|
|
136
|
+
}
|
|
137
|
+
ue.Fragment = wt;
|
|
138
|
+
ue.jsx = Oe;
|
|
139
|
+
ue.jsxs = Oe;
|
|
140
|
+
Me.exports = ue;
|
|
141
|
+
var i = Me.exports, M = function() {
|
|
142
|
+
return M = Object.assign || function(t) {
|
|
143
|
+
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
144
|
+
e = arguments[r];
|
|
145
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
415
146
|
}
|
|
416
147
|
return t;
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
var
|
|
420
|
-
for (var
|
|
421
|
-
if (
|
|
422
|
-
for (var
|
|
423
|
-
e.indexOf(
|
|
424
|
-
return
|
|
425
|
-
},
|
|
426
|
-
var
|
|
427
|
-
return
|
|
148
|
+
}, M.apply(this, arguments);
|
|
149
|
+
}, kt = function(t, e) {
|
|
150
|
+
var r = {};
|
|
151
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
152
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
153
|
+
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
154
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
155
|
+
return r;
|
|
156
|
+
}, Z = A(function(t, e) {
|
|
157
|
+
var r = t.icon, n = t.id, o = t.className, a = t.extend, d = kt(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), v = ne("_".concat(Vt()));
|
|
158
|
+
return Pe(r, "".concat(n), { defIds: r.defIds, idSuffix: v.current }, M({ ref: e, className: c }, d), a);
|
|
428
159
|
});
|
|
429
|
-
function
|
|
430
|
-
return
|
|
431
|
-
return
|
|
160
|
+
function Pe(t, e, r, n, o) {
|
|
161
|
+
return z(t.tag, M(M({ key: e }, At(t, r, o)), n), (Lt(t, r).children || []).map(function(a, d) {
|
|
162
|
+
return Pe(a, "".concat(e, "-").concat(t.tag, "-").concat(d), r, void 0, o);
|
|
432
163
|
}));
|
|
433
164
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
})), attrs;
|
|
165
|
+
function At(t, e, r) {
|
|
166
|
+
var n = M({}, t.attrs);
|
|
167
|
+
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
168
|
+
var o = e.defIds;
|
|
169
|
+
return !o || o.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(a) {
|
|
170
|
+
var d = a[0], c = a[1];
|
|
171
|
+
typeof c == "string" && (n[d] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
172
|
+
})), n;
|
|
443
173
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}) }) : node;
|
|
174
|
+
function Lt(t, e) {
|
|
175
|
+
var r, n = e.defIds;
|
|
176
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? M(M({}, t), { children: t.children.map(function(o) {
|
|
177
|
+
return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? M(M({}, o), { attrs: M(M({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
178
|
+
}) }) : t;
|
|
450
179
|
}
|
|
451
|
-
|
|
452
|
-
function generateShortUuid() {
|
|
180
|
+
function Vt() {
|
|
453
181
|
return Math.random().toString(36).substring(2, 8);
|
|
454
182
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
183
|
+
Z.displayName = "UniverIcon";
|
|
184
|
+
var Bt = { 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" } }] }, $e = A(function(t, e) {
|
|
185
|
+
return z(Z, Object.assign({}, t, {
|
|
459
186
|
id: "delete-single",
|
|
460
|
-
ref,
|
|
461
|
-
icon:
|
|
187
|
+
ref: e,
|
|
188
|
+
icon: Bt
|
|
462
189
|
}));
|
|
463
190
|
});
|
|
464
|
-
|
|
465
|
-
var
|
|
466
|
-
return
|
|
191
|
+
$e.displayName = "DeleteSingle";
|
|
192
|
+
var Ft = { 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" } }] }, we = A(function(t, e) {
|
|
193
|
+
return z(Z, Object.assign({}, t, {
|
|
467
194
|
id: "increase-single",
|
|
468
|
-
ref,
|
|
469
|
-
icon:
|
|
195
|
+
ref: e,
|
|
196
|
+
icon: Ft
|
|
470
197
|
}));
|
|
471
198
|
});
|
|
472
|
-
|
|
473
|
-
var
|
|
474
|
-
return
|
|
199
|
+
we.displayName = "IncreaseSingle";
|
|
200
|
+
var Wt = { 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" } }] }, Re = A(function(t, e) {
|
|
201
|
+
return z(Z, Object.assign({}, t, {
|
|
475
202
|
id: "more-horizontal-single",
|
|
476
|
-
ref,
|
|
477
|
-
icon:
|
|
203
|
+
ref: e,
|
|
204
|
+
icon: Wt
|
|
478
205
|
}));
|
|
479
206
|
});
|
|
480
|
-
|
|
481
|
-
var
|
|
482
|
-
return
|
|
207
|
+
Re.displayName = "MoreHorizontalSingle";
|
|
208
|
+
var zt = { 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 } }] }, He = A(function(t, e) {
|
|
209
|
+
return z(Z, Object.assign({}, t, {
|
|
483
210
|
id: "reply-to-comment-single",
|
|
484
|
-
ref,
|
|
485
|
-
icon:
|
|
211
|
+
ref: e,
|
|
212
|
+
icon: zt
|
|
486
213
|
}));
|
|
487
214
|
});
|
|
488
|
-
|
|
489
|
-
var
|
|
490
|
-
return
|
|
215
|
+
He.displayName = "ReplyToCommentSingle";
|
|
216
|
+
var Zt = { 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" } }] }, De = A(function(t, e) {
|
|
217
|
+
return z(Z, Object.assign({}, t, {
|
|
491
218
|
id: "resolved-single",
|
|
492
|
-
ref,
|
|
493
|
-
icon:
|
|
219
|
+
ref: e,
|
|
220
|
+
icon: Zt
|
|
494
221
|
}));
|
|
495
222
|
});
|
|
496
|
-
|
|
497
|
-
var
|
|
498
|
-
return
|
|
223
|
+
De.displayName = "ResolvedSingle";
|
|
224
|
+
var Gt = { 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 } }] }, ke = A(function(t, e) {
|
|
225
|
+
return z(Z, Object.assign({}, t, {
|
|
499
226
|
id: "solve-single",
|
|
500
|
-
ref,
|
|
501
|
-
icon:
|
|
227
|
+
ref: e,
|
|
228
|
+
icon: Gt
|
|
502
229
|
}));
|
|
503
230
|
});
|
|
504
|
-
|
|
505
|
-
function
|
|
506
|
-
var
|
|
507
|
-
if (typeof
|
|
508
|
-
else if (typeof
|
|
509
|
-
var o =
|
|
510
|
-
for (
|
|
511
|
-
} else for (
|
|
231
|
+
ke.displayName = "SolveSingle";
|
|
232
|
+
function Ae(t) {
|
|
233
|
+
var e, r, n = "";
|
|
234
|
+
if (typeof t == "string" || typeof t == "number") n += t;
|
|
235
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
236
|
+
var o = t.length;
|
|
237
|
+
for (e = 0; e < o; e++) t[e] && (r = Ae(t[e])) && (n && (n += " "), n += r);
|
|
238
|
+
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
512
239
|
return n;
|
|
513
240
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
241
|
+
function qt() {
|
|
242
|
+
for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = Ae(t)) && (n && (n += " "), n += e);
|
|
517
243
|
return n;
|
|
518
244
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
match.index > lastIndex && result.push({
|
|
245
|
+
const Kt = "univer-thread-comment-editor-buttons", Yt = "univer-thread-comment-editor-suggestion", Jt = "univer-thread-comment-editor-suggestionActive", Qt = "univer-thread-comment-editor-suggestion-icon", ce = {
|
|
246
|
+
threadCommentEditorButtons: Kt,
|
|
247
|
+
threadCommentEditorSuggestion: Yt,
|
|
248
|
+
threadCommentEditorSuggestionActive: Jt,
|
|
249
|
+
threadCommentEditorSuggestionIcon: Qt
|
|
250
|
+
}, Xt = (t) => {
|
|
251
|
+
const e = /@\[(.*?)\]\((.*?)\)|(\w+)/g;
|
|
252
|
+
let r, n = 0;
|
|
253
|
+
const o = [];
|
|
254
|
+
for (; (r = e.exec(t)) !== null; )
|
|
255
|
+
r.index > n && o.push({
|
|
531
256
|
type: "text",
|
|
532
|
-
content:
|
|
533
|
-
}),
|
|
257
|
+
content: t.substring(n, r.index)
|
|
258
|
+
}), r[1] && r[2] ? o.push({
|
|
534
259
|
type: "mention",
|
|
535
260
|
content: {
|
|
536
|
-
label:
|
|
537
|
-
id:
|
|
261
|
+
label: r[1],
|
|
262
|
+
id: r[2]
|
|
538
263
|
}
|
|
539
|
-
}) :
|
|
264
|
+
}) : r[3] && o.push({
|
|
540
265
|
type: "text",
|
|
541
|
-
content:
|
|
542
|
-
}),
|
|
543
|
-
return
|
|
266
|
+
content: r[3]
|
|
267
|
+
}), n = e.lastIndex;
|
|
268
|
+
return n < t.length && o.push({
|
|
544
269
|
type: "text",
|
|
545
|
-
content:
|
|
546
|
-
}),
|
|
547
|
-
},
|
|
548
|
-
switch (
|
|
270
|
+
content: t.substring(n)
|
|
271
|
+
}), o;
|
|
272
|
+
}, en = (t) => t.map((e) => {
|
|
273
|
+
switch (e.type) {
|
|
549
274
|
case "mention":
|
|
550
|
-
return `@[${
|
|
275
|
+
return `@[${e.content.label}](${e.content.id})`;
|
|
551
276
|
default:
|
|
552
|
-
return
|
|
277
|
+
return e.content;
|
|
553
278
|
}
|
|
554
|
-
}).join(""),
|
|
555
|
-
const { dataStream, customRanges } =
|
|
556
|
-
let
|
|
557
|
-
return
|
|
558
|
-
|
|
279
|
+
}).join(""), Le = (t) => {
|
|
280
|
+
const { dataStream: e, customRanges: r } = t, n = e.length - 2, o = [];
|
|
281
|
+
let a = 0;
|
|
282
|
+
return r == null || r.forEach((d) => {
|
|
283
|
+
a < d.startIndex && o.push({
|
|
559
284
|
type: "text",
|
|
560
|
-
content:
|
|
561
|
-
}),
|
|
285
|
+
content: e.slice(a, d.startIndex)
|
|
286
|
+
}), o.push({
|
|
562
287
|
type: "mention",
|
|
563
288
|
content: {
|
|
564
|
-
label:
|
|
565
|
-
id:
|
|
289
|
+
label: e.slice(d.startIndex, d.endIndex).slice(1, -1),
|
|
290
|
+
id: d.rangeId
|
|
566
291
|
}
|
|
567
|
-
}),
|
|
568
|
-
}),
|
|
292
|
+
}), a = d.endIndex;
|
|
293
|
+
}), o.push({
|
|
569
294
|
type: "text",
|
|
570
|
-
content:
|
|
571
|
-
}),
|
|
572
|
-
},
|
|
573
|
-
let
|
|
574
|
-
const
|
|
575
|
-
return
|
|
576
|
-
switch (
|
|
295
|
+
content: e.slice(a, n)
|
|
296
|
+
}), o;
|
|
297
|
+
}, Ve = (t) => {
|
|
298
|
+
let e = "";
|
|
299
|
+
const r = [];
|
|
300
|
+
return t.forEach((n) => {
|
|
301
|
+
switch (n.type) {
|
|
577
302
|
case "text":
|
|
578
|
-
|
|
303
|
+
e += n.content;
|
|
579
304
|
break;
|
|
580
305
|
case "mention": {
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
rangeId:
|
|
586
|
-
rangeType:
|
|
587
|
-
startIndex:
|
|
588
|
-
endIndex:
|
|
306
|
+
const o = e.length;
|
|
307
|
+
e += `${n.content.label}`;
|
|
308
|
+
const a = e.length;
|
|
309
|
+
r.push({
|
|
310
|
+
rangeId: n.content.id,
|
|
311
|
+
rangeType: et.MENTION,
|
|
312
|
+
startIndex: o,
|
|
313
|
+
endIndex: a,
|
|
314
|
+
properties: {}
|
|
589
315
|
});
|
|
590
316
|
break;
|
|
591
317
|
}
|
|
592
318
|
}
|
|
593
|
-
}),
|
|
319
|
+
}), e += `
|
|
594
320
|
\r`, {
|
|
595
321
|
textRuns: [],
|
|
596
322
|
paragraphs: [
|
|
597
323
|
{
|
|
598
|
-
startIndex:
|
|
324
|
+
startIndex: e.length - 2,
|
|
599
325
|
paragraphStyle: {}
|
|
600
326
|
}
|
|
601
327
|
],
|
|
602
328
|
sectionBreaks: [
|
|
603
329
|
{
|
|
604
|
-
startIndex:
|
|
330
|
+
startIndex: e.length - 1
|
|
605
331
|
}
|
|
606
332
|
],
|
|
607
|
-
dataStream:
|
|
608
|
-
customRanges
|
|
333
|
+
dataStream: e,
|
|
334
|
+
customRanges: r
|
|
609
335
|
};
|
|
610
|
-
},
|
|
611
|
-
display:
|
|
612
|
-
id: `${
|
|
613
|
-
raw:
|
|
614
|
-
}),
|
|
615
|
-
var
|
|
616
|
-
const
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
336
|
+
}, tn = (t) => ({
|
|
337
|
+
display: t.label,
|
|
338
|
+
id: `${t.id}`,
|
|
339
|
+
raw: t
|
|
340
|
+
}), nn = (t, e, r, n, o) => {
|
|
341
|
+
var d, c;
|
|
342
|
+
const a = (d = t.raw) == null ? void 0 : d.icon;
|
|
343
|
+
return /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditorSuggestion, children: [
|
|
344
|
+
a ? /* @__PURE__ */ i.jsx("img", { className: ce.threadCommentEditorSuggestionIcon, src: a }) : null,
|
|
345
|
+
/* @__PURE__ */ i.jsx("div", { children: (c = t.display) != null ? c : t.id })
|
|
346
|
+
] });
|
|
347
|
+
}, Be = A((t, e) => {
|
|
348
|
+
var p, U;
|
|
349
|
+
const { comment: r, onSave: n, id: o, onCancel: a, autoFocus: d, unitId: c, subUnitId: v } = t, S = x(Te), O = x(re), N = x(fe), [f, u] = k({ ...r }), [C, g] = k(!1), T = ne(null), b = x(gt), m = (p = x(It).getCurrentTypeOfRenderer(he.UNIVER_DOC)) == null ? void 0 : p.with(pt);
|
|
350
|
+
ct(e, () => ({
|
|
351
|
+
reply(s) {
|
|
352
|
+
var I;
|
|
353
|
+
u({
|
|
354
|
+
...r,
|
|
355
|
+
text: s,
|
|
627
356
|
attachments: []
|
|
628
|
-
}), (
|
|
357
|
+
}), (I = T.current) == null || I.inputElement.focus();
|
|
629
358
|
}
|
|
630
359
|
}));
|
|
631
|
-
const
|
|
632
|
-
var
|
|
633
|
-
|
|
634
|
-
...
|
|
635
|
-
text:
|
|
636
|
-
}),
|
|
637
|
-
}
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
ref: inputRef,
|
|
642
|
-
autoFocus,
|
|
643
|
-
style: { width: "100%" },
|
|
644
|
-
placeholder: localeService.t("threadCommentUI.editor.placeholder"),
|
|
645
|
-
value: localComment != null && localComment.text ? transformTextNode2Text(transformDocument2TextNodes(localComment.text)) : "",
|
|
646
|
-
onChange: /* @__PURE__ */ __name((e) => {
|
|
647
|
-
e.target.value || setLocalComment({ ...comment, text: void 0 }), setLocalComment == null || setLocalComment({ ...comment, text: transformTextNodes2Document(parseMentions(e.target.value)) });
|
|
648
|
-
}, "onChange"),
|
|
649
|
-
onFocus: /* @__PURE__ */ __name(() => {
|
|
650
|
-
const activeRange = docSelectionManagerService.getActiveTextRange();
|
|
651
|
-
activeRange && activeRange.collapsed && (docSelectionRenderService == null || docSelectionRenderService.removeAllRanges()), docSelectionRenderService == null || docSelectionRenderService.blur(), setEditing(!0);
|
|
652
|
-
}, "onFocus")
|
|
653
|
-
},
|
|
654
|
-
/* @__PURE__ */ React.createElement(
|
|
655
|
-
Mention,
|
|
360
|
+
const D = () => {
|
|
361
|
+
var s;
|
|
362
|
+
f.text && (n == null || n({
|
|
363
|
+
...f,
|
|
364
|
+
text: f.text
|
|
365
|
+
}), g(!1), u({ text: void 0 }), (s = T.current) == null || s.inputElement.blur());
|
|
366
|
+
};
|
|
367
|
+
return /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditor, onClick: (s) => s.preventDefault(), children: [
|
|
368
|
+
/* @__PURE__ */ i.jsx(
|
|
369
|
+
ht,
|
|
656
370
|
{
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
371
|
+
ref: T,
|
|
372
|
+
autoFocus: d,
|
|
373
|
+
style: { width: "100%" },
|
|
374
|
+
placeholder: N.t("threadCommentUI.editor.placeholder"),
|
|
375
|
+
value: f != null && f.text ? en(Le(f.text)) : "",
|
|
376
|
+
onChange: (s) => {
|
|
377
|
+
s.target.value || u({ ...r, text: void 0 }), u == null || u({ ...r, text: Ve(Xt(s.target.value)) });
|
|
378
|
+
},
|
|
379
|
+
onFocus: () => {
|
|
380
|
+
const s = b.getActiveTextRange();
|
|
381
|
+
s && s.collapsed && (m == null || m.removeAllRanges()), m == null || m.blur(), g(!0);
|
|
382
|
+
},
|
|
383
|
+
children: /* @__PURE__ */ i.jsx(
|
|
384
|
+
ut,
|
|
385
|
+
{
|
|
386
|
+
trigger: S.trigger,
|
|
387
|
+
data: (s, I) => S.getMentions(s, c, v).then((y) => y.map(tn)).then(I),
|
|
388
|
+
displayTransform: (s, I) => `@${I} `,
|
|
389
|
+
renderSuggestion: (U = S.renderSuggestion) != null ? U : nn
|
|
390
|
+
},
|
|
391
|
+
S.trigger
|
|
392
|
+
)
|
|
662
393
|
}
|
|
663
|
-
)
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
394
|
+
),
|
|
395
|
+
C ? /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditorButtons, children: [
|
|
396
|
+
/* @__PURE__ */ i.jsx(
|
|
397
|
+
de,
|
|
398
|
+
{
|
|
399
|
+
style: { marginRight: 12 },
|
|
400
|
+
onClick: () => {
|
|
401
|
+
a == null || a(), g(!1), u({ text: void 0 }), O.executeCommand(W.id);
|
|
402
|
+
},
|
|
403
|
+
children: N.t("threadCommentUI.editor.cancel")
|
|
404
|
+
}
|
|
405
|
+
),
|
|
406
|
+
/* @__PURE__ */ i.jsx(
|
|
407
|
+
de,
|
|
408
|
+
{
|
|
409
|
+
type: "primary",
|
|
410
|
+
disabled: !f.text,
|
|
411
|
+
onClick: D,
|
|
412
|
+
children: N.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
] }) : null
|
|
416
|
+
] });
|
|
417
|
+
}), rn = "univer-thread-comment", on = "univer-thread-comment-active", sn = "univer-thread-comment-content", an = "univer-thread-comment-highlight", ln = "univer-thread-comment-icon-container", dn = "univer-thread-comment-icon", mn = "univer-thread-comment-title", cn = "univer-thread-comment-title-position", hn = "univer-thread-comment-title-highlight", un = "univer-thread-comment-title-position-text", vn = "univer-thread-comment-username", Cn = "univer-thread-comment-item", fn = "univer-thread-comment-item-head", gn = "univer-thread-comment-item-title", pn = "univer-thread-comment-item-title-position", In = "univer-thread-comment-item-title-highlight", xn = "univer-thread-comment-item-time", bn = "univer-thread-comment-item-content", Sn = "univer-thread-comment-item-at", h = {
|
|
418
|
+
threadComment: rn,
|
|
419
|
+
threadCommentActive: on,
|
|
420
|
+
threadCommentContent: sn,
|
|
421
|
+
threadCommentHighlight: an,
|
|
422
|
+
threadCommentIconContainer: ln,
|
|
423
|
+
threadCommentIcon: dn,
|
|
424
|
+
threadCommentTitle: mn,
|
|
425
|
+
threadCommentTitlePosition: cn,
|
|
426
|
+
threadCommentTitleHighlight: hn,
|
|
427
|
+
threadCommentTitlePositionText: un,
|
|
428
|
+
threadCommentUsername: vn,
|
|
429
|
+
threadCommentItem: Cn,
|
|
430
|
+
threadCommentItemHead: fn,
|
|
431
|
+
threadCommentItemTitle: gn,
|
|
432
|
+
threadCommentItemTitlePosition: pn,
|
|
433
|
+
threadCommentItemTitleHighlight: In,
|
|
434
|
+
threadCommentItemTime: xn,
|
|
435
|
+
threadCommentItemContent: bn,
|
|
436
|
+
threadCommentItemAt: Sn
|
|
437
|
+
}, Fe = "__mock__", yn = (t) => {
|
|
438
|
+
const { item: e, unitId: r, subUnitId: n, editing: o, onEditingChange: a, onReply: d, resolved: c, isRoot: v, onClose: S, onDeleteComment: O } = t, N = x(re), f = x(fe), u = x(ge), C = u.getUser(e.personId), g = F(u.currentUser$), T = (g == null ? void 0 : g.userID) === e.personId, b = e.id === Fe, [L, m] = k(!1), D = () => {
|
|
439
|
+
(O == null ? void 0 : O(e)) !== !1 && (N.executeCommand(
|
|
440
|
+
v ? je.id : at.id,
|
|
706
441
|
{
|
|
707
|
-
unitId,
|
|
708
|
-
subUnitId,
|
|
709
|
-
commentId:
|
|
442
|
+
unitId: r,
|
|
443
|
+
subUnitId: n,
|
|
444
|
+
commentId: e.id
|
|
710
445
|
}
|
|
711
|
-
),
|
|
712
|
-
}
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
|
|
715
|
-
{
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
{
|
|
722
|
-
id: item.id,
|
|
723
|
-
comment: item,
|
|
724
|
-
onCancel: /* @__PURE__ */ __name(() => onEditingChange == null ? void 0 : onEditingChange(!1), "onCancel"),
|
|
725
|
-
autoFocus: !0,
|
|
726
|
-
unitId,
|
|
727
|
-
subUnitId,
|
|
728
|
-
onSave: /* @__PURE__ */ __name(({ text, attachments }) => {
|
|
729
|
-
onEditingChange == null || onEditingChange(!1), commandService.executeCommand(
|
|
730
|
-
UpdateCommentCommand.id,
|
|
446
|
+
), v && (S == null || S()));
|
|
447
|
+
};
|
|
448
|
+
return /* @__PURE__ */ i.jsxs("div", { className: h.threadCommentItem, onMouseLeave: () => m(!1), onMouseEnter: () => m(!0), children: [
|
|
449
|
+
/* @__PURE__ */ i.jsx("img", { className: h.threadCommentItemHead, src: C == null ? void 0 : C.avatar }),
|
|
450
|
+
/* @__PURE__ */ i.jsxs("div", { className: h.threadCommentItemTitle, children: [
|
|
451
|
+
/* @__PURE__ */ i.jsx("div", { className: h.threadCommentUsername, children: (C == null ? void 0 : C.name) || " " }),
|
|
452
|
+
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
453
|
+
b || c ? null : L ? /* @__PURE__ */ i.jsx("div", { className: h.threadCommentIcon, onClick: () => d(C), children: /* @__PURE__ */ i.jsx(He, {}) }) : null,
|
|
454
|
+
T && !b && !c ? /* @__PURE__ */ i.jsx(
|
|
455
|
+
Ct,
|
|
731
456
|
{
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
attachments
|
|
738
|
-
}
|
|
457
|
+
overlay: /* @__PURE__ */ i.jsxs(ft, { children: [
|
|
458
|
+
/* @__PURE__ */ i.jsx(Ie, { onClick: () => a == null ? void 0 : a(!0), children: f.t("threadCommentUI.item.edit") }, "edit"),
|
|
459
|
+
/* @__PURE__ */ i.jsx(Ie, { onClick: D, children: f.t("threadCommentUI.item.delete") }, "delete")
|
|
460
|
+
] }),
|
|
461
|
+
children: /* @__PURE__ */ i.jsx("div", { className: h.threadCommentIcon, children: /* @__PURE__ */ i.jsx(Re, {}) })
|
|
739
462
|
}
|
|
740
|
-
)
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
463
|
+
) : null
|
|
464
|
+
] })
|
|
465
|
+
] }),
|
|
466
|
+
/* @__PURE__ */ i.jsx("div", { className: h.threadCommentItemTime, children: e.dT }),
|
|
467
|
+
o ? /* @__PURE__ */ i.jsx(
|
|
468
|
+
Be,
|
|
469
|
+
{
|
|
470
|
+
id: e.id,
|
|
471
|
+
comment: e,
|
|
472
|
+
onCancel: () => a == null ? void 0 : a(!1),
|
|
473
|
+
autoFocus: !0,
|
|
474
|
+
unitId: r,
|
|
475
|
+
subUnitId: n,
|
|
476
|
+
onSave: ({ text: p, attachments: U }) => {
|
|
477
|
+
a == null || a(!1), N.executeCommand(
|
|
478
|
+
it.id,
|
|
479
|
+
{
|
|
480
|
+
unitId: r,
|
|
481
|
+
subUnitId: n,
|
|
482
|
+
payload: {
|
|
483
|
+
commentId: e.id,
|
|
484
|
+
text: p,
|
|
485
|
+
attachments: U
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
) : /* @__PURE__ */ i.jsx("div", { className: h.threadCommentItemContent, children: Le(e.text).map((p, U) => {
|
|
492
|
+
switch (p.type) {
|
|
493
|
+
case "mention":
|
|
494
|
+
return /* @__PURE__ */ i.jsxs("a", { className: h.threadCommentItemAt, children: [
|
|
495
|
+
"@",
|
|
496
|
+
p.content.label,
|
|
497
|
+
" "
|
|
498
|
+
] }, U);
|
|
499
|
+
default:
|
|
500
|
+
return p.content;
|
|
501
|
+
}
|
|
502
|
+
}) })
|
|
503
|
+
] });
|
|
504
|
+
}, _n = (t) => {
|
|
505
|
+
var ie, Q, X;
|
|
753
506
|
const {
|
|
754
|
-
id,
|
|
755
|
-
unitId,
|
|
756
|
-
subUnitId,
|
|
757
|
-
refStr,
|
|
758
|
-
showEdit = !0,
|
|
759
|
-
onClick,
|
|
760
|
-
showHighlight,
|
|
761
|
-
onClose,
|
|
762
|
-
getSubUnitName,
|
|
763
|
-
prefix,
|
|
764
|
-
autoFocus,
|
|
765
|
-
onMouseEnter,
|
|
766
|
-
onMouseLeave,
|
|
767
|
-
onAddComment,
|
|
768
|
-
onDeleteComment,
|
|
769
|
-
onResolve
|
|
770
|
-
} =
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
...
|
|
507
|
+
id: e,
|
|
508
|
+
unitId: r,
|
|
509
|
+
subUnitId: n,
|
|
510
|
+
refStr: o,
|
|
511
|
+
showEdit: a = !0,
|
|
512
|
+
onClick: d,
|
|
513
|
+
showHighlight: c,
|
|
514
|
+
onClose: v,
|
|
515
|
+
getSubUnitName: S,
|
|
516
|
+
prefix: O,
|
|
517
|
+
autoFocus: N,
|
|
518
|
+
onMouseEnter: f,
|
|
519
|
+
onMouseLeave: u,
|
|
520
|
+
onAddComment: C,
|
|
521
|
+
onDeleteComment: g,
|
|
522
|
+
onResolve: T
|
|
523
|
+
} = t, b = x(_e), [L, m] = k(!1), [D, p] = k(""), U = le(() => b.commentUpdate$.pipe(dt(16)), [b]);
|
|
524
|
+
F(U);
|
|
525
|
+
const s = e ? b.getCommentWithChildren(r, n, e) : null, I = x(re), y = x(ge), P = s == null ? void 0 : s.root.resolved, E = F(y.currentUser$), K = ne(null), Y = [
|
|
526
|
+
...s ? [s.root] : (
|
|
774
527
|
// mock empty comment
|
|
775
528
|
[{
|
|
776
|
-
id:
|
|
529
|
+
id: Fe,
|
|
777
530
|
text: {
|
|
778
531
|
dataStream: `
|
|
779
532
|
\r`
|
|
780
533
|
},
|
|
781
|
-
personId: (
|
|
782
|
-
ref:
|
|
534
|
+
personId: (ie = E == null ? void 0 : E.userID) != null ? ie : "",
|
|
535
|
+
ref: o != null ? o : "",
|
|
783
536
|
dT: "",
|
|
784
|
-
unitId,
|
|
785
|
-
subUnitId,
|
|
537
|
+
unitId: r,
|
|
538
|
+
subUnitId: n,
|
|
786
539
|
threadId: ""
|
|
787
540
|
}]
|
|
788
541
|
),
|
|
789
|
-
...(
|
|
790
|
-
],
|
|
791
|
-
|
|
792
|
-
unitId,
|
|
793
|
-
subUnitId,
|
|
794
|
-
commentId:
|
|
795
|
-
}) :
|
|
796
|
-
unitId,
|
|
797
|
-
subUnitId,
|
|
798
|
-
commentId:
|
|
799
|
-
resolved: !
|
|
800
|
-
}),
|
|
801
|
-
},
|
|
802
|
-
|
|
803
|
-
|
|
542
|
+
...(Q = s == null ? void 0 : s.children) != null ? Q : []
|
|
543
|
+
], V = ne(null), R = (_) => {
|
|
544
|
+
_.stopPropagation(), P ? I.executeCommand(W.id, {
|
|
545
|
+
unitId: r,
|
|
546
|
+
subUnitId: n,
|
|
547
|
+
commentId: e
|
|
548
|
+
}) : I.executeCommand(W.id), I.executeCommand(st.id, {
|
|
549
|
+
unitId: r,
|
|
550
|
+
subUnitId: n,
|
|
551
|
+
commentId: e,
|
|
552
|
+
resolved: !P
|
|
553
|
+
}), T == null || T(!P);
|
|
554
|
+
}, J = (_) => {
|
|
555
|
+
_.stopPropagation(), I.executeCommand(W.id), !(s != null && s.root && (g == null ? void 0 : g(s.root)) === !1) && (I.executeCommand(
|
|
556
|
+
je.id,
|
|
804
557
|
{
|
|
805
|
-
unitId,
|
|
806
|
-
subUnitId,
|
|
807
|
-
commentId:
|
|
558
|
+
unitId: r,
|
|
559
|
+
subUnitId: n,
|
|
560
|
+
commentId: e
|
|
808
561
|
}
|
|
809
|
-
),
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
return /* @__PURE__ */
|
|
562
|
+
), v == null || v());
|
|
563
|
+
};
|
|
564
|
+
Ce(() => u == null ? void 0 : u(), []);
|
|
565
|
+
const H = S((X = s == null ? void 0 : s.root.subUnitId) != null ? X : n), oe = a && !D && !P, G = `${o || (s == null ? void 0 : s.root.ref) || ""}${H ? " · " : ""}${H}`;
|
|
566
|
+
return /* @__PURE__ */ i.jsxs(
|
|
814
567
|
"div",
|
|
815
568
|
{
|
|
816
|
-
className:
|
|
817
|
-
[
|
|
569
|
+
className: qt(h.threadComment, {
|
|
570
|
+
[h.threadCommentActive]: !P && (c || L || O === "cell")
|
|
818
571
|
}),
|
|
819
|
-
onClick,
|
|
820
|
-
id: `${
|
|
821
|
-
onMouseEnter:
|
|
822
|
-
|
|
823
|
-
}, "onMouseEnter"),
|
|
824
|
-
onMouseLeave: /* @__PURE__ */ __name(() => {
|
|
825
|
-
onMouseLeave == null || onMouseLeave(), setIsHover(!1);
|
|
826
|
-
}, "onMouseLeave")
|
|
827
|
-
},
|
|
828
|
-
!resolved && showHighlight ? /* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentHighlight }) : null,
|
|
829
|
-
/* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentTitle }, /* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentTitlePosition }, /* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentTitleHighlight }), /* @__PURE__ */ React.createElement(Tooltip, { showIfEllipsis: !0, title }, /* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentTitlePositionText }, title))), comments ? /* @__PURE__ */ React.createElement("div", { className: styles$1.threadCommentIconContainer }, /* @__PURE__ */ React.createElement(
|
|
830
|
-
"div",
|
|
831
|
-
{
|
|
832
|
-
onClick: handleResolve,
|
|
833
|
-
className: styles$1.threadCommentIcon,
|
|
834
|
-
style: { color: resolved ? "rgb(var(--green-500))" : "" }
|
|
572
|
+
onClick: d,
|
|
573
|
+
id: `${O}-${r}-${n}-${e}`,
|
|
574
|
+
onMouseEnter: () => {
|
|
575
|
+
f == null || f(), m(!0);
|
|
835
576
|
},
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
{
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}]));
|
|
863
|
-
});
|
|
864
|
-
}, "onReply"),
|
|
865
|
-
onAddComment,
|
|
866
|
-
onDeleteComment
|
|
867
|
-
}
|
|
868
|
-
)
|
|
869
|
-
)),
|
|
870
|
-
editorVisible ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
871
|
-
ThreadCommentEditor,
|
|
872
|
-
{
|
|
873
|
-
key: `${autoFocus}`,
|
|
874
|
-
ref: editorRef,
|
|
875
|
-
unitId,
|
|
876
|
-
subUnitId,
|
|
877
|
-
onSave: /* @__PURE__ */ __name(async ({ text, attachments }) => {
|
|
878
|
-
const comment = {
|
|
879
|
-
text,
|
|
880
|
-
attachments,
|
|
881
|
-
dT: getDT(),
|
|
882
|
-
id: generateRandomId(),
|
|
883
|
-
ref: refStr,
|
|
884
|
-
personId: currentUser == null ? void 0 : currentUser.userID,
|
|
885
|
-
parentId: comments == null ? void 0 : comments.root.id,
|
|
886
|
-
unitId,
|
|
887
|
-
subUnitId,
|
|
888
|
-
threadId: comments == null ? void 0 : comments.root.threadId
|
|
889
|
-
};
|
|
890
|
-
(onAddComment == null ? void 0 : onAddComment(comment)) !== !1 && (await commandService.executeCommand(
|
|
891
|
-
AddCommentCommand.id,
|
|
577
|
+
onMouseLeave: () => {
|
|
578
|
+
u == null || u(), m(!1);
|
|
579
|
+
},
|
|
580
|
+
children: [
|
|
581
|
+
!P && c ? /* @__PURE__ */ i.jsx("div", { className: h.threadCommentHighlight }) : null,
|
|
582
|
+
/* @__PURE__ */ i.jsxs("div", { className: h.threadCommentTitle, children: [
|
|
583
|
+
/* @__PURE__ */ i.jsxs("div", { className: h.threadCommentTitlePosition, children: [
|
|
584
|
+
/* @__PURE__ */ i.jsx("div", { className: h.threadCommentTitleHighlight }),
|
|
585
|
+
/* @__PURE__ */ i.jsx(vt, { showIfEllipsis: !0, title: G, children: /* @__PURE__ */ i.jsx("div", { className: h.threadCommentTitlePositionText, children: G }) })
|
|
586
|
+
] }),
|
|
587
|
+
s ? /* @__PURE__ */ i.jsxs("div", { className: h.threadCommentIconContainer, children: [
|
|
588
|
+
/* @__PURE__ */ i.jsx(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
onClick: R,
|
|
592
|
+
className: h.threadCommentIcon,
|
|
593
|
+
style: { color: P ? "rgb(var(--green-500))" : "" },
|
|
594
|
+
children: P ? /* @__PURE__ */ i.jsx(De, {}) : /* @__PURE__ */ i.jsx(ke, {})
|
|
595
|
+
}
|
|
596
|
+
),
|
|
597
|
+
(E == null ? void 0 : E.userID) === s.root.personId ? /* @__PURE__ */ i.jsx("div", { className: h.threadCommentIcon, onClick: J, children: /* @__PURE__ */ i.jsx($e, {}) }) : null
|
|
598
|
+
] }) : null
|
|
599
|
+
] }),
|
|
600
|
+
/* @__PURE__ */ i.jsx("div", { className: h.threadCommentContent, ref: V, children: Y.map(
|
|
601
|
+
(_) => /* @__PURE__ */ i.jsx(
|
|
602
|
+
yn,
|
|
892
603
|
{
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
604
|
+
onClose: v,
|
|
605
|
+
unitId: r,
|
|
606
|
+
subUnitId: n,
|
|
607
|
+
item: _,
|
|
608
|
+
isRoot: _.id === (s == null ? void 0 : s.root.id),
|
|
609
|
+
editing: D === _.id,
|
|
610
|
+
resolved: s == null ? void 0 : s.root.resolved,
|
|
611
|
+
onEditingChange: ($) => {
|
|
612
|
+
p($ ? _.id : "");
|
|
613
|
+
},
|
|
614
|
+
onReply: ($) => {
|
|
615
|
+
$ && requestAnimationFrame(() => {
|
|
616
|
+
var l;
|
|
617
|
+
(l = K.current) == null || l.reply(Ve([{
|
|
618
|
+
type: "mention",
|
|
619
|
+
content: {
|
|
620
|
+
id: $.userID,
|
|
621
|
+
label: $.name
|
|
622
|
+
}
|
|
623
|
+
}]));
|
|
624
|
+
});
|
|
625
|
+
},
|
|
626
|
+
onAddComment: C,
|
|
627
|
+
onDeleteComment: g
|
|
628
|
+
},
|
|
629
|
+
_.id
|
|
630
|
+
)
|
|
631
|
+
) }),
|
|
632
|
+
oe ? /* @__PURE__ */ i.jsx("div", { children: /* @__PURE__ */ i.jsx(
|
|
633
|
+
Be,
|
|
634
|
+
{
|
|
635
|
+
ref: K,
|
|
636
|
+
unitId: r,
|
|
637
|
+
subUnitId: n,
|
|
638
|
+
onSave: async ({ text: _, attachments: $ }) => {
|
|
639
|
+
const l = {
|
|
640
|
+
text: _,
|
|
641
|
+
attachments: $,
|
|
642
|
+
dT: rt(),
|
|
643
|
+
id: tt(),
|
|
644
|
+
ref: o,
|
|
645
|
+
personId: E == null ? void 0 : E.userID,
|
|
646
|
+
parentId: s == null ? void 0 : s.root.id,
|
|
647
|
+
unitId: r,
|
|
648
|
+
subUnitId: n,
|
|
649
|
+
threadId: s == null ? void 0 : s.root.threadId
|
|
650
|
+
};
|
|
651
|
+
(C == null ? void 0 : C(l)) !== !1 && (await I.executeCommand(
|
|
652
|
+
ot.id,
|
|
653
|
+
{
|
|
654
|
+
unitId: r,
|
|
655
|
+
subUnitId: n,
|
|
656
|
+
comment: l
|
|
657
|
+
}
|
|
658
|
+
), V.current && (V.current.scrollTop = V.current.scrollHeight));
|
|
659
|
+
},
|
|
660
|
+
autoFocus: N || !s,
|
|
661
|
+
onCancel: () => {
|
|
662
|
+
s || v == null || v();
|
|
896
663
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}, "onCancel")
|
|
903
|
-
}
|
|
904
|
-
)) : null
|
|
664
|
+
},
|
|
665
|
+
`${N}`
|
|
666
|
+
) }) : null
|
|
667
|
+
]
|
|
668
|
+
}
|
|
905
669
|
);
|
|
906
|
-
},
|
|
907
|
-
threadCommentPanel,
|
|
908
|
-
threadComment,
|
|
909
|
-
threadCommentPanelForms,
|
|
910
|
-
select,
|
|
911
|
-
threadCommentPanelEmpty,
|
|
912
|
-
threadCommentPanelAdd,
|
|
913
|
-
threadCommentPanelSolved
|
|
914
|
-
},
|
|
670
|
+
}, jn = "univer-thread-comment-panel", Nn = "univer-thread-comment", Tn = "univer-thread-comment-panel-forms", Un = "univer-select", En = "univer-thread-comment-panel-empty", Mn = "univer-thread-comment-panel-add", On = "univer-thread-comment-panel-solved", te = {
|
|
671
|
+
threadCommentPanel: jn,
|
|
672
|
+
threadComment: Nn,
|
|
673
|
+
threadCommentPanelForms: Tn,
|
|
674
|
+
select: Un,
|
|
675
|
+
threadCommentPanelEmpty: En,
|
|
676
|
+
threadCommentPanelAdd: Mn,
|
|
677
|
+
threadCommentPanelSolved: On
|
|
678
|
+
}, Bn = (t) => {
|
|
915
679
|
const {
|
|
916
|
-
unitId,
|
|
917
|
-
subUnitId
|
|
918
|
-
type,
|
|
919
|
-
onAdd,
|
|
920
|
-
getSubUnitName,
|
|
921
|
-
onResolve,
|
|
922
|
-
sortComments,
|
|
923
|
-
onItemLeave,
|
|
924
|
-
onItemEnter,
|
|
925
|
-
disableAdd,
|
|
926
|
-
tempComment,
|
|
927
|
-
onAddComment,
|
|
928
|
-
onDeleteComment,
|
|
929
|
-
showComments
|
|
930
|
-
} =
|
|
931
|
-
var
|
|
932
|
-
const
|
|
933
|
-
var
|
|
934
|
-
return { ...
|
|
680
|
+
unitId: e,
|
|
681
|
+
subUnitId$: r,
|
|
682
|
+
type: n,
|
|
683
|
+
onAdd: o,
|
|
684
|
+
getSubUnitName: a,
|
|
685
|
+
onResolve: d,
|
|
686
|
+
sortComments: c,
|
|
687
|
+
onItemLeave: v,
|
|
688
|
+
onItemEnter: S,
|
|
689
|
+
disableAdd: O,
|
|
690
|
+
tempComment: N,
|
|
691
|
+
onAddComment: f,
|
|
692
|
+
onDeleteComment: u,
|
|
693
|
+
showComments: C
|
|
694
|
+
} = t, [g, T] = k("all"), [b, L] = k("all"), m = x(fe), D = x(ge), p = x(_e), [U, s] = k(() => p.getUnit(e)), I = x(q), y = F(I.activeCommentId$), P = F(p.commentUpdate$), E = x(re), K = F(r), Y = ne(!0), V = "panel", R = F(D.currentUser$), J = le(() => {
|
|
695
|
+
var ae;
|
|
696
|
+
const l = g === "all" ? U : (ae = U.filter((j) => j.subUnitId === K)) != null ? ae : [], ee = c != null ? c : (j) => j, se = l.map((j) => {
|
|
697
|
+
var B;
|
|
698
|
+
return { ...j.root, children: (B = j.children) != null ? B : [], users: j.relativeUsers };
|
|
935
699
|
});
|
|
936
|
-
if (
|
|
937
|
-
const
|
|
938
|
-
return
|
|
939
|
-
|
|
940
|
-
}), [...
|
|
700
|
+
if (C) {
|
|
701
|
+
const j = /* @__PURE__ */ new Map();
|
|
702
|
+
return se.forEach((B) => {
|
|
703
|
+
j.set(B.id, B);
|
|
704
|
+
}), [...C, ""].map((B) => j.get(B)).filter(Boolean);
|
|
941
705
|
} else
|
|
942
|
-
return
|
|
943
|
-
}, [
|
|
944
|
-
...
|
|
945
|
-
...
|
|
946
|
-
], [
|
|
947
|
-
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
706
|
+
return ee(se);
|
|
707
|
+
}, [C, g, U, c, K]), H = le(() => [
|
|
708
|
+
...J.filter((l) => !l.resolved),
|
|
709
|
+
...J.filter((l) => l.resolved)
|
|
710
|
+
], [J]), oe = le(() => b === "resolved" ? H.filter((l) => l.resolved) : b === "unsolved" ? H.filter((l) => !l.resolved) : b === "concern_me" && R != null && R.userID ? H.filter((l) => l == null ? void 0 : l.users.has(R.userID)) : H, [H, R == null ? void 0 : R.userID, b]), G = N ? [N, ...oe] : oe, ie = G.filter((l) => !l.resolved), Q = G.filter((l) => l.resolved), X = b !== "all" || g !== "all", _ = () => {
|
|
711
|
+
L("all"), T("all");
|
|
712
|
+
};
|
|
713
|
+
Ce(() => {
|
|
714
|
+
e && s(
|
|
715
|
+
p.getUnit(e)
|
|
952
716
|
);
|
|
953
|
-
}, [
|
|
954
|
-
var
|
|
955
|
-
if (!
|
|
717
|
+
}, [e, p, P]), Ce(() => {
|
|
718
|
+
var j;
|
|
719
|
+
if (!y)
|
|
956
720
|
return;
|
|
957
|
-
if (!
|
|
958
|
-
|
|
721
|
+
if (!Y.current) {
|
|
722
|
+
Y.current = !0;
|
|
959
723
|
return;
|
|
960
724
|
}
|
|
961
|
-
const { unitId:
|
|
962
|
-
(
|
|
963
|
-
}, [
|
|
964
|
-
const
|
|
965
|
-
|
|
725
|
+
const { unitId: l, subUnitId: ee, commentId: se } = y, ae = `${V}-${l}-${ee}-${se}`;
|
|
726
|
+
(j = document.getElementById(ae)) == null || j.scrollIntoView({ block: "center" });
|
|
727
|
+
}, [y]);
|
|
728
|
+
const $ = (l) => /* @__PURE__ */ i.jsx(
|
|
729
|
+
_n,
|
|
966
730
|
{
|
|
967
|
-
prefix,
|
|
968
|
-
getSubUnitName,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
SetActiveCommentOperation.id,
|
|
731
|
+
prefix: V,
|
|
732
|
+
getSubUnitName: a,
|
|
733
|
+
id: l.id,
|
|
734
|
+
unitId: l.unitId,
|
|
735
|
+
subUnitId: l.subUnitId,
|
|
736
|
+
refStr: l.ref,
|
|
737
|
+
type: n,
|
|
738
|
+
showEdit: (y == null ? void 0 : y.commentId) === l.id,
|
|
739
|
+
showHighlight: (y == null ? void 0 : y.commentId) === l.id,
|
|
740
|
+
onClick: () => {
|
|
741
|
+
Y.current = !1, l.resolved ? E.executeCommand(W.id) : E.executeCommand(
|
|
742
|
+
W.id,
|
|
980
743
|
{
|
|
981
|
-
unitId:
|
|
982
|
-
subUnitId:
|
|
983
|
-
commentId:
|
|
744
|
+
unitId: l.unitId,
|
|
745
|
+
subUnitId: l.subUnitId,
|
|
746
|
+
commentId: l.id,
|
|
984
747
|
temp: !1
|
|
985
748
|
}
|
|
986
749
|
);
|
|
987
|
-
},
|
|
988
|
-
onMouseEnter:
|
|
989
|
-
onMouseLeave:
|
|
990
|
-
onAddComment,
|
|
991
|
-
onDeleteComment,
|
|
992
|
-
onResolve:
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
{
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
onChange: /* @__PURE__ */ __name((e) => setUnit(e), "onChange"),
|
|
1001
|
-
options: [
|
|
1002
|
-
{
|
|
1003
|
-
value: "current",
|
|
1004
|
-
label: localeService.t("threadCommentUI.filter.sheet.current")
|
|
1005
|
-
},
|
|
750
|
+
},
|
|
751
|
+
onMouseEnter: () => S == null ? void 0 : S(l),
|
|
752
|
+
onMouseLeave: () => v == null ? void 0 : v(l),
|
|
753
|
+
onAddComment: f,
|
|
754
|
+
onDeleteComment: u,
|
|
755
|
+
onResolve: (ee) => d == null ? void 0 : d(l.id, ee)
|
|
756
|
+
},
|
|
757
|
+
l.id
|
|
758
|
+
);
|
|
759
|
+
return /* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanel, children: [
|
|
760
|
+
/* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanelForms, children: [
|
|
761
|
+
n === he.UNIVER_SHEET ? /* @__PURE__ */ i.jsx(
|
|
762
|
+
xe,
|
|
1006
763
|
{
|
|
1007
|
-
|
|
1008
|
-
|
|
764
|
+
borderless: !0,
|
|
765
|
+
value: g,
|
|
766
|
+
onChange: (l) => T(l),
|
|
767
|
+
options: [
|
|
768
|
+
{
|
|
769
|
+
value: "current",
|
|
770
|
+
label: m.t("threadCommentUI.filter.sheet.current")
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
value: "all",
|
|
774
|
+
label: m.t("threadCommentUI.filter.sheet.all")
|
|
775
|
+
}
|
|
776
|
+
]
|
|
1009
777
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
Select,
|
|
1014
|
-
{
|
|
1015
|
-
borderless: !0,
|
|
1016
|
-
value: status,
|
|
1017
|
-
onChange: /* @__PURE__ */ __name((e) => setStatus(e), "onChange"),
|
|
1018
|
-
options: [
|
|
778
|
+
) : null,
|
|
779
|
+
/* @__PURE__ */ i.jsx(
|
|
780
|
+
xe,
|
|
1019
781
|
{
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
782
|
+
borderless: !0,
|
|
783
|
+
value: b,
|
|
784
|
+
onChange: (l) => L(l),
|
|
785
|
+
options: [
|
|
786
|
+
{
|
|
787
|
+
value: "all",
|
|
788
|
+
label: m.t("threadCommentUI.filter.status.all")
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
value: "resolved",
|
|
792
|
+
label: m.t("threadCommentUI.filter.status.resolved")
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
value: "unsolved",
|
|
796
|
+
label: m.t("threadCommentUI.filter.status.unsolved")
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
value: "concern_me",
|
|
800
|
+
label: m.t("threadCommentUI.filter.status.concernMe")
|
|
801
|
+
}
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
)
|
|
805
|
+
] }),
|
|
806
|
+
ie.map($),
|
|
807
|
+
Q.length ? /* @__PURE__ */ i.jsx("div", { className: te.threadCommentPanelSolved, children: "已解决" }) : null,
|
|
808
|
+
Q.map($),
|
|
809
|
+
G.length ? null : /* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanelEmpty, children: [
|
|
810
|
+
X ? m.t("threadCommentUI.panel.filterEmpty") : m.t("threadCommentUI.panel.empty"),
|
|
811
|
+
X ? /* @__PURE__ */ i.jsx(
|
|
812
|
+
de,
|
|
1027
813
|
{
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
814
|
+
onClick: _,
|
|
815
|
+
type: "link",
|
|
816
|
+
children: m.t("threadCommentUI.panel.reset")
|
|
817
|
+
}
|
|
818
|
+
) : /* @__PURE__ */ i.jsxs(
|
|
819
|
+
de,
|
|
1031
820
|
{
|
|
1032
|
-
|
|
1033
|
-
|
|
821
|
+
id: "thread-comment-add",
|
|
822
|
+
className: te.threadCommentPanelAdd,
|
|
823
|
+
type: "primary",
|
|
824
|
+
onClick: o,
|
|
825
|
+
disabled: O,
|
|
826
|
+
children: [
|
|
827
|
+
/* @__PURE__ */ i.jsx(we, {}),
|
|
828
|
+
m.t("threadCommentUI.panel.addComment")
|
|
829
|
+
]
|
|
1034
830
|
}
|
|
1035
|
-
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
{
|
|
1040
|
-
onClick: onReset,
|
|
1041
|
-
type: "link"
|
|
1042
|
-
},
|
|
1043
|
-
localeService.t("threadCommentUI.panel.reset")
|
|
1044
|
-
) : /* @__PURE__ */ React.createElement(
|
|
1045
|
-
Button,
|
|
1046
|
-
{
|
|
1047
|
-
id: "thread-comment-add",
|
|
1048
|
-
className: styles.threadCommentPanelAdd,
|
|
1049
|
-
type: "primary",
|
|
1050
|
-
onClick: onAdd,
|
|
1051
|
-
disabled: disableAdd
|
|
1052
|
-
},
|
|
1053
|
-
/* @__PURE__ */ React.createElement(IncreaseSingle, null),
|
|
1054
|
-
localeService.t("threadCommentUI.panel.addComment")
|
|
1055
|
-
)));
|
|
1056
|
-
}, "ThreadCommentPanel");
|
|
831
|
+
)
|
|
832
|
+
] })
|
|
833
|
+
] });
|
|
834
|
+
};
|
|
1057
835
|
export {
|
|
1058
|
-
IThreadCommentMentionDataService,
|
|
1059
|
-
SetActiveCommentOperation,
|
|
1060
|
-
THREAD_COMMENT_PANEL,
|
|
1061
|
-
ThreadCommentPanel,
|
|
1062
|
-
ThreadCommentPanelService,
|
|
1063
|
-
ThreadCommentTree,
|
|
1064
|
-
ToggleSheetCommentPanelOperation,
|
|
1065
|
-
UniverThreadCommentUIPlugin
|
|
1066
|
-
getDT
|
|
836
|
+
Te as IThreadCommentMentionDataService,
|
|
837
|
+
W as SetActiveCommentOperation,
|
|
838
|
+
yt as THREAD_COMMENT_PANEL,
|
|
839
|
+
Bn as ThreadCommentPanel,
|
|
840
|
+
q as ThreadCommentPanelService,
|
|
841
|
+
_n as ThreadCommentTree,
|
|
842
|
+
jt as ToggleSheetCommentPanelOperation,
|
|
843
|
+
me as UniverThreadCommentUIPlugin
|
|
1067
844
|
};
|