diff --git a/.gitignore b/.gitignore
index 6455d757..7e1ca17c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,4 +96,5 @@ coverage
scripts/__tests__/examples/dist
!scripts/__tests__/examples/dist/.gitkeep
*.zip
-!capture/*.zip
\ No newline at end of file
+!capture/*.zip
+!5f686585-c5d0-4057-93b2-c54832ffb393.zip
\ No newline at end of file
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
index 2ab53096..3b9b956a 100644
--- a/docs/.vitepress/config.mts
+++ b/docs/.vitepress/config.mts
@@ -18,7 +18,7 @@ export default defineConfig(
{ text: "首页", link: "/" },
{ text: "指南", link: "/guide/intro/what-is-skip" },
{ text: "进阶", link: "/advance/layout-inspect/intro" },
- // { text: "布局检查", link: "/inspect/index", target: "_blank" },
+ { text: "布局检查", link: "/inspect/index", target: "_blank" },
],
sidebar: {
"/guide/": [
diff --git a/docs/inspect/InspectContainer.vue b/docs/inspect/InspectContainer.vue
index a6fe8389..7a8c0cc6 100644
--- a/docs/inspect/InspectContainer.vue
+++ b/docs/inspect/InspectContainer.vue
@@ -19,7 +19,10 @@
:style="{ width: `${nodeTreeWidth}px` }"
/>
-
+
+
+
+
@@ -28,6 +31,7 @@
import NodeTree from "./NodeTree.vue";
import NodeTable from "./NodeTable.vue";
import NodePic from "./NodePic.vue";
+import NodeCode from "./inspect-node-container/NodeCode.vue";
import { ref, onMounted, onBeforeUnmount } from "vue";
import { AccessibilityNode, AccessibilityNodeTree, AccessibilityWindow } from "./types";
diff --git a/docs/inspect/InspectHeader.vue b/docs/inspect/InspectHeader.vue
index 3602d092..3456a1e2 100644
--- a/docs/inspect/InspectHeader.vue
+++ b/docs/inspect/InspectHeader.vue
@@ -4,6 +4,7 @@
批量上传
批量删除
+ 获取示例
@@ -50,6 +51,26 @@ const handleOnChange = async () => {
});
};
+const handleGetExample = async () => {
+ const response = await fetch("/5f686585-c5d0-4057-93b2-c54832ffb393.zip");
+ const arrayBuffer = await response.arrayBuffer();
+ const { added, extractZip } = useZip(arrayBuffer);
+ await extractZip();
+ if (added.value === true) {
+ emits("uploadSuccess");
+ ElNotification({
+ title: "示例文件添加成功",
+ message: "示例文件添加成功",
+ type: "success",
+ });
+ } else
+ ElNotification({
+ title: "示例文件已存在",
+ message: "示例文件已存在,无需重复添加",
+ type: "warning",
+ });
+};
+
onMounted(() => {
const el = document.querySelector(".el-upload__input")!;
el.oncancel = () => {
diff --git a/docs/inspect/NodeTable.vue b/docs/inspect/NodeTable.vue
index 530ca2f3..84d8ab34 100644
--- a/docs/inspect/NodeTable.vue
+++ b/docs/inspect/NodeTable.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/docs/inspect/inspect-node-container/NodeCode.vue b/docs/inspect/inspect-node-container/NodeCode.vue
new file mode 100644
index 00000000..aaeb0a4b
--- /dev/null
+++ b/docs/inspect/inspect-node-container/NodeCode.vue
@@ -0,0 +1,94 @@
+
+
+
+ {{
+ copyButtonText
+ }}
+
+
+
+
+
+
diff --git a/docs/public/5f686585-c5d0-4057-93b2-c54832ffb393.zip b/docs/public/5f686585-c5d0-4057-93b2-c54832ffb393.zip
new file mode 100644
index 00000000..3efda198
Binary files /dev/null and b/docs/public/5f686585-c5d0-4057-93b2-c54832ffb393.zip differ
diff --git a/package-lock.json b/package-lock.json
index cbc74272..7655206a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,9 +12,12 @@
"skip": "file:"
},
"devDependencies": {
+ "@codemirror/lang-yaml": "^6.1.1",
+ "@codemirror/theme-one-dark": "^6.1.2",
"@types/jest": "^29.5.12",
"@types/js-yaml": "^4.0.9",
"autoprefixer": "^10.4.20",
+ "codemirror": "^6.0.1",
"element-plus": "^2.8.0",
"idb": "^8.0.0",
"jest": "^29.7.0",
@@ -26,6 +29,7 @@
"ts-node": "^10.9.2",
"vitepress": "^1.3.1",
"vitepress-plugin-mermaid": "^2.0.16",
+ "vue-codemirror": "^6.1.1",
"zod": "^3.23.8"
}
},
@@ -717,6 +721,124 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@codemirror/autocomplete": {
+ "version": "6.18.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.1.tgz",
+ "integrity": "sha512-iWHdj/B1ethnHRTwZj+C1obmmuCzquH29EbcKr0qIjA9NfDeBDJ7vs+WOHsFeLeflE4o+dHfYndJloMKHUkWUA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.17.0",
+ "@lezer/common": "^1.0.0"
+ },
+ "peerDependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/commands": {
+ "version": "6.6.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.6.2.tgz",
+ "integrity": "sha512-Fq7eWOl1Rcbrfn6jD8FPCj9Auaxdm5nIK5RYOeW7ughnd/rY5AmPg6b+CfsG39ZHdwiwe8lde3q8uR7CF5S0yQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.4.0",
+ "@codemirror/view": "^6.27.0",
+ "@lezer/common": "^1.1.0"
+ }
+ },
+ "node_modules/@codemirror/lang-yaml": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-yaml/-/lang-yaml-6.1.1.tgz",
+ "integrity": "sha512-HV2NzbK9bbVnjWxwObuZh5FuPCowx51mEfoFT9y3y+M37fA3+pbxx4I7uePuygFzDsAmCTwQSc/kXh/flab4uw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.2.0",
+ "@lezer/yaml": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/language": {
+ "version": "6.10.3",
+ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.3.tgz",
+ "integrity": "sha512-kDqEU5sCP55Oabl6E7m5N+vZRoc0iWqgDVhEKifcHzPzjqCegcO4amfrYVL9PmPZpl4G0yjkpTpUO/Ui8CzO8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.23.0",
+ "@lezer/common": "^1.1.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0",
+ "style-mod": "^4.0.0"
+ }
+ },
+ "node_modules/@codemirror/lint": {
+ "version": "6.8.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.2.tgz",
+ "integrity": "sha512-PDFG5DjHxSEjOXk9TQYYVjZDqlZTFaDBfhQixHnQOEVDDNHUbEh/hstAjcQJaA6FQdZTD1hquXTK0rVBLADR1g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/search": {
+ "version": "6.5.6",
+ "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.6.tgz",
+ "integrity": "sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/state": {
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz",
+ "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@codemirror/theme-one-dark": {
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz",
+ "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/highlight": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/view": {
+ "version": "6.34.0",
+ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.34.0.tgz",
+ "integrity": "sha512-2vKJ79tOcVfgPYVJM2XjcL1BH5Bsl7/tgn9ilBj3XWeCS5kTRy/NE4FHEj4aMylOl/D3IPNsmZH0WPlB+DyIdA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.4.0",
+ "style-mod": "^4.1.0",
+ "w3c-keyname": "^2.2.4"
+ }
+ },
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"dev": true,
@@ -1703,6 +1825,45 @@
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
+ "node_modules/@lezer/common": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.1.tgz",
+ "integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@lezer/highlight": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz",
+ "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/lr": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz",
+ "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/yaml": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@lezer/yaml/-/yaml-1.0.3.tgz",
+ "integrity": "sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.4.0"
+ }
+ },
"node_modules/@mermaid-js/mermaid-mindmap": {
"version": "9.3.0",
"dev": true,
@@ -3150,6 +3311,22 @@
"node": ">= 0.12.0"
}
},
+ "node_modules/codemirror": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz",
+ "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/commands": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/lint": "^6.0.0",
+ "@codemirror/search": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0"
+ }
+ },
"node_modules/collect-v8-coverage": {
"version": "1.0.2",
"dev": true,
@@ -3245,6 +3422,13 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/crelt": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
+ "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/cross-spawn": {
"version": "7.0.3",
"dev": true,
@@ -7165,6 +7349,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/style-mod": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz",
+ "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/stylis": {
"version": "4.3.2",
"dev": true,
@@ -7796,6 +7987,30 @@
}
}
},
+ "node_modules/vue-codemirror": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/vue-codemirror/-/vue-codemirror-6.1.1.tgz",
+ "integrity": "sha512-rTAYo44owd282yVxKtJtnOi7ERAcXTeviwoPXjIc6K/IQYUsoDkzPvw/JDFtSP6T7Cz/2g3EHaEyeyaQCKoDMg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/commands": "6.x",
+ "@codemirror/language": "6.x",
+ "@codemirror/state": "6.x",
+ "@codemirror/view": "6.x"
+ },
+ "peerDependencies": {
+ "codemirror": "6.x",
+ "vue": "3.x"
+ }
+ },
+ "node_modules/w3c-keyname": {
+ "version": "2.2.8",
+ "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
+ "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/walker": {
"version": "1.0.8",
"dev": true,
diff --git a/package.json b/package.json
index b0412cd3..508e2601 100644
--- a/package.json
+++ b/package.json
@@ -14,9 +14,12 @@
"author": "",
"license": "ISC",
"devDependencies": {
+ "@codemirror/lang-yaml": "^6.1.1",
+ "@codemirror/theme-one-dark": "^6.1.2",
"@types/jest": "^29.5.12",
"@types/js-yaml": "^4.0.9",
"autoprefixer": "^10.4.20",
+ "codemirror": "^6.0.1",
"element-plus": "^2.8.0",
"idb": "^8.0.0",
"jest": "^29.7.0",
@@ -28,6 +31,7 @@
"ts-node": "^10.9.2",
"vitepress": "^1.3.1",
"vitepress-plugin-mermaid": "^2.0.16",
+ "vue-codemirror": "^6.1.1",
"zod": "^3.23.8"
},
"dependencies": {