@varlet/cli 2.20.5-alpha.1703836585426 → 2.20.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.
- package/lib/node/config/varlet.default.config.js +29 -1
- package/package.json +15 -15
- package/site/pc/components/AppHeader.vue +17 -14
- package/template/generators/base/package.json +2 -2
- package/template/generators/base/tsconfig.json +1 -0
- package/template/generators/config/default/base/varlet.config.mjs +1 -0
- package/template/generators/config/i18n/base/varlet.config.mjs +2 -1
|
@@ -418,7 +418,35 @@ export default defineConfig({
|
|
|
418
418
|
'zh-CN': '中文',
|
|
419
419
|
'en-US': 'English',
|
|
420
420
|
},
|
|
421
|
-
|
|
421
|
+
currentVersion: 'latest',
|
|
422
|
+
versions: [
|
|
423
|
+
{
|
|
424
|
+
name: 'varlet.gitee.io',
|
|
425
|
+
items: [
|
|
426
|
+
{
|
|
427
|
+
label: 'latest',
|
|
428
|
+
link: 'https://varlet.gitee.io/varlet-ui',
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
label: 'v2.x',
|
|
432
|
+
link: 'https://varlet.gitee.io/varlet-ui/v2',
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: 'varletjs.vercel.app',
|
|
438
|
+
items: [
|
|
439
|
+
{
|
|
440
|
+
label: 'latest',
|
|
441
|
+
link: 'varlet-varletjs.vercel.app',
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
label: 'v2.x',
|
|
445
|
+
link: 'https://varlet-git-v2x-varletjs.vercel.app',
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
},
|
|
449
|
+
],
|
|
422
450
|
github: 'https://github.com/varletjs/varlet',
|
|
423
451
|
changelog: 'https://github.com/varletjs/varlet/blob/main/CHANGELOG.md',
|
|
424
452
|
playground: 'https://varlet.gitee.io/varlet-ui-playground',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@varlet/release": "^0.1.2",
|
|
38
38
|
"@babel/core": "^7.22.5",
|
|
39
39
|
"@babel/preset-typescript": "^7.22.5",
|
|
40
|
-
"@vitejs/plugin-vue": "5.0.
|
|
40
|
+
"@vitejs/plugin-vue": "5.0.1",
|
|
41
41
|
"@vitejs/plugin-vue-jsx": "3.1.0",
|
|
42
42
|
"@vue/babel-plugin-jsx": "1.1.5",
|
|
43
|
-
"@vue/compiler-sfc": "3.4.
|
|
44
|
-
"@vue/runtime-core": "3.4.
|
|
43
|
+
"@vue/compiler-sfc": "3.4.3",
|
|
44
|
+
"@vue/runtime-core": "3.4.3",
|
|
45
|
+
"vue": "3.4.3",
|
|
45
46
|
"vite": "5.0.10",
|
|
46
|
-
"vue": "3.4.0",
|
|
47
47
|
"esbuild": "0.19.3",
|
|
48
48
|
"vitest": "1.1.0",
|
|
49
49
|
"chokidar": "^3.5.2",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"slash": "^3.0.0",
|
|
65
65
|
"typescript": "^5.1.5",
|
|
66
66
|
"webfont": "11.2.26",
|
|
67
|
-
"@varlet/shared": "2.20.
|
|
68
|
-
"@varlet/vite-plugins": "2.20.
|
|
67
|
+
"@varlet/shared": "2.20.6",
|
|
68
|
+
"@varlet/vite-plugins": "2.20.6"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/babel__core": "^7.20.1",
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"@types/semver": "^7.3.9",
|
|
81
81
|
"@types/sharp": "0.31.1",
|
|
82
82
|
"rimraf": "^5.0.1",
|
|
83
|
-
"@varlet/
|
|
84
|
-
"@varlet/
|
|
85
|
-
"@varlet/
|
|
83
|
+
"@varlet/icons": "2.20.6",
|
|
84
|
+
"@varlet/ui": "2.20.6",
|
|
85
|
+
"@varlet/touch-emulator": "2.20.6"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@vue/runtime-core": "3.3
|
|
88
|
+
"@vue/runtime-core": "3.4.3",
|
|
89
89
|
"@vue/test-utils": "2.4.1",
|
|
90
90
|
"@vitest/coverage-istanbul": "1.1.0",
|
|
91
91
|
"vitest": "1.1.0",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"clipboard": "^2.0.6",
|
|
94
94
|
"live-server": "^1.2.1",
|
|
95
95
|
"lodash-es": "^4.17.21",
|
|
96
|
-
"vue": "3.3
|
|
96
|
+
"vue": "3.4.3",
|
|
97
97
|
"vue-router": "4.2.0",
|
|
98
|
-
"@varlet/
|
|
99
|
-
"@varlet/icons": "2.20.
|
|
100
|
-
"@varlet/
|
|
98
|
+
"@varlet/ui": "2.20.6",
|
|
99
|
+
"@varlet/icons": "2.20.6",
|
|
100
|
+
"@varlet/touch-emulator": "2.20.6"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"dev": "tsc --watch",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
class="varlet-site-header__versions"
|
|
11
11
|
@mouseenter="isOpenVersionsMenu = true"
|
|
12
12
|
@mouseleave="isOpenVersionsMenu = false"
|
|
13
|
-
v-if="
|
|
13
|
+
v-if="isShowVersion"
|
|
14
14
|
>
|
|
15
|
-
<span style="font-size:
|
|
15
|
+
<span style="font-size: 16px;">{{ currentVersion }}</span>
|
|
16
16
|
<var-icon name="chevron-down"/>
|
|
17
17
|
<transition name="fade">
|
|
18
18
|
<div
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
:style="{ pointerEvents: isOpenVersionsMenu ? 'auto' : 'none' }"
|
|
22
22
|
>
|
|
23
23
|
<var-cell
|
|
24
|
-
v-for="(
|
|
24
|
+
v-for="(i, key) in versionItems"
|
|
25
25
|
v-ripple
|
|
26
26
|
:key="key"
|
|
27
|
-
:class="{ 'varlet-site-header__animation-list--active': currentVersion ===
|
|
28
|
-
@click="open(
|
|
29
|
-
>
|
|
27
|
+
:class="{ 'varlet-site-header__animation-list--active': currentVersion === i.label }"
|
|
28
|
+
@click="open(i.link)"
|
|
29
|
+
>
|
|
30
|
+
{{ i.label }}
|
|
30
31
|
</var-cell>
|
|
31
32
|
</div>
|
|
32
33
|
</transition>
|
|
@@ -102,8 +103,10 @@ export default defineComponent({
|
|
|
102
103
|
const title: Ref<string> = ref(get(config, 'title'))
|
|
103
104
|
const logo: Ref<string> = ref(get(config, 'logo'))
|
|
104
105
|
const languages: Ref<Record<string, string>> = ref(get(config, 'pc.header.i18n'))
|
|
105
|
-
const currentVersion: Ref<string> = ref(get(config, 'pc.header.
|
|
106
|
-
const
|
|
106
|
+
const currentVersion: Ref<string> = ref(get(config, 'pc.header.currentVersion'))
|
|
107
|
+
const versions = get(config, 'pc.header.versions')
|
|
108
|
+
const isShowVersion: Ref<boolean> = ref(!!versions)
|
|
109
|
+
const versionItems: Ref<Array<Record<string, any>>> = ref((versions ?? []).find((i: any) => window.location.host.includes(i.name))?.items ?? versions?.[0]?.items ?? [])
|
|
107
110
|
const playground: Ref<string> = ref(get(config, 'pc.header.playground'))
|
|
108
111
|
const github: Ref<string> = ref(get(config, 'pc.header.github'))
|
|
109
112
|
const changelog: Ref<string> = ref(get(config, 'pc.header.changelog'))
|
|
@@ -115,7 +118,6 @@ export default defineComponent({
|
|
|
115
118
|
const isOpenVersionsMenu: Ref<boolean> = ref(false)
|
|
116
119
|
const router = useRouter()
|
|
117
120
|
const nonEmptyLanguages: ComputedRef<Record<string, string>> = computed(() => removeEmpty(languages.value))
|
|
118
|
-
const nonEmptyVersions: ComputedRef<Record<string, string>> = computed(() => removeEmpty(versionItems.value))
|
|
119
121
|
|
|
120
122
|
const backRoot = () => {
|
|
121
123
|
const { language: lang } = getPCLocationInfo()
|
|
@@ -144,15 +146,16 @@ export default defineComponent({
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
const notifyThemeChange = (target: 'mobile' | 'window') => {
|
|
147
|
-
const contentWindow = target === 'window' ? window : (document.getElementById(target) as HTMLIFrameElement)
|
|
149
|
+
const contentWindow = target === 'window' ? window : (document.getElementById(target) as HTMLIFrameElement | undefined)?.contentWindow
|
|
150
|
+
if (!contentWindow) {
|
|
151
|
+
return
|
|
152
|
+
}
|
|
148
153
|
|
|
149
154
|
contentWindow.postMessage(getThemeMessage(), '*')
|
|
150
155
|
}
|
|
151
156
|
|
|
152
157
|
const open = (value: string) => {
|
|
153
|
-
|
|
154
|
-
window.location.href = value
|
|
155
|
-
}, 350)
|
|
158
|
+
window.location.href = value
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
watchTheme((theme, from) => {
|
|
@@ -175,9 +178,9 @@ export default defineComponent({
|
|
|
175
178
|
title,
|
|
176
179
|
currentVersion,
|
|
177
180
|
languages,
|
|
181
|
+
isShowVersion,
|
|
178
182
|
versionItems,
|
|
179
183
|
nonEmptyLanguages,
|
|
180
|
-
nonEmptyVersions,
|
|
181
184
|
playground,
|
|
182
185
|
changelog,
|
|
183
186
|
github,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@varlet/shared": "workspace:*",
|
|
45
45
|
"@varlet/ui": "workspace:*",
|
|
46
46
|
"@vue/test-utils": "2.4.1",
|
|
47
|
-
"@vue/runtime-core": "3.4.
|
|
47
|
+
"@vue/runtime-core": "3.4.3",
|
|
48
48
|
"@vitest/coverage-istanbul": "1.1.0",
|
|
49
49
|
"jsdom": "22.1.0",
|
|
50
50
|
"vitest": "1.1.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"prettier": "^2.8.8",
|
|
57
57
|
"simple-git-hooks": "^2.8.0",
|
|
58
58
|
"typescript": "^5.1.5",
|
|
59
|
-
"vue": "3.4.
|
|
59
|
+
"vue": "3.4.3",
|
|
60
60
|
"vue-router": "4.2.0"
|
|
61
61
|
},
|
|
62
62
|
"lint-staged": {
|