@univerjs/thread-comment-ui 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/cjs/index.js +66 -95
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/index.js +67 -96
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/index.css +15 -80
- package/lib/index.js +67 -96
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/umd/index.js +3 -10
- package/package.json +14 -14
package/lib/cjs/locale/zh-TW.js
CHANGED
package/lib/es/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import { BehaviorSubject, debounceTime, map, of, startWith } from "rxjs";
|
|
|
4
4
|
import { BreakLineCommand, DeleteLeftCommand, DeleteRightCommand, IEditorService, RichTextEditor, UniverDocsUIPlugin } from "@univerjs/docs-ui";
|
|
5
5
|
import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, ResolveCommentCommand, ThreadCommentModel, UniverThreadCommentPlugin, UpdateCommentCommand, getDT } from "@univerjs/thread-comment";
|
|
6
6
|
import { BaseObject, DEFAULT_FONTFACE_PLANE } from "@univerjs/engine-render";
|
|
7
|
-
import { ActionRow, Button, Dropdown, MobileActionRowGroup, MobileDropdown, Select, Tooltip, borderClassName, clsx,
|
|
7
|
+
import { ActionRow, Button, Dropdown, MobileActionRowGroup, MobileDropdown, Segmented, Select, Tooltip, borderClassName, clsx, scrollbarClassName } from "@univerjs/design";
|
|
8
8
|
import { DeleteIcon, IncreaseIcon, MoreHorizontalIcon, MoreLeftIcon, ReplyToCommentIcon, SuccessIcon, SuccessOutlineIcon } from "@univerjs/icons";
|
|
9
9
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
13
13
|
function _typeof(o) {
|
|
14
14
|
"@babel/helpers - typeof";
|
|
15
15
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -19,28 +19,25 @@ function _typeof(o) {
|
|
|
19
19
|
}, _typeof(o);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function toPrimitive(t, r) {
|
|
22
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
23
|
+
function toPrimitive(t, e) {
|
|
25
24
|
if ("object" != _typeof(t) || !t) return t;
|
|
26
|
-
var
|
|
27
|
-
if (void 0 !==
|
|
28
|
-
var i =
|
|
25
|
+
var r;
|
|
26
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
27
|
+
var i = r.call(t, e || "default");
|
|
29
28
|
if ("object" != _typeof(i)) return i;
|
|
30
29
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
31
30
|
}
|
|
32
|
-
return ("string" ===
|
|
31
|
+
return ("string" === e ? String : Number)(t);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
34
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
37
35
|
function toPropertyKey(t) {
|
|
38
36
|
var i = toPrimitive(t, "string");
|
|
39
37
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
40
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
44
41
|
function _defineProperty(e, r, t) {
|
|
45
42
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
46
43
|
value: t,
|
|
@@ -50,16 +47,14 @@ function _defineProperty(e, r, t) {
|
|
|
50
47
|
}) : e[r] = t, e;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
50
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
55
51
|
function __decorateParam(paramIndex, decorator) {
|
|
56
52
|
return function(target, key) {
|
|
57
53
|
decorator(target, key, paramIndex);
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
57
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
63
58
|
function __decorate(decorators, target, key, desc) {
|
|
64
59
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
65
60
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -67,8 +62,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
67
62
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
68
63
|
}
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
//#region src/services/thread-comment-panel.service.ts
|
|
65
|
+
// src/services/thread-comment-panel.service.ts
|
|
72
66
|
let ThreadCommentPanelService = class ThreadCommentPanelService extends Disposable {
|
|
73
67
|
constructor(_sidebarService) {
|
|
74
68
|
super();
|
|
@@ -119,8 +113,7 @@ let ThreadCommentPanelService = class ThreadCommentPanelService extends Disposab
|
|
|
119
113
|
};
|
|
120
114
|
ThreadCommentPanelService = __decorate([__decorateParam(0, Inject(ISidebarService))], ThreadCommentPanelService);
|
|
121
115
|
|
|
122
|
-
|
|
123
|
-
//#region src/commands/operations/comment.operations.ts
|
|
116
|
+
// src/commands/operations/comment.operations.ts
|
|
124
117
|
const SetActiveCommentOperation = {
|
|
125
118
|
id: "thread-comment-ui.operation.set-active-comment",
|
|
126
119
|
type: CommandType.OPERATION,
|
|
@@ -130,19 +123,16 @@ const SetActiveCommentOperation = {
|
|
|
130
123
|
}
|
|
131
124
|
};
|
|
132
125
|
|
|
133
|
-
|
|
134
|
-
//#region package.json
|
|
126
|
+
// package.json
|
|
135
127
|
var name = "@univerjs/thread-comment-ui";
|
|
136
|
-
var version = "1.
|
|
128
|
+
var version = "1.5.0";
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
//#region src/config/config.ts
|
|
130
|
+
// src/config/config.ts
|
|
140
131
|
const THREAD_COMMENT_UI_PLUGIN_CONFIG_KEY = "thread-comment-ui.config";
|
|
141
132
|
const configSymbol = Symbol(THREAD_COMMENT_UI_PLUGIN_CONFIG_KEY);
|
|
142
133
|
const defaultPluginConfig = {};
|
|
143
134
|
|
|
144
|
-
|
|
145
|
-
//#region src/services/thread-comment-draft.service.ts
|
|
135
|
+
// src/services/thread-comment-draft.service.ts
|
|
146
136
|
let ThreadCommentDraftService = class ThreadCommentDraftService extends Disposable {
|
|
147
137
|
constructor(instanceService, _userManagerService) {
|
|
148
138
|
super();
|
|
@@ -207,8 +197,7 @@ let ThreadCommentDraftService = class ThreadCommentDraftService extends Disposab
|
|
|
207
197
|
};
|
|
208
198
|
ThreadCommentDraftService = __decorate([__decorateParam(0, IUniverInstanceService), __decorateParam(1, Inject(UserManagerService))], ThreadCommentDraftService);
|
|
209
199
|
|
|
210
|
-
|
|
211
|
-
//#region src/types/const.ts
|
|
200
|
+
// src/types/const.ts
|
|
212
201
|
/**
|
|
213
202
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
214
203
|
*
|
|
@@ -226,8 +215,7 @@ ThreadCommentDraftService = __decorate([__decorateParam(0, IUniverInstanceServic
|
|
|
226
215
|
*/
|
|
227
216
|
const PLUGIN_NAME = "UNIVER_THREAD_COMMENT_UI_PLUGIN";
|
|
228
217
|
|
|
229
|
-
|
|
230
|
-
//#region src/mobile-plugin.ts
|
|
218
|
+
// src/mobile-plugin.ts
|
|
231
219
|
let UniverThreadCommentMobileUIPlugin = class UniverThreadCommentMobileUIPlugin extends Plugin {
|
|
232
220
|
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
233
221
|
super();
|
|
@@ -258,8 +246,7 @@ UniverThreadCommentMobileUIPlugin = __decorate([
|
|
|
258
246
|
__decorateParam(3, IConfigService)
|
|
259
247
|
], UniverThreadCommentMobileUIPlugin);
|
|
260
248
|
|
|
261
|
-
|
|
262
|
-
//#region src/plugin.ts
|
|
249
|
+
// src/plugin.ts
|
|
263
250
|
let UniverThreadCommentUIPlugin = class UniverThreadCommentUIPlugin extends Plugin {
|
|
264
251
|
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
265
252
|
super();
|
|
@@ -292,8 +279,7 @@ UniverThreadCommentUIPlugin = __decorate([
|
|
|
292
279
|
__decorateParam(3, IConfigService)
|
|
293
280
|
], UniverThreadCommentUIPlugin);
|
|
294
281
|
|
|
295
|
-
|
|
296
|
-
//#region src/render-objects/thread-comment-canvas-overlay.ts
|
|
282
|
+
// src/render-objects/thread-comment-canvas-overlay.ts
|
|
297
283
|
const MARKER_SIZE = 24;
|
|
298
284
|
const MARKER_IDLE_OPACITY = .58;
|
|
299
285
|
const MARKER_PREVIEW_OPACITY = .42;
|
|
@@ -452,8 +438,7 @@ var ThreadCommentCanvasOverlay = class extends BaseObject {
|
|
|
452
438
|
}
|
|
453
439
|
};
|
|
454
440
|
|
|
455
|
-
|
|
456
|
-
//#region src/views/thread-comment-panel/util.ts
|
|
441
|
+
// src/views/thread-comment-panel/util.ts
|
|
457
442
|
function isSameThreadCommentTarget(active, comment) {
|
|
458
443
|
return (active === null || active === void 0 ? void 0 : active.unitId) === comment.unitId && active.subUnitId === comment.subUnitId && active.commentId === comment.id;
|
|
459
444
|
}
|
|
@@ -475,8 +460,7 @@ function getThreadCommentPanelItemKey(comment, index, section) {
|
|
|
475
460
|
].join("-");
|
|
476
461
|
}
|
|
477
462
|
|
|
478
|
-
|
|
479
|
-
//#region src/views/thread-comment-editor/util.ts
|
|
463
|
+
// src/views/thread-comment-editor/util.ts
|
|
480
464
|
const transformDocument2TextNodesInParagraph = (doc) => {
|
|
481
465
|
const { dataStream, customRanges } = doc;
|
|
482
466
|
const end = dataStream.endsWith("\r\n") ? dataStream.length - 2 : dataStream.length;
|
|
@@ -576,15 +560,13 @@ function focusThreadCommentEditor(editorService, editorId, editor) {
|
|
|
576
560
|
editor === null || editor === void 0 || editor.focus();
|
|
577
561
|
}
|
|
578
562
|
|
|
579
|
-
|
|
580
|
-
//#region src/views/thread-comment-tree/util.ts
|
|
563
|
+
// src/views/thread-comment-tree/util.ts
|
|
581
564
|
function getThreadCommentEditorId(params) {
|
|
582
565
|
const { location, unitId, subUnitId, commentId, fallbackId } = params;
|
|
583
566
|
return `${DOCS_COMMENT_EDITOR_UNIT_ID_KEY}_${location}_${unitId}_${subUnitId}_${commentId || fallbackId}`;
|
|
584
567
|
}
|
|
585
568
|
|
|
586
|
-
|
|
587
|
-
//#region src/views/ThreadCommentEditor.tsx
|
|
569
|
+
// src/views/ThreadCommentEditor.tsx
|
|
588
570
|
function getSnapshot(body) {
|
|
589
571
|
return {
|
|
590
572
|
id: "d",
|
|
@@ -751,27 +733,13 @@ const ThreadCommentEditor = forwardRef((props, ref) => {
|
|
|
751
733
|
});
|
|
752
734
|
});
|
|
753
735
|
|
|
754
|
-
|
|
755
|
-
//#region src/views/ThreadCommentTree.tsx
|
|
736
|
+
// src/views/ThreadCommentTree.tsx
|
|
756
737
|
let ThreadCommentTreeLocation = /* @__PURE__ */ function(ThreadCommentTreeLocation) {
|
|
757
738
|
ThreadCommentTreeLocation["CELL"] = "CELL";
|
|
758
739
|
ThreadCommentTreeLocation["PANEL"] = "PANEL";
|
|
759
740
|
return ThreadCommentTreeLocation;
|
|
760
741
|
}({});
|
|
761
742
|
const MOCK_ID = "__mock__";
|
|
762
|
-
function formatCommentDateTime(value, region) {
|
|
763
|
-
const date = dateKit(value);
|
|
764
|
-
const regionTag = LOCALE_META[region].tag;
|
|
765
|
-
return date.formatIntl(regionTag, {
|
|
766
|
-
year: "numeric",
|
|
767
|
-
month: "numeric",
|
|
768
|
-
day: "numeric",
|
|
769
|
-
hour: "2-digit",
|
|
770
|
-
minute: "2-digit",
|
|
771
|
-
hour12: false,
|
|
772
|
-
numberingSystem: "latn"
|
|
773
|
-
});
|
|
774
|
-
}
|
|
775
743
|
const ThreadCommentItem = (props) => {
|
|
776
744
|
const { item, unitId, subUnitId, editing, onEditingChange, onReply, resolved, isRoot, onClose, onDeleteComment, onAfterDeleteComment, type, threadCommentEditorId, DropdownComponent, EditorComponent } = props;
|
|
777
745
|
const commandService = useDependency(ICommandService);
|
|
@@ -788,6 +756,19 @@ const ThreadCommentItem = (props) => {
|
|
|
788
756
|
const avatarFallback = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.avatarFallback;
|
|
789
757
|
const currentRegion = useObservable(regionService.currentRegion$, regionService.getCurrentRegion());
|
|
790
758
|
const direction = useObservable(localeService.direction$, localeService.getDirection());
|
|
759
|
+
function formatCommentDateTime(value, region) {
|
|
760
|
+
const date = dateKit(value);
|
|
761
|
+
const regionTag = LOCALE_META[region].tag;
|
|
762
|
+
return date.formatIntl(regionTag, {
|
|
763
|
+
year: "numeric",
|
|
764
|
+
month: "numeric",
|
|
765
|
+
day: "numeric",
|
|
766
|
+
hour: "2-digit",
|
|
767
|
+
minute: "2-digit",
|
|
768
|
+
hour12: false,
|
|
769
|
+
numberingSystem: "latn"
|
|
770
|
+
});
|
|
771
|
+
}
|
|
791
772
|
const dateText = isMock ? null : formatCommentDateTime(item.dT, currentRegion);
|
|
792
773
|
const handleDeleteItem = async () => {
|
|
793
774
|
if ((onDeleteComment === null || onDeleteComment === void 0 ? void 0 : onDeleteComment(item)) === false) return;
|
|
@@ -821,7 +802,7 @@ const ThreadCommentItem = (props) => {
|
|
|
821
802
|
}), /* @__PURE__ */ jsxs("div", { children: [isMock || resolved ? null : showReply && user ? /* @__PURE__ */ jsx("button", {
|
|
822
803
|
type: "button",
|
|
823
804
|
"aria-label": localeService.t("thread-comment-ui.editor.reply"),
|
|
824
|
-
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-border-0 univer-bg-transparent univer-p-0 univer-text-base hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
805
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-border-0 univer-bg-transparent univer-p-0 univer-text-base univer-text-inherit hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
825
806
|
onClick: () => onReply(user),
|
|
826
807
|
children: /* @__PURE__ */ jsx(ReplyToCommentIcon, {})
|
|
827
808
|
}) : null, isCommentBySelf && !isMock && !resolved ? /* @__PURE__ */ jsx(DropdownComponent, {
|
|
@@ -829,15 +810,15 @@ const ThreadCommentItem = (props) => {
|
|
|
829
810
|
dir: direction,
|
|
830
811
|
className: "univer-rounded-lg",
|
|
831
812
|
children: /* @__PURE__ */ jsxs("ul", {
|
|
832
|
-
className: "univer-m-0 univer-box-border univer-grid univer-list-none univer-p-1.5 univer-text-sm rtl:univer-text-right [&_button]:univer-block [&_button]:univer-w-full [&_button]:univer-cursor-pointer [&_button]:univer-rounded [&_button]:univer-border-0 [&_button]:univer-bg-transparent [&_button]:univer-px-2 [&_button]:univer-py-1.5 [&_button]:univer-text-left [&_button]:univer-transition-colors rtl:[&_button]:univer-text-right",
|
|
813
|
+
className: "univer-m-0 univer-box-border univer-grid univer-list-none univer-p-1.5 univer-text-sm rtl:univer-text-right [&_button]:univer-block [&_button]:univer-w-full [&_button]:univer-cursor-pointer [&_button]:univer-rounded [&_button]:univer-border-0 [&_button]:univer-bg-transparent [&_button]:univer-px-2 [&_button]:univer-py-1.5 [&_button]:univer-text-left [&_button]:univer-text-inherit [&_button]:univer-transition-colors rtl:[&_button]:univer-text-right",
|
|
833
814
|
children: [/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
|
|
834
815
|
type: "button",
|
|
835
|
-
className: "hover:univer-bg-gray-
|
|
816
|
+
className: "hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
|
|
836
817
|
onClick: () => onEditingChange === null || onEditingChange === void 0 ? void 0 : onEditingChange(true),
|
|
837
818
|
children: localeService.t("thread-comment-ui.item.edit")
|
|
838
819
|
}) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
|
|
839
820
|
type: "button",
|
|
840
|
-
className: "hover:univer-bg-gray-
|
|
821
|
+
className: "hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
|
|
841
822
|
onClick: handleDeleteItem,
|
|
842
823
|
children: localeService.t("thread-comment-ui.item.delete")
|
|
843
824
|
}) })]
|
|
@@ -846,7 +827,7 @@ const ThreadCommentItem = (props) => {
|
|
|
846
827
|
children: /* @__PURE__ */ jsx("button", {
|
|
847
828
|
type: "button",
|
|
848
829
|
"aria-label": localeService.t("thread-comment-ui.item.more"),
|
|
849
|
-
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-border-0 univer-bg-transparent univer-p-0 univer-text-base hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
830
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-border-0 univer-bg-transparent univer-p-0 univer-text-base univer-text-inherit hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
850
831
|
children: /* @__PURE__ */ jsx(MoreHorizontalIcon, {})
|
|
851
832
|
})
|
|
852
833
|
}) : null] })]
|
|
@@ -1042,7 +1023,7 @@ const ThreadCommentTree = (props) => {
|
|
|
1042
1023
|
children: /* @__PURE__ */ jsx("button", {
|
|
1043
1024
|
type: "button",
|
|
1044
1025
|
"aria-label": resolveLabel,
|
|
1045
|
-
className: clsx("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-border-0 univer-bg-transparent univer-p-0 univer-text-base hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800", { "univer-text-green-500": resolved }),
|
|
1026
|
+
className: clsx("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-border-0 univer-bg-transparent univer-p-0 univer-text-base univer-text-inherit hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800", { "univer-text-green-500": resolved }),
|
|
1046
1027
|
onClick: handleResolve,
|
|
1047
1028
|
children: resolved ? /* @__PURE__ */ jsx(SuccessIcon, {}) : /* @__PURE__ */ jsx(SuccessOutlineIcon, {})
|
|
1048
1029
|
})
|
|
@@ -1051,7 +1032,7 @@ const ThreadCommentTree = (props) => {
|
|
|
1051
1032
|
children: /* @__PURE__ */ jsx("button", {
|
|
1052
1033
|
type: "button",
|
|
1053
1034
|
"aria-label": deleteLabel,
|
|
1054
|
-
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-border-0 univer-bg-transparent univer-p-0 univer-text-base hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
1035
|
+
className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-border-0 univer-bg-transparent univer-p-0 univer-text-base univer-text-inherit hover:univer-bg-gray-50 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-800",
|
|
1055
1036
|
onClick: handleDeleteRoot,
|
|
1056
1037
|
children: /* @__PURE__ */ jsx(DeleteIcon, {})
|
|
1057
1038
|
})
|
|
@@ -1138,16 +1119,14 @@ const ThreadCommentTree = (props) => {
|
|
|
1138
1119
|
});
|
|
1139
1120
|
};
|
|
1140
1121
|
|
|
1141
|
-
|
|
1142
|
-
//#region src/views/mobile/MobileThreadCommentEditor.tsx
|
|
1122
|
+
// src/views/mobile/MobileThreadCommentEditor.tsx
|
|
1143
1123
|
const MobileThreadCommentEditor = forwardRef((props, ref) => /* @__PURE__ */ jsx(ThreadCommentEditor, {
|
|
1144
1124
|
...props,
|
|
1145
1125
|
ref,
|
|
1146
1126
|
ActionRowComponent: MobileActionRowGroup
|
|
1147
1127
|
}));
|
|
1148
1128
|
|
|
1149
|
-
|
|
1150
|
-
//#region src/views/mobile/MobileThreadCommentTree.tsx
|
|
1129
|
+
// src/views/mobile/MobileThreadCommentTree.tsx
|
|
1151
1130
|
function MobileThreadCommentTree(props) {
|
|
1152
1131
|
return /* @__PURE__ */ jsx(ThreadCommentTree, {
|
|
1153
1132
|
...props,
|
|
@@ -1156,18 +1135,17 @@ function MobileThreadCommentTree(props) {
|
|
|
1156
1135
|
});
|
|
1157
1136
|
}
|
|
1158
1137
|
|
|
1159
|
-
|
|
1160
|
-
//#region src/views/mobile/MobileThreadCommentPanel.tsx
|
|
1138
|
+
// src/views/mobile/MobileThreadCommentPanel.tsx
|
|
1161
1139
|
function MobileCommentFilter({ value, options = [], onChange }) {
|
|
1162
|
-
return /* @__PURE__ */ jsx(
|
|
1163
|
-
className: "univer-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1140
|
+
return /* @__PURE__ */ jsx(Segmented, {
|
|
1141
|
+
className: "univer-w-full",
|
|
1142
|
+
value,
|
|
1143
|
+
items: options.flatMap((option) => option.options ?? [option]).filter((option) => option.value != null).map((option) => ({
|
|
1144
|
+
label: option.label,
|
|
1145
|
+
value: option.value,
|
|
1146
|
+
disabled: option.disabled
|
|
1147
|
+
})),
|
|
1148
|
+
onChange
|
|
1171
1149
|
});
|
|
1172
1150
|
}
|
|
1173
1151
|
function MobileCommentHeader({ comment: activeComment, displayRef }) {
|
|
@@ -1175,17 +1153,10 @@ function MobileCommentHeader({ comment: activeComment, displayRef }) {
|
|
|
1175
1153
|
const commandService = useDependency(ICommandService);
|
|
1176
1154
|
return /* @__PURE__ */ jsxs("div", {
|
|
1177
1155
|
className: "univer-mt-2 univer-flex univer-min-h-12 univer-items-center univer-gap-2 univer-border-0 univer-border-b univer-border-solid univer-border-gray-200 univer-pb-2 dark:!univer-border-gray-700",
|
|
1178
|
-
children: [/* @__PURE__ */ jsx(
|
|
1179
|
-
|
|
1156
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
1157
|
+
size: "icon",
|
|
1158
|
+
variant: "text",
|
|
1180
1159
|
"aria-label": localeService.t("thread-comment-ui.mobile.back"),
|
|
1181
|
-
className: `
|
|
1182
|
-
${resetButtonClassName}
|
|
1183
|
-
univer-flex univer-size-12 univer-shrink-0 univer-items-center univer-justify-center univer-rounded-xl
|
|
1184
|
-
univer-text-2xl univer-text-gray-700
|
|
1185
|
-
active:univer-bg-gray-100
|
|
1186
|
-
dark:!univer-text-gray-200
|
|
1187
|
-
dark:active:!univer-bg-gray-700
|
|
1188
|
-
`,
|
|
1189
1160
|
onClick: () => commandService.executeCommand(SetActiveCommentOperation.id),
|
|
1190
1161
|
children: /* @__PURE__ */ jsx(MoreLeftIcon, {})
|
|
1191
1162
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -1207,6 +1178,7 @@ function MobileAddComment({ onAdd }) {
|
|
|
1207
1178
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
1208
1179
|
className: "univer-w-full",
|
|
1209
1180
|
onClick: onAdd,
|
|
1181
|
+
size: "middle",
|
|
1210
1182
|
children: [/* @__PURE__ */ jsx(IncreaseIcon, { className: "univer-mr-1.5" }), localeService.t("thread-comment-ui.panel.addComment")]
|
|
1211
1183
|
})
|
|
1212
1184
|
});
|
|
@@ -1383,7 +1355,7 @@ function MobileThreadCommentPanel(props) {
|
|
|
1383
1355
|
onClose: !comment.id ? onTempCommentClose : void 0
|
|
1384
1356
|
}, getThreadCommentPanelItemKey(comment, index, section));
|
|
1385
1357
|
return /* @__PURE__ */ jsxs("div", {
|
|
1386
|
-
className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3",
|
|
1358
|
+
className: "univer-box-border univer-flex univer-min-h-full univer-flex-col univer-pb-3",
|
|
1387
1359
|
children: [
|
|
1388
1360
|
activeComment && /* @__PURE__ */ jsx(MobileCommentHeader, {
|
|
1389
1361
|
comment: activeComment,
|
|
@@ -1408,6 +1380,7 @@ function MobileThreadCommentPanel(props) {
|
|
|
1408
1380
|
className: "univer-mt-2 univer-flex univer-flex-row",
|
|
1409
1381
|
children: /* @__PURE__ */ jsx(Button, {
|
|
1410
1382
|
onClick: handleReset,
|
|
1383
|
+
size: "middle",
|
|
1411
1384
|
children: localeService.t("thread-comment-ui.panel.reset")
|
|
1412
1385
|
})
|
|
1413
1386
|
}) : null]
|
|
@@ -1426,8 +1399,7 @@ function MobileThreadCommentPanel(props) {
|
|
|
1426
1399
|
});
|
|
1427
1400
|
}
|
|
1428
1401
|
|
|
1429
|
-
|
|
1430
|
-
//#region src/views/ThreadCommentPanel.tsx
|
|
1402
|
+
// src/views/ThreadCommentPanel.tsx
|
|
1431
1403
|
const ThreadCommentPanel = (props) => {
|
|
1432
1404
|
const { unitId, subUnitId$, type, onAdd, getSubUnitName, onResolve, sortComments, onItemLeave, onItemEnter, disableAdd, tempComment, onAddComment, onDeleteComment, onAfterDeleteComment, showComments, formatRef, onTempCommentClose, autoFocusActiveComment = false } = props;
|
|
1433
1405
|
const [unit, setUnit] = useState("all");
|
|
@@ -1579,7 +1551,7 @@ const ThreadCommentPanel = (props) => {
|
|
|
1579
1551
|
onClose: !comment.id ? onTempCommentClose : void 0
|
|
1580
1552
|
}, getThreadCommentPanelItemKey(comment, index, section));
|
|
1581
1553
|
return /* @__PURE__ */ jsxs("div", {
|
|
1582
|
-
className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3",
|
|
1554
|
+
className: "univer-box-border univer-flex univer-min-h-full univer-flex-col univer-pb-3",
|
|
1583
1555
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1584
1556
|
className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between",
|
|
1585
1557
|
children: [type === UniverInstanceType.UNIVER_SHEET ? /* @__PURE__ */ jsx(Select, {
|
|
@@ -1645,5 +1617,4 @@ const ThreadCommentPanel = (props) => {
|
|
|
1645
1617
|
});
|
|
1646
1618
|
};
|
|
1647
1619
|
|
|
1648
|
-
//#endregion
|
|
1649
1620
|
export { MobileThreadCommentPanel, MobileThreadCommentTree, SetActiveCommentOperation, ThreadCommentCanvasOverlay, ThreadCommentDraftService, ThreadCommentPanel, ThreadCommentPanelService, ThreadCommentTree, ThreadCommentTreeLocation, UniverThreadCommentMobileUIPlugin, UniverThreadCommentUIPlugin };
|
package/lib/es/locale/ar-SA.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ar-SA.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "رجوع" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/ca-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ca-ES.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Enrere" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/de-DE.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/de-DE.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Zurück" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/en-US.js
CHANGED
package/lib/es/locale/es-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/es-ES.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Atrás" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/fa-IR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fa-IR.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "بازگشت" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/fr-FR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Retour" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/id-ID.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/id-ID.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Kembali" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/it-IT.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/it-IT.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Indietro" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/ja-JP.js
CHANGED
package/lib/es/locale/ko-KR.js
CHANGED
package/lib/es/locale/pl-PL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pl-PL.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Wstecz" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/pt-BR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pt-BR.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Voltar" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/ru-RU.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Назад" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/sk-SK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/sk-SK.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Späť" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/vi-VN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/vi-VN.ts
|
|
2
2
|
const locale = { "thread-comment-ui": {
|
|
3
3
|
mobile: { back: "Quay lại" },
|
|
4
4
|
panel: {
|
|
@@ -35,5 +35,4 @@ const locale = { "thread-comment-ui": {
|
|
|
35
35
|
}
|
|
36
36
|
} };
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { locale as default };
|
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-HK.js
CHANGED