react-intlayer 6.0.0-canary.3 → 6.0.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.
@@ -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 'react';\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<T>(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,oCAAiB,YAAY,YAAY;AAClD;","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 'react';\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<T>(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,oCAAiB,YAAY,YAAY;AAClD;","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 'react';\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<T>(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,cAAiB,YAAY,YAAY;AAClD;","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 'react';\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<T>(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,cAAiB,YAAY,YAAY;AAClD;","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": "react-intlayer",
3
- "version": "6.0.0-canary.3",
3
+ "version": "6.0.1",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -79,11 +79,11 @@
79
79
  ],
80
80
  "dependencies": {
81
81
  "js-cookie": "^3.0.5",
82
- "@intlayer/config": "6.0.0-canary.3",
83
- "@intlayer/api": "6.0.0-canary.3",
84
- "@intlayer/core": "6.0.0-canary.3",
85
- "@intlayer/editor-react": "6.0.0-canary.3",
86
- "@intlayer/dictionaries-entry": "6.0.0-canary.3"
82
+ "@intlayer/config": "6.0.1",
83
+ "@intlayer/core": "6.0.1",
84
+ "@intlayer/api": "6.0.1",
85
+ "@intlayer/editor-react": "6.0.1",
86
+ "@intlayer/dictionaries-entry": "6.0.1"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@craco/types": "^7.1.0",
@@ -104,18 +104,18 @@
104
104
  "@utils/eslint-config": "1.0.4",
105
105
  "@utils/ts-config": "1.0.4",
106
106
  "@utils/ts-config-types": "1.0.4",
107
- "@utils/tsup-config": "1.0.4",
108
- "intlayer": "6.0.0-canary.3"
107
+ "intlayer": "6.0.1",
108
+ "@utils/tsup-config": "1.0.4"
109
109
  },
110
110
  "peerDependencies": {
111
111
  "react": ">=16.0.0",
112
112
  "react-dom": ">=16.0.0",
113
- "@intlayer/api": "6.0.0-canary.3",
114
- "@intlayer/core": "6.0.0-canary.3",
115
- "intlayer": "6.0.0-canary.3",
116
- "@intlayer/editor-react": "6.0.0-canary.3",
117
- "@intlayer/dictionaries-entry": "6.0.0-canary.3",
118
- "@intlayer/config": "6.0.0-canary.3"
113
+ "@intlayer/api": "6.0.1",
114
+ "@intlayer/config": "6.0.1",
115
+ "@intlayer/dictionaries-entry": "6.0.1",
116
+ "@intlayer/core": "6.0.1",
117
+ "intlayer": "6.0.1",
118
+ "@intlayer/editor-react": "6.0.1"
119
119
  },
120
120
  "engines": {
121
121
  "node": ">=14.18"