@univerjs/sheets-note 1.5.2 → 1.6.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.
Files changed (111) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/facade.js +45 -14
  3. package/lib/cjs/index.js +95 -31
  4. package/lib/cjs/locale/ar-SA.js +4 -0
  5. package/lib/cjs/locale/ca-ES.js +4 -0
  6. package/lib/cjs/locale/de-DE.js +4 -0
  7. package/lib/cjs/locale/en-US.js +19 -0
  8. package/lib/cjs/locale/es-ES.js +4 -0
  9. package/lib/cjs/locale/fa-IR.js +4 -0
  10. package/lib/cjs/locale/fr-FR.js +4 -0
  11. package/lib/cjs/locale/id-ID.js +4 -0
  12. package/lib/cjs/locale/it-IT.js +4 -0
  13. package/lib/cjs/locale/ja-JP.js +4 -0
  14. package/lib/cjs/locale/ko-KR.js +4 -0
  15. package/lib/cjs/locale/pl-PL.js +4 -0
  16. package/lib/cjs/locale/pt-BR.js +4 -0
  17. package/lib/cjs/locale/ru-RU.js +4 -0
  18. package/lib/cjs/locale/sk-SK.js +4 -0
  19. package/lib/cjs/locale/vi-VN.js +4 -0
  20. package/lib/cjs/locale/zh-CN.js +4 -0
  21. package/lib/cjs/locale/zh-HK.js +4 -0
  22. package/lib/cjs/locale/zh-TW.js +4 -0
  23. package/lib/es/facade.js +46 -15
  24. package/lib/es/index.js +97 -34
  25. package/lib/es/locale/ar-SA.js +4 -0
  26. package/lib/es/locale/ca-ES.js +4 -0
  27. package/lib/es/locale/de-DE.js +4 -0
  28. package/lib/es/locale/en-US.js +19 -0
  29. package/lib/es/locale/es-ES.js +4 -0
  30. package/lib/es/locale/fa-IR.js +4 -0
  31. package/lib/es/locale/fr-FR.js +4 -0
  32. package/lib/es/locale/id-ID.js +4 -0
  33. package/lib/es/locale/it-IT.js +4 -0
  34. package/lib/es/locale/ja-JP.js +4 -0
  35. package/lib/es/locale/ko-KR.js +4 -0
  36. package/lib/es/locale/pl-PL.js +4 -0
  37. package/lib/es/locale/pt-BR.js +4 -0
  38. package/lib/es/locale/ru-RU.js +4 -0
  39. package/lib/es/locale/sk-SK.js +4 -0
  40. package/lib/es/locale/vi-VN.js +4 -0
  41. package/lib/es/locale/zh-CN.js +4 -0
  42. package/lib/es/locale/zh-HK.js +4 -0
  43. package/lib/es/locale/zh-TW.js +4 -0
  44. package/lib/facade.js +46 -15
  45. package/lib/index.js +97 -34
  46. package/lib/locale/ar-SA.js +4 -0
  47. package/lib/locale/ca-ES.js +4 -0
  48. package/lib/locale/de-DE.js +4 -0
  49. package/lib/locale/en-US.js +19 -0
  50. package/lib/locale/es-ES.js +4 -0
  51. package/lib/locale/fa-IR.js +4 -0
  52. package/lib/locale/fr-FR.js +4 -0
  53. package/lib/locale/id-ID.js +4 -0
  54. package/lib/locale/it-IT.js +4 -0
  55. package/lib/locale/ja-JP.js +4 -0
  56. package/lib/locale/ko-KR.js +4 -0
  57. package/lib/locale/pl-PL.js +4 -0
  58. package/lib/locale/pt-BR.js +4 -0
  59. package/lib/locale/ru-RU.js +4 -0
  60. package/lib/locale/sk-SK.js +4 -0
  61. package/lib/locale/vi-VN.js +4 -0
  62. package/lib/locale/zh-CN.js +4 -0
  63. package/lib/locale/zh-HK.js +4 -0
  64. package/lib/locale/zh-TW.js +4 -0
  65. package/lib/types/commands/commands/note.command.d.ts +7 -1
  66. package/lib/types/const.d.ts +6 -0
  67. package/lib/types/controllers/sheets-note-permission.controller.d.ts +34 -0
  68. package/lib/types/index.d.ts +1 -0
  69. package/lib/types/locale/ar-SA.d.ts +18 -0
  70. package/lib/types/locale/ca-ES.d.ts +18 -0
  71. package/lib/types/locale/de-DE.d.ts +18 -0
  72. package/lib/types/locale/en-US.d.ts +23 -0
  73. package/lib/types/locale/es-ES.d.ts +18 -0
  74. package/lib/types/locale/fa-IR.d.ts +18 -0
  75. package/lib/types/locale/fr-FR.d.ts +18 -0
  76. package/lib/types/locale/id-ID.d.ts +18 -0
  77. package/lib/types/locale/it-IT.d.ts +18 -0
  78. package/lib/types/locale/ja-JP.d.ts +18 -0
  79. package/lib/types/locale/ko-KR.d.ts +18 -0
  80. package/lib/types/locale/pl-PL.d.ts +18 -0
  81. package/lib/types/locale/pt-BR.d.ts +18 -0
  82. package/lib/types/locale/ru-RU.d.ts +18 -0
  83. package/lib/types/locale/sk-SK.d.ts +18 -0
  84. package/lib/types/locale/types.d.ts +18 -0
  85. package/lib/types/locale/vi-VN.d.ts +18 -0
  86. package/lib/types/locale/zh-CN.d.ts +18 -0
  87. package/lib/types/locale/zh-HK.d.ts +18 -0
  88. package/lib/types/locale/zh-TW.d.ts +18 -0
  89. package/lib/types/plugin.d.ts +1 -1
  90. package/lib/umd/facade.js +1 -1
  91. package/lib/umd/index.js +1 -1
  92. package/lib/umd/locale/ar-SA.js +1 -0
  93. package/lib/umd/locale/ca-ES.js +1 -0
  94. package/lib/umd/locale/de-DE.js +1 -0
  95. package/lib/umd/locale/en-US.js +1 -0
  96. package/lib/umd/locale/es-ES.js +1 -0
  97. package/lib/umd/locale/fa-IR.js +1 -0
  98. package/lib/umd/locale/fr-FR.js +1 -0
  99. package/lib/umd/locale/id-ID.js +1 -0
  100. package/lib/umd/locale/it-IT.js +1 -0
  101. package/lib/umd/locale/ja-JP.js +1 -0
  102. package/lib/umd/locale/ko-KR.js +1 -0
  103. package/lib/umd/locale/pl-PL.js +1 -0
  104. package/lib/umd/locale/pt-BR.js +1 -0
  105. package/lib/umd/locale/ru-RU.js +1 -0
  106. package/lib/umd/locale/sk-SK.js +1 -0
  107. package/lib/umd/locale/vi-VN.js +1 -0
  108. package/lib/umd/locale/zh-CN.js +1 -0
  109. package/lib/umd/locale/zh-HK.js +1 -0
  110. package/lib/umd/locale/zh-TW.js +1 -0
  111. package/package.json +14 -9
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { LocaleLeafKeys } from '@univerjs/core';
17
+ import type enUS from './en-US';
18
+ export type LocaleKey = LocaleLeafKeys<typeof enUS>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IUniverSheetsNoteConfig } from './config/config';
17
16
  import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
17
+ import type { IUniverSheetsNoteConfig } from './config/config';
18
18
  export declare class UniverSheetsNotePlugin extends Plugin {
19
19
  private readonly _config;
20
20
  private readonly _configService;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (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 extends t.FEventName{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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col,note:r};this.fireEvent(this.Event.SheetNoteAdd,s)}}))),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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col,oldNote:r};this.fireEvent(this.Event.SheetNoteDelete,s)}}))),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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!a)return;let{workbook:o,worksheet:s}=a,c={workbook:o,worksheet:s,row:i.row,col:i.col,note:i,oldNote:r};this.fireEvent(this.Event.SheetNoteUpdate,c)}}))),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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col};this.fireEvent(this.Event.SheetNoteShow,s)}}))),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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col};this.fireEvent(this.Event.SheetNoteHide,s)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteAdd,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetUpdateNoteCommand.id){let r=t.params,a=this.getSheetCommandTarget(r);if(!a)return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=a,{row:u,col:d,note:f}=r;if(e.get(n.SheetsNoteModel).getNote(c,l,{noteId:f.id,row:u,col:d}))return;let p={workbook:o,worksheet:s,row:u,col:d,note:f};if(this.fireEvent(this.Event.BeforeSheetNoteAdd,p))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteDelete,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetDeleteNoteCommand.id){let t=this.getSheetCommandTarget();if(!t)return;let r=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(r!=null&&r.primary))return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=t,{actualRow:u,actualColumn:d}=r.primary,f=e.get(n.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!f)return;let p={workbook:o,worksheet:s,row:u,col:d,oldNote:f};if(this.fireEvent(this.Event.BeforeSheetNoteDelete,p))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteUpdate,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetUpdateNoteCommand.id){let r=t.params,a=this.getSheetCommandTarget(r);if(!a)return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=a,{row:u,col:d,note:f}=r,p=e.get(n.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!p)return;let m={workbook:o,worksheet:s,row:u,col:d,note:f,oldNote:p};if(this.fireEvent(this.Event.BeforeSheetNoteUpdate,m))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteShow,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetToggleNotePopupCommand.id){let t=this.getSheetCommandTarget();if(!t)return;let r=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(r!=null&&r.primary))return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=t,{actualRow:u,actualColumn:d}=r.primary,f=e.get(n.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!f||f.show)return;let p={workbook:o,worksheet:s,row:u,col:d};if(this.fireEvent(this.Event.BeforeSheetNoteShow,p))throw new i.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteHide,()=>t.beforeCommandExecuted(t=>{if(t.id===n.SheetToggleNotePopupCommand.id){let t=this.getSheetCommandTarget();if(!t)return;let r=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(r!=null&&r.primary))return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=t,{actualRow:u,actualColumn:d}=r.primary,f=e.get(n.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!f||!f.show)return;let p={workbook:o,worksheet:s,row:u,col:d};if(this.fireEvent(this.Event.BeforeSheetNoteHide,p))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.FRangeSheetsNoteMixin=s,e.FSheetsNoteEventNameMixin=o,e.FUniverSheetsNoteMixin=c,e.FWorksheetNoteMixin=l});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core/facade"),require("@univerjs/core"),require("@univerjs/sheets-note"),require("@univerjs/sheets/facade"),require("@univerjs/sheets")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core/facade`,`@univerjs/core`,`@univerjs/sheets-note`,`@univerjs/sheets/facade`,`@univerjs/sheets`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNoteFacade={},e.UniverCoreFacade,e.UniverCore,e.UniverSheetsNote,e.UniverSheetsFacade,e.UniverSheets))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=class extends t.FEventName{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 i.FRange{createOrUpdateNote(e){let t=this.getUnitId(),i=this.getSheetId(),a=this.getRow(),o=this.getColumn(),s=this._injector.get(r.SheetsNoteModel).getNote(t,i,{row:a,col:o});return this._commandService.syncExecuteCommand(r.SheetUpdateNoteCommand.id,{unitId:t,sheetId:i,row:a,col:o,note:{id:(s==null?void 0:s.id)??e.id??(0,n.generateRandomId)(6),row:a,col:o,width:e.width,height:e.height,note:e.note,show:e.show}}),this}deleteNote(){return this._commandService.syncExecuteCommand(r.SheetDeleteNoteCommand.id,{unitId:this.getUnitId(),sheetId:this.getSheetId(),row:this.getRow(),col:this.getColumn()}),this}getNote(){return this._injector.get(r.SheetsNoteModel).getNote(this.getUnitId(),this.getSheetId(),{row:this.getRow(),col:this.getColumn()})}};i.FRange.extend(s);var c=class extends t.FUniver{_initialize(e){let t=e.get(n.ICommandService);this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteAdd,()=>e.get(r.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&!e.oldNote&&e.newNote){let{unitId:t,subUnitId:n,newNote:r}=e,i=this.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col,note:r};this.fireEvent(this.Event.SheetNoteAdd,s)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteDelete,()=>e.get(r.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&!e.newNote){let{unitId:t,subUnitId:n,oldNote:r}=e,i=this.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col,oldNote:r};this.fireEvent(this.Event.SheetNoteDelete,s)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteUpdate,()=>e.get(r.SheetsNoteModel).change$.subscribe(e=>{if(e.type===`update`&&e.oldNote&&e.newNote){let{unitId:t,subUnitId:n,oldNote:r,newNote:i}=e,a=this.getSheetCommandTarget({unitId:t,subUnitId:n});if(!a)return;let{workbook:o,worksheet:s}=a,c={workbook:o,worksheet:s,row:i.row,col:i.col,note:i,oldNote:r};this.fireEvent(this.Event.SheetNoteUpdate,c)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteShow,()=>e.get(r.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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col};this.fireEvent(this.Event.SheetNoteShow,s)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetNoteHide,()=>e.get(r.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.getSheetCommandTarget({unitId:t,subUnitId:n});if(!i)return;let{workbook:a,worksheet:o}=i,s={workbook:a,worksheet:o,row:r.row,col:r.col};this.fireEvent(this.Event.SheetNoteHide,s)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteAdd,()=>t.beforeCommandExecuted(t=>{if(t.id===r.SheetUpdateNoteCommand.id){let i=t.params,a=this.getSheetCommandTarget({unitId:i.unitId,subUnitId:i.sheetId});if(!a)return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=a,{row:u,col:d,note:f}=i;if(e.get(r.SheetsNoteModel).getNote(c,l,{noteId:f.id,row:u,col:d}))return;let p={workbook:o,worksheet:s,row:u,col:d,note:f};if(this.fireEvent(this.Event.BeforeSheetNoteAdd,p))throw new n.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteDelete,()=>t.beforeCommandExecuted(t=>{if(t.id===r.SheetDeleteNoteCommand.id){let i=t.params,o=this.getSheetCommandTarget(i?{unitId:i.unitId,subUnitId:i.sheetId}:{});if(!o)return;let{workbook:s,worksheet:c,unitId:l,subUnitId:u}=o,d,f;if(i)({row:d,col:f}=i);else{let t=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(t!=null&&t.primary))return;({actualRow:d,actualColumn:f}=t.primary)}let p=e.get(r.SheetsNoteModel).getNote(l,u,{row:d,col:f});if(!p)return;let m={workbook:s,worksheet:c,row:d,col:f,oldNote:p};if(this.fireEvent(this.Event.BeforeSheetNoteDelete,m))throw new n.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteUpdate,()=>t.beforeCommandExecuted(t=>{if(t.id===r.SheetUpdateNoteCommand.id){let i=t.params,a=this.getSheetCommandTarget({unitId:i.unitId,subUnitId:i.sheetId});if(!a)return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=a,{row:u,col:d,note:f}=i,p=e.get(r.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!p)return;let m={workbook:o,worksheet:s,row:u,col:d,note:f,oldNote:p};if(this.fireEvent(this.Event.BeforeSheetNoteUpdate,m))throw new n.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteShow,()=>t.beforeCommandExecuted(t=>{if(t.id===r.SheetToggleNotePopupCommand.id){let t=this.getSheetCommandTarget();if(!t)return;let i=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(i!=null&&i.primary))return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=t,{actualRow:u,actualColumn:d}=i.primary,f=e.get(r.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!f||f.show)return;let p={workbook:o,worksheet:s,row:u,col:d};if(this.fireEvent(this.Event.BeforeSheetNoteShow,p))throw new n.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetNoteHide,()=>t.beforeCommandExecuted(t=>{if(t.id===r.SheetToggleNotePopupCommand.id){let t=this.getSheetCommandTarget();if(!t)return;let i=e.get(a.SheetsSelectionsService).getCurrentLastSelection();if(!(i!=null&&i.primary))return;let{workbook:o,worksheet:s,unitId:c,subUnitId:l}=t,{actualRow:u,actualColumn:d}=i.primary,f=e.get(r.SheetsNoteModel).getNote(c,l,{row:u,col:d});if(!f||!f.show)return;let p={workbook:o,worksheet:s,row:u,col:d};if(this.fireEvent(this.Event.BeforeSheetNoteHide,p))throw new n.CanceledError}})))}};t.FUniver.extend(c);var l=class extends i.FWorksheet{getNotes(){let e=this._injector.get(r.SheetsNoteModel).getSheetNotes(this.getWorkbook().getUnitId(),this.getSheetId());return e?Array.from(e.values()).map(e=>({...e})):[]}};i.FWorksheet.extend(l),e.FRangeSheetsNoteMixin=s,e.FSheetsNoteEventNameMixin=o,e.FUniverSheetsNoteMixin=c,e.FWorksheetNoteMixin=l});
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("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;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==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`,/* @__PURE__ */ new Map),s(this,`_notePositionCache`,/* @__PURE__ */ new WeakMap),s(this,`_change$`,new r.Subject),s(this,`change$`,this._change$.asObservable())}dispose(){this._notePositionCache=/* @__PURE__ */ new WeakMap,this._notesMap.clear(),this._change$.complete(),super.dispose()}_ensureNotesMap(e,t){let n=this._notesMap.get(e);n||(n=/* @__PURE__ */ new Map,this._notesMap.set(e,n));let r=n.get(t);return r||(r=/* @__PURE__ */ new Map,n.set(t,r)),r}_getNoteByPosition(e,n,r,i){let a=this._ensureNotesMap(e,n),o=this._notePositionCache.get(a);if(!o){o=new t.ObjectMatrix;for(let e of a.values())o.getValue(e.row,e.col)||o.setValue(e.row,e.col,e);this._notePositionCache.set(a,o)}let s=o.getValue(r,i);return(s==null?void 0:s.row)===r&&s.col===i?s:void 0}_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._notePositionCache.delete(c),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});if(!s)return;let c=this._ensureNotesMap(e,t);c.delete(s.id),this._notePositionCache.delete(c),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._notePositionCache.delete(c),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._notePositionCache.delete(u),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){var t;(t=this._notesMap.get(e))==null||t.forEach(e=>this._notePositionCache.delete(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}}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=`1.5.2`;let S={},C=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`,/* @__PURE__ */ new Map),s(this,`_watcherMap`,/* @__PURE__ */ 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}}}))}};C=v([_(0,(0,t.Inject)(n.RefRangeService)),_(1,(0,t.Inject)(c)),_(2,(0,t.Inject)(n.SheetsSelectionsService)),_(3,t.ICommandService)],C);let w=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))})}};w=v([_(0,t.ICommandService)],w);let T=class extends t.Plugin{constructor(e=S,n,r){super(),this._config=e,this._configService=n,this._injector=r;let{...i}=(0,t.merge)({},S,this._config);this._configService.setConfig(`sheets-note.config`,i)}onStarting(){[[c],[w],[y],[C]].forEach(e=>{this._injector.add(e)}),(0,t.touchDependencies)(this._injector,[[c],[w],[y]])}onReady(){(0,t.touchDependencies)(this._injector,[[C]])}};s(T,`pluginName`,g),s(T,`packageName`,b),s(T,`version`,x),s(T,`type`,t.UniverInstanceType.UNIVER_SHEET),T=v([(0,t.DependentOn)(n.UniverSheetsPlugin),_(1,t.IConfigService),_(2,(0,t.Inject)(t.Injector))],T),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 T}}),e.UpdateNoteMutation=l,e.UpdateNotePositionMutation=f});
1
+ (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;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==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`,/* @__PURE__ */ new Map),s(this,`_notePositionCache`,/* @__PURE__ */ new WeakMap),s(this,`_change$`,new r.Subject),s(this,`change$`,this._change$.asObservable())}dispose(){this._notePositionCache=/* @__PURE__ */ new WeakMap,this._notesMap.clear(),this._change$.complete(),super.dispose()}_ensureNotesMap(e,t){let n=this._notesMap.get(e);n||(n=/* @__PURE__ */ new Map,this._notesMap.set(e,n));let r=n.get(t);return r||(r=/* @__PURE__ */ new Map,n.set(t,r)),r}_getNoteByPosition(e,n,r,i){let a=this._ensureNotesMap(e,n),o=this._notePositionCache.get(a);if(!o){o=new t.ObjectMatrix;for(let e of a.values())o.getValue(e.row,e.col)||o.setValue(e.row,e.col,e);this._notePositionCache.set(a,o)}let s=o.getValue(r,i);return(s==null?void 0:s.row)===r&&s.col===i?s:void 0}_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._notePositionCache.delete(c),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});if(!s)return;let c=this._ensureNotesMap(e,t);c.delete(s.id),this._notePositionCache.delete(c),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._notePositionCache.delete(c),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._notePositionCache.delete(u),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){var t;(t=this._notesMap.get(e))==null||t.forEach(e=>this._notePositionCache.delete(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,r)=>{let i=e.get(t.IUniverInstanceService),a,o,s,d;if(r){let e=(0,n.getSheetCommandTarget)(i,{unitId:r.unitId,subUnitId:r.sheetId});if(!e)return!1;({unitId:a,subUnitId:o}=e),s=r.row,d=r.col}else{let t=(0,n.getSheetCommandTarget)(i);if(!t)return!1;let r=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!(r!=null&&r.primary))return!1;({unitId:a,subUnitId:o}=t),{actualColumn:d,actualRow:s}=r.primary}let f=e.get(c).getNote(a,o,{row:s,col:d});if(!f)return!1;let p=e.get(t.ICommandService),m=e.get(t.IUndoRedoService),h={id:u.id,params:{unitId:a,sheetId:o,noteId:f.id}},g={id:l.id,params:{unitId:a,sheetId:o,row:s,col:d,note:{...f}}};return p.syncExecuteCommand(h.id,h.params)?(m.pushUndoRedo({unitID:a,redoMutations:[h],undoMutations:[g]}),!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),{unitId:r.unitId,subUnitId:r.sheetId});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`,_={workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission]},v={..._,rangeTypes:[n.RangeProtectionPermissionEditPoint]};function y(e,t){return function(n,r){t(n,r,e)}}function b(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let x=class extends t.Disposable{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}}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:[]}}}))}};x=b([y(0,t.IResourceManagerService),y(1,t.IUniverInstanceService),y(2,(0,t.Inject)(n.SheetInterceptorService)),y(3,(0,t.Inject)(c))],x);var S=`@univerjs/sheets-note`,C=`1.6.0`;let w={},T=class extends t.Disposable{constructor(e,t,n,r){super(),this._commandService=e,this._sheetPermissionCheckController=t,this._noteModel=n,this._localeService=r,this._initCommandListener()}_initCommandListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{let{id:t}=e;if(t===h.id){let t=e.params;if(!t)return;let{unitId:n,sheetId:r,row:i,col:a,note:o}=t,s=this._noteModel.getNote(n,r,{noteId:o.id}),c=s&&(s.row!==i||s.col!==a);(!this._checkCell(n,r,i,a)||c&&!this._checkCell(n,r,s.row,s.col))&&this._blockExecute()}else if(t===p.id){let t=e.params;(t?this._checkCell(t.unitId,t.sheetId,t.row,t.col):this._sheetPermissionCheckController.permissionCheckWithoutRange(v))||this._blockExecute()}else t===m.id&&(this._sheetPermissionCheckController.permissionCheckWithoutRange(_)||this._blockExecute())}))}_checkCell(e,t,n,r){return this._sheetPermissionCheckController.permissionCheckWithRanges(v,[{startRow:n,startColumn:r,endRow:n,endColumn:r}],e,t)}_blockExecute(){this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-note.permission.editErr`))}};T=b([y(0,t.ICommandService),y(1,(0,t.Inject)(n.SheetPermissionCheckController)),y(2,(0,t.Inject)(c)),y(3,(0,t.Inject)(t.LocaleService))],T);let E=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`,/* @__PURE__ */ new Map),s(this,`_watcherMap`,/* @__PURE__ */ 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}}}))}};E=b([y(0,(0,t.Inject)(n.RefRangeService)),y(1,(0,t.Inject)(c)),y(2,(0,t.Inject)(n.SheetsSelectionsService)),y(3,t.ICommandService)],E);let D=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))})}};D=b([y(0,t.ICommandService)],D);let O=class extends t.Plugin{constructor(e=w,n,r){super(),this._config=e,this._configService=n,this._injector=r;let{...i}=(0,t.merge)({},w,this._config);this._configService.setConfig(`sheets-note.config`,i)}onStarting(){[[c],[D],[T],[x],[E]].forEach(e=>{this._injector.add(e)}),(0,t.touchDependencies)(this._injector,[[c],[D],[T],[x]])}onReady(){(0,t.touchDependencies)(this._injector,[[E]])}};s(O,`pluginName`,g),s(O,`packageName`,S),s(O,`version`,C),s(O,`type`,t.UniverInstanceType.UNIVER_SHEET),O=b([(0,t.DependentOn)(n.UniverSheetsPlugin),y(1,t.IConfigService),y(2,(0,t.Inject)(t.Injector))],O),e.RemoveNoteMutation=u,e.SHEET_NOTE_EDIT_PERMISSIONS=v,e.SheetDeleteNoteCommand=p,e.SheetToggleNotePopupCommand=m,e.SheetUpdateNoteCommand=h,e.SheetsNoteModel=c,Object.defineProperty(e,"SheetsNoteResourceController",{enumerable:!0,get:function(){return x}}),e.ToggleNotePopupMutation=d,Object.defineProperty(e,"UniverSheetsNotePlugin",{enumerable:!0,get:function(){return O}}),e.UpdateNoteMutation=l,e.UpdateNotePositionMutation=f});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteArSA=t())})(this,function(){return{"sheets-note":{permission:{editErr:`ليس لديك إذن لتعديل الملاحظات.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteCaES=t())})(this,function(){return{"sheets-note":{permission:{editErr:`No teniu permís per editar les notes.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteDeDE=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Sie haben keine Berechtigung, Notizen zu bearbeiten.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteEnUS=t())})(this,function(){return{"sheets-note":{permission:{editErr:`You do not have permission to edit notes.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteEsES=t())})(this,function(){return{"sheets-note":{permission:{editErr:`No tienes permiso para editar las notas.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteFaIR=t())})(this,function(){return{"sheets-note":{permission:{editErr:`شما اجازه ویرایش یادداشت‌ها را ندارید.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteFrFR=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Vous n'avez pas la permission de modifier les notes.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteIdID=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Anda tidak memiliki izin untuk mengedit catatan.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteItIT=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Non hai il permesso di modificare le note.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteJaJP=t())})(this,function(){return{"sheets-note":{permission:{editErr:`メモを編集する権限がありません。`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteKoKR=t())})(this,function(){return{"sheets-note":{permission:{editErr:`메모를 편집할 권한이 없습니다.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNotePlPL=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Nie masz uprawnień do edytowania notatek.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNotePtBR=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Você não tem permissão para editar notas.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteRuRU=t())})(this,function(){return{"sheets-note":{permission:{editErr:`У вас нет разрешения на редактирование примечаний.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteSkSK=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Nemáte povolenie upravovať poznámky.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteViVN=t())})(this,function(){return{"sheets-note":{permission:{editErr:`Bạn không có quyền chỉnh sửa ghi chú.`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteZhCN=t())})(this,function(){return{"sheets-note":{permission:{editErr:`暂无编辑批注的权限。`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteZhHK=t())})(this,function(){return{"sheets-note":{permission:{editErr:`暫無編輯批註的權限。`}}}});
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsNoteZhTW=t())})(this,function(){return{"sheets-note":{permission:{editErr:`暫無編輯批註的權限。`}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-note",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "description": "Cell note model and commands for Univer Sheets.",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -35,6 +35,11 @@
35
35
  "require": "./lib/cjs/*",
36
36
  "types": "./lib/types/index.d.ts"
37
37
  },
38
+ "./locale/*": {
39
+ "import": "./lib/es/locale/*.js",
40
+ "require": "./lib/cjs/locale/*.js",
41
+ "types": "./lib/types/locale/*.d.ts"
42
+ },
38
43
  "./facade": {
39
44
  "import": "./lib/es/facade.js",
40
45
  "require": "./lib/cjs/facade.js",
@@ -62,17 +67,17 @@
62
67
  "rxjs": ">=7.0.0"
63
68
  },
64
69
  "dependencies": {
65
- "@univerjs/core": "1.5.2",
66
- "@univerjs/sheets": "1.5.2"
70
+ "@univerjs/core": "1.6.0",
71
+ "@univerjs/sheets": "1.6.0"
67
72
  },
68
73
  "devDependencies": {
69
- "@univerjs-infra/shared": "1.5.2",
70
- "@univerjs/engine-formula": "1.5.2",
71
- "@univerjs/engine-render": "1.5.2",
72
- "@univerjs/network": "1.5.2",
74
+ "@univerjs-infra/shared": "1.6.0",
75
+ "@univerjs/engine-formula": "1.6.0",
76
+ "@univerjs/engine-render": "1.6.0",
77
+ "@univerjs/network": "1.6.0",
73
78
  "rxjs": "7.8.2",
74
- "tsrs": "0.23.0-ts7.1.0-beta",
75
- "vitest": "^5.1.0"
79
+ "tsrs": "7.1.0-beta.tsrs2",
80
+ "vitest": "^5.1.1"
76
81
  },
77
82
  "scripts": {
78
83
  "test": "vitest run",