@dao42/d42paas-front 0.4.1 → 0.4.6

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 (156) hide show
  1. package/dist/1569.js +1 -1
  2. package/dist/1585.js +1 -1
  3. package/dist/1593.js +1 -1
  4. package/dist/1594.js +1 -1
  5. package/dist/162.js +1 -1
  6. package/dist/1649.js +1 -1
  7. package/dist/1742.js +1 -1
  8. package/dist/1941.js +1 -1
  9. package/dist/2014.js +1 -1
  10. package/dist/2088.js +1 -1
  11. package/dist/2235.js +3 -3
  12. package/dist/2271.js +1 -1
  13. package/dist/2287.js +3 -3
  14. package/dist/2388.js +1 -1
  15. package/dist/2583.js +1 -1
  16. package/dist/2862.js +1 -1
  17. package/dist/2906.js +1 -1
  18. package/dist/300.js +1 -1
  19. package/dist/3008.js +1 -1
  20. package/dist/317.js +1 -1
  21. package/dist/3315.js +1 -1
  22. package/dist/3399.js +1 -1
  23. package/dist/3504.js +1 -1
  24. package/dist/3553.js +2 -2
  25. package/dist/3673.js +1 -1
  26. package/dist/3780.js +1 -1
  27. package/dist/3855.js +1 -1
  28. package/dist/4035.js +1 -1
  29. package/dist/4073.js +1 -1
  30. package/dist/4246.js +1 -1
  31. package/dist/4366.js +1 -1
  32. package/dist/4369.js +1 -1
  33. package/dist/4454.js +1 -1
  34. package/dist/4511.js +2 -2
  35. package/dist/4558.js +1 -1
  36. package/dist/4610.js +1 -1
  37. package/dist/471.js +1 -1
  38. package/dist/4858.js +1 -1
  39. package/dist/4896.js +1 -1
  40. package/dist/491.js +1 -1
  41. package/dist/5257.js +1 -1
  42. package/dist/5454.js +1 -1
  43. package/dist/5524.js +1 -1
  44. package/dist/5669.js +2 -2
  45. package/dist/5881.js +1 -1
  46. package/dist/5900.js +2 -2
  47. package/dist/5924.js +1 -1
  48. package/dist/5925.js +1 -1
  49. package/dist/5972.js +1 -1
  50. package/dist/5974.js +1 -1
  51. package/dist/6022.js +2 -2
  52. package/dist/6120.js +1 -1
  53. package/dist/615.js +1 -1
  54. package/dist/6162.js +1 -1
  55. package/dist/6175.js +1 -1
  56. package/dist/622.js +1 -1
  57. package/dist/6223.js +1 -1
  58. package/dist/6330.js +1 -1
  59. package/dist/6331.js +1 -1
  60. package/dist/6354.js +2 -2
  61. package/dist/6751.js +2 -2
  62. package/dist/6792.js +1 -1
  63. package/dist/6844.js +1 -1
  64. package/dist/7125.js +1 -1
  65. package/dist/7127.js +1 -1
  66. package/dist/7135.js +2 -2
  67. package/dist/7148.js +1 -1
  68. package/dist/7447.js +1 -1
  69. package/dist/7453.js +2 -2
  70. package/dist/7483.js +1 -1
  71. package/dist/7604.js +1 -1
  72. package/dist/7971.js +1 -1
  73. package/dist/8147.js +1 -1
  74. package/dist/8308.js +1 -1
  75. package/dist/8309.js +1 -1
  76. package/dist/8327.js +1 -1
  77. package/dist/849.js +1 -1
  78. package/dist/8677.js +1 -1
  79. package/dist/868.js +1 -1
  80. package/dist/8947.js +1 -1
  81. package/dist/930.js +1 -1
  82. package/dist/9342.js +2 -2
  83. package/dist/9482.js +1 -1
  84. package/dist/9538.js +1 -1
  85. package/dist/9741.js +2 -2
  86. package/dist/9909.js +1 -1
  87. package/dist/9953.js +2 -2
  88. package/dist/daoPaaS.js +3 -3
  89. package/dist/index.d.ts +31 -31
  90. package/dist/index.html +16 -16
  91. package/package.json +163 -161
  92. package/src/app.tsx +250 -0
  93. package/src/assets/code-brackets.svg +1 -0
  94. package/src/assets/colors.svg +1 -0
  95. package/src/assets/comments.svg +1 -0
  96. package/src/assets/direction.svg +1 -0
  97. package/src/assets/flow.svg +1 -0
  98. package/src/assets/plugin.svg +1 -0
  99. package/src/assets/repo.svg +1 -0
  100. package/src/assets/stackalt.svg +1 -0
  101. package/src/components/Avatar/index.tsx +27 -0
  102. package/src/components/CanvasHelper/index.tsx +89 -0
  103. package/src/components/Console/index.tsx +88 -0
  104. package/src/components/Editor/index.tsx +979 -0
  105. package/src/components/FileTree/index.tsx +477 -0
  106. package/src/components/LiveContent/index.tsx +221 -0
  107. package/src/components/LiveContent/video.tsx +213 -0
  108. package/src/components/LottieAnim/index.tsx +41 -0
  109. package/src/components/Message/index.tsx +64 -0
  110. package/src/components/Model/index.tsx +42 -0
  111. package/src/components/OutputBrowser/index.tsx +180 -0
  112. package/src/components/Skeleton/index.tsx +41 -0
  113. package/src/components/Tabs/index.tsx +23 -0
  114. package/src/components/Terminal/index.tsx +127 -0
  115. package/src/components/ToolBar/index.tsx +169 -0
  116. package/src/components/XTerm/index.tsx +113 -0
  117. package/src/components/index.tsx +4 -0
  118. package/src/components/loading/index.tsx +282 -0
  119. package/src/enum/FExtension.ts +168 -0
  120. package/src/helpers/collections/IoClient.tsx +314 -0
  121. package/src/helpers/collections/errorCatcher.tsx +0 -0
  122. package/src/helpers/collections/idb.tsx +186 -0
  123. package/src/helpers/collections/localStorage.tsx +13 -0
  124. package/src/helpers/collections/mock.tsx +30 -0
  125. package/src/helpers/collections/playgroundInit.tsx +311 -0
  126. package/src/helpers/collections/replay.tsx +168 -0
  127. package/src/helpers/collections/socket.tsx +6 -0
  128. package/src/helpers/collections/toast.tsx +19 -0
  129. package/src/helpers/collections/userTool.tsx +12 -0
  130. package/src/helpers/collections/util.tsx +4 -0
  131. package/src/helpers/index.tsx +6 -0
  132. package/src/helpers/monaco/monaco-ot-adapter.tsx +476 -0
  133. package/src/hooks/collections/useOT.tsx +38 -0
  134. package/src/hooks/index.tsx +1 -0
  135. package/src/pages/index.tsx +450 -0
  136. package/src/public/dev.html +35 -0
  137. package/src/public/index.html +45 -0
  138. package/src/public/sdkserver.html +35 -0
  139. package/src/stores/index.tsx +1 -0
  140. package/src/stores/oTStore.tsx +288 -0
  141. package/src/stories/BrowserWindow.tsx +30 -0
  142. package/src/stories/Console.tsx +46 -0
  143. package/src/stories/Editor.tsx +37 -0
  144. package/src/stories/FileTree.tsx +50 -0
  145. package/src/stories/Shell.tsx +53 -0
  146. package/src/stories/introduction.stories.mdx +193 -0
  147. package/src/stories/page.tsx +71 -0
  148. package/src/styles/collections/iconfont.scss +1 -0
  149. package/src/styles/collections/tabs-costumers.scss +20 -0
  150. package/src/styles/collections/tailwind.scss +3 -0
  151. package/src/styles/collections/tree-costumers.scss +53 -0
  152. package/src/styles/collections/utility.scss +10 -0
  153. package/src/styles/collections/xterm-costumers.scss +47 -0
  154. package/src/styles/index.scss +19 -0
  155. package/src/types/editor.d.ts +31 -0
  156. package/src/types/index.d.ts +158 -0
@@ -0,0 +1,71 @@
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
+ };
@@ -0,0 +1 @@
1
+ @import url(//at.alicdn.com/t/font_2833282_wku3pmhjs9.css);
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,53 @@
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
+ }
@@ -0,0 +1,10 @@
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
+ }
@@ -0,0 +1,47 @@
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
+ }
@@ -0,0 +1,19 @@
1
+ @import "./collections/tailwind.scss";
2
+ @import 'rsuite/dist/rsuite.min.css';
3
+ @import 'xterm/css/xterm.css';
4
+ @import 'react-complex-tree/lib/style.css';
5
+
6
+ @import "./collections/utility.scss";
7
+ @import "./collections/iconfont.scss";
8
+ @import "./collections/tabs-costumers.scss";
9
+ @import "./collections/tree-costumers.scss";
10
+ @import "./collections/xterm-costumers.scss";
11
+
12
+ // $black: #15171C;
13
+
14
+
15
+ .editor-layout {
16
+ height: 100%;
17
+ flex-flow: 1;
18
+ min-height: 300px;
19
+ }
@@ -0,0 +1,31 @@
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
+ }
@@ -0,0 +1,158 @@
1
+ /// <reference types="@emotion/react/types/css-prop" />
2
+ /// <reference types="socket.io-client/build/typed-events" />
3
+
4
+ import { Socket } from 'socket.io-client';
5
+ import { TreeItemIndex } from 'react-complex-tree/lib/esm/types';
6
+ import { TextOperation } from 'ot';
7
+
8
+ type WindowType = typeof window;
9
+ // type FileExtraType = 'Add' | 'Get';
10
+ // type EvtType = 'file' | 'editor';
11
+
12
+ export type UserInfo = {
13
+ avatar?: string;
14
+ name?: string;
15
+ uuid?: string;
16
+ role?: string;
17
+ };
18
+
19
+ declare global {
20
+ interface Window extends WindowType {
21
+ xtermFitAddon: { fit: () => void };
22
+ io: unknown;
23
+ clearCache: () => void;
24
+ Toast: unknown;
25
+ ot: unknown;
26
+ MonacoEnvironment: any;
27
+ }
28
+ interface D42 extends Window {
29
+ log: typeof window.log;
30
+ }
31
+
32
+ declare let LOCAL_IP_HOST: string;
33
+
34
+ declare let d42: D42;
35
+ declare module 'lottie-web';
36
+ // declare module TreeItemIndex;
37
+ namespace D42_FrontType {
38
+ const io: unknown;
39
+ interface SocketType {
40
+ Socket: Socket<DefaultEventsMap, DefaultEventsMap>;
41
+ }
42
+
43
+ /*
44
+ *
45
+ */
46
+
47
+ // CRDT
48
+
49
+ /*
50
+ *
51
+ */
52
+
53
+ type FileExtraType = 'Add' | 'Get' | 'Update' | 'Edit';
54
+ type EvtType = 'File' | 'Editor' | 'Selection' | 'Position';
55
+
56
+ interface CRDT {
57
+ timestamp: string | number;
58
+ userInfo: Pick<UserInfo, 'uuid' | 'role'>;
59
+ editor?: {
60
+ operation?: TextOperation[];
61
+ // selection?: TextSelection;
62
+ selection?: any;
63
+ revision?: number;
64
+ evtType?: EvtType;
65
+ // doc?: {
66
+ // action: FileExtraType;
67
+ // path: string | number;
68
+ // redisKey?: string;
69
+ // value?: string;
70
+ // };
71
+ extraInfo?: any;
72
+ };
73
+ file?: {
74
+ action?: FileExtraType;
75
+ path: string;
76
+ redisKey?: string;
77
+ value?: string;
78
+ };
79
+ selection?: array[];
80
+ terminal?: {
81
+ doc?: {
82
+ action: FileExtraType;
83
+ value?: string;
84
+ };
85
+ extraInfo?: any;
86
+ };
87
+ console?: {
88
+ doc?: {
89
+ action: FileExtraType;
90
+ value?: string;
91
+ };
92
+ extraInfo?: any;
93
+ };
94
+ media?: {
95
+ extraInfo?: {
96
+ segmentId: string;
97
+ };
98
+ };
99
+ }
100
+
101
+ interface ReplaySource {
102
+ timestamp: string | number;
103
+ userInfo?: Pick<UserInfo, 'uuid' | 'role'>;
104
+ editor?: {
105
+ [key: string]: {
106
+ operation?: TextOperation[];
107
+ // selection?: TextSelection;
108
+ selection?: any;
109
+ revision?: number;
110
+ evtType?: EvtType;
111
+ // doc?: {
112
+ // action: FileExtraType;
113
+ // path: string | number;
114
+ // redisKey?: string;
115
+ // value?: string;
116
+ // };
117
+ extraInfo?: any;
118
+ };
119
+ };
120
+ file?: {
121
+ [key: string]: {
122
+ action: FileExtraType;
123
+ path: string | number;
124
+ redisKey?: string;
125
+ value?: string;
126
+ };
127
+ };
128
+ selection?: {
129
+ [key: string]: [][];
130
+ };
131
+ terminal?: {
132
+ [key: string]: {
133
+ doc?: {
134
+ action: FileExtraType;
135
+ value?: string;
136
+ };
137
+ extraInfo?: any;
138
+ };
139
+ };
140
+ console?: {
141
+ [key: string]: {
142
+ doc?: {
143
+ action: FileExtraType;
144
+ value?: string;
145
+ };
146
+ extraInfo?: any;
147
+ };
148
+ };
149
+ media?: {
150
+ [key: string]: {
151
+ extraInfo?: {
152
+ segmentId: string;
153
+ };
154
+ };
155
+ };
156
+ }
157
+ }
158
+ }