From 344a032ac3364a08af9e9dfb11a5fee7573953e1 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 22 Feb 2022 20:27:01 +0800 Subject: [PATCH] docs: add docs --- README.md | 6 +- docs/.gitignore | 3 + docs/package-lock.json | 2030 +++++++++++++++++ docs/package.json | 17 + docs/src/.vuepress/clientAppEnhance.ts | 13 + docs/src/.vuepress/config.ts | 144 ++ docs/src/.vuepress/demo-block.vue | 360 +++ docs/src/.vuepress/styles/index.scss | 3 + docs/src/README.md | 22 + docs/src/api/base-config.md | 179 ++ docs/src/api/editor.md | 294 +++ docs/src/api/field-config.md | 1222 ++++++++++ docs/src/api/form.md | 163 ++ docs/src/api/model.md | 590 +++++ docs/src/component/introduction.md | 209 ++ docs/src/guide/advanced/coupling.md | 171 ++ .../src/guide/advanced/high-level-function.md | 45 + docs/src/guide/advanced/js-schema.md | 137 ++ docs/src/guide/advanced/layout.md | 49 + docs/src/guide/advanced/magic-form.md | 135 ++ docs/src/guide/advanced/magic-ui.md | 30 + docs/src/guide/advanced/page.md | 65 + docs/src/guide/conception.md | 62 + docs/src/guide/installation.md | 159 ++ docs/src/guide/introduction.md | 45 + docs/src/page/advanced.md | 142 ++ docs/src/page/introduction.md | 106 + package.json | 2 +- playground/package-lock.json | 2 +- playground/src/pages/Editor.vue | 6 +- playground/vite.config.ts | 11 +- runtime/react/src/playground/main.tsx | 2 +- runtime/react/vite.config.ts | 2 +- runtime/vue2/src/playground/main.ts | 2 +- runtime/vue2/vite.config.ts | 2 +- runtime/vue3/src/playground/main.ts | 2 +- runtime/vue3/vite.config.ts | 2 +- 37 files changed, 6416 insertions(+), 18 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/package-lock.json create mode 100644 docs/package.json create mode 100644 docs/src/.vuepress/clientAppEnhance.ts create mode 100644 docs/src/.vuepress/config.ts create mode 100644 docs/src/.vuepress/demo-block.vue create mode 100644 docs/src/.vuepress/styles/index.scss create mode 100644 docs/src/README.md create mode 100644 docs/src/api/base-config.md create mode 100644 docs/src/api/editor.md create mode 100644 docs/src/api/field-config.md create mode 100644 docs/src/api/form.md create mode 100644 docs/src/api/model.md create mode 100644 docs/src/component/introduction.md create mode 100644 docs/src/guide/advanced/coupling.md create mode 100644 docs/src/guide/advanced/high-level-function.md create mode 100644 docs/src/guide/advanced/js-schema.md create mode 100644 docs/src/guide/advanced/layout.md create mode 100644 docs/src/guide/advanced/magic-form.md create mode 100644 docs/src/guide/advanced/magic-ui.md create mode 100644 docs/src/guide/advanced/page.md create mode 100644 docs/src/guide/conception.md create mode 100644 docs/src/guide/installation.md create mode 100644 docs/src/guide/introduction.md create mode 100644 docs/src/page/advanced.md create mode 100644 docs/src/page/introduction.md diff --git a/README.md b/README.md index 34267e4b..8da2294d 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,14 @@ TMagic 可视化搭建平台。 # 文档 -文档请移步 +文档请移步 https://tencent.github.io/tmagic-editor/docs/index.html 目前文档仍在逐步完善中,如有疑问欢迎给我们提 issue。 +# Playground 体验 + +https://tencent.github.io/tmagic-editor/playground/index.html + ## 环境准备 node.js > 14 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..d46af724 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +node_modules +.temp +.cache diff --git a/docs/package-lock.json b/docs/package-lock.json new file mode 100644 index 00000000..580326cb --- /dev/null +++ b/docs/package-lock.json @@ -0,0 +1,2030 @@ +{ + "name": "docs", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/parser": { + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", + "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "dev": true + }, + "@ctrl/tinycolor": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz", + "integrity": "sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ==" + }, + "@element-plus/icons-vue": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-0.2.7.tgz", + "integrity": "sha512-S8kDbfVaWkQvbUYQE1ui448tzaHfUvyESCep9J6uPRlViyQPXjdIfwLBhV6AmQSOfFS8rL+xehJGhvzPXLrSBg==" + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@popperjs/core": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.2.tgz", + "integrity": "sha512-92FRmppjjqz29VMJ2dn+xdyXZBrMlE42AV6Kq6BwjWV7CNUW1hs2FtxSNLQE+gJhaZ6AAmYuO9y8dshhcBl7vA==" + }, + "@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "dev": true, + "requires": { + "@types/ms": "*" + } + }, + "@types/fs-extra": { + "version": "9.0.13", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", + "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/hash-sum": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/hash-sum/-/hash-sum-1.0.0.tgz", + "integrity": "sha512-FdLBT93h3kcZ586Aee66HPCVJ6qvxVjBlDWNmxSGSbCZe9hTsjRKdSsl4y1T+3zfujxo9auykQMnFsfyHWD7wg==", + "dev": true + }, + "@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "dev": true + }, + "@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "requires": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, + "@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", + "dev": true + }, + "@types/node": { + "version": "17.0.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.19.tgz", + "integrity": "sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==", + "dev": true + }, + "@vitejs/plugin-vue": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.2.2.tgz", + "integrity": "sha512-3C0s45VOwIFEDU+2ownJOpb0zD5fnjXWaHVOLID2R1mYOlAx3doNBFnNbVjaZvpke/L7IdPJXjpyYpXZToDKig==", + "dev": true + }, + "@vue/compiler-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.31.tgz", + "integrity": "sha512-aKno00qoA4o+V/kR6i/pE+aP+esng5siNAVQ422TkBNM6qA4veXiZbSe8OTXHXquEi/f6Akc+nLfB4JGfe4/WQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.31.tgz", + "integrity": "sha512-60zIlFfzIDf3u91cqfqy9KhCKIJgPeqxgveH2L+87RcGU/alT6BRrk5JtUso0OibH3O7NXuNOQ0cDc9beT0wrg==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/compiler-sfc": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.31.tgz", + "integrity": "sha512-748adc9msSPGzXgibHiO6T7RWgfnDcVQD+VVwYgSsyyY8Ans64tALHZANrKtOzvkwznV/F4H7OAod/jIlp/dkQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-ssr": "3.2.31", + "@vue/reactivity-transform": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-ssr": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.31.tgz", + "integrity": "sha512-mjN0rqig+A8TVDnsGPYJM5dpbjlXeHUm2oZHZwGyMYiGT/F4fhJf/cXy8QpjnLQK4Y9Et4GWzHn9PS8AHUnSkw==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/devtools-api": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.12.tgz", + "integrity": "sha512-iO/4FIezHKXhiDBdKySCvJVh8/mZPxHpiQrTy+PXVqJZgpTPTdHy4q8GXulaY+UKEagdkBb0onxNQZ0LNiqVhw==", + "dev": true + }, + "@vue/reactivity": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.31.tgz", + "integrity": "sha512-HVr0l211gbhpEKYr2hYe7hRsV91uIVGFYNHj73njbARVGHQvIojkImKMaZNDdoDZOIkMsBc9a1sMqR+WZwfSCw==", + "dev": true, + "requires": { + "@vue/shared": "3.2.31" + } + }, + "@vue/reactivity-transform": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.31.tgz", + "integrity": "sha512-uS4l4z/W7wXdI+Va5pgVxBJ345wyGFKvpPYtdSgvfJfX/x2Ymm6ophQlXXB6acqGHtXuBqNyyO3zVp9b1r0MOA==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "@vue/runtime-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.31.tgz", + "integrity": "sha512-Kcog5XmSY7VHFEMuk4+Gap8gUssYMZ2+w+cmGI6OpZWYOEIcbE0TPzzPHi+8XTzAgx1w/ZxDFcXhZeXN5eKWsA==", + "dev": true, + "requires": { + "@vue/reactivity": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/runtime-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.31.tgz", + "integrity": "sha512-N+o0sICVLScUjfLG7u9u5XCjvmsexAiPt17GNnaWHJUfsKed5e85/A3SWgKxzlxx2SW/Hw7RQxzxbXez9PtY3g==", + "dev": true, + "requires": { + "@vue/runtime-core": "3.2.31", + "@vue/shared": "3.2.31", + "csstype": "^2.6.8" + } + }, + "@vue/server-renderer": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.31.tgz", + "integrity": "sha512-8CN3Zj2HyR2LQQBHZ61HexF5NReqngLT3oahyiVRfSSvak+oAvVmu8iNLSu6XR77Ili2AOpnAt1y8ywjjqtmkg==", + "dev": true, + "requires": { + "@vue/compiler-ssr": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/shared": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", + "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==", + "dev": true + }, + "@vuepress/bundler-vite": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/bundler-vite/-/bundler-vite-2.0.0-beta.35.tgz", + "integrity": "sha512-U8u7t9dDRxoh5MV++ntQUJUsofennBla+8weca+C2LEhSqzlqaDvqCsmVI0sc5vipBDfSWvwNqCb+cRTdlXirw==", + "dev": true, + "requires": { + "@vitejs/plugin-vue": "^2.1.0", + "@vue/compiler-sfc": "^3.2.28", + "@vue/server-renderer": "^3.2.28", + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "autoprefixer": "^10.4.2", + "connect-history-api-fallback": "^1.6.0", + "postcss": "^8.4.5", + "postcss-csso": "^6.0.0", + "rollup": "^2.66.0", + "vite": "^2.7.13", + "vue": "^3.2.28", + "vue-router": "^4.0.12" + } + }, + "@vuepress/cli": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/cli/-/cli-2.0.0-beta.35.tgz", + "integrity": "sha512-m+BfO2z4C/MlqE+QBBRvgaMk9eUESMca+3XXaXl3l6ciHZ/pZOeDodMCZpiVeNpWbQT5qNNnt1DITyWlF6DyMw==", + "dev": true, + "requires": { + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "cac": "^6.7.12", + "chokidar": "^3.5.3", + "envinfo": "^7.8.1", + "esbuild": "^0.13.12" + } + }, + "@vuepress/client": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/client/-/client-2.0.0-beta.35.tgz", + "integrity": "sha512-oQj+fDvfDDJ+fPpcVVRJLeVX1QmnLCcpLBxPBVhqMD0WAFkj+sCBaeq0sQc5CwDaNysDcN71ACeuEpLDOEtCgQ==", + "dev": true, + "requires": { + "@vue/devtools-api": "^6.0.0-beta.21.1", + "@vuepress/shared": "2.0.0-beta.35", + "vue": "^3.2.28", + "vue-router": "^4.0.12" + } + }, + "@vuepress/core": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/core/-/core-2.0.0-beta.35.tgz", + "integrity": "sha512-EWcO/C+VgYl/i4o5arfKeasvtRUgHBe/fNqiDwTGysJVlez6brH1TvViTPth1nAXi+YZeJ6C2LCuH7gCU6Wh+w==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/markdown": "2.0.0-beta.35", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "gray-matter": "^4.0.3", + "toml": "^3.0.0" + } + }, + "@vuepress/markdown": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/markdown/-/markdown-2.0.0-beta.35.tgz", + "integrity": "sha512-fVg3UlQ86eaUXVHMW3SSZwSkaQvdx1CbGmsl3nZ/FZ3FbEIhHUeaZmLcNiaI3y8P4ORH/Nhit17gtcDCc6yPNg==", + "dev": true, + "requires": { + "@types/markdown-it": "^12.2.3", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "markdown-it-emoji": "^2.0.0", + "mdurl": "^1.0.1" + } + }, + "@vuepress/plugin-active-header-links": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-active-header-links/-/plugin-active-header-links-2.0.0-beta.35.tgz", + "integrity": "sha512-TQJqoIpRBFaohu7wHdwUrUkubA6S58MGDI8MkfkEFEN+fDarUEUOpWC3AIZUYbHTAJp1qRCRl4ZEB85xvhPOcg==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "ts-debounce": "^4.0.0", + "vue": "^3.2.28", + "vue-router": "^4.0.12" + } + }, + "@vuepress/plugin-back-to-top": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-back-to-top/-/plugin-back-to-top-2.0.0-beta.35.tgz", + "integrity": "sha512-8gAZBZhUML9/nNXirInI7qZhQkIeTrqp30IcpteoyFWCOM8XAE5I9zH7PxG5zNm4YN0k5WkLK0VICybPODyjEA==", + "dev": true, + "requires": { + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "ts-debounce": "^4.0.0", + "vue": "^3.2.28" + } + }, + "@vuepress/plugin-container": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-container/-/plugin-container-2.0.0-beta.35.tgz", + "integrity": "sha512-cfkeOLg1FciVJgJIw9M+SRQ2qSwnW8J2/nmW19W8SGg9PdADIfnfHjVWKeSno3Y6RgA0v94fbnWEyC5MLp0wwA==", + "dev": true, + "requires": { + "@types/markdown-it": "^12.2.3", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/markdown": "2.0.0-beta.35", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "markdown-it": "^12.3.2", + "markdown-it-container": "^3.0.0" + } + }, + "@vuepress/plugin-external-link-icon": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-external-link-icon/-/plugin-external-link-icon-2.0.0-beta.35.tgz", + "integrity": "sha512-CRXxtv4yQu29s4MQysN1e0gZn5wzl7o5fmzxn6YcZLY6UfEH9vYTyxM+YWyIdekHsHfz5JM0zDghZ5ds2lvJKQ==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/markdown": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "vue": "^3.2.28" + } + }, + "@vuepress/plugin-git": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-git/-/plugin-git-2.0.0-beta.35.tgz", + "integrity": "sha512-XBqEMlKO8SXIttJy0ughodsI40AbCeFZkS6WmmX1IfUzL/yPVzcIMKaTzNzza2YYt7qBjrJspApzBQhCqMof/g==", + "dev": true, + "requires": { + "@vuepress/core": "2.0.0-beta.35", + "execa": "^5.1.1" + } + }, + "@vuepress/plugin-medium-zoom": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-medium-zoom/-/plugin-medium-zoom-2.0.0-beta.35.tgz", + "integrity": "sha512-AnBSCOWkd6juBwlEKESftk+UWOxJPYbdSEW/u4MuKtCaahcR9O4R2ZcSmH5O6mpl/MzOP02Ac0h5+UIsSHzZ2g==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "medium-zoom": "^1.0.6", + "vue": "^3.2.28" + } + }, + "@vuepress/plugin-nprogress": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-nprogress/-/plugin-nprogress-2.0.0-beta.35.tgz", + "integrity": "sha512-Biu/91xG7FGr3OWyWXC5CKdJgcA8dxBaq1Q+MicvWo/9Og7kXfOSI5z0o6DVuGbFULfkctb2UJj/NT7xYW/2PA==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "nprogress": "^0.2.0", + "vue": "^3.2.28", + "vue-router": "^4.0.12" + } + }, + "@vuepress/plugin-palette": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-palette/-/plugin-palette-2.0.0-beta.35.tgz", + "integrity": "sha512-VSZSWbttnW2jF9AMsvpfBA63sP+bFvKuFCP8Uwfc6FLJaav1CConrrMYi1y0RmU0BmVsJzWYkaMmiUALA/cQKw==", + "dev": true, + "requires": { + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "chokidar": "^3.5.3" + } + }, + "@vuepress/plugin-prismjs": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-prismjs/-/plugin-prismjs-2.0.0-beta.35.tgz", + "integrity": "sha512-MIjofK5OEiSy6yPPGBNWp4YZezJB1sF7hzFi945ts3P6XXTBt1LctjzvVvQumNCRYYB+tsd3ge8+EzAQtznGXQ==", + "dev": true, + "requires": { + "@vuepress/core": "2.0.0-beta.35", + "prismjs": "^1.26.0" + } + }, + "@vuepress/plugin-theme-data": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/plugin-theme-data/-/plugin-theme-data-2.0.0-beta.35.tgz", + "integrity": "sha512-iFVus6jbKk/BgBFMU3Xf1VQiCo89Tz6j5P67m1Xj7maTfCKxKOBfjxdVLBx6oLAY8WC19pcpeWXigqcKXMvzjA==", + "dev": true, + "requires": { + "@vue/devtools-api": "^6.0.0-beta.21.1", + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "vue": "^3.2.28" + } + }, + "@vuepress/shared": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/shared/-/shared-2.0.0-beta.35.tgz", + "integrity": "sha512-sU+ekNDv22YG16B1XmZyMD+A94QbAUgTp5FTs+X2POU9UQCIZCuFhgTM9TfAnSgD/6lnbp2Aljwg5fJAidPQmw==", + "dev": true, + "requires": { + "@vue/shared": "^3.2.28" + } + }, + "@vuepress/theme-default": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/theme-default/-/theme-default-2.0.0-beta.35.tgz", + "integrity": "sha512-g30Pur96tz1w1lRtUxJzF3J8/QYJL+o2ACuGinZ0GuBlcLXmbD1enqxTf/Ie9skd049YLEYb9LITG3MDPLjtWg==", + "dev": true, + "requires": { + "@vuepress/client": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/plugin-active-header-links": "2.0.0-beta.35", + "@vuepress/plugin-back-to-top": "2.0.0-beta.35", + "@vuepress/plugin-container": "2.0.0-beta.35", + "@vuepress/plugin-external-link-icon": "2.0.0-beta.35", + "@vuepress/plugin-git": "2.0.0-beta.35", + "@vuepress/plugin-medium-zoom": "2.0.0-beta.35", + "@vuepress/plugin-nprogress": "2.0.0-beta.35", + "@vuepress/plugin-palette": "2.0.0-beta.35", + "@vuepress/plugin-prismjs": "2.0.0-beta.35", + "@vuepress/plugin-theme-data": "2.0.0-beta.35", + "@vuepress/shared": "2.0.0-beta.35", + "@vuepress/utils": "2.0.0-beta.35", + "@vueuse/core": "^7.5.4", + "sass": "^1.49.0", + "sass-loader": "^12.4.0", + "vue": "^3.2.28", + "vue-router": "^4.0.12" + } + }, + "@vuepress/utils": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@vuepress/utils/-/utils-2.0.0-beta.35.tgz", + "integrity": "sha512-359RVp8T5w+OB/rKy3DYBFqrH98IDWxiB2pf1Z9vgUA54p5xWBbvmh5GwIAfz1PDjpC5BOIk1b1/03VgcJSZFg==", + "dev": true, + "requires": { + "@types/debug": "^4.1.7", + "@types/fs-extra": "^9.0.13", + "@types/hash-sum": "^1.0.0", + "@vuepress/shared": "2.0.0-beta.35", + "chalk": "^4.1.2", + "debug": "^4.3.3", + "fs-extra": "^10.0.0", + "globby": "^11.0.4", + "hash-sum": "^2.0.0", + "ora": "^5.4.1", + "upath": "^2.0.1" + } + }, + "@vueuse/core": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-7.6.2.tgz", + "integrity": "sha512-bjAbXJVJO6aElMaZtDz2B70C0L6jFk/jGVqJxWZS5huffxA6dW5DN6tQQJwzOnx9B9rDhePHJIFKsix0qZIH2Q==", + "requires": { + "@vueuse/shared": "7.6.2", + "vue-demi": "*" + } + }, + "@vueuse/shared": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-7.6.2.tgz", + "integrity": "sha512-ThDld4Mx501tahRuHV6qJGkwCr17GknZrOzlD02Na9qJcH7Pq0quNTLx5cNDou7b1CKNvE3BXi2w/hz9KuPNTQ==", + "requires": { + "vue-demi": "*" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "async-validator": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.0.7.tgz", + "integrity": "sha512-Pj2IR7u8hmUEDOwB++su6baaRi+QvsgajuFB9j95foM1N2gy5HM4z60hfusIO0fBPG5uLAEl6yCJr1jNSVugEQ==" + }, + "autoprefixer": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.2.tgz", + "integrity": "sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ==", + "dev": true, + "requires": { + "browserslist": "^4.19.1", + "caniuse-lite": "^1.0.30001297", + "fraction.js": "^4.1.2", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browserslist": { + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", + "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001312", + "electron-to-chromium": "^1.4.71", + "escalade": "^3.1.1", + "node-releases": "^2.0.2", + "picocolors": "^1.0.0" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "cac": { + "version": "6.7.12", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.12.tgz", + "integrity": "sha512-rM7E2ygtMkJqD9c7WnFU6fruFcN3xe4FM5yUmgxhZzIKJk4uHl9U/fhwdajGFQbQuv43FAUo1Fe8gX/oIKDeSA==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001312", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz", + "integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "dev": true + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "css-tree": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.0.4.tgz", + "integrity": "sha512-b4IS9ZUMtGBiNjzYbcj9JhYbyei99R3ai2CSxlu8GQDnoPA/P+NU85hAm0eKDc/Zp660rpK6tFJQ2OSdacMHVg==", + "dev": true, + "requires": { + "mdn-data": "2.0.23", + "source-map-js": "^1.0.1" + } + }, + "csso": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.2.tgz", + "integrity": "sha512-llFAe1UfFHy38ziX+YrPMGkn5MxdjzYtz0drvgnjRY/tLPmBRxotYTGO51BsKe9voQA074pEb0udV+piXH4scQ==", + "dev": true, + "requires": { + "css-tree": "~2.0.4" + } + }, + "csstype": { + "version": "2.6.19", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", + "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==", + "dev": true + }, + "dayjs": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "electron-to-chromium": { + "version": "1.4.71", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz", + "integrity": "sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw==", + "dev": true + }, + "element-plus": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.0.2.tgz", + "integrity": "sha512-URjC0HwwiqtlLxqTmHXQ31WXrdAq4ChWyyn52OcQs3PRsnMPfahGVq2AWnfzzlzlhVeI5lY3HQiuB1zDathS+g==", + "requires": { + "@ctrl/tinycolor": "^3.4.0", + "@element-plus/icons-vue": "^0.2.6", + "@popperjs/core": "^2.11.2", + "@vueuse/core": "^7.6.0", + "async-validator": "^4.0.7", + "dayjs": "^1.10.7", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "lodash-unified": "^1.0.1", + "memoize-one": "^6.0.0", + "normalize-wheel-es": "^1.1.1" + } + }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true + }, + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, + "esbuild": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz", + "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==", + "dev": true, + "requires": { + "esbuild-android-arm64": "0.13.15", + "esbuild-darwin-64": "0.13.15", + "esbuild-darwin-arm64": "0.13.15", + "esbuild-freebsd-64": "0.13.15", + "esbuild-freebsd-arm64": "0.13.15", + "esbuild-linux-32": "0.13.15", + "esbuild-linux-64": "0.13.15", + "esbuild-linux-arm": "0.13.15", + "esbuild-linux-arm64": "0.13.15", + "esbuild-linux-mips64le": "0.13.15", + "esbuild-linux-ppc64le": "0.13.15", + "esbuild-netbsd-64": "0.13.15", + "esbuild-openbsd-64": "0.13.15", + "esbuild-sunos-64": "0.13.15", + "esbuild-windows-32": "0.13.15", + "esbuild-windows-64": "0.13.15", + "esbuild-windows-arm64": "0.13.15" + } + }, + "esbuild-android-arm64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz", + "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz", + "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz", + "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz", + "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz", + "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz", + "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz", + "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz", + "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz", + "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz", + "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz", + "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.23.tgz", + "integrity": "sha512-fbL3ggK2wY0D8I5raPIMPhpCvODFE+Bhb5QGtNP3r5aUsRR6TQV+ZBXIaw84iyvKC8vlXiA4fWLGhghAd/h/Zg==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.23.tgz", + "integrity": "sha512-GHMDCyfy7+FaNSO8RJ8KCFsnax8fLUsOrj9q5Gi2JmZMY0Zhp75keb5abTFCq2/Oy6KVcT0Dcbyo/bFb4rIFJA==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz", + "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz", + "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz", + "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz", + "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz", + "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.13.15", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz", + "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==", + "dev": true, + "optional": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fraction.js": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.1.3.tgz", + "integrity": "sha512-pUHWWt6vHzZZiQJcM6S/0PXfS+g6FM4BF5rj9wZyreivhQPdsh5PpE25VtSNxq80wHS5RfY51Ii+8Z0Zl/pmzg==", + "dev": true + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "dev": true + }, + "gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "dev": true, + "requires": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "hash-sum": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", + "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", + "dev": true + }, + "highlight.js": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.4.0.tgz", + "integrity": "sha512-nawlpCBCSASs7EdvZOYOYVkJpGmAOKMYZgZtUqSRqodZE0GRVcFKwo1RcpeOemqh9hyttTdd5wDBwHkuSyUfnA==" + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "immutable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", + "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + } + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klona": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", + "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==", + "dev": true + }, + "linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "lodash-unified": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lodash-unified/-/lodash-unified-1.0.1.tgz", + "integrity": "sha512-Py+twfpWn+2dFQWCuGcp21WiQRwZwnm1cyE3piSt/VtBVKVyxlR58WgOVRzXtmdmDRGJKH8F8GPaA29WK/yK8g==" + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "requires": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.4.1.tgz", + "integrity": "sha512-sLODeRetZ/61KkKLJElaU3NuU2z7MhXf12Ml1WJMSdwpngeofneCRF+JBbat8HiSqhniOMuTemXMrsI7hA6XyA==", + "dev": true + }, + "markdown-it-container": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-container/-/markdown-it-container-3.0.0.tgz", + "integrity": "sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==", + "dev": true + }, + "markdown-it-emoji": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-2.0.0.tgz", + "integrity": "sha512-39j7/9vP/CPCKbEI44oV8yoPJTpvfeReTn/COgRhSpNrjWF3PfP/JUxxB0hxV6ynOY8KH8Y8aX9NMDdo6z+6YQ==", + "dev": true + }, + "mdn-data": { + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.23.tgz", + "integrity": "sha512-IonVb7pfla2U4zW8rc7XGrtgq11BvYeCxWN8HS+KFBnLDE7XDK9AAMVhRuG6fj9BBsjc69Fqsp6WEActEdNTDQ==", + "dev": true + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, + "medium-zoom": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.6.tgz", + "integrity": "sha512-UdiUWfvz9fZMg1pzf4dcuqA0W079o0mpqbTnOz5ip4VGYX96QjmbM+OgOU/0uOzAytxC0Ny4z+VcYQnhdifimg==", + "dev": true + }, + "memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node-releases": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", + "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "normalize-wheel-es": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.1.1.tgz", + "integrity": "sha512-157VNH4CngrcsvF8xOVOe22cwniIR3nxSltdctvQeHZj8JttEeOXffK28jucWfWBXs0QNetAumjc1GiInnwX4w==" + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "nprogress": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", + "integrity": "sha1-y480xTIT2JVyP8urkH6UIq28r7E=", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "requires": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "postcss": { + "version": "8.4.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.6.tgz", + "integrity": "sha512-OovjwIzs9Te46vlEx7+uXB0PLijpwjXGKXjVGGPIGubGpq7uh5Xgf6D6FiJ/SzJMBosHDp6a2hiXOS97iBXcaA==", + "dev": true, + "requires": { + "nanoid": "^3.2.0", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "postcss-csso": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-csso/-/postcss-csso-6.0.0.tgz", + "integrity": "sha512-LsrU+LVR0mNIYauoTEbYVC81i+yXcGWa9kqW6Lvm+gYUZTaNTJmJT6Dbv+fqT8gOnwXAH1RV+5RXvAVoRtwO+g==", + "dev": true, + "requires": { + "csso": "^5.0.1" + } + }, + "postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "prismjs": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", + "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rollup": { + "version": "2.68.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.68.0.tgz", + "integrity": "sha512-XrMKOYK7oQcTio4wyTz466mucnd8LzkiZLozZ4Rz0zQD+HeX4nUK4B8GrTX/2EvN2/vBF/i2WnaXboPxo0JylA==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "sass": { + "version": "1.49.8", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.49.8.tgz", + "integrity": "sha512-NoGOjvDDOU9og9oAxhRnap71QaTjjlzrvLnKecUJ3GxhaQBrV6e7gPuSPF28u1OcVAArVojPAe4ZhOXwwC4tGw==", + "dev": true, + "requires": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + } + }, + "sass-loader": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.6.0.tgz", + "integrity": "sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==", + "dev": true, + "requires": { + "klona": "^2.0.4", + "neo-async": "^2.6.2" + } + }, + "section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true + }, + "ts-debounce": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ts-debounce/-/ts-debounce-4.0.0.tgz", + "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + }, + "upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "vite": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.8.4.tgz", + "integrity": "sha512-GwtOkkaT2LDI82uWZKcrpRQxP5tymLnC7hVHHqNkhFNknYr0hJUlDLfhVRgngJvAy3RwypkDCWtTKn1BjO96Dw==", + "dev": true, + "requires": { + "esbuild": "^0.14.14", + "fsevents": "~2.3.2", + "postcss": "^8.4.6", + "resolve": "^1.22.0", + "rollup": "^2.59.0" + }, + "dependencies": { + "esbuild": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.23.tgz", + "integrity": "sha512-XjnIcZ9KB6lfonCa+jRguXyRYcldmkyZ99ieDksqW/C8bnyEX299yA4QH2XcgijCgaddEZePPTgvx/2imsq7Ig==", + "dev": true, + "requires": { + "esbuild-android-arm64": "0.14.23", + "esbuild-darwin-64": "0.14.23", + "esbuild-darwin-arm64": "0.14.23", + "esbuild-freebsd-64": "0.14.23", + "esbuild-freebsd-arm64": "0.14.23", + "esbuild-linux-32": "0.14.23", + "esbuild-linux-64": "0.14.23", + "esbuild-linux-arm": "0.14.23", + "esbuild-linux-arm64": "0.14.23", + "esbuild-linux-mips64le": "0.14.23", + "esbuild-linux-ppc64le": "0.14.23", + "esbuild-linux-riscv64": "0.14.23", + "esbuild-linux-s390x": "0.14.23", + "esbuild-netbsd-64": "0.14.23", + "esbuild-openbsd-64": "0.14.23", + "esbuild-sunos-64": "0.14.23", + "esbuild-windows-32": "0.14.23", + "esbuild-windows-64": "0.14.23", + "esbuild-windows-arm64": "0.14.23" + } + }, + "esbuild-android-arm64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.23.tgz", + "integrity": "sha512-k9sXem++mINrZty1v4FVt6nC5BQCFG4K2geCIUUqHNlTdFnuvcqsY7prcKZLFhqVC1rbcJAr9VSUGFL/vD4vsw==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.23.tgz", + "integrity": "sha512-lB0XRbtOYYL1tLcYw8BoBaYsFYiR48RPrA0KfA/7RFTr4MV7Bwy/J4+7nLsVnv9FGuQummM3uJ93J3ptaTqFug==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.23.tgz", + "integrity": "sha512-yat73Z/uJ5tRcfRiI4CCTv0FSnwErm3BJQeZAh+1tIP0TUNh6o+mXg338Zl5EKChD+YGp6PN+Dbhs7qa34RxSw==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.23.tgz", + "integrity": "sha512-/1xiTjoLuQ+LlbfjJdKkX45qK/M7ARrbLmyf7x3JhyQGMjcxRYVR6Dw81uH3qlMHwT4cfLW4aEVBhP1aNV7VsA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.23.tgz", + "integrity": "sha512-uyPqBU/Zcp6yEAZS4LKj5jEE0q2s4HmlMBIPzbW6cTunZ8cyvjG6YWpIZXb1KK3KTJDe62ltCrk3VzmWHp+iLg==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.23.tgz", + "integrity": "sha512-37R/WMkQyUfNhbH7aJrr1uCjDVdnPeTHGeDhZPUNhfoHV0lQuZNCKuNnDvlH/u/nwIYZNdVvz1Igv5rY/zfrzQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.23.tgz", + "integrity": "sha512-H0gztDP60qqr8zoFhAO64waoN5yBXkmYCElFklpd6LPoobtNGNnDe99xOQm28+fuD75YJ7GKHzp/MLCLhw2+vQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.23.tgz", + "integrity": "sha512-x64CEUxi8+EzOAIpCUeuni0bZfzPw/65r8tC5cy5zOq9dY7ysOi5EVQHnzaxS+1NmV+/RVRpmrzGw1QgY2Xpmw==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.23.tgz", + "integrity": "sha512-c4MLOIByNHR55n3KoYf9hYDfBRghMjOiHLaoYLhkQkIabb452RWi+HsNgB41sUpSlOAqfpqKPFNg7VrxL3UX9g==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.23.tgz", + "integrity": "sha512-kHKyKRIAedYhKug2EJpyJxOUj3VYuamOVA1pY7EimoFPzaF3NeY7e4cFBAISC/Av0/tiV0xlFCt9q0HJ68IBIw==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.23.tgz", + "integrity": "sha512-7ilAiJEPuJJnJp/LiDO0oJm5ygbBPzhchJJh9HsHZzeqO+3PUzItXi+8PuicY08r0AaaOe25LA7sGJ0MzbfBag==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.23.tgz", + "integrity": "sha512-ovk2EX+3rrO1M2lowJfgMb/JPN1VwVYrx0QPUyudxkxLYrWeBxDKQvc6ffO+kB4QlDyTfdtAURrVzu3JeNdA2g==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.23.tgz", + "integrity": "sha512-uYYNqbVR+i7k8ojP/oIROAHO9lATLN7H2QeXKt2H310Fc8FJj4y3Wce6hx0VgnJ4k1JDrgbbiXM8rbEgQyg8KA==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.23.tgz", + "integrity": "sha512-hAzeBeET0+SbScknPzS2LBY6FVDpgE+CsHSpe6CEoR51PApdn2IB0SyJX7vGelXzlyrnorM4CAsRyb9Qev4h9g==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.23.tgz", + "integrity": "sha512-Kttmi3JnohdaREbk6o9e25kieJR379TsEWF0l39PQVHXq3FR6sFKtVPgY8wk055o6IB+rllrzLnbqOw/UV60EA==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.23.tgz", + "integrity": "sha512-JtIT0t8ymkpl6YlmOl6zoSWL5cnCgyLaBdf/SiU/Eg3C13r0NbHZWNT/RDEMKK91Y6t79kTs3vyRcNZbfu5a8g==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.23.tgz", + "integrity": "sha512-cTFaQqT2+ik9e4hePvYtRZQ3pqOvKDVNarzql0VFIzhc0tru/ZgdLoXd6epLiKT+SzoSce6V9YJ+nn6RCn6SHw==", + "dev": true, + "optional": true + } + } + }, + "vue": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz", + "integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-sfc": "3.2.31", + "@vue/runtime-dom": "3.2.31", + "@vue/server-renderer": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "vue-demi": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.12.1.tgz", + "integrity": "sha512-QL3ny+wX8c6Xm1/EZylbgzdoDolye+VpCXRhI2hug9dJTP3OUJ3lmiKN3CsVV3mOJKwFi0nsstbgob0vG7aoIw==" + }, + "vue-router": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz", + "integrity": "sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==", + "dev": true, + "requires": { + "@vue/devtools-api": "^6.0.0-beta.18" + } + }, + "vuepress": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/vuepress/-/vuepress-2.0.0-beta.35.tgz", + "integrity": "sha512-WMuL1s7DeyWRBFaByYMDSF4n9K/asLQXW1OJL9yxyTFmTl/VGs3llEjBqwbLhSmktz2lBlq67RtDLjVTE8PJPA==", + "dev": true, + "requires": { + "vuepress-vite": "2.0.0-beta.35" + }, + "dependencies": { + "vuepress-vite": { + "version": "2.0.0-beta.35", + "resolved": "https://registry.npmjs.org/vuepress-vite/-/vuepress-vite-2.0.0-beta.35.tgz", + "integrity": "sha512-gN7DbhZLdoFxK2Yv9ao+51IfcmjuIEGigwrT8gfdOMBGTRCTkxYgiSQsS5IbwN+aXxA2VJLBAcCdrgk1miAMRQ==", + "dev": true, + "requires": { + "@vuepress/bundler-vite": "2.0.0-beta.35", + "@vuepress/cli": "2.0.0-beta.35", + "@vuepress/core": "2.0.0-beta.35", + "@vuepress/theme-default": "2.0.0-beta.35" + } + } + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } +} diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 00000000..8a5e50c8 --- /dev/null +++ b/docs/package.json @@ -0,0 +1,17 @@ +{ + "name": "docs", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vuepress dev src", + "build": "vuepress build src -d dist" + }, + "dependencies": { + "element-plus": "^2.0.2", + "highlight.js": "^11.2.0" + }, + "devDependencies": { + "@vuepress/cli": "^2.0.0-beta.26", + "vuepress": "^2.0.0-beta.26" + } +} diff --git a/docs/src/.vuepress/clientAppEnhance.ts b/docs/src/.vuepress/clientAppEnhance.ts new file mode 100644 index 00000000..c49b4c0e --- /dev/null +++ b/docs/src/.vuepress/clientAppEnhance.ts @@ -0,0 +1,13 @@ +import 'element-plus/dist/index.css'; +import 'highlight.js/styles/github.css'; + +import { defineClientAppEnhance } from '@vuepress/client'; +import ElementPlus from 'element-plus'; +import MagicForm from '@tmagic/form'; +import DemoBlock from './demo-block.vue'; + +export default defineClientAppEnhance(({ app }) => { + app.use(ElementPlus); + app.use(MagicForm); + app.component('demo-block', DemoBlock); +}); diff --git a/docs/src/.vuepress/config.ts b/docs/src/.vuepress/config.ts new file mode 100644 index 00000000..fcb9de44 --- /dev/null +++ b/docs/src/.vuepress/config.ts @@ -0,0 +1,144 @@ +import { defineUserConfig } from '@vuepress/cli' +import type { DefaultThemeOptions } from '@vuepress/theme-default' +import path from 'path'; + +const sidebar = { + guide: [ + { + text: '使用指南', + children: [ + '/guide/introduction', + '/guide/installation', + '/guide/conception', + ] + }, { + text: '进阶指南', + children: [ + '/guide/advanced/js-schema.md', + '/guide/advanced/layout.md', + '/guide/advanced/page.md', + '/guide/advanced/high-level-function.md', + '/guide/advanced/magic-ui.md', + '/guide/advanced/magic-form.md', + '/guide/advanced/coupling.md', + ] + } + ], + page: [ + { + text: '页面发布', + sidebarDepth: 2, + children: [ + '/page/introduction', + '/page/advanced', + ] + } + ], + component: [ + { + text: '组件开发', + children: [ + '/component/introduction', + ] + } + ], + api: [ + { + text: '编辑器', + children: [ + '/api/editor', + '/api/model', + ] + }, + { + text: '表单', + children: [ + '/api/form', + ] + }, + { + text: '表单配置协议', + children: [ + '/api/base-config', + '/api/field-config', + ] + } + ] +}; + +export default defineUserConfig({ + title: '魔方', + description: 'magic', + clientAppEnhanceFiles: path.resolve(__dirname, './clientAppEnhance.ts'), + themeConfig: { + logo: 'https://vfiles.gtimg.cn/vupload/20210811/388ed01628667545737.png', + navbar: [ + { + text: '文档', + children: [ + { + text: '使用指南', + link: '/guide/introduction' + }, + { + text: '组件开发', + link: '/component/introduction' + }, + { + text: '页面发布', + link: '/page/introduction' + }, + ] + }, + { + text: 'API参考', + link: '/api/editor' + }, { + text: '查看源码', + link: 'https://github.com/Tencent/tmagic-editor' + }, { + text: 'Playground', + link: 'https://tencent.github.io/tmagic-editor/playground/index.html' + } + ], + docsDir: 'src', + sidebarDepth: 2, + sidebar: { + '/guide/': sidebar.guide, + '/page/': sidebar.page, + '/component/': sidebar.component, + '/api/': sidebar.api, + }, + smoothScroll: false, + lastUpdated: false, + contributors: false, + + }, + base: '/tmagic-editor/docs/', + bundlerConfig: { + vuePluginOptions: { + template: { + ssr: true, + compilerOptions: { + directiveTransforms: { + loading: () => { + return { + props: [], + needRuntime: true, + }; + }, + }, + }, + }, + }, + viteOptions: { + resolve: { + alias:[ + { find: /^@tmagic\/form/, replacement: path.join(__dirname, '../../../packages/form/src/index.ts') }, + { find: /^@tmagic\/form/, replacement: path.join(__dirname, '../../../packages/form/src/index.ts') }, + { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../../packages/utils/src/index.ts') }, + ] + }, + }, + }, +}); diff --git a/docs/src/.vuepress/demo-block.vue b/docs/src/.vuepress/demo-block.vue new file mode 100644 index 00000000..111c3270 --- /dev/null +++ b/docs/src/.vuepress/demo-block.vue @@ -0,0 +1,360 @@ + + + + + diff --git a/docs/src/.vuepress/styles/index.scss b/docs/src/.vuepress/styles/index.scss new file mode 100644 index 00000000..7a387d70 --- /dev/null +++ b/docs/src/.vuepress/styles/index.scss @@ -0,0 +1,3 @@ +:root { + --c-brand: #2882e0; +} diff --git a/docs/src/README.md b/docs/src/README.md new file mode 100644 index 00000000..a74a443c --- /dev/null +++ b/docs/src/README.md @@ -0,0 +1,22 @@ +--- +home: true +heroImage: https://vfiles.gtimg.cn/vupload/20210811/388ed01628667545737.png +heroText: 魔方页面可视化平台 +tagline: null + +features: + - title: 所见即所得 + details: 体验友好的拖拽编辑方式。 + - title: 丰富的拓展能力 + details: 支持业务方自定义组件、插件。 + - title: 支持多种布局方式 + details: 魔方的容器概念,支持配置活动时,自由组合嵌套业务组件,提供超强的组件布局方式。 + - title: 强大的配置 + details: 支持表单联动等配置能力。 + - title: 组件联动 + details: 支持组件通信、组件联动,允许页面内各组件提供丰富配置能力。 + - title: 低代码 + details: 支持在平台写入代码,修改页面样式属性等,提供除组件外的高级编码能力。 + +footer: Powered by 腾讯视频会员平台技术中心 +--- diff --git a/docs/src/api/base-config.md b/docs/src/api/base-config.md new file mode 100644 index 00000000..56386f84 --- /dev/null +++ b/docs/src/api/base-config.md @@ -0,0 +1,179 @@ +# 布局 + +## 基础用法 + + + +## 行内布局 + +可以通过配置span,来指定行内的配置项占用多少位置,一行为24,例如一行要显示三个配置则 span 可以配置 8;四个则为 6。默认会自动调节在一行中显示。 + + + +## 混合布局 + + + +## 对象容器 + +### Object + + + +### fieldset + + + +### panel + + + +### tabs + + + +## 数组容器 + +### groupList + + + +### table + + diff --git a/docs/src/api/editor.md b/docs/src/api/editor.md new file mode 100644 index 00000000..00b1802c --- /dev/null +++ b/docs/src/api/editor.md @@ -0,0 +1,294 @@ +# m-editor + +## props + +### data + +- **类型:** MApp(https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)[] + +- **默认值:** {} + +- **详情:** + + 页面初始值 + +- **示例:** + +```js +{ + type: 'app', + id: 'app_1', + items: [ + { + type: 'page', + id: 'page_1', + items: [ + { + type: 'text', + id: 'text_1', + text: '文本' + } + ] + } + ] +} +``` + +### componentGroupList + +- **类型:** [ComponentGroup](https://github.com/Tencent/tmagic-editor/blob/master/packages/editor/src/type.ts)[] + +- **默认值:** [] + +- **详情:** + + 左侧面板中的组件列表 + +- **示例:** + +```js +[ + { + title: '容器', + items: [ + { + icon: 'folder-opened', + text: '组', + type: 'container', + }, + { + icon: 'el-icon-files', + text: '标签页(tab)', + type: 'tabs', + }, + ], + }, + { + title: '基础组件', + items: [ + { + icon: 'tickets', + text: '文本', + type: 'text', + }, + { + icon: 'switch-button', + text: '按钮', + type: 'button', + }, + ], + }, +] +``` + +::: tip +icon使用的是[element-plus icon](https://element-plus.org/zh-CN/component/icon.html) +::: + +::: warning +此配置仅在[sidebar](#sidebar)中配置了'component-list'时有效 +::: + +### sidebar + +- **类型:** [SideBarData](https://github.com/Tencent/tmagic-editor/blob/master/packages/editor/src/type.ts) + +- **默认值:** { type: 'tabs', status: '组件', items: ['component-list', 'layer'] } + +- **详情:** + + 左侧面板,目前只支持type: 'tabs'; + + component-list的text为'组件' + +- **示例:** + +```js +import ModListPanel from '../components/sidebars/ModListPanel.vue'; + +{ + type: 'tabs', + status: '组件', + items: [ + 'component-list', + 'layer', + { + type: 'component', + icon: 'el-icon-s-order', + component: ModListPanel, + text: '模块', + }, +} +``` + +### menu + +- **类型:** [MenuBarData](https://github.com/Tencent/tmagic-editor/blob/master/packages/editor/src/type.ts) + +- **默认值:** { left: [], center: [], right: [] } + +- **详情:** + + 顶部工具栏 + + 系统提供了几个常用功能: '/' | 'delete' | 'undo' | 'redo' | 'zoom-in' | 'zoom-out' + + '/': 分隔符 + + 'delete': 删除按钮 + + 'undo': 撤销按钮 + + 'redo': 恢复按钮 + + 'zoom-in': 放大按钮 + + 'zoom-out': 缩小按钮 + +- **示例:** + +```js +{ + left: [ + { + type: 'button', + icon: 'el-icon-arrow-left', + tooltip: '返回', + }, + '/', + { + type: 'text', + text: '魔方', + }, + ], + center: ['delete', 'undo', 'redo', 'zoom-in', 'zoom-out'], + right: [ + { + type: 'button', + text: '保存', + icon: 'el-icon-coin', + disabled: true, + handler: ({ store }) => console.log(toRaw(store.get('root'))), + }, + ], +} +``` + +### render + +- **类型:** Function + +- **默认值:** undefined + +- **详情:** + + 中间工作区域中画布渲染的内容 + +- **示例:** + +```js +(renderer) => renderer.contentWindow.document.createElement('div') +``` + +### runtimeUrl + +- **类型:** string + +- **默认值:** undefined + +- **详情:** + + 中间工作区域中画布通过iframe渲染时的页面url + +### propsConfigs + +- **类型:** { [type: string]: [FormConfig](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) } + +- **默认值:** {} + +- **详情:** + + 组件的属性配置表单的dsl + +- **示例:** + +```js +{ + text: [ + { + name: 'text', + text: '文本', + }, + { + name: 'multiple', + text: '多行文本', + type: 'switch', + }, + ], + button: [ + { + name: 'text', + text: '文本', + }, + ] +} +``` + +### propsValues + +- **类型:** { [type: string]: Object } + +- **默认值:** {} + +- **详情:** + + 添加组件时的默认值 + +- **示例:** + +```js +{ + text: { + text: '文本', + multiple: true, + }, + button: { + text: '按钮', + }, +} +``` + +### moveableOptions + +- **类型:** ((core: StageCore) => MoveableOptions) | [MoveableOptions](https://daybrush.com/moveable/release/latest/doc/) + +- **默认值:** {} + +- **详情:** + + 画布中的选中框配置选项,使用的是[moveable](https://github.com/daybrush/moveable)第三方库 +## slots + +### nav + +- **详情:** 工具栏 + +### sidebar + +- **详情:** 左侧栏 + +### workspace + +- **详情:** 中间工作区域 + +### workspace-content + +- **详情:** 中间工作区域内部 + +:::tip +在没有 workspace slots 的时候才可以用 +::: + +### propsPanel + +- **详情:** 属性面板 diff --git a/docs/src/api/field-config.md b/docs/src/api/field-config.md new file mode 100644 index 00000000..e6e1bd91 --- /dev/null +++ b/docs/src/api/field-config.md @@ -0,0 +1,1222 @@ +# 基础组件 + +## Cascader 级联选择器 + +当一个数据集合有清晰的层级结构时,可通过级联选择器逐级查看并选择。 + +### 基础用法 + +有两种触发子菜单的方式 + + + +### 禁用选项 + +通过在数据源中设置 disabled 字段来声明该选项是禁用的 + + + + + +#### 多选 + +可通过 `multiple = true` 来开启多选模式 + + + + + +## Checkbox 多选框 +一组备选项中进行多选 + +### 基础用法 + +单独使用可以表示两种状态之间的切换。 + + + + + +### 禁用状态 + +多选框不可用状态。 + + + + + +### 多选框组 + +适用于多个勾选框绑定到同一个数组的情景,通过是否勾选来表示这一组选项中选中的项。 + + + + + + +### Checkbox Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| activeValue | 选中时的值 | string / number / Function | — | 1 | +| inactiveValue | 没有选中时的值 | string / number / Function | — | 0 | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + +### CheckboxGroup Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | +| options | 选项 | Array | — | - | + +## ColorPicker 颜色选择器 + +用于颜色选择,支持多种格式。 + +### 基础用法 + + + + + + +## DatePicker 日期选择器 + +用于选择或输入日期 + +### 基础用法 + + + + + +### 禁用状态 + + + + +### 日期格式 + +使用`format`指定输入框的格式;使用`valueFormat`指定绑定值的格式。 + +默认情况下,组件接受并返回`Date`对象。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例: + +:::warning +请注意大小写 +::: + +| 格式 | 含义 | 备注 | 举例 | +|------|------|------|------| +| `yyyy` | 年 | | 2017 | +| `M` | 月 | 不补0 | 1 | +| `MM` | 月 | | 01 | +| `W` | 周 | 仅周选择器的 `format` 可用;不补0 | 1 | +| `WW` | 周 | 仅周选择器的 `format` 可用 | 01 | +| `d` | 日 | 不补0 | 2 | +| `dd` | 日 | | 02 | +| `H` | 小时 | 24小时制;不补0 | 3 | +| `HH` | 小时 | 24小时制 | 03 | +| `h` | 小时 | 12小时制,须和 `A` 或 `a` 使用;不补0 | 3 | +| `hh` | 小时 | 12小时制,须和 `A` 或 `a` 使用 | 03 | +| `m` | 分钟 | 不补0 | 4 | +| `mm` | 分钟 | | 04 | +| `s` | 秒 | 不补0 | 5 | +| `ss` | 秒 | | 05 | +| `timestamp` | JS时间戳 | 组件绑定值为`number`类型 | 1483326245000 | +| `[MM]` | 不需要格式化字符 | 使用方括号标识不需要格式化的字符 (如 [A] [MM]) | MM | + + + + + +### Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| value-format | 可选,绑定值的格式。不指定则绑定值为 Date 对象 | string | 见[日期格式](#/zh-CN/component/date-picker#ri-qi-ge-shi) | — | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + + + + +## DateTimePicker 日期时间选择器 + +在同一个选择器里选择日期和时间 + +### 基础用法 + + + + + +### 禁用状态 + + + + + +### 日期格式 + +使用`format`指定输入框的格式;使用`valueFormat`指定绑定值的格式。 + +默认情况下,组件接受并返回`Date`对象。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例: + +:::warning +请注意大小写 +::: + +| 格式 | 含义 | 备注 | 举例 | +|------|------|------|------| +| `yyyy` | 年 | | 2017 | +| `M` | 月 | 不补0 | 1 | +| `MM` | 月 | | 01 | +| `W` | 周 | 仅周选择器的 `format` 可用;不补0 | 1 | +| `WW` | 周 | 仅周选择器的 `format` 可用 | 01 | +| `d` | 日 | 不补0 | 2 | +| `dd` | 日 | | 02 | +| `H` | 小时 | 24小时制;不补0 | 3 | +| `HH` | 小时 | 24小时制 | 03 | +| `h` | 小时 | 12小时制,须和 `A` 或 `a` 使用;不补0 | 3 | +| `hh` | 小时 | 12小时制,须和 `A` 或 `a` 使用 | 03 | +| `m` | 分钟 | 不补0 | 4 | +| `mm` | 分钟 | | 04 | +| `s` | 秒 | 不补0 | 5 | +| `ss` | 秒 | | 05 | +| `A` | AM/PM | 仅 `format` 可用,大写 | AM | +| `a` | am/pm | 仅 `format` 可用,小写 | am | +| `timestamp` | JS时间戳 | 仅 `valueFormat` 可用;组件绑定值为`number`类型 | 1483326245000 | +| `[MM]` | 不需要格式化字符 | 使用方括号标识不需要格式化的字符 (如 [A] [MM]) | MM | + + + + + +### Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| format | 显示在输入框中的格式 | string | 见[日期格式](#/zh-CN/component/date-picker#ri-qi-ge-shi) | yyyy-MM-dd HH:mm:ss | +| value-format | 可选,绑定值的格式。不指定则绑定值为 Date 对象 | string | 见[日期格式](#/zh-CN/component/date-picker#ri-qi-ge-shi) | — | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + +## Display 只读文本 + +用于显示,不可编辑 + +### TS 定义 + +```typescript +interface Display extends FormItem { + type: 'display'; +} +``` + +点击查看[FormItem](#/form/component/common#/FormItem)的定义 + +### 基础用法 + + + + + + +### Input Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | + +## Hidden 隐藏域 + +改值体现于最终提交的表单中,用于例如编辑记录的id这种场景中 + +### TS 定义 + +```typescript +interface Hidden extends FormItem { + type: 'hidden'; +} +``` + +点击查看[FormItem](#/form/component/common#/FormItem)的定义 + +### 基础用法 + + + + + + +### Input Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | + +## InputNumber 计数器 + +仅允许输入标准的数字值,可定义范围 + +### 基础用法 + + + + + +### 禁用状态 + + + + + +### 步数 + +允许定义递增递减的步数控制 + + + + + + +### Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|----------|-------------- |----------|-------------------------------- |-------- | +| name | 绑定值 | string | — | — | +| placeholder | 输入框占位文本 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| min | 设置计数器允许的最小值 | number | — | -Infinity | +| max | 设置计数器允许的最大值 | number | — | Infinity | +| step | 计数器步长 | number | — | 1 | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + +## Input 输入框 + +通过鼠标或键盘输入字符 + +### 基础用法 + + + + + + +### 禁用状态 + + + + + +### 复合型输入框 + +后置内容 + + + + + + + + + +### 过滤内容 + + + + + +### 去掉首尾空格 + + + + + +### 显示详情 + + + + + +### Input Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| placeholder | 输入框占位文本 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| tooltip | 输入时显示内容 | boolean | — | false | +| placeholder | 输入框占位文本 | string | — | — | +| trim | 是否去掉首尾空格 | boolean | — | false | +| filter | 过滤值 | string / Function | number | - | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | +| append | 后置内容 | string / Object | — | - | + +### append Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| type | 内容类型 | string | button | — | +| text | 文本内容 | string | — | — | +| handler | 点击操作 | Function | — | - | + +## Link 链接 + +用于显示,不可编辑 + +### TS 定义 + +```typescript +interface Link extends FormItem { + type: 'link'; + href?: string | typeof LinkHrefFunction; + css?: { + [key: string]: string | number; + }; + disabledCss?: { + [key: string]: string | number; + }; + formTitle?: string; + formWidth?: number | string; + displayText?: string | typeof LinkDisplayTextFunction; + form: FormConfig | typeof LinkFormFunction; +} +``` + +点击查看[FormItem](#/form/component/common#/FormItem)的定义 + +### 基础用法 + + + + + +### 打开表单 + + + + + + +### Input Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | + +## Radio 单选框 + +在一组备选项中进行单选 + +### TS 定义 + +```typescript +interface RedioGroup extends FormItem { + type: 'redioGroup'; + options: { + value: any; + text: string; + }[]; +} +``` + +点击查看[FormItem](#/form/component/common#/FormItem)的定义 + +### 基础用法 + +由于选项默认可见,不宜过多,若选项过多,建议使用 Select 选择器。 + + + + + +### 禁用状态 + +单选框不可用的状态。 + + + + + +### RadioGroup Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| options | 选项 | Array | — | - | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + +## Select 选择器 + +当选项过多时,使用下拉菜单展示并选择内容。 + +### 基础用法 + +适用广泛的基础单选 + + + + + +### 有禁用选项 + + + + + +### 禁用状态 + +选择器不可用状态 + + + + + +### 基础多选 + +适用性较广的基础多选,用 Tag 展示已选项 + + + +### 分组 + +备选项进行分组展示 + + + + + +### 创建条目 + +可以创建并选中选项中不存在的条目 + + + +### 远程选项 + +通过接口请求获取选项列表 + + + + + +:::tip +如果 Select 的绑定值为对象类型,请务必指定 valueKey 作为它的唯一性标识。 +::: + +### Select Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| name | 绑定值 | string | — | — | +| placeholder | 输入框占位文本 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| multiple | 是否多选 | boolean | — | false | +| valueKey | 作为 value 唯一标识的键名,绑定值为对象类型时必填 | string | — | value | +| allowCreate | 是否允许用户创建新条目 | boolean | — | false | +| remote | 是否为远程搜索 | boolean | — | false | +| group | 是否选择分组 | boolean | — | false | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | +| options | 选项 | Array | — | - | +| option | 选项 | Object | — | - | + +### options item +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| text | | 选项的标签 | string/number/object | — | — | +| value | 选项的值 | string | — | — | +| disabled | 是否禁用 | boolean | — | false | +| label | string | — | — | — | +| options | Array | — | — | — | + +### option +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| url | string | — | — | — | +| root | string | — | — | — | +| text | string / Function | — | — | — | +| value | string / Function | — | — | — | + +## Switch 开关 + +表示两种相互对立的状态间的切换,多用于触发「开/关」。 + +### 基本用法 + + + +### 扩展的 value 类型 + + + + + +### 禁用状态 + + + + + + +### Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| active-value | switch 打开时的值 | boolean / string / number | — | true | +| inactive-value | switch 关闭时的值 | boolean / string / number | — | false | + +## Textarea 文本域 + +### 基础用法 + + + + + +### 禁用状态 + + + + + +### Input Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------- |---------- |------------- |-------- | +| name | 绑定值 | string | — | — | +| placeholder | 输入框占位文本 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | +| placeholder | 输入框占位文本 | string | — | — | +| trim | 是否去掉首尾空格 | boolean | — | false | +| filter | 过滤值 | string / Function | number | - | +| onChange | 值变化时触发的函数 | [Function](#/form/component/common#/onChange) | — | - | + +## TimePicker 时间选择器 + + 用于选择或输入日期 + +### 基础用法 + + + + + +### 禁用状态 + + + + + + +### Attributes +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------- |-------------- |---------- |-------------------------------- |-------- | +| name | 绑定值 | string | — | — | +| placeholder | 输入框占位文本 | string | — | — | +| text | 表单标签 | string | — | — | +| disabled | 是否禁用 | boolean / [Function](#/form/component/common#/disabled) | — | false | diff --git a/docs/src/api/form.md b/docs/src/api/form.md new file mode 100644 index 00000000..8c661f92 --- /dev/null +++ b/docs/src/api/form.md @@ -0,0 +1,163 @@ +# m-form + +## props + +### initValues + +- **类型:** Object + +- **默认值:** {} + +- **详情:** + + 表单初始化值 + +- **示例:** + +```js +{ + text: 'text', + multiple: true, +} +``` + +:::tip +initValues应该是与config一一对应的,如果initValues中的key没有出现在config的name中,那么这个值将被丢掉 +::: + +### config + +- **类型:** [FormConfig](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) + +- **默认值:** [] + +- **详情:** + + 表单配置 + +- **示例:** + +```js +[ + { + name: 'text', + text: '文本', + }, + { + name: 'multiple', + text: '多行文本', + type: 'switch', + }, +] +``` + +### labelWidth + +- **类型:** string | number + +- **默认值:** '200px' + +- **详情:** + + 表单域标签的宽度,例如 '50px'。 作为 Form 直接子元素的 form-item 会继承该值。 支持 auto + +### disabled + +- **类型:** boolean + +- **默认值:** false + +- **详情:** + + 是否禁用该表单内的所有组件。 若设置为 true,则表单内组件上的 disabled 属性不再生效 + +- **示例:** + +### height + +- **类型:** string + +- **默认值:** 'auto' + +- **详情:** + + 表单高度 + +### stepActive + +- **类型:** string | number + +- **默认值:** 1 + +- **详情:** + + 使用了 step 组件时,默认的选中的步骤数 + +### size + +- **类型:** 'medium' | 'small' | 'mini' + +- **默认值:** 'small' + +- **详情:** + + 用于控制该表单内组件的尺寸 + +### inline + +- **类型:** boolean + +- **默认值:** false + +- **详情:** + + 行内表单模式 + +### labelPosition + +- **类型:** 'right' | 'left' | 'top' + +- **默认值:** 'right' + +- **详情:** + + 表单域标签的位置, 如果值为 left 或者 right 时,则需要设置 label-width + +### keyProp + +- **类型:** string + +- **默认值:** '__key' + +- **详情:** + + 作为表单项的组件实例的key + +- **示例:** + +```js +[ + { + name: 'text', + type: 'text', + text: '文本', + __key: 123, + } +] +``` + +## instance methods + +### submitForm + +- **参数:** + + - `{boolean}` native + +- **返回:** + + - `{Object}` 整个表单的值 + +- **用法:** + + 提交表单,获取表单的值 diff --git a/docs/src/api/model.md b/docs/src/api/model.md new file mode 100644 index 00000000..114ae681 --- /dev/null +++ b/docs/src/api/model.md @@ -0,0 +1,590 @@ +# Services + +## editorService + +### set + +- **参数:** + + - `{'root' | 'page' | 'parent' | 'node'} name` + - `{MNode} value` + +- **返回:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} + +- **用法:** + + 设置当前指点节点配置 + + 'root': 当前整个配置,也就是当前编辑器的值 + + 'page': 当前正在编辑的页面配置 + + 'parent': 当前选中的节点的父节点 + + 'node': 当前选中的节点 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); + +node.name = 'new name'; + +editorService.set('node', node); + +``` + +### get + + +- **参数:** + + - `{'root' | 'page' | 'parent' | 'node'} name` + +- **返回:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} + +- **用法:** + + 获取当前指点节点配置 + + 'root': 当前整个配置,也就是当前编辑器的值 + + 'page': 当前正在编辑的页面配置 + + 'parent': 当前选中的节点的父节点 + + 'node': 当前选中的节点 + +- **示例:** + +```js +import { toRaw } from 'vue'; +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); + +console.log(toRaw(node)); +``` + +### getNodeInfo + +- **参数:** + + - `{number | string}` id + +- **返回:** + + - {[EditorNodeInfo](https://github.com/Tencent/tmagic-editor/blob/master/packages/editor/src/type.ts)} + +- **用法:** + + 根据id获取组件、组件的父组件以及组件所属的页面节点 + +- **示例:** + +```js +import { toRaw } from 'vue'; +import { editorService } from '@tmagic/editor'; + +const info = editorService.getNodeInfo('text_123'); + +console.log(toRaw(info.node)); +console.log(toRaw(info.parent)); +console.log(toRaw(info.page)); +``` + +### getNodeById + +- **参数:** + + - `{number | string}` id + +- **返回:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} 组件节点配置 + +- **用法:** + + 根据id获取组件的信息 + +- **示例:** + +```js +import { toRaw } from 'vue'; +import { editorService } from '@tmagic/editor'; + +const node = editorService.getNodeById('text_123'); + +console.log(toRaw(node)); +``` + +### getParentById + +- **参数:** + + - `{number | string}` id + +- **返回:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} 指点组件的父节点配置 + +- **用法:** + + 根据ID获取指点节点的父节点配置 + +- **示例:** + +```js +import { toRaw } from 'vue'; +import { editorService } from '@tmagic/editor'; + +const parent = editorService.getParentById('text_123'); + +console.log(toRaw(parent)); +``` + + +### select + +- **参数:** + + - `{number | string | MNode}` config + +- **返回:** + + 当前选中的节点配置 + +- **用法:** + + 选中指点节点(将指点节点设置成当前选中状态) + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.select('text_123'); +``` + +### add + +- **参数:** + + - {[AddMNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/editor/src/type.ts)} param0 将要添加的组件节点配置 + - {[MContainer](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts) | null} parent 要添加到的容器组件节点配置,如果不设置,默认为当前选中的组件的父节点 + +- **返回:** + + 添加后的节点 + +- **用法:** + + 向指点容器添加组件节点 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.add({ + type: 'text', + // ... +}); + +const parent = editorService.getParentById('text_123'); + +editorService.add({ + type: 'text', + // ... +}, parent); +``` + +### remove + +- **参数:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} node + +- **返回:** + + 删除的组件配置 + +- **用法:** + + 删除组件 + +- **示例:** + + +```js +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); +editorService.remove(node); +``` + +- ### update + +- **参数:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} config + +- **返回:** + + 更新后的节点配置 + +- **用法:** + + 更新节点 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); +node.name = 'new name'; +editorService.update(node); +``` + +- ### sort + +- **参数:** + + - `{number | string}` id1 + - `{number | string}` id2 + +- **用法:** + + 将id为id1的组件移动到id为id2的组件位置上,例如:[1,2,3,4] -> sort(1,3) -> [2,1,3,4] + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +const parent = editorService.get('parent'); +editorService.update(parent[0].id, parent[3].id); +``` + +- ### copy + +- **参数:** + + - {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} config + +- **用法:** + + 将组将节点配置转化成string,然后存储到localStorage中 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); +editorService.copy(node); +``` + +- ### paste + +- **参数:** + + - `{Position}` position 可选,如果设置,指定组件位置 + +- **返回:** + + 添加后的组件节点配置 + +- **用法:** + + 从localStorage中获取节点,然后添加到当前容器中 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.paste({ left: 0, top: 0 });` +``` + +- ### alignCenter + +- **参数:** + + {[MNode](https://github.com/Tencent/tmagic-editor/blob/master/packages/schema/src/index.ts)} config + +- **返回:** + + 当前组件节点配置 + +- **用法:** + + 将指点节点设置居中 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +const node = editorService.get('node'); +editorService.alignCenter(node); +``` + +- ### swap + +- **参数:** + + - `{number | 'latest' | 'first'` offset + +- **用法:** + + 移动当前选中节点位置 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.swap('bottom'); // 置底 +editorService.swap('first'); // 置顶 +editorService.swap(1); // 上移一层 +editorService.swap(-1); // 下移一层 +``` + +- ### undo + +- **返回:** + + 上一次数据 + +- **用法:** + + 撤销当前操作 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.undo(); +``` + +- ### redo + +- **返回:** + + 下一步数据 + +- **用法:** + + 恢复到下一步 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.redo(); +``` + +### usePlugin + +- **参数:** + + - `{Record` options + + +- **用法:** + 扩展editorService中的方法('select', 'add', 'remove', 'update', 'sort', 'copy', 'paste', 'center', 'moveLayer', 'undo', 'redo') + + 对于每一个方法,都可以为其添加before/after两个扩展方法,分别在该方法运行前与运行后调用 + + 调用时的参数会透传到before方法的参数中, 然后before的return 会作为原方法的参数和after的参数,after最后一个参数则是原方法的return值 + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.usePlugin({ + beforeAdd(value) { + console.log(value); // { type: 'text' } + console.log('before add'); + return [{ + type: 'button', + }]; + }, + afterAdd(value, result) { + console.log(value) // { type: 'button' } + console.log('after add'); + }, +}); + +const node = await editorService.add({ + type: 'text'; +}); + +console.log(node); // { type: 'button' } + +// console 输出如下: +// { type: 'text' } +// before add +// add +// { type: 'button' } +// after add +// { type: 'button' } +``` + +### use + +- **参数:** + + - `{Record` options + + +- **用法:** + 使用中间的方式扩展editorService中的方法('select', 'add', 'remove', 'update', 'sort', 'copy', 'paste', 'center', 'moveLayer', 'undo', 'redo') + +- **示例:** + +```js +import { editorService } from '@tmagic/editor'; + +editorService.use({ + add(value, next) { + console.log('before'); + next(); + console.log('after') + }, +}); + +editorService.add({ + type: 'text'; +}); + +// console 输出如下: +// before +// add +// after +``` + + +:::tip +可以多次为同一个方法添加扩展,运行时会根据添加的顺序依次调用 +::: + +## propsService + +### setPropsConfig + +- **参数:** + + - `{string}` type 组件类型 + - [FormConfig](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) config 组件属性表单配置 + +- **用法:** + + 为指定类型组件设置组件属性表单配置 + +- **示例:** + +```js +import { propsService } from '@tmagic/editor'; + +propsService.setPropsConfig('text', [ + { + name: 'text', + text: '文本', + }, + { + name: 'multiple', + text: '多行文本', + type: 'switch', + }, +]); +``` + +### getPropsConfig + +- **参数:** + + - `{string}` type 组件类型 + +- **返回:** + + 组件属性表单配置 + +- **用法:** + + 获取指点类型的组件属性表单配置 + +- **示例:** + +```js +import { propsService } from '@tmagic/editor'; + +propsService.getPropsConfig('text'); +``` + +### setPropsValue + +- **参数:** + + - `{string}` type 组件类型 + - `{Object}` value 组件初始值 + +- **用法:** + + 为指点类型组件设置组件初始值 + +- **示例:** + +```js +import { propsService } from '@tmagic/editor'; + +propsService.setPropsValue('text', { + text: '文本', + multiple: true, +}); +``` + +### getPropsValue + +- **参数:** + + - `{string}` type 组件类型 + +- **返回:** + + 组件初始值 + +- **用法:** + + 获取指定类型的组件初始值 + +- **示例:** + +```js +import { propsService } from '@tmagic/editor'; + +propsService.getPropsValue('text'); +``` + +### usePlugin + +扩展propsService中的方法('setConfig', 'getConfig', 'setValue', 'getValue') + +参照[editorService.usePlugin](#useplugin) + +### use + +扩展propsService中的方法('setConfig', 'getConfig', 'setValue', 'getValue') + +参照[editorService.use](#use) diff --git a/docs/src/component/introduction.md b/docs/src/component/introduction.md new file mode 100644 index 00000000..b6863469 --- /dev/null +++ b/docs/src/component/introduction.md @@ -0,0 +1,209 @@ +# 如何开发一个组件 +魔方支持业务方进行自定义组件开发。在魔方中,组件是以 npm 包形式存在的,组件和插件只要按照规范开发,就可以在魔方的 runtime 中被加入并正确渲染组件。 + +## 组件注册 +在 [playground](https://tencent.github.io/tmagic-editor/playground/index.html#/) 中,我们可以尝试点击添加一个组件,在模拟器区域里,就会出现这个组件。其中就涉及到组件注册。 + +这一步需要开发者基于魔方搭建了平台后,实现组件列表的注册、获取机制,魔方组件注册其实就是保存好组件 `type` 的映射关系。`type` 可以参考[组件介绍](/docs/guide/conception.html#组件)。 + +可以参考 vue3 版本的 Magic-UI 中,[组件渲染](/docs/guide/advanced/page.html#组件渲染)逻辑里,type 会作为组件名进入渲染。所以在 vue3 的组件开发中,我们也需要在为 vue 组件声明 name 字段时,和 type 值对应起来,才能正确渲染组件。 + +## 组件开发 +以 vue3 的组件开发为例。目前项目中的 playground 代码,会自动加载 vue3 相关的组件库。 + +### 组件规范 +组件的基础形式,需要有四个文件 +- index 入口文件,引入下面几个文件 +- formConfig 表单配置描述 +- initValue 表单初始值 +- event 定义联动事件,具体可以参考[组件联动](docs/guide/advanced/coupling.html#组件联动) +- component.{vue,jsx} 组件样式、逻辑代码 + +Magic-UI 中的 button/text 就是基础的组件示例。我们要求声明 index 入口,因为我们希望在后续的配套打包工具实现上,可以有一个统一规范入口。 + +### 1. 创建组件 +在项目中,如 runtime vue3 目录中,创建一个名为 test-comopnent 的组件目录,其中包含上面四个规范文件。 +```javascript +// index.js +// vue +import Test from './Test.vue'; +// react +import Test from './Test.tsx'; + +export { default as config } from './formConfig'; +export { default as value } from './initValue'; + +export default Test; +``` + +```javascript +// formConfig.js +export default [ + { + type: 'select', + text: '字体颜色', + name: 'color', + options: [ + { + text: '红色字体', + value: 'red', + }, + { + text: '蓝色字体', + value: 'blue', + }, + ], + }, + { + name: 'text', + text: '配置文案', + }, +]; +``` + +```javascript +// initValue.js +export default { + color: 'red', + text: '一段文字', +}; +``` + +vue3 版本的组件代码示例 +```vue + + + + +``` + +react 版本组件代码示例 +```javascript +// Test.tsx +import React, { useContext } from 'react'; + +import Core from '@tencent/magic-core'; +import { AppContent } from '@tencent/magic-ui-react'; + +function Test({ config }: { config: any }) { + const app = useContext(AppContent); + console.log(app) + + return (
+ this is a Test component: + { config.text } +
); +} + +export default Test; + +``` + +### 2. 打包脚本 +在 runtime vue3 中,我们已经提供好一份打包脚本示例。在 script 目录中。只需要在 unit.js 中加入你创建的组件到导出的 units 对象中,属性名即上面我们提到的组件 type,属性值为组件路径(如果是个 npm 包,则将路径替换为包名即可),打包脚本就会自动识别到你的组件。 + +``` +const units = { + test: path.join(__dirname, '../src/components/test-component/index.js'), +}; +``` +::: tip 自定义打包脚本 +scripts目录中的打包脚本仅是一份示例。业务方可以自行处理打包方式。这份示例的目的,在于告诉开发者,我们是如何生成组件入口、表单配置描述、表单初始值三个入口文件,并提供出去的供 runtime 使用的。 +::: + +### 3. 启动 playground +在上面的步骤完成后,在 playground/src/page/Editor.vue 中。找到组件栏的基础组件列表,在其中加入你的开发组件 +```javascript +{ + title: '基础组件', + items: [ + { + text: '文本', + type: 'text', + }, + { + text: '按钮', + type: 'button', + }, + // 加入这个测试组件 + { + text: '测试', + type: 'test', + }, + ], +} +``` + +然后,在 magic 项目根目录中,运行 + +``` +npm run playground +``` + +至此,我们打开 playground 后,就能添加开发的中的组件,并且得到这个开发中的组件**在编辑器中的表现**了。 + + + +### 4. 启动 runtime +在完成开发中组件在编辑器中的实现后,我们将编辑器中的 uiconfig 源码📄 打开,复制 uiconfig。并在 runtime/vue3/src/page 下。创建一个 page-config.js 文件。将 uiconfig 作为配置导出。 + +```javascript +window.magicUiConfig = [ + // uiconfig +] +``` + +在 page/main.ts 中,将这份配置读入 +```javascript +import './page-config.js'; +``` + +然后执行在 runtime/vue3 目录下执行 +``` +npm run start +``` + +至此,我们就可以得到这个开发中组件在编辑器中进行了配置并保存后,在真实页面中应该有的样子。 + + + +## 插件开发 +插件开发和组件开发形式类似,但是插件开发不需要有组件的规范。在以 vue 为基础的 ui 和 runtime 中,插件其实就是一个 vue 插件。 + +我们只需要在插件中提供一个入口文件,其中包含 vue 的 install 方法即可。 + +```javascript +export default { + install() {} +} +``` + +在插件中开发者可以自由实现需要的业务逻辑。插件和组件一样,只需要在 units.js 中,加入导出的 units 对象里即可。 + +## 业务定制 +上述的步骤,如 +1. 组件/插件初始化 +2. 编辑器中的组件调试 +3. 真实页面的组件调试 +4. 编辑器中的 uiconfig 同步至本地调试页面 + +等许多步骤,都可以交由业务方进行定制,开发业务自定义的脚手架工具,或者如示例中一样,使用打包脚本来处理。 \ No newline at end of file diff --git a/docs/src/guide/advanced/coupling.md b/docs/src/guide/advanced/coupling.md new file mode 100644 index 00000000..e0a2c0a7 --- /dev/null +++ b/docs/src/guide/advanced/coupling.md @@ -0,0 +1,171 @@ +# 联动原理 +魔方的联动,指这两种情况: +- 在编辑器中,组件的表单配置项之间需要联动。 +- 页面中的组件之间,需要联动触发行为。 + +## 表单联动 +表单的详细内容,可以参考[Magic-Form](/docs/guide/advanced/magic-form)。我们通过 [JS Schema](/docs/guide/advanced/js-schema) 描述的表单配置,实现联动的方式,就是写一个简单 js 函数。 + +比如下面的例子,我们希望改变选项时,同时改变文本框的内容。 + + + + +在经过表单渲染器时,所有指出函数 API 都会传入当前渲染的**表单组件实例(vm)**,**当前项目(value)**,**当前表单model**,**表单值formValue**,model 即 vue 的[表单输入绑定](https://cn.vuejs.org/v2/guide/forms.html#%E5%9C%A8%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BD%BF%E7%94%A8-v-model),可以通过修改他来实现值联动。 + +当然我们也可以通过上述的参数传入,以及其他函数 API 实现更多灵活的表单联动,具体参考[表单 API](/docs/api/base-config)。 + +## 组件联动 +魔方在 @tencent/magic-core 中,实现了组件的事件绑定/分发机制。在组件渲染时,每个组件在 Magic-UI 中经过基础组件渲染时,会被基础组件注入公共方法的实现。如下对按钮配置了**点击使文本隐藏**的联动事件,那么在对应按钮被点击时,将会触发对应绑定文本的隐藏。 + + + +### 添加组件自定义事件 +如何开发一个完整组件可以参考[组件开发](/docs/component/introduction),这一节我们主要讲述如何配置定义事件。 + +在组件开发过程中,我们可以通过声明组件中的 event 文件,在文件中描述当前组件可以配置的事件名,和可以被触发的动作。 +```javascript +// event.js +export default { + events: [ + { + label: '完成某事件', + value: 'yourComponent:finishSomething', + }, + ], + methods: [ + { + label: '弹出 Toast', + value: 'toast', + }, + ], +}; + +``` +其中,events 的 value 是个事件名,是 `string` 类型,未了避免和其他组件事件名重复,应该添加上一些前缀。 + +而 methods 中的 value 则是一个挂载在组件上的可执行函数。我们会在事件触发时,分发到对应组件上,并执行对应组件实例上的方法。 + +配置了上述内容的组件,在编辑器中选中当前组件,要触发其他组件的联动事件时,会有如下选项 + + + +在被其他组件选中为联动组件,要触发联动事件,会有如下选项 + + + +### 组件中的代码实现 +如上面提到的,我们定制了**完成某件事**这个事件,以及要提供一个**弹出 Toast**的方法。在组件中必要的实现内容如下。 + +#### vue 版本实现 +我们主要讲解 vue3 的 setup 实现。vue2 可以根据 vue3 同理转换成 options api 实现即可。 + +```vue + + + + +``` + +::: tip +在用 vue 实现的 组件中,我们通过 inject 方式来提供核心 app 和高阶组件 hoc。调用联动事件方法时,魔方是通过组件的 ref,并直接调用当前组件的方法。 +::: + +#### react 版本实现 +在 react 的实现中,由于魔方提供的 Magic-UI react 版本是用 hook 实现的。所以组件开发我们也相应的需要使用 hook 方式。 + +```jsx +import React from 'react'; + +import { useApp } from '@tencent/magic-ui-react'; + +function Test({ config }) { + // react 和 vue 实现不同,我们通过 useApp 这个 hook 来提供 app, ref 等核心内容 + // 其中 ref 需要绑定到你的组件上作为 ref。因为一些公共事件会需要使用到你的组件 dom + // 同时这个 ref 也会在魔方的高级函数钩子中,将你的组件 dom 作为参数提供给自定义钩子 + const { app, ref } = useApp({ + config, + // 此处实现事件动作 + // 通过向 useApp 这个 hook 提供 methods 方法 + // 魔方会将该事件注册到事件机制中,在对应事件响应被触发时调用对应方法 + methods: { + toast: (/*接收触发事件组件传进来的参数*/) => { + toast('测试 react'); + }, + }, + }); + + const onClickFunc = () => { + // app.emit 第一个参数为事件名,其余参数为你要传给接受事件组件的参数 + app?.emit("yourComponent:finishSomething", /*可以传参给接收方*/); + } + + return ( +
+ // your component code +
+ ); +} + +export default Test; +``` + +::: tip +react 的实现方式需要开发者通过 useApp 来获得我们提供的核心 app 和一个 ref,这个 ref 是需要开发者绑定到组件上的。和 vue 不同,react 的 dom 实例需要用户指定。 + +而需要这个 ref 的原因,是在公共事件执行时,可能会需要 dom 实例来进行操作;或者用户使用高级函数时,我们会向用户传入组件的 dom 实例给开发者使用。 +::: + +按照上述实现触发事件和事件动作,就可以完成组件的联动事件分发响应。 + + diff --git a/docs/src/guide/advanced/high-level-function.md b/docs/src/guide/advanced/high-level-function.md new file mode 100644 index 00000000..0b2af384 --- /dev/null +++ b/docs/src/guide/advanced/high-level-function.md @@ -0,0 +1,45 @@ +# 高级函数 +魔方的一个高级特性,就是支持开发者在不修改组件代码的情况下,对活动页面进行特定的修改,方式即支持开发者在线编码,让这份代码特定时机执行。 + + + +## Magic-Core +我们在 @tencent/magic-core 这个包中,实现了魔方组件节点的 Node 类,每个组件在魔方的运行环境被渲染前,都会对应初始化一个 Node 类实例。而这些 Node 实例上包含了一些基础功能,包括触发指定钩子函数。这是一个框架无关的核心库,所以支持在各个语言框架中使用。但是具体触发时机需要由各个框架的渲染器实现。 + +在 react 和 vue 两种框架下的执行时机,可以参考我们的 runtime 实现: + +- [react runtime 执行钩子时机](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react/src/useApp.ts) +- [vue runtime 执行钩子时机](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui/src/useApp.ts) + +## 函数编写 +在编辑中,即写入一个执行函数,魔方会在对应组件的指定声明周期中执行改函数。同时**传入当前组件的 Node 实例对象**,作为执行参数。 + +传入的实例对象,可以根据各语言框架实现的 ui 提供的特性能力,来支持业务组件的能力实现。这个功能提供给开发者自由实现黑科技的机会。 + + + +### 函数参数 +在 Magic-Core 中,我们对执行钩子函数传入了对应的 Node 实例对象。在 react 和 vue 中会稍有差异。差异在于 Node 实例的 instance 属性。 + +- [Node 实例描述](https://github.com/Tencent/tmagic-editor/blob/master/packages/core/src/Node.ts) + +### instance +Magic-Core 会在监听到对应事件时,将 payload 赋值给 Node 实例的 instace 属性。 + +其中 instance 属性的值,即我们在上面描述的,各个框架的钩子执行时机时发送的 payload 数据,各个框架发送的 instance 数据依据框架而定。instance 上会挂载一个 $el 对象,是各个框架 runtime 实现后,在组件 mounted 时候会得到的 dom 引用实例。 + +在示例中可以找到对应的触发事件和监听事件的形式如下: + +```javascript +// runtime 中发送数据 +app.emit('created', instance) + +// class Node +this.once('created', (instance: any) => { + this.instance = instance; +}); +``` + +- [Node 类监听声明周期](https://github.com/Tencent/tmagic-editor/blob/master/packages/core/src/Node.ts) +- [react runtime 执行钩子时机](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react/src/useApp.ts) +- [vue runtime 执行钩子时机](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui/src/useApp.ts) \ No newline at end of file diff --git a/docs/src/guide/advanced/js-schema.md b/docs/src/guide/advanced/js-schema.md new file mode 100644 index 00000000..38c76f93 --- /dev/null +++ b/docs/src/guide/advanced/js-schema.md @@ -0,0 +1,137 @@ +# JS Schema +魔方的业务组件需要有表单配置能力,我们通过一份配置来描述表单,我们采用的描述方案是 JS schema。当我们在编辑器中配置一个页面时,页面的基本信息和页面包含的组件信息,也是采用 JS schema 描述的。JS schema 描述方案,,也是我们提供[高级函数](/docs/guide/advanced/high-level-function)功能的基础。 + +组件的**配置描述**,参考[示例](/docs/guide/advanced/magic-form.html#示例),是由开发者在开发组件时,通过 [Magic-Form](/docs/guide/advanced/magic-form) 支持的表单项来提供的。 + +在编辑器中对页面进行编辑,保存得到的是一份关于页面基本信息、页面所包含组件以及组件配置信息的配置,我们称为 **uiconfig**,这份配置是最终页面渲染需要的描述信息。 + +JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件的表单配置描述中,直接进行函数编写,功能灵活,对于前端开发来说更符合直觉,几乎没有理解成本。 + +## 表单配置 +组件中的表单配置描述,在经过 Magic-Form 表单渲染器后,可以生成表单栏的配置项。在表单栏中对表单进行配置,配置数据将动态写入 uiconfig 中。 + + + +## uiconfig +编辑器中生成的 uiconfig 序列化存储后,在发布时,将其作为 js 文件发布出去,供生成页使用。一个生成页最终保存的 uiconfig 配置示例如下: + +```javascript +{ + id: "75f0extui9d7yksklx27hff8xg", + name: "test_page", + type: "app", + beginTime: "2021-04-26T16:00:00.000Z", + endTime: "2021-05-28T16:00:00.000Z", + items: [ + { + type: "page", + name: "index", + title: "1", + isAbsoluteLayout: true, + style: { + width: "375", + height: "1728", + backgroundColor: "rgba(218, 192, 192, 1)" + }, + id: "39381280", + items: [ + { + dtEid: "container", + type: "container", + name: "组", + id: "98549062", + renderType: 0, + reportType: "module", + time: 1623850856402, + report: { + module: { + _module: "组_98549062", + eid: "container" + } + }, + devconfig: { + lock: false, + pack: false, + resizable: true, + aspectRatio: false, + ratio: 1, + modify: false + }, + items: [ + { + type: "button", + id: "87016850", + name: "按钮", + style: { + position: "absolute", + left: 57, + top: 152, + right: "", + bottom: "", + width: 270, + height: 38, + backgroundImage: "", + backgroundColor: "#fb6f00", + backgroundRepeat: "no-repeat", + backgroundSize: "100% 100%", + transform: "none", + textAlign: "center", + border: 0 + }, + events: [ + { + name: "magic:common:events:click", + to: "button_3877", + method: "" + } + ], + created: ()=>{}, + renderType: 1, + text: "请输入文本内容", + }, + { + id: "text_7909", + style: { + left: 88, + top: -73, + position: "absolute", + width: 100, + height: 14, + transform: "none" + }, + type: "text", + name: "文本", + text: "请输入文本内容", + multiple: true, + renderType: 1 + }, + { + type: "button", + id: "button_3877", + style: { + position: "absolute", + left: "57", + width: "270", + height: "37.5", + border: 0, + backgroundColor: "#fb6f00" + }, + name: "按钮", + text: "请输入文本内容", + multiple: true, + renderType: 1 + } + ], + style: { + width: "100%", + height: "100", + position: "absolute", + left: 0, + top: 204 + } + } + ] + }, + ] +} +``` \ No newline at end of file diff --git a/docs/src/guide/advanced/layout.md b/docs/src/guide/advanced/layout.md new file mode 100644 index 00000000..e70ce7d9 --- /dev/null +++ b/docs/src/guide/advanced/layout.md @@ -0,0 +1,49 @@ +# 布局原理 +魔方的布局实现方式,**关键在于将布局配置指定在容器上,对容器内的所有子组件生效**,这是魔方页面可以支持各种布局方式混合使用的核心方法。 + +## 容器 +前面概念介绍中有提到,魔方的容器是组件的基础。组件必属于某个容器,容器下可以放组件,也可以放容器。页面本身就是一个容器,是所有容器和组件的根,整个页面的容器和组件组成一个树状结构。在 uiconfig 配置中,表现为: + +```javascript +[{ + id: 123456, + type: 'page', + items: [{ + id: 222222, + type: 'comp-A', + }, { + id: 333333, + type: 'comp-B', + }] +}] +``` + +## 顺序/绝对定位 +组件是绝对或者顺序定位,体现在组件的**直属父级容器**上,比如我们将 page 设置为绝对定位,则它的子组件,全都为绝对定位。在 uiconfig 配置中,表现为: + +```javascript +[{ + id: 123456, + type: 'page', + isAbsoluteLayout: true, + items: [{ + id: 222222, + type: 'comp-A', + style: { + position: 'absolute', + }, + }, { + id: 333333, + type: 'comp-B', + style: { + position: 'absolute', + }, + }] +}] +``` +当然,绝对/顺序排布的配置方式,也只存在于容器中。 + +## 混合布局 +因为魔方的布局配置,是指定在容器上的,所以魔方的设计方式,就可以支持在页面中实现各种混合布局的嵌套。 + + \ No newline at end of file diff --git a/docs/src/guide/advanced/magic-form.md b/docs/src/guide/advanced/magic-form.md new file mode 100644 index 00000000..01b8ef00 --- /dev/null +++ b/docs/src/guide/advanced/magic-form.md @@ -0,0 +1,135 @@ +# Magic-Form +魔方的表单配置,核心就是使用了 magic-form 来作为渲染器。magic-form 是一个 npm 包,可以安装它,在你想使用的地方单独使用。 + +Magic-Form 接受一个表单配置,详细配置可参考[表单api](/docs/api/form.md)。 + +## 安装 + +```bash +# 最新稳定版 +$ npm install @tmagic/form@next +``` + +```bash +$ npm install element-plus +``` + +## 快速上手 + +本节将介绍如何在项目中使用 MagicForm。 + +### 引入 Magic-Form + +MagicForm使用了element-ui库 + +在 main.js 中写入以下内容: + +```javascript +import { createApp } from 'vue'; +import ElementPlus from 'element-plus'; +import MagicForm from '@tmagic/form'; +import 'element-plus/lib/theme-chalk/index.css'; +import App from './App.vue'; + +const app = createApp(App); +app.use(ElementUI); +app.use(MagicForm); +app.mount('#app'); +``` + +在 App.Vue 中写入以下内容: + +```html + + + +``` + +以上代码便完成了 MagicForm 的引入。需要注意的是,ElementUI的样式文件需要单独引入。 + +### 开始使用 + +至此,一个基于 Vue 和 MagicForm 的开发环境已经搭建完毕,现在就可以编写代码了。 + + +### 示例 + + + diff --git a/docs/src/guide/advanced/magic-ui.md b/docs/src/guide/advanced/magic-ui.md new file mode 100644 index 00000000..88fbad35 --- /dev/null +++ b/docs/src/guide/advanced/magic-ui.md @@ -0,0 +1,30 @@ +# Magic-UI +在前面[页面渲染](/docs/guide/advanced/page)中提到的 UI 渲染器,就是包含在 Magic-UI 中的渲染器组件。 + +魔方的设计是希望发布的页面支持多个前端框架,即各个业务方可以根据自己熟悉的语言来开发组件、发布页面。也可以通过 [实现一个 runtime](/docs/page/advanced.html#实现一个-runtime) 的方式,来实现一个自己的 Magic-UI。 + +所以魔方的设计中,针对每个前端框架,都需要有一个对应的 Magic-UI 来承担渲染器职责。同时,也需要一个使用和 Magic-UI 相同前端框架的 runtime 来 Magic-UI 和业务组件的,具体 runtime 概念,可以参考[页面发布](/docs/page/introduction)。 + +Magic-UI 在魔方设计中,承担的是业务逻辑无关的,基础组件渲染的功能。一切和业务相关的逻辑,都应该在 [runtime](/docs/page/introduction.html#runtime) 中实现。这样 Magic-UI 就能保持其通用性。 + +我们以项目代码中提供的 vue3 版本的 Magic-UI 作为示例介绍其中包含的内容。 + +## 渲染器 +在 vue3 中,实现渲染器的具体形式参考[页面渲染](/docs/guide/advanced/page)中描述的[容器渲染](/docs/guide/advanced/page.html#容器渲染)和[组件渲染](/docs/guide/advanced/page.html#容器渲染)。 + +## 基础组件 +在 Magic-UI vue3 中,我们提供了几个基础组件,可以在项目源码中找到对应内容。 + +- page 魔方的页面基础 +- container 魔方的容器渲染器 +- Component.vue 魔方的组件渲染器 +- button/text 基础组件示例 + +其中 page/container/Component 是 UI 的基础,是每个框架的 UI 都应该实现的。 + +button/text 其实就是一个组件开发的示例,具体组件开发相关规范可以参考[组件开发](/docs/component/introduction)。 + +## Magic-UI 示例 +- [vue3 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui) +- [vue2 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-vue2) +- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react) \ No newline at end of file diff --git a/docs/src/guide/advanced/page.md b/docs/src/guide/advanced/page.md new file mode 100644 index 00000000..e9c47175 --- /dev/null +++ b/docs/src/guide/advanced/page.md @@ -0,0 +1,65 @@ +# 页面渲染 +魔方的页面渲染,是通过在载入编辑器中保存的 uiconfig 配置,通过 ui 渲染器渲染页面。在容器布局原理里我们提到过,容器和组件在配置中呈树状结构,所以渲染页面的时候,渲染器会递归配置内容,从而渲染出页面所有组件。 + + + +## 容器渲染 +页面的渲染器,其实就是两个基础组件,基础容器组件和基础组件。页面在读到 uiconfig 配置之后,根组件必定是一个容器,此时渲染基础容器组件,而容器组件的职责很简单,就是将其子组件渲染出来。具体形式为: + +```vue + + + +``` + +## 组件渲染 +所有魔方组件,都通过一个魔方基础组件来渲染,这个基础组件会识别,当前渲染的组件是个普通组件,或者是容器组件,如果是普通组件(包括ui中提供的基础组件和业务开发的业务组件),则直接渲染;如果是个容器,则回到上一步的容器渲染逻辑中。 + +基础组件的具体形式为: +```vue + + + +``` + +## 渲染器示例 +在魔方的示例项目中,我们提供了三个版本的 Magic-UI。可以参考对应前端框架的渲染器实现。 +- [vue3 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui/src/container/src/Container.vue) +- [vue2 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-vue2/src/container/Container.vue) +- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react/src/container/Container.tsx) \ No newline at end of file diff --git a/docs/src/guide/conception.md b/docs/src/guide/conception.md new file mode 100644 index 00000000..50c5abac --- /dev/null +++ b/docs/src/guide/conception.md @@ -0,0 +1,62 @@ +# 基础概念 +我们通过讲述魔方的一些基础概念。帮助开发者可以了解魔方是如何运行以及如何在基础项目之上开发、使用它。 + +## 编辑器 +编辑器基础布局上分为:左面板、工作区、右面板、工具栏,如下图。 +- **左面板**,包含了组件库的展示,以及工作区中已添加组件的组件树展示。 +- **工作区**,一个页面模拟器,用于实时展示用户添加到当前页面中的组件在真实页面中的展示情况。 +- **右面板**,展示组件提供出来的表单选项,让用户可以通过配置项来改变组件的行为和样式。 +- **工具栏**,放置一些如缩放、撤销等工具按键。 + + +### 组件 +组件是魔方可配置页面元素的最小单位。我们都会从左面版的组件区中选中组件,加入到工作区的模拟器中,然后在右面板中对组件进行配置。一个组件的基本内容,会包含如下: +- 组件样式、逻辑代码(即开发者写的 vue, react 等代码)。 +- 表单配置描述,魔方的定义是导出一个表单对象,这份配置仅在编辑器中使用。 +- 拓展描述,这部分内容目前还未有严格定义,但是我们保留这个扩展能力。 +- 组件 `type`, 是组件的类型,这是用来告诉编辑器,我们要渲染的是什么组件。每个组件在开发时就应该确定这样一个唯一、不和其他组件冲突的组件 `type`。 + +### 插件 +插件和组件类似,但是插件的功能是作为页面逻辑行为的一种补充方式。一般不显式的在模拟器中被渲染出具体内容(除非插件中会生成组件并插入页面),通常我们会用插件实现类似登录,页面环境判断,请求拦截器等等功能。 + +插件一般包含如下内容: +- 插件逻辑代码。 +- 插件 `type`,是插件的类型,和组件 `type` 作用相同。在开发时就应该确定这样一个唯一、不和其他组件冲突的组件 `type`。 + + +### 容器 +容器是魔方编辑器中的一个基础单位,页面本身就是一个容器,在基础组件中称为**组**,魔方通过容器概念,实现了丰富的布局方式,因为我们的布局行为是设置在容器上的,容器内的组件是绝对定位、或是顺序排布,是根据容器的配置行为改变的。魔方的容器理论上可以无限嵌套。 + +### 表单配置 +表单配置是编辑器右面板展示的内容,配置项目都是由组件里的表单描述来决定的,用户可以在表单配置区域里通过配置项来改变组件的行为和样式。 + +注意,由于每个组件都需要有一些共同的表单配置项目,所以魔方通过在表单渲染器,统一为所有组件加上了通用的表单配置项目。包括基础组件样式配置、钩子事件配置等。 + +### uiconfig +uiconfig 是编辑器搭建页面的最终产物(描述文件),其中包含了所有组件信息(组件布局,组件配置等)和插件内容,以及其他可拓展的信息都存放在 uiconfig 中。魔方活动页的展示即是魔方页面在加载 uiconfig 之后,根据 uiconfig 的描述进行渲染的。在魔方中,我们使用 JS schema 来保存这份配置文件。 + +## 页面 +页面是魔方作为一个可视化编辑器经过配置后,最终得到的呈现结果。搭建后的页面会被发布上线,供用户访问。 + +### runtime +我们把页面统一称为 runtime,更具体的 runtime 概念可以查看[页面发布](/docs/page/introduction.html#runtime)。**runtime 是承载魔方活动页面的运行环境**。编辑器的工作区是 runtime 的一个具体实例,另一个就是我们发布上线后,用户访问的真实活动页面。 + +### magic-ui +magic-ui 包含了魔方的基础组件库,提供了容器、文本、按钮这样的基础组件。我们提供了不同语言框架的 magic-ui,如 vue2 和 vue3。 + +magic-ui 和 runtime 是配套出现的,runtime 必须基于 magic-ui 才可以实现渲染。因为 magic-ui 需要提供 runtime 所需要的渲染器。 + +## 联动 +页面搭建过程中,会涉及到两种联动形式 +- 在编辑器中,组件的表单配置项之间需要联动。 +- 页面中的组件之间,需要联动触发行为。 + +### 表单联动 +配置项 A 改变值,希望能触发配置项 B 相应的变成另外一个值,就是表单联动的一个示例。魔方实现表单联动的方式,就是通过渲染的时候,将表单对象注入,在组件的表单配置描述中,可以通过函数声明来获取并且进行逻辑编写,实现表单联动。 + +### 组件联动 +组件 A 在完成点击事件后,希望组件 B 可以展示一个弹窗,就是组件联动的一个示例。魔方通过事件绑定方式,可以为组件 A 和 B 配置事件关联,实现上述的组件联动。 +组件联动 + + + diff --git a/docs/src/guide/installation.md b/docs/src/guide/installation.md new file mode 100644 index 00000000..2fe07be3 --- /dev/null +++ b/docs/src/guide/installation.md @@ -0,0 +1,159 @@ +# 快速开始 +魔方的编辑器我们已经封装成一个 npm 包,可以直接安装使用。编辑器是使用 vue3 开发的,但使用编辑器的业务可以不限框架,可以用vue2、react等开发业务组件。 + +## 安装 + +node.js > 14 + +可以通过[Vite](https://github.com/vitejs/vite) 或 [Vue CLI](https://cli.vuejs.org/zh/)快速创建项目。 + +推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。 + +```bash +# 最新稳定版 +$ npm install @tmagic/editor@next -S +``` + +editor中组件自定义属性配置由[magic-form](../form/introduction.md)提供,需要添加@tmagic/form依赖;editor 与 form 中使用到的UI组件都由 [element-plus](https://element-plus.org/)提供,需要添加element-plus依赖。 + +```bash +$ npm install @tmagic/form@next element-plus -S +``` + +## 快速上手 + +### 引入 @tmagic/editor + +在 main.js 中写入以下内容: +```js +import { createApp } from 'vue'; +import ElementPlus from 'element-plus'; +import zhCn from 'element-plus/es/locale/lang/zh-cn'; + +import MagicEditor from '@tmagic/editor'; +import MagicForm from '@tmagic/form'; + +import App from './App.vue'; + +import 'element-plus/dist/index.css'; +import '@tmagic/editor/dist/style.css'; +import '@tmagic/form/dist/style.css'; + +const app = createApp(App); +app.use(ElementPlus, { + locale: zhCn, +}); +app.use(MagicEditor); +app.use(MagicForm); +app.mount('#app'); + +``` +以上代码便完成了 @tmagic/editor 的引入。需要注意的是,样式文件需要单独引入。 + +### 使用 m-editor 组件 + +在 App.vue 中写入以下内容: +```html + + + + + +``` + +关于 Magic-Editor 组件,更多的属性配置详情请参考[编辑器API](/docs/api/editor.md)。 + +其中,**有四个需要注意的属性配置项**:`runtimeUrl` `values` `configs` `componentGroupList`。这是能让我们的编辑器正常运行的关键。 + +### runtimeUrl +该配置涉及到 [runtime 概念](/docs/guide/conception.html#runtime),魔方编辑器中心的模拟器画布,是一个 iframe(这里的 `runtimeUrl` 配置的,就是你提供的 iframe 的 url),其中渲染了一个 runtime,用来响应编辑器中的组件增删改等操作。 + +::: tip 如何快速得到一个 runtime +如果要快速启动,可以使用[魔方项目源码](https://github.com/Tencent/tmagic-editor)中的 runtime,在提供的三个框架 vue2/vue3/react runtime 目录中选择一个,执行 `npm run build` 得到产物,并将产物放到你的项目中,此处的 runtimeUrl 指向你放置 playground.html 的路径。 +::: + +### componentGroupList +`componentGroupList` 是指定左侧组件库内容的配置。此处定义了在编辑器组件库中有什么组件。在添加的时候通过组件 `type` 来确定 runtime 中要渲染什么组件。可以参考 [componentGroupList 配置](/docs/api/editor.html#componentgrouplist)。 + +### propsConfigs/propsValues +`propsConfigs` `propsValues` 和 `componentGroupList` 中声明的组件是一一对应的,通过 `type` 来识别属于哪个组件,该配置涉及的内容,就是组件的表单配置描述,在[组件开发中](/docs/component/introduction.html#组件开发)会通过 formConfig 配置来声明这份内容。 + +`configs` 既可以通过 hardcode 方式写上每个组件的表单配置,也可以通过组件打包方式得到对应内容,然后通过异步加载来载入。比如: +```javascript +setup() { + asyncLoadJs(`/runtime/vue3/assets/config.js`).then(() => { + propsConfigs.value = window.magicPresetConfigs; + }); + asyncLoadJs(`/runtime/vue3/assets/value.js`).then(() => { + propsValues.value = window.magicPresetValues; + }); +} +``` + +::: tip 如何快速得到一个 configs/values +上述的 runtime 产物中,assets 目录中即包含一个 configs 文件,在你的项目组件初始化之后,异步加载它。并如上面代码中,赋值给 configs/values 即可。 +::: + +### 更多 +通过上述步骤,可以快速得到一个初始化的简单编辑器。在编辑器中,对于使用者来说,需要了解的核心内容: +- [魔方编辑器的基础概念](/docs/guide/conception) +- [编辑器的产物 uiconfig]() +- [runtime 的概念](/docs/page/introduction.html) +- [如何实现一个 runtime](/docs/page/advanced.html) + +除了上述内容外,文档的其他章节中,也会更深入的描述整个魔方的设计理念和实现细节。同时你也可以查看我们的[项目源码](https://github.com/Tencent/tmagic-editor),从源码提供的 playground 和 runtime 示例来开发和理解魔方。 \ No newline at end of file diff --git a/docs/src/guide/introduction.md b/docs/src/guide/introduction.md new file mode 100644 index 00000000..2fd8f91a --- /dev/null +++ b/docs/src/guide/introduction.md @@ -0,0 +1,45 @@ +# 介绍 + +魔方可视化开源项目(Magic)是从魔方平台演化而来的开源项目,意在提供一个供开发者快速搭建可视化搭建平台的解决方案。 + +魔方demo图 + +## 特性 + +- **所见即所得**,体验友好的拖拽编辑方式。 +- **丰富的拓展能力**,支持业务方自定义组件、插件、扩展编辑器能力。 +- **支持多种布局方式**,魔方的容器概念,支持配置活动时,自由组合嵌套业务组件,提供超强的组件布局方式。 +- **支持不同前端框架**,使用编辑器的业务方可以采用自己熟悉的前端框架,来开发自己的业务组件,比如vue2、vue3、react。 +- **强大的配置**,支持表单联动的配置能力。 +- **组件联动**,支持组件通信、组件联动,允许页面内各组件提供丰富配置能力。 +- **低代码**,支持针对具体配置的页面写代码,修改页面样式属性等,提供除组件外的高级编码能力。 + +## 编辑器 + +编辑器是可视化搭建平台的主要内容,其中包含以下内容: + +- **编辑器**,承载整个拖拽布局的页面,包含了下述的其他页面可见元素。 +- **模拟器**,居中位置渲染了当前页面配置的组件内容,模拟真实页面的展示内容。 +- **组件库**,左侧展示当前业务下的相关组件内容,包含魔方提供的基础组件和业务自定义组件。 +- **组件树**,左侧展示当前页面添加的组件内容,以树状结构展示。 +- **表单配置**,右侧表单项目,展示由组件内提供的配置描述,提供修改组件行为的配置项。 +- **uiconfig 源码**,右上角的 📄 图标可以展示当前页面,各个组件配置,页面基础配置组合而成的配置源码。 + +通过编辑器,可以创建、编辑、保存一个活动页面。同时,魔方开源项目提供了一个页面搭建管理平台的示例:magic-admin,可以用于快速构建一个完整的页面可视化搭建系统。 + +## 核心库 + +- **@tmagic/editor** 实现一个可视化编辑器。 +- **@tmagic/form** 实现组件在编辑器中自定义表单配置。 +- **@tencent/magic-core** 实现对组件进行跨框架管理与一些通用复杂逻辑的实现。 +- **@tencent/magic-stage** 实现在编辑器中对组件的位置拖动与大小拖拉。 +- **@tencent/magic-ui** 提供一些基础组件。 +- **runtime** 实现在编辑器中对使用不同框架的组件的渲染。 +- **page** 项目提供最终页面发布的执行环境与组件构建。 + +可以查阅 Magic 的[源代码](https://github.com/Tencent/tmagic-editor),与文档描述内容可以逐一对应上,希望文档内容可以为开发者带来比较好的开发体验。 + +## 谁在使用 + +- 腾讯视频:视频会员,体育会员,WETV 国际版,TV,doki 商城,小企鹅,小说,漫画 +- 腾讯会议 diff --git a/docs/src/page/advanced.md b/docs/src/page/advanced.md new file mode 100644 index 00000000..3be1fe77 --- /dev/null +++ b/docs/src/page/advanced.md @@ -0,0 +1,142 @@ +# 深入 +本章详细介绍如何深入理解魔方的打包,以及如何根据需求定制,修改魔方的页面打包发布方案。页面发布、打包相关的定制化开发,需要使用魔方的业务方,搭建好基于开源魔方的管理平台、存储服务等配套设施。 + +## 实现一个 runtime +在 [Magic-UI](/docs/guide/advanced/magic-ui.html) 部分,我们已经说过,runtime 和 UI 是配套实现的。每个版本的 runtime 都需要一个对应的 UI 来作为渲染器,实现渲染 uiconfig 呈现页面的功能。 + +### UI +一个 UI 应该至少包含一个渲染器,来实现[页面渲染](/docs/guide/advanced/page.html)。同时可以提供一些基础组件。具体实现可以参考[Magic-UI](/docs/guide/advanced/magic-ui.html)。 + +### page +runtime 的 `page` 部分,就是真实活动页面的渲染环境。发布出去的活动页都需要基于该部分来实现渲染功能。而 `page` 的主要逻辑,就是需要加载 UI,同时实现业务方需要的业务逻辑,比如: +- 提供页面需要的全局 api +- 业务需要的特殊实现逻辑 +- 加载第三方全局组件/插件等 + +具体的 page 实现示例,可以参考 +- [vue3 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue3/src/page) +- [vue2 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue2/src/page) +- [react runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/react/src/page) + +### playground +runtime 的 `playground` 部分,和 `page` 做的事情几乎一致,业务方可以包含上述 `page` 所拥有的全部能力。但是,因为 playground 需要被编辑器加载,作为编辑器中页面模拟器的渲染容器,和编辑器通信,接受编辑器中组件的增删改查。所以,除了保持和 `page` 一样的渲染逻辑之外,`playground` 还要额外实现一套既定通信内容和 api,才能实现和编辑器的通信功能。 + +#### onRuntimeReady +**在 playground 页面渲染后**,需要调用接口通知编辑器完成加载。该调用需要传入一个参数 API,即挂载了增删改查功能的对象示例,提供给编辑器。 +```javascript +window.magic?.onRuntimeReady(API) +``` + +#### onPageElUpdate +**playground 在每次更新了页面配置后**,调用一次 onPageElUpdate 并传入一个 DOM 节点,该方法作用是传入一个页面渲染组件的根节点,用来告知编辑器的模拟器遮罩如何作出反应。 +```javascript +window.magic.onPageElUpdate(document.querySelector('.magic-ui-page')); +``` + +#### 提供 API +| API | 说明 | 参数 | +|---------- |-------- |---------- | +|updateRootConfig| 根节点更新 | `root: MApp` | +|updatePageId| 更新当前页面 id | `id: string` | +|select| 选中组件 | `id: string`| +|add| 增加组件 | { `config` , `root` }: `UpdateData` | +|update| 更新组件 | { `config` , `root` }: `UpdateData` | +|remove| 删除组件 | { `config` , `root` }: `UpdateData` | +|sortNode| 组件在容器间排序 |{ `src` , `dist`, `root` }: `SortEventData` | + +runtime 的实现示例,可以参考魔方提供的: +- [vue3 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue3) +- [vue2 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue2) +- [react runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/react) + +## 打包原理 +在魔方的示例打包方案中,是基于 runtime 代码,以及 runtime 的打包配置进行的打包构建,将构建得到的产物发布,在魔方页面最终发布时,通过加载构建产物和 uiconfig 来实现页面渲染。 + +### 打包配置 +在 vite.config.ts 中有如下配置: +```javascript +export default { + build: { + sourcemap: true, + minify: false, + + rollupOptions: { + input: { + page: './page.html', + playground: './playground.html', + components: './src/comp-entry.ts', + config: './src/config-entry.ts', + value: './src/value-entry.ts', + }, + output: { + entryFileNames: 'assets/[name].js', + }, + }, + } +} +``` +打包时,即会生成对应的静态资源,我们在对应地方使用时,加载对应入口文件的打包产物即可。其中 page.html 和 playground.html 在示例项目中,而另外三个入口是在打包过程中动态生成的。 + +### 打包产物 +执行打包命令`npm run build`后,会在 runtime/src 中生成三个入口文件 +``` +comp-entry.ts +config-entry.ts +value-entry.ts +``` + +这三个入口文件是基于 scripts/units.js 中描述的组件信息生成的,units.js 中的组件信息如何获取和生成,需要由使用魔方代码的业务方自行处理。更多关于魔方组件规范相关可以查阅[组件开发文档](/docs/component/introduction.html)。示例的 units.js 文件中,组件描述是以组件在魔方中定义的 type 为 key,包名(或本地路径)为 value 的对象。 + +魔方的[打包脚本](/docs/page/introduction.html#打包脚本)会根据这个组件声明,进行分析,生成上述三个入口文件: +::: tip 生成步骤为 +1. 分析包结构,是否符合魔方组件规范 +2. 分析每个组件包内的 config value 和组件逻辑代码的入口 +3. 生成包含所有组件信息的三个入口文件 +::: + +同时得到打包产物 dist 目录。包含了如下的主要文件: +``` +|----dist + |----assets + | |----components.js + | |----config.js + | |----value.js + |----page.html + |----playground.html +``` + +::: tip 各个文件作用说明 +- page.html 即真实活动页渲染时,用户加载的页面框架,魔方在发布时,会将活动页面所需的信息注入到 page.html 中,让用户加载了页面后,能拉取到对应的活动信息。 +- playground.html 是编辑器中模拟器使用的静态资源。魔方的模拟器使用 iframe 渲染,即加载了 playground.html,并注入编辑器中的配置信息,实现页面渲染。 +- component.js 是所有自定义组件的入口,在 runtime 中需要加载组件,交由渲染器渲染页面。 +- config.js 和 value.js 是编辑器中的各个组件的表单配置信息和表单初始值的入口,仅在编辑器中会被使用到。 +::: + + +打开活动页面加载的产物资源: +魔方 runtime page 示意图 + +在编辑器中加载的产物资源: +魔方 runtime playground 示意图 + +### 页面发布 +如介绍中提到的,魔方页面发布方案,是对构建产物 page.html 进行活动信息注入。活动信息就是搭建平台存储的页面配置。发布时,将注入活动信息的 page.html 发布出去即可。 + +## 版本管理 +基于上一步提到的打包原理,每次执行`npm run build`后,得到的产物都可以进行归档编号,存为版本。涉及到的组件改动和新增修改,体现在各个版本中。 + +版本选择 + +版本管理具体如何实现取决于使用魔方的业务方相关,拥有版本管理能力,具有如下优点: +1. 对于已经配置好发布的活动,使用固定版本,不会被新版本的特性影响,保证活动线上稳定运行 +2. 发布的新版本如果出现问题,可以及时回退选择使用旧版本 + +## 结合业务定制 +魔方的静态资源构建,活动配置保存,页面发布,在魔方的提供的示例方案中,流程是: +1. 触发构建,执行流水线,基于 runtime 执行 build +2. 将构建产物归档推送至 cdn,存为一个ui版本 +3. 活动配保存后,活动发布时,将活动配置发布至 CDN 存储为 uiconfig.js,同时根据当前活动使用的ui版本,获取到 page.html,将 uiconfig.js 引用方式以 script 标签形式写入。 +4. 将注入信息的 page.html 发布为活动静态资源 act.html +5. 线上可加载 act.html 访问活动 + +其中各个步骤的定制,可以交由业务方根据魔方提供的示例进行自定义修改。 \ No newline at end of file diff --git a/docs/src/page/introduction.md b/docs/src/page/introduction.md new file mode 100644 index 00000000..9f94e629 --- /dev/null +++ b/docs/src/page/introduction.md @@ -0,0 +1,106 @@ +# 介绍 +本章主要介绍魔方页面打包、发布相关的基础概念,打包原理,打包方案实现。使用了魔方开源代码的业务方可以自由定制页面的打包构建方案。 + +## 编辑器产物 uiconfig +编辑器中最终保存得到的的配置结果,同时也是魔方页面最终渲染的描述文件,就是一份 JS schema 形式的 uiconfig。其具体形式就是在 [JS Schema](/docs/guide/advanced/js-schema.html#uiconfig) 我们示例中提到的内容。 + +在魔方编辑器中,所有的操作和配置信息,最终都保存成这一份 uiconfig。这份配置在魔方 runtime 中被加载和渲染,最终呈现出魔方活动页。 + +## runtime +runtime 的概念,是理解魔方活动页运行的重要感念,runtime 是承载魔方活动页面的运行环境。可视化页面需要在魔方编辑器中搭建、渲染,通过模拟器所见即所得。搭建完成后,保存配置并发布,然后渲染到真实页面。其中涉及到两个不同的 runtime: +- 编辑器中的模拟器 +- 终端打开真实页面 + +所以更深入描述,runtime 是魔方页面的渲染环境,提供不同场景下的能力封装。如果理解了魔方的设计,阅读了魔方的源码,可以发现,runtime 只是对魔方的渲染器做了一层包装,在不同 runtime 中,魔方的渲染逻辑和组件代码都是相同的。 + +并且,由于魔方在编辑器中的模拟器是通过 iframe 渲染的,和魔方平台本身可以做到框架解耦,所以 runtime 也可以用不同框架开发。目前魔方提供了 vue2/vue3 和 react 的 runtime 示例。 + +各个 runtime 的作用除了作为不同场景下的渲染环境,同时也是不同环境的打包构建载体。魔方示例代码中的打包就是基于 runtime 进行的。 + +### 业务相关 +由于 runtime 是页面渲染的承载环境,其中会加载 Magic-UI 以及各个业务组件,业务发布活动页也是基于 runtime,所以在 runtime 中实现业务方的自定逻辑是最合适的。runtime 可以提供一些全局 API,供业务组件调用。我们可以把下面的模拟器中的 runtime 视为一个业务方runtime。 + +魔方提供了三个版本的 runtime 示例,可以参考: +- [vue3 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue3) +- [vue2 runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/vue2) +- [react runtime](https://github.com/Tencent/tmagic-editor/blob/master/runtime/react) + +### 真实页面渲染(Page) +这一部分,对应的是 runtime 中的 page。即把魔方保存后的配置进行加载、解析、渲染,然后呈现页面的过程。 +魔方 runtime page 示意图 + +### 模拟器中的页面渲染(Playground) +这一部分,对应的是 runtime 中的 playground。其实仔细查看源码,playground 和 page runtime 的差异,在于 playground 中需要响应编辑器中用户的操作: +- 组件的增删改 +- 表单配置修改 + +响应用户配置修改的操作代码并不需要在用户打开的页面被使用到,这是两个 runtime 的主要差异。 +魔方 runtime playground 示意图 + +## 打包脚本 +在魔方各个框架的 runtime 目录中,有对应的 scripts 打包脚本目录。由于各个框架的 runtime 间有可能有不同的打包方式,所以为了架构职责明确,我们将示例打包代码分别放入对应 runtime 的 scripts 目录中。 + +详细的打包脚本,可以参考调用[魔方打包脚本 generateEntry](https://github.com/Tencent/tmagic-editor/blob/master/runtime/scripts/generateEntry.js)。 + +在 runtime 中,我们通过 vite.config.ts 定义了打包入口文件,在 package.json 中声明了打包命令。你可以进入对应的 runtime 目录中尝试执行 +```bash +npm i +npm run build +``` + +我们就可以得到打包产物 dist 目录。其中有我们在线上活动页面使用的 page.html 和编辑器模拟器使用的 playground.html 两个 runtime 页面框架。 + +## 页面发布 +魔方的页面发布,目前使用的是静态资源发布。而所有配置出的活动页唯一的区别,就是配置信息。我们发布页面时,将页面的配置信息插入到 page.html 中,然后将修改后的 page.html 发布至 CDN,得到活动页面。 + +原始的 page.html 页面框架 +```html + + + + + + Magic App + + + + + + + + + + +
+ + + +``` + +插入活动信息后的 page.html +```html + + + + + + Publish Page + + + + + + + + + + + + +
+ + + + +``` + diff --git a/package.json b/package.json index e56211eb..f11daa2b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint": "eslint . --ext .js,.vue,.ts,.tsx", "lint-fix": "eslint . --fix --ext .vue,.js,.ts,.tsx", "playground": "npx lerna run dev --scope tmagic-playground --scope runtime-vue3 --parallel", - "build": "npx lerna run build --parallel", + "build": "npx lerna run build --scope tmagic-playground --scope runtime-vue3 --scope runtime-vue2 --scope runtime-react --scope @tmagic/* --parallel", "postbuild": "npx mkdir playground/dist/runtime && npx cp -r runtime/vue2/dist ./playground/dist/runtime/vue2 && npx cp -r runtime/vue3/dist ./playground/dist/runtime/vue3 && npx cp -r runtime/react/dist ./playground/dist/runtime/react", "docs": "cd docs && npm run doc:dev", "page": "cd page && vite", diff --git a/playground/package-lock.json b/playground/package-lock.json index 88342085..b85b891a 100644 --- a/playground/package-lock.json +++ b/playground/package-lock.json @@ -1,5 +1,5 @@ { - "name": "magic-playground", + "name": "tmagic-playground", "version": "1.0.0-beta.1", "lockfileVersion": 1, "requires": true, diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index 46f9e34a..0aa08f89 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -30,19 +30,19 @@ import { Coin, Connection, Document, FolderOpened, SwitchButton, Tickets } from import { ElMessage } from 'element-plus'; import serialize from 'serialize-javascript'; -import type { MagicEditor, MenuBarData, MoveableOptions } from '@tmagic/editor'; +import type { MenuBarData, MoveableOptions, TMagicEditor } from '@tmagic/editor'; import StageCore from '@tmagic/stage'; import { asyncLoadJs } from '@tmagic/utils'; import config from '../config'; -const RUNTIME_PATH = '/runtime/vue3'; +const RUNTIME_PATH = '/tmagic-editor/playground/runtime/vue3'; export default defineComponent({ name: 'EditorApp', setup() { - const editor = ref>(); + const editor = ref>(); const previewVisible = ref(false); const value = ref(config); const defaultSelected = ref(config.items[0].id); diff --git a/playground/vite.config.ts b/playground/vite.config.ts index fa53a584..ae7f6bd8 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -26,6 +26,8 @@ import vueJsx from '@vitejs/plugin-vue-jsx'; export default defineConfig({ plugins: [vue(), vueJsx()], + base: '/tmagic-editor/playground', + resolve: { alias: [ { find: /@editor/, replacement: path.join(__dirname, '../packages/editor/src') }, @@ -52,23 +54,20 @@ export default defineConfig({ host: '0.0.0.0', port: 8098, proxy: { - '^/runtime/react': { + '^/tmagic-editor/playground/runtime/react': { target: 'http://127.0.0.1:8076', changeOrigin: true, prependPath: false, - rewrite: (path: string) => path.replace(/^\/runtime\/react/, ''), }, - '^/runtime/vue2': { + '^/tmagic-editor/playground/runtime/vue2': { target: 'http://127.0.0.1:8077', changeOrigin: true, prependPath: false, - rewrite: (path: string) => path.replace(/^\/runtime\/vue2/, ''), }, - '^/runtime/vue3': { + '^/tmagic-editor/playground/runtime/vue3': { target: 'http://127.0.0.1:8078', changeOrigin: true, prependPath: false, - rewrite: (path: string) => path.replace(/^\/runtime\/vue3/, ''), }, }, }, diff --git a/runtime/react/src/playground/main.tsx b/runtime/react/src/playground/main.tsx index 8b7602c8..36bba442 100644 --- a/runtime/react/src/playground/main.tsx +++ b/runtime/react/src/playground/main.tsx @@ -27,7 +27,7 @@ import { getUrlParam } from '@tmagic/utils'; import App from './App'; -const componentUrl = '/runtime/react/assets/components.js'; +const componentUrl = '/tamgic-editor/playground/runtime/react/assets/components.js'; import(componentUrl).then(() => { const { components } = window.magicPresetComponents; diff --git a/runtime/react/vite.config.ts b/runtime/react/vite.config.ts index 1ee4395c..f1eb64db 100644 --- a/runtime/react/vite.config.ts +++ b/runtime/react/vite.config.ts @@ -23,7 +23,7 @@ import reactRefresh from '@vitejs/plugin-react-refresh'; // https://vitejs.dev/config/ export default defineConfig({ - base: '', + base: '/tmagic-editor/playground/runtime/react', plugins: [reactRefresh()], resolve: { diff --git a/runtime/vue2/src/playground/main.ts b/runtime/vue2/src/playground/main.ts index eb77d914..40a81a0c 100644 --- a/runtime/vue2/src/playground/main.ts +++ b/runtime/vue2/src/playground/main.ts @@ -20,7 +20,7 @@ import Vue from 'vue'; import App from './App.vue'; -const componentUrl = '/runtime/vue2/assets/components.js'; +const componentUrl = '/tamgic-editor/playground/runtime/vue2/assets/components.js'; import(componentUrl).then(() => { const { components, plugins } = window.magicPresetComponents; diff --git a/runtime/vue2/vite.config.ts b/runtime/vue2/vite.config.ts index 0efbba89..ade0e6c9 100644 --- a/runtime/vue2/vite.config.ts +++ b/runtime/vue2/vite.config.ts @@ -24,7 +24,7 @@ import { createVuePlugin } from 'vite-plugin-vue2'; import externalGlobals from 'rollup-plugin-external-globals'; export default defineConfig({ - base: '', + base: '/tmagic-editor/playground/runtime/vue2', plugins: [createVuePlugin(), externalGlobals({ vue: 'Vue' }, { exclude: ['page.html', 'playground.html'] })], resolve: { diff --git a/runtime/vue3/src/playground/main.ts b/runtime/vue3/src/playground/main.ts index cb65bb49..7165d18d 100644 --- a/runtime/vue3/src/playground/main.ts +++ b/runtime/vue3/src/playground/main.ts @@ -20,7 +20,7 @@ import { createApp } from 'vue'; import App from './App.vue'; -const componentUrl = '/runtime/vue3/assets/components.js'; +const componentUrl = '/tmagic-editor/playground/runtime/vue3/assets/components.js'; import(componentUrl).then(() => { const magicApp = createApp(App); diff --git a/runtime/vue3/vite.config.ts b/runtime/vue3/vite.config.ts index 1a1ff35a..8627b47c 100644 --- a/runtime/vue3/vite.config.ts +++ b/runtime/vue3/vite.config.ts @@ -25,7 +25,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'; import externalGlobals from 'rollup-plugin-external-globals'; export default defineConfig({ - base: '', + base: '/tmagic-editor/playground/runtime/vue3', plugins: [vue(), vueJsx(), externalGlobals({ vue: 'Vue' }, { exclude: ['page.html', 'playground.html'] })], resolve: {