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