@univerjs/sheets-thread-comment-ui 0.5.0 → 0.5.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 +2 -2
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/es/index.js +493 -487
- package/lib/es/locale/fr-FR.js +11 -0
- package/lib/index.css +0 -0
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/fr-FR.d.ts +24 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/fr-FR.js +1 -0
- package/package.json +17 -15
package/lib/index.css
ADDED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DependencyOverride } from '@univerjs/core';
|
|
2
2
|
import { MenuConfig } from '@univerjs/ui';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const SHEETS_THREAD_COMMENT_UI_PLUGIN_CONFIG_KEY = "sheets-thread-comment.config";
|
|
4
4
|
export declare const configSymbol: unique symbol;
|
|
5
5
|
export interface IUniverSheetsThreadCommentUIConfig {
|
|
6
6
|
menu?: MenuConfig;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import './global.css';
|
|
16
17
|
export { ShowAddSheetCommentModalOperation } from './commands/operations/comment.operation';
|
|
17
18
|
export { UniverSheetsThreadCommentUIPlugin } from './plugin';
|
|
18
19
|
export { SheetsThreadCommentPopupService } from './services/sheets-thread-comment-popup.service';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
declare const _default: {
|
|
17
|
+
sheetThreadComment: {
|
|
18
|
+
menu: {
|
|
19
|
+
addComment: string;
|
|
20
|
+
commentManagement: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
package/lib/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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("react"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment")):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","react","@univerjs/engine-formula","@univerjs/thread-comment"],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.React,c.UniverEngineFormula,c.UniverThreadComment))})(this,function(c,a,p,A,P,I,f,k,re,E,$,C){"use strict";var st=Object.defineProperty;var at=(c,a,p)=>a in c?st(c,a,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[a]=p;var N=(c,a,p)=>at(c,typeof a!="symbol"?a+"":a,p);const ie="univer.sheet.thread-comment-modal",J="comment-single",Q="SHEET_THREAD_COMMENT";var ve=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,_e=(i,t,r,e)=>{for(var n=e>1?void 0:e?Se(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&ve(t,r,n),n},oe=(i,t)=>(r,e)=>t(r,e,i);c.SheetsThreadCommentPopupService=class extends a.Disposable{constructor(r,e){super();N(this,"_lastPopup",null);N(this,"_activePopup");N(this,"_activePopup$",new k.BehaviorSubject(null));N(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=r,this._zenZoneService=e,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(r=>{r&&this.hidePopup()}))}showPopup(r,e){var l;const{row:n,col:o,unitId:s,subUnitId:d}=r;if(this._activePopup&&n===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&d===((l=this.activePopup)==null?void 0:l.subUnitId)){this._activePopup=r,this._activePopup$.next(r);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=r,this._activePopup$.next(r);const u=this._canvasPopupManagerService.attachPopupToCell(n,o,{componentKey:ie,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!u)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const m=new a.DisposableCollection;m.add(u),m.add({dispose:()=>{e==null||e()}}),this._lastPopup=m}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=_e([oe(0,a.Inject(I.SheetCanvasPopManagerService)),oe(1,f.IZenZoneService)],c.SheetsThreadCommentPopupService);const B={type:a.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(i){var g;const t=i.get(p.SheetsSelectionsService),r=i.get(a.IUniverInstanceService),e=i.get(c.SheetsThreadCommentPopupService),n=i.get(P.ThreadCommentPanelService),o=(g=t.getCurrentLastSelection())==null?void 0:g.primary,s=i.get(A.SheetsThreadCommentModel);if(!o)return!1;const d=p.getSheetCommandTarget(r);if(!d)return!1;const{workbook:u,worksheet:m,unitId:l,subUnitId:h}=d,v={workbook:u,worksheet:m,unitId:l,subUnitId:h,row:o.startRow,col:o.startColumn};e.showPopup(v);const _=s.getByLocation(l,h,o.startRow,o.startColumn);return _&&n.setActiveComment({unitId:l,subUnitId:h,commentId:_,trigger:"context-menu"}),!0}},fe="sheets-thread-comment.config",Ce={};var Ie=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Pe=(i,t,r,e)=>{for(var n=e>1?void 0:e?ge(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&Ie(t,r,n),n},L=(i,t)=>(r,e)=>t(r,e,i);let x=class extends a.Disposable{constructor(i,t,r,e){super(),this._sheetInterceptorService=i,this._sheetsThreadCommentModel=t,this._univerInstanceService=r,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(p.INTERCEPTOR_POINT.CELL_CONTENT,{effect:a.InterceptorEffectEnum.Style,handler:(i,t,r)=>{const{row:e,col:n,unitId:o,subUnitId:s}=t;return this._sheetsThreadCommentModel.showCommentMarker(o,s,e,n)?r({...i,markers:{...i==null?void 0:i.markers,tr:{color:"#FFBD37",size:6}}}):r(i)},priority:100}))}_initSkeletonChange(){const i=()=>{var n;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!t)return;const r=t.getUnitId(),e=this._renderManagerService.getRenderById(r);(n=e==null?void 0:e.mainComponent)==null||n.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(k.debounceTime(16)).subscribe(()=>{i()}))}};x=Pe([L(0,a.Inject(p.SheetInterceptorService)),L(1,a.Inject(A.SheetsThreadCommentModel)),L(2,a.IUniverInstanceService),L(3,re.IRenderManagerService)],x);var y=function(){return y=Object.assign||function(i){for(var t,r=1,e=arguments.length;r<e;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},y.apply(this,arguments)},Te=function(i,t){var r={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&t.indexOf(e)<0&&(r[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(i);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(i,e[n])&&(r[e[n]]=i[e[n]]);return r},se=E.forwardRef(function(i,t){var r=i.icon,e=i.id,n=i.className,o=i.extend,s=Te(i,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(e," ").concat(n||"").trim(),u=E.useRef("_".concat(Me()));return ae(r,"".concat(e),{defIds:r.defIds,idSuffix:u.current},y({ref:t,className:d},s),o)});function ae(i,t,r,e,n){return E.createElement(i.tag,y(y({key:t},be(i,r,n)),e),(ye(i,r).children||[]).map(function(o,s){return ae(o,"".concat(t,"-").concat(i.tag,"-").concat(s),r,void 0,n)}))}function be(i,t,r){var e=y({},i.attrs);r!=null&&r.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=r.colorChannel1);var n=t.defIds;return!n||n.length===0||(i.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+t.idSuffix),Object.entries(e).forEach(function(o){var s=o[0],d=o[1];typeof d=="string"&&(e[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),e}function ye(i,t){var r,e=t.defIds;return!e||e.length===0?i:i.tag==="defs"&&(!((r=i.children)===null||r===void 0)&&r.length)?y(y({},i),{children:i.children.map(function(n){return typeof n.attrs.id=="string"&&e&&e.indexOf(n.attrs.id)>-1?y(y({},n),{attrs:y(y({},n.attrs),{id:n.attrs.id+t.idSuffix})}):n})}):i}function Me(){return Math.random().toString(36).substring(2,8)}se.displayName="UniverIcon";var we={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ce=E.forwardRef(function(i,t){return E.createElement(se,Object.assign({},i,{id:"comment-single",ref:t,icon:we}))});ce.displayName="CommentSingle";var de={exports:{}},W={};/**
|
|
1
|
+
(function(d,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")):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"],a):(d=typeof globalThis<"u"?globalThis:d||self,a(d.UniverSheetsThreadCommentUi={},d.UniverCore,d.UniverSheets,d.UniverSheetsThreadComment,d.UniverThreadCommentUi,d.UniverSheetsUi,d.UniverUi,d.rxjs,d.UniverEngineRender,d.UniverEngineFormula,d.UniverThreadComment,d.React))})(this,function(d,a,v,A,P,I,f,k,ie,$,C,E){"use strict";var rt=Object.defineProperty;var it=(d,a,v)=>a in d?rt(d,a,{enumerable:!0,configurable:!0,writable:!0,value:v}):d[a]=v;var N=(d,a,v)=>it(d,typeof a!="symbol"?a+"":a,v);const oe="univer.sheet.thread-comment-modal",K="comment-single",Q="SHEET_THREAD_COMMENT";var Se=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,fe=(i,t,n,e)=>{for(var r=e>1?void 0:e?_e(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Se(t,n,r),r},se=(i,t)=>(n,e)=>t(n,e,i);d.SheetsThreadCommentPopupService=class extends a.Disposable{constructor(n,e){super();N(this,"_lastPopup",null);N(this,"_activePopup");N(this,"_activePopup$",new k.BehaviorSubject(null));N(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=n,this._zenZoneService=e,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}showPopup(n,e){var m;const{row:r,col:o,unitId:s,subUnitId:c}=n;if(this._activePopup&&r===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&c===((m=this.activePopup)==null?void 0:m.subUnitId)){this._activePopup=n,this._activePopup$.next(n);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=n,this._activePopup$.next(n);const u=this._canvasPopupManagerService.attachPopupToCell(r,o,{componentKey:oe,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!u)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const h=new a.DisposableCollection;h.add(u),h.add({dispose:()=>{e==null||e()}}),this._lastPopup=h}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},d.SheetsThreadCommentPopupService=fe([se(0,a.Inject(I.SheetCanvasPopManagerService)),se(1,f.IZenZoneService)],d.SheetsThreadCommentPopupService);const B={type:a.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(i){var g;const t=i.get(v.SheetsSelectionsService),n=i.get(a.IUniverInstanceService),e=i.get(d.SheetsThreadCommentPopupService),r=i.get(P.ThreadCommentPanelService),o=(g=t.getCurrentLastSelection())==null?void 0:g.primary,s=i.get(A.SheetsThreadCommentModel);if(!o)return!1;const c=v.getSheetCommandTarget(n);if(!c)return!1;const{workbook:u,worksheet:h,unitId:m,subUnitId:l}=c,p={workbook:u,worksheet:h,unitId:m,subUnitId:l,row:o.startRow,col:o.startColumn};e.showPopup(p);const S=s.getByLocation(m,l,o.startRow,o.startColumn);return S&&r.setActiveComment({unitId:m,subUnitId:l,commentId:S,trigger:"context-menu"}),!0}},Ce="sheets-thread-comment.config",Ie={};var ge=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Te=(i,t,n,e)=>{for(var r=e>1?void 0:e?Pe(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&ge(t,n,r),r},L=(i,t)=>(n,e)=>t(n,e,i);let W=class extends a.Disposable{constructor(i,t,n,e){super(),this._sheetInterceptorService=i,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:(i,t,n)=>{const{row:e,col:r,unitId:o,subUnitId:s}=t;return this._sheetsThreadCommentModel.showCommentMarker(o,s,e,r)?n({...i,markers:{...i==null?void 0:i.markers,tr:{color:"#FFBD37",size:6}}}):n(i)},priority:100}))}_initSkeletonChange(){const i=()=>{var r;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!t)return;const n=t.getUnitId(),e=this._renderManagerService.getRenderById(n);(r=e==null?void 0:e.mainComponent)==null||r.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(k.debounceTime(16)).subscribe(()=>{i()}))}};W=Te([L(0,a.Inject(v.SheetInterceptorService)),L(1,a.Inject(A.SheetsThreadCommentModel)),L(2,a.IUniverInstanceService),L(3,ie.IRenderManagerService)],W);var be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Me=(i,t,n,e)=>{for(var r=e>1?void 0:e?ye(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&be(t,n,r),r},X=(i,t)=>(n,e)=>t(n,e,i);const we=(i,t,n)=>{const e=$.singleReferenceToGrid(i),r=n.row-t.row,o=n.column-t.column,s={startColumn:e.column+o,startRow:e.row+r,endColumn:e.column+o,endRow:e.row+r};return $.serializeRange(s)};let F=class extends a.Disposable{constructor(t,n,e){super();N(this,"_copyInfo");this._sheetClipboardService=t,this._sheetsThreadCommentModel=n,this._threadCommentDataSourceService=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Q,onBeforeCopy:(t,n,e)=>{this._copyInfo={unitId:t,subUnitId:n,range:e}},onPasteCells:(t,n,e,r)=>{const{unitId:o,subUnitId:s,range:c}=n,u={row:c.rows[0],column:c.cols[0]};if(r.copyType===I.COPY_TYPE.CUT&&this._copyInfo){const{range:h,unitId:m,subUnitId:l}=this._copyInfo,p={row:h.startRow,column:h.startColumn};if(!(o===m&&s===l)){const S=[];a.Range.foreach(h,(w,_)=>{const R=this._sheetsThreadCommentModel.getAllByLocation(m,l,w,_);this._threadCommentDataSourceService.syncUpdateMutationToColla?R.forEach(T=>{S.push(T)}):R.forEach(({children:T,...j})=>{j.parentId||S.push(j)})});const g=[],M=[],V=[],H=[],re=w=>{g.unshift({id:C.DeleteCommentMutation.id,params:{unitId:m,subUnitId:l,commentId:w.id}}),V.push({id:C.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...w,ref:we(w.ref,p,u),unitId:o,subUnitId:s},sync:!0}}),M.push({id:C.AddCommentMutation.id,params:{unitId:m,subUnitId:l,comment:w,sync:!0}}),H.unshift({id:C.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:w.id}})};return S.forEach(w=>{re(w)}),{redos:[...g,...V],undos:[...H,...M]}}}return{redos:[],undos:[]}}}))}};F=Me([X(0,a.Inject(I.ISheetClipboardService)),X(1,a.Inject(A.SheetsThreadCommentModel)),X(2,C.IThreadCommentDataSourceService)],F);var Re=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,Oe=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ee(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Re(t,n,r),r},G=(i,t)=>(n,e)=>t(n,e,i);let Z=class extends a.Disposable{constructor(i,t,n,e){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionInterceptorBaseController=e,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(k.debounceTime(100)).subscribe(i=>{const t=this._sheetsThreadCommentPopupService.activePopup;if(i&&(t&&t.temp||!t)){const{location:n}=i,{unitId:e,subUnitId:r,row:o,col:s}=n,c=this._sheetsThreadCommentModel.getByLocation(e,r,o,s);if(c){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}]))return;const h=this._sheetsThreadCommentModel.getComment(e,r,c);h&&!h.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:r,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};Z=Oe([G(0,a.Inject(I.HoverManagerService)),G(1,a.Inject(d.SheetsThreadCommentPopupService)),G(2,a.Inject(A.SheetsThreadCommentModel)),G(3,a.Inject(I.SheetPermissionInterceptorBaseController))],Z);var Ue=Object.defineProperty,je=Object.getOwnPropertyDescriptor,De=(i,t,n,e)=>{for(var r=e>1?void 0:e?je(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Ue(t,n,r),r},U=(i,t)=>(n,e)=>t(n,e,i);let z=class extends a.Disposable{constructor(t,n,e,r,o,s,c,u,h,m){super();N(this,"_isSwitchToCommenting",!1);N(this,"_selectionShapeInfo",null);this._commandService=t,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._threadCommentPanelService=r,this._univerInstanceService=o,this._sheetPermissionInterceptorBaseController=s,this._markSelectionService=c,this._sheetSelectionService=u,this._editorBridgeService=h,this._renderManagerService=m,this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(t,n,e){var p,S,g;const r=(p=t[0])==null?void 0:p.range,o=this._renderManagerService.getRenderById(n),s=(S=o==null?void 0:o.with(I.SheetSkeletonManagerService).getWorksheetSkeleton(e))==null?void 0:S.skeleton;if(!s||!r)return;const c=s.getCellWithCoordByIndex(r.startRow,r.startColumn);if((((g=r.rangeType)!=null?g:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||r.endColumn-r.startColumn>0||r.endRow-r.startRow>0)&&!((c.isMerged||c.isMergedMainCell)&&a.Rectangle.equals(c.mergeInfo,r))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const h=c.actualRow,m=c.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,e,h,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const l=this._sheetsThreadCommentModel.getByLocation(n,e,h,m);l&&this._commandService.executeCommand(P.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===C.DeleteCommentMutation.id){const n=t.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:r,subUnitId:o,commentId:s}=e;n.unitId===r&&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:r,commentId:o,trigger:s}=t,c=this._sheetsThreadCommentModel.getComment(e,r,o);if(!c||c.resolved)return;const u=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!u||u.getUnitId()!==e)return;this._isSwitchToCommenting=!0,((n=u.getActiveSheet())==null?void 0:n.getSheetId())!==r&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:r}),this._isSwitchToCommenting=!1;const l=$.singleReferenceToGrid(c.ref),{row:p,column:S}=l;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:p,startColumn:S,endRow:p,endColumn:S}]))return;const M=1;if(await this._commandService.executeCommand(I.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:r,row:l.row,col:l.column,commentId:c.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(k.debounceTime(100)).subscribe(t=>{var p,S;if(!t){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:n,subUnitId:e,commentId:r}=t;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);const o=this._sheetsThreadCommentModel.getComment(n,e,r);if(!o)return;const s=$.singleReferenceToGrid(o.ref),{row:c,column:u}=s;if(Number.isNaN(c)||Number.isNaN(u))return null;const h=(p=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:p.getSheetBySheetId(e),m=(S=h==null?void 0:h.getMergedCell(c,u))!=null?S:{startColumn:u,endColumn:u,startRow:c,endRow:c},l=this._markSelectionService.addShape({range:m,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1);l&&(this._selectionShapeInfo={...t,shapeId:l})}))}};z=De([U(0,a.ICommandService),U(1,a.Inject(d.SheetsThreadCommentPopupService)),U(2,a.Inject(A.SheetsThreadCommentModel)),U(3,a.Inject(P.ThreadCommentPanelService)),U(4,a.IUniverInstanceService),U(5,a.Inject(I.SheetPermissionInterceptorBaseController)),U(6,I.IMarkSelectionService),U(7,a.Inject(v.SheetsSelectionsService)),U(8,I.IEditorBridgeService),U(9,ie.IRenderManagerService)],z);var Ne=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,Ve=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ae(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Ne(t,n,r),r},q=(i,t)=>(n,e)=>t(n,e,i);let Y=class extends a.Disposable{constructor(i,t,n,e){super(),this._sheetInterceptorService=i,this._univerInstanceService=t,this._threadCommentModel=n,this._threadCommentDataSourceService=e,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var t;if(i.id===v.RemoveSheetCommand.id){const n=i.params,e=n.unitId?this._univerInstanceService.getUnit(n.unitId):this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!e)return{redos:[],undos:[]};const r=e.getUnitId(),o=n.subUnitId||((t=e.getActiveSheet())==null?void 0:t.getSheetId());if(!o)return{redos:[],undos:[]};const s=this._threadCommentModel.ensureMap(r,o),c=Array.from(s.values()).filter(p=>!p.parentId),u=c.map(p=>p.id),h=this._threadCommentDataSourceService.syncUpdateMutationToColla,m=u.map(p=>({id:C.DeleteCommentMutation.id,params:{unitId:r,subUnitId:o,commentId:p}})),l=c.map(({children:p,...S})=>({id:C.AddCommentMutation.id,params:{unitId:r,subUnitId:o,comment:{...S,children:h?p:void 0},sync:!h}}));return{redos:m,undos:l}}return{redos:[],undos:[]}}}))}};Y=Ve([q(0,a.Inject(v.SheetInterceptorService)),q(1,a.IUniverInstanceService),q(2,a.Inject(C.ThreadCommentModel)),q(3,C.IThreadCommentDataSourceService)],Y);var y=function(){return y=Object.assign||function(i){for(var t,n=1,e=arguments.length;n<e;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},y.apply(this,arguments)},$e=function(i,t){var n={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&t.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(i);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(i,e[r])&&(n[e[r]]=i[e[r]]);return n},ae=E.forwardRef(function(i,t){var n=i.icon,e=i.id,r=i.className,o=i.extend,s=$e(i,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(e," ").concat(r||"").trim(),u=E.useRef("_".concat(xe()));return ce(n,"".concat(e),{defIds:n.defIds,idSuffix:u.current},y({ref:t,className:c},s),o)});function ce(i,t,n,e,r){return E.createElement(i.tag,y(y({key:t},Be(i,n,r)),e),(ke(i,n).children||[]).map(function(o,s){return ce(o,"".concat(t,"-").concat(i.tag,"-").concat(s),n,void 0,r)}))}function Be(i,t,n){var e=y({},i.attrs);n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1);var r=t.defIds;return!r||r.length===0||(i.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+t.idSuffix),Object.entries(e).forEach(function(o){var s=o[0],c=o[1];typeof c=="string"&&(e[s]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),e}function ke(i,t){var n,e=t.defIds;return!e||e.length===0?i:i.tag==="defs"&&(!((n=i.children)===null||n===void 0)&&n.length)?y(y({},i),{children:i.children.map(function(r){return typeof r.attrs.id=="string"&&e&&e.indexOf(r.attrs.id)>-1?y(y({},r),{attrs:y(y({},r.attrs),{id:r.attrs.id+t.idSuffix})}):r})}):i}function xe(){return Math.random().toString(36).substring(2,8)}ae.displayName="UniverIcon";var He={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ue=E.forwardRef(function(i,t){return E.createElement(ae,Object.assign({},i,{id:"comment-single",ref:t,icon:He}))});ue.displayName="CommentSingle";var ee={exports:{}},x={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Oe=E,Ee=Symbol.for("react.element"),Re=Symbol.for("react.fragment"),Ue=Object.prototype.hasOwnProperty,je=Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,De={key:!0,ref:!0,__self:!0,__source:!0};function ue(i,t,r){var e,n={},o=null,s=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(e in t)Ue.call(t,e)&&!De.hasOwnProperty(e)&&(n[e]=t[e]);if(i&&i.defaultProps)for(e in t=i.defaultProps,t)n[e]===void 0&&(n[e]=t[e]);return{$$typeof:Ee,type:i,key:o,ref:s,props:n,_owner:je.current}}W.Fragment=Re,W.jsx=ue,W.jsxs=ue,de.exports=W;var me=de.exports;const Ne=()=>{const i=a.useDependency(a.IUniverInstanceService),t=a.useDependency(c.SheetsThreadCommentPopupService),r=f.useObservable(t.activePopup$),e=a.useDependency(A.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!r)return null;const{row:n,col:o,unitId:s,subUnitId:d,trigger:u}=r,m=e.getByLocation(s,d,n,o),l=`${a.Tools.chatAtABC(o)}${n+1}`,h=()=>{t.hidePopup()},v=_=>{var g,M,V;return(V=(M=(g=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:g.getSheetBySheetId(_))==null?void 0:M.getName())!=null?V:""};return me.jsx(P.ThreadCommentTree,{onClick:()=>{t.persistPopup()},prefix:"cell",id:m,unitId:s,subUnitId:d,type:a.UniverInstanceType.UNIVER_SHEET,refStr:l,onClose:h,getSubUnitName:v,autoFocus:u==="context-menu"})},Ae=()=>{var w;const i=a.useDependency(I.IMarkSelectionService),t=a.useDependency(a.IUniverInstanceService),r=a.useDependency(c.SheetsThreadCommentPopupService),e=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),n=e.getUnitId(),o=a.useDependency(a.ICommandService),s=E.useMemo(()=>e.activeSheet$.pipe(k.map(S=>S==null?void 0:S.getSheetId())),[e.activeSheet$]),d=f.useObservable(s,(w=e.getActiveSheet())==null?void 0:w.getSheetId()),u=E.useRef(),m=a.useDependency(P.ThreadCommentPanelService),l=f.useObservable(m.activeCommentId$),h=f.useObservable(m.panelVisible$,m.panelVisible),v=E.useCallback(S=>{const O=e.getSheets(),T={};O.forEach((R,b)=>{T[R.getSheetId()]=b});const j=R=>R.map(b=>{var pe;const D=$.singleReferenceToGrid(b.ref),ot=[(pe=T[b.subUnitId])!=null?pe:0,D.row,D.column];return{...b,p:ot}}).sort((b,D)=>b.p[0]===D.p[0]?b.p[1]===D.p[1]?b.p[2]-D.p[2]:b.p[1]-D.p[1]:b.p[0]-D.p[0]);return[...j(S.filter(R=>!R.resolved)),...j(S.filter(R=>R.resolved))]},[e]),_=E.useCallback(S=>{var O;if(S.unitId===n&&S.subUnitId===d&&!S.resolved){const{row:T,column:j}=$.singleReferenceToGrid(S.ref),R=e.getSheetBySheetId(S.subUnitId),b=(O=R==null?void 0:R.getMergedCell(T,j))!=null?O:{startColumn:j,endColumn:j,startRow:T,endRow:T};if(!Number.isNaN(T)&&!Number.isNaN(j))return i.addShape({range:b,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[i,d,n]),g=S=>{var O,T;return(T=(O=e.getSheetBySheetId(S))==null?void 0:O.getName())!=null?T:""},M=()=>{o.executeCommand(B.id)},V=S=>{l&&l.unitId===S.unitId&&l.subUnitId===S.subUnitId&&l.commentId===S.id||(u.current&&(i.removeShape(u.current),u.current=null),u.current=_(S))},H=()=>{u.current&&(i.removeShape(u.current),u.current=null)},ne=(S,O)=>{O&&r.hidePopup()};return E.useEffect(()=>{!h&&u.current&&i.removeShape(u.current)},[i,h]),me.jsx(P.ThreadCommentPanel,{unitId:n,subUnitId$:s,type:a.UniverInstanceType.UNIVER_SHEET,onAdd:M,getSubUnitName:g,onResolve:ne,sortComments:v,onItemEnter:V,onItemLeave:H,onDeleteComment:()=>(H(),!0)})},Ve=i=>({id:B.id,type:f.MenuItemType.BUTTON,icon:J,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET),disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]})}),$e=i=>({id:P.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:J,tooltip:"sheetThreadComment.menu.commentManagement",disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET)}),Be={id:B.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:I.whenSheetEditorFocused},ke={[f.RibbonStartGroup.OTHERS]:{[P.ToggleSheetCommentPanelOperation.id]:{order:1,menuItemFactory:$e}},[f.ContextMenuPosition.MAIN_AREA]:{[f.ContextMenuGroup.OTHERS]:{[B.id]:{order:0,menuItemFactory:Ve}}}};var He=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,xe=(i,t,r,e)=>{for(var n=e>1?void 0:e?Le(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&He(t,r,n),n},X=(i,t)=>(r,e)=>t(r,e,i);let F=class extends a.Disposable{constructor(i,t,r){super(),this._menuManagerService=i,this._componentManager=t,this._shortcutService=r,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(Be)}_initMenu(){this._menuManagerService.mergeMenu(ke)}_initComponent(){[[ie,Ne],[P.THREAD_COMMENT_PANEL,Ae],[J,ce]].forEach(([i,t])=>{this._componentManager.register(i,t)})}};F=xe([X(0,f.IMenuManagerService),X(1,a.Inject(f.ComponentManager)),X(2,f.IShortcutService)],F);var We=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,Ge=(i,t,r,e)=>{for(var n=e>1?void 0:e?Fe(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&We(t,r,n),n},ee=(i,t)=>(r,e)=>t(r,e,i);const Ze=(i,t,r)=>{const e=$.singleReferenceToGrid(i),n=r.row-t.row,o=r.column-t.column,s={startColumn:e.column+o,startRow:e.row+n,endColumn:e.column+o,endRow:e.row+n};return $.serializeRange(s)};let G=class extends a.Disposable{constructor(t,r,e){super();N(this,"_copyInfo");this._sheetClipboardService=t,this._sheetsThreadCommentModel=r,this._threadCommentDataSourceService=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Q,onBeforeCopy:(t,r,e)=>{this._copyInfo={unitId:t,subUnitId:r,range:e}},onPasteCells:(t,r,e,n)=>{const{unitId:o,subUnitId:s,range:d}=r,u={row:d.rows[0],column:d.cols[0]};if(n.copyType===I.COPY_TYPE.CUT&&this._copyInfo){const{range:m,unitId:l,subUnitId:h}=this._copyInfo,v={row:m.startRow,column:m.startColumn};if(!(o===l&&s===h)){const _=[];a.Range.foreach(m,(w,S)=>{const O=this._sheetsThreadCommentModel.getAllByLocation(l,h,w,S);this._threadCommentDataSourceService.syncUpdateMutationToColla?O.forEach(T=>{_.push(T)}):O.forEach(({children:T,...j})=>{j.parentId||_.push(j)})});const g=[],M=[],V=[],H=[],ne=w=>{g.unshift({id:C.DeleteCommentMutation.id,params:{unitId:l,subUnitId:h,commentId:w.id}}),V.push({id:C.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...w,ref:Ze(w.ref,v,u),unitId:o,subUnitId:s},sync:!0}}),M.push({id:C.AddCommentMutation.id,params:{unitId:l,subUnitId:h,comment:w,sync:!0}}),H.unshift({id:C.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:w.id}})};return _.forEach(w=>{ne(w)}),{redos:[...g,...V],undos:[...H,...M]}}}return{redos:[],undos:[]}}}))}};G=Ge([ee(0,a.Inject(I.ISheetClipboardService)),ee(1,a.Inject(A.SheetsThreadCommentModel)),ee(2,C.IThreadCommentDataSourceService)],G);var ze=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,Ke=(i,t,r,e)=>{for(var n=e>1?void 0:e?Ye(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&ze(t,r,n),n},Z=(i,t)=>(r,e)=>t(r,e,i);let z=class extends a.Disposable{constructor(i,t,r,e){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=r,this._sheetPermissionInterceptorBaseController=e,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(k.debounceTime(100)).subscribe(i=>{const t=this._sheetsThreadCommentPopupService.activePopup;if(i&&(t&&t.temp||!t)){const{location:r}=i,{unitId:e,subUnitId:n,row:o,col:s}=r,d=this._sheetsThreadCommentModel.getByLocation(e,n,o,s);if(d){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}]))return;const m=this._sheetsThreadCommentModel.getComment(e,n,d);m&&!m.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:n,row:o,col:s,commentId:d,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};z=Ke([Z(0,a.Inject(I.HoverManagerService)),Z(1,a.Inject(c.SheetsThreadCommentPopupService)),Z(2,a.Inject(A.SheetsThreadCommentModel)),Z(3,a.Inject(I.SheetPermissionInterceptorBaseController))],z);var qe=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Qe=(i,t,r,e)=>{for(var n=e>1?void 0:e?Je(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&qe(t,r,n),n},U=(i,t)=>(r,e)=>t(r,e,i);let Y=class extends a.Disposable{constructor(t,r,e,n,o,s,d,u,m,l){super();N(this,"_isSwitchToCommenting",!1);N(this,"_selectionShapeInfo",null);this._commandService=t,this._sheetsThreadCommentPopupService=r,this._sheetsThreadCommentModel=e,this._threadCommentPanelService=n,this._univerInstanceService=o,this._sheetPermissionInterceptorBaseController=s,this._markSelectionService=d,this._sheetSelectionService=u,this._editorBridgeService=m,this._renderManagerService=l,this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(t,r,e){var v,_,g;const n=(v=t[0])==null?void 0:v.range,o=this._renderManagerService.getRenderById(r),s=(_=o==null?void 0:o.with(I.SheetSkeletonManagerService).getWorksheetSkeleton(e))==null?void 0:_.skeleton;if(!s||!n)return;const d=s.getCellWithCoordByIndex(n.startRow,n.startColumn);if((((g=n.rangeType)!=null?g:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||n.endColumn-n.startColumn>0||n.endRow-n.startRow>0)&&!((d.isMerged||d.isMergedMainCell)&&a.Rectangle.equals(d.mergeInfo,n))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const m=d.actualRow,l=d.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(r,e,m,l)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const h=this._sheetsThreadCommentModel.getByLocation(r,e,m,l);h&&this._commandService.executeCommand(P.SetActiveCommentOperation.id,{unitId:r,subUnitId:e,commentId:h})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(t=>{if(this._isSwitchToCommenting)return;const r=this._sheetSelectionService.currentSelectionParam;r&&this._handleSelectionChange(t,r.unitId,r.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(t=>{t.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(t=>{if(t.id===C.DeleteCommentMutation.id){const r=t.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:n,subUnitId:o,commentId:s}=e;r.unitId===n&&r.subUnitId===o&&r.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async t=>{var r;if(t){const{unitId:e,subUnitId:n,commentId:o,trigger:s}=t,d=this._sheetsThreadCommentModel.getComment(e,n,o);if(!d||d.resolved)return;const u=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!u||u.getUnitId()!==e)return;this._isSwitchToCommenting=!0,((r=u.getActiveSheet())==null?void 0:r.getSheetId())!==n&&await this._commandService.executeCommand(p.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:n}),this._isSwitchToCommenting=!1;const h=$.singleReferenceToGrid(d.ref),{row:v,column:_}=h;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]},[{startRow:v,startColumn:_,endRow:v,endColumn:_}]))return;const M=1;if(await this._commandService.executeCommand(I.ScrollToRangeOperation.id,{range:{startRow:Math.max(h.row-M,0),endRow:h.row+M,startColumn:Math.max(h.column-M,0),endColumn:h.column+M}}),this._editorBridgeService.isVisible().visible)return;this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:n,row:h.row,col:h.column,commentId:d.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(k.debounceTime(100)).subscribe(t=>{var v,_;if(!t){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:r,subUnitId:e,commentId:n}=t;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);const o=this._sheetsThreadCommentModel.getComment(r,e,n);if(!o)return;const s=$.singleReferenceToGrid(o.ref),{row:d,column:u}=s;if(Number.isNaN(d)||Number.isNaN(u))return null;const m=(v=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getSheetBySheetId(e),l=(_=m==null?void 0:m.getMergedCell(d,u))!=null?_:{startColumn:u,endColumn:u,startRow:d,endRow:d},h=this._markSelectionService.addShape({range:l,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1);h&&(this._selectionShapeInfo={...t,shapeId:h})}))}};Y=Qe([U(0,a.ICommandService),U(1,a.Inject(c.SheetsThreadCommentPopupService)),U(2,a.Inject(A.SheetsThreadCommentModel)),U(3,a.Inject(P.ThreadCommentPanelService)),U(4,a.IUniverInstanceService),U(5,a.Inject(I.SheetPermissionInterceptorBaseController)),U(6,I.IMarkSelectionService),U(7,a.Inject(p.SheetsSelectionsService)),U(8,I.IEditorBridgeService),U(9,re.IRenderManagerService)],Y);var Xe=Object.defineProperty,et=Object.getOwnPropertyDescriptor,tt=(i,t,r,e)=>{for(var n=e>1?void 0:e?et(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&Xe(t,r,n),n},K=(i,t)=>(r,e)=>t(r,e,i);let q=class extends a.Disposable{constructor(i,t,r,e){super(),this._sheetInterceptorService=i,this._univerInstanceService=t,this._threadCommentModel=r,this._threadCommentDataSourceService=e,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var t;if(i.id===p.RemoveSheetCommand.id){const r=i.params,e=r.unitId?this._univerInstanceService.getUnit(r.unitId):this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!e)return{redos:[],undos:[]};const n=e.getUnitId(),o=r.subUnitId||((t=e.getActiveSheet())==null?void 0:t.getSheetId());if(!o)return{redos:[],undos:[]};const s=this._threadCommentModel.ensureMap(n,o),d=Array.from(s.values()).filter(v=>!v.parentId),u=d.map(v=>v.id),m=this._threadCommentDataSourceService.syncUpdateMutationToColla,l=u.map(v=>({id:C.DeleteCommentMutation.id,params:{unitId:n,subUnitId:o,commentId:v}})),h=d.map(({children:v,..._})=>({id:C.AddCommentMutation.id,params:{unitId:n,subUnitId:o,comment:{..._,children:m?v:void 0},sync:!m}}));return{redos:l,undos:h}}return{redos:[],undos:[]}}}))}};q=tt([K(0,a.Inject(p.SheetInterceptorService)),K(1,a.IUniverInstanceService),K(2,a.Inject(C.ThreadCommentModel)),K(3,C.IThreadCommentDataSourceService)],q);var he=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,rt=(i,t,r)=>t in i?he(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r,it=(i,t,r,e)=>{for(var n=e>1?void 0:e?nt(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&he(t,r,n),n},te=(i,t)=>(r,e)=>t(r,e,i),le=(i,t,r)=>rt(i,typeof t!="symbol"?t+"":t,r);c.UniverSheetsThreadCommentUIPlugin=class extends a.Plugin{constructor(t=Ce,r,e,n){super(),this._config=t,this._injector=r,this._commandService=e,this._configService=n;const{menu:o,...s}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(fe,s)}onStarting(){[[F],[x],[G],[z],[q],[Y],[c.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[B].forEach(t=>{this._commandService.registerCommand(t)}),this._injector.get(F)}onReady(){this._injector.get(x),this._injector.get(q)}onRendered(){this._injector.get(G),this._injector.get(z),this._injector.get(Y)}},le(c.UniverSheetsThreadCommentUIPlugin,"pluginName",Q),le(c.UniverSheetsThreadCommentUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),c.UniverSheetsThreadCommentUIPlugin=it([a.DependentOn(P.UniverThreadCommentUIPlugin,A.UniverSheetsThreadCommentPlugin),te(1,a.Inject(a.Injector)),te(2,a.Inject(a.ICommandService)),te(3,a.IConfigService)],c.UniverSheetsThreadCommentUIPlugin),Object.defineProperty(c,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin}),Object.defineProperty(c,"AddCommentCommand",{enumerable:!0,get:()=>C.AddCommentCommand}),Object.defineProperty(c,"DeleteCommentCommand",{enumerable:!0,get:()=>C.DeleteCommentCommand}),Object.defineProperty(c,"DeleteCommentTreeCommand",{enumerable:!0,get:()=>C.DeleteCommentTreeCommand}),Object.defineProperty(c,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>C.IThreadCommentDataSourceService}),Object.defineProperty(c,"ResolveCommentCommand",{enumerable:!0,get:()=>C.ResolveCommentCommand}),Object.defineProperty(c,"UpdateCommentCommand",{enumerable:!0,get:()=>C.UpdateCommentCommand}),c.SHEETS_THREAD_COMMENT=Q,c.ShowAddSheetCommentModalOperation=B,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
9
|
+
*/var de;function Le(){if(de)return x;de=1;var i=E,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(c,u,h){var m,l={},p=null,S=null;h!==void 0&&(p=""+h),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(S=u.ref);for(m in u)e.call(u,m)&&!o.hasOwnProperty(m)&&(l[m]=u[m]);if(c&&c.defaultProps)for(m in u=c.defaultProps,u)l[m]===void 0&&(l[m]=u[m]);return{$$typeof:t,type:c,key:p,ref:S,props:l,_owner:r.current}}return x.Fragment=n,x.jsx=s,x.jsxs=s,x}var me;function We(){return me||(me=1,ee.exports=Le()),ee.exports}var he=We();const Fe=()=>{const i=a.useDependency(a.IUniverInstanceService),t=a.useDependency(d.SheetsThreadCommentPopupService),n=f.useObservable(t.activePopup$),e=a.useDependency(A.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!n)return null;const{row:r,col:o,unitId:s,subUnitId:c,trigger:u}=n,h=e.getByLocation(s,c,r,o),m=`${a.Tools.chatAtABC(o)}${r+1}`,l=()=>{t.hidePopup()},p=S=>{var g,M,V;return(V=(M=(g=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:g.getSheetBySheetId(S))==null?void 0:M.getName())!=null?V:""};return he.jsx(P.ThreadCommentTree,{onClick:()=>{t.persistPopup()},prefix:"cell",id:h,unitId:s,subUnitId:c,type:a.UniverInstanceType.UNIVER_SHEET,refStr:m,onClose:l,getSubUnitName:p,autoFocus:u==="context-menu"})},Ge=()=>{var w;const i=a.useDependency(I.IMarkSelectionService),t=a.useDependency(a.IUniverInstanceService),n=a.useDependency(d.SheetsThreadCommentPopupService),e=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),r=e.getUnitId(),o=a.useDependency(a.ICommandService),s=E.useMemo(()=>e.activeSheet$.pipe(k.map(_=>_==null?void 0:_.getSheetId())),[e.activeSheet$]),c=f.useObservable(s,(w=e.getActiveSheet())==null?void 0:w.getSheetId()),u=E.useRef(),h=a.useDependency(P.ThreadCommentPanelService),m=f.useObservable(h.activeCommentId$),l=f.useObservable(h.panelVisible$,h.panelVisible),p=E.useCallback(_=>{const R=e.getSheets(),T={};R.forEach((O,b)=>{T[O.getSheetId()]=b});const j=O=>O.map(b=>{var ve;const D=$.singleReferenceToGrid(b.ref),nt=[(ve=T[b.subUnitId])!=null?ve:0,D.row,D.column];return{...b,p:nt}}).sort((b,D)=>b.p[0]===D.p[0]?b.p[1]===D.p[1]?b.p[2]-D.p[2]:b.p[1]-D.p[1]:b.p[0]-D.p[0]);return[...j(_.filter(O=>!O.resolved)),...j(_.filter(O=>O.resolved))]},[e]),S=E.useCallback(_=>{var R;if(_.unitId===r&&_.subUnitId===c&&!_.resolved){const{row:T,column:j}=$.singleReferenceToGrid(_.ref),O=e.getSheetBySheetId(_.subUnitId),b=(R=O==null?void 0:O.getMergedCell(T,j))!=null?R:{startColumn:j,endColumn:j,startRow:T,endRow:T};if(!Number.isNaN(T)&&!Number.isNaN(j))return i.addShape({range:b,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[i,c,r]),g=_=>{var R,T;return(T=(R=e.getSheetBySheetId(_))==null?void 0:R.getName())!=null?T:""},M=()=>{o.executeCommand(B.id)},V=_=>{m&&m.unitId===_.unitId&&m.subUnitId===_.subUnitId&&m.commentId===_.id||(u.current&&(i.removeShape(u.current),u.current=null),u.current=S(_))},H=()=>{u.current&&(i.removeShape(u.current),u.current=null)},re=(_,R)=>{R&&n.hidePopup()};return E.useEffect(()=>{!l&&u.current&&i.removeShape(u.current)},[i,l]),he.jsx(P.ThreadCommentPanel,{unitId:r,subUnitId$:s,type:a.UniverInstanceType.UNIVER_SHEET,onAdd:M,getSubUnitName:g,onResolve:re,sortComments:p,onItemEnter:V,onItemLeave:H,onDeleteComment:()=>(H(),!0)})},Ze=i=>({id:B.id,type:f.MenuItemType.BUTTON,icon:K,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET),disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]})}),ze=i=>({id:P.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:K,tooltip:"sheetThreadComment.menu.commentManagement",disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET)}),qe={id:B.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:I.whenSheetEditorFocused},Ye={[f.RibbonStartGroup.OTHERS]:{[P.ToggleSheetCommentPanelOperation.id]:{order:1,menuItemFactory:ze}},[f.ContextMenuPosition.MAIN_AREA]:{[f.ContextMenuGroup.OTHERS]:{[B.id]:{order:0,menuItemFactory:Ze}}}};var Je=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Qe=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ke(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Je(t,n,r),r},te=(i,t)=>(n,e)=>t(n,e,i);let J=class extends a.Disposable{constructor(i,t,n){super(),this._menuManagerService=i,this._componentManager=t,this._shortcutService=n,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(qe)}_initMenu(){this._menuManagerService.mergeMenu(Ye)}_initComponent(){[[oe,Fe],[P.THREAD_COMMENT_PANEL,Ge],[K,ue]].forEach(([i,t])=>{this._componentManager.register(i,t)})}};J=Qe([te(0,f.IMenuManagerService),te(1,a.Inject(f.ComponentManager)),te(2,f.IShortcutService)],J);var le=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor,et=(i,t,n)=>t in i?le(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,tt=(i,t,n,e)=>{for(var r=e>1?void 0:e?Xe(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&le(t,n,r),r},ne=(i,t)=>(n,e)=>t(n,e,i),pe=(i,t,n)=>et(i,typeof t!="symbol"?t+"":t,n);d.UniverSheetsThreadCommentUIPlugin=class extends a.Plugin{constructor(t=Ie,n,e,r){super(),this._config=t,this._injector=n,this._commandService=e,this._configService=r;const{menu:o,...s}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Ce,s)}onStarting(){[[J],[W],[F],[Z],[Y],[z],[d.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[B].forEach(t=>{this._commandService.registerCommand(t)}),this._injector.get(J)}onReady(){this._injector.get(W),this._injector.get(Y)}onRendered(){this._injector.get(F),this._injector.get(Z),this._injector.get(z)}},pe(d.UniverSheetsThreadCommentUIPlugin,"pluginName",Q),pe(d.UniverSheetsThreadCommentUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),d.UniverSheetsThreadCommentUIPlugin=tt([a.DependentOn(P.UniverThreadCommentUIPlugin,A.UniverSheetsThreadCommentPlugin),ne(1,a.Inject(a.Injector)),ne(2,a.Inject(a.ICommandService)),ne(3,a.IConfigService)],d.UniverSheetsThreadCommentUIPlugin),Object.defineProperty(d,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin}),Object.defineProperty(d,"AddCommentCommand",{enumerable:!0,get:()=>C.AddCommentCommand}),Object.defineProperty(d,"DeleteCommentCommand",{enumerable:!0,get:()=>C.DeleteCommentCommand}),Object.defineProperty(d,"DeleteCommentTreeCommand",{enumerable:!0,get:()=>C.DeleteCommentTreeCommand}),Object.defineProperty(d,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>C.IThreadCommentDataSourceService}),Object.defineProperty(d,"ResolveCommentCommand",{enumerable:!0,get:()=>C.ResolveCommentCommand}),Object.defineProperty(d,"UpdateCommentCommand",{enumerable:!0,get:()=>C.UpdateCommentCommand}),d.SHEETS_THREAD_COMMENT=Q,d.ShowAddSheetCommentModalOperation=B,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsThreadCommentUiFrFR=n())})(this,function(){"use strict";return{sheetThreadComment:{menu:{addComment:"Ajouter un commentaire",commentManagement:"Gestion des commentaires"}}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-thread-comment-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer thread comment plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -52,25 +52,27 @@
|
|
|
52
52
|
"rxjs": ">=7.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@univerjs/icons": "^0.2.
|
|
55
|
+
"@univerjs/icons": "^0.2.8",
|
|
56
56
|
"clsx": "^2.1.1",
|
|
57
|
-
"@univerjs/core": "0.5.
|
|
58
|
-
"@univerjs/engine-formula": "0.5.
|
|
59
|
-
"@univerjs/engine-render": "0.5.
|
|
60
|
-
"@univerjs/sheets": "0.5.
|
|
61
|
-
"@univerjs/sheets
|
|
62
|
-
"@univerjs/thread-comment": "0.5.
|
|
63
|
-
"@univerjs/sheets-ui": "0.5.
|
|
64
|
-
"@univerjs/
|
|
65
|
-
"@univerjs/ui": "0.5.
|
|
57
|
+
"@univerjs/core": "0.5.1",
|
|
58
|
+
"@univerjs/engine-formula": "0.5.1",
|
|
59
|
+
"@univerjs/engine-render": "0.5.1",
|
|
60
|
+
"@univerjs/sheets-thread-comment": "0.5.1",
|
|
61
|
+
"@univerjs/sheets": "0.5.1",
|
|
62
|
+
"@univerjs/thread-comment": "0.5.1",
|
|
63
|
+
"@univerjs/sheets-ui": "0.5.1",
|
|
64
|
+
"@univerjs/ui": "0.5.1",
|
|
65
|
+
"@univerjs/thread-comment-ui": "0.5.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
+
"postcss": "^8.4.49",
|
|
68
69
|
"react": "18.3.1",
|
|
69
70
|
"rxjs": "^7.8.1",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
71
|
+
"tailwindcss": "^3.4.15",
|
|
72
|
+
"typescript": "^5.7.2",
|
|
73
|
+
"vite": "^6.0.1",
|
|
74
|
+
"vitest": "^2.1.6",
|
|
75
|
+
"@univerjs-infra/shared": "0.5.1"
|
|
74
76
|
},
|
|
75
77
|
"space": {
|
|
76
78
|
".": {
|