@univerjs/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 +8 -7
- package/lib/cjs/index.js +374 -173
- package/lib/cjs/locale/ar-SA.js +81 -0
- package/lib/cjs/locale/ca-ES.js +5 -3
- package/lib/cjs/locale/de-DE.js +81 -0
- package/lib/cjs/locale/en-US.js +5 -3
- package/lib/cjs/locale/es-ES.js +5 -3
- package/lib/cjs/locale/fa-IR.js +5 -3
- package/lib/cjs/locale/fr-FR.js +5 -3
- package/lib/cjs/locale/id-ID.js +81 -0
- package/lib/cjs/locale/it-IT.js +81 -0
- package/lib/cjs/locale/ja-JP.js +5 -3
- package/lib/cjs/locale/ko-KR.js +5 -3
- package/lib/cjs/locale/pl-PL.js +81 -0
- package/lib/cjs/locale/pt-BR.js +81 -0
- package/lib/cjs/locale/ru-RU.js +5 -3
- package/lib/cjs/locale/sk-SK.js +5 -3
- package/lib/cjs/locale/vi-VN.js +5 -3
- package/lib/cjs/locale/zh-CN.js +5 -3
- package/lib/cjs/locale/zh-HK.js +81 -0
- package/lib/cjs/locale/zh-TW.js +5 -3
- package/lib/es/facade.js +8 -7
- package/lib/es/index.js +375 -158
- package/lib/es/locale/ar-SA.js +80 -0
- package/lib/es/locale/ca-ES.js +5 -3
- package/lib/es/locale/de-DE.js +80 -0
- package/lib/es/locale/en-US.js +5 -3
- package/lib/es/locale/es-ES.js +5 -3
- package/lib/es/locale/fa-IR.js +5 -3
- package/lib/es/locale/fr-FR.js +5 -3
- package/lib/es/locale/id-ID.js +80 -0
- package/lib/es/locale/it-IT.js +80 -0
- package/lib/es/locale/ja-JP.js +5 -3
- package/lib/es/locale/ko-KR.js +5 -3
- package/lib/es/locale/pl-PL.js +80 -0
- package/lib/es/locale/pt-BR.js +80 -0
- package/lib/es/locale/ru-RU.js +5 -3
- package/lib/es/locale/sk-SK.js +5 -3
- package/lib/es/locale/vi-VN.js +5 -3
- package/lib/es/locale/zh-CN.js +5 -3
- package/lib/es/locale/zh-HK.js +80 -0
- package/lib/es/locale/zh-TW.js +5 -3
- package/lib/facade.js +8 -7
- package/lib/index.css +9 -4
- package/lib/index.js +375 -158
- package/lib/locale/ar-SA.js +80 -0
- package/lib/locale/ca-ES.js +5 -3
- package/lib/locale/de-DE.js +80 -0
- package/lib/locale/en-US.js +5 -3
- package/lib/locale/es-ES.js +5 -3
- package/lib/locale/fa-IR.js +5 -3
- package/lib/locale/fr-FR.js +5 -3
- package/lib/locale/id-ID.js +80 -0
- package/lib/locale/it-IT.js +80 -0
- package/lib/locale/ja-JP.js +5 -3
- package/lib/locale/ko-KR.js +5 -3
- package/lib/locale/pl-PL.js +80 -0
- package/lib/locale/pt-BR.js +80 -0
- package/lib/locale/ru-RU.js +5 -3
- package/lib/locale/sk-SK.js +5 -3
- package/lib/locale/vi-VN.js +5 -3
- package/lib/locale/zh-CN.js +5 -3
- package/lib/locale/zh-HK.js +80 -0
- package/lib/locale/zh-TW.js +5 -3
- package/lib/types/components/menu/desktop/DesignTinyMenuGroup.d.ts +1 -0
- package/lib/types/components/menu/desktop/TinyMenuGroup.d.ts +4 -0
- package/lib/types/facade/f-shortcut.d.ts +2 -1
- package/lib/types/facade/f-univer.d.ts +8 -4
- package/lib/types/index.d.ts +0 -1
- package/lib/types/{components/hooks/locale.d.ts → locale/ar-SA.d.ts} +3 -3
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +79 -75
- 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/services/before-close/before-close.service.d.ts +5 -1
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +2 -2
- package/lib/types/services/menu/menu-manager.service.d.ts +1 -0
- package/lib/types/services/ribbon/ribbon.service.d.ts +2 -0
- package/lib/types/services/shortcut/shortcut.service.d.ts +8 -0
- package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +5 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +51 -36
- 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 +8 -8
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/locale/vi-VN.ts
|
|
2
|
-
const locale = {
|
|
2
|
+
const locale = { ui: {
|
|
3
3
|
toolbar: { heading: {
|
|
4
4
|
normal: "Văn bản",
|
|
5
5
|
title: "Tiêu đề",
|
|
@@ -71,8 +71,10 @@ const locale = {
|
|
|
71
71
|
cancel: "Hủy"
|
|
72
72
|
},
|
|
73
73
|
"global-shortcut": "Phím tắt toàn cầu",
|
|
74
|
-
"zoom-slider": { resetTo: "Khôi phục đến" }
|
|
75
|
-
|
|
74
|
+
"zoom-slider": { resetTo: "Khôi phục đến" },
|
|
75
|
+
row: "Hàng",
|
|
76
|
+
column: "Cột"
|
|
77
|
+
} };
|
|
76
78
|
|
|
77
79
|
//#endregion
|
|
78
80
|
export { locale as default };
|
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 = { ui: {
|
|
3
3
|
toolbar: { heading: {
|
|
4
4
|
normal: "正文",
|
|
5
5
|
title: "标题",
|
|
@@ -71,8 +71,10 @@ const locale = {
|
|
|
71
71
|
cancel: "取消"
|
|
72
72
|
},
|
|
73
73
|
"global-shortcut": "全局快捷键",
|
|
74
|
-
"zoom-slider": { resetTo: "恢复至" }
|
|
75
|
-
|
|
74
|
+
"zoom-slider": { resetTo: "恢复至" },
|
|
75
|
+
row: "行",
|
|
76
|
+
column: "列"
|
|
77
|
+
} };
|
|
76
78
|
|
|
77
79
|
//#endregion
|
|
78
80
|
export { locale as default };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//#region src/locale/zh-HK.ts
|
|
2
|
+
const locale = { ui: {
|
|
3
|
+
toolbar: { heading: {
|
|
4
|
+
normal: "正文",
|
|
5
|
+
title: "標題",
|
|
6
|
+
subTitle: "副標題",
|
|
7
|
+
1: "標題 1",
|
|
8
|
+
2: "標題 2",
|
|
9
|
+
3: "標題 3",
|
|
10
|
+
4: "標題 4",
|
|
11
|
+
5: "標題 5",
|
|
12
|
+
6: "標題 6",
|
|
13
|
+
tooltip: "設定標題"
|
|
14
|
+
} },
|
|
15
|
+
ribbon: {
|
|
16
|
+
start: "開始",
|
|
17
|
+
startDesc: "初始化工作表並設定基本參數。",
|
|
18
|
+
insert: "插入",
|
|
19
|
+
insertDesc: "插入行、列、圖表和各種其他元素。",
|
|
20
|
+
formulas: "公式",
|
|
21
|
+
formulasDesc: "使用函數和公式進行數據計算。",
|
|
22
|
+
data: "資料",
|
|
23
|
+
dataDesc: "管理資料,包括匯入、排序和篩選。",
|
|
24
|
+
view: "視圖",
|
|
25
|
+
viewDesc: "切換視圖模式並調整顯示效果。",
|
|
26
|
+
others: "其他",
|
|
27
|
+
othersDesc: "其他功能和設定。",
|
|
28
|
+
more: "更多"
|
|
29
|
+
},
|
|
30
|
+
fontFamily: {
|
|
31
|
+
"not-supported": "系統中未找到該字型,使用預設字型。",
|
|
32
|
+
arial: "Arial",
|
|
33
|
+
"times-new-roman": "Times New Roman",
|
|
34
|
+
tahoma: "Tahoma",
|
|
35
|
+
verdana: "Verdana",
|
|
36
|
+
"microsoft-yahei": "微軟雅黑",
|
|
37
|
+
simsun: "宋體",
|
|
38
|
+
simhei: "黑體",
|
|
39
|
+
kaiti: "楷體",
|
|
40
|
+
fangsong: "仿宋",
|
|
41
|
+
nsimsun: "新宋體",
|
|
42
|
+
stxinwei: "華文新魏",
|
|
43
|
+
stxingkai: "華文行楷",
|
|
44
|
+
stliti: "華文隸書"
|
|
45
|
+
},
|
|
46
|
+
"shortcut-panel": { title: "快捷鍵面板" },
|
|
47
|
+
shortcut: {
|
|
48
|
+
undo: "撤銷",
|
|
49
|
+
redo: "重做",
|
|
50
|
+
cut: "剪切",
|
|
51
|
+
copy: "複製",
|
|
52
|
+
paste: "貼上",
|
|
53
|
+
"shortcut-panel": "開啟收起快捷鍵面板"
|
|
54
|
+
},
|
|
55
|
+
"common-edit": "常用編輯",
|
|
56
|
+
"toggle-shortcut-panel": "開啟收起快速鍵面板",
|
|
57
|
+
clipboard: { authentication: {
|
|
58
|
+
title: "無法存取剪貼簿",
|
|
59
|
+
content: "請允許 Univer 存取您的剪貼簿。 "
|
|
60
|
+
} },
|
|
61
|
+
textEditor: {
|
|
62
|
+
formulaError: "請輸入合法的公式,例如=SUM(A1)",
|
|
63
|
+
rangeError: "請輸入合法的範圍,例如 A1:B10"
|
|
64
|
+
},
|
|
65
|
+
rangeSelector: {
|
|
66
|
+
title: "選擇一個資料範圍",
|
|
67
|
+
addAnotherRange: "新增範圍",
|
|
68
|
+
buttonTooltip: "選擇資料範圍",
|
|
69
|
+
placeHolder: "框選範圍或輸入",
|
|
70
|
+
confirm: "確認",
|
|
71
|
+
cancel: "取消"
|
|
72
|
+
},
|
|
73
|
+
"global-shortcut": "全域快捷鍵",
|
|
74
|
+
"zoom-slider": { resetTo: "恢復至" },
|
|
75
|
+
row: "列",
|
|
76
|
+
column: "欄"
|
|
77
|
+
} };
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
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 = { ui: {
|
|
3
3
|
toolbar: { heading: {
|
|
4
4
|
normal: "正文",
|
|
5
5
|
title: "標題",
|
|
@@ -71,8 +71,10 @@ const locale = {
|
|
|
71
71
|
cancel: "取消"
|
|
72
72
|
},
|
|
73
73
|
"global-shortcut": "全域快捷鍵",
|
|
74
|
-
"zoom-slider": { resetTo: "恢復至" }
|
|
75
|
-
|
|
74
|
+
"zoom-slider": { resetTo: "恢復至" },
|
|
75
|
+
row: "列",
|
|
76
|
+
column: "欄"
|
|
77
|
+
} };
|
|
76
78
|
|
|
77
79
|
//#endregion
|
|
78
80
|
export { locale as default };
|
|
@@ -17,8 +17,12 @@ import type { IValueOption } from '../../../services/menu/menu';
|
|
|
17
17
|
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
18
18
|
interface IUIQuickMenuGroupProps {
|
|
19
19
|
item: IMenuSchema;
|
|
20
|
+
activeItemIds?: string[];
|
|
21
|
+
hiddenItemIds?: string[];
|
|
20
22
|
onOptionSelect?: (option: IValueOption) => void;
|
|
21
23
|
}
|
|
24
|
+
export declare function resolveMenuItemActiveState(itemId: string | undefined, observableActive: boolean, activeItemIds?: string[]): boolean;
|
|
25
|
+
export declare function getVisibleTinyMenuChildren(children: IMenuSchema[], hiddenItemKeys: string[]): IMenuSchema[];
|
|
22
26
|
export declare function UITinyMenuGroup(props: IUIQuickMenuGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
27
|
export declare function UIQuickTileMenuGroup(props: IUIQuickMenuGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
28
|
export {};
|
|
@@ -59,7 +59,8 @@ export declare class FShortcut extends FBase {
|
|
|
59
59
|
* ```typescript
|
|
60
60
|
* // Assum the current sheet is empty sheet.
|
|
61
61
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
62
|
-
* const fWorksheet = fWorkbook.
|
|
62
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
63
|
+
* if (!fWorksheet) return;
|
|
63
64
|
* const fRange = fWorksheet.getRange('A1');
|
|
64
65
|
*
|
|
65
66
|
* // Set A1 cell active and set value to 'Hello Univer'.
|
|
@@ -49,7 +49,8 @@ export interface IFUniverUIMixin {
|
|
|
49
49
|
*
|
|
50
50
|
* // Trigger a shortcut
|
|
51
51
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
52
|
-
* const fWorksheet = fWorkbook.
|
|
52
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
53
|
+
* if (!fWorksheet) return;
|
|
53
54
|
* const fRange = fWorksheet.getRange('A1');
|
|
54
55
|
* fRange.activate();
|
|
55
56
|
* fRange.setValue('Hello Univer');
|
|
@@ -76,7 +77,8 @@ export interface IFUniverUIMixin {
|
|
|
76
77
|
* // this example listens for the cell click event and executes the copy and paste code.
|
|
77
78
|
* univerAPI.addEvent(univerAPI.Event.CellClicked, async (params) => {
|
|
78
79
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
79
|
-
* const fWorksheet = fWorkbook.
|
|
80
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
81
|
+
* if (!fWorksheet) return;
|
|
80
82
|
*
|
|
81
83
|
* // Copy the range A1:B2 to the clipboard
|
|
82
84
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
@@ -106,7 +108,8 @@ export interface IFUniverUIMixin {
|
|
|
106
108
|
* // this example listens for the cell click event and executes the copy and paste code.
|
|
107
109
|
* univerAPI.addEvent(univerAPI.Event.CellClicked, async (params) => {
|
|
108
110
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
109
|
-
* const fWorksheet = fWorkbook.
|
|
111
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
112
|
+
* if (!fWorksheet) return;
|
|
110
113
|
*
|
|
111
114
|
* // Copy the range A1:B2 to the clipboard
|
|
112
115
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
@@ -349,7 +352,8 @@ export interface IFUniverUIMixin {
|
|
|
349
352
|
* @returns {IDisposable} The disposable object.
|
|
350
353
|
* @example
|
|
351
354
|
* ```ts
|
|
352
|
-
* const fWorksheet = univerAPI.getActiveWorkbook().
|
|
355
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
|
|
356
|
+
* if (!fWorksheet) return;
|
|
353
357
|
*
|
|
354
358
|
* // Register a range loading component
|
|
355
359
|
* const RangeLoading = () => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export { FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT, type IFontFamilyProp
|
|
|
26
26
|
export { FontSize } from './components/font-size/FontSize';
|
|
27
27
|
export { FONT_SIZE_COMPONENT, FONT_SIZE_LIST, HEADING_LIST } from './components/font-size/interface';
|
|
28
28
|
export * from './components/hooks';
|
|
29
|
-
export { t } from './components/hooks/locale';
|
|
30
29
|
export { type INotificationOptions } from './components/notification/Notification';
|
|
31
30
|
export { ProgressBar } from './components/progress-bar/ProgressBar';
|
|
32
31
|
export { type IUniverUIConfig, UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
export
|
|
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;
|
|
@@ -14,85 +14,89 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
declare const locale: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
ui: {
|
|
18
|
+
toolbar: {
|
|
19
|
+
heading: {
|
|
20
|
+
normal: string;
|
|
21
|
+
title: string;
|
|
22
|
+
subTitle: string;
|
|
23
|
+
1: string;
|
|
24
|
+
2: string;
|
|
25
|
+
3: string;
|
|
26
|
+
4: string;
|
|
27
|
+
5: string;
|
|
28
|
+
6: string;
|
|
29
|
+
tooltip: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
ribbon: {
|
|
33
|
+
start: string;
|
|
34
|
+
startDesc: string;
|
|
35
|
+
insert: string;
|
|
36
|
+
insertDesc: string;
|
|
37
|
+
formulas: string;
|
|
38
|
+
formulasDesc: string;
|
|
39
|
+
data: string;
|
|
40
|
+
dataDesc: string;
|
|
41
|
+
view: string;
|
|
42
|
+
viewDesc: string;
|
|
43
|
+
others: string;
|
|
44
|
+
othersDesc: string;
|
|
45
|
+
more: string;
|
|
46
|
+
};
|
|
47
|
+
fontFamily: {
|
|
48
|
+
'not-supported': string;
|
|
49
|
+
arial: string;
|
|
50
|
+
'times-new-roman': string;
|
|
51
|
+
tahoma: string;
|
|
52
|
+
verdana: string;
|
|
53
|
+
'microsoft-yahei': string;
|
|
54
|
+
simsun: string;
|
|
55
|
+
simhei: string;
|
|
56
|
+
kaiti: string;
|
|
57
|
+
fangsong: string;
|
|
58
|
+
nsimsun: string;
|
|
59
|
+
stxinwei: string;
|
|
60
|
+
stxingkai: string;
|
|
61
|
+
stliti: string;
|
|
62
|
+
};
|
|
63
|
+
'shortcut-panel': {
|
|
20
64
|
title: string;
|
|
21
|
-
subTitle: string;
|
|
22
|
-
1: string;
|
|
23
|
-
2: string;
|
|
24
|
-
3: string;
|
|
25
|
-
4: string;
|
|
26
|
-
5: string;
|
|
27
|
-
6: string;
|
|
28
|
-
tooltip: string;
|
|
29
65
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
verdana: string;
|
|
52
|
-
'microsoft-yahei': string;
|
|
53
|
-
simsun: string;
|
|
54
|
-
simhei: string;
|
|
55
|
-
kaiti: string;
|
|
56
|
-
fangsong: string;
|
|
57
|
-
nsimsun: string;
|
|
58
|
-
stxinwei: string;
|
|
59
|
-
stxingkai: string;
|
|
60
|
-
stliti: string;
|
|
61
|
-
};
|
|
62
|
-
'shortcut-panel': {
|
|
63
|
-
title: string;
|
|
64
|
-
};
|
|
65
|
-
shortcut: {
|
|
66
|
-
undo: string;
|
|
67
|
-
redo: string;
|
|
68
|
-
cut: string;
|
|
69
|
-
copy: string;
|
|
70
|
-
paste: string;
|
|
71
|
-
'shortcut-panel': string;
|
|
72
|
-
};
|
|
73
|
-
'common-edit': string;
|
|
74
|
-
'toggle-shortcut-panel': string;
|
|
75
|
-
clipboard: {
|
|
76
|
-
authentication: {
|
|
66
|
+
shortcut: {
|
|
67
|
+
undo: string;
|
|
68
|
+
redo: string;
|
|
69
|
+
cut: string;
|
|
70
|
+
copy: string;
|
|
71
|
+
paste: string;
|
|
72
|
+
'shortcut-panel': string;
|
|
73
|
+
};
|
|
74
|
+
'common-edit': string;
|
|
75
|
+
'toggle-shortcut-panel': string;
|
|
76
|
+
clipboard: {
|
|
77
|
+
authentication: {
|
|
78
|
+
title: string;
|
|
79
|
+
content: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
textEditor: {
|
|
83
|
+
formulaError: string;
|
|
84
|
+
rangeError: string;
|
|
85
|
+
};
|
|
86
|
+
rangeSelector: {
|
|
77
87
|
title: string;
|
|
78
|
-
|
|
88
|
+
addAnotherRange: string;
|
|
89
|
+
buttonTooltip: string;
|
|
90
|
+
placeHolder: string;
|
|
91
|
+
confirm: string;
|
|
92
|
+
cancel: string;
|
|
79
93
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
title: string;
|
|
87
|
-
addAnotherRange: string;
|
|
88
|
-
buttonTooltip: string;
|
|
89
|
-
placeHolder: string;
|
|
90
|
-
confirm: string;
|
|
91
|
-
cancel: string;
|
|
92
|
-
};
|
|
93
|
-
'global-shortcut': string;
|
|
94
|
-
'zoom-slider': {
|
|
95
|
-
resetTo: string;
|
|
94
|
+
'global-shortcut': string;
|
|
95
|
+
'zoom-slider': {
|
|
96
|
+
resetTo: string;
|
|
97
|
+
};
|
|
98
|
+
row: string;
|
|
99
|
+
column: string;
|
|
96
100
|
};
|
|
97
101
|
};
|
|
98
102
|
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type 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;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDisposable } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
17
18
|
import { INotificationService } from '../notification/notification.service';
|
|
18
19
|
export interface IBeforeCloseService {
|
|
19
20
|
/**
|
|
@@ -32,11 +33,14 @@ export interface IBeforeCloseService {
|
|
|
32
33
|
registerOnClose(callback: () => void): IDisposable;
|
|
33
34
|
}
|
|
34
35
|
export declare const IBeforeCloseService: import("@wendellhu/redi").IdentifierDecorator<IBeforeCloseService>;
|
|
35
|
-
export declare class DesktopBeforeCloseService implements IBeforeCloseService {
|
|
36
|
+
export declare class DesktopBeforeCloseService extends Disposable implements IBeforeCloseService {
|
|
36
37
|
private readonly _notificationService;
|
|
37
38
|
private _beforeUnloadCallbacks;
|
|
38
39
|
private _onCloseCallbacks;
|
|
40
|
+
private readonly _beforeUnloadHandler;
|
|
41
|
+
private readonly _unloadHandler;
|
|
39
42
|
constructor(_notificationService: INotificationService);
|
|
43
|
+
dispose(): void;
|
|
40
44
|
registerBeforeClose(callback: () => string | undefined): IDisposable;
|
|
41
45
|
registerOnClose(callback: () => void): IDisposable;
|
|
42
46
|
private _init;
|
|
@@ -37,7 +37,7 @@ export interface IClipboardInterfaceService {
|
|
|
37
37
|
* @param text
|
|
38
38
|
* @param html
|
|
39
39
|
*/
|
|
40
|
-
write(text: string, html: string): Promise<void>;
|
|
40
|
+
write(text: string, html: string, customData?: Record<string, string>): Promise<void>;
|
|
41
41
|
/**
|
|
42
42
|
* Read plain text from clipboard. Use read() to read both plain text and html.
|
|
43
43
|
* @returns plain text
|
|
@@ -59,7 +59,7 @@ export declare class BrowserClipboardService extends Disposable implements IClip
|
|
|
59
59
|
private readonly _notificationService?;
|
|
60
60
|
get supportClipboard(): boolean;
|
|
61
61
|
constructor(_localeService: LocaleService, _logService: ILogService, _notificationService?: INotificationService | undefined);
|
|
62
|
-
write(text: string, html: string): Promise<void>;
|
|
62
|
+
write(text: string, html: string, customData?: Record<string, string>): Promise<void>;
|
|
63
63
|
writeText(text: string): Promise<void>;
|
|
64
64
|
read(): Promise<ClipboardItem[]>;
|
|
65
65
|
readText(): Promise<string>;
|
|
@@ -46,6 +46,7 @@ export declare class DesktopRibbonService extends Disposable implements IRibbonS
|
|
|
46
46
|
private readonly _visibleContextualTabs;
|
|
47
47
|
private readonly _contextualTabs;
|
|
48
48
|
private _lastNonContextualActivatedTab;
|
|
49
|
+
private _hiddenSubscription;
|
|
49
50
|
constructor(_menuManagerService: IMenuManagerService, _univerInstanceService: IUniverInstanceService);
|
|
50
51
|
setActivatedTab(tab: string): void;
|
|
51
52
|
showContextualTab(tab: string, options?: {
|
|
@@ -60,4 +61,5 @@ export declare class DesktopRibbonService extends Disposable implements IRibbonS
|
|
|
60
61
|
private _filterContextualTabs;
|
|
61
62
|
private _setRibbon;
|
|
62
63
|
private _isContextualTab;
|
|
64
|
+
dispose(): void;
|
|
63
65
|
}
|
|
@@ -61,6 +61,14 @@ export interface IShortcutItem<P extends object = object> {
|
|
|
61
61
|
* @example { group: '10_global-shortcut' }
|
|
62
62
|
*/
|
|
63
63
|
group?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The locale key for the group title displayed in the shortcut panel.
|
|
66
|
+
* If not specified, the group name (without the sequence prefix) will be used as the locale key.
|
|
67
|
+
* It supports dot-notation paths for namespaced locale keys.
|
|
68
|
+
*
|
|
69
|
+
* @example { groupTitle: 'ui.global-shortcut' }
|
|
70
|
+
*/
|
|
71
|
+
groupTitle?: string;
|
|
64
72
|
/**
|
|
65
73
|
* Static parameters of this shortcut. Would be send to {@link ICommandService.executeCommand} as the second
|
|
66
74
|
* parameter when the corresponding command is executed.
|
|
@@ -14,12 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IValueOption } from '../../../services/menu/menu';
|
|
17
|
+
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
17
18
|
interface IContextMenuPanelProps {
|
|
18
19
|
menuType: string;
|
|
19
20
|
menuSessionVersion?: number;
|
|
20
21
|
className?: string;
|
|
22
|
+
activeItemIds?: string[];
|
|
23
|
+
hiddenItemIds?: string[];
|
|
21
24
|
onOptionSelect?: (option: IValueOption) => void;
|
|
22
25
|
}
|
|
26
|
+
export declare const CONTEXT_MENU_SUBMENU_CLOSE_DELAY = 500;
|
|
23
27
|
export declare const CONTEXT_MENU_SUBMENU_PORTAL_ATTR = "data-u-context-menu-submenu";
|
|
28
|
+
export declare function hasRenderableContextMenuSchema(menuSchema: IMenuSchema): boolean;
|
|
24
29
|
export declare function ContextMenuPanel(props: IContextMenuPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
30
|
export {};
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/core")):typeof define==`function`&&define.amd?define([`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/ui`,`@univerjs/core`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCoreFacade,e.UniverEngineRender,e.UniverUi,e.UniverCore))})(this,function(e,t,n,r){function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var u=class extends e.FBase{appendTo(e){let t=typeof e==`string`?e.split(`|`):e,n=t.length,r={},i=r,a=this.__getSchema();t.forEach((e,t)=>{t===n-1?i[e]=a:i[e]={},i=i[e]}),this._menuManagerService.mergeMenu(r)}};let d=class extends u{constructor(e,t,i,a){super(),this._item=e,this._injector=t,this._commandService=i,this._menuManagerService=a,s(this,`_commandToRegister`,new Map),s(this,`_buildingSchema`,void 0);let o=typeof e.action==`string`?e.action:(0,r.generateRandomId)(12);o!==e.action&&this._commandToRegister.set(o,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:o})},e.order!==void 0&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:r.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}};s(d,`RibbonStartGroup`,n.RibbonStartGroup),s(d,`RibbonPosition`,n.RibbonPosition),s(d,`MenuManagerPosition`,n.MenuManagerPosition),d=l([c(1,(0,r.Inject)(r.Injector)),c(2,r.ICommandService),c(3,n.IMenuManagerService)],d);let f=class extends u{constructor(e,t,r){super(),this._item=e,this._injector=t,this._menuManagerService=r,s(this,`_menuByGroups`,[]),s(this,`_submenus`,[]),s(this,`_buildingSchema`,void 0),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},e.order!==void 0&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){let e={};return this.addSeparator(),this._menuByGroups.forEach((t,n)=>{let r={};t.forEach(e=>{Object.assign(r,e.__getSchema())}),e[`${this._item.id}-group-${n}`]=r}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};f=l([c(1,(0,r.Inject)(r.Injector)),c(2,n.IMenuManagerService)],f);let p=class extends e.FBase{constructor(e,t,n,r){super(),this._injector=e,this._renderManagerService=t,this._univerInstanceService=n,this._shortcutService=r,s(this,`_forceDisableDisposable`,null)}enableShortcut(){var e;return(e=this._forceDisableDisposable)==null||e.dispose(),this._forceDisableDisposable=null,this}disableShortcut(){return this._forceDisableDisposable||(this._forceDisableDisposable=this._shortcutService.forceDisable()),this}triggerShortcut(e){let t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET);if(!t)return;let n=this._renderManagerService.getRenderById(t.getUnitId());if(n)return n.engine.getCanvasElement().dispatchEvent(e),this._shortcutService.dispatch(e)}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};p=l([c(0,(0,r.Inject)(r.Injector)),c(1,(0,r.Inject)(t.IRenderManagerService)),c(2,r.IUniverInstanceService),c(3,n.IShortcutService)],p);var m=class extends e.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(p)}copy(){return this._commandService.executeCommand(n.CopyCommand.id)}paste(){return this._commandService.executeCommand(n.PasteCommand.id)}createMenu(e){return this._injector.createInstance(d,e)}createSubmenu(e){return this._injector.createInstance(f,e)}openSiderbar(e){return this._injector.get(n.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){let t=this._injector.get(n.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}getComponentManager(){return this._injector.get(n.ComponentManager)}showMessage(e){return this._injector.get(n.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(n.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(n.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(n.IUIPartsService).registerComponent(e,()=>(0,n.connectInjector)(t,this._injector))}registerComponent(e,t,r){let i=this._injector.get(n.ComponentManager);return this.disposeWithMe(i.register(e,t,r))}setCurrent(e){if(!this._injector.get(t.IRenderManagerService).getRenderById(e))throw Error(`Unit not found`);this._univerInstanceService.setCurrentUnitForType(e)}addFonts(e){let t=this._injector.get(n.IFontService);e.forEach(e=>{t.addFont(e)})}};e.FUniver.extend(m);var h=class extends e.FHooks{onBeforeCopy(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{(t.id===n.PasteCommand.id||t.id===n.SheetPasteShortKeyCommandName)&&e()})}};e.FHooks.extend(h);var g=class extends e.FEnum{get BuiltInUIPart(){return n.BuiltInUIPart}get KeyCode(){return n.KeyCode}};e.FEnum.extend(g)});
|