@univerjs/sheets-zen-editor 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +9 -3
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -144
- package/lib/es/index.js +9 -466
- package/lib/es/locale/ca-ES.js +1 -14
- package/lib/es/locale/en-US.js +1 -14
- package/lib/es/locale/es-ES.js +1 -14
- package/lib/es/locale/fa-IR.js +1 -14
- package/lib/es/locale/fr-FR.js +1 -14
- package/lib/es/locale/ja-JP.js +1 -14
- package/lib/es/locale/ko-KR.js +1 -14
- package/lib/es/locale/ru-RU.js +1 -14
- package/lib/es/locale/sk-SK.js +1 -14
- package/lib/es/locale/vi-VN.js +1 -14
- package/lib/es/locale/zh-CN.js +1 -14
- package/lib/es/locale/zh-TW.js +1 -14
- package/lib/facade.js +1 -144
- package/lib/index.css +82 -1
- package/lib/index.js +9 -466
- package/lib/locale/ca-ES.js +1 -14
- package/lib/locale/en-US.js +1 -14
- package/lib/locale/es-ES.js +1 -14
- package/lib/locale/fa-IR.js +1 -14
- package/lib/locale/fr-FR.js +1 -14
- package/lib/locale/ja-JP.js +1 -14
- package/lib/locale/ko-KR.js +1 -14
- package/lib/locale/ru-RU.js +1 -14
- package/lib/locale/sk-SK.js +1 -14
- package/lib/locale/vi-VN.js +1 -14
- package/lib/locale/zh-CN.js +1 -14
- package/lib/locale/zh-TW.js +1 -14
- package/lib/types/commands/commands/zen-editor.command.d.ts +16 -1
- package/lib/types/config/config.d.ts +16 -1
- package/lib/types/controllers/shortcuts/zen-editor.shortcut.d.ts +17 -2
- package/lib/types/controllers/zen-editor-ui.controller.d.ts +15 -0
- package/lib/types/controllers/zen-editor.controller.d.ts +15 -0
- package/lib/types/facade/f-univer.d.ts +16 -1
- package/lib/types/facade/f-workbook.d.ts +15 -0
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/menu.d.ts +17 -2
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/zen-editor.service.d.ts +18 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -3
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -13
package/lib/es/locale/zh-TW.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
const e
|
|
2
|
-
rightClick: {
|
|
3
|
-
zenEditor: "禪模式編輯"
|
|
4
|
-
},
|
|
5
|
-
shortcut: {
|
|
6
|
-
sheet: {
|
|
7
|
-
"zen-edit-cancel": "取消編輯(禪模式狀態)",
|
|
8
|
-
"zen-edit-confirm": "放棄編輯(禪模式狀態)"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
e as default
|
|
14
|
-
};
|
|
1
|
+
const e={rightClick:{zenEditor:`禪模式編輯`},shortcut:{sheet:{"zen-edit-cancel":`取消編輯(禪模式狀態)`,"zen-edit-confirm":`放棄編輯(禪模式狀態)`}}};export{e as default};
|
package/lib/facade.js
CHANGED
|
@@ -1,144 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FUniver as f } from "@univerjs/core/facade";
|
|
3
|
-
import { RichTextEditingMutation as T } from "@univerjs/docs";
|
|
4
|
-
import { IEditorBridgeService as v } from "@univerjs/sheets-ui";
|
|
5
|
-
import { OpenZenEditorCommand as l, CancelZenEditCommand as p, ConfirmZenEditCommand as m } from "@univerjs/sheets-zen-editor";
|
|
6
|
-
import { FWorkbook as x } from "@univerjs/sheets/facade";
|
|
7
|
-
class b extends f {
|
|
8
|
-
// eslint-disable-next-line max-lines-per-function
|
|
9
|
-
_initSheetZenEditorEvent(i) {
|
|
10
|
-
const E = i.get(u);
|
|
11
|
-
this.disposeWithMe(
|
|
12
|
-
this.registerEventHandler(
|
|
13
|
-
this.Event.BeforeSheetEditStart,
|
|
14
|
-
() => E.beforeCommandExecuted((e) => {
|
|
15
|
-
if (e.id === l.id) {
|
|
16
|
-
const t = this.getCommandSheetTarget(e);
|
|
17
|
-
if (!t)
|
|
18
|
-
return;
|
|
19
|
-
const { workbook: s, worksheet: d } = t, o = i.get(v), c = e.params, { keycode: a, eventType: h } = c, r = o.getEditLocation(), n = {
|
|
20
|
-
row: r.row,
|
|
21
|
-
column: r.column,
|
|
22
|
-
eventType: h,
|
|
23
|
-
keycode: a,
|
|
24
|
-
workbook: s,
|
|
25
|
-
worksheet: d,
|
|
26
|
-
isZenEditor: !0
|
|
27
|
-
};
|
|
28
|
-
if (this.fireEvent(this.Event.BeforeSheetEditStart, n), n.cancel)
|
|
29
|
-
throw new C();
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
), this.disposeWithMe(
|
|
34
|
-
this.registerEventHandler(
|
|
35
|
-
this.Event.BeforeSheetEditEnd,
|
|
36
|
-
() => E.beforeCommandExecuted((e) => {
|
|
37
|
-
if (e.id === p.id || e.id === m.id) {
|
|
38
|
-
const t = this.getCommandSheetTarget(e);
|
|
39
|
-
if (!t)
|
|
40
|
-
return;
|
|
41
|
-
const { workbook: s, worksheet: d } = t, o = i.get(v), c = i.get(k), a = e.params, { keycode: h, eventType: r } = a, n = o.getEditLocation(), g = {
|
|
42
|
-
row: n.row,
|
|
43
|
-
column: n.column,
|
|
44
|
-
eventType: r,
|
|
45
|
-
keycode: h,
|
|
46
|
-
workbook: s,
|
|
47
|
-
worksheet: d,
|
|
48
|
-
isZenEditor: !0,
|
|
49
|
-
value: w.create(c.getUnit(S).getSnapshot()),
|
|
50
|
-
isConfirm: e.id === m.id
|
|
51
|
-
};
|
|
52
|
-
if (this.fireEvent(this.Event.BeforeSheetEditEnd, g), g.cancel)
|
|
53
|
-
throw new C();
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
)
|
|
57
|
-
), this.disposeWithMe(
|
|
58
|
-
this.registerEventHandler(
|
|
59
|
-
this.Event.SheetEditStarted,
|
|
60
|
-
() => E.onCommandExecuted((e) => {
|
|
61
|
-
if (e.id === l.id) {
|
|
62
|
-
const t = this.getCommandSheetTarget(e);
|
|
63
|
-
if (!t)
|
|
64
|
-
return;
|
|
65
|
-
const { workbook: s, worksheet: d } = t, o = i.get(v), c = e.params, { keycode: a, eventType: h } = c, r = o.getEditLocation(), n = {
|
|
66
|
-
row: r.row,
|
|
67
|
-
column: r.column,
|
|
68
|
-
eventType: h,
|
|
69
|
-
keycode: a,
|
|
70
|
-
workbook: s,
|
|
71
|
-
worksheet: d,
|
|
72
|
-
isZenEditor: !0
|
|
73
|
-
};
|
|
74
|
-
this.fireEvent(this.Event.SheetEditStarted, n);
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
)
|
|
78
|
-
), this.disposeWithMe(
|
|
79
|
-
this.registerEventHandler(
|
|
80
|
-
this.Event.SheetEditEnded,
|
|
81
|
-
() => E.onCommandExecuted((e) => {
|
|
82
|
-
if (e.id === p.id || e.id === m.id) {
|
|
83
|
-
const t = this.getCommandSheetTarget(e);
|
|
84
|
-
if (!t)
|
|
85
|
-
return;
|
|
86
|
-
const { workbook: s, worksheet: d } = t, o = i.get(v), c = e.params, { keycode: a, eventType: h } = c, r = o.getEditLocation(), n = {
|
|
87
|
-
row: r.row,
|
|
88
|
-
column: r.column,
|
|
89
|
-
eventType: h,
|
|
90
|
-
keycode: a,
|
|
91
|
-
workbook: s,
|
|
92
|
-
worksheet: d,
|
|
93
|
-
isZenEditor: !0,
|
|
94
|
-
isConfirm: e.id === m.id
|
|
95
|
-
};
|
|
96
|
-
this.fireEvent(this.Event.SheetEditEnded, n);
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
)
|
|
100
|
-
), this.disposeWithMe(
|
|
101
|
-
this.registerEventHandler(
|
|
102
|
-
this.Event.SheetEditChanging,
|
|
103
|
-
() => E.onCommandExecuted((e) => {
|
|
104
|
-
if (e.id === T.id) {
|
|
105
|
-
const t = this.getActiveSheet();
|
|
106
|
-
if (!t)
|
|
107
|
-
return;
|
|
108
|
-
const { workbook: s, worksheet: d } = t, o = i.get(v), c = i.get(k), a = e.params;
|
|
109
|
-
if (!o.isVisible().visible) return;
|
|
110
|
-
const { unitId: h } = a;
|
|
111
|
-
if (h === S) {
|
|
112
|
-
const { row: r, column: n } = o.getEditLocation(), g = {
|
|
113
|
-
workbook: s,
|
|
114
|
-
worksheet: d,
|
|
115
|
-
row: r,
|
|
116
|
-
column: n,
|
|
117
|
-
value: w.create(c.getUnit(S).getSnapshot()),
|
|
118
|
-
isZenEditor: !0
|
|
119
|
-
};
|
|
120
|
-
this.fireEvent(this.Event.SheetEditChanging, g);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
)
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @ignore
|
|
129
|
-
*/
|
|
130
|
-
_initialize(i) {
|
|
131
|
-
this._initSheetZenEditorEvent(i);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
f.extend(b);
|
|
135
|
-
class y extends x {
|
|
136
|
-
startZenEditingAsync() {
|
|
137
|
-
return this._injector.get(u).executeCommand(l.id);
|
|
138
|
-
}
|
|
139
|
-
endZenEditingAsync(i = !0) {
|
|
140
|
-
const E = this._injector.get(u);
|
|
141
|
-
return i ? E.executeCommand(m.id) : E.executeCommand(p.id);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
x.extend(y);
|
|
1
|
+
import{CanceledError as e,DOCS_ZEN_EDITOR_UNIT_ID_KEY as t,ICommandService as n,IUniverInstanceService as r,RichTextValue as i}from"@univerjs/core";import{FUniver as a}from"@univerjs/core/facade";import{RichTextEditingMutation as o}from"@univerjs/docs";import{IEditorBridgeService as s}from"@univerjs/sheets-ui";import{CancelZenEditCommand as c,ConfirmZenEditCommand as l,OpenZenEditorCommand as u}from"@univerjs/sheets-zen-editor";import{FWorkbook as d}from"@univerjs/sheets/facade";var f=class extends a{_initSheetZenEditorEvent(a){let d=a.get(n);this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetEditStart,()=>d.beforeCommandExecuted(t=>{if(t.id===u.id){let n=this.getCommandSheetTarget(t);if(!n)return;let{workbook:r,worksheet:i}=n,o=a.get(s),{keycode:c,eventType:l}=t.params,u=o.getEditLocation(),d={row:u.row,column:u.column,eventType:l,keycode:c,workbook:r,worksheet:i,isZenEditor:!0};if(this.fireEvent(this.Event.BeforeSheetEditStart,d),d.cancel)throw new e}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetEditEnd,()=>d.beforeCommandExecuted(n=>{if(n.id===c.id||n.id===l.id){let o=this.getCommandSheetTarget(n);if(!o)return;let{workbook:c,worksheet:u}=o,d=a.get(s),f=a.get(r),{keycode:p,eventType:m}=n.params,h=d.getEditLocation(),g={row:h.row,column:h.column,eventType:m,keycode:p,workbook:c,worksheet:u,isZenEditor:!0,value:i.create(f.getUnit(t).getSnapshot()),isConfirm:n.id===l.id};if(this.fireEvent(this.Event.BeforeSheetEditEnd,g),g.cancel)throw new e}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditStarted,()=>d.onCommandExecuted(e=>{if(e.id===u.id){let t=this.getCommandSheetTarget(e);if(!t)return;let{workbook:n,worksheet:r}=t,i=a.get(s),{keycode:o,eventType:c}=e.params,l=i.getEditLocation(),u={row:l.row,column:l.column,eventType:c,keycode:o,workbook:n,worksheet:r,isZenEditor:!0};this.fireEvent(this.Event.SheetEditStarted,u)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditEnded,()=>d.onCommandExecuted(e=>{if(e.id===c.id||e.id===l.id){let t=this.getCommandSheetTarget(e);if(!t)return;let{workbook:n,worksheet:r}=t,i=a.get(s),{keycode:o,eventType:c}=e.params,u=i.getEditLocation(),d={row:u.row,column:u.column,eventType:c,keycode:o,workbook:n,worksheet:r,isZenEditor:!0,isConfirm:e.id===l.id};this.fireEvent(this.Event.SheetEditEnded,d)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditChanging,()=>d.onCommandExecuted(e=>{if(e.id===o.id){let n=this.getActiveSheet();if(!n)return;let{workbook:o,worksheet:c}=n,l=a.get(s),u=a.get(r),d=e.params;if(!l.isVisible().visible)return;let{unitId:f}=d;if(f===t){let{row:e,column:n}=l.getEditLocation(),r={workbook:o,worksheet:c,row:e,column:n,value:i.create(u.getUnit(t).getSnapshot()),isZenEditor:!0};this.fireEvent(this.Event.SheetEditChanging,r)}}})))}_initialize(e){this._initSheetZenEditorEvent(e)}};a.extend(f);var p=class extends d{startZenEditingAsync(){return this._injector.get(n).executeCommand(u.id)}endZenEditingAsync(e=!0){let t=this._injector.get(n);return e?t.executeCommand(l.id):t.executeCommand(c.id)}};d.extend(p);export{};
|
package/lib/index.css
CHANGED
|
@@ -1 +1,82 @@
|
|
|
1
|
-
.univer-absolute
|
|
1
|
+
.univer-absolute {
|
|
2
|
+
position: absolute;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.univer-inset-0 {
|
|
6
|
+
top: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.univer-right-6 {
|
|
13
|
+
right: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.univer-top-2 {
|
|
17
|
+
top: .5rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.univer-z-10 {
|
|
21
|
+
z-index: 10;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.univer-flex {
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.univer-size-5 {
|
|
29
|
+
width: 1.25rem;
|
|
30
|
+
height: 1.25rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.univer-size-full {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.univer-w-7 {
|
|
39
|
+
width: 1.75rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.univer-cursor-pointer {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.univer-items-center {
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.univer-justify-center {
|
|
51
|
+
justify-content: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.univer-bg-white {
|
|
55
|
+
background-color: var(--univer-white);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.univer-text-green-500 {
|
|
59
|
+
color: var(--univer-green-500);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.univer-text-red-500 {
|
|
63
|
+
color: var(--univer-red-500);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.univer-transition-colors {
|
|
67
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
68
|
+
transition-duration: .15s;
|
|
69
|
+
transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hover\:univer-text-green-600:hover {
|
|
73
|
+
color: var(--univer-green-600);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.hover\:univer-text-red-600:hover {
|
|
77
|
+
color: var(--univer-red-600);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dark\:\!univer-bg-gray-800:where(.univer-dark, .univer-dark *) {
|
|
81
|
+
background-color: var(--univer-gray-800) !important;
|
|
82
|
+
}
|