diff --git a/.changeset/proud-apricots-warn.md b/.changeset/proud-apricots-warn.md deleted file mode 100644 index 6d94425739c..00000000000 --- a/.changeset/proud-apricots-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Fixes a list item spacing issue where line break elements (`
`) could receive a margin, breaking layout in Firefox diff --git a/examples/basics/package.json b/examples/basics/package.json index 8af9dbac005..a1d627b59db 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.30.2", + "@astrojs/starlight": "^0.30.3", "astro": "^5.0.2", "sharp": "^0.32.5" } diff --git a/examples/markdoc/package.json b/examples/markdoc/package.json index 7b727a14b4c..c1e6a03c1bd 100644 --- a/examples/markdoc/package.json +++ b/examples/markdoc/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdoc": "^0.12.1", - "@astrojs/starlight": "^0.30.2", + "@astrojs/starlight": "^0.30.3", "@astrojs/starlight-markdoc": "^0.2.0", "astro": "^5.0.2", "sharp": "^0.32.5" diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 05e44bb98de..ee400cb8bec 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.30.2", + "@astrojs/starlight": "^0.30.3", "@astrojs/starlight-tailwind": "^3.0.0", "@astrojs/tailwind": "^5.1.3", "astro": "^5.0.2", diff --git a/package.json b/package.json index f63a9fd3d2e..7682471c68b 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ { "name": "/_astro/*.js", "path": "examples/basics/dist/_astro/*.js", - "limit": "23 kB", + "limit": "23.5 kB", "gzip": true }, { diff --git a/packages/starlight/CHANGELOG.md b/packages/starlight/CHANGELOG.md index b675e2c67c9..1648b8ed59f 100644 --- a/packages/starlight/CHANGELOG.md +++ b/packages/starlight/CHANGELOG.md @@ -1,5 +1,17 @@ # @astrojs/starlight +## 0.30.3 + +### Patch Changes + +- [#2717](https://github.com/withastro/starlight/pull/2717) [`c5fcbb3`](https://github.com/withastro/starlight/commit/c5fcbb33a7a0511ac372f5d006a69f4195d1e266) Thanks [@delucis](https://github.com/delucis)! - Fixes a list item spacing issue where line break elements (`
`) could receive a margin, breaking layout in Firefox + +- [#2724](https://github.com/withastro/starlight/pull/2724) [`02d7ac6`](https://github.com/withastro/starlight/commit/02d7ac66a0bdca3f26001f556de070027d4e0faf) Thanks [@dionysuzx](https://github.com/dionysuzx)! - Adds social link support for Farcaster + +- [#2635](https://github.com/withastro/starlight/pull/2635) [`ec4b851`](https://github.com/withastro/starlight/commit/ec4b85154ea301d9144ff49f3abd009e3a929387) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where the language picker in multilingual sites could display the wrong language when navigating between pages with the browser back/forward buttons. + +- [#2726](https://github.com/withastro/starlight/pull/2726) [`e54ebd5`](https://github.com/withastro/starlight/commit/e54ebd5c879deb3fdff2180426b377181773b85f) Thanks [@techfg](https://github.com/techfg)! - Adds icon for phone + ## 0.30.2 ### Patch Changes diff --git a/packages/starlight/__tests__/basics/config-errors.test.ts b/packages/starlight/__tests__/basics/config-errors.test.ts index 76c5b73a41e..1574cd42cdd 100644 --- a/packages/starlight/__tests__/basics/config-errors.test.ts +++ b/packages/starlight/__tests__/basics/config-errors.test.ts @@ -115,7 +115,7 @@ test('errors with bad social icon config', () => { "[AstroUserError]: Invalid config passed to starlight integration Hint: - **social.unknown**: Invalid enum value. Expected 'twitter' | 'mastodon' | 'github' | 'gitlab' | 'bitbucket' | 'discord' | 'gitter' | 'codeberg' | 'codePen' | 'youtube' | 'threads' | 'linkedin' | 'twitch' | 'azureDevOps' | 'microsoftTeams' | 'instagram' | 'stackOverflow' | 'x.com' | 'telegram' | 'rss' | 'facebook' | 'email' | 'reddit' | 'patreon' | 'signal' | 'slack' | 'matrix' | 'openCollective' | 'hackerOne' | 'blueSky' | 'discourse' | 'zulip' | 'pinterest' | 'tiktok' | 'nostr' | 'backstage', received 'unknown' + **social.unknown**: Invalid enum value. Expected 'twitter' | 'mastodon' | 'github' | 'gitlab' | 'bitbucket' | 'discord' | 'gitter' | 'codeberg' | 'codePen' | 'youtube' | 'threads' | 'linkedin' | 'twitch' | 'azureDevOps' | 'microsoftTeams' | 'instagram' | 'stackOverflow' | 'x.com' | 'telegram' | 'rss' | 'facebook' | 'email' | 'reddit' | 'patreon' | 'signal' | 'slack' | 'matrix' | 'openCollective' | 'hackerOne' | 'blueSky' | 'discourse' | 'zulip' | 'pinterest' | 'tiktok' | 'nostr' | 'backstage' | 'farcaster', received 'unknown' **social.unknown**: Invalid url" ` ); diff --git a/packages/starlight/components/Icons.ts b/packages/starlight/components/Icons.ts index 79cea787460..875f4df60fe 100644 --- a/packages/starlight/components/Icons.ts +++ b/packages/starlight/components/Icons.ts @@ -108,6 +108,8 @@ export const BuiltInIcons = { '', email: '', + phone: + '', reddit: '', patreon: diff --git a/packages/starlight/components/LanguageSelect.astro b/packages/starlight/components/LanguageSelect.astro index 8187e833b61..b2bd2639011 100644 --- a/packages/starlight/components/LanguageSelect.astro +++ b/packages/starlight/components/LanguageSelect.astro @@ -41,6 +41,16 @@ function localizedPathname(locale: string | undefined): string { window.location.pathname = e.currentTarget.value; } }); + window.addEventListener('pageshow', (event) => { + if (!event.persisted) return; + // If the page was loaded from a cache, the language select selected index might not be + // in sync with the current page. + const markupSelectedIndex = + select.querySelector('option[selected]')?.index; + if (markupSelectedIndex !== select.selectedIndex) { + select.selectedIndex = markupSelectedIndex ?? 0; + } + }); } } } diff --git a/packages/starlight/components/Select.astro b/packages/starlight/components/Select.astro index 8be1685985c..50925b1a9cd 100644 --- a/packages/starlight/components/Select.astro +++ b/packages/starlight/components/Select.astro @@ -12,12 +12,21 @@ interface Props { selected: boolean; }>; } + +/** + * The `autocomplete="off"` attribute is used to prevent the browser from automatically selecting a + * value for this input, e.g. based on the user's previous selections, as this could lead to + * incorrect values being selected for example when the user switches between languages and uses + * the back button. + * Note that this attribute is only useful when a value is not restored at a later stage, e.g. the + * bfcache that ignores this attribute when restoring the value. + */ ---