@varlet/cli 1.26.1-alpha.1644652196468 → 1.26.3

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.
@@ -65,6 +65,7 @@ function getBuildConfig(varletConfig) {
65
65
  outDir: constant_1.SITE_OUTPUT_PATH,
66
66
  brotliSize: false,
67
67
  emptyOutDir: true,
68
+ cssTarget: 'chrome61',
68
69
  rollupOptions: {
69
70
  input: {
70
71
  main: (0, path_1.resolve)(constant_1.SITE_DIR, 'index.html'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.26.1-alpha.1644652196468",
3
+ "version": "1.26.3",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -33,9 +33,9 @@
33
33
  "@babel/helper-plugin-utils": "^7.14.5",
34
34
  "@babel/preset-env": "^7.14.8",
35
35
  "@babel/preset-typescript": "^7.14.5",
36
- "@varlet/icons": "1.26.1-alpha.1644652196468",
37
- "@varlet/markdown-vite-plugin": "1.26.1-alpha.1644652196468",
38
- "@varlet/touch-emulator": "1.26.1-alpha.1644652196468",
36
+ "@varlet/icons": "1.26.3",
37
+ "@varlet/markdown-vite-plugin": "1.26.3",
38
+ "@varlet/touch-emulator": "1.26.3",
39
39
  "@vitejs/plugin-vue": "2.2.0",
40
40
  "@vitejs/plugin-vue-jsx": "1.3.5",
41
41
  "@vue/babel-plugin-jsx": "1.1.1",
@@ -75,7 +75,7 @@
75
75
  "@types/semver": "^7.3.9"
76
76
  },
77
77
  "peerDependencies": {
78
- "@varlet/touch-emulator": "1.26.1-alpha.1644652196468",
78
+ "@varlet/touch-emulator": "1.26.3",
79
79
  "@vue/test-utils": "^2.0.0-rc.6",
80
80
  "clipboard": "^2.0.6",
81
81
  "live-server": "^1.2.1",
@@ -57,6 +57,7 @@ export default defineComponent({
57
57
  const disabledFold: Ref<boolean> = ref(false)
58
58
  const clipboard: Ref = ref(get(config, 'pc.clipboard', {}))
59
59
  const height: Ref<number> = ref(-1)
60
+ let timer: any = null
60
61
 
61
62
  const toggle = async () => {
62
63
  const foldHeight = fold.value.foldHeight
@@ -68,7 +69,15 @@ export default defineComponent({
68
69
  height.value = foldHeight
69
70
  await doubleRaf()
70
71
  height.value = offsetHeight
72
+
73
+ timer = setTimeout(() => {
74
+ height.value = -1
75
+ }, 250)
71
76
  } else {
77
+ clearTimeout(timer)
78
+ const { offsetHeight } = code.value as HTMLElement
79
+ height.value = offsetHeight
80
+ await doubleRaf()
72
81
  height.value = foldHeight
73
82
  }
74
83
  }
@@ -82,7 +91,7 @@ export default defineComponent({
82
91
 
83
92
  const { offsetHeight } = code.value as HTMLElement
84
93
  disabledFold.value = offsetHeight - fold.value.foldHeight < offset
85
- height.value = fold.value?.defaultFold ? fold.value?.foldHeight : offsetHeight
94
+ height.value = fold.value?.defaultFold ? fold.value?.foldHeight : -1
86
95
  })
87
96
 
88
97
  return {
@@ -1,6 +1,16 @@
1
1
  .var-site-code-example {
2
- margin-top: 12px;
2
+ margin-top: 16px;
3
+ margin-bottom: 4px;
3
4
  position: relative;
5
+ border: thin solid var(--site-config-color-hl-border);
6
+ border-radius: 4px;
7
+ transition: border .25s;
8
+
9
+ &:hover {
10
+ .var-site-code-example__toolbar {
11
+ opacity: 1;
12
+ }
13
+ }
4
14
 
5
15
  &__toolbar {
6
16
  display: flex;
@@ -8,10 +18,12 @@
8
18
  position: absolute;
9
19
  z-index: 1;
10
20
  right: 10px;
11
- top: 20px;
21
+ top: 10px;
22
+ opacity: 0;
23
+ transition: .25s all;
12
24
 
13
25
  button {
14
- color: white !important;
26
+ color: var(--site-config-color-hl-code) !important;
15
27
  }
16
28
  }
17
29
 
@@ -1,6 +1,4 @@
1
- // @ts-ignore
2
1
  import routes from '@mobile-routes'
3
- // @ts-ignore
4
2
  import config from '@config'
5
3
  import App from './App.vue'
6
4
  import '@varlet/touch-emulator'
package/site/pc/App.vue CHANGED
@@ -129,9 +129,49 @@ export default defineComponent({
129
129
 
130
130
  <style>
131
131
  .hljs {
132
- background: #202020 !important;
132
+ background: var(--site-config-color-hl-background) !important;
133
133
  padding: 0 !important;
134
- border-radius: 4px;
134
+ transition: all .25s
135
+ }
136
+
137
+ .hljs code {
138
+ line-height: 31px;
139
+ }
140
+
141
+ .hljs-comment, .hljs-meta, .hljs-quote {
142
+ color: var(--site-config-color-hl-group-a)
143
+ }
144
+
145
+ .hljs-keyword, .hljs-name, .hljs-selector-tag, .hljs-tag {
146
+ color: var(--site-config-color-hl-group-b)
147
+ }
148
+
149
+ .hljs-attribute, .hljs-selector-id {
150
+ color: var(--site-config-color-hl-group-c)
151
+ }
152
+
153
+ .hljs-addition, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-string {
154
+ color: var(--site-config-color-hl-group-d)
155
+ }
156
+
157
+ .hljs-subst {
158
+ color: var(--site-config-color-hl-group-e)
159
+ }
160
+
161
+ .hljs-link, .hljs-regexp {
162
+ color: var(--site-config-color-hl-group-f)
163
+ }
164
+
165
+ .hljs-doctag, .hljs-section, .hljs-title, .hljs-type {
166
+ color: var(--site-config-color-hl-group-g)
167
+ }
168
+
169
+ .hljs-bullet, .hljs-literal, .hljs-symbol, .hljs-template-variable, .hljs-variable {
170
+ color: var(--site-config-color-hl-group-h)
171
+ }
172
+
173
+ .hljs-deletion, .hljs-number {
174
+ color: var(--site-config-color-hl-group-i)
135
175
  }
136
176
  </style>
137
177
 
@@ -139,7 +179,7 @@ export default defineComponent({
139
179
  @doc-active: {
140
180
  display: inline;
141
181
  font-family: inherit;
142
- padding: 0 4px;
182
+ padding: 0;
143
183
  white-space: pre-wrap;
144
184
  }
145
185
 
@@ -174,7 +214,7 @@ iframe {
174
214
  display: flex;
175
215
  flex-direction: column;
176
216
  align-items: center;
177
- margin: 20px 4px 20px;
217
+ margin: 20px 0;
178
218
  padding: 90px 40px;
179
219
  border-top: 6px solid var(--site-config-color-introduce-border);
180
220
  border-radius: 2px;
@@ -267,25 +307,30 @@ iframe {
267
307
  }
268
308
 
269
309
  h3 {
270
- margin-bottom: 16px;
271
310
  font-size: 18px;
311
+ margin: 0;
312
+ }
313
+
314
+ h4 {
315
+ margin: 18px 0 0;
272
316
  }
273
317
 
274
318
  p,
275
- ul {
319
+ ul,
320
+ ol {
276
321
  -webkit-font-smoothing: antialiased;
277
322
  color: var(--site-config-color-text);
278
323
  font-size: 15px;
279
324
  line-height: 26px;
280
- padding: 16px;
281
325
  border-radius: 4px;
282
326
  background: var(--site-config-color-bar);
283
- box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
284
327
  list-style: none;
328
+ margin: 14px 0 0;
329
+ padding: 0;
285
330
  }
286
331
 
287
332
  pre {
288
- margin: 10px 0 0;
333
+ margin: 0;
289
334
  }
290
335
 
291
336
  code {
@@ -295,10 +340,9 @@ iframe {
295
340
  overflow-x: auto;
296
341
  font-size: 13px;
297
342
  font-family: Consolas, Monaco, monospace;
298
- line-height: 31px;
299
343
  white-space: pre-wrap;
300
344
  word-wrap: break-word;
301
- color: #fff;
345
+ color: var(--site-config-color-hl-code);
302
346
  }
303
347
 
304
348
  p code,
@@ -321,7 +365,6 @@ iframe {
321
365
  line-height: 28px;
322
366
  border-collapse: collapse;
323
367
  border-radius: 4px;
324
- box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
325
368
 
326
369
  th {
327
370
  padding: 8px 16px;
@@ -330,11 +373,12 @@ iframe {
330
373
  color: var(--site-config-color-sub-text);
331
374
  font-size: 13px;
332
375
  -webkit-font-smoothing: antialiased;
376
+ border-bottom: 1px solid var(--site-config-color-border);
333
377
  }
334
378
 
335
379
  td {
336
380
  padding: 8px 16px;
337
- border-top: 1px solid var(--site-config-color-border);
381
+ border-bottom: 1px solid var(--site-config-color-border);
338
382
  color: var(--site-config-color-text);
339
383
  font-family: Consolas, Monaco, monospace;
340
384
 
@@ -355,7 +399,11 @@ iframe {
355
399
  }
356
400
 
357
401
  .card {
358
- margin-bottom: 24px;
402
+ border-radius: 4px;
403
+ background: var(--site-config-color-bar);
404
+ padding: 20px;
405
+ margin-bottom: 30px;
406
+ box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
359
407
  }
360
408
  }
361
409
  }
@@ -1,8 +1,6 @@
1
1
  import Progress from './components/progress'
2
2
  import { reactive } from 'vue'
3
- // @ts-ignore
4
3
  import config from '@config'
5
- // @ts-ignore
6
4
  import { getBrowserThemes, mountInstance, watchThemes } from './utils'
7
5
  import { get } from 'lodash-es'
8
6
 
@@ -39,7 +39,7 @@ module.exports = {
39
39
  },
40
40
  fold: {
41
41
  defaultFold: false,
42
- foldHeight: 60,
42
+ foldHeight: 50,
43
43
  },
44
44
  },
45
45
  mobile: {
@@ -80,6 +80,18 @@ module.exports = {
80
80
  'color-pc-language-active-background': '#edf5ff',
81
81
  'color-mobile-language-active': '#3a7afe',
82
82
  'color-mobile-language-active-background': '#edf5ff',
83
+ 'color-hl-background': '#fafafa',
84
+ 'color-hl-code': '#58727e',
85
+ 'color-hl-border': '#f3f3f3',
86
+ 'color-hl-group-a': '#7c7c7c',
87
+ 'color-hl-group-b': '#2196f3',
88
+ 'color-hl-group-c': '#ff9422',
89
+ 'color-hl-group-d': '#58c193',
90
+ 'color-hl-group-e': '#ff9422',
91
+ 'color-hl-group-f': '#ff9422',
92
+ 'color-hl-group-g': '#ff9422',
93
+ 'color-hl-group-h': '#06a6e9',
94
+ 'color-hl-group-i': '#f23733',
83
95
  },
84
96
  darkThemes: {
85
97
  'color-body': '#121212',
@@ -90,9 +102,9 @@ module.exports = {
90
102
  'color-border': '#333',
91
103
  'color-shadow': '#121212',
92
104
  'color-introduce-border': '#555',
93
- 'color-primary': '#5580f8',
94
- 'color-link': '#10c48f',
95
- 'color-type': '#10c48f',
105
+ 'color-primary': '#96cbfe',
106
+ 'color-link': '#A8FFC4',
107
+ 'color-type': '#A8FFC4',
96
108
  'color-progress': '#5580f8',
97
109
  'color-progress-track': '#202020',
98
110
  'color-side-bar': '#4a7afe',
@@ -104,5 +116,17 @@ module.exports = {
104
116
  'color-pc-language-active-background': '#4a7afe20',
105
117
  'color-mobile-language-active': '#4a7afe',
106
118
  'color-mobile-language-active-background': '#4a7afe20',
119
+ 'color-hl-background': '#272727',
120
+ 'color-hl-code': '#fff',
121
+ 'color-hl-border': '#272727',
122
+ 'color-hl-group-a': '#7c7c7c',
123
+ 'color-hl-group-b': '#96cbfe',
124
+ 'color-hl-group-c': '#ff7b1e',
125
+ 'color-hl-group-d': '#A8FFC4',
126
+ 'color-hl-group-e': '#ff7b1e',
127
+ 'color-hl-group-f': '#ff7b1e',
128
+ 'color-hl-group-g': '#ff7b1e',
129
+ 'color-hl-group-h': '#14a6e9',
130
+ 'color-hl-group-i': '#ed4648',
107
131
  },
108
132
  }