From a8f1d9cb3b9ba7f63cb3ab582b12bf45e61a151a Mon Sep 17 00:00:00 2001 From: Eiinu Date: Fri, 17 Nov 2023 17:11:15 +0800 Subject: [PATCH] feat: add vite markdown plugin (#2650) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 markdown 相关插件独立为 @nutui/vite-plugins 子包。 将 demo 拆分为单独的文件,中英文文档内容由 demo 代码直接生成。 --- package.json | 11 +- packages/nutui-taro-demo/tsconfig.json | 5 +- packages/nutui-vite-plugins/package.json | 43 ++ packages/nutui-vite-plugins/src/index.ts | 2 + packages/nutui-vite-plugins/src/markdown.ts | 90 ++++ packages/nutui-vite-plugins/tsup.config.ts | 10 + pnpm-lock.yaml | 503 ++++++++++++++++---- scripts/copyh5.cjs | 33 ++ scripts/copytaro.cjs | 2 +- src/packages/__VUE/button/demo.vue | 230 +++------ src/packages/__VUE/button/demo/block.vue | 3 + src/packages/__VUE/button/demo/color.vue | 5 + src/packages/__VUE/button/demo/disabled.vue | 5 + src/packages/__VUE/button/demo/icon.vue | 16 + src/packages/__VUE/button/demo/loading.vue | 16 + src/packages/__VUE/button/demo/plain.vue | 4 + src/packages/__VUE/button/demo/shape.vue | 4 + src/packages/__VUE/button/demo/size.vue | 6 + src/packages/__VUE/button/demo/type.vue | 8 + src/packages/__VUE/button/doc.en-US.md | 246 +++------- src/packages/__VUE/button/doc.md | 247 +++------- src/packages/__VUE/button/doc.taro.md | 122 ++--- src/packages/utils/useLocale/index.ts | 6 +- src/sites/assets/util/useTranslate.ts | 13 +- vite.config.jdt.ts | 42 +- vite.config.ts | 52 +- 26 files changed, 939 insertions(+), 785 deletions(-) create mode 100644 packages/nutui-vite-plugins/package.json create mode 100644 packages/nutui-vite-plugins/src/index.ts create mode 100644 packages/nutui-vite-plugins/src/markdown.ts create mode 100644 packages/nutui-vite-plugins/tsup.config.ts create mode 100644 src/packages/__VUE/button/demo/block.vue create mode 100644 src/packages/__VUE/button/demo/color.vue create mode 100644 src/packages/__VUE/button/demo/disabled.vue create mode 100644 src/packages/__VUE/button/demo/icon.vue create mode 100644 src/packages/__VUE/button/demo/loading.vue create mode 100644 src/packages/__VUE/button/demo/plain.vue create mode 100644 src/packages/__VUE/button/demo/shape.vue create mode 100644 src/packages/__VUE/button/demo/size.vue create mode 100644 src/packages/__VUE/button/demo/type.vue diff --git a/package.json b/package.json index 2591919ee5..993f1f3659 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,8 @@ "@commitlint/cli": "^18.0.0", "@commitlint/config-conventional": "^18.0.0", "@nutui/eslint-config": "workspace:*", - "@nutui/prettier-plugin": "workspace:^", + "@nutui/prettier-plugin": "workspace:*", + "@nutui/vite-plugins": "workspace:*", "@tarojs/taro": "3.6.14", "@types/node": "^18.18.5", "@vitejs/plugin-vue": "^4.4.0", @@ -93,23 +94,21 @@ "codesandbox": "^2.2.3", "eslint": "^8.51.0", "fs-extra": "^11.1.1", - "highlight.js": "^11.9.0", "husky": "^8.0.3", "inquirer": "^9.2.11", "lint-staged": "^15.0.1", "lzutf8": "^0.6.3", "markdown-it": "^13.0.2", - "markdown-it-container": "^3.0.0", "prettier": "^3.0.3", "rimraf": "^5.0.5", "typescript": "^5.2.2", "unplugin-vue-components": "^0.25.2", - "unplugin-vue-markdown": "^0.25.0", - "vite": "^4.4.11", + "vite": "^4.5.0", "vitest": "^0.34.6", "vitest-canvas-mock": "^0.3.3", "vue": "^3.3.4", - "vue-tsc": "^1.8.22" + "vue-tsc": "^1.8.22", + "vite-plugin-inspect": "^0.7.42" }, "engines": { "pnpm": ">= 8.0.0" diff --git a/packages/nutui-taro-demo/tsconfig.json b/packages/nutui-taro-demo/tsconfig.json index 383b80e2e2..c04ea94aa2 100644 --- a/packages/nutui-taro-demo/tsconfig.json +++ b/packages/nutui-taro-demo/tsconfig.json @@ -18,7 +18,10 @@ "jsx": "preserve", "allowJs": true, "resolveJsonModule": true, - "typeRoots": ["node_modules/@types"] + "typeRoots": ["node_modules/@types"], + "paths": { + "@/packages/*": ["../../src/packages/*"] + } }, "include": ["./src", "./types", "components.d.ts"], "compileOnSave": false diff --git a/packages/nutui-vite-plugins/package.json b/packages/nutui-vite-plugins/package.json new file mode 100644 index 0000000000..02554df491 --- /dev/null +++ b/packages/nutui-vite-plugins/package.json @@ -0,0 +1,43 @@ +{ + "name": "@nutui/vite-plugins", + "version": "1.0.0", + "private": "true", + "type": "module", + "description": "", + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.cjs", + "types": "./dist/index.d.ts" + }, + "./markdown": { + "import": "./dist/markdown.js", + "require": "./dist/markdown.cjs", + "types": "./dist/markdown.d.ts" + } + }, + "main": "./dist/index.cjs", + "module": "dist/index.js", + "types": "./dist/index.d.ts", + "files": ["dist"], + "scripts": { + "prepare": "pnpm build", + "dev": "tsup --watch", + "build": "tsup" + }, + "author": "jdf2e", + "license": "MIT", + "dependencies": { + "lzutf8": "^0.6.3", + "markdown-it-container": "^3.0.0", + "unplugin-vue-markdown": "^0.24.3", + "highlight.js": "^11.9.0", + "fs-extra": "^11.1.1" + }, + "devDependencies": { + "tsup": "^7.2.0", + "typescript": "^5.0.4", + "@types/markdown-it-container": "^2.0.8", + "@types/fs-extra": "^11.0.3" + } +} diff --git a/packages/nutui-vite-plugins/src/index.ts b/packages/nutui-vite-plugins/src/index.ts new file mode 100644 index 0000000000..760f785136 --- /dev/null +++ b/packages/nutui-vite-plugins/src/index.ts @@ -0,0 +1,2 @@ +export * from './markdown'; +export { default as markdown } from './markdown'; diff --git a/packages/nutui-vite-plugins/src/markdown.ts b/packages/nutui-vite-plugins/src/markdown.ts new file mode 100644 index 0000000000..3b4e89e7ca --- /dev/null +++ b/packages/nutui-vite-plugins/src/markdown.ts @@ -0,0 +1,90 @@ +import Markdown from 'unplugin-vue-markdown/vite'; +import MarkdownIt from 'markdown-it-container'; +import hljs from 'highlight.js'; +import LZUTF8 from 'lzutf8'; +import fs from 'fs-extra'; +import path from 'path'; +import { Plugin } from 'vite'; + +function compressText(str: string): any { + // @ts-ignore + return LZUTF8.encodeBase64(LZUTF8.compress(str, { outputEncoding: 'ByteArray' })); +} + +interface MarkdownOptions { + docRoot: string; +} + +const fileRegex = /\.md$/; + +const TransformMarkdownDemo = (options: MarkdownOptions): Plugin => { + return { + name: 'nutui-transform-markdown-demo', + enforce: 'pre', + transform(src, id) { + if (fileRegex.test(id)) { + return { + code: src.replace(/> demo: ([0-9a-z .]*)[\n|\r\n]/g, (_match, $1: string) => { + const [left, right] = $1.split(' '); + let code = ''; + try { + code = fs.readFileSync(path.resolve(options.docRoot, left, 'demo', `${right}.vue`), 'utf-8'); + } catch (err) { + code = + '[@nutui/vite-plugins] File not found: ' + path.resolve(options.docRoot, left, 'demo', `${right}.vue`); + console.warn(code); + } + return code + ? `:::demo + +\`\`\`vue +${code} +\`\`\` + +:::\n` + : ''; + }), + map: null // 如果可行将提供 source map + }; + } + } + }; +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function markdown(options: MarkdownOptions) { + return [ + TransformMarkdownDemo(options), + Markdown({ + markdownItOptions: { + typographer: false, + highlight: function (str, lang) { + if (lang && (lang === 'vue' || hljs.getLanguage(lang))) { + return hljs.highlight(str, { + language: lang === 'vue' ? 'html' : lang + }).value; + } + return ''; + } + }, + markdownItSetup(md) { + md.use(MarkdownIt, 'demo', { + validate: function (params: any) { + return params.match(/^demo\s*(.*)$/); + }, + render: function (tokens: any, idx: any) { + const m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); + if (tokens[idx].nesting === 1) { + // opening tag + const contentHtml = compressText(tokens[idx + 1].content); + return `` + md.utils.escapeHtml(m[1]) + '\n'; + } else { + // closing tag + return '\n'; + } + } + }); + } + }) + ]; +} diff --git a/packages/nutui-vite-plugins/tsup.config.ts b/packages/nutui-vite-plugins/tsup.config.ts new file mode 100644 index 0000000000..46df09653f --- /dev/null +++ b/packages/nutui-vite-plugins/tsup.config.ts @@ -0,0 +1,10 @@ +import type { Options } from 'tsup'; + +export default { + entryPoints: ['src/*.ts'], + clean: true, + format: ['cjs', 'esm'], + dts: true, + shims: true, + silent: true +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc72813d52..d82ab61d32 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,8 +34,11 @@ importers: specifier: workspace:* version: link:packages/nutui-eslint-config '@nutui/prettier-plugin': - specifier: workspace:^ + specifier: workspace:* version: link:packages/nutui-prettier-plugin + '@nutui/vite-plugins': + specifier: workspace:* + version: link:packages/nutui-vite-plugins '@tarojs/taro': specifier: 3.6.14 version: 3.6.14(postcss@8.4.31)(vue@3.3.4) @@ -44,10 +47,10 @@ importers: version: 18.18.5 '@vitejs/plugin-vue': specifier: ^4.4.0 - version: 4.4.0(vite@4.4.11)(vue@3.3.4) + version: 4.4.0(vite@4.5.0)(vue@3.3.4) '@vitejs/plugin-vue-jsx': specifier: ^3.0.2 - version: 3.0.2(vite@4.4.11)(vue@3.3.4) + version: 3.0.2(vite@4.5.0)(vue@3.3.4) '@vitest/coverage-v8': specifier: ^0.34.6 version: 0.34.6(vitest@0.34.6) @@ -69,9 +72,6 @@ importers: fs-extra: specifier: ^11.1.1 version: 11.1.1 - highlight.js: - specifier: ^11.9.0 - version: 11.9.0 husky: specifier: ^8.0.3 version: 8.0.3 @@ -87,9 +87,6 @@ importers: markdown-it: specifier: ^13.0.2 version: 13.0.2 - markdown-it-container: - specifier: ^3.0.0 - version: 3.0.0 prettier: specifier: ^3.0.3 version: 3.0.3 @@ -102,12 +99,12 @@ importers: unplugin-vue-components: specifier: ^0.25.2 version: 0.25.2(vue@3.3.4) - unplugin-vue-markdown: - specifier: ^0.25.0 - version: 0.25.0(vite@4.4.11) vite: - specifier: ^4.4.11 - version: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + specifier: ^4.5.0 + version: 4.5.0(@types/node@18.18.5)(sass@1.69.3) + vite-plugin-inspect: + specifier: ^0.7.42 + version: 0.7.42(vite@4.5.0) vitest: specifier: ^0.34.6 version: 0.34.6(@vitest/ui@0.34.6)(sass@1.69.3) @@ -172,13 +169,13 @@ importers: version: 18.18.5 '@vitejs/plugin-vue': specifier: ^4.4.0 - version: 4.4.0(vite@4.4.11)(vue@3.3.4) + version: 4.4.0(vite@4.5.0)(vue@3.3.4) rimraf: specifier: ^5.0.5 version: 5.0.5 vite: specifier: ^4.4.11 - version: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + version: 4.5.0(@types/node@18.18.5)(sass@1.69.3) vue: specifier: ^3.3.4 version: 3.3.4 @@ -291,6 +288,37 @@ importers: packages/nutui-touch-emulator: {} + packages/nutui-vite-plugins: + dependencies: + fs-extra: + specifier: ^11.1.1 + version: 11.1.1 + highlight.js: + specifier: ^11.9.0 + version: 11.9.0 + lzutf8: + specifier: ^0.6.3 + version: 0.6.3 + markdown-it-container: + specifier: ^3.0.0 + version: 3.0.0 + unplugin-vue-markdown: + specifier: ^0.24.3 + version: 0.24.3(vite@4.5.0) + devDependencies: + '@types/fs-extra': + specifier: ^11.0.3 + version: 11.0.3 + '@types/markdown-it-container': + specifier: ^2.0.8 + version: 2.0.8 + tsup: + specifier: ^7.2.0 + version: 7.2.0(postcss@8.4.31)(ts-node@10.9.1)(typescript@5.2.2) + typescript: + specifier: ^5.0.4 + version: 5.2.2 + packages/nutui-vscode-extension: devDependencies: '@types/glob': @@ -1960,7 +1988,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm@0.18.20: @@ -1969,7 +1996,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-x64@0.18.20: @@ -1978,7 +2004,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/darwin-arm64@0.18.20: @@ -1987,7 +2012,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/darwin-x64@0.18.20: @@ -1996,7 +2020,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-arm64@0.18.20: @@ -2005,7 +2028,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-x64@0.18.20: @@ -2014,7 +2036,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm64@0.18.20: @@ -2023,7 +2044,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm@0.18.20: @@ -2032,7 +2052,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ia32@0.18.20: @@ -2041,7 +2060,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-loong64@0.14.54: @@ -2058,7 +2076,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-mips64el@0.18.20: @@ -2067,7 +2084,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ppc64@0.18.20: @@ -2076,7 +2092,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-riscv64@0.18.20: @@ -2085,7 +2100,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-s390x@0.18.20: @@ -2094,7 +2108,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-x64@0.18.20: @@ -2103,7 +2116,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/netbsd-x64@0.18.20: @@ -2112,7 +2124,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true /@esbuild/openbsd-x64@0.18.20: @@ -2121,7 +2132,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true /@esbuild/sunos-x64@0.18.20: @@ -2130,7 +2140,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true /@esbuild/win32-arm64@0.18.20: @@ -2139,7 +2148,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-ia32@0.18.20: @@ -2148,7 +2156,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-x64@0.18.20: @@ -2157,7 +2164,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.41.0): @@ -2325,25 +2331,25 @@ packages: call-bind: 1.0.2 dev: true - /@mdit-vue/plugin-component@1.0.0: - resolution: {integrity: sha512-ZXsJwxkG5yyTHARIYbR74cT4AZ0SfMokFFjiHYCbypHIeYWgJhso4+CZ8+3V9EWFG3EHlGoKNGqKp9chHnqntQ==} + /@mdit-vue/plugin-component@0.12.1: + resolution: {integrity: sha512-L3elbvuKUufXwPLHrmJGd/ijd/QKxfcHXy3kRy4O+P7UIV7HSWePpfB0k+wWee+by3MviYYxjVAi392z+DGy3Q==} dependencies: '@types/markdown-it': 13.0.6 markdown-it: 13.0.2 - dev: true + dev: false - /@mdit-vue/plugin-frontmatter@1.0.0: - resolution: {integrity: sha512-MMA7Ny+YPZA7eDOY1t4E+rKuEWO39mzDdP/M68fKdXJU6VfcGkPr7gnpnJfW2QBJ5qIvMrK/3lDAA2JBy5TfpA==} + /@mdit-vue/plugin-frontmatter@0.12.1: + resolution: {integrity: sha512-C6ycNjrJ+T4JgbVxwo9cUkfLacOO841Yl8ogqd5PJmAVpc5cM2OLBkqqkZxNRXos3g9xM1VvIQ7gK/047UNADg==} dependencies: - '@mdit-vue/types': 1.0.0 + '@mdit-vue/types': 0.12.0 '@types/markdown-it': 13.0.6 gray-matter: 4.0.3 markdown-it: 13.0.2 - dev: true + dev: false - /@mdit-vue/types@1.0.0: - resolution: {integrity: sha512-xeF5+sHLzRNF7plbksywKCph4qli20l72of2fMlZQQ7RECvXYrRkE9+bjRFQCyULC7B8ydUYbpbkux5xJlVWyw==} - dev: true + /@mdit-vue/types@0.12.0: + resolution: {integrity: sha512-mrC4y8n88BYvgcgzq9bvTlDgFyi2zuvzmPilRvRc3Uz1iIvq8mDhxJ0rHKFUNzPEScpDvJdIujqiDrulMqiudA==} + dev: false /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} @@ -2411,7 +2417,6 @@ packages: '@types/estree': 1.0.2 estree-walker: 2.0.2 picomatch: 2.3.1 - dev: true /@sideway/address@4.1.4: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} @@ -3486,7 +3491,6 @@ packages: /@types/estree@1.0.2: resolution: {integrity: sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==} - dev: true /@types/expect@1.20.4: resolution: {integrity: sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==} @@ -3510,6 +3514,13 @@ packages: '@types/serve-static': 1.15.3 dev: true + /@types/fs-extra@11.0.3: + resolution: {integrity: sha512-sF59BlXtUdzEAL1u0MSvuzWd7PdZvZEtnaVkzX5mjpdWTJ8brG0jUqve3jPCzSzvAKKMHTG8F8o/WMQLtleZdQ==} + dependencies: + '@types/jsonfile': 6.1.3 + '@types/node': 18.18.5 + dev: true + /@types/fs-extra@8.1.3: resolution: {integrity: sha512-7IdV01N0u/CaVO0fuY1YmEg14HQN3+EW8mpNgg6NEfxEl/lzCa5OxlBu3iFsCAdamnYOcTQ7oEi43Xc/67Rgzw==} dependencies: @@ -3558,6 +3569,12 @@ packages: /@types/json-schema@7.0.13: resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} + /@types/jsonfile@6.1.3: + resolution: {integrity: sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==} + dependencies: + '@types/node': 18.18.5 + dev: true + /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: @@ -3566,7 +3583,6 @@ packages: /@types/linkify-it@3.0.3: resolution: {integrity: sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==} - dev: true /@types/lodash.debounce@4.0.7: resolution: {integrity: sha512-X1T4wMZ+gT000M2/91SYj0d/7JfeNZ9PeeOldSNoE/lunLeQXKvkmIumI29IaKMotU/ln/McOIvgzZcQ/3TrSA==} @@ -3576,16 +3592,28 @@ packages: /@types/lodash@4.14.199: resolution: {integrity: sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==} + /@types/markdown-it-container@2.0.8: + resolution: {integrity: sha512-epl+pYkAXmMOncHnp0uWsGkM00r/+5ClRAiQJz7iX3NX5cydJcBkIJEPkORpL9DSgunXpXkZt9spYHbJPuSJZw==} + dependencies: + '@types/markdown-it': 13.0.2 + dev: true + + /@types/markdown-it@13.0.2: + resolution: {integrity: sha512-Tla7hH9oeXHOlJyBFdoqV61xWE9FZf/y2g+gFVwQ2vE1/eBzjUno5JCd3Hdb5oATve5OF6xNjZ/4VIZhVVx+hA==} + dependencies: + '@types/linkify-it': 3.0.3 + '@types/mdurl': 1.0.3 + dev: true + /@types/markdown-it@13.0.6: resolution: {integrity: sha512-0VqpvusJn1/lwRegCxcHVdmLfF+wIsprsKMC9xW8UPcTxhFcQtoN/fBU1zMe8pH7D/RuueMh2CaBaNv+GrLqTw==} dependencies: '@types/linkify-it': 3.0.3 '@types/mdurl': 1.0.3 - dev: true + dev: false /@types/mdurl@1.0.3: resolution: {integrity: sha512-T5k6kTXak79gwmIOaDF2UUQXFbnBE0zBUzF20pz7wDYu0RQMzWg+Ml/Pz50214NsFHBITkoi5VtdjFZnJ2ijjA==} - dev: true /@types/mime@1.3.3: resolution: {integrity: sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg==} @@ -3916,7 +3944,7 @@ packages: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} dev: true - /@vitejs/plugin-vue-jsx@3.0.2(vite@4.4.11)(vue@3.3.4): + /@vitejs/plugin-vue-jsx@3.0.2(vite@4.5.0)(vue@3.3.4): resolution: {integrity: sha512-obF26P2Z4Ogy3cPp07B4VaW6rpiu0ue4OT2Y15UxT5BZZ76haUY9guOsZV3uWh/I6xc+VeiW+ZVabRE82FyzWw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3926,20 +3954,20 @@ packages: '@babel/core': 7.23.2 '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.2) - vite: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) vue: 3.3.4 transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue@4.4.0(vite@4.4.11)(vue@3.3.4): + /@vitejs/plugin-vue@4.4.0(vite@4.5.0)(vue@3.3.4): resolution: {integrity: sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) vue: 3.3.4 dev: true @@ -4453,7 +4481,6 @@ packages: engines: {node: '>=6.5'} dependencies: event-target-shim: 5.0.1 - dev: true /abortcontroller-polyfill@1.7.5: resolution: {integrity: sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==} @@ -4714,7 +4741,6 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 - dev: true /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -5103,6 +5129,13 @@ packages: wrap-ansi: 7.0.0 dev: true + /bplist-parser@0.2.0: + resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} + engines: {node: '>= 5.10.0'} + dependencies: + big-integer: 1.6.51 + dev: true + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -5131,9 +5164,9 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001549 - electron-to-chromium: 1.4.508 + electron-to-chromium: 1.4.554 node-releases: 2.0.13 - update-browserslist-db: 1.0.11(browserslist@4.21.5) + update-browserslist-db: 1.0.13(browserslist@4.21.5) dev: true /browserslist@4.22.1: @@ -5183,7 +5216,6 @@ packages: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 - dev: true /buffers@0.1.1: resolution: {integrity: sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==} @@ -5200,6 +5232,23 @@ packages: semver: 7.5.4 dev: true + /bundle-name@3.0.0: + resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} + engines: {node: '>=12'} + dependencies: + run-applescript: 5.0.0 + dev: true + + /bundle-require@4.0.2(esbuild@0.18.20): + resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + dependencies: + esbuild: 0.18.20 + load-tsconfig: 0.2.5 + dev: true + /bytes@3.0.0: resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} engines: {node: '>= 0.8'} @@ -6715,6 +6764,24 @@ packages: engines: {node: '>=0.10.0'} dev: true + /default-browser-id@3.0.0: + resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} + engines: {node: '>=12'} + dependencies: + bplist-parser: 0.2.0 + untildify: 4.0.0 + dev: true + + /default-browser@4.0.0: + resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} + engines: {node: '>=14.16'} + dependencies: + bundle-name: 3.0.0 + default-browser-id: 3.0.0 + execa: 7.2.0 + titleize: 3.0.0 + dev: true + /default-gateway@6.0.3: resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} engines: {node: '>= 10'} @@ -6745,6 +6812,11 @@ packages: engines: {node: '>=8'} dev: true + /define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + dev: true + /define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} @@ -7066,10 +7138,6 @@ packages: jake: 10.8.7 dev: true - /electron-to-chromium@1.4.508: - resolution: {integrity: sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==} - dev: true - /electron-to-chromium@1.4.554: resolution: {integrity: sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==} @@ -7130,7 +7198,6 @@ packages: /entities@3.0.1: resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==} engines: {node: '>=0.12'} - dev: true /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} @@ -7173,6 +7240,10 @@ packages: is-arrayish: 0.2.1 dev: true + /error-stack-parser-es@0.1.1: + resolution: {integrity: sha512-g/9rfnvnagiNf+DRMHEVGuGuIBlCIMDFoTA616HaP2l9PlCjGjVhD98PNbVSJvmK4TttqT5mV5tInMhoFgi+aA==} + dev: true + /es-module-lexer@0.10.5: resolution: {integrity: sha512-+7IwY/kiGAacQfY+YBhKMvEmyAJnw5grTUgjG85Pe7vcUI/6b7pZjZG8nQ7+48YhzEAEqrEgD2dCz/JIK+AYvw==} dev: true @@ -7425,7 +7496,6 @@ packages: '@esbuild/win32-arm64': 0.18.20 '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 - dev: true /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -7635,7 +7705,6 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: true /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -7673,7 +7742,6 @@ packages: /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} - dev: true /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} @@ -7686,7 +7754,6 @@ packages: /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - dev: true /execa@0.7.0: resolution: {integrity: sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==} @@ -7716,6 +7783,21 @@ packages: strip-final-newline: 2.0.0 dev: true + /execa@7.2.0: + resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 4.3.1 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 3.0.7 + strip-final-newline: 3.0.0 + dev: true + /execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} @@ -7813,7 +7895,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extendable: 0.1.1 - dev: true /extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -8199,7 +8280,6 @@ packages: graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 - dev: true /fs-extra@3.0.1: resolution: {integrity: sha512-V3Z3WZWVUYd8hoCL5xfXJCaHWYzmtwW5XWYSlLgERi8PWd8bx1kUHUk8L1BT57e49oKnDDD180mjfrHc1yA9rg==} @@ -8434,13 +8514,24 @@ packages: path-scurry: 1.10.1 dev: true + /glob@7.1.6: + resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + /glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -8659,7 +8750,7 @@ packages: kind-of: 6.0.3 section-matter: 1.0.0 strip-bom-string: 1.0.0 - dev: true + dev: false /growl@1.10.5: resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} @@ -8767,7 +8858,7 @@ packages: /highlight.js@11.9.0: resolution: {integrity: sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==} engines: {node: '>=12.0.0'} - dev: true + dev: false /history@5.3.0: resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==} @@ -9017,6 +9108,11 @@ packages: engines: {node: '>=10.17.0'} dev: true + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} + dev: true + /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} @@ -9318,6 +9414,12 @@ packages: hasBin: true dev: true + /is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + dev: true + /is-es2016-keyword@1.0.0: resolution: {integrity: sha512-JtZWPUwjdbQ1LIo9OSZ8MdkWEve198ors27vH+RzUUvZXXZkzXCxFnlUhzWYxy5IexQSRiXVw9j2q/tHMmkVYQ==} dev: true @@ -9325,7 +9427,6 @@ packages: /is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} - dev: true /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -9352,6 +9453,14 @@ packages: dependencies: is-extglob: 2.1.1 + /is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + dependencies: + is-docker: 3.0.0 + dev: true + /is-installed-globally@0.1.0: resolution: {integrity: sha512-ERNhMg+i/XgDwPIPF3u24qpajVreaiSuvpb1Uu0jugw7KKcxGyCX8cgp8P5fwTmAuXku6beDHHECdKArjlg7tw==} engines: {node: '>=4'} @@ -9689,7 +9798,6 @@ packages: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: true /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} @@ -9817,7 +9925,6 @@ packages: universalify: 2.0.0 optionalDependencies: graceful-fs: 4.2.11 - dev: true /jsonp-retry@1.0.3: resolution: {integrity: sha512-/jmE9+shtKP+oIt2AWO9Wx+C27NTGpLCEw4QHOqpoV2X6ta374HE9C+EEdgu8r3iLKgFMx7u5j0mCwxWN8UdlA==} @@ -10103,7 +10210,6 @@ packages: resolution: {integrity: sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==} dependencies: uc.micro: 1.0.6 - dev: true /lint-staged@15.0.1: resolution: {integrity: sha512-2IU5OWmCaxch0X0+IBF4/v7sutpB+F3qoXbro43pYjQTOo5wumckjxoxn47pQBqqBsCWrD5HnI2uG/zJA7isew==} @@ -10140,6 +10246,11 @@ packages: wrap-ansi: 8.1.0 dev: true + /load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -10245,6 +10356,10 @@ packages: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} dev: true + /lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + dev: true + /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true @@ -10358,7 +10473,6 @@ packages: resolution: {integrity: sha512-CAkF9HKrM+XpB0f3DepQ2to2iUEo0zrbh+XgBqgNBc1+k8HMM3u/YSfHI3Dr4GmoTIez2Pr/If1XFl3rU26AwA==} dependencies: readable-stream: 4.4.2 - dev: true /magic-string@0.30.5: resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} @@ -10428,7 +10542,7 @@ packages: /markdown-it-container@3.0.0: resolution: {integrity: sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==} - dev: true + dev: false /markdown-it@12.3.2: resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==} @@ -10450,7 +10564,6 @@ packages: linkify-it: 4.0.1 mdurl: 1.0.1 uc.micro: 1.0.6 - dev: true /mathml-tag-names@2.1.3: resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==} @@ -10482,7 +10595,6 @@ packages: /mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} - dev: true /media-typer@0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} @@ -11333,6 +11445,16 @@ packages: is-wsl: 2.2.0 dev: true + /open@9.1.0: + resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} + engines: {node: '>=14.16'} + dependencies: + default-browser: 4.0.0 + define-lazy-prop: 3.0.0 + is-inside-container: 1.0.0 + is-wsl: 2.2.0 + dev: true + /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -11896,6 +12018,24 @@ packages: resolve: 1.22.8 dev: true + /postcss-load-config@4.0.1(postcss@8.4.31)(ts-node@10.9.1): + resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.1.0 + postcss: 8.4.31 + ts-node: 10.9.1(@types/node@18.18.5)(typescript@5.2.2) + yaml: 2.3.2 + dev: true + /postcss-loader@7.3.3(postcss@8.4.31)(typescript@5.2.2)(webpack@5.89.0): resolution: {integrity: sha512-YgO/yhtevGO/vJePCQmTxiaEwER94LABZN0ZMT4A0vsak9TpO+RvKRs7EmJ8peIlB9xfXCsS7M8LjqncsUZ5HA==} engines: {node: '>= 14.15.0'} @@ -12332,7 +12472,6 @@ packages: /process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} - dev: true /promise-inflight@1.0.1(bluebird@3.7.2): resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} @@ -12624,7 +12763,6 @@ packages: events: 3.3.0 process: 0.11.10 string_decoder: 1.3.0 - dev: true /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} @@ -12941,12 +13079,18 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 - dev: true /rrweb-cssom@0.6.0: resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} dev: true + /run-applescript@5.0.0: + resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} + engines: {node: '>=12'} + dependencies: + execa: 5.1.1 + dev: true + /run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} @@ -13112,7 +13256,7 @@ packages: dependencies: extend-shallow: 2.0.1 kind-of: 6.0.3 - dev: true + dev: false /seek-bzip@1.0.6: resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} @@ -13452,6 +13596,13 @@ packages: engines: {node: '>= 8'} dev: true + /source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + dependencies: + whatwg-url: 7.1.0 + dev: true + /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: @@ -13517,7 +13668,6 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true /sshpk@1.17.0: resolution: {integrity: sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==} @@ -13687,7 +13837,7 @@ packages: /strip-bom-string@1.0.0: resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} engines: {node: '>=0.10.0'} - dev: true + dev: false /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} @@ -13871,6 +14021,20 @@ packages: - supports-color dev: true + /sucrase@3.34.0: + resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} + engines: {node: '>=8'} + hasBin: true + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + commander: 4.1.1 + glob: 7.1.6 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + dev: true + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -14168,6 +14332,11 @@ packages: engines: {node: '>=14.0.0'} dev: true + /titleize@3.0.0: + resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} + engines: {node: '>=12'} + dev: true + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -14233,6 +14402,12 @@ packages: url-parse: 1.5.10 dev: true + /tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + dependencies: + punycode: 2.3.0 + dev: true + /tr46@4.1.1: resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} engines: {node: '>=14'} @@ -14244,6 +14419,11 @@ packages: resolution: {integrity: sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==} dev: true + /tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + dev: true + /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} @@ -14270,6 +14450,10 @@ packages: typescript: 5.2.2 dev: false + /ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + dev: true + /ts-loader@9.4.2(typescript@5.2.2)(webpack@5.84.0): resolution: {integrity: sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==} engines: {node: '>=12.0.0'} @@ -14322,6 +14506,43 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + /tsup@7.2.0(postcss@8.4.31)(ts-node@10.9.1)(typescript@5.2.2): + resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} + engines: {node: '>=16.14'} + hasBin: true + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.1.0' + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.0.2(esbuild@0.18.20) + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4 + esbuild: 0.18.20 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss: 8.4.31 + postcss-load-config: 4.0.1(postcss@8.4.31)(ts-node@10.9.1) + resolve-from: 5.0.0 + rollup: 3.29.4 + source-map: 0.8.0-beta.0 + sucrase: 3.34.0 + tree-kill: 1.2.2 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -14424,7 +14645,6 @@ packages: /uc.micro@1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} - dev: true /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -14518,7 +14738,6 @@ packages: /universalify@2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - dev: true /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} @@ -14554,22 +14773,22 @@ packages: - supports-color dev: true - /unplugin-vue-markdown@0.25.0(vite@4.4.11): - resolution: {integrity: sha512-X0G6E1drAM59HKnSEMVZ6WMzfM8IFZvBjd0nlCx988MRFNEj/Pn67aKs2bvHx53O2AyLN0PxnfRqLxGbP2pZ1Q==} + /unplugin-vue-markdown@0.24.3(vite@4.5.0): + resolution: {integrity: sha512-v9fNupSfGnQTYrzpDO51DTppR6IsR/ufNdKycBe7HK0nApuXYiLzo5i5ejG63NSnMauTDFZB1kYOlUjJZ5auvQ==} peerDependencies: vite: ^2.0.0 || ^3.0.0-0 || ^4.0.0 dependencies: - '@mdit-vue/plugin-component': 1.0.0 - '@mdit-vue/plugin-frontmatter': 1.0.0 - '@mdit-vue/types': 1.0.0 + '@mdit-vue/plugin-component': 0.12.1 + '@mdit-vue/plugin-frontmatter': 0.12.1 + '@mdit-vue/types': 0.12.0 '@rollup/pluginutils': 5.0.5 '@types/markdown-it': 13.0.6 markdown-it: 13.0.2 unplugin: 1.5.0 - vite: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) transitivePeerDependencies: - rollup - dev: true + dev: false /unplugin@1.5.0: resolution: {integrity: sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==} @@ -14578,6 +14797,10 @@ packages: chokidar: 3.5.3 webpack-sources: 3.2.3 webpack-virtual-modules: 0.5.0 + + /untildify@4.0.0: + resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} + engines: {node: '>=8'} dev: true /unzip-response@2.0.1: @@ -14600,8 +14823,8 @@ packages: setimmediate: 1.0.5 dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.5): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + /update-browserslist-db@1.0.13(browserslist@4.21.5): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -14828,7 +15051,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) transitivePeerDependencies: - '@types/node' - less @@ -14840,6 +15063,30 @@ packages: - terser dev: true + /vite-plugin-inspect@0.7.42(vite@4.5.0): + resolution: {integrity: sha512-JCyX86wr3siQc+p9Kd0t8VkFHAJag0RaQVIpdFGSv5FEaePEVB6+V/RGtz2dQkkGSXQzRWrPs4cU3dRKg32bXw==} + engines: {node: '>=14'} + peerDependencies: + '@nuxt/kit': '*' + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + '@nuxt/kit': + optional: true + dependencies: + '@antfu/utils': 0.7.6 + '@rollup/pluginutils': 5.0.5 + debug: 4.3.4 + error-stack-parser-es: 0.1.1 + fs-extra: 11.1.1 + open: 9.1.0 + picocolors: 1.0.0 + sirv: 2.0.3 + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) + transitivePeerDependencies: + - rollup + - supports-color + dev: true + /vite@4.4.11(@types/node@18.18.5)(sass@1.69.3): resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==} engines: {node: ^14.18.0 || >=16.0.0} @@ -14877,6 +15124,42 @@ packages: fsevents: 2.3.3 dev: true + /vite@4.5.0(@types/node@18.18.5)(sass@1.69.3): + resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.18.5 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 + sass: 1.69.3 + optionalDependencies: + fsevents: 2.3.3 + /vitest-canvas-mock@0.3.3(vitest@0.34.6): resolution: {integrity: sha512-3P968tYBpqYyzzOaVtqnmYjqbe13576/fkjbDEJSfQAkHtC5/UjuRHOhFEN/ZV5HVZIkaROBUWgazDKJ+Ibw+Q==} peerDependencies: @@ -14939,7 +15222,7 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 4.4.11(@types/node@18.18.5)(sass@1.69.3) + vite: 4.5.0(@types/node@18.18.5)(sass@1.69.3) vite-node: 0.34.6(@types/node@18.18.5)(sass@1.69.3) why-is-node-running: 2.2.2 transitivePeerDependencies: @@ -15164,6 +15447,10 @@ packages: dependencies: defaults: 1.0.4 + /webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + dev: true + /webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -15303,11 +15590,9 @@ packages: /webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} - dev: true /webpack-virtual-modules@0.5.0: resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} - dev: true /webpack@5.84.0(webpack-cli@5.1.1): resolution: {integrity: sha512-XezNK3kwJq6IyeoZmZ1uEqQs+42nTqIi4jYM/YjLwaJedUC1N3bwnCC0+UcnHJPfqWX0kGrQnMIvZZyWYaIZrA==} @@ -15444,6 +15729,14 @@ packages: webidl-conversions: 7.0.0 dev: true + /whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + dev: true + /which-pm@2.0.0: resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} engines: {node: '>=8.15'} diff --git a/scripts/copyh5.cjs b/scripts/copyh5.cjs index 4447caa924..fbbe731f2e 100644 --- a/scripts/copyh5.cjs +++ b/scripts/copyh5.cjs @@ -1,10 +1,43 @@ const targetBaseUrl = `${process.cwd()}/site_docs`; +const fs = require('fs'); const fse = require('fs-extra'); +const path = require('path'); +const replaceFile = (file) => { + fs.readFile(file, 'utf8', function(err, data) { + if (err) throw err; + + // 修改文件内容 + data = data.replace(/> demo: ([0-9a-z .]*)[\n|\r\n]/g, (_match, $1) => { + const [left, right] = $1.split(' '); + const target = path.resolve('src/packages/__VUE/', left, 'demo', `${right}.vue`); + let code = ''; + try { + code = fs.readFileSync(target, 'utf-8'); + } catch (err) { + code = + '[script] copy:h5 File not found: ' + target; + console.warn(code); + } + return code ? `:::demo + +\`\`\`vue +${code} +\`\`\` + +:::\n` : ''; + }); + + fs.writeFile(file, data, function(err) { + if (err) throw err; + }); + }); +} const copyFile = (from, to) => { fse .copy(from, to) .then(() => { console.log('success!>', to); + replaceFile(to); }) .catch((err) => { console.error(err); diff --git a/scripts/copytaro.cjs b/scripts/copytaro.cjs index b18ce10336..8fc5284783 100644 --- a/scripts/copytaro.cjs +++ b/scripts/copytaro.cjs @@ -71,4 +71,4 @@ const copy = async () => { }); }; // copy(reactBaseUrl, 'react'); -copy(); +copy(); \ No newline at end of file diff --git a/src/packages/__VUE/button/demo.vue b/src/packages/__VUE/button/demo.vue index 52abd4868b..7c7ccdb5e3 100644 --- a/src/packages/__VUE/button/demo.vue +++ b/src/packages/__VUE/button/demo.vue @@ -1,176 +1,80 @@ - diff --git a/src/packages/__VUE/button/demo/block.vue b/src/packages/__VUE/button/demo/block.vue new file mode 100644 index 0000000000..b7d030a0c1 --- /dev/null +++ b/src/packages/__VUE/button/demo/block.vue @@ -0,0 +1,3 @@ + diff --git a/src/packages/__VUE/button/demo/color.vue b/src/packages/__VUE/button/demo/color.vue new file mode 100644 index 0000000000..b84661127e --- /dev/null +++ b/src/packages/__VUE/button/demo/color.vue @@ -0,0 +1,5 @@ + diff --git a/src/packages/__VUE/button/demo/disabled.vue b/src/packages/__VUE/button/demo/disabled.vue new file mode 100644 index 0000000000..8e59e8f7bb --- /dev/null +++ b/src/packages/__VUE/button/demo/disabled.vue @@ -0,0 +1,5 @@ + diff --git a/src/packages/__VUE/button/demo/icon.vue b/src/packages/__VUE/button/demo/icon.vue new file mode 100644 index 0000000000..083ac32325 --- /dev/null +++ b/src/packages/__VUE/button/demo/icon.vue @@ -0,0 +1,16 @@ + + diff --git a/src/packages/__VUE/button/demo/loading.vue b/src/packages/__VUE/button/demo/loading.vue new file mode 100644 index 0000000000..7e1586055b --- /dev/null +++ b/src/packages/__VUE/button/demo/loading.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/packages/__VUE/button/demo/plain.vue b/src/packages/__VUE/button/demo/plain.vue new file mode 100644 index 0000000000..f4b237ebf7 --- /dev/null +++ b/src/packages/__VUE/button/demo/plain.vue @@ -0,0 +1,4 @@ + diff --git a/src/packages/__VUE/button/demo/shape.vue b/src/packages/__VUE/button/demo/shape.vue new file mode 100644 index 0000000000..cb7a925a7b --- /dev/null +++ b/src/packages/__VUE/button/demo/shape.vue @@ -0,0 +1,4 @@ + diff --git a/src/packages/__VUE/button/demo/size.vue b/src/packages/__VUE/button/demo/size.vue new file mode 100644 index 0000000000..a189b27aa9 --- /dev/null +++ b/src/packages/__VUE/button/demo/size.vue @@ -0,0 +1,6 @@ + diff --git a/src/packages/__VUE/button/demo/type.vue b/src/packages/__VUE/button/demo/type.vue new file mode 100644 index 0000000000..d52ffc5315 --- /dev/null +++ b/src/packages/__VUE/button/demo/type.vue @@ -0,0 +1,8 @@ + diff --git a/src/packages/__VUE/button/doc.en-US.md b/src/packages/__VUE/button/doc.en-US.md index aef243c433..b4d12c60a8 100644 --- a/src/packages/__VUE/button/doc.en-US.md +++ b/src/packages/__VUE/button/doc.en-US.md @@ -18,190 +18,78 @@ app.use(Button); The button supports six types: `default`, `primary`, `info`, `warning`, `danger`, `success`, the default is `default`. -:::demo - -```vue - -``` - -::: +> demo: button type ### Plain The button is set as a plain button through the `plain` property, the text of the plain button is the button color, and the background is white. -:::demo - -```vue - -``` - -::: +> demo: button plain ### Disabled The button is disabled through the `disabled` property, and the button cannot be clicked in the disabled state. -:::demo - -```vue - -``` - -::: +> demo: button disabled ### Shape Set the button shape through the `shape` property, support circle and square buttons, the default is circle. -:::demo - -```vue - -``` - -::: +> demo: button shape ### Loading -:::demo - -```vue - - - -``` - -::: +> demo: button loading ### Icon -:::demo - -```vue - - -``` - -::: +> demo: button icon ### Size Support `large`, `normal`, `small`, `mini` four sizes, the default is `normal`. -:::demo - -```vue - -``` - -::: +> demo: button size ### Block By default, the button is an inline block-level element. The `block` attribute can set the element type of the button to a block-level element, which is often used to implement banner buttons. -:::demo - -```vue - -``` - -::: +> demo: button block ### Custom Color The color of the button can be customized through the color property. -:::demo - -```vue - -``` - -::: +> demo: button color ## API ### Props -| Attribute | Description | Type | Default | -| --------- | --------------------------------------------------------------------- | ------- | --------- | -| type | Can be set to `primary` `info` `warning` `danger` `success` `default` | string | `default` | -| size | Can be set to `large` `small` `mini` `normal` | string | `normal` | -| shape | Can be set to `square` `round` | string | `round` | -| color | Button color, support incoming linear-gradient gradient color | string | - | -| plain | Whether to be plain button | boolean | `false` | -| disabled | Whether to disable button | boolean | `false` | -| block | Whether to set display block | boolean | `false` | -| loading | Whether to show loading status | boolean | `false` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| type | Can be set to `primary` `info` `warning` `danger` `success` `default` | string | `default` | +| size | Can be set to `large` `small` `mini` `normal` | string | `normal` | +| shape | Can be set to `square` `round` | string | `round` | +| color | Button color, support incoming linear-gradient gradient color | string | - | +| plain | Whether to be plain button | boolean | `false` | +| disabled | Whether to disable button | boolean | `false` | +| block | Whether to set display block | boolean | `false` | +| loading | Whether to show loading status | boolean | `false` | ### Slots -| Name | Description | -| ------- | -------------- | +| Name | Description | +| --- | --- | | default | button content | -| icon | button icon | +| icon | button icon | ### Events -| Event | Description | Arguments | -| ----- | --------------------------------- | ------------------- | +| Event | Description | Arguments | +| --- | --- | --- | | click | Emitted when component is clicked | `event: MouseEvent` | ## Theming @@ -210,46 +98,46 @@ The color of the button can be customized through the color property. The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| --nut-button-border-radius | _25px_ | -| --nut-button-border-width | _1px_ | -| --nut-button-icon-width | _16px_ | -| --nut-button-default-bg-color | _var(--nut-white)_ | -| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | -| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | -| --nut-button-default-padding | _0 18px_ | -| --nut-button-mini-padding | _0 12px_ | -| --nut-button-small-padding | _0 12px_ | -| --nut-button-small-height | _28px_ | -| --nut-button-mini-height | _24px_ | -| --nut-button-default-height | _38px_ | -| --nut-button-large-height | _48px_ | -| --nut-button-large-line-height | _46px_ | -| --nut-button-small-line-height | _26px_ | -| --nut-button-block-height | _48px_ | -| --nut-button-default-line-height | _36px_ | -| --nut-button-block-line-height | _46px_ | -| --nut-button-default-font-size | _var(--nut-font-size-2)_ | -| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | -| --nut-button-small-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-line-height | _1.2_ | -| --nut-button-disabled-opacity | _0.68_ | -| --nut-button-primary-color | _var(--nut-white)_ | -| --nut-button-primary-border-color | _var(--nut-primary-color)_ | -| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | -| --nut-button-info-color | _var(--nut-white)_ | -| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | -| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | -| --nut-button-success-color | _var(--nut-white)_ | -| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | -| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | -| --nut-button-danger-color | _var(--nut-white)_ | -| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-warning-color | _var(--nut-white)_ | -| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | -| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | -| --nut-button-plain-background-color | _var(--nut-white)_ | -| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | +| Name | Default Value | +| --- | --- | +| --nut-button-border-radius | _25px_ | +| --nut-button-border-width | _1px_ | +| --nut-button-icon-width | _16px_ | +| --nut-button-default-bg-color | _var(--nut-white)_ | +| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | +| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | +| --nut-button-default-padding | _0 18px_ | +| --nut-button-mini-padding | _0 12px_ | +| --nut-button-small-padding | _0 12px_ | +| --nut-button-small-height | _28px_ | +| --nut-button-mini-height | _24px_ | +| --nut-button-default-height | _38px_ | +| --nut-button-large-height | _48px_ | +| --nut-button-large-line-height | _46px_ | +| --nut-button-small-line-height | _26px_ | +| --nut-button-block-height | _48px_ | +| --nut-button-default-line-height | _36px_ | +| --nut-button-block-line-height | _46px_ | +| --nut-button-default-font-size | _var(--nut-font-size-2)_ | +| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | +| --nut-button-small-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-line-height | _1.2_ | +| --nut-button-disabled-opacity | _0.68_ | +| --nut-button-primary-color | _var(--nut-white)_ | +| --nut-button-primary-border-color | _var(--nut-primary-color)_ | +| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | +| --nut-button-info-color | _var(--nut-white)_ | +| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | +| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | +| --nut-button-success-color | _var(--nut-white)_ | +| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | +| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | +| --nut-button-danger-color | _var(--nut-white)_ | +| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-warning-color | _var(--nut-white)_ | +| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | +| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | +| --nut-button-plain-background-color | _var(--nut-white)_ | +| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | diff --git a/src/packages/__VUE/button/doc.md b/src/packages/__VUE/button/doc.md index 927ed86265..a4b3c5ceec 100644 --- a/src/packages/__VUE/button/doc.md +++ b/src/packages/__VUE/button/doc.md @@ -18,190 +18,79 @@ app.use(Button); 按钮支持 `default`、`primary`、`info`、`warning`、`danger`、`success` 六种类型,默认为 `default`。 -:::demo - -```vue - -``` - -::: +> demo: button type ### 朴素按钮 通过 `plain` 属性将按钮设置为朴素按钮,朴素按钮的文字为按钮颜色,背景为白色。 -:::demo - -```vue - -``` - -::: +> demo: button plain ### 禁用状态 通过 `disabled` 属性来禁用按钮,禁用状态下按钮不可点击。 -:::demo - -```vue - -``` - -::: +> demo: button disabled ### 按钮形状 通过 `shape` 属性设置按钮形状,支持圆形、方形按钮,默认为圆形。 -:::demo - -```vue - -``` - -::: +> demo: button shape ### 加载状态 -:::demo - -```vue - - - -``` - -::: +> demo: button loading ### 图标按钮 -:::demo - -```vue - - -``` - -::: +> demo: button icon ### 按钮尺寸 支持 `large`、`normal`、`small`、`mini` 四种尺寸,默认为 `normal`。 -:::demo - -```vue - -``` - -::: +> demo: button size ### 块级元素 按钮在默认情况下为行内块级元素,通过 `block` 属性可以将按钮的元素类型设置为块级元素,常用来实现通栏按钮。 -:::demo - -```vue - -``` - -::: +> demo: button block ### 自定义颜色 通过 color 属性可以自定义按钮的颜色。 -:::demo - -```vue - -``` -::: +> demo: button color ## API ### Props -| 参数 | 说明 | 类型 | 默认值 | -| -------- | ---------------------------------------------------------------------- | ------- | --------- | -| type | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string | `default` | -| size | 尺寸,可选值为 `large` `small` `mini` `normal` | string | `normal` | -| shape | 形状,可选值为 `square` `round` | string | `round` | -| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | string | - | -| plain | 是否为朴素按钮 | boolean | `false` | -| disabled | 是否禁用按钮 | boolean | `false` | -| block | 是否为块级元素 | boolean | `false` | -| loading | 按钮 `loading` 状态 | boolean | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| type | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string | `default` | +| size | 尺寸,可选值为 `large` `small` `mini` `normal` | string | `normal` | +| shape | 形状,可选值为 `square` `round` | string | `round` | +| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | string | - | +| plain | 是否为朴素按钮 | boolean | `false` | +| disabled | 是否禁用按钮 | boolean | `false` | +| block | 是否为块级元素 | boolean | `false` | +| loading | 按钮 `loading` 状态 | boolean | `false` | ### Slots -| 名称 | 说明 | -| ------- | -------- | +| 名称 | 说明 | +| --- | --- | | default | 按钮内容 | -| icon | 按钮图标 | +| icon | 按钮图标 | ### Events -| 事件名 | 说明 | 回调参数 | -| ------ | -------------- | ------------------- | -| click | 点击按钮时触发 | `event: MouseEvent` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| click | 点击按钮时触发 | `event: MouseEvent` | ## 主题定制 @@ -209,46 +98,46 @@ import { StarFill, Star } from '@nutui/icons-vue'; 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| --nut-button-border-radius | _25px_ | -| --nut-button-border-width | _1px_ | -| --nut-button-icon-width | _16px_ | -| --nut-button-default-bg-color | _var(--nut-white)_ | -| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | -| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | -| --nut-button-default-padding | _0 18px_ | -| --nut-button-mini-padding | _0 12px_ | -| --nut-button-small-padding | _0 12px_ | -| --nut-button-small-height | _28px_ | -| --nut-button-mini-height | _24px_ | -| --nut-button-default-height | _38px_ | -| --nut-button-large-height | _48px_ | -| --nut-button-large-line-height | _46px_ | -| --nut-button-small-line-height | _26px_ | -| --nut-button-block-height | _48px_ | -| --nut-button-default-line-height | _36px_ | -| --nut-button-block-line-height | _46px_ | -| --nut-button-default-font-size | _var(--nut-font-size-2)_ | -| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | -| --nut-button-small-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-line-height | _1.2_ | -| --nut-button-disabled-opacity | _0.68_ | -| --nut-button-primary-color | _var(--nut-white)_ | -| --nut-button-primary-border-color | _var(--nut-primary-color)_ | -| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | -| --nut-button-info-color | _var(--nut-white)_ | -| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | -| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | -| --nut-button-success-color | _var(--nut-white)_ | -| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | -| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | -| --nut-button-danger-color | _var(--nut-white)_ | -| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-warning-color | _var(--nut-white)_ | -| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | -| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | -| --nut-button-plain-background-color | _var(--nut-white)_ | -| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-button-border-radius | _25px_ | +| --nut-button-border-width | _1px_ | +| --nut-button-icon-width | _16px_ | +| --nut-button-default-bg-color | _var(--nut-white)_ | +| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | +| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | +| --nut-button-default-padding | _0 18px_ | +| --nut-button-mini-padding | _0 12px_ | +| --nut-button-small-padding | _0 12px_ | +| --nut-button-small-height | _28px_ | +| --nut-button-mini-height | _24px_ | +| --nut-button-default-height | _38px_ | +| --nut-button-large-height | _48px_ | +| --nut-button-large-line-height | _46px_ | +| --nut-button-small-line-height | _26px_ | +| --nut-button-block-height | _48px_ | +| --nut-button-default-line-height | _36px_ | +| --nut-button-block-line-height | _46px_ | +| --nut-button-default-font-size | _var(--nut-font-size-2)_ | +| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | +| --nut-button-small-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-line-height | _1.2_ | +| --nut-button-disabled-opacity | _0.68_ | +| --nut-button-primary-color | _var(--nut-white)_ | +| --nut-button-primary-border-color | _var(--nut-primary-color)_ | +| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | +| --nut-button-info-color | _var(--nut-white)_ | +| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | +| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | +| --nut-button-success-color | _var(--nut-white)_ | +| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | +| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | +| --nut-button-danger-color | _var(--nut-white)_ | +| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-warning-color | _var(--nut-white)_ | +| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | +| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | +| --nut-button-plain-background-color | _var(--nut-white)_ | +| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | diff --git a/src/packages/__VUE/button/doc.taro.md b/src/packages/__VUE/button/doc.taro.md index ebca15ff22..a1f328505b 100644 --- a/src/packages/__VUE/button/doc.taro.md +++ b/src/packages/__VUE/button/doc.taro.md @@ -123,7 +123,7 @@ const changeLoading = () => { ``` @@ -179,30 +179,30 @@ import { StarFill, Star } from '@nutui/icons-vue'; ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | ---------------------------------------------------------------------- | ------- | --------- | -| type | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string | `default` | -| form-type`4.0.7` | 表单类型,可选值 `button` `submit` `reset` | string | `button` | -| size | 尺寸,可选值为 `large` `small` `mini` `normal` | string | `normal` | -| shape | 形状,可选值为 `square` `round` | string | `round` | -| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | string | - | -| plain | 是否为朴素按钮 | boolean | `false` | -| disabled | 是否禁用按钮 | boolean | `false` | -| block | 是否为块级元素 | boolean | `false` | -| loading | 按钮 `loading` 状态 | boolean | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| type | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string | `default` | +| form-type`4.0.7` | 表单类型,可选值 `button` `submit` `reset` | string | `button` | +| size | 尺寸,可选值为 `large` `small` `mini` `normal` | string | `normal` | +| shape | 形状,可选值为 `square` `round` | string | `round` | +| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | string | - | +| plain | 是否为朴素按钮 | boolean | `false` | +| disabled | 是否禁用按钮 | boolean | `false` | +| block | 是否为块级元素 | boolean | `false` | +| loading | 按钮 `loading` 状态 | boolean | `false` | ### Slots -| 名称 | 说明 | -| ------- | -------- | +| 名称 | 说明 | +| --- | --- | | default | 按钮内容 | -| icon | 按钮图标 | +| icon | 按钮图标 | ### Events -| 事件名 | 说明 | 回调参数 | -| ------ | -------------- | ------------------- | -| click | 点击按钮时触发 | `event: MouseEvent` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| click | 点击按钮时触发 | `event: MouseEvent` | ## 主题定制 @@ -210,46 +210,46 @@ import { StarFill, Star } from '@nutui/icons-vue'; 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| --nut-button-border-radius | _25px_ | -| --nut-button-border-width | _1px_ | -| --nut-button-icon-width | _16px_ | -| --nut-button-default-bg-color | _var(--nut-white)_ | -| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | -| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | -| --nut-button-default-padding | _0 18px_ | -| --nut-button-mini-padding | _0 12px_ | -| --nut-button-small-padding | _0 12px_ | -| --nut-button-small-height | _28px_ | -| --nut-button-mini-height | _24px_ | -| --nut-button-default-height | _38px_ | -| --nut-button-large-height | _48px_ | -| --nut-button-large-line-height | _46px_ | -| --nut-button-small-line-height | _26px_ | -| --nut-button-block-height | _48px_ | -| --nut-button-default-line-height | _36px_ | -| --nut-button-block-line-height | _46px_ | -| --nut-button-default-font-size | _var(--nut-font-size-2)_ | -| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | -| --nut-button-small-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | -| --nut-button-mini-line-height | _1.2_ | -| --nut-button-disabled-opacity | _0.68_ | -| --nut-button-primary-color | _var(--nut-white)_ | -| --nut-button-primary-border-color | _var(--nut-primary-color)_ | -| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | -| --nut-button-info-color | _var(--nut-white)_ | -| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | -| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | -| --nut-button-success-color | _var(--nut-white)_ | -| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | -| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | -| --nut-button-danger-color | _var(--nut-white)_ | -| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | -| --nut-button-warning-color | _var(--nut-white)_ | -| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | -| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | -| --nut-button-plain-background-color | _var(--nut-white)_ | -| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-button-border-radius | _25px_ | +| --nut-button-border-width | _1px_ | +| --nut-button-icon-width | _16px_ | +| --nut-button-default-bg-color | _var(--nut-white)_ | +| --nut-button-default-border-color | _rgba(204, 204, 204, 1)_ | +| --nut-button-default-color | _rgba(102, 102, 102, 1)_ | +| --nut-button-default-padding | _0 18px_ | +| --nut-button-mini-padding | _0 12px_ | +| --nut-button-small-padding | _0 12px_ | +| --nut-button-small-height | _28px_ | +| --nut-button-mini-height | _24px_ | +| --nut-button-default-height | _38px_ | +| --nut-button-large-height | _48px_ | +| --nut-button-large-line-height | _46px_ | +| --nut-button-small-line-height | _26px_ | +| --nut-button-block-height | _48px_ | +| --nut-button-default-line-height | _36px_ | +| --nut-button-block-line-height | _46px_ | +| --nut-button-default-font-size | _var(--nut-font-size-2)_ | +| --nut-button-large-font-size | _var(--nut-button-default-font-size)_ | +| --nut-button-small-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-font-size | _var(--nut-font-size-1)_ | +| --nut-button-mini-line-height | _1.2_ | +| --nut-button-disabled-opacity | _0.68_ | +| --nut-button-primary-color | _var(--nut-white)_ | +| --nut-button-primary-border-color | _var(--nut-primary-color)_ | +| --nut-button-primary-background-color | _linear-gradient(135deg,var(--nut-primary-color) 0%,var(--nut-primary-color-end) 100%)_ | +| --nut-button-info-color | _var(--nut-white)_ | +| --nut-button-info-border-color | _rgba(73, 106, 242, 1)_ | +| --nut-button-info-background-color | _linear-gradient(315deg, rgba(73, 143, 242, 1) 0%, rgba(73, 101, 242, 1) 100%)_ | +| --nut-button-success-color | _var(--nut-white)_ | +| --nut-button-success-border-color | _rgba(38, 191, 38, 1)_ | +| --nut-button-success-background-color | _linear-gradient(135deg,rgba(38, 191, 38, 1) 0%,rgba(39, 197, 48, 1) 45%,rgba(40, 207, 63, 1) 83%,rgba(41, 212, 70, 1) 100%)_ | +| --nut-button-danger-color | _var(--nut-white)_ | +| --nut-button-danger-border-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-danger-background-color | _rgba(250, 44, 25, 1)_ | +| --nut-button-warning-color | _var(--nut-white)_ | +| --nut-button-warning-border-color | _rgba(255, 158, 13, 1)_ | +| --nut-button-warning-background-color | _linear-gradient(135deg,rgba(255, 158, 13, 1) 0%,rgba(255, 167, 13, 1) 45%,rgba(255, 182, 13, 1) 83%,rgba(255, 190, 13, 1) 100%)_ | +| --nut-button-plain-background-color | _var(--nut-white)_ | +| --nut-button-small-round-border-radius | _var(--nut-button-border-radius)_ | diff --git a/src/packages/utils/useLocale/index.ts b/src/packages/utils/useLocale/index.ts index b5b038f2a3..eda3528922 100644 --- a/src/packages/utils/useLocale/index.ts +++ b/src/packages/utils/useLocale/index.ts @@ -1,11 +1,11 @@ import locale from '@/packages/locale'; import { getPropByPath, isFunction } from '../util'; -export const useLocale = (name = '') => { - return (keyPath: string, ...args: unknown[]) => { +export const useLocale = (name = '') => { + return (keyPath: T, ...args: unknown[]) => { name = name.toLocaleLowerCase(); const languages = locale.languages(); - let text = keyPath; + let text: string = keyPath; if (name && name.startsWith('nut')) { text = `${name.slice(3)}.${keyPath}`; } diff --git a/src/sites/assets/util/useTranslate.ts b/src/sites/assets/util/useTranslate.ts index 30e6fc264a..f2caf63085 100644 --- a/src/sites/assets/util/useTranslate.ts +++ b/src/sites/assets/util/useTranslate.ts @@ -1,9 +1,20 @@ import Locale from '@/packages/locale'; +import { useLocale } from '@/packages/utils/useLocale'; export const currentLang = Locale.currentLang; -export const useTranslate = (object: Record) => { +// @type-challenges +type TupleToUnion = T[number]; +export const useTranslate = (object: { + 'zh-CN': { + [key in TupleToUnion]: string; + }; + 'en-US': { + [key in TupleToUnion]: string; + }; +}) => { for (const [key, value] of Object.entries(object)) { Locale.merge(key, value); } + return useLocale>(); }; export const translateChange = () => { diff --git a/vite.config.jdt.ts b/vite.config.jdt.ts index 766a2fc6dd..1f91a09188 100644 --- a/vite.config.jdt.ts +++ b/vite.config.jdt.ts @@ -1,10 +1,8 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; -import Markdown from 'unplugin-vue-markdown/vite'; import path from 'path'; import config from './package.json'; -const hljs = require('highlight.js'); // https://highlightjs.org/ -import { compressText } from './src/sites/doc/components/demo-block/basedUtil'; +import { markdown } from '@nutui/vite-plugins'; const resolve = path.resolve; // https://vitejs.dev/config/ export default defineConfig({ @@ -48,43 +46,9 @@ export default defineConfig({ vue({ include: [/\.vue$/, /\.md$/] }), - Markdown({ - // default options passed to markdown-it - // see: https://markdown-it.github.io/markdown-it/ - markdownItOptions: { - highlight: function (str, lang) { - if (lang && hljs.getLanguage(lang)) { - try { - return hljs.highlight(lang, str).value; - } catch (__) {} - } - - return ''; // 使用额外的默认转义 - } - }, - markdownItSetup(md) { - md.use(require('markdown-it-container'), 'demo', { - validate: function (params) { - return params.match(/^demo\s*(.*)$/); - }, - - render: function (tokens, idx) { - const m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); - if (tokens[idx].nesting === 1) { - // opening tag - const contentHtml = compressText(tokens[idx + 1].content); - return `` + md.utils.escapeHtml(m[1]) + '\n'; - } else { - // closing tag - return '\n'; - } - } - }); - } + markdown({ + docRoot: path.resolve(__dirname, './src/packages/__VUE') }) - // legacy({ - // targets: ['defaults', 'not IE 11'] - // }) ], build: { target: 'es2015', diff --git a/vite.config.ts b/vite.config.ts index 01ad30f7eb..3e21e9d425 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,12 +1,10 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; -import Markdown from 'unplugin-vue-markdown/vite'; -import MarkdownIt from 'markdown-it-container'; import path from 'path'; import config from './package.json'; -import hljs from 'highlight.js'; import autoprefixer from 'autoprefixer'; -import { compressText } from './src/sites/doc/components/demo-block/basedUtil'; +import Inspect from 'vite-plugin-inspect'; +import { markdown } from '@nutui/vite-plugins'; const resolve = path.resolve; // https://vitejs.dev/config/ export default defineConfig({ @@ -47,52 +45,12 @@ export default defineConfig({ } }, plugins: [ + Inspect(), vue({ include: [/\.vue$/, /\.md$/] }), - Markdown({ - // default options passed to markdown-it - // see: https://markdown-it.github.io/markdown-it/ - markdownItOptions: { - typographer: false, - highlight: function (str, lang) { - if (lang && lang === 'vue') { - try { - return hljs.highlight(str, { - language: 'html' - }).value; - } catch (__) {} - } - if (lang && hljs.getLanguage(lang)) { - try { - return hljs.highlight(str, { - language: lang - }).value; - } catch (__) {} - } - - return ''; // 使用额外的默认转义 - } - }, - markdownItSetup(md) { - md.use(MarkdownIt, 'demo', { - validate: function (params) { - return params.match(/^demo\s*(.*)$/); - }, - - render: function (tokens, idx) { - const m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); - if (tokens[idx].nesting === 1) { - // opening tag - const contentHtml = compressText(tokens[idx + 1].content); - return `` + md.utils.escapeHtml(m[1]) + '\n'; - } else { - // closing tag - return '\n'; - } - } - }); - } + markdown({ + docRoot: path.resolve(__dirname, './src/packages/__VUE') }) ], build: {