@univerjs/sheets-thread-comment 0.2.3 → 0.2.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { IMenuItem, IShortcutItem, MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
2
- import { IAccessor } from '@wendellhu/redi';
2
+ import { IAccessor } from '@univerjs/core';
3
3
 
4
4
  export declare const threadCommentMenuFactory: (accessor: IAccessor) => IMenuItem;
5
5
  export declare const threadPanelMenuFactory: (accessor: IAccessor) => {
@@ -1,8 +1,7 @@
1
- import { DependencyOverride, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
1
+ import { DependencyOverride, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
2
  import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
3
- import { Injector } from '@wendellhu/redi';
4
3
  import { ThreadCommentPanelService } from '@univerjs/thread-comment-ui';
5
- import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
4
+ import { IMarkSelectionService, SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
6
5
  import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment-base';
7
6
  import { SheetsThreadCommentPopupService } from '../services/sheets-thread-comment-popup.service';
8
7
 
@@ -23,10 +22,14 @@ export declare class SheetsThreadCommentController extends Disposable {
23
22
  private readonly _shortcutService;
24
23
  private readonly _univerInstanceService;
25
24
  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);
25
+ private readonly _markSelectionService;
26
+ private _isSwitchToCommenting;
27
+ private _selectionShapeInfo;
28
+ 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
29
  private _initShortcut;
28
30
  private _initCommandListener;
29
31
  private _initMenu;
30
32
  private _initComponent;
31
33
  private _initPanelListener;
34
+ private _initMarkSelection;
32
35
  }
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export type { Dependency } from '@wendellhu/redi';
17
- export { Inject, Injector } from '@wendellhu/redi';
16
+ export type { Dependency } from '@univerjs/core';
17
+ export { Inject, Injector } from '@univerjs/core';
18
18
  export { ICommandService, Plugin, UniverInstanceType } from '@univerjs/core';
19
19
  export { UniverThreadCommentUIPlugin } from '@univerjs/thread-comment-ui';
20
20
  export { SheetsThreadCommentController } from './controllers/sheets-thread-comment.controller';
@@ -1,5 +1,4 @@
1
- import { Injector } from '@wendellhu/redi';
2
- import { ICommandService, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import { ICommandService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
2
  import { IUniverSheetsThreadCommentConfig } from './controllers/sheets-thread-comment.controller';
4
3
 
5
4
  export declare class UniverSheetsThreadCommentPlugin extends Plugin {
@@ -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(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,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("react"),require("rxjs"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment-ui","@univerjs/ui","@univerjs/sheets","@univerjs/engine-formula","@univerjs/thread-comment","@univerjs/sheets-ui","@univerjs/sheets-thread-comment-base","react","rxjs","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverSheetsThreadComment={},c.UniverCore,c.UniverThreadCommentUi,c.UniverUi,c.UniverSheets,c.UniverEngineFormula,c.UniverThreadComment,c.UniverSheetsUi,c.UniverSheetsThreadCommentBase,c.React,c.rxjs,c.UniverEngineRender))})(this,function(c,o,_,f,v,$,w,P,R,T,Z,ie){"use strict";var Le=Object.defineProperty;var ke=(c,o,_)=>o in c?Le(c,o,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[o]=_;var j=(c,o,_)=>ke(c,typeof o!="symbol"?o+"":o,_);var g=function(){return g=Object.assign||function(r){for(var i,n=1,e=arguments.length;n<e;n++){i=arguments[n];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])}return r},g.apply(this,arguments)},oe=function(r,i){var n={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&i.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++)i.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(r,e[t])&&(n[e[t]]=r[e[t]]);return n},Y=T.forwardRef(function(r,i){var n=r.icon,e=r.id,t=r.className,s=r.extend,a=oe(r,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(e," ").concat(t||"").trim(),u=T.useRef("_".concat(ce()));return X(n,"".concat(e),{defIds:n.defIds,idSuffix:u.current},g({ref:i,className:d},a),s)});function X(r,i,n,e,t){return T.createElement(r.tag,g(g({key:i},se(r,n,t)),e),(ae(r,n).children||[]).map(function(s,a){return X(s,"".concat(i,"-").concat(r.tag,"-").concat(a),n,void 0,t)}))}function se(r,i,n){var e=g({},r.attrs);n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1);var t=i.defIds;return!t||t.length===0||(r.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+i.idSuffix),Object.entries(e).forEach(function(s){var a=s[0],d=s[1];typeof d=="string"&&(e[a]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(i.idSuffix,")")))})),e}function ae(r,i){var n,e=i.defIds;return!e||e.length===0?r:r.tag==="defs"&&(!((n=r.children)===null||n===void 0)&&n.length)?g(g({},r),{children:r.children.map(function(t){return typeof t.attrs.id=="string"&&e&&e.indexOf(t.attrs.id)>-1?g(g({},t),{attrs:g(g({},t.attrs),{id:t.attrs.id+i.idSuffix})}):t})}):r}function ce(){return Math.random().toString(36).substring(2,8)}Y.displayName="UniverIcon";var ue={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"}}]},J=T.forwardRef(function(r,i){return T.createElement(Y,Object.assign({},r,{id:"comment-single",ref:i,icon:ue}))});J.displayName="CommentSingle";const Q="univer.sheet.thread-comment-modal",z="comment-single",G="SHEET_THREAD_COMMENT";var de=Object.defineProperty,me=Object.getOwnPropertyDescriptor,he=(r,i,n,e)=>{for(var t=e>1?void 0:e?me(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&de(i,n,t),t},x=(r,i)=>(n,e)=>i(n,e,r);c.SheetsThreadCommentPopupService=class extends o.Disposable{constructor(n,e){super();j(this,"_lastPopup",null);j(this,"_activePopup");j(this,"_activePopup$",new Z.BehaviorSubject(null));j(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 m;const{row:t,col:s,unitId:a,subUnitId:d}=n;if(this._activePopup&&t===this._activePopup.row&&s===this._activePopup.col&&a===this._activePopup.unitId&&d===((m=this.activePopup)==null?void 0:m.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,s,{componentKey:Q,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 h=new o.DisposableCollection;h.add(u),h.add({dispose:()=>{e==null||e()}}),this._lastPopup=h}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))}},c.SheetsThreadCommentPopupService=he([x(0,o.Inject(P.SheetCanvasPopManagerService)),x(1,f.IZenZoneService)],c.SheetsThreadCommentPopupService);const le=()=>{const r=o.useDependency(o.IUniverInstanceService),i=o.useDependency(c.SheetsThreadCommentPopupService),n=f.useObservable(i.activePopup$),e=o.useDependency(R.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!n)return null;const{row:t,col:s,unitId:a,subUnitId:d,trigger:u}=n,h=e.getByLocation(a,d,t,s),m=`${o.Tools.chatAtABC(s)}${t+1}`,S=()=>{i.hidePopup()},p=C=>{var I,D,b;return(b=(D=(I=r.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getSheetBySheetId(C))==null?void 0:D.getName())!=null?b:""};return T.createElement(_.ThreadCommentTree,{onClick:()=>{i.persistPopup()},prefix:"cell",id:h,unitId:a,subUnitId:d,type:o.UniverInstanceType.UNIVER_SHEET,refStr:m,onClose:S,getSubUnitName:p,autoFocus:u==="context-menu"})},V={type:o.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(r){var I;const i=r.get(v.SheetsSelectionsService),n=r.get(o.IUniverInstanceService),e=r.get(c.SheetsThreadCommentPopupService),t=r.get(_.ThreadCommentPanelService),s=(I=i.getCurrentLastSelection())==null?void 0:I.primary,a=r.get(R.SheetsThreadCommentModel);if(!s)return!1;const d=v.getSheetCommandTarget(n);if(!d)return!1;const{workbook:u,worksheet:h,unitId:m,subUnitId:S}=d,p={workbook:u,worksheet:h,unitId:m,subUnitId:S,row:s.startRow,col:s.startColumn};e.showPopup(p);const C=a.getByLocation(m,S,s.startRow,s.startColumn);return C&&t.setActiveComment({unitId:m,subUnitId:S,commentId:C,trigger:"context-menu"}),!0}},pe=()=>{var q;const r=o.useDependency(P.IMarkSelectionService),i=o.useDependency(o.IUniverInstanceService),n=o.useDependency(c.SheetsThreadCommentPopupService),e=i.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET),t=e.getUnitId(),s=o.useDependency(o.ICommandService),a=T.useMemo(()=>e.activeSheet$.pipe(Z.map(l=>l==null?void 0:l.getSheetId())),[e.activeSheet$]),d=f.useObservable(a,(q=e.getActiveSheet())==null?void 0:q.getSheetId()),u=T.useRef(),h=o.useDependency(_.ThreadCommentPanelService),m=f.useObservable(h.activeCommentId$),S=f.useObservable(h.panelVisible$,h.panelVisible),p=T.useCallback(l=>{const y=e.getSheets(),M={};y.forEach((E,U)=>{M[E.getSheetId()]=U});const H=E=>E.map(U=>{var re;const N=$.singleReferenceToGrid(U.ref),He=[(re=M[U.subUnitId])!=null?re:0,N.row,N.column];return{...U,p:He}}).sort((U,N)=>U.p[0]===N.p[0]?U.p[1]===N.p[1]?U.p[2]-N.p[2]:U.p[1]-N.p[1]:U.p[0]-N.p[0]);return[...H(l.filter(E=>!E.resolved)),...H(l.filter(E=>E.resolved))]},[e]),C=T.useCallback(l=>{if(l.unitId===t&&l.subUnitId===d&&!l.resolved){const{row:y,column:M}=$.singleReferenceToGrid(l.ref);if(!Number.isNaN(y)&&!Number.isNaN(M))return r.addShape({range:{startColumn:M,endColumn:M,startRow:y,endRow:y},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[r,d,t]),I=l=>{var y,M;return(M=(y=e.getSheetBySheetId(l))==null?void 0:y.getName())!=null?M:""},D=()=>{s.executeCommand(V.id)},b=l=>{m&&m.unitId===l.unitId&&m.subUnitId===l.subUnitId&&m.commentId===l.id||(u.current&&(r.removeShape(u.current),u.current=null),u.current=C(l))},A=()=>{u.current&&(r.removeShape(u.current),u.current=null)},F=(l,y)=>{y&&n.hidePopup()};return T.useEffect(()=>{!S&&u.current&&r.removeShape(u.current)},[r,S]),T.createElement(_.ThreadCommentPanel,{unitId:t,subUnitId$:a,type:o.UniverInstanceType.UNIVER_SHEET,onAdd:D,getSubUnitName:I,onResolve:F,sortComments:p,onItemEnter:b,onItemLeave:A,onDeleteComment:()=>(A(),!0)})},ve=r=>({id:V.id,type:f.MenuItemType.BUTTON,positions:[f.MenuPosition.CONTEXT_MENU],icon:z,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(r,o.UniverInstanceType.UNIVER_SHEET),disabled$:P.getCurrentRangeDisable$(r,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]})}),Se=r=>({id:_.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:z,tooltip:"sheetThreadComment.menu.commentManagement",positions:f.MenuPosition.TOOLBAR_START,group:f.MenuGroup.TOOLBAR_OTHERS,disabled$:P.getCurrentRangeDisable$(r,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(r,o.UniverInstanceType.UNIVER_SHEET)}),Ce={id:V.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:P.whenSheetEditorFocused};var fe=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ie=(r,i,n,e)=>{for(var t=e>1?void 0:e?_e(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&fe(i,n,t),t},O=(r,i)=>(n,e)=>i(n,e,r);const Pe={};c.SheetsThreadCommentController=class extends o.Disposable{constructor(n,e,t,s,a,d,u,h,m,S,p,C){super();j(this,"_isSwitchToCommenting",!1);j(this,"_selectionShapeInfo",null);this._config=n,this._menuService=e,this._injector=t,this._componentManager=s,this._commandService=a,this._sheetsThreadCommentPopupService=d,this._sheetsThreadCommentModel=u,this._threadCommentPanelService=h,this._shortcutService=m,this._univerInstanceService=S,this._sheetPermissionInterceptorBaseController=p,this._markSelectionService=C,this._initMenu(),this._initShortcut(),this._initComponent(),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection()}_initShortcut(){this._shortcutService.registerShortcut(Ce)}_initCommandListener(){this._commandService.onCommandExecuted(n=>{if(n.id===v.SetSelectionsOperation.id){if(this._isSwitchToCommenting)return;const e=n.params,{unitId:t,subUnitId:s,selections:a,type:d}=e;if((d===v.SelectionMoveType.MOVE_END||d===void 0)&&a[0].primary){const u=a[0].range;if(u.endColumn-u.startColumn>0||u.endRow-u.startRow>0)return;const h=a[0].primary.actualRow,m=a[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(t,s,h,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(_.SetActiveCommentOperation.id);return}const S=this._sheetsThreadCommentModel.getByLocation(t,s,h,m);S&&this._commandService.executeCommand(_.SetActiveCommentOperation.id,{unitId:t,subUnitId:s,commentId:S})}}if(n.id===w.DeleteCommentMutation.id){const e=n.params,t=this._sheetsThreadCommentPopupService.activePopup;if(!t)return;const{unitId:s,subUnitId:a,commentId:d}=t;e.unitId===s&&e.subUnitId===a&&e.commentId===d&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initMenu(){const{menu:n={}}=this._config;[ve,Se].forEach(e=>{this._menuService.addMenuItem(e(this._injector),n)})}_initComponent(){[[Q,le],[_.THREAD_COMMENT_PANEL,pe],[z,J]].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:s,commentId:a,trigger:d}=n,u=this._sheetsThreadCommentModel.getComment(t,s,a);if(!u||u.resolved)return;const h=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);if(!h||h.getUnitId()!==t)return;this._isSwitchToCommenting=!0,((e=h.getActiveSheet())==null?void 0:e.getSheetId())!==s&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:s}),this._isSwitchToCommenting=!1;const p=$.singleReferenceToGrid(u.ref),{row:C,column:I}=p;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:C,startColumn:I,endRow:C,endColumn:I}]))return;const b=1;await this._commandService.executeCommand(P.ScrollToRangeOperation.id,{range:{startRow:Math.max(p.row-b,0),endRow:p.row+b,startColumn:Math.max(p.column-b,0),endColumn:p.column+b}}),this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:s,row:p.row,col:p.column,commentId:u.id,trigger:d})}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:s}=n;if(this._selectionShapeInfo){if(this._selectionShapeInfo.unitId===e&&this._selectionShapeInfo.subUnitId===t&&this._selectionShapeInfo.commentId===s)return;this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null}const a=this._sheetsThreadCommentModel.getComment(e,t,s);if(!a)return;const d=$.singleReferenceToGrid(a.ref),{row:u,column:h}=d;if(Number.isNaN(u)||Number.isNaN(h))return;const m=this._markSelectionService.addShape({range:{startColumn:h,endColumn:h,startRow:u,endRow:u},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null});m&&(this._selectionShapeInfo={...n,shapeId:m})}))}},c.SheetsThreadCommentController=Ie([o.OnLifecycle(o.LifecycleStages.Starting,c.SheetsThreadCommentController),O(1,f.IMenuService),O(2,o.Inject(o.Injector)),O(3,o.Inject(f.ComponentManager)),O(4,o.ICommandService),O(5,o.Inject(c.SheetsThreadCommentPopupService)),O(6,o.Inject(R.SheetsThreadCommentModel)),O(7,o.Inject(_.ThreadCommentPanelService)),O(8,f.IShortcutService),O(9,o.IUniverInstanceService),O(10,o.Inject(P.SheetPermissionInterceptorBaseController)),O(11,P.IMarkSelectionService)],c.SheetsThreadCommentController);var Te=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,be=(r,i,n,e)=>{for(var t=e>1?void 0:e?ge(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&Te(i,n,t),t},L=(r,i)=>(n,e)=>i(n,e,r);let k=class extends o.Disposable{constructor(r,i,n,e){super(),this._sheetInterceptorService=r,this._sheetsThreadCommentModel=i,this._univerInstanceService=n,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(v.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(r,i,n)=>{const{row:e,col:t,unitId:s,subUnitId:a}=i;return this._sheetsThreadCommentModel.showCommentMarker(s,a,e,t)?n({...r,markers:{...r==null?void 0:r.markers,tr:{color:"#FFBD37",size:6}}}):n(r)},priority:100}))}_initSkeletonChange(){const r=()=>{var a;const i=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);if(!i)return;const n=i.getUnitId(),e=(a=i.getActiveSheet())==null?void 0:a.getSheetId();if(!e){console.warn("No active sheet found");return}const t=this._renderManagerService.getRenderById(n),s=t==null?void 0:t.with(P.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:e});s==null||s.makeDirty(!0),s==null||s.calculate(),t&&t.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(i=>{r()}))}};k=be([o.OnLifecycle(o.LifecycleStages.Ready,k),L(0,o.Inject(v.SheetInterceptorService)),L(1,o.Inject(R.SheetsThreadCommentModel)),L(2,o.IUniverInstanceService),L(3,ie.IRenderManagerService)],k);var ye=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,we=(r,i,n,e)=>{for(var t=e>1?void 0:e?Me(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&ye(i,n,t),t},K=(r,i)=>(n,e)=>i(n,e,r);const Oe=(r,i,n)=>{const e=$.singleReferenceToGrid(r),t=n.row-i.row,s=n.column-i.column,a={startColumn:e.column+s,startRow:e.row+t,endColumn:e.column+s,endRow:e.row+t};return $.serializeRange(a)};c.SheetsThreadCommentCopyPasteController=class extends o.Disposable{constructor(n,e,t){super();j(this,"_copyInfo");this._sheetClipboardService=n,this._sheetsThreadCommentModel=e,this._threadCommentDataSourceService=t,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:G,onBeforeCopy:(n,e,t)=>{this._copyInfo={unitId:n,subUnitId:e,range:t}},onPasteCells:(n,e,t,s)=>{const{unitId:a,subUnitId:d,range:u}=e,h={row:u.rows[0],column:u.cols[0]};if(s.copyType===P.COPY_TYPE.CUT&&this._copyInfo){const{range:m,unitId:S,subUnitId:p}=this._copyInfo,C={row:m.startRow,column:m.startColumn};if(!(a===S&&d===p)){const I=[];o.Range.foreach(m,(l,y)=>{const M=this._sheetsThreadCommentModel.getAllByLocation(S,p,l,y);this._threadCommentDataSourceService.syncUpdateMutationToColla?M.forEach(H=>{I.push(H)}):M.forEach(({children:H,...E})=>{E.parentId||I.push(E)})});const D=[],b=[],A=[],F=[],q=l=>{D.unshift({id:w.DeleteCommentMutation.id,params:{unitId:S,subUnitId:p,commentId:l.id}}),A.push({id:w.AddCommentMutation.id,params:{unitId:a,subUnitId:d,comment:{...l,ref:Oe(l.ref,C,h),unitId:a,subUnitId:d},sync:!0}}),b.push({id:w.AddCommentMutation.id,params:{unitId:S,subUnitId:p,comment:l,sync:!0}}),F.unshift({id:w.DeleteCommentMutation.id,params:{unitId:a,subUnitId:d,commentId:l.id}})};return I.forEach(l=>{q(l)}),{redos:[...D,...A],undos:[...F,...b]}}}return{redos:[],undos:[]}}}))}},c.SheetsThreadCommentCopyPasteController=we([o.OnLifecycle(o.LifecycleStages.Rendered,c.SheetsThreadCommentCopyPasteController),K(0,o.Inject(P.ISheetClipboardService)),K(1,o.Inject(R.SheetsThreadCommentModel)),K(2,w.IThreadCommentDataSourceService)],c.SheetsThreadCommentCopyPasteController);var Ue=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,je=(r,i,n,e)=>{for(var t=e>1?void 0:e?Ee(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&Ue(i,n,t),t},B=(r,i)=>(n,e)=>i(n,e,r);c.SheetsThreadCommentHoverController=class extends o.Disposable{constructor(i,n,e,t){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._sheetPermissionInterceptorBaseController=t,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(Z.debounceTime(100)).subscribe(i=>{const n=this._sheetsThreadCommentPopupService.activePopup;if(i&&(n&&n.temp||!n)){const{location:e}=i,{unitId:t,subUnitId:s,row:a,col:d}=e,u=this._sheetsThreadCommentModel.getByLocation(t,s,a,d);if(u){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:d,endRow:a,endColumn:d}]))return;const m=this._sheetsThreadCommentModel.getComment(t,s,u);m&&!m.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:s,row:a,col:d,commentId:u,temp:!0})}else n&&this._sheetsThreadCommentPopupService.hidePopup()}}))}},c.SheetsThreadCommentHoverController=je([o.OnLifecycle(o.LifecycleStages.Rendered,c.SheetsThreadCommentHoverController),B(0,o.Inject(P.HoverManagerService)),B(1,o.Inject(c.SheetsThreadCommentPopupService)),B(2,o.Inject(R.SheetsThreadCommentModel)),B(3,o.Inject(P.SheetPermissionInterceptorBaseController))],c.SheetsThreadCommentHoverController);var Re=Object.defineProperty,De=Object.getOwnPropertyDescriptor,Ne=(r,i,n,e)=>{for(var t=e>1?void 0:e?De(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&Re(i,n,t),t},W=(r,i)=>(n,e)=>i(n,e,r);c.ThreadCommentRemoveSheetsController=class extends o.Disposable{constructor(i,n,e,t){super(),this._sheetInterceptorService=i,this._univerInstanceService=n,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var n;if(i.id===v.RemoveSheetCommand.id){const e=i.params,t=e.unitId?this._univerInstanceService.getUnit(e.unitId):this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_SHEET);if(!t)return{redos:[],undos:[]};const s=t.getUnitId(),a=e.subUnitId||((n=t.getActiveSheet())==null?void 0:n.getSheetId());if(!a)return{redos:[],undos:[]};const{commentMap:d}=this._threadCommentModel.ensureMap(s,a),u=Array.from(Object.values(d)).filter(C=>!C.parentId),h=u.map(C=>C.id),m=this._threadCommentDataSourceService.syncUpdateMutationToColla,S=h.map(C=>({id:w.DeleteCommentMutation.id,params:{unitId:s,subUnitId:a,commentId:C}})),p=u.map(({children:C,...I})=>({id:w.AddCommentMutation.id,params:{unitId:s,subUnitId:a,comment:{...I,children:m?C:void 0},sync:!m}}));return{redos:S,undos:p}}return{redos:[],undos:[]}}}))}},c.ThreadCommentRemoveSheetsController=Ne([o.OnLifecycle(o.LifecycleStages.Ready,c.ThreadCommentRemoveSheetsController),W(0,o.Inject(v.SheetInterceptorService)),W(1,o.IUniverInstanceService),W(2,o.Inject(w.ThreadCommentModel)),W(3,w.IThreadCommentDataSourceService)],c.ThreadCommentRemoveSheetsController);var ee=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,Ve=(r,i,n)=>i in r?ee(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Ae=(r,i,n,e)=>{for(var t=e>1?void 0:e?$e(i,n):i,s=r.length-1,a;s>=0;s--)(a=r[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&ee(i,n,t),t},te=(r,i)=>(n,e)=>i(n,e,r),ne=(r,i,n)=>Ve(r,typeof i!="symbol"?i+"":i,n);c.UniverSheetsThreadCommentPlugin=class extends o.Plugin{constructor(n={},e,t){super();j(this,"_pluginConfig");this._injector=e,this._commandService=t,this._pluginConfig=o.Tools.deepMerge({},Pe,n)}onStarting(n){[[c.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(c.SheetsThreadCommentController,this._pluginConfig)}],[k],[c.SheetsThreadCommentCopyPasteController],[c.SheetsThreadCommentHoverController],[c.ThreadCommentRemoveSheetsController],[c.SheetsThreadCommentPopupService]].forEach(e=>{n.add(e)}),[V].forEach(e=>{this._commandService.registerCommand(e)})}},ne(c.UniverSheetsThreadCommentPlugin,"pluginName",G),ne(c.UniverSheetsThreadCommentPlugin,"type",o.UniverInstanceType.UNIVER_SHEET),c.UniverSheetsThreadCommentPlugin=Ae([o.DependentOn(_.UniverThreadCommentUIPlugin,R.UniverSheetsThreadCommentBasePlugin),te(1,o.Inject(o.Injector)),te(2,o.Inject(o.ICommandService))],c.UniverSheetsThreadCommentPlugin),Object.defineProperty(c,"ICommandService",{enumerable:!0,get:()=>o.ICommandService}),Object.defineProperty(c,"Inject",{enumerable:!0,get:()=>o.Inject}),Object.defineProperty(c,"Injector",{enumerable:!0,get:()=>o.Injector}),Object.defineProperty(c,"Plugin",{enumerable:!0,get:()=>o.Plugin}),Object.defineProperty(c,"UniverInstanceType",{enumerable:!0,get:()=>o.UniverInstanceType}),Object.defineProperty(c,"IThreadCommentMentionDataService",{enumerable:!0,get:()=>_.IThreadCommentMentionDataService}),Object.defineProperty(c,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>_.UniverThreadCommentUIPlugin}),Object.defineProperty(c,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>w.IThreadCommentDataSourceService}),Object.defineProperty(c,"SheetsThreadCommentModel",{enumerable:!0,get:()=>R.SheetsThreadCommentModel}),c.SHEETS_THREAD_COMMENT=G,c.ShowAddSheetCommentModalOperation=V,Object.defineProperty(c,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-alpha.0",
4
4
  "private": false,
5
5
  "description": "Univer thread comment plugin",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -45,38 +45,36 @@
45
45
  "lib"
46
46
  ],
47
47
  "peerDependencies": {
48
- "@wendellhu/redi": "0.15.5",
49
48
  "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
50
49
  "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"
50
+ "@univerjs/core": "0.2.4-alpha.0",
51
+ "@univerjs/sheets-thread-comment-base": "0.2.4-alpha.0",
52
+ "@univerjs/engine-formula": "0.2.4-alpha.0",
53
+ "@univerjs/engine-render": "0.2.4-alpha.0",
54
+ "@univerjs/sheets": "0.2.4-alpha.0",
55
+ "@univerjs/sheets-ui": "0.2.4-alpha.0",
56
+ "@univerjs/thread-comment-ui": "0.2.4-alpha.0",
57
+ "@univerjs/thread-comment": "0.2.4-alpha.0",
58
+ "@univerjs/ui": "0.2.4-alpha.0"
60
59
  },
61
60
  "dependencies": {
62
- "@univerjs/icons": "^0.1.58"
61
+ "@univerjs/icons": "^0.1.64"
63
62
  },
64
63
  "devDependencies": {
65
- "@wendellhu/redi": "0.15.5",
66
64
  "clsx": "^2.1.1",
67
65
  "react": "18.3.1",
68
66
  "rxjs": "^7.8.1",
69
67
  "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"
68
+ "vite": "^5.3.4",
69
+ "vitest": "^2.0.3",
70
+ "@univerjs/core": "0.2.4-alpha.0",
71
+ "@univerjs/design": "0.2.4-alpha.0",
72
+ "@univerjs/shared": "0.2.4-alpha.0",
73
+ "@univerjs/engine-formula": "0.2.4-alpha.0",
74
+ "@univerjs/sheets-thread-comment-base": "0.2.4-alpha.0",
75
+ "@univerjs/thread-comment": "0.2.4-alpha.0",
76
+ "@univerjs/thread-comment-ui": "0.2.4-alpha.0",
77
+ "@univerjs/ui": "0.2.4-alpha.0"
80
78
  },
81
79
  "univerSpace": {
82
80
  ".": {