preact-intlayer 6.0.0-canary.2 → 6.0.0

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,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () => (await dictionaryPromise[localeTarget]!()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0B;AAG1B,mBAAoC;AACpC,8BAAsC;AACtC,2BAA8B;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACe;AACf,QAAM,EAAE,QAAQ,cAAc,QAAI,yBAAW,6CAAqB;AAElE,QAAM,mBAAe;AAAA,IACnB,MACE,UACA,iBACA,aAAAA,SAAe,qBAAqB;AAAA,IACtC,CAAC,eAAe,MAAM;AAAA,EACxB;AAEA,QAAM,aAAa,UAAM;AAAA,IACvB,YAAa,MAAM,kBAAkB,YAAY,EAAG;AAAA,IACpD,CAAC,mBAAmB,YAAY;AAAA,EAClC;AAEA,aAAO,oCAAc,YAAY,YAAY;AAC/C;","names":["configuration"]}
1
+ {"version":3,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () =>\n (await dictionaryPromise[\n localeTarget as keyof typeof dictionaryPromise\n ]!()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0B;AAG1B,mBAAoC;AACpC,8BAAsC;AACtC,2BAA8B;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACe;AACf,QAAM,EAAE,QAAQ,cAAc,QAAI,yBAAW,6CAAqB;AAElE,QAAM,mBAAe;AAAA,IACnB,MACE,UACA,iBACA,aAAAA,SAAe,qBAAqB;AAAA,IACtC,CAAC,eAAe,MAAM;AAAA,EACxB;AAEA,QAAM,aAAa,UAAM;AAAA,IACvB,YACG,MAAM,kBACL,YACF,EAAG;AAAA,IACL,CAAC,mBAAmB,YAAY;AAAA,EAClC;AAEA,aAAO,oCAAc,YAAY,YAAY;AAC/C;","names":["configuration"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () => (await dictionaryPromise[localeTarget]!()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":";AAEA,OAAO,mBAAmB;AAG1B,SAAS,YAAY,eAAe;AACpC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACe;AACf,QAAM,EAAE,QAAQ,cAAc,IAAI,WAAW,qBAAqB;AAElE,QAAM,eAAe;AAAA,IACnB,MACE,UACA,iBACA,eAAe,qBAAqB;AAAA,IACtC,CAAC,eAAe,MAAM;AAAA,EACxB;AAEA,QAAM,aAAa,MAAM;AAAA,IACvB,YAAa,MAAM,kBAAkB,YAAY,EAAG;AAAA,IACpD,CAAC,mBAAmB,YAAY;AAAA,EAClC;AAEA,SAAO,cAAc,YAAY,YAAY;AAC/C;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () =>\n (await dictionaryPromise[\n localeTarget as keyof typeof dictionaryPromise\n ]!()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":";AAEA,OAAO,mBAAmB;AAG1B,SAAS,YAAY,eAAe;AACpC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACe;AACf,QAAM,EAAE,QAAQ,cAAc,IAAI,WAAW,qBAAqB;AAElE,QAAM,eAAe;AAAA,IACnB,MACE,UACA,iBACA,eAAe,qBAAqB;AAAA,IACtC,CAAC,eAAe,MAAM;AAAA,EACxB;AAEA,QAAM,aAAa,MAAM;AAAA,IACvB,YACG,MAAM,kBACL,YACF,EAAG;AAAA,IACL,CAAC,mBAAmB,YAAY;AAAA,EAClC;AAEA,SAAO,cAAc,YAAY,YAAY;AAC/C;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryAsync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,SAAS,UAAU,EAC3D,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,aAAa,KACrB,OAAO,CAAC,CAAC,CAiBX,CAAC"}
1
+ {"version":3,"file":"useDictionaryAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryAsync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,SAAS,UAAU,EAC3D,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,aAAa,KACrB,OAAO,CAAC,CAAC,CAoBX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preact-intlayer",
3
- "version": "6.0.0-canary.2",
3
+ "version": "6.0.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -63,11 +63,11 @@
63
63
  "dependencies": {
64
64
  "js-cookie": "^3.0.5",
65
65
  "uuid": "^11.1.0",
66
- "@intlayer/chokidar": "6.0.0-canary.2",
67
- "@intlayer/api": "6.0.0-canary.2",
68
- "@intlayer/config": "6.0.0-canary.2",
69
- "@intlayer/core": "6.0.0-canary.2",
70
- "@intlayer/editor": "6.0.0-canary.2"
66
+ "@intlayer/api": "6.0.0",
67
+ "@intlayer/editor": "6.0.0",
68
+ "@intlayer/chokidar": "6.0.0",
69
+ "@intlayer/core": "6.0.0",
70
+ "@intlayer/config": "6.0.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": "^24.2.1",
@@ -81,18 +81,18 @@
81
81
  "tsup": "^8.5.0",
82
82
  "typescript": "^5.9.2",
83
83
  "vitest": "^3.2.4",
84
- "@utils/eslint-config": "1.0.4",
85
- "@utils/ts-config-types": "1.0.4",
86
84
  "@utils/ts-config": "1.0.4",
87
- "@utils/tsup-config": "1.0.4"
85
+ "@utils/ts-config-types": "1.0.4",
86
+ "@utils/tsup-config": "1.0.4",
87
+ "@utils/eslint-config": "1.0.4"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "preact": "^10.26.4",
91
- "@intlayer/config": "6.0.0-canary.2",
92
- "@intlayer/api": "6.0.0-canary.2",
93
- "@intlayer/editor": "6.0.0-canary.2",
94
- "@intlayer/chokidar": "6.0.0-canary.2",
95
- "@intlayer/core": "6.0.0-canary.2"
91
+ "@intlayer/api": "6.0.0",
92
+ "@intlayer/chokidar": "6.0.0",
93
+ "@intlayer/config": "6.0.0",
94
+ "@intlayer/editor": "6.0.0",
95
+ "@intlayer/core": "6.0.0"
96
96
  },
97
97
  "engines": {
98
98
  "node": ">=14.18"