svelte-intlayer 7.1.5 → 7.1.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("svelte/store"),r=require("./intlayerContext.cjs"),t=require("./intlayerStore.cjs"),c=()=>{const e=r.getIntlayerContext();return e?{locale:l.derived([t.intlayerStore],([o])=>e.locale||o.locale),setLocale:e.setLocale}:{locale:t.intlayerStore.getLocale(),setLocale:t.intlayerStore.setLocale}};exports.useLocale=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/config/built"),n=require("svelte/store"),c=require("./intlayerContext.cjs"),t=require("./intlayerStore.cjs"),i=()=>{const e=c.getIntlayerContext(),{defaultLocale:o,locales:l}=r?.internationalization??{};return e?{locale:n.derived([t.intlayerStore],([a])=>e.locale||a.locale),setLocale:e.setLocale}:{locale:t.intlayerStore.getLocale(),setLocale:t.intlayerStore.setLocale,defaultLocale:o,availableLocales:l}};exports.useLocale=i;
@@ -1,19 +1,22 @@
1
- import { derived as l } from "svelte/store";
2
- import { getIntlayerContext as r } from "./intlayerContext.mjs";
1
+ import r from "@intlayer/config/built";
2
+ import { derived as c } from "svelte/store";
3
+ import { getIntlayerContext as n } from "./intlayerContext.mjs";
3
4
  import { intlayerStore as o } from "./intlayerStore.mjs";
4
- const s = () => {
5
- const e = r();
5
+ const f = () => {
6
+ const e = n(), { defaultLocale: t, locales: l } = r?.internationalization ?? {};
6
7
  return e ? {
7
- locale: l(
8
+ locale: c(
8
9
  [o],
9
- ([t]) => e.locale || t.locale
10
+ ([a]) => e.locale || a.locale
10
11
  ),
11
12
  setLocale: e.setLocale
12
13
  } : {
13
14
  locale: o.getLocale(),
14
- setLocale: o.setLocale
15
+ setLocale: o.setLocale,
16
+ defaultLocale: t,
17
+ availableLocales: l
15
18
  };
16
19
  };
17
20
  export {
18
- s as useLocale
21
+ f as useLocale
19
22
  };
@@ -3,6 +3,13 @@
3
3
  * @returns Readable store with current locale and setter function
4
4
  */
5
5
  export declare const useLocale: () => {
6
- locale: import('svelte/store').Readable<import('intlayer').LocalesValues>;
7
- setLocale: (locale: import('intlayer').LocalesValues) => void;
6
+ locale: import('svelte/store').Readable<import('@intlayer/types').LocalesValues>;
7
+ setLocale: (locale: import('@intlayer/types').LocalesValues) => void;
8
+ defaultLocale?: undefined;
9
+ availableLocales?: undefined;
10
+ } | {
11
+ locale: import('svelte/store').Readable<import('@intlayer/types').LocalesValues>;
12
+ setLocale: (locale: import('@intlayer/types').LocalesValues) => void;
13
+ defaultLocale: import('@intlayer/types').Locale;
14
+ availableLocales: import('@intlayer/types').Locale[];
8
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-intlayer",
3
- "version": "7.1.5",
3
+ "version": "7.1.7",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Svelte applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -74,11 +74,11 @@
74
74
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
75
75
  },
76
76
  "dependencies": {
77
- "@intlayer/api": "7.1.5",
78
- "@intlayer/config": "7.1.5",
79
- "@intlayer/core": "7.1.5",
80
- "@intlayer/editor": "7.1.5",
81
- "@intlayer/types": "7.1.5"
77
+ "@intlayer/api": "7.1.7",
78
+ "@intlayer/config": "7.1.7",
79
+ "@intlayer/core": "7.1.7",
80
+ "@intlayer/editor": "7.1.7",
81
+ "@intlayer/types": "7.1.7"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@sveltejs/vite-plugin-svelte": "6.1.4",
@@ -89,9 +89,9 @@
89
89
  "rimraf": "6.1.0",
90
90
  "tsdown": "0.16.5",
91
91
  "typescript": "5.9.3",
92
- "vite": "7.2.0",
92
+ "vite": "7.2.2",
93
93
  "vite-plugin-dts": "4.5.4",
94
- "vitest": "4.0.8"
94
+ "vitest": "4.0.10"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "svelte": ">=5.0.0"