@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.
@@ -418,7 +418,35 @@ export default defineConfig({
418
418
  'zh-CN': '中文',
419
419
  'en-US': 'English',
420
420
  },
421
- versions: null,
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.5-alpha.1703836585426",
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.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.0",
44
- "@vue/runtime-core": "3.4.0",
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.5-alpha.1703836585426",
68
- "@varlet/vite-plugins": "2.20.5-alpha.1703836585426"
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/touch-emulator": "2.20.5-alpha.1703836585426",
84
- "@varlet/icons": "2.20.5-alpha.1703836585426",
85
- "@varlet/ui": "2.20.5-alpha.1703836585426"
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.4",
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.4",
96
+ "vue": "3.4.3",
97
97
  "vue-router": "4.2.0",
98
- "@varlet/touch-emulator": "2.20.5-alpha.1703836585426",
99
- "@varlet/icons": "2.20.5-alpha.1703836585426",
100
- "@varlet/ui": "2.20.5-alpha.1703836585426"
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="nonEmptyVersions && Object.keys(nonEmptyVersions).length"
13
+ v-if="isShowVersion"
14
14
  >
15
- <span style="font-size: 14px;">{{ currentVersion }}</span>
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="(value, key) in nonEmptyVersions"
24
+ v-for="(i, key) in versionItems"
25
25
  v-ripple
26
26
  :key="key"
27
- :class="{ 'varlet-site-header__animation-list--active': currentVersion === key }"
28
- @click="open(value)"
29
- >{{ key }}
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.version.current'))
106
- const versionItems: Ref<Record<string, string>> = ref(get(config, 'pc.header.version.items'))
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).contentWindow!
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
- setTimeout(() => {
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.0",
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.0",
59
+ "vue": "3.4.3",
60
60
  "vue-router": "4.2.0"
61
61
  },
62
62
  "lint-staged": {
@@ -8,6 +8,7 @@
8
8
  "allowJs": true,
9
9
  "lib": ["esnext", "dom"],
10
10
  "allowSyntheticDefaultImports": true,
11
+ "jsxImportSource": "vue",
11
12
  "jsx": "preserve",
12
13
  "types": ["vitest/globals"]
13
14
  },
@@ -8,6 +8,7 @@ export default defineConfig({
8
8
  darkMode: null,
9
9
  i18n: null,
10
10
  playground: null,
11
+ versions: null
11
12
  },
12
13
  menu: [
13
14
  {
@@ -7,12 +7,13 @@ export default defineConfig({
7
7
  header: {
8
8
  darkMode: null,
9
9
  playground: null,
10
+ versions: null
10
11
  },
11
12
  menu: [
12
13
  {
13
14
  text: {
14
15
  'zh-CN': '开发指南',
15
- 'en-US': 'Developer guide',
16
+ 'en-US': 'Developer Guide',
16
17
  },
17
18
  type: 1,
18
19
  },