@univerjs/thread-comment-ui 0.7.0-nightly.202505081607 → 0.7.0-nightly.202505101606
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 +25 -18
- package/lib/es/index.js +271 -250
- package/lib/index.css +1 -1
- package/lib/index.js +271 -250
- package/lib/umd/index.js +27 -20
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -3,24 +3,24 @@ var Pe = (t, e, n) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var z = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { Inject as Se, IUniverInstanceService as Ve, Disposable as Ae, UniverInstanceType as ce, CommandType as _e, DependentOn as Be, Injector as We, ICommandService as ne, IConfigService as Fe, Plugin as ze, merge as Ge, mergeOverrideWithDependencies as Ke, LocaleService as fe, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, BuildTextUtils as ve, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as he, generateRandomId as Qe } from "@univerjs/core";
|
|
5
5
|
import { UniverThreadCommentPlugin as Xe, ThreadCommentModel as Ne, getDT as et, AddCommentCommand as tt, ResolveCommentCommand as nt, DeleteCommentTreeCommand as we, UpdateCommentCommand as rt, DeleteCommentCommand as it } from "@univerjs/thread-comment";
|
|
6
|
-
import { ISidebarService as Ue, useDependency as N, KeyCode as
|
|
7
|
-
import { BehaviorSubject as
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import { Button as se, clsx as Ce, Tooltip as dt,
|
|
10
|
-
import { forwardRef as B, useRef as te, createElement as Z, useState as A, useEffect as de, useMemo as ee, useImperativeHandle as
|
|
11
|
-
import { IEditorService as
|
|
12
|
-
var
|
|
13
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
14
|
-
(d = t[
|
|
6
|
+
import { ISidebarService as Ue, useDependency as N, KeyCode as ge, useObservable as G, useConfigValue as at, UI_PLUGIN_CONFIG_KEY as ot } from "@univerjs/ui";
|
|
7
|
+
import { BehaviorSubject as pe, filter as lt, debounceTime as st } from "rxjs";
|
|
8
|
+
import { jsxs as b, jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import { Button as se, clsx as Ce, Tooltip as dt, borderClassName as ut, Dropdown as ct, Select as Ie } from "@univerjs/design";
|
|
10
|
+
import { forwardRef as B, useRef as te, createElement as Z, useState as A, useEffect as de, useMemo as ee, useImperativeHandle as vt } from "react";
|
|
11
|
+
import { IEditorService as mt, BreakLineCommand as ft, RichTextEditor as ht } from "@univerjs/docs-ui";
|
|
12
|
+
var gt = Object.getOwnPropertyDescriptor, pt = (t, e, n, r) => {
|
|
13
|
+
for (var i = r > 1 ? void 0 : r ? gt(e, n) : e, a = t.length - 1, d; a >= 0; a--)
|
|
14
|
+
(d = t[a]) && (i = d(i) || i);
|
|
15
15
|
return i;
|
|
16
|
-
},
|
|
16
|
+
}, be = (t, e) => (n, r) => e(n, r, t);
|
|
17
17
|
let q = class extends Ae {
|
|
18
18
|
constructor(e, n) {
|
|
19
19
|
super();
|
|
20
20
|
z(this, "_panelVisible", !1);
|
|
21
|
-
z(this, "_panelVisible$", new
|
|
21
|
+
z(this, "_panelVisible$", new pe(!1));
|
|
22
22
|
z(this, "_activeCommentId");
|
|
23
|
-
z(this, "_activeCommentId$", new
|
|
23
|
+
z(this, "_activeCommentId$", new pe(void 0));
|
|
24
24
|
z(this, "panelVisible$", this._panelVisible$.asObservable());
|
|
25
25
|
z(this, "activeCommentId$", this._activeCommentId$.asObservable());
|
|
26
26
|
this._sidebarService = e, this._univerInstanceService = n, this._init(), this.disposeWithMe(() => {
|
|
@@ -33,7 +33,7 @@ let q = class extends Ae {
|
|
|
33
33
|
e.visible || this.setPanelVisible(!1);
|
|
34
34
|
})
|
|
35
35
|
), this.disposeWithMe(
|
|
36
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(ce.UNIVER_SHEET).pipe(
|
|
36
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(ce.UNIVER_SHEET).pipe(lt((e) => !e)).subscribe(() => {
|
|
37
37
|
this._sidebarService.close();
|
|
38
38
|
})
|
|
39
39
|
);
|
|
@@ -52,17 +52,17 @@ let q = class extends Ae {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
q = pt([
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
be(0, Se(Ue)),
|
|
56
|
+
be(1, Ve)
|
|
57
57
|
], q);
|
|
58
|
-
const
|
|
58
|
+
const Ct = "thread-comment-panel", It = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
|
|
59
59
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
60
60
|
type: _e.OPERATION,
|
|
61
61
|
handler(t) {
|
|
62
62
|
const e = t.get(Ue), n = t.get(q);
|
|
63
63
|
return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
|
|
64
64
|
header: { title: "threadCommentUI.panel.title" },
|
|
65
|
-
children: { label:
|
|
65
|
+
children: { label: Ct },
|
|
66
66
|
width: 330
|
|
67
67
|
}), n.setPanelVisible(!0)), !0;
|
|
68
68
|
}
|
|
@@ -72,21 +72,21 @@ const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN", It =
|
|
|
72
72
|
handler(t, e) {
|
|
73
73
|
return t.get(q).setActiveComment(e), !0;
|
|
74
74
|
}
|
|
75
|
-
}, xt = "thread-comment-ui.config",
|
|
76
|
-
var
|
|
77
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
78
|
-
(d = t[
|
|
75
|
+
}, xt = "thread-comment-ui.config", xe = {};
|
|
76
|
+
var yt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, _t = (t, e, n) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Nt = (t, e, n, r) => {
|
|
77
|
+
for (var i = r > 1 ? void 0 : r ? St(e, n) : e, a = t.length - 1, d; a >= 0; a--)
|
|
78
|
+
(d = t[a]) && (i = d(i) || i);
|
|
79
79
|
return i;
|
|
80
|
-
}, me = (t, e) => (n, r) => e(n, r, t),
|
|
80
|
+
}, me = (t, e) => (n, r) => e(n, r, t), ke = (t, e, n) => _t(t, typeof e != "symbol" ? e + "" : e, n);
|
|
81
81
|
let ue = class extends ze {
|
|
82
|
-
constructor(t =
|
|
82
|
+
constructor(t = xe, e, n, r) {
|
|
83
83
|
super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r;
|
|
84
|
-
const { menu: i, ...
|
|
84
|
+
const { menu: i, ...a } = Ge(
|
|
85
85
|
{},
|
|
86
|
-
|
|
86
|
+
xe,
|
|
87
87
|
this._config
|
|
88
88
|
);
|
|
89
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(xt,
|
|
89
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(xt, a);
|
|
90
90
|
}
|
|
91
91
|
onStarting() {
|
|
92
92
|
var t;
|
|
@@ -94,14 +94,14 @@ let ue = class extends ze {
|
|
|
94
94
|
[q]
|
|
95
95
|
], (t = this._config) == null ? void 0 : t.overrides).forEach((e) => {
|
|
96
96
|
this._injector.add(e);
|
|
97
|
-
}), [
|
|
97
|
+
}), [bt, K].forEach((e) => {
|
|
98
98
|
this._commandService.registerCommand(e);
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ue =
|
|
102
|
+
ke(ue, "pluginName", It);
|
|
103
|
+
ke(ue, "type", ce.UNIVER_UNKNOWN);
|
|
104
|
+
ue = Nt([
|
|
105
105
|
Be(Xe),
|
|
106
106
|
me(1, Se(We)),
|
|
107
107
|
me(2, ne),
|
|
@@ -115,7 +115,7 @@ var M = function() {
|
|
|
115
115
|
}
|
|
116
116
|
return t;
|
|
117
117
|
}, M.apply(this, arguments);
|
|
118
|
-
},
|
|
118
|
+
}, wt = function(t, e) {
|
|
119
119
|
var n = {};
|
|
120
120
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
121
121
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -123,27 +123,27 @@ var M = function() {
|
|
|
123
123
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
|
|
124
124
|
return n;
|
|
125
125
|
}, Y = B(function(t, e) {
|
|
126
|
-
var n = t.icon, r = t.id, i = t.className,
|
|
127
|
-
return
|
|
126
|
+
var n = t.icon, r = t.id, i = t.className, a = t.extend, d = wt(t, ["icon", "id", "className", "extend"]), f = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), h = te("_".concat(Ot()));
|
|
127
|
+
return Oe(n, "".concat(r), { defIds: n.defIds, idSuffix: h.current }, M({ ref: e, className: f }, d), a);
|
|
128
128
|
});
|
|
129
|
-
function
|
|
130
|
-
return Z(t.tag, M(M({ key: e },
|
|
131
|
-
return
|
|
129
|
+
function Oe(t, e, n, r, i) {
|
|
130
|
+
return Z(t.tag, M(M({ key: e }, Ut(t, n, i)), r), (kt(t, n).children || []).map(function(a, d) {
|
|
131
|
+
return Oe(a, "".concat(e, "-").concat(t.tag, "-").concat(d), n, void 0, i);
|
|
132
132
|
}));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Ut(t, e, n) {
|
|
135
135
|
var r = M({}, t.attrs);
|
|
136
|
-
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(
|
|
137
|
-
var d =
|
|
136
|
+
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(a) {
|
|
137
|
+
var d = a[0], f = a[1];
|
|
138
138
|
d === "mask" && typeof f == "string" && (r[d] = f.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
139
139
|
});
|
|
140
140
|
var i = e.defIds;
|
|
141
|
-
return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(
|
|
142
|
-
var d =
|
|
141
|
+
return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(a) {
|
|
142
|
+
var d = a[0], f = a[1];
|
|
143
143
|
typeof f == "string" && (r[d] = f.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
144
144
|
})), r;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function kt(t, e) {
|
|
147
147
|
var n, r = e.defIds;
|
|
148
148
|
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? M(M({}, t), { children: t.children.map(function(i) {
|
|
149
149
|
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? M(M({}, i), { attrs: M(M({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
@@ -153,51 +153,51 @@ function Ot() {
|
|
|
153
153
|
return Math.random().toString(36).substring(2, 8);
|
|
154
154
|
}
|
|
155
155
|
Y.displayName = "UniverIcon";
|
|
156
|
-
var Tt = { 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" } }] },
|
|
156
|
+
var Tt = { 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" } }] }, Te = B(function(t, e) {
|
|
157
157
|
return Z(Y, Object.assign({}, t, {
|
|
158
158
|
id: "delete-single",
|
|
159
159
|
ref: e,
|
|
160
160
|
icon: Tt
|
|
161
161
|
}));
|
|
162
162
|
});
|
|
163
|
-
|
|
164
|
-
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" } }] },
|
|
163
|
+
Te.displayName = "DeleteSingle";
|
|
164
|
+
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" } }] }, Ee = B(function(t, e) {
|
|
165
165
|
return Z(Y, Object.assign({}, t, {
|
|
166
166
|
id: "increase-single",
|
|
167
167
|
ref: e,
|
|
168
168
|
icon: Et
|
|
169
169
|
}));
|
|
170
170
|
});
|
|
171
|
-
|
|
172
|
-
var
|
|
171
|
+
Ee.displayName = "IncreaseSingle";
|
|
172
|
+
var Dt = { 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" } }] }, De = B(function(t, e) {
|
|
173
173
|
return Z(Y, Object.assign({}, t, {
|
|
174
174
|
id: "more-horizontal-single",
|
|
175
175
|
ref: e,
|
|
176
|
-
icon:
|
|
176
|
+
icon: Dt
|
|
177
177
|
}));
|
|
178
178
|
});
|
|
179
179
|
De.displayName = "MoreHorizontalSingle";
|
|
180
|
-
var
|
|
180
|
+
var $t = { 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 = B(function(t, e) {
|
|
181
181
|
return Z(Y, Object.assign({}, t, {
|
|
182
182
|
id: "reply-to-comment-single",
|
|
183
183
|
ref: e,
|
|
184
|
-
icon:
|
|
184
|
+
icon: $t
|
|
185
185
|
}));
|
|
186
186
|
});
|
|
187
187
|
$e.displayName = "ReplyToCommentSingle";
|
|
188
|
-
var
|
|
188
|
+
var Mt = { 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" } }] }, Me = B(function(t, e) {
|
|
189
189
|
return Z(Y, Object.assign({}, t, {
|
|
190
190
|
id: "resolved-single",
|
|
191
191
|
ref: e,
|
|
192
|
-
icon:
|
|
192
|
+
icon: Mt
|
|
193
193
|
}));
|
|
194
194
|
});
|
|
195
195
|
Me.displayName = "ResolvedSingle";
|
|
196
|
-
var
|
|
196
|
+
var Rt = { 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 } }] }, Re = B(function(t, e) {
|
|
197
197
|
return Z(Y, Object.assign({}, t, {
|
|
198
198
|
id: "solve-single",
|
|
199
199
|
ref: e,
|
|
200
|
-
icon:
|
|
200
|
+
icon: Rt
|
|
201
201
|
}));
|
|
202
202
|
});
|
|
203
203
|
Re.displayName = "SolveSingle";
|
|
@@ -210,33 +210,33 @@ function ye(t) {
|
|
|
210
210
|
}
|
|
211
211
|
const je = B((t, e) => {
|
|
212
212
|
var R;
|
|
213
|
-
const { comment: n, onSave: r, id: i, onCancel:
|
|
214
|
-
var u, m,
|
|
215
|
-
return ve.transform.getPlainText((
|
|
213
|
+
const { comment: n, onSave: r, id: i, onCancel: a, autoFocus: d, unitId: f, type: h } = t, w = N(ne), k = N(fe), [P, O] = A(!1), x = N(mt), c = te(null), v = h === ce.UNIVER_SHEET ? Ze : f, [T, y] = A(() => {
|
|
214
|
+
var u, m, g;
|
|
215
|
+
return ve.transform.getPlainText((g = (m = (u = c.current) == null ? void 0 : u.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? g : "");
|
|
216
216
|
});
|
|
217
217
|
de(() => {
|
|
218
|
-
var m,
|
|
219
|
-
y(ve.transform.getPlainText((S = (
|
|
220
|
-
const u = (
|
|
221
|
-
var
|
|
222
|
-
y(ve.transform.getPlainText((W = (_ = (
|
|
218
|
+
var m, g, S, p;
|
|
219
|
+
y(ve.transform.getPlainText((S = (g = (m = c.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : g.dataStream) != null ? S : ""));
|
|
220
|
+
const u = (p = c.current) == null ? void 0 : p.selectionChange$.subscribe(() => {
|
|
221
|
+
var o, _, W;
|
|
222
|
+
y(ve.transform.getPlainText((W = (_ = (o = c.current) == null ? void 0 : o.getDocumentData().body) == null ? void 0 : _.dataStream) != null ? W : ""));
|
|
223
223
|
});
|
|
224
224
|
return () => u == null ? void 0 : u.unsubscribe();
|
|
225
225
|
}, [(R = c.current) == null ? void 0 : R.selectionChange$]);
|
|
226
226
|
const V = ee(() => ({
|
|
227
|
-
keyCodes: [{ keyCode:
|
|
227
|
+
keyCodes: [{ keyCode: ge.ENTER }],
|
|
228
228
|
handler: (u) => {
|
|
229
|
-
u ===
|
|
230
|
-
|
|
229
|
+
u === ge.ENTER && w.executeCommand(
|
|
230
|
+
ft.id
|
|
231
231
|
);
|
|
232
232
|
}
|
|
233
233
|
}), [w]);
|
|
234
|
-
|
|
234
|
+
vt(e, () => ({
|
|
235
235
|
reply(u) {
|
|
236
|
-
var
|
|
236
|
+
var g, S;
|
|
237
237
|
if (!c.current)
|
|
238
238
|
return;
|
|
239
|
-
|
|
239
|
+
x.focus((g = c.current.getEditorId()) != null ? g : "");
|
|
240
240
|
const m = ye(u);
|
|
241
241
|
(S = c.current) == null || S.setDocumentData(m, [{
|
|
242
242
|
startOffset: m.body.dataStream.length - 2,
|
|
@@ -245,88 +245,88 @@ const je = B((t, e) => {
|
|
|
245
245
|
}]);
|
|
246
246
|
}
|
|
247
247
|
}));
|
|
248
|
-
const
|
|
248
|
+
const C = () => {
|
|
249
249
|
if (c.current) {
|
|
250
250
|
const u = Ye.deepClone(c.current.getDocumentData().body);
|
|
251
|
-
|
|
251
|
+
O(!1), r == null || r({
|
|
252
252
|
...n,
|
|
253
253
|
text: u
|
|
254
254
|
}), c.current.replaceText(""), setTimeout(() => {
|
|
255
|
-
var m,
|
|
256
|
-
(m = c.current) == null || m.setSelectionRanges([]), (
|
|
255
|
+
var m, g;
|
|
256
|
+
(m = c.current) == null || m.setSelectionRanges([]), (g = c.current) == null || g.blur();
|
|
257
257
|
}, 10);
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
260
|
+
return /* @__PURE__ */ b("div", { onClick: (u) => u.preventDefault(), children: [
|
|
261
|
+
/* @__PURE__ */ l(
|
|
262
|
+
ht,
|
|
263
263
|
{
|
|
264
264
|
className: "univer-w-full",
|
|
265
265
|
editorRef: c,
|
|
266
266
|
autoFocus: d,
|
|
267
267
|
keyboardEventConfig: V,
|
|
268
|
-
placeholder:
|
|
268
|
+
placeholder: k.t("threadCommentUI.editor.placeholder"),
|
|
269
269
|
initialValue: (n == null ? void 0 : n.text) && ye(n.text),
|
|
270
|
-
onFocusChange: (u) => u &&
|
|
270
|
+
onFocusChange: (u) => u && O(u),
|
|
271
271
|
isSingle: !1,
|
|
272
272
|
maxHeight: 64,
|
|
273
273
|
onClickOutside: () => {
|
|
274
274
|
setTimeout(() => {
|
|
275
|
-
|
|
275
|
+
x.focus(v);
|
|
276
276
|
}, 30);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
),
|
|
280
|
-
P ? /* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
280
|
+
P ? /* @__PURE__ */ b("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end", children: [
|
|
281
|
+
/* @__PURE__ */ l(
|
|
282
282
|
se,
|
|
283
283
|
{
|
|
284
284
|
style: { marginRight: 12 },
|
|
285
285
|
onClick: () => {
|
|
286
286
|
var u;
|
|
287
|
-
|
|
287
|
+
a == null || a(), O(!1), (u = c.current) == null || u.replaceText("", !0), w.executeCommand(K.id);
|
|
288
288
|
},
|
|
289
|
-
children:
|
|
289
|
+
children: k.t("threadCommentUI.editor.cancel")
|
|
290
290
|
}
|
|
291
291
|
),
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ l(
|
|
293
293
|
se,
|
|
294
294
|
{
|
|
295
295
|
variant: "primary",
|
|
296
|
-
disabled: !
|
|
297
|
-
onClick:
|
|
298
|
-
children:
|
|
296
|
+
disabled: !T,
|
|
297
|
+
onClick: C,
|
|
298
|
+
children: k.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
299
299
|
}
|
|
300
300
|
)
|
|
301
301
|
] }) : null
|
|
302
302
|
] });
|
|
303
|
-
}),
|
|
303
|
+
}), jt = (t) => {
|
|
304
304
|
const { dataStream: e, customRanges: n } = t, r = e.endsWith(`\r
|
|
305
305
|
`) ? e.length - 2 : e.length, i = [];
|
|
306
|
-
let
|
|
306
|
+
let a = 0;
|
|
307
307
|
return n == null || n.forEach((d) => {
|
|
308
|
-
|
|
308
|
+
a < d.startIndex && i.push({
|
|
309
309
|
type: "text",
|
|
310
|
-
content: e.slice(
|
|
310
|
+
content: e.slice(a, d.startIndex)
|
|
311
311
|
}), i.push({
|
|
312
312
|
type: "mention",
|
|
313
313
|
content: {
|
|
314
314
|
label: e.slice(d.startIndex, d.endIndex + 1),
|
|
315
315
|
id: d.rangeId
|
|
316
316
|
}
|
|
317
|
-
}),
|
|
317
|
+
}), a = d.endIndex + 1;
|
|
318
318
|
}), i.push({
|
|
319
319
|
type: "text",
|
|
320
|
-
content: e.slice(
|
|
320
|
+
content: e.slice(a, r)
|
|
321
321
|
}), i;
|
|
322
|
-
},
|
|
322
|
+
}, Ht = (t) => {
|
|
323
323
|
const { paragraphs: e = [] } = t;
|
|
324
324
|
let n = 0;
|
|
325
325
|
return e.map((r) => {
|
|
326
326
|
const i = Je(t, n, r.startIndex);
|
|
327
|
-
return n = r.startIndex + 1,
|
|
327
|
+
return n = r.startIndex + 1, jt(i);
|
|
328
328
|
});
|
|
329
|
-
},
|
|
329
|
+
}, Lt = (t) => {
|
|
330
330
|
let e = "";
|
|
331
331
|
const n = [];
|
|
332
332
|
return t.forEach((r) => {
|
|
@@ -337,12 +337,12 @@ const je = B((t, e) => {
|
|
|
337
337
|
case "mention": {
|
|
338
338
|
const i = e.length;
|
|
339
339
|
e += r.content.label;
|
|
340
|
-
const
|
|
340
|
+
const a = e.length - 1;
|
|
341
341
|
n.push({
|
|
342
342
|
rangeId: r.content.id,
|
|
343
343
|
rangeType: qe.MENTION,
|
|
344
344
|
startIndex: i,
|
|
345
|
-
endIndex:
|
|
345
|
+
endIndex: a,
|
|
346
346
|
properties: {},
|
|
347
347
|
wholeEntity: !0
|
|
348
348
|
});
|
|
@@ -366,9 +366,9 @@ const je = B((t, e) => {
|
|
|
366
366
|
dataStream: e,
|
|
367
367
|
customRanges: n
|
|
368
368
|
};
|
|
369
|
-
}, He = "__mock__",
|
|
370
|
-
const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange:
|
|
371
|
-
(
|
|
369
|
+
}, He = "__mock__", Pt = (t) => {
|
|
370
|
+
const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: a, onReply: d, resolved: f, isRoot: h, onClose: w, onDeleteComment: k, type: P } = t, O = N(ne), x = N(fe), c = N(he), v = c.getUser(e.personId), T = G(c.currentUser$), y = (T == null ? void 0 : T.userID) === e.personId, V = e.id === He, [C, R] = A(!1), u = at(ot), m = u == null ? void 0 : u.avatarFallback, g = () => {
|
|
371
|
+
(k == null ? void 0 : k(e)) !== !1 && (O.executeCommand(
|
|
372
372
|
h ? we.id : it.id,
|
|
373
373
|
{
|
|
374
374
|
unitId: n,
|
|
@@ -377,8 +377,8 @@ const je = B((t, e) => {
|
|
|
377
377
|
}
|
|
378
378
|
), h && (w == null || w()));
|
|
379
379
|
};
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ b("div", { className: "univer-relative univer-mb-3 univer-pl-[30px]", onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
|
|
381
|
+
/* @__PURE__ */ l(
|
|
382
382
|
"div",
|
|
383
383
|
{
|
|
384
384
|
className: `
|
|
@@ -390,10 +390,10 @@ const je = B((t, e) => {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
|
-
v ? /* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
V || f ? null :
|
|
393
|
+
v ? /* @__PURE__ */ b("div", { className: "univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between", children: [
|
|
394
|
+
/* @__PURE__ */ l("div", { className: "univer-text-sm univer-font-medium univer-leading-5", children: (v == null ? void 0 : v.name) || " " }),
|
|
395
|
+
/* @__PURE__ */ b("div", { children: [
|
|
396
|
+
V || f ? null : C && v ? /* @__PURE__ */ l(
|
|
397
397
|
"div",
|
|
398
398
|
{
|
|
399
399
|
className: `
|
|
@@ -403,43 +403,43 @@ const je = B((t, e) => {
|
|
|
403
403
|
hover:univer-bg-gray-50
|
|
404
404
|
`,
|
|
405
405
|
onClick: () => d(v),
|
|
406
|
-
children: /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ l($e, {})
|
|
407
407
|
}
|
|
408
408
|
) : null,
|
|
409
|
-
y && !V && !f ? /* @__PURE__ */
|
|
410
|
-
|
|
409
|
+
y && !V && !f ? /* @__PURE__ */ l(
|
|
410
|
+
ct,
|
|
411
411
|
{
|
|
412
|
-
overlay: /* @__PURE__ */
|
|
412
|
+
overlay: /* @__PURE__ */ l("div", { className: "univer-rounded-lg", children: /* @__PURE__ */ b(
|
|
413
413
|
"ul",
|
|
414
414
|
{
|
|
415
415
|
className: `
|
|
416
416
|
univer-m-0 univer-box-border univer-grid univer-list-none
|
|
417
|
-
univer-p-1.5 univer-text-
|
|
417
|
+
univer-p-1.5 univer-text-sm
|
|
418
418
|
[&_a]:univer-block [&_a]:univer-cursor-pointer
|
|
419
419
|
[&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5
|
|
420
420
|
[&_a]:univer-transition-colors
|
|
421
421
|
`,
|
|
422
422
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
|
|
424
424
|
"a",
|
|
425
425
|
{
|
|
426
426
|
className: "hover:univer-bg-gray-200",
|
|
427
|
-
onClick: () =>
|
|
428
|
-
children:
|
|
427
|
+
onClick: () => a == null ? void 0 : a(!0),
|
|
428
|
+
children: x.t("threadCommentUI.item.edit")
|
|
429
429
|
}
|
|
430
430
|
) }),
|
|
431
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
|
|
432
432
|
"a",
|
|
433
433
|
{
|
|
434
434
|
className: "hover:univer-bg-gray-200",
|
|
435
|
-
onClick:
|
|
436
|
-
children:
|
|
435
|
+
onClick: g,
|
|
436
|
+
children: x.t("threadCommentUI.item.delete")
|
|
437
437
|
}
|
|
438
438
|
) })
|
|
439
439
|
]
|
|
440
440
|
}
|
|
441
441
|
) }),
|
|
442
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ l(
|
|
443
443
|
"div",
|
|
444
444
|
{
|
|
445
445
|
className: `
|
|
@@ -448,26 +448,35 @@ const je = B((t, e) => {
|
|
|
448
448
|
univer-text-base
|
|
449
449
|
hover:univer-bg-gray-50
|
|
450
450
|
`,
|
|
451
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ l(De, {})
|
|
452
452
|
}
|
|
453
453
|
)
|
|
454
454
|
}
|
|
455
455
|
) : null
|
|
456
456
|
] })
|
|
457
457
|
] }) : null,
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
|
|
458
|
+
/* @__PURE__ */ l(
|
|
459
|
+
"time",
|
|
460
|
+
{
|
|
461
|
+
className: `
|
|
462
|
+
univer-mb-1 univer-text-xs/normal univer-text-gray-600
|
|
463
|
+
dark:univer-text-gray-200
|
|
464
|
+
`,
|
|
465
|
+
children: e.dT
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
i ? /* @__PURE__ */ l(
|
|
460
469
|
je,
|
|
461
470
|
{
|
|
462
471
|
type: P,
|
|
463
472
|
id: e.id,
|
|
464
473
|
comment: e,
|
|
465
|
-
onCancel: () =>
|
|
474
|
+
onCancel: () => a == null ? void 0 : a(!1),
|
|
466
475
|
autoFocus: !0,
|
|
467
476
|
unitId: n,
|
|
468
477
|
subUnitId: r,
|
|
469
|
-
onSave: ({ text: S, attachments:
|
|
470
|
-
|
|
478
|
+
onSave: ({ text: S, attachments: p }) => {
|
|
479
|
+
a == null || a(!1), O.executeCommand(
|
|
471
480
|
rt.id,
|
|
472
481
|
{
|
|
473
482
|
unitId: n,
|
|
@@ -475,50 +484,59 @@ const je = B((t, e) => {
|
|
|
475
484
|
payload: {
|
|
476
485
|
commentId: e.id,
|
|
477
486
|
text: S,
|
|
478
|
-
attachments:
|
|
487
|
+
attachments: p
|
|
479
488
|
}
|
|
480
489
|
}
|
|
481
490
|
);
|
|
482
491
|
}
|
|
483
492
|
}
|
|
484
|
-
) : /* @__PURE__ */
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
+
) : /* @__PURE__ */ l(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
className: `
|
|
497
|
+
univer-text-sm univer-text-gray-900
|
|
498
|
+
dark:univer-text-white
|
|
499
|
+
`,
|
|
500
|
+
children: Ht(e.text).map((S, p) => /* @__PURE__ */ l("div", { className: "univer-break-words", children: S.map((o, _) => {
|
|
501
|
+
switch (o.type) {
|
|
502
|
+
case "mention":
|
|
503
|
+
return /* @__PURE__ */ b("a", { className: "univer-text-primary-600", children: [
|
|
504
|
+
o.content.label,
|
|
505
|
+
" "
|
|
506
|
+
] }, _);
|
|
507
|
+
default:
|
|
508
|
+
return o.content;
|
|
509
|
+
}
|
|
510
|
+
}) }, p))
|
|
493
511
|
}
|
|
494
|
-
|
|
512
|
+
)
|
|
495
513
|
] });
|
|
496
|
-
},
|
|
497
|
-
var
|
|
514
|
+
}, Vt = (t) => {
|
|
515
|
+
var le, X, s;
|
|
498
516
|
const {
|
|
499
517
|
id: e,
|
|
500
518
|
unitId: n,
|
|
501
519
|
subUnitId: r,
|
|
502
520
|
refStr: i,
|
|
503
|
-
showEdit:
|
|
521
|
+
showEdit: a = !0,
|
|
504
522
|
onClick: d,
|
|
505
523
|
showHighlight: f,
|
|
506
524
|
onClose: h,
|
|
507
525
|
getSubUnitName: w,
|
|
508
|
-
prefix:
|
|
526
|
+
prefix: k,
|
|
509
527
|
autoFocus: P,
|
|
510
|
-
onMouseEnter:
|
|
511
|
-
onMouseLeave:
|
|
528
|
+
onMouseEnter: O,
|
|
529
|
+
onMouseLeave: x,
|
|
512
530
|
onAddComment: c,
|
|
513
531
|
onDeleteComment: v,
|
|
514
|
-
onResolve:
|
|
532
|
+
onResolve: T,
|
|
515
533
|
type: y,
|
|
516
534
|
style: V,
|
|
517
|
-
full:
|
|
518
|
-
} = t, R = N(Ne), [u, m] = A(!1), [
|
|
519
|
-
G(
|
|
520
|
-
const
|
|
521
|
-
...
|
|
535
|
+
full: C
|
|
536
|
+
} = t, R = N(Ne), [u, m] = A(!1), [g, S] = A(""), p = ee(() => R.commentUpdate$.pipe(st(16)), [R]);
|
|
537
|
+
G(p);
|
|
538
|
+
const o = e ? R.getCommentWithChildren(n, r, e) : null, _ = N(ne), W = N(he), E = o == null ? void 0 : o.root.resolved, D = G(W.currentUser$), H = te(null), J = [
|
|
539
|
+
...o ? [o.root] : (
|
|
522
540
|
// mock empty comment
|
|
523
541
|
[{
|
|
524
542
|
id: He,
|
|
@@ -526,7 +544,7 @@ const je = B((t, e) => {
|
|
|
526
544
|
dataStream: `
|
|
527
545
|
\r`
|
|
528
546
|
},
|
|
529
|
-
personId: (
|
|
547
|
+
personId: (le = D == null ? void 0 : D.userID) != null ? le : "",
|
|
530
548
|
ref: i != null ? i : "",
|
|
531
549
|
dT: "",
|
|
532
550
|
unitId: n,
|
|
@@ -534,9 +552,9 @@ const je = B((t, e) => {
|
|
|
534
552
|
threadId: ""
|
|
535
553
|
}]
|
|
536
554
|
),
|
|
537
|
-
...(X =
|
|
538
|
-
], j = te(null), re = (
|
|
539
|
-
|
|
555
|
+
...(X = o == null ? void 0 : o.children) != null ? X : []
|
|
556
|
+
], j = te(null), re = (I) => {
|
|
557
|
+
I.stopPropagation(), E ? _.executeCommand(K.id, {
|
|
540
558
|
unitId: n,
|
|
541
559
|
subUnitId: r,
|
|
542
560
|
commentId: e
|
|
@@ -544,10 +562,10 @@ const je = B((t, e) => {
|
|
|
544
562
|
unitId: n,
|
|
545
563
|
subUnitId: r,
|
|
546
564
|
commentId: e,
|
|
547
|
-
resolved: !
|
|
548
|
-
}),
|
|
549
|
-
}, Q = (
|
|
550
|
-
|
|
565
|
+
resolved: !E
|
|
566
|
+
}), T == null || T(!E);
|
|
567
|
+
}, Q = (I) => {
|
|
568
|
+
I.stopPropagation(), _.executeCommand(K.id), !(o != null && o.root && (v == null ? void 0 : v(o.root)) === !1) && (_.executeCommand(
|
|
551
569
|
we.id,
|
|
552
570
|
{
|
|
553
571
|
unitId: n,
|
|
@@ -556,32 +574,34 @@ const je = B((t, e) => {
|
|
|
556
574
|
}
|
|
557
575
|
), h == null || h());
|
|
558
576
|
};
|
|
559
|
-
de(() =>
|
|
560
|
-
const ie = w((s =
|
|
561
|
-
return /* @__PURE__ */
|
|
577
|
+
de(() => x == null ? void 0 : x(), []);
|
|
578
|
+
const ie = w((s = o == null ? void 0 : o.root.subUnitId) != null ? s : r), ae = a && !g && !E, oe = `${i || (o == null ? void 0 : o.root.ref) || ""}${ie ? " · " : ""}${ie}`;
|
|
579
|
+
return /* @__PURE__ */ b(
|
|
562
580
|
"div",
|
|
563
581
|
{
|
|
582
|
+
id: `${k}-${n}-${r}-${e}`,
|
|
564
583
|
className: Ce(
|
|
565
584
|
`
|
|
566
|
-
univer-relative univer-box-border univer-rounded-md univer-
|
|
567
|
-
univer-
|
|
585
|
+
univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4
|
|
586
|
+
dark:univer-bg-gray-900 dark:univer-text-white
|
|
568
587
|
`,
|
|
569
|
-
|
|
588
|
+
ut,
|
|
570
589
|
{
|
|
571
|
-
"univer-
|
|
590
|
+
"univer-w-[278px]": !C,
|
|
591
|
+
"univer-w-full": C,
|
|
592
|
+
"univer-shadow": !E && (f || u || k === "cell")
|
|
572
593
|
}
|
|
573
594
|
),
|
|
574
595
|
style: V,
|
|
575
596
|
onClick: d,
|
|
576
|
-
id: `${O}-${n}-${r}-${e}`,
|
|
577
597
|
onMouseEnter: () => {
|
|
578
|
-
|
|
598
|
+
O == null || O(), m(!0);
|
|
579
599
|
},
|
|
580
600
|
onMouseLeave: () => {
|
|
581
|
-
|
|
601
|
+
x == null || x(), m(!1);
|
|
582
602
|
},
|
|
583
603
|
children: [
|
|
584
|
-
!
|
|
604
|
+
!E && f ? /* @__PURE__ */ l(
|
|
585
605
|
"div",
|
|
586
606
|
{
|
|
587
607
|
className: `
|
|
@@ -590,7 +610,7 @@ const je = B((t, e) => {
|
|
|
590
610
|
`
|
|
591
611
|
}
|
|
592
612
|
) : null,
|
|
593
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ b(
|
|
594
614
|
"div",
|
|
595
615
|
{
|
|
596
616
|
className: `
|
|
@@ -598,85 +618,85 @@ const je = B((t, e) => {
|
|
|
598
618
|
univer-leading-5
|
|
599
619
|
`,
|
|
600
620
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ b("div", { className: "univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden", children: [
|
|
622
|
+
/* @__PURE__ */ l(
|
|
603
623
|
"div",
|
|
604
624
|
{
|
|
605
625
|
className: `
|
|
606
626
|
univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0
|
|
607
|
-
univer-rounded-sm univer-bg-yellow-
|
|
627
|
+
univer-rounded-sm univer-bg-yellow-500
|
|
608
628
|
`
|
|
609
629
|
}
|
|
610
630
|
),
|
|
611
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ l(dt, { showIfEllipsis: !0, title: oe, children: /* @__PURE__ */ l(
|
|
612
632
|
"div",
|
|
613
633
|
{
|
|
614
|
-
className:
|
|
615
|
-
|
|
616
|
-
`,
|
|
617
|
-
children: le
|
|
634
|
+
className: "univer-flex-1 univer-truncate",
|
|
635
|
+
children: oe
|
|
618
636
|
}
|
|
619
637
|
) })
|
|
620
638
|
] }),
|
|
621
|
-
|
|
622
|
-
/* @__PURE__ */
|
|
639
|
+
o ? /* @__PURE__ */ b("div", { className: "univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row", children: [
|
|
640
|
+
/* @__PURE__ */ l(
|
|
623
641
|
"div",
|
|
624
642
|
{
|
|
625
|
-
onClick: re,
|
|
626
643
|
className: Ce(
|
|
627
644
|
`
|
|
628
645
|
univer-ml-1 univer-inline-flex univer-h-6 univer-w-6 univer-cursor-pointer
|
|
629
646
|
univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base
|
|
647
|
+
dark:hover:univer-bg-gray-800
|
|
630
648
|
hover:univer-bg-gray-50
|
|
631
649
|
`,
|
|
632
650
|
{
|
|
633
|
-
"univer-text-green-500":
|
|
651
|
+
"univer-text-green-500": E
|
|
634
652
|
}
|
|
635
653
|
),
|
|
636
|
-
|
|
654
|
+
onClick: re,
|
|
655
|
+
children: E ? /* @__PURE__ */ l(Me, {}) : /* @__PURE__ */ l(Re, {})
|
|
637
656
|
}
|
|
638
657
|
),
|
|
639
|
-
(D == null ? void 0 : D.userID) ===
|
|
658
|
+
(D == null ? void 0 : D.userID) === o.root.personId ? /* @__PURE__ */ l(
|
|
640
659
|
"div",
|
|
641
660
|
{
|
|
642
661
|
className: `
|
|
643
662
|
univer-ml-1 univer-inline-flex univer-h-6 univer-w-6 univer-cursor-pointer
|
|
644
663
|
univer-items-center univer-justify-center univer-rounded-[3px]
|
|
645
664
|
univer-text-base
|
|
665
|
+
dark:hover:univer-bg-gray-800
|
|
646
666
|
hover:univer-bg-gray-50
|
|
647
667
|
`,
|
|
648
668
|
onClick: Q,
|
|
649
|
-
children: /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ l(Te, {})
|
|
650
670
|
}
|
|
651
671
|
) : null
|
|
652
672
|
] }) : null
|
|
653
673
|
]
|
|
654
674
|
}
|
|
655
675
|
),
|
|
656
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ l(
|
|
657
677
|
"div",
|
|
658
678
|
{
|
|
659
679
|
ref: j,
|
|
660
|
-
className: "univer-max-h-
|
|
680
|
+
className: "univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden",
|
|
661
681
|
children: J.map(
|
|
662
|
-
(
|
|
663
|
-
|
|
682
|
+
(I) => /* @__PURE__ */ l(
|
|
683
|
+
Pt,
|
|
664
684
|
{
|
|
665
685
|
onClose: h,
|
|
666
686
|
unitId: n,
|
|
667
687
|
subUnitId: r,
|
|
668
|
-
item:
|
|
669
|
-
isRoot:
|
|
670
|
-
editing:
|
|
671
|
-
resolved:
|
|
688
|
+
item: I,
|
|
689
|
+
isRoot: I.id === (o == null ? void 0 : o.root.id),
|
|
690
|
+
editing: g === I.id,
|
|
691
|
+
resolved: o == null ? void 0 : o.root.resolved,
|
|
672
692
|
type: y,
|
|
673
693
|
onEditingChange: ($) => {
|
|
674
|
-
S($ ?
|
|
694
|
+
S($ ? I.id : "");
|
|
675
695
|
},
|
|
676
696
|
onReply: ($) => {
|
|
677
697
|
$ && requestAnimationFrame(() => {
|
|
678
698
|
var L;
|
|
679
|
-
(L = H.current) == null || L.reply(
|
|
699
|
+
(L = H.current) == null || L.reply(Lt([
|
|
680
700
|
{
|
|
681
701
|
type: "mention",
|
|
682
702
|
content: {
|
|
@@ -694,30 +714,30 @@ const je = B((t, e) => {
|
|
|
694
714
|
onAddComment: c,
|
|
695
715
|
onDeleteComment: v
|
|
696
716
|
},
|
|
697
|
-
|
|
717
|
+
I.id
|
|
698
718
|
)
|
|
699
719
|
)
|
|
700
720
|
}
|
|
701
721
|
),
|
|
702
|
-
|
|
722
|
+
ae ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
703
723
|
je,
|
|
704
724
|
{
|
|
705
725
|
ref: H,
|
|
706
726
|
type: y,
|
|
707
727
|
unitId: n,
|
|
708
728
|
subUnitId: r,
|
|
709
|
-
onSave: async ({ text:
|
|
729
|
+
onSave: async ({ text: I, attachments: $ }) => {
|
|
710
730
|
const L = {
|
|
711
|
-
text:
|
|
731
|
+
text: I,
|
|
712
732
|
attachments: $,
|
|
713
733
|
dT: et(),
|
|
714
734
|
id: Qe(),
|
|
715
735
|
ref: i,
|
|
716
736
|
personId: D == null ? void 0 : D.userID,
|
|
717
|
-
parentId:
|
|
737
|
+
parentId: o == null ? void 0 : o.root.id,
|
|
718
738
|
unitId: n,
|
|
719
739
|
subUnitId: r,
|
|
720
|
-
threadId:
|
|
740
|
+
threadId: o == null ? void 0 : o.root.threadId
|
|
721
741
|
};
|
|
722
742
|
(c == null ? void 0 : c(L)) !== !1 && (await _.executeCommand(
|
|
723
743
|
tt.id,
|
|
@@ -728,9 +748,9 @@ const je = B((t, e) => {
|
|
|
728
748
|
}
|
|
729
749
|
), j.current && (j.current.scrollTop = j.current.scrollHeight));
|
|
730
750
|
},
|
|
731
|
-
autoFocus: P || !
|
|
751
|
+
autoFocus: P || !o,
|
|
732
752
|
onCancel: () => {
|
|
733
|
-
|
|
753
|
+
o || h == null || h();
|
|
734
754
|
}
|
|
735
755
|
},
|
|
736
756
|
`${P}`
|
|
@@ -738,25 +758,25 @@ const je = B((t, e) => {
|
|
|
738
758
|
]
|
|
739
759
|
}
|
|
740
760
|
);
|
|
741
|
-
},
|
|
761
|
+
}, qt = (t) => {
|
|
742
762
|
const {
|
|
743
763
|
unitId: e,
|
|
744
764
|
subUnitId$: n,
|
|
745
765
|
type: r,
|
|
746
766
|
onAdd: i,
|
|
747
|
-
getSubUnitName:
|
|
767
|
+
getSubUnitName: a,
|
|
748
768
|
onResolve: d,
|
|
749
769
|
sortComments: f,
|
|
750
770
|
onItemLeave: h,
|
|
751
771
|
onItemEnter: w,
|
|
752
|
-
disableAdd:
|
|
772
|
+
disableAdd: k,
|
|
753
773
|
tempComment: P,
|
|
754
|
-
onAddComment:
|
|
755
|
-
onDeleteComment:
|
|
774
|
+
onAddComment: O,
|
|
775
|
+
onDeleteComment: x,
|
|
756
776
|
showComments: c
|
|
757
|
-
} = t, [v,
|
|
777
|
+
} = t, [v, T] = A("all"), [y, V] = A("all"), C = N(fe), R = N(he), u = N(Ne), [m, g] = A(() => u.getUnit(e)), S = N(q), p = G(S.activeCommentId$), o = G(u.commentUpdate$), _ = N(ne), W = G(n), E = te(!0), D = "panel", H = G(R.currentUser$), J = ee(() => {
|
|
758
778
|
var L;
|
|
759
|
-
const s = v === "all" ? m : (L = m.filter((U) => U.subUnitId === W)) != null ? L : [],
|
|
779
|
+
const s = v === "all" ? m : (L = m.filter((U) => U.subUnitId === W)) != null ? L : [], I = f != null ? f : (U) => U, $ = s.map((U) => {
|
|
760
780
|
var F;
|
|
761
781
|
return { ...U.root, children: (F = U.children) != null ? F : [], users: U.relativeUsers };
|
|
762
782
|
});
|
|
@@ -766,43 +786,43 @@ const je = B((t, e) => {
|
|
|
766
786
|
U.set(F.id, F);
|
|
767
787
|
}), [...c, ""].map((F) => U.get(F)).filter(Boolean);
|
|
768
788
|
} else
|
|
769
|
-
return
|
|
789
|
+
return I($);
|
|
770
790
|
}, [c, v, m, f, W]), j = ee(() => [
|
|
771
791
|
...J.filter((s) => !s.resolved),
|
|
772
792
|
...J.filter((s) => s.resolved)
|
|
773
|
-
], [J]), re = ee(() => y === "resolved" ? j.filter((s) => s.resolved) : y === "unsolved" ? j.filter((s) => !s.resolved) : y === "concern_me" && H != null && H.userID ? j.filter((s) => s == null ? void 0 : s.users.has(H.userID)) : j, [j, H == null ? void 0 : H.userID, y]), Q = P ? [P, ...re] : re, ie = Q.filter((s) => !s.resolved),
|
|
774
|
-
V("all"),
|
|
793
|
+
], [J]), re = ee(() => y === "resolved" ? j.filter((s) => s.resolved) : y === "unsolved" ? j.filter((s) => !s.resolved) : y === "concern_me" && H != null && H.userID ? j.filter((s) => s == null ? void 0 : s.users.has(H.userID)) : j, [j, H == null ? void 0 : H.userID, y]), Q = P ? [P, ...re] : re, ie = Q.filter((s) => !s.resolved), ae = Q.filter((s) => s.resolved), oe = y !== "all" || v !== "all", le = () => {
|
|
794
|
+
V("all"), T("all");
|
|
775
795
|
};
|
|
776
796
|
de(() => {
|
|
777
|
-
e &&
|
|
797
|
+
e && g(
|
|
778
798
|
u.getUnit(e)
|
|
779
799
|
);
|
|
780
|
-
}, [e, u,
|
|
800
|
+
}, [e, u, o]), de(() => {
|
|
781
801
|
var U;
|
|
782
|
-
if (!
|
|
802
|
+
if (!p)
|
|
783
803
|
return;
|
|
784
|
-
if (!
|
|
785
|
-
|
|
804
|
+
if (!E.current) {
|
|
805
|
+
E.current = !0;
|
|
786
806
|
return;
|
|
787
807
|
}
|
|
788
|
-
const { unitId: s, subUnitId:
|
|
808
|
+
const { unitId: s, subUnitId: I, commentId: $ } = p, L = `${D}-${s}-${I}-${$}`;
|
|
789
809
|
(U = document.getElementById(L)) == null || U.scrollIntoView({ block: "center" });
|
|
790
|
-
}, [
|
|
791
|
-
const X = (s) => /* @__PURE__ */
|
|
792
|
-
|
|
810
|
+
}, [p]);
|
|
811
|
+
const X = (s) => /* @__PURE__ */ l(
|
|
812
|
+
Vt,
|
|
793
813
|
{
|
|
794
814
|
full: !0,
|
|
795
815
|
prefix: D,
|
|
796
|
-
getSubUnitName:
|
|
816
|
+
getSubUnitName: a,
|
|
797
817
|
id: s.id,
|
|
798
818
|
unitId: s.unitId,
|
|
799
819
|
subUnitId: s.subUnitId,
|
|
800
820
|
refStr: s.ref,
|
|
801
821
|
type: r,
|
|
802
|
-
showEdit: (
|
|
803
|
-
showHighlight: (
|
|
822
|
+
showEdit: (p == null ? void 0 : p.commentId) === s.id,
|
|
823
|
+
showHighlight: (p == null ? void 0 : p.commentId) === s.id,
|
|
804
824
|
onClick: () => {
|
|
805
|
-
|
|
825
|
+
E.current = !1, s.resolved ? _.executeCommand(K.id) : _.executeCommand(
|
|
806
826
|
K.id,
|
|
807
827
|
{
|
|
808
828
|
unitId: s.unitId,
|
|
@@ -814,15 +834,15 @@ const je = B((t, e) => {
|
|
|
814
834
|
},
|
|
815
835
|
onMouseEnter: () => w == null ? void 0 : w(s),
|
|
816
836
|
onMouseLeave: () => h == null ? void 0 : h(s),
|
|
817
|
-
onAddComment:
|
|
818
|
-
onDeleteComment:
|
|
819
|
-
onResolve: (
|
|
837
|
+
onAddComment: O,
|
|
838
|
+
onDeleteComment: x,
|
|
839
|
+
onResolve: (I) => d == null ? void 0 : d(s.id, I)
|
|
820
840
|
},
|
|
821
841
|
s.id
|
|
822
842
|
);
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
r === ce.UNIVER_SHEET ? /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ b("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
|
|
844
|
+
/* @__PURE__ */ b("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
|
|
845
|
+
r === ce.UNIVER_SHEET ? /* @__PURE__ */ l(
|
|
826
846
|
Ie,
|
|
827
847
|
{
|
|
828
848
|
borderless: !0,
|
|
@@ -830,17 +850,17 @@ const je = B((t, e) => {
|
|
|
830
850
|
options: [
|
|
831
851
|
{
|
|
832
852
|
value: "current",
|
|
833
|
-
label:
|
|
853
|
+
label: C.t("threadCommentUI.filter.sheet.current")
|
|
834
854
|
},
|
|
835
855
|
{
|
|
836
856
|
value: "all",
|
|
837
|
-
label:
|
|
857
|
+
label: C.t("threadCommentUI.filter.sheet.all")
|
|
838
858
|
}
|
|
839
859
|
],
|
|
840
|
-
onChange:
|
|
860
|
+
onChange: T
|
|
841
861
|
}
|
|
842
862
|
) : null,
|
|
843
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ l(
|
|
844
864
|
Ie,
|
|
845
865
|
{
|
|
846
866
|
borderless: !0,
|
|
@@ -848,53 +868,54 @@ const je = B((t, e) => {
|
|
|
848
868
|
options: [
|
|
849
869
|
{
|
|
850
870
|
value: "all",
|
|
851
|
-
label:
|
|
871
|
+
label: C.t("threadCommentUI.filter.status.all")
|
|
852
872
|
},
|
|
853
873
|
{
|
|
854
874
|
value: "resolved",
|
|
855
|
-
label:
|
|
875
|
+
label: C.t("threadCommentUI.filter.status.resolved")
|
|
856
876
|
},
|
|
857
877
|
{
|
|
858
878
|
value: "unsolved",
|
|
859
|
-
label:
|
|
879
|
+
label: C.t("threadCommentUI.filter.status.unsolved")
|
|
860
880
|
},
|
|
861
881
|
{
|
|
862
882
|
value: "concern_me",
|
|
863
|
-
label:
|
|
883
|
+
label: C.t("threadCommentUI.filter.status.concernMe")
|
|
864
884
|
}
|
|
865
885
|
],
|
|
866
886
|
onChange: V
|
|
867
887
|
}
|
|
868
888
|
)
|
|
869
889
|
] }),
|
|
870
|
-
Q.length === 0 ? /* @__PURE__ */
|
|
890
|
+
Q.length === 0 ? /* @__PURE__ */ b(
|
|
871
891
|
"div",
|
|
872
892
|
{
|
|
873
893
|
className: `
|
|
874
894
|
univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center
|
|
875
|
-
univer-text-
|
|
895
|
+
univer-text-sm univer-text-gray-600
|
|
896
|
+
dark:univer-text-gray-200
|
|
876
897
|
`,
|
|
877
898
|
children: [
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
|
|
899
|
+
C.t("threadCommentUI.panel.empty"),
|
|
900
|
+
oe ? /* @__PURE__ */ l("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ l(se, { onClick: le, children: C.t("threadCommentUI.panel.reset") }) }) : k ? null : /* @__PURE__ */ l("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ b(se, { onClick: i, children: [
|
|
901
|
+
/* @__PURE__ */ l(Ee, { className: "univer-mr-1.5" }),
|
|
902
|
+
C.t("threadCommentUI.panel.add")
|
|
882
903
|
] }) })
|
|
883
904
|
]
|
|
884
905
|
}
|
|
885
|
-
) : /* @__PURE__ */
|
|
906
|
+
) : /* @__PURE__ */ b("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
|
|
886
907
|
ie.map(X),
|
|
887
|
-
|
|
888
|
-
|
|
908
|
+
ae.length > 0 && /* @__PURE__ */ l("div", { className: "univer-text-xs", children: C.t("threadCommentUI.panel.solved") }),
|
|
909
|
+
ae.map(X)
|
|
889
910
|
] })
|
|
890
911
|
] });
|
|
891
912
|
};
|
|
892
913
|
export {
|
|
893
914
|
K as SetActiveCommentOperation,
|
|
894
|
-
|
|
895
|
-
|
|
915
|
+
Ct as THREAD_COMMENT_PANEL,
|
|
916
|
+
qt as ThreadCommentPanel,
|
|
896
917
|
q as ThreadCommentPanelService,
|
|
897
|
-
|
|
898
|
-
|
|
918
|
+
Vt as ThreadCommentTree,
|
|
919
|
+
bt as ToggleSheetCommentPanelOperation,
|
|
899
920
|
ue as UniverThreadCommentUIPlugin
|
|
900
921
|
};
|