@univerjs/sheets-thread-comment-ui 0.17.0 → 0.18.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/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -828
- package/lib/es/locale/ca-ES.js +1 -11
- package/lib/es/locale/en-US.js +1 -11
- package/lib/es/locale/es-ES.js +1 -11
- package/lib/es/locale/fa-IR.js +1 -11
- package/lib/es/locale/fr-FR.js +1 -11
- package/lib/es/locale/ja-JP.js +1 -11
- package/lib/es/locale/ko-KR.js +1 -11
- package/lib/es/locale/ru-RU.js +1 -11
- package/lib/es/locale/sk-SK.js +1 -11
- package/lib/es/locale/vi-VN.js +1 -11
- package/lib/es/locale/zh-CN.js +1 -11
- package/lib/es/locale/zh-TW.js +1 -11
- package/lib/index.css +1 -0
- package/lib/index.js +1 -828
- package/lib/locale/ca-ES.js +1 -11
- package/lib/locale/en-US.js +1 -11
- package/lib/locale/es-ES.js +1 -11
- package/lib/locale/fa-IR.js +1 -11
- package/lib/locale/fr-FR.js +1 -11
- package/lib/locale/ja-JP.js +1 -11
- package/lib/locale/ko-KR.js +1 -11
- package/lib/locale/ru-RU.js +1 -11
- package/lib/locale/sk-SK.js +1 -11
- package/lib/locale/vi-VN.js +1 -11
- package/lib/locale/zh-CN.js +1 -11
- package/lib/locale/zh-TW.js +1 -11
- package/lib/types/commands/operations/comment.operation.d.ts +16 -1
- package/lib/types/config/config.d.ts +17 -2
- package/lib/types/controllers/render-controllers/render.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-thread-comment-copy-paste.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-thread-comment-hover.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-thread-comment-popup.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-thread-comment.controller.d.ts +15 -0
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/menu.d.ts +22 -6
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/sheets-thread-comment-popup.service.d.ts +19 -3
- package/lib/types/types/interfaces/i-sheet-thread-comment.d.ts +16 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +15 -14
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IThreadComment } from '@univerjs/thread-comment';
|
|
2
17
|
export interface ISheetThreadComment extends IThreadComment {
|
|
3
18
|
row: number;
|
|
4
19
|
column: number;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/sheets-ui"),require("@univerjs/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/sheets-ui","@univerjs/ui","rxjs","@univerjs/engine-render","@univerjs/engine-formula","@univerjs/thread-comment","react","react/jsx-runtime"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.UniverSheetsThreadCommentUi={},c.UniverCore,c.UniverSheets,c.UniverSheetsThreadComment,c.UniverThreadCommentUi,c.UniverSheetsUi,c.UniverUi,c.rxjs,c.UniverEngineRender,c.UniverEngineFormula,c.UniverThreadComment,c.React,c.React))})(this,(function(c,a,v,D,I,g,h,V,ee,N,b,O,te){"use strict";var Ve=Object.defineProperty;var He=(c,a,v)=>a in c?Ve(c,a,{enumerable:!0,configurable:!0,writable:!0,value:v}):c[a]=v;var k=(c,a,v)=>He(c,typeof a!="symbol"?a+"":a,v);const ne="univer.sheet.thread-comment-modal",z="SHEET_THREAD_COMMENT";var me=Object.getOwnPropertyDescriptor,de=(r,t,n,e)=>{for(var i=e>1?void 0:e?me(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},K=(r,t)=>(n,e)=>t(n,e,r);c.SheetsThreadCommentPopupService=class extends a.Disposable{constructor(n,e,i){super();k(this,"_lastPopup",null);k(this,"_activePopup");k(this,"_activePopup$",new V.BehaviorSubject(null));k(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=n,this._zenZoneService=e,this._cellPopupManagerService=i,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}dispose(){super.dispose(),this.hidePopup()}showPopup(n,e){var p;const{row:i,col:o,unitId:s,subUnitId:m}=n;if(this._activePopup&&i===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&m===((p=this.activePopup)==null?void 0:p.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._cellPopupManagerService.showPopup({row:i,col:o,unitId:s,subUnitId:m},{componentKey:ne,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean),priority:2});if(!d)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const u=new a.DisposableCollection;u.add(d),u.add({dispose:()=>{e==null||e()}}),this._lastPopup=u}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},c.SheetsThreadCommentPopupService=de([K(0,a.Inject(g.SheetCanvasPopManagerService)),K(1,h.IZenZoneService),K(2,a.Inject(g.CellPopupManagerService))],c.SheetsThreadCommentPopupService);const A={type:a.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(r){var f;const t=r.get(v.SheetsSelectionsService),n=r.get(a.IUniverInstanceService),e=r.get(c.SheetsThreadCommentPopupService),i=r.get(I.ThreadCommentPanelService),o=(f=t.getCurrentLastSelection())==null?void 0:f.primary,s=r.get(D.SheetsThreadCommentModel);if(!o)return!1;const m=v.getSheetCommandTarget(n);if(!m)return!1;const{workbook:d,worksheet:u,unitId:p,subUnitId:l}=m,_={workbook:d,worksheet:u,unitId:p,subUnitId:l,row:o.startRow,col:o.startColumn};e.showPopup(_);const C=s.getByLocation(p,l,o.startRow,o.startColumn);return C&&i.setActiveComment({unitId:p,subUnitId:l,commentId:C,trigger:"context-menu"}),!0}},re={name:"@univerjs/sheets-thread-comment-ui",version:"0.17.0"},ue="sheets-thread-comment.config",ie={};var he=Object.getOwnPropertyDescriptor,le=(r,t,n,e)=>{for(var i=e>1?void 0:e?he(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},B=(r,t)=>(n,e)=>t(n,e,r);let L=class extends a.Disposable{constructor(r,t,n,e){super(),this._sheetInterceptorService=r,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(v.INTERCEPTOR_POINT.CELL_CONTENT,{effect:a.InterceptorEffectEnum.Style,handler:(r,t,n)=>{const{row:e,col:i,unitId:o,subUnitId:s}=t;return this._sheetsThreadCommentModel.showCommentMarker(o,s,e,i)&&((!r||r===t.rawData)&&(r={...t.rawData}),r.markers={...r==null?void 0:r.markers,tr:{color:"#FFBD37",size:6}}),n(r)},priority:100}))}_initSkeletonChange(){const r=()=>{var i;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!t)return;const n=t.getUnitId(),e=this._renderManagerService.getRenderById(n);(i=e==null?void 0:e.mainComponent)==null||i.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(V.debounceTime(16)).subscribe(()=>{r()}))}};L=le([B(0,a.Inject(v.SheetInterceptorService)),B(1,a.Inject(D.SheetsThreadCommentModel)),B(2,a.IUniverInstanceService),B(3,ee.IRenderManagerService)],L);var pe=Object.getOwnPropertyDescriptor,ve=(r,t,n,e)=>{for(var i=e>1?void 0:e?pe(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},Y=(r,t)=>(n,e)=>t(n,e,r);const Se=(r,t,n)=>{const e=N.singleReferenceToGrid(r),i=n.row-t.row,o=n.column-t.column,s={startColumn:e.column+o,startRow:e.row+i,endColumn:e.column+o,endRow:e.row+i};return N.serializeRange(s)};let W=class extends a.Disposable{constructor(t,n,e){super();k(this,"_copyInfo");this._sheetClipboardService=t,this._sheetsThreadCommentModel=n,this._threadCommentDataSourceService=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:z,onBeforeCopy:(t,n,e)=>{this._copyInfo={unitId:t,subUnitId:n,range:e}},onPasteCells:(t,n,e,i)=>{const{unitId:o,subUnitId:s,range:m}=n,d={row:m.rows[0],column:m.cols[0]};if(i.copyType===g.COPY_TYPE.CUT&&this._copyInfo){const{range:u,unitId:p,subUnitId:l}=this._copyInfo,_={row:u.startRow,column:u.startColumn};if(!(o===p&&s===l)){const C=[];a.Range.foreach(u,(y,S)=>{const w=this._sheetsThreadCommentModel.getAllByLocation(p,l,y,S);this._threadCommentDataSourceService.syncUpdateMutationToColla?w.forEach(P=>{C.push(P)}):w.forEach(({children:P,...R})=>{R.parentId||C.push(R)})});const f=[],M=[],$=[],H=[],X=y=>{f.unshift({id:b.DeleteCommentMutation.id,params:{unitId:p,subUnitId:l,commentId:y.id}}),$.push({id:b.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...y,ref:Se(y.ref,_,d),unitId:o,subUnitId:s},sync:!0}}),M.push({id:b.AddCommentMutation.id,params:{unitId:p,subUnitId:l,comment:y,sync:!0}}),H.unshift({id:b.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:y.id}})};return C.forEach(y=>{X(y)}),{redos:[...f,...$],undos:[...H,...M]}}}return{redos:[],undos:[]}}}))}};W=ve([Y(0,a.Inject(g.ISheetClipboardService)),Y(1,a.Inject(D.SheetsThreadCommentModel)),Y(2,b.IThreadCommentDataSourceService)],W);var Ce=Object.getOwnPropertyDescriptor,_e=(r,t,n,e)=>{for(var i=e>1?void 0:e?Ce(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},F=(r,t)=>(n,e)=>t(n,e,r);let x=class extends a.Disposable{constructor(r,t,n,e){super(),this._hoverManagerService=r,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionCheckController=e,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(V.debounceTime(100)).subscribe(r=>{const t=this._sheetsThreadCommentPopupService.activePopup;if(r&&(t&&t.temp||!t)){const{location:n}=r,{unitId:e,subUnitId:i,row:o,col:s}=n,m=this._sheetsThreadCommentModel.getByLocation(e,i,o,s);if(m){if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}],e,i))return;const u=this._sheetsThreadCommentModel.getComment(e,i,m);u&&!u.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:i,row:o,col:s,commentId:m,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};x=_e([F(0,a.Inject(g.HoverManagerService)),F(1,a.Inject(c.SheetsThreadCommentPopupService)),F(2,a.Inject(D.SheetsThreadCommentModel)),F(3,a.Inject(v.SheetPermissionCheckController))],x);var fe=Object.getOwnPropertyDescriptor,Ie=(r,t,n,e)=>{for(var i=e>1?void 0:e?fe(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},U=(r,t)=>(n,e)=>t(n,e,r);let Z=class extends a.Disposable{constructor(t,n,e,i,o,s,m,d,u,p){super();k(this,"_isSwitchToCommenting",!1);k(this,"_selectionShapeInfo",null);this._commandService=t,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._threadCommentPanelService=i,this._univerInstanceService=o,this._sheetPermissionCheckController=s,this._markSelectionService=m,this._sheetSelectionService=d,this._editorBridgeService=u,this._renderManagerService=p,this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(t,n,e){var _,C,f;const i=(_=t[0])==null?void 0:_.range,o=this._renderManagerService.getRenderById(n),s=(C=o==null?void 0:o.with(g.SheetSkeletonManagerService).getSkeletonParam(e))==null?void 0:C.skeleton;if(!s||!i)return;const m=s.getCellWithCoordByIndex(i.startRow,i.startColumn);if((((f=i.rangeType)!=null?f:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||i.endColumn-i.startColumn>0||i.endRow-i.startRow>0)&&!((m.isMerged||m.isMergedMainCell)&&a.Rectangle.equals(m.mergeInfo,i))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(I.SetActiveCommentOperation.id);return}const u=m.actualRow,p=m.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,e,u,p)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(I.SetActiveCommentOperation.id);return}const l=this._sheetsThreadCommentModel.getByLocation(n,e,u,p);l&&this._commandService.executeCommand(I.SetActiveCommentOperation.id,{unitId:n,subUnitId:e,commentId:l})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(t=>{if(this._isSwitchToCommenting)return;const n=this._sheetSelectionService.currentSelectionParam;n&&this._handleSelectionChange(t,n.unitId,n.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(t=>{t.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(t=>{if(t.id===b.DeleteCommentMutation.id){const n=t.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:i,subUnitId:o,commentId:s}=e;n.unitId===i&&n.subUnitId===o&&n.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async t=>{var n;if(t){const{unitId:e,subUnitId:i,commentId:o,trigger:s}=t,m=this._sheetsThreadCommentModel.getComment(e,i,o);if(!m||m.resolved)return;const d=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!d||d.getUnitId()!==e)return;this._isSwitchToCommenting=!0,((n=d.getActiveSheet())==null?void 0:n.getSheetId())!==i&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:i}),this._isSwitchToCommenting=!1;const l=N.singleReferenceToGrid(m.ref),{row:_,column:C}=l;if(!this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:_,startColumn:C,endRow:_,endColumn:C}],e,i))return;const M=1;if(await this._commandService.executeCommand(g.ScrollToRangeOperation.id,{range:{startRow:Math.max(l.row-M,0),endRow:l.row+M,startColumn:Math.max(l.column-M,0),endColumn:l.column+M}}),this._editorBridgeService.isVisible().visible)return;this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:i,row:l.row,col:l.column,commentId:m.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(V.debounceTime(100)).subscribe(t=>{var _,C;if(!t){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:n,subUnitId:e,commentId:i}=t;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);const o=this._sheetsThreadCommentModel.getComment(n,e,i);if(!o)return;const s=N.singleReferenceToGrid(o.ref),{row:m,column:d}=s;if(Number.isNaN(m)||Number.isNaN(d))return null;const u=(_=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getSheetBySheetId(e),p=(C=u==null?void 0:u.getMergedCell(m,d))!=null?C:{startColumn:d,endColumn:d,startRow:m,endRow:m},l=this._markSelectionService.addShape({range:p,style:{fill:"rgba(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1);l&&(this._selectionShapeInfo={...t,shapeId:l})}))}};Z=Ie([U(0,a.ICommandService),U(1,a.Inject(c.SheetsThreadCommentPopupService)),U(2,a.Inject(D.SheetsThreadCommentModel)),U(3,a.Inject(I.ThreadCommentPanelService)),U(4,a.IUniverInstanceService),U(5,a.Inject(v.SheetPermissionCheckController)),U(6,g.IMarkSelectionService),U(7,a.Inject(v.SheetsSelectionsService)),U(8,g.IEditorBridgeService),U(9,ee.IRenderManagerService)],Z);function oe({ref:r,...t}){const{icon:n,id:e,className:i,extend:o,...s}=t,m=`univerjs-icon univerjs-icon-${e} ${i||""}`.trim(),d=O.useRef(`_${Te()}`);return se(n,`${e}`,{defIds:n.defIds,idSuffix:d.current},{ref:r,className:m,...s},o)}function se(r,t,n,e,i){return O.createElement(r.tag,{key:t,...ge(r,n,i),...e},(Pe(r,n).children||[]).map((o,s)=>se(o,`${t}-${r.tag}-${s}`,n,void 0,i)))}function ge(r,t,n){const e={...r.attrs};n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1),r.tag==="mask"&&e.id&&(e.id=e.id+t.idSuffix),Object.entries(e).forEach(([o,s])=>{o==="mask"&&typeof s=="string"&&(e[o]=s.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});const{defIds:i}=t;return!i||i.length===0||(r.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+t.idSuffix),Object.entries(e).forEach(([o,s])=>{typeof s=="string"&&(e[o]=s.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),e}function Pe(r,t){var e;const{defIds:n}=t;return!n||n.length===0?r:r.tag==="defs"&&((e=r.children)!=null&&e.length)?{...r,children:r.children.map(i=>typeof i.attrs.id=="string"&&n&&n.includes(i.attrs.id)?{...i,attrs:{...i.attrs,id:i.attrs.id+t.idSuffix}}:i)}:r}function Te(){return Math.random().toString(36).substring(2,8)}oe.displayName="UniverIcon";const be={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"}}]},ae=O.forwardRef(function(t,n){return O.createElement(oe,Object.assign({},t,{id:"comment-icon",ref:n,icon:be}))});ae.displayName="CommentIcon";const Me=r=>({id:A.id,type:h.MenuItemType.BUTTON,icon:"CommentIcon",title:"sheetThreadComment.menu.addComment",hidden$:h.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SHEET),disabled$:g.getCurrentRangeDisable$(r,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]})}),ye=r=>({id:I.ToggleSheetCommentPanelOperation.id,type:h.MenuItemType.BUTTON,icon:"CommentIcon",tooltip:"sheetThreadComment.menu.commentManagement",disabled$:g.getCurrentRangeDisable$(r,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]}),hidden$:h.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SHEET)}),we={id:A.id,binding:h.KeyCode.M|h.MetaKeys.CTRL_COMMAND|h.MetaKeys.ALT,preconditions:g.whenSheetEditorFocused},Ee={[h.RibbonInsertGroup.MEDIA]:{[I.ToggleSheetCommentPanelOperation.id]:{order:2,menuItemFactory:ye}},[h.ContextMenuPosition.MAIN_AREA]:{[h.ContextMenuGroup.OTHERS]:{[A.id]:{order:0,menuItemFactory:Me}}}},Ue=()=>{const r=h.useDependency(a.IUniverInstanceService),t=h.useDependency(c.SheetsThreadCommentPopupService),n=h.useObservable(t.activePopup$),e=h.useDependency(D.SheetsThreadCommentModel);if(h.useObservable(e.commentUpdate$),!n)return null;const{row:i,col:o,unitId:s,subUnitId:m,trigger:d}=n,u=e.getByLocation(s,m,i,o),p=`${a.Tools.chatAtABC(o)}${i+1}`,l=()=>{t.hidePopup()},_=C=>{var f,M,$;return($=(M=(f=r.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:f.getSheetBySheetId(C))==null?void 0:M.getName())!=null?$:""};return te.jsx(I.ThreadCommentTree,{onClick:()=>{t.persistPopup()},prefix:"cell",id:u,unitId:s,subUnitId:m,type:a.UniverInstanceType.UNIVER_SHEET,refStr:p,onClose:l,getSubUnitName:_,autoFocus:d==="context-menu"})},Re=()=>{var y;const r=h.useDependency(g.IMarkSelectionService),t=h.useDependency(a.IUniverInstanceService),n=h.useDependency(c.SheetsThreadCommentPopupService),e=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),i=e.getUnitId(),o=h.useDependency(a.ICommandService),s=O.useMemo(()=>e.activeSheet$.pipe(V.map(S=>S==null?void 0:S.getSheetId())),[e.activeSheet$]),m=h.useObservable(s,(y=e.getActiveSheet())==null?void 0:y.getSheetId()),d=O.useRef(null),u=h.useDependency(I.ThreadCommentPanelService),p=h.useObservable(u.activeCommentId$),l=h.useObservable(u.panelVisible$,u.panelVisible),_=O.useCallback(S=>{const w=e.getSheets(),P={};w.forEach((E,T)=>{P[E.getSheetId()]=T});const R=E=>E.map(T=>{var ce;const j=N.singleReferenceToGrid(T.ref),Ae=[(ce=P[T.subUnitId])!=null?ce:0,j.row,j.column];return{...T,p:Ae}}).sort((T,j)=>T.p[0]===j.p[0]?T.p[1]===j.p[1]?T.p[2]-j.p[2]:T.p[1]-j.p[1]:T.p[0]-j.p[0]);return[...R(S.filter(E=>!E.resolved)),...R(S.filter(E=>E.resolved))]},[e]),C=O.useCallback(S=>{var w;if(S.unitId===i&&S.subUnitId===m&&!S.resolved){const{row:P,column:R}=N.singleReferenceToGrid(S.ref),E=e.getSheetBySheetId(S.subUnitId),T=(w=E==null?void 0:E.getMergedCell(P,R))!=null?w:{startColumn:R,endColumn:R,startRow:P,endRow:P};if(!Number.isNaN(P)&&!Number.isNaN(R))return r.addShape({range:T,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}return null},[r,m,i]),f=S=>{var w,P;return(P=(w=e.getSheetBySheetId(S))==null?void 0:w.getName())!=null?P:""},M=()=>{o.executeCommand(A.id)},$=S=>{p&&p.unitId===S.unitId&&p.subUnitId===S.subUnitId&&p.commentId===S.id||(d.current&&(r.removeShape(d.current),d.current=null),d.current=C(S))},H=()=>{d.current&&(r.removeShape(d.current),d.current=null)},X=(S,w)=>{w&&n.hidePopup()};return O.useEffect(()=>{!l&&d.current&&r.removeShape(d.current)},[r,l]),te.jsx(I.ThreadCommentPanel,{unitId:i,subUnitId$:s,type:a.UniverInstanceType.UNIVER_SHEET,onAdd:M,getSubUnitName:f,onResolve:X,sortComments:_,onItemEnter:$,onItemLeave:H,onDeleteComment:()=>(H(),!0)})};var Oe=Object.getOwnPropertyDescriptor,je=(r,t,n,e)=>{for(var i=e>1?void 0:e?Oe(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},J=(r,t)=>(n,e)=>t(n,e,r);let q=class extends a.Disposable{constructor(r,t,n){super(),this._menuManagerService=r,this._componentManager=t,this._shortcutService=n,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(we)}_initMenu(){this._menuManagerService.mergeMenu(Ee)}_initComponent(){[[ne,Ue],[I.THREAD_COMMENT_PANEL,Re],["CommentIcon",ae]].forEach(([r,t])=>{this.disposeWithMe(this._componentManager.register(r,t))})}};q=je([J(0,h.IMenuManagerService),J(1,a.Inject(h.ComponentManager)),J(2,h.IShortcutService)],q);var ke=Object.defineProperty,De=Object.getOwnPropertyDescriptor,$e=(r,t,n)=>t in r?ke(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,Ne=(r,t,n,e)=>{for(var i=e>1?void 0:e?De(t,n):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},Q=(r,t)=>(n,e)=>t(n,e,r),G=(r,t,n)=>$e(r,typeof t!="symbol"?t+"":t,n);c.UniverSheetsThreadCommentUIPlugin=class extends a.Plugin{constructor(t=ie,n,e,i){super(),this._config=t,this._injector=n,this._commandService=e,this._configService=i;const{menu:o,...s}=a.merge({},ie,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(ue,s)}onStarting(){[[q],[L],[W],[x],[Z],[c.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[A].forEach(t=>{this._commandService.registerCommand(t)}),this._injector.get(q)}onReady(){this._injector.get(L)}onRendered(){this._injector.get(W),this._injector.get(x),this._injector.get(Z)}},G(c.UniverSheetsThreadCommentUIPlugin,"pluginName",z),G(c.UniverSheetsThreadCommentUIPlugin,"packageName",re.name),G(c.UniverSheetsThreadCommentUIPlugin,"version",re.version),G(c.UniverSheetsThreadCommentUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),c.UniverSheetsThreadCommentUIPlugin=Ne([a.DependentOn(I.UniverThreadCommentUIPlugin,D.UniverSheetsThreadCommentPlugin),Q(1,a.Inject(a.Injector)),Q(2,a.Inject(a.ICommandService)),Q(3,a.IConfigService)],c.UniverSheetsThreadCommentUIPlugin),Object.defineProperty(c,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>I.UniverThreadCommentUIPlugin}),Object.defineProperty(c,"AddCommentCommand",{enumerable:!0,get:()=>b.AddCommentCommand}),Object.defineProperty(c,"DeleteCommentCommand",{enumerable:!0,get:()=>b.DeleteCommentCommand}),Object.defineProperty(c,"DeleteCommentTreeCommand",{enumerable:!0,get:()=>b.DeleteCommentTreeCommand}),Object.defineProperty(c,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>b.IThreadCommentDataSourceService}),Object.defineProperty(c,"ResolveCommentCommand",{enumerable:!0,get:()=>b.ResolveCommentCommand}),Object.defineProperty(c,"UpdateCommentCommand",{enumerable:!0,get:()=>b.UpdateCommentCommand}),c.SHEETS_THREAD_COMMENT=z,c.ShowAddSheetCommentModalOperation=A,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|
|
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/sheets-ui`),require(`@univerjs/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/sheets-ui`,`@univerjs/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.UniverSheetsUi,e.UniverUi,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=`SHEET_THREAD_COMMENT`;function h(e){"@babel/helpers - typeof";return h=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},h(e)}function g(e,t){if(h(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(h(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _(e){var t=g(e,`string`);return h(t)==`symbol`?t:t+``}function v(e,t,n){return(t=_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){return function(n,r){t(n,r,e)}}function b(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 x=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t,n){super(),this._canvasPopupManagerService=e,this._zenZoneService=t,this._cellPopupManagerService=n,v(this,`_lastPopup`,null),v(this,`_activePopup`,void 0),v(this,`_activePopup$`,new s.BehaviorSubject(null)),v(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))}};x=b([y(0,(0,t.Inject)(a.SheetCanvasPopManagerService)),y(1,o.IZenZoneService),y(2,(0,t.Inject)(a.CellPopupManagerService))],x);let S={type:t.CommandType.OPERATION,id:`sheets.operation.show-comment-modal`,handler(e){var a;let o=e.get(n.SheetsSelectionsService),s=e.get(t.IUniverInstanceService),c=e.get(x),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}};var C=`@univerjs/sheets-thread-comment-ui`,w=`0.18.0`;let T=`sheets-thread-comment.config`;Symbol(T);let E={},D=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()}))}};D=b([y(0,(0,t.Inject)(n.SheetInterceptorService)),y(1,(0,t.Inject)(r.SheetsThreadCommentModel)),y(2,t.IUniverInstanceService),y(3,c.IRenderManagerService)],D);let O=(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})},k=class extends t.Disposable{constructor(e,t,n){super(),this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._threadCommentDataSourceService=n,v(this,`_copyInfo`,void 0),this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:m,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,n,r,i)=>{let{unitId:o,subUnitId:s,range:c}=n,l={row:c.rows[0],column:c.cols[0]};if(i.copyType===a.COPY_TYPE.CUT&&this._copyInfo){let{range:e,unitId:n,subUnitId:r}=this._copyInfo,i={row:e.startRow,column:e.startColumn};if(!(o===n&&s===r)){let a=[];t.Range.foreach(e,(e,t)=>{let i=this._sheetsThreadCommentModel.getAllByLocation(n,r,e,t);this._threadCommentDataSourceService.syncUpdateMutationToColla?i.forEach(e=>{a.push(e)}):i.forEach(({children:e,...t})=>{t.parentId||a.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:o,subUnitId:s,comment:{...e,ref:O(e.ref,i,l),unitId:o,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:o,subUnitId:s,commentId:e.id}})};return a.forEach(e=>{m(e)}),{redos:[...c,...f],undos:[...p,...d]}}}return{redos:[],undos:[]}}}))}};k=b([y(0,(0,t.Inject)(a.ISheetClipboardService)),y(1,(0,t.Inject)(r.SheetsThreadCommentModel)),y(2,u.IThreadCommentDataSourceService)],k);let A=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()}}))}};A=b([y(0,(0,t.Inject)(a.HoverManagerService)),y(1,(0,t.Inject)(x)),y(2,(0,t.Inject)(r.SheetsThreadCommentModel)),y(3,(0,t.Inject)(n.SheetPermissionCheckController))],A);let j=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,v(this,`_isSwitchToCommenting`,!1),v(this,`_selectionShapeInfo`,null),this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(e,n,r){var o,s,c;let l=(o=e[0])==null?void 0:o.range,u=this._renderManagerService.getRenderById(n),d=u==null||(s=u.with(a.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:o,commentId:s,trigger:c}=e,u=this._sheetsThreadCommentModel.getComment(i,o,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())!==o&&await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:i,subUnitId:o}),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,o)||(await this._commandService.executeCommand(a.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:o,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})}))}};j=b([y(0,t.ICommandService),y(1,(0,t.Inject)(x)),y(2,(0,t.Inject)(r.SheetsThreadCommentModel)),y(3,(0,t.Inject)(i.ThreadCommentPanelService)),y(4,t.IUniverInstanceService),y(5,(0,t.Inject)(n.SheetPermissionCheckController)),y(6,a.IMarkSelectionService),y(7,(0,t.Inject)(n.SheetsSelectionsService)),y(8,a.IEditorBridgeService),y(9,c.IRenderManagerService)],j);function M({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)(`_${I()}`);return N(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function N(e,t,n,r,i){return(0,d.createElement)(e.tag,{key:t,...P(e,n,i),...r},(F(e,n).children||[]).map((r,a)=>N(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function P(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 F(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 I(){return Math.random().toString(36).substring(2,8)}M.displayName=`UniverIcon`;let L={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`}}]},R=(0,d.forwardRef)(function(e,t){return(0,d.createElement)(M,Object.assign({},e,{id:`comment-icon`,ref:t,icon:L}))});R.displayName=`CommentIcon`;let z=e=>({id:S.id,type:o.MenuItemType.BUTTON,icon:`CommentIcon`,title:`sheetThreadComment.menu.addComment`,hidden$:(0,o.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,a.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]})}),B=e=>({id:i.ToggleSheetCommentPanelOperation.id,type:o.MenuItemType.BUTTON,icon:`CommentIcon`,tooltip:`sheetThreadComment.menu.commentManagement`,disabled$:(0,a.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookCommentPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]}),hidden$:(0,o.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET)}),V={id:S.id,binding:o.KeyCode.M|o.MetaKeys.CTRL_COMMAND|o.MetaKeys.ALT,preconditions:a.whenSheetEditorFocused},H={[o.RibbonInsertGroup.MEDIA]:{[i.ToggleSheetCommentPanelOperation.id]:{order:2,menuItemFactory:B}},[o.ContextMenuPosition.MAIN_AREA]:{[o.ContextMenuGroup.OTHERS]:{[S.id]:{order:0,menuItemFactory:z}}}},U=()=>{let e=(0,o.useDependency)(t.IUniverInstanceService),n=(0,o.useDependency)(x),a=(0,o.useObservable)(n.activePopup$),s=(0,o.useDependency)(r.SheetsThreadCommentModel);if((0,o.useObservable)(s.commentUpdate$),!a)return null;let{row:c,col:l,unitId:u,subUnitId:d,trigger:p}=a,m=s.getByLocation(u,d,c,l),h=`${t.Tools.chatAtABC(l)}${c+1}`;return(0,f.jsx)(i.ThreadCommentTree,{onClick:()=>{n.persistPopup()},prefix:`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`})},W=()=>{var e;let n=(0,o.useDependency)(a.IMarkSelectionService),r=(0,o.useDependency)(t.IUniverInstanceService),c=(0,o.useDependency)(x),u=r.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET),p=u.getUnitId(),m=(0,o.useDependency)(t.ICommandService),h=(0,d.useMemo)(()=>u.activeSheet$.pipe((0,s.map)(e=>e==null?void 0:e.getSheetId())),[u.activeSheet$]),g=(0,o.useObservable)(h,(e=u.getActiveSheet())==null?void 0:e.getSheetId()),_=(0,d.useRef)(null),v=(0,o.useDependency)(i.ThreadCommentPanelService),y=(0,o.useObservable)(v.activeCommentId$),b=(0,o.useObservable)(v.panelVisible$,v.panelVisible),C=(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(S.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:C,onItemEnter:D,onItemLeave:O,onDeleteComment:()=>(O(),!0)})},G=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(V)}_initMenu(){this._menuManagerService.mergeMenu(H)}_initComponent(){[[p,U],[i.THREAD_COMMENT_PANEL,W],[`CommentIcon`,R]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};G=b([y(0,o.IMenuManagerService),y(1,(0,t.Inject)(o.ComponentManager)),y(2,o.IShortcutService)],G);let K=class extends t.Plugin{constructor(e=E,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},E,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(T,o)}onStarting(){[[G],[D],[k],[A],[j],[x]].forEach(e=>{this._injector.add(e)}),[S].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(G)}onReady(){this._injector.get(D)}onRendered(){this._injector.get(k),this._injector.get(A),this._injector.get(j)}};v(K,`pluginName`,m),v(K,`packageName`,C),v(K,`version`,w),v(K,`type`,t.UniverInstanceType.UNIVER_SHEET),K=b([(0,t.DependentOn)(i.UniverThreadCommentUIPlugin,r.UniverSheetsThreadCommentPlugin),y(1,(0,t.Inject)(t.Injector)),y(2,(0,t.Inject)(t.ICommandService)),y(3,t.IConfigService)],K),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}}),e.SHEETS_THREAD_COMMENT=m,Object.defineProperty(e,`SheetsThreadCommentPopupService`,{enumerable:!0,get:function(){return x}}),e.ShowAddSheetCommentModalOperation=S,Object.defineProperty(e,`UniverSheetsThreadCommentUIPlugin`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(e,`UniverThreadCommentUIPlugin`,{enumerable:!0,get:function(){return i.UniverThreadCommentUIPlugin}}),Object.defineProperty(e,`UpdateCommentCommand`,{enumerable:!0,get:function(){return u.UpdateCommentCommand}})});
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiCaES=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Afegeix un comentari`,commentManagement:`Gestió de comentaris`}}}});
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEnUS=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Add Comment`,commentManagement:`Comment Management`}}}});
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiEsES=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Añadir comentario`,commentManagement:`Gestión de comentarios`}}}});
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFaIR=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`افزودن نظر`,commentManagement:`مدیریت نظر`}}}});
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiFrFR=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Ajouter un commentaire`,commentManagement:`Gestion des commentaires`}}}});
|
package/lib/umd/locale/ja-JP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiJaJP=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`コメントを追加`,commentManagement:`コメント管理`}}}});
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiKoKR=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`댓글 추가`,commentManagement:`댓글 관리`}}}});
|
package/lib/umd/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiRuRU=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Добавить комментарий`,commentManagement:`Управление комментариями`}}}});
|
package/lib/umd/locale/sk-SK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiSkSK=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Pridať komentár`,commentManagement:`Správa komentárov`}}}});
|
package/lib/umd/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiViVN=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`Thêm bình luận`,commentManagement:`Quản lý bình luận`}}}});
|
package/lib/umd/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhCN=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`添加评论`,commentManagement:`评论管理`}}}});
|
package/lib/umd/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsThreadCommentUiZhTW=t())})(this,function(){return{sheetThreadComment:{menu:{addComment:`新增評論`,commentManagement:`評論管理`}}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-thread-comment-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
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.
|
|
57
|
-
"@univerjs/engine-formula": "0.
|
|
58
|
-
"@univerjs/engine-render": "0.
|
|
59
|
-
"@univerjs/sheets
|
|
60
|
-
"@univerjs/thread-comment": "0.
|
|
61
|
-
"@univerjs/
|
|
62
|
-
"@univerjs/sheets": "0.
|
|
63
|
-
"@univerjs/ui": "0.
|
|
64
|
-
"@univerjs/thread-comment-ui": "0.
|
|
56
|
+
"@univerjs/core": "0.18.0",
|
|
57
|
+
"@univerjs/engine-formula": "0.18.0",
|
|
58
|
+
"@univerjs/engine-render": "0.18.0",
|
|
59
|
+
"@univerjs/sheets": "0.18.0",
|
|
60
|
+
"@univerjs/sheets-thread-comment": "0.18.0",
|
|
61
|
+
"@univerjs/thread-comment": "0.18.0",
|
|
62
|
+
"@univerjs/sheets-ui": "0.18.0",
|
|
63
|
+
"@univerjs/ui": "0.18.0",
|
|
64
|
+
"@univerjs/thread-comment-ui": "0.18.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"postcss": "^8.5.8",
|
|
@@ -69,16 +69,17 @@
|
|
|
69
69
|
"rxjs": "^7.8.2",
|
|
70
70
|
"tailwindcss": "3.4.18",
|
|
71
71
|
"typescript": "^5.9.3",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"@univerjs-infra/shared": "0.17.0"
|
|
72
|
+
"vitest": "^4.1.0",
|
|
73
|
+
"@univerjs-infra/shared": "0.18.0"
|
|
75
74
|
},
|
|
76
75
|
"scripts": {
|
|
77
76
|
"test": "vitest run",
|
|
78
77
|
"test:watch": "vitest",
|
|
79
78
|
"coverage": "vitest run --coverage",
|
|
80
79
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"build": "univer-cli build"
|
|
80
|
+
"build:bundle": "univer-cli build",
|
|
81
|
+
"build:types": "tsc -p tsconfig.node.json",
|
|
82
|
+
"build": "pnpm run build:bundle && pnpm run build:types"
|
|
82
83
|
},
|
|
83
84
|
"module": "./lib/es/index.js"
|
|
84
85
|
}
|