@nocode-factory/sanity-kit 2.32.0 → 2.32.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocode-factory/sanity-kit",
3
- "version": "2.32.0",
3
+ "version": "2.32.1",
4
4
  "description": "Outils Studio de NoCode Factory : Pages (liste + board), Composants, Historique",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -33,14 +33,16 @@ function PagesNavigator() {
33
33
  const shownLocale = localeOfPreview(params?.preview, i18n)
34
34
  const [locale, setLocale] = useState<string | null>(null)
35
35
  const [search, setSearch] = useState('')
36
- const activeLocale = locale ?? shownLocale ?? ''
36
+ // Langue choisie, sinon celle de la page affichée, sinon la langue principale :
37
+ // le menu montre toujours la langue réellement filtrée.
38
+ const activeLocale = locale ?? shownLocale ?? i18n?.defaultLocale ?? ''
37
39
  const current = pathOf(params?.preview)
38
40
 
39
41
  const visible = useMemo(() => {
40
42
  const q = search.trim().toLowerCase()
41
43
  return rows
42
44
  .filter((r) => r.path !== null)
43
- .filter((r) => !i18n || !activeLocale || r.locale === activeLocale)
45
+ .filter((r) => !i18n || !activeLocale || !r.locale || r.locale === activeLocale)
44
46
  .filter((r) => !q || r.title.toLowerCase().includes(q) || (r.path ?? '').toLowerCase().includes(q))
45
47
  .sort((a, b) => (a.path ?? '').localeCompare(b.path ?? ''))
46
48
  }, [rows, search, activeLocale, i18n])
@@ -63,7 +65,7 @@ function PagesNavigator() {
63
65
  />
64
66
  </Box>
65
67
  {i18n && i18n.locales.length > 1 && (
66
- <Select fontSize={1} padding={2} value={activeLocale} onChange={(e) => setLocale(e.currentTarget.value)} style={{width: 72}}>
68
+ <Select fontSize={1} padding={2} value={activeLocale} onChange={(e) => setLocale(e.currentTarget.value)} style={{width: 88}}>
67
69
  {i18n.locales.map((code) => (
68
70
  <option key={code} value={code}>
69
71
  {code.toUpperCase()}
package/src/version.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
4
4
  * le vérifie.
5
5
  */
6
- export const KIT_VERSION = '2.32.0'
6
+ export const KIT_VERSION = '2.32.1'