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