From b460a3fd7a70a1f8e74e1c7280af97438567d803 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:25:22 +0800 Subject: [PATCH 1/7] feat(cli): add Open Sans font --- packages/vant-cli/site/common/style/base.less | 7 +- packages/vant-cli/site/common/style/font.less | 153 ++++++++++++++++++ packages/vant-cli/site/desktop/App.vue | 1 - .../site/desktop/components/Header.vue | 1 - 4 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 packages/vant-cli/site/common/style/font.less diff --git a/packages/vant-cli/site/common/style/base.less b/packages/vant-cli/site/common/style/base.less index 86c418300..dec735122 100644 --- a/packages/vant-cli/site/common/style/base.less +++ b/packages/vant-cli/site/common/style/base.less @@ -1,4 +1,5 @@ @import './var'; +@import './font.less'; body { min-width: 1100px; @@ -6,9 +7,9 @@ body { overflow-x: auto; color: @van-doc-black; font-size: 16px; - font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, - Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', - 'Microsoft Yahei', sans-serif; + font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', + Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', + 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif; background-color: @van-doc-background-color; -webkit-font-smoothing: antialiased; } diff --git a/packages/vant-cli/site/common/style/font.less b/packages/vant-cli/site/common/style/font.less new file mode 100644 index 000000000..20b6e4b08 --- /dev/null +++ b/packages/vant-cli/site/common/style/font.less @@ -0,0 +1,153 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, + U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, + U+01AF-01B0, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2) + format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, + U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) + format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, + U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, + U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOX-hpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, + U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOVuhpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXuhpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUehpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+0370-03FF; +} + +/* vietnamese */ +@font-face { + font-weight: 600; + font-family: 'Open Sans'; + font-style: normal; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXehpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, + U+01AF-01B0, U+1EA0-1EF9, U+20AB; +} + +/* latin-ext */ +@font-face { + font-weight: 600; + font-family: 'Open Sans'; + font-style: normal; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXOhpKKSTj5PW.woff2) + format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, + U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +/* latin */ +@font-face { + font-weight: 600; + font-family: 'Open Sans'; + font-style: normal; + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), + url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) + format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, + U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, + U+FEFF, U+FFFD; +} diff --git a/packages/vant-cli/site/desktop/App.vue b/packages/vant-cli/site/desktop/App.vue index 6e7cbc46f..1c7be8ee3 100644 --- a/packages/vant-cli/site/desktop/App.vue +++ b/packages/vant-cli/site/desktop/App.vue @@ -95,7 +95,6 @@ export default { .van-doc-intro { padding-top: 20px; - font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; text-align: center; p { diff --git a/packages/vant-cli/site/desktop/components/Header.vue b/packages/vant-cli/site/desktop/components/Header.vue index 95fd21cd9..a30fc2894 100644 --- a/packages/vant-cli/site/desktop/components/Header.vue +++ b/packages/vant-cli/site/desktop/components/Header.vue @@ -178,7 +178,6 @@ export default { padding: 0 12px; color: #fff; font-size: 14px; - font-family: 'Helvetica Neue', Arial, sans-serif; line-height: 24px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.7); From d021a1c975993c39d26c32900baebf964e387abc Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:26:22 +0800 Subject: [PATCH 2/7] chore(cli): fix stylelint error --- packages/vant-cli/site/common/style/font.less | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/vant-cli/site/common/style/font.less b/packages/vant-cli/site/common/style/font.less index 20b6e4b08..9e87d5d8b 100644 --- a/packages/vant-cli/site/common/style/font.less +++ b/packages/vant-cli/site/common/style/font.less @@ -1,71 +1,77 @@ /* cyrillic-ext */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } + /* cyrillic */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2) format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { + font-weight: 400; font-family: 'Open Sans'; font-style: normal; - font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2'); @@ -73,42 +79,46 @@ U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } + /* cyrillic-ext */ @font-face { + font-weight: 600; font-family: 'Open Sans'; font-style: normal; - font-weight: 600; src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOX-hpKKSTj5PW.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } + /* cyrillic */ @font-face { + font-weight: 600; font-family: 'Open Sans'; font-style: normal; - font-weight: 600; src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOVuhpKKSTj5PW.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { + font-weight: 600; font-family: 'Open Sans'; font-style: normal; - font-weight: 600; src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXuhpKKSTj5PW.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { + font-weight: 600; font-family: 'Open Sans'; font-style: normal; - font-weight: 600; src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUehpKKSTj5PW.woff2) format('woff2'); From 025271015566284f942d59c28294d9b8bb0244c9 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:30:55 +0800 Subject: [PATCH 3/7] docs(Button): fix icon-position missing type --- src/button/README.md | 2 +- src/button/README.zh-CN.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/button/README.md b/src/button/README.md index 9080768cb..e573a878d 100644 --- a/src/button/README.md +++ b/src/button/README.md @@ -111,7 +111,7 @@ Vue.use(Button); | color | Color, support linear-gradient | _string_ | - | | icon | Left Icon | _string_ | - | | icon-prefix `v2.6.0` | Icon className prefix | _string_ | `van-icon` | -| icon-position `v2.10.7` | Icon position, can be set to `right` | `left` | +| icon-position `v2.10.7` | Icon position, can be set to `right` | _string_ | `left` | | tag | HTML Tag | _string_ | `button` | | native-type | Native Type Attribute | _string_ | `''` | | plain | Whether to be plain button | _boolean_ | `false` | diff --git a/src/button/README.zh-CN.md b/src/button/README.zh-CN.md index 672a87372..857c61e05 100644 --- a/src/button/README.zh-CN.md +++ b/src/button/README.zh-CN.md @@ -130,10 +130,10 @@ Vue.use(Button); | type | 类型,可选值为 `primary` `info` `warning` `danger` | _string_ | `default` | | size | 尺寸,可选值为 `large` `small` `mini` | _string_ | `normal` | | text | 按钮文字 | _string_ | - | -| color | 按钮颜色,支持传入`linear-gradient`渐变色 | _string_ | - | +| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | _string_ | - | | icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - | | icon-prefix `v2.6.0` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` | -| icon-position `v2.10.7` | 图标展示位置,可选值为 `right` | `left` | +| icon-position `v2.10.7` | 图标展示位置,可选值为 `right` | _string_ | `left` | | tag | 按钮根节点的 HTML 标签 | _string_ | `button` | | native-type | 原生 button 标签的 type 属性 | _string_ | - | | block | 是否为块级元素 | _boolean_ | `false` | @@ -144,7 +144,7 @@ Vue.use(Button); | hairline | 是否使用 0.5px 边框 | _boolean_ | `false` | | loading | 是否显示为加载状态 | _boolean_ | `false` | | loading-text | 加载状态提示文字 | _string_ | - | -| loading-type | [加载图标类型](#/zh-CN/loading),可选值为`spinner` | _string_ | `circular` | +| loading-type | [加载图标类型](#/zh-CN/loading),可选值为 `spinner` | _string_ | `circular` | | loading-size | 加载图标大小 | _string_ | `20px` | | url | 点击后跳转的链接地址 | _string_ | - | | to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - | From a872a070e457c6113ef490c3623b5d7dca51aec2 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:44:40 +0800 Subject: [PATCH 4/7] fix(cli): docsearch anchor not work --- .../vant-cli/site/desktop/components/SearchInput.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/vant-cli/site/desktop/components/SearchInput.vue b/packages/vant-cli/site/desktop/components/SearchInput.vue index 103f74adc..31b239873 100644 --- a/packages/vant-cli/site/desktop/components/SearchInput.vue +++ b/packages/vant-cli/site/desktop/components/SearchInput.vue @@ -29,6 +29,17 @@ export default { if (this.searchConfig) { this.docsearchInstance = window.docsearch({ ...this.searchConfig, + transformData: (hits) => { + hits.forEach((hit) => { + if (hit.anchor) { + hit.url = hit.url + '#' + hit.anchor; + hit.anchor = null; + } + }); + if (this.searchConfig.transformData) { + this.searchConfig.transformData(hits); + } + }, inputSelector: '.van-doc-search', algoliaOptions: { facetFilters: [`lang:${this.lang}`], From c77bf803cbaad1d8ac5b20adfbfcb14e907162f1 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:45:59 +0800 Subject: [PATCH 5/7] chore: add publish config --- package.json | 3 +++ packages/vant-cli/package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 76ffa36be..dba702f8e 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,9 @@ "types", "vetur" ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, "scripts": { "bootstrap": "yarn || npm i", "dev": "vant-cli dev", diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index 765e51ef2..b0d6fac94 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -11,7 +11,8 @@ "node": ">=10" }, "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://registry.npmjs.org/" }, "scripts": { "dev": "tsc --watch", From 18f550465bb4963aea072c9cb78d18d900e8d5a2 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:46:59 +0800 Subject: [PATCH 6/7] chore: release @vant/cli@2.5.5 --- packages/vant-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index b0d6fac94..08c6632dd 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -1,6 +1,6 @@ { "name": "@vant/cli", - "version": "2.5.4", + "version": "2.5.5", "description": "", "main": "lib/index.js", "typings": "lib/index.d.ts", From 9697c2881984354968664e235080af3051bd9dab Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 22:53:16 +0800 Subject: [PATCH 7/7] docs(cli): chagelog 2.5.5 --- package.json | 2 +- packages/vant-cli/changelog.md | 8 ++++++++ yarn.lock | 8 ++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index dba702f8e..8760bb0ec 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ }, "devDependencies": { "@ls-lint/ls-lint": "^1.8.0", - "@vant/cli": "^2.5.3", + "@vant/cli": "^2.5.5", "prettier": "^2.0.4", "vue": "^2.6.11", "vue-template-compiler": "^2.6.11" diff --git a/packages/vant-cli/changelog.md b/packages/vant-cli/changelog.md index 8d6ea215f..52f56347d 100644 --- a/packages/vant-cli/changelog.md +++ b/packages/vant-cli/changelog.md @@ -1,5 +1,13 @@ # 更新日志 +### v2.5.5 + +`2020-09-26` + +- 新增 Open Sas 字体 +- 修复搜索时无法跳转到对应锚点的问题 +- 修复自定义 webpack 配置时某些情况下出现配置错误的问题 + ### v2.5.4 `2020-09-22` diff --git a/yarn.lock b/yarn.lock index 2afcb559b..5cd687e4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2000,10 +2000,10 @@ semver "^6.3.0" tsutils "^3.17.1" -"@vant/cli@^2.5.3": - version "2.5.3" - resolved "https://registry.npm.taobao.org/@vant/cli/download/@vant/cli-2.5.3.tgz?cache=0&sync_timestamp=1600247593747&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fcli%2Fdownload%2F%40vant%2Fcli-2.5.3.tgz#4ba3bae7fe957d28f63a57348aeefa1fbf96e54c" - integrity sha1-S6O65/6VfSj2Olc0iu76H7+W5Uw= +"@vant/cli@^2.5.5": + version "2.5.5" + resolved "https://registry.npm.taobao.org/@vant/cli/download/@vant/cli-2.5.5.tgz#15b68b8684d2b4209cde092645556c2abcdd262a" + integrity sha1-FbaLhoTStCCc3gkmRVVsKrzdJio= dependencies: "@babel/core" "^7.10.1" "@babel/plugin-syntax-jsx" "^7.10.1"