@electerm/electerm-react 1.34.68 → 1.35.0
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/client/common/constants.js +3 -1
- package/client/common/key-pressed.js +1 -1
- package/client/common/rand-hex-color.js +28 -0
- package/client/common/shortcuts-defaults.js +51 -0
- package/client/components/batch-op/batch-op.jsx +6 -2
- package/client/components/bookmark-form/color-picker-item.jsx +14 -0
- package/client/components/bookmark-form/color-picker.jsx +90 -0
- package/client/components/bookmark-form/color-picker.styl +20 -0
- package/client/components/bookmark-form/form-ssh-common.jsx +4 -0
- package/client/components/bookmark-form/hex-input.jsx +39 -0
- package/client/components/bookmark-form/local-form-ui.jsx +1 -0
- package/client/components/bookmark-form/serial-form-ui.jsx +12 -8
- package/client/components/bookmark-form/ssh-form-ui.jsx +3 -0
- package/client/components/bookmark-form/telnet-form-ui.jsx +1 -0
- package/client/components/bookmark-form/use-ui.jsx +11 -1
- package/client/components/context-menu/context-menu.styl +1 -1
- package/client/components/context-menu/menu-btn.jsx +6 -3
- package/client/components/main/custom-css.jsx +28 -0
- package/client/components/main/main.jsx +5 -2
- package/client/components/session/session.jsx +11 -35
- package/client/components/session/sessions.jsx +15 -15
- package/client/components/setting-panel/setting.jsx +20 -32
- package/client/components/setting-panel/tab-settings.jsx +13 -10
- package/client/components/sftp/transfer-tag.jsx +2 -2
- package/client/components/sftp/transport-action.jsx +1 -0
- package/client/components/shortcuts/get-key-char.js +45 -0
- package/client/components/shortcuts/shortcut-control.jsx +63 -0
- package/client/components/shortcuts/shortcut-editor.jsx +194 -0
- package/client/components/shortcuts/shortcut-handler.js +76 -0
- package/client/components/shortcuts/shortcut.styl +0 -0
- package/client/components/shortcuts/shortcuts-defaults.js +87 -0
- package/client/components/shortcuts/shortcuts.jsx +166 -0
- package/client/components/sidebar/index.jsx +1 -1
- package/client/components/sidebar/transfer-history-modal.jsx +14 -2
- package/client/components/tabs/index.jsx +0 -25
- package/client/components/tabs/tab.jsx +6 -5
- package/client/components/terminal/index.jsx +93 -110
- package/client/components/terminal/term-search.jsx +9 -21
- package/client/components/terminal-theme/index.jsx +4 -3
- package/client/store/index.js +17 -2
- package/client/store/init-state.js +1 -8
- package/client/store/item.js +3 -0
- package/client/store/session.js +0 -22
- package/client/store/watch.js +3 -1
- package/client/views/index.pug +2 -0
- package/package.json +1 -1
|
@@ -8,22 +8,20 @@ import {
|
|
|
8
8
|
ArrowRightOutlined,
|
|
9
9
|
CloseCircleOutlined
|
|
10
10
|
} from '@ant-design/icons'
|
|
11
|
-
import { paneMap, terminalActions
|
|
11
|
+
import { paneMap, terminalActions } from '../../common/constants'
|
|
12
12
|
import postMessage from '../../common/post-msg'
|
|
13
13
|
import { MatchCaseIcon } from '../icons/match-case'
|
|
14
14
|
import { MatchWholWordIcon } from '../icons/match-whole-word'
|
|
15
15
|
import { RegularExpIcon } from '../icons/regular-exp'
|
|
16
16
|
import classNames from 'classnames'
|
|
17
17
|
import copy from 'json-deep-copy'
|
|
18
|
-
import
|
|
19
|
-
import keyControlPressed from '../../common/key-control-pressed'
|
|
20
|
-
import keyPressed from '../../common/key-pressed'
|
|
18
|
+
import { shortcutExtend } from '../shortcuts/shortcut-handler.js'
|
|
21
19
|
import './term-search.styl'
|
|
22
20
|
|
|
23
21
|
const { prefix } = window
|
|
24
22
|
const s = prefix('ssh')
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
class TermSearch extends Component {
|
|
27
25
|
searchControls = [{
|
|
28
26
|
id: 'matchCase',
|
|
29
27
|
icon: MatchCaseIcon,
|
|
@@ -53,11 +51,7 @@ export default class TermSearch extends Component {
|
|
|
53
51
|
}]
|
|
54
52
|
|
|
55
53
|
componentDidMount () {
|
|
56
|
-
window.addEventListener('keydown', this.
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
componentWillUnmount () {
|
|
60
|
-
window.removeEventListener('keydown', this.handleEvent)
|
|
54
|
+
window.addEventListener('keydown', this.handleKeyboardEvent.bind(this))
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
toggleSearch = () => {
|
|
@@ -65,17 +59,9 @@ export default class TermSearch extends Component {
|
|
|
65
59
|
setTimeout(window.store.focus, 100)
|
|
66
60
|
}
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
isMac ||
|
|
73
|
-
(!isMac && keyShiftPressed(e))
|
|
74
|
-
)
|
|
75
|
-
) {
|
|
76
|
-
e.stopPropagation()
|
|
77
|
-
this.toggleSearch()
|
|
78
|
-
}
|
|
62
|
+
searchShortcut = (e) => {
|
|
63
|
+
e.stopPropagation()
|
|
64
|
+
this.toggleSearch()
|
|
79
65
|
}
|
|
80
66
|
|
|
81
67
|
prev = () => {
|
|
@@ -222,3 +208,5 @@ export default class TermSearch extends Component {
|
|
|
222
208
|
)
|
|
223
209
|
}
|
|
224
210
|
}
|
|
211
|
+
|
|
212
|
+
export default shortcutExtend(TermSearch)
|
|
@@ -164,7 +164,7 @@ export default function ThemeForm (props) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
const {
|
|
167
|
-
|
|
167
|
+
readonly,
|
|
168
168
|
id,
|
|
169
169
|
type,
|
|
170
170
|
name: themeName
|
|
@@ -175,7 +175,7 @@ export default function ThemeForm (props) {
|
|
|
175
175
|
}
|
|
176
176
|
const { autofocustrigger } = props.store
|
|
177
177
|
const isDefaultTheme = id === defaultTheme.id || id === defaultThemeLight.id
|
|
178
|
-
const disabled =
|
|
178
|
+
const disabled = readonly || isDefaultTheme
|
|
179
179
|
return (
|
|
180
180
|
<Form
|
|
181
181
|
onFinish={handleSubmit}
|
|
@@ -226,7 +226,8 @@ export default function ThemeForm (props) {
|
|
|
226
226
|
rules={[{
|
|
227
227
|
max: 1000, message: '1000 chars max'
|
|
228
228
|
}, {
|
|
229
|
-
required: true,
|
|
229
|
+
required: true,
|
|
230
|
+
message: 'theme config required'
|
|
230
231
|
}, {
|
|
231
232
|
validator: validateInput
|
|
232
233
|
}]}
|
package/client/store/index.js
CHANGED
|
@@ -33,13 +33,19 @@ import {
|
|
|
33
33
|
settingMap,
|
|
34
34
|
sidebarWidth,
|
|
35
35
|
sidebarPanelWidth,
|
|
36
|
-
paneMap
|
|
36
|
+
paneMap,
|
|
37
|
+
settingSyncId,
|
|
38
|
+
settingShortcutsId
|
|
37
39
|
} from '../common/constants'
|
|
38
40
|
import getInitItem from '../common/init-setting-item'
|
|
39
41
|
import {
|
|
40
42
|
theme
|
|
41
43
|
} from 'antd'
|
|
42
44
|
|
|
45
|
+
const { prefix } = window
|
|
46
|
+
const ss = prefix('settingSync')
|
|
47
|
+
const s = prefix('setting')
|
|
48
|
+
|
|
43
49
|
function getReverseColor (hex) {
|
|
44
50
|
// Check if the input is a valid hex color code
|
|
45
51
|
if (!/^#[0-9a-fA-F]{6}$/.test(hex)) {
|
|
@@ -240,7 +246,16 @@ class Store {
|
|
|
240
246
|
}
|
|
241
247
|
|
|
242
248
|
get setting () {
|
|
243
|
-
return
|
|
249
|
+
return [
|
|
250
|
+
{
|
|
251
|
+
id: settingSyncId,
|
|
252
|
+
title: ss('settingSync')
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: settingShortcutsId,
|
|
256
|
+
title: s('settingShortcuts')
|
|
257
|
+
}
|
|
258
|
+
]
|
|
244
259
|
}
|
|
245
260
|
|
|
246
261
|
get config () {
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
newBookmarkIdPrefix,
|
|
9
9
|
fileOperationsMap,
|
|
10
10
|
syncTypes,
|
|
11
|
-
settingSyncId,
|
|
12
11
|
infoTabs,
|
|
13
12
|
openedSidebarKey,
|
|
14
13
|
sidebarPinnedKey,
|
|
@@ -26,7 +25,6 @@ const t = prefix('terminalThemes')
|
|
|
26
25
|
const e = prefix('control')
|
|
27
26
|
const newQuickCommand = 'newQuickCommand'
|
|
28
27
|
const q = prefix('quickCommands')
|
|
29
|
-
const ss = prefix('settingSync')
|
|
30
28
|
|
|
31
29
|
function getDefaultBookmarkGroups (bookmarks) {
|
|
32
30
|
return [
|
|
@@ -104,12 +102,7 @@ export default {
|
|
|
104
102
|
}),
|
|
105
103
|
|
|
106
104
|
// for settings related
|
|
107
|
-
_setting:
|
|
108
|
-
{
|
|
109
|
-
id: settingSyncId,
|
|
110
|
-
title: ss('settingSync')
|
|
111
|
-
}
|
|
112
|
-
]),
|
|
105
|
+
_setting: '',
|
|
113
106
|
_settingItem: JSON.stringify(getInitItem([], settingMap.bookmarks)),
|
|
114
107
|
settingTab: settingMap.bookmarks, // setting tab
|
|
115
108
|
autofocustrigger: Date.now(),
|
package/client/store/item.js
CHANGED
package/client/store/session.js
CHANGED
|
@@ -22,28 +22,6 @@ export default Store => {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
Store.prototype.onKeyDown = function (event) {
|
|
26
|
-
if (
|
|
27
|
-
event.key === '=' &&
|
|
28
|
-
(
|
|
29
|
-
(isMac && event.metaKey) ||
|
|
30
|
-
(!isMac && event.ctrlKey)
|
|
31
|
-
)
|
|
32
|
-
) {
|
|
33
|
-
event.stopPropagation()
|
|
34
|
-
window.store.zoom(0.25, true)
|
|
35
|
-
} else if (
|
|
36
|
-
event.key === '-' &&
|
|
37
|
-
(
|
|
38
|
-
(isMac && event.metaKey) ||
|
|
39
|
-
(!isMac && event.ctrlKey)
|
|
40
|
-
)
|
|
41
|
-
) {
|
|
42
|
-
event.stopPropagation()
|
|
43
|
-
window.store.zoom(-0.25, true)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
25
|
Store.prototype.zoomTerminal = debounce(function (delta) {
|
|
48
26
|
postMsg({
|
|
49
27
|
action: terminalActions.zoom,
|
package/client/store/watch.js
CHANGED
|
@@ -65,7 +65,9 @@ export default store => {
|
|
|
65
65
|
}).start()
|
|
66
66
|
|
|
67
67
|
autoRun(store, () => {
|
|
68
|
-
|
|
68
|
+
if (store.config) {
|
|
69
|
+
window.pre.runGlobalAsync('saveUserConfig', store.config)
|
|
70
|
+
}
|
|
69
71
|
return store._config
|
|
70
72
|
}, func => debounce(func, 100)).start()
|
|
71
73
|
|
package/client/views/index.pug
CHANGED
|
@@ -29,9 +29,11 @@ html
|
|
|
29
29
|
link(rel='stylesheet', href='css/' + version + '-basic.css')
|
|
30
30
|
link(rel='stylesheet', href='css/' + version + '-index.css')
|
|
31
31
|
style(id='theme-css').
|
|
32
|
+
style(id='custom-css').
|
|
32
33
|
body
|
|
33
34
|
- if (isDev)
|
|
34
35
|
style(id='theme-css').
|
|
36
|
+
style(id='custom-css').
|
|
35
37
|
#container
|
|
36
38
|
#content-loading
|
|
37
39
|
.morph-shape.iblock.pd3
|