@electerm/electerm-react 1.100.56 → 1.100.60

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Check if install source should skip upgrade check
3
+ */
4
+
5
+ import { srcsSkipUpgradeCheck } from './constants'
6
+
7
+ export const checkSkipSrc = (installSrc) => {
8
+ if (!installSrc) return false
9
+ return srcsSkipUpgradeCheck.some(skipSrc => {
10
+ if (skipSrc === 'skip-upgrade-check') {
11
+ return installSrc === skipSrc
12
+ }
13
+ // For file extensions like '.appx', '.snap', check if installSrc ends with them
14
+ return installSrc.endsWith(skipSrc)
15
+ })
16
+ }
@@ -49,25 +49,34 @@ export default forwardRef(function Password (props, ref) {
49
49
  }
50
50
  }, [props.onBlur])
51
51
 
52
- // Caps lock indicator icon
53
- const capsLockIcon = isCapsLockOn
54
- ? (
55
- <Tag
56
- color='red'
57
- >
58
- A
59
- </Tag>
60
- )
61
- : null
52
+ // Keep addonBefore as-is from props; must be null when caps lock is off
53
+ const addonBefore = props.addonBefore ?? null
62
54
 
63
- // Merge addonBefore with caps lock indicator
64
- const addonBefore = capsLockIcon || props.addonBefore || null
55
+ // Show caps lock indicator inside prefix to avoid remounting the input wrapper
56
+ let capsPrefix = null
57
+ if (isCapsLockOn) {
58
+ capsPrefix = (
59
+ <Tag color='orange' style={{ marginRight: 4 }}>CAPS</Tag>
60
+ )
61
+ }
62
+
63
+ // Merge any existing prefix from props with our caps indicator
64
+ let prefix = capsPrefix
65
+ if (props.prefix) {
66
+ prefix = (
67
+ <>
68
+ {capsPrefix}
69
+ {props.prefix}
70
+ </>
71
+ )
72
+ }
65
73
 
66
74
  return (
67
75
  <Input.Password
68
76
  {...props}
69
77
  ref={ref}
70
78
  addonBefore={addonBefore}
79
+ prefix={prefix}
71
80
  onKeyDown={handleKeyEvent}
72
81
  onKeyUp={handleKeyEvent}
73
82
  onFocus={handleFocus}
@@ -9,10 +9,10 @@ import {
9
9
  isMac,
10
10
  isWin,
11
11
  packInfo,
12
- srcsSkipUpgradeCheck,
13
12
  downloadUpgradeTimeout,
14
13
  mirrors
15
14
  } from '../../common/constants'
15
+ import { checkSkipSrc } from '../../common/check-skip-src'
16
16
  import { debounce } from 'lodash-es'
17
17
  import newTerm from '../../common/new-terminal'
18
18
  import Markdown from '../common/markdown'
@@ -146,7 +146,7 @@ export default class Upgrade extends PureComponent {
146
146
 
147
147
  getLatestRelease = async (noSkipVersion = false) => {
148
148
  const { installSrc } = this.props
149
- if (srcsSkipUpgradeCheck.includes(installSrc)) {
149
+ if (checkSkipSrc(installSrc)) {
150
150
  return
151
151
  }
152
152
  this.changeProps({
@@ -305,7 +305,7 @@ export default class Upgrade extends PureComponent {
305
305
  {this.renderChangeLog()}
306
306
  </div>
307
307
  )
308
- const skip = srcsSkipUpgradeCheck.includes(installSrc)
308
+ const skip = checkSkipSrc(installSrc)
309
309
  return (
310
310
  <div className={cls}>
311
311
  <div className='upgrade-panel-title fix'>
@@ -19,9 +19,9 @@ import { auto } from 'manate/react'
19
19
 
20
20
  import {
21
21
  packInfo,
22
- infoTabs,
23
- srcsSkipUpgradeCheck
22
+ infoTabs
24
23
  } from '../../common/constants'
24
+ import { checkSkipSrc } from '../../common/check-skip-src'
25
25
  import './info.styl'
26
26
 
27
27
  const e = window.translate
@@ -32,7 +32,7 @@ export default auto(function InfoModal (props) {
32
32
  }
33
33
 
34
34
  const renderCheckUpdate = () => {
35
- if (window.et.isWebApp || srcsSkipUpgradeCheck.includes(props.installSrc)) {
35
+ if (window.et.isWebApp || checkSkipSrc(props.installSrc)) {
36
36
  return null
37
37
  }
38
38
  const {
@@ -38,6 +38,12 @@ async function load () {
38
38
  const url = !isDev ? `js/electerm-${version}.js` : 'js/electerm.js'
39
39
  rcs.src = url
40
40
  rcs.type = 'module'
41
+ rcs.onload = () => {
42
+ const loadingEl = document.getElementById('content-loading')
43
+ if (loadingEl) {
44
+ document.body.removeChild(loadingEl)
45
+ }
46
+ }
41
47
  document.body.appendChild(rcs)
42
48
  }
43
49
  window.getLang = (lang = window.store?.config.language || 'en_us') => {
@@ -50,7 +56,6 @@ async function load () {
50
56
  }
51
57
  await loadWorker()
52
58
  loadScript()
53
- document.body.removeChild(document.getElementById('content-loading'))
54
59
  }
55
60
 
56
61
  // window.addEventListener('load', load)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.100.56",
3
+ "version": "1.100.60",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",