@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.
Files changed (64) hide show
  1. package/README.md +5 -5
  2. package/lib/cjs/index.js +66 -95
  3. package/lib/cjs/locale/ar-SA.js +1 -2
  4. package/lib/cjs/locale/ca-ES.js +1 -2
  5. package/lib/cjs/locale/de-DE.js +1 -2
  6. package/lib/cjs/locale/en-US.js +1 -2
  7. package/lib/cjs/locale/es-ES.js +1 -2
  8. package/lib/cjs/locale/fa-IR.js +1 -2
  9. package/lib/cjs/locale/fr-FR.js +1 -2
  10. package/lib/cjs/locale/id-ID.js +1 -2
  11. package/lib/cjs/locale/it-IT.js +1 -2
  12. package/lib/cjs/locale/ja-JP.js +1 -2
  13. package/lib/cjs/locale/ko-KR.js +1 -2
  14. package/lib/cjs/locale/pl-PL.js +1 -2
  15. package/lib/cjs/locale/pt-BR.js +1 -2
  16. package/lib/cjs/locale/ru-RU.js +1 -2
  17. package/lib/cjs/locale/sk-SK.js +1 -2
  18. package/lib/cjs/locale/vi-VN.js +1 -2
  19. package/lib/cjs/locale/zh-CN.js +1 -2
  20. package/lib/cjs/locale/zh-HK.js +1 -2
  21. package/lib/cjs/locale/zh-TW.js +1 -2
  22. package/lib/es/index.js +67 -96
  23. package/lib/es/locale/ar-SA.js +1 -2
  24. package/lib/es/locale/ca-ES.js +1 -2
  25. package/lib/es/locale/de-DE.js +1 -2
  26. package/lib/es/locale/en-US.js +1 -2
  27. package/lib/es/locale/es-ES.js +1 -2
  28. package/lib/es/locale/fa-IR.js +1 -2
  29. package/lib/es/locale/fr-FR.js +1 -2
  30. package/lib/es/locale/id-ID.js +1 -2
  31. package/lib/es/locale/it-IT.js +1 -2
  32. package/lib/es/locale/ja-JP.js +1 -2
  33. package/lib/es/locale/ko-KR.js +1 -2
  34. package/lib/es/locale/pl-PL.js +1 -2
  35. package/lib/es/locale/pt-BR.js +1 -2
  36. package/lib/es/locale/ru-RU.js +1 -2
  37. package/lib/es/locale/sk-SK.js +1 -2
  38. package/lib/es/locale/vi-VN.js +1 -2
  39. package/lib/es/locale/zh-CN.js +1 -2
  40. package/lib/es/locale/zh-HK.js +1 -2
  41. package/lib/es/locale/zh-TW.js +1 -2
  42. package/lib/index.css +15 -80
  43. package/lib/index.js +67 -96
  44. package/lib/locale/ar-SA.js +1 -2
  45. package/lib/locale/ca-ES.js +1 -2
  46. package/lib/locale/de-DE.js +1 -2
  47. package/lib/locale/en-US.js +1 -2
  48. package/lib/locale/es-ES.js +1 -2
  49. package/lib/locale/fa-IR.js +1 -2
  50. package/lib/locale/fr-FR.js +1 -2
  51. package/lib/locale/id-ID.js +1 -2
  52. package/lib/locale/it-IT.js +1 -2
  53. package/lib/locale/ja-JP.js +1 -2
  54. package/lib/locale/ko-KR.js +1 -2
  55. package/lib/locale/pl-PL.js +1 -2
  56. package/lib/locale/pt-BR.js +1 -2
  57. package/lib/locale/ru-RU.js +1 -2
  58. package/lib/locale/sk-SK.js +1 -2
  59. package/lib/locale/vi-VN.js +1 -2
  60. package/lib/locale/zh-CN.js +1 -2
  61. package/lib/locale/zh-HK.js +1 -2
  62. package/lib/locale/zh-TW.js +1 -2
  63. package/lib/umd/index.js +3 -10
  64. package/package.json +14 -14
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  ## Package Overview
10
10
 
11
- | Package | UMD global | CSS | Locales | Facade entry |
12
- | --- | --- | :---: | :---: | :---: |
13
- | `@univerjs/thread-comment-ui` | `UniverThreadCommentUi` | Yes | Yes | No |
11
+ | Package | UMD global | CSS | Locales | Facade entry | Worker entry |
12
+ | --- | --- | :---: | :---: | :---: | :---: |
13
+ | `@univerjs/thread-comment-ui` | `UniverThreadCommentUi` | Yes | Yes | No | No |
14
14
 
15
15
  ## Installation
16
16
 
@@ -20,10 +20,10 @@ pnpm add @univerjs/thread-comment-ui
20
20
  npm install @univerjs/thread-comment-ui
21
21
  ```
22
22
 
23
- Keep all `@univerjs/*` packages on the same version.
24
-
25
23
  ## Usage
26
24
 
25
+ Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
26
+
27
27
  ```ts
28
28
  import '@univerjs/thread-comment-ui/lib/index.css';
29
29
  import EnUS from '@univerjs/thread-comment-ui/locale/en-US';
package/lib/cjs/index.js CHANGED
@@ -10,7 +10,7 @@ let _univerjs_icons = require("@univerjs/icons");
10
10
  let react = require("react");
11
11
  let react_jsx_runtime = require("react/jsx-runtime");
12
12
 
13
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
13
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
14
14
  function _typeof(o) {
15
15
  "@babel/helpers - typeof";
16
16
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -20,28 +20,25 @@ function _typeof(o) {
20
20
  }, _typeof(o);
21
21
  }
22
22
 
23
- //#endregion
24
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
25
- function toPrimitive(t, r) {
23
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
24
+ function toPrimitive(t, e) {
26
25
  if ("object" != _typeof(t) || !t) return t;
27
- var e = t[Symbol.toPrimitive];
28
- if (void 0 !== e) {
29
- var i = e.call(t, r || "default");
26
+ var r;
27
+ if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
28
+ var i = r.call(t, e || "default");
30
29
  if ("object" != _typeof(i)) return i;
31
30
  throw new TypeError("@@toPrimitive must return a primitive value.");
32
31
  }
33
- return ("string" === r ? String : Number)(t);
32
+ return ("string" === e ? String : Number)(t);
34
33
  }
35
34
 
36
- //#endregion
37
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
35
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
38
36
  function toPropertyKey(t) {
39
37
  var i = toPrimitive(t, "string");
40
38
  return "symbol" == _typeof(i) ? i : i + "";
41
39
  }
42
40
 
43
- //#endregion
44
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
41
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
45
42
  function _defineProperty(e, r, t) {
46
43
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
47
44
  value: t,
@@ -51,16 +48,14 @@ function _defineProperty(e, r, t) {
51
48
  }) : e[r] = t, e;
52
49
  }
53
50
 
54
- //#endregion
55
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
51
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
56
52
  function __decorateParam(paramIndex, decorator) {
57
53
  return function(target, key) {
58
54
  decorator(target, key, paramIndex);
59
55
  };
60
56
  }
61
57
 
62
- //#endregion
63
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
58
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
64
59
  function __decorate(decorators, target, key, desc) {
65
60
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
66
61
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -68,8 +63,7 @@ function __decorate(decorators, target, key, desc) {
68
63
  return c > 3 && r && Object.defineProperty(target, key, r), r;
69
64
  }
70
65
 
71
- //#endregion
72
- //#region src/services/thread-comment-panel.service.ts
66
+ // src/services/thread-comment-panel.service.ts
73
67
  let ThreadCommentPanelService = class ThreadCommentPanelService extends _univerjs_core.Disposable {
74
68
  constructor(_sidebarService) {
75
69
  super();
@@ -120,8 +114,7 @@ let ThreadCommentPanelService = class ThreadCommentPanelService extends _univerj
120
114
  };
121
115
  ThreadCommentPanelService = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ISidebarService))], ThreadCommentPanelService);
122
116
 
123
- //#endregion
124
- //#region src/commands/operations/comment.operations.ts
117
+ // src/commands/operations/comment.operations.ts
125
118
  const SetActiveCommentOperation = {
126
119
  id: "thread-comment-ui.operation.set-active-comment",
127
120
  type: _univerjs_core.CommandType.OPERATION,
@@ -131,19 +124,16 @@ const SetActiveCommentOperation = {
131
124
  }
132
125
  };
133
126
 
134
- //#endregion
135
- //#region package.json
127
+ // package.json
136
128
  var name = "@univerjs/thread-comment-ui";
137
- var version = "1.3.1";
129
+ var version = "1.5.0";
138
130
 
139
- //#endregion
140
- //#region src/config/config.ts
131
+ // src/config/config.ts
141
132
  const THREAD_COMMENT_UI_PLUGIN_CONFIG_KEY = "thread-comment-ui.config";
142
133
  const configSymbol = Symbol(THREAD_COMMENT_UI_PLUGIN_CONFIG_KEY);
143
134
  const defaultPluginConfig = {};
144
135
 
145
- //#endregion
146
- //#region src/services/thread-comment-draft.service.ts
136
+ // src/services/thread-comment-draft.service.ts
147
137
  let ThreadCommentDraftService = class ThreadCommentDraftService extends _univerjs_core.Disposable {
148
138
  constructor(instanceService, _userManagerService) {
149
139
  super();
@@ -208,8 +198,7 @@ let ThreadCommentDraftService = class ThreadCommentDraftService extends _univerj
208
198
  };
209
199
  ThreadCommentDraftService = __decorate([__decorateParam(0, _univerjs_core.IUniverInstanceService), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.UserManagerService))], ThreadCommentDraftService);
210
200
 
211
- //#endregion
212
- //#region src/types/const.ts
201
+ // src/types/const.ts
213
202
  /**
214
203
  * Copyright 2023-present DreamNum Co., Ltd.
215
204
  *
@@ -227,8 +216,7 @@ ThreadCommentDraftService = __decorate([__decorateParam(0, _univerjs_core.IUnive
227
216
  */
228
217
  const PLUGIN_NAME = "UNIVER_THREAD_COMMENT_UI_PLUGIN";
229
218
 
230
- //#endregion
231
- //#region src/mobile-plugin.ts
219
+ // src/mobile-plugin.ts
232
220
  let UniverThreadCommentMobileUIPlugin = class UniverThreadCommentMobileUIPlugin extends _univerjs_core.Plugin {
233
221
  constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
234
222
  super();
@@ -259,8 +247,7 @@ UniverThreadCommentMobileUIPlugin = __decorate([
259
247
  __decorateParam(3, _univerjs_core.IConfigService)
260
248
  ], UniverThreadCommentMobileUIPlugin);
261
249
 
262
- //#endregion
263
- //#region src/plugin.ts
250
+ // src/plugin.ts
264
251
  let UniverThreadCommentUIPlugin = class UniverThreadCommentUIPlugin extends _univerjs_core.Plugin {
265
252
  constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
266
253
  super();
@@ -293,8 +280,7 @@ UniverThreadCommentUIPlugin = __decorate([
293
280
  __decorateParam(3, _univerjs_core.IConfigService)
294
281
  ], UniverThreadCommentUIPlugin);
295
282
 
296
- //#endregion
297
- //#region src/render-objects/thread-comment-canvas-overlay.ts
283
+ // src/render-objects/thread-comment-canvas-overlay.ts
298
284
  const MARKER_SIZE = 24;
299
285
  const MARKER_IDLE_OPACITY = .58;
300
286
  const MARKER_PREVIEW_OPACITY = .42;
@@ -453,8 +439,7 @@ var ThreadCommentCanvasOverlay = class extends _univerjs_engine_render.BaseObjec
453
439
  }
454
440
  };
455
441
 
456
- //#endregion
457
- //#region src/views/thread-comment-panel/util.ts
442
+ // src/views/thread-comment-panel/util.ts
458
443
  function isSameThreadCommentTarget(active, comment) {
459
444
  return (active === null || active === void 0 ? void 0 : active.unitId) === comment.unitId && active.subUnitId === comment.subUnitId && active.commentId === comment.id;
460
445
  }
@@ -476,8 +461,7 @@ function getThreadCommentPanelItemKey(comment, index, section) {
476
461
  ].join("-");
477
462
  }
478
463
 
479
- //#endregion
480
- //#region src/views/thread-comment-editor/util.ts
464
+ // src/views/thread-comment-editor/util.ts
481
465
  const transformDocument2TextNodesInParagraph = (doc) => {
482
466
  const { dataStream, customRanges } = doc;
483
467
  const end = dataStream.endsWith("\r\n") ? dataStream.length - 2 : dataStream.length;
@@ -577,15 +561,13 @@ function focusThreadCommentEditor(editorService, editorId, editor) {
577
561
  editor === null || editor === void 0 || editor.focus();
578
562
  }
579
563
 
580
- //#endregion
581
- //#region src/views/thread-comment-tree/util.ts
564
+ // src/views/thread-comment-tree/util.ts
582
565
  function getThreadCommentEditorId(params) {
583
566
  const { location, unitId, subUnitId, commentId, fallbackId } = params;
584
567
  return `${_univerjs_core.DOCS_COMMENT_EDITOR_UNIT_ID_KEY}_${location}_${unitId}_${subUnitId}_${commentId || fallbackId}`;
585
568
  }
586
569
 
587
- //#endregion
588
- //#region src/views/ThreadCommentEditor.tsx
570
+ // src/views/ThreadCommentEditor.tsx
589
571
  function getSnapshot(body) {
590
572
  return {
591
573
  id: "d",
@@ -752,27 +734,13 @@ const ThreadCommentEditor = (0, react.forwardRef)((props, ref) => {
752
734
  });
753
735
  });
754
736
 
755
- //#endregion
756
- //#region src/views/ThreadCommentTree.tsx
737
+ // src/views/ThreadCommentTree.tsx
757
738
  let ThreadCommentTreeLocation = /* @__PURE__ */ function(ThreadCommentTreeLocation) {
758
739
  ThreadCommentTreeLocation["CELL"] = "CELL";
759
740
  ThreadCommentTreeLocation["PANEL"] = "PANEL";
760
741
  return ThreadCommentTreeLocation;
761
742
  }({});
762
743
  const MOCK_ID = "__mock__";
763
- function formatCommentDateTime(value, region) {
764
- const date = (0, _univerjs_core.dateKit)(value);
765
- const regionTag = _univerjs_core.LOCALE_META[region].tag;
766
- return date.formatIntl(regionTag, {
767
- year: "numeric",
768
- month: "numeric",
769
- day: "numeric",
770
- hour: "2-digit",
771
- minute: "2-digit",
772
- hour12: false,
773
- numberingSystem: "latn"
774
- });
775
- }
776
744
  const ThreadCommentItem = (props) => {
777
745
  const { item, unitId, subUnitId, editing, onEditingChange, onReply, resolved, isRoot, onClose, onDeleteComment, onAfterDeleteComment, type, threadCommentEditorId, DropdownComponent, EditorComponent } = props;
778
746
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
@@ -789,6 +757,19 @@ const ThreadCommentItem = (props) => {
789
757
  const avatarFallback = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.avatarFallback;
790
758
  const currentRegion = (0, _univerjs_ui.useObservable)(regionService.currentRegion$, regionService.getCurrentRegion());
791
759
  const direction = (0, _univerjs_ui.useObservable)(localeService.direction$, localeService.getDirection());
760
+ function formatCommentDateTime(value, region) {
761
+ const date = (0, _univerjs_core.dateKit)(value);
762
+ const regionTag = _univerjs_core.LOCALE_META[region].tag;
763
+ return date.formatIntl(regionTag, {
764
+ year: "numeric",
765
+ month: "numeric",
766
+ day: "numeric",
767
+ hour: "2-digit",
768
+ minute: "2-digit",
769
+ hour12: false,
770
+ numberingSystem: "latn"
771
+ });
772
+ }
792
773
  const dateText = isMock ? null : formatCommentDateTime(item.dT, currentRegion);
793
774
  const handleDeleteItem = async () => {
794
775
  if ((onDeleteComment === null || onDeleteComment === void 0 ? void 0 : onDeleteComment(item)) === false) return;
@@ -822,7 +803,7 @@ const ThreadCommentItem = (props) => {
822
803
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [isMock || resolved ? null : showReply && user ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
823
804
  type: "button",
824
805
  "aria-label": localeService.t("thread-comment-ui.editor.reply"),
825
- 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",
806
+ 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",
826
807
  onClick: () => onReply(user),
827
808
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.ReplyToCommentIcon, {})
828
809
  }) : null, isCommentBySelf && !isMock && !resolved ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropdownComponent, {
@@ -830,15 +811,15 @@ const ThreadCommentItem = (props) => {
830
811
  dir: direction,
831
812
  className: "univer-rounded-lg",
832
813
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
833
- 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",
814
+ 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",
834
815
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
835
816
  type: "button",
836
- className: "hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-800",
817
+ className: "hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
837
818
  onClick: () => onEditingChange === null || onEditingChange === void 0 ? void 0 : onEditingChange(true),
838
819
  children: localeService.t("thread-comment-ui.item.edit")
839
820
  }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
840
821
  type: "button",
841
- className: "hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-800",
822
+ className: "hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
842
823
  onClick: handleDeleteItem,
843
824
  children: localeService.t("thread-comment-ui.item.delete")
844
825
  }) })]
@@ -847,7 +828,7 @@ const ThreadCommentItem = (props) => {
847
828
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
848
829
  type: "button",
849
830
  "aria-label": localeService.t("thread-comment-ui.item.more"),
850
- 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",
831
+ 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",
851
832
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreHorizontalIcon, {})
852
833
  })
853
834
  }) : null] })]
@@ -1043,7 +1024,7 @@ const ThreadCommentTree = (props) => {
1043
1024
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1044
1025
  type: "button",
1045
1026
  "aria-label": resolveLabel,
1046
- className: (0, _univerjs_design.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 }),
1027
+ className: (0, _univerjs_design.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 }),
1047
1028
  onClick: handleResolve,
1048
1029
  children: resolved ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.SuccessIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.SuccessOutlineIcon, {})
1049
1030
  })
@@ -1052,7 +1033,7 @@ const ThreadCommentTree = (props) => {
1052
1033
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1053
1034
  type: "button",
1054
1035
  "aria-label": deleteLabel,
1055
- 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",
1036
+ 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",
1056
1037
  onClick: handleDeleteRoot,
1057
1038
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.DeleteIcon, {})
1058
1039
  })
@@ -1139,16 +1120,14 @@ const ThreadCommentTree = (props) => {
1139
1120
  });
1140
1121
  };
1141
1122
 
1142
- //#endregion
1143
- //#region src/views/mobile/MobileThreadCommentEditor.tsx
1123
+ // src/views/mobile/MobileThreadCommentEditor.tsx
1144
1124
  const MobileThreadCommentEditor = (0, react.forwardRef)((props, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThreadCommentEditor, {
1145
1125
  ...props,
1146
1126
  ref,
1147
1127
  ActionRowComponent: _univerjs_design.MobileActionRowGroup
1148
1128
  }));
1149
1129
 
1150
- //#endregion
1151
- //#region src/views/mobile/MobileThreadCommentTree.tsx
1130
+ // src/views/mobile/MobileThreadCommentTree.tsx
1152
1131
  function MobileThreadCommentTree(props) {
1153
1132
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThreadCommentTree, {
1154
1133
  ...props,
@@ -1157,18 +1136,17 @@ function MobileThreadCommentTree(props) {
1157
1136
  });
1158
1137
  }
1159
1138
 
1160
- //#endregion
1161
- //#region src/views/mobile/MobileThreadCommentPanel.tsx
1139
+ // src/views/mobile/MobileThreadCommentPanel.tsx
1162
1140
  function MobileCommentFilter({ value, options = [], onChange }) {
1163
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1164
- className: "univer-flex univer-gap-1 univer-overflow-x-auto univer-rounded-xl univer-bg-gray-100 univer-p-1 dark:!univer-bg-gray-800",
1165
- children: options.flatMap((option) => option.options ?? [option]).map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1166
- type: "button",
1167
- "aria-pressed": option.value === value,
1168
- className: (0, _univerjs_design.clsx)(_univerjs_design.resetButtonClassName, "univer-h-10 univer-shrink-0 univer-rounded-lg univer-px-3 univer-text-sm univer-text-gray-700 active:univer-scale-95 dark:!univer-text-gray-200", option.value === value && "univer-bg-gray-0 univer-font-medium univer-text-primary-600 univer-shadow-sm dark:!univer-bg-gray-700 dark:!univer-text-primary-300"),
1169
- onClick: () => option.value != null && (onChange === null || onChange === void 0 ? void 0 : onChange(option.value)),
1170
- children: option.label
1171
- }, option.value))
1141
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Segmented, {
1142
+ className: "univer-w-full",
1143
+ value,
1144
+ items: options.flatMap((option) => option.options ?? [option]).filter((option) => option.value != null).map((option) => ({
1145
+ label: option.label,
1146
+ value: option.value,
1147
+ disabled: option.disabled
1148
+ })),
1149
+ onChange
1172
1150
  });
1173
1151
  }
1174
1152
  function MobileCommentHeader({ comment: activeComment, displayRef }) {
@@ -1176,17 +1154,10 @@ function MobileCommentHeader({ comment: activeComment, displayRef }) {
1176
1154
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
1177
1155
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1178
1156
  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",
1179
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1180
- type: "button",
1157
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
1158
+ size: "icon",
1159
+ variant: "text",
1181
1160
  "aria-label": localeService.t("thread-comment-ui.mobile.back"),
1182
- className: `
1183
- ${_univerjs_design.resetButtonClassName}
1184
- univer-flex univer-size-12 univer-shrink-0 univer-items-center univer-justify-center univer-rounded-xl
1185
- univer-text-2xl univer-text-gray-700
1186
- active:univer-bg-gray-100
1187
- dark:!univer-text-gray-200
1188
- dark:active:!univer-bg-gray-700
1189
- `,
1190
1161
  onClick: () => commandService.executeCommand(SetActiveCommentOperation.id),
1191
1162
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreLeftIcon, {})
1192
1163
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -1208,6 +1179,7 @@ function MobileAddComment({ onAdd }) {
1208
1179
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_univerjs_design.Button, {
1209
1180
  className: "univer-w-full",
1210
1181
  onClick: onAdd,
1182
+ size: "middle",
1211
1183
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.IncreaseIcon, { className: "univer-mr-1.5" }), localeService.t("thread-comment-ui.panel.addComment")]
1212
1184
  })
1213
1185
  });
@@ -1384,7 +1356,7 @@ function MobileThreadCommentPanel(props) {
1384
1356
  onClose: !comment.id ? onTempCommentClose : void 0
1385
1357
  }, getThreadCommentPanelItemKey(comment, index, section));
1386
1358
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1387
- className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3",
1359
+ className: "univer-box-border univer-flex univer-min-h-full univer-flex-col univer-pb-3",
1388
1360
  children: [
1389
1361
  activeComment && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileCommentHeader, {
1390
1362
  comment: activeComment,
@@ -1409,6 +1381,7 @@ function MobileThreadCommentPanel(props) {
1409
1381
  className: "univer-mt-2 univer-flex univer-flex-row",
1410
1382
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
1411
1383
  onClick: handleReset,
1384
+ size: "middle",
1412
1385
  children: localeService.t("thread-comment-ui.panel.reset")
1413
1386
  })
1414
1387
  }) : null]
@@ -1427,8 +1400,7 @@ function MobileThreadCommentPanel(props) {
1427
1400
  });
1428
1401
  }
1429
1402
 
1430
- //#endregion
1431
- //#region src/views/ThreadCommentPanel.tsx
1403
+ // src/views/ThreadCommentPanel.tsx
1432
1404
  const ThreadCommentPanel = (props) => {
1433
1405
  const { unitId, subUnitId$, type, onAdd, getSubUnitName, onResolve, sortComments, onItemLeave, onItemEnter, disableAdd, tempComment, onAddComment, onDeleteComment, onAfterDeleteComment, showComments, formatRef, onTempCommentClose, autoFocusActiveComment = false } = props;
1434
1406
  const [unit, setUnit] = (0, react.useState)("all");
@@ -1580,7 +1552,7 @@ const ThreadCommentPanel = (props) => {
1580
1552
  onClose: !comment.id ? onTempCommentClose : void 0
1581
1553
  }, getThreadCommentPanelItemKey(comment, index, section));
1582
1554
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1583
- className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3",
1555
+ className: "univer-box-border univer-flex univer-min-h-full univer-flex-col univer-pb-3",
1584
1556
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1585
1557
  className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between",
1586
1558
  children: [type === _univerjs_core.UniverInstanceType.UNIVER_SHEET ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
@@ -1646,7 +1618,6 @@ const ThreadCommentPanel = (props) => {
1646
1618
  });
1647
1619
  };
1648
1620
 
1649
- //#endregion
1650
1621
  exports.MobileThreadCommentPanel = MobileThreadCommentPanel;
1651
1622
  exports.MobileThreadCommentTree = MobileThreadCommentTree;
1652
1623
  exports.SetActiveCommentOperation = SetActiveCommentOperation;
@@ -1,4 +1,4 @@
1
- //#region src/locale/ar-SA.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/ca-ES.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/de-DE.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/en-US.ts
1
+ // src/locale/en-US.ts
2
2
  /**
3
3
  * Copyright 2023-present DreamNum Co., Ltd.
4
4
  *
@@ -50,5 +50,4 @@ const locale = { "thread-comment-ui": {
50
50
  }
51
51
  } };
52
52
 
53
- //#endregion
54
53
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/es-ES.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/fa-IR.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/fr-FR.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/id-ID.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/it-IT.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/ja-JP.ts
1
+ // src/locale/ja-JP.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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/ko-KR.ts
1
+ // src/locale/ko-KR.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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/pl-PL.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/pt-BR.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/ru-RU.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/sk-SK.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/vi-VN.ts
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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/zh-CN.ts
1
+ // src/locale/zh-CN.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
  module.exports = locale;
@@ -1,4 +1,4 @@
1
- //#region src/locale/zh-HK.ts
1
+ // src/locale/zh-HK.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
  module.exports = locale;