@varlet/cli 1.27.8-alpha.1651665460392 → 1.27.9
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.
- package/generators/base/varlet.config.js +2 -0
- package/lib/commands/compile.js +4 -0
- package/lib/commands/create.js +1 -1
- package/lib/compiler/compileSiteEntry.d.ts +3 -0
- package/lib/compiler/compileSiteEntry.js +86 -9
- package/lib/shared/constant.d.ts +4 -2
- package/lib/shared/constant.js +5 -3
- package/package.json +6 -5
- package/site/components/button/Button.vue +1 -1
- package/site/index.html +8 -0
- package/site/mobile/App.vue +32 -7
- package/site/mobile/components/AppHome.vue +17 -13
- package/site/{components → mobile/components}/app-bar/AppBar.vue +0 -0
- package/site/{components → mobile/components}/app-bar/appBar.less +0 -0
- package/site/{components → mobile/components}/app-bar/index.ts +0 -0
- package/site/{components → mobile/components}/app-bar/props.ts +0 -0
- package/site/mobile/components/styles/common.less +64 -0
- package/site/mobile/components/styles/elevation.less +126 -0
- package/site/mobile/components/styles/var.less +27 -0
- package/site/mobile/main.ts +1 -1
- package/site/pc/App.vue +14 -376
- package/site/pc/Layout.vue +397 -0
- package/site/pc/components/AnimationBox.vue +45 -0
- package/site/pc/components/AppHeader.vue +95 -35
- package/site/pc/components/AppSidebar.vue +2 -2
- package/site/pc/components/LogoAnimation.vue +119 -0
- package/site/pc/floating.ts +9 -0
- package/site/pc/pages/index/index.less +194 -0
- package/site/pc/pages/index/index.vue +125 -0
- package/site/pc/pages/index/locale/en-US.ts +5 -0
- package/site/pc/pages/index/locale/zh-CN.ts +5 -0
- package/varlet.default.config.js +16 -3
package/lib/commands/compile.js
CHANGED
|
@@ -90,15 +90,19 @@ function compile(cmd) {
|
|
|
90
90
|
return [4 /*yield*/, Promise.all([runTask('types', compileTypes_1.compileTypes), runTask('template highlight', compileTemplateHighlight_1.compileTemplateHighlight)])];
|
|
91
91
|
case 2:
|
|
92
92
|
_b.sent();
|
|
93
|
+
process.env.TARGET_MODULE = 'module';
|
|
93
94
|
return [4 /*yield*/, runTask('module', compileModule_1.compileModule)];
|
|
94
95
|
case 3:
|
|
95
96
|
_b.sent();
|
|
97
|
+
process.env.TARGET_MODULE = 'esm-bundle';
|
|
96
98
|
return [4 /*yield*/, runTask('esm bundle', function () { return (0, compileModule_1.compileModule)('esm-bundle'); })];
|
|
97
99
|
case 4:
|
|
98
100
|
_b.sent();
|
|
101
|
+
process.env.TARGET_MODULE = 'commonjs';
|
|
99
102
|
return [4 /*yield*/, runTask('commonjs', function () { return (0, compileModule_1.compileModule)('commonjs'); })];
|
|
100
103
|
case 5:
|
|
101
104
|
_b.sent();
|
|
105
|
+
process.env.TARGET_MODULE = 'umd';
|
|
102
106
|
_a = !cmd.noUmd;
|
|
103
107
|
if (!_a) return [3 /*break*/, 7];
|
|
104
108
|
return [4 /*yield*/, runTask('umd', function () { return (0, compileModule_1.compileModule)('umd'); })];
|
package/lib/commands/create.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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 [
|
|
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([
|
|
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(),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
}
|
package/lib/shared/constant.d.ts
CHANGED
|
@@ -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
|
|
16
|
+
export declare const LOCALE_DIR_NAME = "locale";
|
|
16
17
|
export declare const DOCS_DIR_NAME = "docs";
|
|
17
|
-
export declare const
|
|
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;
|
package/lib/shared/constant.js
CHANGED
|
@@ -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.
|
|
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.
|
|
20
|
+
exports.LOCALE_DIR_NAME = 'locale';
|
|
20
21
|
exports.DOCS_DIR_NAME = 'docs';
|
|
21
|
-
exports.
|
|
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.
|
|
3
|
+
"version": "1.27.9",
|
|
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.
|
|
37
|
-
"@varlet/markdown-vite-plugin": "1.27.
|
|
38
|
-
"@varlet/touch-emulator": "1.27.
|
|
36
|
+
"@varlet/icons": "1.27.9",
|
|
37
|
+
"@varlet/markdown-vite-plugin": "1.27.9",
|
|
38
|
+
"@varlet/touch-emulator": "1.27.9",
|
|
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.
|
|
79
|
+
"@varlet/touch-emulator": "1.27.9",
|
|
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 %>') {
|
package/site/mobile/App.vue
CHANGED
|
@@ -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"
|
|
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"
|
|
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
|
-
|
|
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
|
-
|
|
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"
|
|
48
|
-
<var-site-icon name="chevron-down"
|
|
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:
|
|
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
|
-
|
|
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
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
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:
|
|
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:
|
|
107
|
-
height:
|
|
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
|
-
.
|
|
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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
+
}
|