react-intlayer 1.0.0 → 1.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.
Files changed (91) 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/LocaleContextProvider.cjs +14 -26
  7. package/dist/cjs/LocaleContextProvider.d.ts +5 -6
  8. package/dist/cjs/client/LocaleClientContextProvider.cjs +14 -26
  9. package/dist/cjs/client/LocaleClientContextProvider.d.ts +6 -11
  10. package/dist/cjs/client/index.cjs +23 -30
  11. package/dist/cjs/client/index.d.ts +10 -19
  12. package/dist/cjs/client/useContent.cjs +11 -16
  13. package/dist/cjs/client/useContent.d.ts +7 -8
  14. package/dist/cjs/client/useIntlayer.cjs +11 -18
  15. package/dist/cjs/client/useIntlayer.d.ts +3 -3
  16. package/dist/cjs/client/useLocale.cjs +12 -20
  17. package/dist/cjs/client/useLocale.d.ts +5 -5
  18. package/dist/cjs/client/useLocaleCookie.cjs +20 -30
  19. package/dist/cjs/client/useLocaleCookie.d.ts +3 -3
  20. package/dist/cjs/client/useTraduction.cjs +11 -18
  21. package/dist/cjs/client/useTraduction.d.ts +2 -4
  22. package/dist/cjs/getEnumeration.cjs +9 -14
  23. package/dist/cjs/getEnumeration.d.ts +2 -5
  24. package/dist/cjs/getTranslation.cjs +9 -14
  25. package/dist/cjs/getTranslation.d.ts +3 -6
  26. package/dist/cjs/index.cjs +19 -24
  27. package/dist/cjs/index.d.ts +11 -20
  28. package/dist/cjs/processDictionary/contentDictionary.d.cjs +4 -8
  29. package/dist/cjs/processDictionary/contentDictionary.d.d.ts +6 -9
  30. package/dist/cjs/processDictionary/index.cjs +15 -17
  31. package/dist/cjs/processDictionary/index.d.ts +5 -16
  32. package/dist/cjs/server/LocaleServerContextProvider.cjs +12 -21
  33. package/dist/cjs/server/LocaleServerContextProvider.d.ts +16 -26
  34. package/dist/cjs/server/getLocaleTranslation.cjs +12 -19
  35. package/dist/cjs/server/getLocaleTranslation.d.ts +5 -7
  36. package/dist/cjs/server/index.cjs +19 -26
  37. package/dist/cjs/server/index.d.ts +9 -13
  38. package/dist/cjs/server/serverContext.cjs +25 -31
  39. package/dist/cjs/server/serverContext.d.ts +12 -20
  40. package/dist/cjs/server/useIntlayer.cjs +12 -21
  41. package/dist/cjs/server/useIntlayer.d.ts +3 -3
  42. package/dist/cjs/server/useTraduction.cjs +12 -19
  43. package/dist/cjs/server/useTraduction.d.ts +2 -4
  44. package/dist/cjs/useIntlayerBase.cjs +22 -31
  45. package/dist/cjs/useIntlayerBase.d.ts +4 -12
  46. package/dist/esm/ContentEditor/ContentEditor.d.mts +2 -2
  47. package/dist/esm/ContentEditor/ContentEditor.mjs +38 -29
  48. package/dist/esm/ContentEditor/contentRender.mjs +5 -3
  49. package/dist/esm/ContentEditor/index.d.mts +3 -3
  50. package/dist/esm/ContentEditor/index.mjs +3 -3
  51. package/dist/esm/LocaleContextProvider.d.mts +5 -6
  52. package/dist/esm/LocaleContextProvider.mjs +14 -12
  53. package/dist/esm/client/LocaleClientContextProvider.d.mts +6 -11
  54. package/dist/esm/client/LocaleClientContextProvider.mjs +16 -11
  55. package/dist/esm/client/index.d.mts +10 -19
  56. package/dist/esm/client/index.mjs +9 -9
  57. package/dist/esm/client/useContent.d.mts +7 -8
  58. package/dist/esm/client/useContent.mjs +7 -5
  59. package/dist/esm/client/useIntlayer.d.mts +3 -3
  60. package/dist/esm/client/useIntlayer.mjs +8 -4
  61. package/dist/esm/client/useLocale.d.mts +5 -5
  62. package/dist/esm/client/useLocale.mjs +6 -4
  63. package/dist/esm/client/useLocaleCookie.d.mts +3 -3
  64. package/dist/esm/client/useLocaleCookie.mjs +11 -5
  65. package/dist/esm/client/useTraduction.d.mts +2 -4
  66. package/dist/esm/client/useTraduction.mjs +6 -4
  67. package/dist/esm/getEnumeration.d.mts +2 -5
  68. package/dist/esm/getEnumeration.mjs +9 -4
  69. package/dist/esm/getTranslation.d.mts +3 -6
  70. package/dist/esm/getTranslation.mjs +8 -4
  71. package/dist/esm/index.d.mts +11 -20
  72. package/dist/esm/index.mjs +5 -5
  73. package/dist/esm/processDictionary/contentDictionary.d.d.mts +6 -9
  74. package/dist/esm/processDictionary/contentDictionary.d.mjs +1 -1
  75. package/dist/esm/processDictionary/index.d.mts +5 -16
  76. package/dist/esm/processDictionary/index.mjs +25 -9
  77. package/dist/esm/server/LocaleServerContextProvider.d.mts +16 -26
  78. package/dist/esm/server/LocaleServerContextProvider.mjs +11 -9
  79. package/dist/esm/server/getLocaleTranslation.d.mts +5 -7
  80. package/dist/esm/server/getLocaleTranslation.mjs +7 -5
  81. package/dist/esm/server/index.d.mts +9 -13
  82. package/dist/esm/server/index.mjs +7 -7
  83. package/dist/esm/server/serverContext.d.mts +12 -20
  84. package/dist/esm/server/serverContext.mjs +13 -6
  85. package/dist/esm/server/useIntlayer.d.mts +3 -3
  86. package/dist/esm/server/useIntlayer.mjs +9 -5
  87. package/dist/esm/server/useTraduction.d.mts +2 -4
  88. package/dist/esm/server/useTraduction.mjs +7 -5
  89. package/dist/esm/useIntlayerBase.d.mts +4 -12
  90. package/dist/esm/useIntlayerBase.mjs +9 -4
  91. package/package.json +8 -8
@@ -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_LocaleClientContextProvider = require('./LocaleClientContextProvider.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_LocaleClientContextProvider.LocaleClientContext);
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,10 +1,10 @@
1
- import * as _intlayer_config_client from "@intlayer/config/client";
1
+ import * as _intlayer_config_client from '@intlayer/config/client';
2
2
 
3
3
  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[];
4
+ locale: _intlayer_config_client.Locales;
5
+ defaultLocale: _intlayer_config_client.Locales;
6
+ availableLocales: _intlayer_config_client.Locales[];
7
+ localeList: _intlayer_config_client.Locales[];
8
8
  };
9
9
 
10
10
  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,10 +1,10 @@
1
- import { Locales } from "@intlayer/config/client";
1
+ import { Locales } from '@intlayer/config/client';
2
2
 
3
3
  declare const localeCookie: Locales | undefined;
4
4
  declare const setLocaleCookie: (locale: Locales) => void;
5
5
  declare const useLocaleCookie: () => {
6
- localeCookie: Locales | undefined;
7
- setLocaleCookie: (locale: Locales) => void;
6
+ localeCookie: Locales | undefined;
7
+ setLocaleCookie: (locale: Locales) => void;
8
8
  };
9
9
 
10
10
  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_LocaleClientContextProvider = require('./LocaleClientContextProvider.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_LocaleClientContextProvider.LocaleClientContext);
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,7 +1,5 @@
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
+ declare const useTraduction: <Content>(languageContent: LanguageContent<Content>) => Content;
6
4
 
7
5
  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,8 +1,5 @@
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
+ declare const getEnumeration: <Content>(enumerationContent: QuantityContent<Content>, quantity: number) => Content;
7
4
 
8
5
  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,9 +1,6 @@
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
+ declare const getTranslation: <Content>(languageContent: LanguageContent<Content>, locale?: Locales) => Content;
8
5
 
9
6
  export { getTranslation };
@@ -8,18 +8,14 @@ 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
21
  LocaleClientContext: () => import_client.LocaleClientContext,
@@ -31,23 +27,22 @@ __export(src_exports, {
31
27
  useLocale: () => import_client.useLocale,
32
28
  useLocaleContext: () => import_client.useLocaleContext,
33
29
  useLocaleCookie: () => import_client.useLocaleCookie,
34
- useTraduction: () => import_client.useTraduction,
30
+ useTraduction: () => import_client.useTraduction
35
31
  });
36
32
  module.exports = __toCommonJS(src_exports);
37
- var import_getTranslation = require("./getTranslation.cjs");
38
- var import_client = require("./client/index.cjs");
33
+ var import_getTranslation = require('./getTranslation.cjs');
34
+ var import_client = require('./client/index.cjs');
39
35
  // 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
36
+ 0 && (module.exports = {
37
+ LocaleClientContext,
38
+ LocaleClientContextProvider,
39
+ getTranslation,
40
+ localeCookie,
41
+ setLocaleCookie,
42
+ useIntlayer,
43
+ useLocale,
44
+ useLocaleContext,
45
+ useLocaleCookie,
46
+ useTraduction
47
+ });
48
+ //# sourceMappingURL=index.cjs.map
@@ -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 { LocaleClientContext, LocaleClientContextProvider, LocaleClientContextProviderProps, useLocaleContext } from './client/LocaleClientContextProvider.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 };
@@ -8,28 +8,24 @@ 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 processDictionary_exports = {};
24
20
  __export(processDictionary_exports, {
25
21
  processDictionary: () => processDictionary,
26
- processNode: () => processNode,
22
+ processNode: () => processNode
27
23
  });
28
24
  module.exports = __toCommonJS(processDictionary_exports);
29
25
  var import_client = require("@intlayer/config/client");
30
26
  var import_core = require("@intlayer/core");
31
- var import_getEnumeration = require("../getEnumeration.cjs");
32
- var import_getTranslation = require("../getTranslation.cjs");
27
+ var import_getEnumeration = require('../getEnumeration.cjs');
28
+ var import_getTranslation = require('../getTranslation.cjs');
33
29
  const defaultLocale = import_client.intlayerIntlConfiguration.defaultLocale;
34
30
  const processTranslation = (languageContent, locale) => {
35
31
  const translationResult = (0, import_getTranslation.getTranslation)(
@@ -55,7 +51,10 @@ const processNode = (field, locale) => {
55
51
  return processTranslation(field, locale);
56
52
  }
57
53
  if (field.nodeType === import_core.NodeType.Enumeration) {
58
- return processEnumeration(field, locale);
54
+ return processEnumeration(
55
+ field,
56
+ locale
57
+ );
59
58
  }
60
59
  if (typeof field.type === "undefined") {
61
60
  return processDictionary(field, locale);
@@ -74,9 +73,8 @@ const processDictionary = (content, locale = defaultLocale) => {
74
73
  return content;
75
74
  };
76
75
  // Annotate the CommonJS export names for ESM import in node:
77
- 0 &&
78
- (module.exports = {
79
- processDictionary,
80
- processNode,
81
- });
82
- //# sourceMappingURL=index.cjs.map
76
+ 0 && (module.exports = {
77
+ processDictionary,
78
+ processNode
79
+ });
80
+ //# sourceMappingURL=index.cjs.map
@@ -1,22 +1,11 @@
1
- import { Locales } from "@intlayer/config/client";
2
- import {
3
- ContentValue,
4
- TransformedContentValue,
5
- Content,
6
- TransformedContent,
7
- } from "./contentDictionary.d.js";
8
- import "@intlayer/core";
1
+ import { Locales } from '@intlayer/config/client';
2
+ import { ContentValue, TransformedContentValue, Content, TransformedContent } from './contentDictionary.d.js';
3
+ import '@intlayer/core';
9
4
 
10
- declare const processNode: (
11
- field: ContentValue | undefined,
12
- locale: Locales
13
- ) => TransformedContentValue;
5
+ declare const processNode: (field: ContentValue | undefined, locale: Locales) => TransformedContentValue;
14
6
  /**
15
7
  * Function to replace the multi lingual content with content in the current locale
16
8
  */
17
- declare const processDictionary: (
18
- content: Content,
19
- locale?: Locales
20
- ) => TransformedContent;
9
+ declare const processDictionary: (content: Content, locale?: Locales) => TransformedContent;
21
10
 
22
11
  export { processDictionary, processNode };
@@ -8,42 +8,33 @@ 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 LocaleServerContextProvider_exports = {};
24
20
  __export(LocaleServerContextProvider_exports, {
25
21
  LocaleServerContext: () => LocaleServerContext,
26
22
  LocaleServerContextProvider: () => LocaleServerContextProvider,
27
- locale: () => locale,
23
+ locale: () => locale
28
24
  });
29
25
  module.exports = __toCommonJS(LocaleServerContextProvider_exports);
30
26
  var import_jsx_runtime = require("react/jsx-runtime");
31
27
  var import_client = require("@intlayer/config/client");
32
- var import_serverContext = require("./serverContext.cjs");
28
+ var import_serverContext = require('./serverContext.cjs');
33
29
  const LocaleServerContext = (0, import_serverContext.createServerContext)(
34
30
  import_client.intlayerIntlConfiguration.defaultLocale
35
31
  );
36
32
  const locale = (0, import_serverContext.getServerContext)(LocaleServerContext);
37
- const LocaleServerContextProvider = ({ children, locale: locale2 }) =>
38
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LocaleServerContext.Provider, {
39
- value: locale2,
40
- children,
41
- });
33
+ const LocaleServerContextProvider = ({ children, locale: locale2 }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LocaleServerContext.Provider, { value: locale2, children });
42
34
  // Annotate the CommonJS export names for ESM import in node:
43
- 0 &&
44
- (module.exports = {
45
- LocaleServerContext,
46
- LocaleServerContextProvider,
47
- locale,
48
- });
49
- //# sourceMappingURL=LocaleServerContextProvider.cjs.map
35
+ 0 && (module.exports = {
36
+ LocaleServerContext,
37
+ LocaleServerContextProvider,
38
+ locale
39
+ });
40
+ //# sourceMappingURL=LocaleServerContextProvider.cjs.map