preact-intlayer 9.7.0 → 9.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/cjs/IntlayerNode.cjs +1 -2
  2. package/dist/cjs/UI/ContentSelector.cjs +1 -2
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
  4. package/dist/cjs/analytics/AnalyticsProvider.cjs +2 -3
  5. package/dist/cjs/analytics/exposureSink.cjs +1 -2
  6. package/dist/cjs/analytics/index.cjs +4 -4
  7. package/dist/cjs/analytics/useAnalytics.cjs +4 -5
  8. package/dist/cjs/analytics/useConversion.cjs +2 -3
  9. package/dist/cjs/analytics/useExperiment.cjs +2 -3
  10. package/dist/cjs/client/IntlayerProvider.cjs +7 -8
  11. package/dist/cjs/client/index.cjs +11 -11
  12. package/dist/cjs/client/t.cjs +3 -4
  13. package/dist/cjs/client/useContent.cjs +3 -4
  14. package/dist/cjs/client/useDictionary.cjs +3 -4
  15. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  16. package/dist/cjs/client/useDictionaryAsync.cjs +4 -5
  17. package/dist/cjs/client/useDictionaryDynamic.cjs +5 -6
  18. package/dist/cjs/client/useIntlayer.cjs +3 -4
  19. package/dist/cjs/client/useLoadDynamic.cjs +1 -2
  20. package/dist/cjs/client/useLocale.cjs +4 -5
  21. package/dist/cjs/client/useLocaleBase.cjs +3 -4
  22. package/dist/cjs/client/useLocaleStorage.cjs +1 -2
  23. package/dist/cjs/client/usePathname.cjs +1 -2
  24. package/dist/cjs/client/useTraduction.cjs +3 -4
  25. package/dist/cjs/editor/ContentSelector.cjs +2 -3
  26. package/dist/cjs/editor/EditorProvider.cjs +2 -3
  27. package/dist/cjs/editor/useEditor.cjs +3 -4
  28. package/dist/cjs/format/index.cjs +9 -9
  29. package/dist/cjs/format/useCompact.cjs +2 -3
  30. package/dist/cjs/format/useCurrency.cjs +2 -3
  31. package/dist/cjs/format/useDate.cjs +2 -3
  32. package/dist/cjs/format/useIntl.cjs +2 -3
  33. package/dist/cjs/format/useList.cjs +2 -3
  34. package/dist/cjs/format/useNumber.cjs +2 -3
  35. package/dist/cjs/format/usePercentage.cjs +2 -3
  36. package/dist/cjs/format/useRelativeTime.cjs +2 -3
  37. package/dist/cjs/format/useUnit.cjs +2 -3
  38. package/dist/cjs/getDictionary.cjs +2 -3
  39. package/dist/cjs/getDictionary.cjs.map +1 -1
  40. package/dist/cjs/getIntlayer.cjs +2 -3
  41. package/dist/cjs/html/HTMLProvider.cjs +2 -3
  42. package/dist/cjs/html/HTMLRenderer.cjs +3 -4
  43. package/dist/cjs/html/index.cjs +2 -2
  44. package/dist/cjs/index.cjs +17 -17
  45. package/dist/cjs/markdown/MarkdownProvider.cjs +3 -4
  46. package/dist/cjs/markdown/MarkdownRenderer.cjs +3 -4
  47. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +4 -5
  48. package/dist/cjs/markdown/compiler.cjs +2 -3
  49. package/dist/cjs/markdown/index.cjs +3 -3
  50. package/dist/cjs/markdown/runtime.cjs +1 -2
  51. package/dist/cjs/plugins.cjs +10 -11
  52. package/dist/cjs/plugins.cjs.map +1 -1
  53. package/dist/cjs/preactElement/renderPreactElement.cjs +1 -2
  54. package/dist/esm/IntlayerNode.mjs +1 -2
  55. package/dist/esm/UI/ContentSelector.mjs +1 -2
  56. package/dist/esm/analytics/AnalyticsProvider.mjs +1 -2
  57. package/dist/esm/analytics/exposureSink.mjs +1 -2
  58. package/dist/esm/analytics/index.mjs +1 -1
  59. package/dist/esm/analytics/useAnalytics.mjs +3 -4
  60. package/dist/esm/analytics/useConversion.mjs +2 -3
  61. package/dist/esm/analytics/useExperiment.mjs +2 -3
  62. package/dist/esm/client/IntlayerProvider.mjs +5 -6
  63. package/dist/esm/client/index.mjs +2 -2
  64. package/dist/esm/client/t.mjs +2 -3
  65. package/dist/esm/client/useContent.mjs +1 -2
  66. package/dist/esm/client/useDictionary.mjs +1 -2
  67. package/dist/esm/client/useDictionary.mjs.map +1 -1
  68. package/dist/esm/client/useDictionaryAsync.mjs +2 -3
  69. package/dist/esm/client/useDictionaryDynamic.mjs +2 -3
  70. package/dist/esm/client/useIntlayer.mjs +1 -2
  71. package/dist/esm/client/useLoadDynamic.mjs +1 -2
  72. package/dist/esm/client/useLocale.mjs +3 -4
  73. package/dist/esm/client/useLocaleBase.mjs +2 -3
  74. package/dist/esm/client/useLocaleStorage.mjs +1 -2
  75. package/dist/esm/client/usePathname.mjs +1 -2
  76. package/dist/esm/client/useTraduction.mjs +2 -3
  77. package/dist/esm/editor/ContentSelector.mjs +2 -3
  78. package/dist/esm/editor/EditorProvider.mjs +1 -2
  79. package/dist/esm/editor/useEditor.mjs +2 -3
  80. package/dist/esm/format/index.mjs +5 -5
  81. package/dist/esm/format/useCompact.mjs +1 -2
  82. package/dist/esm/format/useCurrency.mjs +1 -2
  83. package/dist/esm/format/useDate.mjs +1 -2
  84. package/dist/esm/format/useIntl.mjs +1 -2
  85. package/dist/esm/format/useList.mjs +1 -2
  86. package/dist/esm/format/useNumber.mjs +1 -2
  87. package/dist/esm/format/usePercentage.mjs +1 -2
  88. package/dist/esm/format/useRelativeTime.mjs +1 -2
  89. package/dist/esm/format/useUnit.mjs +1 -2
  90. package/dist/esm/getDictionary.mjs +1 -2
  91. package/dist/esm/getDictionary.mjs.map +1 -1
  92. package/dist/esm/getIntlayer.mjs +1 -2
  93. package/dist/esm/html/HTMLProvider.mjs +2 -3
  94. package/dist/esm/html/HTMLRenderer.mjs +2 -3
  95. package/dist/esm/index.mjs +6 -6
  96. package/dist/esm/markdown/MarkdownProvider.mjs +2 -3
  97. package/dist/esm/markdown/MarkdownRenderer.mjs +1 -2
  98. package/dist/esm/markdown/MarkdownRendererPlugin.mjs +2 -3
  99. package/dist/esm/markdown/compiler.mjs +1 -2
  100. package/dist/esm/markdown/runtime.mjs +1 -2
  101. package/dist/esm/plugins.mjs +5 -6
  102. package/dist/esm/plugins.mjs.map +1 -1
  103. package/dist/esm/preactElement/renderPreactElement.mjs +1 -2
  104. package/dist/types/IntlayerNode.d.ts +2 -3
  105. package/dist/types/IntlayerNode.d.ts.map +1 -1
  106. package/dist/types/UI/ContentSelector.d.ts +1 -2
  107. package/dist/types/UI/ContentSelector.d.ts.map +1 -1
  108. package/dist/types/analytics/AnalyticsProvider.d.ts +0 -2
  109. package/dist/types/analytics/AnalyticsProvider.d.ts.map +1 -1
  110. package/dist/types/analytics/exposureSink.d.ts +0 -2
  111. package/dist/types/analytics/exposureSink.d.ts.map +1 -1
  112. package/dist/types/analytics/useAnalytics.d.ts +0 -2
  113. package/dist/types/analytics/useAnalytics.d.ts.map +1 -1
  114. package/dist/types/analytics/useConversion.d.ts +0 -2
  115. package/dist/types/analytics/useConversion.d.ts.map +1 -1
  116. package/dist/types/analytics/useExperiment.d.ts +0 -2
  117. package/dist/types/analytics/useExperiment.d.ts.map +1 -1
  118. package/dist/types/client/IntlayerProvider.d.ts +1 -2
  119. package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
  120. package/dist/types/client/t.d.ts +0 -2
  121. package/dist/types/client/t.d.ts.map +1 -1
  122. package/dist/types/client/useContent.d.ts +0 -2
  123. package/dist/types/client/useContent.d.ts.map +1 -1
  124. package/dist/types/client/useDictionary.d.ts +0 -2
  125. package/dist/types/client/useDictionary.d.ts.map +1 -1
  126. package/dist/types/client/useDictionaryAsync.d.ts +0 -2
  127. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  128. package/dist/types/client/useDictionaryDynamic.d.ts +0 -2
  129. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  130. package/dist/types/client/useIntlayer.d.ts +0 -2
  131. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  132. package/dist/types/client/useLoadDynamic.d.ts +0 -2
  133. package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
  134. package/dist/types/client/useLocale.d.ts +1 -2
  135. package/dist/types/client/useLocale.d.ts.map +1 -1
  136. package/dist/types/client/useLocaleBase.d.ts +0 -2
  137. package/dist/types/client/useLocaleBase.d.ts.map +1 -1
  138. package/dist/types/client/useLocaleStorage.d.ts +0 -2
  139. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  140. package/dist/types/client/usePathname.d.ts +0 -2
  141. package/dist/types/client/usePathname.d.ts.map +1 -1
  142. package/dist/types/client/useTraduction.d.ts +0 -2
  143. package/dist/types/client/useTraduction.d.ts.map +1 -1
  144. package/dist/types/editor/ContentSelector.d.ts +0 -2
  145. package/dist/types/editor/ContentSelector.d.ts.map +1 -1
  146. package/dist/types/editor/EditorProvider.d.ts +0 -2
  147. package/dist/types/editor/EditorProvider.d.ts.map +1 -1
  148. package/dist/types/editor/useEditor.d.ts +0 -2
  149. package/dist/types/editor/useEditor.d.ts.map +1 -1
  150. package/dist/types/format/useCompact.d.ts +0 -2
  151. package/dist/types/format/useCompact.d.ts.map +1 -1
  152. package/dist/types/format/useCurrency.d.ts +0 -2
  153. package/dist/types/format/useCurrency.d.ts.map +1 -1
  154. package/dist/types/format/useDate.d.ts +0 -2
  155. package/dist/types/format/useDate.d.ts.map +1 -1
  156. package/dist/types/format/useIntl.d.ts +0 -2
  157. package/dist/types/format/useIntl.d.ts.map +1 -1
  158. package/dist/types/format/useList.d.ts +0 -2
  159. package/dist/types/format/useList.d.ts.map +1 -1
  160. package/dist/types/format/useNumber.d.ts +0 -2
  161. package/dist/types/format/useNumber.d.ts.map +1 -1
  162. package/dist/types/format/usePercentage.d.ts +0 -2
  163. package/dist/types/format/usePercentage.d.ts.map +1 -1
  164. package/dist/types/format/useRelativeTime.d.ts +0 -2
  165. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  166. package/dist/types/format/useUnit.d.ts +0 -2
  167. package/dist/types/format/useUnit.d.ts.map +1 -1
  168. package/dist/types/getDictionary.d.ts +0 -2
  169. package/dist/types/getDictionary.d.ts.map +1 -1
  170. package/dist/types/getIntlayer.d.ts +0 -2
  171. package/dist/types/getIntlayer.d.ts.map +1 -1
  172. package/dist/types/html/HTMLProvider.d.ts +1 -2
  173. package/dist/types/html/HTMLProvider.d.ts.map +1 -1
  174. package/dist/types/html/HTMLRenderer.d.ts +0 -2
  175. package/dist/types/html/HTMLRenderer.d.ts.map +1 -1
  176. package/dist/types/html/index.d.ts +1 -1
  177. package/dist/types/html/types.d.ts +1 -2
  178. package/dist/types/html/types.d.ts.map +1 -1
  179. package/dist/types/index.d.ts +4 -6
  180. package/dist/types/index.d.ts.map +1 -1
  181. package/dist/types/markdown/MarkdownProvider.d.ts +1 -2
  182. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  183. package/dist/types/markdown/MarkdownRenderer.d.ts +0 -2
  184. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  185. package/dist/types/markdown/MarkdownRendererPlugin.d.ts +1 -2
  186. package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -1
  187. package/dist/types/markdown/compiler.d.ts +3 -2
  188. package/dist/types/markdown/compiler.d.ts.map +1 -1
  189. package/dist/types/markdown/runtime.d.ts +3 -2
  190. package/dist/types/markdown/runtime.d.ts.map +1 -1
  191. package/dist/types/plugins.d.ts +3 -5
  192. package/dist/types/plugins.d.ts.map +1 -1
  193. package/dist/types/preactElement/renderPreactElement.d.ts +0 -2
  194. package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -1
  195. package/package.json +50 -50
@@ -1,7 +1,7 @@
1
1
  import { useAnalytics } from "./useAnalytics.mjs";
2
2
  import { Fragment, jsx } from "preact/jsx-runtime";
3
3
 
4
- //#region src/analytics/AnalyticsProvider.tsx
4
+ // src/analytics/AnalyticsProvider.tsx
5
5
  /**
6
6
  * Runs {@link useAnalytics} and renders its children unchanged. Mounted inside
7
7
  * {@link IntlayerProvider} alongside `EditorProvider`.
@@ -11,6 +11,5 @@ const AnalyticsProvider = ({ children }) => {
11
11
  return /* @__PURE__ */ jsx(Fragment, { children });
12
12
  };
13
13
 
14
- //#endregion
15
14
  export { AnalyticsProvider };
16
15
  //# sourceMappingURL=AnalyticsProvider.mjs.map
@@ -1,4 +1,4 @@
1
- //#region src/analytics/exposureSink.ts
1
+ // src/analytics/exposureSink.ts
2
2
  let sink = null;
3
3
  /**
4
4
  * Installs (or clears) the exposure sink. `useAnalytics` sets this once the
@@ -19,6 +19,5 @@ const reportExposure = (input) => {
19
19
  sink?.(input);
20
20
  };
21
21
 
22
- //#endregion
23
22
  export { reportExposure, setExposureSink };
24
23
  //# sourceMappingURL=exposureSink.mjs.map
@@ -1,5 +1,5 @@
1
- import { useAnalytics } from "./useAnalytics.mjs";
2
1
  import { AnalyticsProvider } from "./AnalyticsProvider.mjs";
2
+ import { useAnalytics } from "./useAnalytics.mjs";
3
3
  import { useConversion } from "./useConversion.mjs";
4
4
  import { useExperiment } from "./useExperiment.mjs";
5
5
 
@@ -1,9 +1,9 @@
1
- import { setExposureSink } from "./exposureSink.mjs";
2
1
  import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
3
- import { useContext, useEffect, useRef } from "preact/hooks";
2
+ import { setExposureSink } from "./exposureSink.mjs";
4
3
  import { isEnabled } from "@intlayer/analytics/isEnabled";
4
+ import { useContext, useEffect, useRef } from "preact/hooks";
5
5
 
6
- //#region src/analytics/useAnalytics.tsx
6
+ // src/analytics/useAnalytics.tsx
7
7
  /**
8
8
  * Initializes the Intlayer analytics client singleton when analytics is enabled
9
9
  * and keeps it aware of the current locale.
@@ -46,6 +46,5 @@ const useAnalytics = () => {
46
46
  }, [locale]);
47
47
  };
48
48
 
49
- //#endregion
50
49
  export { useAnalytics };
51
50
  //# sourceMappingURL=useAnalytics.mjs.map
@@ -1,7 +1,7 @@
1
- import { useCallback } from "preact/hooks";
2
1
  import { isEnabled } from "@intlayer/analytics/isEnabled";
2
+ import { useCallback } from "preact/hooks";
3
3
 
4
- //#region src/analytics/useConversion.ts
4
+ // src/analytics/useConversion.ts
5
5
  /**
6
6
  * Returns a stable `trackConversion` callback for content A/B testing. Safe to
7
7
  * call from any component: it resolves to a no-op when analytics is disabled
@@ -24,6 +24,5 @@ const useConversion = () => {
24
24
  }, []);
25
25
  };
26
26
 
27
- //#endregion
28
27
  export { useConversion };
29
28
  //# sourceMappingURL=useConversion.mjs.map
@@ -1,7 +1,7 @@
1
- import { useEffect, useState } from "preact/hooks";
2
1
  import { isEnabled } from "@intlayer/analytics/isEnabled";
2
+ import { useEffect, useState } from "preact/hooks";
3
3
 
4
- //#region src/analytics/useExperiment.ts
4
+ // src/analytics/useExperiment.ts
5
5
  /**
6
6
  * Assigns this session to a variant of an A/B experiment and records the
7
7
  * exposure, scoped to `experimentKey`, so the backend can compute per-variant
@@ -57,6 +57,5 @@ const useExperiment = (experimentKey, variants, weights) => {
57
57
  return state;
58
58
  };
59
59
 
60
- //#endregion
61
60
  export { useExperiment };
62
61
  //# sourceMappingURL=useExperiment.mjs.map
@@ -1,14 +1,14 @@
1
+ import { AnalyticsProvider } from "../analytics/AnalyticsProvider.mjs";
1
2
  import { EditorProvider } from "../editor/EditorProvider.mjs";
2
3
  import { getLocaleInStorage, setLocaleInStorage } from "./useLocaleStorage.mjs";
3
- import { AnalyticsProvider } from "../analytics/AnalyticsProvider.mjs";
4
- import { internationalization } from "@intlayer/config/built";
5
- import { createContext } from "preact";
6
4
  import { useCallback, useContext, useEffect, useMemo, useState } from "preact/hooks";
7
- import { jsx, jsxs } from "preact/jsx-runtime";
5
+ import { internationalization } from "@intlayer/config/built";
8
6
  import { setIntlayerIdentifier } from "@intlayer/config/client";
9
7
  import { localeResolver } from "@intlayer/core/localization";
8
+ import { createContext } from "preact";
9
+ import { jsx, jsxs } from "preact/jsx-runtime";
10
10
 
11
- //#region src/client/IntlayerProvider.tsx
11
+ // src/client/IntlayerProvider.tsx
12
12
  /**
13
13
  * Context that store the current locale on the client side
14
14
  */
@@ -92,6 +92,5 @@ const IntlayerProvider = ({ children, ...props }) => /* @__PURE__ */ jsxs(Intlay
92
92
  ]
93
93
  });
94
94
 
95
- //#endregion
96
95
  export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext };
97
96
  //# sourceMappingURL=IntlayerProvider.mjs.map
@@ -1,13 +1,13 @@
1
- import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.mjs";
2
1
  import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./IntlayerProvider.mjs";
3
2
  import { t } from "./t.mjs";
4
3
  import { useDictionary } from "./useDictionary.mjs";
5
4
  import { useDictionaryAsync } from "./useDictionaryAsync.mjs";
6
- import { useLoadDynamic } from "./useLoadDynamic.mjs";
7
5
  import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
8
6
  import { useIntlayer } from "./useIntlayer.mjs";
7
+ import { useLoadDynamic } from "./useLoadDynamic.mjs";
9
8
  import { useLocale } from "./useLocale.mjs";
10
9
  import { useLocaleBase } from "./useLocaleBase.mjs";
10
+ import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.mjs";
11
11
  import { usePathname } from "./usePathname.mjs";
12
12
 
13
13
  export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, usePathname };
@@ -1,8 +1,8 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { getTranslation } from "@intlayer/core/interpreter";
3
2
  import { useContext } from "preact/hooks";
3
+ import { getTranslation } from "@intlayer/core/interpreter";
4
4
 
5
- //#region src/client/t.ts
5
+ // src/client/t.ts
6
6
  /**
7
7
  * On the client side, this function returns the translation of the provided multilang content.
8
8
  *
@@ -13,6 +13,5 @@ const t = (multilangContent, locale) => {
13
13
  return getTranslation(multilangContent, locale ?? currentLocale);
14
14
  };
15
15
 
16
- //#endregion
17
16
  export { t };
18
17
  //# sourceMappingURL=t.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { useLocaleBase } from "./useLocaleBase.mjs";
2
2
  import { useTranslation } from "./useTraduction.mjs";
3
3
 
4
- //#region src/client/useContent.ts
4
+ // src/client/useContent.ts
5
5
  /**
6
6
  * On the client side, hook to get the translation content based on the locale
7
7
  */
@@ -14,6 +14,5 @@ const useContent = (languageContent) => {
14
14
  };
15
15
  };
16
16
 
17
- //#endregion
18
17
  export { useContent };
19
18
  //# sourceMappingURL=useContent.mjs.map
@@ -3,7 +3,7 @@ import { IntlayerClientContext } from "./IntlayerProvider.mjs";
3
3
  import { useContext, useMemo } from "preact/hooks";
4
4
  import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
6
- //#region src/client/useDictionary.ts
6
+ // src/client/useDictionary.ts
7
7
  /**
8
8
  * Preact hook that transforms a dictionary (or qualified dictionary group) and
9
9
  * returns the content.
@@ -23,6 +23,5 @@ const useDictionary = (dictionary, localeOrSelector) => {
23
23
  return useMemo(() => getDictionary(dictionary, argument), [dictionary.key, argumentIdentity]);
24
24
  };
25
25
 
26
- //#endregion
27
26
  export { useDictionary };
28
27
  //# sourceMappingURL=useDictionary.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import {\n getDictionarySelectorCacheKey,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that transforms a dictionary (or qualified dictionary group) and\n * returns the content.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n) => {\n const { locale: currentLocale, variant: contextVariant } =\n useContext(IntlayerClientContext) ?? {};\n\n // Layers the provider's locale and variant under the call-site argument.\n // This is the seam the build-time optimize transform lands on: it rewrites\n // `useIntlayer('key', selector)` into `useDictionary(dict, selector)`, so an\n // ambient variant has to be applied here to survive the rewrite.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant,\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? currentLocale);\n\n // Stable identity of the resolved argument for memoization — a provider\n // variant is often a fresh object literal on every render, so the dependency\n // has to be its serialization, never its reference.\n const argumentIdentity =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof argument === 'object' &&\n argument !== null\n ? `${argument.locale ?? ''}|${getDictionarySelectorCacheKey(argument)}`\n : argument;\n\n return useMemo(\n () => getDictionary<T, A>(dictionary, argument as A),\n [dictionary.key, argumentIdentity]\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAa,iBAMX,YACA,qBACG;CACH,MAAM,EAAE,QAAQ,eAAe,SAAS,mBACtC,WAAW,qBAAqB,KAAK,CAAC;CAMxC,MAAM,WACJ,QAAQ,IAAI,iCAAiC,UACzC,0BAA0B;EACxB;EACA,eAAe;EACf;EACA,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoB;CAK3B,MAAM,mBACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,aAAa,YACpB,aAAa,OACT,GAAG,SAAS,UAAU,GAAG,GAAG,8BAA8B,QAAQ,MAClE;CAEN,OAAO,cACC,cAAoB,YAAY,QAAa,GACnD,CAAC,WAAW,KAAK,gBAAgB,CACnC;AACF"}
1
+ {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import {\n getDictionarySelectorCacheKey,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that transforms a dictionary (or qualified dictionary group) and\n * returns the content.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n) => {\n const { locale: currentLocale, variant: contextVariant } =\n useContext(IntlayerClientContext) ?? {};\n\n // Layers the provider's locale and variant under the call-site argument.\n // This is the seam the build-time optimize transform lands on: it rewrites\n // `useIntlayer('key', selector)` into `useDictionary(dict, selector)`, so an\n // ambient variant has to be applied here to survive the rewrite.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant,\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? currentLocale);\n\n // Stable identity of the resolved argument for memoization — a provider\n // variant is often a fresh object literal on every render, so the dependency\n // has to be its serialization, never its reference.\n const argumentIdentity =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof argument === 'object' &&\n argument !== null\n ? `${argument.locale ?? ''}|${getDictionarySelectorCacheKey(argument)}`\n : argument;\n\n return useMemo(\n () => getDictionary<T, A>(dictionary, argument as A),\n [dictionary.key, argumentIdentity]\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAa,iBAKX,YACA,qBACG;CACH,MAAM,EAAE,QAAQ,eAAe,SAAS,mBACtC,WAAW,qBAAqB,KAAK,CAAC;CAMxC,MAAM,WACJ,QAAQ,IAAI,iCAAiC,UACzC,0BAA0B;EACxB;EACA,eAAe;EACf;EACA,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoB;CAK3B,MAAM,mBACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,aAAa,YACpB,aAAa,OACT,GAAG,SAAS,UAAU,GAAG,GAAG,8BAA8B,QAAQ,MAClE;CAEN,OAAO,cACC,cAAoB,YAAY,QAAa,GACnD,CAAC,WAAW,KAAK,gBAAgB,CACnC;AACF"}
@@ -1,9 +1,9 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
2
  import { useDictionary } from "./useDictionary.mjs";
3
- import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
4
3
  import { useContext, useMemo } from "preact/hooks";
4
+ import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
5
5
 
6
- //#region src/client/useDictionaryAsync.ts
6
+ // src/client/useDictionaryAsync.ts
7
7
  /**
8
8
  * On the server side, Hook that transform a dictionary and return the content
9
9
  *
@@ -16,6 +16,5 @@ const useDictionaryAsync = async (dictionaryPromise, locale) => {
16
16
  return useDictionary(dictionary, localeTarget);
17
17
  };
18
18
 
19
- //#endregion
20
19
  export { useDictionaryAsync };
21
20
  //# sourceMappingURL=useDictionaryAsync.mjs.map
@@ -1,11 +1,11 @@
1
1
  import { getDictionary as getDictionary$1 } from "../getDictionary.mjs";
2
2
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
3
3
  import { useLoadDynamic } from "./useLoadDynamic.mjs";
4
- import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
5
4
  import { useContext } from "preact/hooks";
5
+ import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
6
6
  import { getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryArgument, resolveQualifiedDynamicContent } from "@intlayer/core/dictionaryManipulator";
7
7
 
8
- //#region src/client/useDictionaryDynamic.ts
8
+ // src/client/useDictionaryDynamic.ts
9
9
  /**
10
10
  * Preact hook that lazily loads a dictionary and returns its content.
11
11
  *
@@ -44,6 +44,5 @@ const useDictionaryDynamic = (dictionaryPromise, key, localeOrSelector) => {
44
44
  return getDictionary$1(dictionary, localeTarget);
45
45
  };
46
46
 
47
- //#endregion
48
47
  export { useDictionaryDynamic };
49
48
  //# sourceMappingURL=useDictionaryDynamic.mjs.map
@@ -3,7 +3,7 @@ import { IntlayerClientContext } from "./IntlayerProvider.mjs";
3
3
  import { useContext, useMemo } from "preact/hooks";
4
4
  import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
6
- //#region src/client/useIntlayer.ts
6
+ // src/client/useIntlayer.ts
7
7
  /**
8
8
  * Preact hook that picks one dictionary by its key and returns its content.
9
9
  *
@@ -40,6 +40,5 @@ const useIntlayer = (key, localeOrSelector) => {
40
40
  return useMemo(() => getIntlayer(key, argument), [key, argumentIdentity]);
41
41
  };
42
42
 
43
- //#endregion
44
43
  export { useIntlayer };
45
44
  //# sourceMappingURL=useIntlayer.mjs.map
@@ -1,4 +1,4 @@
1
- //#region src/client/useLoadDynamic.ts
1
+ // src/client/useLoadDynamic.ts
2
2
  const createSuspender = (promise) => {
3
3
  let status = "pending";
4
4
  let result;
@@ -21,6 +21,5 @@ const useLoadDynamic = (key, promise) => {
21
21
  return cache.get(key).read();
22
22
  };
23
23
 
24
- //#endregion
25
24
  export { useLoadDynamic };
26
25
  //# sourceMappingURL=useLoadDynamic.mjs.map
@@ -1,9 +1,9 @@
1
- import { setLocaleInStorage } from "./useLocaleStorage.mjs";
2
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
3
- import { internationalization } from "@intlayer/config/built";
2
+ import { setLocaleInStorage } from "./useLocaleStorage.mjs";
4
3
  import { useContext } from "preact/hooks";
4
+ import { internationalization } from "@intlayer/config/built";
5
5
 
6
- //#region src/client/useLocale.ts
6
+ // src/client/useLocale.ts
7
7
  const { defaultLocale, locales: availableLocales } = internationalization ?? {};
8
8
  /**
9
9
  * Preact hook to get the current locale and related locale management functions.
@@ -47,6 +47,5 @@ const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
47
47
  };
48
48
  };
49
49
 
50
- //#endregion
51
50
  export { useLocale };
52
51
  //# sourceMappingURL=useLocale.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { useContext } from "preact/hooks";
3
+ import { internationalization } from "@intlayer/config/built";
4
4
 
5
- //#region src/client/useLocaleBase.ts
5
+ // src/client/useLocaleBase.ts
6
6
  const { defaultLocale, locales: availableLocales } = internationalization;
7
7
  /**
8
8
  * On the client side, hook to get the current locale and all related fields
@@ -17,6 +17,5 @@ const useLocaleBase = () => {
17
17
  };
18
18
  };
19
19
 
20
- //#endregion
21
20
  export { useLocaleBase };
22
21
  //# sourceMappingURL=useLocaleBase.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from "preact/hooks";
2
2
  import { LocaleStorageClient, getCachedLocaleFromStorageClient, getLocaleFromStorageClient, localeStorageOptions, setLocaleInStorageClient } from "@intlayer/core/utils";
3
3
 
4
- //#region src/client/useLocaleStorage.ts
4
+ // src/client/useLocaleStorage.ts
5
5
  /**
6
6
  * Reads the locale persisted in the browser storage (cookie, localStorage…).
7
7
  *
@@ -51,6 +51,5 @@ const useLocaleStorage = (isCookieEnabled) => useMemo(() => LocaleStorageClient(
51
51
  */
52
52
  const useLocaleCookie = useLocaleStorage;
53
53
 
54
- //#endregion
55
54
  export { getLocaleInStorage, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage };
56
55
  //# sourceMappingURL=useLocaleStorage.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useMemo, useState } from "preact/hooks";
2
2
  import { getPathWithoutLocale } from "@intlayer/core/localization";
3
3
 
4
- //#region src/client/usePathname.ts
4
+ // src/client/usePathname.ts
5
5
  /**
6
6
  * Preact hook that returns the current pathname with the locale segment removed.
7
7
  *
@@ -32,6 +32,5 @@ const usePathname = () => {
32
32
  return useMemo(() => getPathWithoutLocale(rawPathname), [rawPathname]);
33
33
  };
34
34
 
35
- //#endregion
36
35
  export { usePathname };
37
36
  //# sourceMappingURL=usePathname.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { getTranslation } from "@intlayer/core/interpreter";
3
2
  import { useContext, useMemo } from "preact/hooks";
3
+ import { getTranslation } from "@intlayer/core/interpreter";
4
4
 
5
- //#region src/client/useTraduction.ts
5
+ // src/client/useTraduction.ts
6
6
  /**
7
7
  * On the client side, Hook that picking one dictionary by its id and return the content.
8
8
  *
@@ -29,6 +29,5 @@ const useTranslation = (languageContent) => {
29
29
  return useMemo(() => getTranslation(languageContent, locale), [languageContent, locale]);
30
30
  };
31
31
 
32
- //#endregion
33
32
  export { useTranslation };
34
33
  //# sourceMappingURL=useTraduction.mjs.map
@@ -1,8 +1,8 @@
1
- import { isEnabled } from "@intlayer/editor/isEnabled";
2
1
  import { useEffect } from "preact/hooks";
2
+ import { isEnabled } from "@intlayer/editor/isEnabled";
3
3
  import { jsx } from "preact/jsx-runtime";
4
4
 
5
- //#region src/editor/ContentSelector.tsx
5
+ // src/editor/ContentSelector.tsx
6
6
  const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
7
7
  useEffect(() => {
8
8
  if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !isEnabled || typeof window === "undefined") return;
@@ -18,6 +18,5 @@ const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
18
18
  });
19
19
  };
20
20
 
21
- //#endregion
22
21
  export { ContentSelector };
23
22
  //# sourceMappingURL=ContentSelector.mjs.map
@@ -1,11 +1,10 @@
1
1
  import { useEditor } from "./useEditor.mjs";
2
2
 
3
- //#region src/editor/EditorProvider.tsx
3
+ // src/editor/EditorProvider.tsx
4
4
  const EditorProvider = ({ children }) => {
5
5
  useEditor();
6
6
  return children;
7
7
  };
8
8
 
9
- //#endregion
10
9
  export { EditorProvider };
11
10
  //# sourceMappingURL=EditorProvider.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
- import { isEnabled } from "@intlayer/editor/isEnabled";
3
2
  import { useContext, useEffect, useRef } from "preact/hooks";
3
+ import { isEnabled } from "@intlayer/editor/isEnabled";
4
4
 
5
- //#region src/editor/useEditor.tsx
5
+ // src/editor/useEditor.tsx
6
6
  /**
7
7
  * Initialises the Intlayer editor client singleton when the editor is enabled.
8
8
  * Syncs the current locale from the Intlayer context into the editor manager so
@@ -39,6 +39,5 @@ const useEditor = () => {
39
39
  }, [locale]);
40
40
  };
41
41
 
42
- //#endregion
43
42
  export { useEditor };
44
43
  //# sourceMappingURL=useEditor.mjs.map
@@ -1,11 +1,11 @@
1
- import { usePercentage } from "./usePercentage.mjs";
2
- import { useUnit } from "./useUnit.mjs";
3
1
  import { useCompact } from "./useCompact.mjs";
4
- import { useNumber } from "./useNumber.mjs";
5
- import { useIntl } from "./useIntl.mjs";
6
- import { useList } from "./useList.mjs";
7
2
  import { useCurrency } from "./useCurrency.mjs";
8
3
  import { useDate } from "./useDate.mjs";
4
+ import { useIntl } from "./useIntl.mjs";
5
+ import { useList } from "./useList.mjs";
6
+ import { useNumber } from "./useNumber.mjs";
7
+ import { usePercentage } from "./usePercentage.mjs";
9
8
  import { useRelativeTime } from "./useRelativeTime.mjs";
9
+ import { useUnit } from "./useUnit.mjs";
10
10
 
11
11
  export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { compact } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useCompact.ts
5
+ // src/format/useCompact.ts
6
6
  /**
7
7
  * React client hook that provides a compact number formatter
8
8
  * bound to the current application locale.
@@ -21,6 +21,5 @@ const useCompact = () => {
21
21
  }), [locale]);
22
22
  };
23
23
 
24
- //#endregion
25
24
  export { useCompact };
26
25
  //# sourceMappingURL=useCompact.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { currency } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useCurrency.ts
5
+ // src/format/useCurrency.ts
6
6
  /**
7
7
  * React client hook that provides a currency formatter
8
8
  * bound to the current application locale.
@@ -35,6 +35,5 @@ const useCurrency = () => {
35
35
  }), [locale]);
36
36
  };
37
37
 
38
- //#endregion
39
38
  export { useCurrency };
40
39
  //# sourceMappingURL=useCurrency.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useContext } from "preact/hooks";
3
3
  import { date } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useDate.ts
5
+ // src/format/useDate.ts
6
6
  /**
7
7
  * React client hook that provides a localized date/time formatter
8
8
  * bound to the current application locale.
@@ -37,6 +37,5 @@ const useDate = () => {
37
37
  });
38
38
  };
39
39
 
40
- //#endregion
41
40
  export { useDate };
42
41
  //# sourceMappingURL=useDate.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useContext, useMemo } from "preact/hooks";
3
3
  import { bindIntl } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useIntl.ts
5
+ // src/format/useIntl.ts
6
6
  /**
7
7
  * Preact client hook that provides a locale-bound `Intl` object.
8
8
  *
@@ -27,6 +27,5 @@ const useIntl = (locale) => {
27
27
  return useMemo(() => bindIntl(currentLocale), [currentLocale]);
28
28
  };
29
29
 
30
- //#endregion
31
30
  export { useIntl };
32
31
  //# sourceMappingURL=useIntl.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { list } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useList.ts
5
+ // src/format/useList.ts
6
6
  /**
7
7
  * React client hook that provides a list formatter
8
8
  * bound to the current application locale.
@@ -32,6 +32,5 @@ const useList = () => {
32
32
  }), [locale]);
33
33
  };
34
34
 
35
- //#endregion
36
35
  export { useList };
37
36
  //# sourceMappingURL=useList.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { number } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useNumber.ts
5
+ // src/format/useNumber.ts
6
6
  /**
7
7
  * React client hook that provides a localized number formatter.
8
8
  *
@@ -33,6 +33,5 @@ const useNumber = () => {
33
33
  }), [locale]);
34
34
  };
35
35
 
36
- //#endregion
37
36
  export { useNumber };
38
37
  //# sourceMappingURL=useNumber.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { percentage } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/usePercentage.ts
5
+ // src/format/usePercentage.ts
6
6
  /**
7
7
  * React hook to provide a percentage formatter function
8
8
  * based on the current application locale.
@@ -29,6 +29,5 @@ const usePercentage = () => {
29
29
  }), [locale]);
30
30
  };
31
31
 
32
- //#endregion
33
32
  export { usePercentage };
34
33
  //# sourceMappingURL=usePercentage.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { relativeTime } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useRelativeTime.ts
5
+ // src/format/useRelativeTime.ts
6
6
  /**
7
7
  * Client-side React hook for accessing a localized relative time formatter.
8
8
  *
@@ -29,6 +29,5 @@ const useRelativeTime = () => {
29
29
  }), [locale]);
30
30
  };
31
31
 
32
- //#endregion
33
32
  export { useRelativeTime };
34
33
  //# sourceMappingURL=useRelativeTime.mjs.map
@@ -2,7 +2,7 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
2
  import { useCallback, useContext } from "preact/hooks";
3
3
  import { units } from "@intlayer/core/formatters";
4
4
 
5
- //#region src/format/useUnit.ts
5
+ // src/format/useUnit.ts
6
6
  /**
7
7
  * React hook that provides a unit formatting function
8
8
  * based on the current locale from {@link useLocaleBase}.
@@ -28,6 +28,5 @@ const useUnit = () => {
28
28
  }), [locale]);
29
29
  };
30
30
 
31
- //#endregion
32
31
  export { useUnit };
33
32
  //# sourceMappingURL=useUnit.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { getPlugins } from "./plugins.mjs";
2
2
  import { getDictionary as getDictionary$1 } from "@intlayer/core/interpreter";
3
3
 
4
- //#region src/getDictionary.ts
4
+ // src/getDictionary.ts
5
5
  /**
6
6
  * Transforms a dictionary (or qualified dictionary group) and returns its
7
7
  * content for the given locale or selector (`{ item }`, `{ variant }`,
@@ -12,6 +12,5 @@ const getDictionary = (dictionary, localeOrSelector) => {
12
12
  return getDictionary$1(dictionary, localeOrSelector, getPlugins(locale));
13
13
  };
14
14
 
15
- //#endregion
16
15
  export { getDictionary };
17
16
  //# sourceMappingURL=getDictionary.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,OAAOA,gBACL,YACA,kBACA,WAAW,MAAM,CACnB;AACF"}
1
+ {"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,iBAKX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,OAAOA,gBACL,YACA,kBACA,WAAW,MAAM,CACnB;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { getPlugins } from "./plugins.mjs";
2
2
  import { getIntlayer as getIntlayer$1 } from "@intlayer/core/interpreter";
3
3
 
4
- //#region src/getIntlayer.ts
4
+ // src/getIntlayer.ts
5
5
  /**
6
6
  * Picks one dictionary by its key and returns its content for the given
7
7
  * locale or selector (`{ item }`, `{ variant }`,
@@ -12,6 +12,5 @@ const getIntlayer = (key, localeOrSelector) => {
12
12
  return getIntlayer$1(key, localeOrSelector, getPlugins(locale));
13
13
  };
14
14
 
15
- //#endregion
16
15
  export { getIntlayer };
17
16
  //# sourceMappingURL=getIntlayer.mjs.map