@intlayer/svelte-i18n 9.7.1 → 9.7.2

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
- {"version":3,"file":"locale.mjs","names":[],"sources":["../../src/locale.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { derived, type Readable, readable, writable } from 'svelte/store';\nimport { intlayerStore } from 'svelte-intlayer';\nimport { configLocales } from './configuration';\n\n/** A svelte-i18n `locale` store: writable, nullable. */\nexport type LocaleStore = Readable<string | null | undefined> & {\n set: (locale: string | null | undefined) => void;\n update: (\n updater: (locale: string | null | undefined) => string | null | undefined\n ) => void;\n};\n\nconst currentLocale = derived(\n intlayerStore,\n ($store) => $store.locale as string\n);\n\nlet currentLocaleValue: string | null | undefined;\ncurrentLocale.subscribe((value) => {\n currentLocaleValue = value;\n});\n\n/**\n * `$locale` — backed by svelte-intlayer's store, so svelte-i18n call sites,\n * `useIntlayer` and `useLocale().setLocale` share one active locale.\n */\nexport const locale: LocaleStore = {\n subscribe: currentLocale.subscribe,\n set: (newLocale) => {\n // svelte-i18n allows clearing the locale; intlayer always has one.\n if (newLocale) intlayerStore.setLocale(newLocale as LocalesValues);\n },\n update: (updater) => {\n const newLocale = updater(currentLocaleValue);\n if (newLocale) intlayerStore.setLocale(newLocale as LocalesValues);\n },\n};\n\n/** `$locales` — the locales declared in the intlayer configuration. */\nexport const locales: Readable<string[]> = readable(configLocales);\n\n/**\n * `$isLoading` — always `false`: intlayer dictionaries are part of the bundle\n * (or preloaded per locale), so there is no pending catalog to wait for.\n */\nexport const isLoading = writable(false);\n"],"mappings":";;;;;AAaA,MAAM,gBAAgB,QACpB,gBACC,WAAW,OAAO,MACrB;AAEA,IAAI;AACJ,cAAc,WAAW,UAAU;CACjC,qBAAqB;AACvB,CAAC;;;;;AAMD,MAAa,SAAsB;CACjC,WAAW,cAAc;CACzB,MAAM,cAAc;EAElB,IAAI,WAAW,cAAc,UAAU,SAA0B;CACnE;CACA,SAAS,YAAY;EACnB,MAAM,YAAY,QAAQ,kBAAkB;EAC5C,IAAI,WAAW,cAAc,UAAU,SAA0B;CACnE;AACF;;AAGA,MAAa,UAA8B,SAAS,aAAa;;;;;AAMjE,MAAa,YAAY,SAAS,KAAK"}
1
+ {"version":3,"file":"locale.mjs","names":[],"sources":["../../src/locale.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { intlayerStore } from 'svelte-intlayer';\nimport { derived, type Readable, readable, writable } from 'svelte/store';\nimport { configLocales } from './configuration';\n\n/** A svelte-i18n `locale` store: writable, nullable. */\nexport type LocaleStore = Readable<string | null | undefined> & {\n set: (locale: string | null | undefined) => void;\n update: (\n updater: (locale: string | null | undefined) => string | null | undefined\n ) => void;\n};\n\nconst currentLocale = derived(\n intlayerStore,\n ($store) => $store.locale as string\n);\n\nlet currentLocaleValue: string | null | undefined;\ncurrentLocale.subscribe((value) => {\n currentLocaleValue = value;\n});\n\n/**\n * `$locale` — backed by svelte-intlayer's store, so svelte-i18n call sites,\n * `useIntlayer` and `useLocale().setLocale` share one active locale.\n */\nexport const locale: LocaleStore = {\n subscribe: currentLocale.subscribe,\n set: (newLocale) => {\n // svelte-i18n allows clearing the locale; intlayer always has one.\n if (newLocale) intlayerStore.setLocale(newLocale as LocalesValues);\n },\n update: (updater) => {\n const newLocale = updater(currentLocaleValue);\n if (newLocale) intlayerStore.setLocale(newLocale as LocalesValues);\n },\n};\n\n/** `$locales` — the locales declared in the intlayer configuration. */\nexport const locales: Readable<string[]> = readable(configLocales);\n\n/**\n * `$isLoading` — always `false`: intlayer dictionaries are part of the bundle\n * (or preloaded per locale), so there is no pending catalog to wait for.\n */\nexport const isLoading = writable(false);\n"],"mappings":";;;;;AAaA,MAAM,gBAAgB,QACpB,gBACC,WAAW,OAAO,MACrB;AAEA,IAAI;AACJ,cAAc,WAAW,UAAU;CACjC,qBAAqB;AACvB,CAAC;;;;;AAMD,MAAa,SAAsB;CACjC,WAAW,cAAc;CACzB,MAAM,cAAc;EAElB,IAAI,WAAW,cAAc,UAAU,SAA0B;CACnE;CACA,SAAS,YAAY;EACnB,MAAM,YAAY,QAAQ,kBAAkB;EAC5C,IAAI,WAAW,cAAc,UAAU,SAA0B;CACnE;AACF;;AAGA,MAAa,UAA8B,SAAS,aAAa;;;;;AAMjE,MAAa,YAAY,SAAS,KAAK"}
package/package.json CHANGED
@@ -1,24 +1,20 @@
1
1
  {
2
2
  "name": "@intlayer/svelte-i18n",
3
- "version": "9.7.1",
3
+ "version": "9.7.2",
4
4
  "private": false,
5
5
  "description": "svelte-i18n API adapter for intlayer — drop-in compatibility layer",
6
6
  "keywords": [
7
+ "adapter",
8
+ "compatibility",
9
+ "i18n",
7
10
  "intlayer",
8
- "svelte-i18n",
9
11
  "svelte",
10
- "i18n",
11
- "adapter",
12
- "compatibility"
12
+ "svelte-i18n"
13
13
  ],
14
14
  "homepage": "https://intlayer.org",
15
15
  "bugs": {
16
16
  "url": "https://github.com/aymericzip/intlayer/issues"
17
17
  },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/aymericzip/intlayer.git"
21
- },
22
18
  "license": "Apache-2.0",
23
19
  "author": {
24
20
  "name": "Aymeric PINEAU",
@@ -31,7 +27,18 @@
31
27
  "url": "https://github.com/aymericzip"
32
28
  }
33
29
  ],
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/aymericzip/intlayer.git"
33
+ },
34
+ "files": [
35
+ "./dist",
36
+ "./package.json"
37
+ ],
34
38
  "sideEffects": false,
39
+ "main": "dist/esm/index.mjs",
40
+ "module": "dist/esm/index.mjs",
41
+ "types": "dist/types/index.d.ts",
35
42
  "exports": {
36
43
  ".": {
37
44
  "types": "./dist/types/index.d.ts",
@@ -43,22 +50,15 @@
43
50
  },
44
51
  "./package.json": "./package.json"
45
52
  },
46
- "main": "dist/esm/index.mjs",
47
- "module": "dist/esm/index.mjs",
48
- "types": "dist/types/index.d.ts",
49
- "files": [
50
- "./dist",
51
- "./package.json"
52
- ],
53
53
  "scripts": {
54
54
  "build": "bun --bun tsdown --config tsdown.config.ts",
55
55
  "build:ci": "bun --bun tsdown --config tsdown.config.ts",
56
56
  "clean": "bun --bun rimraf ./dist .turbo",
57
57
  "dev": "bun --bun tsdown --config tsdown.config.ts --watch",
58
- "format": "bun --bun biome format . --check",
59
- "format:fix": "bun --bun biome format --write .",
60
- "lint": "bun --bun biome lint .",
61
- "lint:fix": "bun --bun biome lint --write .",
58
+ "format": "oxfmt --check .",
59
+ "format:fix": "oxfmt .",
60
+ "lint": "oxlint .",
61
+ "lint:fix": "oxlint --fix .",
62
62
  "prepublish": "cp -f ../../README.md ./README.md",
63
63
  "publish": "bun publish || true",
64
64
  "publish:canary": "bun publish --access public --tag canary || true",
@@ -69,25 +69,25 @@
69
69
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
70
70
  },
71
71
  "dependencies": {
72
- "@intlayer/config": "9.7.1",
73
- "@intlayer/core": "9.7.1",
74
- "@intlayer/dictionaries-entry": "9.7.1",
75
- "@intlayer/engine": "9.7.1",
76
- "@intlayer/types": "9.7.1",
77
- "svelte-intlayer": "9.7.1",
78
- "vite-intlayer": "9.7.1"
72
+ "@intlayer/config": "9.7.2",
73
+ "@intlayer/core": "9.7.2",
74
+ "@intlayer/dictionaries-entry": "9.7.2",
75
+ "@intlayer/engine": "9.7.2",
76
+ "@intlayer/types": "9.7.2",
77
+ "svelte-intlayer": "9.7.2",
78
+ "vite-intlayer": "9.7.2"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/node": "^26",
82
82
  "@utils/ts-config": "1.0.4",
83
83
  "@utils/ts-config-types": "1.0.4",
84
84
  "@utils/tsdown-config": "1.0.4",
85
- "rimraf": "6.1.3",
85
+ "rimraf": "6.1.4",
86
86
  "svelte": "5.57.3",
87
87
  "svelte-i18n": "^4.0.1",
88
- "tsdown": "0.23.4",
88
+ "tsdown": "0.23.7",
89
89
  "typescript": "7.0.2",
90
- "vite": "8.3.5",
90
+ "vite": "8.3.7",
91
91
  "vitest": "5.1.0"
92
92
  },
93
93
  "peerDependencies": {