@univerjs/thread-comment 0.20.1 → 0.21.0-insiders.20260424-262d69f

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 CHANGED
@@ -1 +1,773 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@univerjs/core`),t=require(`rxjs`);function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}function a(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=class extends e.Disposable{set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}constructor(){super(),a(this,`_dataSource`,null),a(this,`syncUpdateMutationToColla`,!0)}async getThreadComment(e,t,n){return this._dataSource?(await this._dataSource.listComments(e,t,[n]))[0]:null}async addComment(e){var t;return this._dataSource?this._dataSource.addComment(e):{...e,threadId:(t=e.threadId)==null?e.id:t}}async updateComment(e){return this._dataSource?this._dataSource.updateComment(e):!0}async resolveComment(e){return this._dataSource?this._dataSource.resolveComment(e):!0}async deleteComment(e,t,n,r){return this._dataSource?this._dataSource.deleteComment(e,t,n,r):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){let t={};return Object.keys(e).forEach(n=>{t[n]=e[n].map(this.dataSource.saveCommentToSnapshot)}),t}return e}};const s=(0,e.createIdentifier)(`univer.thread-comment.data-source-service`);function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let u=class extends e.Disposable{constructor(n,r){super(),this._dataSourceService=n,this._lifecycleService=r,a(this,`_commentsMap`,new Map),a(this,`_threadMap`,new Map),a(this,`_commentUpdate$`,new t.Subject),a(this,`commentUpdate$`,this._commentUpdate$.asObservable()),a(this,`_tasks`,[]),this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(t=>{let n=new Map;t===e.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:e,subUnitId:t,threadIds:r})=>{let i=n.get(e);i||(i=new Map,n.set(e,i));let a=i.get(t);a||(a=new Set,i.set(t,a));for(let e of r)a.add(e)}),this._tasks=[],n.forEach((e,t)=>{e.forEach((e,n)=>{this.syncThreadComments(t,n,Array.from(e))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}ensureMap(e,t){return this._ensureCommentMap(e,t)}_ensureThreadMap(e,t){let n=this._threadMap.get(e);n||(n=new Map,this._threadMap.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_replaceComment(e,t,n){let r=this._ensureCommentMap(e,t),i=r.get(n.id);if(i){let{children:a,...o}=n,s={...o,ref:i.ref};r.set(n.id,s),a==null||a.forEach(e=>{r.set(e.id,{...e,ref:``})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:`syncUpdate`,payload:s}),!!n.resolved!=!!i.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:`resolve`,payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(t,n,r){if(this._lifecycleService.stage<e.LifecycleStages.Rendered){this._tasks.push({unitId:t,subUnitId:n,threadIds:r});return}let i=this._ensureThreadMap(t,n),a=this._ensureCommentMap(t,n),o=await this._dataSourceService.listThreadComments(t,n,r);if(!o)return;let s=new Set(r);o.forEach(e=>{this._replaceComment(t,n,e),s.delete(e.threadId)}),s.forEach(e=>{i.delete(e),a.forEach((t,n)=>{t.threadId===e&&a.delete(n)})})}addComment(e,t,n,r){let i=this._ensureCommentMap(e,t),{parentId:a,children:o=[],...s}=n,c={...s,parentId:a===n.id?void 0:a};c.threadId||(c.threadId=c.parentId||c.id);let l=n=>{i.set(n.id,n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:`add`,payload:n,isRoot:!n.parentId})};l(c);let u=this._ensureThreadMap(e,t);if(!c.parentId){u.set(c.threadId,c);for(let e of o)l(e)}return r&&this.syncThreadComments(e,t,[c.threadId]),!0}updateComment(e,t,n,r){let i=this._ensureCommentMap(e,t).get(n.commentId);return i?(i.updated=!0,i.text=n.text,i.attachments=n.attachments,i.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:`update`,payload:n,silent:r}),!0):!0}updateCommentRef(e,t,n,r){let i=this._ensureCommentMap(e,t).get(n.commentId);return i?(i.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:`updateRef`,payload:n,silent:r,threadId:i.threadId}),!0):!1}resolveComment(e,t,n,r){let i=this._ensureCommentMap(e,t).get(n);return i?(i.resolved=r,this._commentUpdate$.next({unitId:e,subUnitId:t,type:`resolve`,payload:{commentId:n,resolved:r}}),!0):!1}getComment(e,t,n){return this._ensureCommentMap(e,t).get(n)}getRootComment(e,t,n){return this._ensureThreadMap(e,t).get(n)}getThread(e,t,n){let r=this._ensureCommentMap(e,t),i=Array.from(r.values()).filter(e=>e.threadId===n),a,o=[],s=new Set;for(let e of i)e.parentId?o.push(e):a=e,s.add(e.personId);if(a)return{root:a,children:o,relativeUsers:s,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){let r=this.getComment(e,t,n);if(r)return this.getThread(e,t,r.threadId)}_deleteComment(e,t,n){let r=this._ensureCommentMap(e,t),i=r.get(n);i&&(r.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:`delete`,payload:{commentId:n,isRoot:!i.parentId,comment:i}}))}deleteThread(e,t,n){this._ensureThreadMap(e,t).delete(n),this._ensureCommentMap(e,t).forEach(r=>{r.threadId===n&&this._deleteComment(e,t,r.id)})}deleteComment(e,t,n){let r=this._ensureCommentMap(e,t).get(n);return r&&(r.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,r.threadId)),!0}deleteUnit(e){let t=this._commentsMap.get(e);t&&t.forEach((t,n)=>{t.forEach(t=>{this.deleteComment(e,n,t.id)})})}getUnit(e){let t=this._threadMap.get(e);if(!t)return[];let n=[];return t.forEach((t,r)=>{t.forEach((t,i)=>{let a=this.getThread(e,r,i);a&&n.push(a)})}),n}getAll(){let e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}};u=l([c(0,(0,e.Inject)(s)),c(1,(0,e.Inject)(e.LifecycleService))],u);const d={id:`thread-comment.mutation.add-comment`,type:e.CommandType.MUTATION,handler(e,t,n){if(!t)return!1;let r=e.get(u),{unitId:i,subUnitId:a,comment:o,sync:s}=t,c=s||(n==null?void 0:n.fromChangeset)&&!o.parentId;return r.addComment(i,a,o,c)}},f={id:`thread-comment.mutation.update-comment`,type:e.CommandType.MUTATION,handler(e,t){if(!t)return!1;let n=e.get(u),{unitId:r,subUnitId:i,payload:a,silent:o}=t;return n.updateComment(r,i,a,o)}},p={id:`thread-comment.mutation.update-comment-ref`,type:e.CommandType.MUTATION,handler(e,t){if(!t)return!1;let n=e.get(u),{unitId:r,subUnitId:i,payload:a,silent:o}=t;return n.updateCommentRef(r,i,a,o)}},m={id:`thread-comment.mutation.resolve-comment`,type:e.CommandType.MUTATION,handler(e,t){if(!t)return!1;let n=e.get(u),{unitId:r,subUnitId:i,resolved:a,commentId:o}=t;return n.resolveComment(r,i,o,a)}},h={id:`thread-comment.mutation.delete-comment`,type:e.CommandType.MUTATION,handler(e,t){if(!t)return!1;let n=e.get(u),{unitId:r,subUnitId:i,commentId:a}=t;return n.deleteComment(r,i,a)}},g={id:`thread-comment.command.add-comment`,type:e.CommandType.COMMAND,async handler(t,n){if(!n)return!1;let r=t.get(e.ICommandService),i=t.get(s),{comment:a}=n,o=await i.addComment(a),c=i.syncUpdateMutationToColla,l=!a.parentId,u={id:d.id,params:{...n,comment:o}};return l?await r.executeCommand(u.id,u.params):r.executeCommand(u.id,u.params,{onlyLocal:!c})}},_={id:`thread-comment.command.update-comment`,type:e.CommandType.COMMAND,async handler(t,n){if(!n)return!1;let{unitId:r,subUnitId:i,payload:a}=n,o=t.get(e.ICommandService),c=t.get(u),l=t.get(s),d=l.syncUpdateMutationToColla,p=c.getComment(r,i,a.commentId);if(!p)return!1;let{children:m,...h}=p;if(!await l.updateComment({...h,...a}))return!1;let g={id:f.id,params:n};return o.executeCommand(g.id,g.params,{onlyLocal:!d}),!0}},v={id:`thread-comment.command.resolve-comment`,type:e.CommandType.COMMAND,async handler(t,n){if(!n)return!1;let{unitId:r,subUnitId:i,resolved:a,commentId:o}=n,c=t.get(s),l=t.get(u).getComment(r,i,o),d=c.syncUpdateMutationToColla;return!l||!await c.resolveComment({...l,resolved:a})?!1:t.get(e.ICommandService).executeCommand(m.id,n,{onlyLocal:!d})}},y={id:`thread-comment.command.delete-comment`,type:e.CommandType.COMMAND,async handler(t,n){if(!n)return!1;let r=t.get(u),i=t.get(s),a=t.get(e.ICommandService),{unitId:o,subUnitId:c,commentId:l}=n,d=i.syncUpdateMutationToColla,f=r.getComment(o,c,l);if(!f||!await i.deleteComment(o,c,f.threadId,l))return!1;let p={id:h.id,params:n};return a.executeCommand(p.id,p.params,{onlyLocal:!d})}},b={id:`thread-comment.command.delete-comment-tree`,type:e.CommandType.COMMAND,async handler(t,n){if(!n)return!1;let r=t.get(u),i=t.get(e.ICommandService),a=t.get(s),{unitId:o,subUnitId:c,commentId:l}=n,d=r.getCommentWithChildren(o,c,l);return!d||!await a.deleteComment(o,c,d.root.threadId,l)?!1:await i.executeCommand(h.id,{unitId:o,subUnitId:c,commentId:d.root.id})}};function x(t){return(0,e.dateKit)(t).format(`YYYY/MM/DD HH:mm`)}const S=`UNIVER_THREAD_COMMENT_PLUGIN`,C=`SHEET_${S}`;let w=class extends e.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._threadCommentModel=t,this._threadCommentDataSourceService=n,this._initSnapshot()}_initSnapshot(){let t=e=>{let t=this._threadCommentModel.getUnit(e),n={};return t?(t.forEach(e=>{var t;let r=(t=n[e.subUnitId])==null?[]:t;r.push({...e.root,children:e.children}),n[e.subUnitId]=r}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(n,e))):``},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:C,businesses:[e.UniverInstanceType.UNIVER_SHEET,e.UniverInstanceType.UNIVER_DOC],toJson:e=>t(e),parseJson:e=>n(e),onUnLoad:e=>{this._threadCommentModel.deleteUnit(e)},onLoad:async(e,t)=>{Object.keys(t).forEach(n=>{let r=t[n];r.forEach(t=>{this._threadCommentModel.addComment(e,n,t)}),this._threadCommentModel.syncThreadComments(e,n,r.map(e=>e.threadId))})}}))}};w=l([c(0,e.IResourceManagerService),c(1,(0,e.Inject)(u)),c(2,s)],w);var T=`@univerjs/thread-comment`,E=`0.20.1`;const D=`thread-comment.config`;Symbol(D);const O={};let k=class extends e.Plugin{constructor(t=O,n,r,i){super(),this._config=t,this._injector=n,this._commandService=r,this._configService=i;let{...a}=(0,e.merge)({},O,this._config);this._configService.setConfig(D,a)}onStarting(){var t;(0,e.mergeOverrideWithDependencies)([[s,{useClass:o}],[u],[w]],(t=this._config)==null?void 0:t.overrides).forEach(e=>{this._injector.add(e)}),[g,_,y,v,b,d,f,p,h,m].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(w)}};a(k,`pluginName`,S),a(k,`packageName`,T),a(k,`version`,E),a(k,`type`,e.UniverInstanceType.UNIVER_UNKNOWN),k=l([c(1,(0,e.Inject)(e.Injector)),c(2,e.ICommandService),c(3,e.IConfigService)],k),exports.AddCommentCommand=g,exports.AddCommentMutation=d,exports.DeleteCommentCommand=y,exports.DeleteCommentMutation=h,exports.DeleteCommentTreeCommand=b,exports.IThreadCommentDataSourceService=s,exports.ResolveCommentCommand=v,exports.ResolveCommentMutation=m,exports.SHEET_UNIVER_THREAD_COMMENT_PLUGIN=C,exports.TC_PLUGIN_NAME=S,exports.ThreadCommentDataSourceService=o,Object.defineProperty(exports,`ThreadCommentModel`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`ThreadCommentResourceController`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`UniverThreadCommentPlugin`,{enumerable:!0,get:function(){return k}}),exports.UpdateCommentCommand=_,exports.UpdateCommentMutation=f,exports.UpdateCommentRefMutation=p,exports.getDT=x;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _univerjs_core = require("@univerjs/core");
3
+ let rxjs = require("rxjs");
4
+
5
+ //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
6
+ function _typeof(o) {
7
+ "@babel/helpers - typeof";
8
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
9
+ return typeof o;
10
+ } : function(o) {
11
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
12
+ }, _typeof(o);
13
+ }
14
+
15
+ //#endregion
16
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
17
+ function toPrimitive(t, r) {
18
+ if ("object" != _typeof(t) || !t) return t;
19
+ var e = t[Symbol.toPrimitive];
20
+ if (void 0 !== e) {
21
+ var i = e.call(t, r || "default");
22
+ if ("object" != _typeof(i)) return i;
23
+ throw new TypeError("@@toPrimitive must return a primitive value.");
24
+ }
25
+ return ("string" === r ? String : Number)(t);
26
+ }
27
+
28
+ //#endregion
29
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
30
+ function toPropertyKey(t) {
31
+ var i = toPrimitive(t, "string");
32
+ return "symbol" == _typeof(i) ? i : i + "";
33
+ }
34
+
35
+ //#endregion
36
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
37
+ function _defineProperty(e, r, t) {
38
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
39
+ value: t,
40
+ enumerable: !0,
41
+ configurable: !0,
42
+ writable: !0
43
+ }) : e[r] = t, e;
44
+ }
45
+
46
+ //#endregion
47
+ //#region src/services/tc-datasource.service.ts
48
+ /**
49
+ * Preserve for import async comment system
50
+ */
51
+ var ThreadCommentDataSourceService = class extends _univerjs_core.Disposable {
52
+ set dataSource(dataSource) {
53
+ this._dataSource = dataSource;
54
+ }
55
+ get dataSource() {
56
+ return this._dataSource;
57
+ }
58
+ constructor() {
59
+ super();
60
+ _defineProperty(this, "_dataSource", null);
61
+ _defineProperty(this, "syncUpdateMutationToColla", true);
62
+ }
63
+ async getThreadComment(unitId, subUnitId, threadId) {
64
+ if (this._dataSource) return (await this._dataSource.listComments(unitId, subUnitId, [threadId]))[0];
65
+ return null;
66
+ }
67
+ async addComment(comment) {
68
+ var _comment$threadId;
69
+ if (this._dataSource) return this._dataSource.addComment(comment);
70
+ return {
71
+ ...comment,
72
+ threadId: (_comment$threadId = comment.threadId) !== null && _comment$threadId !== void 0 ? _comment$threadId : comment.id
73
+ };
74
+ }
75
+ async updateComment(comment) {
76
+ if (this._dataSource) return this._dataSource.updateComment(comment);
77
+ return true;
78
+ }
79
+ async resolveComment(comment) {
80
+ if (this._dataSource) return this._dataSource.resolveComment(comment);
81
+ return true;
82
+ }
83
+ async deleteComment(unitId, subUnitId, threadId, commentId) {
84
+ if (this._dataSource) return this._dataSource.deleteComment(unitId, subUnitId, threadId, commentId);
85
+ return true;
86
+ }
87
+ async listThreadComments(unitId, subUnitId, threadIds) {
88
+ if (this.dataSource) return this.dataSource.listComments(unitId, subUnitId, threadIds);
89
+ return false;
90
+ }
91
+ saveToSnapshot(unitComments, unitId) {
92
+ if (this._dataSource) {
93
+ const map = {};
94
+ Object.keys(unitComments).forEach((subUnitId) => {
95
+ map[subUnitId] = unitComments[subUnitId].map(this.dataSource.saveCommentToSnapshot);
96
+ });
97
+ return map;
98
+ }
99
+ return unitComments;
100
+ }
101
+ };
102
+ const IThreadCommentDataSourceService = (0, _univerjs_core.createIdentifier)("univer.thread-comment.data-source-service");
103
+
104
+ //#endregion
105
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorateParam.js
106
+ function __decorateParam(paramIndex, decorator) {
107
+ return function(target, key) {
108
+ decorator(target, key, paramIndex);
109
+ };
110
+ }
111
+
112
+ //#endregion
113
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
114
+ function __decorate(decorators, target, key, desc) {
115
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
116
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
117
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
118
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
119
+ }
120
+
121
+ //#endregion
122
+ //#region src/models/thread-comment.model.ts
123
+ let ThreadCommentModel = class ThreadCommentModel extends _univerjs_core.Disposable {
124
+ constructor(_dataSourceService, _lifecycleService) {
125
+ super();
126
+ this._dataSourceService = _dataSourceService;
127
+ this._lifecycleService = _lifecycleService;
128
+ _defineProperty(this, "_commentsMap", /* @__PURE__ */ new Map());
129
+ _defineProperty(this, "_threadMap", /* @__PURE__ */ new Map());
130
+ _defineProperty(this, "_commentUpdate$", new rxjs.Subject());
131
+ _defineProperty(this, "commentUpdate$", this._commentUpdate$.asObservable());
132
+ _defineProperty(this, "_tasks", []);
133
+ this.disposeWithMe(() => {
134
+ this._commentUpdate$.complete();
135
+ });
136
+ this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe((stage) => {
137
+ const taskMap = /* @__PURE__ */ new Map();
138
+ if (stage === _univerjs_core.LifecycleStages.Rendered) {
139
+ this._tasks.forEach(({ unitId, subUnitId, threadIds }) => {
140
+ let unitMap = taskMap.get(unitId);
141
+ if (!unitMap) {
142
+ unitMap = /* @__PURE__ */ new Map();
143
+ taskMap.set(unitId, unitMap);
144
+ }
145
+ let subUnitMap = unitMap.get(subUnitId);
146
+ if (!subUnitMap) {
147
+ subUnitMap = /* @__PURE__ */ new Set();
148
+ unitMap.set(subUnitId, subUnitMap);
149
+ }
150
+ for (const threadId of threadIds) subUnitMap.add(threadId);
151
+ });
152
+ this._tasks = [];
153
+ taskMap.forEach((subUnitMap, unitId) => {
154
+ subUnitMap.forEach((threadIds, subUnitId) => {
155
+ this.syncThreadComments(unitId, subUnitId, Array.from(threadIds));
156
+ });
157
+ });
158
+ }
159
+ }));
160
+ }
161
+ _ensureCommentMap(unitId, subUnitId) {
162
+ let unitMap = this._commentsMap.get(unitId);
163
+ if (!unitMap) {
164
+ unitMap = /* @__PURE__ */ new Map();
165
+ this._commentsMap.set(unitId, unitMap);
166
+ }
167
+ let subUnitMap = unitMap.get(subUnitId);
168
+ if (!subUnitMap) {
169
+ subUnitMap = /* @__PURE__ */ new Map();
170
+ unitMap.set(subUnitId, subUnitMap);
171
+ }
172
+ return subUnitMap;
173
+ }
174
+ ensureMap(unitId, subUnitId) {
175
+ return this._ensureCommentMap(unitId, subUnitId);
176
+ }
177
+ _ensureThreadMap(unitId, subUnitId) {
178
+ let unitMap = this._threadMap.get(unitId);
179
+ if (!unitMap) {
180
+ unitMap = /* @__PURE__ */ new Map();
181
+ this._threadMap.set(unitId, unitMap);
182
+ }
183
+ let subUnitMap = unitMap.get(subUnitId);
184
+ if (!subUnitMap) {
185
+ subUnitMap = /* @__PURE__ */ new Map();
186
+ unitMap.set(subUnitId, subUnitMap);
187
+ }
188
+ return subUnitMap;
189
+ }
190
+ _replaceComment(unitId, subUnitId, comment) {
191
+ const commentMap = this._ensureCommentMap(unitId, subUnitId);
192
+ const currentComment = commentMap.get(comment.id);
193
+ if (currentComment) {
194
+ const { children, ...rest } = comment;
195
+ const newComment = {
196
+ ...rest,
197
+ ref: currentComment.ref
198
+ };
199
+ commentMap.set(comment.id, newComment);
200
+ children === null || children === void 0 || children.forEach((child) => {
201
+ commentMap.set(child.id, {
202
+ ...child,
203
+ ref: ""
204
+ });
205
+ });
206
+ this._commentUpdate$.next({
207
+ unitId,
208
+ subUnitId,
209
+ type: "syncUpdate",
210
+ payload: newComment
211
+ });
212
+ if (Boolean(comment.resolved) !== Boolean(currentComment.resolved)) this._commentUpdate$.next({
213
+ unitId,
214
+ subUnitId,
215
+ type: "resolve",
216
+ payload: {
217
+ commentId: comment.id,
218
+ resolved: Boolean(comment.resolved)
219
+ }
220
+ });
221
+ }
222
+ }
223
+ async syncThreadComments(unitId, subUnitId, threadIds) {
224
+ if (this._lifecycleService.stage < _univerjs_core.LifecycleStages.Rendered) {
225
+ this._tasks.push({
226
+ unitId,
227
+ subUnitId,
228
+ threadIds
229
+ });
230
+ return;
231
+ }
232
+ const threadMap = this._ensureThreadMap(unitId, subUnitId);
233
+ const commentMap = this._ensureCommentMap(unitId, subUnitId);
234
+ const comments = await this._dataSourceService.listThreadComments(unitId, subUnitId, threadIds);
235
+ if (!comments) return;
236
+ const deleteThreads = new Set(threadIds);
237
+ comments.forEach((comment) => {
238
+ this._replaceComment(unitId, subUnitId, comment);
239
+ deleteThreads.delete(comment.threadId);
240
+ });
241
+ deleteThreads.forEach((id) => {
242
+ threadMap.delete(id);
243
+ commentMap.forEach((comment, commentId) => {
244
+ if (comment.threadId === id) commentMap.delete(commentId);
245
+ });
246
+ });
247
+ }
248
+ addComment(unitId, subUnitId, origin, shouldSync) {
249
+ const commentMap = this._ensureCommentMap(unitId, subUnitId);
250
+ const { parentId, children = [], ...rest } = origin;
251
+ const comment = {
252
+ ...rest,
253
+ parentId: parentId === origin.id ? void 0 : parentId
254
+ };
255
+ if (!comment.threadId) comment.threadId = comment.parentId || comment.id;
256
+ const addCommentItem = (item) => {
257
+ commentMap.set(item.id, item);
258
+ this._commentUpdate$.next({
259
+ unitId,
260
+ subUnitId,
261
+ type: "add",
262
+ payload: item,
263
+ isRoot: !item.parentId
264
+ });
265
+ };
266
+ addCommentItem(comment);
267
+ const threadMap = this._ensureThreadMap(unitId, subUnitId);
268
+ if (!comment.parentId) {
269
+ threadMap.set(comment.threadId, comment);
270
+ for (const child of children) addCommentItem(child);
271
+ }
272
+ if (shouldSync) this.syncThreadComments(unitId, subUnitId, [comment.threadId]);
273
+ return true;
274
+ }
275
+ updateComment(unitId, subUnitId, payload, silent) {
276
+ const oldComment = this._ensureCommentMap(unitId, subUnitId).get(payload.commentId);
277
+ if (!oldComment) return true;
278
+ oldComment.updated = true;
279
+ oldComment.text = payload.text;
280
+ oldComment.attachments = payload.attachments;
281
+ oldComment.updateT = payload.updateT;
282
+ this._commentUpdate$.next({
283
+ unitId,
284
+ subUnitId,
285
+ type: "update",
286
+ payload,
287
+ silent
288
+ });
289
+ return true;
290
+ }
291
+ updateCommentRef(unitId, subUnitId, payload, silent) {
292
+ const oldComment = this._ensureCommentMap(unitId, subUnitId).get(payload.commentId);
293
+ if (!oldComment) return false;
294
+ oldComment.ref = payload.ref;
295
+ this._commentUpdate$.next({
296
+ unitId,
297
+ subUnitId,
298
+ type: "updateRef",
299
+ payload,
300
+ silent,
301
+ threadId: oldComment.threadId
302
+ });
303
+ return true;
304
+ }
305
+ resolveComment(unitId, subUnitId, commentId, resolved) {
306
+ const oldComment = this._ensureCommentMap(unitId, subUnitId).get(commentId);
307
+ if (!oldComment) return false;
308
+ oldComment.resolved = resolved;
309
+ this._commentUpdate$.next({
310
+ unitId,
311
+ subUnitId,
312
+ type: "resolve",
313
+ payload: {
314
+ commentId,
315
+ resolved
316
+ }
317
+ });
318
+ return true;
319
+ }
320
+ getComment(unitId, subUnitId, commentId) {
321
+ return this._ensureCommentMap(unitId, subUnitId).get(commentId);
322
+ }
323
+ getRootComment(unitId, subUnitId, threadId) {
324
+ return this._ensureThreadMap(unitId, subUnitId).get(threadId);
325
+ }
326
+ getThread(unitId, subUnitId, threadId) {
327
+ const commentMap = this._ensureCommentMap(unitId, subUnitId);
328
+ const comments = Array.from(commentMap.values()).filter((comment) => comment.threadId === threadId);
329
+ let root;
330
+ const children = [];
331
+ const relativeUsers = /* @__PURE__ */ new Set();
332
+ for (const comment of comments) {
333
+ if (!comment.parentId) root = comment;
334
+ else children.push(comment);
335
+ relativeUsers.add(comment.personId);
336
+ }
337
+ if (!root) return;
338
+ return {
339
+ root,
340
+ children,
341
+ relativeUsers,
342
+ unitId,
343
+ subUnitId,
344
+ threadId
345
+ };
346
+ }
347
+ getCommentWithChildren(unitId, subUnitId, commentId) {
348
+ const comment = this.getComment(unitId, subUnitId, commentId);
349
+ if (!comment) return;
350
+ return this.getThread(unitId, subUnitId, comment.threadId);
351
+ }
352
+ _deleteComment(unitId, subUnitId, commentId) {
353
+ const commentMap = this._ensureCommentMap(unitId, subUnitId);
354
+ const current = commentMap.get(commentId);
355
+ if (!current) return;
356
+ commentMap.delete(commentId);
357
+ this._commentUpdate$.next({
358
+ unitId,
359
+ subUnitId,
360
+ type: "delete",
361
+ payload: {
362
+ commentId,
363
+ isRoot: !current.parentId,
364
+ comment: current
365
+ }
366
+ });
367
+ }
368
+ deleteThread(unitId, subUnitId, threadId) {
369
+ this._ensureThreadMap(unitId, subUnitId).delete(threadId);
370
+ this._ensureCommentMap(unitId, subUnitId).forEach((comment) => {
371
+ if (comment.threadId === threadId) this._deleteComment(unitId, subUnitId, comment.id);
372
+ });
373
+ }
374
+ deleteComment(unitId, subUnitId, commentId) {
375
+ const current = this._ensureCommentMap(unitId, subUnitId).get(commentId);
376
+ if (!current) return true;
377
+ if (current.parentId) this._deleteComment(unitId, subUnitId, commentId);
378
+ else this.deleteThread(unitId, subUnitId, current.threadId);
379
+ return true;
380
+ }
381
+ deleteUnit(unitId) {
382
+ const unitMap = this._commentsMap.get(unitId);
383
+ if (!unitMap) return;
384
+ unitMap.forEach((subUnitMap, subUnitId) => {
385
+ subUnitMap.forEach((comment) => {
386
+ this.deleteComment(unitId, subUnitId, comment.id);
387
+ });
388
+ });
389
+ }
390
+ getUnit(unitId) {
391
+ const unitMap = this._threadMap.get(unitId);
392
+ if (!unitMap) return [];
393
+ const threads = [];
394
+ unitMap.forEach((subUnitSet, subUnitId) => {
395
+ subUnitSet.forEach((threadComment, threadId) => {
396
+ const thread = this.getThread(unitId, subUnitId, threadId);
397
+ if (thread) threads.push(thread);
398
+ });
399
+ });
400
+ return threads;
401
+ }
402
+ getAll() {
403
+ const all = [];
404
+ this._commentsMap.forEach((unitMap, unitId) => {
405
+ all.push({
406
+ unitId,
407
+ threads: this.getUnit(unitId)
408
+ });
409
+ });
410
+ return all;
411
+ }
412
+ };
413
+ ThreadCommentModel = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(IThreadCommentDataSourceService)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.LifecycleService))], ThreadCommentModel);
414
+
415
+ //#endregion
416
+ //#region src/commands/mutations/comment.mutation.ts
417
+ const AddCommentMutation = {
418
+ id: "thread-comment.mutation.add-comment",
419
+ type: _univerjs_core.CommandType.MUTATION,
420
+ handler(accessor, params, options) {
421
+ if (!params) return false;
422
+ const threadCommentModel = accessor.get(ThreadCommentModel);
423
+ const { unitId, subUnitId, comment, sync } = params;
424
+ const shouldSync = sync || (options === null || options === void 0 ? void 0 : options.fromChangeset) && !comment.parentId;
425
+ return threadCommentModel.addComment(unitId, subUnitId, comment, shouldSync);
426
+ }
427
+ };
428
+ const UpdateCommentMutation = {
429
+ id: "thread-comment.mutation.update-comment",
430
+ type: _univerjs_core.CommandType.MUTATION,
431
+ handler(accessor, params) {
432
+ if (!params) return false;
433
+ const threadCommentModel = accessor.get(ThreadCommentModel);
434
+ const { unitId, subUnitId, payload, silent } = params;
435
+ return threadCommentModel.updateComment(unitId, subUnitId, payload, silent);
436
+ }
437
+ };
438
+ const UpdateCommentRefMutation = {
439
+ id: "thread-comment.mutation.update-comment-ref",
440
+ type: _univerjs_core.CommandType.MUTATION,
441
+ handler(accessor, params) {
442
+ if (!params) return false;
443
+ const threadCommentModel = accessor.get(ThreadCommentModel);
444
+ const { unitId, subUnitId, payload, silent } = params;
445
+ return threadCommentModel.updateCommentRef(unitId, subUnitId, payload, silent);
446
+ }
447
+ };
448
+ const ResolveCommentMutation = {
449
+ id: "thread-comment.mutation.resolve-comment",
450
+ type: _univerjs_core.CommandType.MUTATION,
451
+ handler(accessor, params) {
452
+ if (!params) return false;
453
+ const threadCommentModel = accessor.get(ThreadCommentModel);
454
+ const { unitId, subUnitId, resolved, commentId } = params;
455
+ return threadCommentModel.resolveComment(unitId, subUnitId, commentId, resolved);
456
+ }
457
+ };
458
+ const DeleteCommentMutation = {
459
+ id: "thread-comment.mutation.delete-comment",
460
+ type: _univerjs_core.CommandType.MUTATION,
461
+ handler(accessor, params) {
462
+ if (!params) return false;
463
+ const threadCommentModel = accessor.get(ThreadCommentModel);
464
+ const { unitId, subUnitId, commentId } = params;
465
+ return threadCommentModel.deleteComment(unitId, subUnitId, commentId);
466
+ }
467
+ };
468
+
469
+ //#endregion
470
+ //#region src/commands/commands/comment.command.ts
471
+ const AddCommentCommand = {
472
+ id: "thread-comment.command.add-comment",
473
+ type: _univerjs_core.CommandType.COMMAND,
474
+ async handler(accessor, params) {
475
+ if (!params) return false;
476
+ const commandService = accessor.get(_univerjs_core.ICommandService);
477
+ const dataSourceService = accessor.get(IThreadCommentDataSourceService);
478
+ const { comment: originComment } = params;
479
+ const comment = await dataSourceService.addComment(originComment);
480
+ const syncUpdateMutationToColla = dataSourceService.syncUpdateMutationToColla;
481
+ const isRoot = !originComment.parentId;
482
+ const redo = {
483
+ id: AddCommentMutation.id,
484
+ params: {
485
+ ...params,
486
+ comment
487
+ }
488
+ };
489
+ if (isRoot) return await commandService.executeCommand(redo.id, redo.params);
490
+ return commandService.executeCommand(redo.id, redo.params, { onlyLocal: !syncUpdateMutationToColla });
491
+ }
492
+ };
493
+ const UpdateCommentCommand = {
494
+ id: "thread-comment.command.update-comment",
495
+ type: _univerjs_core.CommandType.COMMAND,
496
+ async handler(accessor, params) {
497
+ if (!params) return false;
498
+ const { unitId, subUnitId, payload } = params;
499
+ const commandService = accessor.get(_univerjs_core.ICommandService);
500
+ const threadCommentModel = accessor.get(ThreadCommentModel);
501
+ const dataSourceService = accessor.get(IThreadCommentDataSourceService);
502
+ const syncUpdateMutationToColla = dataSourceService.syncUpdateMutationToColla;
503
+ const current = threadCommentModel.getComment(unitId, subUnitId, payload.commentId);
504
+ if (!current) return false;
505
+ const { children, ...currentComment } = current;
506
+ if (!await dataSourceService.updateComment({
507
+ ...currentComment,
508
+ ...payload
509
+ })) return false;
510
+ const redo = {
511
+ id: UpdateCommentMutation.id,
512
+ params
513
+ };
514
+ commandService.executeCommand(redo.id, redo.params, { onlyLocal: !syncUpdateMutationToColla });
515
+ return true;
516
+ }
517
+ };
518
+ const ResolveCommentCommand = {
519
+ id: "thread-comment.command.resolve-comment",
520
+ type: _univerjs_core.CommandType.COMMAND,
521
+ async handler(accessor, params) {
522
+ if (!params) return false;
523
+ const { unitId, subUnitId, resolved, commentId } = params;
524
+ const dataSourceService = accessor.get(IThreadCommentDataSourceService);
525
+ const currentComment = accessor.get(ThreadCommentModel).getComment(unitId, subUnitId, commentId);
526
+ const syncUpdateMutationToColla = dataSourceService.syncUpdateMutationToColla;
527
+ if (!currentComment) return false;
528
+ if (!await dataSourceService.resolveComment({
529
+ ...currentComment,
530
+ resolved
531
+ })) return false;
532
+ return accessor.get(_univerjs_core.ICommandService).executeCommand(ResolveCommentMutation.id, params, { onlyLocal: !syncUpdateMutationToColla });
533
+ }
534
+ };
535
+ /**
536
+ * Delete Reply
537
+ */
538
+ const DeleteCommentCommand = {
539
+ id: "thread-comment.command.delete-comment",
540
+ type: _univerjs_core.CommandType.COMMAND,
541
+ async handler(accessor, params) {
542
+ if (!params) return false;
543
+ const threadCommentModel = accessor.get(ThreadCommentModel);
544
+ const dataSourceService = accessor.get(IThreadCommentDataSourceService);
545
+ const commandService = accessor.get(_univerjs_core.ICommandService);
546
+ const { unitId, subUnitId, commentId } = params;
547
+ const syncUpdateMutationToColla = dataSourceService.syncUpdateMutationToColla;
548
+ const comment = threadCommentModel.getComment(unitId, subUnitId, commentId);
549
+ if (!comment) return false;
550
+ if (!await dataSourceService.deleteComment(unitId, subUnitId, comment.threadId, commentId)) return false;
551
+ const redo = {
552
+ id: DeleteCommentMutation.id,
553
+ params
554
+ };
555
+ return commandService.executeCommand(redo.id, redo.params, { onlyLocal: !syncUpdateMutationToColla });
556
+ }
557
+ };
558
+ const DeleteCommentTreeCommand = {
559
+ id: "thread-comment.command.delete-comment-tree",
560
+ type: _univerjs_core.CommandType.COMMAND,
561
+ async handler(accessor, params) {
562
+ if (!params) return false;
563
+ const threadCommentModel = accessor.get(ThreadCommentModel);
564
+ const commandService = accessor.get(_univerjs_core.ICommandService);
565
+ const dataSourceService = accessor.get(IThreadCommentDataSourceService);
566
+ const { unitId, subUnitId, commentId } = params;
567
+ const commentWithChildren = threadCommentModel.getCommentWithChildren(unitId, subUnitId, commentId);
568
+ if (!commentWithChildren) return false;
569
+ if (!await dataSourceService.deleteComment(unitId, subUnitId, commentWithChildren.root.threadId, commentId)) return false;
570
+ return await commandService.executeCommand(DeleteCommentMutation.id, {
571
+ unitId,
572
+ subUnitId,
573
+ commentId: commentWithChildren.root.id
574
+ });
575
+ }
576
+ };
577
+
578
+ //#endregion
579
+ //#region src/common/utils.ts
580
+ /**
581
+ * Copyright 2023-present DreamNum Co., Ltd.
582
+ *
583
+ * Licensed under the Apache License, Version 2.0 (the "License");
584
+ * you may not use this file except in compliance with the License.
585
+ * You may obtain a copy of the License at
586
+ *
587
+ * http://www.apache.org/licenses/LICENSE-2.0
588
+ *
589
+ * Unless required by applicable law or agreed to in writing, software
590
+ * distributed under the License is distributed on an "AS IS" BASIS,
591
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
592
+ * See the License for the specific language governing permissions and
593
+ * limitations under the License.
594
+ */
595
+ function getDT(date) {
596
+ return (0, _univerjs_core.dateKit)(date).format("YYYY/MM/DD HH:mm");
597
+ }
598
+
599
+ //#endregion
600
+ //#region src/types/const/index.ts
601
+ /**
602
+ * Copyright 2023-present DreamNum Co., Ltd.
603
+ *
604
+ * Licensed under the Apache License, Version 2.0 (the "License");
605
+ * you may not use this file except in compliance with the License.
606
+ * You may obtain a copy of the License at
607
+ *
608
+ * http://www.apache.org/licenses/LICENSE-2.0
609
+ *
610
+ * Unless required by applicable law or agreed to in writing, software
611
+ * distributed under the License is distributed on an "AS IS" BASIS,
612
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
613
+ * See the License for the specific language governing permissions and
614
+ * limitations under the License.
615
+ */
616
+ const TC_PLUGIN_NAME = "UNIVER_THREAD_COMMENT_PLUGIN";
617
+
618
+ //#endregion
619
+ //#region src/controllers/tc-resource.controller.ts
620
+ const SHEET_UNIVER_THREAD_COMMENT_PLUGIN = `SHEET_${TC_PLUGIN_NAME}`;
621
+ let ThreadCommentResourceController = class ThreadCommentResourceController extends _univerjs_core.Disposable {
622
+ constructor(_resourceManagerService, _threadCommentModel, _threadCommentDataSourceService) {
623
+ super();
624
+ this._resourceManagerService = _resourceManagerService;
625
+ this._threadCommentModel = _threadCommentModel;
626
+ this._threadCommentDataSourceService = _threadCommentDataSourceService;
627
+ this._initSnapshot();
628
+ }
629
+ _initSnapshot() {
630
+ const toJson = (unitID) => {
631
+ const map = this._threadCommentModel.getUnit(unitID);
632
+ const resultMap = {};
633
+ if (map) {
634
+ map.forEach((info) => {
635
+ var _resultMap$info$subUn;
636
+ const subUnitComments = (_resultMap$info$subUn = resultMap[info.subUnitId]) !== null && _resultMap$info$subUn !== void 0 ? _resultMap$info$subUn : [];
637
+ subUnitComments.push({
638
+ ...info.root,
639
+ children: info.children
640
+ });
641
+ resultMap[info.subUnitId] = subUnitComments;
642
+ });
643
+ return JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(resultMap, unitID));
644
+ }
645
+ return "";
646
+ };
647
+ const parseJson = (json) => {
648
+ if (!json) return {};
649
+ try {
650
+ return JSON.parse(json);
651
+ } catch (err) {
652
+ return {};
653
+ }
654
+ };
655
+ this.disposeWithMe(this._resourceManagerService.registerPluginResource({
656
+ pluginName: SHEET_UNIVER_THREAD_COMMENT_PLUGIN,
657
+ businesses: [_univerjs_core.UniverInstanceType.UNIVER_SHEET, _univerjs_core.UniverInstanceType.UNIVER_DOC],
658
+ toJson: (unitID) => toJson(unitID),
659
+ parseJson: (json) => parseJson(json),
660
+ onUnLoad: (unitID) => {
661
+ this._threadCommentModel.deleteUnit(unitID);
662
+ },
663
+ onLoad: async (unitID, value) => {
664
+ Object.keys(value).forEach((subunitId) => {
665
+ const commentList = value[subunitId];
666
+ commentList.forEach((comment) => {
667
+ this._threadCommentModel.addComment(unitID, subunitId, comment);
668
+ });
669
+ this._threadCommentModel.syncThreadComments(unitID, subunitId, commentList.map((i) => i.threadId));
670
+ });
671
+ }
672
+ }));
673
+ }
674
+ };
675
+ ThreadCommentResourceController = __decorate([
676
+ __decorateParam(0, _univerjs_core.IResourceManagerService),
677
+ __decorateParam(1, (0, _univerjs_core.Inject)(ThreadCommentModel)),
678
+ __decorateParam(2, IThreadCommentDataSourceService)
679
+ ], ThreadCommentResourceController);
680
+
681
+ //#endregion
682
+ //#region package.json
683
+ var name = "@univerjs/thread-comment";
684
+ var version = "0.21.0-insiders.20260424-262d69f";
685
+
686
+ //#endregion
687
+ //#region src/config/config.ts
688
+ const THREAD_COMMENT_PLUGIN_CONFIG_KEY = "thread-comment.config";
689
+ const configSymbol = Symbol(THREAD_COMMENT_PLUGIN_CONFIG_KEY);
690
+ const defaultPluginConfig = {};
691
+
692
+ //#endregion
693
+ //#region src/plugin.ts
694
+ let UniverThreadCommentPlugin = class UniverThreadCommentPlugin extends _univerjs_core.Plugin {
695
+ constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
696
+ super();
697
+ this._config = _config;
698
+ this._injector = _injector;
699
+ this._commandService = _commandService;
700
+ this._configService = _configService;
701
+ const { ...rest } = (0, _univerjs_core.merge)({}, defaultPluginConfig, this._config);
702
+ this._configService.setConfig(THREAD_COMMENT_PLUGIN_CONFIG_KEY, rest);
703
+ }
704
+ onStarting() {
705
+ var _this$_config;
706
+ (0, _univerjs_core.mergeOverrideWithDependencies)([
707
+ [IThreadCommentDataSourceService, { useClass: ThreadCommentDataSourceService }],
708
+ [ThreadCommentModel],
709
+ [ThreadCommentResourceController]
710
+ ], (_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.overrides).forEach((d) => {
711
+ this._injector.add(d);
712
+ });
713
+ [
714
+ AddCommentCommand,
715
+ UpdateCommentCommand,
716
+ DeleteCommentCommand,
717
+ ResolveCommentCommand,
718
+ DeleteCommentTreeCommand,
719
+ AddCommentMutation,
720
+ UpdateCommentMutation,
721
+ UpdateCommentRefMutation,
722
+ DeleteCommentMutation,
723
+ ResolveCommentMutation
724
+ ].forEach((command) => {
725
+ this._commandService.registerCommand(command);
726
+ });
727
+ this._injector.get(ThreadCommentResourceController);
728
+ }
729
+ };
730
+ _defineProperty(UniverThreadCommentPlugin, "pluginName", TC_PLUGIN_NAME);
731
+ _defineProperty(UniverThreadCommentPlugin, "packageName", name);
732
+ _defineProperty(UniverThreadCommentPlugin, "version", version);
733
+ _defineProperty(UniverThreadCommentPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_UNKNOWN);
734
+ UniverThreadCommentPlugin = __decorate([
735
+ __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
736
+ __decorateParam(2, _univerjs_core.ICommandService),
737
+ __decorateParam(3, _univerjs_core.IConfigService)
738
+ ], UniverThreadCommentPlugin);
739
+
740
+ //#endregion
741
+ exports.AddCommentCommand = AddCommentCommand;
742
+ exports.AddCommentMutation = AddCommentMutation;
743
+ exports.DeleteCommentCommand = DeleteCommentCommand;
744
+ exports.DeleteCommentMutation = DeleteCommentMutation;
745
+ exports.DeleteCommentTreeCommand = DeleteCommentTreeCommand;
746
+ exports.IThreadCommentDataSourceService = IThreadCommentDataSourceService;
747
+ exports.ResolveCommentCommand = ResolveCommentCommand;
748
+ exports.ResolveCommentMutation = ResolveCommentMutation;
749
+ exports.SHEET_UNIVER_THREAD_COMMENT_PLUGIN = SHEET_UNIVER_THREAD_COMMENT_PLUGIN;
750
+ exports.TC_PLUGIN_NAME = TC_PLUGIN_NAME;
751
+ exports.ThreadCommentDataSourceService = ThreadCommentDataSourceService;
752
+ Object.defineProperty(exports, 'ThreadCommentModel', {
753
+ enumerable: true,
754
+ get: function () {
755
+ return ThreadCommentModel;
756
+ }
757
+ });
758
+ Object.defineProperty(exports, 'ThreadCommentResourceController', {
759
+ enumerable: true,
760
+ get: function () {
761
+ return ThreadCommentResourceController;
762
+ }
763
+ });
764
+ Object.defineProperty(exports, 'UniverThreadCommentPlugin', {
765
+ enumerable: true,
766
+ get: function () {
767
+ return UniverThreadCommentPlugin;
768
+ }
769
+ });
770
+ exports.UpdateCommentCommand = UpdateCommentCommand;
771
+ exports.UpdateCommentMutation = UpdateCommentMutation;
772
+ exports.UpdateCommentRefMutation = UpdateCommentRefMutation;
773
+ exports.getDT = getDT;