@startupjs-ui/link 0.2.0-alpha.2 → 0.3.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/CHANGELOG.md +19 -0
- package/index.tsx +17 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.3.0](https://github.com/startupjs/startupjs-ui/compare/v0.2.3...v0.3.0) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/link
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.2.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.23...v0.2.0) (2026-05-04)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* [v0.2] add accessibility features to most components, which also dramatically improves E2E testability ([#22](https://github.com/startupjs/startupjs-ui/issues/22)) ([b563e2f](https://github.com/startupjs/startupjs-ui/commit/b563e2fa498a8a83bd5abc7836d120f6d2381e3f))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.2.0-alpha.2](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-04-20)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @startupjs-ui/link
|
package/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import Span from '@startupjs-ui/span'
|
|
|
9
9
|
import './index.cssx.styl'
|
|
10
10
|
|
|
11
11
|
const isWeb = Platform.OS === 'web'
|
|
12
|
-
const EXTERNAL_LINK_REGEXP = /^(https
|
|
12
|
+
const EXTERNAL_LINK_REGEXP = /^(https?:\/\/|\/\/|mailto:)/i
|
|
13
13
|
|
|
14
14
|
export default observer(themed('Link', Link))
|
|
15
15
|
|
|
@@ -103,10 +103,23 @@ function Link ({
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (EXTERNAL_LINK_REGEXP.test(target ?? '')) {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
const url = target ?? ''
|
|
107
|
+
if (/^mailto:/i.test(url)) {
|
|
108
|
+
if (isWeb && typeof document !== 'undefined') {
|
|
109
|
+
const a = document.createElement('a')
|
|
110
|
+
a.href = url
|
|
111
|
+
document.body.appendChild(a)
|
|
112
|
+
a.click()
|
|
113
|
+
document.body.removeChild(a)
|
|
114
|
+
} else {
|
|
115
|
+
Linking.openURL(url)
|
|
116
|
+
}
|
|
108
117
|
} else {
|
|
109
|
-
|
|
118
|
+
if (isWeb) {
|
|
119
|
+
window.open(target, '_blank')
|
|
120
|
+
} else {
|
|
121
|
+
Linking.openURL(target ?? '')
|
|
122
|
+
}
|
|
110
123
|
}
|
|
111
124
|
} else {
|
|
112
125
|
let method
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/link",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@startupjs-ui/button": "^0.
|
|
12
|
-
"@startupjs-ui/core": "^0.
|
|
13
|
-
"@startupjs-ui/div": "^0.
|
|
14
|
-
"@startupjs-ui/span": "^0.
|
|
11
|
+
"@startupjs-ui/button": "^0.3.0",
|
|
12
|
+
"@startupjs-ui/core": "^0.3.0",
|
|
13
|
+
"@startupjs-ui/div": "^0.3.0",
|
|
14
|
+
"@startupjs-ui/span": "^0.3.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "*",
|
|
18
18
|
"react-native": "*",
|
|
19
19
|
"startupjs": "*"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "8d212b47680af1dfe582f9759b38724b46488e25"
|
|
22
22
|
}
|