@univerjs/docs-ui 0.24.0 → 0.25.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 +42 -11
- package/lib/cjs/index.js +4487 -1456
- package/lib/cjs/locale/ar-SA.js +124 -0
- package/lib/cjs/locale/ca-ES.js +11 -10
- package/lib/cjs/locale/de-DE.js +124 -0
- package/lib/cjs/locale/en-US.js +11 -10
- package/lib/cjs/locale/es-ES.js +11 -10
- package/lib/cjs/locale/fa-IR.js +11 -10
- package/lib/cjs/locale/fr-FR.js +11 -10
- package/lib/cjs/locale/id-ID.js +124 -0
- package/lib/cjs/locale/it-IT.js +124 -0
- package/lib/cjs/locale/ja-JP.js +11 -10
- package/lib/cjs/locale/ko-KR.js +11 -10
- package/lib/cjs/locale/pl-PL.js +124 -0
- package/lib/cjs/locale/pt-BR.js +124 -0
- package/lib/cjs/locale/ru-RU.js +13 -12
- package/lib/cjs/locale/sk-SK.js +11 -10
- package/lib/cjs/locale/vi-VN.js +22 -21
- package/lib/cjs/locale/zh-CN.js +11 -10
- package/lib/cjs/locale/zh-HK.js +124 -0
- package/lib/cjs/locale/zh-TW.js +22 -21
- package/lib/es/facade.js +42 -11
- package/lib/es/index.js +4476 -1462
- package/lib/es/locale/ar-SA.js +123 -0
- package/lib/es/locale/ca-ES.js +11 -10
- package/lib/es/locale/de-DE.js +123 -0
- package/lib/es/locale/en-US.js +11 -10
- package/lib/es/locale/es-ES.js +11 -10
- package/lib/es/locale/fa-IR.js +11 -10
- package/lib/es/locale/fr-FR.js +11 -10
- package/lib/es/locale/id-ID.js +123 -0
- package/lib/es/locale/it-IT.js +123 -0
- package/lib/es/locale/ja-JP.js +11 -10
- package/lib/es/locale/ko-KR.js +11 -10
- package/lib/es/locale/pl-PL.js +123 -0
- package/lib/es/locale/pt-BR.js +123 -0
- package/lib/es/locale/ru-RU.js +13 -12
- package/lib/es/locale/sk-SK.js +11 -10
- package/lib/es/locale/vi-VN.js +22 -21
- package/lib/es/locale/zh-CN.js +11 -10
- package/lib/es/locale/zh-HK.js +123 -0
- package/lib/es/locale/zh-TW.js +22 -21
- package/lib/facade.js +42 -11
- package/lib/index.css +240 -26
- package/lib/index.js +4476 -1462
- package/lib/locale/ar-SA.js +123 -0
- package/lib/locale/ca-ES.js +11 -10
- package/lib/locale/de-DE.js +123 -0
- package/lib/locale/en-US.js +11 -10
- package/lib/locale/es-ES.js +11 -10
- package/lib/locale/fa-IR.js +11 -10
- package/lib/locale/fr-FR.js +11 -10
- package/lib/locale/id-ID.js +123 -0
- package/lib/locale/it-IT.js +123 -0
- package/lib/locale/ja-JP.js +11 -10
- package/lib/locale/ko-KR.js +11 -10
- package/lib/locale/pl-PL.js +123 -0
- package/lib/locale/pt-BR.js +123 -0
- package/lib/locale/ru-RU.js +13 -12
- package/lib/locale/sk-SK.js +11 -10
- package/lib/locale/vi-VN.js +22 -21
- package/lib/locale/zh-CN.js +11 -10
- package/lib/locale/zh-HK.js +123 -0
- package/lib/locale/zh-TW.js +22 -21
- package/lib/types/commands/commands/doc-block-move.command.d.ts +40 -0
- package/lib/types/commands/commands/doc-delete.command.d.ts +2 -1
- package/lib/types/commands/commands/doc-page-setup.command.d.ts +2 -0
- package/lib/types/commands/commands/list.command.d.ts +1 -0
- package/lib/types/components/paragraph-menu/index.d.ts +23 -1
- package/lib/types/controllers/render-controllers/doc-contextmenu.render-controller.d.ts +8 -2
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +8 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -3
- package/lib/types/facade/f-document.d.ts +18 -0
- package/lib/types/index.d.ts +6 -1
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +117 -110
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/menu/menu.d.ts +9 -1
- package/lib/types/menu/paragraph-menu.d.ts +21 -2
- package/lib/types/menu/schema.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -1
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +12 -0
- package/lib/types/services/clipboard/html-to-udm/paste-plugins/type.d.ts +1 -0
- package/lib/types/services/clipboard/internal-fragment.d.ts +30 -0
- package/lib/types/services/doc-content-insert.service.d.ts +28 -0
- package/lib/types/services/doc-event-manager.service.d.ts +19 -1
- package/lib/types/services/doc-paragraph-menu.service.d.ts +51 -3
- package/lib/types/services/doc-popup-manager.service.d.ts +2 -2
- package/lib/types/services/docs-render.service.d.ts +2 -1
- package/lib/types/services/editor/editor.d.ts +1 -0
- package/lib/types/services/selection/convert-text-range.d.ts +1 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +4 -0
- package/lib/types/views/page-settings/index.d.ts +4 -2
- package/lib/types/views/rich-text-editor/hooks/use-editor.d.ts +2 -1
- package/lib/umd/facade.js +5 -1
- package/lib/umd/index.js +37 -10
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- 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/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- 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-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/locale/zh-CN.ts
|
|
2
|
-
const locale = {
|
|
2
|
+
const locale = { "docs-ui": {
|
|
3
3
|
toolbar: {
|
|
4
4
|
undo: "撤销",
|
|
5
5
|
redo: "重做",
|
|
@@ -11,14 +11,8 @@ const locale = {
|
|
|
11
11
|
subscript: "下标",
|
|
12
12
|
superscript: "上标",
|
|
13
13
|
underline: "下划线",
|
|
14
|
-
textColor: {
|
|
15
|
-
|
|
16
|
-
right: "颜色选择"
|
|
17
|
-
},
|
|
18
|
-
fillColor: {
|
|
19
|
-
main: "文本背景色",
|
|
20
|
-
right: "背景色选择"
|
|
21
|
-
},
|
|
14
|
+
textColor: { main: "文本颜色" },
|
|
15
|
+
fillColor: { main: "文本背景色" },
|
|
22
16
|
table: {
|
|
23
17
|
main: "表格",
|
|
24
18
|
insert: "插入表格",
|
|
@@ -90,6 +84,13 @@ const locale = {
|
|
|
90
84
|
},
|
|
91
85
|
"page-settings": {
|
|
92
86
|
"document-setting": "文档设置",
|
|
87
|
+
mode: "模式",
|
|
88
|
+
"modern-mode": "现代模式",
|
|
89
|
+
"classic-mode": "经典模式",
|
|
90
|
+
"modern-width": "内容宽度",
|
|
91
|
+
"modern-width-narrow": "窄",
|
|
92
|
+
"modern-width-medium": "适中",
|
|
93
|
+
"modern-width-wide": "宽",
|
|
93
94
|
"page-size": {
|
|
94
95
|
main: "纸张大小",
|
|
95
96
|
a4: "A4",
|
|
@@ -116,7 +117,7 @@ const locale = {
|
|
|
116
117
|
cancel: "取消",
|
|
117
118
|
confirm: "确认"
|
|
118
119
|
}
|
|
119
|
-
};
|
|
120
|
+
} };
|
|
120
121
|
|
|
121
122
|
//#endregion
|
|
122
123
|
export { locale as default };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//#region src/locale/zh-HK.ts
|
|
2
|
+
const locale = { "docs-ui": {
|
|
3
|
+
toolbar: {
|
|
4
|
+
undo: "撤銷",
|
|
5
|
+
redo: "重做",
|
|
6
|
+
font: "字型",
|
|
7
|
+
fontSize: "字號",
|
|
8
|
+
bold: "粗體",
|
|
9
|
+
italic: "斜體",
|
|
10
|
+
strikethrough: "刪除線",
|
|
11
|
+
subscript: "下標",
|
|
12
|
+
superscript: "上標",
|
|
13
|
+
underline: "底線",
|
|
14
|
+
textColor: { main: "文字顏色" },
|
|
15
|
+
fillColor: { main: "文字背景色" },
|
|
16
|
+
table: {
|
|
17
|
+
main: "Table",
|
|
18
|
+
insert: "Insert Table",
|
|
19
|
+
colCount: "Column count",
|
|
20
|
+
rowCount: "Row count"
|
|
21
|
+
},
|
|
22
|
+
resetColor: "重置顏色",
|
|
23
|
+
order: "有序列表",
|
|
24
|
+
unorder: "無序列表",
|
|
25
|
+
checklist: "任務列表",
|
|
26
|
+
documentFlavor: "现代模式",
|
|
27
|
+
alignLeft: "左對齊",
|
|
28
|
+
alignCenter: "居中對齊",
|
|
29
|
+
alignRight: "右對齊",
|
|
30
|
+
alignJustify: "兩端對齊",
|
|
31
|
+
horizontalLine: "Horizontal line",
|
|
32
|
+
headerFooter: "頁眉頁腳",
|
|
33
|
+
pageSetup: "頁面設置"
|
|
34
|
+
},
|
|
35
|
+
table: {
|
|
36
|
+
insert: "Insert",
|
|
37
|
+
insertRowAbove: "Insert row above",
|
|
38
|
+
insertRowBelow: "Insert row below",
|
|
39
|
+
insertColumnLeft: "Insert column left",
|
|
40
|
+
insertColumnRight: "Insert column right",
|
|
41
|
+
delete: "Table delete",
|
|
42
|
+
deleteRows: "Delete row",
|
|
43
|
+
deleteColumns: "Delete column",
|
|
44
|
+
deleteTable: "Delete table"
|
|
45
|
+
},
|
|
46
|
+
headerFooter: {
|
|
47
|
+
header: "頁眉",
|
|
48
|
+
footer: "頁腳",
|
|
49
|
+
panel: "頁眉頁腳設置",
|
|
50
|
+
firstPageCheckBox: "首頁不同",
|
|
51
|
+
oddEvenCheckBox: "奇偶頁不同",
|
|
52
|
+
headerTopMargin: "頁眉頂端距離(px)",
|
|
53
|
+
footerBottomMargin: "頁腳底端距離(px)",
|
|
54
|
+
closeHeaderFooter: "關閉頁眉頁腳",
|
|
55
|
+
disableText: "頁眉頁腳設置不可用"
|
|
56
|
+
},
|
|
57
|
+
doc: {
|
|
58
|
+
menu: { paragraphSetting: "Paragraph Setting" },
|
|
59
|
+
slider: { paragraphSetting: "Paragraph Setting" },
|
|
60
|
+
paragraphSetting: {
|
|
61
|
+
alignment: "Alignment",
|
|
62
|
+
indentation: "Indentation",
|
|
63
|
+
left: "Left",
|
|
64
|
+
right: "Right",
|
|
65
|
+
firstLine: "First Line",
|
|
66
|
+
hanging: "Hanging",
|
|
67
|
+
spacing: "Spacing",
|
|
68
|
+
before: "Before",
|
|
69
|
+
after: "After",
|
|
70
|
+
lineSpace: "Line Space",
|
|
71
|
+
multiSpace: "Multi Space",
|
|
72
|
+
fixedValue: "Fixed Value(px)"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
rightClick: {
|
|
76
|
+
copy: "複製",
|
|
77
|
+
cut: "剪切",
|
|
78
|
+
paste: "貼上",
|
|
79
|
+
delete: "刪除",
|
|
80
|
+
bulletList: "無序列表",
|
|
81
|
+
orderList: "有序列表",
|
|
82
|
+
checkList: "任務列表",
|
|
83
|
+
insertBellow: "在下方插入"
|
|
84
|
+
},
|
|
85
|
+
"page-settings": {
|
|
86
|
+
"document-setting": "文檔設置",
|
|
87
|
+
mode: "模式",
|
|
88
|
+
"modern-mode": "現代模式",
|
|
89
|
+
"classic-mode": "經典模式",
|
|
90
|
+
"modern-width": "內容寬度",
|
|
91
|
+
"modern-width-narrow": "窄",
|
|
92
|
+
"modern-width-medium": "適中",
|
|
93
|
+
"modern-width-wide": "寬",
|
|
94
|
+
"paper-size": "紙張大小",
|
|
95
|
+
"page-size": {
|
|
96
|
+
main: "紙張大小",
|
|
97
|
+
a4: "A4",
|
|
98
|
+
a3: "A3",
|
|
99
|
+
a5: "A5",
|
|
100
|
+
b4: "B4",
|
|
101
|
+
b5: "B5",
|
|
102
|
+
letter: "美式信紙",
|
|
103
|
+
legal: "美式法律用紙",
|
|
104
|
+
tabloid: "小報尺寸",
|
|
105
|
+
statement: "聲明用紙",
|
|
106
|
+
executive: "行政用紙",
|
|
107
|
+
folio: "對開紙"
|
|
108
|
+
},
|
|
109
|
+
orientation: "方向",
|
|
110
|
+
portrait: "縱向",
|
|
111
|
+
landscape: "橫向",
|
|
112
|
+
"custom-paper-size": "自定義紙張大小",
|
|
113
|
+
top: "上",
|
|
114
|
+
bottom: "下",
|
|
115
|
+
left: "左",
|
|
116
|
+
right: "右",
|
|
117
|
+
cancel: "取消",
|
|
118
|
+
confirm: "確認"
|
|
119
|
+
}
|
|
120
|
+
} };
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { locale as default };
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/locale/zh-TW.ts
|
|
2
|
-
const locale = {
|
|
2
|
+
const locale = { "docs-ui": {
|
|
3
3
|
toolbar: {
|
|
4
4
|
undo: "撤銷",
|
|
5
5
|
redo: "重做",
|
|
@@ -11,14 +11,8 @@ const locale = {
|
|
|
11
11
|
subscript: "下標",
|
|
12
12
|
superscript: "上標",
|
|
13
13
|
underline: "底線",
|
|
14
|
-
textColor: {
|
|
15
|
-
|
|
16
|
-
right: "顏色選擇"
|
|
17
|
-
},
|
|
18
|
-
fillColor: {
|
|
19
|
-
main: "文字背景色",
|
|
20
|
-
right: "背景色選擇"
|
|
21
|
-
},
|
|
14
|
+
textColor: { main: "文字顏色" },
|
|
15
|
+
fillColor: { main: "文字背景色" },
|
|
22
16
|
table: {
|
|
23
17
|
main: "Table",
|
|
24
18
|
insert: "Insert Table",
|
|
@@ -28,26 +22,26 @@ const locale = {
|
|
|
28
22
|
resetColor: "重置顏色",
|
|
29
23
|
order: "有序列表",
|
|
30
24
|
unorder: "無序列表",
|
|
25
|
+
checklist: "任務列表",
|
|
26
|
+
documentFlavor: "现代模式",
|
|
31
27
|
alignLeft: "左對齊",
|
|
32
28
|
alignCenter: "居中對齊",
|
|
33
29
|
alignRight: "右對齊",
|
|
34
30
|
alignJustify: "兩端對齊",
|
|
35
31
|
horizontalLine: "Horizontal line",
|
|
36
32
|
headerFooter: "頁眉頁腳",
|
|
37
|
-
checklist: "任務列表",
|
|
38
|
-
documentFlavor: "现代模式",
|
|
39
33
|
pageSetup: "頁面設置"
|
|
40
34
|
},
|
|
41
35
|
table: {
|
|
42
|
-
insert: "
|
|
43
|
-
insertRowAbove: "
|
|
44
|
-
insertRowBelow: "
|
|
45
|
-
insertColumnLeft: "
|
|
46
|
-
insertColumnRight: "
|
|
47
|
-
delete: "
|
|
48
|
-
deleteRows: "
|
|
49
|
-
deleteColumns: "
|
|
50
|
-
deleteTable: "
|
|
36
|
+
insert: "插入",
|
|
37
|
+
insertRowAbove: "在上方插入行",
|
|
38
|
+
insertRowBelow: "在下方插入行",
|
|
39
|
+
insertColumnLeft: "在左側插入列",
|
|
40
|
+
insertColumnRight: "在右側插入列",
|
|
41
|
+
delete: "刪除表格",
|
|
42
|
+
deleteRows: "刪除行",
|
|
43
|
+
deleteColumns: "刪除列",
|
|
44
|
+
deleteTable: "刪除表格"
|
|
51
45
|
},
|
|
52
46
|
headerFooter: {
|
|
53
47
|
header: "頁眉",
|
|
@@ -90,6 +84,13 @@ const locale = {
|
|
|
90
84
|
},
|
|
91
85
|
"page-settings": {
|
|
92
86
|
"document-setting": "文檔設置",
|
|
87
|
+
mode: "模式",
|
|
88
|
+
"modern-mode": "現代模式",
|
|
89
|
+
"classic-mode": "經典模式",
|
|
90
|
+
"modern-width": "內容寬度",
|
|
91
|
+
"modern-width-narrow": "窄",
|
|
92
|
+
"modern-width-medium": "適中",
|
|
93
|
+
"modern-width-wide": "寬",
|
|
93
94
|
"page-size": {
|
|
94
95
|
main: "紙張大小",
|
|
95
96
|
a4: "A4",
|
|
@@ -116,7 +117,7 @@ const locale = {
|
|
|
116
117
|
cancel: "取消",
|
|
117
118
|
confirm: "確認"
|
|
118
119
|
}
|
|
119
|
-
};
|
|
120
|
+
} };
|
|
120
121
|
|
|
121
122
|
//#endregion
|
|
122
123
|
export { locale as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { ICommand, IDocumentData } from '@univerjs/core';
|
|
17
|
+
export interface IMoveDocBlockCommandParams {
|
|
18
|
+
unitId?: string;
|
|
19
|
+
sourceRange: {
|
|
20
|
+
startOffset: number;
|
|
21
|
+
endOffset: number;
|
|
22
|
+
};
|
|
23
|
+
targetOffset: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IMoveDocBlockActionResult {
|
|
26
|
+
nextDocumentData: IDocumentData;
|
|
27
|
+
movedRange: {
|
|
28
|
+
startOffset: number;
|
|
29
|
+
endOffset: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare const MoveDocBlockCommand: ICommand<IMoveDocBlockCommandParams>;
|
|
33
|
+
export declare function buildMoveDocBlockActions(params: {
|
|
34
|
+
documentData: IDocumentData;
|
|
35
|
+
sourceRange: {
|
|
36
|
+
startOffset: number;
|
|
37
|
+
endOffset: number;
|
|
38
|
+
};
|
|
39
|
+
targetOffset: number;
|
|
40
|
+
}): IMoveDocBlockActionResult;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICommand, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ICommand, IDocumentBody, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
18
18
|
import { DeleteDirection } from '../../types/delete-direction';
|
|
19
19
|
export interface IDeleteCustomBlockParams {
|
|
@@ -30,6 +30,7 @@ interface IMergeTwoParagraphParams {
|
|
|
30
30
|
export declare const MergeTwoParagraphCommand: ICommand<IMergeTwoParagraphParams>;
|
|
31
31
|
export declare const RemoveHorizontalLineCommand: ICommand;
|
|
32
32
|
export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: readonly IRectRangeWithStyle[]): number;
|
|
33
|
+
export declare function isDeleteOffsetInsideBlockRange(body: IDocumentBody, offset: number): boolean;
|
|
33
34
|
export declare const DeleteLeftCommand: ICommand;
|
|
34
35
|
export declare const DeleteRightCommand: ICommand;
|
|
35
36
|
export declare const DeleteCurrentParagraphCommand: ICommand;
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand, ISize, PageOrientType } from '@univerjs/core';
|
|
17
|
+
import { DocumentFlavor } from '@univerjs/core';
|
|
17
18
|
export interface IDocPageSetupCommandParams {
|
|
18
19
|
pageSize: ISize;
|
|
19
20
|
pageOrient: PageOrientType;
|
|
21
|
+
documentFlavor?: DocumentFlavor;
|
|
20
22
|
marginTop: number;
|
|
21
23
|
marginBottom: number;
|
|
22
24
|
marginLeft: number;
|
|
@@ -48,6 +48,7 @@ export interface IToggleCheckListCommandParams {
|
|
|
48
48
|
export declare const ToggleCheckListCommand: ICommand<IToggleCheckListCommandParams>;
|
|
49
49
|
interface IOrderListCommandParams {
|
|
50
50
|
value?: PresetListType;
|
|
51
|
+
docRange?: ITextRangeWithStyle[];
|
|
51
52
|
}
|
|
52
53
|
export declare const OrderListCommand: ICommand<IOrderListCommandParams>;
|
|
53
54
|
interface IQuickListCommandParams {
|
|
@@ -13,7 +13,29 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
17
|
+
import type { IPopup, IValueOption } from '@univerjs/ui';
|
|
18
|
+
import type { IMutiPageParagraphBound } from '../../services/doc-event-manager.service';
|
|
19
|
+
import type { IDocBlockMenuTarget } from '../../services/doc-paragraph-menu.service';
|
|
20
|
+
import { NamedStyleType } from '@univerjs/core';
|
|
21
|
+
export declare function getParagraphMenuIconSizeClass(iconKey: string): string;
|
|
22
|
+
export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number): 'left' | 'right';
|
|
23
|
+
export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 260;
|
|
24
|
+
export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): {
|
|
25
|
+
schedule(): void;
|
|
26
|
+
cancel: () => void;
|
|
27
|
+
openNow(): void;
|
|
28
|
+
};
|
|
29
|
+
export declare function isEmptyParagraphMenuTarget(dataStream: string, paragraph?: IMutiPageParagraphBound | null | void): boolean;
|
|
30
|
+
export declare function getParagraphMenuTargetRange(paragraph?: IMutiPageParagraphBound | null | void): ITextRangeWithStyle | null;
|
|
31
|
+
export declare function getParagraphMenuActiveHeadingCommandId(namedStyleType?: NamedStyleType): string;
|
|
32
|
+
export declare function getParagraphMenuHiddenHeadingCommandIds(namedStyleType?: NamedStyleType): string[];
|
|
33
|
+
export declare function getParagraphMenuCommand(params: IValueOption, targetRange?: ITextRangeWithStyle | null): {
|
|
34
|
+
commandId?: string;
|
|
35
|
+
params?: object;
|
|
36
|
+
};
|
|
37
|
+
export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
|
|
17
38
|
export declare const ParagraphMenu: ({ popup }: {
|
|
18
39
|
popup: IPopup;
|
|
19
40
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function shouldUseInsertBelowRange(commandId: string, params: IValueOption): boolean;
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Workbook } from '@univerjs/core';
|
|
17
17
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
-
import { Disposable, ICommandService } from '@univerjs/core';
|
|
18
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
19
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
19
20
|
import { IContextMenuService } from '@univerjs/ui';
|
|
21
|
+
import { DocEventManagerService } from '../../services/doc-event-manager.service';
|
|
20
22
|
/**
|
|
21
23
|
* This controller subscribe to context menu events in sheet rendering views and invoke context menu at a correct
|
|
22
24
|
* position and with correct menu type.
|
|
@@ -25,7 +27,11 @@ export declare class DocContextMenuRenderController extends Disposable implement
|
|
|
25
27
|
private readonly _context;
|
|
26
28
|
private readonly _contextMenuService;
|
|
27
29
|
private readonly _commandService;
|
|
28
|
-
|
|
30
|
+
private readonly _docEventManagerService;
|
|
31
|
+
private readonly _docSelectionManagerService;
|
|
32
|
+
private readonly _univerInstanceService;
|
|
33
|
+
constructor(_context: IRenderContext<Workbook>, _contextMenuService: IContextMenuService, _commandService: ICommandService, _docEventManagerService: DocEventManagerService, _docSelectionManagerService: DocSelectionManagerService, _univerInstanceService: IUniverInstanceService);
|
|
29
34
|
private _initPointerDown;
|
|
30
35
|
private _initEditChange;
|
|
36
|
+
private _isSelectionInCodeBlock;
|
|
31
37
|
}
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
import type { DocumentDataModel } from '@univerjs/core';
|
|
17
17
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
18
|
import { ICommandService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
19
|
-
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
19
|
+
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
20
20
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
21
|
+
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
21
22
|
import { IEditorService } from '../../services/editor/editor-manager.service';
|
|
22
23
|
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
23
24
|
export declare class DocRenderController extends RxDisposable implements IRenderModule {
|
|
@@ -28,12 +29,17 @@ export declare class DocRenderController extends RxDisposable implements IRender
|
|
|
28
29
|
private readonly _editorService;
|
|
29
30
|
private readonly _renderManagerService;
|
|
30
31
|
private readonly _univerInstanceService;
|
|
31
|
-
|
|
32
|
+
private readonly _docPageLayoutService;
|
|
33
|
+
private readonly _textSelectionManagerService;
|
|
34
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _editorService: IEditorService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService: DocSelectionManagerService);
|
|
32
35
|
reRender(unitId: string): void;
|
|
33
36
|
private _addNewRender;
|
|
34
37
|
private _addComponent;
|
|
35
38
|
private _initRenderRefresh;
|
|
36
39
|
private _create;
|
|
37
40
|
private _initCommandListener;
|
|
41
|
+
private _refreshPagePositionAndSelection;
|
|
38
42
|
private _recalculateSizeBySkeleton;
|
|
43
|
+
private _syncCanvasBackground;
|
|
44
|
+
private _getEditorBackgroundConfig;
|
|
39
45
|
}
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { DocumentDataModel } from '@univerjs/core';
|
|
17
|
-
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
-
import { Disposable, ICommandService, IContextService, IUniverInstanceService } from '@univerjs/core';
|
|
17
|
+
import type { IRenderContext, IRenderModule, IWheelEvent } from '@univerjs/engine-render';
|
|
18
|
+
import { Disposable, DocumentFlavor, ICommandService, IContextService, IUniverInstanceService } from '@univerjs/core';
|
|
19
19
|
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
20
20
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
21
21
|
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
22
22
|
import { IEditorService } from '../../services/editor/editor-manager.service';
|
|
23
|
+
export declare function shouldHandleDocWheelZoom(event: Pick<IWheelEvent, 'ctrlKey' | 'metaKey'>, focusingDoc: boolean, _documentFlavor?: DocumentFlavor): boolean;
|
|
23
24
|
export declare class DocZoomRenderController extends Disposable implements IRenderModule {
|
|
24
25
|
private readonly _context;
|
|
25
26
|
private readonly _contextService;
|
|
@@ -35,7 +36,6 @@ export declare class DocZoomRenderController extends Disposable implements IRend
|
|
|
35
36
|
private _updateTimer;
|
|
36
37
|
constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _docPageLayoutService: DocPageLayoutService, _renderManagerService: IRenderManagerService);
|
|
37
38
|
dispose(): void;
|
|
38
|
-
private _initRenderRefresher;
|
|
39
39
|
private _initSkeletonListener;
|
|
40
40
|
private _initCommandExecutedListener;
|
|
41
41
|
updateViewZoom(zoomRatio: number, needRefreshSelection?: boolean): void;
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
import type { DocumentDataModel, IDocumentData } from '@univerjs/core';
|
|
17
17
|
import { ICommandService, Injector, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
18
18
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
19
|
+
export interface IDocumentInsertTextFacadeOptions {
|
|
20
|
+
startOffset?: number;
|
|
21
|
+
endOffset?: number;
|
|
22
|
+
segmentId?: string;
|
|
23
|
+
cursorOffset?: number;
|
|
24
|
+
}
|
|
19
25
|
/**
|
|
20
26
|
* @hideconstructor
|
|
21
27
|
*/
|
|
@@ -38,6 +44,18 @@ export declare class FDocument {
|
|
|
38
44
|
* @param text - The text to be added to the end of this text region.
|
|
39
45
|
*/
|
|
40
46
|
appendText(text: string): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Inserts text at the provided document range. Defaults to appending before the final section break.
|
|
49
|
+
* @param text - The text to insert.
|
|
50
|
+
* @param options - Optional target range, segment id, and cursor offset.
|
|
51
|
+
*/
|
|
52
|
+
insertText(text: string, options?: IDocumentInsertTextFacadeOptions): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Inserts one or more plain-text paragraphs at the provided document range.
|
|
55
|
+
* @param text - Paragraph text. Newlines are normalized to document paragraph separators.
|
|
56
|
+
* @param options - Optional target range, segment id, and cursor offset.
|
|
57
|
+
*/
|
|
58
|
+
insertParagraph(text?: string, options?: IDocumentInsertTextFacadeOptions): Promise<boolean>;
|
|
41
59
|
/**
|
|
42
60
|
* Sets the selection to a specified text range in the document.
|
|
43
61
|
* @param startOffset - The starting offset of the selection in the document.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export { CutContentCommand, type IInnerPasteCommandParams, InnerPasteCommand } f
|
|
|
28
28
|
export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner.command';
|
|
29
29
|
export { getCustomBlockIdsInSelections, getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
30
30
|
export { DeleteCommand, EditorInsertTextCommandId, type ICoverCommandParams, type IDeleteCommandParams, type IInsertCommandParams, InsertCommand, type IUpdateCommandParams, UpdateCommand, } from './commands/commands/core-editing.command';
|
|
31
|
+
export { buildMoveDocBlockActions, type IMoveDocBlockCommandParams, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
|
|
31
32
|
export { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, type IDeleteCustomBlockParams, MergeTwoParagraphCommand } from './commands/commands/doc-delete.command';
|
|
32
33
|
export { getCursorWhenDelete } from './commands/commands/doc-delete.command';
|
|
33
34
|
export { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';
|
|
@@ -60,14 +61,18 @@ export type { IUniverDocsUIConfig } from './config/config';
|
|
|
60
61
|
export { DocUIController } from './controllers/doc-ui.controller';
|
|
61
62
|
export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
|
|
62
63
|
export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
|
|
64
|
+
export { FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange } from './menu/menu';
|
|
65
|
+
export { DOC_CONTENT_INSERT_MENU_ID, EMPTY_PARAGRAPH_MENU_ID, getDocBlockRangeMenuId, INSERT_BELLOW_MENU_ID } from './menu/paragraph-menu';
|
|
63
66
|
export { menuSchema as DocsUIMenuSchema } from './menu/schema';
|
|
64
67
|
export { UniverDocsUIPlugin } from './plugin';
|
|
65
68
|
export * from './services';
|
|
66
69
|
export { IDocClipboardService } from './services/clipboard/clipboard.service';
|
|
67
70
|
export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
|
|
68
71
|
export { DocAutoFormatService } from './services/doc-auto-format.service';
|
|
69
|
-
export {
|
|
72
|
+
export { DocContentInsertService, type IDocContentInsertRange } from './services/doc-content-insert.service';
|
|
73
|
+
export { DocEventManagerService, type IBulletBound } from './services/doc-event-manager.service';
|
|
70
74
|
export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
|
|
75
|
+
export { DocParagraphMenuService } from './services/doc-paragraph-menu.service';
|
|
71
76
|
export { calcDocRangePositions, DocCanvasPopManagerService } from './services/doc-popup-manager.service';
|
|
72
77
|
export { DocPrintInterceptorService, type IDocPrintComponentContext, type IDocPrintContext } from './services/doc-print-interceptor.service';
|
|
73
78
|
export { DocStateChangeManagerService } from './services/doc-state-change-manager.service';
|
|
@@ -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;
|