@electerm/electerm-react 2.2.0 → 2.3.18

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 (50) hide show
  1. package/client/common/constants.js +1 -1
  2. package/client/common/ui-theme.js +25 -12
  3. package/client/components/ai/ai.styl +1 -3
  4. package/client/components/bg/custom-css.jsx +2 -2
  5. package/client/components/bookmark-form/common/serial-path-selector.jsx +1 -1
  6. package/client/components/common/highlight.styl +1 -2
  7. package/client/components/common/input-context-menu.jsx +294 -0
  8. package/client/components/common/opacity.jsx +66 -0
  9. package/client/components/file-transfer/transfer.styl +6 -9
  10. package/client/components/footer/footer.styl +2 -5
  11. package/client/components/layout/layout.styl +2 -3
  12. package/client/components/main/error-wrapper.jsx +3 -3
  13. package/client/components/main/main.jsx +4 -7
  14. package/client/components/main/term-fullscreen.styl +1 -1
  15. package/client/components/main/ui-theme.jsx +46 -6
  16. package/client/components/main/upgrade.styl +4 -6
  17. package/client/components/main/wrapper.styl +5 -27
  18. package/client/components/quick-commands/qm.styl +3 -6
  19. package/client/components/session/session.styl +11 -13
  20. package/client/components/setting-panel/list.styl +5 -5
  21. package/client/components/setting-panel/setting-wrap.styl +1 -6
  22. package/client/components/setting-panel/terminal-bg-config.jsx +3 -0
  23. package/client/components/setting-sync/setting-sync-form.jsx +0 -1
  24. package/client/components/sftp/file-item.jsx +3 -0
  25. package/client/components/sftp/sftp-entry.jsx +50 -9
  26. package/client/components/sftp/sftp.styl +21 -34
  27. package/client/components/sftp/transfer-tag.styl +3 -5
  28. package/client/components/side-panel-r/right-side-panel.styl +7 -9
  29. package/client/components/sidebar/info.styl +1 -14
  30. package/client/components/sidebar/sidebar.styl +16 -18
  31. package/client/components/sys-menu/sys-menu.styl +8 -11
  32. package/client/components/tabs/tabs.styl +34 -35
  33. package/client/components/terminal/term-search.styl +3 -3
  34. package/client/components/terminal/terminal-search-bar.jsx +1 -1
  35. package/client/components/terminal/terminal.jsx +2 -2
  36. package/client/components/terminal/terminal.styl +22 -27
  37. package/client/components/terminal-info/terminal-info.styl +8 -8
  38. package/client/components/theme/terminal-theme-list.styl +2 -2
  39. package/client/components/theme/theme-list-item.jsx +62 -20
  40. package/client/components/tree-list/tree-list.styl +1 -1
  41. package/client/css/basic.styl +6 -12
  42. package/client/css/includes/theme.styl +16 -0
  43. package/client/store/ui-theme.js +0 -35
  44. package/client/views/index.pug +8 -1
  45. package/package.json +1 -1
  46. package/client/components/common/native-input.styl +0 -7
  47. package/client/components/setting-sync/sync.styl +0 -7
  48. package/client/components/terminal/zmodem.styl +0 -14
  49. package/client/css/antd-overwrite.styl +0 -10
  50. package/client/css/includes/theme-default.styl +0 -20
@@ -1,4 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
1
  .context-menu
3
2
  position: relative
4
3
  width 280px
@@ -6,7 +5,6 @@
6
5
  .context-item
7
6
  -webkit-app-region no-drag
8
7
  position relative
9
- color text
10
8
  height 28px
11
9
  line-height 28px
12
10
  padding 0 16px
@@ -15,7 +13,7 @@
15
13
  color #eee
16
14
  cursor pointer
17
15
  &.disabled
18
- color alpha(text, .85)
16
+ color var(--text-disabled)
19
17
  &:hover
20
18
  color #777
21
19
  background #333
@@ -30,21 +28,21 @@
30
28
  position absolute
31
29
  right 16px
32
30
  top 0
33
- opacity .65
31
+ color var(--text-light)
34
32
 
35
33
  .context-menu
36
34
  hr
37
35
  margin 0
38
36
  border none
39
- border-bottom 1px solid main-light
37
+ border-bottom 1px solid var(--main-darker)
40
38
  .sub-context-menu
41
39
  display none
42
40
  width 200px
43
41
  position absolute
44
42
  left 100%
45
43
  top 0
46
- background main
47
- box-shadow 0px 0px 3px 3px alpha(main, .35)
44
+ background var(--main)
45
+ box-shadow 0px 0px 3px 3px var(--main-lighter)
48
46
  max-height 300px
49
47
  overflow-y scroll
50
48
  .with-sub-menu
@@ -68,18 +66,17 @@
68
66
  width 28px
69
67
  height 28px
70
68
  border-radius 30px
71
- color text
69
+ color var(--text-light)
72
70
  font-size 16px
73
71
  text-align center
74
72
  display inline-block
75
73
  line-height 28px
76
74
  cursor pointer
77
- opacity .6
78
75
  &:hover
79
- opacity 1
76
+ color var(--text)
80
77
  .is-main
81
78
  .menu-control
82
79
  img
83
- border 1px solid text-dark
80
+ border 1px solid var(--text-dark)
84
81
  border-radius 28px
85
82
  background #000
@@ -1,9 +1,9 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .tabs
3
3
  position relative
4
4
  height 36px
5
5
  overflow hidden
6
- background main-dark
6
+ background var(--main-dark)
7
7
  z-index 12
8
8
  ::-webkit-scrollbar
9
9
  width 0
@@ -41,17 +41,17 @@
41
41
  line-height 36px
42
42
  margin 0 1px 0 0
43
43
  border-radius 3px 3px 0 0
44
- background main-dark
44
+ background var(--main-darker)
45
45
  text-align center
46
- color text-dark
46
+ color var(--text-dark)
47
47
  &.tab-last
48
48
  margin-right 5px
49
49
  .tab-reload
50
50
  .tab-close
51
51
  display none
52
52
  &.active
53
- color text
54
- background main
53
+ color var(--text)
54
+ background var(--main)
55
55
  .tab-count
56
56
  opacity 1
57
57
  &:hover
@@ -63,19 +63,19 @@
63
63
  left -2px
64
64
  top 0
65
65
  width 1px
66
- border 1px dashed text-dark
66
+ border 1px dashed var(--text-dark)
67
67
  height 36px
68
68
  &.error
69
69
  .tab-reload
70
70
  display inline-block
71
- color text-light
71
+ color var(--text-light)
72
72
  @keyframes blink
73
73
  0%
74
- opacity 0.3
74
+ background-color #e0e0e0
75
75
  50%
76
- opacity 1
76
+ background-color #ffffff
77
77
  100%
78
- opacity 0.3
78
+ background-color #e0e0e0
79
79
 
80
80
  .tab-terminal-feed
81
81
  .tab-traffic
@@ -86,30 +86,32 @@
86
86
  width 5px
87
87
  height 5px
88
88
  border-radius 5px
89
- background-color text-dark
89
+ background-color var(--text-dark)
90
90
  &.success
91
- background-color success
91
+ background-color var(--success)
92
92
  &.error
93
- background-color error
93
+ background-color var(--error)
94
94
  &.processing
95
- background-color primary
95
+ background-color var(--primary)
96
96
  .is-transporting .tab-traffic
97
97
  display block
98
98
  animation blink 2s infinite
99
+ /* Remove opacity animation, use background-color */
99
100
  .tab-traffic
100
101
  display none
101
102
  left 10px
102
103
  width 5px
103
104
  border-radius 0
104
- background-color success
105
+ background-color var(--success)
105
106
  .is-terminal-active .tab-terminal-feed
106
107
  display block
107
108
  animation blink 2s infinite
109
+ /* Remove opacity animation, use background-color */
108
110
  .tab-terminal-feed
109
111
  display none
110
112
  left 20px
111
113
  border-radius 0
112
- color success
114
+ color var(--success)
113
115
  background none
114
116
  font-size 8px
115
117
  left 2px
@@ -120,28 +122,27 @@
120
122
  cursor pointer
121
123
  top 50%
122
124
  margin-top -8px
123
- background text-dark
125
+ background var(--text-dark)
124
126
  border-radius 100%
125
- color text
127
+ color var(--text)
126
128
  height 16px
127
129
  width 16px
128
130
  text-align center
129
131
  line-height 16px
130
132
  font-size 10px
131
133
  &:hover
132
- color text-light
134
+ color var(--text-light)
133
135
 
134
136
  .tabs-add-btn
135
137
  display inline-block
136
138
  vertical-align middle
137
139
  margin 0 3px 0 3px
138
- color text
139
140
  &.empty
140
141
  font-size 20px
141
142
  margin-left 20px
142
143
  margin-top 10px
143
144
  &:hover
144
- color text-light
145
+ color var(--text-light)
145
146
  .tabs-extra
146
147
  position absolute
147
148
  height 40px
@@ -151,7 +152,6 @@
151
152
  z-index 20
152
153
 
153
154
  .tabs-dd-icon
154
- color text
155
155
  font-size 12px
156
156
  .tabs-add-btn
157
157
  margin-top 0
@@ -163,21 +163,21 @@
163
163
  z-index 900
164
164
  border-radius 0 0 3px 3px
165
165
  padding 0
166
- background main-light
166
+ background var(--main-lighter)
167
167
 
168
168
  .window-control-box
169
169
  display inline-block
170
170
  padding 5px 10px
171
- color text
171
+ color var(--text)
172
172
  &:hover
173
- color primary
173
+ color var(--primary)
174
174
  cursor pointer
175
175
  .icon-maximize
176
- border-color primary
176
+ border-color var(--primary)
177
177
  .icon-maximize
178
178
  width 10px
179
179
  height 7px
180
- border 1px solid text
180
+ border 1px solid var(--text)
181
181
  cursor pointer
182
182
  &.is-max
183
183
  height 6px
@@ -194,11 +194,11 @@
194
194
  border-right none
195
195
 
196
196
  .control-icon:hover
197
- color text-light
197
+ color var(--text-light)
198
198
  .tab-scroll-icon
199
- color text-dark
199
+ color var(--text-dark)
200
200
  &:hover
201
- color text
201
+ color var(--text)
202
202
 
203
203
  .add-menu-wrap
204
204
  overflow-y scroll
@@ -206,9 +206,9 @@
206
206
  .window-control-minimize
207
207
  .window-control-maximize
208
208
  &:hover
209
- background main-dark
209
+ background var(--main-darker)
210
210
  .window-control-close:hover
211
- background error
211
+ background var(--error)
212
212
 
213
213
  .system-ui
214
214
  .window-controls
@@ -217,7 +217,7 @@
217
217
  margin-right 5px
218
218
  font-size 14px
219
219
  .no-sessions
220
- background main-dark
220
+ background var(--main)
221
221
  text-align center
222
222
  padding 50px 0
223
223
  position absolute
@@ -231,7 +231,6 @@
231
231
  padding 0 4px
232
232
  height 20px
233
233
  line-height 21px
234
- opacity 0.8
235
234
  .no-session-history
236
235
  position absolute
237
236
  top 280px
@@ -1,10 +1,10 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .term-search-opt-icon
3
3
  margin 0 3px
4
- color text-light
4
+ color var(--text-light)
5
5
  font-size 15px
6
6
  &:hover
7
- color text
7
+ color var(--text)
8
8
  &.term-search-on
9
9
  background #333
10
10
  color #aaa
@@ -26,7 +26,7 @@ export default function SearchResultBar ({
26
26
  ctx.clearRect(0, 0, canvas.width, canvas.height)
27
27
  matches.forEach((match, index) => {
28
28
  const y = (match / totalLines) * containerHeight
29
- ctx.fillStyle = index === matchIndex ? 'rgba(243, 67, 9, 0.5)' : 'rgba(243, 196, 9, 0.5)'
29
+ ctx.fillStyle = index === matchIndex ? '#f34309' : '#f3c409'
30
30
  ctx.fillRect(0, y, 16, 2)
31
31
  })
32
32
  }
@@ -1429,8 +1429,8 @@ class Term extends Component {
1429
1429
  ref: this.domRef,
1430
1430
  className: 'absolute term-wrap-2',
1431
1431
  style: {
1432
- left: '10px',
1433
- top: '10px',
1432
+ left: 0,
1433
+ top: 0,
1434
1434
  right: 0,
1435
1435
  bottom: 0
1436
1436
  }
@@ -1,6 +1,6 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .terms-box
3
- background main
3
+ background var(--main)
4
4
  position relative
5
5
  .loading-wrapper
6
6
  padding 30px
@@ -12,22 +12,22 @@
12
12
  z-index 30
13
13
 
14
14
  .terminal-control
15
- background main
15
+ background var(--main)
16
16
  line-height 32px
17
17
  padding 0 10px
18
18
 
19
19
  .terms-box
20
20
  position relative
21
21
  .term-wrap
22
- background main
22
+ background var(--main)
23
23
  position absolute
24
24
 
25
25
  .vertical
26
26
  .term-wrap.not-first-term
27
- border-top 1px solid main-light
27
+ border-top 1px solid var(--main-lighter)
28
28
  .horizontal
29
29
  .term-wrap.not-first-term
30
- border-left 1px solid main-light
30
+ border-left 1px solid var(--main-lighter)
31
31
  .term-sftp-tabs
32
32
  margin-left 5px
33
33
 
@@ -41,20 +41,16 @@
41
41
  height 100%
42
42
  background-repeat no-repeat
43
43
  background-position center
44
- background-color: transparent !important
45
-
46
-
47
- .terminal-not-active .xterm-text-layer
48
- opacity .74
44
+ background-color transparent !important
49
45
 
50
46
  .terminal-normal-buffer
51
47
  position absolute
52
48
  left 0
53
49
  top 0
54
50
  width 100%
55
- background main
56
- color text
57
- box-shadow 0px 3px 3px 0px alpha(text, .25)
51
+ background var(--main)
52
+ color var(--text)
53
+ box-shadow 0px 3px 3px 0px var(--main-lighter)
58
54
  z-index 66
59
55
  padding-bottom 32px
60
56
  .terminal-normal-buffer-body
@@ -63,9 +59,9 @@
63
59
  .terminal-normal-buffer-close
64
60
  cursor pointer
65
61
  font-size 14px
66
- color text
62
+ color var(--text)
67
63
  &:hover
68
- color text-light
64
+ color var(--text-light)
69
65
  .terminal-normal-buffer-footer
70
66
  position absolute
71
67
  left 0
@@ -73,25 +69,24 @@
73
69
  width 100%
74
70
  height 32px
75
71
  line-height 32px
76
- box-shadow 0px -3px 3px 0px alpha(text, .25)
77
- background main-light
72
+ box-shadow 0px -3px 3px 0px var(--main)
73
+ background var(--main-lighter)
78
74
  .batch-input-wrap
79
75
  width calc(100% - 80px)
80
76
 
81
77
  .terminal-suggestions-wrap
82
78
  position absolute
83
79
  z-index 100
84
- color text
85
80
  max-height 300px
86
81
  max-width 300px
87
82
  min-width 200px
88
- box-shadow 0px 0px 3px 3px main-light
83
+ box-shadow 0px 0px 3px 3px var(--main-lighter)
89
84
  display flex
90
85
  flex-direction column
91
- background main
86
+ background var(--main)
92
87
  border-radius 4px
93
88
  &.reverse .terminal-suggestions-list
94
- border-top 1px solid main-light
89
+ border-top 1px solid var(--main-lighter)
95
90
  border-bottom none
96
91
 
97
92
  .terminal-suggestions-list
@@ -100,7 +95,7 @@
100
95
  overflow-y auto
101
96
  max-height 268px
102
97
  max-width 300px
103
- border-bottom 1px solid main-light
98
+ border-bottom 1px solid var(--main-lighter)
104
99
 
105
100
  .terminal-suggestions-sticky
106
101
  flex-shrink 0
@@ -113,9 +108,9 @@
113
108
  align-items center
114
109
  padding 5px 10px
115
110
  cursor pointer
116
- color text
111
+ color var(--text)
117
112
  &:hover
118
- background-color main-light
113
+ background-color var(--main-lighter)
119
114
  .suggestion-delete
120
115
  visibility visible
121
116
 
@@ -128,9 +123,9 @@
128
123
  .suggestion-type
129
124
  margin-left 5px
130
125
  font-size 0.8em
131
- opacity .8
126
+ color var(--text)
132
127
  &:hover
133
- opacity 1
128
+ color var(--success)
134
129
 
135
130
  .suggestion-delete
136
131
  margin-left 5px
@@ -1,22 +1,22 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .terminal-info-icon
3
- color text-dark
3
+ color var(--text-dark)
4
4
  &:hover
5
- color text
5
+ color var(--text)
6
6
  .info-panel-wrap
7
7
  position fixed
8
8
  right 0
9
9
  top 100px
10
10
  bottom 0
11
11
  width 500px
12
- background main
13
- border 1px solid darken(main, 30%)
12
+ background var(--main)
13
+ border 1px solid var(--main-darker)
14
14
  border-radius 5px 0 0 5px
15
15
  border-right none
16
- color text
16
+ color var(--text)
17
17
  z-index 100
18
18
  overflow-y scroll
19
- opacity .9
19
+
20
20
  .drag-handle
21
21
  left 0
22
22
  right auto
@@ -36,4 +36,4 @@
36
36
  max-height none
37
37
  .info-panel-wrap-pin
38
38
  .toggle-info-panel-wrap
39
- color success
39
+ color var(--success)
@@ -1,3 +1,3 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .theme-item.current
3
- border-left 3px solid success
3
+ border-left 3px solid var(--success)
@@ -2,13 +2,15 @@
2
2
  * theme list render
3
3
  */
4
4
 
5
+ import { useState } from 'react'
5
6
  import {
6
7
  CheckCircleOutlined,
7
8
  PlusOutlined,
8
9
  SunOutlined,
9
- MoonOutlined
10
+ MoonOutlined,
11
+ EyeOutlined
10
12
  } from '@ant-design/icons'
11
- import { Tag } from 'antd'
13
+ import { Tag, Tooltip, Button, Space } from 'antd'
12
14
  import classnames from 'classnames'
13
15
  import { defaultTheme } from '../../common/constants'
14
16
  import highlight from '../common/highlight'
@@ -25,25 +27,60 @@ export default function ThemeListItem (props) {
25
27
  } = props
26
28
  const { store } = window
27
29
 
30
+ const [tooltipVisible, setTooltipVisible] = useState(false)
31
+ const [isPreviewing, setIsPreviewing] = useState(false)
32
+
28
33
  function handleClickApply () {
34
+ setTooltipVisible(false)
35
+ setIsPreviewing(false)
29
36
  delete window.originalTheme
30
37
  store.setTheme(item.id)
31
38
  }
32
39
 
33
- function handleMouseEnter () {
34
- // Store current theme ID before changing
35
- const currentTheme = window.store.config.theme
36
- window.originalTheme = currentTheme
37
- // Apply the hovered theme
38
- store.setTheme(item.id)
40
+ function handleClickPreview () {
41
+ if (!isPreviewing) {
42
+ // Store current theme ID before changing
43
+ const currentTheme = window.store.config.theme
44
+ window.originalTheme = currentTheme
45
+ // Apply the preview theme
46
+ store.setTheme(item.id)
47
+ setIsPreviewing(true)
48
+ }
39
49
  }
40
50
 
41
- function handleMouseLeave () {
42
- if (!window.originalTheme) return
43
- // Restore the original theme
44
- store.setTheme(window.originalTheme)
45
- // Clean up
46
- delete window.originalTheme
51
+ function handleTooltipVisibleChange (visible) {
52
+ setTooltipVisible(visible)
53
+ if (!visible && isPreviewing) {
54
+ // Restore original theme when tooltip closes during preview
55
+ if (window.originalTheme) {
56
+ store.setTheme(window.originalTheme)
57
+ delete window.originalTheme
58
+ }
59
+ setIsPreviewing(false)
60
+ }
61
+ }
62
+
63
+ function renderTooltipContent () {
64
+ return (
65
+ <Space>
66
+ <Button
67
+ size='small'
68
+ icon={<EyeOutlined />}
69
+ onClick={handleClickPreview}
70
+ type={isPreviewing ? 'primary' : 'default'}
71
+ >
72
+ {e('preview')}
73
+ </Button>
74
+ <Button
75
+ size='small'
76
+ icon={<CheckCircleOutlined />}
77
+ onClick={handleClickApply}
78
+ type='primary'
79
+ >
80
+ {e('apply')}
81
+ </Button>
82
+ </Space>
83
+ )
47
84
  }
48
85
 
49
86
  function renderApplyBtn () {
@@ -51,12 +88,17 @@ export default function ThemeListItem (props) {
51
88
  return null
52
89
  }
53
90
  return (
54
- <CheckCircleOutlined
55
- className='pointer list-item-apply'
56
- onClick={handleClickApply}
57
- onMouseEnter={handleMouseEnter}
58
- onMouseLeave={handleMouseLeave}
59
- />
91
+ <Tooltip
92
+ title={renderTooltipContent()}
93
+ trigger='click'
94
+ open={tooltipVisible}
95
+ onOpenChange={handleTooltipVisibleChange}
96
+ placement='top'
97
+ >
98
+ <CheckCircleOutlined
99
+ className='pointer list-item-apply'
100
+ />
101
+ </Tooltip>
60
102
  )
61
103
  }
62
104
 
@@ -75,5 +75,5 @@
75
75
  height 12px
76
76
  margin-right 6px
77
77
  border-radius 2px
78
- border 1px solid rgba(0,0,0,0.1)
78
+ border 1px solid #1a1a1a
79
79
  vertical-align middle
@@ -1,21 +1,17 @@
1
1
  @require './includes'
2
- @require './antd-overwrite'
3
- @require './includes/theme-default'
4
-
5
- html
6
- background rgba(0,0,0,.01)
2
+ @require './includes/theme'
7
3
 
8
4
  body
9
- color text
10
5
  overflow hidden
11
- background alpha(main, .3)
6
+ background main
12
7
  font-size 12px
13
8
  line-height 1.5715
14
9
  font-family -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
15
10
  font-variant: tabular-nums
11
+ color var(--text)
16
12
 
17
13
  ::-webkit-scrollbar
18
- background alpha(main, .5)
14
+ background transparent
19
15
  width 7px
20
16
 
21
17
  .term-wrap:hover
@@ -26,7 +22,7 @@ body
26
22
  -webkit-box-shadow none
27
23
 
28
24
  ::-webkit-scrollbar-thumb
29
- background-color primary
25
+ background-color var(--primary)
30
26
  outline none
31
27
 
32
28
  .common-err
@@ -34,11 +30,9 @@ body
34
30
  overflow-y scroll
35
31
  overflow-x hidden
36
32
  word-break break-all
37
- .hide-resize-observer
38
- display: none !important
39
33
 
40
34
  a
41
- color primary
35
+ color var(--primary)
42
36
 
43
37
  .cap
44
38
  text-transform capitalize
@@ -0,0 +1,16 @@
1
+ :root
2
+ --main #141314
3
+ --main-dark #000
4
+ --main-light #2E3338
5
+ --text #ddd
6
+ --text-light #fff
7
+ --text-dark #888
8
+ --text-disabled #777
9
+ --primary #08c
10
+ --info #FFD166
11
+ --success #06D6A0
12
+ --error #EF476F
13
+ --warn #E55934
14
+ --primary-contrast #fff
15
+ --main-darker #0e0d0e
16
+ --main-lighter #5b5a5b