@sewadah/selaras-docs 1.4.2 → 1.4.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.4.3
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.4.2...selaras-docs-v1.4.3)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **fix(docs):** refresh language trigger after hydration ([34994e2](https://github.com/sewadahapp/selaras/commit/34994e2a0c068243a4b08170aa53957b236add06))
|
|
10
|
+
|
|
11
|
+
### 🤖 Other changes
|
|
12
|
+
|
|
13
|
+
- Merge pull request #38 from sewadahapp/fix/docs-switcher-hydration ([272466a](https://github.com/sewadahapp/selaras/commit/272466ae26b3a4804d29039d0145484174b990f4))
|
|
14
|
+
|
|
15
|
+
Published against `@sewadah/selaras` ^1.3.0.
|
|
16
|
+
|
|
3
17
|
## v1.4.2
|
|
4
18
|
|
|
5
19
|
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.4.1...selaras-docs-v1.4.2)
|
|
@@ -4,6 +4,12 @@ import { formatDocsMessage } from '../utils/docs-messages'
|
|
|
4
4
|
const { locale, locales, localeOption, hasLocaleSwitching, setLocale } = useDocsLocale()
|
|
5
5
|
const messages = useDocsMessages()
|
|
6
6
|
const open = ref(false)
|
|
7
|
+
// A root locale redirect can hydrate a different locale than the prerendered
|
|
8
|
+
// trigger. Replace that trigger after hydration so its icon and label match.
|
|
9
|
+
const hydrated = ref(false)
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
hydrated.value = true
|
|
12
|
+
})
|
|
7
13
|
|
|
8
14
|
const nextLocale = computed(() => locales.value.find(option => option.code !== locale.value) ?? localeOption.value)
|
|
9
15
|
const label = computed(() => formatDocsMessage(messages.value.languageSwitcher, { language: nextLocale.value.name }))
|
|
@@ -12,6 +18,7 @@ const label = computed(() => formatDocsMessage(messages.value.languageSwitcher,
|
|
|
12
18
|
<template>
|
|
13
19
|
<SPopover v-if="hasLocaleSwitching" v-model:open="open" :positioning="{ side: 'bottom', align: 'end', sideOffset: 8 }" :ui="{ content: 'p-2' }">
|
|
14
20
|
<SButton
|
|
21
|
+
:key="String(hydrated)"
|
|
15
22
|
variant="ghost"
|
|
16
23
|
color="neutral"
|
|
17
24
|
square
|