From a1ff4fd79f4a9f05d3c577dc37baad77123b8f4d Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Wed, 1 Nov 2023 02:10:38 +0530 Subject: [PATCH] Emoji Legend --- .vitepress/theme/components/InputField.vue | 47 +++++++++++++++++++++ .vitepress/theme/components/PaneFields.vue | 34 +++++++++++++++ .vitepress/theme/components/SidebarPane.vue | 45 ++++++++++++++++++++ .vitepress/theme/index.ts | 11 +++-- .vitepress/theme/layouts/Sidebar.vue | 9 ++++ .vitepress/vue-shim.d.ts | 4 ++ package.json | 1 + pnpm-lock.yaml | 12 ++++++ tsconfig.json | 2 +- 9 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 .vitepress/theme/components/InputField.vue create mode 100644 .vitepress/theme/components/PaneFields.vue create mode 100644 .vitepress/theme/components/SidebarPane.vue create mode 100644 .vitepress/theme/layouts/Sidebar.vue create mode 100644 .vitepress/vue-shim.d.ts diff --git a/.vitepress/theme/components/InputField.vue b/.vitepress/theme/components/InputField.vue new file mode 100644 index 000000000..8b43e764b --- /dev/null +++ b/.vitepress/theme/components/InputField.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/.vitepress/theme/components/PaneFields.vue b/.vitepress/theme/components/PaneFields.vue new file mode 100644 index 000000000..247476d64 --- /dev/null +++ b/.vitepress/theme/components/PaneFields.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/.vitepress/theme/components/SidebarPane.vue b/.vitepress/theme/components/SidebarPane.vue new file mode 100644 index 000000000..6d1b1c4cf --- /dev/null +++ b/.vitepress/theme/components/SidebarPane.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 36023453d..bb54e3d1a 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -1,18 +1,17 @@ import { h } from "vue"; -import {type Theme, inBrowser } from "vitepress"; +import { type Theme, inBrowser } from "vitepress"; import DefaultTheme from "vitepress/theme"; +import Sidebar from "./layouts/Sidebar.vue"; import "./style.css"; import "uno.css"; -if (inBrowser) - import('./pwa') - +if (inBrowser) import("./pwa"); export default { Layout: () => { return h(DefaultTheme.Layout, null, { + "sidebar-nav-after": () => h(Sidebar), }); }, - enhanceApp({ app, router, siteData }) { - }, + enhanceApp({ app, router, siteData }) { }, } satisfies Theme; diff --git a/.vitepress/theme/layouts/Sidebar.vue b/.vitepress/theme/layouts/Sidebar.vue new file mode 100644 index 000000000..48151bdd6 --- /dev/null +++ b/.vitepress/theme/layouts/Sidebar.vue @@ -0,0 +1,9 @@ + + + diff --git a/.vitepress/vue-shim.d.ts b/.vitepress/vue-shim.d.ts new file mode 100644 index 000000000..8f6f41026 --- /dev/null +++ b/.vitepress/vue-shim.d.ts @@ -0,0 +1,4 @@ +declare module '*.vue' { + import Vue from 'vue'; + export default Vue; +} diff --git a/package.json b/package.json index e891d4d25..a49a10d11 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "format": "prettier -w ." }, "dependencies": { + "@headlessui/vue": "^1.7.16", "fast-glob": "^3.3.1", "pathe": "^1.1.1", "unocss": "^0.57.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d851ebab8..42f4e9424 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@headlessui/vue': + specifier: ^1.7.16 + version: 1.7.16(vue@3.3.7) fast-glob: specifier: ^3.3.1 version: 3.3.1 @@ -1576,6 +1579,15 @@ packages: requiresBuild: true optional: true + /@headlessui/vue@1.7.16(vue@3.3.7): + resolution: {integrity: sha512-nKT+nf/q6x198SsyK54mSszaQl/z+QxtASmgMEJtpxSX2Q0OPJX0upS/9daDyiECpeAsvjkoOrm2O/6PyBQ+Qg==} + engines: {node: '>=10'} + peerDependencies: + vue: ^3.2.0 + dependencies: + vue: 3.3.7 + dev: false + /@iconify-json/carbon@1.1.21: resolution: {integrity: sha512-bK2cMVM4noBU+FGlay433flpXLRzQu0ED095iAnoO6ka3yb4uz0lvb8acpN5gthyGLJ89C4HpfIbQZLQnMKQww==} dependencies: diff --git a/tsconfig.json b/tsconfig.json index ab1caa42b..ba13c3c63 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ "forceConsistentCasingInFileNames": true, "types": ["vite/client", "vite-plugin-pwa/vanillajs", "vitepress"] }, - "include": ["./*.ts", "./.vitepress/**/*.ts"], + "include": ["./*.ts", "./.vitepress/**/*.ts", "./.vitepress/vue-shim.d.ts"], "exclude": ["dist", "node_modules"] }