@dao42/d42paas-front 0.4.8 → 0.4.9
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/package.json +2 -3
- package/src/_bundle.tsx +0 -283
- package/src/app.tsx +0 -356
- package/src/assets/code-brackets.svg +0 -1
- package/src/assets/colors.svg +0 -1
- package/src/assets/comments.svg +0 -1
- package/src/assets/direction.svg +0 -1
- package/src/assets/flow.svg +0 -1
- package/src/assets/plugin.svg +0 -1
- package/src/assets/repo.svg +0 -1
- package/src/assets/stackalt.svg +0 -1
- package/src/components/Avatar/index.tsx +0 -27
- package/src/components/CanvasHelper/index.tsx +0 -89
- package/src/components/Console/index.tsx +0 -88
- package/src/components/Editor/index copy.tsx +0 -1010
- package/src/components/Editor/index.tsx +0 -1011
- package/src/components/FileTree/index.tsx +0 -478
- package/src/components/LiveContent/index.tsx +0 -221
- package/src/components/LiveContent/video.tsx +0 -213
- package/src/components/LottieAnim/index.tsx +0 -41
- package/src/components/Message/index.tsx +0 -64
- package/src/components/Model/index.tsx +0 -42
- package/src/components/OutputBrowser/index.tsx +0 -180
- package/src/components/Skeleton/index.tsx +0 -41
- package/src/components/Tabs/index.tsx +0 -23
- package/src/components/Terminal/index.tsx +0 -127
- package/src/components/ToolBar/index.tsx +0 -169
- package/src/components/XTerm/index.tsx +0 -113
- package/src/components/index.tsx +0 -4
- package/src/components/loading/index.tsx +0 -284
- package/src/enum/FExtension.ts +0 -168
- package/src/helpers/collections/IoClient.tsx +0 -314
- package/src/helpers/collections/errorCatcher.tsx +0 -0
- package/src/helpers/collections/idb.tsx +0 -186
- package/src/helpers/collections/localStorage.tsx +0 -13
- package/src/helpers/collections/mock.tsx +0 -30
- package/src/helpers/collections/playgroundInit.tsx +0 -316
- package/src/helpers/collections/replay.tsx +0 -168
- package/src/helpers/collections/socket.tsx +0 -6
- package/src/helpers/collections/toast.tsx +0 -19
- package/src/helpers/collections/userTool.tsx +0 -12
- package/src/helpers/collections/util.tsx +0 -4
- package/src/helpers/index.tsx +0 -6
- package/src/helpers/monaco/monaco-ot-adapter.tsx +0 -476
- package/src/hooks/collections/useOT.tsx +0 -39
- package/src/hooks/index.tsx +0 -1
- package/src/index.html +0 -49
- package/src/pages/index.tsx +0 -452
- package/src/public/dev.html +0 -35
- package/src/public/index.html +0 -50
- package/src/public/sdkserver.html +0 -36
- package/src/stores/index.tsx +0 -1
- package/src/stores/oTStore.tsx +0 -310
- package/src/stories/BrowserWindow.tsx +0 -30
- package/src/stories/Console.tsx +0 -46
- package/src/stories/Editor.tsx +0 -37
- package/src/stories/FileTree.tsx +0 -50
- package/src/stories/Shell.tsx +0 -53
- package/src/stories/introduction.stories.mdx +0 -193
- package/src/stories/page.tsx +0 -71
- package/src/styles/collections/iconfont.scss +0 -1
- package/src/styles/collections/tabs-costumers.scss +0 -20
- package/src/styles/collections/tailwind.scss +0 -3
- package/src/styles/collections/tree-costumers.scss +0 -53
- package/src/styles/collections/utility.scss +0 -10
- package/src/styles/collections/xterm-costumers.scss +0 -47
- package/src/styles/index.css +0 -21
- package/src/types/editor.d.ts +0 -31
- package/src/types/index.d.ts +0 -166
package/src/stores/oTStore.tsx
DELETED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
// import { Client } from 'ot';
|
|
2
|
-
import qs from 'qs';
|
|
3
|
-
import create from 'zustand';
|
|
4
|
-
import { daopaasDB, GenerateDB, SetDB } from '~/helpers/collections/idb';
|
|
5
|
-
import { persist } from 'zustand/middleware';
|
|
6
|
-
// import { get, set } from 'idb-keyval';
|
|
7
|
-
|
|
8
|
-
// Web-worker 待补充
|
|
9
|
-
export interface T_UserInfo {
|
|
10
|
-
playgroundId?: string;
|
|
11
|
-
operation?: any;
|
|
12
|
-
uuid?: string;
|
|
13
|
-
color?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
username?: string;
|
|
16
|
-
role?: string;
|
|
17
|
-
avatar?: string;
|
|
18
|
-
onlineCount?: number;
|
|
19
|
-
userId?: string;
|
|
20
|
-
// [x: string]:
|
|
21
|
-
// | string
|
|
22
|
-
// | number
|
|
23
|
-
// | qs.ParsedQs
|
|
24
|
-
// | string[]
|
|
25
|
-
// | number[]
|
|
26
|
-
// | qs.ParsedQs[];
|
|
27
|
-
// [x: string]: string | qs.ParsedQs | string[] | qs.ParsedQs[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface T_File {
|
|
31
|
-
valueAndPos?: string;
|
|
32
|
-
path?: string;
|
|
33
|
-
value?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface T_Query {
|
|
37
|
-
playgroundId?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export type T_PlaygroundStatus = 'EMPTY' | 'ACTIVE' | 'INACTIVE';
|
|
41
|
-
export type T_DockerStatus = 'RUNNING' | 'STOP';
|
|
42
|
-
|
|
43
|
-
export interface T_PlaygroundInfo {
|
|
44
|
-
dockerId?: string;
|
|
45
|
-
fileTree?: unknown;
|
|
46
|
-
framework?: string;
|
|
47
|
-
frameworkVersion?: string;
|
|
48
|
-
language?: string;
|
|
49
|
-
languageVersion?: string;
|
|
50
|
-
needBrowser?: boolean;
|
|
51
|
-
needConsole?: boolean;
|
|
52
|
-
needRunButton?: boolean;
|
|
53
|
-
url?: string;
|
|
54
|
-
version?: string;
|
|
55
|
-
frameWork?: string;
|
|
56
|
-
frameWorkVersion?: string;
|
|
57
|
-
status?: string;
|
|
58
|
-
runStatus?: string;
|
|
59
|
-
terminalHistory?: string;
|
|
60
|
-
messageId?: string;
|
|
61
|
-
playgroundId?: string;
|
|
62
|
-
result?: string;
|
|
63
|
-
lspUrl?: string;
|
|
64
|
-
ticket?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// const IDBStorage = {
|
|
68
|
-
// getItem: async (name: string): Promise<string | null> => {
|
|
69
|
-
// // Exit early on server
|
|
70
|
-
// if (typeof indexedDB === 'undefined') {
|
|
71
|
-
// return null;
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
// return (await get(name)) || null;
|
|
75
|
-
// },
|
|
76
|
-
// setItem: async (name: string, value: string): Promise<void> => {
|
|
77
|
-
// // Exit early on server
|
|
78
|
-
// if (typeof indexedDB === 'undefined') {
|
|
79
|
-
// return null;
|
|
80
|
-
// }
|
|
81
|
-
// set(name, value);
|
|
82
|
-
// },
|
|
83
|
-
// };
|
|
84
|
-
|
|
85
|
-
export type StateType = {
|
|
86
|
-
appStatus: 'code' | 'replay' | 'recording' | 'pause';
|
|
87
|
-
isRecording: boolean;
|
|
88
|
-
lspServerDisabled: boolean;
|
|
89
|
-
setAppStatus: (arg: StateType['appStatus']) => void;
|
|
90
|
-
setGlobalData: (arg: Pick<StateType, 'isRecording'>) => void;
|
|
91
|
-
switchLspServer: (arg: boolean) => void;
|
|
92
|
-
// client?: Client;
|
|
93
|
-
userInfo: T_UserInfo;
|
|
94
|
-
senders: T_UserInfo[];
|
|
95
|
-
doc?: T_File;
|
|
96
|
-
// TODO :FIXED any
|
|
97
|
-
fileTree?: any;
|
|
98
|
-
CRDTInfo: D42_FrontType.CRDT;
|
|
99
|
-
serverAck: number;
|
|
100
|
-
customAck: number;
|
|
101
|
-
revision: number;
|
|
102
|
-
// TO FIXED any
|
|
103
|
-
dockerInfo: any;
|
|
104
|
-
globalData: Pick<StateType, 'isRecording'>;
|
|
105
|
-
|
|
106
|
-
playgroundInfo: T_PlaygroundInfo;
|
|
107
|
-
playgroundStatus: T_PlaygroundStatus;
|
|
108
|
-
dockerStatus: T_DockerStatus;
|
|
109
|
-
fromServer: boolean;
|
|
110
|
-
setFromServer: (arg: boolean) => void;
|
|
111
|
-
queryObject: T_Query;
|
|
112
|
-
setIsRecording: (arg: boolean) => void;
|
|
113
|
-
fileSaved: boolean;
|
|
114
|
-
setFileSaved: (arg: boolean) => void;
|
|
115
|
-
switchDoc?: (arg: T_File) => void;
|
|
116
|
-
switchDocTree?: (arg: any) => void;
|
|
117
|
-
setUserInfo: (arg: T_UserInfo) => void;
|
|
118
|
-
setSenders: (arg: T_UserInfo[]) => void;
|
|
119
|
-
setCRDTInfo: (arg: D42_FrontType.CRDT) => void;
|
|
120
|
-
setServerAck: () => void;
|
|
121
|
-
setCustomAck: () => void;
|
|
122
|
-
setVersion: (arg: number) => void;
|
|
123
|
-
setPlaygroundInfo: (arg: Pick<Omit<StateType, "userInfo" | "setUserInfo">, "playgroundInfo">) => void;
|
|
124
|
-
setDockerInfo: (arg: unknown) => void;
|
|
125
|
-
setPlaygroundStatus: (arg: T_PlaygroundStatus) => void;
|
|
126
|
-
setDockerStatus: (arg: T_DockerStatus) => void;
|
|
127
|
-
setQueryObject: (arg)=> void;
|
|
128
|
-
// setClientInstance: (arg: number) => void;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// console.log();
|
|
132
|
-
|
|
133
|
-
const QUERY_ARGUMENTS = (qs.parse(location.search.slice(1)) as unknown) as any;
|
|
134
|
-
const user = localStorage.getItem('userInfo');
|
|
135
|
-
// const localUser = user ? JSON.parse(user) : {};
|
|
136
|
-
|
|
137
|
-
export const oTStore = create<Omit<StateType, 'userInfo' | 'setUserInfo'>>(
|
|
138
|
-
(set) => ({
|
|
139
|
-
appStatus: 'code',
|
|
140
|
-
setAppStatus: (arg) => set(() => ({ appStatus: arg })),
|
|
141
|
-
fromServer: false,
|
|
142
|
-
setFromServer: (arg: boolean) => set(() => ({ fromServer: arg })),
|
|
143
|
-
client: null,
|
|
144
|
-
senders: [],
|
|
145
|
-
doc: {},
|
|
146
|
-
fileTree: {
|
|
147
|
-
data: {
|
|
148
|
-
type: 'DIRECTORY',
|
|
149
|
-
name: '/',
|
|
150
|
-
children: [],
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
isRecording: false,
|
|
154
|
-
CRDTInfo: ({
|
|
155
|
-
operation: [],
|
|
156
|
-
userInfo: {},
|
|
157
|
-
evtType: '',
|
|
158
|
-
timestamp: '',
|
|
159
|
-
} as unknown) as D42_FrontType.CRDT,
|
|
160
|
-
serverAck: 0,
|
|
161
|
-
customAck: 0,
|
|
162
|
-
revision: 0,
|
|
163
|
-
dockerInfo: {},
|
|
164
|
-
playgroundInfo: {
|
|
165
|
-
data: {
|
|
166
|
-
fileTree: {},
|
|
167
|
-
framework: '',
|
|
168
|
-
frameworkVersion: null,
|
|
169
|
-
language: '',
|
|
170
|
-
languageVersion: null,
|
|
171
|
-
needBrowser: true,
|
|
172
|
-
needConsole: true,
|
|
173
|
-
needRunButton: true,
|
|
174
|
-
url: '',
|
|
175
|
-
version: '',
|
|
176
|
-
terminalHistory: '',
|
|
177
|
-
},
|
|
178
|
-
messageId: '',
|
|
179
|
-
playgroundId: QUERY_ARGUMENTS.playgroundId,
|
|
180
|
-
result: '',
|
|
181
|
-
},
|
|
182
|
-
playgroundStatus: 'EMPTY',
|
|
183
|
-
dockerStatus: 'STOP',
|
|
184
|
-
queryObject: {},
|
|
185
|
-
globalData: {
|
|
186
|
-
isRecording: false,
|
|
187
|
-
},
|
|
188
|
-
fileSaved: true,
|
|
189
|
-
lspServerDisabled: false,
|
|
190
|
-
switchLspServer: (arg) => set(() => ({ lspServerDisabled: arg })),
|
|
191
|
-
setIsRecording: (arg) => set(() => ({ isRecording: arg })),
|
|
192
|
-
setFileSaved: (arg) => set(() => ({ fileSaved: arg })),
|
|
193
|
-
switchDoc: (arg) => set(() => ({ doc: arg })),
|
|
194
|
-
switchDocTree: (arg) => set(() => ({ fileTree: arg })),
|
|
195
|
-
|
|
196
|
-
setSenders: (arg) => set(() => ({ senders: arg })),
|
|
197
|
-
setCRDTInfo: (arg) => set(() => ({ CRDTInfo: arg })),
|
|
198
|
-
setServerAck: () =>
|
|
199
|
-
set(({ serverAck }) => {
|
|
200
|
-
return {
|
|
201
|
-
serverAck: serverAck + 1,
|
|
202
|
-
};
|
|
203
|
-
}),
|
|
204
|
-
setCustomAck: () =>
|
|
205
|
-
set(({ customAck }) => {
|
|
206
|
-
return {
|
|
207
|
-
customAck: customAck + 1,
|
|
208
|
-
};
|
|
209
|
-
}),
|
|
210
|
-
setGlobalData: (arg) =>
|
|
211
|
-
set(({ appStatus }) => {
|
|
212
|
-
if (
|
|
213
|
-
'isRecording' in arg &&
|
|
214
|
-
arg.isRecording &&
|
|
215
|
-
(appStatus === 'replay' || appStatus === 'pause')
|
|
216
|
-
) {
|
|
217
|
-
throw 'dError: 回放中无法录制!';
|
|
218
|
-
// throw '录制过程中无法回放!';
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
globalData: arg,
|
|
222
|
-
};
|
|
223
|
-
}),
|
|
224
|
-
setVersion: (arg) => set(() => ({ revision: arg })),
|
|
225
|
-
setPlaygroundInfo: (arg) => set(() => ({ playgroundInfo: arg })),
|
|
226
|
-
setDockerInfo: (arg) => set(() => ({ dockerInfo: arg })),
|
|
227
|
-
setPlaygroundStatus: (arg) => set(() => ({ playgroundStatus: arg })),
|
|
228
|
-
setDockerStatus: (arg) => set(() => ({ dockerStatus: arg })),
|
|
229
|
-
setQueryObject: (arg) => set(() => ({ queryObject: arg })),
|
|
230
|
-
// setClientInstance: (arg) => set(() => ({ client: new Client(arg) })),
|
|
231
|
-
}),
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
export const userStore = create<Pick<StateType, 'userInfo' | 'setUserInfo'>>(
|
|
235
|
-
persist(
|
|
236
|
-
(set) => ({
|
|
237
|
-
userInfo: {
|
|
238
|
-
...QUERY_ARGUMENTS,
|
|
239
|
-
},
|
|
240
|
-
setUserInfo: (arg) => set(() => ({ userInfo: arg })),
|
|
241
|
-
}),
|
|
242
|
-
{
|
|
243
|
-
name: 'userInfo',
|
|
244
|
-
getStorage: () => localStorage,
|
|
245
|
-
},
|
|
246
|
-
),
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
export const userListStore = create<{
|
|
250
|
-
userList: T_UserInfo[];
|
|
251
|
-
setUserList: (arg: T_UserInfo[]) => void;
|
|
252
|
-
}>(
|
|
253
|
-
persist(
|
|
254
|
-
(set) => ({
|
|
255
|
-
userList: [],
|
|
256
|
-
setUserList: (arg) => set(() => ({ userList: arg })),
|
|
257
|
-
}),
|
|
258
|
-
{
|
|
259
|
-
name: 'userList',
|
|
260
|
-
getStorage: () => ({
|
|
261
|
-
getItem: async (name: string): Promise<string | null> => {
|
|
262
|
-
// Exit early on server
|
|
263
|
-
if (typeof indexedDB === 'undefined') {
|
|
264
|
-
return null;
|
|
265
|
-
}
|
|
266
|
-
// (await daopaasDB).getAll(name);
|
|
267
|
-
// const john = await get(name);
|
|
268
|
-
// ;
|
|
269
|
-
return (await daopaasDB).getAll(name) || null;
|
|
270
|
-
},
|
|
271
|
-
setItem: async (name: string, value: string): Promise<void> => {
|
|
272
|
-
// Exit early on server
|
|
273
|
-
// if (typeof indexedDB === 'undefined') {
|
|
274
|
-
// return null;
|
|
275
|
-
// }
|
|
276
|
-
(await daopaasDB).put(
|
|
277
|
-
'users',
|
|
278
|
-
JSON.parse(value).state[name],
|
|
279
|
-
'userList',
|
|
280
|
-
);
|
|
281
|
-
// set(name, value);
|
|
282
|
-
},
|
|
283
|
-
removeItem: async () => {
|
|
284
|
-
// console.log();
|
|
285
|
-
},
|
|
286
|
-
}),
|
|
287
|
-
},
|
|
288
|
-
),
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// "esModuleInterop": false,
|
|
295
|
-
// "skipLibCheck": false,
|
|
296
|
-
// "allowJs": true,
|
|
297
|
-
// "target": "ESNext",
|
|
298
|
-
// "lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
299
|
-
|
|
300
|
-
// "allowSyntheticDefaultImports": true,
|
|
301
|
-
// "strict": true,
|
|
302
|
-
// "forceConsistentCasingInFileNames": true,
|
|
303
|
-
// "module": "ESNext",
|
|
304
|
-
// "moduleResolution": "Node",
|
|
305
|
-
// "resolveJsonModule": true,
|
|
306
|
-
// "jsx": "react-jsx",
|
|
307
|
-
|
|
308
|
-
// "useDefineForClassFields": true,
|
|
309
|
-
// "isolatedModules": true,
|
|
310
|
-
// "noEmit": true,
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Meta } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import BrowserWindow from '~/components/OutputBrowser';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: '组件/BrowserWindow',
|
|
9
|
-
component: BrowserWindow,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
url: {
|
|
15
|
-
description: '输出窗口预览链接',
|
|
16
|
-
defaultValue: 'http://',
|
|
17
|
-
type: 'string',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
} as Meta;
|
|
21
|
-
|
|
22
|
-
export const Primary = (args) => (
|
|
23
|
-
<div style={{ backgroundColor: '#b4e0df', height: '100%' }}>
|
|
24
|
-
<BrowserWindow {...args} />
|
|
25
|
-
</div>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
Primary.args = {
|
|
29
|
-
url: 'http://localhost:8080',
|
|
30
|
-
};
|
package/src/stories/Console.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Meta } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import Console from '~/components/Console';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: '组件/Console',
|
|
9
|
-
component: Console,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
options: {
|
|
15
|
-
description: 'Console 配置',
|
|
16
|
-
type: 'ITerminalOptions',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
} as Meta;
|
|
20
|
-
|
|
21
|
-
export const Primary = (args) => (
|
|
22
|
-
<div
|
|
23
|
-
style={{
|
|
24
|
-
height: '70vh',
|
|
25
|
-
width: '80vw',
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<Console {...args} />
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
Primary.args = {
|
|
33
|
-
options: {
|
|
34
|
-
convertEol: true,
|
|
35
|
-
fontSize: 12,
|
|
36
|
-
fontFamily: 'Monaco, Menlo, monospace',
|
|
37
|
-
lineHeight: 1,
|
|
38
|
-
cursorBlink: true,
|
|
39
|
-
cursorWidth: 1,
|
|
40
|
-
cursorStyle: 'block',
|
|
41
|
-
rightClickSelectsWord: true,
|
|
42
|
-
theme: {
|
|
43
|
-
background: '#1E1E1E',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
package/src/stories/Editor.tsx
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Button.stories.js | Button.stories.jsx
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { Meta } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
import { Editor } from '~/components';
|
|
8
|
-
|
|
9
|
-
import '../styles/index.scss';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
title: '组件/Editor',
|
|
13
|
-
component: Editor,
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: 'fullscreen',
|
|
16
|
-
},
|
|
17
|
-
} as Meta;
|
|
18
|
-
|
|
19
|
-
export const Primary = (args) => <Editor {...args} />;
|
|
20
|
-
// export const Primary = (args) => <FileTree {...args} />;
|
|
21
|
-
Primary.args = {
|
|
22
|
-
doc: '',
|
|
23
|
-
// users: []
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// Primary.storyName = 'Editor';
|
|
27
|
-
// export const LoggedIn = Primary.bind({
|
|
28
|
-
// // user: {},
|
|
29
|
-
// doc: '',
|
|
30
|
-
// });
|
|
31
|
-
|
|
32
|
-
// LoggedIn.args = {
|
|
33
|
-
// user: {},
|
|
34
|
-
// };
|
|
35
|
-
|
|
36
|
-
// export const LoggedOut = Template.bind({});
|
|
37
|
-
// LoggedOut.args = {};
|
package/src/stories/FileTree.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Meta } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import { FileTree } from '~/components/FileTree';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: '组件/FileTree',
|
|
9
|
-
component: FileTree,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
onCustomSelect: {
|
|
15
|
-
description: '用户自定义选择操作方法',
|
|
16
|
-
defaultValue: `null`,
|
|
17
|
-
type: 'Function',
|
|
18
|
-
},
|
|
19
|
-
onCustomExpand: {
|
|
20
|
-
description: '用户自定义展开操作方法',
|
|
21
|
-
defaultValue: `null`,
|
|
22
|
-
type: 'Function',
|
|
23
|
-
},
|
|
24
|
-
onCustomCollapse: {
|
|
25
|
-
description: '用户自定义折叠操作方法',
|
|
26
|
-
defaultValue: `null`,
|
|
27
|
-
type: 'Function',
|
|
28
|
-
},
|
|
29
|
-
onCustomFocus: {
|
|
30
|
-
description: '用户自定义聚焦操作方法',
|
|
31
|
-
defaultValue: `null`,
|
|
32
|
-
type: 'Function',
|
|
33
|
-
},
|
|
34
|
-
onCustomUpload: {
|
|
35
|
-
description: '用户自定义上传操作方法',
|
|
36
|
-
defaultValue: `null`,
|
|
37
|
-
type: 'Function',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
} as Meta;
|
|
41
|
-
|
|
42
|
-
export const Primary = (args) => <FileTree {...args} />;
|
|
43
|
-
|
|
44
|
-
Primary.args = {
|
|
45
|
-
onCustomSelect: null,
|
|
46
|
-
onCustomExpand: null,
|
|
47
|
-
onCustomCollapse: null,
|
|
48
|
-
onCustomFocus: null,
|
|
49
|
-
onCustomUpload: null,
|
|
50
|
-
};
|
package/src/stories/Shell.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Meta } from '@storybook/react';
|
|
4
|
-
import Shell from '~/components/Terminal';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: '组件/Shell',
|
|
8
|
-
component: Shell,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
options: {
|
|
14
|
-
description: 'Shell 配置',
|
|
15
|
-
type: 'ITerminalOptions',
|
|
16
|
-
},
|
|
17
|
-
postUser: {
|
|
18
|
-
description: '当前操作者',
|
|
19
|
-
type: 'T_UserInfo',
|
|
20
|
-
},
|
|
21
|
-
corTime: {
|
|
22
|
-
description: '操作发生时的时间戳',
|
|
23
|
-
type: 'number',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
} as Meta;
|
|
27
|
-
|
|
28
|
-
export const Primary = (args) => (
|
|
29
|
-
<div
|
|
30
|
-
style={{
|
|
31
|
-
height: '70vh',
|
|
32
|
-
width: '80vw',
|
|
33
|
-
}}
|
|
34
|
-
>
|
|
35
|
-
<Shell {...args} />
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
Primary.args = {
|
|
40
|
-
options: {
|
|
41
|
-
convertEol: true,
|
|
42
|
-
fontSize: 12,
|
|
43
|
-
fontFamily: 'Monaco, Menlo, monospace',
|
|
44
|
-
lineHeight: 1,
|
|
45
|
-
cursorBlink: true,
|
|
46
|
-
cursorWidth: 1,
|
|
47
|
-
cursorStyle: 'block',
|
|
48
|
-
rightClickSelectsWord: true,
|
|
49
|
-
theme: {
|
|
50
|
-
background: '#1E1E1E',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|