@univerjs/docs-thread-comment-ui 0.24.0 → 0.25.0-insiders.20260604-29ebbff
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 +16 -42
- package/lib/cjs/locale/ar-SA.js +9 -0
- package/lib/cjs/locale/ca-ES.js +9 -0
- package/lib/cjs/locale/de-DE.js +9 -0
- package/lib/cjs/locale/en-US.js +24 -0
- package/lib/cjs/locale/es-ES.js +9 -0
- package/lib/cjs/locale/fa-IR.js +9 -0
- package/lib/cjs/locale/fr-FR.js +9 -0
- package/lib/cjs/locale/id-ID.js +9 -0
- package/lib/cjs/locale/it-IT.js +9 -0
- package/lib/cjs/locale/ja-JP.js +9 -0
- package/lib/cjs/locale/ko-KR.js +9 -0
- package/lib/cjs/locale/pl-PL.js +9 -0
- package/lib/cjs/locale/pt-BR.js +9 -0
- package/lib/cjs/locale/ru-RU.js +9 -0
- package/lib/cjs/locale/sk-SK.js +9 -0
- package/lib/cjs/locale/vi-VN.js +9 -0
- package/lib/cjs/locale/zh-CN.js +9 -0
- package/lib/cjs/locale/zh-HK.js +9 -0
- package/lib/cjs/locale/zh-TW.js +9 -0
- package/lib/es/index.js +16 -42
- package/lib/es/locale/ar-SA.js +8 -0
- package/lib/es/locale/ca-ES.js +8 -0
- package/lib/es/locale/de-DE.js +8 -0
- package/lib/es/locale/en-US.js +23 -0
- package/lib/es/locale/es-ES.js +8 -0
- package/lib/es/locale/fa-IR.js +8 -0
- package/lib/es/locale/fr-FR.js +8 -0
- package/lib/es/locale/id-ID.js +8 -0
- package/lib/es/locale/it-IT.js +8 -0
- package/lib/es/locale/ja-JP.js +8 -0
- package/lib/es/locale/ko-KR.js +8 -0
- package/lib/es/locale/pl-PL.js +8 -0
- package/lib/es/locale/pt-BR.js +8 -0
- package/lib/es/locale/ru-RU.js +8 -0
- package/lib/es/locale/sk-SK.js +8 -0
- package/lib/es/locale/vi-VN.js +8 -0
- package/lib/es/locale/zh-CN.js +8 -0
- package/lib/es/locale/zh-HK.js +8 -0
- package/lib/es/locale/zh-TW.js +8 -0
- package/lib/index.js +16 -42
- package/lib/locale/ar-SA.js +8 -0
- package/lib/locale/ca-ES.js +8 -0
- package/lib/locale/de-DE.js +8 -0
- package/lib/locale/en-US.js +23 -0
- package/lib/locale/es-ES.js +8 -0
- package/lib/locale/fa-IR.js +8 -0
- package/lib/locale/fr-FR.js +8 -0
- package/lib/locale/id-ID.js +8 -0
- package/lib/locale/it-IT.js +8 -0
- package/lib/locale/ja-JP.js +8 -0
- package/lib/locale/ko-KR.js +8 -0
- package/lib/locale/pl-PL.js +8 -0
- package/lib/locale/pt-BR.js +8 -0
- package/lib/locale/ru-RU.js +8 -0
- package/lib/locale/sk-SK.js +8 -0
- package/lib/locale/vi-VN.js +8 -0
- package/lib/locale/zh-CN.js +8 -0
- package/lib/locale/zh-HK.js +8 -0
- package/lib/locale/zh-TW.js +8 -0
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/ca-ES.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +24 -0
- package/lib/types/locale/es-ES.d.ts +18 -0
- package/lib/types/locale/fa-IR.d.ts +18 -0
- package/lib/types/locale/fr-FR.d.ts +18 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/ja-JP.d.ts +18 -0
- package/lib/types/locale/ko-KR.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/ru-RU.d.ts +18 -0
- package/lib/types/locale/sk-SK.d.ts +18 -0
- package/lib/types/locale/vi-VN.d.ts +18 -0
- package/lib/types/locale/zh-CN.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/locale/zh-TW.d.ts +18 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +16 -11
- package/LICENSE +0 -176
package/lib/cjs/index.js
CHANGED
|
@@ -88,7 +88,7 @@ const DeleteDocCommentComment = {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region \0@oxc-project+runtime@0.
|
|
91
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
92
92
|
function _typeof(o) {
|
|
93
93
|
"@babel/helpers - typeof";
|
|
94
94
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -99,7 +99,7 @@ function _typeof(o) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
//#endregion
|
|
102
|
-
//#region \0@oxc-project+runtime@0.
|
|
102
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
103
103
|
function toPrimitive(t, r) {
|
|
104
104
|
if ("object" != _typeof(t) || !t) return t;
|
|
105
105
|
var e = t[Symbol.toPrimitive];
|
|
@@ -112,14 +112,14 @@ function toPrimitive(t, r) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
//#endregion
|
|
115
|
-
//#region \0@oxc-project+runtime@0.
|
|
115
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
116
116
|
function toPropertyKey(t) {
|
|
117
117
|
var i = toPrimitive(t, "string");
|
|
118
118
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
//#endregion
|
|
122
|
-
//#region \0@oxc-project+runtime@0.
|
|
122
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
123
123
|
function _defineProperty(e, r, t) {
|
|
124
124
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
125
125
|
value: t,
|
|
@@ -130,7 +130,7 @@ function _defineProperty(e, r, t) {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
//#endregion
|
|
133
|
-
//#region \0@oxc-project+runtime@0.
|
|
133
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
|
|
134
134
|
function __decorateParam(paramIndex, decorator) {
|
|
135
135
|
return function(target, key) {
|
|
136
136
|
decorator(target, key, paramIndex);
|
|
@@ -138,7 +138,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
//#endregion
|
|
141
|
-
//#region \0@oxc-project+runtime@0.
|
|
141
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
142
142
|
function __decorate(decorators, target, key, desc) {
|
|
143
143
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
144
144
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -182,7 +182,7 @@ const ShowCommentPanelOperation = {
|
|
|
182
182
|
const sidebarService = accessor.get(_univerjs_ui.ISidebarService);
|
|
183
183
|
if (!panelService.panelVisible || ((_sidebarService$optio = sidebarService.options.children) === null || _sidebarService$optio === void 0 ? void 0 : _sidebarService$optio.label) !== "univer.doc.thread-comment-panel") {
|
|
184
184
|
sidebarService.open({
|
|
185
|
-
header: { title: "
|
|
185
|
+
header: { title: "docs-thread-comment-ui.panel.title" },
|
|
186
186
|
children: { label: DOCS_THREAD_COMMENT_PANEL },
|
|
187
187
|
width: 320,
|
|
188
188
|
onClose: () => panelService.setPanelVisible(false)
|
|
@@ -202,7 +202,7 @@ const ToggleCommentPanelOperation = {
|
|
|
202
202
|
const sidebarService = accessor.get(_univerjs_ui.ISidebarService);
|
|
203
203
|
if (!panelService.panelVisible || ((_sidebarService$optio2 = sidebarService.options.children) === null || _sidebarService$optio2 === void 0 ? void 0 : _sidebarService$optio2.label) !== "univer.doc.thread-comment-panel") {
|
|
204
204
|
sidebarService.open({
|
|
205
|
-
header: { title: "
|
|
205
|
+
header: { title: "docs-thread-comment-ui.panel.title" },
|
|
206
206
|
children: { label: DOCS_THREAD_COMMENT_PANEL },
|
|
207
207
|
width: 320,
|
|
208
208
|
onClose: () => panelService.setPanelVisible(false)
|
|
@@ -273,7 +273,7 @@ const StartAddCommentOperation = {
|
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region package.json
|
|
275
275
|
var name = "@univerjs/docs-thread-comment-ui";
|
|
276
|
-
var version = "0.
|
|
276
|
+
var version = "0.25.0-insiders.20260604-29ebbff";
|
|
277
277
|
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region src/config/config.ts
|
|
@@ -326,6 +326,9 @@ let DocThreadCommentSelectionController = class DocThreadCommentSelectionControl
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
if (!this._threadCommentPanelService.activeCommentId) return;
|
|
329
|
+
const addingComment = this._docThreadCommentService.addingComment;
|
|
330
|
+
const activeComment = this._threadCommentPanelService.activeCommentId;
|
|
331
|
+
if (addingComment && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.unitId) === addingComment.unitId && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.subUnitId) === "default_doc" && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.commentId) === addingComment.id) return;
|
|
329
332
|
this._commandService.executeCommand(_univerjs_thread_comment_ui.SetActiveCommentOperation.id);
|
|
330
333
|
}
|
|
331
334
|
}));
|
|
@@ -377,8 +380,8 @@ function AddDocCommentMenuItemFactory(accessor) {
|
|
|
377
380
|
id: StartAddCommentOperation.id,
|
|
378
381
|
type: _univerjs_ui.MenuItemType.BUTTON,
|
|
379
382
|
icon: "CommentIcon",
|
|
380
|
-
title: "
|
|
381
|
-
tooltip: "
|
|
383
|
+
title: "docs-thread-comment-ui.panel.addComment",
|
|
384
|
+
tooltip: "docs-thread-comment-ui.panel.addComment",
|
|
382
385
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_DOC, void 0, _univerjs_core.SHEET_EDITOR_UNITS),
|
|
383
386
|
disabled$: new rxjs.Observable(function(subscribe) {
|
|
384
387
|
const observer = accessor.get(_univerjs_docs.DocSelectionManagerService).textSelection$.pipe((0, rxjs.debounceTime)(16)).subscribe(() => {
|
|
@@ -395,8 +398,8 @@ function ToolbarDocCommentMenuItemFactory(accessor) {
|
|
|
395
398
|
id: ToggleCommentPanelOperation.id,
|
|
396
399
|
type: _univerjs_ui.MenuItemType.BUTTON,
|
|
397
400
|
icon: "CommentIcon",
|
|
398
|
-
title: "
|
|
399
|
-
tooltip: "
|
|
401
|
+
title: "docs-thread-comment-ui.panel.addComment",
|
|
402
|
+
tooltip: "docs-thread-comment-ui.panel.addComment",
|
|
400
403
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_DOC)
|
|
401
404
|
};
|
|
402
405
|
}
|
|
@@ -601,18 +604,6 @@ let DocThreadCommentRenderController = class DocThreadCommentRenderController ex
|
|
|
601
604
|
const unitId = this._context.unit.getUnitId();
|
|
602
605
|
const subUnitId = DEFAULT_DOC_SUBUNIT_ID;
|
|
603
606
|
const threadIds = (_this$_context$unit$g = (_this$_context$unit$g2 = this._context.unit.getBody()) === null || _this$_context$unit$g2 === void 0 || (_this$_context$unit$g2 = _this$_context$unit$g2.customDecorations) === null || _this$_context$unit$g2 === void 0 ? void 0 : _this$_context$unit$g2.filter((i) => i.type === _univerjs_core.CustomDecorationType.COMMENT).map((i) => i.id)) !== null && _this$_context$unit$g !== void 0 ? _this$_context$unit$g : [];
|
|
604
|
-
threadIds.forEach((id) => {
|
|
605
|
-
if (!this._threadCommentModel.getComment(unitId, subUnitId, id)) this._threadCommentModel.addComment(unitId, subUnitId, {
|
|
606
|
-
id,
|
|
607
|
-
threadId: id,
|
|
608
|
-
ref: "",
|
|
609
|
-
dT: "",
|
|
610
|
-
personId: "",
|
|
611
|
-
text: { dataStream: "" },
|
|
612
|
-
unitId,
|
|
613
|
-
subUnitId
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
607
|
threadIds.length && this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(), "default_doc", threadIds);
|
|
617
608
|
let prevThreadIds = threadIds.sort();
|
|
618
609
|
this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {
|
|
@@ -623,28 +614,11 @@ let DocThreadCommentRenderController = class DocThreadCommentRenderController ex
|
|
|
623
614
|
const currentThreadIdsSorted = currentThreadIds.sort();
|
|
624
615
|
if (JSON.stringify(prevThreadIds) !== JSON.stringify(currentThreadIdsSorted)) {
|
|
625
616
|
const preIds = new Set(prevThreadIds);
|
|
626
|
-
const currentIds = new Set(currentThreadIdsSorted);
|
|
627
617
|
const addIds = /* @__PURE__ */ new Set();
|
|
628
|
-
const deleteIds = /* @__PURE__ */ new Set();
|
|
629
618
|
currentThreadIds.forEach((id) => {
|
|
630
619
|
if (!preIds.has(id)) addIds.add(id);
|
|
631
620
|
});
|
|
632
|
-
prevThreadIds.forEach((id) => {
|
|
633
|
-
if (!currentIds.has(id)) deleteIds.add(id);
|
|
634
|
-
});
|
|
635
621
|
prevThreadIds = currentThreadIdsSorted;
|
|
636
|
-
addIds.forEach((id) => {
|
|
637
|
-
if (!this._threadCommentModel.getComment(unitId, subUnitId, id)) this._threadCommentModel.addComment(unitId, subUnitId, {
|
|
638
|
-
id,
|
|
639
|
-
threadId: id,
|
|
640
|
-
ref: "",
|
|
641
|
-
dT: "",
|
|
642
|
-
personId: "",
|
|
643
|
-
text: { dataStream: "" },
|
|
644
|
-
unitId,
|
|
645
|
-
subUnitId
|
|
646
|
-
});
|
|
647
|
-
});
|
|
648
622
|
this._threadCommentModel.syncThreadComments(unitId, subUnitId, [...addIds]);
|
|
649
623
|
}
|
|
650
624
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/locale/en-US.ts
|
|
3
|
+
/**
|
|
4
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
const locale = { "docs-thread-comment-ui": { panel: {
|
|
19
|
+
title: "Comment Management",
|
|
20
|
+
addComment: "Add Comment"
|
|
21
|
+
} } };
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
module.exports = locale;
|
package/lib/es/index.js
CHANGED
|
@@ -87,7 +87,7 @@ const DeleteDocCommentComment = {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
//#endregion
|
|
90
|
-
//#region \0@oxc-project+runtime@0.
|
|
90
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
91
91
|
function _typeof(o) {
|
|
92
92
|
"@babel/helpers - typeof";
|
|
93
93
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -98,7 +98,7 @@ function _typeof(o) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region \0@oxc-project+runtime@0.
|
|
101
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
102
102
|
function toPrimitive(t, r) {
|
|
103
103
|
if ("object" != _typeof(t) || !t) return t;
|
|
104
104
|
var e = t[Symbol.toPrimitive];
|
|
@@ -111,14 +111,14 @@ function toPrimitive(t, r) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
//#endregion
|
|
114
|
-
//#region \0@oxc-project+runtime@0.
|
|
114
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
115
115
|
function toPropertyKey(t) {
|
|
116
116
|
var i = toPrimitive(t, "string");
|
|
117
117
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region \0@oxc-project+runtime@0.
|
|
121
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
122
122
|
function _defineProperty(e, r, t) {
|
|
123
123
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
124
124
|
value: t,
|
|
@@ -129,7 +129,7 @@ function _defineProperty(e, r, t) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
//#endregion
|
|
132
|
-
//#region \0@oxc-project+runtime@0.
|
|
132
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
|
|
133
133
|
function __decorateParam(paramIndex, decorator) {
|
|
134
134
|
return function(target, key) {
|
|
135
135
|
decorator(target, key, paramIndex);
|
|
@@ -137,7 +137,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
//#endregion
|
|
140
|
-
//#region \0@oxc-project+runtime@0.
|
|
140
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
141
141
|
function __decorate(decorators, target, key, desc) {
|
|
142
142
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
143
143
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -181,7 +181,7 @@ const ShowCommentPanelOperation = {
|
|
|
181
181
|
const sidebarService = accessor.get(ISidebarService);
|
|
182
182
|
if (!panelService.panelVisible || ((_sidebarService$optio = sidebarService.options.children) === null || _sidebarService$optio === void 0 ? void 0 : _sidebarService$optio.label) !== "univer.doc.thread-comment-panel") {
|
|
183
183
|
sidebarService.open({
|
|
184
|
-
header: { title: "
|
|
184
|
+
header: { title: "docs-thread-comment-ui.panel.title" },
|
|
185
185
|
children: { label: DOCS_THREAD_COMMENT_PANEL },
|
|
186
186
|
width: 320,
|
|
187
187
|
onClose: () => panelService.setPanelVisible(false)
|
|
@@ -201,7 +201,7 @@ const ToggleCommentPanelOperation = {
|
|
|
201
201
|
const sidebarService = accessor.get(ISidebarService);
|
|
202
202
|
if (!panelService.panelVisible || ((_sidebarService$optio2 = sidebarService.options.children) === null || _sidebarService$optio2 === void 0 ? void 0 : _sidebarService$optio2.label) !== "univer.doc.thread-comment-panel") {
|
|
203
203
|
sidebarService.open({
|
|
204
|
-
header: { title: "
|
|
204
|
+
header: { title: "docs-thread-comment-ui.panel.title" },
|
|
205
205
|
children: { label: DOCS_THREAD_COMMENT_PANEL },
|
|
206
206
|
width: 320,
|
|
207
207
|
onClose: () => panelService.setPanelVisible(false)
|
|
@@ -272,7 +272,7 @@ const StartAddCommentOperation = {
|
|
|
272
272
|
//#endregion
|
|
273
273
|
//#region package.json
|
|
274
274
|
var name = "@univerjs/docs-thread-comment-ui";
|
|
275
|
-
var version = "0.
|
|
275
|
+
var version = "0.25.0-insiders.20260604-29ebbff";
|
|
276
276
|
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/config/config.ts
|
|
@@ -325,6 +325,9 @@ let DocThreadCommentSelectionController = class DocThreadCommentSelectionControl
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
if (!this._threadCommentPanelService.activeCommentId) return;
|
|
328
|
+
const addingComment = this._docThreadCommentService.addingComment;
|
|
329
|
+
const activeComment = this._threadCommentPanelService.activeCommentId;
|
|
330
|
+
if (addingComment && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.unitId) === addingComment.unitId && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.subUnitId) === "default_doc" && (activeComment === null || activeComment === void 0 ? void 0 : activeComment.commentId) === addingComment.id) return;
|
|
328
331
|
this._commandService.executeCommand(SetActiveCommentOperation.id);
|
|
329
332
|
}
|
|
330
333
|
}));
|
|
@@ -376,8 +379,8 @@ function AddDocCommentMenuItemFactory(accessor) {
|
|
|
376
379
|
id: StartAddCommentOperation.id,
|
|
377
380
|
type: MenuItemType.BUTTON,
|
|
378
381
|
icon: "CommentIcon",
|
|
379
|
-
title: "
|
|
380
|
-
tooltip: "
|
|
382
|
+
title: "docs-thread-comment-ui.panel.addComment",
|
|
383
|
+
tooltip: "docs-thread-comment-ui.panel.addComment",
|
|
381
384
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC, void 0, SHEET_EDITOR_UNITS),
|
|
382
385
|
disabled$: new Observable(function(subscribe) {
|
|
383
386
|
const observer = accessor.get(DocSelectionManagerService).textSelection$.pipe(debounceTime(16)).subscribe(() => {
|
|
@@ -394,8 +397,8 @@ function ToolbarDocCommentMenuItemFactory(accessor) {
|
|
|
394
397
|
id: ToggleCommentPanelOperation.id,
|
|
395
398
|
type: MenuItemType.BUTTON,
|
|
396
399
|
icon: "CommentIcon",
|
|
397
|
-
title: "
|
|
398
|
-
tooltip: "
|
|
400
|
+
title: "docs-thread-comment-ui.panel.addComment",
|
|
401
|
+
tooltip: "docs-thread-comment-ui.panel.addComment",
|
|
399
402
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC)
|
|
400
403
|
};
|
|
401
404
|
}
|
|
@@ -600,18 +603,6 @@ let DocThreadCommentRenderController = class DocThreadCommentRenderController ex
|
|
|
600
603
|
const unitId = this._context.unit.getUnitId();
|
|
601
604
|
const subUnitId = DEFAULT_DOC_SUBUNIT_ID;
|
|
602
605
|
const threadIds = (_this$_context$unit$g = (_this$_context$unit$g2 = this._context.unit.getBody()) === null || _this$_context$unit$g2 === void 0 || (_this$_context$unit$g2 = _this$_context$unit$g2.customDecorations) === null || _this$_context$unit$g2 === void 0 ? void 0 : _this$_context$unit$g2.filter((i) => i.type === CustomDecorationType.COMMENT).map((i) => i.id)) !== null && _this$_context$unit$g !== void 0 ? _this$_context$unit$g : [];
|
|
603
|
-
threadIds.forEach((id) => {
|
|
604
|
-
if (!this._threadCommentModel.getComment(unitId, subUnitId, id)) this._threadCommentModel.addComment(unitId, subUnitId, {
|
|
605
|
-
id,
|
|
606
|
-
threadId: id,
|
|
607
|
-
ref: "",
|
|
608
|
-
dT: "",
|
|
609
|
-
personId: "",
|
|
610
|
-
text: { dataStream: "" },
|
|
611
|
-
unitId,
|
|
612
|
-
subUnitId
|
|
613
|
-
});
|
|
614
|
-
});
|
|
615
606
|
threadIds.length && this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(), "default_doc", threadIds);
|
|
616
607
|
let prevThreadIds = threadIds.sort();
|
|
617
608
|
this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {
|
|
@@ -622,28 +613,11 @@ let DocThreadCommentRenderController = class DocThreadCommentRenderController ex
|
|
|
622
613
|
const currentThreadIdsSorted = currentThreadIds.sort();
|
|
623
614
|
if (JSON.stringify(prevThreadIds) !== JSON.stringify(currentThreadIdsSorted)) {
|
|
624
615
|
const preIds = new Set(prevThreadIds);
|
|
625
|
-
const currentIds = new Set(currentThreadIdsSorted);
|
|
626
616
|
const addIds = /* @__PURE__ */ new Set();
|
|
627
|
-
const deleteIds = /* @__PURE__ */ new Set();
|
|
628
617
|
currentThreadIds.forEach((id) => {
|
|
629
618
|
if (!preIds.has(id)) addIds.add(id);
|
|
630
619
|
});
|
|
631
|
-
prevThreadIds.forEach((id) => {
|
|
632
|
-
if (!currentIds.has(id)) deleteIds.add(id);
|
|
633
|
-
});
|
|
634
620
|
prevThreadIds = currentThreadIdsSorted;
|
|
635
|
-
addIds.forEach((id) => {
|
|
636
|
-
if (!this._threadCommentModel.getComment(unitId, subUnitId, id)) this._threadCommentModel.addComment(unitId, subUnitId, {
|
|
637
|
-
id,
|
|
638
|
-
threadId: id,
|
|
639
|
-
ref: "",
|
|
640
|
-
dT: "",
|
|
641
|
-
personId: "",
|
|
642
|
-
text: { dataStream: "" },
|
|
643
|
-
unitId,
|
|
644
|
-
subUnitId
|
|
645
|
-
});
|
|
646
|
-
});
|
|
647
621
|
this._threadCommentModel.syncThreadComments(unitId, subUnitId, [...addIds]);
|
|
648
622
|
}
|
|
649
623
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/locale/en-US.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
const locale = { "docs-thread-comment-ui": { panel: {
|
|
18
|
+
title: "Comment Management",
|
|
19
|
+
addComment: "Add Comment"
|
|
20
|
+
} } };
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { locale as default };
|