@univerjs/preset-sheets-note 0.17.0 → 0.19.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/index.css +1 -1
- package/lib/umd/index.js +3 -6
- package/lib/umd/locales/ca-ES.js +1 -2
- package/lib/umd/locales/en-US.js +1 -2
- package/lib/umd/locales/es-ES.js +1 -2
- package/lib/umd/locales/fa-IR.js +1 -2
- package/lib/umd/locales/fr-FR.js +1 -2
- package/lib/umd/locales/ja-JP.js +1 -2
- package/lib/umd/locales/ko-KR.js +1 -2
- package/lib/umd/locales/ru-RU.js +1 -2
- package/lib/umd/locales/sk-SK.js +1 -2
- package/lib/umd/locales/vi-VN.js +1 -2
- package/lib/umd/locales/zh-CN.js +1 -2
- package/lib/umd/locales/zh-TW.js +1 -2
- package/package.json +5 -5
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-ml-px{margin-left:1px}.univer-min-h-1{min-height:.25rem}.univer-min-w-1{min-width:.25rem}.univer-bg-white{background-color:var(--univer-white)}.\!univer-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0
|
|
1
|
+
.univer-ml-px{margin-left:1px}.univer-min-h-1{min-height:.25rem}.univer-min-w-1{min-width:.25rem}.univer-bg-white{background-color:var(--univer-white)}.\!univer-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}.dark\:\!univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}
|
package/lib/umd/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
// @univerjs/sheets-note/index
|
|
2
|
-
(function(u,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs"],c):(u=typeof globalThis<"u"?globalThis:u||self,c(u.UniverSheetsNote={},u.UniverCore,u.UniverSheets,u.rxjs))})(this,(function(u,c,g,M){"use strict";var X=Object.defineProperty;var Z=(u,c,g)=>c in u?X(u,c,{enumerable:!0,configurable:!0,writable:!0,value:g}):u[c]=g;var f=(u,c,g)=>Z(u,typeof c!="symbol"?c+"":c,g);class m extends c.Disposable{constructor(){super(...arguments);f(this,"_notesMap",new Map);f(this,"_change$",new M.Subject);f(this,"change$",this._change$.asObservable())}_ensureNotesMap(t,e){let n=this._notesMap.get(t);n||(n=new Map,this._notesMap.set(t,n));let o=n.get(e);return o||(o=new Map,n.set(e,o)),o}_getNoteByPosition(t,e,n,o){const s=this._ensureNotesMap(t,e);for(const[r,d]of s)if(d.row===n&&d.col===o)return d}_getNoteById(t,e,n){return this._ensureNotesMap(t,e).get(n)}_getNoteByParams(t,e,n){const{noteId:o,row:s,col:r}=n;return o?this._getNoteById(t,e,o):s!==void 0&&r!==void 0?this._getNoteByPosition(t,e,s,r):null}getSheetShowNotes$(t,e){return this._change$.pipe(M.filter(({unitId:n,subUnitId:o})=>n===t&&o===e),M.map(()=>{const n=this._ensureNotesMap(t,e),o=[];for(const[s,r]of n)r.show&&o.push({loc:{row:r.row,col:r.col,unitId:t,subUnitId:e},note:r});return o}))}getCellNoteChange$(t,e,n,o){return this._change$.pipe(M.filter(({unitId:s,subUnitId:r,oldNote:d})=>s!==t||r!==e||!d?!1:d.row===n&&d.col===o),M.map(s=>s))}updateNote(t,e,n,o,s,r){const d=this._getNoteByParams(t,e,{noteId:s==null?void 0:s.id,row:n,col:o}),h=this._ensureNotesMap(t,e),l={...s,id:(d==null?void 0:d.id)||s.id||c.generateRandomId(6),row:n,col:o};h.set(l.id,l),this._change$.next({unitId:t,subUnitId:e,oldNote:d,type:"update",newNote:l,silent:r})}removeNote(t,e,n){const{noteId:o,row:s,col:r,silent:d}=n,h=this._getNoteByParams(t,e,{noteId:o,row:s,col:r});if(!h)return;this._ensureNotesMap(t,e).delete(h.id),this._change$.next({unitId:t,subUnitId:e,oldNote:h,type:"update",newNote:null,silent:d})}toggleNotePopup(t,e,n){const{noteId:o,row:s,col:r,silent:d}=n,h=this._getNoteByParams(t,e,{noteId:o,row:s,col:r});if(!h)return;const l=this._ensureNotesMap(t,e),p={...h,show:!h.show};l.set(p.id,p),this._change$.next({unitId:t,subUnitId:e,oldNote:h,type:"update",newNote:p,silent:d})}updateNotePosition(t,e,n){const{noteId:o,row:s,col:r,newRow:d,newCol:h,silent:l}=n,p=this._getNoteByParams(t,e,{noteId:o,row:s,col:r});if(!p)return;const _=this._ensureNotesMap(t,e),N={...p,row:d,col:h};_.set(N.id,N),this._change$.next({unitId:t,subUnitId:e,oldNote:p,type:"ref",newNote:N,silent:l})}getNote(t,e,n){return this._getNoteByParams(t,e,n)}getNotes(){return this._notesMap}getUnitNotes(t){return this._notesMap.get(t)}getSheetNotes(t,e){const n=this._notesMap.get(t);if(n)return n.get(e)}deleteUnitNotes(t){this._notesMap.delete(t)}}const S={id:"sheet.mutation.update-note",type:c.CommandType.MUTATION,handler:(a,i)=>{const{unitId:t,sheetId:e,row:n,col:o,note:s,silent:r}=i;return a.get(m).updateNote(t,e,n,o,s,r),!0}},v={id:"sheet.mutation.remove-note",type:c.CommandType.MUTATION,handler:(a,i)=>{const{unitId:t,sheetId:e,noteId:n,row:o,col:s,silent:r}=i;return a.get(m).removeNote(t,e,{noteId:n,row:o,col:s,silent:r}),!0}},I={id:"sheet.mutation.toggle-note-popup",type:c.CommandType.MUTATION,handler:(a,i)=>{const{unitId:t,sheetId:e,noteId:n,row:o,col:s,silent:r}=i;return a.get(m).toggleNotePopup(t,e,{noteId:n,row:o,col:s,silent:r}),!0}},w={id:"sheet.mutation.update-note-position",type:c.CommandType.MUTATION,handler:(a,i)=>{const{unitId:t,sheetId:e,noteId:n,row:o,col:s,newPosition:r,silent:d}=i;return a.get(m).updateNotePosition(t,e,{noteId:n,row:o,col:s,newRow:r.row,newCol:r.col,silent:d}),!0}},E={id:"sheet.command.delete-note",type:c.CommandType.COMMAND,handler:a=>{const i=g.getSheetCommandTarget(a.get(c.IUniverInstanceService));if(!i)return!1;const e=a.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!(e!=null&&e.primary))return!1;const n=a.get(m),{unitId:o,subUnitId:s}=i,{actualColumn:r,actualRow:d}=e.primary,h=n.getNote(o,s,{row:d,col:r});if(!h)return!1;const l=a.get(c.ICommandService),p=a.get(c.IUndoRedoService),_={id:v.id,params:{unitId:o,sheetId:s,noteId:h.id}},N={id:S.id,params:{unitId:o,sheetId:s,row:d,col:r,note:{...h}}};return l.syncExecuteCommand(_.id,_.params)?(p.pushUndoRedo({unitID:o,redoMutations:[_],undoMutations:[N]}),!0):!1}},O={id:"sheet.command.toggle-note-popup",type:c.CommandType.COMMAND,handler:a=>{const i=g.getSheetCommandTarget(a.get(c.IUniverInstanceService));if(!i)return!1;const e=a.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!(e!=null&&e.primary))return!1;const n=a.get(m),{unitId:o,subUnitId:s}=i,{actualColumn:r,actualRow:d}=e.primary,h=n.getNote(o,s,{row:d,col:r});if(!h)return!1;const l=a.get(c.ICommandService),p=a.get(c.IUndoRedoService),_={id:I.id,params:{unitId:o,sheetId:s,noteId:h.id}},N={id:I.id,params:{unitId:o,sheetId:s,noteId:h.id}};return l.syncExecuteCommand(_.id,_.params)?(p.pushUndoRedo({unitID:o,redoMutations:[_],undoMutations:[N]}),!0):!1}},b={id:"sheet.command.update-note",type:c.CommandType.COMMAND,handler:(a,i)=>{const t=g.getSheetCommandTarget(a.get(c.IUniverInstanceService),i);if(!t)return!1;const e=a.get(c.ICommandService),n=a.get(c.IUndoRedoService),o=a.get(m),{unitId:s,subUnitId:r}=t,{row:d,col:h,note:l}=i,p=o.getNote(s,r,{noteId:l.id,row:d,col:h}),_={id:S.id,params:{unitId:s,sheetId:r,row:d,col:h,note:l}},N=[];if(p){const T={id:S.id,params:{unitId:s,sheetId:r,row:d,col:h,note:{...p}}};N.push(T)}else{const T={id:v.id,params:{unitId:s,sheetId:r,row:d,col:h}};N.push(T)}return e.syncExecuteCommand(_.id,_.params)?(n.pushUndoRedo({unitID:s,redoMutations:[_],undoMutations:N}),!0):!1}},D="SHEET_NOTE_PLUGIN";var B=Object.getOwnPropertyDescriptor,L=(a,i,t,e)=>{for(var n=e>1?void 0:e?B(i,t):i,o=a.length-1,s;o>=0;o--)(s=a[o])&&(n=s(n)||n);return n},C=(a,i)=>(t,e)=>i(t,e,a);u.SheetsNoteResourceController=class extends c.Disposable{constructor(i,t,e,n){super(),this._resourceManagerService=i,this._univerInstanceService=t,this._sheetInterceptorService=e,this._sheetsNoteModel=n,this._initSnapshot(),this._initSheetChange()}_initSnapshot(){const i=e=>{const n=this._sheetsNoteModel.getUnitNotes(e);if(!n)return"";const o={};return n.forEach((s,r)=>{const d={};s.forEach(h=>{const{row:l,col:p}=h;d[l]||(d[l]={}),d[l][p]=h}),Object.keys(d).length>0&&(o[r]=d)}),JSON.stringify(o)},t=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:D,businesses:[c.UniverInstanceType.UNIVER_SHEET],toJson:e=>i(e),parseJson:e=>t(e),onUnLoad:e=>{this._sheetsNoteModel.deleteUnitNotes(e)},onLoad:(e,n)=>{Object.entries(n).forEach(([o,s])=>{Object.entries(s).forEach(([r,d])=>{Object.entries(d).forEach(([h,l])=>{this._sheetsNoteModel.updateNote(e,o,Number(r),Number(h),l)})})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var t;if(i.id===g.RemoveSheetCommand.id){const e=i.params,n=e.unitId||this._univerInstanceService.getCurrentUnitOfType(c.UniverInstanceType.UNIVER_SHEET).getUnitId(),o=e.subUnitId||((t=this._univerInstanceService.getCurrentUnitOfType(c.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:t.getSheetId());if(!n||!o)return{redos:[],undos:[]};const s=this._sheetsNoteModel.getSheetNotes(n,o);if(!s)return{redos:[],undos:[]};const r=[],d=[];return s.forEach(h=>{r.push({id:v.id,params:{unitId:n,sheetId:o,noteId:h.id,row:h.row,col:h.col}}),d.push({id:S.id,params:{unitId:n,sheetId:o,row:h.row,col:h.col,note:h}})}),{redos:r,undos:d}}else if(i.id===g.CopySheetCommand.id){const e=i.params,{unitId:n,subUnitId:o,targetSubUnitId:s}=e;if(!n||!o||!s)return{redos:[],undos:[]};const r=this._sheetsNoteModel.getSheetNotes(n,o);if(!r)return{redos:[],undos:[]};const d=[],h=[];return r.forEach(l=>{const p={...l,id:c.generateRandomId(6)};d.push({id:S.id,params:{unitId:n,sheetId:s,row:p.row,col:p.col,note:p}}),h.push({id:v.id,params:{unitId:n,sheetId:s,noteId:p.id,row:p.row,col:p.col}})}),{redos:d,undos:h}}return{redos:[],undos:[]}}}))}},u.SheetsNoteResourceController=L([C(0,c.IResourceManagerService),C(1,c.IUniverInstanceService),C(2,c.Inject(g.SheetInterceptorService)),C(3,c.Inject(m))],u.SheetsNoteResourceController);const $={name:"@univerjs/sheets-note",version:"0.17.0"},H="sheets-note.config",j={};var J=Object.getOwnPropertyDescriptor,q=(a,i,t,e)=>{for(var n=e>1?void 0:e?J(i,t):i,o=a.length-1,s;o>=0;o--)(s=a[o])&&(n=s(n)||n);return n},R=(a,i)=>(t,e)=>i(t,e,a);let U=class extends c.Disposable{constructor(i,t,e,n){super();f(this,"_disposableMap",new Map);f(this,"_watcherMap",new Map);f(this,"_handleRangeChange",(i,t,e,n,o,s,r)=>s?{redos:[{id:w.id,params:{unitId:i,sheetId:t,noteId:e.id,newPosition:{row:s.startRow,col:s.startColumn},silent:r}}],undos:[{id:w.id,params:{unitId:i,sheetId:t,noteId:e.id,newPosition:{row:n,col:o},note:e,silent:r}}]}:{redos:[{id:v.id,params:{unitId:i,sheetId:t,noteId:e.id}}],undos:[{id:S.id,params:{unitId:i,sheetId:t,row:n,col:o,note:e}}]});this._refRangeService=i,this._sheetsNoteModel=t,this._selectionManagerService=e,this._commandService=n,this._initData(),this._initRefRange()}_getIdWithUnitId(i,t,e,n){return`${i}-${t}-${e}-${n}`}_register(i,t,e,n,o){const s={startColumn:o,endColumn:o,startRow:n,endRow:n};this._disposableMap.set(this._getIdWithUnitId(i,t,n,o),this._refRangeService.registerRefRange(s,r=>{const d=g.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests(s,r,{selectionManagerService:this._selectionManagerService}),h=Array.isArray(d)?d[0]:d;return h&&h.startColumn===s.startColumn&&h.startRow===s.startRow?{undos:[],redos:[]}:this._handleRangeChange(i,t,e,n,o,h,!1)},i,t))}_watch(i,t,e,n,o){const s={startColumn:o,endColumn:o,startRow:n,endRow:n};this._watcherMap.set(this._getIdWithUnitId(i,t,n,o),this._refRangeService.watchRange(i,t,s,(r,d)=>{const{redos:h}=this._handleRangeChange(i,t,e,r.startRow,r.startColumn,d,!0);c.sequenceExecuteAsync(h,this._commandService,{onlyLocal:!0})},!0))}_unwatch(i,t,e,n){var s;const o=this._getIdWithUnitId(i,t,e,n);(s=this._watcherMap.get(o))==null||s.dispose(),this._watcherMap.delete(o)}_unregister(i,t,e,n){var s;const o=this._getIdWithUnitId(i,t,e,n);(s=this._disposableMap.get(o))==null||s.dispose(),this._disposableMap.delete(o)}_initData(){const i=this._sheetsNoteModel.getNotes();for(const[t,e]of i)for(const[n,o]of e)o.forEach(s=>{this._register(t,n,s,s.row,s.col),this._watch(t,n,s,s.row,s.col)})}_initRefRange(){this.disposeWithMe(this._sheetsNoteModel.change$.subscribe(i=>{switch(i.type){case"update":{const{unitId:t,subUnitId:e,oldNote:n,newNote:o}=i,s=o?o.row:n.row,r=o?o.col:n.col,d=this._getIdWithUnitId(t,e,s,r);o?this._disposableMap.has(d)||(this._register(t,e,o,s,r),this._watch(t,e,o,s,r)):(this._unregister(t,e,s,r),this._unwatch(t,e,s,r));break}case"ref":{const{unitId:t,subUnitId:e,oldNote:n,newNote:o,silent:s}=i,{row:r,col:d}=n,{row:h,col:l}=o;this._unregister(t,e,r,d),s||(this._unwatch(t,e,r,d),this._watch(t,e,o,h,l)),this._register(t,e,o,h,l);break}}}))}};U=q([R(0,c.Inject(g.RefRangeService)),R(1,c.Inject(m)),R(2,c.Inject(g.SheetsSelectionsService)),R(3,c.ICommandService)],U);var G=Object.getOwnPropertyDescriptor,V=(a,i,t,e)=>{for(var n=e>1?void 0:e?G(i,t):i,o=a.length-1,s;o>=0;o--)(s=a[o])&&(n=s(n)||n);return n},z=(a,i)=>(t,e)=>i(t,e,a);let y=class extends c.Disposable{constructor(a){super(),this._commandService=a,this._initialize()}_initialize(){[w,I,S,v,E,O,b].forEach(a=>{this.disposeWithMe(this._commandService.registerCommand(a))})}};y=V([z(0,c.ICommandService)],y);var F=Object.defineProperty,K=Object.getOwnPropertyDescriptor,Y=(a,i,t)=>i in a?F(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t,Q=(a,i,t,e)=>{for(var n=e>1?void 0:e?K(i,t):i,o=a.length-1,s;o>=0;o--)(s=a[o])&&(n=s(n)||n);return n},A=(a,i)=>(t,e)=>i(t,e,a),P=(a,i,t)=>Y(a,typeof i!="symbol"?i+"":i,t);u.UniverSheetsNotePlugin=class extends c.Plugin{constructor(i=j,t,e){super(),this._config=i,this._configService=t,this._injector=e;const{...n}=c.merge({},j,this._config);this._configService.setConfig(H,n)}onStarting(){[[m],[y],[u.SheetsNoteResourceController],[U]].forEach(i=>{this._injector.add(i)}),c.touchDependencies(this._injector,[[m],[y],[u.SheetsNoteResourceController]])}onReady(){c.touchDependencies(this._injector,[[U]])}},P(u.UniverSheetsNotePlugin,"pluginName",D),P(u.UniverSheetsNotePlugin,"packageName",$.name),P(u.UniverSheetsNotePlugin,"version",$.version),P(u.UniverSheetsNotePlugin,"type",c.UniverInstanceType.UNIVER_SHEET),u.UniverSheetsNotePlugin=Q([c.DependentOn(g.UniverSheetsPlugin),A(1,c.IConfigService),A(2,c.Inject(c.Injector))],u.UniverSheetsNotePlugin),u.RemoveNoteMutation=v,u.SheetDeleteNoteCommand=E,u.SheetToggleNotePopupCommand=O,u.SheetUpdateNoteCommand=b,u.SheetsNoteModel=m,u.ToggleNotePopupMutation=I,u.UpdateNoteMutation=S,u.UpdateNotePositionMutation=w,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
3
|
-
|
|
2
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`rxjs`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`rxjs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNote={},e.UniverCore,e.UniverSheets,e.rxjs))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function i(e){"@babel/helpers - typeof";return i=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},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=class extends t.Disposable{constructor(...e){super(...e),s(this,`_notesMap`,new Map),s(this,`_change$`,new r.Subject),s(this,`change$`,this._change$.asObservable())}_ensureNotesMap(e,t){let n=this._notesMap.get(e);n||(n=new Map,this._notesMap.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_getNoteByPosition(e,t,n,r){let i=this._ensureNotesMap(e,t);for(let[e,t]of i)if(t.row===n&&t.col===r)return t}_getNoteById(e,t,n){return this._ensureNotesMap(e,t).get(n)}_getNoteByParams(e,t,n){let{noteId:r,row:i,col:a}=n;return r?this._getNoteById(e,t,r):i!==void 0&&a!==void 0?this._getNoteByPosition(e,t,i,a):null}getSheetShowNotes$(e,t){return this._change$.pipe((0,r.filter)(({unitId:n,subUnitId:r})=>n===e&&r===t),(0,r.map)(()=>{let n=this._ensureNotesMap(e,t),r=[];for(let[i,a]of n)a.show&&r.push({loc:{row:a.row,col:a.col,unitId:e,subUnitId:t},note:a});return r}))}getCellNoteChange$(e,t,n,i){return this._change$.pipe((0,r.filter)(({unitId:r,subUnitId:a,oldNote:o})=>r!==e||a!==t||!o?!1:o.row===n&&o.col===i),(0,r.map)(e=>e))}updateNote(e,n,r,i,a,o){let s=this._getNoteByParams(e,n,{noteId:a==null?void 0:a.id,row:r,col:i}),c=this._ensureNotesMap(e,n),l={...a,id:(s==null?void 0:s.id)||a.id||(0,t.generateRandomId)(6),row:r,col:i};c.set(l.id,l),this._change$.next({unitId:e,subUnitId:n,oldNote:s,type:`update`,newNote:l,silent:o})}removeNote(e,t,n){let{noteId:r,row:i,col:a,silent:o}=n,s=this._getNoteByParams(e,t,{noteId:r,row:i,col:a});s&&(this._ensureNotesMap(e,t).delete(s.id),this._change$.next({unitId:e,subUnitId:t,oldNote:s,type:`update`,newNote:null,silent:o}))}toggleNotePopup(e,t,n){let{noteId:r,row:i,col:a,silent:o}=n,s=this._getNoteByParams(e,t,{noteId:r,row:i,col:a});if(!s)return;let c=this._ensureNotesMap(e,t),l={...s,show:!s.show};c.set(l.id,l),this._change$.next({unitId:e,subUnitId:t,oldNote:s,type:`update`,newNote:l,silent:o})}updateNotePosition(e,t,n){let{noteId:r,row:i,col:a,newRow:o,newCol:s,silent:c}=n,l=this._getNoteByParams(e,t,{noteId:r,row:i,col:a});if(!l)return;let u=this._ensureNotesMap(e,t),d={...l,row:o,col:s};u.set(d.id,d),this._change$.next({unitId:e,subUnitId:t,oldNote:l,type:`ref`,newNote:d,silent:c})}getNote(e,t,n){return this._getNoteByParams(e,t,n)}getNotes(){return this._notesMap}getUnitNotes(e){return this._notesMap.get(e)}getSheetNotes(e,t){let n=this._notesMap.get(e);if(n)return n.get(t)}deleteUnitNotes(e){this._notesMap.delete(e)}};let l={id:`sheet.mutation.update-note`,type:t.CommandType.MUTATION,handler:(e,t)=>{let{unitId:n,sheetId:r,row:i,col:a,note:o,silent:s}=t;return e.get(c).updateNote(n,r,i,a,o,s),!0}},u={id:`sheet.mutation.remove-note`,type:t.CommandType.MUTATION,handler:(e,t)=>{let{unitId:n,sheetId:r,noteId:i,row:a,col:o,silent:s}=t;return e.get(c).removeNote(n,r,{noteId:i,row:a,col:o,silent:s}),!0}},d={id:`sheet.mutation.toggle-note-popup`,type:t.CommandType.MUTATION,handler:(e,t)=>{let{unitId:n,sheetId:r,noteId:i,row:a,col:o,silent:s}=t;return e.get(c).toggleNotePopup(n,r,{noteId:i,row:a,col:o,silent:s}),!0}},f={id:`sheet.mutation.update-note-position`,type:t.CommandType.MUTATION,handler:(e,t)=>{let{unitId:n,sheetId:r,noteId:i,row:a,col:o,newPosition:s,silent:l}=t;return e.get(c).updateNotePosition(n,r,{noteId:i,row:a,col:o,newRow:s.row,newCol:s.col,silent:l}),!0}},p={id:`sheet.command.delete-note`,type:t.CommandType.COMMAND,handler:e=>{let r=(0,n.getSheetCommandTarget)(e.get(t.IUniverInstanceService));if(!r)return!1;let i=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!(i!=null&&i.primary))return!1;let a=e.get(c),{unitId:o,subUnitId:s}=r,{actualColumn:d,actualRow:f}=i.primary,p=a.getNote(o,s,{row:f,col:d});if(!p)return!1;let m=e.get(t.ICommandService),h=e.get(t.IUndoRedoService),g={id:u.id,params:{unitId:o,sheetId:s,noteId:p.id}},_={id:l.id,params:{unitId:o,sheetId:s,row:f,col:d,note:{...p}}};return m.syncExecuteCommand(g.id,g.params)?(h.pushUndoRedo({unitID:o,redoMutations:[g],undoMutations:[_]}),!0):!1}},m={id:`sheet.command.toggle-note-popup`,type:t.CommandType.COMMAND,handler:e=>{let r=(0,n.getSheetCommandTarget)(e.get(t.IUniverInstanceService));if(!r)return!1;let i=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!(i!=null&&i.primary))return!1;let a=e.get(c),{unitId:o,subUnitId:s}=r,{actualColumn:l,actualRow:u}=i.primary,f=a.getNote(o,s,{row:u,col:l});if(!f)return!1;let p=e.get(t.ICommandService),m=e.get(t.IUndoRedoService),h={id:d.id,params:{unitId:o,sheetId:s,noteId:f.id}},g={id:d.id,params:{unitId:o,sheetId:s,noteId:f.id}};return p.syncExecuteCommand(h.id,h.params)?(m.pushUndoRedo({unitID:o,redoMutations:[h],undoMutations:[g]}),!0):!1}},h={id:`sheet.command.update-note`,type:t.CommandType.COMMAND,handler:(e,r)=>{let i=(0,n.getSheetCommandTarget)(e.get(t.IUniverInstanceService),r);if(!i)return!1;let a=e.get(t.ICommandService),o=e.get(t.IUndoRedoService),s=e.get(c),{unitId:d,subUnitId:f}=i,{row:p,col:m,note:h}=r,g=s.getNote(d,f,{noteId:h.id,row:p,col:m}),_={id:l.id,params:{unitId:d,sheetId:f,row:p,col:m,note:h}},v=[];if(g){let e={id:l.id,params:{unitId:d,sheetId:f,row:p,col:m,note:{...g}}};v.push(e)}else{let e={id:u.id,params:{unitId:d,sheetId:f,row:p,col:m}};v.push(e)}return a.syncExecuteCommand(_.id,_.params)?(o.pushUndoRedo({unitID:d,redoMutations:[_],undoMutations:v}),!0):!1}},g=`SHEET_NOTE_PLUGIN`;function _(e,t){return function(n,r){t(n,r,e)}}function v(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 y=class extends t.Disposable{constructor(e,t,n,r){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._sheetsNoteModel=r,this._initSnapshot(),this._initSheetChange()}_initSnapshot(){let e=e=>{let t=this._sheetsNoteModel.getUnitNotes(e);if(!t)return``;let n={};return t.forEach((e,t)=>{let r={};e.forEach(e=>{let{row:t,col:n}=e;r[t]||(r[t]={}),r[t][n]=e}),Object.keys(r).length>0&&(n[t]=r)}),JSON.stringify(n)},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:g,businesses:[t.UniverInstanceType.UNIVER_SHEET],toJson:t=>e(t),parseJson:e=>n(e),onUnLoad:e=>{this._sheetsNoteModel.deleteUnitNotes(e)},onLoad:(e,t)=>{Object.entries(t).forEach(([t,n])=>{Object.entries(n).forEach(([n,r])=>{Object.entries(r).forEach(([r,i])=>{this._sheetsNoteModel.updateNote(e,t,Number(n),Number(r),i)})})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===n.RemoveSheetCommand.id){var r;let n=e.params,i=n.unitId||this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET).getUnitId(),a=n.subUnitId||((r=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId());if(!i||!a)return{redos:[],undos:[]};let o=this._sheetsNoteModel.getSheetNotes(i,a);if(!o)return{redos:[],undos:[]};let s=[],c=[];return o.forEach(e=>{s.push({id:u.id,params:{unitId:i,sheetId:a,noteId:e.id,row:e.row,col:e.col}}),c.push({id:l.id,params:{unitId:i,sheetId:a,row:e.row,col:e.col,note:e}})}),{redos:s,undos:c}}else if(e.id===n.CopySheetCommand.id){let{unitId:n,subUnitId:r,targetSubUnitId:i}=e.params;if(!n||!r||!i)return{redos:[],undos:[]};let a=this._sheetsNoteModel.getSheetNotes(n,r);if(!a)return{redos:[],undos:[]};let o=[],s=[];return a.forEach(e=>{let r={...e,id:(0,t.generateRandomId)(6)};o.push({id:l.id,params:{unitId:n,sheetId:i,row:r.row,col:r.col,note:r}}),s.push({id:u.id,params:{unitId:n,sheetId:i,noteId:r.id,row:r.row,col:r.col}})}),{redos:o,undos:s}}return{redos:[],undos:[]}}}))}};y=v([_(0,t.IResourceManagerService),_(1,t.IUniverInstanceService),_(2,(0,t.Inject)(n.SheetInterceptorService)),_(3,(0,t.Inject)(c))],y);var b=`@univerjs/sheets-note`,x=`0.19.0`;let S=`sheets-note.config`;Symbol(S);let C={},w=class extends t.Disposable{constructor(e,t,n,r){super(),this._refRangeService=e,this._sheetsNoteModel=t,this._selectionManagerService=n,this._commandService=r,s(this,`_disposableMap`,new Map),s(this,`_watcherMap`,new Map),s(this,`_handleRangeChange`,(e,t,n,r,i,a,o)=>a?{redos:[{id:f.id,params:{unitId:e,sheetId:t,noteId:n.id,newPosition:{row:a.startRow,col:a.startColumn},silent:o}}],undos:[{id:f.id,params:{unitId:e,sheetId:t,noteId:n.id,newPosition:{row:r,col:i},note:n,silent:o}}]}:{redos:[{id:u.id,params:{unitId:e,sheetId:t,noteId:n.id}}],undos:[{id:l.id,params:{unitId:e,sheetId:t,row:r,col:i,note:n}}]}),this._initData(),this._initRefRange()}_getIdWithUnitId(e,t,n,r){return`${e}-${t}-${n}-${r}`}_register(e,t,r,i,a){let o={startColumn:a,endColumn:a,startRow:i,endRow:i};this._disposableMap.set(this._getIdWithUnitId(e,t,i,a),this._refRangeService.registerRefRange(o,s=>{let c=(0,n.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests)(o,s,{selectionManagerService:this._selectionManagerService}),l=Array.isArray(c)?c[0]:c;return l&&l.startColumn===o.startColumn&&l.startRow===o.startRow?{undos:[],redos:[]}:this._handleRangeChange(e,t,r,i,a,l,!1)},e,t))}_watch(e,n,r,i,a){let o={startColumn:a,endColumn:a,startRow:i,endRow:i};this._watcherMap.set(this._getIdWithUnitId(e,n,i,a),this._refRangeService.watchRange(e,n,o,(i,a)=>{let{redos:o}=this._handleRangeChange(e,n,r,i.startRow,i.startColumn,a,!0);(0,t.sequenceExecuteAsync)(o,this._commandService,{onlyLocal:!0})},!0))}_unwatch(e,t,n,r){var i;let a=this._getIdWithUnitId(e,t,n,r);(i=this._watcherMap.get(a))==null||i.dispose(),this._watcherMap.delete(a)}_unregister(e,t,n,r){var i;let a=this._getIdWithUnitId(e,t,n,r);(i=this._disposableMap.get(a))==null||i.dispose(),this._disposableMap.delete(a)}_initData(){let e=this._sheetsNoteModel.getNotes();for(let[t,n]of e)for(let[e,r]of n)r.forEach(n=>{this._register(t,e,n,n.row,n.col),this._watch(t,e,n,n.row,n.col)})}_initRefRange(){this.disposeWithMe(this._sheetsNoteModel.change$.subscribe(e=>{switch(e.type){case`update`:{let{unitId:t,subUnitId:n,oldNote:r,newNote:i}=e,a=i?i.row:r.row,o=i?i.col:r.col,s=this._getIdWithUnitId(t,n,a,o);i?this._disposableMap.has(s)||(this._register(t,n,i,a,o),this._watch(t,n,i,a,o)):(this._unregister(t,n,a,o),this._unwatch(t,n,a,o));break}case`ref`:{let{unitId:t,subUnitId:n,oldNote:r,newNote:i,silent:a}=e,{row:o,col:s}=r,{row:c,col:l}=i;this._unregister(t,n,o,s),a||(this._unwatch(t,n,o,s),this._watch(t,n,i,c,l)),this._register(t,n,i,c,l);break}}}))}};w=v([_(0,(0,t.Inject)(n.RefRangeService)),_(1,(0,t.Inject)(c)),_(2,(0,t.Inject)(n.SheetsSelectionsService)),_(3,t.ICommandService)],w);let T=class extends t.Disposable{constructor(e){super(),this._commandService=e,this._initialize()}_initialize(){[f,d,l,u,p,m,h].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}};T=v([_(0,t.ICommandService)],T);let E=class extends t.Plugin{constructor(e=C,n,r){super(),this._config=e,this._configService=n,this._injector=r;let{...i}=(0,t.merge)({},C,this._config);this._configService.setConfig(S,i)}onStarting(){[[c],[T],[y],[w]].forEach(e=>{this._injector.add(e)}),(0,t.touchDependencies)(this._injector,[[c],[T],[y]])}onReady(){(0,t.touchDependencies)(this._injector,[[w]])}};s(E,`pluginName`,g),s(E,`packageName`,b),s(E,`version`,x),s(E,`type`,t.UniverInstanceType.UNIVER_SHEET),E=v([(0,t.DependentOn)(n.UniverSheetsPlugin),_(1,t.IConfigService),_(2,(0,t.Inject)(t.Injector))],E),e.RemoveNoteMutation=u,e.SheetDeleteNoteCommand=p,e.SheetToggleNotePopupCommand=m,e.SheetUpdateNoteCommand=h,e.SheetsNoteModel=c,Object.defineProperty(e,`SheetsNoteResourceController`,{enumerable:!0,get:function(){return y}}),e.ToggleNotePopupMutation=d,Object.defineProperty(e,`UniverSheetsNotePlugin`,{enumerable:!0,get:function(){return E}}),e.UpdateNoteMutation=l,e.UpdateNotePositionMutation=f});
|
|
4
3
|
|
|
5
4
|
// @univerjs/sheets-note/facade
|
|
6
|
-
(function(
|
|
7
|
-
|
|
5
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core/facade`),require(`@univerjs/sheets-note`),require(`@univerjs/sheets/facade`),require(`@univerjs/core`),require(`@univerjs/sheets`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core/facade`,`@univerjs/sheets-note`,`@univerjs/sheets/facade`,`@univerjs/core`,`@univerjs/sheets`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNoteFacade={},e.UniverCoreFacade,e.UniverSheetsNote,e.UniverSheetsFacade,e.UniverCore,e.UniverSheets))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=class{get SheetNoteAdd(){return`SheetNoteAdd`}get SheetNoteDelete(){return`SheetNoteDelete`}get SheetNoteUpdate(){return`SheetNoteUpdate`}get SheetNoteShow(){return`SheetNoteShow`}get SheetNoteHide(){return`SheetNoteHide`}get BeforeSheetNoteAdd(){return`BeforeSheetNoteAdd`}get BeforeSheetNoteDelete(){return`BeforeSheetNoteDelete`}get BeforeSheetNoteUpdate(){return`BeforeSheetNoteUpdate`}get BeforeSheetNoteShow(){return`BeforeSheetNoteShow`}get BeforeSheetNoteHide(){return`BeforeSheetNoteHide`}};t.FEventName.extend(o);var s=class extends r.FRange{createOrUpdateNote(e){return this._commandService.syncExecuteCommand(n.UpdateNoteMutation.id,{unitId:this.getUnitId(),sheetId:this.getSheetId(),row:this.getRow(),col:this.getColumn(),note:e}),this}deleteNote(){return this._commandService.syncExecuteCommand(n.RemoveNoteMutation.id,{unitId:this.getUnitId(),sheetId:this.getSheetId(),row:this.getRow(),col:this.getColumn()}),this}getNote(){return this._injector.get(n.SheetsNoteModel).getNote(this.getUnitId(),this.getSheetId(),{row:this.getRow(),col:this.getColumn()})}};r.FRange.extend(s);var c=class extends t.FUniver{_initialize(e){let t=e.get(i.ICommandService);this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteAdd,()=>e.get(n.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&!e.oldNote&&e.newNote){let{unitId:t,subUnitId:n,newNote:r}=e,i=this.getSheetTarget(t,n);if(!i)return;let{workbook:a,worksheet:o}=i;this.fireEvent(this.Event.SheetNoteAdd,{workbook:a,worksheet:o,row:r.row,col:r.col,note:r})}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteDelete,()=>e.get(n.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&!e.newNote){let{unitId:t,subUnitId:n,oldNote:r}=e,i=this.getSheetTarget(t,n);if(!i)return;let{workbook:a,worksheet:o}=i;this.fireEvent(this.Event.SheetNoteDelete,{workbook:a,worksheet:o,row:r.row,col:r.col,oldNote:r})}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteUpdate,()=>e.get(n.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&e.newNote){let{unitId:t,subUnitId:n,oldNote:r,newNote:i}=e,a=this.getSheetTarget(t,n);if(!a)return;let{workbook:o,worksheet:s}=a;this.fireEvent(this.Event.SheetNoteUpdate,{workbook:o,worksheet:s,row:i.row,col:i.col,note:i,oldNote:r})}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteShow,()=>e.get(n.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&e.newNote&&!e.oldNote.show&&e.newNote.show){let{unitId:t,subUnitId:n,newNote:r}=e,i=this.getSheetTarget(t,n);if(!i)return;let{workbook:a,worksheet:o}=i;this.fireEvent(this.Event.SheetNoteShow,{workbook:a,worksheet:o,row:r.row,col:r.col})}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteHide,()=>e.get(n.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&e.newNote&&e.oldNote.show&&!e.newNote.show){let{unitId:t,subUnitId:n,newNote:r}=e,i=this.getSheetTarget(t,n);if(!i)return;let{workbook:a,worksheet:o}=i;this.fireEvent(this.Event.SheetNoteHide,{workbook:a,worksheet:o,row:r.row,col:r.col})}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteAdd,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetUpdateNoteCommand.id){let{unitId:r,sheetId:a,row:o,col:s,note:c}=t.params,l=this.getSheetTarget(r,a);if(!l||e.get(n.SheetsNoteModel).getNote(r,a,{noteId:c.id,row:o,col:s}))return;let{workbook:u,worksheet:d}=l;if(this.fireEvent(this.Event.BeforeSheetNoteAdd,{workbook:u,worksheet:d,row:o,col:s,note:c}))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteDelete,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetDeleteNoteCommand.id){let{unitId:r,sheetId:a,row:o,col:s}=t.params,c=this.getSheetTarget(r,a);if(!c||o===void 0||s===void 0)return;let l=e.get(n.SheetsNoteModel).getNote(r,a,{row:o,col:s});if(!l)return;let{workbook:u,worksheet:d}=c;if(this.fireEvent(this.Event.BeforeSheetNoteDelete,{workbook:u,worksheet:d,row:o,col:s,oldNote:l}))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteUpdate,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetUpdateNoteCommand.id){let{unitId:r,sheetId:a,row:o,col:s,note:c}=t.params,l=this.getSheetTarget(r,a);if(!l)return;let u=e.get(n.SheetsNoteModel).getNote(r,a,{row:o,col:s});if(!u)return;let{workbook:d,worksheet:f}=l;if(this.fireEvent(this.Event.BeforeSheetNoteUpdate,{workbook:d,worksheet:f,row:o,col:s,note:c,oldNote:u}))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteShow,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetToggleNotePopupCommand.id){let t=(0,a.getSheetCommandTarget)(e.get(i.IUniverInstanceService));if(!t)return;let{unitId:r,subUnitId:o}=t,s=this.getUniverSheet(r);if(!s)return;let c=s.getSheetBySheetId(o);if(!c)return;let l=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(l!=null&&l.primary))return;let u=e.get(n.SheetsNoteModel),{actualColumn:d,actualRow:f}=l.primary,p=u.getNote(r,o,{row:f,col:d});if(!p||p.show)return;if(this.fireEvent(this.Event.BeforeSheetNoteShow,{workbook:s,worksheet:c,row:f,col:d}))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteHide,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetToggleNotePopupCommand.id){let t=(0,a.getSheetCommandTarget)(e.get(i.IUniverInstanceService));if(!t)return;let{unitId:r,subUnitId:o}=t,s=this.getUniverSheet(r);if(!s)return;let c=s.getSheetBySheetId(o);if(!c)return;let l=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(l!=null&&l.primary))return;let u=e.get(n.SheetsNoteModel),{actualColumn:d,actualRow:f}=l.primary,p=u.getNote(r,o,{row:f,col:d});if(!p||!p.show)return;if(this.fireEvent(this.Event.BeforeSheetNoteHide,{workbook:s,worksheet:c,row:f,col:d}))throw new i.CanceledError}})))}};t.FUniver.extend(c);var l=class extends r.FWorksheet{getNotes(){let e=this._injector.get(n.SheetsNoteModel).getSheetNotes(this.getWorkbook().getUnitId(),this.getSheetId());return e?Array.from(e.values()).map(e=>({...e})):[]}};r.FWorksheet.extend(l),e.FSheetNoteEvent=o,e.FSheetsNoteRangeMixin=s,e.FSheetsNoteWorksheet=l,e.FUniverSheetNoteMixin=c});
|
|
8
6
|
|
|
9
7
|
// @univerjs/sheets-note-ui/index
|
|
10
|
-
(function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("@univerjs/sheets-note"),require("rxjs"),require("@univerjs/sheets-ui"),require("rxjs/operators"),require("@univerjs/ui"),require("react"),require("react/jsx-runtime"),require("@univerjs/design")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets","@univerjs/sheets-note","rxjs","@univerjs/sheets-ui","rxjs/operators","@univerjs/ui","react","react/jsx-runtime","@univerjs/design"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.UniverSheetsNoteUi={},c.UniverCore,c.UniverEngineRender,c.UniverSheets,c.UniverSheetsNote,c.rxjs,c.UniverSheetsUi,c.rxjs.operators,c.UniverUi,c.React,c.React,c.UniverDesign))})(this,(function(c,a,y,N,I,b,E,ue,f,g,le,F){"use strict";var He=Object.defineProperty;var Re=(c,a,y)=>a in c?He(c,a,{enumerable:!0,configurable:!0,writable:!0,value:y}):c[a]=y;var $=(c,a,y)=>Re(c,typeof a!="symbol"?a+"":a,y);var pe=Object.getOwnPropertyDescriptor,he=(r,t,e,n)=>{for(var i=n>1?void 0:n?pe(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},D=(r,t)=>(e,n)=>t(e,n,r);c.SheetsCellContentController=class extends a.Disposable{constructor(t,e,n,i){super(),this._sheetInterceptorService=t,this._sheetsNoteModel=e,this._renderManagerService=n,this._univerInstanceService=i,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(N.INTERCEPTOR_POINT.CELL_CONTENT,{effect:a.InterceptorEffectEnum.Style,handler:(t,e,n)=>{const{row:i,col:o,unitId:s,subUnitId:l}=e;return this._sheetsNoteModel.getNote(s,l,{row:i,col:o})&&((!t||t===e.rawData)&&(t={...e.rawData}),t.markers={...t==null?void 0:t.markers,tr:{color:"#FFBD37",size:6}}),n(t)},priority:100}))}_initSkeletonChange(){const t=()=>{var o;const e=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!e)return;const n=e.getUnitId(),i=this._renderManagerService.getRenderById(n);(o=i==null?void 0:i.mainComponent)==null||o.makeForceDirty()};this.disposeWithMe(this._sheetsNoteModel.change$.pipe(b.debounceTime(16)).subscribe(()=>{t()}))}},c.SheetsCellContentController=he([D(0,a.Inject(N.SheetInterceptorService)),D(1,a.Inject(I.SheetsNoteModel)),D(2,y.IRenderManagerService),D(3,a.IUniverInstanceService)],c.SheetsCellContentController);const Z="SHEET_NOTE_COMPONENT";var de=Object.getOwnPropertyDescriptor,ve=(r,t,e,n)=>{for(var i=n>1?void 0:n?de(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},q=(r,t)=>(e,n)=>t(e,n,r);c.SheetsNotePopupService=class extends a.Disposable{constructor(e,n){super();$(this,"_lastPopup",null);$(this,"_activePopup");$(this,"_activePopup$",new b.BehaviorSubject(null));$(this,"activePopup$",this._activePopup$.asObservable());this._zenZoneService=e,this._cellPopupManagerService=n,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var p;const{row:i,col:o,unitId:s,subUnitId:l}=e;if(this._activePopup&&i===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&l===((p=this.activePopup)==null?void 0:p.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);const u=this._cellPopupManagerService.showPopup({unitId:s,subUnitId:l,row:i,col:o},{componentKey:Z,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",extraProps:{location:e},priority:3});if(!u)throw new Error("[SheetsNotePopupService]: cannot show popup!");const d=new a.DisposableCollection;d.add(u),d.add({dispose:()=>{n==null||n()}}),this._lastPopup=d}hidePopup(e){this._activePopup&&(!e&&!this._activePopup.temp||(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.SheetsNotePopupService=ve([q(0,f.IZenZoneService),q(1,a.Inject(E.CellPopupManagerService))],c.SheetsNotePopupService);var Ce=Object.getOwnPropertyDescriptor,fe=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ce(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},O=(r,t)=>(e,n)=>t(e,n,r);c.SheetsNotePopupController=class extends a.Disposable{constructor(e,n,i,o,s,l){super();$(this,"_isSwitchingSheet",!1);this._sheetsNotePopupService=e,this._sheetsNoteModel=n,this._sheetSelectionService=i,this._editorBridgeService=o,this._renderManagerService=s,this._hoverManagerService=l,this._initSelectionUpdateListener(),this._initEditorBridge(),this._initHoverEvent(),this._initDeleteNoteListener()}_handleSelectionChange(e,n,i){var S,M,w;const o=(S=e[0])==null?void 0:S.range,s=this._renderManagerService.getRenderById(n),l=(M=s==null?void 0:s.with(E.SheetSkeletonManagerService).getSkeletonParam(i))==null?void 0:M.skeleton;if(!l||!o)return;const u=l.getCellWithCoordByIndex(o.startRow,o.startColumn);if((((w=o.rangeType)!=null?w:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||o.endColumn-o.startColumn>0||o.endRow-o.startRow>0)&&!((u.isMerged||u.isMergedMainCell)&&a.Rectangle.equals(u.mergeInfo,o))){this._sheetsNotePopupService.hidePopup();return}const p=u.actualRow,h=u.actualColumn,C=this._sheetsNoteModel.getNote(n,i,{row:p,col:h});C!=null&&C.show||(C?this._sheetsNotePopupService.showPopup({unitId:n,subUnitId:i,noteId:C.id,row:p,col:h}):this._sheetsNotePopupService.hidePopup(!0))}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchingSheet)return;const n=this._sheetSelectionService.currentSelectionParam;n&&this._handleSelectionChange(e,n.unitId,n.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible&&this._sheetsNotePopupService.hidePopup(!0)}))}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(ue.debounceTime(100)).subscribe(e=>{var C;if(!(e!=null&&e.location))return;const{unitId:n,subUnitId:i,row:o,col:s}=e.location,l=this._renderManagerService.getRenderById(n),u=(C=l==null?void 0:l.with(E.SheetSkeletonManagerService).getSkeletonParam(i))==null?void 0:C.skeleton;let d=o,p=s,h=this._sheetsNoteModel.getNote(n,i,{row:d,col:p});if(!h&&u){const S=u.getCellWithCoordByIndex(o,s),{startRow:M,endRow:w,startColumn:U,endColumn:v}=S.mergeInfo;if(M!==w||U!==v){const _=this._sheetsNoteModel.getSheetNotes(n,i);if(_){for(const[T,m]of _)if(m.row>=M&&m.row<=w&&m.col>=U&&m.col<=v){h=m,d=m.row,p=m.col;break}}}}h!=null&&h.show||(h?this._sheetsNotePopupService.showPopup({unitId:n,subUnitId:i,noteId:h.id,row:d,col:p,temp:!0}):this._sheetsNotePopupService.hidePopup())}))}_initDeleteNoteListener(){this.disposeWithMe(this._sheetsNoteModel.change$.subscribe(e=>{if(!this._sheetsNotePopupService.activePopup)return;const{unitId:n,subUnitId:i,noteId:o,row:s,col:l}=this._sheetsNotePopupService.activePopup,{oldNote:u,newNote:d}=e;d===null&&e.unitId===n&&e.subUnitId===i&&(u!=null&&u.id&&u.id===o||(u==null?void 0:u.row)===s&&u.col===l)&&this._sheetsNotePopupService.hidePopup(!0)}))}},c.SheetsNotePopupController=fe([O(0,a.Inject(c.SheetsNotePopupService)),O(1,a.Inject(I.SheetsNoteModel)),O(2,a.Inject(N.SheetsSelectionsService)),O(3,E.IEditorBridgeService),O(4,y.IRenderManagerService),O(5,a.Inject(E.HoverManagerService))],c.SheetsNotePopupController);const z={name:"@univerjs/sheets-note-ui",version:"0.17.0"},G="sheets-note-ui.config",K={};var _e=Object.getOwnPropertyDescriptor,ge=(r,t,e,n)=>{for(var i=n>1?void 0:n?_e(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},H=(r,t)=>(e,n)=>t(e,n,r);let R=class extends a.Disposable{constructor(t,e,n,i){super();$(this,"_noteMatrix",new a.ObjectMatrix);this._sheetsNoteModel=t,this._univerInstanceService=e,this._cellPopupManagerService=n,this._sheetsNotePopupService=i,this._initNoteChangeListener()}_showPopup(t,e,n,i){return this._sheetsNotePopupService.hidePopup(!0),this._cellPopupManagerService.showPopup({unitId:t,subUnitId:e,row:n,col:i},{componentKey:Z,direction:"horizontal",extraProps:{location:{unitId:t,subUnitId:e,row:n,col:i}},priority:3})}dispose(){super.dispose(),this._noteMatrix.forValue((t,e,n)=>{n.dispose()})}_initSheet(t,e){var o;this._noteMatrix.forValue((s,l,u)=>{u.dispose()}),this._noteMatrix=new a.ObjectMatrix;const i=(s,l,u,d,p)=>{const h=this._noteMatrix,C=h.getValue(u,d);if(p!=null&&p.show){if(!C){const S=this._showPopup(s,l,u,d);S&&h.setValue(u,d,S)}}else C&&(C.dispose(),h.realDeleteValue(u,d))};return(o=this._sheetsNoteModel.getSheetNotes(t,e))==null||o.forEach(s=>{i(t,e,s.row,s.col,s)}),this._sheetsNoteModel.change$.subscribe(s=>{if(!(s.unitId!==t||s.subUnitId!==e))switch(s.type){case"ref":{const{unitId:l,subUnitId:u,oldNote:d,newNote:p}=s;if(!p.show)return;const h=this._noteMatrix,{row:C,col:S}=d,{row:M,col:w}=p,U=h.getValue(C,S);U&&(U.dispose(),h.realDeleteValue(C,S));const v=this._showPopup(l,u,M,w);v&&h.setValue(M,w,v);break}case"update":{const{unitId:l,subUnitId:u,oldNote:d,newNote:p}=s,h=p?p.row:d.row,C=p?p.col:d.col;i(l,u,h,C,p);break}}})}_initNoteChangeListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SHEET).pipe(b.switchMap(t=>{var e;return(e=t==null?void 0:t.activeSheet$)!=null?e:b.of(null)})).subscribe(t=>{if(t){const e=this._initSheet(t.getUnitId(),t.getSheetId());return()=>{e.unsubscribe()}}else this._noteMatrix.forValue((e,n,i)=>{i.dispose()}),this._noteMatrix=new a.ObjectMatrix}))}};R=ge([H(0,a.Inject(I.SheetsNoteModel)),H(1,a.Inject(a.IUniverInstanceService)),H(2,a.Inject(E.CellPopupManagerService)),H(3,a.Inject(c.SheetsNotePopupService))],R);function L({ref:r,...t}){const{icon:e,id:n,className:i,extend:o,...s}=t,l=`univerjs-icon univerjs-icon-${n} ${i||""}`.trim(),u=g.useRef(`_${Ie()}`);return Y(e,`${n}`,{defIds:e.defIds,idSuffix:u.current},{ref:r,className:l,...s},o)}function Y(r,t,e,n,i){return g.createElement(r.tag,{key:t,...Se(r,e,i),...n},(me(r,e).children||[]).map((o,s)=>Y(o,`${t}-${r.tag}-${s}`,e,void 0,i)))}function Se(r,t,e){const n={...r.attrs};e!=null&&e.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=e.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(([o,s])=>{o==="mask"&&typeof s=="string"&&(n[o]=s.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});const{defIds:i}=t;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(([o,s])=>{typeof s=="string"&&(n[o]=s.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),n}function me(r,t){var n;const{defIds:e}=t;return!e||e.length===0?r:r.tag==="defs"&&((n=r.children)!=null&&n.length)?{...r,children:r.children.map(i=>typeof i.attrs.id=="string"&&e&&e.includes(i.attrs.id)?{...i,attrs:{...i.attrs,id:i.attrs.id+t.idSuffix}}:i)}:r}function Ie(){return Math.random().toString(36).substring(2,8)}L.displayName="UniverIcon";const Pe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745C11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962C11.1791 15.0962 10.8814 14.7983 10.8813 14.4312Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.47697 11.6968H11.5463H13.6156C13.9829 11.6968 14.2807 11.9946 14.2807 12.3618C14.2807 12.7291 13.9829 13.0269 13.6156 13.0269H9.47697C9.10981 13.0267 8.81193 12.729 8.81193 12.3618C8.81193 11.9946 9.10981 11.6969 9.47697 11.6968Z"}}]},J=g.forwardRef(function(t,e){return g.createElement(L,Object.assign({},t,{id:"add-note-icon",ref:e,icon:Pe}))});J.displayName="AddNoteIcon";const Ne={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618C14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618C8.80985 11.9946 9.10762 11.6968 9.47489 11.6968Z"}}]},Q=g.forwardRef(function(t,e){return g.createElement(L,Object.assign({},t,{id:"delete-note-icon",ref:e,icon:Ne}))});Q.displayName="DeleteNoteIcon";const Me={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477C13.039 11.6659 12.5573 11.4614 12.0394 11.4614C11.5213 11.4614 11.0398 11.6666 10.6878 11.9487C10.3037 12.2565 10.2045 12.5399 10.2044 12.6147C10.2044 12.6893 10.3034 12.9737 10.6878 13.2817C11.0398 13.5636 11.5215 13.768 12.0394 13.768C12.5574 13.768 13.039 13.5635 13.3909 13.2817C13.7751 12.9739 13.8743 12.6897 13.8743 12.6147ZM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198C13.6701 14.7627 12.9019 15.0981 12.0394 15.0981C11.1768 15.0981 10.4085 14.7627 9.85577 14.3198C9.33533 13.9027 8.87433 13.2769 8.87433 12.6147C8.8744 11.9526 9.33541 11.3276 9.85577 10.9106C10.4086 10.4676 11.1767 10.1313 12.0394 10.1313C12.9018 10.1313 13.6701 10.4668 14.223 10.9096C14.7435 11.3267 15.2043 11.9523 15.2044 12.6147Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.0394 13.299C12.4172 13.299 12.7234 12.9927 12.7234 12.6149C12.7234 12.2371 12.4172 11.9308 12.0394 11.9308C11.6616 11.9308 11.3553 12.2371 11.3553 12.6149C11.3553 12.9927 11.6616 13.299 12.0394 13.299Z"}}]},X=g.forwardRef(function(t,e){return g.createElement(L,Object.assign({},t,{id:"hide-note-icon",ref:e,icon:Me}))});X.displayName="HideNoteIcon";const V={id:"sheet.operation.add-note-popup",type:a.CommandType.OPERATION,handler:async(r,t)=>{var d;const e=r.get(N.SheetsSelectionsService),n=r.get(c.SheetsNotePopupService),o=r.get(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!o)return!1;const s=o.getActiveSheet(),l=e.getCurrentLastSelection();if(!(l!=null&&l.primary))return!1;const{primary:u}=l;return n.showPopup({unitId:o.getUnitId(),subUnitId:s.getSheetId(),row:u.actualRow,col:u.actualColumn,temp:!1,trigger:(d=t==null?void 0:t.trigger)!=null?d:"add-note"}),!0}};function B(r){const t=r.get(N.SheetsSelectionsService),e=r.get(a.IUniverInstanceService);return t.selectionMoveEnd$.pipe(b.map(()=>{const n=t.getCurrentLastSelection();if(!(n!=null&&n.primary))return!1;const i=N.getSheetCommandTarget(e);if(!i)return!1;const{actualColumn:o,actualRow:s}=n.primary;return!!r.get(I.SheetsNoteModel).getNote(i.unitId,i.subUnitId,{row:s,col:o})}))}function we(r){return{id:V.id,type:f.MenuItemType.BUTTON,title:"rightClick.addNote",icon:"AddNoteIcon",hidden$:b.combineLatest([f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SHEET),B(r)]).pipe(b.map(([t,e])=>t||e)),disabled$:E.getCurrentRangeDisable$(r,{workbookTypes:[N.WorkbookEditablePermission],worksheetTypes:[N.WorksheetEditPermission]}),commandId:V.id}}function be(r){return{id:I.SheetDeleteNoteCommand.id,type:f.MenuItemType.BUTTON,title:"rightClick.deleteNote",icon:"DeleteNoteIcon",hidden$:B(r).pipe(b.map(t=>!t)),disabled$:E.getCurrentRangeDisable$(r,{workbookTypes:[N.WorkbookEditablePermission],worksheetTypes:[N.WorksheetEditPermission]})}}function ye(r){return{id:I.SheetToggleNotePopupCommand.id,type:f.MenuItemType.BUTTON,title:"rightClick.toggleNote",icon:"HideNoteIcon",hidden$:B(r).pipe(b.map(t=>!t))}}const Ee={[f.ContextMenuPosition.MAIN_AREA]:{[f.ContextMenuGroup.OTHERS]:{order:0,[V.id]:{order:0,menuItemFactory:we},[I.SheetDeleteNoteCommand.id]:{order:0,menuItemFactory:be},[I.SheetToggleNotePopupCommand.id]:{order:0,menuItemFactory:ye}}}},ee=r=>{var U;const{popup:t}=r,e=f.useDependency(I.SheetsNoteModel),n=f.useDependency(a.LocaleService),i=f.useDependency(y.IRenderManagerService),o=f.useDependency(c.SheetsNotePopupService),s=f.useConfigValue(G),l=(U=t.extraProps)==null?void 0:U.location;if(!l)return console.error("Popup extraProps or location is undefined."),null;const u=g.useRef(null),d=i.getRenderById(l.unitId),[p,h]=g.useState(null);g.useEffect(()=>{var ne,ie,re,oe,se,ae;const{unitId:v,subUnitId:_,row:T,col:m}=l,P=e.getNote(v,_,{row:T,col:m}),W=(re=(ie=P==null?void 0:P.width)!=null?ie:(ne=s==null?void 0:s.defaultNoteSize)==null?void 0:ne.width)!=null?re:160,j=(ae=(se=P==null?void 0:P.height)!=null?se:(oe=s==null?void 0:s.defaultNoteSize)==null?void 0:oe.height)!=null?ae:72;if(P)h(P);else{const ce={id:a.generateRandomId(6),width:W,height:j,note:""};h(ce),S(ce)}u.current&&(u.current.style.width=`${W}px`,u.current.style.height=`${j}px`)},[l,u]),g.useEffect(()=>{if(!l||l.temp||!l.trigger||!u.current)return;const v=requestAnimationFrame(()=>{var _;(_=u.current)==null||_.focus()});return()=>cancelAnimationFrame(v)},[l]);const C=f.useDependency(a.ICommandService),S=f.useDebounceFn(v=>{if(!l)return;const{unitId:_,subUnitId:T,row:m,col:P}=l;if(!C.syncExecuteCommand(I.SheetUpdateNoteCommand.id,{unitId:_,sheetId:T,row:m,col:P,note:v})){const j=e.getNote(_,T,{noteId:v.id,row:m,col:P});j?h(j):o.hidePopup(!0)}}),M=g.useCallback(v=>{if(!p||v===p.note)return;const _={...p,note:v};h(_),S(_)},[p]),w=g.useCallback((v,_)=>{if(!p||v===p.width&&_===p.height)return;const T={...p,width:v,height:_};h(T),S(T)},[p]);return le.jsx(F.Textarea,{ref:u,"data-u-comp":"note-textarea",className:F.clsx("univer-ml-px univer-min-h-1 univer-min-w-1 univer-bg-white !univer-text-sm univer-shadow dark:!univer-bg-gray-800"),value:p==null?void 0:p.note,placeholder:n.t("note.placeholder"),onResize:w,onValueChange:M,onWheel:v=>{document.activeElement!==u.current&&d.engine.getCanvasElement().dispatchEvent(new WheelEvent(v.type,v.nativeEvent))}})};var Ue=Object.getOwnPropertyDescriptor,Te=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ue(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},A=(r,t)=>(e,n)=>t(e,n,r);let x=class extends a.Disposable{constructor(r,t,e){super(),this._componentManager=r,this._menuManagerService=t,this._commandService=e,this._initComponents(),this._initMenu(),this._initCommands()}_initComponents(){[[Z,ee],["AddNoteIcon",J],["DeleteNoteIcon",Q],["HideNoteIcon",X]].forEach(([r,t])=>{this.disposeWithMe(this._componentManager.register(r,t))})}_initMenu(){this._menuManagerService.mergeMenu(Ee)}_initCommands(){this._commandService.registerCommand(V)}};x=Te([A(0,a.Inject(f.ComponentManager)),A(1,a.Inject(f.IMenuManagerService)),A(2,a.ICommandService)],x);var $e=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,je=(r,t,e)=>t in r?$e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,De=(r,t,e,n)=>{for(var i=n>1?void 0:n?Oe(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i},te=(r,t)=>(e,n)=>t(e,n,r),k=(r,t,e)=>je(r,typeof t!="symbol"?t+"":t,e);c.UniverSheetsNoteUIPlugin=class extends a.Plugin{constructor(t=K,e,n){super(),this._config=t,this._injector=e,this._configService=n;const{menu:i,...o}=a.merge({},K,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(G,o)}onStarting(){[[c.SheetsNotePopupService],[c.SheetsCellContentController],[c.SheetsNotePopupController],[x],[R]].forEach(t=>{this._injector.add(t)})}onReady(){a.touchDependencies(this._injector,[[x],[c.SheetsCellContentController]])}onRendered(){a.touchDependencies(this._injector,[[c.SheetsNotePopupController],[R]])}},k(c.UniverSheetsNoteUIPlugin,"pluginName","SHEET_NOTE_UI_PLUGIN"),k(c.UniverSheetsNoteUIPlugin,"packageName",z.name),k(c.UniverSheetsNoteUIPlugin,"version",z.version),k(c.UniverSheetsNoteUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),c.UniverSheetsNoteUIPlugin=De([a.DependentOn(I.UniverSheetsNotePlugin),te(1,a.Inject(a.Injector)),te(2,a.IConfigService)],c.UniverSheetsNoteUIPlugin),c.SheetsNote=ee,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|
|
11
|
-
|
|
8
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/engine-render`),require(`@univerjs/sheets`),require(`@univerjs/sheets-note`),require(`rxjs`),require(`@univerjs/sheets-ui`),require(`rxjs/operators`),require(`@univerjs/ui`),require(`react`),require(`@univerjs/design`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/engine-render`,`@univerjs/sheets`,`@univerjs/sheets-note`,`rxjs`,`@univerjs/sheets-ui`,`rxjs/operators`,`@univerjs/ui`,`react`,`@univerjs/design`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNoteUi={},e.UniverCore,e.UniverEngineRender,e.UniverSheets,e.UniverSheetsNote,e.rxjs,e.UniverSheetsUi,e.rxjs.operators,e.UniverUi,e.React,e.UniverDesign,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function f(e,t){return function(n,r){t(n,r,e)}}function p(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 m=class extends t.Disposable{constructor(e,t,n,r){super(),this._sheetInterceptorService=e,this._sheetsNoteModel=t,this._renderManagerService=n,this._univerInstanceService=r,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(r.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t;return this._sheetsNoteModel.getNote(a,o,{row:r,col: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._sheetsNoteModel.change$.pipe((0,a.debounceTime)(16)).subscribe(()=>{e()}))}};m=p([f(0,(0,t.Inject)(r.SheetInterceptorService)),f(1,(0,t.Inject)(i.SheetsNoteModel)),f(2,n.IRenderManagerService),f(3,t.IUniverInstanceService)],m);let h=`SHEET_NOTE_COMPONENT`;function g(e){"@babel/helpers - typeof";return g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g(e)}function _(e,t){if(g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v(e){var t=_(e,`string`);return g(t)==`symbol`?t:t+``}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let b=class extends t.Disposable{get activePopup(){return this._activePopup}constructor(e,t){super(),this._zenZoneService=e,this._cellPopupManagerService=t,y(this,`_lastPopup`,null),y(this,`_activePopup`,void 0),y(this,`_activePopup$`,new a.BehaviorSubject(null)),y(this,`activePopup$`,this._activePopup$.asObservable()),this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}dispose(){super.dispose(),this.hidePopup()}showPopup(e,n){var r;let{row:i,col:a,unitId:o,subUnitId:s}=e;if(this._activePopup&&i===this._activePopup.row&&a===this._activePopup.col&&o===this._activePopup.unitId&&s===((r=this.activePopup)==null?void 0:r.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=e,this._activePopup$.next(e);let c=this._cellPopupManagerService.showPopup({unitId:o,subUnitId:s,row:i,col:a},{componentKey:h,onClickOutside:()=>{this.hidePopup()},direction:`horizontal`,extraProps:{location:e},priority:3});if(!c)throw Error(`[SheetsNotePopupService]: cannot show popup!`);let l=new t.DisposableCollection;l.add(c),l.add({dispose:()=>{n==null||n()}}),this._lastPopup=l}hidePopup(e){this._activePopup&&(!e&&!this._activePopup.temp||(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))}};b=p([f(0,c.IZenZoneService),f(1,(0,t.Inject)(o.CellPopupManagerService))],b);let x=class extends t.Disposable{constructor(e,t,n,r,i,a){super(),this._sheetsNotePopupService=e,this._sheetsNoteModel=t,this._sheetSelectionService=n,this._editorBridgeService=r,this._renderManagerService=i,this._hoverManagerService=a,y(this,`_isSwitchingSheet`,!1),this._initSelectionUpdateListener(),this._initEditorBridge(),this._initHoverEvent(),this._initDeleteNoteListener()}_handleSelectionChange(e,n,r){var i,a,s;let c=(i=e[0])==null?void 0:i.range,l=this._renderManagerService.getRenderById(n),u=l==null||(a=l.with(o.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:a.skeleton;if(!u||!c)return;let d=u.getCellWithCoordByIndex(c.startRow,c.startColumn);if((((s=c.rangeType)==null?t.RANGE_TYPE.NORMAL:s)!==t.RANGE_TYPE.NORMAL||c.endColumn-c.startColumn>0||c.endRow-c.startRow>0)&&!((d.isMerged||d.isMergedMainCell)&&t.Rectangle.equals(d.mergeInfo,c))){this._sheetsNotePopupService.hidePopup();return}let f=d.actualRow,p=d.actualColumn,m=this._sheetsNoteModel.getNote(n,r,{row:f,col:p});m!=null&&m.show||(m?this._sheetsNotePopupService.showPopup({unitId:n,subUnitId:r,noteId:m.id,row:f,col:p}):this._sheetsNotePopupService.hidePopup(!0))}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(e=>{if(this._isSwitchingSheet)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._sheetsNotePopupService.hidePopup(!0)}))}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0,s.debounceTime)(100)).subscribe(e=>{var t;if(!(e!=null&&e.location))return;let{unitId:n,subUnitId:r,row:i,col:a}=e.location,s=this._renderManagerService.getRenderById(n),c=s==null||(t=s.with(o.SheetSkeletonManagerService).getSkeletonParam(r))==null?void 0:t.skeleton,l=i,u=a,d=this._sheetsNoteModel.getNote(n,r,{row:l,col:u});if(!d&&c){let{startRow:e,endRow:t,startColumn:o,endColumn:s}=c.getCellWithCoordByIndex(i,a).mergeInfo;if(e!==t||o!==s){let i=this._sheetsNoteModel.getSheetNotes(n,r);if(i){for(let[n,r]of i)if(r.row>=e&&r.row<=t&&r.col>=o&&r.col<=s){d=r,l=r.row,u=r.col;break}}}}d!=null&&d.show||(d?this._sheetsNotePopupService.showPopup({unitId:n,subUnitId:r,noteId:d.id,row:l,col:u,temp:!0}):this._sheetsNotePopupService.hidePopup())}))}_initDeleteNoteListener(){this.disposeWithMe(this._sheetsNoteModel.change$.subscribe(e=>{if(!this._sheetsNotePopupService.activePopup)return;let{unitId:t,subUnitId:n,noteId:r,row:i,col:a}=this._sheetsNotePopupService.activePopup,{oldNote:o,newNote:s}=e;s===null&&e.unitId===t&&e.subUnitId===n&&(o!=null&&o.id&&o.id===r||(o==null?void 0:o.row)===i&&o.col===a)&&this._sheetsNotePopupService.hidePopup(!0)}))}};x=p([f(0,(0,t.Inject)(b)),f(1,(0,t.Inject)(i.SheetsNoteModel)),f(2,(0,t.Inject)(r.SheetsSelectionsService)),f(3,o.IEditorBridgeService),f(4,n.IRenderManagerService),f(5,(0,t.Inject)(o.HoverManagerService))],x);var S=`@univerjs/sheets-note-ui`,C=`0.19.0`;let w=`sheets-note-ui.config`;Symbol(w);let T={},E=class extends t.Disposable{constructor(e,n,r,i){super(),this._sheetsNoteModel=e,this._univerInstanceService=n,this._cellPopupManagerService=r,this._sheetsNotePopupService=i,y(this,`_noteMatrix`,new t.ObjectMatrix),this._initNoteChangeListener()}_showPopup(e,t,n,r){return this._sheetsNotePopupService.hidePopup(!0),this._cellPopupManagerService.showPopup({unitId:e,subUnitId:t,row:n,col:r},{componentKey:h,direction:`horizontal`,extraProps:{location:{unitId:e,subUnitId:t,row:n,col:r}},priority:3})}dispose(){super.dispose(),this._noteMatrix.forValue((e,t,n)=>{n.dispose()})}_initSheet(e,n){var r;this._noteMatrix.forValue((e,t,n)=>{n.dispose()}),this._noteMatrix=new t.ObjectMatrix;let i=(e,t,n,r,i)=>{let a=this._noteMatrix,o=a.getValue(n,r);if(i!=null&&i.show){if(!o){let i=this._showPopup(e,t,n,r);i&&a.setValue(n,r,i)}}else o&&(o.dispose(),a.realDeleteValue(n,r))};return(r=this._sheetsNoteModel.getSheetNotes(e,n))==null||r.forEach(t=>{i(e,n,t.row,t.col,t)}),this._sheetsNoteModel.change$.subscribe(t=>{if(!(t.unitId!==e||t.subUnitId!==n))switch(t.type){case`ref`:{let{unitId:e,subUnitId:n,oldNote:r,newNote:i}=t;if(!i.show)return;let a=this._noteMatrix,{row:o,col:s}=r,{row:c,col:l}=i,u=a.getValue(o,s);u&&(u.dispose(),a.realDeleteValue(o,s));let d=this._showPopup(e,n,c,l);d&&a.setValue(c,l,d);break}case`update`:{let{unitId:e,subUnitId:n,oldNote:r,newNote:a}=t;i(e,n,a?a.row:r.row,a?a.col:r.col,a);break}default:break}})}_initNoteChangeListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_SHEET).pipe((0,a.switchMap)(e=>{var t;return(t=e==null?void 0:e.activeSheet$)==null?(0,a.of)(null):t})).subscribe(e=>{if(e){let t=this._initSheet(e.getUnitId(),e.getSheetId());return()=>{t.unsubscribe()}}else this._noteMatrix.forValue((e,t,n)=>{n.dispose()}),this._noteMatrix=new t.ObjectMatrix}))}};E=p([f(0,(0,t.Inject)(i.SheetsNoteModel)),f(1,(0,t.Inject)(t.IUniverInstanceService)),f(2,(0,t.Inject)(o.CellPopupManagerService)),f(3,(0,t.Inject)(b))],E);function D({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,l.useRef)(`_${j()}`);return O(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function O(e,t,n,r,i){return(0,l.createElement)(e.tag,{key:t,...k(e,n,i),...r},(A(e,n).children||[]).map((r,a)=>O(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function k(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 A(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 j(){return Math.random().toString(36).substring(2,8)}D.displayName=`UniverIcon`;let M={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745C11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962C11.1791 15.0962 10.8814 14.7983 10.8813 14.4312Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.47697 11.6968H11.5463H13.6156C13.9829 11.6968 14.2807 11.9946 14.2807 12.3618C14.2807 12.7291 13.9829 13.0269 13.6156 13.0269H9.47697C9.10981 13.0267 8.81193 12.729 8.81193 12.3618C8.81193 11.9946 9.10981 11.6969 9.47697 11.6968Z`}}]},N=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(D,Object.assign({},e,{id:`add-note-icon`,ref:t,icon:M}))});N.displayName=`AddNoteIcon`;let P={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618C14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618C8.80985 11.9946 9.10762 11.6968 9.47489 11.6968Z`}}]},F=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(D,Object.assign({},e,{id:`delete-note-icon`,ref:t,icon:P}))});F.displayName=`DeleteNoteIcon`;let I={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477C13.039 11.6659 12.5573 11.4614 12.0394 11.4614C11.5213 11.4614 11.0398 11.6666 10.6878 11.9487C10.3037 12.2565 10.2045 12.5399 10.2044 12.6147C10.2044 12.6893 10.3034 12.9737 10.6878 13.2817C11.0398 13.5636 11.5215 13.768 12.0394 13.768C12.5574 13.768 13.039 13.5635 13.3909 13.2817C13.7751 12.9739 13.8743 12.6897 13.8743 12.6147ZM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198C13.6701 14.7627 12.9019 15.0981 12.0394 15.0981C11.1768 15.0981 10.4085 14.7627 9.85577 14.3198C9.33533 13.9027 8.87433 13.2769 8.87433 12.6147C8.8744 11.9526 9.33541 11.3276 9.85577 10.9106C10.4086 10.4676 11.1767 10.1313 12.0394 10.1313C12.9018 10.1313 13.6701 10.4668 14.223 10.9096C14.7435 11.3267 15.2043 11.9523 15.2044 12.6147Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.0394 13.299C12.4172 13.299 12.7234 12.9927 12.7234 12.6149C12.7234 12.2371 12.4172 11.9308 12.0394 11.9308C11.6616 11.9308 11.3553 12.2371 11.3553 12.6149C11.3553 12.9927 11.6616 13.299 12.0394 13.299Z`}}]},L=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(D,Object.assign({},e,{id:`hide-note-icon`,ref:t,icon:I}))});L.displayName=`HideNoteIcon`;let R={id:`sheet.operation.add-note-popup`,type:t.CommandType.OPERATION,handler:async(e,n)=>{var i;let a=e.get(r.SheetsSelectionsService),o=e.get(b),s=e.get(t.IUniverInstanceService).getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!s)return!1;let c=s.getActiveSheet(),l=a.getCurrentLastSelection();if(!(l!=null&&l.primary))return!1;let{primary:u}=l;return o.showPopup({unitId:s.getUnitId(),subUnitId:c.getSheetId(),row:u.actualRow,col:u.actualColumn,temp:!1,trigger:(i=n==null?void 0:n.trigger)==null?`add-note`:i}),!0}};function z(e){let n=e.get(r.SheetsSelectionsService),o=e.get(t.IUniverInstanceService);return n.selectionMoveEnd$.pipe((0,a.map)(()=>{let t=n.getCurrentLastSelection();if(!(t!=null&&t.primary))return!1;let a=(0,r.getSheetCommandTarget)(o);if(!a)return!1;let{actualColumn:s,actualRow:c}=t.primary;return!!e.get(i.SheetsNoteModel).getNote(a.unitId,a.subUnitId,{row:c,col:s})}))}function B(e){return{id:R.id,type:c.MenuItemType.BUTTON,title:`rightClick.addNote`,icon:`AddNoteIcon`,hidden$:(0,a.combineLatest)([(0,c.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),z(e)]).pipe((0,a.map)(([e,t])=>e||t)),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]}),commandId:R.id}}function V(e){return{id:i.SheetDeleteNoteCommand.id,type:c.MenuItemType.BUTTON,title:`rightClick.deleteNote`,icon:`DeleteNoteIcon`,hidden$:z(e).pipe((0,a.map)(e=>!e)),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]})}}function H(e){return{id:i.SheetToggleNotePopupCommand.id,type:c.MenuItemType.BUTTON,title:`rightClick.toggleNote`,icon:`HideNoteIcon`,hidden$:z(e).pipe((0,a.map)(e=>!e))}}let U={[c.ContextMenuPosition.MAIN_AREA]:{[c.ContextMenuGroup.OTHERS]:{order:0,[R.id]:{order:0,menuItemFactory:B},[i.SheetDeleteNoteCommand.id]:{order:0,menuItemFactory:V},[i.SheetToggleNotePopupCommand.id]:{order:0,menuItemFactory:H}}}},W=e=>{var r;let{popup:a}=e,o=(0,c.useDependency)(i.SheetsNoteModel),s=(0,c.useDependency)(t.LocaleService),f=(0,c.useDependency)(n.IRenderManagerService),p=(0,c.useDependency)(b),m=(0,c.useConfigValue)(w),h=(r=a.extraProps)==null?void 0:r.location;if(!h)return console.error(`Popup extraProps or location is undefined.`),null;let g=(0,l.useRef)(null),_=f.getRenderById(h.unitId),[v,y]=(0,l.useState)(null);(0,l.useEffect)(()=>{var e,n,r,i,a,s;let{unitId:c,subUnitId:l,row:u,col:d}=h,f=o.getNote(c,l,{row:u,col:d}),p=(e=(n=f==null?void 0:f.width)==null?m==null||(r=m.defaultNoteSize)==null?void 0:r.width:n)==null?160:e,_=(i=(a=f==null?void 0:f.height)==null?m==null||(s=m.defaultNoteSize)==null?void 0:s.height:a)==null?72:i;if(f)y(f);else{let e={id:(0,t.generateRandomId)(6),width:p,height:_,note:``};y(e),S(e)}g.current&&(g.current.style.width=`${p}px`,g.current.style.height=`${_}px`)},[h,g]),(0,l.useEffect)(()=>{if(!h||h.temp||!h.trigger||!g.current)return;let e=requestAnimationFrame(()=>{var e;(e=g.current)==null||e.focus()});return()=>cancelAnimationFrame(e)},[h]);let x=(0,c.useDependency)(t.ICommandService),S=(0,c.useDebounceFn)(e=>{if(!h)return;let{unitId:t,subUnitId:n,row:r,col:a}=h;if(!x.syncExecuteCommand(i.SheetUpdateNoteCommand.id,{unitId:t,sheetId:n,row:r,col:a,note:e})){let i=o.getNote(t,n,{noteId:e.id,row:r,col:a});i?y(i):p.hidePopup(!0)}}),C=(0,l.useCallback)(e=>{if(!v||e===v.note)return;let t={...v,note:e};y(t),S(t)},[v]),T=(0,l.useCallback)((e,t)=>{if(!v||e===v.width&&t===v.height)return;let n={...v,width:e,height:t};y(n),S(n)},[v]);return(0,d.jsx)(u.Textarea,{ref:g,"data-u-comp":`note-textarea`,className:(0,u.clsx)(`univer-ml-px univer-min-h-1 univer-min-w-1 univer-bg-white !univer-text-sm univer-shadow dark:!univer-bg-gray-800`),value:v==null?void 0:v.note,placeholder:s.t(`note.placeholder`),onResize:T,onValueChange:C,onWheel:e=>{document.activeElement!==g.current&&_.engine.getCanvasElement().dispatchEvent(new WheelEvent(e.type,e.nativeEvent))}})},G=class extends t.Disposable{constructor(e,t,n){super(),this._componentManager=e,this._menuManagerService=t,this._commandService=n,this._initComponents(),this._initMenu(),this._initCommands()}_initComponents(){[[h,W],[`AddNoteIcon`,N],[`DeleteNoteIcon`,F],[`HideNoteIcon`,L]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_initMenu(){this._menuManagerService.mergeMenu(U)}_initCommands(){this._commandService.registerCommand(R)}};G=p([f(0,(0,t.Inject)(c.ComponentManager)),f(1,(0,t.Inject)(c.IMenuManagerService)),f(2,t.ICommandService)],G);let K=class extends t.Plugin{constructor(e=T,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},T,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(w,a)}onStarting(){[[b],[m],[x],[G],[E]].forEach(e=>{this._injector.add(e)})}onReady(){(0,t.touchDependencies)(this._injector,[[G],[m]])}onRendered(){(0,t.touchDependencies)(this._injector,[[x],[E]])}};y(K,`pluginName`,`SHEET_NOTE_UI_PLUGIN`),y(K,`packageName`,S),y(K,`version`,C),y(K,`type`,t.UniverInstanceType.UNIVER_SHEET),K=p([(0,t.DependentOn)(i.UniverSheetsNotePlugin),f(1,(0,t.Inject)(t.Injector)),f(2,t.IConfigService)],K),Object.defineProperty(e,`SheetsCellContentController`,{enumerable:!0,get:function(){return m}}),e.SheetsNote=W,Object.defineProperty(e,`SheetsNotePopupController`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,`SheetsNotePopupService`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,`UniverSheetsNoteUIPlugin`,{enumerable:!0,get:function(){return K}})});
|
|
12
9
|
|
|
13
10
|
// index
|
|
14
11
|
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@univerjs/sheets-note"),require("@univerjs/sheets-note-ui"),require("@univerjs/sheets-note/lib/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-note","@univerjs/sheets-note-ui","@univerjs/sheets-note/lib/facade"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.UniverPresetSheetsNote={},e.UniverSheetsNote,e.UniverSheetsNoteUi))})(this,(function(e,t,i){"use strict";function n(){return{plugins:[t.UniverSheetsNotePlugin,i.UniverSheetsNoteUIPlugin].filter(s=>!!s)}}e.UniverSheetsNotePreset=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/umd/locales/ca-ES.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/ca-ES
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiCaES=t())})(this,function(){return{rightClick:{addNote:`Afegeix nota`,deleteNote:`Elimina nota`,toggleNote:`Mostra/Amaga nota`},note:{placeholder:`Escriu aquí`}}});
|
|
4
3
|
|
|
5
4
|
// locale/ca-ES
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/ca-ES")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/ca-ES"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteCaES=i(e.UniverCore,e.UniverSheetsNoteUiCaES))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/en-US.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/en-US
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiEnUS=t())})(this,function(){return{rightClick:{addNote:`Add Note`,deleteNote:`Delete Note`,toggleNote:`Show/Hide Note`},note:{placeholder:`Type here`}}});
|
|
4
3
|
|
|
5
4
|
// locale/en-US
|
|
6
5
|
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/en-US")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/en-US"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteEnUS=n(e.UniverCore,e.UniverSheetsNoteUiEnUS))})(this,(function(e,n){"use strict";return e.mergeLocales(n)}));
|
package/lib/umd/locales/es-ES.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/es-ES
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiEsES=t())})(this,function(){return{rightClick:{addNote:`Agregar nota`,deleteNote:`Eliminar nota`,toggleNote:`Mostrar/Ocultar nota`},note:{placeholder:`Escribe aquí`}}});
|
|
4
3
|
|
|
5
4
|
// locale/es-ES
|
|
6
5
|
(function(e,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/es-ES")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/es-ES"],s):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteEsES=s(e.UniverCore,e.UniverSheetsNoteUiEsES))})(this,(function(e,s){"use strict";return e.mergeLocales(s)}));
|
package/lib/umd/locales/fa-IR.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/fa-IR
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiFaIR=t())})(this,function(){return{rightClick:{addNote:`افزودن یادداشت`,deleteNote:`حذف یادداشت`,toggleNote:`نمایش/پنهان کردن یادداشت`},note:{placeholder:`اینجا تایپ کنید`}}});
|
|
4
3
|
|
|
5
4
|
// locale/fa-IR
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/fa-IR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/fa-IR"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteFaIR=i(e.UniverCore,e.UniverSheetsNoteUiFaIR))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/fr-FR.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/fr-FR
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiFrFR=t())})(this,function(){return{rightClick:{addNote:`Ajouter une note`,deleteNote:`Supprimer la note`,toggleNote:`Afficher/Masquer la note`},note:{placeholder:`Écrivez ici`}}});
|
|
4
3
|
|
|
5
4
|
// locale/fr-FR
|
|
6
5
|
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/fr-FR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/fr-FR"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteFrFR=r(e.UniverCore,e.UniverSheetsNoteUiFrFR))})(this,(function(e,r){"use strict";return e.mergeLocales(r)}));
|
package/lib/umd/locales/ja-JP.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/ja-JP
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiJaJP=t())})(this,function(){return{rightClick:{addNote:`コメントを追加`,deleteNote:`コメントを削除`,toggleNote:`コメントの表示/非表示`},note:{placeholder:`ここに入力`}}});
|
|
4
3
|
|
|
5
4
|
// locale/ja-JP
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/ja-JP")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/ja-JP"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteJaJP=i(e.UniverCore,e.UniverSheetsNoteUiJaJP))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/ko-KR.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/ko-KR
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiKoKR=t())})(this,function(){return{rightClick:{addNote:`노트 추가`,deleteNote:`노트 삭제`,toggleNote:`노트 표시/숨기기`},note:{placeholder:`여기에 입력`}}});
|
|
4
3
|
|
|
5
4
|
// locale/ko-KR
|
|
6
5
|
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/ko-KR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/ko-KR"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteKoKR=o(e.UniverCore,e.UniverSheetsNoteUiKoKR))})(this,(function(e,o){"use strict";return e.mergeLocales(o)}));
|
package/lib/umd/locales/ru-RU.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/ru-RU
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiRuRU=t())})(this,function(){return{rightClick:{addNote:`Добавить примечание`,deleteNote:`Удалить примечание`,toggleNote:`Показать/Скрыть примечание`},note:{placeholder:`Введите текст здесь`}}});
|
|
4
3
|
|
|
5
4
|
// locale/ru-RU
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/ru-RU")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/ru-RU"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteRuRU=i(e.UniverCore,e.UniverSheetsNoteUiRuRU))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/sk-SK.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/sk-SK
|
|
2
|
-
(function(e,
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiSkSK=t())})(this,function(){return{rightClick:{addNote:`Pridať poznámku`,deleteNote:`Odstrániť poznámku`,toggleNote:`Zobraziť/Skryť poznámku`},note:{placeholder:`Píšte sem`}}});
|
|
4
3
|
|
|
5
4
|
// locale/sk-SK
|
|
6
5
|
(function(e,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/sk-SK")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/sk-SK"],s):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteSkSK=s(e.UniverCore,e.UniverSheetsNoteUiSkSK))})(this,(function(e,s){"use strict";return e.mergeLocales(s)}));
|
package/lib/umd/locales/vi-VN.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/vi-VN
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiViVN=t())})(this,function(){return{rightClick:{addNote:`Thêm ghi chú`,deleteNote:`Xóa ghi chú`,toggleNote:`Hiện/Ẩn ghi chú`},note:{placeholder:`Nhập tại đây`}}});
|
|
4
3
|
|
|
5
4
|
// locale/vi-VN
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/vi-VN")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/vi-VN"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteViVN=i(e.UniverCore,e.UniverSheetsNoteUiViVN))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/zh-CN.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/zh-CN
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiZhCN=t())})(this,function(){return{rightClick:{addNote:`添加批注`,deleteNote:`删除批注`,toggleNote:`显示/隐藏批注`},note:{placeholder:`在此输入`}}});
|
|
4
3
|
|
|
5
4
|
// locale/zh-CN
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/zh-CN")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/zh-CN"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteZhCN=i(e.UniverCore,e.UniverSheetsNoteUiZhCN))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/lib/umd/locales/zh-TW.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @univerjs/sheets-note-ui/locale/zh-TW
|
|
2
|
-
(function(e,t){typeof exports
|
|
3
|
-
|
|
2
|
+
(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.UniverSheetsNoteUiZhTW=t())})(this,function(){return{rightClick:{addNote:`添加批註`,deleteNote:`刪除批註`,toggleNote:`顯示/隱藏批註`},note:{placeholder:`在此輸入`}}});
|
|
4
3
|
|
|
5
4
|
// locale/zh-TW
|
|
6
5
|
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/sheets-note-ui/locale/zh-TW")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-note-ui/locale/zh-TW"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsNoteZhTW=i(e.UniverCore,e.UniverSheetsNoteUiZhTW))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-sheets-note",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"rxjs": ">=7.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@univerjs/sheets-note": "0.
|
|
62
|
-
"@univerjs/sheets-note-ui": "0.
|
|
61
|
+
"@univerjs/sheets-note": "0.19.0",
|
|
62
|
+
"@univerjs/sheets-note-ui": "0.19.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@univerjs/core": "0.
|
|
65
|
+
"@univerjs/core": "0.19.0",
|
|
66
66
|
"react": "18.3.1",
|
|
67
67
|
"react-dom": "18.3.1",
|
|
68
68
|
"rxjs": "7.8.2",
|
|
69
69
|
"typescript": "^5.9.3",
|
|
70
|
-
"@univerjs-infra/shared": "0.
|
|
70
|
+
"@univerjs-infra/shared": "0.19.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"prebuild:preset": "tsx prepare.ts",
|