@vuepress/theme-default 2.0.0-rc.124 → 2.0.0-rc.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{lib → dist}/client/components/VPFadeSlideYTransition.vue +1 -0
- package/{lib → dist}/client/components/VPHome.vue +2 -1
- package/{lib → dist}/client/components/VPHomeFeatures.vue +3 -1
- package/{lib → dist}/client/components/VPHomeFooter.vue +1 -0
- package/{lib → dist}/client/components/VPHomeHero.vue +5 -3
- package/{lib → dist}/client/components/VPNavbar.vue +6 -5
- package/{lib → dist}/client/components/VPNavbarBrand.vue +3 -2
- package/{lib → dist}/client/components/VPNavbarDropdown.vue +3 -1
- package/{lib → dist}/client/components/VPNavbarItems.vue +4 -3
- package/{lib → dist}/client/components/VPPage.vue +3 -2
- package/{lib → dist}/client/components/VPPageMeta.vue +4 -3
- package/{lib → dist}/client/components/VPPageNav.vue +4 -3
- package/{lib → dist}/client/components/VPSidebar.vue +2 -1
- package/{lib → dist}/client/components/VPSidebarItem.vue +5 -3
- package/{lib → dist}/client/components/VPSidebarItems.vue +3 -2
- package/dist/client/composables/index.d.ts +12 -0
- package/dist/client/composables/useDarkMode.d.ts +2 -0
- package/dist/client/composables/useDarkMode.js +2 -0
- package/dist/client/composables/useDarkMode.js.map +1 -0
- package/dist/client/composables/useData.d.ts +2 -0
- package/dist/client/composables/useData.js.map +1 -0
- package/dist/client/composables/useEditLink.d.ts +2 -0
- package/{lib → dist}/client/composables/useEditLink.js +1 -1
- package/dist/client/composables/useEditLink.js.map +1 -0
- package/dist/client/composables/useHeaders.js +2 -0
- package/dist/client/composables/useHeaders.js.map +1 -0
- package/dist/client/composables/useNavbarConfig.d.ts +2 -0
- package/{lib → dist}/client/composables/useNavbarConfig.js +1 -1
- package/dist/client/composables/useNavbarConfig.js.map +1 -0
- package/dist/client/composables/useNavbarRepo.d.ts +2 -0
- package/dist/client/composables/useNavbarRepo.js +2 -0
- package/dist/client/composables/useNavbarRepo.js.map +1 -0
- package/dist/client/composables/useNavbarSelectLanguage.d.ts +2 -0
- package/{lib → dist}/client/composables/useNavbarSelectLanguage.js +1 -1
- package/dist/client/composables/useNavbarSelectLanguage.js.map +1 -0
- package/dist/client/composables/useNavigate.d.ts +2 -0
- package/dist/client/composables/useRelatedLinks.d.ts +2 -0
- package/dist/client/composables/useRelatedLinks.js +2 -0
- package/dist/client/composables/useRelatedLinks.js.map +1 -0
- package/dist/client/composables/useScrollPromise.d.ts +2 -0
- package/dist/client/composables/useSidebarItems.d.ts +2 -0
- package/dist/client/composables/useSidebarItems.js +2 -0
- package/dist/client/composables/useSidebarItems.js.map +1 -0
- package/dist/client/composables/useUpdateDeviceStatus.d.ts +2 -0
- package/dist/client/composables/useUpdateDeviceStatus.js.map +1 -0
- package/{lib → dist}/client/config.d.ts +0 -4
- package/dist/client/config.js +2 -0
- package/dist/client/config.js.map +1 -0
- package/{lib → dist}/client/index.d.ts +19 -19
- package/dist/client/index.js +1 -0
- package/{lib → dist}/client/layouts/Layout.vue +7 -6
- package/{lib → dist}/client/layouts/NotFound.vue +2 -1
- package/{lib → dist}/client/styles/arrow.scss +3 -3
- package/{lib → dist}/client/styles/vars.scss +2 -2
- package/dist/client/utils/index.d.ts +6 -0
- package/dist/client/utils/isActiveSidebarItem.d.ts +2 -0
- package/dist/client/utils/isActiveSidebarItem.js.map +1 -0
- package/dist/client/utils/resolveAutoLink.d.ts +2 -0
- package/dist/client/utils/resolveAutoLink.js.map +1 -0
- package/dist/client/utils/resolveEditLink.d.ts +2 -0
- package/dist/client/utils/resolveEditLink.js.map +1 -0
- package/dist/client/utils/resolvePrefix.d.ts +2 -0
- package/dist/client/utils/resolveRepoType.d.ts +2 -0
- package/{lib/client/utils/isActiveSidebarItem.d.ts → dist/isActiveSidebarItem-aythFTeC.d.ts} +3 -3
- package/{lib → dist}/node/index.d.ts +4 -2
- package/dist/node/index.js.map +1 -0
- package/{lib/page-F2gyvsdE.d.ts → dist/page-FWcDnzJp.d.ts} +2 -2
- package/{lib/client/utils/resolveAutoLink.d.ts → dist/resolveAutoLink-BR2Z05MD.d.ts} +3 -3
- package/{lib/client/utils/resolveEditLink.d.ts → dist/resolveEditLink-DazcWeGf.d.ts} +2 -2
- package/{lib/client/utils/resolvePrefix.d.ts → dist/resolvePrefix-BN9K9RA5.d.ts} +2 -2
- package/{lib/client/utils/resolveRepoType.d.ts → dist/resolveRepoType-Wcj35_rs.d.ts} +2 -2
- package/{lib/sidebar-FqrQ3PGy.d.ts → dist/sidebar-CF1YPYLN.d.ts} +1 -1
- package/{lib/typings-jKn48KwS.d.ts → dist/typings-NbQSzbOn.d.ts} +2 -2
- package/{lib/client/composables/useDarkMode.d.ts → dist/useDarkMode-DLor2cV7.d.ts} +2 -2
- package/{lib/client/composables/useData.d.ts → dist/useData-JDen_Bxm.d.ts} +4 -4
- package/{lib/client/composables/useEditLink.d.ts → dist/useEditLink-DPCTvXmM.d.ts} +2 -2
- package/{lib/client/composables/useNavbarConfig.d.ts → dist/useNavbarConfig-C19TGFg7.d.ts} +3 -3
- package/{lib/client/composables/useNavbarRepo.d.ts → dist/useNavbarRepo-DxhSIAFq.d.ts} +3 -3
- package/{lib/client/composables/useNavbarSelectLanguage.d.ts → dist/useNavbarSelectLanguage-4GkrPvc2.d.ts} +3 -3
- package/{lib/client/composables/useNavigate.d.ts → dist/useNavigate-lH4xyHOV.d.ts} +2 -2
- package/{lib/client/composables/useRelatedLinks.d.ts → dist/useRelatedLinks-ChTW2RRU.d.ts} +3 -3
- package/{lib/client/composables/useScrollPromise.d.ts → dist/useScrollPromise-BAl732Uv.d.ts} +2 -2
- package/{lib/client/composables/useSidebarItems.d.ts → dist/useSidebarItems-CdpB96Ta.d.ts} +4 -4
- package/{lib/client/composables/useUpdateDeviceStatus.d.ts → dist/useUpdateDeviceStatus-SBnOZx8J.d.ts} +2 -2
- package/package.json +36 -36
- package/lib/client/composables/index.d.ts +0 -12
- package/lib/client/composables/useDarkMode.js +0 -2
- package/lib/client/composables/useDarkMode.js.map +0 -1
- package/lib/client/composables/useData.js.map +0 -1
- package/lib/client/composables/useEditLink.js.map +0 -1
- package/lib/client/composables/useHeaders.js +0 -2
- package/lib/client/composables/useHeaders.js.map +0 -1
- package/lib/client/composables/useNavbarConfig.js.map +0 -1
- package/lib/client/composables/useNavbarRepo.js +0 -2
- package/lib/client/composables/useNavbarRepo.js.map +0 -1
- package/lib/client/composables/useNavbarSelectLanguage.js.map +0 -1
- package/lib/client/composables/useRelatedLinks.js +0 -2
- package/lib/client/composables/useRelatedLinks.js.map +0 -1
- package/lib/client/composables/useSidebarItems.js +0 -2
- package/lib/client/composables/useSidebarItems.js.map +0 -1
- package/lib/client/composables/useUpdateDeviceStatus.js.map +0 -1
- package/lib/client/config.js +0 -2
- package/lib/client/config.js.map +0 -1
- package/lib/client/index.js +0 -1
- package/lib/client/shim.d.ts +0 -11
- package/lib/client/utils/index.d.ts +0 -6
- package/lib/client/utils/isActiveSidebarItem.js.map +0 -1
- package/lib/client/utils/resolveAutoLink.js.map +0 -1
- package/lib/client/utils/resolveEditLink.js.map +0 -1
- package/lib/node/index.js.map +0 -1
- package/{lib → dist}/client/components/VPAutoLink.vue +0 -0
- package/{lib → dist}/client/components/VPDarkIcon.vue +0 -0
- package/{lib → dist}/client/components/VPDropdownTransition.vue +0 -0
- package/{lib → dist}/client/components/VPEditIcon.vue +0 -0
- package/{lib → dist}/client/components/VPLightIcon.vue +0 -0
- package/{lib → dist}/client/components/VPToggleColorModeButton.vue +2 -2
- /package/{lib → dist}/client/components/VPToggleSidebarButton.vue +0 -0
- /package/{lib → dist}/client/components/global/Badge.vue +0 -0
- /package/{lib → dist}/client/composables/index.js +0 -0
- /package/{lib → dist}/client/composables/useData.js +0 -0
- /package/{lib → dist}/client/composables/useHeaders.d.ts +0 -0
- /package/{lib → dist}/client/composables/useNavigate.js +0 -0
- /package/{lib → dist}/client/composables/useNavigate.js.map +0 -0
- /package/{lib → dist}/client/composables/useScrollPromise.js +0 -0
- /package/{lib → dist}/client/composables/useScrollPromise.js.map +0 -0
- /package/{lib → dist}/client/composables/useUpdateDeviceStatus.js +0 -0
- /package/{lib → dist}/client/styles/_mixins.scss +0 -0
- /package/{lib → dist}/client/styles/_variables.module.scss +0 -0
- /package/{lib → dist}/client/styles/_variables.scss +0 -0
- /package/{lib → dist}/client/styles/code-group.scss +0 -0
- /package/{lib → dist}/client/styles/content/code.scss +0 -0
- /package/{lib → dist}/client/styles/content/index.scss +0 -0
- /package/{lib → dist}/client/styles/content/normalize.scss +0 -0
- /package/{lib → dist}/client/styles/content/toc.scss +0 -0
- /package/{lib → dist}/client/styles/external-link-icon.scss +0 -0
- /package/{lib → dist}/client/styles/index.scss +0 -0
- /package/{lib → dist}/client/styles/layout.scss +0 -0
- /package/{lib → dist}/client/styles/normalize.scss +0 -0
- /package/{lib → dist}/client/styles/plugins.scss +0 -0
- /package/{lib → dist}/client/styles/vars-dark.scss +0 -0
- /package/{lib → dist}/client/utils/index.js +0 -0
- /package/{lib → dist}/client/utils/isActiveSidebarItem.js +0 -0
- /package/{lib → dist}/client/utils/resolveAutoLink.js +0 -0
- /package/{lib → dist}/client/utils/resolveEditLink.js +0 -0
- /package/{lib → dist}/client/utils/resolvePrefix.js +0 -0
- /package/{lib → dist}/client/utils/resolvePrefix.js.map +0 -0
- /package/{lib → dist}/client/utils/resolveRepoType.js +0 -0
- /package/{lib → dist}/client/utils/resolveRepoType.js.map +0 -0
- /package/{lib → dist}/nav-DikslSJ_.d.ts +0 -0
- /package/{lib → dist}/node/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateDeviceStatus.js","names":[],"sources":["../../../src/client/composables/useUpdateDeviceStatus.ts"],"sourcesContent":["// oxlint-disable promise/prefer-await-to-callbacks\nimport { useEventListener } from '@vueuse/core'\nimport { onMounted } from 'vue'\nimport cssVariables from '../styles/_variables.module.scss'\n\nexport enum DeviceType {\n Mobile = 'mobile',\n}\n\nconst DeviceTypeMap = {\n [DeviceType.Mobile]: Number.parseInt(\n cssVariables.mobile.replace('px', ''),\n 10,\n ),\n}\n\n/**\n * add listener to detect screen though device type\n *\n * @param deviceType - Device type to detect / 要检测的设备类型\n * @param callback - Callback function to call when device status changes / 设备状态改变时调用的回调函数\n */\nexport const useUpdateDeviceStatus = (\n deviceType: DeviceType,\n callback: (width: number) => void,\n): void => {\n const width = DeviceTypeMap[deviceType]\n if (!Number.isInteger(width)) {\n if (__VUEPRESS_DEV__) throw new Error('device width must be a integer')\n return\n }\n\n useEventListener('orientationchange', () => {\n callback(width)\n })\n useEventListener('resize', () => {\n callback(width)\n })\n\n onMounted(() => {\n callback(width)\n })\n}\n"],"mappings":"gIAKA,IAAY,EAAA,SAAA,EAAL,OACL,GAAA,OAAA,gBAGF,MAAM,EAAgB,EACnB,EAAW,QAAS,OAAO,SAC1B,EAAa,OAAO,QAAQ,KAAM,GAAG,CACrC,GACD,CACF,CAQY,GACX,EACA,IACS,CACT,IAAM,EAAQ,EAAc,GAC5B,GAAI,CAAC,OAAO,UAAU,EAAM,CAAE,CAC5B,GAAI,iBAAkB,MAAU,MAAM,iCAAiC,CACvE,OAGF,EAAiB,wBAA2B,CAC1C,EAAS,EAAM,EACf,CACF,EAAiB,aAAgB,CAC/B,EAAS,EAAM,EACf,CAEF,MAAgB,CACd,EAAS,EAAM,EACf"}
|
package/lib/client/config.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{setupDarkMode as e}from"@theme/useDarkMode";import{setupHeaders as t}from"@theme/useHeaders";import{useScrollPromise as n}from"@theme/useScrollPromise";import{setupSidebarItems as r}from"@theme/useSidebarItems";import{hasGlobalComponent as i}from"@vuepress/helper/client";import{defineClientConfig as a}from"vuepress/client";import o from"./components/global/Badge.vue";import s from"./layouts/Layout.vue";import c from"./layouts/NotFound.vue";import"@vuepress/helper/colors.css";import"@vuepress/helper/normalize.css";import"./styles/index.scss";var l=a({enhance({app:e,router:t}){i(`Badge`)||e.component(`Badge`,o);let r=t.options.scrollBehavior;t.options.scrollBehavior=async(...e)=>(await n().wait(),r(...e))},setup(){e(),t(),r()},layouts:{Layout:s,NotFound:c}});export{l as default};
|
|
2
|
-
//# sourceMappingURL=config.js.map
|
package/lib/client/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../../src/client/config.ts"],"sourcesContent":["import { setupDarkMode } from '@theme/useDarkMode'\nimport { setupHeaders } from '@theme/useHeaders'\nimport { useScrollPromise } from '@theme/useScrollPromise'\nimport { setupSidebarItems } from '@theme/useSidebarItems'\nimport { hasGlobalComponent } from '@vuepress/helper/client'\nimport { defineClientConfig } from 'vuepress/client'\nimport { Badge } from './components/global/index.js'\nimport Layout from './layouts/Layout.vue'\nimport NotFound from './layouts/NotFound.vue'\n\nimport '@vuepress/helper/colors.css'\nimport '@vuepress/helper/normalize.css'\nimport './styles/index.scss'\n\nexport default defineClientConfig({\n enhance({ app, router }) {\n if (!hasGlobalComponent('Badge')) app.component('Badge', Badge)\n\n // handle scrollBehavior with transition\n const scrollBehavior = router.options.scrollBehavior!\n\n // scrollBehavior is a bit hard to typed here\n // oxlint-disable-next-line typescript/explicit-function-return-type\n router.options.scrollBehavior = async (...args) => {\n await useScrollPromise().wait()\n return scrollBehavior(...args)\n }\n },\n\n setup() {\n setupDarkMode()\n setupHeaders()\n setupSidebarItems()\n },\n\n layouts: {\n Layout,\n NotFound,\n },\n})\n"],"mappings":"0iBAcA,IAAA,EAAe,EAAmB,CAChC,QAAQ,CAAE,MAAK,UAAU,CAClB,EAAmB,QAAQ,EAAE,EAAI,UAAU,QAAS,EAAM,CAG/D,IAAM,EAAiB,EAAO,QAAQ,eAItC,EAAO,QAAQ,eAAiB,MAAO,GAAG,KACxC,MAAM,GAAkB,CAAC,MAAM,CACxB,EAAe,GAAG,EAAK,GAIlC,OAAQ,CACN,GAAe,CACf,GAAc,CACd,GAAmB,EAGrB,QAAS,CACP,SACA,WACD,CACF,CAAC"}
|
package/lib/client/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setupDarkMode as e,useDarkMode as t}from"./composables/useDarkMode.js";import{useData as n}from"./composables/useData.js";import{useEditLink as r}from"./composables/useEditLink.js";import{useNavigate as i}from"./composables/useNavigate.js";import{useNavbarConfig as a}from"./composables/useNavbarConfig.js";import{useNavbarRepo as o}from"./composables/useNavbarRepo.js";import{useNavbarSelectLanguage as s}from"./composables/useNavbarSelectLanguage.js";import{useRelatedLinks as c}from"./composables/useRelatedLinks.js";import{useScrollPromise as l}from"./composables/useScrollPromise.js";import{resolveArraySidebarItems as u,resolveMultiSidebarItems as d,resolveSidebarHeadingItem as f,resolveSidebarItems as p,resolveSidebarPageHeader as m,resolveSidebarPageHeaders as h,setupSidebarItems as g,sidebarItemsSymbol as _,useSidebarItems as v}from"./composables/useSidebarItems.js";import{DeviceType as y,useUpdateDeviceStatus as b}from"./composables/useUpdateDeviceStatus.js";import{isActiveSidebarItem as x}from"./utils/isActiveSidebarItem.js";import{resolveAutoLink as S}from"./utils/resolveAutoLink.js";import{EDIT_LINK_PATTERNS as C,resolveEditLink as w}from"./utils/resolveEditLink.js";import{resolvePrefix as T}from"./utils/resolvePrefix.js";import{resolveRepoType as E}from"./utils/resolveRepoType.js";export{y as DeviceType,C as EDIT_LINK_PATTERNS,x as isActiveSidebarItem,u as resolveArraySidebarItems,S as resolveAutoLink,w as resolveEditLink,d as resolveMultiSidebarItems,T as resolvePrefix,E as resolveRepoType,f as resolveSidebarHeadingItem,p as resolveSidebarItems,m as resolveSidebarPageHeader,h as resolveSidebarPageHeaders,e as setupDarkMode,g as setupSidebarItems,_ as sidebarItemsSymbol,t as useDarkMode,n as useData,r as useEditLink,a as useNavbarConfig,o as useNavbarRepo,s as useNavbarSelectLanguage,i as useNavigate,c as useRelatedLinks,l as useScrollPromise,v as useSidebarItems,b as useUpdateDeviceStatus};
|
package/lib/client/shim.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare module '*.vue' {
|
|
2
|
-
import type { ComponentOptions } from 'vue'
|
|
3
|
-
|
|
4
|
-
const component: ComponentOptions
|
|
5
|
-
export default component
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare module '*/styles/_variables.module.scss' {
|
|
9
|
-
const cSSVariables: Record<string, string>
|
|
10
|
-
export default cSSVariables
|
|
11
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { isActiveSidebarItem } from "./isActiveSidebarItem.js";
|
|
2
|
-
import { resolveAutoLink } from "./resolveAutoLink.js";
|
|
3
|
-
import { EDIT_LINK_PATTERNS, resolveEditLink } from "./resolveEditLink.js";
|
|
4
|
-
import { resolvePrefix } from "./resolvePrefix.js";
|
|
5
|
-
import { RepoType, resolveRepoType } from "./resolveRepoType.js";
|
|
6
|
-
export { EDIT_LINK_PATTERNS, RepoType, isActiveSidebarItem, resolveAutoLink, resolveEditLink, resolvePrefix, resolveRepoType };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isActiveSidebarItem.js","names":[],"sources":["../../../src/client/utils/isActiveSidebarItem.ts"],"sourcesContent":["import type { RouteLocationNormalizedLoaded } from 'vuepress/client'\nimport type { SidebarItem } from '../typings.js'\n\nconst normalizePath = (path: string): string =>\n decodeURI(path)\n .replace(/#.*$/, '')\n .replace(/(index)?\\.(md|html)$/, '')\n\nconst isActiveLink = (\n link: string,\n route: RouteLocationNormalizedLoaded,\n): boolean => {\n if (route.hash === link) return true\n\n const currentPath = normalizePath(route.path)\n const targetPath = normalizePath(link)\n return currentPath === targetPath\n}\n\nexport const isActiveSidebarItem = (\n item: SidebarItem,\n route: RouteLocationNormalizedLoaded,\n): boolean => {\n if (item.link && isActiveLink(item.link, route)) return true\n\n if ('children' in item)\n return item.children.some((child) => isActiveSidebarItem(child, route))\n\n return false\n}\n"],"mappings":"AAGA,MAAM,EAAiB,GACrB,UAAU,EAAK,CACZ,QAAQ,OAAQ,GAAG,CACnB,QAAQ,uBAAwB,GAAG,CAElC,GACJ,EACA,IAEI,EAAM,OAAS,EAAa,GAEZ,EAAc,EAAM,KAAK,GAC1B,EAAc,EAAK,CAI3B,GACX,EACA,IAEI,EAAK,MAAQ,EAAa,EAAK,KAAM,EAAM,CAAS,GAEpD,aAAc,EACT,EAAK,SAAS,KAAM,GAAU,EAAoB,EAAO,EAAM,CAAC,CAElE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveAutoLink.js","names":[],"sources":["../../../src/client/utils/resolveAutoLink.ts"],"sourcesContent":["import { resolveRoute } from 'vuepress/client'\nimport type { AutoLinkOptions } from '../../shared/index.js'\n\n/**\n * Resolve AutoLink props from string\n *\n * 从字符串解析 AutoLink 属性\n *\n * @param config - The string to resolve / 要解析的字符串\n * @param currentPath - The current route path / 当前路由路径\n * @returns Resolved AutoLink options / 解析后的 AutoLink 选项\n *\n * @example\n * - Input: '/README.md'\n * - Output: { text: 'Home', link: '/' }\n */\nexport const resolveAutoLink = (\n config: string,\n currentPath?: string,\n): AutoLinkOptions => {\n const { notFound, meta, path } = resolveRoute<{\n title?: string\n }>(config, currentPath)\n\n return notFound\n ? { text: path, link: path }\n : {\n text: meta.title || path,\n link: path,\n }\n}\n"],"mappings":"+CAgBA,MAAa,GACX,EACA,IACoB,CACpB,GAAM,CAAE,WAAU,OAAM,QAAS,EAE9B,EAAQ,EAAY,CAEvB,OAAO,EACH,CAAE,KAAM,EAAM,KAAM,EAAM,CAC1B,CACE,KAAM,EAAK,OAAS,EACpB,KAAM,EACP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEditLink.js","names":[],"sources":["../../../src/client/utils/resolveEditLink.ts"],"sourcesContent":["import type { RepoType } from '@theme/resolveRepoType'\nimport { resolveRepoType } from '@theme/resolveRepoType'\nimport {\n isLinkHttp,\n removeEndingSlash,\n removeLeadingSlash,\n} from 'vuepress/shared'\n\nexport const EDIT_LINK_PATTERNS: Record<Exclude<RepoType, null>, string> = {\n GitHub: ':repo/edit/:branch/:path',\n GitLab: ':repo/-/edit/:branch/:path',\n Gitee: ':repo/edit/:branch/:path',\n Bitbucket:\n ':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',\n}\n\nconst resolveEditLinkPatterns = ({\n docsRepo,\n editLinkPattern,\n}: {\n docsRepo: string\n editLinkPattern?: string\n}): string | null => {\n if (editLinkPattern) return editLinkPattern\n\n const repoType = resolveRepoType(docsRepo)\n if (repoType != null) return EDIT_LINK_PATTERNS[repoType]\n\n return null\n}\n\nexport const resolveEditLink = ({\n docsRepo,\n docsBranch,\n docsDir,\n filePathRelative,\n editLinkPattern,\n}: {\n docsRepo: string\n docsBranch: string\n docsDir: string\n filePathRelative: string | null\n editLinkPattern?: string\n}): string | null => {\n if (!filePathRelative) return null\n\n const pattern = resolveEditLinkPatterns({ docsRepo, editLinkPattern })\n if (!pattern) return null\n\n return pattern\n .replace(\n /:repo/,\n isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`,\n )\n .replace(/:branch/, docsBranch)\n .replace(\n /:path/,\n removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`),\n )\n}\n"],"mappings":"qJAQA,MAAa,EAA8D,CACzE,OAAQ,2BACR,OAAQ,6BACR,MAAO,2BACP,UACE,kFACH,CAEK,GAA2B,CAC/B,WACA,qBAImB,CACnB,GAAI,EAAiB,OAAO,EAE5B,IAAM,EAAW,EAAgB,EAAS,CAG1C,OAFI,GAAY,KAET,KAFsB,EAAmB,IAKrC,GAAmB,CAC9B,WACA,aACA,UACA,mBACA,qBAOmB,CACnB,GAAI,CAAC,EAAkB,OAAO,KAE9B,IAAM,EAAU,EAAwB,CAAE,WAAU,kBAAiB,CAAC,CAGtE,OAFK,EAEE,EACJ,QACC,QACA,EAAW,EAAS,CAAG,EAAW,sBAAsB,IACzD,CACA,QAAQ,UAAW,EAAW,CAC9B,QACC,QACA,EAAmB,GAAG,EAAkB,EAAQ,CAAC,GAAG,IAAmB,CACxE,CAXkB"}
|
package/lib/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/node/utils/assignDefaultLocaleOptions.ts","../../src/node/utils/resolveMarkdownHintLocales.ts","../../src/node/defaultTheme.ts"],"sourcesContent":["import type {\n DefaultThemeLocaleData,\n DefaultThemeLocaleOptions,\n} from '../../shared/index.js'\n\nexport const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions = {\n // color mode\n colorMode: 'auto',\n colorModeSwitch: true,\n\n // navbar\n navbar: [],\n logo: null,\n repo: null,\n selectLanguageText: 'Languages',\n selectLanguageAriaLabel: 'Select language',\n\n // sidebar\n sidebar: 'heading',\n sidebarDepth: 2,\n\n // page meta\n editLink: true,\n editLinkText: 'Edit this page',\n lastUpdated: true,\n contributors: true,\n contributorsText: 'Contributors',\n\n // 404 page messages\n notFound: [\n `There's nothing here.`,\n `How did we get here?`,\n `That's a Four-Oh-Four.`,\n `Looks like we've got some broken links.`,\n ],\n backToHome: 'Take me home',\n\n // a11y\n openInNewWindow: 'open in new window',\n toggleColorMode: 'toggle color mode',\n toggleSidebar: 'toggle sidebar',\n}\n\nexport const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData = {\n // navbar\n selectLanguageName: 'English',\n}\n\n/**\n * Assign default options\n */\nexport const assignDefaultLocaleOptions = (\n localeOptions: DefaultThemeLocaleOptions,\n): void => {\n localeOptions.locales ??= {}\n Object.assign(localeOptions, {\n ...DEFAULT_LOCALE_OPTIONS,\n ...localeOptions,\n })\n localeOptions.locales['/'] ??= {}\n Object.assign(localeOptions.locales['/'], {\n ...DEFAULT_LOCALE_DATA,\n ...localeOptions.locales['/'],\n })\n}\n","import type { MarkdownHintPluginLocaleData } from '@vuepress/plugin-markdown-hint'\nimport type { LocaleConfig } from 'vuepress/shared'\nimport type { DefaultThemeData } from '../../shared/index.js'\n\n/**\n * Resolve options for `@vuepress/plugin-markdown-container`\n *\n * For custom containers default title\n *\n * @param localeOptions - Locales config from theme options\n * @returns Locales config for `@vuepress/plugin-markdown-container`\n */\nexport const resolveMarkdownHintLocales = (\n localeOptions: DefaultThemeData,\n): LocaleConfig<MarkdownHintPluginLocaleData> =>\n Object.entries(localeOptions.locales ?? {}).reduce<\n LocaleConfig<MarkdownHintPluginLocaleData>\n >((result, [key, value]) => {\n result[key] = {}\n\n if (value.tip) result[key].tip = value.tip\n if (value.warning) result[key].warning = value.warning\n if (value.danger) result[key].caution = value.danger\n if (value.important) result[key].important = value.important\n if (value.note) result[key].note = value.note\n\n return result\n }, {})\n","import { addViteOptimizeDepsExclude } from '@vuepress/helper'\nimport { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'\nimport { backToTopPlugin } from '@vuepress/plugin-back-to-top'\nimport { copyCodePlugin } from '@vuepress/plugin-copy-code'\nimport { gitPlugin } from '@vuepress/plugin-git'\nimport { linksCheckPlugin } from '@vuepress/plugin-links-check'\nimport { markdownHintPlugin } from '@vuepress/plugin-markdown-hint'\nimport { markdownTabPlugin } from '@vuepress/plugin-markdown-tab'\nimport { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom'\nimport { nprogressPlugin } from '@vuepress/plugin-nprogress'\nimport { palettePlugin } from '@vuepress/plugin-palette'\nimport { prismjsPlugin } from '@vuepress/plugin-prismjs'\nimport { seoPlugin } from '@vuepress/plugin-seo'\nimport { sitemapPlugin } from '@vuepress/plugin-sitemap'\nimport { themeDataPlugin } from '@vuepress/plugin-theme-data'\nimport type { Page, Theme } from 'vuepress/core'\nimport { isPlainObject } from 'vuepress/shared'\nimport { fs, getDirname, path } from 'vuepress/utils'\nimport type {\n DefaultThemeLocaleOptions,\n DefaultThemePageData,\n} from '../shared/index.js'\nimport type { DefaultThemePluginsOptions } from './typings.js'\nimport {\n assignDefaultLocaleOptions,\n resolveMarkdownHintLocales,\n} from './utils/index.js'\n\nconst __dirname = import.meta.dirname || getDirname(import.meta.url)\n\nexport interface DefaultThemeOptions extends DefaultThemeLocaleOptions {\n /**\n * deployed hostname\n */\n hostname?: string\n\n /**\n * To avoid confusion with the root `plugins` option,\n * we use `themePlugins`\n */\n themePlugins?: DefaultThemePluginsOptions\n}\n\nexport const defaultTheme = ({\n hostname,\n themePlugins = {},\n ...localeOptions\n}: DefaultThemeOptions = {}): Theme => {\n assignDefaultLocaleOptions(localeOptions)\n\n return {\n name: '@vuepress/theme-default',\n\n templateBuild: path.resolve(__dirname, '../../templates/build.html'),\n\n alias: {\n // use alias to make all components replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/components'))\n .filter((file) => file.endsWith('.vue'))\n .map((file) => [\n `@theme/${file}`,\n path.resolve(__dirname, '../client/components', file),\n ]),\n ),\n // use alias to make all composables replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/composables'))\n .filter((file) => file.endsWith('.js'))\n .map((file) => [\n `@theme/${file.slice(0, -3)}`,\n path.resolve(__dirname, '../client/composables', file),\n ]),\n ),\n // use alias to make all utils replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/utils'))\n .filter((file) => file.endsWith('.js'))\n .map((file) => [\n `@theme/${file.slice(0, -3)}`,\n path.resolve(__dirname, '../client/utils', file),\n ]),\n ),\n },\n\n clientConfigFile: path.resolve(__dirname, '../client/config.js'),\n\n extendsBundlerOptions: (bundlerOptions, app) => {\n // ensure theme alias is not optimized by Vite\n addViteOptimizeDepsExclude(bundlerOptions, app, '@theme')\n },\n\n extendsPage: (page: Page<Partial<DefaultThemePageData>>) => {\n // save relative file path into page data to generate edit link\n page.data.filePathRelative = page.filePathRelative\n // save title into route meta to generate navbar and sidebar\n page.routeMeta.title = page.title\n },\n\n plugins: [\n // @vuepress/plugin-active-header-link\n (themePlugins.activeHeaderLinks ?? true)\n ? activeHeaderLinksPlugin({\n // should greater than page transition duration\n delay: 300,\n })\n : [],\n\n // @vuepress/plugin-back-to-top\n (themePlugins.backToTop ?? true)\n ? backToTopPlugin(\n isPlainObject(themePlugins.backToTop) ? themePlugins.backToTop : {},\n )\n : [],\n\n // @vuepress/plugin-copy-code\n (themePlugins.copyCode ?? true)\n ? copyCodePlugin({\n ...(isPlainObject(themePlugins.copyCode)\n ? themePlugins.copyCode\n : {}),\n })\n : [],\n\n // @vuepress/plugin-markdown-container\n (themePlugins.hint ?? true)\n ? markdownHintPlugin({\n locales: resolveMarkdownHintLocales(localeOptions),\n ...(isPlainObject(themePlugins.hint) ? themePlugins.hint : {}),\n })\n : [],\n\n // @vuepress/plugin-git\n (themePlugins.git ?? true)\n ? gitPlugin({\n createdTime: false,\n updatedTime: localeOptions.lastUpdated ?? true,\n changelog: { repoUrl: localeOptions.repo || '' },\n ...(isPlainObject(themePlugins.git) ? themePlugins.git : {}),\n })\n : [],\n\n // @vuepress/plugin-links-check\n (themePlugins.linksCheck ?? true)\n ? linksCheckPlugin(\n isPlainObject(themePlugins.linksCheck)\n ? themePlugins.linksCheck\n : {},\n )\n : [],\n\n // @vuepress/plugin-medium-zoom\n (themePlugins.mediumZoom ?? true) ? mediumZoomPlugin() : [],\n\n // @vuepress/plugin-nprogress\n (themePlugins.nprogress ?? true) ? nprogressPlugin() : [],\n\n // @vuepress/plugin-palette\n palettePlugin({ preset: 'sass' }),\n\n // @vuepress/plugin-prismjs\n (themePlugins.prismjs ?? true)\n ? prismjsPlugin(\n isPlainObject(themePlugins.prismjs) ? themePlugins.prismjs : {},\n )\n : [],\n\n // @vuepress/plugin-seo\n hostname && (themePlugins.seo ?? true)\n ? seoPlugin({\n hostname,\n ...(isPlainObject(themePlugins.seo) ? themePlugins.seo : {}),\n })\n : [],\n\n // @vuepress/plugin-sitemap\n hostname && (themePlugins.sitemap ?? true)\n ? sitemapPlugin({\n hostname,\n ...(isPlainObject(themePlugins.sitemap)\n ? themePlugins.sitemap\n : {}),\n })\n : [],\n\n // @vuepress/plugin-markdown-tab\n (themePlugins.tab ?? true)\n ? markdownTabPlugin(\n isPlainObject(themePlugins.tab)\n ? themePlugins.tab\n : { codeTabs: true, tabs: true },\n )\n : [],\n\n // @vuepress/plugin-theme-data\n themeDataPlugin({ themeData: localeOptions }),\n ],\n }\n}\n"],"mappings":"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"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import VPDarkIcon from '@theme/VPDarkIcon.vue'
|
|
3
|
-
import VPLightIcon from '@theme/VPLightIcon.vue'
|
|
4
2
|
import { useDarkMode } from '@theme/useDarkMode'
|
|
5
3
|
import { useData } from '@theme/useData'
|
|
4
|
+
import VPDarkIcon from '@theme/VPDarkIcon.vue'
|
|
5
|
+
import VPLightIcon from '@theme/VPLightIcon.vue'
|
|
6
6
|
|
|
7
7
|
const { themeLocale } = useData()
|
|
8
8
|
const isDarkMode = useDarkMode()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|