@univerjs/preset-sheets-note 0.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +176 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/locales/en-US.js +1 -0
- package/lib/cjs/locales/fa-IR.js +1 -0
- package/lib/cjs/locales/fr-FR.js +1 -0
- package/lib/cjs/locales/ru-RU.js +1 -0
- package/lib/cjs/locales/vi-VN.js +1 -0
- package/lib/cjs/locales/zh-CN.js +1 -0
- package/lib/cjs/locales/zh-TW.js +1 -0
- package/lib/es/index.js +16 -0
- package/lib/es/locales/en-US.js +9 -0
- package/lib/es/locales/fa-IR.js +9 -0
- package/lib/es/locales/fr-FR.js +9 -0
- package/lib/es/locales/ru-RU.js +9 -0
- package/lib/es/locales/vi-VN.js +9 -0
- package/lib/es/locales/zh-CN.js +9 -0
- package/lib/es/locales/zh-TW.js +9 -0
- package/lib/index.css +1 -0
- package/lib/index.js +16 -0
- package/lib/locales/en-US.js +9 -0
- package/lib/locales/fa-IR.js +9 -0
- package/lib/locales/fr-FR.js +9 -0
- package/lib/locales/ru-RU.js +9 -0
- package/lib/locales/vi-VN.js +9 -0
- package/lib/locales/zh-CN.js +9 -0
- package/lib/locales/zh-TW.js +9 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/locales/en-US.d.ts +2 -0
- package/lib/types/locales/fa-IR.d.ts +2 -0
- package/lib/types/locales/fr-FR.d.ts +2 -0
- package/lib/types/locales/ru-RU.d.ts +2 -0
- package/lib/types/locales/vi-VN.d.ts +2 -0
- package/lib/types/locales/zh-CN.d.ts +2 -0
- package/lib/types/locales/zh-TW.d.ts +2 -0
- package/lib/types/types.d.ts +11 -0
- package/lib/types/umd.d.ts +4 -0
- package/lib/umd/index.js +19 -0
- package/lib/umd/locales/en-US.js +6 -0
- package/lib/umd/locales/fa-IR.js +6 -0
- package/lib/umd/locales/fr-FR.js +6 -0
- package/lib/umd/locales/ru-RU.js +6 -0
- package/lib/umd/locales/vi-VN.js +6 -0
- package/lib/umd/locales/zh-CN.js +6 -0
- package/lib/umd/locales/zh-TW.js +6 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@univerjs/sheets-note"),r=require("@univerjs/sheets-note-ui"),o=require("@univerjs/sheets-note/facade");function n(){return{plugins:[t.UniverSheetsNotePlugin,r.UniverSheetsNoteUIPlugin].filter(e=>!!e)}}exports.UniverSheetsNotePreset=n;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});Object.keys(o).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>o[e]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/en-US"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/fa-IR"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/fr-FR"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/ru-RU"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/vi-VN"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/zh-CN"),s=e.merge({},r);module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-note-ui/locale/zh-TW"),s=e.merge({},r);module.exports=s;
|
package/lib/es/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UniverSheetsNotePlugin as r } from "@univerjs/sheets-note";
|
|
2
|
+
export * from "@univerjs/sheets-note";
|
|
3
|
+
import { UniverSheetsNoteUIPlugin as t } from "@univerjs/sheets-note-ui";
|
|
4
|
+
export * from "@univerjs/sheets-note-ui";
|
|
5
|
+
export * from "@univerjs/sheets-note/facade";
|
|
6
|
+
function n() {
|
|
7
|
+
return {
|
|
8
|
+
plugins: [
|
|
9
|
+
r,
|
|
10
|
+
t
|
|
11
|
+
].filter((e) => !!e)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
n as UniverSheetsNotePreset
|
|
16
|
+
};
|
package/lib/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.univer-ml-px{margin-left:1px}.univer-rounded-md{border-radius:6px}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-shadow{--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.focus\:univer-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.dark\:univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)}.dark\:univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UniverSheetsNotePlugin as r } from "@univerjs/sheets-note";
|
|
2
|
+
export * from "@univerjs/sheets-note";
|
|
3
|
+
import { UniverSheetsNoteUIPlugin as t } from "@univerjs/sheets-note-ui";
|
|
4
|
+
export * from "@univerjs/sheets-note-ui";
|
|
5
|
+
export * from "@univerjs/sheets-note/facade";
|
|
6
|
+
function n() {
|
|
7
|
+
return {
|
|
8
|
+
plugins: [
|
|
9
|
+
r,
|
|
10
|
+
t
|
|
11
|
+
].filter((e) => !!e)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
n as UniverSheetsNotePreset
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IUniverConfig, Plugin, PluginCtor } from '@univerjs/core';
|
|
2
|
+
/**
|
|
3
|
+
* A collection of plugins and their default configs.
|
|
4
|
+
*/
|
|
5
|
+
export interface IPreset {
|
|
6
|
+
plugins: Array<PluginCtor<Plugin> | [PluginCtor<Plugin>, ConstructorParameters<PluginCtor<Plugin>>[0]]>;
|
|
7
|
+
locales?: IUniverConfig['locales'];
|
|
8
|
+
}
|
|
9
|
+
export interface IPresetOptions {
|
|
10
|
+
lazy?: boolean;
|
|
11
|
+
}
|
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @univerjs/sheets-note/index
|
|
2
|
+
(function(u,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs"],a):(u=typeof globalThis<"u"?globalThis:u||self,a(u.UniverSheetsNote={},u.UniverCore,u.UniverSheets,u.rxjs))})(this,function(u,a,l,_){"use strict";var H=Object.defineProperty;var z=(u,a,l)=>a in u?H(u,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[a]=l;var p=(u,a,l)=>z(u,typeof a!="symbol"?a+"":a,l);class m extends a.Disposable{constructor(){super(...arguments);p(this,"_noteMatrix",new Map);p(this,"_change$",new _.Subject);p(this,"change$",this._change$.asObservable())}_ensureNoteMatrix(e,t){let n=this._noteMatrix.get(e);n||(n=new Map,this._noteMatrix.set(e,n));let s=n.get(t);return s||(s=new a.ObjectMatrix,n.set(t,s)),s}getSheetShowNotes$(e,t){return this._change$.pipe(_.filter(({unitId:n,sheetId:s})=>n===e&&s===t),_.map(()=>{const n=this._ensureNoteMatrix(e,t),s=[];return n.forValue((i,h,c)=>{c.show&&s.push({loc:{row:i,col:h,unitId:e,subUnitId:t},note:c})}),s}))}getCellNoteChange$(e,t,n,s){return this._change$.pipe(_.filter(({unitId:i,sheetId:h,row:c,col:d})=>i===e&&h===t&&c===n&&d===s),_.map(({note:i})=>i))}updateNote(e,t,n,s,i,h){const c=this._ensureNoteMatrix(e,t),d=c.getValue(n,s);c.setValue(n,s,i),this._change$.next({unitId:e,sheetId:t,row:n,col:s,type:"update",note:i,oldNote:d,silent:h})}removeNote(e,t,n,s,i){const h=this._ensureNoteMatrix(e,t),c=h.getValue(n,s);h.realDeleteValue(n,s),this._change$.next({unitId:e,sheetId:t,row:n,col:s,type:"update",note:null,oldNote:c,silent:i})}toggleNotePopup(e,t,n,s,i){const h=this._ensureNoteMatrix(e,t),c=h.getValue(n,s);if(c){c.show=!c.show;const d={...c,show:c.show};h.setValue(n,s,d),this._change$.next({unitId:e,sheetId:t,row:n,col:s,type:"update",note:d,oldNote:c,silent:i})}}updateNotePosition(e,t,n,s,i,h,c){const d=this._ensureNoteMatrix(e,t),g=d.getValue(n,s);g&&(d.realDeleteValue(n,s),d.setValue(i,h,g),this._change$.next({unitId:e,sheetId:t,row:n,col:s,type:"ref",newPosition:{row:i,col:h},note:g,silent:c}))}getNote(e,t,n,s){return this._ensureNoteMatrix(e,t).getValue(n,s)}getUnitNotes(e){return this._noteMatrix.get(e)}getSheetNotes(e,t){const n=this._noteMatrix.get(e);if(n)return n.get(t)}getNotes(){return this._noteMatrix}deleteUnitNotes(e){this._noteMatrix.delete(e)}}const N={id:"sheet.mutation.update-note",type:a.CommandType.MUTATION,handler:(r,o)=>{const{unitId:e,sheetId:t,row:n,col:s,note:i,silent:h}=o;return r.get(m).updateNote(e,t,n,s,i,h),!0}},v={id:"sheet.mutation.remove-note",type:a.CommandType.MUTATION,handler:(r,o)=>{const{unitId:e,sheetId:t,row:n,col:s,silent:i}=o;return r.get(m).removeNote(e,t,n,s,i),!0}},I={id:"sheet.mutation.toggle-note-popup",type:a.CommandType.MUTATION,handler:(r,o)=>{const{unitId:e,sheetId:t,row:n,col:s,silent:i}=o;return r.get(m).toggleNotePopup(e,t,n,s,i),!0}},S={id:"sheet.mutation.update-note-position",type:a.CommandType.MUTATION,handler:(r,o)=>{const{unitId:e,sheetId:t,row:n,col:s,newPosition:i,silent:h}=o;return r.get(m).updateNotePosition(e,t,n,s,i.row,i.col,h),!0}};var b=Object.getOwnPropertyDescriptor,$=(r,o,e,t)=>{for(var n=t>1?void 0:t?b(o,e):o,s=r.length-1,i;s>=0;s--)(i=r[s])&&(n=i(n)||n);return n},f=(r,o)=>(e,t)=>o(e,t,r);let M=class extends a.Disposable{constructor(o,e,t,n){super();p(this,"_disposableMap",new Map);p(this,"_watcherMap",new Map);p(this,"_handleRangeChange",(o,e,t,n,s,i,h)=>i?{redos:[{id:S.id,params:{unitId:o,sheetId:e,row:n,col:s,newPosition:{row:i.startRow,col:i.startColumn},silent:h}}],undos:[{id:S.id,params:{unitId:o,sheetId:e,row:i.startRow,col:i.startColumn,newPosition:{row:n,col:s},note:t,silent:h}}]}:{redos:[{id:v.id,params:{unitId:o,sheetId:e,row:n,col:s}}],undos:[{id:N.id,params:{unitId:o,sheetId:e,row:n,col:s,note:t}}]});this._refRangeService=o,this._sheetsNoteModel=e,this._selectionManagerService=t,this._commandService=n,this._initData(),this._initRefRange()}_getIdWithUnitId(o,e,t,n){return`${o}-${e}-${t}-${n}`}_register(o,e,t,n,s){const i={startColumn:s,endColumn:s,startRow:n,endRow:n};this._disposableMap.set(this._getIdWithUnitId(o,e,n,s),this._refRangeService.registerRefRange(i,h=>{const c=l.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests(i,h,{selectionManagerService:this._selectionManagerService}),d=Array.isArray(c)?c[0]:c;return d&&d.startColumn===i.startColumn&&d.startRow===i.startRow?{undos:[],redos:[]}:this._handleRangeChange(o,e,t,n,s,d,!1)},o,e))}_watch(o,e,t,n,s){const i={startColumn:s,endColumn:s,startRow:n,endRow:n};this._watcherMap.set(this._getIdWithUnitId(o,e,n,s),this._refRangeService.watchRange(o,e,i,(h,c)=>{const{redos:d}=this._handleRangeChange(o,e,t,h.startRow,h.startColumn,c,!0);a.sequenceExecuteAsync(d,this._commandService,{onlyLocal:!0})},!0))}_unwatch(o,e,t,n){var i;const s=this._getIdWithUnitId(o,e,t,n);(i=this._watcherMap.get(s))==null||i.dispose(),this._watcherMap.delete(s)}_unregister(o,e,t,n){var i;const s=this._getIdWithUnitId(o,e,t,n);(i=this._disposableMap.get(s))==null||i.dispose(),this._disposableMap.delete(s)}_initData(){const o=this._sheetsNoteModel.getNotes();for(const[e,t]of o)for(const[n,s]of t)s.forValue((i,h,c)=>(c&&(this._register(e,n,c,i,h),this._watch(e,n,c,i,h)),!0))}_initRefRange(){this.disposeWithMe(this._sheetsNoteModel.change$.subscribe(o=>{switch(o.type){case"update":{const{unitId:e,sheetId:t,row:n,col:s,note:i}=o,h=this._getIdWithUnitId(e,t,n,s);i?this._disposableMap.has(h)||(this._register(e,t,i,n,s),this._watch(e,t,i,n,s)):(this._unregister(e,t,n,s),this._unwatch(e,t,n,s));break}case"ref":{const{unitId:e,sheetId:t,row:n,col:s,newPosition:i,note:h,silent:c}=o;this._unregister(e,t,n,s),c||(this._unwatch(e,t,n,s),this._watch(e,t,h,i.row,i.col)),this._register(e,t,h,i.row,i.col);break}}}))}};M=$([f(0,a.Inject(l.RefRangeService)),f(1,a.Inject(m)),f(2,a.Inject(l.SheetsSelectionsService)),f(3,a.ICommandService)],M);var D=Object.getOwnPropertyDescriptor,j=(r,o,e,t)=>{for(var n=t>1?void 0:t?D(o,e):o,s=r.length-1,i;s>=0;s--)(i=r[s])&&(n=i(n)||n);return n},w=(r,o)=>(e,t)=>o(e,t,r);u.SheetsNoteResourceController=class extends a.Disposable{constructor(o,e,t){super(),this._resourceManagerService=o,this._univerInstanceService=e,this._sheetsNoteModel=t,this._initSnapshot()}_initSnapshot(){const o=t=>{const n=this._sheetsNoteModel.getUnitNotes(t);if(!n)return"";const s={};return n.forEach((i,h)=>{const c={};i.forValue((d,g,q)=>{c[d]||(c[d]={}),c[d][g]=q}),Object.keys(c).length>0&&(s[h]=c)}),JSON.stringify(s)},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:T,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:t=>o(t),parseJson:t=>e(t),onUnLoad:t=>{this._sheetsNoteModel.deleteUnitNotes(t)},onLoad:(t,n)=>{Object.entries(n).forEach(([s,i])=>{Object.entries(i).forEach(([h,c])=>{Object.entries(c).forEach(([d,g])=>{this._sheetsNoteModel.updateNote(t,s,Number(h),Number(d),g)})})})}}))}},u.SheetsNoteResourceController=j([w(0,a.IResourceManagerService),w(1,a.IUniverInstanceService),w(2,a.Inject(m))],u.SheetsNoteResourceController);const y={id:"sheet.command.delete-note",type:a.CommandType.COMMAND,handler:(r,o)=>{const e=r.get(a.IUniverInstanceService),t=l.getSheetCommandTarget(e);if(!t)return!1;const s=r.get(l.SheetsSelectionsService).getCurrentLastSelection();if(!(s!=null&&s.primary))return!1;const{actualColumn:i,actualRow:h}=s.primary;return r.get(a.ICommandService).executeCommand(v.id,{unitId:t.unitId,sheetId:t.subUnitId,row:h,col:i})}},P={id:"sheet.command.toggle-note-popup",type:a.CommandType.COMMAND,handler:(r,o)=>{const e=r.get(a.IUniverInstanceService),t=l.getSheetCommandTarget(e);if(!t)return!1;const s=r.get(l.SheetsSelectionsService).getCurrentLastSelection();if(!(s!=null&&s.primary))return!1;const{actualColumn:i,actualRow:h}=s.primary;return r.get(a.ICommandService).executeCommand(I.id,{unitId:t.unitId,sheetId:t.subUnitId,row:h,col:i})}},R={id:"sheet.command.update-note",type:a.CommandType.COMMAND,handler:(r,o)=>r.get(a.ICommandService).syncExecuteCommand(N.id,o)};var x=Object.getOwnPropertyDescriptor,E=(r,o,e,t)=>{for(var n=t>1?void 0:t?x(o,e):o,s=r.length-1,i;s>=0;s--)(i=r[s])&&(n=i(n)||n);return n},V=(r,o)=>(e,t)=>o(e,t,r);let C=class extends a.Disposable{constructor(r){super(),this._commandService=r,this._initialize()}_initialize(){[S,I,N,v,y,P,R].forEach(r=>{this.disposeWithMe(this._commandService.registerCommand(r))})}};C=E([V(0,a.ICommandService)],C);var A=Object.defineProperty,W=Object.getOwnPropertyDescriptor,L=(r,o,e)=>o in r?A(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e,J=(r,o,e,t)=>{for(var n=t>1?void 0:t?W(o,e):o,s=r.length-1,i;s>=0;s--)(i=r[s])&&(n=i(n)||n);return n},U=(r,o)=>(e,t)=>o(e,t,r),O=(r,o,e)=>L(r,typeof o!="symbol"?o+"":o,e);const T="SHEET_NOTE_PLUGIN";u.UniverSheetsNotePlugin=class extends a.Plugin{constructor(o,e){super(),this._configService=o,this._injector=e}onStarting(){[[m],[C],[u.SheetsNoteResourceController],[M]].forEach(o=>{this._injector.add(o)}),a.touchDependencies(this._injector,[[m],[C],[u.SheetsNoteResourceController]])}onReady(){a.touchDependencies(this._injector,[[M]])}},O(u.UniverSheetsNotePlugin,"pluginName",T),O(u.UniverSheetsNotePlugin,"type",a.UniverInstanceType.UNIVER_SHEET),u.UniverSheetsNotePlugin=J([a.DependentOn(l.UniverSheetsPlugin),U(0,a.IConfigService),U(1,a.Inject(a.Injector))],u.UniverSheetsNotePlugin),u.RemoveNoteMutation=v,u.SheetDeleteNoteCommand=y,u.SheetToggleNotePopupCommand=P,u.SheetUpdateNoteCommand=R,u.SheetsNoteModel=m,u.ToggleNotePopupMutation=I,u.UpdateNoteMutation=N,u.UpdateNotePositionMutation=S,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// @univerjs/sheets-note/facade
|
|
6
|
+
(function(a,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core/facade"),require("@univerjs/sheets-note"),require("@univerjs/sheets/facade"),require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core/facade","@univerjs/sheets-note","@univerjs/sheets/facade","@univerjs/core"],m):(a=typeof globalThis<"u"?globalThis:a||self,m(a.UniverSheetsNoteFacade={},a.UniverCoreFacade,a.UniverSheetsNote,a.UniverSheetsFacade,a.UniverCore))})(this,function(a,m,h,f,g){"use strict";class w{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"}}m.FEventName.extend(w);class E extends f.FRange{createOrUpdateNote(c){return this._commandService.syncExecuteCommand(h.UpdateNoteMutation.id,{unitId:this.getUnitId(),sheetId:this.getSheetId(),row:this.getRow(),col:this.getColumn(),note:c}),this}deleteNote(){return this._injector.get(h.SheetsNoteModel),this._commandService.syncExecuteCommand(h.RemoveNoteMutation.id,{unitId:this.getUnitId(),sheetId:this.getSheetId(),row:this.getRow(),col:this.getColumn()}),this}getNote(){return this._injector.get(h.SheetsNoteModel).getNote(this.getUnitId(),this.getSheetId(),this.getRow(),this.getColumn())}}f.FRange.extend(E);class I extends m.FUniver{_initialize(c){this.registerEventHandler(this.Event.SheetNoteAdd,()=>c.get(h.SheetsNoteModel).change$.subscribe(e=>{if(e.type==="update"&&!e.oldNote&&e.note){const{unitId:d,sheetId:t,row:o,col:i,note:r,oldNote:s}=e,n=this.getSheetTarget(d,t);if(!n)return;const{workbook:S,worksheet:l}=n;this.fireEvent(this.Event.SheetNoteAdd,{workbook:S,worksheet:l,row:o,col:i,note:r})}})),this.registerEventHandler(this.Event.SheetNoteDelete,()=>c.get(h.SheetsNoteModel).change$.subscribe(e=>{if(e.type==="update"&&e.oldNote&&!e.note){const{unitId:d,sheetId:t,row:o,col:i,note:r,oldNote:s}=e,n=this.getSheetTarget(d,t);if(!n)return;const{workbook:S,worksheet:l}=n;this.fireEvent(this.Event.SheetNoteDelete,{workbook:S,worksheet:l,row:o,col:i,oldNote:s})}})),this.registerEventHandler(this.Event.SheetNoteUpdate,()=>c.get(h.SheetsNoteModel).change$.subscribe(e=>{if(e.type==="update"&&e.oldNote&&e.note){const{unitId:d,sheetId:t,row:o,col:i,note:r,oldNote:s}=e,n=this.getSheetTarget(d,t);if(!n)return;const{workbook:S,worksheet:l}=n;this.fireEvent(this.Event.SheetNoteUpdate,{workbook:S,worksheet:l,row:o,col:i,note:r,oldNote:s})}})),this.registerEventHandler(this.Event.SheetNoteShow,()=>c.get(h.SheetsNoteModel).change$.subscribe(e=>{if(e.type==="update"&&e.oldNote&&e.note&&!e.oldNote.show&&e.note.show){const{unitId:d,sheetId:t,row:o,col:i}=e,r=this.getSheetTarget(d,t);if(!r)return;const{workbook:s,worksheet:n}=r;this.fireEvent(this.Event.SheetNoteShow,{workbook:s,worksheet:n,row:o,col:i})}})),this.registerEventHandler(this.Event.SheetNoteHide,()=>c.get(h.SheetsNoteModel).change$.subscribe(e=>{if(e.type==="update"&&e.oldNote&&e.note&&e.oldNote.show&&!e.note.show){const{unitId:d,sheetId:t,row:o,col:i}=e,r=this.getSheetTarget(d,t);if(!r)return;const{workbook:s,worksheet:n}=r;this.fireEvent(this.Event.SheetNoteHide,{workbook:s,worksheet:n,row:o,col:i})}})),this.registerEventHandler(this.Event.BeforeSheetNoteAdd,()=>c.get(g.ICommandService).beforeCommandExecuted(e=>{if(e.id===h.SheetUpdateNoteCommand.id){const d=c.get(h.SheetsNoteModel),{unitId:t,sheetId:o,row:i,col:r,note:s}=e.params;if(d.getNote(t,o,i,r))return;const S=this.getSheetTarget(t,o);if(!S)return;const{workbook:l,worksheet:v}=S;if(this.fireEvent(this.Event.BeforeSheetNoteAdd,{workbook:l,worksheet:v,row:i,col:r,note:s}))throw new g.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNoteDelete,()=>c.get(g.ICommandService).beforeCommandExecuted(e=>{if(e.id===h.SheetDeleteNoteCommand.id){const d=c.get(h.SheetsNoteModel),{unitId:t,sheetId:o,row:i,col:r}=e.params,s=d.getNote(t,o,i,r);if(!s)return;const n=this.getSheetTarget(t,o);if(!n)return;const{workbook:S,worksheet:l}=n;if(this.fireEvent(this.Event.BeforeSheetNoteDelete,{workbook:S,worksheet:l,row:i,col:r,oldNote:s}))throw new g.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNoteUpdate,()=>c.get(g.ICommandService).beforeCommandExecuted(e=>{if(e.id===h.SheetUpdateNoteCommand.id){const d=c.get(h.SheetsNoteModel),{unitId:t,sheetId:o,row:i,col:r,note:s}=e.params,n=d.getNote(t,o,i,r);if(!n)return;const S=this.getSheetTarget(t,o);if(!S)return;const{workbook:l,worksheet:v}=S;if(this.fireEvent(this.Event.BeforeSheetNoteUpdate,{workbook:l,worksheet:v,row:i,col:r,note:s,oldNote:n}))throw new g.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNoteShow,()=>c.get(g.ICommandService).beforeCommandExecuted(e=>{if(e.id===h.SheetToggleNotePopupCommand.id){const d=c.get(h.SheetsNoteModel),{unitId:t,sheetId:o,row:i,col:r}=e.params,s=d.getNote(t,o,i,r);if(s!=null&&s.show)return;const n=this.getSheetTarget(t,o);if(!n)return;const{workbook:S,worksheet:l}=n;if(this.fireEvent(this.Event.BeforeSheetNoteShow,{workbook:S,worksheet:l,row:i,col:r}))throw new g.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNoteHide,()=>c.get(g.ICommandService).beforeCommandExecuted(e=>{if(e.id===h.SheetToggleNotePopupCommand.id){const d=c.get(h.SheetsNoteModel),{unitId:t,sheetId:o,row:i,col:r}=e.params,s=d.getNote(t,o,i,r);if(!(s!=null&&s.show))return;const n=this.getSheetTarget(t,o);if(!n)return;const{workbook:S,worksheet:l}=n;if(this.fireEvent(this.Event.BeforeSheetNoteHide,{workbook:S,worksheet:l,row:i,col:r}))throw new g.CanceledError}}))}}m.FUniver.extend(I);class k extends f.FWorksheet{getNotes(){const u=this._injector.get(h.SheetsNoteModel).getSheetNotes(this.getWorkbook().getUnitId(),this.getSheetId()),e=[];return u==null||u.forValue((d,t,o)=>{e.push({...o,row:d,col:t})}),e}}f.FWorksheet.extend(k),a.FSheetNoteEvent=w,a.FSheetsNoteRange=E,a.FSheetsNoteWorksheet=k,a.FUniverSheetNoteMixin=I,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// @univerjs/sheets-note-ui/index
|
|
10
|
+
(function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets-note"),require("@univerjs/ui"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("rxjs"),require("@univerjs/engine-render"),require("rxjs/operators"),require("react/jsx-runtime"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-note","@univerjs/ui","@univerjs/sheets","@univerjs/sheets-ui","rxjs","@univerjs/engine-render","rxjs/operators","react/jsx-runtime","@univerjs/design","react"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.UniverSheetsNoteUi={},u.UniverCore,u.UniverSheetsNote,u.UniverUi,u.UniverSheets,u.UniverSheetsUi,u.rxjs,u.UniverEngineRender,u.rxjs.operators,u.React,u.UniverDesign,u.React))})(this,function(u,s,h,S,N,M,I,R,J,Q,L,f){"use strict";var we=Object.defineProperty;var ye=(u,s,h)=>s in u?we(u,s,{enumerable:!0,configurable:!0,writable:!0,value:h}):u[s]=h;var b=(u,s,h)=>ye(u,typeof s!="symbol"?s+"":s,h);const $="SHEET_NOTE_COMPONENT";var X=Object.getOwnPropertyDescriptor,ee=(r,t,n,i)=>{for(var e=i>1?void 0:i?X(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},V=(r,t)=>(n,i)=>t(n,i,r);u.SheetsNotePopupService=class extends s.Disposable{constructor(n,i){super();b(this,"_lastPopup",null);b(this,"_activePopup");b(this,"_activePopup$",new I.BehaviorSubject(null));b(this,"activePopup$",this._activePopup$.asObservable());this._zenZoneService=n,this._cellPopupManagerService=i,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}showPopup(n,i){var v;const{row:e,col:o,unitId:a,subUnitId:c}=n;if(this._activePopup&&e===this._activePopup.row&&o===this._activePopup.col&&a===this._activePopup.unitId&&c===((v=this.activePopup)==null?void 0:v.subUnitId)){this._activePopup=n,this._activePopup$.next(n);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=n,this._activePopup$.next(n);const l=this._cellPopupManagerService.showPopup({unitId:a,subUnitId:c,row:e,col:o},{componentKey:$,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",extraProps:{location:n},priority:3});if(!l)throw new Error("[SheetsNotePopupService]: cannot show popup!");const d=new s.DisposableCollection;d.add(l),d.add({dispose:()=>{i==null||i()}}),this._lastPopup=d}hidePopup(n){this._activePopup&&(!n&&!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))}},u.SheetsNotePopupService=ee([V(0,S.IZenZoneService),V(1,s.Inject(M.CellPopupManagerService))],u.SheetsNotePopupService);const E={id:"sheet.operation.add-note-popup",type:s.CommandType.OPERATION,handler:async(r,t)=>{const n=r.get(N.SheetsSelectionsService),i=r.get(u.SheetsNotePopupService),o=r.get(s.IUniverInstanceService).getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);if(!o)return!1;const a=o.getActiveSheet(),c=n.getCurrentLastSelection();if(!(c!=null&&c.primary))return!1;const{primary:l}=c;return i.showPopup({unitId:o.getUnitId(),subUnitId:a.getSheetId(),row:l.actualRow,col:l.actualColumn,temp:!1,trigger:t==null?void 0:t.trigger}),!0}};function D(r){const t=r.get(N.SheetsSelectionsService),n=r.get(s.IUniverInstanceService);return t.selectionMoveEnd$.pipe(I.map(()=>{const i=t.getCurrentLastSelection();if(!(i!=null&&i.primary))return!1;const e=N.getSheetCommandTarget(n);if(!e)return!1;const{actualColumn:o,actualRow:a}=i.primary;return!!r.get(h.SheetsNoteModel).getNote(e.unitId,e.subUnitId,a,o)}))}function te(r){return{id:E.id,type:S.MenuItemType.BUTTON,title:"rightClick.addNote",icon:"AddNoteSingle",hidden$:I.combineLatest([S.getMenuHiddenObservable(r,s.UniverInstanceType.UNIVER_SHEET),D(r)]).pipe(I.map(([t,n])=>t||n)),disabled$:M.getCurrentRangeDisable$(r,{workbookTypes:[N.WorkbookEditablePermission],worksheetTypes:[N.WorksheetEditPermission]}),commandId:E.id}}function ie(r){return{id:h.SheetDeleteNoteCommand.id,type:S.MenuItemType.BUTTON,title:"rightClick.deleteNote",icon:"DeleteNoteSingle",hidden$:D(r).pipe(I.map(t=>!t)),disabled$:M.getCurrentRangeDisable$(r,{workbookTypes:[N.WorkbookEditablePermission],worksheetTypes:[N.WorksheetEditPermission]})}}function ne(r){return{id:h.SheetToggleNotePopupCommand.id,type:S.MenuItemType.BUTTON,title:"rightClick.toggleNote",icon:"HideNoteSingle",hidden$:D(r).pipe(I.map(t=>!t))}}const k={[S.ContextMenuPosition.MAIN_AREA]:{[S.ContextMenuGroup.OTHERS]:{order:0,[E.id]:{order:0,menuItemFactory:te},[h.SheetDeleteNoteCommand.id]:{order:0,menuItemFactory:ie},[h.SheetToggleNotePopupCommand.id]:{order:0,menuItemFactory:ne}}}};var re=Object.getOwnPropertyDescriptor,oe=(r,t,n,i)=>{for(var e=i>1?void 0:i?re(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},O=(r,t)=>(n,i)=>t(n,i,r);u.SheetsCellContentController=class extends s.Disposable{constructor(t,n,i,e){super(),this._sheetInterceptorService=t,this._sheetsNoteModel=n,this._renderManagerService=i,this._univerInstanceService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(N.INTERCEPTOR_POINT.CELL_CONTENT,{effect:s.InterceptorEffectEnum.Style,handler:(t,n,i)=>{const{row:e,col:o,unitId:a,subUnitId:c}=n;return this._sheetsNoteModel.getNote(a,c,e,o)?i({...t,markers:{...t==null?void 0:t.markers,tr:{color:"#FFBD37",size:6}}}):i(t)},priority:100}))}_initSkeletonChange(){const t=()=>{var o;const n=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);if(!n)return;const i=n.getUnitId(),e=this._renderManagerService.getRenderById(i);(o=e==null?void 0:e.mainComponent)==null||o.makeForceDirty()};this.disposeWithMe(this._sheetsNoteModel.change$.pipe(I.debounceTime(16)).subscribe(()=>{t()}))}},u.SheetsCellContentController=oe([O(0,s.Inject(N.SheetInterceptorService)),O(1,s.Inject(h.SheetsNoteModel)),O(2,R.IRenderManagerService),O(3,s.IUniverInstanceService)],u.SheetsCellContentController);var se=Object.getOwnPropertyDescriptor,ae=(r,t,n,i)=>{for(var e=i>1?void 0:i?se(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},U=(r,t)=>(n,i)=>t(n,i,r);let T=class extends s.Disposable{constructor(t,n,i,e){super();b(this,"_noteMatrix",new s.ObjectMatrix);this._sheetsNoteModel=t,this._univerInstanceService=n,this._cellPopupManagerService=i,this._sheetsNotePopupService=e,this._initNoteChangeListener()}_showPopup(t,n,i,e){return this._sheetsNotePopupService.hidePopup(!0),this._cellPopupManagerService.showPopup({unitId:t,subUnitId:n,row:i,col:e},{componentKey:$,direction:"horizontal",extraProps:{location:{unitId:t,subUnitId:n,row:i,col:e}},priority:3})}_initSheet(t,n){var o;this._noteMatrix.forValue((a,c,l)=>{l.dispose()}),this._noteMatrix=new s.ObjectMatrix;const e=(a,c,l,d,v)=>{const g=this._noteMatrix,C=g.getValue(l,d);if(v!=null&&v.show){if(!C){const p=this._showPopup(a,c,l,d);p&&g.setValue(l,d,p)}}else C&&(C.dispose(),g.realDeleteValue(l,d))};return(o=this._sheetsNoteModel.getSheetNotes(t,n))==null||o.forValue((a,c,l)=>{e(t,n,a,c,l)}),this._sheetsNoteModel.change$.subscribe(a=>{if(!(a.unitId!==t||a.sheetId!==n))switch(a.type){case"ref":{const{unitId:c,sheetId:l,row:d,col:v,newPosition:g,note:C}=a,p=this._noteMatrix;if(!C.show)return;const _=p.getValue(d,v);_&&(_.dispose(),p.realDeleteValue(d,v));const m=this._showPopup(c,l,g.row,g.col);m&&p.setValue(g.row,g.col,m);break}case"update":{const{unitId:c,sheetId:l,row:d,col:v,note:g}=a;e(c,l,d,v,g);break}}})}_initNoteChangeListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_SHEET).pipe(I.switchMap(t=>{var n;return(n=t==null?void 0:t.activeSheet$)!=null?n:I.of(null)})).subscribe(t=>{if(t){const n=this._initSheet(t.getUnitId(),t.getSheetId());return()=>{n.unsubscribe()}}else this._noteMatrix.forValue((n,i,e)=>{e.dispose()}),this._noteMatrix=new s.ObjectMatrix}))}};T=ae([U(0,s.Inject(h.SheetsNoteModel)),U(1,s.Inject(s.IUniverInstanceService)),U(2,s.Inject(M.CellPopupManagerService)),U(3,s.Inject(u.SheetsNotePopupService))],T);var ue=Object.getOwnPropertyDescriptor,ce=(r,t,n,i)=>{for(var e=i>1?void 0:i?ue(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},w=(r,t)=>(n,i)=>t(n,i,r);u.SheetsNotePopupController=class extends s.Disposable{constructor(n,i,e,o,a,c){super();b(this,"_isSwitchingSheet",!1);this._sheetsNotePopupService=n,this._sheetsNoteModel=i,this._sheetSelectionService=e,this._editorBridgeService=o,this._renderManagerService=a,this._hoverManagerService=c,this._initSelectionUpdateListener(),this._initEditorBridge(),this._initHoverEvent()}_handleSelectionChange(n,i,e){var p,_,m;const o=(p=n[0])==null?void 0:p.range,a=this._renderManagerService.getRenderById(i),c=(_=a==null?void 0:a.with(M.SheetSkeletonManagerService).getSkeletonParam(e))==null?void 0:_.skeleton;if(!c||!o)return;const l=c.getCellWithCoordByIndex(o.startRow,o.startColumn);if((((m=o.rangeType)!=null?m:s.RANGE_TYPE.NORMAL)!==s.RANGE_TYPE.NORMAL||o.endColumn-o.startColumn>0||o.endRow-o.startRow>0)&&!((l.isMerged||l.isMergedMainCell)&&s.Rectangle.equals(l.mergeInfo,o))){this._sheetsNotePopupService.hidePopup();return}const v=l.actualRow,g=l.actualColumn,C=this._sheetsNoteModel.getNote(i,e,v,g);C!=null&&C.show||(C?this._sheetsNotePopupService.showPopup({unitId:i,subUnitId:e,row:v,col:g}):this._sheetsNotePopupService.hidePopup(!0))}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(n=>{if(this._isSwitchingSheet)return;const i=this._sheetSelectionService.currentSelectionParam;i&&this._handleSelectionChange(n,i.unitId,i.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(n=>{n.visible&&this._sheetsNotePopupService.hidePopup(!0)}))}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(J.debounceTime(100)).subscribe(n=>{if(!(n!=null&&n.location))return;const{unitId:i,subUnitId:e,row:o,col:a}=n.location,c=this._sheetsNoteModel.getNote(i,e,o,a);c!=null&&c.show||(c?this._sheetsNotePopupService.showPopup({unitId:i,subUnitId:e,row:o,col:a,temp:!0}):this._sheetsNotePopupService.hidePopup())}))}},u.SheetsNotePopupController=ce([w(0,s.Inject(u.SheetsNotePopupService)),w(1,s.Inject(h.SheetsNoteModel)),w(2,s.Inject(N.SheetsSelectionsService)),w(3,M.IEditorBridgeService),w(4,R.IRenderManagerService),w(5,s.Inject(M.HoverManagerService))],u.SheetsNotePopupController);var P=function(){return P=Object.assign||function(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},P.apply(this,arguments)},le=function(r,t){var n={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(n[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,i=Object.getOwnPropertySymbols(r);e<i.length;e++)t.indexOf(i[e])<0&&Object.prototype.propertyIsEnumerable.call(r,i[e])&&(n[i[e]]=r[i[e]]);return n},j=f.forwardRef(function(r,t){var n=r.icon,i=r.id,e=r.className,o=r.extend,a=le(r,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(i," ").concat(e||"").trim(),l=f.useRef("_".concat(de()));return z(n,"".concat(i),{defIds:n.defIds,idSuffix:l.current},P({ref:t,className:c},a),o)});function z(r,t,n,i,e){return f.createElement(r.tag,P(P({key:t},pe(r,n,e)),i),(he(r,n).children||[]).map(function(o,a){return z(o,"".concat(t,"-").concat(r.tag,"-").concat(a),n,void 0,e)}))}function pe(r,t,n){var i=P({},r.attrs);n!=null&&n.colorChannel1&&i.fill==="colorChannel1"&&(i.fill=n.colorChannel1),r.tag==="mask"&&i.id&&(i.id=i.id+t.idSuffix),Object.entries(i).forEach(function(o){var a=o[0],c=o[1];a==="mask"&&typeof c=="string"&&(i[a]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var e=t.defIds;return!e||e.length===0||(r.tag==="use"&&i["xlink:href"]&&(i["xlink:href"]=i["xlink:href"]+t.idSuffix),Object.entries(i).forEach(function(o){var a=o[0],c=o[1];typeof c=="string"&&(i[a]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),i}function he(r,t){var n,i=t.defIds;return!i||i.length===0?r:r.tag==="defs"&&(!((n=r.children)===null||n===void 0)&&n.length)?P(P({},r),{children:r.children.map(function(e){return typeof e.attrs.id=="string"&&i&&i.indexOf(e.attrs.id)>-1?P(P({},e),{attrs:P(P({},e.attrs),{id:e.attrs.id+t.idSuffix})}):e})}):r}function de(){return Math.random().toString(36).substring(2,8)}j.displayName="UniverIcon";var ve={tag:"svg",attrs:{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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745 11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962 11.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"}}]},A=f.forwardRef(function(r,t){return f.createElement(j,Object.assign({},r,{id:"add-note-single",ref:t,icon:ve}))});A.displayName="AddNoteSingle";var fe={tag:"svg",attrs:{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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618 14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618 8.80985 11.9946 9.10762 11.6968 9.47489 11.6968z"}}]},B=f.forwardRef(function(r,t){return f.createElement(j,Object.assign({},r,{id:"delete-note-single",ref:t,icon:fe}))});B.displayName="DeleteNoteSingle";var ge={tag:"svg",attrs:{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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477 13.039 11.6659 12.5573 11.4614 12.0394 11.4614 11.5213 11.4614 11.0398 11.6666 10.6878 11.9487 10.3037 12.2565 10.2045 12.5399 10.2044 12.6147 10.2044 12.6893 10.3034 12.9737 10.6878 13.2817 11.0398 13.5636 11.5215 13.768 12.0394 13.768 12.5574 13.768 13.039 13.5635 13.3909 13.2817 13.7751 12.9739 13.8743 12.6897 13.8743 12.6147zM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198 13.6701 14.7627 12.9019 15.0981 12.0394 15.0981 11.1768 15.0981 10.4085 14.7627 9.85577 14.3198 9.33533 13.9027 8.87433 13.2769 8.87433 12.6147 8.8744 11.9526 9.33541 11.3276 9.85577 10.9106 10.4086 10.4676 11.1767 10.1313 12.0394 10.1313 12.9018 10.1313 13.6701 10.4668 14.223 10.9096 14.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"}}]},W=f.forwardRef(function(r,t){return f.createElement(j,Object.assign({},r,{id:"hide-note-single",ref:t,icon:ge}))});W.displayName="HideNoteSingle";const F=r=>{var C;const t=S.useDependency(h.SheetsNoteModel),n=S.useDependency(s.LocaleService),i=S.useConfigValue(G),e=(C=r.popup.extraProps)==null?void 0:C.location;if(!e)return console.error("Popup extraProps or location is undefined."),null;const[o,a]=f.useState(()=>{var m,y;const p={width:((m=i==null?void 0:i.defaultNoteSize)==null?void 0:m.width)||216,height:((y=i==null?void 0:i.defaultNoteSize)==null?void 0:y.height)||92,note:""};return t.getNote(e.unitId,e.subUnitId,e.row,e.col)||p}),c=f.useRef(null),l=S.useDependency(s.ICommandService),d=f.useMemo(()=>e?t.getCellNoteChange$(e.unitId,e.subUnitId,e.row,e.col):I.of(null),[e]),v=S.useDebounceFn(p=>{e&&(p.note?l.executeCommand(h.SheetUpdateNoteCommand.id,{unitId:e.unitId,sheetId:e.subUnitId,row:e.row,col:e.col,note:p}):l.executeCommand(h.SheetDeleteNoteCommand.id,{unitId:e.unitId,sheetId:e.subUnitId,row:e.row,col:e.col}))});f.useEffect(()=>{var p;e&&(t.getNote(e.unitId,e.subUnitId,e.row,e.col)||(p=c.current)==null||p.focus())},[e,t]),f.useEffect(()=>{const p=d.subscribe(()=>{if(!e)return;const _=t.getNote(e.unitId,e.subUnitId,e.row,e.col);_&&a(_)});return()=>p.unsubscribe()},[d]),f.useEffect(()=>{const p=c.current;if(!p)return;const _=new ResizeObserver(m=>{const y=m[0];if(!y)return;const{width:Me,height:be}=y.contentRect,Y={...o,width:Me,height:be};a(Y),v(Y)});return _.observe(p),()=>{_.disconnect()}},[o.note]);const g=p=>{const _=p.target.value,m={...o,note:_};a(m),v(m)};return Q.jsx("textarea",{ref:c,"data-u-comp":"note-textarea",className:L.clsx(`
|
|
11
|
+
univer-resize-both univer-ml-px univer-rounded-md univer-border univer-border-solid univer-border-gray-200
|
|
12
|
+
univer-bg-white univer-p-2 univer-text-gray-900 univer-shadow
|
|
13
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-800 dark:univer-text-white
|
|
14
|
+
focus:univer-outline-none
|
|
15
|
+
`,L.scrollbarClassName),style:{width:o.width,height:o.height},value:o.note,placeholder:n.t("note.placeholder"),onChange:g})};var _e=Object.getOwnPropertyDescriptor,Se=(r,t,n,i)=>{for(var e=i>1?void 0:i?_e(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},x=(r,t)=>(n,i)=>t(n,i,r);let H=class extends s.Disposable{constructor(r,t,n){super(),this._componentManager=r,this._menuManagerService=t,this._commandService=n,this._initComponents(),this._initMenu(),this._initCommands()}_initComponents(){this.disposeWithMe(this._componentManager.register($,F)),this.disposeWithMe(this._componentManager.register("AddNoteSingle",A)),this.disposeWithMe(this._componentManager.register("DeleteNoteSingle",B)),this.disposeWithMe(this._componentManager.register("HideNoteSingle",W))}_initMenu(){this._menuManagerService.mergeMenu(k)}_initCommands(){this._commandService.registerCommand(E)}};H=Se([x(0,s.Inject(S.ComponentManager)),x(1,s.Inject(S.IMenuManagerService)),x(2,s.ICommandService)],H);var Ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,Pe=(r,t,n)=>t in r?Ce(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,Ne=(r,t,n,i)=>{for(var e=i>1?void 0:i?me(t,n):t,o=r.length-1,a;o>=0;o--)(a=r[o])&&(e=a(e)||e);return e},q=(r,t)=>(n,i)=>t(n,i,r),Z=(r,t,n)=>Pe(r,typeof t!="symbol"?t+"":t,n);const Ie="SHEET_NOTE_UI_PLUGIN",G="sheets-note-ui",K={menu:k};u.UniverSheetsNoteUIPlugin=class extends s.Plugin{constructor(t=K,n,i){super(),this._config=t,this._injector=n,this._configService=i;const{menu:e,...o}=s.merge({},K,this._config);e&&this._configService.setConfig("menu",e,{merge:!0}),this._configService.setConfig(G,o)}onStarting(){[[u.SheetsNotePopupService],[u.SheetsCellContentController],[u.SheetsNotePopupController],[H],[T]].forEach(t=>{this._injector.add(t)})}onReady(){s.touchDependencies(this._injector,[[H],[u.SheetsCellContentController]])}onRendered(){s.touchDependencies(this._injector,[[u.SheetsNotePopupController],[T]])}},Z(u.UniverSheetsNoteUIPlugin,"pluginName",Ie),Z(u.UniverSheetsNoteUIPlugin,"type",s.UniverInstanceType.UNIVER_SHEET),u.UniverSheetsNoteUIPlugin=Ne([s.DependentOn(h.UniverSheetsNotePlugin),q(1,s.Inject(s.Injector)),q(2,s.IConfigService)],u.UniverSheetsNoteUIPlugin),u.SheetsNote=F,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
// index
|
|
19
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/sheets-note"),require("@univerjs/sheets-note-ui"),require("@univerjs/sheets-note/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-note","@univerjs/sheets-note-ui","@univerjs/sheets-note/facade"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverPresetSheetsNote={},e.UniverSheetsNote,e.UniverSheetsNoteUi,e.UniverSheetsNoteFacade))})(this,function(e,n,s,i){"use strict";function r(){return{plugins:[n.UniverSheetsNotePlugin,s.UniverSheetsNoteUIPlugin].filter(t=>!!t)}}e.UniverSheetsNotePreset=r,Object.keys(i).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:()=>i[t]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/en-US
|
|
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(){"use strict";return{rightClick:{addNote:"Add Note",deleteNote:"Delete Note",toggleNote:"Show/Hide Note"},note:{placeholder:"Type here"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/en-US
|
|
6
|
+
(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.merge({},n)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/fa-IR
|
|
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(){"use strict";return{rightClick:{addNote:"افزودن یادداشت",deleteNote:"حذف یادداشت",toggleNote:"نمایش/پنهان کردن یادداشت"},note:{placeholder:"اینجا تایپ کنید"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/fa-IR
|
|
6
|
+
(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.merge({},i)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/fr-FR
|
|
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(){"use strict";return{rightClick:{addNote:"Ajouter une note",deleteNote:"Supprimer la note",toggleNote:"Afficher/Masquer la note"},note:{placeholder:"Écrivez ici"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/fr-FR
|
|
6
|
+
(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.merge({},r)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/ru-RU
|
|
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(){"use strict";return{rightClick:{addNote:"Добавить примечание",deleteNote:"Удалить примечание",toggleNote:"Показать/Скрыть примечание"},note:{placeholder:"Введите текст здесь"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/ru-RU
|
|
6
|
+
(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.merge({},i)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/vi-VN
|
|
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(){"use strict";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"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/vi-VN
|
|
6
|
+
(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.merge({},i)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/zh-CN
|
|
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(){"use strict";return{rightClick:{addNote:"添加批注",deleteNote:"删除批注",toggleNote:"显示/隐藏批注"},note:{placeholder:"在此输入"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/zh-CN
|
|
6
|
+
(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.merge({},i)});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @univerjs/sheets-note-ui/locale/zh-TW
|
|
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(){"use strict";return{rightClick:{addNote:"添加批註",deleteNote:"刪除批註",toggleNote:"顯示/隱藏批註"},note:{placeholder:"在此輸入"}}});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// locale/zh-TW
|
|
6
|
+
(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.merge({},i)});
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@univerjs/preset-sheets-note",
|
|
3
|
+
"version": "0.7.0-beta.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "",
|
|
6
|
+
"author": "DreamNum <developer@univer.ai>",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"funding": {
|
|
9
|
+
"type": "opencollective",
|
|
10
|
+
"url": "https://opencollective.com/univer"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://univer.ai",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/dream-num/univer-presets"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/dream-num/univer-presets/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"univer"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"*.css"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./lib/es/index.js",
|
|
29
|
+
"require": "./lib/cjs/index.js",
|
|
30
|
+
"types": "./lib/types/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./*": {
|
|
33
|
+
"import": "./lib/es/*",
|
|
34
|
+
"require": "./lib/cjs/*",
|
|
35
|
+
"types": "./lib/types/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./locales/*": {
|
|
38
|
+
"import": "./lib/es/locales/*.js",
|
|
39
|
+
"require": "./lib/cjs/locales/*.js",
|
|
40
|
+
"types": "./lib/types/locales/*.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./lib/*": "./lib/*"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"main": "./lib/es/index.js",
|
|
48
|
+
"directories": {
|
|
49
|
+
"lib": "lib"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"lib"
|
|
53
|
+
],
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
56
|
+
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
57
|
+
"rxjs": ">=7.0.0"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@univerjs/sheets-note": "0.7.0-beta.1",
|
|
61
|
+
"@univerjs/sheets-note-ui": "0.7.0-beta.1",
|
|
62
|
+
"rxjs": ">=7.0.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@univerjs/core": "0.7.0-beta.1",
|
|
66
|
+
"react": "18.3.1",
|
|
67
|
+
"react-dom": "18.3.1",
|
|
68
|
+
"typescript": "^5.8.3",
|
|
69
|
+
"@univerjs-infra/shared": "0.7.0-beta.1"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"prebuild:preset": "tsx prepare.ts",
|
|
73
|
+
"build:preset": "tsx build.ts",
|
|
74
|
+
"lint:types": "tsc --noEmit"
|
|
75
|
+
},
|
|
76
|
+
"module": "./lib/es/index.js"
|
|
77
|
+
}
|