react-intlayer 1.0.0 → 1.2.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.
Files changed (169) hide show
  1. package/dist/cjs/ContentEditor/ContentEditor.cjs +36 -39
  2. package/dist/cjs/ContentEditor/ContentEditor.d.ts +2 -2
  3. package/dist/cjs/ContentEditor/contentRender.cjs +10 -18
  4. package/dist/cjs/ContentEditor/index.cjs +11 -27
  5. package/dist/cjs/ContentEditor/index.d.ts +3 -3
  6. package/dist/cjs/IntlayerProvider.cjs +37 -0
  7. package/dist/cjs/IntlayerProvider.cjs.map +1 -0
  8. package/dist/cjs/IntlayerProvider.d.ts +9 -0
  9. package/dist/cjs/client/IntlayerClientProvider.cjs +45 -0
  10. package/dist/cjs/client/IntlayerClientProvider.cjs.map +1 -0
  11. package/dist/cjs/client/IntlayerClientProvider.d.ts +24 -0
  12. package/dist/cjs/client/index.cjs +24 -31
  13. package/dist/cjs/client/index.cjs.map +1 -1
  14. package/dist/cjs/client/index.d.ts +10 -19
  15. package/dist/cjs/client/useContent.cjs +11 -16
  16. package/dist/cjs/client/useContent.cjs.map +1 -1
  17. package/dist/cjs/client/useContent.d.ts +10 -8
  18. package/dist/cjs/client/useIntlayer.cjs +11 -18
  19. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  20. package/dist/cjs/client/useIntlayer.d.ts +8 -3
  21. package/dist/cjs/client/useLocale.cjs +12 -20
  22. package/dist/cjs/client/useLocale.cjs.map +1 -1
  23. package/dist/cjs/client/useLocale.d.ts +8 -5
  24. package/dist/cjs/client/useLocaleCookie.cjs +20 -30
  25. package/dist/cjs/client/useLocaleCookie.cjs.map +1 -1
  26. package/dist/cjs/client/useLocaleCookie.d.ts +12 -3
  27. package/dist/cjs/client/useTraduction.cjs +11 -18
  28. package/dist/cjs/client/useTraduction.cjs.map +1 -1
  29. package/dist/cjs/client/useTraduction.d.ts +22 -4
  30. package/dist/cjs/getEnumeration.cjs +9 -14
  31. package/dist/cjs/getEnumeration.cjs.map +1 -1
  32. package/dist/cjs/getEnumeration.d.ts +27 -5
  33. package/dist/cjs/getTranslation.cjs +9 -14
  34. package/dist/cjs/getTranslation.cjs.map +1 -1
  35. package/dist/cjs/getTranslation.d.ts +23 -6
  36. package/dist/cjs/index.cjs +20 -27
  37. package/dist/cjs/index.cjs.map +1 -1
  38. package/dist/cjs/index.d.ts +11 -20
  39. package/dist/cjs/processDictionary/contentDictionary.d.cjs +4 -8
  40. package/dist/cjs/processDictionary/contentDictionary.d.d.ts +6 -9
  41. package/dist/cjs/processDictionary/index.cjs +15 -17
  42. package/dist/cjs/processDictionary/index.cjs.map +1 -1
  43. package/dist/cjs/processDictionary/index.d.ts +6 -17
  44. package/dist/cjs/server/IntlayerServerProvider.cjs +46 -0
  45. package/dist/cjs/server/IntlayerServerProvider.cjs.map +1 -0
  46. package/dist/cjs/server/IntlayerServerProvider.d.ts +37 -0
  47. package/dist/cjs/server/getLocaleTranslation.cjs +12 -19
  48. package/dist/cjs/server/getLocaleTranslation.cjs.map +1 -1
  49. package/dist/cjs/server/getLocaleTranslation.d.ts +8 -7
  50. package/dist/cjs/server/index.cjs +20 -27
  51. package/dist/cjs/server/index.cjs.map +1 -1
  52. package/dist/cjs/server/index.d.ts +9 -13
  53. package/dist/cjs/server/serverContext.cjs +25 -31
  54. package/dist/cjs/server/serverContext.cjs.map +1 -1
  55. package/dist/cjs/server/serverContext.d.ts +16 -24
  56. package/dist/cjs/server/useIntlayer.cjs +12 -21
  57. package/dist/cjs/server/useIntlayer.cjs.map +1 -1
  58. package/dist/cjs/server/useIntlayer.d.ts +8 -3
  59. package/dist/cjs/server/useTraduction.cjs +12 -19
  60. package/dist/cjs/server/useTraduction.cjs.map +1 -1
  61. package/dist/cjs/server/useTraduction.d.ts +22 -4
  62. package/dist/cjs/useIntlayerBase.cjs +22 -31
  63. package/dist/cjs/useIntlayerBase.cjs.map +1 -1
  64. package/dist/cjs/useIntlayerBase.d.ts +7 -18
  65. package/dist/esm/ContentEditor/ContentEditor.d.mts +2 -2
  66. package/dist/esm/ContentEditor/ContentEditor.mjs +38 -29
  67. package/dist/esm/ContentEditor/contentRender.mjs +5 -3
  68. package/dist/esm/ContentEditor/index.d.mts +3 -3
  69. package/dist/esm/ContentEditor/index.mjs +3 -3
  70. package/dist/esm/IntlayerProvider.d.mts +9 -0
  71. package/dist/esm/IntlayerProvider.mjs +17 -0
  72. package/dist/esm/IntlayerProvider.mjs.map +1 -0
  73. package/dist/esm/client/IntlayerClientProvider.d.mts +24 -0
  74. package/dist/esm/client/IntlayerClientProvider.mjs +24 -0
  75. package/dist/esm/client/IntlayerClientProvider.mjs.map +1 -0
  76. package/dist/esm/client/index.d.mts +10 -19
  77. package/dist/esm/client/index.mjs +14 -14
  78. package/dist/esm/client/index.mjs.map +1 -1
  79. package/dist/esm/client/useContent.d.mts +10 -8
  80. package/dist/esm/client/useContent.mjs +7 -5
  81. package/dist/esm/client/useContent.mjs.map +1 -1
  82. package/dist/esm/client/useIntlayer.d.mts +8 -3
  83. package/dist/esm/client/useIntlayer.mjs +9 -5
  84. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  85. package/dist/esm/client/useLocale.d.mts +8 -5
  86. package/dist/esm/client/useLocale.mjs +7 -5
  87. package/dist/esm/client/useLocale.mjs.map +1 -1
  88. package/dist/esm/client/useLocaleCookie.d.mts +12 -3
  89. package/dist/esm/client/useLocaleCookie.mjs +11 -5
  90. package/dist/esm/client/useLocaleCookie.mjs.map +1 -1
  91. package/dist/esm/client/useTraduction.d.mts +22 -4
  92. package/dist/esm/client/useTraduction.mjs +7 -5
  93. package/dist/esm/client/useTraduction.mjs.map +1 -1
  94. package/dist/esm/getEnumeration.d.mts +27 -5
  95. package/dist/esm/getEnumeration.mjs +9 -4
  96. package/dist/esm/getEnumeration.mjs.map +1 -1
  97. package/dist/esm/getTranslation.d.mts +23 -6
  98. package/dist/esm/getTranslation.mjs +8 -4
  99. package/dist/esm/getTranslation.mjs.map +1 -1
  100. package/dist/esm/index.d.mts +11 -20
  101. package/dist/esm/index.mjs +9 -11
  102. package/dist/esm/index.mjs.map +1 -1
  103. package/dist/esm/processDictionary/contentDictionary.d.d.mts +6 -9
  104. package/dist/esm/processDictionary/contentDictionary.d.mjs +1 -1
  105. package/dist/esm/processDictionary/index.d.mts +6 -17
  106. package/dist/esm/processDictionary/index.mjs +25 -9
  107. package/dist/esm/processDictionary/index.mjs.map +1 -1
  108. package/dist/esm/server/IntlayerServerProvider.d.mts +37 -0
  109. package/dist/esm/server/IntlayerServerProvider.mjs +21 -0
  110. package/dist/esm/server/IntlayerServerProvider.mjs.map +1 -0
  111. package/dist/esm/server/getLocaleTranslation.d.mts +8 -7
  112. package/dist/esm/server/getLocaleTranslation.mjs +8 -6
  113. package/dist/esm/server/getLocaleTranslation.mjs.map +1 -1
  114. package/dist/esm/server/index.d.mts +9 -13
  115. package/dist/esm/server/index.mjs +10 -10
  116. package/dist/esm/server/index.mjs.map +1 -1
  117. package/dist/esm/server/serverContext.d.mts +16 -24
  118. package/dist/esm/server/serverContext.mjs +13 -6
  119. package/dist/esm/server/serverContext.mjs.map +1 -1
  120. package/dist/esm/server/useIntlayer.d.mts +8 -3
  121. package/dist/esm/server/useIntlayer.mjs +10 -6
  122. package/dist/esm/server/useIntlayer.mjs.map +1 -1
  123. package/dist/esm/server/useTraduction.d.mts +22 -4
  124. package/dist/esm/server/useTraduction.mjs +8 -6
  125. package/dist/esm/server/useTraduction.mjs.map +1 -1
  126. package/dist/esm/useIntlayerBase.d.mts +7 -18
  127. package/dist/esm/useIntlayerBase.mjs +9 -4
  128. package/dist/esm/useIntlayerBase.mjs.map +1 -1
  129. package/package.json +10 -10
  130. package/src/IntlayerProvider.tsx +24 -0
  131. package/src/client/IntlayerClientProvider.tsx +45 -0
  132. package/src/client/index.ts +5 -5
  133. package/src/client/useContent.ts +3 -0
  134. package/src/client/useIntlayer.ts +7 -2
  135. package/src/client/useLocale.ts +5 -2
  136. package/src/client/useLocaleCookie.ts +9 -1
  137. package/src/client/useTraduction.ts +23 -3
  138. package/src/getEnumeration.ts +25 -0
  139. package/src/getTranslation.ts +21 -1
  140. package/src/index.ts +3 -4
  141. package/src/processDictionary/index.ts +1 -1
  142. package/src/server/IntlayerServerProvider.tsx +39 -0
  143. package/src/server/getLocaleTranslation.ts +5 -2
  144. package/src/server/index.ts +3 -3
  145. package/src/server/serverContext.ts +4 -4
  146. package/src/server/useIntlayer.ts +8 -2
  147. package/src/server/useTraduction.ts +23 -3
  148. package/src/useIntlayerBase.ts +4 -1
  149. package/dist/cjs/LocaleContextProvider.cjs +0 -49
  150. package/dist/cjs/LocaleContextProvider.cjs.map +0 -1
  151. package/dist/cjs/LocaleContextProvider.d.ts +0 -10
  152. package/dist/cjs/client/LocaleClientContextProvider.cjs +0 -54
  153. package/dist/cjs/client/LocaleClientContextProvider.cjs.map +0 -1
  154. package/dist/cjs/client/LocaleClientContextProvider.d.ts +0 -20
  155. package/dist/cjs/server/LocaleServerContextProvider.cjs +0 -49
  156. package/dist/cjs/server/LocaleServerContextProvider.cjs.map +0 -1
  157. package/dist/cjs/server/LocaleServerContextProvider.d.ts +0 -34
  158. package/dist/esm/LocaleContextProvider.d.mts +0 -10
  159. package/dist/esm/LocaleContextProvider.mjs +0 -15
  160. package/dist/esm/LocaleContextProvider.mjs.map +0 -1
  161. package/dist/esm/client/LocaleClientContextProvider.d.mts +0 -20
  162. package/dist/esm/client/LocaleClientContextProvider.mjs +0 -16
  163. package/dist/esm/client/LocaleClientContextProvider.mjs.map +0 -1
  164. package/dist/esm/server/LocaleServerContextProvider.d.mts +0 -34
  165. package/dist/esm/server/LocaleServerContextProvider.mjs +0 -14
  166. package/dist/esm/server/LocaleServerContextProvider.mjs.map +0 -1
  167. package/src/LocaleContextProvider.tsx +0 -26
  168. package/src/client/LocaleClientContextProvider.tsx +0 -35
  169. package/src/server/LocaleServerContextProvider.tsx +0 -24
@@ -9,33 +9,26 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if ((from && typeof from === "object") || typeof from === "function") {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
13
  for (let key of __getOwnPropNames(from))
14
14
  if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
18
- });
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
16
  }
20
17
  return to;
21
18
  };
22
- var __toCommonJS = (mod) =>
23
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
20
  var useLocale_exports = {};
25
21
  __export(useLocale_exports, {
26
- useLocale: () => useLocale,
22
+ useLocale: () => useLocale
27
23
  });
28
24
  module.exports = __toCommonJS(useLocale_exports);
29
25
  var import_client = require("@intlayer/config/client");
30
26
  var import_core = require("@intlayer/core");
31
27
  var import_react = require("react");
32
- var import_LocaleClientContextProvider = require("./LocaleClientContextProvider.cjs");
33
- const { defaultLocale, locales: availableLocales } =
34
- import_client.intlayerIntlConfiguration;
28
+ var import_IntlayerClientProvider = require('./IntlayerClientProvider.cjs');
29
+ const { defaultLocale, locales: availableLocales } = import_client.intlayerIntlConfiguration;
35
30
  const useLocale = () => {
36
- const { locale } = (0, import_react.useContext)(
37
- import_LocaleClientContextProvider.LocaleClientContext
38
- );
31
+ const { locale } = (0, import_react.useContext)(import_IntlayerClientProvider.IntlayerClientContext);
39
32
  return {
40
33
  locale,
41
34
  // Current locale
@@ -43,13 +36,12 @@ const useLocale = () => {
43
36
  // Principal locale defined in config
44
37
  availableLocales,
45
38
  // List of the available locales defined in config
46
- localeList: import_core.localeList,
39
+ localeList: import_core.localeList
47
40
  // List of all available locales
48
41
  };
49
42
  };
50
43
  // Annotate the CommonJS export names for ESM import in node:
51
- 0 &&
52
- (module.exports = {
53
- useLocale,
54
- });
55
- //# sourceMappingURL=useLocale.cjs.map
44
+ 0 && (module.exports = {
45
+ useLocale
46
+ });
47
+ //# sourceMappingURL=useLocale.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { intlayerIntlConfiguration } from '@intlayer/config/client';\nimport { localeList } from '@intlayer/core';\nimport { useContext } from 'react';\nimport { LocaleClientContext } from './LocaleClientContextProvider';\n\nconst { defaultLocale, locales: availableLocales } = intlayerIntlConfiguration;\n\nexport const useLocale = () => {\n const { locale } = useContext(LocaleClientContext);\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n localeList, // List of all available locales\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA0C;AAC1C,kBAA2B;AAC3B,mBAA2B;AAC3B,yCAAoC;AAEpC,MAAM,EAAE,eAAe,SAAS,iBAAiB,IAAI;AAE9C,MAAM,YAAY,MAAM;AAC7B,QAAM,EAAE,OAAO,QAAI,yBAAW,sDAAmB;AAEjD,SAAO;AAAA,IACL;AAAA;AAAA,IACA;AAAA;AAAA,IACA;AAAA;AAAA,IACA;AAAA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { intlayerIntlConfiguration } from '@intlayer/config/client';\nimport { localeList } from '@intlayer/core';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerClientProvider';\n\nconst { defaultLocale, locales: availableLocales } = intlayerIntlConfiguration;\n\n/**\n * On the client side, hook to get the current locale and all related fields\n */\nexport const useLocale = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n localeList, // List of all available locales\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA0C;AAC1C,kBAA2B;AAC3B,mBAA2B;AAC3B,oCAAsC;AAEtC,MAAM,EAAE,eAAe,SAAS,iBAAiB,IAAI;AAK9C,MAAM,YAAY,MAAM;AAC7B,QAAM,EAAE,OAAO,QAAI,yBAAW,mDAAqB;AAEnD,SAAO;AAAA,IACL;AAAA;AAAA,IACA;AAAA;AAAA,IACA;AAAA;AAAA,IACA;AAAA;AAAA,EACF;AACF;","names":[]}
@@ -1,10 +1,13 @@
1
- import * as _intlayer_config_client from "@intlayer/config/client";
1
+ import * as _intlayer_config_client from '@intlayer/config/client';
2
2
 
3
+ /**
4
+ * On the client side, hook to get the current locale and all related fields
5
+ */
3
6
  declare const useLocale: () => {
4
- locale: _intlayer_config_client.Locales;
5
- defaultLocale: _intlayer_config_client.Locales;
6
- availableLocales: _intlayer_config_client.Locales[];
7
- localeList: _intlayer_config_client.Locales[];
7
+ locale: _intlayer_config_client.Locales;
8
+ defaultLocale: _intlayer_config_client.Locales;
9
+ availableLocales: _intlayer_config_client.Locales[];
10
+ localeList: _intlayer_config_client.Locales[];
8
11
  };
9
12
 
10
13
  export { useLocale };
@@ -10,36 +10,27 @@ var __export = (target, all) => {
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
12
  var __copyProps = (to, from, except, desc) => {
13
- if ((from && typeof from === "object") || typeof from === "function") {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
14
  for (let key of __getOwnPropNames(from))
15
15
  if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, {
17
- get: () => from[key],
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
19
- });
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
17
  }
21
18
  return to;
22
19
  };
23
- var __toESM = (mod, isNodeMode, target) => (
24
- (target = mod != null ? __create(__getProtoOf(mod)) : {}),
25
- __copyProps(
26
- // If the importer is in node compatibility mode or this is not an ESM
27
- // file that has been converted to a CommonJS file using a Babel-
28
- // compatible transform (i.e. "__esModule" has not been set), then set
29
- // "default" to the CommonJS "module.exports" for node compatibility.
30
- isNodeMode || !mod || !mod.__esModule
31
- ? __defProp(target, "default", { value: mod, enumerable: true })
32
- : target,
33
- mod
34
- )
35
- );
36
- var __toCommonJS = (mod) =>
37
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
29
  var useLocaleCookie_exports = {};
39
30
  __export(useLocaleCookie_exports, {
40
31
  localeCookie: () => localeCookie,
41
32
  setLocaleCookie: () => setLocaleCookie,
42
- useLocaleCookie: () => useLocaleCookie,
33
+ useLocaleCookie: () => useLocaleCookie
43
34
  });
44
35
  module.exports = __toCommonJS(useLocaleCookie_exports);
45
36
  var import_client = require("@intlayer/config/client");
@@ -50,7 +41,7 @@ const cookieAttributes = {
50
41
  expires: void 0,
51
42
  domain: void 0,
52
43
  secure: false,
53
- sameSite: "strict",
44
+ sameSite: "strict"
54
45
  };
55
46
  const localeCookie = import_js_cookie.default.get(cookieName);
56
47
  const setLocaleCookie = (locale) => {
@@ -58,13 +49,12 @@ const setLocaleCookie = (locale) => {
58
49
  };
59
50
  const useLocaleCookie = () => ({
60
51
  localeCookie,
61
- setLocaleCookie,
52
+ setLocaleCookie
62
53
  });
63
54
  // Annotate the CommonJS export names for ESM import in node:
64
- 0 &&
65
- (module.exports = {
66
- localeCookie,
67
- setLocaleCookie,
68
- useLocaleCookie,
69
- });
70
- //# sourceMappingURL=useLocaleCookie.cjs.map
55
+ 0 && (module.exports = {
56
+ localeCookie,
57
+ setLocaleCookie,
58
+ useLocaleCookie
59
+ });
60
+ //# sourceMappingURL=useLocaleCookie.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/useLocaleCookie.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport {\n type Locales,\n intlayerMiddlewareConfiguration,\n} from '@intlayer/config/client';\nimport Cookies from 'js-cookie';\n\nconst { cookieName } = intlayerMiddlewareConfiguration;\n\nconst cookieAttributes: Cookies.CookieAttributes = {\n path: '/',\n expires: undefined,\n domain: undefined,\n secure: false,\n sameSite: 'strict',\n};\n\nexport const localeCookie = Cookies.get(cookieName) as Locales | undefined;\n\nexport const setLocaleCookie = (locale: Locales) => {\n Cookies.set(cookieName, locale, cookieAttributes);\n};\n\nexport const useLocaleCookie = () => ({\n localeCookie,\n setLocaleCookie,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAGO;AACP,uBAAoB;AAEpB,MAAM,EAAE,WAAW,IAAI;AAEvB,MAAM,mBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAEO,MAAM,eAAe,iBAAAA,QAAQ,IAAI,UAAU;AAE3C,MAAM,kBAAkB,CAAC,WAAoB;AAClD,mBAAAA,QAAQ,IAAI,YAAY,QAAQ,gBAAgB;AAClD;AAEO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AACF;","names":["Cookies"]}
1
+ {"version":3,"sources":["../../../src/client/useLocaleCookie.ts"],"sourcesContent":["import {\n type Locales,\n intlayerMiddlewareConfiguration,\n} from '@intlayer/config/client';\nimport Cookies from 'js-cookie';\n\nconst { cookieName } = intlayerMiddlewareConfiguration;\n\nconst cookieAttributes: Cookies.CookieAttributes = {\n path: '/',\n expires: undefined,\n domain: undefined,\n secure: false,\n sameSite: 'strict',\n};\n\n/**\n * Get the locale cookie\n */\nexport const localeCookie = Cookies.get(cookieName) as Locales | undefined;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleCookie = (locale: Locales) => {\n Cookies.set(cookieName, locale, cookieAttributes);\n};\n\n/**\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = () => ({\n localeCookie,\n setLocaleCookie,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AACP,uBAAoB;AAEpB,MAAM,EAAE,WAAW,IAAI;AAEvB,MAAM,mBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAKO,MAAM,eAAe,iBAAAA,QAAQ,IAAI,UAAU;AAK3C,MAAM,kBAAkB,CAAC,WAAoB;AAClD,mBAAAA,QAAQ,IAAI,YAAY,QAAQ,gBAAgB;AAClD;AAKO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AACF;","names":["Cookies"]}
@@ -1,10 +1,19 @@
1
- import { Locales } from "@intlayer/config/client";
1
+ import { Locales } from '@intlayer/config/client';
2
2
 
3
+ /**
4
+ * Get the locale cookie
5
+ */
3
6
  declare const localeCookie: Locales | undefined;
7
+ /**
8
+ * Set the locale cookie
9
+ */
4
10
  declare const setLocaleCookie: (locale: Locales) => void;
11
+ /**
12
+ * Hook that provides the locale cookie and a function to set it
13
+ */
5
14
  declare const useLocaleCookie: () => {
6
- localeCookie: Locales | undefined;
7
- setLocaleCookie: (locale: Locales) => void;
15
+ localeCookie: Locales | undefined;
16
+ setLocaleCookie: (locale: Locales) => void;
8
17
  };
9
18
 
10
19
  export { localeCookie, setLocaleCookie, useLocaleCookie };
@@ -8,35 +8,28 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if ((from && typeof from === "object") || typeof from === "function") {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
- });
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
19
16
  return to;
20
17
  };
21
- var __toCommonJS = (mod) =>
22
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
19
  var useTraduction_exports = {};
24
20
  __export(useTraduction_exports, {
25
- useTraduction: () => useTraduction,
21
+ useTraduction: () => useTraduction
26
22
  });
27
23
  module.exports = __toCommonJS(useTraduction_exports);
28
24
  var import_react = require("react");
29
- var import_getTranslation = require("../getTranslation.cjs");
30
- var import_LocaleClientContextProvider = require("./LocaleClientContextProvider.cjs");
25
+ var import_getTranslation = require('../getTranslation.cjs');
26
+ var import_IntlayerClientProvider = require('./IntlayerClientProvider.cjs');
31
27
  const useTraduction = (languageContent) => {
32
- const { locale } = (0, import_react.useContext)(
33
- import_LocaleClientContextProvider.LocaleClientContext
34
- );
28
+ const { locale } = (0, import_react.useContext)(import_IntlayerClientProvider.IntlayerClientContext);
35
29
  return (0, import_getTranslation.getTranslation)(languageContent, locale);
36
30
  };
37
31
  // Annotate the CommonJS export names for ESM import in node:
38
- 0 &&
39
- (module.exports = {
40
- useTraduction,
41
- });
42
- //# sourceMappingURL=useTraduction.cjs.map
32
+ 0 && (module.exports = {
33
+ useTraduction
34
+ });
35
+ //# sourceMappingURL=useTraduction.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":["import type { LanguageContent } from '@intlayer/core';\nimport { useContext } from 'react';\nimport { getTranslation } from '../getTranslation';\nimport { LocaleClientContext } from './LocaleClientContextProvider';\n\nexport const useTraduction = <Content>(\n languageContent: LanguageContent<Content>\n): Content => {\n const { locale } = useContext(LocaleClientContext);\n\n return getTranslation(languageContent, locale);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA2B;AAC3B,4BAA+B;AAC/B,yCAAoC;AAE7B,MAAM,gBAAgB,CAC3B,oBACY;AACZ,QAAM,EAAE,OAAO,QAAI,yBAAW,sDAAmB;AAEjD,aAAO,sCAAe,iBAAiB,MAAM;AAC/C;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":["import type { LanguageContent } from '@intlayer/core';\nimport { useContext } from 'react';\nimport { getTranslation } from '../getTranslation';\nimport { IntlayerClientContext } from './IntlayerClientProvider';\n\n/**\n * On the client side, Hook that picking one dictionary by its id and return the content.\n *\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * const content = getTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * },\n * 'fr');\n * // 'Bonjour'\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const useTraduction = <Content = string>(\n languageContent: LanguageContent<Content>\n): Content => {\n const { locale } = useContext(IntlayerClientContext);\n\n return getTranslation(languageContent, locale);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA2B;AAC3B,4BAA+B;AAC/B,oCAAsC;AAsB/B,MAAM,gBAAgB,CAC3B,oBACY;AACZ,QAAM,EAAE,OAAO,QAAI,yBAAW,mDAAqB;AAEnD,aAAO,sCAAe,iBAAiB,MAAM;AAC/C;","names":[]}
@@ -1,7 +1,25 @@
1
- import { LanguageContent } from "@intlayer/core";
1
+ import { LanguageContent } from '@intlayer/core';
2
2
 
3
- declare const useTraduction: <Content>(
4
- languageContent: LanguageContent<Content>
5
- ) => Content;
3
+ /**
4
+ * On the client side, Hook that picking one dictionary by its id and return the content.
5
+ *
6
+ * If not locale found, it will return the content related to the default locale.
7
+ *
8
+ * Return either the content editor, or the content itself depending on the configuration.
9
+ *
10
+ * Usage:
11
+ *
12
+ * const content = getTranslation<string>({
13
+ * en: 'Hello',
14
+ * fr: 'Bonjour',
15
+ * },
16
+ * 'fr');
17
+ * // 'Bonjour'
18
+ *
19
+ * Using TypeScript:
20
+ * - this function will require each locale to be defined if defined in the project configuration.
21
+ * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
22
+ */
23
+ declare const useTraduction: <Content = string>(languageContent: LanguageContent<Content>) => Content;
6
24
 
7
25
  export { useTraduction };
@@ -8,25 +8,21 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if ((from && typeof from === "object") || typeof from === "function") {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
- });
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
19
16
  return to;
20
17
  };
21
- var __toCommonJS = (mod) =>
22
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
19
  var getEnumeration_exports = {};
24
20
  __export(getEnumeration_exports, {
25
- getEnumeration: () => getEnumeration,
21
+ getEnumeration: () => getEnumeration
26
22
  });
27
23
  module.exports = __toCommonJS(getEnumeration_exports);
28
24
  var import_core = require("@intlayer/core");
29
- var import_contentRender = require("./ContentEditor/contentRender.cjs");
25
+ var import_contentRender = require('./ContentEditor/contentRender.cjs');
30
26
  const getEnumeration = (enumerationContent, quantity) => {
31
27
  const result = (0, import_core.getEnumerationContent)(
32
28
  enumerationContent,
@@ -38,8 +34,7 @@ const getEnumeration = (enumerationContent, quantity) => {
38
34
  return result;
39
35
  };
40
36
  // Annotate the CommonJS export names for ESM import in node:
41
- 0 &&
42
- (module.exports = {
43
- getEnumeration,
44
- });
45
- //# sourceMappingURL=getEnumeration.cjs.map
37
+ 0 && (module.exports = {
38
+ getEnumeration
39
+ });
40
+ //# sourceMappingURL=getEnumeration.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getEnumeration.ts"],"sourcesContent":["import { type QuantityContent, getEnumerationContent } from '@intlayer/core';\nimport { contentRender } from './ContentEditor/contentRender';\n\nexport const getEnumeration = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const result: Content = getEnumerationContent<Content>(\n enumerationContent,\n quantity\n );\n\n if (typeof result === 'string') {\n return contentRender(result) as Content;\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,2BAA8B;AAEvB,MAAM,iBAAiB,CAC5B,oBACA,aACY;AACZ,QAAM,aAAkB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AAEA,MAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,oCAAc,MAAM;AAAA,EAC7B;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/getEnumeration.ts"],"sourcesContent":["import { type QuantityContent, getEnumerationContent } from '@intlayer/core';\nimport { contentRender } from './ContentEditor/contentRender';\n\n/**\n * Allow to pick a content based on a quantity.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * const content = getEnumeration({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * },\n * 2);\n * // 'You have two'\n *\n * The order of the keys will define the priority of the content.\n *\n * const content = getEnumeration({\n * '<4': 'You have less than four',\n * '2': 'You have two',\n * });\n * // 'You have less than four'\n *\n */\nexport const getEnumeration = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const result: Content = getEnumerationContent<Content>(\n enumerationContent,\n quantity\n );\n\n if (typeof result === 'string') {\n return contentRender(result) as Content;\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,2BAA8B;AA2BvB,MAAM,iBAAiB,CAC5B,oBACA,aACY;AACZ,QAAM,aAAkB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AAEA,MAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,oCAAc,MAAM;AAAA,EAC7B;AAEA,SAAO;AACT;","names":[]}
@@ -1,8 +1,30 @@
1
- import { QuantityContent } from "@intlayer/core";
1
+ import { QuantityContent } from '@intlayer/core';
2
2
 
3
- declare const getEnumeration: <Content>(
4
- enumerationContent: QuantityContent<Content>,
5
- quantity: number
6
- ) => Content;
3
+ /**
4
+ * Allow to pick a content based on a quantity.
5
+ *
6
+ * Return either the content editor, or the content itself depending on the configuration.
7
+ *
8
+ * Usage:
9
+ *
10
+ * const content = getEnumeration({
11
+ * '<=-2.3': 'You have less than -2.3',
12
+ * '<1': 'You have less than one',
13
+ * '2': 'You have two',
14
+ * '>=3': 'You have three or more',
15
+ * },
16
+ * 2);
17
+ * // 'You have two'
18
+ *
19
+ * The order of the keys will define the priority of the content.
20
+ *
21
+ * const content = getEnumeration({
22
+ * '<4': 'You have less than four',
23
+ * '2': 'You have two',
24
+ * });
25
+ * // 'You have less than four'
26
+ *
27
+ */
28
+ declare const getEnumeration: <Content>(enumerationContent: QuantityContent<Content>, quantity: number) => Content;
7
29
 
8
30
  export { getEnumeration };
@@ -8,26 +8,22 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if ((from && typeof from === "object") || typeof from === "function") {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
- });
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
19
16
  return to;
20
17
  };
21
- var __toCommonJS = (mod) =>
22
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
19
  var getTranslation_exports = {};
24
20
  __export(getTranslation_exports, {
25
- getTranslation: () => getTranslation,
21
+ getTranslation: () => getTranslation
26
22
  });
27
23
  module.exports = __toCommonJS(getTranslation_exports);
28
24
  var import_client = require("@intlayer/config/client");
29
25
  var import_core = require("@intlayer/core");
30
- var import_contentRender = require("./ContentEditor/contentRender.cjs");
26
+ var import_contentRender = require('./ContentEditor/contentRender.cjs');
31
27
  const getTranslation = (languageContent, locale) => {
32
28
  const { defaultLocale } = import_client.intlayerIntlConfiguration;
33
29
  const result = (0, import_core.getTranslationContent)(
@@ -40,8 +36,7 @@ const getTranslation = (languageContent, locale) => {
40
36
  return result;
41
37
  };
42
38
  // Annotate the CommonJS export names for ESM import in node:
43
- 0 &&
44
- (module.exports = {
45
- getTranslation,
46
- });
47
- //# sourceMappingURL=getTranslation.cjs.map
39
+ 0 && (module.exports = {
40
+ getTranslation
41
+ });
42
+ //# sourceMappingURL=getTranslation.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getTranslation.ts"],"sourcesContent":["import {\n type Locales,\n intlayerIntlConfiguration,\n} from '@intlayer/config/client';\nimport { type LanguageContent, getTranslationContent } from '@intlayer/core';\nimport { contentRender } from './ContentEditor/contentRender';\n\nexport const getTranslation = <Content>(\n languageContent: LanguageContent<Content>,\n locale?: Locales\n): Content => {\n const { defaultLocale } = intlayerIntlConfiguration;\n\n const result: Content = getTranslationContent<Content>(\n languageContent,\n locale ?? defaultLocale\n );\n\n if (typeof result === 'string') {\n return contentRender(result) as Content;\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AACP,kBAA4D;AAC5D,2BAA8B;AAEvB,MAAM,iBAAiB,CAC5B,iBACA,WACY;AACZ,QAAM,EAAE,cAAc,IAAI;AAE1B,QAAM,aAAkB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,EACZ;AAEA,MAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,oCAAc,MAAM;AAAA,EAC7B;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/getTranslation.ts"],"sourcesContent":["import {\n type Locales,\n intlayerIntlConfiguration,\n} from '@intlayer/config/client';\nimport { type LanguageContent, getTranslationContent } from '@intlayer/core';\nimport { contentRender } from './ContentEditor/contentRender';\n\n/**\n *\n * Allow to pick a content based on a locale.\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * const content = getTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * },\n * 'fr');\n * // 'Bonjour'\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const getTranslation = <Content = string>(\n languageContent: LanguageContent<Content>,\n locale?: Locales\n): Content => {\n const { defaultLocale } = intlayerIntlConfiguration;\n\n const result: Content = getTranslationContent<Content>(\n languageContent,\n locale ?? defaultLocale\n );\n\n if (typeof result === 'string') {\n return contentRender(result) as Content;\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AACP,kBAA4D;AAC5D,2BAA8B;AAsBvB,MAAM,iBAAiB,CAC5B,iBACA,WACY;AACZ,QAAM,EAAE,cAAc,IAAI;AAE1B,QAAM,aAAkB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,EACZ;AAEA,MAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,oCAAc,MAAM;AAAA,EAC7B;AAEA,SAAO;AACT;","names":[]}
@@ -1,9 +1,26 @@
1
- import { Locales } from "@intlayer/config/client";
2
- import { LanguageContent } from "@intlayer/core";
1
+ import { Locales } from '@intlayer/config/client';
2
+ import { LanguageContent } from '@intlayer/core';
3
3
 
4
- declare const getTranslation: <Content>(
5
- languageContent: LanguageContent<Content>,
6
- locale?: Locales
7
- ) => Content;
4
+ /**
5
+ *
6
+ * Allow to pick a content based on a locale.
7
+ * If not locale found, it will return the content related to the default locale.
8
+ *
9
+ * Return either the content editor, or the content itself depending on the configuration.
10
+ *
11
+ * Usage:
12
+ *
13
+ * const content = getTranslation<string>({
14
+ * en: 'Hello',
15
+ * fr: 'Bonjour',
16
+ * },
17
+ * 'fr');
18
+ * // 'Bonjour'
19
+ *
20
+ * Using TypeScript:
21
+ * - this function will require each locale to be defined if defined in the project configuration.
22
+ * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
23
+ */
24
+ declare const getTranslation: <Content = string>(languageContent: LanguageContent<Content>, locale?: Locales) => Content;
8
25
 
9
26
  export { getTranslation };
@@ -8,46 +8,39 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if ((from && typeof from === "object") || typeof from === "function") {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
- });
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
19
16
  return to;
20
17
  };
21
- var __toCommonJS = (mod) =>
22
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
19
  var src_exports = {};
24
20
  __export(src_exports, {
25
- LocaleClientContext: () => import_client.LocaleClientContext,
26
- LocaleClientContextProvider: () => import_client.LocaleClientContextProvider,
21
+ IntlayerClient: () => import_client.IntlayerClient,
22
+ IntlayerClientProvider: () => import_client.IntlayerClientProvider,
27
23
  getTranslation: () => import_getTranslation.getTranslation,
28
24
  localeCookie: () => import_client.localeCookie,
29
25
  setLocaleCookie: () => import_client.setLocaleCookie,
30
26
  useIntlayer: () => import_client.useIntlayer,
31
27
  useLocale: () => import_client.useLocale,
32
- useLocaleContext: () => import_client.useLocaleContext,
33
28
  useLocaleCookie: () => import_client.useLocaleCookie,
34
- useTraduction: () => import_client.useTraduction,
29
+ useTraduction: () => import_client.useTraduction
35
30
  });
36
31
  module.exports = __toCommonJS(src_exports);
37
- var import_getTranslation = require("./getTranslation.cjs");
38
- var import_client = require("./client/index.cjs");
32
+ var import_getTranslation = require('./getTranslation.cjs');
33
+ var import_client = require('./client/index.cjs');
39
34
  // Annotate the CommonJS export names for ESM import in node:
40
- 0 &&
41
- (module.exports = {
42
- LocaleClientContext,
43
- LocaleClientContextProvider,
44
- getTranslation,
45
- localeCookie,
46
- setLocaleCookie,
47
- useIntlayer,
48
- useLocale,
49
- useLocaleContext,
50
- useLocaleCookie,
51
- useTraduction,
52
- });
53
- //# sourceMappingURL=index.cjs.map
35
+ 0 && (module.exports = {
36
+ IntlayerClient,
37
+ IntlayerClientProvider,
38
+ getTranslation,
39
+ localeCookie,
40
+ setLocaleCookie,
41
+ useIntlayer,
42
+ useLocale,
43
+ useLocaleCookie,
44
+ useTraduction
45
+ });
46
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getTranslation } from './getTranslation';\nexport {\n LocaleClientContextProvider,\n type LocaleClientContextProviderProps,\n LocaleClientContext,\n useLocaleContext,\n useIntlayer,\n useLocale,\n useTraduction,\n useLocaleCookie,\n localeCookie,\n setLocaleCookie,\n} from './client/index';\nexport {} from './client/useLocaleCookie';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,oBAWO;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getTranslation } from './getTranslation';\nexport {\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n IntlayerClient,\n useIntlayer,\n useLocale,\n useTraduction,\n useLocaleCookie,\n localeCookie,\n setLocaleCookie,\n} from './client/index';\nexport {} from './client/useLocaleCookie';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,oBAUO;","names":[]}
@@ -1,20 +1,11 @@
1
- export { getTranslation } from "./getTranslation.js";
2
- export {
3
- LocaleClientContext,
4
- LocaleClientContextProvider,
5
- LocaleClientContextProviderProps,
6
- useLocaleContext,
7
- } from "./client/LocaleClientContextProvider.js";
8
- export { useIntlayer } from "./client/useIntlayer.js";
9
- export { useLocale } from "./client/useLocale.js";
10
- export { useTraduction } from "./client/useTraduction.js";
11
- export {
12
- localeCookie,
13
- setLocaleCookie,
14
- useLocaleCookie,
15
- } from "./client/useLocaleCookie.js";
16
- import "@intlayer/config/client";
17
- import "@intlayer/core";
18
- import "react";
19
- import "./useIntlayerBase.js";
20
- import "intlayer";
1
+ export { getTranslation } from './getTranslation.js';
2
+ export { IntlayerClientContext as IntlayerClient, IntlayerClientProvider, IntlayerClientProviderProps } from './client/IntlayerClientProvider.js';
3
+ export { useIntlayer } from './client/useIntlayer.js';
4
+ export { useLocale } from './client/useLocale.js';
5
+ export { useTraduction } from './client/useTraduction.js';
6
+ export { localeCookie, setLocaleCookie, useLocaleCookie } from './client/useLocaleCookie.js';
7
+ import '@intlayer/config/client';
8
+ import '@intlayer/core';
9
+ import 'react';
10
+ import './useIntlayerBase.js';
11
+ import 'intlayer';
@@ -4,18 +4,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __copyProps = (to, from, except, desc) => {
7
- if ((from && typeof from === "object") || typeof from === "function") {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
8
  for (let key of __getOwnPropNames(from))
9
9
  if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, {
11
- get: () => from[key],
12
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
13
- });
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
11
  }
15
12
  return to;
16
13
  };
17
- var __toCommonJS = (mod) =>
18
- __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
15
  var contentDictionary_d_exports = {};
20
16
  module.exports = __toCommonJS(contentDictionary_d_exports);
21
- //# sourceMappingURL=contentDictionary.d.cjs.map
17
+ //# sourceMappingURL=contentDictionary.d.cjs.map
@@ -1,4 +1,4 @@
1
- import { TranslationContent } from "@intlayer/core";
1
+ import { TranslationContent } from '@intlayer/core';
2
2
 
3
3
  type ContentValue =
4
4
  | string
@@ -17,16 +17,13 @@ type TransformedContentValue =
17
17
  | undefined
18
18
  | ((quantity: number) => TransformedContentValue);
19
19
 
20
- type TransformedContent = Record<string, TransformedContentValue | undefined>;
20
+ type TransformedContent = Record<
21
+ string,
22
+ TransformedContentValue | undefined
23
+ >;
21
24
 
22
25
  type ContentDictionary = Content & {
23
26
  id: string;
24
27
  };
25
28
 
26
- export type {
27
- Content,
28
- ContentDictionary,
29
- ContentValue,
30
- TransformedContent,
31
- TransformedContentValue,
32
- };
29
+ export type { Content, ContentDictionary, ContentValue, TransformedContent, TransformedContentValue };