@univerjs/sheets-thread-comment 0.2.3 → 0.2.4

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.
@@ -2,7 +2,7 @@ import { DependencyOverride, Disposable, ICommandService, IUniverInstanceService
2
2
  import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
3
3
  import { Injector } from '@wendellhu/redi';
4
4
  import { ThreadCommentPanelService } from '@univerjs/thread-comment-ui';
5
- import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
5
+ import { IMarkSelectionService, SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
6
6
  import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment-base';
7
7
  import { SheetsThreadCommentPopupService } from '../services/sheets-thread-comment-popup.service';
8
8
 
@@ -23,10 +23,14 @@ export declare class SheetsThreadCommentController extends Disposable {
23
23
  private readonly _shortcutService;
24
24
  private readonly _univerInstanceService;
25
25
  private readonly _sheetPermissionInterceptorBaseController;
26
- constructor(_config: Partial<IUniverSheetsThreadCommentConfig>, _menuService: IMenuService, _injector: Injector, _componentManager: ComponentManager, _commandService: ICommandService, _sheetsThreadCommentPopupService: SheetsThreadCommentPopupService, _sheetsThreadCommentModel: SheetsThreadCommentModel, _threadCommentPanelService: ThreadCommentPanelService, _shortcutService: IShortcutService, _univerInstanceService: IUniverInstanceService, _sheetPermissionInterceptorBaseController: SheetPermissionInterceptorBaseController);
26
+ private readonly _markSelectionService;
27
+ private _isSwitchToCommenting;
28
+ private _selectionShapeInfo;
29
+ constructor(_config: Partial<IUniverSheetsThreadCommentConfig>, _menuService: IMenuService, _injector: Injector, _componentManager: ComponentManager, _commandService: ICommandService, _sheetsThreadCommentPopupService: SheetsThreadCommentPopupService, _sheetsThreadCommentModel: SheetsThreadCommentModel, _threadCommentPanelService: ThreadCommentPanelService, _shortcutService: IShortcutService, _univerInstanceService: IUniverInstanceService, _sheetPermissionInterceptorBaseController: SheetPermissionInterceptorBaseController, _markSelectionService: IMarkSelectionService);
27
30
  private _initShortcut;
28
31
  private _initCommandListener;
29
32
  private _initMenu;
30
33
  private _initComponent;
31
34
  private _initPanelListener;
35
+ private _initMarkSelection;
32
36
  }
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export declare const SheetsThreadCommentPanel: () => React.JSX.Element | null;
3
+ export declare const SheetsThreadCommentPanel: () => React.JSX.Element;
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(a,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@wendellhu/redi"),require("@univerjs/core"),require("@univerjs/thread-comment-ui"),require("@univerjs/ui"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment"),require("@univerjs/sheets-ui"),require("@univerjs/sheets-thread-comment-base"),require("@wendellhu/redi/react-bindings"),require("react"),require("rxjs"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","@univerjs/core","@univerjs/thread-comment-ui","@univerjs/ui","@univerjs/sheets","@univerjs/engine-formula","@univerjs/thread-comment","@univerjs/sheets-ui","@univerjs/sheets-thread-comment-base","@wendellhu/redi/react-bindings","react","rxjs","@univerjs/engine-render"],m):(a=typeof globalThis<"u"?globalThis:a||self,m(a.UniverSheetsThreadComment={},a["@wendellhu/redi"],a.UniverCore,a.UniverThreadCommentUi,a.UniverUi,a.UniverSheets,a.UniverEngineFormula,a.UniverThreadComment,a.UniverSheetsUi,a.UniverSheetsThreadCommentBase,a["@wendellhu/redi/react-bindings"],a.React,a.rxjs,a.UniverEngineRender))})(this,function(a,m,c,T,f,C,V,g,b,D,R,y,G,se){"use strict";var We=Object.defineProperty;var Fe=(a,m,c)=>m in a?We(a,m,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[m]=c;var A=(a,m,c)=>Fe(a,typeof m!="symbol"?m+"":m,c);var M=function(){return M=Object.assign||function(o){for(var r,n=1,e=arguments.length;n<e;n++){r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(o[t]=r[t])}return o},M.apply(this,arguments)},ae=function(o,r){var n={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&r.indexOf(e)<0&&(n[e]=o[e]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(o);t<e.length;t++)r.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(o,e[t])&&(n[e[t]]=o[e[t]]);return n},J=y.forwardRef(function(o,r){var n=o.icon,e=o.id,t=o.className,i=o.extend,s=ae(o,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(e," ").concat(t||"").trim(),l=y.useRef("_".concat(me()));return Q(n,"".concat(e),{defIds:n.defIds,idSuffix:l.current},M({ref:r,className:u},s),i)});function Q(o,r,n,e,t){return y.createElement(o.tag,M(M({key:r},ce(o,n,t)),e),(ue(o,n).children||[]).map(function(i,s){return Q(i,"".concat(r,"-").concat(o.tag,"-").concat(s),n,void 0,t)}))}function ce(o,r,n){var e=M({},o.attrs);n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1);var t=r.defIds;return!t||t.length===0||(o.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+r.idSuffix),Object.entries(e).forEach(function(i){var s=i[0],u=i[1];typeof u=="string"&&(e[s]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(r.idSuffix,")")))})),e}function ue(o,r){var n,e=r.defIds;return!e||e.length===0?o:o.tag==="defs"&&(!((n=o.children)===null||n===void 0)&&n.length)?M(M({},o),{children:o.children.map(function(t){return typeof t.attrs.id=="string"&&e&&e.indexOf(t.attrs.id)>-1?M(M({},t),{attrs:M(M({},t.attrs),{id:t.attrs.id+r.idSuffix})}):t})}):o}function me(){return Math.random().toString(36).substring(2,8)}J.displayName="UniverIcon";var de={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},x=y.forwardRef(function(o,r){return y.createElement(J,Object.assign({},o,{id:"comment-single",ref:r,icon:de}))});x.displayName="CommentSingle";const ee="univer.sheet.thread-comment-modal",K="comment-single",Y="SHEET_THREAD_COMMENT";var he=Object.defineProperty,le=Object.getOwnPropertyDescriptor,pe=(o,r,n,e)=>{for(var t=e>1?void 0:e?le(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&he(r,n,t),t},te=(o,r)=>(n,e)=>r(n,e,o);a.SheetsThreadCommentPopupService=class extends c.Disposable{constructor(n,e){super();A(this,"_lastPopup",null);A(this,"_activePopup");A(this,"_activePopup$",new G.BehaviorSubject(null));A(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=n,this._zenZoneService=e,this._initZenVisible()}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}showPopup(n,e){var v;const{row:t,col:i,unitId:s,subUnitId:u}=n;if(this._activePopup&&t===this._activePopup.row&&i===this._activePopup.col&&s===this._activePopup.unitId&&u===((v=this.activePopup)==null?void 0:v.subUnitId)){this._activePopup=n,this._activePopup$.next(n);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=n,this._activePopup$.next(n);const l=this._canvasPopupManagerService.attachPopupToCell(t,i,{componentKey:ee,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!l)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const p=new c.DisposableCollection;p.add(l),p.add({dispose:()=>{e==null||e()}}),this._lastPopup=p}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},a.SheetsThreadCommentPopupService=pe([te(0,m.Inject(b.SheetCanvasPopManagerService)),te(1,f.IZenZoneService)],a.SheetsThreadCommentPopupService);const ve=()=>{const o=R.useDependency(c.IUniverInstanceService),r=R.useDependency(a.SheetsThreadCommentPopupService),n=f.useObservable(r.activePopup$),e=R.useDependency(D.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!n)return null;const{row:t,col:i,unitId:s,subUnitId:u,trigger:l}=n,p=e.getByLocation(s,u,t,i),v=`${c.Tools.chatAtABC(i)}${t+1}`,d=()=>{r.hidePopup()},_=S=>{var P,w,N;return(N=(w=(P=o.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:P.getSheetBySheetId(S))==null?void 0:w.getName())!=null?N:""};return y.createElement(T.ThreadCommentTree,{onClick:()=>{r.persistPopup()},prefix:"cell",id:p,unitId:s,subUnitId:u,type:c.UniverInstanceType.UNIVER_SHEET,refStr:v,onClose:d,getSubUnitName:_,autoFocus:l==="context-menu"})},H={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(o){var P;const r=o.get(C.SheetsSelectionsService),n=o.get(c.IUniverInstanceService),e=o.get(a.SheetsThreadCommentPopupService),t=o.get(T.ThreadCommentPanelService),i=(P=r.getCurrentLastSelection())==null?void 0:P.primary,s=o.get(D.SheetsThreadCommentModel);if(!i)return!1;const u=C.getSheetCommandTarget(n);if(!u)return!1;const{workbook:l,worksheet:p,unitId:v,subUnitId:d}=u,_={workbook:l,worksheet:p,unitId:v,subUnitId:d,row:i.startRow,col:i.startColumn};e.showPopup(_);const S=s.getByLocation(v,d,i.startRow,i.startColumn);return S&&t.setActiveComment({unitId:v,subUnitId:d,commentId:S,trigger:"context-menu"}),!0}},Ce=()=>{var z;const o=R.useDependency(b.IMarkSelectionService),r=R.useDependency(c.IUniverInstanceService),n=R.useDependency(g.ThreadCommentModel),e=R.useDependency(a.SheetsThreadCommentPopupService),t=r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const i=t.getUnitId(),s=R.useDependency(c.ICommandService),u=y.useMemo(()=>t.activeSheet$.pipe(G.map(h=>h==null?void 0:h.getSheetId())),[t.activeSheet$]),l=f.useObservable(u,(z=t.getActiveSheet())==null?void 0:z.getSheetId()),p=y.useRef(),v=R.useDependency(T.ThreadCommentPanelService),d=f.useObservable(v.activeCommentId$),_=y.useCallback(h=>{const I=t.getSheets(),O={};I.forEach((j,U)=>{O[j.getSheetId()]=U});const k=j=>j.map(U=>{var ie;const $=V.singleReferenceToGrid(U.ref),ke=[(ie=O[U.subUnitId])!=null?ie:0,$.row,$.column];return{...U,p:ke}}).sort((U,$)=>U.p[0]===$.p[0]?U.p[1]===$.p[1]?U.p[2]-$.p[2]:U.p[1]-$.p[1]:U.p[0]-$.p[0]);return[...k(h.filter(j=>!j.resolved)),...k(h.filter(j=>j.resolved))]},[t]),S=y.useCallback(h=>{if(h.unitId===i&&h.subUnitId===l&&!h.resolved){const{row:I,column:O}=V.singleReferenceToGrid(h.ref);if(!Number.isNaN(I)&&!Number.isNaN(O))return o.addShape({range:{startColumn:O,endColumn:O,startRow:I,endRow:I},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[o,l,i]),P=h=>{var I,O;return(O=(I=t.getSheetBySheetId(h))==null?void 0:I.getName())!=null?O:""},w=()=>{s.executeCommand(H.id)},N=h=>{d&&d.unitId===h.unitId&&d.subUnitId===h.subUnitId&&d.commentId===h.id||(p.current&&(o.removeShape(p.current),p.current=null),p.current=S(h))},L=()=>{p.current&&(o.removeShape(p.current),p.current=null)},Z=(h,I)=>{I&&e.hidePopup()};return y.useEffect(()=>{if(!d)return;const h=n.getComment(d.unitId,d.subUnitId,d.commentId);if(!h)return;const I=S(h);return()=>{I&&o.removeShape(I)}},[S,d,n,o]),y.createElement(T.ThreadCommentPanel,{unitId:i,subUnitId$:u,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:w,getSubUnitName:P,onResolve:Z,sortComments:_,onItemEnter:N,onItemLeave:L,onDeleteComment:()=>(L(),!0)})},Se=o=>({id:H.id,type:f.MenuItemType.BUTTON,positions:[f.MenuPosition.CONTEXT_MENU],icon:K,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET),disabled$:b.getCurrentRangeDisable$(o,{workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]})}),fe=o=>({id:T.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:K,tooltip:"sheetThreadComment.menu.commentManagement",positions:f.MenuPosition.TOOLBAR_START,group:f.MenuGroup.TOOLBAR_OTHERS,disabled$:b.getCurrentRangeDisable$(o,{workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET)}),_e={id:H.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:b.whenSheetEditorFocused};var Ie=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Te=(o,r,n,e)=>{for(var t=e>1?void 0:e?Pe(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&Ie(r,n,t),t},E=(o,r)=>(n,e)=>r(n,e,o);const ge={};a.SheetsThreadCommentController=class extends c.Disposable{constructor(r,n,e,t,i,s,u,l,p,v,d){super(),this._config=r,this._menuService=n,this._injector=e,this._componentManager=t,this._commandService=i,this._sheetsThreadCommentPopupService=s,this._sheetsThreadCommentModel=u,this._threadCommentPanelService=l,this._shortcutService=p,this._univerInstanceService=v,this._sheetPermissionInterceptorBaseController=d,this._initMenu(),this._initShortcut(),this._initComponent(),this._initCommandListener(),this._initPanelListener()}_initShortcut(){this._shortcutService.registerShortcut(_e)}_initCommandListener(){this._commandService.onCommandExecuted(r=>{if(r.id===C.SetSelectionsOperation.id){const n=r.params,{unitId:e,subUnitId:t,selections:i,type:s}=n;if((s===C.SelectionMoveType.MOVE_END||s===void 0)&&i[0].primary){const u=i[0].primary.actualRow,l=i[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(e,t,u,l)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(T.SetActiveCommentOperation.id);return}const p=this._sheetsThreadCommentModel.getByLocation(e,t,u,l);p&&this._commandService.executeCommand(T.SetActiveCommentOperation.id,{unitId:e,subUnitId:t,commentId:p})}}if(r.id===g.DeleteCommentMutation.id){const n=r.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:t,subUnitId:i,commentId:s}=e;n.unitId===t&&n.subUnitId===i&&n.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initMenu(){const{menu:r={}}=this._config;[Se,fe].forEach(n=>{this._menuService.addMenuItem(n(this._injector),r)})}_initComponent(){[[ee,ve],[T.THREAD_COMMENT_PANEL,Ce],[K,x]].forEach(([r,n])=>{this._componentManager.register(r,n)})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async r=>{var n;if(r){const{unitId:e,subUnitId:t,commentId:i,trigger:s}=r,u=this._sheetsThreadCommentModel.getComment(e,t,i);if(!u||u.resolved)return;const l=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!l||l.getUnitId()!==e)return;((n=l.getActiveSheet())==null?void 0:n.getSheetId())!==t&&await this._commandService.executeCommand(C.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:t});const d=V.singleReferenceToGrid(u.ref),{row:_,column:S}=d;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]},[{startRow:_,startColumn:S,endRow:_,endColumn:S}]))return;const w=1;await this._commandService.executeCommand(b.ScrollToRangeOperation.id,{range:{startRow:Math.max(d.row-w,0),endRow:d.row+w,startColumn:Math.max(d.column-w,0),endColumn:d.column+w}}),this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:t,row:d.row,col:d.column,commentId:u.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}},a.SheetsThreadCommentController=Te([c.OnLifecycle(c.LifecycleStages.Starting,a.SheetsThreadCommentController),E(1,f.IMenuService),E(2,m.Inject(m.Injector)),E(3,m.Inject(f.ComponentManager)),E(4,c.ICommandService),E(5,m.Inject(a.SheetsThreadCommentPopupService)),E(6,m.Inject(D.SheetsThreadCommentModel)),E(7,m.Inject(T.ThreadCommentPanelService)),E(8,f.IShortcutService),E(9,c.IUniverInstanceService),E(10,m.Inject(b.SheetPermissionInterceptorBaseController))],a.SheetsThreadCommentController);var be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Me=(o,r,n,e)=>{for(var t=e>1?void 0:e?ye(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&be(r,n,t),t},W=(o,r)=>(n,e)=>r(n,e,o);let F=class extends c.Disposable{constructor(o,r,n,e){super(),this._sheetInterceptorService=o,this._sheetsThreadCommentModel=r,this._univerInstanceService=n,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(C.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(o,r,n)=>{const{row:e,col:t,unitId:i,subUnitId:s}=r;return this._sheetsThreadCommentModel.showCommentMarker(i,s,e,t)?n({...o,markers:{...o==null?void 0:o.markers,tr:{color:"#FFBD37",size:6}}}):n(o)},priority:100}))}_initSkeletonChange(){const o=()=>{var s;const r=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!r)return;const n=r.getUnitId(),e=(s=r.getActiveSheet())==null?void 0:s.getSheetId();if(!e){console.warn("No active sheet found");return}const t=this._renderManagerService.getRenderById(n),i=t==null?void 0:t.with(b.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:e});i==null||i.makeDirty(!0),i==null||i.calculate(),t&&t.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(r=>{o()}))}};F=Me([c.OnLifecycle(c.LifecycleStages.Ready,F),W(0,m.Inject(C.SheetInterceptorService)),W(1,m.Inject(D.SheetsThreadCommentModel)),W(2,c.IUniverInstanceService),W(3,se.IRenderManagerService)],F);var we=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Ue=(o,r,n,e)=>{for(var t=e>1?void 0:e?Oe(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&we(r,n,t),t},X=(o,r)=>(n,e)=>r(n,e,o);const Ee=(o,r,n)=>{const e=V.singleReferenceToGrid(o),t=n.row-r.row,i=n.column-r.column,s={startColumn:e.column+i,startRow:e.row+t,endColumn:e.column+i,endRow:e.row+t};return V.serializeRange(s)};a.SheetsThreadCommentCopyPasteController=class extends c.Disposable{constructor(n,e,t){super();A(this,"_copyInfo");this._sheetClipboardService=n,this._sheetsThreadCommentModel=e,this._threadCommentDataSourceService=t,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Y,onBeforeCopy:(n,e,t)=>{this._copyInfo={unitId:n,subUnitId:e,range:t}},onPasteCells:(n,e,t,i)=>{const{unitId:s,subUnitId:u,range:l}=e,p={row:l.rows[0],column:l.cols[0]};if(i.copyType===b.COPY_TYPE.CUT&&this._copyInfo){const{range:v,unitId:d,subUnitId:_}=this._copyInfo,S={row:v.startRow,column:v.startColumn};if(!(s===d&&u===_)){const P=[];c.Range.foreach(v,(h,I)=>{const O=this._sheetsThreadCommentModel.getAllByLocation(d,_,h,I);this._threadCommentDataSourceService.syncUpdateMutationToColla?O.forEach(k=>{P.push(k)}):O.forEach(({children:k,...j})=>{j.parentId||P.push(j)})});const w=[],N=[],L=[],Z=[],z=h=>{w.unshift({id:g.DeleteCommentMutation.id,params:{unitId:d,subUnitId:_,commentId:h.id}}),L.push({id:g.AddCommentMutation.id,params:{unitId:s,subUnitId:u,comment:{...h,ref:Ee(h.ref,S,p),unitId:s,subUnitId:u},sync:!0}}),N.push({id:g.AddCommentMutation.id,params:{unitId:d,subUnitId:_,comment:h,sync:!0}}),Z.unshift({id:g.DeleteCommentMutation.id,params:{unitId:s,subUnitId:u,commentId:h.id}})};return P.forEach(h=>{z(h)}),{redos:[...w,...L],undos:[...Z,...N]}}}return{redos:[],undos:[]}}}))}},a.SheetsThreadCommentCopyPasteController=Ue([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentCopyPasteController),X(0,m.Inject(b.ISheetClipboardService)),X(1,m.Inject(D.SheetsThreadCommentModel)),X(2,g.IThreadCommentDataSourceService)],a.SheetsThreadCommentCopyPasteController);var je=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,De=(o,r,n,e)=>{for(var t=e>1?void 0:e?Re(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&je(r,n,t),t},q=(o,r)=>(n,e)=>r(n,e,o);a.SheetsThreadCommentHoverController=class extends c.Disposable{constructor(r,n,e,t){super(),this._hoverManagerService=r,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._sheetPermissionInterceptorBaseController=t,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(G.debounceTime(100)).subscribe(r=>{const n=this._sheetsThreadCommentPopupService.activePopup;if(r&&(n&&n.temp||!n)){const{location:e}=r,{unitId:t,subUnitId:i,row:s,col:u}=e,l=this._sheetsThreadCommentModel.getByLocation(t,i,s,u);if(l){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]},[{startRow:s,startColumn:u,endRow:s,endColumn:u}]))return;const v=this._sheetsThreadCommentModel.getComment(t,i,l);v&&!v.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:i,row:s,col:u,commentId:l,temp:!0})}else n&&this._sheetsThreadCommentPopupService.hidePopup()}}))}},a.SheetsThreadCommentHoverController=De([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentHoverController),q(0,m.Inject(b.HoverManagerService)),q(1,m.Inject(a.SheetsThreadCommentPopupService)),q(2,m.Inject(D.SheetsThreadCommentModel)),q(3,m.Inject(b.SheetPermissionInterceptorBaseController))],a.SheetsThreadCommentHoverController);var $e=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ae=(o,r,n,e)=>{for(var t=e>1?void 0:e?Ne(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&$e(r,n,t),t},B=(o,r)=>(n,e)=>r(n,e,o);a.ThreadCommentRemoveSheetsController=class extends c.Disposable{constructor(r,n,e,t){super(),this._sheetInterceptorService=r,this._univerInstanceService=n,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{var n;if(r.id===C.RemoveSheetCommand.id){const e=r.params,t=e.unitId?this._univerInstanceService.getUnit(e.unitId):this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return{redos:[],undos:[]};const i=t.getUnitId(),s=e.subUnitId||((n=t.getActiveSheet())==null?void 0:n.getSheetId());if(!s)return{redos:[],undos:[]};const{commentMap:u}=this._threadCommentModel.ensureMap(i,s),l=Array.from(Object.values(u)).filter(S=>!S.parentId),p=l.map(S=>S.id),v=this._threadCommentDataSourceService.syncUpdateMutationToColla,d=p.map(S=>({id:g.DeleteCommentMutation.id,params:{unitId:i,subUnitId:s,commentId:S}})),_=l.map(({children:S,...P})=>({id:g.AddCommentMutation.id,params:{unitId:i,subUnitId:s,comment:{...P,children:v?S:void 0},sync:!v}}));return{redos:d,undos:_}}return{redos:[],undos:[]}}}))}},a.ThreadCommentRemoveSheetsController=Ae([c.OnLifecycle(c.LifecycleStages.Ready,a.ThreadCommentRemoveSheetsController),B(0,m.Inject(C.SheetInterceptorService)),B(1,c.IUniverInstanceService),B(2,m.Inject(g.ThreadCommentModel)),B(3,g.IThreadCommentDataSourceService)],a.ThreadCommentRemoveSheetsController);var ne=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,He=(o,r,n)=>r in o?ne(o,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[r]=n,Le=(o,r,n,e)=>{for(var t=e>1?void 0:e?Ve(r,n):r,i=o.length-1,s;i>=0;i--)(s=o[i])&&(t=(e?s(r,n,t):s(t))||t);return e&&t&&ne(r,n,t),t},re=(o,r)=>(n,e)=>r(n,e,o),oe=(o,r,n)=>He(o,typeof r!="symbol"?r+"":r,n);a.UniverSheetsThreadCommentPlugin=class extends c.Plugin{constructor(n={},e,t){super();A(this,"_pluginConfig");this._injector=e,this._commandService=t,this._pluginConfig=c.Tools.deepMerge({},ge,n)}onStarting(n){[[a.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(a.SheetsThreadCommentController,this._pluginConfig)}],[F],[a.SheetsThreadCommentCopyPasteController],[a.SheetsThreadCommentHoverController],[a.ThreadCommentRemoveSheetsController],[a.SheetsThreadCommentPopupService]].forEach(e=>{n.add(e)}),[H].forEach(e=>{this._commandService.registerCommand(e)})}},oe(a.UniverSheetsThreadCommentPlugin,"pluginName",Y),oe(a.UniverSheetsThreadCommentPlugin,"type",c.UniverInstanceType.UNIVER_SHEET),a.UniverSheetsThreadCommentPlugin=Le([c.DependentOn(T.UniverThreadCommentUIPlugin,D.UniverSheetsThreadCommentBasePlugin),re(1,m.Inject(m.Injector)),re(2,m.Inject(c.ICommandService))],a.UniverSheetsThreadCommentPlugin),Object.defineProperty(a,"Inject",{enumerable:!0,get:()=>m.Inject}),Object.defineProperty(a,"Injector",{enumerable:!0,get:()=>m.Injector}),Object.defineProperty(a,"ICommandService",{enumerable:!0,get:()=>c.ICommandService}),Object.defineProperty(a,"Plugin",{enumerable:!0,get:()=>c.Plugin}),Object.defineProperty(a,"UniverInstanceType",{enumerable:!0,get:()=>c.UniverInstanceType}),Object.defineProperty(a,"IThreadCommentMentionDataService",{enumerable:!0,get:()=>T.IThreadCommentMentionDataService}),Object.defineProperty(a,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>T.UniverThreadCommentUIPlugin}),Object.defineProperty(a,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>g.IThreadCommentDataSourceService}),Object.defineProperty(a,"SheetsThreadCommentModel",{enumerable:!0,get:()=>D.SheetsThreadCommentModel}),a.SHEETS_THREAD_COMMENT=Y,a.ShowAddSheetCommentModalOperation=H,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
1
+ (function(a,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@wendellhu/redi"),require("@univerjs/core"),require("@univerjs/thread-comment-ui"),require("@univerjs/ui"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment"),require("@univerjs/sheets-ui"),require("@univerjs/sheets-thread-comment-base"),require("@wendellhu/redi/react-bindings"),require("react"),require("rxjs"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","@univerjs/core","@univerjs/thread-comment-ui","@univerjs/ui","@univerjs/sheets","@univerjs/engine-formula","@univerjs/thread-comment","@univerjs/sheets-ui","@univerjs/sheets-thread-comment-base","@wendellhu/redi/react-bindings","react","rxjs","@univerjs/engine-render"],d):(a=typeof globalThis<"u"?globalThis:a||self,d(a.UniverSheetsThreadComment={},a["@wendellhu/redi"],a.UniverCore,a.UniverThreadCommentUi,a.UniverUi,a.UniverSheets,a.UniverEngineFormula,a.UniverThreadComment,a.UniverSheetsUi,a.UniverSheetsThreadCommentBase,a["@wendellhu/redi/react-bindings"],a.React,a.rxjs,a.UniverEngineRender))})(this,function(a,d,c,T,_,S,A,O,P,D,N,g,W,se){"use strict";var We=Object.defineProperty;var Fe=(a,d,c)=>d in a?We(a,d,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[d]=c;var R=(a,d,c)=>Fe(a,typeof d!="symbol"?d+"":d,c);var b=function(){return b=Object.assign||function(r){for(var o,n=1,e=arguments.length;n<e;n++){o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},b.apply(this,arguments)},ae=function(r,o){var n={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.indexOf(e)<0&&(n[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(r);t<e.length;t++)o.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(r,e[t])&&(n[e[t]]=r[e[t]]);return n},J=g.forwardRef(function(r,o){var n=r.icon,e=r.id,t=r.className,i=r.extend,s=ae(r,["icon","id","className","extend"]),m="univerjs-icon univerjs-icon-".concat(e," ").concat(t||"").trim(),u=g.useRef("_".concat(me()));return Q(n,"".concat(e),{defIds:n.defIds,idSuffix:u.current},b({ref:o,className:m},s),i)});function Q(r,o,n,e,t){return g.createElement(r.tag,b(b({key:o},ce(r,n,t)),e),(ue(r,n).children||[]).map(function(i,s){return Q(i,"".concat(o,"-").concat(r.tag,"-").concat(s),n,void 0,t)}))}function ce(r,o,n){var e=b({},r.attrs);n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1);var t=o.defIds;return!t||t.length===0||(r.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+o.idSuffix),Object.entries(e).forEach(function(i){var s=i[0],m=i[1];typeof m=="string"&&(e[s]=m.replace(/url\(#(.*)\)/,"url(#$1".concat(o.idSuffix,")")))})),e}function ue(r,o){var n,e=o.defIds;return!e||e.length===0?r:r.tag==="defs"&&(!((n=r.children)===null||n===void 0)&&n.length)?b(b({},r),{children:r.children.map(function(t){return typeof t.attrs.id=="string"&&e&&e.indexOf(t.attrs.id)>-1?b(b({},t),{attrs:b(b({},t.attrs),{id:t.attrs.id+o.idSuffix})}):t})}):r}function me(){return Math.random().toString(36).substring(2,8)}J.displayName="UniverIcon";var de={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},x=g.forwardRef(function(r,o){return g.createElement(J,Object.assign({},r,{id:"comment-single",ref:o,icon:de}))});x.displayName="CommentSingle";const ee="univer.sheet.thread-comment-modal",K="comment-single",Y="SHEET_THREAD_COMMENT";var he=Object.defineProperty,le=Object.getOwnPropertyDescriptor,pe=(r,o,n,e)=>{for(var t=e>1?void 0:e?le(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&he(o,n,t),t},te=(r,o)=>(n,e)=>o(n,e,r);a.SheetsThreadCommentPopupService=class extends c.Disposable{constructor(n,e){super();R(this,"_lastPopup",null);R(this,"_activePopup");R(this,"_activePopup$",new W.BehaviorSubject(null));R(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=n,this._zenZoneService=e,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}showPopup(n,e){var h;const{row:t,col:i,unitId:s,subUnitId:m}=n;if(this._activePopup&&t===this._activePopup.row&&i===this._activePopup.col&&s===this._activePopup.unitId&&m===((h=this.activePopup)==null?void 0:h.subUnitId)){this._activePopup=n,this._activePopup$.next(n);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=n,this._activePopup$.next(n);const u=this._canvasPopupManagerService.attachPopupToCell(t,i,{componentKey:ee,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!u)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const l=new c.DisposableCollection;l.add(u),l.add({dispose:()=>{e==null||e()}}),this._lastPopup=l}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},a.SheetsThreadCommentPopupService=pe([te(0,d.Inject(P.SheetCanvasPopManagerService)),te(1,_.IZenZoneService)],a.SheetsThreadCommentPopupService);const ve=()=>{const r=N.useDependency(c.IUniverInstanceService),o=N.useDependency(a.SheetsThreadCommentPopupService),n=_.useObservable(o.activePopup$),e=N.useDependency(D.SheetsThreadCommentModel);if(_.useObservable(e.commentUpdate$),!n)return null;const{row:t,col:i,unitId:s,subUnitId:m,trigger:u}=n,l=e.getByLocation(s,m,t,i),h=`${c.Tools.chatAtABC(i)}${t+1}`,C=()=>{o.hidePopup()},v=f=>{var I,$,y;return(y=($=(I=r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getSheetBySheetId(f))==null?void 0:$.getName())!=null?y:""};return g.createElement(T.ThreadCommentTree,{onClick:()=>{o.persistPopup()},prefix:"cell",id:l,unitId:s,subUnitId:m,type:c.UniverInstanceType.UNIVER_SHEET,refStr:h,onClose:C,getSubUnitName:v,autoFocus:u==="context-menu"})},H={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(r){var I;const o=r.get(S.SheetsSelectionsService),n=r.get(c.IUniverInstanceService),e=r.get(a.SheetsThreadCommentPopupService),t=r.get(T.ThreadCommentPanelService),i=(I=o.getCurrentLastSelection())==null?void 0:I.primary,s=r.get(D.SheetsThreadCommentModel);if(!i)return!1;const m=S.getSheetCommandTarget(n);if(!m)return!1;const{workbook:u,worksheet:l,unitId:h,subUnitId:C}=m,v={workbook:u,worksheet:l,unitId:h,subUnitId:C,row:i.startRow,col:i.startColumn};e.showPopup(v);const f=s.getByLocation(h,C,i.startRow,i.startColumn);return f&&t.setActiveComment({unitId:h,subUnitId:C,commentId:f,trigger:"context-menu"}),!0}},Se=()=>{var G;const r=N.useDependency(P.IMarkSelectionService),o=N.useDependency(c.IUniverInstanceService),n=N.useDependency(a.SheetsThreadCommentPopupService),e=o.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET),t=e.getUnitId(),i=N.useDependency(c.ICommandService),s=g.useMemo(()=>e.activeSheet$.pipe(W.map(p=>p==null?void 0:p.getSheetId())),[e.activeSheet$]),m=_.useObservable(s,(G=e.getActiveSheet())==null?void 0:G.getSheetId()),u=g.useRef(),l=N.useDependency(T.ThreadCommentPanelService),h=_.useObservable(l.activeCommentId$),C=_.useObservable(l.panelVisible$,l.panelVisible),v=g.useCallback(p=>{const M=e.getSheets(),w={};M.forEach((j,E)=>{w[j.getSheetId()]=E});const k=j=>j.map(E=>{var ie;const V=A.singleReferenceToGrid(E.ref),ke=[(ie=w[E.subUnitId])!=null?ie:0,V.row,V.column];return{...E,p:ke}}).sort((E,V)=>E.p[0]===V.p[0]?E.p[1]===V.p[1]?E.p[2]-V.p[2]:E.p[1]-V.p[1]:E.p[0]-V.p[0]);return[...k(p.filter(j=>!j.resolved)),...k(p.filter(j=>j.resolved))]},[e]),f=g.useCallback(p=>{if(p.unitId===t&&p.subUnitId===m&&!p.resolved){const{row:M,column:w}=A.singleReferenceToGrid(p.ref);if(!Number.isNaN(M)&&!Number.isNaN(w))return r.addShape({range:{startColumn:w,endColumn:w,startRow:M,endRow:M},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[r,m,t]),I=p=>{var M,w;return(w=(M=e.getSheetBySheetId(p))==null?void 0:M.getName())!=null?w:""},$=()=>{i.executeCommand(H.id)},y=p=>{h&&h.unitId===p.unitId&&h.subUnitId===p.subUnitId&&h.commentId===p.id||(u.current&&(r.removeShape(u.current),u.current=null),u.current=f(p))},L=()=>{u.current&&(r.removeShape(u.current),u.current=null)},z=(p,M)=>{M&&n.hidePopup()};return g.useEffect(()=>{!C&&u.current&&r.removeShape(u.current)},[r,C]),g.createElement(T.ThreadCommentPanel,{unitId:t,subUnitId$:s,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:$,getSubUnitName:I,onResolve:z,sortComments:v,onItemEnter:y,onItemLeave:L,onDeleteComment:()=>(L(),!0)})},Ce=r=>({id:H.id,type:_.MenuItemType.BUTTON,positions:[_.MenuPosition.CONTEXT_MENU],icon:K,title:"sheetThreadComment.menu.addComment",hidden$:_.getMenuHiddenObservable(r,c.UniverInstanceType.UNIVER_SHEET),disabled$:P.getCurrentRangeDisable$(r,{workbookTypes:[S.WorkbookCommentPermission],worksheetTypes:[S.WorksheetViewPermission],rangeTypes:[S.RangeProtectionPermissionViewPoint]})}),fe=r=>({id:T.ToggleSheetCommentPanelOperation.id,type:_.MenuItemType.BUTTON,icon:K,tooltip:"sheetThreadComment.menu.commentManagement",positions:_.MenuPosition.TOOLBAR_START,group:_.MenuGroup.TOOLBAR_OTHERS,disabled$:P.getCurrentRangeDisable$(r,{workbookTypes:[S.WorkbookCommentPermission],worksheetTypes:[S.WorksheetViewPermission],rangeTypes:[S.RangeProtectionPermissionViewPoint]}),hidden$:_.getMenuHiddenObservable(r,c.UniverInstanceType.UNIVER_SHEET)}),_e={id:H.id,binding:_.KeyCode.M|_.MetaKeys.CTRL_COMMAND|_.MetaKeys.ALT,preconditions:P.whenSheetEditorFocused};var Ie=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Te=(r,o,n,e)=>{for(var t=e>1?void 0:e?Pe(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&Ie(o,n,t),t},U=(r,o)=>(n,e)=>o(n,e,r);const ge={};a.SheetsThreadCommentController=class extends c.Disposable{constructor(n,e,t,i,s,m,u,l,h,C,v,f){super();R(this,"_isSwitchToCommenting",!1);R(this,"_selectionShapeInfo",null);this._config=n,this._menuService=e,this._injector=t,this._componentManager=i,this._commandService=s,this._sheetsThreadCommentPopupService=m,this._sheetsThreadCommentModel=u,this._threadCommentPanelService=l,this._shortcutService=h,this._univerInstanceService=C,this._sheetPermissionInterceptorBaseController=v,this._markSelectionService=f,this._initMenu(),this._initShortcut(),this._initComponent(),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection()}_initShortcut(){this._shortcutService.registerShortcut(_e)}_initCommandListener(){this._commandService.onCommandExecuted(n=>{if(n.id===S.SetSelectionsOperation.id){if(this._isSwitchToCommenting)return;const e=n.params,{unitId:t,subUnitId:i,selections:s,type:m}=e;if((m===S.SelectionMoveType.MOVE_END||m===void 0)&&s[0].primary){const u=s[0].range;if(u.endColumn-u.startColumn>0||u.endRow-u.startRow>0)return;const l=s[0].primary.actualRow,h=s[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(t,i,l,h)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(T.SetActiveCommentOperation.id);return}const C=this._sheetsThreadCommentModel.getByLocation(t,i,l,h);C&&this._commandService.executeCommand(T.SetActiveCommentOperation.id,{unitId:t,subUnitId:i,commentId:C})}}if(n.id===O.DeleteCommentMutation.id){const e=n.params,t=this._sheetsThreadCommentPopupService.activePopup;if(!t)return;const{unitId:i,subUnitId:s,commentId:m}=t;e.unitId===i&&e.subUnitId===s&&e.commentId===m&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initMenu(){const{menu:n={}}=this._config;[Ce,fe].forEach(e=>{this._menuService.addMenuItem(e(this._injector),n)})}_initComponent(){[[ee,ve],[T.THREAD_COMMENT_PANEL,Se],[K,x]].forEach(([n,e])=>{this._componentManager.register(n,e)})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async n=>{var e;if(n){const{unitId:t,subUnitId:i,commentId:s,trigger:m}=n,u=this._sheetsThreadCommentModel.getComment(t,i,s);if(!u||u.resolved)return;const l=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!l||l.getUnitId()!==t)return;this._isSwitchToCommenting=!0,((e=l.getActiveSheet())==null?void 0:e.getSheetId())!==i&&await this._commandService.executeCommand(S.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:i}),this._isSwitchToCommenting=!1;const v=A.singleReferenceToGrid(u.ref),{row:f,column:I}=v;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[S.WorkbookCommentPermission],worksheetTypes:[S.WorksheetViewPermission],rangeTypes:[S.RangeProtectionPermissionViewPoint]},[{startRow:f,startColumn:I,endRow:f,endColumn:I}]))return;const y=1;await this._commandService.executeCommand(P.ScrollToRangeOperation.id,{range:{startRow:Math.max(v.row-y,0),endRow:v.row+y,startColumn:Math.max(v.column-y,0),endColumn:v.column+y}}),this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:i,row:v.row,col:v.column,commentId:u.id,trigger:m})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(n=>{if(!n){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:e,subUnitId:t,commentId:i}=n;if(this._selectionShapeInfo){if(this._selectionShapeInfo.unitId===e&&this._selectionShapeInfo.subUnitId===t&&this._selectionShapeInfo.commentId===i)return;this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null}const s=this._sheetsThreadCommentModel.getComment(e,t,i);if(!s)return;const m=A.singleReferenceToGrid(s.ref),{row:u,column:l}=m;if(Number.isNaN(u)||Number.isNaN(l))return;const h=this._markSelectionService.addShape({range:{startColumn:l,endColumn:l,startRow:u,endRow:u},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null});h&&(this._selectionShapeInfo={...n,shapeId:h})}))}},a.SheetsThreadCommentController=Te([c.OnLifecycle(c.LifecycleStages.Starting,a.SheetsThreadCommentController),U(1,_.IMenuService),U(2,d.Inject(d.Injector)),U(3,d.Inject(_.ComponentManager)),U(4,c.ICommandService),U(5,d.Inject(a.SheetsThreadCommentPopupService)),U(6,d.Inject(D.SheetsThreadCommentModel)),U(7,d.Inject(T.ThreadCommentPanelService)),U(8,_.IShortcutService),U(9,c.IUniverInstanceService),U(10,d.Inject(P.SheetPermissionInterceptorBaseController)),U(11,P.IMarkSelectionService)],a.SheetsThreadCommentController);var be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Me=(r,o,n,e)=>{for(var t=e>1?void 0:e?ye(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&be(o,n,t),t},F=(r,o)=>(n,e)=>o(n,e,r);let B=class extends c.Disposable{constructor(r,o,n,e){super(),this._sheetInterceptorService=r,this._sheetsThreadCommentModel=o,this._univerInstanceService=n,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(S.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(r,o,n)=>{const{row:e,col:t,unitId:i,subUnitId:s}=o;return this._sheetsThreadCommentModel.showCommentMarker(i,s,e,t)?n({...r,markers:{...r==null?void 0:r.markers,tr:{color:"#FFBD37",size:6}}}):n(r)},priority:100}))}_initSkeletonChange(){const r=()=>{var s;const o=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!o)return;const n=o.getUnitId(),e=(s=o.getActiveSheet())==null?void 0:s.getSheetId();if(!e){console.warn("No active sheet found");return}const t=this._renderManagerService.getRenderById(n),i=t==null?void 0:t.with(P.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:e});i==null||i.makeDirty(!0),i==null||i.calculate(),t&&t.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(W.debounceTime(16)).subscribe(o=>{r()}))}};B=Me([c.OnLifecycle(c.LifecycleStages.Ready,B),F(0,d.Inject(S.SheetInterceptorService)),F(1,d.Inject(D.SheetsThreadCommentModel)),F(2,c.IUniverInstanceService),F(3,se.IRenderManagerService)],B);var we=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Ue=(r,o,n,e)=>{for(var t=e>1?void 0:e?Oe(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&we(o,n,t),t},X=(r,o)=>(n,e)=>o(n,e,r);const Ee=(r,o,n)=>{const e=A.singleReferenceToGrid(r),t=n.row-o.row,i=n.column-o.column,s={startColumn:e.column+i,startRow:e.row+t,endColumn:e.column+i,endRow:e.row+t};return A.serializeRange(s)};a.SheetsThreadCommentCopyPasteController=class extends c.Disposable{constructor(n,e,t){super();R(this,"_copyInfo");this._sheetClipboardService=n,this._sheetsThreadCommentModel=e,this._threadCommentDataSourceService=t,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Y,onBeforeCopy:(n,e,t)=>{this._copyInfo={unitId:n,subUnitId:e,range:t}},onPasteCells:(n,e,t,i)=>{const{unitId:s,subUnitId:m,range:u}=e,l={row:u.rows[0],column:u.cols[0]};if(i.copyType===P.COPY_TYPE.CUT&&this._copyInfo){const{range:h,unitId:C,subUnitId:v}=this._copyInfo,f={row:h.startRow,column:h.startColumn};if(!(s===C&&m===v)){const I=[];c.Range.foreach(h,(p,M)=>{const w=this._sheetsThreadCommentModel.getAllByLocation(C,v,p,M);this._threadCommentDataSourceService.syncUpdateMutationToColla?w.forEach(k=>{I.push(k)}):w.forEach(({children:k,...j})=>{j.parentId||I.push(j)})});const $=[],y=[],L=[],z=[],G=p=>{$.unshift({id:O.DeleteCommentMutation.id,params:{unitId:C,subUnitId:v,commentId:p.id}}),L.push({id:O.AddCommentMutation.id,params:{unitId:s,subUnitId:m,comment:{...p,ref:Ee(p.ref,f,l),unitId:s,subUnitId:m},sync:!0}}),y.push({id:O.AddCommentMutation.id,params:{unitId:C,subUnitId:v,comment:p,sync:!0}}),z.unshift({id:O.DeleteCommentMutation.id,params:{unitId:s,subUnitId:m,commentId:p.id}})};return I.forEach(p=>{G(p)}),{redos:[...$,...L],undos:[...z,...y]}}}return{redos:[],undos:[]}}}))}},a.SheetsThreadCommentCopyPasteController=Ue([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentCopyPasteController),X(0,d.Inject(P.ISheetClipboardService)),X(1,d.Inject(D.SheetsThreadCommentModel)),X(2,O.IThreadCommentDataSourceService)],a.SheetsThreadCommentCopyPasteController);var je=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,De=(r,o,n,e)=>{for(var t=e>1?void 0:e?Re(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&je(o,n,t),t},q=(r,o)=>(n,e)=>o(n,e,r);a.SheetsThreadCommentHoverController=class extends c.Disposable{constructor(o,n,e,t){super(),this._hoverManagerService=o,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._sheetPermissionInterceptorBaseController=t,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(W.debounceTime(100)).subscribe(o=>{const n=this._sheetsThreadCommentPopupService.activePopup;if(o&&(n&&n.temp||!n)){const{location:e}=o,{unitId:t,subUnitId:i,row:s,col:m}=e,u=this._sheetsThreadCommentModel.getByLocation(t,i,s,m);if(u){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[S.WorkbookCommentPermission],worksheetTypes:[S.WorksheetViewPermission],rangeTypes:[S.RangeProtectionPermissionViewPoint]},[{startRow:s,startColumn:m,endRow:s,endColumn:m}]))return;const h=this._sheetsThreadCommentModel.getComment(t,i,u);h&&!h.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:i,row:s,col:m,commentId:u,temp:!0})}else n&&this._sheetsThreadCommentPopupService.hidePopup()}}))}},a.SheetsThreadCommentHoverController=De([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentHoverController),q(0,d.Inject(P.HoverManagerService)),q(1,d.Inject(a.SheetsThreadCommentPopupService)),q(2,d.Inject(D.SheetsThreadCommentModel)),q(3,d.Inject(P.SheetPermissionInterceptorBaseController))],a.SheetsThreadCommentHoverController);var Ne=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,Ve=(r,o,n,e)=>{for(var t=e>1?void 0:e?$e(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&Ne(o,n,t),t},Z=(r,o)=>(n,e)=>o(n,e,r);a.ThreadCommentRemoveSheetsController=class extends c.Disposable{constructor(o,n,e,t){super(),this._sheetInterceptorService=o,this._univerInstanceService=n,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:o=>{var n;if(o.id===S.RemoveSheetCommand.id){const e=o.params,t=e.unitId?this._univerInstanceService.getUnit(e.unitId):this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return{redos:[],undos:[]};const i=t.getUnitId(),s=e.subUnitId||((n=t.getActiveSheet())==null?void 0:n.getSheetId());if(!s)return{redos:[],undos:[]};const{commentMap:m}=this._threadCommentModel.ensureMap(i,s),u=Array.from(Object.values(m)).filter(f=>!f.parentId),l=u.map(f=>f.id),h=this._threadCommentDataSourceService.syncUpdateMutationToColla,C=l.map(f=>({id:O.DeleteCommentMutation.id,params:{unitId:i,subUnitId:s,commentId:f}})),v=u.map(({children:f,...I})=>({id:O.AddCommentMutation.id,params:{unitId:i,subUnitId:s,comment:{...I,children:h?f:void 0},sync:!h}}));return{redos:C,undos:v}}return{redos:[],undos:[]}}}))}},a.ThreadCommentRemoveSheetsController=Ve([c.OnLifecycle(c.LifecycleStages.Ready,a.ThreadCommentRemoveSheetsController),Z(0,d.Inject(S.SheetInterceptorService)),Z(1,c.IUniverInstanceService),Z(2,d.Inject(O.ThreadCommentModel)),Z(3,O.IThreadCommentDataSourceService)],a.ThreadCommentRemoveSheetsController);var ne=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,He=(r,o,n)=>o in r?ne(r,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[o]=n,Le=(r,o,n,e)=>{for(var t=e>1?void 0:e?Ae(o,n):o,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=(e?s(o,n,t):s(t))||t);return e&&t&&ne(o,n,t),t},re=(r,o)=>(n,e)=>o(n,e,r),oe=(r,o,n)=>He(r,typeof o!="symbol"?o+"":o,n);a.UniverSheetsThreadCommentPlugin=class extends c.Plugin{constructor(n={},e,t){super();R(this,"_pluginConfig");this._injector=e,this._commandService=t,this._pluginConfig=c.Tools.deepMerge({},ge,n)}onStarting(n){[[a.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(a.SheetsThreadCommentController,this._pluginConfig)}],[B],[a.SheetsThreadCommentCopyPasteController],[a.SheetsThreadCommentHoverController],[a.ThreadCommentRemoveSheetsController],[a.SheetsThreadCommentPopupService]].forEach(e=>{n.add(e)}),[H].forEach(e=>{this._commandService.registerCommand(e)})}},oe(a.UniverSheetsThreadCommentPlugin,"pluginName",Y),oe(a.UniverSheetsThreadCommentPlugin,"type",c.UniverInstanceType.UNIVER_SHEET),a.UniverSheetsThreadCommentPlugin=Le([c.DependentOn(T.UniverThreadCommentUIPlugin,D.UniverSheetsThreadCommentBasePlugin),re(1,d.Inject(d.Injector)),re(2,d.Inject(c.ICommandService))],a.UniverSheetsThreadCommentPlugin),Object.defineProperty(a,"Inject",{enumerable:!0,get:()=>d.Inject}),Object.defineProperty(a,"Injector",{enumerable:!0,get:()=>d.Injector}),Object.defineProperty(a,"ICommandService",{enumerable:!0,get:()=>c.ICommandService}),Object.defineProperty(a,"Plugin",{enumerable:!0,get:()=>c.Plugin}),Object.defineProperty(a,"UniverInstanceType",{enumerable:!0,get:()=>c.UniverInstanceType}),Object.defineProperty(a,"IThreadCommentMentionDataService",{enumerable:!0,get:()=>T.IThreadCommentMentionDataService}),Object.defineProperty(a,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>T.UniverThreadCommentUIPlugin}),Object.defineProperty(a,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>O.IThreadCommentDataSourceService}),Object.defineProperty(a,"SheetsThreadCommentModel",{enumerable:!0,get:()=>D.SheetsThreadCommentModel}),a.SHEETS_THREAD_COMMENT=Y,a.ShowAddSheetCommentModalOperation=H,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-thread-comment",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "description": "Univer thread comment plugin",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -45,38 +45,38 @@
45
45
  "lib"
46
46
  ],
47
47
  "peerDependencies": {
48
- "@wendellhu/redi": "0.15.5",
48
+ "@wendellhu/redi": "0.16.0",
49
49
  "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
50
50
  "rxjs": ">=7.0.0",
51
- "@univerjs/core": "0.2.3",
52
- "@univerjs/engine-formula": "0.2.3",
53
- "@univerjs/engine-render": "0.2.3",
54
- "@univerjs/sheets": "0.2.3",
55
- "@univerjs/sheets-ui": "0.2.3",
56
- "@univerjs/thread-comment": "0.2.3",
57
- "@univerjs/sheets-thread-comment-base": "0.2.3",
58
- "@univerjs/thread-comment-ui": "0.2.3",
59
- "@univerjs/ui": "0.2.3"
51
+ "@univerjs/core": "0.2.4",
52
+ "@univerjs/engine-formula": "0.2.4",
53
+ "@univerjs/engine-render": "0.2.4",
54
+ "@univerjs/sheets": "0.2.4",
55
+ "@univerjs/sheets-thread-comment-base": "0.2.4",
56
+ "@univerjs/sheets-ui": "0.2.4",
57
+ "@univerjs/thread-comment": "0.2.4",
58
+ "@univerjs/ui": "0.2.4",
59
+ "@univerjs/thread-comment-ui": "0.2.4"
60
60
  },
61
61
  "dependencies": {
62
- "@univerjs/icons": "^0.1.58"
62
+ "@univerjs/icons": "^0.1.65"
63
63
  },
64
64
  "devDependencies": {
65
- "@wendellhu/redi": "0.15.5",
65
+ "@wendellhu/redi": "0.16.0",
66
66
  "clsx": "^2.1.1",
67
67
  "react": "18.3.1",
68
68
  "rxjs": "^7.8.1",
69
69
  "typescript": "^5.5.3",
70
- "vite": "^5.3.3",
71
- "vitest": "^1.6.0",
72
- "@univerjs/core": "0.2.3",
73
- "@univerjs/design": "0.2.3",
74
- "@univerjs/engine-formula": "0.2.3",
75
- "@univerjs/sheets-thread-comment-base": "0.2.3",
76
- "@univerjs/shared": "0.2.3",
77
- "@univerjs/thread-comment-ui": "0.2.3",
78
- "@univerjs/thread-comment": "0.2.3",
79
- "@univerjs/ui": "0.2.3"
70
+ "vite": "^5.3.4",
71
+ "vitest": "^2.0.3",
72
+ "@univerjs/core": "0.2.4",
73
+ "@univerjs/design": "0.2.4",
74
+ "@univerjs/engine-formula": "0.2.4",
75
+ "@univerjs/shared": "0.2.4",
76
+ "@univerjs/sheets-thread-comment-base": "0.2.4",
77
+ "@univerjs/thread-comment": "0.2.4",
78
+ "@univerjs/thread-comment-ui": "0.2.4",
79
+ "@univerjs/ui": "0.2.4"
80
80
  },
81
81
  "univerSpace": {
82
82
  ".": {