svelte-intlayer 8.9.3 → 8.9.4

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.
@@ -1,7 +1,14 @@
1
- import type { LocalesValues } from '@intlayer/types/module_augmentation';
2
- type useLocaleProps = {
1
+ import type { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
2
+ import { type Readable } from 'svelte/store';
3
+ export type UseLocaleProps = {
3
4
  isCookieEnabled?: boolean;
4
- onLocaleChange?: (locale: LocalesValues) => void;
5
+ onLocaleChange?: (locale: DeclaredLocales) => void;
6
+ };
7
+ export type UseLocaleResult = {
8
+ locale: Readable<DeclaredLocales>;
9
+ defaultLocale: DeclaredLocales;
10
+ availableLocales: DeclaredLocales[];
11
+ setLocale: (locale: LocalesValues) => void;
5
12
  };
6
13
  /**
7
14
  * Svelte hook to manage the current locale and related functions.
@@ -23,10 +30,4 @@ type useLocaleProps = {
23
30
  * </select>
24
31
  * ```
25
32
  */
26
- export declare const useLocale: ({ isCookieEnabled, onLocaleChange, }?: useLocaleProps) => {
27
- locale: import("svelte/store").Readable<LocalesValues>;
28
- setLocale: (locale: LocalesValues) => void;
29
- defaultLocale: import("@intlayer/types").Locale;
30
- availableLocales: import("@intlayer/types").Locale[];
31
- };
32
- export {};
33
+ export declare const useLocale: ({ isCookieEnabled, onLocaleChange, }?: UseLocaleProps) => UseLocaleResult;
@@ -29,7 +29,7 @@ export const useLocale = ({ isCookieEnabled, onLocaleChange, } = {}) => {
29
29
  if (context) {
30
30
  // Use context if available
31
31
  return {
32
- locale: derived([intlayerStore], ([$store]) => context.locale ?? $store.locale),
32
+ locale: derived([intlayerStore], ([$store]) => (context.locale ?? $store.locale)),
33
33
  setLocale: (locale) => {
34
34
  context.setLocale(locale);
35
35
  setLocaleInStorage(locale, isCookieEnabled ?? context?.isCookieEnabled ?? true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-intlayer",
3
- "version": "8.9.3",
3
+ "version": "8.9.4",
4
4
  "description": "Easily internationalize i18n your Svelte applications with type-safe multilingual content management.",
5
5
  "keywords": [
6
6
  "intlayer",
@@ -82,17 +82,17 @@
82
82
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
83
83
  },
84
84
  "dependencies": {
85
- "@intlayer/api": "8.9.3",
86
- "@intlayer/config": "8.9.3",
87
- "@intlayer/core": "8.9.3",
88
- "@intlayer/editor": "8.9.3",
89
- "@intlayer/types": "8.9.3"
85
+ "@intlayer/api": "8.9.4",
86
+ "@intlayer/config": "8.9.4",
87
+ "@intlayer/core": "8.9.4",
88
+ "@intlayer/editor": "8.9.4",
89
+ "@intlayer/types": "8.9.4"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@sveltejs/adapter-auto": "7.0.1",
93
93
  "@sveltejs/package": "2.5.7",
94
94
  "@sveltejs/vite-plugin-svelte": "7.1.2",
95
- "@types/node": "25.6.1",
95
+ "@types/node": "25.6.2",
96
96
  "@utils/ts-config": "1.0.4",
97
97
  "@utils/ts-config-types": "1.0.4",
98
98
  "@utils/tsdown-config": "1.0.4",