@viteplus/versions 2.0.5 → 2.0.7
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/README.md +108 -120
- package/components/version-switcher.component.vue +75 -67
- package/dist/index.d.ts +603 -2233
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -8
- package/package.json +77 -72
package/README.md
CHANGED
|
@@ -2,183 +2,171 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://viteplus.github.io/versions/)
|
|
4
4
|
[](https://www.npmjs.com/package/@viteplus/versions)
|
|
5
|
+
[](https://www.npmjs.com/package/@viteplus/versions)
|
|
5
6
|
[](https://opensource.org/licenses/MPL-2.0)
|
|
6
|
-
[](https://github.com/viteplus/versions/actions/workflows/ci.yml)
|
|
7
8
|
[](https://discord.gg/6vgFhJTEGn)
|
|
8
9
|
[](https://deepwiki.com/viteplus/versions)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
A VitePress plugin for versioned documentation. Call `defineVersionedConfig` instead of VitePress's
|
|
12
|
+
`defineConfig` and it manages versioned routes, a per-version sidebar and navigation, and a `VersionSwitcher`
|
|
13
|
+
component - so a single site can serve your current docs alongside frozen copies of every previous version.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
It is designed for documentation that evolves across releases, with version-aware localization, automatic URL
|
|
16
|
+
rewriting, and per-version configuration that lets each version keep its own navigation. It builds on the API
|
|
17
|
+
pioneered by [vitepress-versioning-plugin](https://github.com/IMB11/vitepress-versioning-plugin) and supports
|
|
18
|
+
VitePress v1.6.4 and the v2.x line.
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
- **Localization**: Full multi-language support with version-aware localization
|
|
17
|
-
- **Smart URL Routing**: Automatic path rewriting for clean, predictable URLs
|
|
18
|
-
- **Version Switcher**: Built-in component for navigating between versions
|
|
19
|
-
- **Flexible Configuration**: Customize navigation, sidebar, and URL structures per version/locale
|
|
20
|
-
- **VitePress**: support 2.0.0-alpha.12
|
|
20
|
+
## Key Features
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
- **Versioned routes**: serve the current docs from `src/` at the root and each `archive/` subfolder as a frozen, separately-routed version.
|
|
23
|
+
- **Per-version navigation**: give every version its own nav and sidebar, or share one configuration across all of them.
|
|
24
|
+
- **Version switcher**: a built-in `VersionSwitcher` component that lists every version and switches between them.
|
|
25
|
+
- **Version-aware localization**: full multi-language support, with locale and version combined into clean URLs.
|
|
26
|
+
- **Smart URL rewriting**: automatic, predictable paths, customizable through a `rewritesHook`.
|
|
27
|
+
- **Drop-in**: wraps VitePress's config and keeps every native VitePress feature.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
23
30
|
|
|
24
31
|
```bash
|
|
25
32
|
npm install @viteplus/versions
|
|
26
33
|
# or
|
|
27
|
-
yarn add @viteplus/versions
|
|
28
|
-
# or
|
|
29
34
|
pnpm add @viteplus/versions
|
|
35
|
+
# or
|
|
36
|
+
yarn add @viteplus/versions
|
|
30
37
|
```
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
@viteplus/versions requires Node.js 20 or later and works with VitePress v1.6.4 and the v2.x line.
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
2. Install @viteplus/versions
|
|
36
|
-
3. Configure your documentation using `defineVersionedConfig`
|
|
41
|
+
## Quick start
|
|
37
42
|
|
|
38
43
|
```ts
|
|
39
44
|
// .vitepress/config.ts
|
|
40
45
|
import { defineVersionedConfig } from '@viteplus/versions';
|
|
41
46
|
|
|
42
47
|
export default defineVersionedConfig({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
title: 'My Project Documentation',
|
|
49
|
+
description: 'Documentation with version control',
|
|
50
|
+
versionsConfig: {
|
|
51
|
+
current: 'v2.0.0',
|
|
52
|
+
versionSwitcher: {
|
|
53
|
+
text: 'Version',
|
|
54
|
+
includeCurrentVersion: true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
themeConfig: {
|
|
58
|
+
nav: [
|
|
59
|
+
{ text: 'Guide', link: '/guide/' },
|
|
60
|
+
{ component: 'VersionSwitcher' }
|
|
61
|
+
]
|
|
52
62
|
}
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// Standard VitePress configuration
|
|
56
|
-
themeConfig: {
|
|
57
|
-
nav: [
|
|
58
|
-
{ text: 'Guide', link: '/guide/' },
|
|
59
|
-
{ component: 'VersionSwitcher' }
|
|
60
|
-
],
|
|
61
|
-
// ...
|
|
62
|
-
}
|
|
63
63
|
});
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Current-version content lives in `docs/src` and is served at the site root; each subfolder of `docs/archive`
|
|
67
|
+
becomes a frozen version. `defineVersionedConfig` wires the routing - you do not set `srcDir` yourself.
|
|
68
|
+
|
|
69
|
+
## Theme setup
|
|
70
|
+
|
|
71
|
+
Register the `VersionSwitcher` component in your theme so it can be placed in the nav or used directly.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// .vitepress/theme/index.ts
|
|
75
|
+
import DefaultTheme from 'vitepress/theme';
|
|
76
|
+
import VersionSwitcher from '@viteplus/versions/components/version-switcher.component.vue';
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
extends: DefaultTheme,
|
|
80
|
+
enhanceApp({ app }) {
|
|
81
|
+
app.component('VersionSwitcher', VersionSwitcher);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Project structure
|
|
67
87
|
|
|
68
88
|
```text
|
|
69
89
|
docs/
|
|
70
90
|
├── .vitepress/
|
|
71
91
|
│ └── config.ts
|
|
72
|
-
├── src/ //
|
|
73
|
-
│ ├──
|
|
74
|
-
│
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
└── archive/ // Archived versions
|
|
80
|
-
└── v1.0/
|
|
81
|
-
├── en/
|
|
82
|
-
│ ├── index.md
|
|
83
|
-
│ └── guide/
|
|
84
|
-
└── de/
|
|
85
|
-
├── index.md
|
|
86
|
-
└── guide/
|
|
87
|
-
|
|
92
|
+
├── src/ // current version content (served at the root)
|
|
93
|
+
│ ├── index.md
|
|
94
|
+
│ └── guide/
|
|
95
|
+
└── archive/ // archived versions (each subfolder is one frozen version)
|
|
96
|
+
└── v1.0.x/
|
|
97
|
+
├── index.md
|
|
98
|
+
└── guide/
|
|
88
99
|
```
|
|
89
100
|
|
|
90
|
-
##
|
|
101
|
+
## Localization
|
|
102
|
+
|
|
103
|
+
Add locale subfolders under `src` and each `archive/<version>`; the default URL layout is `locale/version/source`.
|
|
91
104
|
|
|
92
105
|
```ts
|
|
93
106
|
export default defineVersionedConfig({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
lang: 'en',
|
|
98
|
-
label: 'English',
|
|
99
|
-
themeConfig: {
|
|
100
|
-
nav: [
|
|
101
|
-
{ text: 'Home', link: '/' },
|
|
102
|
-
{ text: 'Guide', link: '/guide/' }
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
de: {
|
|
107
|
-
lang: 'de',
|
|
108
|
-
label: 'Deutsch',
|
|
109
|
-
themeConfig: {
|
|
110
|
-
nav: [
|
|
111
|
-
{ text: 'Startseite', link: '/' },
|
|
112
|
-
{ text: 'Anleitung', link: '/guide/' }
|
|
113
|
-
]
|
|
114
|
-
}
|
|
107
|
+
locales: {
|
|
108
|
+
root: { lang: 'en', label: 'English' },
|
|
109
|
+
de: { lang: 'de', label: 'Deutsch' }
|
|
115
110
|
}
|
|
116
|
-
}
|
|
117
111
|
});
|
|
118
|
-
|
|
119
112
|
```
|
|
120
113
|
|
|
121
|
-
##
|
|
114
|
+
## Version-specific navigation
|
|
115
|
+
|
|
116
|
+
`nav` and `sidebar` each accept an array (shared by every version) or an object keyed by version, where `root`
|
|
117
|
+
is the current version. Version-specific entries are self-contained and do not inherit from `root`.
|
|
122
118
|
|
|
123
119
|
```ts
|
|
124
120
|
export default defineVersionedConfig({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
themeConfig: {
|
|
122
|
+
nav: {
|
|
123
|
+
// Default navigation for the current version
|
|
124
|
+
root: [
|
|
125
|
+
{ text: 'Home', link: '/' },
|
|
126
|
+
{ text: 'Guide', link: '/guide/' }
|
|
127
|
+
],
|
|
128
|
+
// Navigation only for v1.0.x
|
|
129
|
+
'v1.0.x': [
|
|
130
|
+
{ text: 'Home', link: '/' },
|
|
131
|
+
{ text: 'Legacy API', link: '/legacy-api/' }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
138
134
|
}
|
|
139
|
-
}
|
|
140
135
|
});
|
|
141
|
-
|
|
142
136
|
```
|
|
143
137
|
|
|
144
|
-
##
|
|
138
|
+
## Custom URL structure
|
|
139
|
+
|
|
140
|
+
Control how source paths map to URLs with `rewritesHook`.
|
|
145
141
|
|
|
146
142
|
```ts
|
|
147
143
|
export default defineVersionedConfig({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return `${version}/${locale}/${source}`;
|
|
154
|
-
}
|
|
144
|
+
versionsConfig: {
|
|
145
|
+
hooks: {
|
|
146
|
+
// version first, then locale
|
|
147
|
+
rewritesHook: (source, version, locale) => `${version}/${locale}/${source}`
|
|
148
|
+
}
|
|
155
149
|
}
|
|
156
|
-
}
|
|
157
150
|
});
|
|
158
151
|
```
|
|
159
152
|
|
|
160
|
-
##
|
|
161
|
-
|
|
162
|
-
For comprehensive guides and reference, check our [documentation](https://viteplus.github.io/versions/).
|
|
163
|
-
|
|
164
|
-
- [Localization](https://viteplus.github.io/versions//guide/locales.html)
|
|
165
|
-
- [URL Path Rewrites](https://viteplus.github.io/versions//guide/rewrites.html)
|
|
166
|
-
- [Version Switcher](https://viteplus.github.io/versions//guide/switcher.html)
|
|
167
|
-
- [Configuration Guide](https://viteplus.github.io/versions//guide/configuration.html)
|
|
153
|
+
## Documentation
|
|
168
154
|
|
|
169
|
-
|
|
155
|
+
Full guides and the configuration reference live at
|
|
156
|
+
**[viteplus.github.io/versions](https://viteplus.github.io/versions/)**.
|
|
170
157
|
|
|
171
|
-
|
|
158
|
+
## Contributing
|
|
172
159
|
|
|
173
|
-
|
|
160
|
+
Contributions are welcome! Open an [issue](https://github.com/viteplus/versions/issues) or a pull request on
|
|
161
|
+
GitHub. See the [contributing guidelines](CONTRIBUTING.md) for setup and conventions.
|
|
174
162
|
|
|
175
|
-
|
|
163
|
+
## Links
|
|
176
164
|
|
|
177
|
-
|
|
165
|
+
[Documentation](https://viteplus.github.io/versions/),
|
|
166
|
+
[GitHub Repository](https://github.com/viteplus/versions),
|
|
167
|
+
[Issue Tracker](https://github.com/viteplus/versions/issues),
|
|
168
|
+
[npm Package](https://www.npmjs.com/package/@viteplus/versions)
|
|
178
169
|
|
|
179
|
-
|
|
180
|
-
- [Vue.js](https://vuejs.org/) - The progressive JavaScript framework
|
|
181
|
-
- [Vite](https://vitejs.dev/) - Next generation frontend tooling
|
|
182
|
-
- `@IMB11` - for the original vitepress-versioning-plugin
|
|
170
|
+
## License
|
|
183
171
|
|
|
184
|
-
|
|
172
|
+
This project is licensed under the Mozilla Public License 2.0 - see the [LICENSE](LICENSE) file for details.
|
|
@@ -1,126 +1,138 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Imports
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
2
|
import { computed, ref } from 'vue';
|
|
7
3
|
import { useData, useRouter } from 'vitepress';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Imports from VitePress
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
4
|
import VPFlyout from 'vitepress/dist/client/theme-default/components/VPFlyout.vue';
|
|
14
5
|
import VPMenuLink from 'vitepress/dist/client/theme-default/components/VPMenuLink.vue';
|
|
15
6
|
|
|
16
|
-
/**
|
|
17
|
-
* Interfaces
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
7
|
interface VersioningPlugin {
|
|
21
8
|
versions: Set<string>;
|
|
22
9
|
currentVersion: string;
|
|
23
10
|
}
|
|
24
11
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
interface Props {
|
|
13
|
+
versioningPlugin: VersioningPlugin;
|
|
14
|
+
screenMenu?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface VersionMenuItem {
|
|
18
|
+
text: string;
|
|
19
|
+
link: string;
|
|
20
|
+
}
|
|
28
21
|
|
|
22
|
+
const props = defineProps<Props>();
|
|
29
23
|
const router = useRouter();
|
|
30
|
-
const isOpen = ref(false);
|
|
31
24
|
const { site } = useData();
|
|
32
|
-
const
|
|
33
|
-
versioningPlugin: VersioningPlugin
|
|
34
|
-
screenMenu?: boolean
|
|
35
|
-
}>();
|
|
25
|
+
const isOpen = ref(false);
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
// Computed properties
|
|
28
|
+
const versionSet = computed(() => new Set([...props.versioningPlugin.versions]));
|
|
38
29
|
const hasVersions = computed(() => versionSet.value.size > 0);
|
|
39
30
|
|
|
40
|
-
const
|
|
41
|
-
|
|
31
|
+
const currentLocale = computed(() =>
|
|
32
|
+
site.value.locales[site.value.localeIndex]?.link?.replace(/\//g, '') || ''
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const pathSegments = computed(() => router.route.data.relativePath.split('/'));
|
|
36
|
+
|
|
37
|
+
const activeVersion = computed(() => {
|
|
42
38
|
const { currentVersion } = props.versioningPlugin;
|
|
43
|
-
const
|
|
39
|
+
const segments = pathSegments.value;
|
|
40
|
+
const locale = currentLocale.value;
|
|
44
41
|
|
|
45
|
-
//
|
|
46
|
-
const
|
|
42
|
+
// Determine which segment might be the version
|
|
43
|
+
const versionCandidate = segments[0] === locale ? segments[1] : segments[0];
|
|
47
44
|
|
|
48
|
-
return versionSet.value.has(
|
|
45
|
+
return versionSet.value.has(versionCandidate) ? versionCandidate : currentVersion;
|
|
49
46
|
});
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const locale = site.value.locales[site.value.localeIndex].link.replace(/\//g, '');
|
|
48
|
+
const availableVersions = computed(() =>
|
|
49
|
+
Array.from(props.versioningPlugin.versions).filter(v => v !== activeVersion.value)
|
|
50
|
+
);
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const shouldShowCurrentVersion = computed(() =>
|
|
53
|
+
activeVersion.value !== props.versioningPlugin.currentVersion
|
|
54
|
+
);
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
// Helper functions
|
|
57
|
+
function isLocaleFirst(segments: string[]): boolean {
|
|
58
|
+
return segments[0] === currentLocale.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function removeVersionSegments(segments: string[]): string[] {
|
|
62
|
+
return segments.filter(seg => !versionSet.value.has(seg));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function buildVersionPath(version: string): string {
|
|
66
|
+
const { currentVersion } = props.versioningPlugin;
|
|
67
|
+
const baseSegments = removeVersionSegments(pathSegments.value);
|
|
68
|
+
const hasLocale = isLocaleFirst(baseSegments);
|
|
61
69
|
|
|
62
70
|
let newSegments: string[];
|
|
71
|
+
|
|
63
72
|
if (version === currentVersion) {
|
|
64
73
|
newSegments = baseSegments;
|
|
65
|
-
} else if (
|
|
66
|
-
newSegments = [
|
|
74
|
+
} else if (hasLocale) {
|
|
75
|
+
newSegments = [baseSegments[0], version, ...baseSegments.slice(1)];
|
|
67
76
|
} else {
|
|
68
|
-
newSegments = [
|
|
77
|
+
newSegments = [version, ...baseSegments];
|
|
69
78
|
}
|
|
70
79
|
|
|
71
|
-
return
|
|
80
|
+
return `/${newSegments.join('/')}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function createVersionMenuItem(version: string): VersionMenuItem {
|
|
84
|
+
return {
|
|
85
|
+
text: version,
|
|
86
|
+
link: buildVersionPath(version)
|
|
87
|
+
};
|
|
72
88
|
}
|
|
73
89
|
|
|
74
|
-
function toggle() {
|
|
90
|
+
function toggle(): void {
|
|
75
91
|
isOpen.value = !isOpen.value;
|
|
76
92
|
}
|
|
77
93
|
</script>
|
|
78
94
|
|
|
79
95
|
<template>
|
|
80
|
-
<!-- Only render if versions exist -->
|
|
81
96
|
<template v-if="hasVersions">
|
|
82
|
-
<!-- Desktop
|
|
97
|
+
<!-- Desktop flyout -->
|
|
83
98
|
<VPFlyout
|
|
84
99
|
v-if="!screenMenu"
|
|
85
100
|
class="VPVersionSwitcher"
|
|
86
101
|
icon="vpi-versioning"
|
|
87
|
-
:button="
|
|
102
|
+
:button="activeVersion"
|
|
88
103
|
label="Switch Version"
|
|
89
104
|
>
|
|
90
105
|
<div class="items">
|
|
91
|
-
<!-- Only show latest version link if we're not already on latest -->
|
|
92
106
|
<VPMenuLink
|
|
93
|
-
v-if="
|
|
107
|
+
v-if="shouldShowCurrentVersion"
|
|
94
108
|
:item="createVersionMenuItem(versioningPlugin.currentVersion)"
|
|
95
109
|
/>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/>
|
|
102
|
-
</template>
|
|
110
|
+
<VPMenuLink
|
|
111
|
+
v-for="version in availableVersions"
|
|
112
|
+
:key="version"
|
|
113
|
+
:item="createVersionMenuItem(version)"
|
|
114
|
+
/>
|
|
103
115
|
</div>
|
|
104
116
|
</VPFlyout>
|
|
105
117
|
|
|
106
|
-
<!-- Mobile
|
|
118
|
+
<!-- Mobile dropdown -->
|
|
107
119
|
<div v-else class="VPScreenVersionSwitcher" :class="{ open: isOpen }">
|
|
108
120
|
<button
|
|
109
121
|
class="button"
|
|
122
|
+
type="button"
|
|
110
123
|
aria-controls="navbar-group-version"
|
|
111
124
|
:aria-expanded="isOpen"
|
|
112
125
|
@click="toggle"
|
|
113
126
|
>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
<span class="button-text">
|
|
128
|
+
<span class="vpi-versioning icon" />
|
|
129
|
+
Switch Version
|
|
130
|
+
</span>
|
|
131
|
+
<span class="vpi-plus button-icon" />
|
|
118
132
|
</button>
|
|
119
133
|
|
|
120
134
|
<div id="navbar-group-version" class="items">
|
|
121
|
-
|
|
122
|
-
<VPMenuLink :item="createVersionMenuItem(versioningPlugin.currentVersion)"/>
|
|
123
|
-
<!-- Show all version links -->
|
|
135
|
+
<VPMenuLink :item="createVersionMenuItem(versioningPlugin.currentVersion)" />
|
|
124
136
|
<VPMenuLink
|
|
125
137
|
v-for="version in versioningPlugin.versions"
|
|
126
138
|
:key="version"
|
|
@@ -130,19 +142,18 @@ function toggle() {
|
|
|
130
142
|
</div>
|
|
131
143
|
</template>
|
|
132
144
|
</template>
|
|
145
|
+
|
|
133
146
|
<style>
|
|
134
|
-
/* Versioning icon styling */
|
|
135
147
|
.vpi-versioning.option-icon {
|
|
136
148
|
margin-right: 2px !important;
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
.vpi-versioning {
|
|
140
|
-
--icon: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0cm9rZS13aWR0aD0iMi4yIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNvbG9yPSIjMDAwMDAwIj48cGF0aCBkPSJNMTcgN0MxOC4xMDQ2IDcgMTkgNi4xMDQ1NyAxOSA1QzE5IDMuODk1NDMgMTguMTA0NiAzIDE3IDNDMTUuODk1NCAzIDE1IDMuODk1ND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bmQiPjwvcGF0aD48cGF0aCBkPSJNNyA3VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNMTcgN1Y4QzE3IDEwLjUgMTUgMTEgMTUgMTFMOSAxM0M5IDEzIDcgMTMuNSA3IDE2VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48L3N2Zz4=");
|
|
141
153
|
}
|
|
142
154
|
</style>
|
|
143
155
|
|
|
144
156
|
<style scoped>
|
|
145
|
-
/* Component styling with minor optimizations */
|
|
146
157
|
.VPVersionSwitcher {
|
|
147
158
|
display: flex;
|
|
148
159
|
align-items: center;
|
|
@@ -160,7 +171,6 @@ function toggle() {
|
|
|
160
171
|
color: var(--vp-c-text-1);
|
|
161
172
|
}
|
|
162
173
|
|
|
163
|
-
/* Mobile version switcher styles */
|
|
164
174
|
.VPScreenVersionSwitcher {
|
|
165
175
|
border-bottom: 1px solid var(--vp-c-divider);
|
|
166
176
|
height: 48px;
|
|
@@ -187,7 +197,6 @@ function toggle() {
|
|
|
187
197
|
}
|
|
188
198
|
|
|
189
199
|
.VPScreenVersionSwitcher.open .button-icon {
|
|
190
|
-
/*rtl:ignore*/
|
|
191
200
|
transform: rotate(45deg);
|
|
192
201
|
}
|
|
193
202
|
|
|
@@ -216,7 +225,6 @@ function toggle() {
|
|
|
216
225
|
transition: transform 0.25s;
|
|
217
226
|
}
|
|
218
227
|
|
|
219
|
-
/* Group styling */
|
|
220
228
|
.group:first-child {
|
|
221
229
|
padding-top: 0;
|
|
222
230
|
}
|