@varlet/cli 1.27.16 → 1.27.18

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.
@@ -15,6 +15,12 @@
15
15
  "UI"
16
16
  ],
17
17
  "license": "MIT",
18
+ "sideEffects": [
19
+ "es/**/style/*",
20
+ "lib/**/style/*",
21
+ "*.css",
22
+ "*.less"
23
+ ],
18
24
  "scripts": {
19
25
  "preinstall": "npx only-allow pnpm",
20
26
  "dev": "varlet-cli dev",
@@ -38,6 +44,7 @@
38
44
  "@varlet/icons": "workspace:*",
39
45
  "@varlet/stylelint-config": "workspace:*",
40
46
  "@varlet/touch-emulator": "workspace:*",
47
+ "@varlet/shared": "workspace:*",
41
48
  "@vue/test-utils": "2.0.0-rc.6",
42
49
  "clipboard": "^2.0.6",
43
50
  "eslint": "^7.30.0",
@@ -15,6 +15,12 @@
15
15
  "UI"
16
16
  ],
17
17
  "license": "MIT",
18
+ "sideEffects": [
19
+ "es/**/style/*",
20
+ "lib/**/style/*",
21
+ "*.css",
22
+ "*.less"
23
+ ],
18
24
  "scripts": {
19
25
  "preinstall": "npx only-allow pnpm",
20
26
  "dev": "varlet-cli dev",
@@ -38,6 +44,7 @@
38
44
  "@varlet/icons": "workspace:*",
39
45
  "@varlet/stylelint-config": "workspace:*",
40
46
  "@varlet/touch-emulator": "workspace:*",
47
+ "@varlet/shared": "workspace:*",
41
48
  "@vue/test-utils": "2.0.0-rc.6",
42
49
  "clipboard": "^2.0.6",
43
50
  "eslint": "^7.30.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.27.16",
3
+ "version": "1.27.18",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -28,10 +28,10 @@
28
28
  "url": "https://github.com/varletjs/varlet/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@varlet/icons": "1.27.16",
32
- "@varlet/shared": "1.27.16",
33
- "@varlet/markdown-vite-plugin": "1.27.16",
34
- "@varlet/touch-emulator": "1.27.16",
31
+ "@varlet/icons": "1.27.18",
32
+ "@varlet/shared": "1.27.18",
33
+ "@varlet/markdown-vite-plugin": "1.27.18",
34
+ "@varlet/touch-emulator": "1.27.18",
35
35
  "@babel/core": "^7.14.8",
36
36
  "@babel/helper-plugin-utils": "^7.14.5",
37
37
  "@babel/preset-env": "^7.14.8",
@@ -60,7 +60,7 @@
60
60
  "slash": "^3.0.0",
61
61
  "ts-jest": "^26.5.1",
62
62
  "typescript": "^4.4.4",
63
- "vite": "2.9.5",
63
+ "vite": "2.9.14",
64
64
  "vite-plugin-html": "^2.1.0",
65
65
  "vue": "3.2.25",
66
66
  "vue-jest": "^5.0.0-alpha.8"
@@ -76,7 +76,7 @@
76
76
  "@types/semver": "^7.3.9"
77
77
  },
78
78
  "peerDependencies": {
79
- "@varlet/touch-emulator": "1.27.16",
79
+ "@varlet/touch-emulator": "1.27.18",
80
80
  "@vue/test-utils": "^2.0.0-rc.6",
81
81
  "clipboard": "^2.0.6",
82
82
  "live-server": "^1.2.1",
@@ -4,6 +4,7 @@
4
4
  height: 100vh;
5
5
  box-sizing: border-box;
6
6
  min-width: 1200px;
7
+ min-height: 460px;
7
8
  background: var(--site-config-color-home-page-background);
8
9
  overflow: hidden;
9
10
  display: flex;
@@ -120,11 +121,6 @@
120
121
  width: 35vw;
121
122
  min-width: 500px;
122
123
 
123
- .description-container {
124
- display: flex;
125
- margin-bottom: 35px;
126
- }
127
-
128
124
  .logo-container {
129
125
  margin-right: 20px;
130
126
  }
@@ -165,30 +161,71 @@
165
161
  margin-left: 10px;
166
162
  }
167
163
 
168
- .base-title {
169
- font-size: 84px;
170
- line-height: 72px;
171
- font-weight: 500;
172
- margin-top: 8px;
173
- animation: fade-in .75s forwards;
164
+ @media all and (max-width: 2560px) {
165
+ .description-container {
166
+ display: flex;
167
+ margin-bottom: 40px;
168
+ }
169
+
170
+ .base-title {
171
+ font-size: 110px;
172
+ line-height: 72px;
173
+ font-weight: 500;
174
+ margin-top: 21px;
175
+ animation: fade-in .75s forwards;
176
+ }
177
+
178
+ .base-description {
179
+ font-size: 20px;
180
+ line-height: 38px;
181
+ padding-left: 4px;
182
+ font-weight: 500;
183
+ margin-bottom: 43px;
184
+ letter-spacing: 1px;
185
+ animation: fade-in .75s forwards;
186
+ }
187
+
188
+ .logo-box {
189
+ width: 120px;
190
+ height: 120px;
191
+ flex-shrink: 0;
192
+ margin-right: 30px;
193
+ z-index: 2;
194
+ }
174
195
  }
175
196
 
176
- .base-description {
177
- font-size: 16px;
178
- line-height: 28px;
179
- padding-left: 4px;
180
- font-weight: 500;
181
- margin-bottom: 45px;
182
- letter-spacing: 1px;
183
- animation: fade-in .75s forwards;
184
- }
185
-
186
- .logo {
187
- width: 90px;
188
- height: 90px;
189
- flex-shrink: 0;
190
- margin-right: 25px;
191
- z-index: 2;
197
+ @media all and (max-width: 1920px) {
198
+
199
+ .description-container {
200
+ display: flex;
201
+ margin-bottom: 35px;
202
+ }
203
+
204
+ .base-title {
205
+ font-size: 84px;
206
+ line-height: 72px;
207
+ font-weight: 500;
208
+ margin-top: 8px;
209
+ animation: fade-in .75s forwards;
210
+ }
211
+
212
+ .base-description {
213
+ font-size: 16px;
214
+ line-height: 28px;
215
+ padding-left: 4px;
216
+ font-weight: 500;
217
+ margin-bottom: 45px;
218
+ letter-spacing: 1px;
219
+ animation: fade-in .75s forwards;
220
+ }
221
+
222
+ .logo-box {
223
+ width: 90px;
224
+ height: 90px;
225
+ flex-shrink: 0;
226
+ margin-right: 25px;
227
+ z-index: 2;
228
+ }
192
229
  }
193
230
  }
194
- }
231
+ }
@@ -4,19 +4,19 @@ import config from '@config'
4
4
  import VarSiteButton from '../../../components/button'
5
5
  import VarSiteIcon from '../../../components/icon'
6
6
  import { get } from 'lodash-es'
7
- import { ref, watch } from 'vue'
7
+ import { ref, watch, computed } from 'vue'
8
8
  import { useRoute, useRouter } from 'vue-router'
9
9
  import { getBrowserThemes, setThemes } from '../../../utils'
10
10
  import { getPCLocationInfo, watchThemes } from '@varlet/cli/site/utils'
11
11
  import en_US from './locale/en-US'
12
12
  import zh_CN from './locale/zh-CN'
13
- import type { Ref } from 'vue'
13
+ import type { Ref, ComputedRef } from 'vue'
14
14
 
15
15
  const route = useRoute()
16
16
  const router = useRouter()
17
17
  const packs = {
18
18
  'zh-CN': zh_CN,
19
- 'en-US': en_US
19
+ 'en-US': en_US,
20
20
  } as any
21
21
 
22
22
  const github = get(config, 'pc.header.github')
@@ -24,16 +24,28 @@ const themesKey = get(config, 'themesKey')
24
24
  const currentThemes = ref(getBrowserThemes(themesKey))
25
25
  const darkMode: Ref<boolean> = ref(get(config, 'pc.header.darkMode'))
26
26
  const title: Ref<string> = ref(get(config, 'title'))
27
+ const language: Ref<string> = ref(get(config, 'defaultLanguage'))
27
28
  const languages: Ref<Record<string, string>> = ref(get(config, 'pc.header.i18n'))
28
29
  const pack: Ref<Record<string, string>> = ref({})
29
30
 
31
+ const description: ComputedRef<string> = computed(() => {
32
+ const { indexPage = {} } = get(config, 'pc')
33
+
34
+ return indexPage?.description?.[language.value] || pack.value.description
35
+ })
36
+
37
+ const started: ComputedRef<string> = computed(() => {
38
+ const { indexPage = {} } = get(config, 'pc')
39
+
40
+ return indexPage?.started?.[language.value] || pack.value.started
41
+ })
42
+
30
43
  const goGithub = () => {
31
44
  window.open(github)
32
45
  }
33
46
 
34
47
  const getStar = () => {
35
- const { language: lang } = getPCLocationInfo()
36
- router.push(`/${lang}/home`)
48
+ router.push(`/${language.value}/home`)
37
49
  }
38
50
 
39
51
  const getThemesMessage = () => ({ action: 'themesChange', from: 'pc', data: currentThemes.value })
@@ -54,6 +66,7 @@ const setLocale = () => {
54
66
  const { language: lang } = getPCLocationInfo()
55
67
  if (!lang) return
56
68
 
69
+ language.value = lang
57
70
  pack.value = packs[lang]
58
71
  document.title = get(config, 'pc.title')[lang] as string
59
72
  }
@@ -63,6 +76,8 @@ const toggleLanguages = () => {
63
76
 
64
77
  const { menuName } = getPCLocationInfo()
65
78
  const replaceStr = `/${lang === 'zh-CN' ? 'en-US' : 'zh-CN'}/${menuName}`
79
+
80
+ language.value = lang
66
81
  router.replace(replaceStr)
67
82
  }
68
83
 
@@ -87,16 +102,16 @@ watch(() => route.path, setLocale, { immediate: true })
87
102
  <div class="profile-container">
88
103
  <div class="container-box">
89
104
  <div class="description-container">
90
- <animation-box class="logo" />
105
+ <animation-box class="logo-box" />
91
106
  <div class="base-title">{{ title }}</div>
92
107
  </div>
93
- <div class="base-description">{{ pack.description }}</div>
108
+ <div class="base-description">{{ description }}</div>
94
109
 
95
110
  <div class="button-group">
96
111
  <var-site-button class="common-button github-button" block @click="goGithub">
97
112
  <div class="block-button-content">
98
113
  <span>GITHUB</span>
99
- <var-site-icon style="margin-left: 10px;" name="github" size="24px" />
114
+ <var-site-icon style="margin-left: 10px" name="github" size="24px" />
100
115
  </div>
101
116
  </var-site-button>
102
117
  <var-site-button class="common-button extra-button margin-left" text v-if="darkMode" @click="toggleTheme">
@@ -107,11 +122,16 @@ watch(() => route.path, setLocale, { immediate: true })
107
122
  <div class="button-group">
108
123
  <var-site-button type="primary" class="common-button primary-button" block @click="getStar">
109
124
  <div class="block-button-content">
110
- <span>{{ pack.started }}</span>
125
+ <span>{{ started }}</span>
111
126
  <var-site-icon style="margin-left: 10px; transform: rotate(-90deg)" name="arrow-down" size="24px" />
112
127
  </div>
113
128
  </var-site-button>
114
- <var-site-button class="common-button extra-button margin-left" text v-if="languages" @click="toggleLanguages">
129
+ <var-site-button
130
+ class="common-button extra-button margin-left"
131
+ text
132
+ v-if="languages"
133
+ @click="toggleLanguages"
134
+ >
115
135
  <var-site-icon name="translate" size="24px" />
116
136
  </var-site-button>
117
137
  </div>
@@ -121,5 +141,5 @@ watch(() => route.path, setLocale, { immediate: true })
121
141
  </template>
122
142
 
123
143
  <style lang="less" scoped>
124
- @import "./index";
144
+ @import './index';
125
145
  </style>