@univerjs/thread-comment-ui 0.2.2 → 0.2.4-alpha.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/README.md +11 -4
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +329 -326
- package/lib/index.css +1 -1
- package/lib/locale/vi-VN.json +33 -0
- package/lib/locale/zh-TW.json +33 -0
- package/lib/types/locale/vi-VN.d.ts +4 -0
- package/lib/types/locale/zh-TW.d.ts +4 -0
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/thread-comment-mention-data.service.d.ts +1 -1
- package/lib/types/views/thread-comment-panel/index.d.ts +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +18 -20
package/lib/es/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var w = (t, e, n) =>
|
|
4
|
-
import
|
|
5
|
-
import { UniverThreadCommentPlugin as
|
|
6
|
-
import { Disposable as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function ht() {
|
|
17
|
-
return Be().format("YYYY/MM/DD HH:mm");
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var Fe = (t, e, n) => e in t ? We(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var w = (t, e, n) => Fe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import ze from "dayjs";
|
|
5
|
+
import { UniverThreadCommentPlugin as Ze, ThreadCommentModel as xe, AddCommentCommand as Ye, UpdateCommentCommand as Ge, ResolveCommentCommand as Ke, DeleteCommentTreeCommand as _e, DeleteCommentCommand as qe } from "@univerjs/thread-comment";
|
|
6
|
+
import { Disposable as Te, UniverInstanceType as Ce, Inject as fe, IUniverInstanceService as Je, CommandType as Ne, OnLifecycle as Qe, LifecycleStages as Xe, LocaleService as de, createIdentifier as et, Plugin as tt, mergeOverrideWithDependencies as nt, DependentOn as rt, Injector as ot, ICommandService as X, CustomRangeType as at, useDependency as b, UserManagerService as ge, Tools as it } from "@univerjs/core";
|
|
7
|
+
import { ISidebarService as Me, useObservable as j } from "@univerjs/ui";
|
|
8
|
+
import { BehaviorSubject as Ie, filter as lt } from "rxjs";
|
|
9
|
+
import a, { forwardRef as A, useRef as ce, createElement as B, useState as k, useImperativeHandle as st, useEffect as ve, useMemo as he } from "react";
|
|
10
|
+
import { Mentions as mt, Mention as dt, Button as le, Dropdown as ct, Menu as ut, MenuItem as Se, Select as be } from "@univerjs/design";
|
|
11
|
+
import ht from "clsx";
|
|
12
|
+
import { ITextSelectionRenderManager as vt } from "@univerjs/engine-render";
|
|
13
|
+
import { TextSelectionManagerService as Ct } from "@univerjs/docs";
|
|
14
|
+
function ft() {
|
|
15
|
+
return ze().format("YYYY/MM/DD HH:mm");
|
|
18
16
|
}
|
|
19
|
-
const
|
|
20
|
-
var
|
|
21
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
22
|
-
(m = t[
|
|
23
|
-
return r && o &&
|
|
24
|
-
},
|
|
25
|
-
let
|
|
17
|
+
const gt = "thread-comment-panel", pt = "THREAD_COMMENT_UI_PLUGIN";
|
|
18
|
+
var It = Object.defineProperty, St = Object.getOwnPropertyDescriptor, bt = (t, e, n, r) => {
|
|
19
|
+
for (var o = r > 1 ? void 0 : r ? St(e, n) : e, i = t.length - 1, m; i >= 0; i--)
|
|
20
|
+
(m = t[i]) && (o = (r ? m(e, n, o) : m(o)) || o);
|
|
21
|
+
return r && o && It(e, n, o), o;
|
|
22
|
+
}, Ee = (t, e) => (n, r) => e(n, r, t);
|
|
23
|
+
let z = class extends Te {
|
|
26
24
|
constructor(e, n) {
|
|
27
25
|
super();
|
|
28
26
|
w(this, "_panelVisible", !1);
|
|
29
|
-
w(this, "_panelVisible$", new
|
|
27
|
+
w(this, "_panelVisible$", new Ie(!1));
|
|
30
28
|
w(this, "_activeCommentId");
|
|
31
|
-
w(this, "_activeCommentId$", new
|
|
29
|
+
w(this, "_activeCommentId$", new Ie(void 0));
|
|
32
30
|
w(this, "panelVisible$", this._panelVisible$.asObservable());
|
|
33
31
|
w(this, "activeCommentId$", this._activeCommentId$.asObservable());
|
|
34
|
-
this._sidebarService = e, this._univerInstanceService = n, this._init()
|
|
32
|
+
this._sidebarService = e, this._univerInstanceService = n, this._init(), this.disposeWithMe(() => {
|
|
33
|
+
this._activeCommentId$.complete(), this._panelVisible$.complete();
|
|
34
|
+
});
|
|
35
35
|
}
|
|
36
36
|
_init() {
|
|
37
37
|
this.disposeWithMe(
|
|
@@ -39,7 +39,7 @@ let F = class extends ye {
|
|
|
39
39
|
e.visible || this.setPanelVisible(!1);
|
|
40
40
|
})
|
|
41
41
|
), this.disposeWithMe(
|
|
42
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
42
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Ce.UNIVER_SHEET).pipe(lt((e) => !e)).subscribe(() => {
|
|
43
43
|
this._sidebarService.close();
|
|
44
44
|
})
|
|
45
45
|
);
|
|
@@ -57,43 +57,43 @@ let F = class extends ye {
|
|
|
57
57
|
this._activeCommentId = e, this._activeCommentId$.next(e);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
],
|
|
64
|
-
const
|
|
60
|
+
z = bt([
|
|
61
|
+
Ee(0, fe(Me)),
|
|
62
|
+
Ee(1, Je)
|
|
63
|
+
], z);
|
|
64
|
+
const Et = {
|
|
65
65
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
66
|
-
type:
|
|
66
|
+
type: Ne.OPERATION,
|
|
67
67
|
handler(t) {
|
|
68
|
-
const e = t.get(
|
|
68
|
+
const e = t.get(Me), n = t.get(z);
|
|
69
69
|
return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
|
|
70
70
|
header: { title: "threadCommentUI.panel.title" },
|
|
71
|
-
children: { label:
|
|
71
|
+
children: { label: gt },
|
|
72
72
|
width: 320
|
|
73
73
|
}), n.setPanelVisible(!0)), !0;
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, V = {
|
|
76
76
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
77
|
-
type:
|
|
77
|
+
type: Ne.OPERATION,
|
|
78
78
|
handler(t, e) {
|
|
79
|
-
return t.get(
|
|
79
|
+
return t.get(z).setActiveComment(e), !0;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
var
|
|
83
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
84
|
-
(m = t[
|
|
85
|
-
return r && o &&
|
|
86
|
-
},
|
|
87
|
-
let
|
|
82
|
+
var yt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, _t = (t, e, n, r) => {
|
|
83
|
+
for (var o = r > 1 ? void 0 : r ? xt(e, n) : e, i = t.length - 1, m; i >= 0; i--)
|
|
84
|
+
(m = t[i]) && (o = (r ? m(e, n, o) : m(o)) || o);
|
|
85
|
+
return r && o && yt(e, n, o), o;
|
|
86
|
+
}, Tt = (t, e) => (n, r) => e(n, r, t);
|
|
87
|
+
let ie = class extends Te {
|
|
88
88
|
constructor(t) {
|
|
89
89
|
super(), this._localeService = t;
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
],
|
|
96
|
-
class
|
|
92
|
+
ie = _t([
|
|
93
|
+
Qe(Xe.Starting, ie),
|
|
94
|
+
Tt(0, fe(de))
|
|
95
|
+
], ie);
|
|
96
|
+
class Nt {
|
|
97
97
|
constructor() {
|
|
98
98
|
w(this, "dataSource");
|
|
99
99
|
w(this, "renderSuggestion");
|
|
@@ -103,36 +103,36 @@ class xt {
|
|
|
103
103
|
return this.dataSource ? this.dataSource.getMentions(e, n, r) : [];
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
const
|
|
107
|
-
var
|
|
108
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
109
|
-
(m = t[
|
|
110
|
-
return r && o &&
|
|
111
|
-
},
|
|
112
|
-
let
|
|
106
|
+
const Pe = et("thread-comment.mention-data.service");
|
|
107
|
+
var Ue = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, Pt = (t, e, n) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ut = (t, e, n, r) => {
|
|
108
|
+
for (var o = r > 1 ? void 0 : r ? Mt(e, n) : e, i = t.length - 1, m; i >= 0; i--)
|
|
109
|
+
(m = t[i]) && (o = (r ? m(e, n, o) : m(o)) || o);
|
|
110
|
+
return r && o && Ue(e, n, o), o;
|
|
111
|
+
}, ye = (t, e) => (n, r) => e(n, r, t), $e = (t, e, n) => Pt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
112
|
+
let se = class extends tt {
|
|
113
113
|
constructor(t, e, n) {
|
|
114
114
|
super(), this._config = t, this._injector = e, this._commandService = n;
|
|
115
115
|
}
|
|
116
116
|
onStarting(t) {
|
|
117
117
|
var e;
|
|
118
|
-
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
118
|
+
nt([
|
|
119
|
+
[ie],
|
|
120
|
+
[z],
|
|
121
|
+
[Pe, { useClass: Nt }]
|
|
122
122
|
], (e = this._config) == null ? void 0 : e.overrides).forEach((n) => {
|
|
123
123
|
t.add(n);
|
|
124
|
-
}), [
|
|
124
|
+
}), [Et, V].forEach((n) => {
|
|
125
125
|
this._commandService.registerCommand(n);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
],
|
|
129
|
+
$e(se, "pluginName", pt);
|
|
130
|
+
$e(se, "type", Ce.UNIVER_UNKNOWN);
|
|
131
|
+
se = Ut([
|
|
132
|
+
rt(Ze),
|
|
133
|
+
ye(1, fe(ot)),
|
|
134
|
+
ye(2, X)
|
|
135
|
+
], se);
|
|
136
136
|
var T = function() {
|
|
137
137
|
return T = Object.assign || function(t) {
|
|
138
138
|
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
@@ -141,95 +141,95 @@ var T = function() {
|
|
|
141
141
|
}
|
|
142
142
|
return t;
|
|
143
143
|
}, T.apply(this, arguments);
|
|
144
|
-
},
|
|
144
|
+
}, $t = function(t, e) {
|
|
145
145
|
var n = {};
|
|
146
146
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
147
147
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
148
148
|
for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
|
|
149
149
|
e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
|
|
150
150
|
return n;
|
|
151
|
-
},
|
|
152
|
-
var n = t.icon, r = t.id, o = t.className,
|
|
153
|
-
return
|
|
151
|
+
}, W = A(function(t, e) {
|
|
152
|
+
var n = t.icon, r = t.id, o = t.className, i = t.extend, m = $t(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), f = ce("_".concat(Ht()));
|
|
153
|
+
return Oe(n, "".concat(r), { defIds: n.defIds, idSuffix: f.current }, T({ ref: e, className: c }, m), i);
|
|
154
154
|
});
|
|
155
|
-
function
|
|
156
|
-
return
|
|
157
|
-
return
|
|
155
|
+
function Oe(t, e, n, r, o) {
|
|
156
|
+
return B(t.tag, T(T({ key: e }, Ot(t, n, o)), r), (wt(t, n).children || []).map(function(i, m) {
|
|
157
|
+
return Oe(i, "".concat(e, "-").concat(t.tag, "-").concat(m), n, void 0, o);
|
|
158
158
|
}));
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Ot(t, e, n) {
|
|
161
161
|
var r = T({}, t.attrs);
|
|
162
162
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
163
163
|
var o = e.defIds;
|
|
164
|
-
return !o || o.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(
|
|
165
|
-
var m =
|
|
164
|
+
return !o || o.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
|
|
165
|
+
var m = i[0], c = i[1];
|
|
166
166
|
typeof c == "string" && (r[m] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
167
167
|
})), r;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function wt(t, e) {
|
|
170
170
|
var n, r = e.defIds;
|
|
171
171
|
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? T(T({}, t), { children: t.children.map(function(o) {
|
|
172
172
|
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? T(T({}, o), { attrs: T(T({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
173
173
|
}) }) : t;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function Ht() {
|
|
176
176
|
return Math.random().toString(36).substring(2, 8);
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
var
|
|
180
|
-
return
|
|
178
|
+
W.displayName = "UniverIcon";
|
|
179
|
+
var Rt = { 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" } }] }, we = A(function(t, e) {
|
|
180
|
+
return B(W, Object.assign({}, t, {
|
|
181
181
|
id: "delete-single",
|
|
182
182
|
ref: e,
|
|
183
|
-
icon:
|
|
183
|
+
icon: Rt
|
|
184
184
|
}));
|
|
185
185
|
});
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
186
|
+
we.displayName = "DeleteSingle";
|
|
187
|
+
var Dt = { 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" } }] }, He = A(function(t, e) {
|
|
188
|
+
return B(W, Object.assign({}, t, {
|
|
189
189
|
id: "increase-single",
|
|
190
190
|
ref: e,
|
|
191
|
-
icon:
|
|
191
|
+
icon: Dt
|
|
192
192
|
}));
|
|
193
193
|
});
|
|
194
|
-
|
|
195
|
-
var
|
|
196
|
-
return
|
|
194
|
+
He.displayName = "IncreaseSingle";
|
|
195
|
+
var kt = { 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) {
|
|
196
|
+
return B(W, Object.assign({}, t, {
|
|
197
197
|
id: "more-horizontal-single",
|
|
198
198
|
ref: e,
|
|
199
|
-
icon:
|
|
199
|
+
icon: kt
|
|
200
200
|
}));
|
|
201
201
|
});
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
202
|
+
Re.displayName = "MoreHorizontalSingle";
|
|
203
|
+
var At = { 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 } }] }, De = A(function(t, e) {
|
|
204
|
+
return B(W, Object.assign({}, t, {
|
|
205
205
|
id: "reply-to-comment-single",
|
|
206
206
|
ref: e,
|
|
207
|
-
icon:
|
|
207
|
+
icon: At
|
|
208
208
|
}));
|
|
209
209
|
});
|
|
210
|
-
|
|
211
|
-
var
|
|
212
|
-
return
|
|
210
|
+
De.displayName = "ReplyToCommentSingle";
|
|
211
|
+
var Lt = { 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" } }] }, ke = A(function(t, e) {
|
|
212
|
+
return B(W, Object.assign({}, t, {
|
|
213
213
|
id: "resolved-single",
|
|
214
214
|
ref: e,
|
|
215
|
-
icon:
|
|
215
|
+
icon: Lt
|
|
216
216
|
}));
|
|
217
217
|
});
|
|
218
|
-
|
|
219
|
-
var
|
|
220
|
-
return
|
|
218
|
+
ke.displayName = "ResolvedSingle";
|
|
219
|
+
var jt = { 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 } }] }, Ae = A(function(t, e) {
|
|
220
|
+
return B(W, Object.assign({}, t, {
|
|
221
221
|
id: "solve-single",
|
|
222
222
|
ref: e,
|
|
223
|
-
icon:
|
|
223
|
+
icon: jt
|
|
224
224
|
}));
|
|
225
225
|
});
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
threadCommentEditorButtons:
|
|
229
|
-
threadCommentEditorSuggestion:
|
|
230
|
-
threadCommentEditorSuggestionActive:
|
|
231
|
-
threadCommentEditorSuggestionIcon:
|
|
232
|
-
},
|
|
226
|
+
Ae.displayName = "SolveSingle";
|
|
227
|
+
const Vt = "univer-thread-comment-editor-buttons", Bt = "univer-thread-comment-editor-suggestion", Wt = "univer-thread-comment-editor-suggestionActive", Ft = "univer-thread-comment-editor-suggestion-icon", me = {
|
|
228
|
+
threadCommentEditorButtons: Vt,
|
|
229
|
+
threadCommentEditorSuggestion: Bt,
|
|
230
|
+
threadCommentEditorSuggestionActive: Wt,
|
|
231
|
+
threadCommentEditorSuggestionIcon: Ft
|
|
232
|
+
}, zt = (t) => {
|
|
233
233
|
const e = /@\[(.*?)\]\((.*?)\)|(\w+)/g;
|
|
234
234
|
let n, r = 0;
|
|
235
235
|
const o = [];
|
|
@@ -251,32 +251,32 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
251
251
|
type: "text",
|
|
252
252
|
content: t.substring(r)
|
|
253
253
|
}), o;
|
|
254
|
-
},
|
|
254
|
+
}, Zt = (t) => t.map((e) => {
|
|
255
255
|
switch (e.type) {
|
|
256
256
|
case "mention":
|
|
257
257
|
return `@[${e.content.label}](${e.content.id})`;
|
|
258
258
|
default:
|
|
259
259
|
return e.content;
|
|
260
260
|
}
|
|
261
|
-
}).join(""),
|
|
261
|
+
}).join(""), Le = (t) => {
|
|
262
262
|
const { dataStream: e, customRanges: n } = t, r = e.length - 2, o = [];
|
|
263
|
-
let
|
|
263
|
+
let i = 0;
|
|
264
264
|
return n == null || n.forEach((m) => {
|
|
265
|
-
|
|
265
|
+
i < m.startIndex && o.push({
|
|
266
266
|
type: "text",
|
|
267
|
-
content: e.slice(
|
|
267
|
+
content: e.slice(i, m.startIndex)
|
|
268
268
|
}), o.push({
|
|
269
269
|
type: "mention",
|
|
270
270
|
content: {
|
|
271
271
|
label: e.slice(m.startIndex, m.endIndex).slice(1, -1),
|
|
272
272
|
id: m.rangeId
|
|
273
273
|
}
|
|
274
|
-
}),
|
|
274
|
+
}), i = m.endIndex;
|
|
275
275
|
}), o.push({
|
|
276
276
|
type: "text",
|
|
277
|
-
content: e.slice(
|
|
277
|
+
content: e.slice(i, r)
|
|
278
278
|
}), o;
|
|
279
|
-
},
|
|
279
|
+
}, je = (t) => {
|
|
280
280
|
let e = "";
|
|
281
281
|
const n = [];
|
|
282
282
|
return t.forEach((r) => {
|
|
@@ -287,12 +287,12 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
287
287
|
case "mention": {
|
|
288
288
|
const o = e.length;
|
|
289
289
|
e += `${r.content.label}`;
|
|
290
|
-
const
|
|
290
|
+
const i = e.length;
|
|
291
291
|
n.push({
|
|
292
292
|
rangeId: r.content.id,
|
|
293
|
-
rangeType:
|
|
293
|
+
rangeType: at.MENTION,
|
|
294
294
|
startIndex: o,
|
|
295
|
-
endIndex:
|
|
295
|
+
endIndex: i
|
|
296
296
|
});
|
|
297
297
|
break;
|
|
298
298
|
}
|
|
@@ -314,63 +314,63 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
314
314
|
dataStream: e,
|
|
315
315
|
customRanges: n
|
|
316
316
|
};
|
|
317
|
-
},
|
|
317
|
+
}, Yt = (t) => ({
|
|
318
318
|
display: t.label,
|
|
319
319
|
id: `${t.id}`,
|
|
320
320
|
raw: t
|
|
321
|
-
}),
|
|
321
|
+
}), Gt = (t, e, n, r, o) => {
|
|
322
322
|
var m, c;
|
|
323
|
-
const
|
|
324
|
-
return /* @__PURE__ */ a.createElement("div", { className:
|
|
325
|
-
},
|
|
326
|
-
var
|
|
327
|
-
const { comment: n, onSave: r, id: o, onCancel:
|
|
328
|
-
return
|
|
329
|
-
reply(
|
|
323
|
+
const i = (m = t.raw) == null ? void 0 : m.icon;
|
|
324
|
+
return /* @__PURE__ */ a.createElement("div", { className: me.threadCommentEditorSuggestion }, i ? /* @__PURE__ */ a.createElement("img", { className: me.threadCommentEditorSuggestionIcon, src: i }) : null, /* @__PURE__ */ a.createElement("div", null, (c = t.display) != null ? c : t.id));
|
|
325
|
+
}, Ve = A((t, e) => {
|
|
326
|
+
var v;
|
|
327
|
+
const { comment: n, onSave: r, id: o, onCancel: i, autoFocus: m, unitId: c, subUnitId: f } = t, y = b(Pe), P = b(X), _ = b(de), [I, h] = k({ ...n }), [g, S] = k(!1), N = ce(null), E = b(vt), H = b(Ct);
|
|
328
|
+
return st(e, () => ({
|
|
329
|
+
reply(C) {
|
|
330
330
|
var d;
|
|
331
331
|
h({
|
|
332
332
|
...n,
|
|
333
|
-
text:
|
|
333
|
+
text: C,
|
|
334
334
|
attachments: []
|
|
335
335
|
}), (d = N.current) == null || d.inputElement.focus();
|
|
336
336
|
}
|
|
337
|
-
})), /* @__PURE__ */ a.createElement("div", { className:
|
|
338
|
-
|
|
337
|
+
})), /* @__PURE__ */ a.createElement("div", { className: me.threadCommentEditor, onClick: (C) => C.preventDefault() }, /* @__PURE__ */ a.createElement(
|
|
338
|
+
mt,
|
|
339
339
|
{
|
|
340
340
|
ref: N,
|
|
341
341
|
autoFocus: m,
|
|
342
342
|
style: { width: "100%" },
|
|
343
343
|
placeholder: _.t("threadCommentUI.editor.placeholder"),
|
|
344
|
-
value: I != null && I.text ?
|
|
345
|
-
onChange: (
|
|
346
|
-
|
|
344
|
+
value: I != null && I.text ? Zt(Le(I.text)) : "",
|
|
345
|
+
onChange: (C) => {
|
|
346
|
+
C.target.value || h({ ...n, text: void 0 }), h == null || h({ ...n, text: je(zt(C.target.value)) });
|
|
347
347
|
},
|
|
348
348
|
onFocus: () => {
|
|
349
|
-
const
|
|
350
|
-
|
|
349
|
+
const C = H.getActiveRange();
|
|
350
|
+
C && C.collapsed && E.removeAllTextRanges(), E.blur(), S(!0);
|
|
351
351
|
}
|
|
352
352
|
},
|
|
353
353
|
/* @__PURE__ */ a.createElement(
|
|
354
|
-
|
|
354
|
+
dt,
|
|
355
355
|
{
|
|
356
356
|
key: y.trigger,
|
|
357
357
|
trigger: y.trigger,
|
|
358
|
-
data: (
|
|
359
|
-
displayTransform: (
|
|
360
|
-
renderSuggestion: (
|
|
358
|
+
data: (C, d) => y.getMentions(C, c, f).then((l) => l.map(Yt)).then(d),
|
|
359
|
+
displayTransform: (C, d) => `@${d} `,
|
|
360
|
+
renderSuggestion: (v = y.renderSuggestion) != null ? v : Gt
|
|
361
361
|
}
|
|
362
362
|
)
|
|
363
|
-
), g ? /* @__PURE__ */ a.createElement("div", { className:
|
|
364
|
-
|
|
363
|
+
), g ? /* @__PURE__ */ a.createElement("div", { className: me.threadCommentEditorButtons }, /* @__PURE__ */ a.createElement(
|
|
364
|
+
le,
|
|
365
365
|
{
|
|
366
366
|
style: { marginRight: 12 },
|
|
367
367
|
onClick: () => {
|
|
368
|
-
|
|
368
|
+
i == null || i(), S(!1), h({ text: void 0 }), P.executeCommand(V.id);
|
|
369
369
|
}
|
|
370
370
|
},
|
|
371
371
|
_.t("threadCommentUI.editor.cancel")
|
|
372
372
|
), /* @__PURE__ */ a.createElement(
|
|
373
|
-
|
|
373
|
+
le,
|
|
374
374
|
{
|
|
375
375
|
type: "primary",
|
|
376
376
|
disabled: !I.text,
|
|
@@ -378,35 +378,35 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
378
378
|
I.text && (r == null || r({
|
|
379
379
|
...I,
|
|
380
380
|
text: I.text
|
|
381
|
-
}),
|
|
381
|
+
}), S(!1), h({ text: void 0 }));
|
|
382
382
|
}
|
|
383
383
|
},
|
|
384
384
|
_.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
385
385
|
)) : null);
|
|
386
|
-
}),
|
|
387
|
-
threadComment:
|
|
388
|
-
threadCommentActive:
|
|
389
|
-
threadCommentContent:
|
|
390
|
-
threadCommentHighlight:
|
|
391
|
-
threadCommentIconContainer:
|
|
392
|
-
threadCommentIcon:
|
|
393
|
-
threadCommentTitle:
|
|
394
|
-
threadCommentTitlePosition:
|
|
395
|
-
threadCommentTitleHighlight:
|
|
396
|
-
threadCommentTitlePositionText:
|
|
397
|
-
threadCommentUsername:
|
|
398
|
-
threadCommentItem:
|
|
399
|
-
threadCommentItemHead:
|
|
400
|
-
threadCommentItemTitle:
|
|
401
|
-
threadCommentItemTitlePosition:
|
|
402
|
-
threadCommentItemTitleHighlight:
|
|
403
|
-
threadCommentItemTime:
|
|
404
|
-
threadCommentItemContent:
|
|
405
|
-
threadCommentItemAt:
|
|
406
|
-
},
|
|
407
|
-
const { item: e, unitId: n, subUnitId: r, editing: o, onEditingChange:
|
|
386
|
+
}), Kt = "univer-thread-comment", qt = "univer-thread-comment-active", Jt = "univer-thread-comment-content", Qt = "univer-thread-comment-highlight", Xt = "univer-thread-comment-icon-container", en = "univer-thread-comment-icon", tn = "univer-thread-comment-title", nn = "univer-thread-comment-title-position", rn = "univer-thread-comment-title-highlight", on = "univer-thread-comment-title-position-text", an = "univer-thread-comment-username", ln = "univer-thread-comment-item", sn = "univer-thread-comment-item-head", mn = "univer-thread-comment-item-title", dn = "univer-thread-comment-item-title-position", cn = "univer-thread-comment-item-title-highlight", un = "univer-thread-comment-item-time", hn = "univer-thread-comment-item-content", vn = "univer-thread-comment-item-at", u = {
|
|
387
|
+
threadComment: Kt,
|
|
388
|
+
threadCommentActive: qt,
|
|
389
|
+
threadCommentContent: Jt,
|
|
390
|
+
threadCommentHighlight: Qt,
|
|
391
|
+
threadCommentIconContainer: Xt,
|
|
392
|
+
threadCommentIcon: en,
|
|
393
|
+
threadCommentTitle: tn,
|
|
394
|
+
threadCommentTitlePosition: nn,
|
|
395
|
+
threadCommentTitleHighlight: rn,
|
|
396
|
+
threadCommentTitlePositionText: on,
|
|
397
|
+
threadCommentUsername: an,
|
|
398
|
+
threadCommentItem: ln,
|
|
399
|
+
threadCommentItemHead: sn,
|
|
400
|
+
threadCommentItemTitle: mn,
|
|
401
|
+
threadCommentItemTitlePosition: dn,
|
|
402
|
+
threadCommentItemTitleHighlight: cn,
|
|
403
|
+
threadCommentItemTime: un,
|
|
404
|
+
threadCommentItemContent: hn,
|
|
405
|
+
threadCommentItemAt: vn
|
|
406
|
+
}, Be = "__mock__", Cn = (t) => {
|
|
407
|
+
const { item: e, unitId: n, subUnitId: r, editing: o, onEditingChange: i, onReply: m, resolved: c, isRoot: f, onClose: y, onDeleteComment: P } = t, _ = b(X), I = b(de), h = b(ge), g = h.getUser(e.personId), S = j(h.currentUser$), N = (S == null ? void 0 : S.userID) === e.personId, E = e.id === Be, [H, v] = k(!1), C = () => {
|
|
408
408
|
(P == null ? void 0 : P(e)) !== !1 && (_.executeCommand(
|
|
409
|
-
f ?
|
|
409
|
+
f ? _e.id : qe.id,
|
|
410
410
|
{
|
|
411
411
|
unitId: n,
|
|
412
412
|
subUnitId: r,
|
|
@@ -414,52 +414,52 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
414
414
|
}
|
|
415
415
|
), f && (y == null || y()));
|
|
416
416
|
};
|
|
417
|
-
return /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItem, onMouseLeave: () =>
|
|
418
|
-
|
|
417
|
+
return /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItem, onMouseLeave: () => v(!1), onMouseEnter: () => v(!0) }, /* @__PURE__ */ a.createElement("img", { className: u.threadCommentItemHead, src: g == null ? void 0 : g.avatar }), /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItemTitle }, /* @__PURE__ */ a.createElement("div", { className: u.threadCommentUsername }, (g == null ? void 0 : g.name) || " "), /* @__PURE__ */ a.createElement("div", null, E || c ? null : H ? /* @__PURE__ */ a.createElement("div", { className: u.threadCommentIcon, onClick: () => m(g) }, /* @__PURE__ */ a.createElement(De, null)) : null, N && !E && !c ? /* @__PURE__ */ a.createElement(
|
|
418
|
+
ct,
|
|
419
419
|
{
|
|
420
|
-
overlay: /* @__PURE__ */ a.createElement(
|
|
420
|
+
overlay: /* @__PURE__ */ a.createElement(ut, null, /* @__PURE__ */ a.createElement(Se, { key: "edit", onClick: () => i == null ? void 0 : i(!0) }, I.t("threadCommentUI.item.edit")), /* @__PURE__ */ a.createElement(Se, { key: "delete", onClick: C }, I.t("threadCommentUI.item.delete")))
|
|
421
421
|
},
|
|
422
|
-
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentIcon }, /* @__PURE__ */ a.createElement(
|
|
422
|
+
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentIcon }, /* @__PURE__ */ a.createElement(Re, null))
|
|
423
423
|
) : null)), /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItemTime }, e.dT), o ? /* @__PURE__ */ a.createElement(
|
|
424
|
-
|
|
424
|
+
Ve,
|
|
425
425
|
{
|
|
426
426
|
id: e.id,
|
|
427
427
|
comment: e,
|
|
428
|
-
onCancel: () =>
|
|
428
|
+
onCancel: () => i == null ? void 0 : i(!1),
|
|
429
429
|
autoFocus: !0,
|
|
430
430
|
unitId: n,
|
|
431
431
|
subUnitId: r,
|
|
432
|
-
onSave: ({ text: d, attachments:
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
onSave: ({ text: d, attachments: l }) => {
|
|
433
|
+
i == null || i(!1), _.executeCommand(
|
|
434
|
+
Ge.id,
|
|
435
435
|
{
|
|
436
436
|
unitId: n,
|
|
437
437
|
subUnitId: r,
|
|
438
438
|
payload: {
|
|
439
439
|
commentId: e.id,
|
|
440
440
|
text: d,
|
|
441
|
-
attachments:
|
|
441
|
+
attachments: l
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
) : /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItemContent },
|
|
447
|
+
) : /* @__PURE__ */ a.createElement("div", { className: u.threadCommentItemContent }, Le(e.text).map((d, l) => {
|
|
448
448
|
switch (d.type) {
|
|
449
449
|
case "mention":
|
|
450
|
-
return /* @__PURE__ */ a.createElement("a", { className: u.threadCommentItemAt, key:
|
|
450
|
+
return /* @__PURE__ */ a.createElement("a", { className: u.threadCommentItemAt, key: l }, "@", d.content.label, " ");
|
|
451
451
|
default:
|
|
452
452
|
return d.content;
|
|
453
453
|
}
|
|
454
454
|
})));
|
|
455
|
-
},
|
|
456
|
-
var
|
|
455
|
+
}, fn = (t) => {
|
|
456
|
+
var K, F, ne;
|
|
457
457
|
const {
|
|
458
458
|
id: e,
|
|
459
459
|
unitId: n,
|
|
460
460
|
subUnitId: r,
|
|
461
461
|
refStr: o,
|
|
462
|
-
showEdit:
|
|
462
|
+
showEdit: i = !0,
|
|
463
463
|
onClick: m,
|
|
464
464
|
showHighlight: c,
|
|
465
465
|
onClose: f,
|
|
@@ -469,20 +469,20 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
469
469
|
onMouseEnter: I,
|
|
470
470
|
onMouseLeave: h,
|
|
471
471
|
onAddComment: g,
|
|
472
|
-
onDeleteComment:
|
|
472
|
+
onDeleteComment: S,
|
|
473
473
|
onResolve: N
|
|
474
|
-
} = t, E =
|
|
475
|
-
|
|
476
|
-
const
|
|
477
|
-
...
|
|
474
|
+
} = t, E = b(xe), [H, v] = k(!1), [C, d] = k("");
|
|
475
|
+
j(E.commentMap$);
|
|
476
|
+
const l = e ? E.getCommentWithChildren(n, r, e) : null, R = b(X), ue = b(ge), p = l == null ? void 0 : l.root.resolved, M = j(ue.currentUser$), Z = ce(null), ee = [
|
|
477
|
+
...l ? [l.root] : (
|
|
478
478
|
// mock empty comment
|
|
479
479
|
[{
|
|
480
|
-
id:
|
|
480
|
+
id: Be,
|
|
481
481
|
text: {
|
|
482
482
|
dataStream: `
|
|
483
483
|
\r`
|
|
484
484
|
},
|
|
485
|
-
personId: (
|
|
485
|
+
personId: (K = M == null ? void 0 : M.userID) != null ? K : "",
|
|
486
486
|
ref: o != null ? o : "",
|
|
487
487
|
dT: "",
|
|
488
488
|
unitId: n,
|
|
@@ -490,21 +490,21 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
490
490
|
threadId: ""
|
|
491
491
|
}]
|
|
492
492
|
),
|
|
493
|
-
...(
|
|
494
|
-
],
|
|
495
|
-
x.stopPropagation(), p ? R.executeCommand(
|
|
493
|
+
...(F = l == null ? void 0 : l.children) != null ? F : []
|
|
494
|
+
], Y = (x) => {
|
|
495
|
+
x.stopPropagation(), p ? R.executeCommand(V.id, {
|
|
496
496
|
unitId: n,
|
|
497
497
|
subUnitId: r,
|
|
498
498
|
commentId: e
|
|
499
|
-
}) : R.executeCommand(
|
|
499
|
+
}) : R.executeCommand(V.id), R.executeCommand(Ke.id, {
|
|
500
500
|
unitId: n,
|
|
501
501
|
subUnitId: r,
|
|
502
502
|
commentId: e,
|
|
503
503
|
resolved: !p
|
|
504
504
|
}), N == null || N(!p);
|
|
505
|
-
},
|
|
506
|
-
x.stopPropagation(), R.executeCommand(
|
|
507
|
-
|
|
505
|
+
}, te = (x) => {
|
|
506
|
+
x.stopPropagation(), R.executeCommand(V.id), !(l != null && l.root && (S == null ? void 0 : S(l.root)) === !1) && (R.executeCommand(
|
|
507
|
+
_e.id,
|
|
508
508
|
{
|
|
509
509
|
unitId: n,
|
|
510
510
|
subUnitId: r,
|
|
@@ -512,115 +512,116 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
512
512
|
}
|
|
513
513
|
), f == null || f());
|
|
514
514
|
};
|
|
515
|
-
|
|
516
|
-
const
|
|
515
|
+
ve(() => h == null ? void 0 : h(), []);
|
|
516
|
+
const U = y((ne = l == null ? void 0 : l.root.subUnitId) != null ? ne : r), G = i && !C && !p, D = `${o || (l == null ? void 0 : l.root.ref) || ""}${U ? " · " : ""}${U}`;
|
|
517
517
|
return /* @__PURE__ */ a.createElement(
|
|
518
518
|
"div",
|
|
519
519
|
{
|
|
520
|
-
className:
|
|
520
|
+
className: ht(u.threadComment, {
|
|
521
521
|
[u.threadCommentActive]: !p && (c || H || P === "cell")
|
|
522
522
|
}),
|
|
523
523
|
onClick: m,
|
|
524
524
|
id: `${P}-${n}-${r}-${e}`,
|
|
525
525
|
onMouseEnter: () => {
|
|
526
|
-
I == null || I(),
|
|
526
|
+
I == null || I(), v(!0);
|
|
527
527
|
},
|
|
528
528
|
onMouseLeave: () => {
|
|
529
|
-
h == null || h(),
|
|
529
|
+
h == null || h(), v(!1);
|
|
530
530
|
}
|
|
531
531
|
},
|
|
532
532
|
!p && c ? /* @__PURE__ */ a.createElement("div", { className: u.threadCommentHighlight }) : null,
|
|
533
|
-
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitle }, /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitlePosition }, /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitleHighlight }), /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitlePositionText }, D)),
|
|
533
|
+
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitle }, /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitlePosition }, /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitleHighlight }), /* @__PURE__ */ a.createElement("div", { className: u.threadCommentTitlePositionText }, D)), l ? /* @__PURE__ */ a.createElement("div", { className: u.threadCommentIconContainer }, /* @__PURE__ */ a.createElement(
|
|
534
534
|
"div",
|
|
535
535
|
{
|
|
536
|
-
onClick:
|
|
536
|
+
onClick: Y,
|
|
537
537
|
className: u.threadCommentIcon,
|
|
538
538
|
style: { color: p ? "rgb(var(--green-500))" : "" }
|
|
539
539
|
},
|
|
540
|
-
p ? /* @__PURE__ */ a.createElement(
|
|
541
|
-
), (M == null ? void 0 : M.userID) ===
|
|
542
|
-
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentContent },
|
|
540
|
+
p ? /* @__PURE__ */ a.createElement(ke, null) : /* @__PURE__ */ a.createElement(Ae, null)
|
|
541
|
+
), (M == null ? void 0 : M.userID) === l.root.personId ? /* @__PURE__ */ a.createElement("div", { className: u.threadCommentIcon, onClick: te }, /* @__PURE__ */ a.createElement(we, null)) : null) : null),
|
|
542
|
+
/* @__PURE__ */ a.createElement("div", { className: u.threadCommentContent }, ee.map(
|
|
543
543
|
(x) => /* @__PURE__ */ a.createElement(
|
|
544
|
-
|
|
544
|
+
Cn,
|
|
545
545
|
{
|
|
546
546
|
onClose: f,
|
|
547
547
|
unitId: n,
|
|
548
548
|
subUnitId: r,
|
|
549
549
|
item: x,
|
|
550
550
|
key: x.id,
|
|
551
|
-
isRoot: x.id === (
|
|
552
|
-
editing:
|
|
553
|
-
resolved:
|
|
554
|
-
onEditingChange: (
|
|
555
|
-
d(
|
|
551
|
+
isRoot: x.id === (l == null ? void 0 : l.root.id),
|
|
552
|
+
editing: C === x.id,
|
|
553
|
+
resolved: l == null ? void 0 : l.root.resolved,
|
|
554
|
+
onEditingChange: ($) => {
|
|
555
|
+
d($ ? x.id : "");
|
|
556
556
|
},
|
|
557
|
-
onReply: (
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
(
|
|
557
|
+
onReply: ($) => {
|
|
558
|
+
$ && requestAnimationFrame(() => {
|
|
559
|
+
var L;
|
|
560
|
+
(L = Z.current) == null || L.reply(je([{
|
|
561
561
|
type: "mention",
|
|
562
562
|
content: {
|
|
563
|
-
id:
|
|
564
|
-
label:
|
|
563
|
+
id: $.userID,
|
|
564
|
+
label: $.name
|
|
565
565
|
}
|
|
566
566
|
}]));
|
|
567
567
|
});
|
|
568
568
|
},
|
|
569
569
|
onAddComment: g,
|
|
570
|
-
onDeleteComment:
|
|
570
|
+
onDeleteComment: S
|
|
571
571
|
}
|
|
572
572
|
)
|
|
573
573
|
)),
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
G ? /* @__PURE__ */ a.createElement("div", null, /* @__PURE__ */ a.createElement(
|
|
575
|
+
Ve,
|
|
576
576
|
{
|
|
577
577
|
key: `${_}`,
|
|
578
|
-
ref:
|
|
578
|
+
ref: Z,
|
|
579
579
|
unitId: n,
|
|
580
580
|
subUnitId: r,
|
|
581
|
-
onSave: ({ text: x, attachments:
|
|
582
|
-
const
|
|
581
|
+
onSave: ({ text: x, attachments: $ }) => {
|
|
582
|
+
const L = {
|
|
583
583
|
text: x,
|
|
584
|
-
attachments:
|
|
585
|
-
dT:
|
|
586
|
-
id:
|
|
584
|
+
attachments: $,
|
|
585
|
+
dT: ft(),
|
|
586
|
+
id: it.generateRandomId(),
|
|
587
587
|
ref: o,
|
|
588
588
|
personId: M == null ? void 0 : M.userID,
|
|
589
|
-
parentId:
|
|
589
|
+
parentId: l == null ? void 0 : l.root.id,
|
|
590
590
|
unitId: n,
|
|
591
591
|
subUnitId: r,
|
|
592
|
-
threadId:
|
|
592
|
+
threadId: l == null ? void 0 : l.root.threadId
|
|
593
593
|
};
|
|
594
|
-
(g == null ? void 0 : g(
|
|
595
|
-
|
|
594
|
+
(g == null ? void 0 : g(L)) !== !1 && R.executeCommand(
|
|
595
|
+
Ye.id,
|
|
596
596
|
{
|
|
597
597
|
unitId: n,
|
|
598
598
|
subUnitId: r,
|
|
599
|
-
comment:
|
|
599
|
+
comment: L
|
|
600
600
|
}
|
|
601
601
|
);
|
|
602
602
|
},
|
|
603
|
-
autoFocus: _ || !
|
|
603
|
+
autoFocus: _ || !l,
|
|
604
604
|
onCancel: () => {
|
|
605
|
-
|
|
605
|
+
l || f == null || f();
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
)) : null
|
|
609
609
|
);
|
|
610
|
-
},
|
|
611
|
-
threadCommentPanel:
|
|
612
|
-
threadComment:
|
|
613
|
-
threadCommentPanelForms:
|
|
614
|
-
select:
|
|
615
|
-
threadCommentPanelEmpty:
|
|
616
|
-
threadCommentPanelAdd:
|
|
617
|
-
|
|
610
|
+
}, gn = "univer-thread-comment-panel", pn = "univer-thread-comment", In = "univer-thread-comment-panel-forms", Sn = "univer-select", bn = "univer-thread-comment-panel-empty", En = "univer-thread-comment-panel-add", yn = "univer-thread-comment-panel-solved", Q = {
|
|
611
|
+
threadCommentPanel: gn,
|
|
612
|
+
threadComment: pn,
|
|
613
|
+
threadCommentPanelForms: In,
|
|
614
|
+
select: Sn,
|
|
615
|
+
threadCommentPanelEmpty: bn,
|
|
616
|
+
threadCommentPanelAdd: En,
|
|
617
|
+
threadCommentPanelSolved: yn
|
|
618
|
+
}, Rn = (t) => {
|
|
618
619
|
const {
|
|
619
620
|
unitId: e,
|
|
620
621
|
subUnitId$: n,
|
|
621
622
|
type: r,
|
|
622
623
|
onAdd: o,
|
|
623
|
-
getSubUnitName:
|
|
624
|
+
getSubUnitName: i,
|
|
624
625
|
onResolve: m,
|
|
625
626
|
sortComments: c,
|
|
626
627
|
onItemLeave: f,
|
|
@@ -630,136 +631,138 @@ const At = "univer-thread-comment-editor-buttons", Lt = "univer-thread-comment-e
|
|
|
630
631
|
onAddComment: I,
|
|
631
632
|
onDeleteComment: h,
|
|
632
633
|
showComments: g
|
|
633
|
-
} = t, [
|
|
634
|
-
var
|
|
635
|
-
const
|
|
634
|
+
} = t, [S, N] = k("all"), [E, H] = k("all"), v = b(de), C = b(ge), d = b(xe), [l, R] = k(() => d.getUnit(e)), ue = b(z), p = j(ue.activeCommentId$), M = j(d.commentUpdate$), Z = b(X), ee = j(n), Y = ce(!0), te = "panel", U = j(C.currentUser$), G = he(() => {
|
|
635
|
+
var oe, J;
|
|
636
|
+
const s = (S === "all" ? l.map((O) => O[1]).flat() : (J = (oe = l.find((O) => O[0] === ee)) == null ? void 0 : oe[1]) != null ? J : []).filter((O) => !O.parentId), q = c != null ? c : (O) => O, re = s;
|
|
636
637
|
if (g) {
|
|
637
|
-
const
|
|
638
|
-
return
|
|
639
|
-
|
|
640
|
-
}), [...g, ""].map((
|
|
638
|
+
const O = /* @__PURE__ */ new Map();
|
|
639
|
+
return re.forEach((ae) => {
|
|
640
|
+
O.set(ae.id, ae);
|
|
641
|
+
}), [...g, ""].map((ae) => O.get(ae)).filter(Boolean);
|
|
641
642
|
} else
|
|
642
|
-
return
|
|
643
|
-
}, [g,
|
|
644
|
-
...
|
|
645
|
-
...
|
|
646
|
-
], [
|
|
643
|
+
return q(re);
|
|
644
|
+
}, [g, S, l, c, ee]), D = he(() => [
|
|
645
|
+
...G.filter((s) => !s.resolved),
|
|
646
|
+
...G.filter((s) => s.resolved)
|
|
647
|
+
], [G]), K = he(() => E === "resolved" ? D.filter((s) => s.resolved) : E === "unsolved" ? D.filter((s) => !s.resolved) : E === "concern_me" && U != null && U.userID ? D.map((s) => d.getCommentWithChildren(s.unitId, s.subUnitId, s.id)).map((s) => s != null && s.relativeUsers.has(U.userID) ? s.root : null).filter(Boolean) : D, [D, U == null ? void 0 : U.userID, E, d]), F = _ ? [_, ...K] : K, ne = F.filter((s) => !s.resolved), x = F.filter((s) => s.resolved), $ = E !== "all" || S !== "all", L = () => {
|
|
647
648
|
H("all"), N("all");
|
|
648
649
|
};
|
|
649
|
-
|
|
650
|
+
ve(() => {
|
|
650
651
|
e && R(
|
|
651
652
|
d.getUnit(e)
|
|
652
653
|
);
|
|
653
|
-
}, [e, d, M]),
|
|
654
|
-
var
|
|
654
|
+
}, [e, d, M]), ve(() => {
|
|
655
|
+
var J;
|
|
655
656
|
if (!p)
|
|
656
657
|
return;
|
|
657
|
-
if (!
|
|
658
|
-
|
|
658
|
+
if (!Y.current) {
|
|
659
|
+
Y.current = !0;
|
|
659
660
|
return;
|
|
660
661
|
}
|
|
661
|
-
const { unitId:
|
|
662
|
-
(
|
|
663
|
-
}, [p])
|
|
664
|
-
|
|
662
|
+
const { unitId: s, subUnitId: q, commentId: re } = p, oe = `${te}-${s}-${q}-${re}`;
|
|
663
|
+
(J = document.getElementById(oe)) == null || J.scrollIntoView({ block: "center" });
|
|
664
|
+
}, [p]);
|
|
665
|
+
const pe = (s) => /* @__PURE__ */ a.createElement(
|
|
666
|
+
fn,
|
|
667
|
+
{
|
|
668
|
+
prefix: te,
|
|
669
|
+
getSubUnitName: i,
|
|
670
|
+
key: s.id,
|
|
671
|
+
id: s.id,
|
|
672
|
+
unitId: s.unitId,
|
|
673
|
+
subUnitId: s.subUnitId,
|
|
674
|
+
refStr: s.ref,
|
|
675
|
+
type: r,
|
|
676
|
+
showEdit: (p == null ? void 0 : p.commentId) === s.id,
|
|
677
|
+
showHighlight: (p == null ? void 0 : p.commentId) === s.id,
|
|
678
|
+
onClick: () => {
|
|
679
|
+
Y.current = !1, s.resolved ? Z.executeCommand(V.id) : Z.executeCommand(
|
|
680
|
+
V.id,
|
|
681
|
+
{
|
|
682
|
+
unitId: s.unitId,
|
|
683
|
+
subUnitId: s.subUnitId,
|
|
684
|
+
commentId: s.id,
|
|
685
|
+
temp: !1
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
},
|
|
689
|
+
onMouseEnter: () => y == null ? void 0 : y(s),
|
|
690
|
+
onMouseLeave: () => f == null ? void 0 : f(s),
|
|
691
|
+
onAddComment: I,
|
|
692
|
+
onDeleteComment: h,
|
|
693
|
+
onResolve: (q) => m == null ? void 0 : m(s.id, q)
|
|
694
|
+
}
|
|
695
|
+
);
|
|
696
|
+
return /* @__PURE__ */ a.createElement("div", { className: Q.threadCommentPanel }, /* @__PURE__ */ a.createElement("div", { className: Q.threadCommentPanelForms }, r === Ce.UNIVER_SHEET ? /* @__PURE__ */ a.createElement(
|
|
697
|
+
be,
|
|
665
698
|
{
|
|
666
699
|
borderless: !0,
|
|
667
|
-
value:
|
|
668
|
-
onChange: (
|
|
700
|
+
value: S,
|
|
701
|
+
onChange: (s) => N(s),
|
|
669
702
|
options: [
|
|
670
703
|
{
|
|
671
704
|
value: "current",
|
|
672
|
-
label:
|
|
705
|
+
label: v.t("threadCommentUI.filter.sheet.current")
|
|
673
706
|
},
|
|
674
707
|
{
|
|
675
708
|
value: "all",
|
|
676
|
-
label:
|
|
709
|
+
label: v.t("threadCommentUI.filter.sheet.all")
|
|
677
710
|
}
|
|
678
711
|
]
|
|
679
712
|
}
|
|
680
713
|
) : null, /* @__PURE__ */ a.createElement(
|
|
681
|
-
|
|
714
|
+
be,
|
|
682
715
|
{
|
|
683
716
|
borderless: !0,
|
|
684
717
|
value: E,
|
|
685
|
-
onChange: (
|
|
718
|
+
onChange: (s) => H(s),
|
|
686
719
|
options: [
|
|
687
720
|
{
|
|
688
721
|
value: "all",
|
|
689
|
-
label:
|
|
722
|
+
label: v.t("threadCommentUI.filter.status.all")
|
|
690
723
|
},
|
|
691
724
|
{
|
|
692
725
|
value: "resolved",
|
|
693
|
-
label:
|
|
726
|
+
label: v.t("threadCommentUI.filter.status.resolved")
|
|
694
727
|
},
|
|
695
728
|
{
|
|
696
729
|
value: "unsolved",
|
|
697
|
-
label:
|
|
730
|
+
label: v.t("threadCommentUI.filter.status.unsolved")
|
|
698
731
|
},
|
|
699
732
|
{
|
|
700
733
|
value: "concern_me",
|
|
701
|
-
label:
|
|
734
|
+
label: v.t("threadCommentUI.filter.status.concernMe")
|
|
702
735
|
}
|
|
703
736
|
]
|
|
704
737
|
}
|
|
705
|
-
)),
|
|
706
|
-
|
|
707
|
-
{
|
|
708
|
-
prefix: X,
|
|
709
|
-
getSubUnitName: l,
|
|
710
|
-
key: i.id,
|
|
711
|
-
id: i.id,
|
|
712
|
-
unitId: i.unitId,
|
|
713
|
-
subUnitId: i.subUnitId,
|
|
714
|
-
refStr: i.ref,
|
|
715
|
-
type: r,
|
|
716
|
-
showEdit: (p == null ? void 0 : p.commentId) === i.id,
|
|
717
|
-
showHighlight: (p == null ? void 0 : p.commentId) === i.id,
|
|
718
|
-
onClick: () => {
|
|
719
|
-
z.current = !1, i.resolved ? W.executeCommand(j.id) : W.executeCommand(
|
|
720
|
-
j.id,
|
|
721
|
-
{
|
|
722
|
-
unitId: i.unitId,
|
|
723
|
-
subUnitId: i.subUnitId,
|
|
724
|
-
commentId: i.id,
|
|
725
|
-
temp: !1
|
|
726
|
-
}
|
|
727
|
-
);
|
|
728
|
-
},
|
|
729
|
-
onMouseEnter: () => y == null ? void 0 : y(i),
|
|
730
|
-
onMouseLeave: () => f == null ? void 0 : f(i),
|
|
731
|
-
onAddComment: I,
|
|
732
|
-
onDeleteComment: h,
|
|
733
|
-
onResolve: (U) => m == null ? void 0 : m(i.id, U)
|
|
734
|
-
}
|
|
735
|
-
)), G.length ? null : /* @__PURE__ */ a.createElement("div", { className: re.threadCommentPanelEmpty }, K ? C.t("threadCommentUI.panel.filterEmpty") : C.t("threadCommentUI.panel.empty"), K ? /* @__PURE__ */ a.createElement(
|
|
736
|
-
ae,
|
|
738
|
+
)), ne.map(pe), x.length ? /* @__PURE__ */ a.createElement("div", { className: Q.threadCommentPanelSolved }, "已解决") : null, x.map(pe), F.length ? null : /* @__PURE__ */ a.createElement("div", { className: Q.threadCommentPanelEmpty }, $ ? v.t("threadCommentUI.panel.filterEmpty") : v.t("threadCommentUI.panel.empty"), $ ? /* @__PURE__ */ a.createElement(
|
|
739
|
+
le,
|
|
737
740
|
{
|
|
738
|
-
onClick:
|
|
741
|
+
onClick: L,
|
|
739
742
|
type: "link"
|
|
740
743
|
},
|
|
741
|
-
|
|
744
|
+
v.t("threadCommentUI.panel.reset")
|
|
742
745
|
) : /* @__PURE__ */ a.createElement(
|
|
743
|
-
|
|
746
|
+
le,
|
|
744
747
|
{
|
|
745
748
|
id: "thread-comment-add",
|
|
746
|
-
className:
|
|
749
|
+
className: Q.threadCommentPanelAdd,
|
|
747
750
|
type: "primary",
|
|
748
751
|
onClick: o,
|
|
749
752
|
disabled: P
|
|
750
753
|
},
|
|
751
|
-
/* @__PURE__ */ a.createElement(
|
|
752
|
-
|
|
754
|
+
/* @__PURE__ */ a.createElement(He, null),
|
|
755
|
+
v.t("threadCommentUI.panel.addComment")
|
|
753
756
|
)));
|
|
754
757
|
};
|
|
755
758
|
export {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
759
|
+
Pe as IThreadCommentMentionDataService,
|
|
760
|
+
V as SetActiveCommentOperation,
|
|
761
|
+
gt as THREAD_COMMENT_PANEL,
|
|
762
|
+
Rn as ThreadCommentPanel,
|
|
763
|
+
z as ThreadCommentPanelService,
|
|
764
|
+
fn as ThreadCommentTree,
|
|
765
|
+
Et as ToggleSheetCommentPanelOperation,
|
|
766
|
+
se as UniverThreadCommentUIPlugin,
|
|
767
|
+
ft as getDT
|
|
765
768
|
};
|