@electerm/electerm-react 1.34.68 → 1.35.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 (45) hide show
  1. package/client/common/constants.js +3 -1
  2. package/client/common/key-pressed.js +1 -1
  3. package/client/common/rand-hex-color.js +28 -0
  4. package/client/components/batch-op/batch-op.jsx +6 -2
  5. package/client/components/bookmark-form/color-picker-item.jsx +14 -0
  6. package/client/components/bookmark-form/color-picker.jsx +90 -0
  7. package/client/components/bookmark-form/color-picker.styl +20 -0
  8. package/client/components/bookmark-form/form-ssh-common.jsx +4 -0
  9. package/client/components/bookmark-form/hex-input.jsx +39 -0
  10. package/client/components/bookmark-form/local-form-ui.jsx +1 -0
  11. package/client/components/bookmark-form/serial-form-ui.jsx +12 -8
  12. package/client/components/bookmark-form/ssh-form-ui.jsx +3 -0
  13. package/client/components/bookmark-form/telnet-form-ui.jsx +1 -0
  14. package/client/components/bookmark-form/use-ui.jsx +11 -1
  15. package/client/components/context-menu/context-menu.styl +1 -1
  16. package/client/components/context-menu/menu-btn.jsx +6 -3
  17. package/client/components/main/custom-css.jsx +28 -0
  18. package/client/components/main/main.jsx +5 -2
  19. package/client/components/session/session.jsx +11 -35
  20. package/client/components/session/sessions.jsx +15 -15
  21. package/client/components/setting-panel/setting.jsx +20 -32
  22. package/client/components/setting-panel/tab-settings.jsx +13 -10
  23. package/client/components/sftp/transfer-tag.jsx +2 -2
  24. package/client/components/sftp/transport-action.jsx +1 -0
  25. package/client/components/shortcuts/get-key-char.js +45 -0
  26. package/client/components/shortcuts/shortcut-control.jsx +72 -0
  27. package/client/components/shortcuts/shortcut-editor.jsx +194 -0
  28. package/client/components/shortcuts/shortcut-handler.js +75 -0
  29. package/client/components/shortcuts/shortcut.styl +0 -0
  30. package/client/components/shortcuts/shortcuts-defaults.js +92 -0
  31. package/client/components/shortcuts/shortcuts.jsx +166 -0
  32. package/client/components/sidebar/index.jsx +1 -1
  33. package/client/components/sidebar/transfer-history-modal.jsx +14 -2
  34. package/client/components/tabs/index.jsx +0 -25
  35. package/client/components/tabs/tab.jsx +6 -5
  36. package/client/components/terminal/index.jsx +95 -112
  37. package/client/components/terminal/term-search.jsx +9 -21
  38. package/client/components/terminal-theme/index.jsx +4 -3
  39. package/client/store/index.js +17 -2
  40. package/client/store/init-state.js +1 -8
  41. package/client/store/item.js +3 -0
  42. package/client/store/session.js +0 -22
  43. package/client/store/watch.js +3 -1
  44. package/client/views/index.pug +2 -0
  45. package/package.json +1 -1
@@ -164,7 +164,7 @@ export default function ThemeForm (props) {
164
164
  }
165
165
 
166
166
  const {
167
- readOnly,
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 = readOnly || isDefaultTheme
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, message: 'theme Config required'
229
+ required: true,
230
+ message: 'theme config required'
230
231
  }, {
231
232
  validator: validateInput
232
233
  }]}
@@ -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 JSON.parse(window.store._setting || '[]')
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: JSON.stringify([
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(),
@@ -111,6 +111,9 @@ export default Store => {
111
111
  }
112
112
 
113
113
  Store.prototype.getItems = function (type) {
114
+ if (type === 'setting') {
115
+ return window.store.setting
116
+ }
114
117
  return JSON.parse(this['_' + type] || [])
115
118
  }
116
119
 
@@ -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,
@@ -65,7 +65,9 @@ export default store => {
65
65
  }).start()
66
66
 
67
67
  autoRun(store, () => {
68
- window.pre.runGlobalAsync('saveUserConfig', store.config)
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
 
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.34.68",
3
+ "version": "1.35.6",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",