@difizen/libro-lab 0.2.35 → 0.2.36
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/es/command/lab-command.d.ts.map +1 -1
- package/es/command/lab-command.js +31 -35
- package/es/command/lab-menu-contribution.d.ts.map +1 -1
- package/es/command/lab-menu-contribution.js +197 -39
- package/es/command/menu-bar-view.d.ts.map +1 -1
- package/es/command/menu-bar-view.js +6 -1
- package/es/common/icon.d.ts.map +1 -1
- package/es/common/icon.js +21 -36
- package/es/editor-viewer/empty-icon.d.ts +3 -0
- package/es/editor-viewer/empty-icon.d.ts.map +1 -0
- package/es/editor-viewer/empty-icon.js +495 -0
- package/es/editor-viewer/empty.svg +136 -0
- package/es/editor-viewer/libro-default-viewer.d.ts.map +1 -1
- package/es/editor-viewer/libro-default-viewer.js +4 -6
- package/es/kernel-and-terminal-panel/collapse/index.d.ts.map +1 -1
- package/es/kernel-and-terminal-panel/collapse/index.js +10 -9
- package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.d.ts.map +1 -1
- package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.js +6 -1
- package/es/kernel-and-terminal-panel/panel-command.d.ts.map +1 -1
- package/es/kernel-and-terminal-panel/panel-command.js +3 -2
- package/es/kernel-manager/index.d.ts.map +1 -1
- package/es/kernel-manager/index.js +7 -2
- package/es/lang-switcher/index.d.ts +7 -0
- package/es/lang-switcher/index.d.ts.map +1 -0
- package/es/lang-switcher/index.js +58 -0
- package/es/layout/footer/current-file-footer-view.d.ts.map +1 -1
- package/es/layout/footer/current-file-footer-view.js +2 -1
- package/es/layout/footer/status-footer-view.d.ts.map +1 -1
- package/es/layout/footer/status-footer-view.js +12 -11
- package/es/layout/layout-service.d.ts +2 -0
- package/es/layout/layout-service.d.ts.map +1 -1
- package/es/layout/layout-service.js +15 -4
- package/es/layout/layout.d.ts.map +1 -1
- package/es/layout/layout.js +3 -2
- package/es/module.d.ts.map +1 -1
- package/es/module.js +14 -1
- package/es/toc/libro-toc-panel-view.d.ts.map +1 -1
- package/es/toc/libro-toc-panel-view.js +7 -2
- package/es/welcome/entry-point-view.d.ts.map +1 -1
- package/es/welcome/entry-point-view.js +5 -4
- package/es/welcome/welcome-view.d.ts.map +1 -1
- package/es/welcome/welcome-view.js +8 -3
- package/package.json +8 -6
- package/src/command/lab-command.ts +31 -35
- package/src/command/{lab-menu-contribution.ts → lab-menu-contribution.tsx} +47 -39
- package/src/command/menu-bar-view.tsx +2 -1
- package/src/common/icon.tsx +0 -8
- package/src/editor-viewer/empty-icon.tsx +425 -0
- package/src/editor-viewer/empty.svg +136 -0
- package/src/editor-viewer/libro-default-viewer.tsx +7 -7
- package/src/kernel-and-terminal-panel/collapse/index.tsx +11 -10
- package/src/kernel-and-terminal-panel/kernel-and-terminal-panel-view.tsx +5 -1
- package/src/kernel-and-terminal-panel/panel-command.tsx +3 -2
- package/src/kernel-manager/index.tsx +3 -2
- package/src/lang-switcher/index.tsx +36 -0
- package/src/layout/footer/current-file-footer-view.tsx +2 -1
- package/src/layout/footer/status-footer-view.tsx +13 -13
- package/src/layout/layout-service.ts +7 -0
- package/src/layout/layout.tsx +3 -2
- package/src/module.tsx +17 -0
- package/src/toc/libro-toc-panel-view.tsx +3 -2
- package/src/welcome/entry-point-view.tsx +40 -37
- package/src/welcome/welcome-view.tsx +8 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
|
|
2
2
|
import { ViewContext } from '@difizen/mana-app';
|
|
3
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
3
4
|
import { Empty, message, Popconfirm } from 'antd';
|
|
4
5
|
import React, { useState } from 'react';
|
|
5
6
|
|
|
6
7
|
import type { SaveableTabView } from '../../index.js';
|
|
7
8
|
|
|
8
9
|
import { LibroCollapseContent } from './collapse-content.js';
|
|
9
|
-
|
|
10
10
|
import './index.less';
|
|
11
11
|
import { LibroKernelCollapseContent } from './kernel-collapse-content.js';
|
|
12
12
|
import { OpenedTabs } from './page-collapse-content.js';
|
|
@@ -45,7 +45,7 @@ const getCollapseContentView = (
|
|
|
45
45
|
return (
|
|
46
46
|
<Empty
|
|
47
47
|
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
|
48
|
-
description=
|
|
48
|
+
description={l10n.t('暂无内容')}
|
|
49
49
|
className="kernel-and-terminal-panel-empty"
|
|
50
50
|
/>
|
|
51
51
|
);
|
|
@@ -66,6 +66,7 @@ const getCollapseContentView = (
|
|
|
66
66
|
items={items as LibroPanelCollapseKernelItem[]}
|
|
67
67
|
/>
|
|
68
68
|
);
|
|
69
|
+
|
|
69
70
|
case LibroPanelCollapseItemType.TERMINAL:
|
|
70
71
|
case LibroPanelCollapseItemType.LSP:
|
|
71
72
|
return <LibroCollapseContent type={type} items={items!} />;
|
|
@@ -75,13 +76,13 @@ const getCollapseContentView = (
|
|
|
75
76
|
const getCollapseHeaderLabel = (type: LibroPanelCollapseItemType) => {
|
|
76
77
|
switch (type) {
|
|
77
78
|
case LibroPanelCollapseItemType.PAGE:
|
|
78
|
-
return '已开启的标签页';
|
|
79
|
+
return l10n.t('已开启的标签页');
|
|
79
80
|
case LibroPanelCollapseItemType.KERNEL:
|
|
80
|
-
return '运行的内核';
|
|
81
|
+
return l10n.t('运行的内核');
|
|
81
82
|
case LibroPanelCollapseItemType.TERMINAL:
|
|
82
|
-
return '运行的终端';
|
|
83
|
+
return l10n.t('运行的终端');
|
|
83
84
|
case LibroPanelCollapseItemType.LSP:
|
|
84
|
-
return '语言服务';
|
|
85
|
+
return l10n.t('语言服务');
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
|
|
@@ -105,9 +106,9 @@ export const LibroCollapse: React.FC<Props> = (props: Props) => {
|
|
|
105
106
|
</div>
|
|
106
107
|
<div className="libro-panel-collapse-header-closeAll">
|
|
107
108
|
<Popconfirm
|
|
108
|
-
title=
|
|
109
|
-
okText=
|
|
110
|
-
cancelText=
|
|
109
|
+
title={l10n.t('你确定要关闭全部吗?')}
|
|
110
|
+
okText={l10n.t('确定')}
|
|
111
|
+
cancelText={l10n.t('取消')}
|
|
111
112
|
onConfirm={() => {
|
|
112
113
|
if (props.shutdownAll) {
|
|
113
114
|
props.shutdownAll().catch((e) => {
|
|
@@ -117,7 +118,7 @@ export const LibroCollapse: React.FC<Props> = (props: Props) => {
|
|
|
117
118
|
}
|
|
118
119
|
}}
|
|
119
120
|
>
|
|
120
|
-
关闭全部
|
|
121
|
+
{l10n.t('关闭全部')}
|
|
121
122
|
</Popconfirm>
|
|
122
123
|
</div>
|
|
123
124
|
</div>
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ViewInstance,
|
|
13
13
|
ViewManager,
|
|
14
14
|
} from '@difizen/mana-app';
|
|
15
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
15
16
|
import { ConfigProvider, theme } from 'antd';
|
|
16
17
|
import { useEffect, useState } from 'react';
|
|
17
18
|
|
|
@@ -161,6 +162,7 @@ const PanelRender: React.FC = () => {
|
|
|
161
162
|
}
|
|
162
163
|
}}
|
|
163
164
|
/>
|
|
165
|
+
|
|
164
166
|
<LibroCollapse
|
|
165
167
|
type={LibroPanelCollapseItemType.KERNEL}
|
|
166
168
|
items={kernelItems}
|
|
@@ -169,11 +171,13 @@ const PanelRender: React.FC = () => {
|
|
|
169
171
|
await libroSessionManager.refreshRunning();
|
|
170
172
|
}}
|
|
171
173
|
/>
|
|
174
|
+
|
|
172
175
|
<LibroCollapse
|
|
173
176
|
type={LibroPanelCollapseItemType.TERMINAL}
|
|
174
177
|
items={terminalItems}
|
|
175
178
|
shutdownAll={async () => await terminalManager.shutdownAll()}
|
|
176
179
|
/>
|
|
180
|
+
|
|
177
181
|
<LibroCollapse
|
|
178
182
|
type={LibroPanelCollapseItemType.LSP}
|
|
179
183
|
items={lspItems}
|
|
@@ -211,7 +215,7 @@ export class KernelAndTerminalPanelView extends BaseView {
|
|
|
211
215
|
) {
|
|
212
216
|
super();
|
|
213
217
|
this.title.icon = <KernelAndTerminal />;
|
|
214
|
-
this.title.label = '运行的终端和内核'
|
|
218
|
+
this.title.label = () => <div>{l10n.t('运行的终端和内核')}</div>;
|
|
215
219
|
|
|
216
220
|
this.libroKernelManager = libroKernelManager;
|
|
217
221
|
this.libroSessionManager = libroSessionManager;
|
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
singleton,
|
|
8
8
|
ToolbarContribution,
|
|
9
9
|
} from '@difizen/mana-app';
|
|
10
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
10
11
|
|
|
11
12
|
import { KernelAndTerminalPanelView } from './kernel-and-terminal-panel-view.js';
|
|
12
13
|
|
|
13
14
|
export const PanelCommand = {
|
|
14
15
|
REFRESH: {
|
|
15
16
|
id: 'panel.command.refresh',
|
|
16
|
-
label: '刷新',
|
|
17
|
+
label: l10n.t('刷新'),
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -50,7 +51,7 @@ export class PanelCommandContribution
|
|
|
50
51
|
id: PanelCommand.REFRESH.id,
|
|
51
52
|
command: PanelCommand.REFRESH.id,
|
|
52
53
|
icon: <ReloadOutlined />,
|
|
53
|
-
tooltip: '刷新',
|
|
54
|
+
tooltip: l10n.t('刷新'),
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CodeFilled } from '@ant-design/icons';
|
|
2
2
|
import { singleton, view } from '@difizen/mana-app';
|
|
3
3
|
import { BaseView } from '@difizen/mana-app';
|
|
4
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
4
5
|
import { forwardRef } from 'react';
|
|
5
6
|
|
|
6
7
|
// import './index.less';
|
|
7
8
|
|
|
8
9
|
export const KernelManagerComponent = forwardRef(function KernelManagerComponent() {
|
|
9
|
-
return <span
|
|
10
|
+
return <span>{l10n.t('暂无文件')}</span>;
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
@singleton()
|
|
@@ -17,6 +18,6 @@ export class KernelManagerView extends BaseView {
|
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
20
|
this.title.icon = <CodeFilled />;
|
|
20
|
-
this.title.label = 'Kernel 管理'
|
|
21
|
+
this.title.label = () => <div>{l10n.t('Kernel 管理')}</div>;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { singleton, useInject, view } from '@difizen/mana-app';
|
|
2
|
+
import { BaseView } from '@difizen/mana-app';
|
|
3
|
+
import { l10n, L10nLang } from '@difizen/mana-l10n';
|
|
4
|
+
import { Select } from 'antd';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { LayoutService } from '../layout/layout-service.js';
|
|
8
|
+
|
|
9
|
+
const langList = [
|
|
10
|
+
{ value: L10nLang.zhCN, label: l10n.t('中文') },
|
|
11
|
+
{ value: L10nLang.enUS, label: 'En' },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export const LangSwitcherComponent = forwardRef(function GithubLinkComponent() {
|
|
15
|
+
const layoutService = useInject(LayoutService);
|
|
16
|
+
|
|
17
|
+
const handleChange = (value: string) => {
|
|
18
|
+
l10n.changeLang(value as L10nLang);
|
|
19
|
+
layoutService.refresh();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Select
|
|
24
|
+
defaultValue={l10n.getLang()}
|
|
25
|
+
style={{ width: 120 }}
|
|
26
|
+
options={langList}
|
|
27
|
+
onChange={handleChange}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
@singleton()
|
|
33
|
+
@view('lang-switcher')
|
|
34
|
+
export class LangSwitcherView extends BaseView {
|
|
35
|
+
override view = LangSwitcherComponent;
|
|
36
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
view,
|
|
7
7
|
ViewInstance,
|
|
8
8
|
} from '@difizen/mana-app';
|
|
9
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
|
|
11
12
|
import { LayoutService } from '../layout-service.js';
|
|
@@ -20,7 +21,7 @@ const CurrentFileFooterComponent = React.forwardRef(function CurrentFileFooterCo
|
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<div className="libro-lab-current-file-footer" ref={ref}>
|
|
23
|
-
<span>{
|
|
24
|
+
<span>{`${l10n.t('当前文件:')}${
|
|
24
25
|
currentFileFooterView.navigatableView?.title.label || ''
|
|
25
26
|
}`}</span>
|
|
26
27
|
</div>
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { BaseView, inject, singleton, useInject, view } from '@difizen/mana-app';
|
|
2
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import { Loadding, SuccIcon } from '../../common/icon.js';
|
|
4
4
|
|
|
5
|
+
import { Loadding, SuccIcon } from '../../common/icon.js';
|
|
5
6
|
import { LayoutService } from '../layout-service.js';
|
|
6
7
|
import { LibroLabLayoutSlots } from '../protocol.js';
|
|
7
8
|
import type { StatusItem, StatusType } from '../protocol.js';
|
|
8
9
|
import './index.less';
|
|
9
10
|
|
|
10
|
-
const Status: Record<StatusType, StatusItem> = {
|
|
11
|
-
loading: {
|
|
12
|
-
label: '启动中',
|
|
13
|
-
icon: <Loadding />,
|
|
14
|
-
},
|
|
15
|
-
success: {
|
|
16
|
-
label: '启动成功',
|
|
17
|
-
icon: <SuccIcon />,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
11
|
const StatusFooterComponent = React.forwardRef(function CurrentFileFooterComponent(
|
|
22
12
|
_props,
|
|
23
13
|
ref: React.ForwardedRef<HTMLDivElement>,
|
|
24
14
|
) {
|
|
25
15
|
const layoutService = useInject(LayoutService);
|
|
16
|
+
const Status: Record<StatusType, StatusItem> = {
|
|
17
|
+
loading: {
|
|
18
|
+
label: l10n.t('启动中'),
|
|
19
|
+
icon: <Loadding />,
|
|
20
|
+
},
|
|
21
|
+
success: {
|
|
22
|
+
label: l10n.t('启动成功'),
|
|
23
|
+
icon: <SuccIcon />,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
26
|
return (
|
|
27
27
|
<div className="libro-lab-status-footer" ref={ref}>
|
|
28
|
-
<span
|
|
28
|
+
<span>{l10n.t('服务状态:')}</span>
|
|
29
29
|
{Status[layoutService.serverSatus].icon}
|
|
30
30
|
{Status[layoutService.serverSatus].label}
|
|
31
31
|
</div>
|
|
@@ -35,6 +35,9 @@ export class LayoutService {
|
|
|
35
35
|
@prop()
|
|
36
36
|
serverSatus: StatusType = 'loading';
|
|
37
37
|
|
|
38
|
+
@prop()
|
|
39
|
+
refreshKey: string;
|
|
40
|
+
|
|
38
41
|
@prop()
|
|
39
42
|
visibilityMap: VisibilityMap = {
|
|
40
43
|
[LibroLabLayoutSlots.header]: true,
|
|
@@ -47,6 +50,10 @@ export class LayoutService {
|
|
|
47
50
|
[LibroLabLayoutSlots.alert]: true,
|
|
48
51
|
};
|
|
49
52
|
|
|
53
|
+
refresh() {
|
|
54
|
+
this.refreshKey = new Date().getTime().toString();
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
isAreaVisible(slot: LibroLabLayoutSlotsType): boolean {
|
|
51
58
|
return this.visibilityMap[slot];
|
|
52
59
|
}
|
package/src/layout/layout.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { inject, singleton, Slot, useInject, view } from '@difizen/mana-app';
|
|
2
2
|
import { BaseView } from '@difizen/mana-app';
|
|
3
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
3
4
|
import { BoxPanel } from '@difizen/mana-react';
|
|
4
5
|
import { Alert } from 'antd';
|
|
5
6
|
import { forwardRef } from 'react';
|
|
@@ -15,7 +16,7 @@ export const LibroLabLayoutComponent = forwardRef(function LibroLabLayoutCompone
|
|
|
15
16
|
const layoutService = useInject(LayoutService);
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
|
-
<div className="libro-lab-layout">
|
|
19
|
+
<div className="libro-lab-layout" key={layoutService.refreshKey}>
|
|
19
20
|
<BoxPanel direction="top-to-bottom">
|
|
20
21
|
{layoutService.isAreaVisible(LibroLabLayoutSlots.header) && (
|
|
21
22
|
<BoxPanel.Pane className="libro-lab-layout-header">
|
|
@@ -24,7 +25,7 @@ export const LibroLabLayoutComponent = forwardRef(function LibroLabLayoutCompone
|
|
|
24
25
|
)}
|
|
25
26
|
{layoutService.isAreaVisible(LibroLabLayoutSlots.alert) && (
|
|
26
27
|
<Alert
|
|
27
|
-
message=
|
|
28
|
+
message={l10n.t('服务启动中,请稍后,待服务启动完成后即可编辑文件。')}
|
|
28
29
|
type="info"
|
|
29
30
|
banner
|
|
30
31
|
closable
|
package/src/module.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
2
|
+
import { langBundles } from '@difizen/libro-l10n';
|
|
2
3
|
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
3
4
|
import { LibroSqlCellModule } from '@difizen/libro-sql-cell';
|
|
4
5
|
import { TerminalModule } from '@difizen/libro-terminal';
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
createViewPreference,
|
|
11
12
|
HeaderArea,
|
|
12
13
|
} from '@difizen/mana-app';
|
|
14
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
13
15
|
|
|
14
16
|
import { LibroLabHeaderMenuModule } from './command/module.js';
|
|
15
17
|
import { LabConfigAppContribution } from './config/config-contribution.js';
|
|
@@ -20,6 +22,7 @@ import { ImageViewerModule } from './image-viewer/index.js';
|
|
|
20
22
|
import { LibroKernelAndTerminalPanelModule } from './kernel-and-terminal-panel/module.js';
|
|
21
23
|
import { LibroLabApp } from './lab-app.js';
|
|
22
24
|
import { LabColorContribution } from './lab-color-registry.js';
|
|
25
|
+
import { LangSwitcherView } from './lang-switcher/index.js';
|
|
23
26
|
import { ContentBottomTabView } from './layout/content-bottom-tab-view.js';
|
|
24
27
|
import {
|
|
25
28
|
LibroLabLayoutModule,
|
|
@@ -34,6 +37,11 @@ import { EntryPointView } from './welcome/entry-point-view.js';
|
|
|
34
37
|
import { WelcomeView } from './welcome/index.js';
|
|
35
38
|
|
|
36
39
|
export const LibroLabModule = ManaModule.create()
|
|
40
|
+
.preload(() => {
|
|
41
|
+
l10n.loadLangBundles(langBundles);
|
|
42
|
+
|
|
43
|
+
return Promise.resolve();
|
|
44
|
+
})
|
|
37
45
|
.register(
|
|
38
46
|
LibroLabApp,
|
|
39
47
|
LibroLabLayoutView,
|
|
@@ -41,6 +49,7 @@ export const LibroLabModule = ManaModule.create()
|
|
|
41
49
|
LabConfigAppContribution,
|
|
42
50
|
LibroLabSideTabView,
|
|
43
51
|
LabColorContribution,
|
|
52
|
+
LangSwitcherView,
|
|
44
53
|
createViewPreference({
|
|
45
54
|
view: GithubLinkView,
|
|
46
55
|
slot: HeaderArea.right,
|
|
@@ -49,6 +58,14 @@ export const LibroLabModule = ManaModule.create()
|
|
|
49
58
|
},
|
|
50
59
|
autoCreate: true,
|
|
51
60
|
}),
|
|
61
|
+
createViewPreference({
|
|
62
|
+
view: LangSwitcherView,
|
|
63
|
+
slot: HeaderArea.right,
|
|
64
|
+
openOptions: {
|
|
65
|
+
order: 'lang',
|
|
66
|
+
},
|
|
67
|
+
autoCreate: true,
|
|
68
|
+
}),
|
|
52
69
|
// KernelManagerView,
|
|
53
70
|
// createViewPreference({
|
|
54
71
|
// view: KernelManagerView,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ViewManager,
|
|
13
13
|
ViewRender,
|
|
14
14
|
} from '@difizen/mana-app';
|
|
15
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
15
16
|
import { ConfigProvider, Empty, theme } from 'antd';
|
|
16
17
|
|
|
17
18
|
import { TocIcon } from '../common/index.js';
|
|
@@ -38,7 +39,7 @@ const TocViewRender: React.FC = () => {
|
|
|
38
39
|
) : (
|
|
39
40
|
<Empty
|
|
40
41
|
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
|
41
|
-
description=
|
|
42
|
+
description={l10n.t('该文件格式暂不支持大纲')}
|
|
42
43
|
className="libro-lab-toc-empty"
|
|
43
44
|
/>
|
|
44
45
|
)}
|
|
@@ -59,7 +60,7 @@ export class TocPanelView extends BaseView {
|
|
|
59
60
|
constructor() {
|
|
60
61
|
super();
|
|
61
62
|
this.title.icon = <TocIcon />;
|
|
62
|
-
this.title.label = '大纲'
|
|
63
|
+
this.title.label = () => <div>{l10n.t('大纲')}</div>;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
override onViewMount(): void {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
ViewManager,
|
|
17
17
|
} from '@difizen/mana-app';
|
|
18
18
|
import { BaseView } from '@difizen/mana-app';
|
|
19
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
19
20
|
import { Col, Row } from 'antd';
|
|
20
21
|
import { forwardRef, useEffect, useState } from 'react';
|
|
21
22
|
|
|
@@ -43,8 +44,10 @@ export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
|
43
44
|
|
|
44
45
|
return (
|
|
45
46
|
<div className="libro-lab-entry-point">
|
|
46
|
-
<div className="libro-lab-entry-point-title"
|
|
47
|
-
|
|
47
|
+
<div className="libro-lab-entry-point-title">
|
|
48
|
+
{l10n.t('请选择你要创建的文件类型:')}
|
|
49
|
+
</div>
|
|
50
|
+
<div className="libro-lab-entry-point-item-title">{l10n.t('文件')}</div>
|
|
48
51
|
<Row>
|
|
49
52
|
<Col
|
|
50
53
|
className="gutter-row"
|
|
@@ -110,11 +113,11 @@ export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
|
110
113
|
}}
|
|
111
114
|
>
|
|
112
115
|
<MoreIcon />
|
|
113
|
-
<span className="libro-lab-entry-point-item-text"
|
|
116
|
+
<span className="libro-lab-entry-point-item-text">{l10n.t('其他')}</span>
|
|
114
117
|
</div>
|
|
115
118
|
</Col>
|
|
116
119
|
</Row>
|
|
117
|
-
<div className="libro-lab-entry-point-item-title"
|
|
120
|
+
<div className="libro-lab-entry-point-item-title">{l10n.t('其他')}</div>
|
|
118
121
|
<Row>
|
|
119
122
|
<Col
|
|
120
123
|
className="gutter-row"
|
|
@@ -132,40 +135,40 @@ export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
|
132
135
|
</Col>
|
|
133
136
|
</Row>
|
|
134
137
|
{/* <div className="libro-lab-entry-point-item-title">最近使用</div>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
<Row>
|
|
139
|
+
<Col
|
|
140
|
+
className="gutter-row"
|
|
141
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
142
|
+
>
|
|
143
|
+
<div className="libro-lab-entry-point-item-recent">
|
|
144
|
+
<span className="libro-lab-entry-point-item-recent-icon">📋 </span>
|
|
145
|
+
<span className="libro-lab-entry-point-item-recent-text">
|
|
146
|
+
这是一个文件名
|
|
147
|
+
</span>
|
|
148
|
+
</div>
|
|
149
|
+
</Col>
|
|
150
|
+
</Row> */}
|
|
148
151
|
{/* <div className="libro-lab-entry-point-item-title">系统设置</div>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
<Row>
|
|
153
|
+
<Col
|
|
154
|
+
className="gutter-row"
|
|
155
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
156
|
+
>
|
|
157
|
+
<div className="libro-lab-entry-point-item-config">
|
|
158
|
+
<PreferenceIcon></PreferenceIcon>
|
|
159
|
+
<span className="libro-lab-entry-point-item-config-text">偏好设置</span>
|
|
160
|
+
</div>
|
|
161
|
+
</Col>
|
|
162
|
+
<Col
|
|
163
|
+
className="gutter-row"
|
|
164
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
165
|
+
>
|
|
166
|
+
<div className="libro-lab-entry-point-item-config">
|
|
167
|
+
<KeybindIcon></KeybindIcon>
|
|
168
|
+
<span className="libro-lab-entry-point-item-config-text">快捷键设置</span>
|
|
169
|
+
</div>
|
|
170
|
+
</Col>
|
|
171
|
+
</Row> */}
|
|
169
172
|
</div>
|
|
170
173
|
);
|
|
171
174
|
});
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ViewRender,
|
|
10
10
|
} from '@difizen/mana-app';
|
|
11
11
|
import { BaseView } from '@difizen/mana-app';
|
|
12
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
12
13
|
import { forwardRef } from 'react';
|
|
13
14
|
|
|
14
15
|
import { LayoutService } from '../layout/layout-service.js';
|
|
@@ -23,9 +24,13 @@ export const WelcomeComponent = forwardRef(function WelcomeComponent() {
|
|
|
23
24
|
const serverConnection = useInject(ServerConnection);
|
|
24
25
|
return (
|
|
25
26
|
<div className="libro-lab-welcome-page">
|
|
26
|
-
<div className="libro-lab-welcome-page-title"
|
|
27
|
+
<div className="libro-lab-welcome-page-title">
|
|
28
|
+
{l10n.t('欢迎使用 Libro Lab🎉🎉')}
|
|
29
|
+
</div>
|
|
27
30
|
<div className="libro-lab-welcome-page-server-info">
|
|
28
|
-
<div className="libro-lab-welcome-page-server-info-title"
|
|
31
|
+
<div className="libro-lab-welcome-page-server-info-title">
|
|
32
|
+
{l10n.t('服务连接信息')}
|
|
33
|
+
</div>
|
|
29
34
|
<div className="libro-lab-welcome-page-server-info-item">
|
|
30
35
|
BaseURL: {`${serverConnection.settings.baseUrl}`}
|
|
31
36
|
</div>
|
|
@@ -49,7 +54,7 @@ export class WelcomeView extends BaseView {
|
|
|
49
54
|
constructor(@inject(ViewManager) viewManager: ViewManager) {
|
|
50
55
|
super();
|
|
51
56
|
this.title.icon = '🙌 ';
|
|
52
|
-
this.title.label = '欢迎使用'
|
|
57
|
+
this.title.label = () => <div>{l10n.t('欢迎使用')}</div>;
|
|
53
58
|
this.title.closable = false;
|
|
54
59
|
this.viewManager = viewManager;
|
|
55
60
|
this.viewManager
|