@univerjs/sheets-thread-comment-ui 0.21.0 → 0.21.1
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 +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +11 -11
package/lib/cjs/index.js
CHANGED
package/lib/es/index.js
CHANGED
package/lib/index.js
CHANGED
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/sheets-thread-comment`),require(`@univerjs/thread-comment-ui`),require(`@univerjs/ui`),require(`@univerjs/sheets-ui`),require(`rxjs`),require(`@univerjs/engine-render`),require(`@univerjs/engine-formula`),require(`@univerjs/thread-comment`),require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/ui`,`@univerjs/sheets-ui`,`rxjs`,`@univerjs/engine-render`,`@univerjs/engine-formula`,`@univerjs/thread-comment`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsThreadCommentUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsThreadComment,e.UniverThreadCommentUi,e.UniverUi,e.UniverSheetsUi,e.rxjs,e.UniverEngineRender,e.UniverEngineFormula,e.UniverThreadComment,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let p=`univer.sheet.thread-comment-modal`,m=`univer.sheet.thread-comment-panel`,h=`SHEET_THREAD_COMMENT_UI_PLUGIN`;function g(e){"@babel/helpers - typeof";return g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g(e)}function _(e,t){if(g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v(e){var t=_(e,`string`);return g(t)==`symbol`?t:t+``}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(n,r){t(n,r,e)}}function x(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let S=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t,n){super(),this._canvasPopupManagerService=e,this._zenZoneService=t,this._cellPopupManagerService=n,y(this,`_lastPopup`,null),y(this,`_activePopup`,void 0),y(this,`_activePopup$`,new s.BehaviorSubject(null)),y(this,`activePopup$`,this._activePopup$.asObservable()),this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var r;let{row:i,col:a,unitId:o,subUnitId:s}=e;if(this._activePopup&&i===this._activePopup.row&&a===this._activePopup.col&&o===this._activePopup.unitId&&s===((r=this.activePopup)==null?void 0:r.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=e,this._activePopup$.next(e);let c=this._cellPopupManagerService.showPopup({row:i,col:a,unitId:o,subUnitId:s},{componentKey:p,onClickOutside:()=>{this.hidePopup()},direction:`horizontal`,excludeOutside:[...Array.from(document.querySelectorAll(`.univer-thread-comment`)),document.getElementById(`thread-comment-add`)].filter(Boolean),priority:2});if(!c)throw Error(`[SheetsThreadCommentPopupService]: cannot show popup!`);let l=new t.DisposableCollection;l.add(c),l.add({dispose:()=>{n==null||n()}}),this._lastPopup=l}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};S=x([b(0,(0,t.Inject)(o.SheetCanvasPopManagerService)),b(1,a.IZenZoneService),b(2,(0,t.Inject)(o.CellPopupManagerService))],S);let C={type:t.CommandType.OPERATION,id:`sheet.operation.show-comment-modal`,handler(e){var a;let o=e.get(n.SheetsSelectionsService),s=e.get(t.IUniverInstanceService),c=e.get(S),l=e.get(i.ThreadCommentPanelService),u=(a=o.getCurrentLastSelection())==null?void 0:a.primary,d=e.get(r.SheetsThreadCommentModel);if(!u)return!1;let f=(0,n.getSheetCommandTarget)(s);if(!f)return!1;let{workbook:p,worksheet:m,unitId:h,subUnitId:g}=f,_={workbook:p,worksheet:m,unitId:h,subUnitId:g,row:u.startRow,col:u.startColumn};c.showPopup(_);let v=d.getByLocation(h,g,u.startRow,u.startColumn);return v&&l.setActiveComment({unitId:h,subUnitId:g,commentId:v,trigger:`context-menu`}),!0}},w={id:`sheet.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){let t=e.get(a.ISidebarService),n=e.get(i.ThreadCommentPanelService);return n.panelVisible?(t.close(),n.setPanelVisible(!1)):(t.open({header:{title:`threadCommentUI.panel.title`},children:{label:m},width:360}),n.setPanelVisible(!0)),!0}};var T=`@univerjs/sheets-thread-comment-ui`,E=`0.21.0`;let D=`sheets-thread-comment.config`;Symbol(D);let O={},k=class extends t.Disposable{constructor(e,t,n,r){super(),this._sheetInterceptorService=e,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=r,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(n.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t;return this._sheetsThreadCommentModel.showCommentMarker(a,o,r,i)?((!e||e===t.rawData)&&(e={...t.rawData}),e.markers={...e==null?void 0:e.markers,tr:{color:`#FFBD37`,size:6}},n(e)):n(e)},priority:100}))}_initSkeletonChange(){let e=()=>{var e;let n=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=n.getUnitId(),i=this._renderManagerService.getRenderById(r);i==null||(e=i.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe((0,s.debounceTime)(16)).subscribe(()=>{e()}))}};k=x([b(0,(0,t.Inject)(n.SheetInterceptorService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,t.IUniverInstanceService),b(3,c.IRenderManagerService)],k);let A=(e,t,n)=>{let r=(0,l.singleReferenceToGrid)(e),i=n.row-t.row,a=n.column-t.column;return(0,l.serializeRange)({startColumn:r.column+a,startRow:r.row+i,endColumn:r.column+a,endRow:r.row+i})},j=class extends t.Disposable{constructor(e,t,n){super(),this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._threadCommentDataSourceService=n,y(this,`_copyInfo`,void 0),this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:h,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,n,r,i)=>{let{unitId:a,subUnitId:s,range:c}=n,l={row:c.rows[0],column:c.cols[0]};if(i.copyType===o.COPY_TYPE.CUT&&this._copyInfo){let{range:e,unitId:n,subUnitId:r}=this._copyInfo,i={row:e.startRow,column:e.startColumn};if(!(a===n&&s===r)){let o=[];t.Range.foreach(e,(e,t)=>{let i=this._sheetsThreadCommentModel.getAllByLocation(n,r,e,t);this._threadCommentDataSourceService.syncUpdateMutationToColla?i.forEach(e=>{o.push(e)}):i.forEach(({children:e,...t})=>{t.parentId||o.push(t)})});let c=[],d=[],f=[],p=[],m=e=>{c.unshift({id:u.DeleteCommentMutation.id,params:{unitId:n,subUnitId:r,commentId:e.id}}),f.push({id:u.AddCommentMutation.id,params:{unitId:a,subUnitId:s,comment:{...e,ref:A(e.ref,i,l),unitId:a,subUnitId:s},sync:!0}}),d.push({id:u.AddCommentMutation.id,params:{unitId:n,subUnitId:r,comment:e,sync:!0}}),p.unshift({id:u.DeleteCommentMutation.id,params:{unitId:a,subUnitId:s,commentId:e.id}})};return o.forEach(e=>{m(e)}),{redos:[...c,...f],undos:[...p,...d]}}}return{redos:[],undos:[]}}}))}};j=x([b(0,(0,t.Inject)(o.ISheetClipboardService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,u.IThreadCommentDataSourceService)],j);let M=class extends t.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionCheckController=r,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0,s.debounceTime)(100)).subscribe(e=>{let t=this._sheetsThreadCommentPopupService.activePopup;if(e&&(t&&t.temp||!t)){let{location:r}=e,{unitId:i,subUnitId:a,row:o,col:s}=r,c=this._sheetsThreadCommentModel.getByLocation(i,a,o,s);if(c){if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}],i,a))return;let e=this._sheetsThreadCommentModel.getComment(i,a,c);e&&!e.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};M=x([b(0,(0,t.Inject)(o.HoverManagerService)),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(n.SheetPermissionCheckController))],M);let N=class extends t.Disposable{constructor(e,t,n,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._sheetsThreadCommentModel=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{let{id:t}=e;if(t===C.id||t===w.id)this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`));else if(t===u.AddCommentCommand.id){let{unitId:t,subUnitId:r,comment:i}=e.params,{row:a,column:o}=(0,l.singleReferenceToGrid)(i.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}else if(t===u.UpdateCommentCommand.id){let{unitId:t,subUnitId:r,payload:i}=e.params,{commentId:a}=i,o=this._sheetsThreadCommentModel.getComment(t,r,a);if(o){let{row:e,column:i}=(0,l.singleReferenceToGrid)(o.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}}else if(t===u.ResolveCommentCommand.id||t===u.DeleteCommentCommand.id||t===u.DeleteCommentTreeCommand.id){let{unitId:t,subUnitId:r,commentId:i}=e.params,a=this._sheetsThreadCommentModel.getComment(t,r,i);if(a){let{row:e,column:i}=(0,l.singleReferenceToGrid)(a.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}}}))}};N=x([b(0,(0,t.Inject)(t.LocaleService)),b(1,t.ICommandService),b(2,(0,t.Inject)(n.SheetPermissionCheckController)),b(3,(0,t.Inject)(r.SheetsThreadCommentModel))],N);let P=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._commandService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._threadCommentPanelService=r,this._univerInstanceService=i,this._sheetPermissionCheckController=a,this._markSelectionService=o,this._sheetSelectionService=s,this._editorBridgeService=c,this._renderManagerService=l,y(this,`_isSwitchToCommenting`,!1),y(this,`_selectionShapeInfo`,null),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(e,n,r){var a,s,c;let l=(a=e[0])==null?void 0:a.range,u=this._renderManagerService.getRenderById(n),d=u==null||(s=u.with(o.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:s.skeleton;if(!d||!l)return;let f=d.getCellWithCoordByIndex(l.startRow,l.startColumn);if((((c=l.rangeType)==null?t.RANGE_TYPE.NORMAL:c)!==t.RANGE_TYPE.NORMAL||l.endColumn-l.startColumn>0||l.endRow-l.startRow>0)&&!((f.isMerged||f.isMergedMainCell)&&t.Rectangle.equals(f.mergeInfo,l))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let p=f.actualRow,m=f.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,r,p,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let h=this._sheetsThreadCommentModel.getByLocation(n,r,p,m);h&&this._commandService.executeCommand(i.SetActiveCommentOperation.id,{unitId:n,subUnitId:r,commentId:h})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchToCommenting)return;let t=this._sheetSelectionService.currentSelectionParam;t&&this._handleSelectionChange(e,t.unitId,t.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(e=>{if(e.id===u.DeleteCommentMutation.id){let t=e.params,n=this._sheetsThreadCommentPopupService.activePopup;if(!n)return;let{unitId:r,subUnitId:i,commentId:a}=n;t.unitId===r&&t.subUnitId===i&&t.commentId===a&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async e=>{if(e){var r;let{unitId:i,subUnitId:a,commentId:s,trigger:c}=e,u=this._sheetsThreadCommentModel.getComment(i,a,s);if(!u||u.resolved)return;let d=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!d||d.getUnitId()!==i)return;this._isSwitchToCommenting=!0,((r=d.getActiveSheet())==null?void 0:r.getSheetId())!==a&&await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:i,subUnitId:a}),this._isSwitchToCommenting=!1;let f=(0,l.singleReferenceToGrid)(u.ref),{row:p,column:m}=f;if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:p,startColumn:m,endRow:p,endColumn:m}],i,a)||(await this._commandService.executeCommand(o.ScrollToRangeOperation.id,{range:{startRow:Math.max(f.row-1,0),endRow:f.row+1,startColumn:Math.max(f.column-1,0),endColumn:f.column+1}}),this._editorBridgeService.isVisible().visible))return;this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:f.row,col:f.column,commentId:u.id,trigger:c})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe((0,s.debounceTime)(100)).subscribe(e=>{var n,r;if(!e){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}let{unitId:i,subUnitId:a,commentId:o}=e;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);let s=this._sheetsThreadCommentModel.getComment(i,a,o);if(!s)return;let{row:c,column:u}=(0,l.singleReferenceToGrid)(s.ref);if(Number.isNaN(c)||Number.isNaN(u))return null;let d=(n=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getSheetBySheetId(a),f=(r=d==null?void 0:d.getMergedCell(c,u))==null?{startColumn:u,endColumn:u,startRow:c,endRow:c}:r,p=this._markSelectionService.addShape({range:f,style:{fill:`rgba(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1);p&&(this._selectionShapeInfo={...e,shapeId:p})}))}};P=x([b(0,t.ICommandService),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(i.ThreadCommentPanelService)),b(4,t.IUniverInstanceService),b(5,(0,t.Inject)(n.SheetPermissionCheckController)),b(6,o.IMarkSelectionService),b(7,(0,t.Inject)(n.SheetsSelectionsService)),b(8,o.IEditorBridgeService),b(9,c.IRenderManagerService)],P);function F({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,d.useRef)(`_${z()}`);return I(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function I(e,t,n,r,i){return(0,d.createElement)(e.tag,{key:t,...L(e,n,i),...r},(R(e,n).children||[]).map((r,a)=>I(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function L(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function R(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function z(){return Math.random().toString(36).substring(2,8)}F.displayName=`UniverIcon`;let B={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,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.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.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.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M11.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`}},{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`}}]},V=(0,d.forwardRef)(function(e,t){return(0,d.createElement)(F,Object.assign({},e,{id:`comment-icon`,ref:t,icon:B}))});V.displayName=`CommentIcon`;let H=e=>({id:C.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,title:`sheetThreadComment.menu.addComment`,hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]})}),U=e=>({id:w.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,tooltip:`sheetThreadComment.menu.commentManagement`,disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]}),hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET)}),W={id:C.id,binding:a.KeyCode.M|a.MetaKeys.CTRL_COMMAND|a.MetaKeys.ALT,preconditions:o.whenSheetEditorFocused},G={[a.RibbonInsertGroup.MEDIA]:{[w.id]:{order:2,menuItemFactory:U}},[a.ContextMenuPosition.MAIN_AREA]:{[a.ContextMenuGroup.OTHERS]:{[C.id]:{order:0,menuItemFactory:H}}}},K=()=>{let e=(0,a.useDependency)(t.IUniverInstanceService),n=(0,a.useDependency)(S),o=(0,a.useObservable)(n.activePopup$),s=(0,a.useDependency)(r.SheetsThreadCommentModel);if((0,a.useObservable)(s.commentUpdate$),!o)return null;let{row:c,col:l,unitId:u,subUnitId:d,trigger:p}=o,m=s.getByLocation(u,d,c,l),h=`${t.Tools.chatAtABC(l)}${c+1}`;return(0,f.jsx)(i.ThreadCommentTree,{onClick:()=>{n.persistPopup()},location:i.ThreadCommentTreeLocation.CELL,id:m,unitId:u,subUnitId:d,type:t.UniverInstanceType.UNIVER_SHEET,refStr:h,onClose:()=>{n.hidePopup()},getSubUnitName:n=>{var r,i;return(r=(i=e.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET))==null||(i=i.getSheetBySheetId(n))==null?void 0:i.getName())==null?``:r},autoFocus:p===`context-menu`})},q=()=>{var e;let n=(0,a.useDependency)(o.IMarkSelectionService),r=(0,a.useDependency)(t.IUniverInstanceService),c=(0,a.useDependency)(S),u=r.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET),p=u.getUnitId(),m=(0,a.useDependency)(t.ICommandService),h=(0,d.useMemo)(()=>u.activeSheet$.pipe((0,s.map)(e=>e==null?void 0:e.getSheetId())),[u.activeSheet$]),g=(0,a.useObservable)(h,(e=u.getActiveSheet())==null?void 0:e.getSheetId()),_=(0,d.useRef)(null),v=(0,a.useDependency)(i.ThreadCommentPanelService),y=(0,a.useObservable)(v.activeCommentId$),b=(0,a.useObservable)(v.panelVisible$,v.panelVisible),x=(0,d.useCallback)(e=>{let t=u.getSheets(),n={};t.forEach((e,t)=>{n[e.getSheetId()]=t});let r=e=>e.map(e=>{var t;let r=(0,l.singleReferenceToGrid)(e.ref),i=[(t=n[e.subUnitId])==null?0:t,r.row,r.column];return{...e,p:i}}).sort((e,t)=>e.p[0]===t.p[0]?e.p[1]===t.p[1]?e.p[2]-t.p[2]:e.p[1]-t.p[1]:e.p[0]-t.p[0]);return[...r(e.filter(e=>!e.resolved)),...r(e.filter(e=>e.resolved))]},[u]),w=(0,d.useCallback)(e=>{if(e.unitId===p&&e.subUnitId===g&&!e.resolved){var t;let{row:r,column:i}=(0,l.singleReferenceToGrid)(e.ref),a=u.getSheetBySheetId(e.subUnitId),o=(t=a==null?void 0:a.getMergedCell(r,i))==null?{startColumn:i,endColumn:i,startRow:r,endRow:r}:t;if(!Number.isNaN(r)&&!Number.isNaN(i))return n.addShape({range:o,style:{fill:`rgb(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null})}return null},[n,g,p]),T=e=>{var t,n;return(t=(n=u.getSheetBySheetId(e))==null?void 0:n.getName())==null?``:t},E=()=>{m.executeCommand(C.id)},D=e=>{y&&y.unitId===e.unitId&&y.subUnitId===e.subUnitId&&y.commentId===e.id||(_.current&&(n.removeShape(_.current),_.current=null),_.current=w(e))},O=()=>{_.current&&(n.removeShape(_.current),_.current=null)};return(0,d.useEffect)(()=>{!b&&_.current&&n.removeShape(_.current)},[n,b]),(0,f.jsx)(i.ThreadCommentPanel,{unitId:p,subUnitId$:h,type:t.UniverInstanceType.UNIVER_SHEET,onAdd:E,getSubUnitName:T,onResolve:(e,t)=>{t&&c.hidePopup()},sortComments:x,onItemEnter:D,onItemLeave:O,onDeleteComment:()=>(O(),!0)})},J=class extends t.Disposable{constructor(e,t,n){super(),this._menuManagerService=e,this._componentManager=t,this._shortcutService=n,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(W)}_initMenu(){this._menuManagerService.mergeMenu(G)}_initComponent(){[[p,K],[m,q],[`CommentIcon`,V]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};J=x([b(0,a.IMenuManagerService),b(1,(0,t.Inject)(a.ComponentManager)),b(2,a.IShortcutService)],J);let Y=class extends t.Plugin{constructor(e=O,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},O,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(D,o)}onStarting(){[[J],[k],[j],[M],[P],[S],[N]].forEach(e=>{this._injector.add(e)}),[C,w].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(J)}onReady(){this._injector.get(k)}onRendered(){this._injector.get(j),this._injector.get(M),this._injector.get(P),this._injector.get(N)}};y(Y,`pluginName`,h),y(Y,`packageName`,T),y(Y,`version`,E),y(Y,`type`,t.UniverInstanceType.UNIVER_SHEET),Y=x([(0,t.DependentOn)(i.UniverThreadCommentUIPlugin,r.UniverSheetsThreadCommentPlugin),b(1,(0,t.Inject)(t.Injector)),b(2,(0,t.Inject)(t.ICommandService)),b(3,t.IConfigService)],Y),Object.defineProperty(e,`AddCommentCommand`,{enumerable:!0,get:function(){return u.AddCommentCommand}}),Object.defineProperty(e,`DeleteCommentCommand`,{enumerable:!0,get:function(){return u.DeleteCommentCommand}}),Object.defineProperty(e,`DeleteCommentTreeCommand`,{enumerable:!0,get:function(){return u.DeleteCommentTreeCommand}}),Object.defineProperty(e,`IThreadCommentDataSourceService`,{enumerable:!0,get:function(){return u.IThreadCommentDataSourceService}}),Object.defineProperty(e,`ResolveCommentCommand`,{enumerable:!0,get:function(){return u.ResolveCommentCommand}}),Object.defineProperty(e,`SheetsThreadCommentPopupService`,{enumerable:!0,get:function(){return S}}),e.ShowAddSheetCommentModalOperation=C,e.ToggleSheetCommentPanelOperation=w,Object.defineProperty(e,`UniverSheetsThreadCommentUIPlugin`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,`UniverThreadCommentUIPlugin`,{enumerable:!0,get:function(){return i.UniverThreadCommentUIPlugin}}),Object.defineProperty(e,`UpdateCommentCommand`,{enumerable:!0,get:function(){return u.UpdateCommentCommand}})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/sheets-thread-comment`),require(`@univerjs/thread-comment-ui`),require(`@univerjs/ui`),require(`@univerjs/sheets-ui`),require(`rxjs`),require(`@univerjs/engine-render`),require(`@univerjs/engine-formula`),require(`@univerjs/thread-comment`),require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/ui`,`@univerjs/sheets-ui`,`rxjs`,`@univerjs/engine-render`,`@univerjs/engine-formula`,`@univerjs/thread-comment`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsThreadCommentUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsThreadComment,e.UniverThreadCommentUi,e.UniverUi,e.UniverSheetsUi,e.rxjs,e.UniverEngineRender,e.UniverEngineFormula,e.UniverThreadComment,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let p=`univer.sheet.thread-comment-modal`,m=`univer.sheet.thread-comment-panel`,h=`SHEET_THREAD_COMMENT_UI_PLUGIN`;function g(e){"@babel/helpers - typeof";return g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g(e)}function _(e,t){if(g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v(e){var t=_(e,`string`);return g(t)==`symbol`?t:t+``}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(n,r){t(n,r,e)}}function x(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let S=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t,n){super(),this._canvasPopupManagerService=e,this._zenZoneService=t,this._cellPopupManagerService=n,y(this,`_lastPopup`,null),y(this,`_activePopup`,void 0),y(this,`_activePopup$`,new s.BehaviorSubject(null)),y(this,`activePopup$`,this._activePopup$.asObservable()),this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var r;let{row:i,col:a,unitId:o,subUnitId:s}=e;if(this._activePopup&&i===this._activePopup.row&&a===this._activePopup.col&&o===this._activePopup.unitId&&s===((r=this.activePopup)==null?void 0:r.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=e,this._activePopup$.next(e);let c=this._cellPopupManagerService.showPopup({row:i,col:a,unitId:o,subUnitId:s},{componentKey:p,onClickOutside:()=>{this.hidePopup()},direction:`horizontal`,excludeOutside:[...Array.from(document.querySelectorAll(`.univer-thread-comment`)),document.getElementById(`thread-comment-add`)].filter(Boolean),priority:2});if(!c)throw Error(`[SheetsThreadCommentPopupService]: cannot show popup!`);let l=new t.DisposableCollection;l.add(c),l.add({dispose:()=>{n==null||n()}}),this._lastPopup=l}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};S=x([b(0,(0,t.Inject)(o.SheetCanvasPopManagerService)),b(1,a.IZenZoneService),b(2,(0,t.Inject)(o.CellPopupManagerService))],S);let C={type:t.CommandType.OPERATION,id:`sheet.operation.show-comment-modal`,handler(e){var a;let o=e.get(n.SheetsSelectionsService),s=e.get(t.IUniverInstanceService),c=e.get(S),l=e.get(i.ThreadCommentPanelService),u=(a=o.getCurrentLastSelection())==null?void 0:a.primary,d=e.get(r.SheetsThreadCommentModel);if(!u)return!1;let f=(0,n.getSheetCommandTarget)(s);if(!f)return!1;let{workbook:p,worksheet:m,unitId:h,subUnitId:g}=f,_={workbook:p,worksheet:m,unitId:h,subUnitId:g,row:u.startRow,col:u.startColumn};c.showPopup(_);let v=d.getByLocation(h,g,u.startRow,u.startColumn);return v&&l.setActiveComment({unitId:h,subUnitId:g,commentId:v,trigger:`context-menu`}),!0}},w={id:`sheet.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){let t=e.get(a.ISidebarService),n=e.get(i.ThreadCommentPanelService);return n.panelVisible?(t.close(),n.setPanelVisible(!1)):(t.open({header:{title:`threadCommentUI.panel.title`},children:{label:m},width:360}),n.setPanelVisible(!0)),!0}};var T=`@univerjs/sheets-thread-comment-ui`,E=`0.21.1`;let D=`sheets-thread-comment.config`;Symbol(D);let O={},k=class extends t.Disposable{constructor(e,t,n,r){super(),this._sheetInterceptorService=e,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=r,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(n.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t;return this._sheetsThreadCommentModel.showCommentMarker(a,o,r,i)?((!e||e===t.rawData)&&(e={...t.rawData}),e.markers={...e==null?void 0:e.markers,tr:{color:`#FFBD37`,size:6}},n(e)):n(e)},priority:100}))}_initSkeletonChange(){let e=()=>{var e;let n=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=n.getUnitId(),i=this._renderManagerService.getRenderById(r);i==null||(e=i.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe((0,s.debounceTime)(16)).subscribe(()=>{e()}))}};k=x([b(0,(0,t.Inject)(n.SheetInterceptorService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,t.IUniverInstanceService),b(3,c.IRenderManagerService)],k);let A=(e,t,n)=>{let r=(0,l.singleReferenceToGrid)(e),i=n.row-t.row,a=n.column-t.column;return(0,l.serializeRange)({startColumn:r.column+a,startRow:r.row+i,endColumn:r.column+a,endRow:r.row+i})},j=class extends t.Disposable{constructor(e,t,n){super(),this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._threadCommentDataSourceService=n,y(this,`_copyInfo`,void 0),this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:h,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,n,r,i)=>{let{unitId:a,subUnitId:s,range:c}=n,l={row:c.rows[0],column:c.cols[0]};if(i.copyType===o.COPY_TYPE.CUT&&this._copyInfo){let{range:e,unitId:n,subUnitId:r}=this._copyInfo,i={row:e.startRow,column:e.startColumn};if(!(a===n&&s===r)){let o=[];t.Range.foreach(e,(e,t)=>{let i=this._sheetsThreadCommentModel.getAllByLocation(n,r,e,t);this._threadCommentDataSourceService.syncUpdateMutationToColla?i.forEach(e=>{o.push(e)}):i.forEach(({children:e,...t})=>{t.parentId||o.push(t)})});let c=[],d=[],f=[],p=[],m=e=>{c.unshift({id:u.DeleteCommentMutation.id,params:{unitId:n,subUnitId:r,commentId:e.id}}),f.push({id:u.AddCommentMutation.id,params:{unitId:a,subUnitId:s,comment:{...e,ref:A(e.ref,i,l),unitId:a,subUnitId:s},sync:!0}}),d.push({id:u.AddCommentMutation.id,params:{unitId:n,subUnitId:r,comment:e,sync:!0}}),p.unshift({id:u.DeleteCommentMutation.id,params:{unitId:a,subUnitId:s,commentId:e.id}})};return o.forEach(e=>{m(e)}),{redos:[...c,...f],undos:[...p,...d]}}}return{redos:[],undos:[]}}}))}};j=x([b(0,(0,t.Inject)(o.ISheetClipboardService)),b(1,(0,t.Inject)(r.SheetsThreadCommentModel)),b(2,u.IThreadCommentDataSourceService)],j);let M=class extends t.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionCheckController=r,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0,s.debounceTime)(100)).subscribe(e=>{let t=this._sheetsThreadCommentPopupService.activePopup;if(e&&(t&&t.temp||!t)){let{location:r}=e,{unitId:i,subUnitId:a,row:o,col:s}=r,c=this._sheetsThreadCommentModel.getByLocation(i,a,o,s);if(c){if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}],i,a))return;let e=this._sheetsThreadCommentModel.getComment(i,a,c);e&&!e.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};M=x([b(0,(0,t.Inject)(o.HoverManagerService)),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(n.SheetPermissionCheckController))],M);let N=class extends t.Disposable{constructor(e,t,n,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._sheetsThreadCommentModel=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{let{id:t}=e;if(t===C.id||t===w.id)this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`));else if(t===u.AddCommentCommand.id){let{unitId:t,subUnitId:r,comment:i}=e.params,{row:a,column:o}=(0,l.singleReferenceToGrid)(i.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}else if(t===u.UpdateCommentCommand.id){let{unitId:t,subUnitId:r,payload:i}=e.params,{commentId:a}=i,o=this._sheetsThreadCommentModel.getComment(t,r,a);if(o){let{row:e,column:i}=(0,l.singleReferenceToGrid)(o.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}}else if(t===u.ResolveCommentCommand.id||t===u.DeleteCommentCommand.id||t===u.DeleteCommentTreeCommand.id){let{unitId:t,subUnitId:r,commentId:i}=e.params,a=this._sheetsThreadCommentModel.getComment(t,r,i);if(a){let{row:e,column:i}=(0,l.singleReferenceToGrid)(a.ref);this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:e,startColumn:i,endRow:e,endColumn:i}],t,r)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.commentErr`))}}}))}};N=x([b(0,(0,t.Inject)(t.LocaleService)),b(1,t.ICommandService),b(2,(0,t.Inject)(n.SheetPermissionCheckController)),b(3,(0,t.Inject)(r.SheetsThreadCommentModel))],N);let P=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._commandService=e,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._threadCommentPanelService=r,this._univerInstanceService=i,this._sheetPermissionCheckController=a,this._markSelectionService=o,this._sheetSelectionService=s,this._editorBridgeService=c,this._renderManagerService=l,y(this,`_isSwitchToCommenting`,!1),y(this,`_selectionShapeInfo`,null),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(e,n,r){var a,s,c;let l=(a=e[0])==null?void 0:a.range,u=this._renderManagerService.getRenderById(n),d=u==null||(s=u.with(o.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:s.skeleton;if(!d||!l)return;let f=d.getCellWithCoordByIndex(l.startRow,l.startColumn);if((((c=l.rangeType)==null?t.RANGE_TYPE.NORMAL:c)!==t.RANGE_TYPE.NORMAL||l.endColumn-l.startColumn>0||l.endRow-l.startRow>0)&&!((f.isMerged||f.isMergedMainCell)&&t.Rectangle.equals(f.mergeInfo,l))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let p=f.actualRow,m=f.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,r,p,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(i.SetActiveCommentOperation.id);return}let h=this._sheetsThreadCommentModel.getByLocation(n,r,p,m);h&&this._commandService.executeCommand(i.SetActiveCommentOperation.id,{unitId:n,subUnitId:r,commentId:h})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchToCommenting)return;let t=this._sheetSelectionService.currentSelectionParam;t&&this._handleSelectionChange(e,t.unitId,t.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(e=>{if(e.id===u.DeleteCommentMutation.id){let t=e.params,n=this._sheetsThreadCommentPopupService.activePopup;if(!n)return;let{unitId:r,subUnitId:i,commentId:a}=n;t.unitId===r&&t.subUnitId===i&&t.commentId===a&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async e=>{if(e){var r;let{unitId:i,subUnitId:a,commentId:s,trigger:c}=e,u=this._sheetsThreadCommentModel.getComment(i,a,s);if(!u||u.resolved)return;let d=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!d||d.getUnitId()!==i)return;this._isSwitchToCommenting=!0,((r=d.getActiveSheet())==null?void 0:r.getSheetId())!==a&&await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:i,subUnitId:a}),this._isSwitchToCommenting=!1;let f=(0,l.singleReferenceToGrid)(u.ref),{row:p,column:m}=f;if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:p,startColumn:m,endRow:p,endColumn:m}],i,a)||(await this._commandService.executeCommand(o.ScrollToRangeOperation.id,{range:{startRow:Math.max(f.row-1,0),endRow:f.row+1,startColumn:Math.max(f.column-1,0),endColumn:f.column+1}}),this._editorBridgeService.isVisible().visible))return;this._sheetsThreadCommentPopupService.showPopup({unitId:i,subUnitId:a,row:f.row,col:f.column,commentId:u.id,trigger:c})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe((0,s.debounceTime)(100)).subscribe(e=>{var n,r;if(!e){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}let{unitId:i,subUnitId:a,commentId:o}=e;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);let s=this._sheetsThreadCommentModel.getComment(i,a,o);if(!s)return;let{row:c,column:u}=(0,l.singleReferenceToGrid)(s.ref);if(Number.isNaN(c)||Number.isNaN(u))return null;let d=(n=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getSheetBySheetId(a),f=(r=d==null?void 0:d.getMergedCell(c,u))==null?{startColumn:u,endColumn:u,startRow:c,endRow:c}:r,p=this._markSelectionService.addShape({range:f,style:{fill:`rgba(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1);p&&(this._selectionShapeInfo={...e,shapeId:p})}))}};P=x([b(0,t.ICommandService),b(1,(0,t.Inject)(S)),b(2,(0,t.Inject)(r.SheetsThreadCommentModel)),b(3,(0,t.Inject)(i.ThreadCommentPanelService)),b(4,t.IUniverInstanceService),b(5,(0,t.Inject)(n.SheetPermissionCheckController)),b(6,o.IMarkSelectionService),b(7,(0,t.Inject)(n.SheetsSelectionsService)),b(8,o.IEditorBridgeService),b(9,c.IRenderManagerService)],P);function F({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,d.useRef)(`_${z()}`);return I(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function I(e,t,n,r,i){return(0,d.createElement)(e.tag,{key:t,...L(e,n,i),...r},(R(e,n).children||[]).map((r,a)=>I(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function L(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function R(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function z(){return Math.random().toString(36).substring(2,8)}F.displayName=`UniverIcon`;let B={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,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.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.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.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M11.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`}},{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`}}]},V=(0,d.forwardRef)(function(e,t){return(0,d.createElement)(F,Object.assign({},e,{id:`comment-icon`,ref:t,icon:B}))});V.displayName=`CommentIcon`;let H=e=>({id:C.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,title:`sheetThreadComment.menu.addComment`,hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]})}),U=e=>({id:w.id,type:a.MenuItemType.BUTTON,icon:`CommentIcon`,tooltip:`sheetThreadComment.menu.commentManagement`,disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]}),hidden$:(0,a.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET)}),W={id:C.id,binding:a.KeyCode.M|a.MetaKeys.CTRL_COMMAND|a.MetaKeys.ALT,preconditions:o.whenSheetEditorFocused},G={[a.RibbonInsertGroup.MEDIA]:{[w.id]:{order:2,menuItemFactory:U}},[a.ContextMenuPosition.MAIN_AREA]:{[a.ContextMenuGroup.OTHERS]:{[C.id]:{order:0,menuItemFactory:H}}}},K=()=>{let e=(0,a.useDependency)(t.IUniverInstanceService),n=(0,a.useDependency)(S),o=(0,a.useObservable)(n.activePopup$),s=(0,a.useDependency)(r.SheetsThreadCommentModel);if((0,a.useObservable)(s.commentUpdate$),!o)return null;let{row:c,col:l,unitId:u,subUnitId:d,trigger:p}=o,m=s.getByLocation(u,d,c,l),h=`${t.Tools.chatAtABC(l)}${c+1}`;return(0,f.jsx)(i.ThreadCommentTree,{onClick:()=>{n.persistPopup()},location:i.ThreadCommentTreeLocation.CELL,id:m,unitId:u,subUnitId:d,type:t.UniverInstanceType.UNIVER_SHEET,refStr:h,onClose:()=>{n.hidePopup()},getSubUnitName:n=>{var r,i;return(r=(i=e.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET))==null||(i=i.getSheetBySheetId(n))==null?void 0:i.getName())==null?``:r},autoFocus:p===`context-menu`})},q=()=>{var e;let n=(0,a.useDependency)(o.IMarkSelectionService),r=(0,a.useDependency)(t.IUniverInstanceService),c=(0,a.useDependency)(S),u=r.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET),p=u.getUnitId(),m=(0,a.useDependency)(t.ICommandService),h=(0,d.useMemo)(()=>u.activeSheet$.pipe((0,s.map)(e=>e==null?void 0:e.getSheetId())),[u.activeSheet$]),g=(0,a.useObservable)(h,(e=u.getActiveSheet())==null?void 0:e.getSheetId()),_=(0,d.useRef)(null),v=(0,a.useDependency)(i.ThreadCommentPanelService),y=(0,a.useObservable)(v.activeCommentId$),b=(0,a.useObservable)(v.panelVisible$,v.panelVisible),x=(0,d.useCallback)(e=>{let t=u.getSheets(),n={};t.forEach((e,t)=>{n[e.getSheetId()]=t});let r=e=>e.map(e=>{var t;let r=(0,l.singleReferenceToGrid)(e.ref),i=[(t=n[e.subUnitId])==null?0:t,r.row,r.column];return{...e,p:i}}).sort((e,t)=>e.p[0]===t.p[0]?e.p[1]===t.p[1]?e.p[2]-t.p[2]:e.p[1]-t.p[1]:e.p[0]-t.p[0]);return[...r(e.filter(e=>!e.resolved)),...r(e.filter(e=>e.resolved))]},[u]),w=(0,d.useCallback)(e=>{if(e.unitId===p&&e.subUnitId===g&&!e.resolved){var t;let{row:r,column:i}=(0,l.singleReferenceToGrid)(e.ref),a=u.getSheetBySheetId(e.subUnitId),o=(t=a==null?void 0:a.getMergedCell(r,i))==null?{startColumn:i,endColumn:i,startRow:r,endRow:r}:t;if(!Number.isNaN(r)&&!Number.isNaN(i))return n.addShape({range:o,style:{fill:`rgb(255, 189, 55, 0.35)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null})}return null},[n,g,p]),T=e=>{var t,n;return(t=(n=u.getSheetBySheetId(e))==null?void 0:n.getName())==null?``:t},E=()=>{m.executeCommand(C.id)},D=e=>{y&&y.unitId===e.unitId&&y.subUnitId===e.subUnitId&&y.commentId===e.id||(_.current&&(n.removeShape(_.current),_.current=null),_.current=w(e))},O=()=>{_.current&&(n.removeShape(_.current),_.current=null)};return(0,d.useEffect)(()=>{!b&&_.current&&n.removeShape(_.current)},[n,b]),(0,f.jsx)(i.ThreadCommentPanel,{unitId:p,subUnitId$:h,type:t.UniverInstanceType.UNIVER_SHEET,onAdd:E,getSubUnitName:T,onResolve:(e,t)=>{t&&c.hidePopup()},sortComments:x,onItemEnter:D,onItemLeave:O,onDeleteComment:()=>(O(),!0)})},J=class extends t.Disposable{constructor(e,t,n){super(),this._menuManagerService=e,this._componentManager=t,this._shortcutService=n,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(W)}_initMenu(){this._menuManagerService.mergeMenu(G)}_initComponent(){[[p,K],[m,q],[`CommentIcon`,V]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};J=x([b(0,a.IMenuManagerService),b(1,(0,t.Inject)(a.ComponentManager)),b(2,a.IShortcutService)],J);let Y=class extends t.Plugin{constructor(e=O,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},O,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(D,o)}onStarting(){[[J],[k],[j],[M],[P],[S],[N]].forEach(e=>{this._injector.add(e)}),[C,w].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(J)}onReady(){this._injector.get(k)}onRendered(){this._injector.get(j),this._injector.get(M),this._injector.get(P),this._injector.get(N)}};y(Y,`pluginName`,h),y(Y,`packageName`,T),y(Y,`version`,E),y(Y,`type`,t.UniverInstanceType.UNIVER_SHEET),Y=x([(0,t.DependentOn)(i.UniverThreadCommentUIPlugin,r.UniverSheetsThreadCommentPlugin),b(1,(0,t.Inject)(t.Injector)),b(2,(0,t.Inject)(t.ICommandService)),b(3,t.IConfigService)],Y),Object.defineProperty(e,`AddCommentCommand`,{enumerable:!0,get:function(){return u.AddCommentCommand}}),Object.defineProperty(e,`DeleteCommentCommand`,{enumerable:!0,get:function(){return u.DeleteCommentCommand}}),Object.defineProperty(e,`DeleteCommentTreeCommand`,{enumerable:!0,get:function(){return u.DeleteCommentTreeCommand}}),Object.defineProperty(e,`IThreadCommentDataSourceService`,{enumerable:!0,get:function(){return u.IThreadCommentDataSourceService}}),Object.defineProperty(e,`ResolveCommentCommand`,{enumerable:!0,get:function(){return u.ResolveCommentCommand}}),Object.defineProperty(e,`SheetsThreadCommentPopupService`,{enumerable:!0,get:function(){return S}}),e.ShowAddSheetCommentModalOperation=C,e.ToggleSheetCommentPanelOperation=w,Object.defineProperty(e,`UniverSheetsThreadCommentUIPlugin`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,`UniverThreadCommentUIPlugin`,{enumerable:!0,get:function(){return i.UniverThreadCommentUIPlugin}}),Object.defineProperty(e,`UpdateCommentCommand`,{enumerable:!0,get:function(){return u.UpdateCommentCommand}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-thread-comment-ui",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer thread comment plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@univerjs/icons": "^1.1.1",
|
|
56
|
-
"@univerjs/core": "0.21.
|
|
57
|
-
"@univerjs/
|
|
58
|
-
"@univerjs/engine-render": "0.21.
|
|
59
|
-
"@univerjs/sheets-thread-comment": "0.21.
|
|
60
|
-
"@univerjs/
|
|
61
|
-
"@univerjs/
|
|
62
|
-
"@univerjs/
|
|
63
|
-
"@univerjs/
|
|
64
|
-
"@univerjs/
|
|
56
|
+
"@univerjs/core": "0.21.1",
|
|
57
|
+
"@univerjs/sheets": "0.21.1",
|
|
58
|
+
"@univerjs/engine-render": "0.21.1",
|
|
59
|
+
"@univerjs/sheets-thread-comment": "0.21.1",
|
|
60
|
+
"@univerjs/sheets-ui": "0.21.1",
|
|
61
|
+
"@univerjs/engine-formula": "0.21.1",
|
|
62
|
+
"@univerjs/thread-comment": "0.21.1",
|
|
63
|
+
"@univerjs/ui": "0.21.1",
|
|
64
|
+
"@univerjs/thread-comment-ui": "0.21.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"postcss": "^8.5.10",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"tailwindcss": "3.4.18",
|
|
71
71
|
"typescript": "^6.0.2",
|
|
72
72
|
"vitest": "^4.1.4",
|
|
73
|
-
"@univerjs-infra/shared": "0.21.
|
|
73
|
+
"@univerjs-infra/shared": "0.21.1"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"test": "vitest run",
|