@varlet/cli 1.27.7 → 1.27.9-alpha.1653036733481

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.
Files changed (31) hide show
  1. package/generators/base/varlet.config.js +2 -0
  2. package/lib/commands/create.js +1 -1
  3. package/lib/compiler/compileSiteEntry.d.ts +3 -0
  4. package/lib/compiler/compileSiteEntry.js +86 -9
  5. package/lib/shared/constant.d.ts +4 -2
  6. package/lib/shared/constant.js +5 -3
  7. package/package.json +6 -5
  8. package/site/components/button/Button.vue +1 -1
  9. package/site/index.html +8 -0
  10. package/site/mobile/App.vue +32 -7
  11. package/site/mobile/components/AppHome.vue +17 -13
  12. package/site/{components → mobile/components}/app-bar/AppBar.vue +0 -0
  13. package/site/{components → mobile/components}/app-bar/appBar.less +0 -0
  14. package/site/{components → mobile/components}/app-bar/index.ts +0 -0
  15. package/site/{components → mobile/components}/app-bar/props.ts +0 -0
  16. package/site/mobile/components/styles/common.less +64 -0
  17. package/site/mobile/components/styles/elevation.less +126 -0
  18. package/site/mobile/components/styles/var.less +27 -0
  19. package/site/mobile/main.ts +1 -1
  20. package/site/pc/App.vue +14 -376
  21. package/site/pc/Layout.vue +397 -0
  22. package/site/pc/components/AnimationBox.vue +39 -0
  23. package/site/pc/components/AppHeader.vue +94 -36
  24. package/site/pc/components/AppSidebar.vue +2 -2
  25. package/site/pc/components/LogoAnimation.vue +119 -0
  26. package/site/pc/floating.ts +9 -0
  27. package/site/pc/pages/index/index.less +193 -0
  28. package/site/pc/pages/index/index.vue +125 -0
  29. package/site/pc/pages/index/locale/en-US.ts +5 -0
  30. package/site/pc/pages/index/locale/zh-CN.ts +5 -0
  31. package/varlet.default.config.js +16 -3
@@ -61,6 +61,8 @@ module.exports = {
61
61
  'zh-CN': '一个组件库',
62
62
  },
63
63
  header: {
64
+ darkMode: null,
65
+ versions: null,
64
66
  i18n: null,
65
67
  playground: null,
66
68
  github: 'https://github.com/varletjs/varlet',
@@ -64,7 +64,7 @@ function create(name) {
64
64
  componentDir = (0, path_1.resolve)(constant_1.SRC_DIR, name);
65
65
  testsDir = (0, path_1.resolve)(constant_1.SRC_DIR, name, constant_1.TESTS_DIR_NAME);
66
66
  exampleDir = (0, path_1.resolve)(constant_1.SRC_DIR, name, constant_1.EXAMPLE_DIR_NAME);
67
- exampleLocalDir = (0, path_1.resolve)(constant_1.SRC_DIR, name, constant_1.EXAMPLE_DIR_NAME, constant_1.EXAMPLE_LOCALE_DIR_NAME);
67
+ exampleLocalDir = (0, path_1.resolve)(constant_1.SRC_DIR, name, constant_1.EXAMPLE_DIR_NAME, constant_1.LOCALE_DIR_NAME);
68
68
  docsDir = (0, path_1.resolve)(constant_1.SRC_DIR, name, constant_1.DOCS_DIR_NAME);
69
69
  if ((0, fs_extra_1.pathExistsSync)(componentDir)) {
70
70
  logger_1.default.error('component directory is existed');
@@ -1,9 +1,12 @@
1
1
  export declare function getExampleRoutePath(examplePath: string): string;
2
2
  export declare function getComponentDocRoutePath(componentDocsPath: string): string;
3
3
  export declare function getRootDocRoutePath(rootDocsPath: string): string;
4
+ export declare function getRootRoutePath(rootLocalePath: string): string;
5
+ export declare function getRootFilePath(rootLocalePath: string): string;
4
6
  export declare function findExamples(): Promise<string[]>;
5
7
  export declare function findComponentDocs(): Promise<string[]>;
6
8
  export declare function findRootDocs(): Promise<string[]>;
9
+ export declare function findRootLocales(): Promise<string[]>;
7
10
  export declare function buildMobileSiteRoutes(): Promise<void>;
8
11
  export declare function buildPcSiteRoutes(): Promise<void>;
9
12
  export declare function buildSiteSource(): Promise<void>;
@@ -60,15 +60,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
60
60
  }
61
61
  return to.concat(ar || Array.prototype.slice.call(from));
62
62
  };
63
+ var __importDefault = (this && this.__importDefault) || function (mod) {
64
+ return (mod && mod.__esModule) ? mod : { "default": mod };
65
+ };
63
66
  Object.defineProperty(exports, "__esModule", { value: true });
64
- exports.buildSiteEntry = exports.buildSiteSource = exports.buildPcSiteRoutes = exports.buildMobileSiteRoutes = exports.findRootDocs = exports.findComponentDocs = exports.findExamples = exports.getRootDocRoutePath = exports.getComponentDocRoutePath = exports.getExampleRoutePath = void 0;
67
+ exports.buildSiteEntry = exports.buildSiteSource = exports.buildPcSiteRoutes = exports.buildMobileSiteRoutes = exports.findRootLocales = exports.findRootDocs = exports.findComponentDocs = exports.findExamples = exports.getRootFilePath = exports.getRootRoutePath = exports.getRootDocRoutePath = exports.getComponentDocRoutePath = exports.getExampleRoutePath = void 0;
65
68
  var constant_1 = require("../shared/constant");
66
69
  var fs_extra_1 = require("fs-extra");
70
+ var slash_1 = __importDefault(require("slash"));
67
71
  var fsUtils_1 = require("../shared/fsUtils");
68
72
  var varlet_config_1 = require("../config/varlet.config");
73
+ var lodash_1 = require("lodash");
69
74
  var EXAMPLE_COMPONENT_NAME_RE = /\/([-\w]+)\/example\/index.vue/;
70
75
  var COMPONENT_DOCS_RE = /\/([-\w]+)\/docs\/([-\w]+)\.md/;
71
76
  var ROOT_DOCS_RE = /\/docs\/([-\w]+)\.([-\w]+)\.md/;
77
+ var ROOT_LOCALE_RE = /\/pages\/([-\w]+)\/locale\/([-\w]+)\.ts/;
72
78
  function getExampleRoutePath(examplePath) {
73
79
  var _a;
74
80
  return '/' + ((_a = examplePath.match(EXAMPLE_COMPONENT_NAME_RE)) === null || _a === void 0 ? void 0 : _a[1]);
@@ -86,8 +92,18 @@ function getRootDocRoutePath(rootDocsPath) {
86
92
  return "/".concat(language, "/").concat(routePath);
87
93
  }
88
94
  exports.getRootDocRoutePath = getRootDocRoutePath;
95
+ function getRootRoutePath(rootLocalePath) {
96
+ var _a;
97
+ var _b = __read((_a = rootLocalePath.match(ROOT_LOCALE_RE)) !== null && _a !== void 0 ? _a : [], 3), routePath = _b[1], language = _b[2];
98
+ return "/".concat(language, "/").concat(routePath);
99
+ }
100
+ exports.getRootRoutePath = getRootRoutePath;
101
+ function getRootFilePath(rootLocalePath) {
102
+ return rootLocalePath.replace(/locale\/.+/, constant_1.DIR_INDEX);
103
+ }
104
+ exports.getRootFilePath = getRootFilePath;
89
105
  function findExamples() {
90
- return (0, fsUtils_1.glob)("".concat(constant_1.SRC_DIR, "/**/").concat(constant_1.EXAMPLE_DIR_NAME, "/").concat(constant_1.EXAMPLE_DIR_INDEX));
106
+ return (0, fsUtils_1.glob)("".concat(constant_1.SRC_DIR, "/**/").concat(constant_1.EXAMPLE_DIR_NAME, "/").concat(constant_1.DIR_INDEX));
91
107
  }
92
108
  exports.findExamples = findExamples;
93
109
  function findComponentDocs() {
@@ -98,6 +114,61 @@ function findRootDocs() {
98
114
  return (0, fsUtils_1.glob)("".concat(constant_1.ROOT_DOCS_DIR, "/*.md"));
99
115
  }
100
116
  exports.findRootDocs = findRootDocs;
117
+ function findRootLocales() {
118
+ return __awaiter(this, void 0, void 0, function () {
119
+ var defaultLanguage, userPages, baseLocales, userLocales, filterMap;
120
+ var _this = this;
121
+ return __generator(this, function (_a) {
122
+ switch (_a.label) {
123
+ case 0:
124
+ defaultLanguage = (0, lodash_1.get)((0, varlet_config_1.getVarletConfig)(), 'defaultLanguage');
125
+ return [4 /*yield*/, (0, fsUtils_1.glob)("".concat(constant_1.ROOT_PAGES_DIR, "/*"))];
126
+ case 1:
127
+ userPages = _a.sent();
128
+ return [4 /*yield*/, (0, fsUtils_1.glob)("".concat(constant_1.SITE, "/pc/pages/**/").concat(constant_1.LOCALE_DIR_NAME, "/*.ts"))];
129
+ case 2:
130
+ baseLocales = _a.sent();
131
+ return [4 /*yield*/, userPages.reduce(function (userLocales, page) { return __awaiter(_this, void 0, void 0, function () {
132
+ var locales;
133
+ var _a;
134
+ return __generator(this, function (_b) {
135
+ switch (_b.label) {
136
+ case 0:
137
+ if (!(0, fsUtils_1.isDir)(page)) return [3 /*break*/, 3];
138
+ return [4 /*yield*/, (0, fsUtils_1.glob)("".concat(page, "/").concat(constant_1.LOCALE_DIR_NAME, "/*.ts"))];
139
+ case 1:
140
+ locales = _b.sent();
141
+ if (!locales.length)
142
+ locales.push("".concat(page, "/").concat(constant_1.LOCALE_DIR_NAME, "/").concat(defaultLanguage, ".ts"));
143
+ return [4 /*yield*/, userLocales];
144
+ case 2:
145
+ (_a = (_b.sent())).push.apply(_a, __spreadArray([], __read(locales), false));
146
+ _b.label = 3;
147
+ case 3: return [2 /*return*/, userLocales];
148
+ }
149
+ });
150
+ }); }, Promise.resolve([]))
151
+ // filter
152
+ ];
153
+ case 3:
154
+ userLocales = _a.sent();
155
+ filterMap = new Map();
156
+ baseLocales.forEach(function (locale) {
157
+ var _a;
158
+ var _b = __read((_a = locale.match(ROOT_LOCALE_RE)) !== null && _a !== void 0 ? _a : [], 3), routePath = _b[1], language = _b[2];
159
+ filterMap.set(routePath + language, (0, slash_1.default)("".concat(constant_1.SITE_PC_DIR, "/pages/").concat(routePath, "/locale/").concat(language, ".ts")));
160
+ });
161
+ userLocales.forEach(function (locale) {
162
+ var _a;
163
+ var _b = __read((_a = locale.match(ROOT_LOCALE_RE)) !== null && _a !== void 0 ? _a : [], 3), routePath = _b[1], language = _b[2];
164
+ filterMap.set(routePath + language, locale);
165
+ });
166
+ return [2 /*return*/, Promise.resolve(Array.from(filterMap.values()))];
167
+ }
168
+ });
169
+ });
170
+ }
171
+ exports.findRootLocales = findRootLocales;
101
172
  function buildMobileSiteRoutes() {
102
173
  return __awaiter(this, void 0, void 0, function () {
103
174
  var examples, routes, source;
@@ -107,7 +178,7 @@ function buildMobileSiteRoutes() {
107
178
  case 1:
108
179
  examples = _a.sent();
109
180
  routes = examples.map(function (example) { return "\n {\n path: '".concat(getExampleRoutePath(example), "',\n // @ts-ignore\n component: () => import('").concat(example, "')\n }"); });
110
- source = "export default [ ".concat(routes.join(','), "\n]");
181
+ source = "export default [ ".concat(routes.join(','), "\n]");
111
182
  return [4 /*yield*/, (0, fsUtils_1.outputFileSyncOnChange)(constant_1.SITE_MOBILE_ROUTES, source)];
112
183
  case 2:
113
184
  _a.sent();
@@ -119,15 +190,21 @@ function buildMobileSiteRoutes() {
119
190
  exports.buildMobileSiteRoutes = buildMobileSiteRoutes;
120
191
  function buildPcSiteRoutes() {
121
192
  return __awaiter(this, void 0, void 0, function () {
122
- var _a, componentDocs, rootDocs, componentDocsRoutes, rootDocsRoutes, source;
193
+ var _a, componentDocs, rootDocs, rootLocales, rootPagesRoutes, componentDocsRoutes, rootDocsRoutes, layoutRoutes, source;
123
194
  return __generator(this, function (_b) {
124
195
  switch (_b.label) {
125
- case 0: return [4 /*yield*/, Promise.all([findComponentDocs(), findRootDocs()])];
196
+ case 0: return [4 /*yield*/, Promise.all([
197
+ findComponentDocs(),
198
+ findRootDocs(),
199
+ findRootLocales(),
200
+ ])];
126
201
  case 1:
127
- _a = __read.apply(void 0, [_b.sent(), 2]), componentDocs = _a[0], rootDocs = _a[1];
128
- componentDocsRoutes = componentDocs.map(function (componentDoc) { return "\n {\n path: '".concat(getComponentDocRoutePath(componentDoc), "',\n // @ts-ignore\n component: () => import('").concat(componentDoc, "')\n }"); });
129
- rootDocsRoutes = rootDocs.map(function (rootDoc) { return "\n {\n path: '".concat(getRootDocRoutePath(rootDoc), "',\n // @ts-ignore\n component: () => import('").concat(rootDoc, "')\n }"); });
130
- source = "export default [ ".concat(__spreadArray(__spreadArray([], __read(componentDocsRoutes), false), [rootDocsRoutes], false).join(','), "\n]");
202
+ _a = __read.apply(void 0, [_b.sent(), 3]), componentDocs = _a[0], rootDocs = _a[1], rootLocales = _a[2];
203
+ rootPagesRoutes = rootLocales.map(function (rootLocale) { return "\n {\n path: '".concat(getRootRoutePath(rootLocale), "',\n // @ts-ignore\n component: () => import('").concat(getRootFilePath(rootLocale), "')\n }"); });
204
+ componentDocsRoutes = componentDocs.map(function (componentDoc) { return "\n {\n path: '".concat(getComponentDocRoutePath(componentDoc), "',\n // @ts-ignore\n component: () => import('").concat(componentDoc, "')\n }"); });
205
+ rootDocsRoutes = rootDocs.map(function (rootDoc) { return "\n {\n path: '".concat(getRootDocRoutePath(rootDoc), "',\n // @ts-ignore\n component: () => import('").concat(rootDoc, "')\n }"); });
206
+ layoutRoutes = "{\n path: '/layout',\n // @ts-ignore\n component:()=> import('".concat((0, slash_1.default)(constant_1.SITE_PC_DIR), "/Layout.vue'),\n children: [\n ").concat(__spreadArray(__spreadArray([], __read(componentDocsRoutes), false), [rootDocsRoutes], false).join(','), ",\n ]\n }");
207
+ source = "export default [ ".concat(rootPagesRoutes.join(','), ",\n ").concat(layoutRoutes, "\n]");
131
208
  (0, fsUtils_1.outputFileSyncOnChange)(constant_1.SITE_PC_ROUTES, source);
132
209
  return [2 /*return*/];
133
210
  }
@@ -6,15 +6,16 @@ export declare const LIB_DIR: string;
6
6
  export declare const UMD_DIR: string;
7
7
  export declare const TYPES_DIR: string;
8
8
  export declare const ROOT_DOCS_DIR: string;
9
+ export declare const ROOT_PAGES_DIR: string;
9
10
  export declare const ESLINT_EXTENSIONS: string[];
10
11
  export declare const VITE_RESOLVE_EXTENSIONS: string[];
11
12
  export declare const SCRIPTS_EXTENSIONS: string[];
12
13
  export declare const PUBLIC_DIR_INDEXES: string[];
13
14
  export declare const STYLE_DIR_NAME = "style";
14
15
  export declare const EXAMPLE_DIR_NAME = "example";
15
- export declare const EXAMPLE_LOCALE_DIR_NAME = "locale";
16
+ export declare const LOCALE_DIR_NAME = "locale";
16
17
  export declare const DOCS_DIR_NAME = "docs";
17
- export declare const EXAMPLE_DIR_INDEX = "index.vue";
18
+ export declare const DIR_INDEX = "index.vue";
18
19
  export declare const TESTS_DIR_NAME = "__tests__";
19
20
  export declare const GENERATORS_DIR: string;
20
21
  export declare const UI_PACKAGE_JSON: string;
@@ -23,6 +24,7 @@ export declare const SITE: string;
23
24
  export declare const SITE_OUTPUT_PATH: string;
24
25
  export declare const SITE_PUBLIC_PATH: string;
25
26
  export declare const SITE_DIR: string;
27
+ export declare const SITE_PC_DIR: string;
26
28
  export declare const SITE_PC_ROUTES: string;
27
29
  export declare const SITE_MOBILE_ROUTES: string;
28
30
  export declare const SITE_CONFIG: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JEST_STYLE_MOCK = exports.JEST_MEDIA_MOCK = exports.JEST_CONFIG = exports.HL_WEB_TYPES_JSON = exports.HL_ATTRIBUTES_JSON = exports.HL_TAGS_JSON = exports.HL_DIR = exports.HL_MD = exports.HL_TITLE_SLOTS_RE = exports.HL_TITLE_EVENTS_RE = exports.HL_TITLE_ATTRIBUTES_RE = exports.HL_API_RE = exports.HL_COMPONENT_NAME_RE = exports.SITE_CONFIG = exports.SITE_MOBILE_ROUTES = exports.SITE_PC_ROUTES = exports.SITE_DIR = exports.SITE_PUBLIC_PATH = exports.SITE_OUTPUT_PATH = exports.SITE = exports.CLI_PACKAGE_JSON = exports.UI_PACKAGE_JSON = exports.GENERATORS_DIR = exports.TESTS_DIR_NAME = exports.EXAMPLE_DIR_INDEX = exports.DOCS_DIR_NAME = exports.EXAMPLE_LOCALE_DIR_NAME = exports.EXAMPLE_DIR_NAME = exports.STYLE_DIR_NAME = exports.PUBLIC_DIR_INDEXES = exports.SCRIPTS_EXTENSIONS = exports.VITE_RESOLVE_EXTENSIONS = exports.ESLINT_EXTENSIONS = exports.ROOT_DOCS_DIR = exports.TYPES_DIR = exports.UMD_DIR = exports.LIB_DIR = exports.ES_DIR = exports.SRC_DIR = exports.VARLET_CONFIG = exports.CWD = void 0;
3
+ exports.JEST_STYLE_MOCK = exports.JEST_MEDIA_MOCK = exports.JEST_CONFIG = exports.HL_WEB_TYPES_JSON = exports.HL_ATTRIBUTES_JSON = exports.HL_TAGS_JSON = exports.HL_DIR = exports.HL_MD = exports.HL_TITLE_SLOTS_RE = exports.HL_TITLE_EVENTS_RE = exports.HL_TITLE_ATTRIBUTES_RE = exports.HL_API_RE = exports.HL_COMPONENT_NAME_RE = exports.SITE_CONFIG = exports.SITE_MOBILE_ROUTES = exports.SITE_PC_ROUTES = exports.SITE_PC_DIR = exports.SITE_DIR = exports.SITE_PUBLIC_PATH = exports.SITE_OUTPUT_PATH = exports.SITE = exports.CLI_PACKAGE_JSON = exports.UI_PACKAGE_JSON = exports.GENERATORS_DIR = exports.TESTS_DIR_NAME = exports.DIR_INDEX = exports.DOCS_DIR_NAME = exports.LOCALE_DIR_NAME = exports.EXAMPLE_DIR_NAME = exports.STYLE_DIR_NAME = exports.PUBLIC_DIR_INDEXES = exports.SCRIPTS_EXTENSIONS = exports.VITE_RESOLVE_EXTENSIONS = exports.ESLINT_EXTENSIONS = exports.ROOT_PAGES_DIR = exports.ROOT_DOCS_DIR = exports.TYPES_DIR = exports.UMD_DIR = exports.LIB_DIR = exports.ES_DIR = exports.SRC_DIR = exports.VARLET_CONFIG = exports.CWD = void 0;
4
4
  var path_1 = require("path");
5
5
  exports.CWD = process.cwd();
6
6
  exports.VARLET_CONFIG = (0, path_1.resolve)(exports.CWD, 'varlet.config.js');
@@ -10,15 +10,16 @@ exports.LIB_DIR = (0, path_1.resolve)(exports.CWD, 'lib');
10
10
  exports.UMD_DIR = (0, path_1.resolve)(exports.CWD, 'umd');
11
11
  exports.TYPES_DIR = (0, path_1.resolve)(exports.CWD, 'types');
12
12
  exports.ROOT_DOCS_DIR = (0, path_1.resolve)(exports.CWD, 'docs');
13
+ exports.ROOT_PAGES_DIR = (0, path_1.resolve)(exports.CWD, 'pages');
13
14
  exports.ESLINT_EXTENSIONS = ['.vue', '.ts', '.js', '.mjs', '.tsx', '.jsx'];
14
15
  exports.VITE_RESOLVE_EXTENSIONS = ['.vue', '.tsx', '.ts', '.jsx', '.js', '.less', '.css'];
15
16
  exports.SCRIPTS_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js'];
16
17
  exports.PUBLIC_DIR_INDEXES = ['index.vue', 'index.tsx', 'index.ts', 'index.jsx', 'index.js'];
17
18
  exports.STYLE_DIR_NAME = 'style';
18
19
  exports.EXAMPLE_DIR_NAME = 'example';
19
- exports.EXAMPLE_LOCALE_DIR_NAME = 'locale';
20
+ exports.LOCALE_DIR_NAME = 'locale';
20
21
  exports.DOCS_DIR_NAME = 'docs';
21
- exports.EXAMPLE_DIR_INDEX = 'index.vue';
22
+ exports.DIR_INDEX = 'index.vue';
22
23
  exports.TESTS_DIR_NAME = '__tests__';
23
24
  exports.GENERATORS_DIR = (0, path_1.resolve)(__dirname, '../../generators');
24
25
  exports.UI_PACKAGE_JSON = (0, path_1.resolve)(exports.CWD, 'package.json');
@@ -28,6 +29,7 @@ exports.SITE = (0, path_1.resolve)(__dirname, '../../site');
28
29
  exports.SITE_OUTPUT_PATH = (0, path_1.resolve)(exports.CWD, 'site');
29
30
  exports.SITE_PUBLIC_PATH = (0, path_1.resolve)(exports.CWD, 'public');
30
31
  exports.SITE_DIR = (0, path_1.resolve)(exports.CWD, '.varlet/site');
32
+ exports.SITE_PC_DIR = (0, path_1.resolve)(exports.CWD, '.varlet/site/pc');
31
33
  exports.SITE_PC_ROUTES = (0, path_1.resolve)(exports.CWD, '.varlet/pc.routes.ts');
32
34
  exports.SITE_MOBILE_ROUTES = (0, path_1.resolve)(exports.CWD, '.varlet/mobile.routes.ts');
33
35
  exports.SITE_CONFIG = (0, path_1.resolve)(exports.CWD, '.varlet/site.config.json');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.27.7",
3
+ "version": "1.27.9-alpha.1653036733481",
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.27.7",
37
- "@varlet/markdown-vite-plugin": "1.27.7",
38
- "@varlet/touch-emulator": "1.27.7",
36
+ "@varlet/icons": "1.27.9-alpha.1653036733481",
37
+ "@varlet/markdown-vite-plugin": "1.27.9-alpha.1653036733481",
38
+ "@varlet/touch-emulator": "1.27.9-alpha.1653036733481",
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",
@@ -68,6 +68,7 @@
68
68
  "devDependencies": {
69
69
  "@types/babel__core": "^7.1.12",
70
70
  "@types/fs-extra": "^9.0.2",
71
+ "@types/glob": "^7.1.3",
71
72
  "@types/hash-sum": "^1.0.0",
72
73
  "@types/jest": "^26.0.15",
73
74
  "@types/lodash": "^4.14.174",
@@ -75,7 +76,7 @@
75
76
  "@types/semver": "^7.3.9"
76
77
  },
77
78
  "peerDependencies": {
78
- "@varlet/touch-emulator": "1.27.7",
79
+ "@varlet/touch-emulator": "1.27.9-alpha.1653036733481",
79
80
  "@vue/test-utils": "^2.0.0-rc.6",
80
81
  "clipboard": "^2.0.6",
81
82
  "live-server": "^1.2.1",
@@ -7,7 +7,7 @@
7
7
  block ? 'var-site--flex var-site-button--block' : 'var-site--inline-flex',
8
8
  disabled ? 'var-site-button--disabled' : null,
9
9
  text ? `var-site-button--text-${type}` : `var-site-button--${type}`,
10
- text ? 'var-site-button--text' : 'var-elevation--1',
10
+ text ? 'var-site-button--text' : 'var-site-elevation--1',
11
11
  text && disabled ? 'var-site-button--text-disabled' : null,
12
12
  round ? 'var-site-button--round' : null,
13
13
  outline ? 'var-site-button--outline' : null,
package/site/index.html CHANGED
@@ -20,6 +20,14 @@
20
20
  font-style: normal;
21
21
  font-display: swap;
22
22
  }
23
+ body {
24
+ box-sizing: border-box;
25
+ margin: 0;
26
+ padding: 0px;
27
+ font-family: 'Roboto', sans-serif;
28
+ background: var(--site-config-color-body);
29
+ color: var(--site-config-color-text);
30
+ }
23
31
  </style>
24
32
  <script>
25
33
  if ('<%= baidu %>') {
@@ -4,7 +4,7 @@
4
4
  <var-site-app-bar class="app-bar" title-position="left" :title="bigCamelizeComponentName">
5
5
  <template #left>
6
6
  <var-site-button v-if="showBackIcon" text round @click="back" color="transparent" text-color="#fff">
7
- <var-site-icon name="chevron-left" :size="28" style="margin-top: 1px" />
7
+ <var-site-icon name="chevron-left" class="arrow-left" style="margin-top: 1px" />
8
8
  </var-site-button>
9
9
  <var-site-button
10
10
  v-if="!showBackIcon && github"
@@ -15,7 +15,7 @@
15
15
  color="transparent"
16
16
  text-color="#fff"
17
17
  >
18
- <var-site-icon name="github" :size="28" style="margin-top: 1px" />
18
+ <var-site-icon name="github" class="github" style="margin-top: 1px" />
19
19
  </var-site-button>
20
20
  </template>
21
21
  <template #right>
@@ -31,21 +31,21 @@
31
31
  @click="toggleTheme"
32
32
  >
33
33
  <var-site-icon
34
- size="24px"
34
+ class="theme"
35
35
  color="#fff"
36
36
  :name="currentThemes === 'themes' ? 'white-balance-sunny' : 'weather-night'"
37
37
  />
38
38
  </var-site-button>
39
39
  <var-site-button
40
- style="padding-right: 6px"
40
+ class="i18n-button"
41
41
  text
42
42
  color="transparent"
43
43
  text-color="#fff"
44
44
  @click.stop="showMenu = true"
45
45
  v-if="languages"
46
46
  >
47
- <var-site-icon name="translate" :size="24" />
48
- <var-site-icon name="chevron-down" :size="22" />
47
+ <var-site-icon name="translate" class="i18n" />
48
+ <var-site-icon name="chevron-down" class="arrow-down" />
49
49
  </var-site-button>
50
50
  </template>
51
51
  </var-site-app-bar>
@@ -200,6 +200,7 @@ body {
200
200
  margin: 0;
201
201
  padding: 0;
202
202
  min-height: 100%;
203
+ font-size: 16px;
203
204
  font-family: 'Roboto', sans-serif;
204
205
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
205
206
  background: var(--site-config-color-bar);
@@ -246,7 +247,7 @@ header {
246
247
  }
247
248
 
248
249
  .router-view__block {
249
- padding: 54px 12px 15px;
250
+ padding: 55px 12px 15px;
250
251
  }
251
252
 
252
253
  * {
@@ -263,4 +264,28 @@ header {
263
264
  background: var(--site-config-color-mobile-language-active-background);
264
265
  }
265
266
  }
267
+
268
+ .arrow-left {
269
+ font-size: 28px !important;
270
+ }
271
+
272
+ .github {
273
+ font-size: 28px !important;
274
+ }
275
+
276
+ .theme {
277
+ font-size: 24px !important;
278
+ }
279
+
280
+ .i18n {
281
+ font-size: 24px !important;
282
+ }
283
+
284
+ .arrow-down {
285
+ font-size: 22px !important;
286
+ }
287
+
288
+ .i18n-button {
289
+ padding-right: 6px !important;
290
+ }
266
291
  </style>
@@ -6,19 +6,17 @@
6
6
  </h1>
7
7
  <h2 class="varlet-home__desc">{{ description[lang] }}</h2>
8
8
  </div>
9
- <var-site-cell
9
+
10
+ <div
11
+ class="varlet-home__cell"
10
12
  v-for="component in components"
11
13
  :key="component.text"
12
- @click="toComponent(component)"
13
14
  v-ripple
15
+ @click="toComponent(component)"
14
16
  >
15
- <template #extra>
16
- <var-site-icon name="chevron-right" size="14" />
17
- </template>
18
- <template #default>
19
- {{ component.text[lang] }}
20
- </template>
21
- </var-site-cell>
17
+ <span>{{ component.text[lang] }}</span>
18
+ <var-site-icon name="chevron-right" size="14" />
19
+ </div>
22
20
  </template>
23
21
 
24
22
  <script lang='ts'>
@@ -85,7 +83,7 @@ export default {
85
83
 
86
84
  .varlet-home__title {
87
85
  margin: 0 0 16px;
88
- font-size: 32px;
86
+ font-size: 34px;
89
87
  }
90
88
 
91
89
  .varlet-home__title,
@@ -103,8 +101,8 @@ export default {
103
101
  }
104
102
 
105
103
  .varlet-home__image {
106
- width: 32px;
107
- height: 32px;
104
+ width: 36px;
105
+ height: 36px;
108
106
  }
109
107
 
110
108
  .varlet-home__image,
@@ -117,7 +115,13 @@ export default {
117
115
  margin-left: 16px;
118
116
  }
119
117
 
120
- .var-site-cell {
118
+ .varlet-home__cell {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: space-between;
122
+ min-height: 40px;
123
+ padding: 10px 12px;
124
+ font-size: 15px;
121
125
  cursor: pointer;
122
126
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
123
127
  transition: all 0.3s;
@@ -0,0 +1,64 @@
1
+ @import './var';
2
+
3
+ .var-site {
4
+ &--box {
5
+ box-sizing: border-box;
6
+
7
+ * {
8
+ box-sizing: border-box;
9
+ }
10
+ }
11
+
12
+ &--relative {
13
+ position: relative;
14
+ }
15
+
16
+ &--absolute {
17
+ position: absolute;
18
+ }
19
+
20
+ &--hidden {
21
+ overflow: hidden;
22
+ }
23
+
24
+ &--lock {
25
+ overflow: hidden;
26
+ }
27
+
28
+ &--block {
29
+ display: block;
30
+ }
31
+
32
+ &--inline-block {
33
+ display: inline-block;
34
+ }
35
+
36
+ &--flex {
37
+ display: flex;
38
+ }
39
+
40
+ &--inline-flex {
41
+ display: inline-flex;
42
+ }
43
+ }
44
+
45
+ :root {
46
+ --site-font-size-xs: @site-font-size-xs;
47
+ --site-font-size-sm: @site-font-size-sm;
48
+ --site-font-size-md: @site-font-size-md;
49
+ --site-font-size-lg: @site-font-size-lg;
50
+ --site-icon-size-xs: @site-icon-size-xs;
51
+ --site-icon-size-sm: @site-icon-size-sm;
52
+ --site-icon-size-md: @site-icon-size-md;
53
+ --site-icon-size-lg: @site-icon-size-lg;
54
+ --site-color-primary: @site-color-primary;
55
+ --site-color-info: @site-color-info;
56
+ --site-color-success: @site-color-success;
57
+ --site-color-warning: @site-color-warning;
58
+ --site-color-danger: @site-color-danger;
59
+ --site-color-disabled: @site-color-disabled;
60
+ --site-cubic-bezier: @site-cubic-bezier;
61
+ --site-shadow-key-umbra-opacity: @site-shadow-key-umbra-opacity;
62
+ --site-shadow-key-penumbra-opacity: @site-shadow-key-penumbra-opacity;
63
+ --site-shadow-key-ambient-opacity: @site-shadow-key-ambient-opacity;
64
+ }
@@ -0,0 +1,126 @@
1
+ .var-site-elevation {
2
+ &--0 {
3
+ box-shadow: 0 0 0 0 var(--site-shadow-key-umbra-opacity), 0 0 0 0 var(--site-shadow-key-penumbra-opacity),
4
+ 0 0 0 0 var(--site-shadow-key-ambient-opacity);
5
+ }
6
+
7
+ &--1 {
8
+ box-shadow: 0 2px 1px -1px var(--site-shadow-key-umbra-opacity), 0 1px 1px 0 var(--site-shadow-key-penumbra-opacity),
9
+ 0 1px 3px 0 var(--site-shadow-key-ambient-opacity);
10
+ }
11
+
12
+ &--2 {
13
+ box-shadow: 0 3px 1px -2px var(--site-shadow-key-umbra-opacity), 0 2px 2px 0 var(--site-shadow-key-penumbra-opacity),
14
+ 0 1px 5px 0 var(--site-shadow-key-ambient-opacity);
15
+ }
16
+
17
+ &--3 {
18
+ box-shadow: 0 3px 3px -2px var(--site-shadow-key-umbra-opacity), 0 3px 4px 0 var(--site-shadow-key-penumbra-opacity),
19
+ 0 1px 8px 0 var(--site-shadow-key-ambient-opacity);
20
+ }
21
+
22
+ &--4 {
23
+ box-shadow: 0 2px 4px -1px var(--site-shadow-key-umbra-opacity), 0 4px 5px 0 var(--site-shadow-key-penumbra-opacity),
24
+ 0 1px 10px 0 var(--site-shadow-key-ambient-opacity);
25
+ }
26
+
27
+ &--5 {
28
+ box-shadow: 0 3px 5px -1px var(--site-shadow-key-umbra-opacity), 0 5px 8px 0 var(--site-shadow-key-penumbra-opacity),
29
+ 0 1px 14px 0 var(--site-shadow-key-ambient-opacity);
30
+ }
31
+
32
+ &--6 {
33
+ box-shadow: 0 3px 5px -1px var(--site-shadow-key-umbra-opacity), 0 6px 10px 0 var(--site-shadow-key-penumbra-opacity),
34
+ 0 1px 18px 0 var(--site-shadow-key-ambient-opacity);
35
+ }
36
+
37
+ &--7 {
38
+ box-shadow: 0 4px 5px -2px var(--site-shadow-key-umbra-opacity), 0 7px 10px 1px var(--site-shadow-key-penumbra-opacity),
39
+ 0 2px 16px 1px var(--site-shadow-key-ambient-opacity);
40
+ }
41
+
42
+ &--8 {
43
+ box-shadow: 0 5px 5px -3px var(--site-shadow-key-umbra-opacity), 0 8px 10px 1px var(--site-shadow-key-penumbra-opacity),
44
+ 0 3px 14px 2px var(--site-shadow-key-ambient-opacity);
45
+ }
46
+
47
+ &--9 {
48
+ box-shadow: 0 5px 6px -3px var(--site-shadow-key-umbra-opacity), 0 9px 12px 1px var(--site-shadow-key-penumbra-opacity),
49
+ 0 3px 16px 2px var(--site-shadow-key-ambient-opacity);
50
+ }
51
+
52
+ &--10 {
53
+ box-shadow: 0 6px 6px -3px var(--site-shadow-key-umbra-opacity), 0 10px 14px 1px var(--site-shadow-key-penumbra-opacity),
54
+ 0 4px 18px 3px var(--site-shadow-key-ambient-opacity);
55
+ }
56
+
57
+ &--11 {
58
+ box-shadow: 0 6px 7px -4px var(--site-shadow-key-umbra-opacity), 0 11px 15px 1px var(--site-shadow-key-penumbra-opacity),
59
+ 0 4px 20px 3px var(--site-shadow-key-ambient-opacity);
60
+ }
61
+
62
+ &--12 {
63
+ box-shadow: 0 7px 8px -4px var(--site-shadow-key-umbra-opacity), 0 12px 17px 2px var(--site-shadow-key-penumbra-opacity),
64
+ 0 5px 22px 4px var(--site-shadow-key-ambient-opacity);
65
+ }
66
+
67
+ &--13 {
68
+ box-shadow: 0 7px 8px -4px var(--site-shadow-key-umbra-opacity), 0 13px 19px 2px var(--site-shadow-key-penumbra-opacity),
69
+ 0 5px 24px 4px var(--site-shadow-key-ambient-opacity);
70
+ }
71
+
72
+ &--14 {
73
+ box-shadow: 0 7px 9px -4px var(--site-shadow-key-umbra-opacity), 0 14px 21px 2px var(--site-shadow-key-penumbra-opacity),
74
+ 0 5px 26px 4px var(--site-shadow-key-ambient-opacity);
75
+ }
76
+
77
+ &--15 {
78
+ box-shadow: 0 8px 9px -5px var(--site-shadow-key-umbra-opacity), 0 15px 22px 2px var(--site-shadow-key-penumbra-opacity),
79
+ 0 6px 28px 5px var(--site-shadow-key-ambient-opacity);
80
+ }
81
+
82
+ &--16 {
83
+ box-shadow: 0 8px 10px -5px var(--site-shadow-key-umbra-opacity), 0 16px 24px 2px var(--site-shadow-key-penumbra-opacity),
84
+ 0 6px 30px 5px var(--site-shadow-key-ambient-opacity);
85
+ }
86
+
87
+ &--17 {
88
+ box-shadow: 0 8px 11px -5px var(--site-shadow-key-umbra-opacity), 0 17px 26px 2px var(--site-shadow-key-penumbra-opacity),
89
+ 0 6px 32px 5px var(--site-shadow-key-ambient-opacity);
90
+ }
91
+
92
+ &--18 {
93
+ box-shadow: 0 9px 11px -5px var(--site-shadow-key-umbra-opacity), 0 18px 28px 2px var(--site-shadow-key-penumbra-opacity),
94
+ 0 7px 34px 6px var(--site-shadow-key-ambient-opacity);
95
+ }
96
+
97
+ &--19 {
98
+ box-shadow: 0 9px 12px -6px var(--site-shadow-key-umbra-opacity), 0 19px 29px 2px var(--site-shadow-key-penumbra-opacity),
99
+ 0 7px 36px 6px var(--site-shadow-key-ambient-opacity);
100
+ }
101
+
102
+ &--20 {
103
+ box-shadow: 0 10px 13px -6px var(--site-shadow-key-umbra-opacity), 0 20px 31px 3px var(--site-shadow-key-penumbra-opacity),
104
+ 0 8px 38px 7px var(--site-shadow-key-ambient-opacity);
105
+ }
106
+
107
+ &--21 {
108
+ box-shadow: 0 10px 13px -6px var(--site-shadow-key-umbra-opacity), 0 21px 33px 3px var(--site-shadow-key-penumbra-opacity),
109
+ 0 8px 40px 7px var(--site-shadow-key-ambient-opacity);
110
+ }
111
+
112
+ &--22 {
113
+ box-shadow: 0 10px 14px -6px var(--site-shadow-key-umbra-opacity), 0 22px 35px 3px var(--site-shadow-key-penumbra-opacity),
114
+ 0 8px 42px 7px var(--site-shadow-key-ambient-opacity);
115
+ }
116
+
117
+ &--23 {
118
+ box-shadow: 0 11px 14px -7px var(--site-shadow-key-umbra-opacity), 0 23px 36px 3px var(--site-shadow-key-penumbra-opacity),
119
+ 0 9px 44px 8px var(--site-shadow-key-ambient-opacity);
120
+ }
121
+
122
+ &--24 {
123
+ box-shadow: 0 11px 15px -7px var(--site-shadow-key-umbra-opacity), 0 24px 38px 3px var(--site-shadow-key-penumbra-opacity),
124
+ 0 9px 46px 8px var(--site-shadow-key-ambient-opacity);
125
+ }
126
+ }