@wsxjs/wsx-router 0.1.0 → 0.1.1
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/dist/index.cjs +1 -1
- package/dist/index.mjs +1051 -0
- package/package.json +8 -8
- package/src/WsxLink.css +35 -25
- package/dist/index.js +0 -1063
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wsxjs/wsx-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "WSX Router - Native History API-based routing for WSXJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./dist/index.
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
11
|
"require": "./dist/index.cjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"!**/test"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wsxjs/wsx-core": "0.1.
|
|
22
|
-
"@wsxjs/wsx-logger": "0.1.
|
|
21
|
+
"@wsxjs/wsx-core": "0.1.1",
|
|
22
|
+
"@wsxjs/wsx-logger": "0.1.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"eslint": "^9.31.0",
|
|
30
30
|
"jsdom": "^26.0.0",
|
|
31
31
|
"typescript": "^5.0.0",
|
|
32
|
-
"vite": "^
|
|
32
|
+
"vite": "^7.3.1",
|
|
33
33
|
"vitest": "^2.1.8",
|
|
34
|
-
"@wsxjs/eslint-plugin-wsx": "0.1.
|
|
35
|
-
"@wsxjs/wsx-vite-plugin": "0.1.
|
|
34
|
+
"@wsxjs/eslint-plugin-wsx": "0.1.1",
|
|
35
|
+
"@wsxjs/wsx-vite-plugin": "0.1.1"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"wsx",
|
package/src/WsxLink.css
CHANGED
|
@@ -1,46 +1,56 @@
|
|
|
1
1
|
/* WSX Link 基础样式 - 使用 CSS Parts 允许宿主自定义 */
|
|
2
2
|
:host {
|
|
3
|
-
display: inline-
|
|
3
|
+
display: var(--wsx-theme-link-host-display, inline-flex);
|
|
4
|
+
align-items: var(--wsx-theme-link-host-align-items, center);
|
|
4
5
|
min-width: fit-content;
|
|
5
6
|
min-height: fit-content;
|
|
6
7
|
width: auto;
|
|
7
8
|
height: auto;
|
|
9
|
+
margin: var(--wsx-theme-btn-margin, 0);
|
|
10
|
+
vertical-align: var(--wsx-theme-btn-vertical-align, middle);
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
.wsx-link {
|
|
11
|
-
color: var(--link-color, #007bff);
|
|
12
|
-
text-decoration: var(--link-decoration, underline);
|
|
14
|
+
color: var(--wsx-theme-link-color, #007bff);
|
|
15
|
+
text-decoration: var(--wsx-theme-link-decoration, underline);
|
|
13
16
|
cursor: pointer;
|
|
14
17
|
transition: color 0.2s ease;
|
|
15
|
-
display:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
line-height: 1.
|
|
18
|
+
display: var(--wsx-theme-link-display, inline-flex);
|
|
19
|
+
align-items: var(--wsx-theme-link-align-items, center);
|
|
20
|
+
justify-content: var(--wsx-theme-link-justify-content, flex-start);
|
|
21
|
+
gap: var(--wsx-theme-link-gap, 0);
|
|
22
|
+
line-height: var(--wsx-theme-link-line-height, var(--wsx-theme-btn-line-height, 1.5));
|
|
23
|
+
font-size: var(--wsx-theme-link-font-size, inherit);
|
|
24
|
+
font-weight: var(--wsx-theme-link-font-weight, inherit);
|
|
20
25
|
/* 确保整个链接区域可点击 */
|
|
21
|
-
padding:
|
|
22
|
-
margin:
|
|
26
|
+
padding: var(--wsx-theme-link-padding, 0);
|
|
27
|
+
margin: var(--wsx-theme-link-margin, 0);
|
|
28
|
+
box-sizing: var(--wsx-theme-btn-box-sizing, border-box);
|
|
29
|
+
vertical-align: var(--wsx-theme-btn-vertical-align, middle);
|
|
30
|
+
width: auto;
|
|
31
|
+
height: auto;
|
|
32
|
+
min-width: fit-content;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
.wsx-link:hover {
|
|
26
|
-
color: var(--link-hover-color, #0056b3);
|
|
27
|
-
text-decoration: var(--link-hover-decoration, underline);
|
|
36
|
+
color: var(--wsx-theme-link-hover-color, #0056b3);
|
|
37
|
+
text-decoration: var(--wsx-theme-link-hover-decoration, underline);
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
.wsx-link:focus {
|
|
31
|
-
outline: 2px solid var(--link-focus-color, var(--focus-color, #dc2626));
|
|
41
|
+
outline: 2px solid var(--wsx-theme-link-focus-color, var(--wsx-theme-focus-color, #dc2626));
|
|
32
42
|
outline-offset: 2px;
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
/* 激活状态 */
|
|
36
46
|
.wsx-link.active {
|
|
37
|
-
color: var(--link-active-color, #6c757d);
|
|
38
|
-
font-weight: var(--link-active-weight, bold);
|
|
47
|
+
color: var(--wsx-theme-link-active-color, #6c757d);
|
|
48
|
+
font-weight: var(--wsx-theme-link-active-weight, bold);
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
/* 禁用状态 */
|
|
42
52
|
:host([disabled]) .wsx-link {
|
|
43
|
-
color: var(--link-disabled-color, #6c757d);
|
|
53
|
+
color: var(--wsx-theme-link-disabled-color, #6c757d);
|
|
44
54
|
cursor: not-allowed;
|
|
45
55
|
pointer-events: none;
|
|
46
56
|
}
|
|
@@ -55,25 +65,25 @@
|
|
|
55
65
|
|
|
56
66
|
/* 变体样式 */
|
|
57
67
|
:host([variant="button"]) .wsx-link {
|
|
58
|
-
background-color: var(--button-bg, #007bff);
|
|
59
|
-
color: var(--button-color, white);
|
|
60
|
-
padding: 0.5rem 1rem;
|
|
61
|
-
border-radius: 0.25rem;
|
|
68
|
+
background-color: var(--wsx-theme-button-bg, #007bff);
|
|
69
|
+
color: var(--wsx-theme-button-color, white);
|
|
70
|
+
padding: var(--wsx-theme-btn-padding, 0.5rem 1rem);
|
|
71
|
+
border-radius: var(--wsx-theme-btn-border-radius, 0.25rem);
|
|
62
72
|
text-decoration: none;
|
|
63
|
-
display: inline-block;
|
|
73
|
+
display: var(--wsx-theme-btn-display, inline-block);
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
:host([variant="button"]) .wsx-link:hover {
|
|
67
|
-
background-color: var(--button-hover-bg, #0056b3);
|
|
68
|
-
color: var(--button-hover-color, white);
|
|
77
|
+
background-color: var(--wsx-theme-button-hover-bg, #0056b3);
|
|
78
|
+
color: var(--wsx-theme-button-hover-color, white);
|
|
69
79
|
}
|
|
70
80
|
|
|
71
81
|
:host([variant="tab"]) .wsx-link {
|
|
72
|
-
padding: 0.5rem 1rem;
|
|
82
|
+
padding: var(--wsx-theme-btn-padding, 0.5rem 1rem);
|
|
73
83
|
border-bottom: 2px solid transparent;
|
|
74
84
|
text-decoration: none;
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
:host([variant="tab"]) .wsx-link.active {
|
|
78
|
-
border-bottom-color: var(--tab-active-border, #007bff);
|
|
88
|
+
border-bottom-color: var(--wsx-theme-tab-active-border, #007bff);
|
|
79
89
|
}
|