@univerjs/preset-docs-node-core 0.10.4 → 0.10.6

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/umd/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  // @univerjs/docs/index
2
- (function(l,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","rxjs"],r):(l=typeof globalThis<"u"?globalThis:l||self,r(l.UniverDocs={},l.UniverCore,l.UniverEngineRender,l.rxjs))})(this,function(l,r,v,p){"use strict";var de=Object.defineProperty;var ge=(l,r,v)=>r in l?de(l,r,{enumerable:!0,configurable:!0,writable:!0,value:v}):l[r]=v;var g=(l,r,v)=>ge(l,typeof r!="symbol"?r+"":r,v);var w;const M={id:"doc.operation.set-selections",type:r.CommandType.OPERATION,handler:()=>!0};var L=Object.getOwnPropertyDescriptor,G=(c,s,e,t)=>{for(var n=t>1?void 0:t?L(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},N=(c,s)=>(e,t)=>s(e,t,c);l.DocSelectionManagerService=class extends r.RxDisposable{constructor(e,t){super();g(this,"_currentSelection",null);g(this,"_textSelectionInfo",new Map);g(this,"_textSelection$",new p.Subject);g(this,"textSelection$",this._textSelection$.asObservable());g(this,"_refreshSelection$",new p.BehaviorSubject(null));g(this,"refreshSelection$",this._refreshSelection$.asObservable());this._commandService=e,this._univerInstanceService=t,this._listenCurrentUnit()}_listenCurrentUnit(){this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_DOC).pipe(p.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const t=e.getUnitId();this._setCurrentSelectionNotRefresh({unitId:t,subUnitId:t})})}__getCurrentSelection(){return this._currentSelection}getSelectionInfo(e=this._currentSelection){return this._getTextRanges(e)}refreshSelection(e=this._currentSelection){e!=null&&this._refresh(e)}__TEST_ONLY_setCurrentSelection(e){this._currentSelection=e,this._refresh(e)}getTextRanges(e=this._currentSelection){var t;return(t=this._getTextRanges(e))==null?void 0:t.textRanges}getRectRanges(e=this._currentSelection){var t;return(t=this._getTextRanges(e))==null?void 0:t.rectRanges}getDocRanges(e=this._currentSelection){var o,a;const t=(o=this.getTextRanges(e))!=null?o:[],n=(a=this.getRectRanges(e))!=null?a:[];return[...t,...n].filter(u=>u.startOffset!=null&&u.endOffset!=null).sort((u,d)=>u.startOffset>d.startOffset?1:u.startOffset<d.startOffset?-1:0)}getActiveTextRange(){const e=this._getTextRanges(this._currentSelection);if(e==null)return;const{textRanges:t}=e;return t.find(n=>n.isActive)}getActiveRectRange(){const e=this._getTextRanges(this._currentSelection);if(e==null)return;const{rectRanges:t}=e;return t.find(n=>n.isActive)}__TEST_ONLY_add(e,t=!0){this._currentSelection!=null&&this._addByParam({...this._currentSelection,textRanges:e,rectRanges:[],segmentId:"",segmentPage:-1,isEditing:t,style:v.NORMAL_TEXT_SELECTION_PLUGIN_STYLE})}replaceTextRanges(e,t=!0,n){return this.replaceDocRanges(e,this._currentSelection,t,n)}replaceDocRanges(e,t=this._currentSelection,n=!0,i){if(t==null)return;const{unitId:o,subUnitId:a}=t;this._refreshSelection$.next({unitId:o,subUnitId:a,docRanges:e,isEditing:n,options:i})}__replaceTextRangesWithNoRefresh(e,t){if(this._currentSelection==null)return;const n={...e,...t};this._replaceByParam(n),this._textSelection$.next(n);const{unitId:i,subUnitId:o,segmentId:a,style:u,textRanges:d,rectRanges:h,isEditing:S}=n,I=[...d,...h].filter(_=>_.startOffset!=null&&_.endOffset!=null).sort((_,f)=>_.startOffset>f.startOffset?1:_.startOffset<f.startOffset?-1:0);this._commandService.executeCommand(M.id,{unitId:i,subUnitId:o,segmentId:a,style:u,isEditing:S,ranges:I})}dispose(){this._textSelection$.complete()}_setCurrentSelectionNotRefresh(e){this._currentSelection=e}_getTextRanges(e){var i;if(e==null)return;const{unitId:t,subUnitId:n=""}=e;return(i=this._textSelectionInfo.get(t))==null?void 0:i.get(n)}_refresh(e){const t=this._getTextRanges(e);if(t==null)return;const{textRanges:n,rectRanges:i}=t,o=[...n,...i],{unitId:a,subUnitId:u}=e;this._refreshSelection$.next({unitId:a,subUnitId:u,docRanges:o,isEditing:!1})}_replaceByParam(e){const{unitId:t,subUnitId:n,...i}=e;this._textSelectionInfo.has(t)||this._textSelectionInfo.set(t,new Map),this._textSelectionInfo.get(t).set(n,{...i})}_addByParam(e){const{unitId:t,subUnitId:n,...i}=e;this._textSelectionInfo.has(t)||this._textSelectionInfo.set(t,new Map);const o=this._textSelectionInfo.get(t);o.has(n)?o.get(n).textRanges.push(...e.textRanges):o.set(n,{...i})}},l.DocSelectionManagerService=G([N(0,r.ICommandService),N(1,r.IUniverInstanceService)],l.DocSelectionManagerService);var z=Object.getOwnPropertyDescriptor,W=(c,s,e,t)=>{for(var n=t>1?void 0:t?z(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},$=(c,s)=>(e,t)=>s(e,t,c);l.DocSkeletonManagerService=class extends r.RxDisposable{constructor(e,t,n){super();g(this,"_skeleton");g(this,"_docViewModel");g(this,"_currentSkeleton$",new p.BehaviorSubject(null));g(this,"currentSkeleton$",this._currentSkeleton$.asObservable());g(this,"_currentSkeletonBefore$",new p.BehaviorSubject(null));g(this,"currentSkeletonBefore$",this._currentSkeletonBefore$.asObservable());g(this,"_currentViewModel$",new p.BehaviorSubject(null));g(this,"currentViewModel$",this._currentViewModel$.asObservable());this._context=e,this._localeService=t,this._univerInstanceService=n,this._init(),this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_DOC).pipe(p.takeUntil(this.dispose$)).subscribe(i=>{i&&i.getUnitId()===this._context.unitId&&this._update(i)})}dispose(){super.dispose(),this._currentSkeletonBefore$.complete(),this._currentSkeleton$.complete()}getSkeleton(){return this._skeleton}getViewModel(){return this._docViewModel}_init(){const e=this._context.unit;this._update(e)}_update(e){const t=this._context.unitId;if(e.getBody()==null)return;this._docViewModel&&r.isInternalEditorID(t)?(this._docViewModel.reset(e),this._context.unit=e):this._docViewModel||(this._docViewModel=this._buildDocViewModel(e)),this._skeleton||(this._skeleton=this._buildSkeleton(this._docViewModel));const n=this._skeleton;n.calculate(),this._currentSkeletonBefore$.next(n),this._currentSkeleton$.next(n),this._currentViewModel$.next(this._docViewModel)}_buildSkeleton(e){return v.DocumentSkeleton.create(e,this._localeService)}_buildDocViewModel(e){return new v.DocumentViewModel(e)}},l.DocSkeletonManagerService=W([$(1,r.Inject(r.LocaleService)),$(2,r.IUniverInstanceService)],l.DocSkeletonManagerService);class y extends r.RxDisposable{constructor(){super();g(this,"_docStateChangeParams$",new p.BehaviorSubject(null));g(this,"docStateChangeParams$",this._docStateChangeParams$.asObservable())}emitStateChangeInfo(e){this._docStateChangeParams$.next(e)}dispose(){super.dispose(),this._docStateChangeParams$.complete()}}const P="doc.mutation.rich-text-editing",O={id:P,type:r.CommandType.MUTATION,handler:(c,s)=>{var X,F;const{unitId:e,segmentId:t="",actions:n,textRanges:i,prevTextRanges:o,trigger:a,noHistory:u,isCompositionEnd:d,noNeedSetTextRange:h,debounce:S,isEditing:I=!0,isSync:_,syncer:f}=s,D=c.get(r.IUniverInstanceService),R=c.get(v.IRenderManagerService),C=c.get(y),m=D.getUniverDocInstance(e),V=(X=R.getRenderById(e))==null?void 0:X.with(l.DocSkeletonManagerService).getViewModel();if(m==null||V==null)throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${e}`);const j=c.get(l.DocSelectionManagerService),E=(F=j.getDocRanges())!=null?F:[],le=!!m.getSnapshot().disabled;if(r.JSONX.isNoop(n)||n&&n.length===0||le)return{unitId:e,actions:[],textRanges:E};const A=r.JSONX.invertWithDoc(n,m.getSnapshot());m.apply(n),V.reset(m),!h&&i&&a!=null&&!_&&queueMicrotask(()=>{j.replaceDocRanges(i,{unitId:e,subUnitId:e},I,s.options)});const ue={commandId:P,unitId:e,segmentId:t,trigger:a,noHistory:u,debounce:S,redoState:{actions:n,textRanges:i},undoState:{actions:A,textRanges:o!=null?o:E},isCompositionEnd:d,isSync:_,syncer:f};return C.emitStateChangeInfo(ue),{unitId:e,actions:A,textRanges:E}}},J={id:"doc.mutation.rename-doc",type:r.CommandType.MUTATION,handler:(c,s)=>{const t=c.get(r.IUniverInstanceService).getUnit(s.unitId,r.UniverInstanceType.UNIVER_DOC);return t?(t.setName(s.name),!0):!1}},Y="docs.config",B={};var K=Object.getOwnPropertyDescriptor,q=(c,s,e,t)=>{for(var n=t>1?void 0:t?K(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},U=(c,s)=>(e,t)=>s(e,t,c);let T=class extends r.Disposable{constructor(c,s,e){super(),this._commandService=c,this._textSelectionManagerService=s,this._univerInstanceService=e,this._initSelectionChange()}_transformCustomRange(c,s){var o;const{startOffset:e,endOffset:t,collapsed:n}=s,i=(o=c.getCustomRanges())==null?void 0:o.filter(a=>!a.wholeEntity||e<=a.startIndex&&t>a.endIndex?!1:n?a.startIndex<e&&a.endIndex>=t:r.BuildTextUtils.range.isIntersects(e,t-1,a.startIndex,a.endIndex));if(i!=null&&i.length){let a=e,u=t;return i.forEach(d=>{a=Math.min(d.startIndex,a),u=Math.max(d.endIndex+1,u)}),{...s,startOffset:a,endOffset:u,collapsed:a===u}}return s}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(c=>{if(c.id===M.id){const s=c.params,{unitId:e,ranges:t,isEditing:n}=s,i=this._univerInstanceService.getUnit(e);if(!i)return;const o=t.map(a=>this._transformCustomRange(i,a));o.some((a,u)=>t[u]!==a)&&this._textSelectionManagerService.replaceTextRanges(o,n)}}))}};T=q([U(0,r.ICommandService),U(1,r.Inject(l.DocSelectionManagerService)),U(2,r.IUniverInstanceService)],T);var H=Object.getOwnPropertyDescriptor,Q=(c,s,e,t)=>{for(var n=t>1?void 0:t?H(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},k=(c,s)=>(e,t)=>s(e,t,c);const Z="DOCS_PLUGIN";l.UniverDocsPlugin=(w=class extends r.Plugin{constructor(s=B,e,t){super(),this._config=s,this._injector=e,this._configService=t;const{...n}=r.merge({},B,this._config);this._configService.setConfig(Y,n)}onStarting(){this._initializeDependencies(),this._initializeCommands()}_initializeCommands(){[O,J,M].forEach(s=>{this._injector.get(r.ICommandService).registerCommand(s)})}_initializeDependencies(){[[l.DocSelectionManagerService],[y],[T]].forEach(s=>this._injector.add(s))}onReady(){this._injector.get(T)}},g(w,"pluginName",Z),w),l.UniverDocsPlugin=Q([k(1,r.Inject(r.Injector)),k(2,r.IConfigService)],l.UniverDocsPlugin);const ee=r.createInterceptorKey("CUSTOM_RANGE"),te=r.createInterceptorKey("CUSTOM_DECORATION"),x={CUSTOM_RANGE:ee,CUSTOM_DECORATION:te};var ne=Object.getOwnPropertyDescriptor,ie=(c,s,e,t)=>{for(var n=t>1?void 0:t?ne(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},se=(c,s)=>(e,t)=>s(e,t,c);l.DocInterceptorService=class extends r.Disposable{constructor(e,t){super();g(this,"_interceptorsByName",new Map);this._context=e,this._docSkeletonManagerService=t;const n=this._docSkeletonManagerService.getViewModel(),i=n.getDataModel().getUnitId();if(i===r.DOCS_NORMAL_EDITOR_UNIT_ID_KEY||i===r.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;this.disposeWithMe(this.interceptDocumentViewModel(n)),this.disposeWithMe(this.intercept(x.CUSTOM_RANGE,{priority:-1,handler:(a,u,d)=>d(a)}));let o=new r.DisposableCollection;n.segmentViewModels$.subscribe(a=>{o.dispose(),o=new r.DisposableCollection,a.forEach(u=>{o.add(this.interceptDocumentViewModel(u))})}),this.disposeWithMe(o)}intercept(e,t){const n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);const i=this._interceptorsByName.get(n);return i.push(t),this._interceptorsByName.set(n,i.sort((o,a)=>{var u,d;return((u=a.priority)!=null?u:0)-((d=o.priority)!=null?d:0)})),this.disposeWithMe(r.toDisposable(()=>r.remove(this._interceptorsByName.get(n),t)))}fetchThroughInterceptors(e){const t=e,n=this._interceptorsByName.get(t);return r.composeInterceptors(n||[])}interceptDocumentViewModel(e){const t=new r.DisposableCollection;return t.add(e.registerCustomRangeInterceptor({getCustomRange:n=>{var i;return this.fetchThroughInterceptors(x.CUSTOM_RANGE)(e.getCustomRangeRaw(n),{index:n,unitId:e.getDataModel().getUnitId(),customRanges:(i=e.getDataModel().getCustomRanges())!=null?i:[]})},getCustomDecoration:n=>{var i;return this.fetchThroughInterceptors(x.CUSTOM_DECORATION)(e.getCustomDecorationRaw(n),{index:n,unitId:e.getDataModel().getUnitId(),customDecorations:(i=e.getDataModel().getCustomDecorations())!=null?i:[]})}})),t}},l.DocInterceptorService=ie([se(1,r.Inject(l.DocSkeletonManagerService))],l.DocInterceptorService);function b(c,s=""){if(!s)return["body"];const{headers:e,footers:t}=c.getSnapshot();if(e==null&&t==null)throw new Error("Document data model must have headers or footers when update by segment id");if((e==null?void 0:e[s])!=null)return["headers",s,"body"];if((t==null?void 0:t[s])!=null)return["footers",s,"body"];throw new Error("Segment id not found in headers or footers")}function re(c,s,e){const{unitId:t,segmentId:n}=s,o=c.get(r.IUniverInstanceService).getUnit(t);if(!o)return!1;const a={id:O.id,params:{unitId:s.unitId,actions:[],textRanges:void 0}},u=r.JSONX.getInstance(),d=r.BuildTextUtils.customRange.add({...s,body:e});if(!d)return!1;const h=b(o,n);return a.params.actions=u.editOp(d.serialize(),h),a}function oe(c,s){var m;const{rangeId:e,rangeType:t,wholeEntity:n,properties:i,unitId:o,selections:a}=s,u=c.get(l.DocSelectionManagerService),d=c.get(r.IUniverInstanceService),h=a!=null?a:u.getTextRanges({unitId:o,subUnitId:o}),S=(m=h==null?void 0:h[0])==null?void 0:m.segmentId;if(!(h!=null&&h.length))return!1;const I=d.getUnit(o,r.UniverInstanceType.UNIVER_DOC);if(!I)return!1;const _=I.getSelfOrHeaderFooterModel(S).getBody();if(!_)return!1;const f=r.BuildTextUtils.customRange.add({ranges:h,rangeId:e,rangeType:t,segmentId:S,wholeEntity:n,properties:i,body:_});if(!f)return!1;const D=r.JSONX.getInstance(),R={id:O.id,params:{unitId:o,actions:[],textRanges:f.selections,segmentId:S},textX:f},C=b(I,S);return R.params.actions=D.editOp(f.serialize(),C),R}function ce(c,s){const{unitId:e,segmentId:t,insert:n}=s,o=c.get(r.IUniverInstanceService).getUnit(e);if(!o)return!1;const a={id:O.id,params:{unitId:s.unitId,actions:[],textRanges:void 0,segmentId:t}},u=r.JSONX.getInstance(),d=r.BuildTextUtils.customRange.delete({documentDataModel:o,rangeId:s.rangeId,insert:n,segmentId:t});if(!d)return!1;const h=b(o,t);return a.params.actions=u.editOp(d.serialize(),h),a.params.textRanges=d.selections,a}function ae(c,s){var f,D,R,C;const{unitId:e,body:t,doc:n}=s;let i=n;if(i||(i=c.get(r.IUniverInstanceService).getUnit(e)),!i)return!1;const o=(f=s.selection)==null?void 0:f.segmentId,a=(D=i.getSelfOrHeaderFooterModel(o))==null?void 0:D.getBody();if(!a)return!1;const u=c.get(l.DocSelectionManagerService),d=(R=s.selection)!=null?R:u.getActiveTextRange();if(!d||!a)return!1;const h=(C=s.textRanges)!=null?C:[{startOffset:d.startOffset+t.dataStream.length,endOffset:d.startOffset+t.dataStream.length,collapsed:!0,segmentId:o}],S=r.BuildTextUtils.selection.replace({selection:d,body:t,doc:i});if(!S)return!1;const I={id:O.id,params:{unitId:e,actions:[],textRanges:h,debounce:!0,segmentId:o},textX:S},_=r.JSONX.getInstance();return I.params.actions=_.editOp(S.serialize()),I}l.DOC_INTERCEPTOR_POINT=x,l.DocStateEmitService=y,l.RichTextEditingMutation=O,l.SetTextSelectionsOperation=M,l.addCustomRangeBySelectionFactory=oe,l.addCustomRangeFactory=re,l.deleteCustomRangeFactory=ce,l.replaceSelectionFactory=ae,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
2
+ (function(l,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","rxjs"],r):(l=typeof globalThis<"u"?globalThis:l||self,r(l.UniverDocs={},l.UniverCore,l.UniverEngineRender,l.rxjs))})(this,(function(l,r,v,p){"use strict";var de=Object.defineProperty;var ge=(l,r,v)=>r in l?de(l,r,{enumerable:!0,configurable:!0,writable:!0,value:v}):l[r]=v;var g=(l,r,v)=>ge(l,typeof r!="symbol"?r+"":r,v);var w;const M={id:"doc.operation.set-selections",type:r.CommandType.OPERATION,handler:()=>!0};var L=Object.getOwnPropertyDescriptor,G=(c,s,e,t)=>{for(var n=t>1?void 0:t?L(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},N=(c,s)=>(e,t)=>s(e,t,c);l.DocSelectionManagerService=class extends r.RxDisposable{constructor(e,t){super();g(this,"_currentSelection",null);g(this,"_textSelectionInfo",new Map);g(this,"_textSelection$",new p.Subject);g(this,"textSelection$",this._textSelection$.asObservable());g(this,"_refreshSelection$",new p.BehaviorSubject(null));g(this,"refreshSelection$",this._refreshSelection$.asObservable());this._commandService=e,this._univerInstanceService=t,this._listenCurrentUnit()}_listenCurrentUnit(){this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_DOC).pipe(p.takeUntil(this.dispose$)).subscribe(e=>{if(e==null)return;const t=e.getUnitId();this._setCurrentSelectionNotRefresh({unitId:t,subUnitId:t})})}__getCurrentSelection(){return this._currentSelection}getSelectionInfo(e=this._currentSelection){return this._getTextRanges(e)}refreshSelection(e=this._currentSelection){e!=null&&this._refresh(e)}__TEST_ONLY_setCurrentSelection(e){this._currentSelection=e,this._refresh(e)}getTextRanges(e=this._currentSelection){var t;return(t=this._getTextRanges(e))==null?void 0:t.textRanges}getRectRanges(e=this._currentSelection){var t;return(t=this._getTextRanges(e))==null?void 0:t.rectRanges}getDocRanges(e=this._currentSelection){var o,a;const t=(o=this.getTextRanges(e))!=null?o:[],n=(a=this.getRectRanges(e))!=null?a:[];return[...t,...n].filter(u=>u.startOffset!=null&&u.endOffset!=null).sort((u,d)=>u.startOffset>d.startOffset?1:u.startOffset<d.startOffset?-1:0)}getActiveTextRange(){const e=this._getTextRanges(this._currentSelection);if(e==null)return;const{textRanges:t}=e;return t.find(n=>n.isActive)}getActiveRectRange(){const e=this._getTextRanges(this._currentSelection);if(e==null)return;const{rectRanges:t}=e;return t.find(n=>n.isActive)}__TEST_ONLY_add(e,t=!0){this._currentSelection!=null&&this._addByParam({...this._currentSelection,textRanges:e,rectRanges:[],segmentId:"",segmentPage:-1,isEditing:t,style:v.NORMAL_TEXT_SELECTION_PLUGIN_STYLE})}replaceTextRanges(e,t=!0,n){return this.replaceDocRanges(e,this._currentSelection,t,n)}replaceDocRanges(e,t=this._currentSelection,n=!0,i){if(t==null)return;const{unitId:o,subUnitId:a}=t;this._refreshSelection$.next({unitId:o,subUnitId:a,docRanges:e,isEditing:n,options:i})}__replaceTextRangesWithNoRefresh(e,t){if(this._currentSelection==null)return;const n={...e,...t};this._replaceByParam(n),this._textSelection$.next(n);const{unitId:i,subUnitId:o,segmentId:a,style:u,textRanges:d,rectRanges:h,isEditing:S}=n,I=[...d,...h].filter(_=>_.startOffset!=null&&_.endOffset!=null).sort((_,f)=>_.startOffset>f.startOffset?1:_.startOffset<f.startOffset?-1:0);this._commandService.executeCommand(M.id,{unitId:i,subUnitId:o,segmentId:a,style:u,isEditing:S,ranges:I})}dispose(){this._textSelection$.complete()}_setCurrentSelectionNotRefresh(e){this._currentSelection=e}_getTextRanges(e){var i;if(e==null)return;const{unitId:t,subUnitId:n=""}=e;return(i=this._textSelectionInfo.get(t))==null?void 0:i.get(n)}_refresh(e){const t=this._getTextRanges(e);if(t==null)return;const{textRanges:n,rectRanges:i}=t,o=[...n,...i],{unitId:a,subUnitId:u}=e;this._refreshSelection$.next({unitId:a,subUnitId:u,docRanges:o,isEditing:!1})}_replaceByParam(e){const{unitId:t,subUnitId:n,...i}=e;this._textSelectionInfo.has(t)||this._textSelectionInfo.set(t,new Map),this._textSelectionInfo.get(t).set(n,{...i})}_addByParam(e){const{unitId:t,subUnitId:n,...i}=e;this._textSelectionInfo.has(t)||this._textSelectionInfo.set(t,new Map);const o=this._textSelectionInfo.get(t);o.has(n)?o.get(n).textRanges.push(...e.textRanges):o.set(n,{...i})}},l.DocSelectionManagerService=G([N(0,r.ICommandService),N(1,r.IUniverInstanceService)],l.DocSelectionManagerService);var z=Object.getOwnPropertyDescriptor,W=(c,s,e,t)=>{for(var n=t>1?void 0:t?z(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},$=(c,s)=>(e,t)=>s(e,t,c);l.DocSkeletonManagerService=class extends r.RxDisposable{constructor(e,t,n){super();g(this,"_skeleton");g(this,"_docViewModel");g(this,"_currentSkeleton$",new p.BehaviorSubject(null));g(this,"currentSkeleton$",this._currentSkeleton$.asObservable());g(this,"_currentSkeletonBefore$",new p.BehaviorSubject(null));g(this,"currentSkeletonBefore$",this._currentSkeletonBefore$.asObservable());g(this,"_currentViewModel$",new p.BehaviorSubject(null));g(this,"currentViewModel$",this._currentViewModel$.asObservable());this._context=e,this._localeService=t,this._univerInstanceService=n,this._init(),this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_DOC).pipe(p.takeUntil(this.dispose$)).subscribe(i=>{i&&i.getUnitId()===this._context.unitId&&this._update(i)})}dispose(){super.dispose(),this._currentSkeletonBefore$.complete(),this._currentSkeleton$.complete()}getSkeleton(){return this._skeleton}getViewModel(){return this._docViewModel}_init(){const e=this._context.unit;this._update(e)}_update(e){const t=this._context.unitId;if(e.getBody()==null)return;this._docViewModel&&r.isInternalEditorID(t)?(this._docViewModel.reset(e),this._context.unit=e):this._docViewModel||(this._docViewModel=this._buildDocViewModel(e)),this._skeleton||(this._skeleton=this._buildSkeleton(this._docViewModel));const n=this._skeleton;n.calculate(),this._currentSkeletonBefore$.next(n),this._currentSkeleton$.next(n),this._currentViewModel$.next(this._docViewModel)}_buildSkeleton(e){return v.DocumentSkeleton.create(e,this._localeService)}_buildDocViewModel(e){return new v.DocumentViewModel(e)}},l.DocSkeletonManagerService=W([$(1,r.Inject(r.LocaleService)),$(2,r.IUniverInstanceService)],l.DocSkeletonManagerService);class y extends r.RxDisposable{constructor(){super();g(this,"_docStateChangeParams$",new p.BehaviorSubject(null));g(this,"docStateChangeParams$",this._docStateChangeParams$.asObservable())}emitStateChangeInfo(e){this._docStateChangeParams$.next(e)}dispose(){super.dispose(),this._docStateChangeParams$.complete()}}const P="doc.mutation.rich-text-editing",O={id:P,type:r.CommandType.MUTATION,handler:(c,s)=>{var X,F;const{unitId:e,segmentId:t="",actions:n,textRanges:i,prevTextRanges:o,trigger:a,noHistory:u,isCompositionEnd:d,noNeedSetTextRange:h,debounce:S,isEditing:I=!0,isSync:_,syncer:f}=s,D=c.get(r.IUniverInstanceService),R=c.get(v.IRenderManagerService),C=c.get(y),m=D.getUniverDocInstance(e),V=(X=R.getRenderById(e))==null?void 0:X.with(l.DocSkeletonManagerService).getViewModel();if(m==null||V==null)throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${e}`);const j=c.get(l.DocSelectionManagerService),E=(F=j.getDocRanges())!=null?F:[],le=!!m.getSnapshot().disabled;if(r.JSONX.isNoop(n)||n&&n.length===0||le)return{unitId:e,actions:[],textRanges:E};const A=r.JSONX.invertWithDoc(n,m.getSnapshot());m.apply(n),V.reset(m),!h&&i&&a!=null&&!_&&queueMicrotask(()=>{j.replaceDocRanges(i,{unitId:e,subUnitId:e},I,s.options)});const ue={commandId:P,unitId:e,segmentId:t,trigger:a,noHistory:u,debounce:S,redoState:{actions:n,textRanges:i},undoState:{actions:A,textRanges:o!=null?o:E},isCompositionEnd:d,isSync:_,syncer:f};return C.emitStateChangeInfo(ue),{unitId:e,actions:A,textRanges:E}}},J={id:"doc.mutation.rename-doc",type:r.CommandType.MUTATION,handler:(c,s)=>{const t=c.get(r.IUniverInstanceService).getUnit(s.unitId,r.UniverInstanceType.UNIVER_DOC);return t?(t.setName(s.name),!0):!1}},Y="docs.config",B={};var K=Object.getOwnPropertyDescriptor,q=(c,s,e,t)=>{for(var n=t>1?void 0:t?K(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},U=(c,s)=>(e,t)=>s(e,t,c);let T=class extends r.Disposable{constructor(c,s,e){super(),this._commandService=c,this._textSelectionManagerService=s,this._univerInstanceService=e,this._initSelectionChange()}_transformCustomRange(c,s){var o;const{startOffset:e,endOffset:t,collapsed:n}=s,i=(o=c.getCustomRanges())==null?void 0:o.filter(a=>!a.wholeEntity||e<=a.startIndex&&t>a.endIndex?!1:n?a.startIndex<e&&a.endIndex>=t:r.BuildTextUtils.range.isIntersects(e,t-1,a.startIndex,a.endIndex));if(i!=null&&i.length){let a=e,u=t;return i.forEach(d=>{a=Math.min(d.startIndex,a),u=Math.max(d.endIndex+1,u)}),{...s,startOffset:a,endOffset:u,collapsed:a===u}}return s}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(c=>{if(c.id===M.id){const s=c.params,{unitId:e,ranges:t,isEditing:n}=s,i=this._univerInstanceService.getUnit(e);if(!i)return;const o=t.map(a=>this._transformCustomRange(i,a));o.some((a,u)=>t[u]!==a)&&this._textSelectionManagerService.replaceTextRanges(o,n)}}))}};T=q([U(0,r.ICommandService),U(1,r.Inject(l.DocSelectionManagerService)),U(2,r.IUniverInstanceService)],T);var H=Object.getOwnPropertyDescriptor,Q=(c,s,e,t)=>{for(var n=t>1?void 0:t?H(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},k=(c,s)=>(e,t)=>s(e,t,c);const Z="DOCS_PLUGIN";l.UniverDocsPlugin=(w=class extends r.Plugin{constructor(s=B,e,t){super(),this._config=s,this._injector=e,this._configService=t;const{...n}=r.merge({},B,this._config);this._configService.setConfig(Y,n)}onStarting(){this._initializeDependencies(),this._initializeCommands()}_initializeCommands(){[O,J,M].forEach(s=>{this._injector.get(r.ICommandService).registerCommand(s)})}_initializeDependencies(){[[l.DocSelectionManagerService],[y],[T]].forEach(s=>this._injector.add(s))}onReady(){this._injector.get(T)}},g(w,"pluginName",Z),w),l.UniverDocsPlugin=Q([k(1,r.Inject(r.Injector)),k(2,r.IConfigService)],l.UniverDocsPlugin);const ee=r.createInterceptorKey("CUSTOM_RANGE"),te=r.createInterceptorKey("CUSTOM_DECORATION"),x={CUSTOM_RANGE:ee,CUSTOM_DECORATION:te};var ne=Object.getOwnPropertyDescriptor,ie=(c,s,e,t)=>{for(var n=t>1?void 0:t?ne(s,e):s,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},se=(c,s)=>(e,t)=>s(e,t,c);l.DocInterceptorService=class extends r.Disposable{constructor(e,t){super();g(this,"_interceptorsByName",new Map);this._context=e,this._docSkeletonManagerService=t;const n=this._docSkeletonManagerService.getViewModel(),i=n.getDataModel().getUnitId();if(i===r.DOCS_NORMAL_EDITOR_UNIT_ID_KEY||i===r.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;this.disposeWithMe(this.interceptDocumentViewModel(n)),this.disposeWithMe(this.intercept(x.CUSTOM_RANGE,{priority:-1,handler:(a,u,d)=>d(a)}));let o=new r.DisposableCollection;n.segmentViewModels$.subscribe(a=>{o.dispose(),o=new r.DisposableCollection,a.forEach(u=>{o.add(this.interceptDocumentViewModel(u))})}),this.disposeWithMe(o)}intercept(e,t){const n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);const i=this._interceptorsByName.get(n);return i.push(t),this._interceptorsByName.set(n,i.sort((o,a)=>{var u,d;return((u=a.priority)!=null?u:0)-((d=o.priority)!=null?d:0)})),this.disposeWithMe(r.toDisposable(()=>r.remove(this._interceptorsByName.get(n),t)))}fetchThroughInterceptors(e){const t=e,n=this._interceptorsByName.get(t);return r.composeInterceptors(n||[])}interceptDocumentViewModel(e){const t=new r.DisposableCollection;return t.add(e.registerCustomRangeInterceptor({getCustomRange:n=>{var i;return this.fetchThroughInterceptors(x.CUSTOM_RANGE)(e.getCustomRangeRaw(n),{index:n,unitId:e.getDataModel().getUnitId(),customRanges:(i=e.getDataModel().getCustomRanges())!=null?i:[]})},getCustomDecoration:n=>{var i;return this.fetchThroughInterceptors(x.CUSTOM_DECORATION)(e.getCustomDecorationRaw(n),{index:n,unitId:e.getDataModel().getUnitId(),customDecorations:(i=e.getDataModel().getCustomDecorations())!=null?i:[]})}})),t}},l.DocInterceptorService=ie([se(1,r.Inject(l.DocSkeletonManagerService))],l.DocInterceptorService);function b(c,s=""){if(!s)return["body"];const{headers:e,footers:t}=c.getSnapshot();if(e==null&&t==null)throw new Error("Document data model must have headers or footers when update by segment id");if((e==null?void 0:e[s])!=null)return["headers",s,"body"];if((t==null?void 0:t[s])!=null)return["footers",s,"body"];throw new Error("Segment id not found in headers or footers")}function re(c,s,e){const{unitId:t,segmentId:n}=s,o=c.get(r.IUniverInstanceService).getUnit(t);if(!o)return!1;const a={id:O.id,params:{unitId:s.unitId,actions:[],textRanges:void 0}},u=r.JSONX.getInstance(),d=r.BuildTextUtils.customRange.add({...s,body:e});if(!d)return!1;const h=b(o,n);return a.params.actions=u.editOp(d.serialize(),h),a}function oe(c,s){var m;const{rangeId:e,rangeType:t,wholeEntity:n,properties:i,unitId:o,selections:a}=s,u=c.get(l.DocSelectionManagerService),d=c.get(r.IUniverInstanceService),h=a!=null?a:u.getTextRanges({unitId:o,subUnitId:o}),S=(m=h==null?void 0:h[0])==null?void 0:m.segmentId;if(!(h!=null&&h.length))return!1;const I=d.getUnit(o,r.UniverInstanceType.UNIVER_DOC);if(!I)return!1;const _=I.getSelfOrHeaderFooterModel(S).getBody();if(!_)return!1;const f=r.BuildTextUtils.customRange.add({ranges:h,rangeId:e,rangeType:t,segmentId:S,wholeEntity:n,properties:i,body:_});if(!f)return!1;const D=r.JSONX.getInstance(),R={id:O.id,params:{unitId:o,actions:[],textRanges:f.selections,segmentId:S},textX:f},C=b(I,S);return R.params.actions=D.editOp(f.serialize(),C),R}function ce(c,s){const{unitId:e,segmentId:t,insert:n}=s,o=c.get(r.IUniverInstanceService).getUnit(e);if(!o)return!1;const a={id:O.id,params:{unitId:s.unitId,actions:[],textRanges:void 0,segmentId:t}},u=r.JSONX.getInstance(),d=r.BuildTextUtils.customRange.delete({documentDataModel:o,rangeId:s.rangeId,insert:n,segmentId:t});if(!d)return!1;const h=b(o,t);return a.params.actions=u.editOp(d.serialize(),h),a.params.textRanges=d.selections,a}function ae(c,s){var f,D,R,C;const{unitId:e,body:t,doc:n}=s;let i=n;if(i||(i=c.get(r.IUniverInstanceService).getUnit(e)),!i)return!1;const o=(f=s.selection)==null?void 0:f.segmentId,a=(D=i.getSelfOrHeaderFooterModel(o))==null?void 0:D.getBody();if(!a)return!1;const u=c.get(l.DocSelectionManagerService),d=(R=s.selection)!=null?R:u.getActiveTextRange();if(!d||!a)return!1;const h=(C=s.textRanges)!=null?C:[{startOffset:d.startOffset+t.dataStream.length,endOffset:d.startOffset+t.dataStream.length,collapsed:!0,segmentId:o}],S=r.BuildTextUtils.selection.replace({selection:d,body:t,doc:i});if(!S)return!1;const I={id:O.id,params:{unitId:e,actions:[],textRanges:h,debounce:!0,segmentId:o},textX:S},_=r.JSONX.getInstance();return I.params.actions=_.editOp(S.serialize()),I}l.DOC_INTERCEPTOR_POINT=x,l.DocStateEmitService=y,l.RichTextEditingMutation=O,l.SetTextSelectionsOperation=M,l.addCustomRangeBySelectionFactory=oe,l.addCustomRangeFactory=re,l.deleteCustomRangeFactory=ce,l.replaceSelectionFactory=ae,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
3
3
 
4
4
 
5
5
  // @univerjs/rpc-node/index
6
- (function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("node:child_process"),require("node:process"),require("@univerjs/core"),require("@univerjs/rpc"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","node:child_process","node:process","@univerjs/core","@univerjs/rpc","rxjs"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.UniverRpcNode={},e.node_child_process,e.process,e.UniverCore,e.UniverRpc,e.rxjs))})(this,function(e,o,g,c,t,l){"use strict";var j=Object.defineProperty;var y=(e,o,g)=>o in e?j(e,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):e[o]=g;var _=(e,o,g)=>y(e,typeof o!="symbol"?o+"":o,g);var P,v;const S="rpc-node.main-thread.config",h={},N="rpc-node.worker-thread.config",C={};var m=Object.getOwnPropertyDescriptor,R=(s,n,i,r)=>{for(var a=r>1?void 0:r?m(n,i):n,d=s.length-1,u;d>=0;d--)(u=s[d])&&(a=u(a)||a);return a},f=(s,n)=>(i,r)=>n(i,r,s);e.UniverRPCNodeMainPlugin=(P=class extends c.Plugin{constructor(n=h,i,r){super(),this._config=n,this._injector=i,this._configService=r;const{...a}=c.merge({},h,this._config);this._configService.setConfig(S,a)}onStarting(){const{workerSrc:n}=this._config;if(!n)throw new Error("[UniverRPCNodeMainPlugin] workerSrc is required for UniverRPCNodeMainPlugin");const i=I(this._injector,n);[[t.IRPCChannelService,{useFactory:()=>new t.ChannelService(i)}],[t.DataSyncPrimaryController],[t.IRemoteSyncService,{useClass:t.RemoteSyncPrimaryService}]].forEach(a=>this._injector.add(a)),this._injector.get(t.DataSyncPrimaryController)}},_(P,"pluginName","UNIVER_RPC_NODE_MAIN_PLUGIN"),P),e.UniverRPCNodeMainPlugin=R([f(1,c.Inject(c.Injector)),f(2,c.IConfigService)],e.UniverRPCNodeMainPlugin),e.UniverRPCNodeWorkerPlugin=(v=class extends c.Plugin{constructor(n=C,i,r){super(),this._config=n,this._injector=i,this._configService=r;const{...a}=c.merge({},C,this._config);this._configService.setConfig(N,a)}onStarting(){[[t.DataSyncReplicaController],[t.IRPCChannelService,{useFactory:()=>new t.ChannelService(p())}],[t.IRemoteInstanceService,{useClass:t.WebWorkerRemoteInstanceService}]].forEach(n=>this._injector.add(n)),this._injector.get(t.DataSyncReplicaController)}},_(v,"pluginName","UNIVER_RPC_NODE_WORKER_PLUGIN"),v),e.UniverRPCNodeWorkerPlugin=R([f(1,c.Inject(c.Injector)),f(2,c.IConfigService)],e.UniverRPCNodeWorkerPlugin);function I(s,n){const i=s.get(c.ILogService),r=o.fork(n);return r.on("spawn",()=>i.log("Child computing process spawned!")),r.on("error",d=>i.error(d)),{send(d){r.send(d)},onMessage:new l.Observable(d=>{const u=U=>{d.next(U)};return r.on("message",u),()=>r.off("message",u)}).pipe(l.shareReplay(1))}}function p(){return{send(s){g.send(s)},onMessage:new l.Observable(s=>{const n=i=>{s.next(i)};return g.on("message",n),()=>g.off("message",n)}).pipe(l.shareReplay(1))}}Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
6
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("node:child_process"),require("node:process"),require("@univerjs/core"),require("@univerjs/rpc"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","node:child_process","node:process","@univerjs/core","@univerjs/rpc","rxjs"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.UniverRpcNode={},e.node_child_process,e.process,e.UniverCore,e.UniverRpc,e.rxjs))})(this,(function(e,o,g,c,t,l){"use strict";var j=Object.defineProperty;var y=(e,o,g)=>o in e?j(e,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):e[o]=g;var _=(e,o,g)=>y(e,typeof o!="symbol"?o+"":o,g);var P,v;const S="rpc-node.main-thread.config",h={},N="rpc-node.worker-thread.config",C={};var m=Object.getOwnPropertyDescriptor,R=(s,n,i,r)=>{for(var a=r>1?void 0:r?m(n,i):n,d=s.length-1,u;d>=0;d--)(u=s[d])&&(a=u(a)||a);return a},f=(s,n)=>(i,r)=>n(i,r,s);e.UniverRPCNodeMainPlugin=(P=class extends c.Plugin{constructor(n=h,i,r){super(),this._config=n,this._injector=i,this._configService=r;const{...a}=c.merge({},h,this._config);this._configService.setConfig(S,a)}onStarting(){const{workerSrc:n}=this._config;if(!n)throw new Error("[UniverRPCNodeMainPlugin] workerSrc is required for UniverRPCNodeMainPlugin");const i=I(this._injector,n);[[t.IRPCChannelService,{useFactory:()=>new t.ChannelService(i)}],[t.DataSyncPrimaryController],[t.IRemoteSyncService,{useClass:t.RemoteSyncPrimaryService}]].forEach(a=>this._injector.add(a)),this._injector.get(t.DataSyncPrimaryController)}},_(P,"pluginName","UNIVER_RPC_NODE_MAIN_PLUGIN"),P),e.UniverRPCNodeMainPlugin=R([f(1,c.Inject(c.Injector)),f(2,c.IConfigService)],e.UniverRPCNodeMainPlugin),e.UniverRPCNodeWorkerPlugin=(v=class extends c.Plugin{constructor(n=C,i,r){super(),this._config=n,this._injector=i,this._configService=r;const{...a}=c.merge({},C,this._config);this._configService.setConfig(N,a)}onStarting(){[[t.DataSyncReplicaController],[t.IRPCChannelService,{useFactory:()=>new t.ChannelService(p())}],[t.IRemoteInstanceService,{useClass:t.WebWorkerRemoteInstanceService}]].forEach(n=>this._injector.add(n)),this._injector.get(t.DataSyncReplicaController)}},_(v,"pluginName","UNIVER_RPC_NODE_WORKER_PLUGIN"),v),e.UniverRPCNodeWorkerPlugin=R([f(1,c.Inject(c.Injector)),f(2,c.IConfigService)],e.UniverRPCNodeWorkerPlugin);function I(s,n){const i=s.get(c.ILogService),r=o.fork(n);return r.on("spawn",()=>i.log("Child computing process spawned!")),r.on("error",d=>i.error(d)),{send(d){r.send(d)},onMessage:new l.Observable(d=>{const u=U=>{d.next(U)};return r.on("message",u),()=>r.off("message",u)}).pipe(l.shareReplay(1))}}function p(){return{send(s){g.send(s)},onMessage:new l.Observable(s=>{const n=i=>{s.next(i)};return g.on("message",n),()=>g.off("message",n)}).pipe(l.shareReplay(1))}}Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
7
7
 
8
8
 
9
9
  // @univerjs/docs-hyper-link/index
10
- (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.UniverDocsHyperLink={},a.UniverCore))})(this,function(a,e){"use strict";var N=Object.defineProperty;var O=(a,e,p)=>e in a?N(a,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):a[e]=p;var f=(a,e,p)=>O(a,typeof e!="symbol"?e+"":e,p);var h;const p={id:"docs.mutation.add-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},I={id:"docs.mutation.update-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},m={id:"docs.mutation.delete-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},U="docs-hyper-link.config",g={};var C=Object.getOwnPropertyDescriptor,D=(s,n,t,o)=>{for(var r=o>1?void 0:o?C(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},v=(s,n)=>(t,o)=>n(t,o,s);const y="DOC_HYPER_LINK_PLUGIN";let l=class extends e.Disposable{constructor(s,n){super(),this._resourceManagerService=s,this._univerInstanceService=n,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:y,businesses:[e.UniverInstanceType.UNIVER_DOC],onLoad:(s,n)=>{const t=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC);if(!t)return;const o=new Map,r=i=>{var c,d;return(d=(c=i.getBody())==null?void 0:c.customRanges)==null||d.forEach(u=>{u.rangeType===e.CustomRangeType.HYPERLINK&&o.set(u.rangeId,u)}),o};t.headerModelMap.forEach(i=>{r(i)}),t.footerModelMap.forEach(i=>{r(i)}),r(t),n.links.forEach(i=>{const c=o.get(i.id);c&&(c.properties={...c.properties,url:i.payload})})},onUnLoad:s=>{},toJson:s=>{const n=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC),t=[];if(n){const o=r=>{var i,c;(c=(i=r.getBody())==null?void 0:i.customRanges)==null||c.forEach(d=>{var u;d.rangeType===e.CustomRangeType.HYPERLINK&&t.push({id:d.rangeId,payload:((u=d.properties)==null?void 0:u.url)||""})})};n.headerModelMap.forEach(r=>{o(r)}),n.footerModelMap.forEach(r=>{o(r)}),o(n)}return JSON.stringify({links:t})},parseJson(s){return JSON.parse(s)}})}};l=D([v(0,e.Inject(e.IResourceManagerService)),v(1,e.IUniverInstanceService)],l);var P=Object.getOwnPropertyDescriptor,M=(s,n,t,o)=>{for(var r=o>1?void 0:o?P(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},_=(s,n)=>(t,o)=>n(t,o,s);a.UniverDocsHyperLinkPlugin=(h=class extends e.Plugin{constructor(n=g,t,o,r){super(),this._config=n,this._injector=t,this._configService=o,this._commandService=r;const{...i}=e.merge({},g,this._config);this._configService.setConfig(U,i)}onStarting(){[[l]].forEach(t=>this._injector.add(t)),[p,m,I].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))}),this._injector.get(l)}},f(h,"pluginName",y),f(h,"type",e.UniverInstanceType.UNIVER_DOC),h),a.UniverDocsHyperLinkPlugin=M([_(1,e.Inject(e.Injector)),_(2,e.IConfigService),_(3,e.ICommandService)],a.UniverDocsHyperLinkPlugin),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
10
+ (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.UniverDocsHyperLink={},a.UniverCore))})(this,(function(a,e){"use strict";var N=Object.defineProperty;var O=(a,e,p)=>e in a?N(a,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):a[e]=p;var f=(a,e,p)=>O(a,typeof e!="symbol"?e+"":e,p);var h;const p={id:"docs.mutation.add-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},I={id:"docs.mutation.update-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},m={id:"docs.mutation.delete-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},U="docs-hyper-link.config",g={};var C=Object.getOwnPropertyDescriptor,D=(s,n,t,o)=>{for(var r=o>1?void 0:o?C(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},v=(s,n)=>(t,o)=>n(t,o,s);const y="DOC_HYPER_LINK_PLUGIN";let l=class extends e.Disposable{constructor(s,n){super(),this._resourceManagerService=s,this._univerInstanceService=n,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:y,businesses:[e.UniverInstanceType.UNIVER_DOC],onLoad:(s,n)=>{const t=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC);if(!t)return;const o=new Map,r=i=>{var c,d;return(d=(c=i.getBody())==null?void 0:c.customRanges)==null||d.forEach(u=>{u.rangeType===e.CustomRangeType.HYPERLINK&&o.set(u.rangeId,u)}),o};t.headerModelMap.forEach(i=>{r(i)}),t.footerModelMap.forEach(i=>{r(i)}),r(t),n.links.forEach(i=>{const c=o.get(i.id);c&&(c.properties={...c.properties,url:i.payload})})},onUnLoad:s=>{},toJson:s=>{const n=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC),t=[];if(n){const o=r=>{var i,c;(c=(i=r.getBody())==null?void 0:i.customRanges)==null||c.forEach(d=>{var u;d.rangeType===e.CustomRangeType.HYPERLINK&&t.push({id:d.rangeId,payload:((u=d.properties)==null?void 0:u.url)||""})})};n.headerModelMap.forEach(r=>{o(r)}),n.footerModelMap.forEach(r=>{o(r)}),o(n)}return JSON.stringify({links:t})},parseJson(s){return JSON.parse(s)}})}};l=D([v(0,e.Inject(e.IResourceManagerService)),v(1,e.IUniverInstanceService)],l);var P=Object.getOwnPropertyDescriptor,M=(s,n,t,o)=>{for(var r=o>1?void 0:o?P(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},_=(s,n)=>(t,o)=>n(t,o,s);a.UniverDocsHyperLinkPlugin=(h=class extends e.Plugin{constructor(n=g,t,o,r){super(),this._config=n,this._injector=t,this._configService=o,this._commandService=r;const{...i}=e.merge({},g,this._config);this._configService.setConfig(U,i)}onStarting(){[[l]].forEach(t=>this._injector.add(t)),[p,m,I].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))}),this._injector.get(l)}},f(h,"pluginName",y),f(h,"type",e.UniverInstanceType.UNIVER_DOC),h),a.UniverDocsHyperLinkPlugin=M([_(1,e.Inject(e.Injector)),_(2,e.IConfigService),_(3,e.ICommandService)],a.UniverDocsHyperLinkPlugin),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
11
11
 
12
12
 
13
13
  // @univerjs/thread-comment/index
14
- (function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d.UniverThreadComment={},d.UniverCore,d.rxjs))})(this,function(d,s,M){"use strict";var B=Object.defineProperty;var q=(d,s,M)=>s in d?B(d,s,{enumerable:!0,configurable:!0,writable:!0,value:M}):d[s]=M;var u=(d,s,M)=>q(d,typeof s!="symbol"?s+"":s,M);var T;class I extends s.Disposable{constructor(){super();u(this,"_dataSource",null);u(this,"syncUpdateMutationToColla",!0)}set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}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?t:e.id}}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,o){return this._dataSource?this._dataSource.deleteComment(e,t,n,o):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){const n={};return Object.keys(e).forEach(o=>{const a=e[o];n[o]=a.map(this.dataSource.saveCommentToSnapshot)}),n}return e}}const C=s.createIdentifier("univer.thread-comment.data-source-service");var H=Object.getOwnPropertyDescriptor,W=(c,m,e,t)=>{for(var n=t>1?void 0:t?H(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},N=(c,m)=>(e,t)=>m(e,t,c);d.ThreadCommentModel=class extends s.Disposable{constructor(e,t){super();u(this,"_commentsMap",new Map);u(this,"_threadMap",new Map);u(this,"_commentUpdate$",new M.Subject);u(this,"commentUpdate$",this._commentUpdate$.asObservable());u(this,"_tasks",[]);this._dataSourceService=e,this._lifecycleService=t,this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(n=>{const o=new Map;n===s.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:a,subUnitId:r,threadIds:i})=>{let h=o.get(a);h||(h=new Map,o.set(a,h));let l=h.get(r);l||(l=new Set,h.set(r,l));for(const p of i)l.add(p)}),this._tasks=[],o.forEach((a,r)=>{a.forEach((i,h)=>{this.syncThreadComments(r,h,Array.from(i))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}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 o=n.get(t);return o||(o=new Map,n.set(t,o)),o}_replaceComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n.id);if(a){const{children:r,...i}=n,h={...i,ref:a.ref};o.set(n.id,h),r==null||r.forEach(l=>{o.set(l.id,{...l,ref:""})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"syncUpdate",payload:h}),!!n.resolved!=!!a.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(e,t,n){if(this._lifecycleService.stage<s.LifecycleStages.Rendered){this._tasks.push({unitId:e,subUnitId:t,threadIds:n});return}const o=this._ensureThreadMap(e,t),a=this._ensureCommentMap(e,t),r=await this._dataSourceService.listThreadComments(e,t,n);if(!r)return;const i=new Set(n);r.forEach(h=>{this._replaceComment(e,t,h),i.delete(h.threadId)}),i.forEach(h=>{o.delete(h),a.forEach((l,p)=>{l.threadId===h&&a.delete(p)})})}addComment(e,t,n,o){const a=this._ensureCommentMap(e,t),{parentId:r,children:i=[],...h}=n,l={...h,parentId:r===n.id?void 0:r};l.threadId||(l.threadId=l.parentId||l.id);const p=f=>{a.set(f.id,f),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"add",payload:f,isRoot:!f.parentId})};p(l);const L=this._ensureThreadMap(e,t);if(!l.parentId){L.set(l.threadId,l);for(const f of i)p(f)}return o&&this.syncThreadComments(e,t,[l.threadId]),!0}updateComment(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n.commentId);return r&&(r.updated=!0,r.text=n.text,r.attachments=n.attachments,r.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"update",payload:n,silent:o})),!0}updateCommentRef(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n.commentId);return r?(r.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"updateRef",payload:n,silent:o,threadId:r.threadId}),!0):!1}resolveComment(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n);return r?(r.resolved=o,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n,resolved:o}}),!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){const o=this._ensureCommentMap(e,t),a=Array.from(o.values()).filter(l=>l.threadId===n);let r;const i=[],h=new Set;for(const l of a)l.parentId?i.push(l):r=l,h.add(l.personId);if(r)return{root:r,children:i,relativeUsers:h,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){const o=this.getComment(e,t,n);if(o)return this.getThread(e,t,o.threadId)}_deleteComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n);a&&(o.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"delete",payload:{commentId:n,isRoot:!a.parentId,comment:a}}))}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){const a=this._ensureCommentMap(e,t).get(n);return a&&(a.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,a.threadId)),!0}deleteUnit(e){const t=this._commentsMap.get(e);t&&t.forEach((n,o)=>{n.forEach(a=>{this.deleteComment(e,o,a.id)})})}getUnit(e){const t=this._threadMap.get(e);if(!t)return[];const n=[];return t.forEach((o,a)=>{o.forEach((r,i)=>{const h=this.getThread(e,a,i);h&&n.push(h)})}),n}getAll(){const e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}},d.ThreadCommentModel=W([N(0,s.Inject(C)),N(1,s.Inject(s.LifecycleService))],d.ThreadCommentModel);const v={id:"thread-comment.mutation.add-comment",type:s.CommandType.MUTATION,handler(c,m,e){if(!m)return!1;const t=c.get(d.ThreadCommentModel),{unitId:n,subUnitId:o,comment:a,sync:r}=m,i=r||(e==null?void 0:e.fromChangeset)&&!a.parentId;return t.addComment(n,o,a,i)}},g={id:"thread-comment.mutation.update-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=m;return e.updateComment(t,n,o,a)}},D={id:"thread-comment.mutation.update-comment-ref",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=m;return e.updateCommentRef(t,n,o,a)}},S={id:"thread-comment.mutation.resolve-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,resolved:o,commentId:a}=m;return e.resolveComment(t,n,a,o)}},_={id:"thread-comment.mutation.delete-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,commentId:o}=m;return e.deleteComment(t,n,o)}},O={id:"thread-comment.command.add-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(s.ICommandService),t=c.get(C),{comment:n}=m,o=await t.addComment(n),a=t.syncUpdateMutationToColla,r=!n.parentId,i={id:v.id,params:{...m,comment:o}};return r?await e.executeCommand(i.id,i.params):e.executeCommand(i.id,i.params,{onlyLocal:!a})}},R={id:"thread-comment.command.update-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const{unitId:e,subUnitId:t,payload:n}=m,o=c.get(s.ICommandService),a=c.get(d.ThreadCommentModel),r=c.get(C),i=r.syncUpdateMutationToColla,h=a.getComment(e,t,n.commentId);if(!h)return!1;const{children:l,...p}=h;if(!await r.updateComment({...p,...n}))return!1;const f={id:g.id,params:m};return o.executeCommand(f.id,f.params,{onlyLocal:!i}),!0}},w={id:"thread-comment.command.resolve-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const{unitId:e,subUnitId:t,resolved:n,commentId:o}=m,a=c.get(C),i=c.get(d.ThreadCommentModel).getComment(e,t,o),h=a.syncUpdateMutationToColla;return!i||!await a.resolveComment({...i,resolved:n})?!1:c.get(s.ICommandService).executeCommand(S.id,m,{onlyLocal:!h})}},A={id:"thread-comment.command.delete-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),t=c.get(C),n=c.get(s.ICommandService),{unitId:o,subUnitId:a,commentId:r}=m,i=t.syncUpdateMutationToColla,h=e.getComment(o,a,r);if(!h||!await t.deleteComment(o,a,h.threadId,r))return!1;const l={id:_.id,params:m};return n.executeCommand(l.id,l.params,{onlyLocal:!i})}},P={id:"thread-comment.command.delete-comment-tree",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),t=c.get(s.ICommandService),n=c.get(C),{unitId:o,subUnitId:a,commentId:r}=m,i=e.getCommentWithChildren(o,a,r);return!i||!await n.deleteComment(o,a,i.root.threadId,r)?!1:await t.executeCommand(_.id,{unitId:o,subUnitId:a,commentId:i.root.id})}};function G(c){return s.dayjs(c).format("YYYY/MM/DD HH:mm")}const y="UNIVER_THREAD_COMMENT_PLUGIN";var J=Object.getOwnPropertyDescriptor,V=(c,m,e,t)=>{for(var n=t>1?void 0:t?J(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},U=(c,m)=>(e,t)=>m(e,t,c);const j=`SHEET_${y}`;d.ThreadCommentResourceController=class extends s.Disposable{constructor(m,e,t){super(),this._resourceManagerService=m,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSnapshot()}_initSnapshot(){const m=t=>{const n=this._threadCommentModel.getUnit(t),o={};return n?(n.forEach(a=>{var i;const r=(i=o[a.subUnitId])!=null?i:[];r.push({...a.root,children:a.children}),o[a.subUnitId]=r}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(o,t))):""},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:j,businesses:[s.UniverInstanceType.UNIVER_SHEET,s.UniverInstanceType.UNIVER_DOC],toJson:t=>m(t),parseJson:t=>e(t),onUnLoad:t=>{this._threadCommentModel.deleteUnit(t)},onLoad:async(t,n)=>{Object.keys(n).forEach(o=>{const a=n[o];a.forEach(r=>{this._threadCommentModel.addComment(t,o,r)}),this._threadCommentModel.syncThreadComments(t,o,a.map(r=>r.threadId))})}}))}},d.ThreadCommentResourceController=V([U(0,s.IResourceManagerService),U(1,s.Inject(d.ThreadCommentModel)),U(2,C)],d.ThreadCommentResourceController);const b="thread-comment.config",$={};var Y=Object.getOwnPropertyDescriptor,k=(c,m,e,t)=>{for(var n=t>1?void 0:t?Y(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},E=(c,m)=>(e,t)=>m(e,t,c);d.UniverThreadCommentPlugin=(T=class extends s.Plugin{constructor(m=$,e,t,n){super(),this._config=m,this._injector=e,this._commandService=t,this._configService=n;const{...o}=s.merge({},$,this._config);this._configService.setConfig(b,o)}onStarting(){var m;s.mergeOverrideWithDependencies([[C,{useClass:I}],[d.ThreadCommentModel],[d.ThreadCommentResourceController]],(m=this._config)==null?void 0:m.overrides).forEach(e=>{this._injector.add(e)}),[O,R,A,w,P,v,g,D,_,S].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(d.ThreadCommentResourceController)}},u(T,"pluginName",y),u(T,"type",s.UniverInstanceType.UNIVER_UNKNOWN),T),d.UniverThreadCommentPlugin=k([E(1,s.Inject(s.Injector)),E(2,s.ICommandService),E(3,s.IConfigService)],d.UniverThreadCommentPlugin),d.AddCommentCommand=O,d.AddCommentMutation=v,d.DeleteCommentCommand=A,d.DeleteCommentMutation=_,d.DeleteCommentTreeCommand=P,d.IThreadCommentDataSourceService=C,d.ResolveCommentCommand=w,d.ResolveCommentMutation=S,d.SHEET_UNIVER_THREAD_COMMENT_PLUGIN=j,d.TC_PLUGIN_NAME=y,d.ThreadCommentDataSourceService=I,d.UpdateCommentCommand=R,d.UpdateCommentMutation=g,d.UpdateCommentRefMutation=D,d.getDT=G,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
14
+ (function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d.UniverThreadComment={},d.UniverCore,d.rxjs))})(this,(function(d,s,M){"use strict";var B=Object.defineProperty;var q=(d,s,M)=>s in d?B(d,s,{enumerable:!0,configurable:!0,writable:!0,value:M}):d[s]=M;var u=(d,s,M)=>q(d,typeof s!="symbol"?s+"":s,M);var T;class I extends s.Disposable{constructor(){super();u(this,"_dataSource",null);u(this,"syncUpdateMutationToColla",!0)}set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}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?t:e.id}}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,o){return this._dataSource?this._dataSource.deleteComment(e,t,n,o):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){const n={};return Object.keys(e).forEach(o=>{const a=e[o];n[o]=a.map(this.dataSource.saveCommentToSnapshot)}),n}return e}}const C=s.createIdentifier("univer.thread-comment.data-source-service");var H=Object.getOwnPropertyDescriptor,W=(c,m,e,t)=>{for(var n=t>1?void 0:t?H(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},N=(c,m)=>(e,t)=>m(e,t,c);d.ThreadCommentModel=class extends s.Disposable{constructor(e,t){super();u(this,"_commentsMap",new Map);u(this,"_threadMap",new Map);u(this,"_commentUpdate$",new M.Subject);u(this,"commentUpdate$",this._commentUpdate$.asObservable());u(this,"_tasks",[]);this._dataSourceService=e,this._lifecycleService=t,this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(n=>{const o=new Map;n===s.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:a,subUnitId:r,threadIds:i})=>{let h=o.get(a);h||(h=new Map,o.set(a,h));let l=h.get(r);l||(l=new Set,h.set(r,l));for(const p of i)l.add(p)}),this._tasks=[],o.forEach((a,r)=>{a.forEach((i,h)=>{this.syncThreadComments(r,h,Array.from(i))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}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 o=n.get(t);return o||(o=new Map,n.set(t,o)),o}_replaceComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n.id);if(a){const{children:r,...i}=n,h={...i,ref:a.ref};o.set(n.id,h),r==null||r.forEach(l=>{o.set(l.id,{...l,ref:""})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"syncUpdate",payload:h}),!!n.resolved!=!!a.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(e,t,n){if(this._lifecycleService.stage<s.LifecycleStages.Rendered){this._tasks.push({unitId:e,subUnitId:t,threadIds:n});return}const o=this._ensureThreadMap(e,t),a=this._ensureCommentMap(e,t),r=await this._dataSourceService.listThreadComments(e,t,n);if(!r)return;const i=new Set(n);r.forEach(h=>{this._replaceComment(e,t,h),i.delete(h.threadId)}),i.forEach(h=>{o.delete(h),a.forEach((l,p)=>{l.threadId===h&&a.delete(p)})})}addComment(e,t,n,o){const a=this._ensureCommentMap(e,t),{parentId:r,children:i=[],...h}=n,l={...h,parentId:r===n.id?void 0:r};l.threadId||(l.threadId=l.parentId||l.id);const p=f=>{a.set(f.id,f),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"add",payload:f,isRoot:!f.parentId})};p(l);const L=this._ensureThreadMap(e,t);if(!l.parentId){L.set(l.threadId,l);for(const f of i)p(f)}return o&&this.syncThreadComments(e,t,[l.threadId]),!0}updateComment(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n.commentId);return r&&(r.updated=!0,r.text=n.text,r.attachments=n.attachments,r.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"update",payload:n,silent:o})),!0}updateCommentRef(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n.commentId);return r?(r.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"updateRef",payload:n,silent:o,threadId:r.threadId}),!0):!1}resolveComment(e,t,n,o){const r=this._ensureCommentMap(e,t).get(n);return r?(r.resolved=o,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n,resolved:o}}),!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){const o=this._ensureCommentMap(e,t),a=Array.from(o.values()).filter(l=>l.threadId===n);let r;const i=[],h=new Set;for(const l of a)l.parentId?i.push(l):r=l,h.add(l.personId);if(r)return{root:r,children:i,relativeUsers:h,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){const o=this.getComment(e,t,n);if(o)return this.getThread(e,t,o.threadId)}_deleteComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n);a&&(o.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"delete",payload:{commentId:n,isRoot:!a.parentId,comment:a}}))}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){const a=this._ensureCommentMap(e,t).get(n);return a&&(a.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,a.threadId)),!0}deleteUnit(e){const t=this._commentsMap.get(e);t&&t.forEach((n,o)=>{n.forEach(a=>{this.deleteComment(e,o,a.id)})})}getUnit(e){const t=this._threadMap.get(e);if(!t)return[];const n=[];return t.forEach((o,a)=>{o.forEach((r,i)=>{const h=this.getThread(e,a,i);h&&n.push(h)})}),n}getAll(){const e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}},d.ThreadCommentModel=W([N(0,s.Inject(C)),N(1,s.Inject(s.LifecycleService))],d.ThreadCommentModel);const v={id:"thread-comment.mutation.add-comment",type:s.CommandType.MUTATION,handler(c,m,e){if(!m)return!1;const t=c.get(d.ThreadCommentModel),{unitId:n,subUnitId:o,comment:a,sync:r}=m,i=r||(e==null?void 0:e.fromChangeset)&&!a.parentId;return t.addComment(n,o,a,i)}},g={id:"thread-comment.mutation.update-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=m;return e.updateComment(t,n,o,a)}},D={id:"thread-comment.mutation.update-comment-ref",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=m;return e.updateCommentRef(t,n,o,a)}},S={id:"thread-comment.mutation.resolve-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,resolved:o,commentId:a}=m;return e.resolveComment(t,n,a,o)}},_={id:"thread-comment.mutation.delete-comment",type:s.CommandType.MUTATION,handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),{unitId:t,subUnitId:n,commentId:o}=m;return e.deleteComment(t,n,o)}},O={id:"thread-comment.command.add-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(s.ICommandService),t=c.get(C),{comment:n}=m,o=await t.addComment(n),a=t.syncUpdateMutationToColla,r=!n.parentId,i={id:v.id,params:{...m,comment:o}};return r?await e.executeCommand(i.id,i.params):e.executeCommand(i.id,i.params,{onlyLocal:!a})}},R={id:"thread-comment.command.update-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const{unitId:e,subUnitId:t,payload:n}=m,o=c.get(s.ICommandService),a=c.get(d.ThreadCommentModel),r=c.get(C),i=r.syncUpdateMutationToColla,h=a.getComment(e,t,n.commentId);if(!h)return!1;const{children:l,...p}=h;if(!await r.updateComment({...p,...n}))return!1;const f={id:g.id,params:m};return o.executeCommand(f.id,f.params,{onlyLocal:!i}),!0}},w={id:"thread-comment.command.resolve-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const{unitId:e,subUnitId:t,resolved:n,commentId:o}=m,a=c.get(C),i=c.get(d.ThreadCommentModel).getComment(e,t,o),h=a.syncUpdateMutationToColla;return!i||!await a.resolveComment({...i,resolved:n})?!1:c.get(s.ICommandService).executeCommand(S.id,m,{onlyLocal:!h})}},A={id:"thread-comment.command.delete-comment",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),t=c.get(C),n=c.get(s.ICommandService),{unitId:o,subUnitId:a,commentId:r}=m,i=t.syncUpdateMutationToColla,h=e.getComment(o,a,r);if(!h||!await t.deleteComment(o,a,h.threadId,r))return!1;const l={id:_.id,params:m};return n.executeCommand(l.id,l.params,{onlyLocal:!i})}},P={id:"thread-comment.command.delete-comment-tree",type:s.CommandType.COMMAND,async handler(c,m){if(!m)return!1;const e=c.get(d.ThreadCommentModel),t=c.get(s.ICommandService),n=c.get(C),{unitId:o,subUnitId:a,commentId:r}=m,i=e.getCommentWithChildren(o,a,r);return!i||!await n.deleteComment(o,a,i.root.threadId,r)?!1:await t.executeCommand(_.id,{unitId:o,subUnitId:a,commentId:i.root.id})}};function G(c){return s.dayjs(c).format("YYYY/MM/DD HH:mm")}const y="UNIVER_THREAD_COMMENT_PLUGIN";var J=Object.getOwnPropertyDescriptor,V=(c,m,e,t)=>{for(var n=t>1?void 0:t?J(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},U=(c,m)=>(e,t)=>m(e,t,c);const j=`SHEET_${y}`;d.ThreadCommentResourceController=class extends s.Disposable{constructor(m,e,t){super(),this._resourceManagerService=m,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSnapshot()}_initSnapshot(){const m=t=>{const n=this._threadCommentModel.getUnit(t),o={};return n?(n.forEach(a=>{var i;const r=(i=o[a.subUnitId])!=null?i:[];r.push({...a.root,children:a.children}),o[a.subUnitId]=r}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(o,t))):""},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:j,businesses:[s.UniverInstanceType.UNIVER_SHEET,s.UniverInstanceType.UNIVER_DOC],toJson:t=>m(t),parseJson:t=>e(t),onUnLoad:t=>{this._threadCommentModel.deleteUnit(t)},onLoad:async(t,n)=>{Object.keys(n).forEach(o=>{const a=n[o];a.forEach(r=>{this._threadCommentModel.addComment(t,o,r)}),this._threadCommentModel.syncThreadComments(t,o,a.map(r=>r.threadId))})}}))}},d.ThreadCommentResourceController=V([U(0,s.IResourceManagerService),U(1,s.Inject(d.ThreadCommentModel)),U(2,C)],d.ThreadCommentResourceController);const b="thread-comment.config",$={};var Y=Object.getOwnPropertyDescriptor,k=(c,m,e,t)=>{for(var n=t>1?void 0:t?Y(m,e):m,o=c.length-1,a;o>=0;o--)(a=c[o])&&(n=a(n)||n);return n},E=(c,m)=>(e,t)=>m(e,t,c);d.UniverThreadCommentPlugin=(T=class extends s.Plugin{constructor(m=$,e,t,n){super(),this._config=m,this._injector=e,this._commandService=t,this._configService=n;const{...o}=s.merge({},$,this._config);this._configService.setConfig(b,o)}onStarting(){var m;s.mergeOverrideWithDependencies([[C,{useClass:I}],[d.ThreadCommentModel],[d.ThreadCommentResourceController]],(m=this._config)==null?void 0:m.overrides).forEach(e=>{this._injector.add(e)}),[O,R,A,w,P,v,g,D,_,S].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(d.ThreadCommentResourceController)}},u(T,"pluginName",y),u(T,"type",s.UniverInstanceType.UNIVER_UNKNOWN),T),d.UniverThreadCommentPlugin=k([E(1,s.Inject(s.Injector)),E(2,s.ICommandService),E(3,s.IConfigService)],d.UniverThreadCommentPlugin),d.AddCommentCommand=O,d.AddCommentMutation=v,d.DeleteCommentCommand=A,d.DeleteCommentMutation=_,d.DeleteCommentTreeCommand=P,d.IThreadCommentDataSourceService=C,d.ResolveCommentCommand=w,d.ResolveCommentMutation=S,d.SHEET_UNIVER_THREAD_COMMENT_PLUGIN=j,d.TC_PLUGIN_NAME=y,d.ThreadCommentDataSourceService=I,d.UpdateCommentCommand=R,d.UpdateCommentMutation=g,d.UpdateCommentRefMutation=D,d.getDT=G,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
15
15
 
16
16
 
17
17
  // index
18
- (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/docs"),require("@univerjs/docs-drawing"),require("@univerjs/docs-hyper-link"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment"),require("@univerjs/engine-formula/lib/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/docs","@univerjs/docs-drawing","@univerjs/docs-hyper-link","@univerjs/engine-formula","@univerjs/thread-comment","@univerjs/engine-formula/lib/facade"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverPresetDocsNodeCore={},e.UniverDocs,e.UniverDocsDrawing,e.UniverDocsHyperLink,e.UniverEngineFormula,e.UniverThreadComment))})(this,function(e,n,r,o,u,s){"use strict";function t(d={}){const{formula:i}=d;return{plugins:[[u.UniverFormulaEnginePlugin,{function:i==null?void 0:i.function}],s.UniverThreadCommentPlugin,n.UniverDocsPlugin,o.UniverDocsHyperLinkPlugin,r.UniverDocsDrawingPlugin].filter(c=>!!c)}}e.UniverDocsNodeCorePreset=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
18
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/docs"),require("@univerjs/docs-drawing"),require("@univerjs/docs-hyper-link"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment"),require("@univerjs/engine-formula/lib/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/docs","@univerjs/docs-drawing","@univerjs/docs-hyper-link","@univerjs/engine-formula","@univerjs/thread-comment","@univerjs/engine-formula/lib/facade"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverPresetDocsNodeCore={},e.UniverDocs,e.UniverDocsDrawing,e.UniverDocsHyperLink,e.UniverEngineFormula,e.UniverThreadComment))})(this,(function(e,n,r,o,u,s){"use strict";function t(d={}){const{formula:i}=d;return{plugins:[[u.UniverFormulaEnginePlugin,{function:i==null?void 0:i.function}],s.UniverThreadCommentPlugin,n.UniverDocsPlugin,o.UniverDocsHyperLinkPlugin,r.UniverDocsDrawingPlugin].filter(c=>!!c)}}e.UniverDocsNodeCorePreset=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1,2 +1,2 @@
1
1
  // locale/ca-ES
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreCaES=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreCaES=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/en-US
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreEnUS=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreEnUS=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/es-ES
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreEsES=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreEsES=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/fa-IR
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreFaIR=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreFaIR=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/fr-FR
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreFrFR=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreFrFR=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/ko-KR
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreKoKR=o(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreKoKR=o(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/ru-RU
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreRuRU=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreRuRU=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/vi-VN
2
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreViVN=i(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreViVN=i(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/zh-CN
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreZhCN=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreZhCN=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
@@ -1,2 +1,2 @@
1
1
  // locale/zh-TW
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreZhTW=n(e.UniverCore))})(this,function(e){"use strict";return e.mergeLocales()});
2
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsNodeCoreZhTW=n(e.UniverCore))})(this,(function(e){"use strict";return e.mergeLocales()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-docs-node-core",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -56,20 +56,20 @@
56
56
  "rxjs": ">=7.0.0"
57
57
  },
58
58
  "dependencies": {
59
- "@univerjs/docs": "0.10.4",
60
- "@univerjs/docs-drawing": "0.10.4",
61
- "@univerjs/docs-hyper-link": "0.10.4",
62
- "@univerjs/drawing": "0.10.4",
63
- "@univerjs/engine-formula": "0.10.4",
64
- "@univerjs/engine-render": "0.10.4",
65
- "@univerjs/rpc-node": "0.10.4",
66
- "@univerjs/thread-comment": "0.10.4"
59
+ "@univerjs/docs": "0.10.6",
60
+ "@univerjs/docs-drawing": "0.10.6",
61
+ "@univerjs/docs-hyper-link": "0.10.6",
62
+ "@univerjs/drawing": "0.10.6",
63
+ "@univerjs/engine-formula": "0.10.6",
64
+ "@univerjs/engine-render": "0.10.6",
65
+ "@univerjs/rpc-node": "0.10.6",
66
+ "@univerjs/thread-comment": "0.10.6"
67
67
  },
68
68
  "devDependencies": {
69
- "@univerjs/core": "0.10.4",
69
+ "@univerjs/core": "0.10.6",
70
70
  "rxjs": "7.8.2",
71
- "typescript": "^5.8.3",
72
- "@univerjs-infra/shared": "0.10.4"
71
+ "typescript": "^5.9.2",
72
+ "@univerjs-infra/shared": "0.10.6"
73
73
  },
74
74
  "scripts": {
75
75
  "prebuild:preset": "tsx prepare.ts",