From de679522ea2269854ec8ac8de925fcf930ce96e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20Ledoux?= Date: Wed, 29 Nov 2023 16:58:20 +0100 Subject: [PATCH] 346-docmenu-use-the-docusaurus-sidebar-structure (#347) * update deps * fix shiki update * replace text by label * add changeset --- .changeset/docmenu-struct.md | 7 + components/DocMenu/ReadMe.md | 8 +- components/DocMenu/assertions.ts | 36 +- components/DocMenu/constants/src/index.ts | 2 +- components/DocMenu/react/ReadMe.md | 24 +- components/DocMenu/react/_DocGroup.tsx | 2 +- components/DocMenu/react/_DocLink.tsx | 2 +- components/DocMenu/vue/ReadMe.md | 24 +- components/DocMenu/vue/_DocGroup.vue | 12 +- components/DocMenu/vue/_DocLink.vue | 4 +- components/Icon/react/package.json | 2 +- components/Icon/vue/package.json | 2 +- css/package.json | 4 +- docs/.vitepress/theme/components/Layout.vue | 12 +- docs/.vitepress/theme/components/SideBar.vue | 12 +- docs/.vitepress/theme/utils/docsPages.ts | 28 +- docs/.vitepress/theme/utils/outline.ts | 8 +- docs/.vitepress/theme/utils/patternPages.ts | 26 +- icon-registry/package.json | 6 +- package.json | 49 +- packages/eslint-plugin/package.json | 4 +- .../rollup-plugin-tailwind-keep/package.json | 2 +- test/react-app/package.json | 6 +- test/vue-app/package.json | 6 +- yarn.lock | 1602 +++++++++++------ 25 files changed, 1233 insertions(+), 657 deletions(-) create mode 100644 .changeset/docmenu-struct.md diff --git a/.changeset/docmenu-struct.md b/.changeset/docmenu-struct.md new file mode 100644 index 000000000..8b519a30e --- /dev/null +++ b/.changeset/docmenu-struct.md @@ -0,0 +1,7 @@ +--- +"@cypress-design/react-docmenu": patch +"@cypress-design/vue-docmenu": patch +"@cypress-design/constants-docmenu": patch +--- + +fix: docmenu docusaurus style items structure diff --git a/components/DocMenu/ReadMe.md b/components/DocMenu/ReadMe.md index f0a3fcf63..23d3521f1 100644 --- a/components/DocMenu/ReadMe.md +++ b/components/DocMenu/ReadMe.md @@ -7,19 +7,19 @@ import DocMenu from '@cypress-design/vue-docmenu' (), { depth: 0, - } + }, ) const open = ref(props.depth === 0) @@ -24,7 +24,7 @@ const height = computed(() => { return $groups.value && open.value ? $groups.value.reduce( (acc, { height: h }) => acc + h, - props.group.items.length + props.group.items.length, ) : 0 }) @@ -37,12 +37,12 @@ defineExpose<{ const activeMarkerTop = computed(() => { const activeIndex = props.group.items.findIndex( - (item) => 'href' in item && item.active + (item) => 'href' in item && item.active, ) // how many groups are before the active element? let numberOfGroups = props.group.items.filter( - (item, index) => !('href' in item) && index < activeIndex + (item, index) => !('href' in item) && index < activeIndex, ).length // if there is any open group before the active element @@ -56,7 +56,7 @@ const activeMarkerTop = computed(() => { }) const Head = computed(() => - props.collapsible ? 'button' : props.group.href ? 'a' : 'div' + props.collapsible ? 'button' : props.group.href ? 'a' : 'div', ) @@ -91,7 +91,7 @@ const Head = computed(() => 'ml-[16px]': depth, }" /> - {{ group.text }} + {{ group.label }}
- {{ item.text }} + {{ item.label }} diff --git a/components/Icon/react/package.json b/components/Icon/react/package.json index ce2874538..1ca68119f 100644 --- a/components/Icon/react/package.json +++ b/components/Icon/react/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@cypress-design/rollup-plugin-tailwind-keep": "*", - "@types/lodash": "^4.14.200", + "@types/lodash": "^4.14.202", "lodash": "^4.17.21", "dedent": "^1.5.1" }, diff --git a/components/Icon/vue/package.json b/components/Icon/vue/package.json index 5fd9ef1f1..89c857058 100644 --- a/components/Icon/vue/package.json +++ b/components/Icon/vue/package.json @@ -25,7 +25,7 @@ }, "devDependencies": { "@cypress-design/rollup-plugin-tailwind-keep": "*", - "@types/lodash": "^4.14.200", + "@types/lodash": "^4.14.202", "lodash": "^4.17.21", "dedent": "^1.5.1" }, diff --git a/css/package.json b/css/package.json index 01a5a3d4a..70a3b811a 100644 --- a/css/package.json +++ b/css/package.json @@ -40,8 +40,8 @@ "tailwindcss": "^3.3.5" }, "devDependencies": { - "@types/lodash": "^4.14.200", - "typescript": "5.2.2", + "@types/lodash": "^4.14.202", + "typescript": "5.3.2", "color-string": "1.9.1" }, "license": "MIT" diff --git a/docs/.vitepress/theme/components/Layout.vue b/docs/.vitepress/theme/components/Layout.vue index a869a679e..e402bf629 100644 --- a/docs/.vitepress/theme/components/Layout.vue +++ b/docs/.vitepress/theme/components/Layout.vue @@ -41,8 +41,8 @@ const framework = computed(() => routePath.value.includes('/react/') ? ('react' as const) : routePath.value.includes('/vue/') - ? ('vue' as const) - : cookieFramework.value, + ? ('vue' as const) + : cookieFramework.value, ) watch( @@ -216,3 +216,11 @@ const { frontmatter } = useData() as any