@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.
Files changed (69) hide show
  1. package/package.json +2 -3
  2. package/src/_bundle.tsx +0 -283
  3. package/src/app.tsx +0 -356
  4. package/src/assets/code-brackets.svg +0 -1
  5. package/src/assets/colors.svg +0 -1
  6. package/src/assets/comments.svg +0 -1
  7. package/src/assets/direction.svg +0 -1
  8. package/src/assets/flow.svg +0 -1
  9. package/src/assets/plugin.svg +0 -1
  10. package/src/assets/repo.svg +0 -1
  11. package/src/assets/stackalt.svg +0 -1
  12. package/src/components/Avatar/index.tsx +0 -27
  13. package/src/components/CanvasHelper/index.tsx +0 -89
  14. package/src/components/Console/index.tsx +0 -88
  15. package/src/components/Editor/index copy.tsx +0 -1010
  16. package/src/components/Editor/index.tsx +0 -1011
  17. package/src/components/FileTree/index.tsx +0 -478
  18. package/src/components/LiveContent/index.tsx +0 -221
  19. package/src/components/LiveContent/video.tsx +0 -213
  20. package/src/components/LottieAnim/index.tsx +0 -41
  21. package/src/components/Message/index.tsx +0 -64
  22. package/src/components/Model/index.tsx +0 -42
  23. package/src/components/OutputBrowser/index.tsx +0 -180
  24. package/src/components/Skeleton/index.tsx +0 -41
  25. package/src/components/Tabs/index.tsx +0 -23
  26. package/src/components/Terminal/index.tsx +0 -127
  27. package/src/components/ToolBar/index.tsx +0 -169
  28. package/src/components/XTerm/index.tsx +0 -113
  29. package/src/components/index.tsx +0 -4
  30. package/src/components/loading/index.tsx +0 -284
  31. package/src/enum/FExtension.ts +0 -168
  32. package/src/helpers/collections/IoClient.tsx +0 -314
  33. package/src/helpers/collections/errorCatcher.tsx +0 -0
  34. package/src/helpers/collections/idb.tsx +0 -186
  35. package/src/helpers/collections/localStorage.tsx +0 -13
  36. package/src/helpers/collections/mock.tsx +0 -30
  37. package/src/helpers/collections/playgroundInit.tsx +0 -316
  38. package/src/helpers/collections/replay.tsx +0 -168
  39. package/src/helpers/collections/socket.tsx +0 -6
  40. package/src/helpers/collections/toast.tsx +0 -19
  41. package/src/helpers/collections/userTool.tsx +0 -12
  42. package/src/helpers/collections/util.tsx +0 -4
  43. package/src/helpers/index.tsx +0 -6
  44. package/src/helpers/monaco/monaco-ot-adapter.tsx +0 -476
  45. package/src/hooks/collections/useOT.tsx +0 -39
  46. package/src/hooks/index.tsx +0 -1
  47. package/src/index.html +0 -49
  48. package/src/pages/index.tsx +0 -452
  49. package/src/public/dev.html +0 -35
  50. package/src/public/index.html +0 -50
  51. package/src/public/sdkserver.html +0 -36
  52. package/src/stores/index.tsx +0 -1
  53. package/src/stores/oTStore.tsx +0 -310
  54. package/src/stories/BrowserWindow.tsx +0 -30
  55. package/src/stories/Console.tsx +0 -46
  56. package/src/stories/Editor.tsx +0 -37
  57. package/src/stories/FileTree.tsx +0 -50
  58. package/src/stories/Shell.tsx +0 -53
  59. package/src/stories/introduction.stories.mdx +0 -193
  60. package/src/stories/page.tsx +0 -71
  61. package/src/styles/collections/iconfont.scss +0 -1
  62. package/src/styles/collections/tabs-costumers.scss +0 -20
  63. package/src/styles/collections/tailwind.scss +0 -3
  64. package/src/styles/collections/tree-costumers.scss +0 -53
  65. package/src/styles/collections/utility.scss +0 -10
  66. package/src/styles/collections/xterm-costumers.scss +0 -47
  67. package/src/styles/index.css +0 -21
  68. package/src/types/editor.d.ts +0 -31
  69. package/src/types/index.d.ts +0 -166
@@ -1,193 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs';
2
- import Code from '../assets/code-brackets.svg';
3
- import Colors from '../assets/colors.svg';
4
- import Comments from '../assets/comments.svg';
5
- import Direction from '../assets/direction.svg';
6
- import Flow from '../assets/flow.svg';
7
- import Plugin from '../assets/plugin.svg';
8
- import Repo from '../assets/repo.svg';
9
- import StackAlt from '../assets/stackalt.svg';
10
- import '../styles/index.scss';
11
- // import { LottieAnim } from '../components/LottieAnim';
12
- // import * as LottiePlayer from "@lottiefiles/lottie-player";
13
- // require("@lottiefiles/lottie-player");
14
-
15
-
16
- <Meta title="使用说明/Introduction" />
17
-
18
- <style>{`
19
- .subheading {
20
- --mediumdark: '#999999';
21
- font-weight: 900;
22
- font-size: 13px;
23
- color: #999;
24
- letter-spacing: 6px;
25
- line-height: 24px;
26
- text-transform: uppercase;
27
- margin-bottom: 12px;
28
- margin-top: 40px;
29
- }
30
-
31
- .link-list {
32
- display: grid;
33
- grid-template-columns: 1fr;
34
- grid-template-rows: 1fr 1fr;
35
- row-gap: 10px;
36
- }
37
-
38
- @media (min-width: 620px) {
39
- .link-list {
40
- row-gap: 20px;
41
- column-gap: 20px;
42
- grid-template-columns: 1fr 1fr;
43
- }
44
- }
45
-
46
- @media all and (-ms-high-contrast:none) {
47
- .link-list {
48
- display: -ms-grid;
49
- -ms-grid-columns: 1fr 1fr;
50
- -ms-grid-rows: 1fr 1fr;
51
- }
52
- }
53
-
54
- .link-item {
55
- display: block;
56
- padding: 20px 30px 20px 15px;
57
- border: 1px solid #00000010;
58
- border-radius: 5px;
59
- transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
60
- color: #333333;
61
- display: flex;
62
- align-items: flex-start;
63
- }
64
-
65
- .link-item:hover {
66
- border-color: #1EA7FD50;
67
- transform: translate3d(0, -3px, 0);
68
- box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
69
- }
70
-
71
- .link-item:active {
72
- border-color: #1EA7FD;
73
- transform: translate3d(0, 0, 0);
74
- }
75
-
76
- .link-item strong {
77
- font-weight: 700;
78
- display: block;
79
- margin-bottom: 2px;
80
- }
81
-
82
- .link-item img {
83
- height: 40px;
84
- width: 40px;
85
- margin-right: 15px;
86
- flex: none;
87
- }
88
-
89
- .link-item span {
90
- font-size: 14px;
91
- line-height: 20px;
92
- }
93
-
94
- .tip {
95
- display: inline-block;
96
- border-radius: 1em;
97
- font-size: 11px;
98
- line-height: 12px;
99
- font-weight: 700;
100
- background: #E7FDD8;
101
- color: #66BF3C;
102
- padding: 4px 12px;
103
- margin-right: 10px;
104
- vertical-align: top;
105
- }
106
-
107
- .tip-wrapper {
108
- font-size: 13px;
109
- line-height: 20px;
110
- margin-top: 40px;
111
- margin-bottom: 40px;
112
- }
113
-
114
- .tip-wrapper code {
115
- font-size: 12px;
116
- display: inline-block;
117
- }
118
-
119
-
120
- `}</style>
121
-
122
-
123
- # PaaS SDK
124
- <!-- ## 使用示例 -->
125
- ### 依赖安装
126
-
127
- #### yarn
128
- yarn add @dao42/d42paas-front
129
-
130
- #### npm
131
- npm install @dao42/d42paas-front
132
-
133
- ### 初始化
134
- ```javascript
135
- import DaoPaaS from '@dao42/d42paas-front';
136
- var dao_paas = new DaoPaaS({
137
- ticket,
138
- playgroundId,
139
- userId,
140
- tenantId,
141
- username
142
- });
143
- ```
144
- Editor 组件
145
-
146
-
147
- <div className="link-list">
148
- <a className="link-item" href="?path=/story/组件-editor--primary">
149
- <img src={Direction} alt="direction" />
150
- <span>
151
- <strong>Editor</strong>
152
- {/* 核心编辑功能 */}
153
- dao_paas.Editor()
154
- </span>
155
- </a>
156
- <a className="link-item" href="?path=/story/组件-fileTree--primary">
157
- <img src={Direction} alt="direction" />
158
- <span>
159
- <strong>FileTree</strong>
160
- {/* 核心编辑功能 */}
161
- dao_paas.FileTree()
162
- </span>
163
- </a>
164
- <a className="link-item" href="?path=/story/组件-browserWindow--primary">
165
- <img src={Direction} alt="direction" />
166
- <span>
167
- <strong>BrowserWindow</strong>
168
- {/* 核心编辑功能 */}
169
- dao_paas.BrowserWindow()
170
- </span>
171
- </a>
172
- <a className="link-item" href="?path=/story/组件-shell--primary">
173
- <img src={Direction} alt="direction" />
174
- <span>
175
- <strong>Shell</strong>
176
- {/* 核心编辑功能 */}
177
- dao_paas.Shell()
178
- </span>
179
- </a>
180
- <a className="link-item" href="?path=/story/组件-console--primary">
181
- <img src={Direction} alt="direction" />
182
- <span>
183
- <strong>Console</strong>
184
- {/* 核心编辑功能 */}
185
- dao_paas.Console()
186
- </span>
187
- </a>
188
- </div>
189
-
190
- <div className="tip-wrapper">
191
- <span className="tip">Tip</span>Edit the Markdown in{' '}
192
- <code>src/client/PaaS/stories/Introduction.stories.mdx</code>
193
- </div>
@@ -1,71 +0,0 @@
1
- import React from 'react';
2
- import { Meta } from '@storybook/react';
3
- import Index from '~/pages';
4
- import { ArgsTable, Story } from '@storybook/addon-docs';
5
- import '../styles/index.scss';
6
-
7
- export default {
8
- title: '组件/Page',
9
- component: Index,
10
- parameters: {
11
- layout: 'fullscreen',
12
- },
13
- argTypes: {
14
- playgroundId: {
15
- description: 'playgroundInfo获取hook',
16
- // default: 1,
17
- // control: 'string',
18
- table: {
19
- category: '初始化参数',
20
- },
21
- },
22
- // backgroundColor: {
23
- // description: 'hi',
24
- // control: 'color',
25
- // // table: {
26
- // // category: '初始化参数',
27
- // // },
28
- // },
29
- primary: {
30
- table: {
31
- category: 'Colors',
32
- },
33
- },
34
- // borderWidth: { control: { type: 'number', min: 0, max: 10 } },
35
-
36
- // backgroundColor: {
37
- // control: 'color',
38
- // table: {
39
- // category: 'Colors',
40
- // // Assigns the argTypes to a specific subcategory
41
- // subcategory: 'Button colors',
42
- // },
43
- // },
44
- // primary: {
45
- // table: {
46
- // category: 'Colors',
47
- // subcategory: 'Button style',
48
- // },
49
- // },
50
- // // Assigns the argType to the Events category
51
- // onClick: {
52
- // table: {
53
- // category: 'Events',
54
- // subcategory: 'Button Events',
55
- // },
56
- // },
57
- // // Assigns the argType to the Sizes category
58
- // size: {
59
- // table: {
60
- // category: 'Sizes',
61
- // },
62
- // },
63
- },
64
- } as Meta;
65
-
66
- export const Primary = (args) => <Index {...args} />;
67
-
68
- Primary.args = {
69
- playgroundId: '329382550470393856',
70
- // users: []
71
- };
@@ -1 +0,0 @@
1
- @import url(//at.alicdn.com/t/font_2833282_wku3pmhjs9.css);
@@ -1,20 +0,0 @@
1
- .rs-nav.rs-nav-tabs.rs-nav-horizontal {
2
- border: none;
3
- .rs-nav-item {
4
- border: none;
5
- &.rs-nav-item-active {
6
- border: 0;
7
- border-radius: 0;
8
- border-bottom-width: 1px;
9
- background-color: #1e1e1e;
10
- color: #eaeaea;
11
- }
12
- &:hover, &:focus {
13
- border-radius: 0;
14
- background-color: #1a1a1a;
15
- }
16
- }
17
- .rs-nav-bar {
18
- border: none;
19
- }
20
- }
@@ -1,3 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
@@ -1,53 +0,0 @@
1
- div.rct-tree-root {
2
- width: 100%;
3
- height: 100%;
4
- background-color: #15171c;
5
- color: #ffffff;
6
- overflow: auto;
7
-
8
- .rct-tree-item-li {
9
- .rct-tree-item-title-container {
10
- .rct-tree-item-arrow {
11
- flex-shrink: 0;
12
- }
13
- .rct-tree-item-avatar {
14
- width: 20px;
15
- height: 20px;
16
- margin-left: 10px;
17
- background-color: white;
18
- right: 5px;
19
- }
20
- }
21
- }
22
-
23
- &.rct-tree-root-focus {
24
- outline: none;
25
- .rct-tree-item-li-selected {
26
- .rct-tree-item-title-container-selected {
27
- background-color: #4b6eaf;
28
- }
29
- }
30
- }
31
-
32
- &:not(.rct-tree-root-focus) {
33
- .rct-tree-item-title-container-focused {
34
- border: none;
35
- }
36
-
37
- .rct-tree-item-li-selected {
38
- .rct-tree-item-title-container-selected {
39
- background-color: #4b6eaf;
40
- }
41
- }
42
- }
43
- &::-webkit-scrollbar {
44
- background-color: #1e1e1e;
45
- width: 6px;
46
- height: 6px;
47
- }
48
-
49
- &::-webkit-scrollbar-thumb {
50
- background-color: #575757;
51
- border-radius: 4px;
52
- }
53
- }
@@ -1,10 +0,0 @@
1
- .nested-sample {
2
- p {
3
- color: red;
4
- }
5
- }
6
- .avatar-hover:hover {
7
- z-index: 10;
8
- transform: scale(1.2);
9
- transition: all 0.5s ease;
10
- }
@@ -1,47 +0,0 @@
1
- .xterm {
2
- width: 100%;
3
- height: 100%;
4
-
5
- .xterm-viewport {
6
- width: calc(100% + 10px) !important;
7
- //height: 100%;
8
- overflow-y: hidden;
9
-
10
- &::-webkit-scrollbar {
11
- background-color: #1e1e1e;
12
- width: 6px;
13
- }
14
-
15
- &::-webkit-scrollbar-thumb {
16
- background-color: #575757;
17
- border-radius: 4px;
18
- }
19
- }
20
-
21
- .xterm-screen {
22
- width: 100% !important;
23
- height: 100% !important;
24
- overflow-y: auto;
25
- overflow-x: hidden;
26
-
27
- .xterm-helpers {
28
- .xterm-helper-user-label {
29
- position: absolute;
30
- height: 20px;
31
- padding: 0 4px;
32
- transform: translateY(-20px);
33
- color: #ffffff;
34
- }
35
- }
36
-
37
- &::-webkit-scrollbar {
38
- background-color: #1e1e1e;
39
- width: 6px;
40
- }
41
-
42
- &::-webkit-scrollbar-thumb {
43
- background-color: #575757;
44
- border-radius: 4px;
45
- }
46
- }
47
- }
@@ -1,21 +0,0 @@
1
- @import 'rsuite/dist/rsuite.min.css';
2
- @import 'xterm/css/xterm.css';
3
- @import 'react-complex-tree/lib/style.css';
4
- @import "./collections/utility.scss";
5
- @import "./collections/iconfont.scss";
6
- @import "./collections/tabs-costumers.scss";
7
- @import "./collections/tree-costumers.scss";
8
- @import "./collections/xterm-costumers.scss";
9
-
10
-
11
- @import "./collections/tailwind.scss";
12
-
13
-
14
-
15
-
16
-
17
- .editor-layout {
18
- height: 100%;
19
- flex-flow: 1;
20
- min-height: 300px;
21
- }
@@ -1,31 +0,0 @@
1
- // export = DaoPaaS;
2
- // export as namespace DaoPaaS;
3
-
4
- interface TConstructor {
5
- ticket: string;
6
- playgroundId: string;
7
- userId: string;
8
- tenantId: string;
9
- username?: string;
10
- avatar?: string;
11
- avatarUrl?: string;
12
- }
13
-
14
- type TReplay = 'stop' | 'disabled' | 'pause';
15
-
16
- interface TComponentArgs {
17
- container: string | HTMLElement | Element;
18
- props?: any;
19
- }
20
-
21
- export class DaoPaaS {
22
- constructor(args: TConstructor): void;
23
- replay(args: TReplay): void;
24
- record(arg: boolean): void;
25
- switchLspServer(arg: boolean): void;
26
-
27
- /* Components */
28
- Editor(args: TComponentArgs): void;
29
- Page(args: TComponentArgs): void;
30
- Tree(args: TComponentArgs): void;
31
- }
@@ -1,166 +0,0 @@
1
- /// <reference types="@emotion/react/types/css-prop" />
2
- // / <reference types="socket.io-client" />
3
- /// <reference types="vite/client" />
4
- import { DefaultEventsMap, EventNames, EventParams, EventsMap, Emitter } from "@socket.io/component-emitter";
5
-
6
-
7
- import { Socket } from 'socket.io-client';
8
- import { TreeItemIndex } from 'react-complex-tree/lib/esm/types';
9
- import { TextOperation } from 'ot';
10
- type WindowType = typeof window;
11
- // type FileExtraType = 'Add' | 'Get';
12
- // type EvtType = 'file' | 'editor';
13
-
14
- export type UserInfo = {
15
- avatar?: string;
16
- name?: string;
17
- uuid?: string;
18
- role?: string;
19
- };
20
-
21
- export * from 'monaco-editor/esm/vs/editor/editor.all';
22
-
23
- declare global {
24
- interface Window {
25
- xtermFitAddon: { fit: () => void };
26
- io: unknown;
27
- clearCache: () => void;
28
- Toast: unknown;
29
- ot: unknown;
30
- MonacoEnvironment: any;
31
- }
32
- // interface D42 extends Window {
33
- // log: typeof window.log;
34
- // }
35
-
36
- let LOCAL_IP_HOST: string;
37
-
38
- // let d42: D42;
39
- // module 'lottie-web';
40
- // declare module TreeItemIndex;
41
- namespace D42_FrontType {
42
- const io: unknown;
43
- // interface SocketType {
44
- // Socket: Socket<DefaultEventsMap, DefaultEventsMap>;
45
- // }
46
-
47
- type SocketType = Socket<DefaultEventsMap, DefaultEventsMap>;
48
- /*
49
- *
50
- */
51
-
52
- // CRDT
53
-
54
- /*
55
- *
56
- */
57
-
58
- type FileExtraType = 'Add' | 'Get' | 'Update' | 'Edit';
59
- type EvtType = 'File' | 'Editor' | 'Selection' | 'Position';
60
-
61
- interface CRDT {
62
- timestamp: string | number;
63
- userInfo: Pick<UserInfo, 'uuid' | 'role'>;
64
- editor?: {
65
- operation?: TextOperation[];
66
- // selection?: TextSelection;
67
- selection?: any;
68
- revision?: number;
69
- evtType?: EvtType;
70
- // doc?: {
71
- // action: FileExtraType;
72
- // path: string | number;
73
- // redisKey?: string;
74
- // value?: string;
75
- // };
76
- extraInfo?: any;
77
- };
78
- file?: {
79
- action?: FileExtraType;
80
- path?: string;
81
- redisKey?: string;
82
- value?: string;
83
- };
84
- selection?: [][] | number[] | number[][];
85
- terminal?: {
86
- doc?: {
87
- action: FileExtraType;
88
- value?: string;
89
- };
90
- extraInfo?: any;
91
- };
92
- console?: {
93
- doc?: {
94
- action: FileExtraType;
95
- value?: string;
96
- };
97
- extraInfo?: any;
98
- };
99
- media?: {
100
- extraInfo?: {
101
- segmentId: string;
102
- };
103
- };
104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
- extend?: any;
106
- }
107
-
108
- interface ReplaySource {
109
- timestamp: string | number;
110
- userInfo?: Pick<UserInfo, 'uuid' | 'role'>;
111
- editor?: {
112
- [key: string]: {
113
- operation?: TextOperation[];
114
- // selection?: TextSelection;
115
- selection?: any;
116
- revision?: number;
117
- evtType?: EvtType;
118
- // doc?: {
119
- // action: FileExtraType;
120
- // path: string | number;
121
- // redisKey?: string;
122
- // value?: string;
123
- // };
124
- extraInfo?: any;
125
- };
126
- };
127
- file?: {
128
- [key: string]: {
129
- action: FileExtraType;
130
- path: string | number;
131
- redisKey?: string;
132
- value?: string;
133
- };
134
- };
135
- selection?: {
136
- [key: string]: [][];
137
- };
138
- terminal?: {
139
- [key: string]: {
140
- doc?: {
141
- action: FileExtraType;
142
- value?: string;
143
- };
144
- extraInfo?: any;
145
- };
146
- };
147
- console?: {
148
- [key: string]: {
149
- doc?: {
150
- action: FileExtraType;
151
- value?: string;
152
- };
153
- extraInfo?: any;
154
- };
155
- };
156
- media?: {
157
- [key: string]: {
158
- extraInfo?: {
159
- segmentId: string;
160
- };
161
- };
162
- };
163
- extend?: any;
164
- }
165
- }
166
- }