@arcblock/terminal 3.1.8 → 3.1.10

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/src/styles.js ADDED
@@ -0,0 +1,357 @@
1
+ import styled from '@emotion/styled';
2
+
3
+ // Terminal Player Root with camelCase styles
4
+ export const PlayerRoot = styled.div({
5
+ // Base styles for .terminal-player
6
+ display: 'inline-block',
7
+ position: 'relative',
8
+ fontSize: 0,
9
+
10
+ // Terminal styles
11
+ '& .terminal': { display: 'inline-block' },
12
+
13
+ '& .terminal .xterm .xterm-viewport': { overflowY: 'hidden !important' },
14
+
15
+ // Terminal frame
16
+ '& .terminal-frame': { position: 'relative' },
17
+
18
+ // Reset styles for terminal divs
19
+ '& .terminal div': {
20
+ margin: 0,
21
+ padding: 0,
22
+ border: 0,
23
+ outline: 0,
24
+ fontWeight: 'inherit',
25
+ fontStyle: 'inherit',
26
+ fontSize: '100%',
27
+ verticalAlign: 'baseline',
28
+ },
29
+
30
+ // Window theme
31
+ '&.terminal-window .terminal-frame': {
32
+ borderRadius: 6,
33
+ border: '1px solid #b3b3b3',
34
+ boxShadow: '0px 0px 18px #b3b3b3',
35
+ margin: 18,
36
+ overflow: 'hidden',
37
+
38
+ '& .terminal-titlebar': {
39
+ background: '#e8e8e8',
40
+ borderBottom: '1px solid #b1aeb1',
41
+ borderTop: '1px solid #f3f1f3',
42
+ borderTopLeftRadius: 6,
43
+ borderTopRightRadius: 6,
44
+ color: '#3b4247',
45
+ fontSize: 14,
46
+ height: 22,
47
+ lineHeight: '22px',
48
+ position: 'relative',
49
+ textAlign: 'center',
50
+ width: '100%',
51
+
52
+ '& .buttons': { left: 8, lineHeight: '0px', position: 'absolute', top: 3.5 },
53
+
54
+ '& .close-button': {
55
+ background: '#ff5c5c',
56
+ borderRadius: '50%',
57
+ border: '1px solid #e33e41',
58
+ display: 'inline-block',
59
+ height: 12,
60
+ width: 12,
61
+ },
62
+
63
+ '& .minimize-button': {
64
+ background: '#ffbd4c',
65
+ borderRadius: '50%',
66
+ border: '1px solid #e09e3e',
67
+ display: 'inline-block',
68
+ height: 12,
69
+ marginLeft: 4,
70
+ width: 12,
71
+ },
72
+
73
+ '& .maximize-button': {
74
+ background: '#00ca56',
75
+ borderRadius: '50%',
76
+ border: '1px solid #14ae46',
77
+ display: 'inline-block',
78
+ height: 12,
79
+ marginLeft: 4,
80
+ width: 12,
81
+ },
82
+ },
83
+
84
+ '& .terminal-body': { backgroundColor: '#1d1d1d', padding: 10 },
85
+ },
86
+
87
+ // Floating theme
88
+ '&.terminal-floating .terminal-frame': {
89
+ backgroundColor: '#1d1d1d',
90
+ borderRadius: 6,
91
+ boxShadow: '0px 0px 18px #b3b3b3',
92
+ margin: 18,
93
+ overflow: 'hidden',
94
+
95
+ '& .terminal-titlebar': {
96
+ color: 'white',
97
+ fontSize: 14,
98
+ height: 34,
99
+ lineHeight: '34px',
100
+ position: 'relative',
101
+ textAlign: 'center',
102
+ width: '100%',
103
+
104
+ '& .buttons': { left: 13, lineHeight: '0px', position: 'absolute', top: 9 },
105
+
106
+ '& .close-button': { background: '#ff5c5c', borderRadius: '50%', display: 'inline-block', height: 15, width: 15 },
107
+
108
+ '& .minimize-button': {
109
+ background: '#ffbd4c',
110
+ borderRadius: '50%',
111
+ display: 'inline-block',
112
+ height: 15,
113
+ lineHeight: '10px',
114
+ marginLeft: 4,
115
+ width: 15,
116
+ },
117
+
118
+ '& .maximize-button': {
119
+ background: '#00ca56',
120
+ borderRadius: '50%',
121
+ display: 'inline-block',
122
+ height: 15,
123
+ lineHeight: '10px',
124
+ marginLeft: 4,
125
+ width: 15,
126
+ },
127
+ },
128
+
129
+ '& .terminal-body': { padding: 20 },
130
+ },
131
+
132
+ // Solid theme
133
+ '&.terminal-solid .terminal-frame': {
134
+ backgroundColor: '#1d1d1d',
135
+ borderRadius: 6,
136
+ boxShadow: '0px 0px 18px #b3b3b3',
137
+ margin: 18,
138
+ overflow: 'hidden',
139
+
140
+ '& .terminal-titlebar': {
141
+ color: 'white',
142
+ fontSize: 14,
143
+ position: 'relative',
144
+ textAlign: 'center',
145
+ width: '100%',
146
+
147
+ '& .title': {
148
+ margin: '15px 15px 15px',
149
+
150
+ '&:empty': { display: 'none' },
151
+ },
152
+
153
+ '& .buttons': { display: 'none' },
154
+ },
155
+
156
+ '& .terminal-body': { padding: 20 },
157
+ },
158
+
159
+ // Player controls
160
+ '& .controller': {
161
+ background: '#45484d', // Original first background value
162
+ backgroundColor: '#222222', // Override background (matches original CSS)
163
+ bottom: '0px',
164
+ display: 'none',
165
+ fontSize: 12,
166
+ height: 40,
167
+ position: 'absolute',
168
+ width: '100%',
169
+ zIndex: 20,
170
+ transition: 'height ease 200ms',
171
+ WebkitTransition: 'height ease 200ms',
172
+ MozTransition: 'height ease 200ms',
173
+ OTransition: 'height ease 200ms',
174
+ },
175
+
176
+ '&.controls .controller': { display: 'block' },
177
+
178
+ '&.playing .controller': { height: 0, overflow: 'hidden' },
179
+
180
+ '&.playing:hover .controller': { height: 40, overflow: 'hidden' },
181
+
182
+ // Play/Pause buttons
183
+ '& .play, & .pause': {
184
+ fill: '#cacaca',
185
+ float: 'left',
186
+ height: 40,
187
+ lineHeight: '40px',
188
+ textAlign: 'center',
189
+ width: 40,
190
+
191
+ '& .icon': {
192
+ borderColor: 'transparent transparent transparent #cacaca',
193
+ boxSizing: 'border-box',
194
+ cursor: 'pointer',
195
+ display: 'inline-block',
196
+ height: 15,
197
+ },
198
+ },
199
+
200
+ '& .pause': {
201
+ display: 'none',
202
+
203
+ '& .icon': { borderStyle: 'double', borderWidth: '0px 0px 0px 12px', marginTop: 11 },
204
+ },
205
+
206
+ '& .play .icon': { borderStyle: 'solid', borderWidth: '8px 0px 8px 13px', marginTop: 10 },
207
+
208
+ '&.playing .play': { display: 'none' },
209
+
210
+ '&.playing .pause': { display: 'inline-block' },
211
+
212
+ // Timer
213
+ '& .timer': { color: '#cacaca', float: 'right', lineHeight: '40px', padding: '0 10px' },
214
+
215
+ // Progress bar
216
+ '& .progressbar-wrapper': { height: 40, lineHeight: '38px', overflow: 'hidden' },
217
+
218
+ '& .progressbar': {
219
+ backgroundColor: '#424242',
220
+ display: 'inline-block',
221
+ height: 7,
222
+ overflow: 'hidden',
223
+ width: '100%',
224
+ borderRadius: 10,
225
+ MozBorderRadius: 10,
226
+ WebkitBorderRadius: 10,
227
+ },
228
+
229
+ '&.started .progressbar': { cursor: 'pointer' },
230
+
231
+ '& .progress': { backgroundColor: '#cacaca', height: 7, position: 'relative', width: '0%' },
232
+
233
+ // Cover and start button
234
+ '& .cover': { cursor: 'pointer', height: '100%', position: 'absolute', width: '100%', zIndex: 10 },
235
+
236
+ '& .start svg': {
237
+ cursor: 'pointer',
238
+ fill: '#eaeaea',
239
+ height: 130,
240
+ left: '50%',
241
+ marginLeft: -65,
242
+ marginTop: -65,
243
+ position: 'absolute',
244
+ top: '50%',
245
+ width: 130,
246
+ zIndex: 20,
247
+ filter: 'drop-shadow(10px 10px 15px rgba(0, 0, 0, 0.4))',
248
+ WebkitFilter: 'drop-shadow(10px 10px 15px rgba(0, 0, 0, 0.4))',
249
+ },
250
+
251
+ '&.small .start svg': { height: 60, marginLeft: -30, marginTop: -30, width: 60 },
252
+
253
+ '&.framed .start svg': {
254
+ transform: 'translate(0px, 8px)',
255
+ WebkitTransform: 'translate(0px, 8px)',
256
+ MozTransform: 'translate(0px, 8px)',
257
+ OTransform: 'translate(0px, 8px)',
258
+ MsTransform: 'translate(0px, 8px)',
259
+ },
260
+
261
+ '& .cover:hover + .start svg, & .start:hover svg': { fill: 'white' },
262
+
263
+ '&.started .cover, &.started .start': { display: 'none' },
264
+
265
+ '& .terminal-watermark': { zIndex: 99999 },
266
+ });
267
+
268
+ // Terminal Root with camelCase xterm styles
269
+ export const TerminalRoot = styled.div({
270
+ // Xterm base styles
271
+ '& .xterm': {
272
+ fontFeatureSettings: "'liga' 0",
273
+ position: 'relative',
274
+ userSelect: 'none',
275
+ MsUserSelect: 'none',
276
+ WebkitUserSelect: 'none',
277
+ cursor: 'text',
278
+
279
+ '&.focus, &:focus': { outline: 'none' },
280
+
281
+ '&.enable-mouse-events': { cursor: 'default' },
282
+
283
+ '&.xterm-cursor-pointer': { cursor: 'pointer' },
284
+
285
+ '&.column-select.focus': { cursor: 'crosshair' },
286
+ },
287
+
288
+ '& .xterm .xterm-helpers': { position: 'absolute', top: 0, zIndex: 5 },
289
+
290
+ '& .xterm .xterm-helper-textarea': {
291
+ position: 'absolute',
292
+ opacity: 0,
293
+ left: '-9999em',
294
+ top: 0,
295
+ width: 0,
296
+ height: 0,
297
+ zIndex: -5,
298
+ whiteSpace: 'nowrap',
299
+ overflow: 'hidden',
300
+ resize: 'none',
301
+ },
302
+
303
+ '& .xterm .composition-view': {
304
+ background: '#000',
305
+ color: '#fff',
306
+ display: 'none',
307
+ position: 'absolute',
308
+ whiteSpace: 'nowrap',
309
+ zIndex: 1,
310
+
311
+ '&.active': { display: 'block' },
312
+ },
313
+
314
+ '& .xterm .xterm-viewport': {
315
+ backgroundColor: '#000',
316
+ overflowY: 'scroll',
317
+ cursor: 'default',
318
+ position: 'absolute',
319
+ right: 0,
320
+ left: 0,
321
+ top: 0,
322
+ bottom: 0,
323
+ },
324
+
325
+ '& .xterm .xterm-screen': {
326
+ position: 'relative',
327
+
328
+ '& canvas': { position: 'absolute', left: 0, top: 0 },
329
+ },
330
+
331
+ '& .xterm .xterm-scroll-area': { visibility: 'hidden' },
332
+
333
+ '& .xterm-char-measure-element': {
334
+ display: 'inline-block',
335
+ visibility: 'hidden',
336
+ position: 'absolute',
337
+ top: 0,
338
+ left: '-9999em',
339
+ lineHeight: 'normal',
340
+ },
341
+
342
+ '& .xterm .xterm-accessibility, & .xterm .xterm-message': {
343
+ position: 'absolute',
344
+ left: 0,
345
+ top: 0,
346
+ bottom: 0,
347
+ right: 0,
348
+ zIndex: 10,
349
+ color: 'transparent',
350
+ },
351
+
352
+ '& .xterm .live-region': { position: 'absolute', left: '-9999px', width: 1, height: 1, overflow: 'hidden' },
353
+
354
+ '& .xterm-dim': { opacity: 0.5 },
355
+
356
+ '& .xterm-underline': { textDecoration: 'underline' },
357
+ });
package/lib/player.css DELETED
@@ -1,378 +0,0 @@
1
- .terminal-player,
2
- .terminal {
3
- display: inline-block;
4
- }
5
-
6
- .terminal .xterm .xterm-viewport {
7
- overflow-y: hidden !important;
8
- }
9
-
10
- .terminal-frame {
11
- position: relative;
12
- }
13
-
14
- /*//// [ Reset ] ////*/
15
-
16
- .terminal div {
17
- margin: 0;
18
- padding: 0;
19
- border: 0;
20
- outline: 0;
21
- font-weight: inherit;
22
- font-style: inherit;
23
- font-size: 100%;
24
- font-family: inherit;
25
- vertical-align: baseline;
26
- }
27
-
28
- /*//// [ Window ] ////*/
29
-
30
- .terminal-frame.terminal-window {
31
- -moz-border-radius: 6px;
32
- -webkit-border-radius: 6px;
33
- border-radius: 6px;
34
- border: 1px solid #b3b3b3;
35
- box-shadow: 0px 0px 18px #b3b3b3;
36
- margin: 18px;
37
- overflow: hidden;
38
- }
39
-
40
- .terminal-frame.terminal-window .terminal-titlebar {
41
- -moz-border-top-left-radius: 6px;
42
- -moz-border-top-right-radius: 6px;
43
- -webkit-border-top-left-radius: 6px;
44
- -webkit-border-top-right-radius: 6px;
45
- background: #e8e8e8;
46
- border-bottom: 1px solid #b1aeb1;
47
- border-top-left-radius: 6px;
48
- border-top-right-radius: 6px;
49
- border-top: 1px solid #f3f1f3;
50
- color: #3b4247;
51
- font-family: Arial, sans-serif;
52
- font-size: 14px;
53
- height: 22px;
54
- line-height: 22px;
55
- position: relative;
56
- text-align: center;
57
- width: 100%;
58
- }
59
-
60
- .terminal-frame.terminal-window .terminal-titlebar .buttons {
61
- left: 8px;
62
- line-height: 0px;
63
- position: absolute;
64
- top: 3.5px;
65
- }
66
-
67
- .terminal-frame.terminal-window .terminal-titlebar .close-button {
68
- -moz-border-radius: 50%;
69
- -webkit-border-radius: 50%;
70
- background: #ff5c5c;
71
- border-radius: 50%;
72
- border: 1px solid #e33e41;
73
- display: inline-block;
74
- height: 12px;
75
- width: 12px;
76
- }
77
-
78
- .terminal-frame.terminal-window .terminal-titlebar .minimize-button {
79
- -moz-border-radius: 50%;
80
- -webkit-border-radius: 50%;
81
- background: #ffbd4c;
82
- border-radius: 50%;
83
- border: 1px solid #e09e3e;
84
- display: inline-block;
85
- height: 12px;
86
- margin-left: 4px;
87
- width: 12px;
88
- }
89
-
90
- .terminal-frame.terminal-window .terminal-titlebar .maximize-button {
91
- -moz-border-radius: 50%;
92
- -webkit-border-radius: 50%;
93
- background: #00ca56;
94
- border-radius: 50%;
95
- border: 1px solid #14ae46;
96
- display: inline-block;
97
- height: 12px;
98
- margin-left: 4px;
99
- width: 12px;
100
- }
101
-
102
- .terminal-frame.terminal-window .terminal-body {
103
- background-color: #1d1d1d;
104
- padding: 10px;
105
- }
106
-
107
- /*//// [ Floating ] ////*/
108
-
109
- .terminal-frame.terminal-floating {
110
- -moz-border-radius: 6px;
111
- -webkit-border-radius: 6px;
112
- background-color: #1d1d1d;
113
- border-radius: 6px;
114
- box-shadow: 0px 0px 18px #b3b3b3;
115
- margin: 18px;
116
- overflow: hidden;
117
- }
118
-
119
- .terminal-frame.terminal-floating .terminal-titlebar {
120
- color: white;
121
- font-family: Arial, sans-serif;
122
- font-size: 14px;
123
- height: 34px;
124
- line-height: 34px;
125
- position: relative;
126
- text-align: center;
127
- width: 100%;
128
- }
129
-
130
- .terminal-frame.terminal-floating .terminal-titlebar .buttons {
131
- left: 13px;
132
- line-height: 0px;
133
- position: absolute;
134
- top: 9px;
135
- }
136
-
137
- .terminal-frame.terminal-floating .terminal-titlebar .close-button {
138
- -moz-border-radius: 50%;
139
- -webkit-border-radius: 50%;
140
- background: #ff5c5c;
141
- border-radius: 50%;
142
- display: inline-block;
143
- height: 15px;
144
- width: 15px;
145
- }
146
-
147
- .terminal-frame.terminal-floating .terminal-titlebar .minimize-button {
148
- -moz-border-radius: 50%;
149
- -webkit-border-radius: 50%;
150
- background: #ffbd4c;
151
- border-radius: 50%;
152
- display: inline-block;
153
- height: 15px;
154
- line-height: 10px;
155
- margin-left: 4px;
156
- width: 15px;
157
- }
158
-
159
- .terminal-frame.terminal-floating .terminal-titlebar .maximize-button {
160
- -moz-border-radius: 50%;
161
- -webkit-border-radius: 50%;
162
- background: #00ca56;
163
- border-radius: 50%;
164
- display: inline-block;
165
- height: 15px;
166
- line-height: 10px;
167
- margin-left: 4px;
168
- width: 15px;
169
- }
170
-
171
- .terminal-frame.terminal-floating .terminal-body {
172
- padding: 20px;
173
- }
174
-
175
- /*//// [ Solid ] ////*/
176
-
177
- .terminal-frame.terminal-solid {
178
- -moz-border-radius: 6px;
179
- -webkit-border-radius: 6px;
180
- background-color: #1d1d1d;
181
- border-radius: 6px;
182
- box-shadow: 0px 0px 18px #b3b3b3;
183
- margin: 18px;
184
- overflow: hidden;
185
- }
186
-
187
- .terminal-frame.terminal-solid .terminal-titlebar {
188
- color: white;
189
- font-family: Arial, sans-serif;
190
- font-size: 14px;
191
- position: relative;
192
- text-align: center;
193
- width: 100%;
194
- }
195
-
196
- .terminal-frame.terminal-solid .terminal-titlebar .title {
197
- margin: 15px 15px 15px;
198
- }
199
-
200
- .terminal-frame.terminal-solid .terminal-titlebar .title:empty {
201
- display: none;
202
- }
203
-
204
- .terminal-frame.terminal-solid .terminal-titlebar .buttons {
205
- display: none;
206
- }
207
-
208
- .terminal-frame.terminal-solid .terminal-body {
209
- padding: 20px;
210
- }
211
-
212
- /*//// [ Player ] ////*/
213
-
214
- .terminal-player {
215
- position: relative;
216
- font-size: 0;
217
- }
218
-
219
- .terminal-player .controller {
220
- background: #45484d;
221
- bottom: 0px;
222
- display: none;
223
- font-family: Helvetica, Arial, sans-serif;
224
- font-size: 12px;
225
- height: 40px;
226
- position: absolute;
227
- width: 100%;
228
- z-index: 20;
229
- background: #222222;
230
- transition: height ease 200ms;
231
- -webkit-transition: height ease 200ms;
232
- -moz-transition: height ease 200ms;
233
- -o-transition: height ease 200ms;
234
- }
235
-
236
- .terminal-player.controls .controller {
237
- display: block;
238
- }
239
-
240
- .terminal-player.playing .controller {
241
- height: 0px;
242
- overflow: hidden;
243
- }
244
-
245
- .terminal-player.playing:hover .controller {
246
- height: 40px;
247
- overflow: hidden;
248
- }
249
-
250
- .terminal-player .play,
251
- .terminal-player .pause {
252
- fill: #cacaca;
253
- float: left;
254
- height: 40px;
255
- line-height: 40px;
256
- text-align: center;
257
- width: 40px;
258
- }
259
-
260
- .terminal-player .play .icon,
261
- .terminal-player .pause .icon {
262
- border-color: transparent transparent transparent #cacaca;
263
- box-sizing: border-box;
264
- cursor: pointer;
265
- display: inline-block;
266
- height: 15px;
267
- }
268
-
269
- .terminal-player .pause .icon {
270
- border-style: double;
271
- border-width: 0px 0px 0px 12px;
272
- margin-top: 11px;
273
- }
274
-
275
- .terminal-player .play .icon {
276
- border-style: solid;
277
- border-width: 8px 0px 8px 13px;
278
- margin-top: 10px;
279
- }
280
-
281
- .terminal-player .pause {
282
- display: none;
283
- }
284
-
285
- .terminal-player.playing .play {
286
- display: none;
287
- }
288
-
289
- .terminal-player.playing .pause {
290
- display: inline-block;
291
- }
292
-
293
- .terminal-player .timer {
294
- color: #cacaca;
295
- float: right;
296
- line-height: 40px;
297
- padding: 0 10px;
298
- }
299
-
300
- .terminal-player .progressbar-wrapper {
301
- height: 40px;
302
- line-height: 38px;
303
- overflow: hidden;
304
- }
305
-
306
- .terminal-player .progressbar {
307
- background-color: #424242;
308
- display: inline-block;
309
- height: 7px;
310
- overflow: hidden;
311
- width: 100%;
312
- border-radius: 10px;
313
- -moz-border-radius: 10px;
314
- -webkit-border-radius: 10px;
315
- }
316
-
317
- .terminal-player.started .progressbar {
318
- cursor: pointer;
319
- }
320
-
321
- .terminal-player .progress {
322
- background-color: #cacaca;
323
- height: 7px;
324
- position: relative;
325
- width: 0%;
326
- }
327
-
328
- .terminal-player .cover {
329
- cursor: pointer;
330
- height: 100%;
331
- position: absolute;
332
- width: 100%;
333
- z-index: 10;
334
- }
335
-
336
- .terminal-player .start svg {
337
- cursor: pointer;
338
- fill: #eaeaea;
339
- height: 130px;
340
- left: 50%;
341
- margin-left: -65px;
342
- margin-top: -65px;
343
- position: absolute;
344
- top: 50%;
345
- width: 130px;
346
- z-index: 20;
347
- filter: drop-shadow(10px 10px 15px rgba(0, 0, 0, 0.4));
348
- -webkit-filter: drop-shadow(10px 10px 15px rgba(0, 0, 0, 0.4));
349
- }
350
-
351
- .terminal-player.small .start svg {
352
- height: 60px;
353
- margin-left: -30px;
354
- margin-top: -30px;
355
- width: 60px;
356
- }
357
-
358
- .terminal-player.framed .start svg {
359
- transform: translate(0px, 8px);
360
- -webkit-transform: translate(0px, 8px);
361
- -moz-transform: translate(0px, 8px);
362
- -o-transform: translate(0px, 8px);
363
- -ms-transform: translate(0px, 8px);
364
- }
365
-
366
- .terminal-player .cover:hover + .start svg,
367
- .terminal-player .start:hover svg {
368
- fill: white;
369
- }
370
-
371
- .terminal-player.started .cover,
372
- .terminal-player.started .start {
373
- display: none;
374
- }
375
-
376
- .terminal-player .terminal-watermark {
377
- z-index: 99999;
378
- }