@univerjs/thread-comment-ui 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +251 -258
- package/lib/types/plugin.d.ts +4 -5
- package/lib/types/types/const.d.ts +1 -1
- package/lib/types/views/thread-comment-tree/index.d.ts +1 -2
- package/lib/umd/index.js +3 -3
- package/package.json +34 -19
package/lib/es/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UniverThreadCommentPlugin as
|
|
5
|
-
import { Disposable as
|
|
6
|
-
import { Inject as te, createIdentifier as
|
|
7
|
-
import { ISidebarService as
|
|
8
|
-
import { BehaviorSubject as re, filter as
|
|
9
|
-
import a, { forwardRef as H, useRef as X, createElement as
|
|
10
|
-
import { useDependency as
|
|
11
|
-
import { Mentions as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var $e = (t, e, n) => e in t ? Pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var P = (t, e, n) => ($e(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { UniverThreadCommentPlugin as He, ThreadCommentModel as de, AddCommentCommand as we, UpdateCommentCommand as De, ResolveCommentCommand as Re, DeleteCommentTreeCommand as ce, DeleteCommentCommand as Le } from "@univerjs/thread-comment";
|
|
5
|
+
import { Disposable as ue, UniverInstanceType as he, IUniverInstanceService as ke, CommandType as Ce, OnLifecycle as je, LifecycleStages as Ae, LocaleService as J, Plugin as Ve, mergeOverrideWithDependencies as Be, DependentOn as We, ICommandService as Q, CustomRangeType as Fe, UserManagerService as ee, Tools as ze } from "@univerjs/core";
|
|
6
|
+
import { Inject as te, createIdentifier as Ze, Injector as Ye } from "@wendellhu/redi";
|
|
7
|
+
import { ISidebarService as ve, useObservable as j } from "@univerjs/ui";
|
|
8
|
+
import { BehaviorSubject as re, filter as Ge } from "rxjs";
|
|
9
|
+
import a, { forwardRef as H, useRef as X, createElement as L, useState as $, useImperativeHandle as Ke, useMemo as oe, useEffect as ae } from "react";
|
|
10
|
+
import { useDependency as E } from "@wendellhu/redi/react-bindings";
|
|
11
|
+
import { Mentions as qe, Mention as Je, Button as G, Dropdown as Qe, Menu as Xe, MenuItem as ie, Select as le } from "@univerjs/design";
|
|
12
|
+
import et from "dayjs";
|
|
13
|
+
import tt from "clsx";
|
|
14
|
+
const nt = "thread-comment-panel", rt = "THREAD_COMMENT_UI_PLUGIN";
|
|
15
|
+
var ot = Object.defineProperty, at = Object.getOwnPropertyDescriptor, it = (t, e, n, r) => {
|
|
16
|
+
for (var o = r > 1 ? void 0 : r ? at(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
17
17
|
(s = t[i]) && (o = (r ? s(e, n, o) : s(o)) || o);
|
|
18
|
-
return r && o &&
|
|
18
|
+
return r && o && ot(e, n, o), o;
|
|
19
19
|
}, se = (t, e) => (n, r) => e(n, r, t);
|
|
20
|
-
let A = class extends
|
|
20
|
+
let A = class extends ue {
|
|
21
21
|
constructor(e, n) {
|
|
22
22
|
super();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
P(this, "_panelVisible", !1);
|
|
24
|
+
P(this, "_panelVisible$", new re(!1));
|
|
25
|
+
P(this, "_activeCommentId");
|
|
26
|
+
P(this, "_activeCommentId$", new re(void 0));
|
|
27
|
+
P(this, "panelVisible$", this._panelVisible$.asObservable());
|
|
28
|
+
P(this, "activeCommentId$", this._activeCommentId$.asObservable());
|
|
29
29
|
this._sidebarService = e, this._univerInstanceService = n, this._init();
|
|
30
30
|
}
|
|
31
31
|
_init() {
|
|
@@ -34,7 +34,7 @@ let A = class extends he {
|
|
|
34
34
|
e.visible || this.setPanelVisible(!1);
|
|
35
35
|
})
|
|
36
36
|
), this.disposeWithMe(
|
|
37
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
37
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(Ge((e) => !e)).subscribe(() => {
|
|
38
38
|
this._sidebarService.close();
|
|
39
39
|
})
|
|
40
40
|
);
|
|
@@ -52,18 +52,18 @@ let A = class extends he {
|
|
|
52
52
|
this._activeCommentId = e, this._activeCommentId$.next(e);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
A =
|
|
56
|
-
se(0, te(
|
|
55
|
+
A = it([
|
|
56
|
+
se(0, te(ve)),
|
|
57
57
|
se(1, ke)
|
|
58
58
|
], A);
|
|
59
|
-
const
|
|
59
|
+
const lt = {
|
|
60
60
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
61
61
|
type: Ce.OPERATION,
|
|
62
62
|
handler(t) {
|
|
63
|
-
const e = t.get(
|
|
63
|
+
const e = t.get(ve), n = t.get(A);
|
|
64
64
|
return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
|
|
65
65
|
header: { title: "threadCommentUI.panel.title" },
|
|
66
|
-
children: { label:
|
|
66
|
+
children: { label: nt },
|
|
67
67
|
width: 320
|
|
68
68
|
}), n.setPanelVisible(!0)), !0;
|
|
69
69
|
}
|
|
@@ -74,70 +74,68 @@ const ot = {
|
|
|
74
74
|
return t.get(A).setActiveComment(e), !0;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
var
|
|
78
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
77
|
+
var st = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, dt = (t, e, n, r) => {
|
|
78
|
+
for (var o = r > 1 ? void 0 : r ? mt(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
79
79
|
(s = t[i]) && (o = (r ? s(e, n, o) : s(o)) || o);
|
|
80
|
-
return r && o &&
|
|
81
|
-
},
|
|
82
|
-
let
|
|
80
|
+
return r && o && st(e, n, o), o;
|
|
81
|
+
}, ct = (t, e) => (n, r) => e(n, r, t);
|
|
82
|
+
let Y = class extends ue {
|
|
83
83
|
constructor(t) {
|
|
84
84
|
super(), this._localeService = t;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
],
|
|
91
|
-
class
|
|
87
|
+
Y = dt([
|
|
88
|
+
je(Ae.Starting, Y),
|
|
89
|
+
ct(0, te(J))
|
|
90
|
+
], Y);
|
|
91
|
+
class ut {
|
|
92
92
|
constructor() {
|
|
93
|
-
|
|
93
|
+
P(this, "trigger", "@");
|
|
94
94
|
}
|
|
95
95
|
async getMentions(e) {
|
|
96
96
|
return [];
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
var
|
|
101
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
99
|
+
const ge = Ze("thread-comment.mention-data.service");
|
|
100
|
+
var pe = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, Ct = (t, e, n) => e in t ? pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, vt = (t, e, n, r) => {
|
|
101
|
+
for (var o = r > 1 ? void 0 : r ? ht(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
102
102
|
(s = t[i]) && (o = (r ? s(e, n, o) : s(o)) || o);
|
|
103
|
-
return r && o &&
|
|
104
|
-
}, me = (t, e) => (n, r) => e(n, r, t),
|
|
105
|
-
let
|
|
106
|
-
constructor(e, n
|
|
107
|
-
super(
|
|
108
|
-
e,
|
|
109
|
-
n,
|
|
110
|
-
r
|
|
111
|
-
);
|
|
112
|
-
_(this, "_config1");
|
|
113
|
-
this._injector = n, this._commandService = r, this._config1 = e;
|
|
103
|
+
return r && o && pe(e, n, o), o;
|
|
104
|
+
}, me = (t, e) => (n, r) => e(n, r, t), Ie = (t, e, n) => (Ct(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
105
|
+
let K = class extends Ve {
|
|
106
|
+
constructor(t, e, n) {
|
|
107
|
+
super(), this._config = t, this._injector = e, this._commandService = n;
|
|
114
108
|
}
|
|
115
|
-
onStarting(
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
onStarting(t) {
|
|
110
|
+
var e;
|
|
111
|
+
Be([
|
|
112
|
+
[Y],
|
|
118
113
|
[A],
|
|
119
|
-
[
|
|
120
|
-
], this.
|
|
121
|
-
|
|
122
|
-
}), [
|
|
114
|
+
[ge, { useClass: ut }]
|
|
115
|
+
], (e = this._config) == null ? void 0 : e.overrides).forEach((n) => {
|
|
116
|
+
t.add(n);
|
|
117
|
+
}), [lt, fe].forEach((n) => {
|
|
123
118
|
this._commandService.registerCommand(n);
|
|
124
119
|
});
|
|
125
120
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
};
|
|
122
|
+
Ie(K, "pluginName", rt);
|
|
123
|
+
Ie(K, "type", he.UNIVER_UNKNOWN);
|
|
124
|
+
K = vt([
|
|
125
|
+
We(He),
|
|
126
|
+
me(1, te(Ye)),
|
|
129
127
|
me(2, Q)
|
|
130
|
-
],
|
|
131
|
-
var
|
|
132
|
-
return
|
|
128
|
+
], K);
|
|
129
|
+
var _ = function() {
|
|
130
|
+
return _ = Object.assign || function(t) {
|
|
133
131
|
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
134
132
|
e = arguments[n];
|
|
135
133
|
for (var o in e)
|
|
136
134
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
137
135
|
}
|
|
138
136
|
return t;
|
|
139
|
-
},
|
|
140
|
-
},
|
|
137
|
+
}, _.apply(this, arguments);
|
|
138
|
+
}, ft = function(t, e) {
|
|
141
139
|
var n = {};
|
|
142
140
|
for (var r in t)
|
|
143
141
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
@@ -145,17 +143,17 @@ var x = function() {
|
|
|
145
143
|
for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
|
|
146
144
|
e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
|
|
147
145
|
return n;
|
|
148
|
-
},
|
|
149
|
-
var n = t.icon, r = t.id, o = t.className, i = t.extend, s =
|
|
150
|
-
return
|
|
146
|
+
}, k = H(function(t, e) {
|
|
147
|
+
var n = t.icon, r = t.id, o = t.className, i = t.extend, s = ft(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), d = X("_".concat(It()));
|
|
148
|
+
return be(n, "".concat(r), { defIds: n.defIds, idSuffix: d.current }, _({ ref: e, className: c }, s), i);
|
|
151
149
|
});
|
|
152
|
-
function
|
|
153
|
-
return
|
|
154
|
-
return
|
|
150
|
+
function be(t, e, n, r, o) {
|
|
151
|
+
return L(t.tag, _(_({ key: e }, gt(t, n, o)), r), (pt(t, n).children || []).map(function(i, s) {
|
|
152
|
+
return be(i, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, o);
|
|
155
153
|
}));
|
|
156
154
|
}
|
|
157
|
-
function
|
|
158
|
-
var r =
|
|
155
|
+
function gt(t, e, n) {
|
|
156
|
+
var r = _({}, t.attrs);
|
|
159
157
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
160
158
|
var o = e.defIds;
|
|
161
159
|
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) {
|
|
@@ -163,75 +161,70 @@ function vt(t, e, n) {
|
|
|
163
161
|
typeof c == "string" && (r[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
164
162
|
})), r;
|
|
165
163
|
}
|
|
166
|
-
function
|
|
164
|
+
function pt(t, e) {
|
|
167
165
|
var n, r = e.defIds;
|
|
168
|
-
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ?
|
|
169
|
-
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ?
|
|
166
|
+
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? _(_({}, t), { children: t.children.map(function(o) {
|
|
167
|
+
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? _(_({}, o), { attrs: _(_({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
170
168
|
}) }) : t;
|
|
171
169
|
}
|
|
172
|
-
function
|
|
170
|
+
function It() {
|
|
173
171
|
return Math.random().toString(36).substring(2, 8);
|
|
174
172
|
}
|
|
175
|
-
|
|
176
|
-
var
|
|
177
|
-
return k
|
|
173
|
+
k.displayName = "UniverIcon";
|
|
174
|
+
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" } }] }, Ee = H(function(t, e) {
|
|
175
|
+
return L(k, Object.assign({}, t, {
|
|
178
176
|
id: "delete-single",
|
|
179
177
|
ref: e,
|
|
180
|
-
icon:
|
|
178
|
+
icon: bt
|
|
181
179
|
}));
|
|
182
180
|
});
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return k(L, Object.assign({}, t, {
|
|
181
|
+
Ee.displayName = "DeleteSingle";
|
|
182
|
+
var Et = { 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" } }] }, ye = H(function(t, e) {
|
|
183
|
+
return L(k, Object.assign({}, t, {
|
|
187
184
|
id: "increase-single",
|
|
188
185
|
ref: e,
|
|
189
|
-
icon:
|
|
186
|
+
icon: Et
|
|
190
187
|
}));
|
|
191
188
|
});
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return k(L, Object.assign({}, t, {
|
|
189
|
+
ye.displayName = "IncreaseSingle";
|
|
190
|
+
var yt = { 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" } }] }, Se = H(function(t, e) {
|
|
191
|
+
return L(k, Object.assign({}, t, {
|
|
196
192
|
id: "more-horizontal-single",
|
|
197
193
|
ref: e,
|
|
198
|
-
icon:
|
|
194
|
+
icon: yt
|
|
199
195
|
}));
|
|
200
196
|
});
|
|
201
197
|
Se.displayName = "MoreHorizontalSingle";
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return k(L, Object.assign({}, t, {
|
|
198
|
+
var St = { 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 } }] }, _e = H(function(t, e) {
|
|
199
|
+
return L(k, Object.assign({}, t, {
|
|
205
200
|
id: "reply-to-comment-single",
|
|
206
201
|
ref: e,
|
|
207
|
-
icon:
|
|
202
|
+
icon: St
|
|
208
203
|
}));
|
|
209
204
|
});
|
|
210
|
-
|
|
211
|
-
const xt = Ee;
|
|
205
|
+
_e.displayName = "ReplyToCommentSingle";
|
|
212
206
|
var _t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, xe = H(function(t, e) {
|
|
213
|
-
return k
|
|
207
|
+
return L(k, Object.assign({}, t, {
|
|
214
208
|
id: "resolved-single",
|
|
215
209
|
ref: e,
|
|
216
210
|
icon: _t
|
|
217
211
|
}));
|
|
218
212
|
});
|
|
219
213
|
xe.displayName = "ResolvedSingle";
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return k(L, Object.assign({}, t, {
|
|
214
|
+
var xt = { 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 } }] }, Ne = H(function(t, e) {
|
|
215
|
+
return L(k, Object.assign({}, t, {
|
|
223
216
|
id: "solve-single",
|
|
224
217
|
ref: e,
|
|
225
|
-
icon:
|
|
218
|
+
icon: xt
|
|
226
219
|
}));
|
|
227
220
|
});
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
threadCommentEditorButtons:
|
|
231
|
-
threadCommentEditorSuggestion:
|
|
232
|
-
threadCommentEditorSuggestionActive:
|
|
233
|
-
threadCommentEditorSuggestionIcon:
|
|
234
|
-
},
|
|
221
|
+
Ne.displayName = "SolveSingle";
|
|
222
|
+
const Nt = "univer-thread-comment-editor-buttons", Tt = "univer-thread-comment-editor-suggestion", Mt = "univer-thread-comment-editor-suggestionActive", Ut = "univer-thread-comment-editor-suggestion-icon", q = {
|
|
223
|
+
threadCommentEditorButtons: Nt,
|
|
224
|
+
threadCommentEditorSuggestion: Tt,
|
|
225
|
+
threadCommentEditorSuggestionActive: Mt,
|
|
226
|
+
threadCommentEditorSuggestionIcon: Ut
|
|
227
|
+
}, Ot = (t) => {
|
|
235
228
|
const e = /@\[(.*?)\]\((.*?)\)|(\w+)/g;
|
|
236
229
|
let n, r = 0;
|
|
237
230
|
const o = [];
|
|
@@ -253,14 +246,14 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
253
246
|
type: "text",
|
|
254
247
|
content: t.substring(r)
|
|
255
248
|
}), o;
|
|
256
|
-
},
|
|
249
|
+
}, Pt = (t) => t.map((e) => {
|
|
257
250
|
switch (e.type) {
|
|
258
251
|
case "mention":
|
|
259
252
|
return `@[${e.content.label}](${e.content.id})`;
|
|
260
253
|
default:
|
|
261
254
|
return e.content;
|
|
262
255
|
}
|
|
263
|
-
}).join(""),
|
|
256
|
+
}).join(""), Te = (t) => {
|
|
264
257
|
const { dataStream: e, customRanges: n } = t, r = e.length - 2, o = [];
|
|
265
258
|
let i = 0;
|
|
266
259
|
return n == null || n.forEach((s) => {
|
|
@@ -278,7 +271,7 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
278
271
|
type: "text",
|
|
279
272
|
content: e.slice(i, r)
|
|
280
273
|
}), o;
|
|
281
|
-
},
|
|
274
|
+
}, Me = (t) => {
|
|
282
275
|
let e = "";
|
|
283
276
|
const n = [];
|
|
284
277
|
return t.forEach((r) => {
|
|
@@ -292,7 +285,7 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
292
285
|
const i = e.length;
|
|
293
286
|
n.push({
|
|
294
287
|
rangeId: r.content.id,
|
|
295
|
-
rangeType:
|
|
288
|
+
rangeType: Fe.MENTION,
|
|
296
289
|
startIndex: o,
|
|
297
290
|
endIndex: i
|
|
298
291
|
});
|
|
@@ -316,57 +309,57 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
316
309
|
dataStream: e,
|
|
317
310
|
customRanges: n
|
|
318
311
|
};
|
|
319
|
-
},
|
|
312
|
+
}, $t = (t) => ({
|
|
320
313
|
display: t.label,
|
|
321
314
|
id: `${t.id}`,
|
|
322
315
|
raw: t
|
|
323
|
-
}),
|
|
316
|
+
}), Ht = (t, e, n, r, o) => {
|
|
324
317
|
var s, c;
|
|
325
318
|
const i = (s = t.raw) == null ? void 0 : s.icon;
|
|
326
319
|
return /* @__PURE__ */ a.createElement("div", { className: q.threadCommentEditorSuggestion }, i ? /* @__PURE__ */ a.createElement("img", { className: q.threadCommentEditorSuggestionIcon, src: i }) : null, /* @__PURE__ */ a.createElement("div", null, (c = t.display) != null ? c : t.id));
|
|
327
|
-
},
|
|
320
|
+
}, Ue = H((t, e) => {
|
|
328
321
|
var u;
|
|
329
|
-
const { comment: n, onSave: r, id: o, onCancel: i, autoFocus: s } = t, c =
|
|
330
|
-
return
|
|
331
|
-
reply(
|
|
322
|
+
const { comment: n, onSave: r, id: o, onCancel: i, autoFocus: s } = t, c = E(ge), d = E(J), [f, g] = $({ ...n }), [x, p] = $(!1), I = X(null);
|
|
323
|
+
return Ke(e, () => ({
|
|
324
|
+
reply(b) {
|
|
332
325
|
var h;
|
|
333
|
-
|
|
326
|
+
g({
|
|
334
327
|
...n,
|
|
335
|
-
text:
|
|
328
|
+
text: b,
|
|
336
329
|
attachments: []
|
|
337
330
|
}), (h = I.current) == null || h.inputElement.focus();
|
|
338
331
|
}
|
|
339
|
-
})), /* @__PURE__ */ a.createElement("div", { className: q.threadCommentEditor, onClick: (
|
|
340
|
-
|
|
332
|
+
})), /* @__PURE__ */ a.createElement("div", { className: q.threadCommentEditor, onClick: (b) => b.preventDefault() }, /* @__PURE__ */ a.createElement(
|
|
333
|
+
qe,
|
|
341
334
|
{
|
|
342
335
|
ref: I,
|
|
343
336
|
autoFocus: s,
|
|
344
337
|
style: { width: "100%" },
|
|
345
338
|
placeholder: d.t("threadCommentUI.editor.placeholder"),
|
|
346
|
-
value:
|
|
347
|
-
onChange: (
|
|
348
|
-
|
|
339
|
+
value: f != null && f.text ? Pt(Te(f.text)) : "",
|
|
340
|
+
onChange: (b) => {
|
|
341
|
+
b.target.value || g({ ...n, text: void 0 }), g == null || g({ ...n, text: Me(Ot(b.target.value)) });
|
|
349
342
|
},
|
|
350
343
|
onFocus: () => {
|
|
351
344
|
p(!0);
|
|
352
345
|
}
|
|
353
346
|
},
|
|
354
347
|
/* @__PURE__ */ a.createElement(
|
|
355
|
-
|
|
348
|
+
Je,
|
|
356
349
|
{
|
|
357
350
|
key: c.trigger,
|
|
358
351
|
trigger: c.trigger,
|
|
359
|
-
data: (
|
|
360
|
-
displayTransform: (
|
|
361
|
-
renderSuggestion: (u = c.renderSuggestion) != null ? u :
|
|
352
|
+
data: (b, h) => c.getMentions(b).then((N) => N.map($t)).then(h),
|
|
353
|
+
displayTransform: (b, h) => `@${h} `,
|
|
354
|
+
renderSuggestion: (u = c.renderSuggestion) != null ? u : Ht
|
|
362
355
|
}
|
|
363
356
|
)
|
|
364
|
-
),
|
|
357
|
+
), x ? /* @__PURE__ */ a.createElement("div", { className: q.threadCommentEditorButtons }, /* @__PURE__ */ a.createElement(
|
|
365
358
|
G,
|
|
366
359
|
{
|
|
367
360
|
style: { marginRight: 12 },
|
|
368
361
|
onClick: () => {
|
|
369
|
-
i == null || i(), p(!1),
|
|
362
|
+
i == null || i(), p(!1), g({ text: void 0 });
|
|
370
363
|
}
|
|
371
364
|
},
|
|
372
365
|
d.t("threadCommentUI.editor.cancel")
|
|
@@ -374,84 +367,84 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
374
367
|
G,
|
|
375
368
|
{
|
|
376
369
|
type: "primary",
|
|
377
|
-
disabled: !
|
|
370
|
+
disabled: !f.text,
|
|
378
371
|
onClick: () => {
|
|
379
|
-
|
|
380
|
-
...
|
|
381
|
-
text:
|
|
382
|
-
}), p(!1),
|
|
372
|
+
f.text && (r == null || r({
|
|
373
|
+
...f,
|
|
374
|
+
text: f.text
|
|
375
|
+
}), p(!1), g({ text: void 0 }));
|
|
383
376
|
}
|
|
384
377
|
},
|
|
385
378
|
d.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
386
379
|
)) : null);
|
|
387
|
-
}),
|
|
388
|
-
threadComment:
|
|
389
|
-
threadCommentActive:
|
|
390
|
-
threadCommentContent:
|
|
391
|
-
threadCommentHighlight:
|
|
392
|
-
threadCommentIconContainer:
|
|
393
|
-
threadCommentIcon:
|
|
394
|
-
threadCommentTitle:
|
|
395
|
-
threadCommentTitlePosition:
|
|
396
|
-
threadCommentTitleHighlight:
|
|
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: i, onReply: s, resolved: c, isRoot: d, onClose:
|
|
408
|
-
|
|
409
|
-
d ?
|
|
380
|
+
}), wt = "univer-thread-comment", Dt = "univer-thread-comment-active", Rt = "univer-thread-comment-content", Lt = "univer-thread-comment-highlight", kt = "univer-thread-comment-icon-container", jt = "univer-thread-comment-icon", At = "univer-thread-comment-title", Vt = "univer-thread-comment-title-position", Bt = "univer-thread-comment-title-highlight", Wt = "univer-thread-comment-username", Ft = "univer-thread-comment-item", zt = "univer-thread-comment-item-head", Zt = "univer-thread-comment-item-title", Yt = "univer-thread-comment-item-title-position", Gt = "univer-thread-comment-item-title-highlight", Kt = "univer-thread-comment-item-time", qt = "univer-thread-comment-item-content", Jt = "univer-thread-comment-item-at", v = {
|
|
381
|
+
threadComment: wt,
|
|
382
|
+
threadCommentActive: Dt,
|
|
383
|
+
threadCommentContent: Rt,
|
|
384
|
+
threadCommentHighlight: Lt,
|
|
385
|
+
threadCommentIconContainer: kt,
|
|
386
|
+
threadCommentIcon: jt,
|
|
387
|
+
threadCommentTitle: At,
|
|
388
|
+
threadCommentTitlePosition: Vt,
|
|
389
|
+
threadCommentTitleHighlight: Bt,
|
|
390
|
+
threadCommentUsername: Wt,
|
|
391
|
+
threadCommentItem: Ft,
|
|
392
|
+
threadCommentItemHead: zt,
|
|
393
|
+
threadCommentItemTitle: Zt,
|
|
394
|
+
threadCommentItemTitlePosition: Yt,
|
|
395
|
+
threadCommentItemTitleHighlight: Gt,
|
|
396
|
+
threadCommentItemTime: Kt,
|
|
397
|
+
threadCommentItemContent: qt,
|
|
398
|
+
threadCommentItemAt: Jt
|
|
399
|
+
}, Oe = "__mock__", Qt = (t) => {
|
|
400
|
+
const { item: e, unitId: n, subUnitId: r, editing: o, onEditingChange: i, onReply: s, resolved: c, isRoot: d, onClose: f } = t, g = E(Q), x = E(J), p = E(ee), I = p.getUser(e.personId), u = j(p.currentUser$), b = (u == null ? void 0 : u.userID) === e.personId, h = e.id === Oe, [N, w] = $(!1), m = () => {
|
|
401
|
+
g.executeCommand(
|
|
402
|
+
d ? ce.id : Le.id,
|
|
410
403
|
{
|
|
411
404
|
unitId: n,
|
|
412
405
|
subUnitId: r,
|
|
413
406
|
commentId: e.id
|
|
414
407
|
}
|
|
415
|
-
), d && (
|
|
408
|
+
), d && (f == null || f());
|
|
416
409
|
};
|
|
417
|
-
return /* @__PURE__ */ a.createElement("div", { className:
|
|
418
|
-
|
|
410
|
+
return /* @__PURE__ */ a.createElement("div", { className: v.threadCommentItem, onMouseLeave: () => w(!1), onMouseEnter: () => w(!0) }, /* @__PURE__ */ a.createElement("img", { className: v.threadCommentItemHead, src: I == null ? void 0 : I.avatar }), /* @__PURE__ */ a.createElement("div", { className: v.threadCommentItemTitle }, /* @__PURE__ */ a.createElement("div", { className: v.threadCommentUsername }, (I == null ? void 0 : I.name) || " "), /* @__PURE__ */ a.createElement("div", null, h || c ? null : N ? /* @__PURE__ */ a.createElement("div", { className: v.threadCommentIcon, onClick: () => s(I) }, /* @__PURE__ */ a.createElement(_e, null)) : null, b && !h && !c ? /* @__PURE__ */ a.createElement(
|
|
411
|
+
Qe,
|
|
419
412
|
{
|
|
420
|
-
overlay: /* @__PURE__ */ a.createElement(
|
|
413
|
+
overlay: /* @__PURE__ */ a.createElement(Xe, null, /* @__PURE__ */ a.createElement(ie, { key: "edit", onClick: () => i == null ? void 0 : i(!0) }, x.t("threadCommentUI.item.edit")), /* @__PURE__ */ a.createElement(ie, { key: "delete", onClick: m }, x.t("threadCommentUI.item.delete")))
|
|
421
414
|
},
|
|
422
|
-
/* @__PURE__ */ a.createElement("div", { className:
|
|
423
|
-
) : null)), /* @__PURE__ */ a.createElement("div", { className:
|
|
424
|
-
|
|
415
|
+
/* @__PURE__ */ a.createElement("div", { className: v.threadCommentIcon }, /* @__PURE__ */ a.createElement(Se, null))
|
|
416
|
+
) : null)), /* @__PURE__ */ a.createElement("div", { className: v.threadCommentItemTime }, e.dT), o ? /* @__PURE__ */ a.createElement(
|
|
417
|
+
Ue,
|
|
425
418
|
{
|
|
426
419
|
id: e.id,
|
|
427
420
|
comment: e,
|
|
428
421
|
onCancel: () => i == null ? void 0 : i(!1),
|
|
429
422
|
autoFocus: !0,
|
|
430
|
-
onSave: ({ text:
|
|
431
|
-
i == null || i(!1),
|
|
432
|
-
|
|
423
|
+
onSave: ({ text: C, attachments: D }) => {
|
|
424
|
+
i == null || i(!1), g.executeCommand(
|
|
425
|
+
De.id,
|
|
433
426
|
{
|
|
434
427
|
unitId: n,
|
|
435
428
|
subUnitId: r,
|
|
436
429
|
payload: {
|
|
437
430
|
commentId: e.id,
|
|
438
|
-
text:
|
|
431
|
+
text: C,
|
|
439
432
|
attachments: D
|
|
440
433
|
}
|
|
441
434
|
}
|
|
442
435
|
);
|
|
443
436
|
}
|
|
444
437
|
}
|
|
445
|
-
) : /* @__PURE__ */ a.createElement("div", { className:
|
|
446
|
-
switch (
|
|
438
|
+
) : /* @__PURE__ */ a.createElement("div", { className: v.threadCommentItemContent }, Te(e.text).map((C, D) => {
|
|
439
|
+
switch (C.type) {
|
|
447
440
|
case "mention":
|
|
448
|
-
return /* @__PURE__ */ a.createElement("a", { className:
|
|
441
|
+
return /* @__PURE__ */ a.createElement("a", { className: v.threadCommentItemAt, key: D }, "@", C.content.label, " ");
|
|
449
442
|
default:
|
|
450
|
-
return
|
|
443
|
+
return C.content;
|
|
451
444
|
}
|
|
452
445
|
})));
|
|
453
|
-
},
|
|
454
|
-
var R, B,
|
|
446
|
+
}, Xt = (t) => {
|
|
447
|
+
var R, B, z;
|
|
455
448
|
const {
|
|
456
449
|
id: e,
|
|
457
450
|
unitId: n,
|
|
@@ -461,23 +454,23 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
461
454
|
onClick: s,
|
|
462
455
|
showHighlight: c,
|
|
463
456
|
onClose: d,
|
|
464
|
-
getSubUnitName:
|
|
465
|
-
prefix:
|
|
466
|
-
autoFocus:
|
|
457
|
+
getSubUnitName: f,
|
|
458
|
+
prefix: g,
|
|
459
|
+
autoFocus: x,
|
|
467
460
|
onMouseEnter: p,
|
|
468
461
|
onMouseLeave: I
|
|
469
|
-
} = t, u =
|
|
462
|
+
} = t, u = E(de), [b, h] = $(!1), [N, w] = $("");
|
|
470
463
|
j(u.commentMap$);
|
|
471
|
-
const m = e ? u.getCommentWithChildren(n, r, e) : null,
|
|
464
|
+
const m = e ? u.getCommentWithChildren(n, r, e) : null, C = E(Q), D = E(ee), U = m == null ? void 0 : m.root.resolved, y = j(D.currentUser$), T = X(null), V = [
|
|
472
465
|
...m ? [m.root] : (
|
|
473
466
|
// mock empty comment
|
|
474
467
|
[{
|
|
475
|
-
id:
|
|
468
|
+
id: Oe,
|
|
476
469
|
text: {
|
|
477
470
|
dataStream: `
|
|
478
471
|
\r`
|
|
479
472
|
},
|
|
480
|
-
personId: (R =
|
|
473
|
+
personId: (R = y == null ? void 0 : y.userID) != null ? R : "",
|
|
481
474
|
ref: o != null ? o : "",
|
|
482
475
|
dT: "",
|
|
483
476
|
unitId: n,
|
|
@@ -485,16 +478,16 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
485
478
|
}]
|
|
486
479
|
),
|
|
487
480
|
...(B = m == null ? void 0 : m.children) != null ? B : []
|
|
488
|
-
],
|
|
489
|
-
|
|
481
|
+
], F = () => {
|
|
482
|
+
C.executeCommand(Re.id, {
|
|
490
483
|
unitId: n,
|
|
491
484
|
subUnitId: r,
|
|
492
485
|
commentId: e,
|
|
493
486
|
resolved: !U
|
|
494
487
|
}), d == null || d();
|
|
495
488
|
}, O = () => {
|
|
496
|
-
|
|
497
|
-
|
|
489
|
+
C.executeCommand(
|
|
490
|
+
ce.id,
|
|
498
491
|
{
|
|
499
492
|
unitId: n,
|
|
500
493
|
subUnitId: r,
|
|
@@ -505,11 +498,11 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
505
498
|
return /* @__PURE__ */ a.createElement(
|
|
506
499
|
"div",
|
|
507
500
|
{
|
|
508
|
-
className:
|
|
509
|
-
[
|
|
501
|
+
className: tt(v.threadComment, {
|
|
502
|
+
[v.threadCommentActive]: !U && (c || b || g === "cell")
|
|
510
503
|
}),
|
|
511
504
|
onClick: s,
|
|
512
|
-
id: `${
|
|
505
|
+
id: `${g}-${n}-${r}-${e}`,
|
|
513
506
|
onMouseEnter: () => {
|
|
514
507
|
p == null || p(), h(!0);
|
|
515
508
|
},
|
|
@@ -517,19 +510,19 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
517
510
|
I == null || I(), h(!1);
|
|
518
511
|
}
|
|
519
512
|
},
|
|
520
|
-
!U && c ? /* @__PURE__ */ a.createElement("div", { className:
|
|
521
|
-
/* @__PURE__ */ a.createElement("div", { className:
|
|
513
|
+
!U && c ? /* @__PURE__ */ a.createElement("div", { className: v.threadCommentHighlight }) : null,
|
|
514
|
+
/* @__PURE__ */ a.createElement("div", { className: v.threadCommentTitle }, /* @__PURE__ */ a.createElement("div", { className: v.threadCommentTitlePosition }, /* @__PURE__ */ a.createElement("div", { className: v.threadCommentTitleHighlight }), o || (m == null ? void 0 : m.root.ref), " · ", f((z = m == null ? void 0 : m.root.subUnitId) != null ? z : r)), m ? /* @__PURE__ */ a.createElement("div", { className: v.threadCommentIconContainer }, /* @__PURE__ */ a.createElement(
|
|
522
515
|
"div",
|
|
523
516
|
{
|
|
524
|
-
onClick:
|
|
525
|
-
className:
|
|
517
|
+
onClick: F,
|
|
518
|
+
className: v.threadCommentIcon,
|
|
526
519
|
style: { color: U ? "rgb(var(--green-500))" : "" }
|
|
527
520
|
},
|
|
528
|
-
U ? /* @__PURE__ */ a.createElement(
|
|
529
|
-
), (
|
|
530
|
-
/* @__PURE__ */ a.createElement("div", { className:
|
|
521
|
+
U ? /* @__PURE__ */ a.createElement(xe, null) : /* @__PURE__ */ a.createElement(Ne, null)
|
|
522
|
+
), (y == null ? void 0 : y.userID) === m.root.personId ? /* @__PURE__ */ a.createElement("div", { className: v.threadCommentIcon, onClick: O }, /* @__PURE__ */ a.createElement(Ee, null)) : null) : null),
|
|
523
|
+
/* @__PURE__ */ a.createElement("div", { className: v.threadCommentContent }, V.map(
|
|
531
524
|
(l) => /* @__PURE__ */ a.createElement(
|
|
532
|
-
|
|
525
|
+
Qt,
|
|
533
526
|
{
|
|
534
527
|
onClose: d,
|
|
535
528
|
unitId: n,
|
|
@@ -537,42 +530,42 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
537
530
|
item: l,
|
|
538
531
|
key: l.id,
|
|
539
532
|
isRoot: l.id === (m == null ? void 0 : m.root.id),
|
|
540
|
-
editing:
|
|
533
|
+
editing: N === l.id,
|
|
541
534
|
resolved: m == null ? void 0 : m.root.resolved,
|
|
542
|
-
onEditingChange: (
|
|
543
|
-
w(
|
|
535
|
+
onEditingChange: (S) => {
|
|
536
|
+
w(S ? l.id : "");
|
|
544
537
|
},
|
|
545
|
-
onReply: (
|
|
546
|
-
var
|
|
547
|
-
|
|
538
|
+
onReply: (S) => {
|
|
539
|
+
var M;
|
|
540
|
+
S && ((M = T.current) == null || M.reply(Me([{
|
|
548
541
|
type: "mention",
|
|
549
542
|
content: {
|
|
550
|
-
id:
|
|
551
|
-
label:
|
|
543
|
+
id: S.userID,
|
|
544
|
+
label: S.name
|
|
552
545
|
}
|
|
553
546
|
}])));
|
|
554
547
|
}
|
|
555
548
|
}
|
|
556
549
|
)
|
|
557
550
|
)),
|
|
558
|
-
i && !
|
|
559
|
-
|
|
551
|
+
i && !N && !U ? /* @__PURE__ */ a.createElement("div", null, /* @__PURE__ */ a.createElement(
|
|
552
|
+
Ue,
|
|
560
553
|
{
|
|
561
|
-
key: `${
|
|
562
|
-
ref:
|
|
563
|
-
onSave: ({ text: l, attachments:
|
|
564
|
-
|
|
565
|
-
|
|
554
|
+
key: `${x}`,
|
|
555
|
+
ref: T,
|
|
556
|
+
onSave: ({ text: l, attachments: S }) => {
|
|
557
|
+
C.executeCommand(
|
|
558
|
+
we.id,
|
|
566
559
|
{
|
|
567
560
|
unitId: n,
|
|
568
561
|
subUnitId: r,
|
|
569
562
|
comment: {
|
|
570
563
|
text: l,
|
|
571
|
-
attachments:
|
|
572
|
-
dT:
|
|
573
|
-
id:
|
|
564
|
+
attachments: S,
|
|
565
|
+
dT: et().format("YYYY/MM/DD HH:mm"),
|
|
566
|
+
id: ze.generateRandomId(),
|
|
574
567
|
ref: o,
|
|
575
|
-
personId:
|
|
568
|
+
personId: y == null ? void 0 : y.userID,
|
|
576
569
|
parentId: m == null ? void 0 : m.root.id,
|
|
577
570
|
unitId: n,
|
|
578
571
|
subUnitId: r
|
|
@@ -580,30 +573,30 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
580
573
|
}
|
|
581
574
|
);
|
|
582
575
|
},
|
|
583
|
-
autoFocus:
|
|
576
|
+
autoFocus: x || !m,
|
|
584
577
|
onCancel: () => {
|
|
585
578
|
m || d == null || d();
|
|
586
579
|
}
|
|
587
580
|
}
|
|
588
581
|
)) : null
|
|
589
582
|
);
|
|
590
|
-
},
|
|
591
|
-
threadCommentPanel:
|
|
592
|
-
threadComment:
|
|
593
|
-
threadCommentPanelForms:
|
|
594
|
-
select:
|
|
595
|
-
threadCommentPanelEmpty:
|
|
596
|
-
threadCommentPanelAdd:
|
|
597
|
-
},
|
|
598
|
-
const { unitId: e, subUnitId$: n, type: r, onAdd: o, getSubUnitName: i, onResolve: s, sortComments: c, onItemLeave: d, onItemEnter:
|
|
599
|
-
var l,
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
return c ? c(
|
|
583
|
+
}, en = "univer-thread-comment-panel", tn = "univer-thread-comment", nn = "univer-thread-comment-panel-forms", rn = "univer-select", on = "univer-thread-comment-panel-empty", an = "univer-thread-comment-panel-add", Z = {
|
|
584
|
+
threadCommentPanel: en,
|
|
585
|
+
threadComment: tn,
|
|
586
|
+
threadCommentPanelForms: nn,
|
|
587
|
+
select: rn,
|
|
588
|
+
threadCommentPanelEmpty: on,
|
|
589
|
+
threadCommentPanelAdd: an
|
|
590
|
+
}, pn = (t) => {
|
|
591
|
+
const { unitId: e, subUnitId$: n, type: r, onAdd: o, getSubUnitName: i, onResolve: s, sortComments: c, onItemLeave: d, onItemEnter: f } = t, [g, x] = $("all"), [p, I] = $("all"), u = E(J), b = E(ee), h = E(de), [N, w] = $(() => h.getUnit(e)), m = E(A), C = j(m.activeCommentId$), D = j(h.commentUpdate$), U = E(Q), y = j(n), T = b.getCurrentUser(), V = X(!0), F = "panel", O = oe(() => {
|
|
592
|
+
var l, S;
|
|
593
|
+
if (g === "all") {
|
|
594
|
+
const M = N.map((W) => W[1]).flat().filter((W) => !W.parentId);
|
|
595
|
+
return c ? c(M) : M;
|
|
603
596
|
} else
|
|
604
|
-
return (
|
|
605
|
-
}, [
|
|
606
|
-
I("all"),
|
|
597
|
+
return (S = (l = N.find((M) => M[0] === y)) == null ? void 0 : l[1]) != null ? S : [];
|
|
598
|
+
}, [g, N, y, c]), R = oe(() => p === "resolved" ? O.filter((l) => l.resolved) : p === "unsolved" ? O.filter((l) => !l.resolved) : p === "concern_me" && T != null && T.userID ? O.map((l) => h.getCommentWithChildren(l.unitId, l.subUnitId, l.id)).map((l) => l != null && l.relativeUsers.has(T.userID) ? l.root : null).filter(Boolean) : O, [O, T == null ? void 0 : T.userID, p, h]), B = p !== "all" || g !== "all", z = () => {
|
|
599
|
+
I("all"), x("all");
|
|
607
600
|
};
|
|
608
601
|
return ae(() => {
|
|
609
602
|
e && w(
|
|
@@ -611,20 +604,20 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
611
604
|
);
|
|
612
605
|
}, [e, h, D]), ae(() => {
|
|
613
606
|
var ne;
|
|
614
|
-
if (!
|
|
607
|
+
if (!C)
|
|
615
608
|
return;
|
|
616
609
|
if (!V.current) {
|
|
617
610
|
V.current = !0;
|
|
618
611
|
return;
|
|
619
612
|
}
|
|
620
|
-
const { unitId: l, subUnitId:
|
|
613
|
+
const { unitId: l, subUnitId: S, commentId: M } = C, W = `${F}-${l}-${S}-${M}`;
|
|
621
614
|
(ne = document.getElementById(W)) == null || ne.scrollIntoView({ block: "center" });
|
|
622
|
-
}, [
|
|
615
|
+
}, [C]), /* @__PURE__ */ a.createElement("div", { className: Z.threadCommentPanel }, /* @__PURE__ */ a.createElement("div", { className: Z.threadCommentPanelForms }, /* @__PURE__ */ a.createElement(
|
|
623
616
|
le,
|
|
624
617
|
{
|
|
625
618
|
borderless: !0,
|
|
626
|
-
value:
|
|
627
|
-
onChange: (l) =>
|
|
619
|
+
value: g,
|
|
620
|
+
onChange: (l) => x(l),
|
|
628
621
|
options: [
|
|
629
622
|
{
|
|
630
623
|
value: "current",
|
|
@@ -662,17 +655,17 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
662
655
|
]
|
|
663
656
|
}
|
|
664
657
|
)), R == null ? void 0 : R.map((l) => /* @__PURE__ */ a.createElement(
|
|
665
|
-
|
|
658
|
+
Xt,
|
|
666
659
|
{
|
|
667
|
-
prefix:
|
|
660
|
+
prefix: F,
|
|
668
661
|
getSubUnitName: i,
|
|
669
662
|
key: l.id,
|
|
670
663
|
id: l.id,
|
|
671
664
|
unitId: l.unitId,
|
|
672
665
|
subUnitId: l.subUnitId,
|
|
673
666
|
type: r,
|
|
674
|
-
showEdit: (
|
|
675
|
-
showHighlight: (
|
|
667
|
+
showEdit: (C == null ? void 0 : C.commentId) === l.id,
|
|
668
|
+
showHighlight: (C == null ? void 0 : C.commentId) === l.id,
|
|
676
669
|
onClick: () => {
|
|
677
670
|
V.current = !1, U.executeCommand(fe.id, {
|
|
678
671
|
unitId: l.unitId,
|
|
@@ -682,13 +675,13 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
682
675
|
});
|
|
683
676
|
},
|
|
684
677
|
onClose: () => s == null ? void 0 : s(l.id),
|
|
685
|
-
onMouseEnter: () =>
|
|
678
|
+
onMouseEnter: () => f == null ? void 0 : f(l),
|
|
686
679
|
onMouseLeave: () => d == null ? void 0 : d(l)
|
|
687
680
|
}
|
|
688
681
|
)), R.length ? null : /* @__PURE__ */ a.createElement("div", { className: Z.threadCommentPanelEmpty }, B ? u.t("threadCommentUI.panel.filterEmpty") : u.t("threadCommentUI.panel.empty"), B ? /* @__PURE__ */ a.createElement(
|
|
689
682
|
G,
|
|
690
683
|
{
|
|
691
|
-
onClick:
|
|
684
|
+
onClick: z,
|
|
692
685
|
type: "link"
|
|
693
686
|
},
|
|
694
687
|
u.t("threadCommentUI.panel.reset")
|
|
@@ -700,17 +693,17 @@ const Mt = _e, $t = "univer-thread-comment-editor-buttons", Ut = "univer-thread-
|
|
|
700
693
|
type: "primary",
|
|
701
694
|
onClick: o
|
|
702
695
|
},
|
|
703
|
-
/* @__PURE__ */ a.createElement(
|
|
696
|
+
/* @__PURE__ */ a.createElement(ye, null),
|
|
704
697
|
u.t("threadCommentUI.panel.addComment")
|
|
705
698
|
)));
|
|
706
699
|
};
|
|
707
700
|
export {
|
|
708
|
-
|
|
701
|
+
ge as IThreadCommentMentionDataService,
|
|
709
702
|
fe as SetActiveCommentOperation,
|
|
710
|
-
|
|
711
|
-
|
|
703
|
+
nt as THREAD_COMMENT_PANEL,
|
|
704
|
+
pn as ThreadCommentPanel,
|
|
712
705
|
A as ThreadCommentPanelService,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
706
|
+
Xt as ThreadCommentTree,
|
|
707
|
+
lt as ToggleSheetCommentPanelOperation,
|
|
708
|
+
K as UniverThreadCommentUIPlugin
|
|
716
709
|
};
|