@electerm/electerm-react 1.35.0 → 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.
@@ -359,7 +359,7 @@ export default class SessionWrapper extends Component {
359
359
  return (
360
360
  <Tooltip title={title}>
361
361
  <FullscreenOutlined
362
- className='mg1r icon-info font16 iblock pointer spliter term-fullscreen-control'
362
+ className='mg1r icon-info font16 iblock pointer spliter term-fullscreen-control1'
363
363
  onClick={this.handleFullscreen}
364
364
  />
365
365
  </Tooltip>
@@ -5,6 +5,7 @@
5
5
 
6
6
  import React from 'react'
7
7
  import { shortcutExtend } from './shortcut-handler.js'
8
+ import { throttle } from 'lodash-es'
8
9
 
9
10
  class ShortcutControl extends React.PureComponent {
10
11
  componentDidMount () {
@@ -27,10 +28,18 @@ class ShortcutControl extends React.PureComponent {
27
28
  window.store.onNewSsh()
28
29
  }
29
30
 
30
- togglefullscreenShortcut = (e) => {
31
+ togglefullscreenShortcut = throttle((e) => {
31
32
  e.stopPropagation()
32
- document.querySelector('.term-fullscreen-control').click()
33
- }
33
+ const x = document.querySelector('.term-fullscreen-control') ||
34
+ document.querySelector('.term-fullscreen-control1')
35
+ x && x.click()
36
+ }, 300)
37
+
38
+ splitShortcut = throttle((e) => {
39
+ e.stopPropagation()
40
+ const x = document.querySelector('.icon-split')
41
+ x && x.click()
42
+ }, 300)
34
43
 
35
44
  zoominShortcut = (e) => {
36
45
  e.stopPropagation()
@@ -9,7 +9,7 @@ import {
9
9
  CheckOutlined,
10
10
  CloseOutlined
11
11
  } from '@ant-design/icons'
12
- import { debounce } from 'lodash-es'
12
+ import { throttle } from 'lodash-es'
13
13
  import { getKeyCharacter } from './get-key-char.js'
14
14
 
15
15
  export default class ShortcutEdit extends PureComponent {
@@ -83,14 +83,14 @@ export default class ShortcutEdit extends PureComponent {
83
83
  return 'shortcut-control-' + index
84
84
  }
85
85
 
86
- warnCtrolKey = debounce(() => {
86
+ warnCtrolKey = throttle(() => {
87
87
  message.info(
88
88
  'Must have one of Ctrl or Shift or Alt or Meta key',
89
89
  undefined
90
90
  )
91
91
  }, 3000)
92
92
 
93
- warnExist = debounce(() => {
93
+ warnExist = throttle(() => {
94
94
  message.info(
95
95
  'Shortcut already exists',
96
96
  undefined
@@ -24,7 +24,6 @@ function buildConfig (config) {
24
24
 
25
25
  export function shortcutExtend (Cls) {
26
26
  Cls.prototype.handleKeyboardEvent = function (event) {
27
- // console.log('event', event)
28
27
  const {
29
28
  code,
30
29
  ctrlKey,
@@ -2,13 +2,13 @@ export default () => {
2
2
  return [
3
3
  {
4
4
  name: 'app_closeCurrentTab',
5
- shortcut: 'ctrl+w',
6
- shortcutMac: 'ctrl+w'
5
+ shortcut: 'alt+w',
6
+ shortcutMac: 'alt+w'
7
7
  },
8
8
  {
9
9
  name: 'app_newBookmark',
10
- shortcut: 'ctrl+b',
11
- shortcutMac: 'meta+b'
10
+ shortcut: 'ctrl+n',
11
+ shortcutMac: 'meta+n'
12
12
  },
13
13
  {
14
14
  name: 'app_togglefullscreen',
@@ -35,6 +35,11 @@ export default () => {
35
35
  shortcut: 'ctrl+tab',
36
36
  shortcutMac: 'ctrl+tab'
37
37
  },
38
+ {
39
+ name: 'terminal_split',
40
+ shortcut: 'ctrl+/',
41
+ shortcutMac: 'meta+/'
42
+ },
38
43
  {
39
44
  name: 'terminal_clear',
40
45
  shortcut: 'ctrl+l,ctrl+shift+l',
@@ -91,7 +91,7 @@ export default class Shortcuts extends Component {
91
91
  const pre = a === 'terminal' ? `[${ss('terminal')}] ` : ''
92
92
  if (
93
93
  [
94
- 'clear', 'selectAll', 'search'
94
+ 'clear', 'selectAll', 'search', 'split'
95
95
  ].includes(b)
96
96
  ) {
97
97
  return pre + ss(b)
@@ -2,7 +2,7 @@ import { Component } from 'react'
2
2
  import ZmodemTransfer from './zmodem-transfer'
3
3
  import { handleErr } from '../../common/fetch'
4
4
  import generate from '../../common/uid'
5
- import { isEqual, pick, debounce } from 'lodash-es'
5
+ import { isEqual, pick, debounce, throttle } from 'lodash-es'
6
6
  import postMessage from '../../common/post-msg'
7
7
  import clone from '../../common/to-simple-obj'
8
8
  import runIdle from '../../common/run-idle'
@@ -255,12 +255,12 @@ class Term extends Component {
255
255
  this.openNormalBuffer()
256
256
  }
257
257
 
258
- prevTabShortcut = debounce((e) => {
258
+ prevTabShortcut = throttle((e) => {
259
259
  e.stopPropagation()
260
260
  window.store.clickPrevTab()
261
261
  }, 300)
262
262
 
263
- nextTabShortcut = debounce((e) => {
263
+ nextTabShortcut = throttle((e) => {
264
264
  e.stopPropagation()
265
265
  window.store.clickNextTab()
266
266
  }, 300)
@@ -1065,7 +1065,7 @@ class Term extends Component {
1065
1065
  // log.log('onKey', key, e)
1066
1066
  }
1067
1067
 
1068
- onResize = debounce(() => {
1068
+ onResize = throttle(() => {
1069
1069
  const cid = this.props.currentTabId
1070
1070
  const tid = this.props.tab?.id
1071
1071
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.35.0",
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",
@@ -1,51 +0,0 @@
1
- export default () => {
2
- return [
3
- {
4
- name: 'app_closeCurrentTab',
5
- shortcut: 'ctrl+w',
6
- shortcutMac: 'ctrl+w'
7
- },
8
- {
9
- name: 'app_prevTab',
10
- shortcut: 'ctrl+shift+tab',
11
- shortcutMac: 'ctrl+shift+tab'
12
- },
13
- {
14
- name: 'app_nextTab',
15
- shortcut: 'ctrl+tab',
16
- shortcutMac: 'ctrl+tab'
17
- },
18
- {
19
- name: 'terminal_clear',
20
- shortcut: 'ctrl+l,ctrl+shift+l',
21
- shortcutMac: 'meta+l'
22
- },
23
- {
24
- name: 'terminal_selectAll',
25
- shortcut: 'ctrl+a,ctrl+shift+a',
26
- shortcutMac: 'meta+a',
27
- readonly: true
28
- },
29
- {
30
- name: 'terminal_copy',
31
- shortcut: 'ctrl+c,ctrl+shift+c',
32
- shortcutMac: 'meta+c',
33
- readonly: true
34
- },
35
- {
36
- name: 'terminal_search',
37
- shortcut: 'ctrl+shift+f',
38
- shortcutMac: 'meta+f'
39
- },
40
- {
41
- name: 'terminal_pasteSelected',
42
- shortcut: 'alt+insert',
43
- shortcutMac: 'alt+insert'
44
- },
45
- {
46
- name: 'terminal_showNormalBuffer',
47
- shortcut: 'ctrl+ArrowUp',
48
- shortcutMac: 'meta+ArrowUp'
49
- }
50
- ]
51
- }