@univerjs/docs-ui 0.24.0 → 0.25.0-insiders.20260608-e4336f7
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 +23 -152
- package/lib/cjs/index.js +4431 -1743
- 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 +25 -147
- package/lib/es/index.js +4397 -1716
- 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 +25 -147
- package/lib/index.css +240 -26
- package/lib/index.js +4397 -1716
- 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 +3 -2
- package/lib/types/commands/commands/doc-page-setup.command.d.ts +2 -0
- package/lib/types/commands/commands/inline-format.command.d.ts +2 -1
- package/lib/types/commands/commands/list.command.d.ts +1 -0
- package/lib/types/commands/util.d.ts +1 -2
- package/lib/types/components/float-toolbar/FloatToolbar.d.ts +1 -1
- package/lib/types/components/float-toolbar/FloatToolbar.stories.d.ts +1 -1
- package/lib/types/components/list-type-picker/Picker.d.ts +3 -3
- package/lib/types/components/paragraph-menu/index.d.ts +24 -2
- package/lib/types/components/side-menu/SideMenu.stories.d.ts +4 -4
- 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 +12 -26
- package/lib/types/facade/index.d.ts +2 -3
- package/lib/types/index.d.ts +7 -5
- package/lib/types/{types/delete-direction.d.ts → locale/ar-SA.d.ts} +3 -4
- 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-event-manager.service.d.ts +19 -1
- package/lib/types/services/doc-ime-state-change-interceptor.service.d.ts +23 -0
- 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/count-bar/CountBar.d.ts +1 -1
- package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
- package/lib/types/views/doc-footer/DocFooter.d.ts +1 -1
- package/lib/types/views/header-footer/panel/DocHeaderFooterOptions.d.ts +1 -1
- package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
- package/lib/types/views/page-settings/index.d.ts +5 -3
- package/lib/types/views/paragraph-setting/Setting.d.ts +1 -1
- package/lib/types/views/paragraph-setting/index.d.ts +1 -1
- package/lib/types/views/rich-text-editor/hooks/use-editor.d.ts +2 -1
- package/lib/types/views/rich-text-editor/index.d.ts +1 -1
- package/lib/types/views/side-menu/index.d.ts +1 -1
- package/lib/types/views/table/create/TableCreate.d.ts +1 -1
- package/lib/umd/facade.js +1 -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 +13 -13
- package/LICENSE +0 -176
- package/lib/types/commands/commands/core-editing.command.d.ts +0 -58
- package/lib/types/facade/f-univer.d.ts +0 -52
- package/lib/types/services/doc-state-change-manager.service.d.ts +0 -50
package/lib/es/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/es/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 };
|
package/lib/facade.js
CHANGED
|
@@ -1,134 +1,38 @@
|
|
|
1
|
-
import { DOC_RANGE_TYPE
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DOC_RANGE_TYPE } from "@univerjs/core";
|
|
2
|
+
import { DocSelectionRenderService } from "@univerjs/docs-ui";
|
|
3
|
+
import { FDocument } from "@univerjs/docs/facade";
|
|
4
4
|
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
5
5
|
|
|
6
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
7
|
-
function _typeof(o) {
|
|
8
|
-
"@babel/helpers - typeof";
|
|
9
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
10
|
-
return typeof o;
|
|
11
|
-
} : function(o) {
|
|
12
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
13
|
-
}, _typeof(o);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
18
|
-
function toPrimitive(t, r) {
|
|
19
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
20
|
-
var e = t[Symbol.toPrimitive];
|
|
21
|
-
if (void 0 !== e) {
|
|
22
|
-
var i = e.call(t, r || "default");
|
|
23
|
-
if ("object" != _typeof(i)) return i;
|
|
24
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
25
|
-
}
|
|
26
|
-
return ("string" === r ? String : Number)(t);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
31
|
-
function toPropertyKey(t) {
|
|
32
|
-
var i = toPrimitive(t, "string");
|
|
33
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
38
|
-
function _defineProperty(e, r, t) {
|
|
39
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
40
|
-
value: t,
|
|
41
|
-
enumerable: !0,
|
|
42
|
-
configurable: !0,
|
|
43
|
-
writable: !0
|
|
44
|
-
}) : e[r] = t, e;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
49
|
-
function __decorateParam(paramIndex, decorator) {
|
|
50
|
-
return function(target, key) {
|
|
51
|
-
decorator(target, key, paramIndex);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
57
|
-
function __decorate(decorators, target, key, desc) {
|
|
58
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
59
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
60
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
61
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
//#endregion
|
|
65
6
|
//#region src/facade/f-document.ts
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
getSnapshot() {
|
|
84
|
-
const resources = this._resourceManagerService.getResourcesByType(this.id, UniverInstanceType.UNIVER_DOC);
|
|
85
|
-
const snapshot = this._documentDataModel.getSnapshot();
|
|
86
|
-
snapshot.resources = resources;
|
|
87
|
-
return snapshot;
|
|
88
|
-
}
|
|
89
|
-
undo() {
|
|
90
|
-
this._univerInstanceService.focusUnit(this.id);
|
|
91
|
-
return this._commandService.executeCommand(UndoCommand.id);
|
|
92
|
-
}
|
|
93
|
-
redo() {
|
|
94
|
-
this._univerInstanceService.focusUnit(this.id);
|
|
95
|
-
return this._commandService.executeCommand(RedoCommand.id);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Adds the specified text to the end of this text region.
|
|
99
|
-
* @param text - The text to be added to the end of this text region.
|
|
100
|
-
*/
|
|
101
|
-
appendText(text) {
|
|
102
|
-
const unitId = this.id;
|
|
103
|
-
const { body } = this.getSnapshot();
|
|
104
|
-
if (!body) throw new Error("The document body is empty");
|
|
105
|
-
const lastPosition = body.dataStream.length - 2;
|
|
106
|
-
const activeRange = {
|
|
107
|
-
startOffset: lastPosition,
|
|
108
|
-
endOffset: lastPosition,
|
|
109
|
-
collapsed: true,
|
|
110
|
-
segmentId: ""
|
|
111
|
-
};
|
|
112
|
-
const { segmentId } = activeRange;
|
|
113
|
-
return this._commandService.executeCommand(InsertCommand.id, {
|
|
114
|
-
unitId,
|
|
115
|
-
body: { dataStream: text },
|
|
116
|
-
range: activeRange,
|
|
117
|
-
segmentId
|
|
118
|
-
});
|
|
119
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
var FDocumentUIMixin = class extends FDocument {
|
|
120
23
|
/**
|
|
121
24
|
* Sets the selection to a specified text range in the document.
|
|
122
25
|
* @param startOffset - The starting offset of the selection in the document.
|
|
123
26
|
* @param endOffset - The ending offset of the selection in the document.
|
|
124
27
|
* @example
|
|
125
28
|
* ```typescript
|
|
126
|
-
*
|
|
29
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
30
|
+
* fDocument.setSelection(10, 20);
|
|
127
31
|
* ```
|
|
128
32
|
*/
|
|
129
33
|
setSelection(startOffset, endOffset) {
|
|
130
|
-
var
|
|
131
|
-
const docSelectionRenderService = (
|
|
34
|
+
var _renderManagerService;
|
|
35
|
+
const docSelectionRenderService = (_renderManagerService = this._injector.get(IRenderManagerService).getRenderUnitById(this.getId())) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(DocSelectionRenderService);
|
|
132
36
|
docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.removeAllRanges();
|
|
133
37
|
docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.addDocRanges([{
|
|
134
38
|
startOffset,
|
|
@@ -137,33 +41,7 @@ let FDocument = class FDocument {
|
|
|
137
41
|
}], true);
|
|
138
42
|
}
|
|
139
43
|
};
|
|
140
|
-
FDocument
|
|
141
|
-
__decorateParam(1, Inject(Injector)),
|
|
142
|
-
__decorateParam(2, IUniverInstanceService),
|
|
143
|
-
__decorateParam(3, ICommandService),
|
|
144
|
-
__decorateParam(4, IResourceManagerService),
|
|
145
|
-
__decorateParam(5, IRenderManagerService)
|
|
146
|
-
], FDocument);
|
|
147
|
-
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/facade/f-univer.ts
|
|
150
|
-
var FUniverDocsUIMixin = class extends FUniver {
|
|
151
|
-
createUniverDoc(data) {
|
|
152
|
-
const document = this._univerInstanceService.createUnit(UniverInstanceType.UNIVER_DOC, data);
|
|
153
|
-
return this._injector.createInstance(FDocument, document);
|
|
154
|
-
}
|
|
155
|
-
getActiveDocument() {
|
|
156
|
-
const document = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
|
|
157
|
-
if (!document) return null;
|
|
158
|
-
return this._injector.createInstance(FDocument, document);
|
|
159
|
-
}
|
|
160
|
-
getUniverDoc(id) {
|
|
161
|
-
const document = this._univerInstanceService.getUniverDocInstance(id);
|
|
162
|
-
if (!document) return null;
|
|
163
|
-
return this._injector.createInstance(FDocument, document);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
FUniver.extend(FUniverDocsUIMixin);
|
|
44
|
+
FDocument.extend(FDocumentUIMixin);
|
|
167
45
|
|
|
168
46
|
//#endregion
|
|
169
|
-
export {
|
|
47
|
+
export { };
|