@univerjs/sheets-thread-comment 0.1.16 → 0.2.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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +346 -330
- package/lib/types/controllers/sheets-thread-comment-copy-paste.controller.d.ts +3 -1
- package/lib/types/controllers/sheets-thread-comment-remove.controller.d.ts +3 -2
- package/lib/types/controllers/sheets-thread-comment.controller.d.ts +2 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +23 -25
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
2
|
import { ISheetClipboardService } from '@univerjs/sheets-ui';
|
|
3
|
+
import { IThreadCommentDataSourceService } from '@univerjs/thread-comment';
|
|
3
4
|
import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment-base';
|
|
4
5
|
|
|
5
6
|
export declare class SheetsThreadCommentCopyPasteController extends Disposable {
|
|
6
7
|
private _sheetClipboardService;
|
|
7
8
|
private _sheetsThreadCommentModel;
|
|
9
|
+
private _threadCommentDataSourceService;
|
|
8
10
|
private _copyInfo;
|
|
9
|
-
constructor(_sheetClipboardService: ISheetClipboardService, _sheetsThreadCommentModel: SheetsThreadCommentModel);
|
|
11
|
+
constructor(_sheetClipboardService: ISheetClipboardService, _sheetsThreadCommentModel: SheetsThreadCommentModel, _threadCommentDataSourceService: IThreadCommentDataSourceService);
|
|
10
12
|
private _initClipboardHook;
|
|
11
13
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
-
import { ThreadCommentModel } from '@univerjs/thread-comment';
|
|
3
|
+
import { IThreadCommentDataSourceService, ThreadCommentModel } from '@univerjs/thread-comment';
|
|
4
4
|
|
|
5
5
|
export declare class ThreadCommentRemoveSheetsController extends Disposable {
|
|
6
6
|
private _sheetInterceptorService;
|
|
7
7
|
private _univerInstanceService;
|
|
8
8
|
private _threadCommentModel;
|
|
9
|
-
|
|
9
|
+
private _threadCommentDataSourceService;
|
|
10
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _threadCommentModel: ThreadCommentModel, _threadCommentDataSourceService: IThreadCommentDataSourceService);
|
|
10
11
|
private _initSheetChange;
|
|
11
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DependencyOverride, Disposable, ICommandService, IUniverInstanceService
|
|
1
|
+
import { DependencyOverride, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
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';
|
|
@@ -16,7 +16,6 @@ export declare class SheetsThreadCommentController extends Disposable {
|
|
|
16
16
|
private readonly _menuService;
|
|
17
17
|
private readonly _injector;
|
|
18
18
|
private readonly _componentManager;
|
|
19
|
-
private readonly _localeService;
|
|
20
19
|
private readonly _commandService;
|
|
21
20
|
private readonly _sheetsThreadCommentPopupService;
|
|
22
21
|
private readonly _sheetsThreadCommentModel;
|
|
@@ -24,7 +23,7 @@ export declare class SheetsThreadCommentController extends Disposable {
|
|
|
24
23
|
private readonly _shortcutService;
|
|
25
24
|
private readonly _univerInstanceService;
|
|
26
25
|
private readonly _sheetPermissionInterceptorBaseController;
|
|
27
|
-
constructor(_config: Partial<IUniverSheetsThreadCommentConfig>, _menuService: IMenuService, _injector: Injector, _componentManager: ComponentManager,
|
|
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);
|
|
28
27
|
private _initShortcut;
|
|
29
28
|
private _initCommandListener;
|
|
30
29
|
private _initMenu;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -27,3 +27,4 @@ export { ThreadCommentRemoveSheetsController } from './controllers/sheets-thread
|
|
|
27
27
|
export { IThreadCommentMentionDataService } from '@univerjs/thread-comment-ui';
|
|
28
28
|
export { IThreadCommentDataSourceService } from '@univerjs/thread-comment';
|
|
29
29
|
export { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment-base';
|
|
30
|
+
export { ShowAddSheetCommentModalOperation } from './commands/operations/comment.operation';
|
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,P,f,v,V,j,T,D,R,g,B,oe){"use strict";var Le=Object.defineProperty;var ke=(a,m,c)=>m in a?Le(a,m,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[m]=c;var N=(a,m,c)=>ke(a,typeof m!="symbol"?m+"":m,c);var b=function(){return b=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},b.apply(this,arguments)},ie=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},K=g.forwardRef(function(o,r){var n=o.icon,e=o.id,t=o.className,i=o.extend,s=ie(o,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(e," ").concat(t||"").trim(),d=g.useRef("_".concat(ce()));return Y(n,"".concat(e),{defIds:n.defIds,idSuffix:d.current},b({ref:r,className:u},s),i)});function Y(o,r,n,e,t){return g.createElement(o.tag,b(b({key:r},se(o,n,t)),e),(ae(o,n).children||[]).map(function(i,s){return Y(i,"".concat(r,"-").concat(o.tag,"-").concat(s),n,void 0,t)}))}function se(o,r,n){var e=b({},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 ae(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)?b(b({},o),{children:o.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+r.idSuffix})}):t})}):o}function ce(){return Math.random().toString(36).substring(2,8)}K.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"}}]},X=g.forwardRef(function(o,r){return g.createElement(K,Object.assign({},o,{id:"comment-single",ref:r,icon:ue}))});X.displayName="CommentSingle";const J="univer.sheet.thread-comment-modal",Z="comment-single",z="SHEET_THREAD_COMMENT";var me=Object.defineProperty,de=Object.getOwnPropertyDescriptor,he=(o,r,n,e)=>{for(var t=e>1?void 0:e?de(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&&me(r,n,t),t},Q=(o,r)=>(n,e)=>r(n,e,o);a.SheetsThreadCommentPopupService=class extends c.Disposable{constructor(n,e){super();N(this,"_lastPopup",null);N(this,"_activePopup");N(this,"_activePopup$",new B.BehaviorSubject(null));N(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 C;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===((C=this.activePopup)==null?void 0:C.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 d=this._canvasPopupManagerService.attachPopupToCell(t,i,{componentKey:J,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!d)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const p=new c.DisposableCollection;p.add(d),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=he([Q(0,m.Inject(T.SheetCanvasPopManagerService)),Q(1,f.IZenZoneService)],a.SheetsThreadCommentPopupService);const le=()=>{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:d}=n,p=e.getByLocation(s,u,t,i),C=`${c.Tools.chatAtABC(i)}${t+1}`,l=()=>{r.hidePopup()},S=y=>{var O,_,$;return($=(_=(O=o.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:O.getSheetBySheetId(y))==null?void 0:_.getName())!=null?$:""};return g.createElement(P.ThreadCommentTree,{onClick:()=>{r.persistPopup()},prefix:"cell",id:p,unitId:s,subUnitId:u,type:c.UniverInstanceType.UNIVER_SHEET,refStr:C,onClose:l,getSubUnitName:S,autoFocus:d==="context-menu"})},H={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(o){var _;const r=o.get(v.SelectionManagerService),n=o.get(c.IUniverInstanceService),e=o.get(a.SheetsThreadCommentPopupService),t=o.get(P.ThreadCommentPanelService),i=(_=r.getFirst())==null?void 0:_.primary,s=r.getCurrent(),u=o.get(D.SheetsThreadCommentModel);if(!s||!i)return!1;const{unitId:d,sheetId:p}=s,C=v.getSheetCommandTarget(n,{unitId:d,subUnitId:p});if(!C)return!1;const{workbook:l,worksheet:S}=C,y={workbook:l,worksheet:S,unitId:d,subUnitId:p,row:i.startRow,col:i.startColumn};e.showPopup(y);const O=u.getByLocation(d,p,i.startRow,i.startColumn);return O&&t.setActiveComment({unitId:d,subUnitId:p,commentId:O,trigger:"context-menu"}),!0}},pe=()=>{var A;const o=R.useDependency(T.IMarkSelectionService),r=R.useDependency(c.IUniverInstanceService),n=R.useDependency(j.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=g.useMemo(()=>t.activeSheet$.pipe(B.map(h=>h==null?void 0:h.getSheetId())),[t.activeSheet$]),d=f.useObservable(u,(A=t.getActiveSheet())==null?void 0:A.getSheetId()),p=g.useRef(),C=R.useDependency(P.ThreadCommentPanelService),l=f.useObservable(C.activeCommentId$),S=g.useCallback(h=>{const I=t.getSheets(),M={};return I.forEach((U,E)=>{M[U.getSheetId()]=E}),h.map(U=>{var re;const E=V.singleReferenceToGrid(U.ref),He=[(re=M[U.subUnitId])!=null?re:0,E.row,E.column];return{...U,p:He}}).sort((U,E)=>U.p[0]===E.p[0]?U.p[1]===E.p[1]?U.p[2]-E.p[2]:U.p[1]-E.p[1]:U.p[0]-E.p[0])},[t]),y=g.useCallback(h=>{if(h.unitId===i&&h.subUnitId===d&&!h.resolved){const{row:I,column:M}=V.singleReferenceToGrid(h.ref);if(!Number.isNaN(I)&&!Number.isNaN(M))return o.addShape({range:{startColumn:M,endColumn:M,startRow:I,endRow:I},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[o,d,i]),O=h=>{var I,M;return(M=(I=t.getSheetBySheetId(h))==null?void 0:I.getName())!=null?M:""},_=()=>{s.executeCommand(H.id)},$=()=>{e.hidePopup()},F=h=>{l&&l.unitId===h.unitId&&l.subUnitId===h.subUnitId&&l.commentId===h.id||(p.current&&(o.removeShape(p.current),p.current=null),p.current=y(h))},q=()=>{p.current&&(o.removeShape(p.current),p.current=null)};return g.useEffect(()=>{if(!l)return;const h=n.getComment(l.unitId,l.subUnitId,l.commentId);if(!h)return;const I=y(h);return()=>{I&&o.removeShape(I)}},[y,l,n,o]),g.createElement(P.ThreadCommentPanel,{unitId:i,subUnitId$:u,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:_,getSubUnitName:O,onResolve:$,sortComments:S,onItemEnter:F,onItemLeave:q})},ve=o=>({id:H.id,type:f.MenuItemType.BUTTON,positions:[f.MenuPosition.CONTEXT_MENU],icon:Z,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(o,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]})}),Ce=o=>({id:P.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:Z,tooltip:"sheetThreadComment.menu.commentManagement",positions:f.MenuPosition.TOOLBAR_START,group:f.MenuGroup.TOOLBAR_OTHERS,disabled$:T.getCurrentRangeDisable$(o,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET)}),Se={id:H.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:T.whenSheetEditorFocused};var fe=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ie=(o,r,n,e)=>{for(var t=e>1?void 0:e?_e(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&&fe(r,n,t),t},w=(o,r)=>(n,e)=>r(n,e,o);const Pe={};a.SheetsThreadCommentController=class extends c.Disposable{constructor(r,n,e,t,i,s,u,d,p,C,l,S){super(),this._config=r,this._menuService=n,this._injector=e,this._componentManager=t,this._localeService=i,this._commandService=s,this._sheetsThreadCommentPopupService=u,this._sheetsThreadCommentModel=d,this._threadCommentPanelService=p,this._shortcutService=C,this._univerInstanceService=l,this._sheetPermissionInterceptorBaseController=S,this._initMenu(),this._initShortcut(),this._initComponent(),this._initCommandListener(),this._initPanelListener()}_initShortcut(){this._shortcutService.registerShortcut(Se)}_initCommandListener(){this._commandService.onCommandExecuted(r=>{if(r.id===v.SetSelectionsOperation.id){const n=r.params,{unitId:e,subUnitId:t,selections:i,type:s}=n;if((s===v.SelectionMoveType.MOVE_END||s===void 0)&&i[0].primary){const u=i[0].primary.actualRow,d=i[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(e,t,u,d)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const p=this._sheetsThreadCommentModel.getByLocation(e,t,u,d);p&&this._commandService.executeCommand(P.SetActiveCommentOperation.id,{unitId:e,subUnitId:t,commentId:p})}}if(r.id===j.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;[ve,Ce].forEach(n=>{this._menuService.addMenuItem(n(this._injector),r)})}_initComponent(){[[J,le],[P.THREAD_COMMENT_PANEL,pe],[Z,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 d=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!d||d.getUnitId()!==e)return;((n=d.getActiveSheet())==null?void 0:n.getSheetId())!==t&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:t});const l=V.singleReferenceToGrid(u.ref),{row:S,column:y}=l;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:S,startColumn:y,endRow:S,endColumn:y}]))return;const _=5;await this._commandService.executeCommand(T.ScrollToRangeOperation.id,{range:{startRow:Math.max(l.row-_,0),endRow:l.row+_,startColumn:Math.max(l.column-_,0),endColumn:l.column+_}}),this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:t,row:l.row,col:l.column,commentId:u.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}},a.SheetsThreadCommentController=Ie([c.OnLifecycle(c.LifecycleStages.Starting,a.SheetsThreadCommentController),w(1,f.IMenuService),w(2,m.Inject(m.Injector)),w(3,m.Inject(f.ComponentManager)),w(4,m.Inject(c.LocaleService)),w(5,c.ICommandService),w(6,m.Inject(a.SheetsThreadCommentPopupService)),w(7,m.Inject(D.SheetsThreadCommentModel)),w(8,m.Inject(P.ThreadCommentPanelService)),w(9,f.IShortcutService),w(10,c.IUniverInstanceService),w(11,m.Inject(T.SheetPermissionInterceptorBaseController))],a.SheetsThreadCommentController);var Te=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,be=(o,r,n,e)=>{for(var t=e>1?void 0:e?ge(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&&Te(r,n,t),t},L=(o,r)=>(n,e)=>r(n,e,o);let k=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(v.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(T.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:e});i==null||i.makeDirty(!0),i==null||i.calculate(),t&&t.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(()=>{o()}))}};k=be([c.OnLifecycle(c.LifecycleStages.Ready,k),L(0,m.Inject(v.SheetInterceptorService)),L(1,m.Inject(D.SheetsThreadCommentModel)),L(2,c.IUniverInstanceService),L(3,oe.IRenderManagerService)],k);var ye=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,we=(o,r,n,e)=>{for(var t=e>1?void 0:e?Me(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&&ye(r,n,t),t},x=(o,r)=>(n,e)=>r(n,e,o);const Oe=(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){super();N(this,"_copyInfo");this._sheetClipboardService=n,this._sheetsThreadCommentModel=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:z,onBeforeCopy:(n,e,t)=>{this._copyInfo={unitId:n,subUnitId:e,range:t}},onPasteCells:(n,e,t,i)=>{const{unitId:s,subUnitId:u,range:d}=e,p={row:d.rows[0],column:d.cols[0]};if(i.copyType===T.COPY_TYPE.CUT&&this._copyInfo){const{range:C,unitId:l,subUnitId:S}=this._copyInfo,y={row:C.startRow,column:C.startColumn};if(!(s===l&&u===S)){const O=[];c.Range.foreach(C,(h,I)=>{const M=this._sheetsThreadCommentModel.getCommentWithChildren(l,S,h,I);M&&O.push(M)});const _=[],$=[],F=[],q=[],A=h=>{_.unshift({id:j.DeleteCommentMutation.id,params:{unitId:l,subUnitId:S,commentId:h.id}}),F.push({id:j.AddCommentMutation.id,params:{unitId:s,subUnitId:u,comment:{...h,ref:Oe(h.ref,y,p),unitId:s,subUnitId:u}}}),$.push({id:j.AddCommentMutation.id,params:{unitId:l,subUnitId:S,comment:h}}),q.unshift({id:j.DeleteCommentMutation.id,params:{unitId:s,subUnitId:u,commentId:h.id}})};return O.forEach(h=>{A(h.root),h.children.forEach(I=>{A(I)})}),{redos:[..._,...F],undos:[...q,...$]}}}return{redos:[],undos:[]}}}))}},a.SheetsThreadCommentCopyPasteController=we([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentCopyPasteController),x(0,m.Inject(T.ISheetClipboardService)),x(1,m.Inject(D.SheetsThreadCommentModel))],a.SheetsThreadCommentCopyPasteController);var Ue=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Ee=(o,r,n,e)=>{for(var t=e>1?void 0:e?je(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&&Ue(r,n,t),t},W=(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(B.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,d=this._sheetsThreadCommentModel.getByLocation(t,i,s,u);if(d){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:s,startColumn:u,endRow:s,endColumn:u}]))return;const C=this._sheetsThreadCommentModel.getComment(t,i,d);C&&!C.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:i,row:s,col:u,commentId:d,temp:!0})}else n&&this._sheetsThreadCommentPopupService.hidePopup()}}))}},a.SheetsThreadCommentHoverController=Ee([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentHoverController),W(0,m.Inject(T.HoverManagerService)),W(1,m.Inject(a.SheetsThreadCommentPopupService)),W(2,m.Inject(D.SheetsThreadCommentModel)),W(3,m.Inject(T.SheetPermissionInterceptorBaseController))],a.SheetsThreadCommentHoverController);var Re=Object.defineProperty,De=Object.getOwnPropertyDescriptor,$e=(o,r,n,e)=>{for(var t=e>1?void 0:e?De(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&&Re(r,n,t),t},G=(o,r)=>(n,e)=>r(n,e,o);a.ThreadCommentRemoveSheetsController=class extends c.Disposable{constructor(r,n,e){super(),this._sheetInterceptorService=r,this._univerInstanceService=n,this._threadCommentModel=e,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{var n;if(r.id===v.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),d=Array.from(Object.keys(u)),p=Array.from(Object.values(u)),C=d.map(S=>({id:j.DeleteCommentMutation.id,params:{unitId:i,subUnitId:s,commentId:S}})),l=p.map(S=>({id:j.AddCommentMutation.id,params:{unitId:i,subUnitId:s,comment:S}}));return{redos:C,undos:l}}return{redos:[],undos:[]}}}))}},a.ThreadCommentRemoveSheetsController=$e([c.OnLifecycle(c.LifecycleStages.Ready,a.ThreadCommentRemoveSheetsController),G(0,m.Inject(v.SheetInterceptorService)),G(1,c.IUniverInstanceService),G(2,m.Inject(j.ThreadCommentModel))],a.ThreadCommentRemoveSheetsController);var ee=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(o,r,n)=>r in o?ee(o,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[r]=n,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&&ee(r,n,t),t},te=(o,r)=>(n,e)=>r(n,e,o),ne=(o,r,n)=>Ve(o,typeof r!="symbol"?r+"":r,n);a.UniverSheetsThreadCommentPlugin=class extends c.Plugin{constructor(n={},e,t){super();N(this,"_pluginConfig");this._injector=e,this._commandService=t,this._pluginConfig=c.Tools.deepMerge({},Pe,n)}onStarting(n){[[a.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(a.SheetsThreadCommentController,this._pluginConfig)}],[k],[a.SheetsThreadCommentCopyPasteController],[a.SheetsThreadCommentHoverController],[a.ThreadCommentRemoveSheetsController],[a.SheetsThreadCommentPopupService]].forEach(e=>{n.add(e)}),[H].forEach(e=>{this._commandService.registerCommand(e)})}},ne(a.UniverSheetsThreadCommentPlugin,"pluginName",z),ne(a.UniverSheetsThreadCommentPlugin,"type",c.UniverInstanceType.UNIVER_SHEET),a.UniverSheetsThreadCommentPlugin=Ae([c.DependentOn(P.UniverThreadCommentUIPlugin,D.UniverSheetsThreadCommentBasePlugin),te(1,m.Inject(m.Injector)),te(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:()=>P.IThreadCommentMentionDataService}),Object.defineProperty(a,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin}),Object.defineProperty(a,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>j.IThreadCommentDataSourceService}),Object.defineProperty(a,"SheetsThreadCommentModel",{enumerable:!0,get:()=>D.SheetsThreadCommentModel}),a.SHEETS_THREAD_COMMENT=z,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
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,g,f,C,V,b,y,D,R,M,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 w=function(){return w=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},w.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=M.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(),d=M.useRef("_".concat(me()));return Q(n,"".concat(e),{defIds:n.defIds,idSuffix:d.current},w({ref:r,className:u},s),i)});function Q(o,r,n,e,t){return M.createElement(o.tag,w(w({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=w({},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)?w(w({},o),{children:o.children.map(function(t){return typeof t.attrs.id=="string"&&e&&e.indexOf(t.attrs.id)>-1?w(w({},t),{attrs:w(w({},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=M.forwardRef(function(o,r){return M.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 d=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(!d)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const p=new c.DisposableCollection;p.add(d),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(y.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:d}=n,p=e.getByLocation(s,u,t,i),v=`${c.Tools.chatAtABC(i)}${t+1}`,l=()=>{r.hidePopup()},_=S=>{var T,I,N;return(N=(I=(T=o.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getSheetBySheetId(S))==null?void 0:I.getName())!=null?N:""};return M.createElement(g.ThreadCommentTree,{onClick:()=>{r.persistPopup()},prefix:"cell",id:p,unitId:s,subUnitId:u,type:c.UniverInstanceType.UNIVER_SHEET,refStr:v,onClose:l,getSubUnitName:_,autoFocus:d==="context-menu"})},H={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(o){var I;const r=o.get(C.SelectionManagerService),n=o.get(c.IUniverInstanceService),e=o.get(a.SheetsThreadCommentPopupService),t=o.get(g.ThreadCommentPanelService),i=(I=r.getFirst())==null?void 0:I.primary,s=r.getCurrent(),u=o.get(D.SheetsThreadCommentModel);if(!s||!i)return!1;const{unitId:d,sheetId:p}=s,v=C.getSheetCommandTarget(n,{unitId:d,subUnitId:p});if(!v)return!1;const{workbook:l,worksheet:_}=v,S={workbook:l,worksheet:_,unitId:d,subUnitId:p,row:i.startRow,col:i.startColumn};e.showPopup(S);const T=u.getByLocation(d,p,i.startRow,i.startColumn);return T&&t.setActiveComment({unitId:d,subUnitId:p,commentId:T,trigger:"context-menu"}),!0}},Ce=()=>{var z;const o=R.useDependency(y.IMarkSelectionService),r=R.useDependency(c.IUniverInstanceService),n=R.useDependency(b.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=M.useMemo(()=>t.activeSheet$.pipe(G.map(h=>h==null?void 0:h.getSheetId())),[t.activeSheet$]),d=f.useObservable(u,(z=t.getActiveSheet())==null?void 0:z.getSheetId()),p=M.useRef(),v=R.useDependency(g.ThreadCommentPanelService),l=f.useObservable(v.activeCommentId$),_=M.useCallback(h=>{const P=t.getSheets(),O={};P.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=M.useCallback(h=>{if(h.unitId===i&&h.subUnitId===d&&!h.resolved){const{row:P,column:O}=V.singleReferenceToGrid(h.ref);if(!Number.isNaN(P)&&!Number.isNaN(O))return o.addShape({range:{startColumn:O,endColumn:O,startRow:P,endRow:P},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[o,d,i]),T=h=>{var P,O;return(O=(P=t.getSheetBySheetId(h))==null?void 0:P.getName())!=null?O:""},I=()=>{s.executeCommand(H.id)},N=h=>{l&&l.unitId===h.unitId&&l.subUnitId===h.subUnitId&&l.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,P)=>{P&&e.hidePopup()};return M.useEffect(()=>{if(!l)return;const h=n.getComment(l.unitId,l.subUnitId,l.commentId);if(!h)return;const P=S(h);return()=>{P&&o.removeShape(P)}},[S,l,n,o]),M.createElement(g.ThreadCommentPanel,{unitId:i,subUnitId$:u,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:I,getSubUnitName:T,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$:y.getCurrentRangeDisable$(o,{workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]})}),fe=o=>({id:g.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:K,tooltip:"sheetThreadComment.menu.commentManagement",positions:f.MenuPosition.TOOLBAR_START,group:f.MenuGroup.TOOLBAR_OTHERS,disabled$:y.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:y.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,d,p,v,l){super(),this._config=r,this._menuService=n,this._injector=e,this._componentManager=t,this._commandService=i,this._sheetsThreadCommentPopupService=s,this._sheetsThreadCommentModel=u,this._threadCommentPanelService=d,this._shortcutService=p,this._univerInstanceService=v,this._sheetPermissionInterceptorBaseController=l,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,d=i[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(e,t,u,d)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(g.SetActiveCommentOperation.id);return}const p=this._sheetsThreadCommentModel.getByLocation(e,t,u,d);p&&this._commandService.executeCommand(g.SetActiveCommentOperation.id,{unitId:e,subUnitId:t,commentId:p})}}if(r.id===b.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],[g.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 d=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!d||d.getUnitId()!==e)return;((n=d.getActiveSheet())==null?void 0:n.getSheetId())!==t&&await this._commandService.executeCommand(C.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:t});const l=V.singleReferenceToGrid(u.ref),{row:_,column:S}=l;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[C.WorkbookCommentPermission],worksheetTypes:[C.WorksheetViewPermission],rangeTypes:[C.RangeProtectionPermissionViewPoint]},[{startRow:_,startColumn:S,endRow:_,endColumn:S}]))return;const I=1;await this._commandService.executeCommand(y.ScrollToRangeOperation.id,{range:{startRow:Math.max(l.row-I,0),endRow:l.row+I,startColumn:Math.max(l.column-I,0),endColumn:l.column+I}}),this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:t,row:l.row,col:l.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(g.ThreadCommentPanelService)),E(8,f.IShortcutService),E(9,c.IUniverInstanceService),E(10,m.Inject(y.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(y.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:d}=e,p={row:d.rows[0],column:d.cols[0]};if(i.copyType===y.COPY_TYPE.CUT&&this._copyInfo){const{range:v,unitId:l,subUnitId:_}=this._copyInfo,S={row:v.startRow,column:v.startColumn};if(!(s===l&&u===_)){const T=[];c.Range.foreach(v,(h,P)=>{const O=this._sheetsThreadCommentModel.getAllByLocation(l,_,h,P);this._threadCommentDataSourceService.syncUpdateMutationToColla?O.forEach(k=>{T.push(k)}):O.forEach(({children:k,...j})=>{j.parentId||T.push(j)})});const I=[],N=[],L=[],Z=[],z=h=>{I.unshift({id:b.DeleteCommentMutation.id,params:{unitId:l,subUnitId:_,commentId:h.id}}),L.push({id:b.AddCommentMutation.id,params:{unitId:s,subUnitId:u,comment:{...h,ref:Ee(h.ref,S,p),unitId:s,subUnitId:u},sync:!0}}),N.push({id:b.AddCommentMutation.id,params:{unitId:l,subUnitId:_,comment:h,sync:!0}}),Z.unshift({id:b.DeleteCommentMutation.id,params:{unitId:s,subUnitId:u,commentId:h.id}})};return T.forEach(h=>{z(h)}),{redos:[...I,...L],undos:[...Z,...N]}}}return{redos:[],undos:[]}}}))}},a.SheetsThreadCommentCopyPasteController=Ue([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentCopyPasteController),X(0,m.Inject(y.ISheetClipboardService)),X(1,m.Inject(D.SheetsThreadCommentModel)),X(2,b.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,d=this._sheetsThreadCommentModel.getByLocation(t,i,s,u);if(d){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,d);v&&!v.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:i,row:s,col:u,commentId:d,temp:!0})}else n&&this._sheetsThreadCommentPopupService.hidePopup()}}))}},a.SheetsThreadCommentHoverController=De([c.OnLifecycle(c.LifecycleStages.Rendered,a.SheetsThreadCommentHoverController),q(0,m.Inject(y.HoverManagerService)),q(1,m.Inject(a.SheetsThreadCommentPopupService)),q(2,m.Inject(D.SheetsThreadCommentModel)),q(3,m.Inject(y.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),d=Array.from(Object.values(u)).filter(S=>!S.parentId),p=d.map(S=>S.id),v=this._threadCommentDataSourceService.syncUpdateMutationToColla,l=p.map(S=>({id:b.DeleteCommentMutation.id,params:{unitId:i,subUnitId:s,commentId:S}})),_=d.map(({children:S,...T})=>({id:b.AddCommentMutation.id,params:{unitId:i,subUnitId:s,comment:{...T,children:v?S:void 0},sync:!v}}));return{redos:l,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(b.ThreadCommentModel)),B(3,b.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(g.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:()=>g.IThreadCommentMentionDataService}),Object.defineProperty(a,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>g.UniverThreadCommentUIPlugin}),Object.defineProperty(a,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>b.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.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer thread comment plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,40 +45,38 @@
|
|
|
45
45
|
"lib"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@wendellhu/redi": "0.15.
|
|
48
|
+
"@wendellhu/redi": "0.15.5",
|
|
49
49
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
|
50
50
|
"rxjs": ">=7.0.0",
|
|
51
|
-
"@univerjs/core": "0.
|
|
52
|
-
"@univerjs/engine-formula": "0.
|
|
53
|
-
"@univerjs/engine-render": "0.
|
|
54
|
-
"@univerjs/sheets": "0.
|
|
55
|
-
"@univerjs/sheets-
|
|
56
|
-
"@univerjs/thread-comment": "0.
|
|
57
|
-
"@univerjs/sheets
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/ui": "0.
|
|
51
|
+
"@univerjs/core": "0.2.0",
|
|
52
|
+
"@univerjs/engine-formula": "0.2.0",
|
|
53
|
+
"@univerjs/engine-render": "0.2.0",
|
|
54
|
+
"@univerjs/sheets-thread-comment-base": "0.2.0",
|
|
55
|
+
"@univerjs/sheets-ui": "0.2.0",
|
|
56
|
+
"@univerjs/thread-comment": "0.2.0",
|
|
57
|
+
"@univerjs/sheets": "0.2.0",
|
|
58
|
+
"@univerjs/ui": "0.2.0",
|
|
59
|
+
"@univerjs/thread-comment-ui": "0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@univerjs/icons": "^0.1.
|
|
63
|
-
"@univerjs/thread-comment": "0.1.16",
|
|
64
|
-
"@univerjs/sheets-thread-comment-base": "0.1.16",
|
|
65
|
-
"@univerjs/thread-comment-ui": "0.1.16"
|
|
62
|
+
"@univerjs/icons": "^0.1.58"
|
|
66
63
|
},
|
|
67
64
|
"devDependencies": {
|
|
68
|
-
"@wendellhu/redi": "0.15.
|
|
65
|
+
"@wendellhu/redi": "0.15.5",
|
|
69
66
|
"clsx": "^2.1.1",
|
|
70
67
|
"react": "18.3.1",
|
|
71
68
|
"rxjs": "^7.8.1",
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vite": "^5.3.
|
|
69
|
+
"typescript": "^5.5.3",
|
|
70
|
+
"vite": "^5.3.3",
|
|
74
71
|
"vitest": "^1.6.0",
|
|
75
|
-
"@univerjs/core": "0.
|
|
76
|
-
"@univerjs/engine-formula": "0.
|
|
77
|
-
"@univerjs/shared": "0.
|
|
78
|
-
"@univerjs/design": "0.
|
|
79
|
-
"@univerjs/thread-comment": "0.
|
|
80
|
-
"@univerjs/thread-comment-
|
|
81
|
-
"@univerjs/ui": "0.
|
|
72
|
+
"@univerjs/core": "0.2.0",
|
|
73
|
+
"@univerjs/engine-formula": "0.2.0",
|
|
74
|
+
"@univerjs/shared": "0.2.0",
|
|
75
|
+
"@univerjs/design": "0.2.0",
|
|
76
|
+
"@univerjs/thread-comment": "0.2.0",
|
|
77
|
+
"@univerjs/sheets-thread-comment-base": "0.2.0",
|
|
78
|
+
"@univerjs/thread-comment-ui": "0.2.0",
|
|
79
|
+
"@univerjs/ui": "0.2.0"
|
|
82
80
|
},
|
|
83
81
|
"univerSpace": {
|
|
84
82
|
".": {
|