@difizen/libro-lab 0.1.0 → 0.1.1
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/common/icon.d.ts +14 -0
- package/es/common/icon.d.ts.map +1 -0
- package/es/common/icon.js +368 -0
- package/es/common/index.d.ts +2 -0
- package/es/common/index.d.ts.map +1 -0
- package/es/common/index.js +1 -0
- package/es/common/index.less +8 -0
- package/es/github-link/index.d.ts +9 -0
- package/es/github-link/index.d.ts.map +1 -0
- package/es/index.less +9 -0
- package/es/kernel-manager/index.d.ts +8 -0
- package/es/kernel-manager/index.d.ts.map +1 -0
- package/es/lab-app.d.ts +4 -1
- package/es/lab-app.d.ts.map +1 -1
- package/es/lab-app.js +28 -5
- package/es/layout/brand/index.d.ts +8 -0
- package/es/layout/brand/index.d.ts.map +1 -0
- package/es/layout/brand/index.js +1 -1
- package/es/layout/container.d.ts +8 -0
- package/es/layout/container.d.ts.map +1 -0
- package/es/layout/footer/current-file-footer-view.d.ts +1 -2
- package/es/layout/footer/current-file-footer-view.d.ts.map +1 -1
- package/es/layout/footer/current-file-footer-view.js +3 -7
- package/es/layout/footer/footer-view.d.ts +11 -0
- package/es/layout/footer/footer-view.d.ts.map +1 -0
- package/es/layout/footer/index.less +10 -7
- package/es/layout/footer/status-footer-view.d.ts +10 -0
- package/es/layout/footer/status-footer-view.d.ts.map +1 -0
- package/es/layout/footer/status-footer-view.js +73 -0
- package/es/layout/layout-service.d.ts +15 -0
- package/es/layout/layout-service.d.ts.map +1 -0
- package/es/layout/layout-service.js +15 -10
- package/es/layout/layout.d.ts +12 -0
- package/es/layout/layout.d.ts.map +1 -0
- package/es/layout/layout.js +39 -6
- package/es/layout/main.d.ts.map +1 -1
- package/es/layout/main.js +0 -1
- package/es/layout/module.d.ts.map +1 -1
- package/es/layout/module.js +6 -2
- package/es/layout/protocol.d.ts +18 -0
- package/es/layout/protocol.d.ts.map +1 -0
- package/es/layout/protocol.js +2 -1
- package/es/layout/{editor-tab-view.d.ts → saveable-tab-view.d.ts} +2 -2
- package/es/layout/saveable-tab-view.d.ts.map +1 -0
- package/es/layout/{editor-tab-view.js → saveable-tab-view.js} +9 -10
- package/es/menu/menu-bar-view.d.ts +9 -0
- package/es/menu/menu-bar-view.d.ts.map +1 -0
- package/es/menu/menu-command.d.ts +139 -0
- package/es/menu/menu-command.d.ts.map +1 -0
- package/es/module.d.ts.map +1 -1
- package/es/module.js +5 -3
- package/es/toc/libro-toc-panel-view.d.ts.map +1 -1
- package/es/toc/libro-toc-panel-view.js +2 -1
- package/es/welcome/entry-point-view.d.ts +8 -0
- package/es/welcome/entry-point-view.d.ts.map +1 -0
- package/es/welcome/entry-point-view.js +200 -0
- package/es/welcome/index.d.ts +13 -0
- package/es/welcome/index.d.ts.map +1 -0
- package/es/welcome/index.js +32 -4
- package/es/welcome/index.less +102 -1
- package/package.json +4 -3
- package/src/common/icon.tsx +300 -0
- package/src/common/index.less +8 -0
- package/src/common/index.tsx +1 -0
- package/src/index.less +9 -0
- package/src/lab-app.ts +18 -1
- package/src/layout/brand/index.tsx +1 -1
- package/src/layout/footer/current-file-footer-view.tsx +3 -7
- package/src/layout/footer/index.less +10 -7
- package/src/layout/footer/status-footer-view.tsx +45 -0
- package/src/layout/layout-service.ts +7 -5
- package/src/layout/layout.tsx +25 -1
- package/src/layout/main.tsx +0 -1
- package/src/layout/module.ts +8 -2
- package/src/layout/protocol.tsx +8 -0
- package/src/layout/{editor-tab-view.tsx → saveable-tab-view.tsx} +4 -5
- package/src/module.tsx +6 -2
- package/src/toc/libro-toc-panel-view.tsx +2 -1
- package/src/welcome/entry-point-view.tsx +169 -0
- package/src/welcome/index.less +102 -1
- package/src/welcome/index.tsx +43 -5
- package/es/layout/brand/logo.js +0 -41
- package/es/layout/editor-tab-view.d.ts.map +0 -1
- package/es/toc/libro-toc-icons.d.ts +0 -7
- package/es/toc/libro-toc-icons.d.ts.map +0 -1
- package/es/toc/libro-toc-icons.js +0 -38
- package/es/welcome/welcome-icon.js +0 -66
- package/src/layout/brand/logo.tsx +0 -39
- package/src/toc/libro-toc-icons.tsx +0 -35
- package/src/welcome/welcome-icon.tsx +0 -64
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CloseOutlined } from '@ant-design/icons';
|
|
2
|
-
import { EditorView } from '@difizen/libro-jupyter';
|
|
3
2
|
import type { View } from '@difizen/mana-app';
|
|
4
3
|
import {
|
|
5
4
|
CardTabView,
|
|
@@ -7,14 +6,15 @@ import {
|
|
|
7
6
|
transient,
|
|
8
7
|
view,
|
|
9
8
|
ViewContext,
|
|
9
|
+
Saveable,
|
|
10
10
|
} from '@difizen/mana-app';
|
|
11
11
|
import { Dropdown } from '@difizen/mana-react';
|
|
12
12
|
import { Badge } from 'antd';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
14
|
|
|
15
15
|
@transient()
|
|
16
|
-
@view('
|
|
17
|
-
export class
|
|
16
|
+
@view('LibroLabSaveableTab')
|
|
17
|
+
export class SaveableTabView extends CardTabView {
|
|
18
18
|
protected override renderTab(item: View) {
|
|
19
19
|
return (
|
|
20
20
|
<ViewContext view={item}>
|
|
@@ -38,9 +38,8 @@ export class EditorTabView extends CardTabView {
|
|
|
38
38
|
</ViewContext>
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
protected renderTail(item: View) {
|
|
43
|
-
const isDirty =
|
|
42
|
+
const isDirty = Saveable.is(item) && Saveable.isDirty(item);
|
|
44
43
|
return (
|
|
45
44
|
<div className="libro-lab-editor-tab-tail">
|
|
46
45
|
{isDirty ? (
|
package/src/module.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
2
3
|
import {
|
|
3
4
|
ManaModule,
|
|
4
5
|
createSlotPreference,
|
|
@@ -11,15 +12,16 @@ import {
|
|
|
11
12
|
import { GithubLinkView } from './github-link/index.js';
|
|
12
13
|
import { KernelManagerView } from './kernel-manager/index.js';
|
|
13
14
|
import { LibroLabApp } from './lab-app.js';
|
|
14
|
-
import { EditorTabView } from './layout/editor-tab-view.js';
|
|
15
15
|
import {
|
|
16
16
|
LibroLabLayoutModule,
|
|
17
17
|
LibroLabLayoutSlots,
|
|
18
18
|
LibroLabLayoutView,
|
|
19
19
|
} from './layout/index.js';
|
|
20
|
+
import { SaveableTabView } from './layout/saveable-tab-view.js';
|
|
20
21
|
import './index.less';
|
|
21
22
|
import { LibroLabHeaderMenuModule } from './menu/module.js';
|
|
22
23
|
import { LibroLabTocModule } from './toc/module.js';
|
|
24
|
+
import { EntryPointView } from './welcome/entry-point-view.js';
|
|
23
25
|
import { WelcomeView } from './welcome/index.js';
|
|
24
26
|
|
|
25
27
|
export const LibroLabModule = ManaModule.create()
|
|
@@ -50,7 +52,7 @@ export const LibroLabModule = ManaModule.create()
|
|
|
50
52
|
slot: RootSlotId,
|
|
51
53
|
}),
|
|
52
54
|
createSlotPreference({
|
|
53
|
-
view:
|
|
55
|
+
view: SaveableTabView,
|
|
54
56
|
slot: LibroLabLayoutSlots.content,
|
|
55
57
|
}),
|
|
56
58
|
createSlotPreference({
|
|
@@ -79,10 +81,12 @@ export const LibroLabModule = ManaModule.create()
|
|
|
79
81
|
order: 'welcome',
|
|
80
82
|
},
|
|
81
83
|
}),
|
|
84
|
+
EntryPointView,
|
|
82
85
|
)
|
|
83
86
|
.dependOn(
|
|
84
87
|
LibroJupyterModule,
|
|
85
88
|
LibroLabLayoutModule,
|
|
86
89
|
LibroLabHeaderMenuModule,
|
|
87
90
|
LibroLabTocModule,
|
|
91
|
+
LibroPromptCellModule,
|
|
88
92
|
);
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
} from '@difizen/mana-app';
|
|
14
14
|
import { Empty } from 'antd';
|
|
15
15
|
|
|
16
|
+
import { TocIcon } from '../common/index.js';
|
|
16
17
|
import { LayoutService } from '../layout/layout-service.js';
|
|
17
18
|
import { LibroLabLayoutSlots } from '../layout/protocol.js';
|
|
18
19
|
|
|
19
|
-
import { TocIcon } from './libro-toc-icons.js';
|
|
20
20
|
import './index.less';
|
|
21
21
|
|
|
22
22
|
const TocViewRender: React.FC = () => {
|
|
@@ -69,6 +69,7 @@ export class TocPanelView extends BaseView {
|
|
|
69
69
|
|
|
70
70
|
handleEditTabChange = () => {
|
|
71
71
|
if (!this.libroNavigatableView) {
|
|
72
|
+
this.libroTocView = undefined;
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
this.viewManager
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NotebookIcon,
|
|
3
|
+
PythonIcon,
|
|
4
|
+
JSONIcon,
|
|
5
|
+
MoreIcon,
|
|
6
|
+
FileCreateModal,
|
|
7
|
+
FileView,
|
|
8
|
+
} from '@difizen/libro-jupyter';
|
|
9
|
+
import {
|
|
10
|
+
ModalService,
|
|
11
|
+
singleton,
|
|
12
|
+
useInject,
|
|
13
|
+
view,
|
|
14
|
+
ViewManager,
|
|
15
|
+
} from '@difizen/mana-app';
|
|
16
|
+
import { BaseView } from '@difizen/mana-app';
|
|
17
|
+
import { Col, Row } from 'antd';
|
|
18
|
+
import { forwardRef, useEffect, useState } from 'react';
|
|
19
|
+
|
|
20
|
+
import { KeybindIcon, PreferenceIcon, TerminalIcon } from '../common/icon.js';
|
|
21
|
+
|
|
22
|
+
import './index.less';
|
|
23
|
+
|
|
24
|
+
export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
25
|
+
const modalService = useInject(ModalService);
|
|
26
|
+
const viewManager = useInject(ViewManager);
|
|
27
|
+
const [fileView, setFileView] = useState<FileView>();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
viewManager
|
|
31
|
+
.getOrCreateView(FileView)
|
|
32
|
+
.then((curfileView) => {
|
|
33
|
+
setFileView(curfileView);
|
|
34
|
+
return;
|
|
35
|
+
})
|
|
36
|
+
.catch(() => {
|
|
37
|
+
//
|
|
38
|
+
});
|
|
39
|
+
}, [viewManager]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="libro-lab-entry-point">
|
|
43
|
+
<div className="libro-lab-entry-point-title">请选择你要创建的文件类型:</div>
|
|
44
|
+
<div className="libro-lab-entry-point-item-title">文件</div>
|
|
45
|
+
<Row>
|
|
46
|
+
<Col
|
|
47
|
+
className="gutter-row"
|
|
48
|
+
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
49
|
+
>
|
|
50
|
+
<div
|
|
51
|
+
className="libro-lab-entry-point-item"
|
|
52
|
+
onClick={() => {
|
|
53
|
+
modalService.openModal(FileCreateModal, {
|
|
54
|
+
path: fileView?.model.location?.path.toString() || '/',
|
|
55
|
+
fileType: '.ipynb',
|
|
56
|
+
});
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<NotebookIcon />
|
|
60
|
+
<span className="libro-lab-entry-point-item-text">Notebook</span>
|
|
61
|
+
</div>
|
|
62
|
+
</Col>
|
|
63
|
+
<Col
|
|
64
|
+
className="gutter-row"
|
|
65
|
+
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
66
|
+
>
|
|
67
|
+
<div
|
|
68
|
+
className="libro-lab-entry-point-item"
|
|
69
|
+
onClick={() => {
|
|
70
|
+
modalService.openModal(FileCreateModal, {
|
|
71
|
+
path: fileView?.model.location?.path.toString() || '/',
|
|
72
|
+
fileType: '.py',
|
|
73
|
+
});
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<PythonIcon />
|
|
77
|
+
<span className="libro-lab-entry-point-item-text">Python</span>
|
|
78
|
+
</div>
|
|
79
|
+
</Col>
|
|
80
|
+
<Col
|
|
81
|
+
className="gutter-row"
|
|
82
|
+
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
className="libro-lab-entry-point-item"
|
|
86
|
+
onClick={() => {
|
|
87
|
+
modalService.openModal(FileCreateModal, {
|
|
88
|
+
path: fileView?.model.location?.path.toString() || '/',
|
|
89
|
+
fileType: '.json',
|
|
90
|
+
});
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<JSONIcon />
|
|
94
|
+
<span className="libro-lab-entry-point-item-text">JSON</span>
|
|
95
|
+
</div>
|
|
96
|
+
</Col>
|
|
97
|
+
<Col
|
|
98
|
+
className="gutter-row"
|
|
99
|
+
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
100
|
+
>
|
|
101
|
+
<div
|
|
102
|
+
className="libro-lab-entry-point-item"
|
|
103
|
+
onClick={() => {
|
|
104
|
+
modalService.openModal(FileCreateModal, {
|
|
105
|
+
path: fileView?.model.location?.path.toString() || '/',
|
|
106
|
+
});
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
<MoreIcon />
|
|
110
|
+
<span className="libro-lab-entry-point-item-text">其他</span>
|
|
111
|
+
</div>
|
|
112
|
+
</Col>
|
|
113
|
+
</Row>
|
|
114
|
+
<div className="libro-lab-entry-point-item-title">其他</div>
|
|
115
|
+
<Row>
|
|
116
|
+
<Col
|
|
117
|
+
className="gutter-row"
|
|
118
|
+
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
119
|
+
>
|
|
120
|
+
<div className="libro-lab-entry-point-item">
|
|
121
|
+
<TerminalIcon />
|
|
122
|
+
<span className="libro-lab-entry-point-item-text">Terminal</span>
|
|
123
|
+
</div>
|
|
124
|
+
</Col>
|
|
125
|
+
</Row>
|
|
126
|
+
{/* <div className="libro-lab-entry-point-item-title">最近使用</div>
|
|
127
|
+
<Row>
|
|
128
|
+
<Col
|
|
129
|
+
className="gutter-row"
|
|
130
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
131
|
+
>
|
|
132
|
+
<div className="libro-lab-entry-point-item-recent">
|
|
133
|
+
<span className="libro-lab-entry-point-item-recent-icon">📋 </span>
|
|
134
|
+
<span className="libro-lab-entry-point-item-recent-text">
|
|
135
|
+
这是一个文件名
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
</Col>
|
|
139
|
+
</Row> */}
|
|
140
|
+
<div className="libro-lab-entry-point-item-title">系统设置</div>
|
|
141
|
+
<Row>
|
|
142
|
+
<Col
|
|
143
|
+
className="gutter-row"
|
|
144
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
145
|
+
>
|
|
146
|
+
<div className="libro-lab-entry-point-item-config">
|
|
147
|
+
<PreferenceIcon></PreferenceIcon>
|
|
148
|
+
<span className="libro-lab-entry-point-item-config-text">偏好设置</span>
|
|
149
|
+
</div>
|
|
150
|
+
</Col>
|
|
151
|
+
<Col
|
|
152
|
+
className="gutter-row"
|
|
153
|
+
style={{ paddingLeft: 'unset', paddingRight: '24px' }}
|
|
154
|
+
>
|
|
155
|
+
<div className="libro-lab-entry-point-item-config">
|
|
156
|
+
<KeybindIcon></KeybindIcon>
|
|
157
|
+
<span className="libro-lab-entry-point-item-config-text">快捷键设置</span>
|
|
158
|
+
</div>
|
|
159
|
+
</Col>
|
|
160
|
+
</Row>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
@singleton()
|
|
166
|
+
@view('entry-point-view')
|
|
167
|
+
export class EntryPointView extends BaseView {
|
|
168
|
+
override view = EntryPointComponent;
|
|
169
|
+
}
|
package/src/welcome/index.less
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
.libro-lab-welcome-page {
|
|
2
2
|
padding: 32px 54px;
|
|
3
|
-
height: 100
|
|
3
|
+
height: calc(100% - 64px);
|
|
4
4
|
background: white;
|
|
5
|
+
overflow: auto;
|
|
5
6
|
|
|
6
7
|
.libro-lab-welcome-page-title {
|
|
7
8
|
/* stylelint-disable-next-line declaration-property-value-disallowed-list */
|
|
@@ -19,3 +20,103 @@
|
|
|
19
20
|
color: rgba(0, 10, 26, 78%);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
.libro-lab-entry-point-item {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
margin-bottom: 24px;
|
|
30
|
+
height: 100px;
|
|
31
|
+
width: 100px;
|
|
32
|
+
background-color: rgba(0, 10, 26, 2%);
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: rgba(0, 10, 26, 4%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.libro-lab-entry-point-item-text {
|
|
42
|
+
margin-top: 6px;
|
|
43
|
+
line-height: 20px;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
color: rgba(0, 10, 26, 68%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.libro-lab-entry-point-title {
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
font-size: 18px;
|
|
51
|
+
margin-bottom: 12px;
|
|
52
|
+
color: rgba(0, 10, 26, 89%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.libro-lab-entry-point-item-title {
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
color: rgba(0, 10, 26, 89%);
|
|
59
|
+
margin-bottom: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.libro-lab-entry-point-item-recent {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
padding: 0 12px;
|
|
66
|
+
height: 52px;
|
|
67
|
+
width: 180px;
|
|
68
|
+
border: 1px solid rgba(0, 10, 26, 7%);
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
margin-bottom: 24px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
border-color: transparent;
|
|
75
|
+
background-color: rgba(0, 10, 26, 4%);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.libro-lab-entry-point-item-recent-icon {
|
|
80
|
+
font-size: 24px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.libro-lab-entry-point-item-recent-text {
|
|
84
|
+
margin-left: 8px;
|
|
85
|
+
color: rgba(0, 10, 26, 89%);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.libro-lab-entry-point-item-config {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
padding: 0 14px;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
height: 32px;
|
|
94
|
+
width: 100px;
|
|
95
|
+
border: 1px solid rgba(0, 0, 0, 15%);
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.libro-lab-entry-point-item-config-text {
|
|
100
|
+
margin-left: 4px;
|
|
101
|
+
color: rgba(0, 0, 0, 88%);
|
|
102
|
+
line-height: 22px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.libro-lab-welcome-page-server-info {
|
|
106
|
+
height: 80px;
|
|
107
|
+
width: 400px;
|
|
108
|
+
background-color: rgba(0, 10, 26, 2%);
|
|
109
|
+
border-radius: 8px;
|
|
110
|
+
margin-bottom: 24px;
|
|
111
|
+
padding: 16px 24px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.libro-lab-welcome-page-server-info-title {
|
|
115
|
+
font-weight: 500;
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
color: rgba(0, 10, 26, 89%);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.libro-lab-welcome-page-server-info-item {
|
|
121
|
+
color: rgba(0, 10, 26, 78%);
|
|
122
|
+
}
|
package/src/welcome/index.tsx
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServerConnection } from '@difizen/libro-jupyter';
|
|
2
|
+
import {
|
|
3
|
+
inject,
|
|
4
|
+
singleton,
|
|
5
|
+
useInject,
|
|
6
|
+
view,
|
|
7
|
+
ViewInstance,
|
|
8
|
+
ViewManager,
|
|
9
|
+
ViewRender,
|
|
10
|
+
} from '@difizen/mana-app';
|
|
2
11
|
import { BaseView } from '@difizen/mana-app';
|
|
3
12
|
import { forwardRef } from 'react';
|
|
4
13
|
|
|
5
|
-
import {
|
|
14
|
+
import { LayoutService } from '../layout/layout-service.js';
|
|
15
|
+
|
|
16
|
+
import { EntryPointView } from './entry-point-view.js';
|
|
6
17
|
|
|
7
18
|
import './index.less';
|
|
8
19
|
|
|
9
20
|
export const WelcomeComponent = forwardRef(function WelcomeComponent() {
|
|
21
|
+
const instance = useInject<WelcomeView>(ViewInstance);
|
|
22
|
+
const layoutService = useInject(LayoutService);
|
|
23
|
+
const serverConnection = useInject(ServerConnection);
|
|
10
24
|
return (
|
|
11
25
|
<div className="libro-lab-welcome-page">
|
|
12
26
|
<div className="libro-lab-welcome-page-title">欢迎使用 Notebook 工作台 🎉🎉</div>
|
|
13
27
|
<div className="libro-lab-welcome-page-title-tip">
|
|
14
28
|
👋 你好,服务正在加载中,请稍后开启你的研发之旅吧~
|
|
15
29
|
</div>
|
|
30
|
+
<div className="libro-lab-welcome-page-server-info">
|
|
31
|
+
<div className="libro-lab-welcome-page-server-info-title">服务连接信息</div>
|
|
32
|
+
<div className="libro-lab-welcome-page-server-info-item">
|
|
33
|
+
BaseURL: {`${serverConnection.settings.baseUrl}`}
|
|
34
|
+
</div>
|
|
35
|
+
<div className="libro-lab-welcome-page-server-info-item">
|
|
36
|
+
WsURL: {`${serverConnection.settings.wsUrl}`}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
{layoutService.serverSatus === 'success' && (
|
|
40
|
+
<ViewRender view={instance.entryPointView}></ViewRender>
|
|
41
|
+
)}
|
|
16
42
|
</div>
|
|
17
43
|
);
|
|
18
44
|
});
|
|
@@ -21,10 +47,22 @@ export const WelcomeComponent = forwardRef(function WelcomeComponent() {
|
|
|
21
47
|
@view('welcome-view')
|
|
22
48
|
export class WelcomeView extends BaseView {
|
|
23
49
|
override view = WelcomeComponent;
|
|
24
|
-
|
|
25
|
-
|
|
50
|
+
viewManager: ViewManager;
|
|
51
|
+
entryPointView: EntryPointView;
|
|
52
|
+
constructor(@inject(ViewManager) viewManager: ViewManager) {
|
|
26
53
|
super();
|
|
27
|
-
this.title.icon =
|
|
54
|
+
this.title.icon = '🙌 ';
|
|
28
55
|
this.title.label = '欢迎使用';
|
|
56
|
+
this.title.closable = false;
|
|
57
|
+
this.viewManager = viewManager;
|
|
58
|
+
this.viewManager
|
|
59
|
+
.getOrCreateView(EntryPointView)
|
|
60
|
+
.then((entryPointView) => {
|
|
61
|
+
this.entryPointView = entryPointView;
|
|
62
|
+
return;
|
|
63
|
+
})
|
|
64
|
+
.catch(() => {
|
|
65
|
+
//
|
|
66
|
+
});
|
|
29
67
|
}
|
|
30
68
|
}
|
package/es/layout/brand/logo.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function Logo(props) {
|
|
4
|
-
var _props$className = props.className,
|
|
5
|
-
className = _props$className === void 0 ? '' : _props$className;
|
|
6
|
-
return /*#__PURE__*/_jsx("svg", {
|
|
7
|
-
viewBox: "0 0 154 116",
|
|
8
|
-
className: className,
|
|
9
|
-
version: "1.1",
|
|
10
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
12
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
13
|
-
id: "\u9875\u9762-1",
|
|
14
|
-
stroke: "none",
|
|
15
|
-
strokeWidth: "1",
|
|
16
|
-
fill: "none",
|
|
17
|
-
fillRule: "evenodd",
|
|
18
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
19
|
-
id: "\u753B\u677F\u5907\u4EFD-6",
|
|
20
|
-
transform: "translate(-119.000000, -152.000000)",
|
|
21
|
-
children: /*#__PURE__*/_jsxs("g", {
|
|
22
|
-
id: "Libro-logo",
|
|
23
|
-
transform: "translate(119.000000, 152.000000)",
|
|
24
|
-
children: [/*#__PURE__*/_jsx("path", {
|
|
25
|
-
d: "M128.970588,66 C142.793951,66 154,77.1926795 154,90.9995493 C154,104.806419 142.793951,115.999099 128.970588,115.999099 C128.473758,115.999099 127.980309,115.98464 127.49064,115.956121 L127.697007,115.999674 L80,115.999099 L93.1090651,98.1074032 L108.158627,77.1069733 C112.649045,70.4093826 120.294268,66 128.970588,66 Z",
|
|
26
|
-
id: "\u5F62\u72B6\u7ED3\u5408",
|
|
27
|
-
fill: "#155DE2"
|
|
28
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
29
|
-
d: "M104.481034,0 L147,0 L147,0 L59.3397468,116 L0,116 L78.0248494,13.1382037 C84.3029962,4.8615911 94.0927023,-5.19712172e-15 104.481034,0 Z",
|
|
30
|
-
id: "\u77E9\u5F62",
|
|
31
|
-
fill: "#155DE2"
|
|
32
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
33
|
-
d: "M65.667264,51.1430655 C65.667264,84.8453007 91.2203312,112.576275 123.999729,115.999972 L0,115.997535 L75.3014571,17.0042341 C69.1915639,26.9341621 65.667264,38.6268332 65.667264,51.1430655 Z",
|
|
34
|
-
id: "\u5F62\u72B6\u7ED3\u5408",
|
|
35
|
-
fill: "#12D8C6"
|
|
36
|
-
})]
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/editor-tab-view.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,WAAW,EAKZ,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,aAAc,SAAQ,WAAW;cACzB,SAAS,CAAC,IAAI,EAAE,IAAI;IAwBvC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI;CAyBhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"libro-toc-icons.d.ts","sourceRoot":"","sources":["../../src/toc/libro-toc-icons.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,2CA6BpC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function TocIcon(props) {
|
|
4
|
-
return /*#__PURE__*/_jsxs("svg", {
|
|
5
|
-
width: "12px",
|
|
6
|
-
height: "14px",
|
|
7
|
-
viewBox: "0 0 12 14",
|
|
8
|
-
version: "1.1",
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
11
|
-
children: [/*#__PURE__*/_jsx("title", {
|
|
12
|
-
children: "source"
|
|
13
|
-
}), /*#__PURE__*/_jsx("g", {
|
|
14
|
-
id: "\u4EE3\u7801\u7247\u6BB5",
|
|
15
|
-
stroke: "none",
|
|
16
|
-
strokeWidth: "1",
|
|
17
|
-
fill: "none",
|
|
18
|
-
fillRule: "evenodd",
|
|
19
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
20
|
-
id: "1.4\u7F16\u8F91\u72B6\u6001\u5907\u4EFD",
|
|
21
|
-
transform: "translate(-14.000000, -215.000000)",
|
|
22
|
-
fill: "currentColor",
|
|
23
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
24
|
-
id: "\u7F16\u7EC4-2",
|
|
25
|
-
transform: "translate(0.000000, 56.000000)",
|
|
26
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
27
|
-
id: "source",
|
|
28
|
-
transform: "translate(14.359615, 159.750439)",
|
|
29
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
30
|
-
d: "M11.3634429,8.03576964 L9.90082151,8.03576964 L9.90082151,5.91521932 C9.90082151,5.85383497 9.85019231,5.80361141 9.78831217,5.80361141 L6.30052278,5.80361141 L6.30052278,4.46431647 L7.81939881,4.46431647 C7.94315907,4.46431647 8.04441748,4.36386935 8.04441748,4.24110065 L8.04441748,0.223215823 C8.04441748,0.100447121 7.94315907,0 7.81939881,0 L3.76906273,0 C3.64530246,0 3.54404406,0.100447121 3.54404406,0.223215823 L3.54404406,4.24110065 C3.54404406,4.36386935 3.64530246,4.46431647 3.76906273,4.46431647 L5.28793876,4.46431647 L5.28793876,5.80361141 L1.80014937,5.80361141 C1.73826923,5.80361141 1.68764003,5.85383497 1.68764003,5.91521932 L1.68764003,8.03576964 L0.225018671,8.03576964 C0.101258402,8.03576964 0,8.13621676 0,8.25898547 L0,12.2768703 C0,12.399639 0.101258402,12.5000861 0.225018671,12.5000861 L4.27535474,12.5000861 C4.39911501,12.5000861 4.50037341,12.399639 4.50037341,12.2768703 L4.50037341,8.25898547 C4.50037341,8.13621676 4.39911501,8.03576964 4.27535474,8.03576964 L2.70022405,8.03576964 L2.70022405,6.80808261 L8.88823749,6.80808261 L8.88823749,8.03576964 L7.3131068,8.03576964 C7.18934653,8.03576964 7.08808813,8.13621676 7.08808813,8.25898547 L7.08808813,12.2768703 C7.08808813,12.399639 7.18934653,12.5000861 7.3131068,12.5000861 L11.3634429,12.5000861 C11.4872031,12.5000861 11.5884615,12.399639 11.5884615,12.2768703 L11.5884615,8.25898547 C11.5884615,8.13621676 11.4872031,8.03576964 11.3634429,8.03576964 Z",
|
|
31
|
-
id: "Path"
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
})]
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function WelcomeIcon(props) {
|
|
4
|
-
return /*#__PURE__*/_jsx("svg", {
|
|
5
|
-
width: "12px",
|
|
6
|
-
height: "12px",
|
|
7
|
-
viewBox: "0 0 12 12",
|
|
8
|
-
version: "1.1",
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
11
|
-
className: props.className,
|
|
12
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
13
|
-
id: "\u6574\u4F53\u6846\u67B6\u90E8\u5206",
|
|
14
|
-
stroke: "none",
|
|
15
|
-
strokeWidth: "1",
|
|
16
|
-
fill: "none",
|
|
17
|
-
fillRule: "evenodd",
|
|
18
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
19
|
-
id: "1.2\u5BB9\u5668\u52A0\u8F7D\u5B8C\u6210",
|
|
20
|
-
transform: "translate(-270.000000, -66.000000)",
|
|
21
|
-
fillRule: "nonzero",
|
|
22
|
-
children: /*#__PURE__*/_jsx("g", {
|
|
23
|
-
id: "\u7F16\u7EC4-17",
|
|
24
|
-
transform: "translate(262.000000, 56.000000)",
|
|
25
|
-
children: /*#__PURE__*/_jsxs("g", {
|
|
26
|
-
id: "setting-fill",
|
|
27
|
-
transform: "translate(8.000000, 10.000000)",
|
|
28
|
-
children: [/*#__PURE__*/_jsx("rect", {
|
|
29
|
-
id: "\u77E9\u5F62",
|
|
30
|
-
fill: "#000000",
|
|
31
|
-
opacity: "0",
|
|
32
|
-
x: "0",
|
|
33
|
-
y: "0",
|
|
34
|
-
width: "12",
|
|
35
|
-
height: "11.7"
|
|
36
|
-
}), /*#__PURE__*/_jsxs("g", {
|
|
37
|
-
id: "sql",
|
|
38
|
-
transform: "translate(1.000000, 1.000000)",
|
|
39
|
-
children: [/*#__PURE__*/_jsx("rect", {
|
|
40
|
-
id: "\u77E9\u5F62",
|
|
41
|
-
fill: "#000000",
|
|
42
|
-
opacity: "0",
|
|
43
|
-
x: "0",
|
|
44
|
-
y: "0",
|
|
45
|
-
width: "10",
|
|
46
|
-
height: "10"
|
|
47
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
48
|
-
d: "M0.33,6.17 C0.33,7 2.42,7.67 5,7.67 C7.57,7.67 9.66,7 9.67,6.17 L9.67,4.98 C8.71,5.67 6.85,6 5,6 C3.15,6 1.29,5.67 0.33,4.97 L0.33,6.17 Z",
|
|
49
|
-
id: "\u8DEF\u5F84",
|
|
50
|
-
fill: "#FAAD14"
|
|
51
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
52
|
-
d: "M9.67,7.3 C8.71,8 6.85,8.33 5,8.33 C3.15,8.33 1.29,8 0.33,7.3 L0.33,8.66 C0.59,9.42 2.6,10 5,10 C7.4,10 9.41,9.42 9.67,8.67 L9.67,7.3 L9.67,7.3 Z M0.33,3.83 C0.33,4.66 2.42,5.33 5,5.33 C7.57,5.33 9.66,4.66 9.67,3.83 L9.67,2.64 C8.71,3.34 6.85,3.67 5,3.67 C3.15,3.67 1.29,3.34 0.33,2.64 L0.33,3.83 Z",
|
|
53
|
-
id: "\u5F62\u72B6",
|
|
54
|
-
fill: "#FAAD14"
|
|
55
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
56
|
-
d: "M0.33,1.5 C0.33,2.32842712 2.42083022,3 5,3 C7.57916978,3 9.67,2.32842712 9.67,1.5 C9.67,0.671572875 7.57916978,0 5,0 C2.42083022,0 0.33,0.671572875 0.33,1.5 Z",
|
|
57
|
-
id: "\u8DEF\u5F84",
|
|
58
|
-
fill: "#FAAD14"
|
|
59
|
-
})]
|
|
60
|
-
})]
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface IProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
width?: string;
|
|
4
|
-
height?: string;
|
|
5
|
-
}
|
|
6
|
-
export function Logo(props: IProps) {
|
|
7
|
-
const { className = '' } = props;
|
|
8
|
-
return (
|
|
9
|
-
<svg
|
|
10
|
-
viewBox="0 0 154 116"
|
|
11
|
-
className={className}
|
|
12
|
-
version="1.1"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
15
|
-
>
|
|
16
|
-
<g id="页面-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
17
|
-
<g id="画板备份-6" transform="translate(-119.000000, -152.000000)">
|
|
18
|
-
<g id="Libro-logo" transform="translate(119.000000, 152.000000)">
|
|
19
|
-
<path
|
|
20
|
-
d="M128.970588,66 C142.793951,66 154,77.1926795 154,90.9995493 C154,104.806419 142.793951,115.999099 128.970588,115.999099 C128.473758,115.999099 127.980309,115.98464 127.49064,115.956121 L127.697007,115.999674 L80,115.999099 L93.1090651,98.1074032 L108.158627,77.1069733 C112.649045,70.4093826 120.294268,66 128.970588,66 Z"
|
|
21
|
-
id="形状结合"
|
|
22
|
-
fill="#155DE2"
|
|
23
|
-
></path>
|
|
24
|
-
<path
|
|
25
|
-
d="M104.481034,0 L147,0 L147,0 L59.3397468,116 L0,116 L78.0248494,13.1382037 C84.3029962,4.8615911 94.0927023,-5.19712172e-15 104.481034,0 Z"
|
|
26
|
-
id="矩形"
|
|
27
|
-
fill="#155DE2"
|
|
28
|
-
></path>
|
|
29
|
-
<path
|
|
30
|
-
d="M65.667264,51.1430655 C65.667264,84.8453007 91.2203312,112.576275 123.999729,115.999972 L0,115.997535 L75.3014571,17.0042341 C69.1915639,26.9341621 65.667264,38.6268332 65.667264,51.1430655 Z"
|
|
31
|
-
id="形状结合"
|
|
32
|
-
fill="#12D8C6"
|
|
33
|
-
></path>
|
|
34
|
-
</g>
|
|
35
|
-
</g>
|
|
36
|
-
</g>
|
|
37
|
-
</svg>
|
|
38
|
-
);
|
|
39
|
-
}
|