react-intlayer 7.6.0-canary.0 → 8.0.0-canary.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 (206) hide show
  1. package/dist/assets/markdown/_fixture.md +896 -0
  2. package/dist/cjs/client/IntlayerProvider.cjs +30 -3
  3. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
  4. package/dist/cjs/client/format/index.cjs +2 -0
  5. package/dist/cjs/client/format/useIntl.cjs +45 -0
  6. package/dist/cjs/client/format/useIntl.cjs.map +1 -0
  7. package/dist/cjs/client/t.cjs +21 -2
  8. package/dist/cjs/client/t.cjs.map +1 -1
  9. package/dist/cjs/client/useIntlayer.cjs +16 -3
  10. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  11. package/dist/cjs/client/useLocale.cjs +27 -7
  12. package/dist/cjs/client/useLocale.cjs.map +1 -1
  13. package/dist/cjs/getDictionary.cjs +2 -0
  14. package/dist/cjs/getDictionary.cjs.map +1 -1
  15. package/dist/cjs/getIntlayer.cjs +2 -0
  16. package/dist/cjs/getIntlayer.cjs.map +1 -1
  17. package/dist/cjs/html/HTMLProvider.cjs +18 -0
  18. package/dist/cjs/html/HTMLProvider.cjs.map +1 -0
  19. package/dist/cjs/html/HTMLRenderer.cjs +59 -0
  20. package/dist/cjs/html/HTMLRenderer.cjs.map +1 -0
  21. package/dist/cjs/html/HTMLRendererPlugin.cjs +36 -0
  22. package/dist/cjs/html/HTMLRendererPlugin.cjs.map +1 -0
  23. package/dist/cjs/html/index.cjs +11 -0
  24. package/dist/cjs/html/types.cjs +0 -0
  25. package/dist/cjs/index.cjs +13 -1
  26. package/dist/cjs/markdown/MarkdownProvider.cjs +76 -5
  27. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  28. package/dist/cjs/markdown/MarkdownRenderer.cjs +192 -32
  29. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  30. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +33 -0
  31. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs.map +1 -0
  32. package/dist/cjs/markdown/index.cjs +19 -2
  33. package/dist/cjs/markdown/processor.cjs +61 -0
  34. package/dist/cjs/markdown/processor.cjs.map +1 -0
  35. package/dist/cjs/markdown/runtime.cjs +45 -0
  36. package/dist/cjs/markdown/runtime.cjs.map +1 -0
  37. package/dist/cjs/plugins.cjs +83 -7
  38. package/dist/cjs/plugins.cjs.map +1 -1
  39. package/dist/cjs/reactElement/renderReactElement.cjs +8 -8
  40. package/dist/cjs/reactElement/renderReactElement.cjs.map +1 -1
  41. package/dist/cjs/server/IntlayerServerProvider.cjs +2 -2
  42. package/dist/cjs/server/IntlayerServerProvider.cjs.map +1 -1
  43. package/dist/cjs/server/format/useIntl.cjs +44 -0
  44. package/dist/cjs/server/format/useIntl.cjs.map +1 -0
  45. package/dist/cjs/server/index.cjs +2 -0
  46. package/dist/esm/IntlayerNode.mjs +2 -2
  47. package/dist/esm/IntlayerNode.mjs.map +1 -1
  48. package/dist/esm/client/IntlayerProvider.mjs +30 -3
  49. package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
  50. package/dist/esm/client/format/index.mjs +2 -1
  51. package/dist/esm/client/format/useIntl.mjs +44 -0
  52. package/dist/esm/client/format/useIntl.mjs.map +1 -0
  53. package/dist/esm/client/t.mjs +21 -2
  54. package/dist/esm/client/t.mjs.map +1 -1
  55. package/dist/esm/client/useIntlayer.mjs +16 -3
  56. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  57. package/dist/esm/client/useLocale.mjs +27 -7
  58. package/dist/esm/client/useLocale.mjs.map +1 -1
  59. package/dist/esm/editor/IntlayerEditorProvider.mjs +3 -3
  60. package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
  61. package/dist/esm/getDictionary.mjs +3 -1
  62. package/dist/esm/getDictionary.mjs.map +1 -1
  63. package/dist/esm/getIntlayer.mjs +3 -1
  64. package/dist/esm/getIntlayer.mjs.map +1 -1
  65. package/dist/esm/html/HTMLProvider.mjs +16 -0
  66. package/dist/esm/html/HTMLProvider.mjs.map +1 -0
  67. package/dist/esm/html/HTMLRenderer.mjs +55 -0
  68. package/dist/esm/html/HTMLRenderer.mjs.map +1 -0
  69. package/dist/esm/html/HTMLRendererPlugin.mjs +35 -0
  70. package/dist/esm/html/HTMLRendererPlugin.mjs.map +1 -0
  71. package/dist/esm/html/index.mjs +5 -0
  72. package/dist/esm/html/types.mjs +0 -0
  73. package/dist/esm/index.mjs +5 -1
  74. package/dist/esm/markdown/MarkdownProvider.mjs +76 -5
  75. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  76. package/dist/esm/markdown/MarkdownRenderer.mjs +191 -32
  77. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  78. package/dist/esm/markdown/MarkdownRendererPlugin.mjs +31 -0
  79. package/dist/esm/markdown/MarkdownRendererPlugin.mjs.map +1 -0
  80. package/dist/esm/markdown/index.mjs +5 -2
  81. package/dist/esm/markdown/processor.mjs +54 -0
  82. package/dist/esm/markdown/processor.mjs.map +1 -0
  83. package/dist/esm/markdown/runtime.mjs +41 -0
  84. package/dist/esm/markdown/runtime.mjs.map +1 -0
  85. package/dist/esm/plugins.mjs +82 -8
  86. package/dist/esm/plugins.mjs.map +1 -1
  87. package/dist/esm/reactElement/renderReactElement.mjs +8 -8
  88. package/dist/esm/reactElement/renderReactElement.mjs.map +1 -1
  89. package/dist/esm/server/IntlayerServerProvider.mjs +2 -2
  90. package/dist/esm/server/IntlayerServerProvider.mjs.map +1 -1
  91. package/dist/esm/server/format/useIntl.mjs +42 -0
  92. package/dist/esm/server/format/useIntl.mjs.map +1 -0
  93. package/dist/esm/server/index.mjs +2 -1
  94. package/dist/types/IntlayerNode.d.ts.map +1 -1
  95. package/dist/types/UI/ContentSelector.d.ts.map +1 -1
  96. package/dist/types/client/IntlayerProvider.d.ts +50 -5
  97. package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
  98. package/dist/types/client/format/index.d.ts +2 -1
  99. package/dist/types/client/format/useCompact.d.ts +2 -3
  100. package/dist/types/client/format/useCompact.d.ts.map +1 -1
  101. package/dist/types/client/format/useCurrency.d.ts +2 -3
  102. package/dist/types/client/format/useCurrency.d.ts.map +1 -1
  103. package/dist/types/client/format/useDate.d.ts +0 -1
  104. package/dist/types/client/format/useDate.d.ts.map +1 -1
  105. package/dist/types/client/format/useIntl.d.ts +92 -0
  106. package/dist/types/client/format/useIntl.d.ts.map +1 -0
  107. package/dist/types/client/format/useList.d.ts +2 -3
  108. package/dist/types/client/format/useList.d.ts.map +1 -1
  109. package/dist/types/client/format/useNumber.d.ts +2 -3
  110. package/dist/types/client/format/useNumber.d.ts.map +1 -1
  111. package/dist/types/client/format/usePercentage.d.ts +2 -3
  112. package/dist/types/client/format/usePercentage.d.ts.map +1 -1
  113. package/dist/types/client/format/useRelativeTime.d.ts +2 -3
  114. package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
  115. package/dist/types/client/format/useUnit.d.ts +2 -3
  116. package/dist/types/client/format/useUnit.d.ts.map +1 -1
  117. package/dist/types/client/t.d.ts +21 -3
  118. package/dist/types/client/t.d.ts.map +1 -1
  119. package/dist/types/client/useDictionary.d.ts +2 -3
  120. package/dist/types/client/useDictionary.d.ts.map +1 -1
  121. package/dist/types/client/useDictionaryAsync.d.ts +0 -1
  122. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  123. package/dist/types/client/useDictionaryDynamic.d.ts +0 -1
  124. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  125. package/dist/types/client/useI18n.d.ts +0 -1
  126. package/dist/types/client/useI18n.d.ts.map +1 -1
  127. package/dist/types/client/useIntlayer.d.ts +18 -6
  128. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  129. package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
  130. package/dist/types/client/useLocale.d.ts +21 -1
  131. package/dist/types/client/useLocale.d.ts.map +1 -1
  132. package/dist/types/client/useLocaleBase.d.ts +5 -5
  133. package/dist/types/client/useLocaleBase.d.ts.map +1 -1
  134. package/dist/types/client/useLocaleStorage.d.ts +5 -6
  135. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  136. package/dist/types/client/useTraduction.d.ts +0 -1
  137. package/dist/types/client/useTraduction.d.ts.map +1 -1
  138. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
  139. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
  140. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -1
  141. package/dist/types/getDictionary.d.ts.map +1 -1
  142. package/dist/types/getIntlayer.d.ts.map +1 -1
  143. package/dist/types/html/HTMLProvider.d.ts +17 -0
  144. package/dist/types/html/HTMLProvider.d.ts.map +1 -0
  145. package/dist/types/html/HTMLRenderer.d.ts +46 -0
  146. package/dist/types/html/HTMLRenderer.d.ts.map +1 -0
  147. package/dist/types/html/HTMLRendererPlugin.d.ts +15 -0
  148. package/dist/types/html/HTMLRendererPlugin.d.ts.map +1 -0
  149. package/dist/types/html/index.d.ts +5 -0
  150. package/dist/types/html/types.d.ts +26 -0
  151. package/dist/types/html/types.d.ts.map +1 -0
  152. package/dist/types/index.d.ts +8 -2
  153. package/dist/types/index.d.ts.map +1 -1
  154. package/dist/types/markdown/MarkdownProvider.d.ts +42 -3
  155. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  156. package/dist/types/markdown/MarkdownRenderer.d.ts +251 -11
  157. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  158. package/dist/types/markdown/MarkdownRendererPlugin.d.ts +19 -0
  159. package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -0
  160. package/dist/types/markdown/index.d.ts +6 -3
  161. package/dist/types/markdown/processor.d.ts +92 -0
  162. package/dist/types/markdown/processor.d.ts.map +1 -0
  163. package/dist/types/markdown/runtime.d.ts +19 -0
  164. package/dist/types/markdown/runtime.d.ts.map +1 -0
  165. package/dist/types/plugins.d.ts +35 -13
  166. package/dist/types/plugins.d.ts.map +1 -1
  167. package/dist/types/reactElement/renderReactElement.d.ts +2 -2
  168. package/dist/types/reactElement/renderReactElement.d.ts.map +1 -1
  169. package/dist/types/server/IntlayerServerProvider.d.ts +2 -2
  170. package/dist/types/server/IntlayerServerProvider.d.ts.map +1 -1
  171. package/dist/types/server/format/useCompact.d.ts +0 -1
  172. package/dist/types/server/format/useCompact.d.ts.map +1 -1
  173. package/dist/types/server/format/useCurrency.d.ts +0 -1
  174. package/dist/types/server/format/useCurrency.d.ts.map +1 -1
  175. package/dist/types/server/format/useDate.d.ts +0 -1
  176. package/dist/types/server/format/useDate.d.ts.map +1 -1
  177. package/dist/types/server/format/useIntl.d.ts +92 -0
  178. package/dist/types/server/format/useIntl.d.ts.map +1 -0
  179. package/dist/types/server/format/useList.d.ts +0 -1
  180. package/dist/types/server/format/useList.d.ts.map +1 -1
  181. package/dist/types/server/format/useNumber.d.ts +0 -1
  182. package/dist/types/server/format/useNumber.d.ts.map +1 -1
  183. package/dist/types/server/format/usePercentage.d.ts +0 -1
  184. package/dist/types/server/format/usePercentage.d.ts.map +1 -1
  185. package/dist/types/server/format/useRelativeTime.d.ts +0 -1
  186. package/dist/types/server/format/useRelativeTime.d.ts.map +1 -1
  187. package/dist/types/server/format/useUnit.d.ts +0 -1
  188. package/dist/types/server/format/useUnit.d.ts.map +1 -1
  189. package/dist/types/server/index.d.ts +2 -1
  190. package/dist/types/server/serverContext.d.ts +0 -1
  191. package/dist/types/server/serverContext.d.ts.map +1 -1
  192. package/dist/types/server/t.d.ts +0 -1
  193. package/dist/types/server/t.d.ts.map +1 -1
  194. package/dist/types/server/useDictionary.d.ts +2 -3
  195. package/dist/types/server/useDictionary.d.ts.map +1 -1
  196. package/dist/types/server/useDictionaryAsync.d.ts +2 -3
  197. package/dist/types/server/useDictionaryAsync.d.ts.map +1 -1
  198. package/dist/types/server/useDictionaryDynamic.d.ts +0 -1
  199. package/dist/types/server/useDictionaryDynamic.d.ts.map +1 -1
  200. package/dist/types/server/useI18n.d.ts +0 -1
  201. package/dist/types/server/useI18n.d.ts.map +1 -1
  202. package/dist/types/server/useIntlayer.d.ts +3 -3
  203. package/dist/types/server/useIntlayer.d.ts.map +1 -1
  204. package/dist/types/server/useLoadDynamic.d.ts.map +1 -1
  205. package/dist/types/server/useLocale.d.ts.map +1 -1
  206. package/package.json +22 -12
@@ -0,0 +1,92 @@
1
+ import { LocalesValues } from "@intlayer/types";
2
+
3
+ //#region src/client/format/useIntl.d.ts
4
+ /**
5
+ * React client hook that provides a locale-bound `Intl` object.
6
+ *
7
+ * It acts exactly like the native `Intl` object, but acts as a proxy to:
8
+ * 1. Inject the current locale automatically if none is provided.
9
+ * 2. Use the performance-optimized `CachedIntl` under the hood.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * const intl = useIntl(); // uses context locale
14
+ *
15
+ * // Standard API, but no need to pass 'en-US' as the first argument
16
+ * const formatted = new intl.NumberFormat({
17
+ * style: 'currency',
18
+ * currency: 'USD'
19
+ * }).format(123.45);
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * const intl = useIntl();
25
+ *
26
+ * // You can still override the locale if needed
27
+ * const date = new intl.DateTimeFormat({ locale: 'fr-FR' }).format(new Date());
28
+ * // or
29
+ * const date2 = new intl.DateTimeFormat('fr-FR').format(new Date());
30
+ * ```
31
+ */
32
+ declare const useIntl: (locale?: LocalesValues) => {
33
+ Collator: {
34
+ new (locales?: LocalesValues, options?: Intl.CollatorOptions): Intl.Collator;
35
+ new (options?: Intl.CollatorOptions & {
36
+ locale?: LocalesValues;
37
+ }): Intl.Collator;
38
+ };
39
+ NumberFormat: {
40
+ new (locales?: LocalesValues, options?: Intl.NumberFormatOptions): Intl.NumberFormat;
41
+ new (options?: Intl.NumberFormatOptions & {
42
+ locale?: LocalesValues;
43
+ }): Intl.NumberFormat;
44
+ };
45
+ DateTimeFormat: {
46
+ new (locales?: LocalesValues, options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
47
+ new (options?: Intl.DateTimeFormatOptions & {
48
+ locale?: LocalesValues;
49
+ }): Intl.DateTimeFormat;
50
+ };
51
+ getCanonicalLocales: typeof Intl.getCanonicalLocales;
52
+ readonly PluralRules: {
53
+ new (locales?: LocalesValues, options?: Intl.PluralRulesOptions): Intl.PluralRules;
54
+ new (options?: Intl.PluralRulesOptions & {
55
+ locale?: LocalesValues;
56
+ }): Intl.PluralRules;
57
+ };
58
+ readonly RelativeTimeFormat: {
59
+ new (locales?: LocalesValues, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat;
60
+ new (options?: Intl.RelativeTimeFormatOptions & {
61
+ locale?: LocalesValues;
62
+ }): Intl.RelativeTimeFormat;
63
+ };
64
+ readonly Locale: {
65
+ new (locales?: LocalesValues, options?: Intl.LocaleOptions): Intl.Locale;
66
+ new (options?: Intl.LocaleOptions & {
67
+ locale?: LocalesValues;
68
+ }): Intl.Locale;
69
+ };
70
+ readonly DisplayNames: {
71
+ new (locales?: LocalesValues, options?: Intl.DisplayNamesOptions): Intl.DisplayNames;
72
+ new (options?: Intl.DisplayNamesOptions & {
73
+ locale?: LocalesValues;
74
+ }): Intl.DisplayNames;
75
+ };
76
+ readonly ListFormat: {
77
+ new (locales?: LocalesValues, options?: Intl.ListFormatOptions): Intl.ListFormat;
78
+ new (options?: Intl.ListFormatOptions & {
79
+ locale?: LocalesValues;
80
+ }): Intl.ListFormat;
81
+ };
82
+ supportedValuesOf: typeof Intl.supportedValuesOf;
83
+ readonly Segmenter: {
84
+ new (locales?: LocalesValues, options?: Intl.SegmenterOptions): Intl.Segmenter;
85
+ new (options?: Intl.SegmenterOptions & {
86
+ locale?: LocalesValues;
87
+ }): Intl.Segmenter;
88
+ };
89
+ };
90
+ //#endregion
91
+ export { useIntl };
92
+ //# sourceMappingURL=useIntl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../../src/client/format/useIntl.ts"],"mappings":";;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,OAAA,GAAW,MAAA,GAAS,aAAA"}
@@ -1,7 +1,6 @@
1
- import * as _intlayer_types3 from "@intlayer/types";
1
+ import * as _intlayer_types11 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/format/useList.d.ts
4
-
5
4
  /**
6
5
  * React client hook that provides a list formatter
7
6
  * bound to the current application locale.
@@ -24,7 +23,7 @@ import * as _intlayer_types3 from "@intlayer/types";
24
23
  * ```
25
24
  */
26
25
  declare const useList: () => (values: (string | number)[], options?: Intl.ListFormatOptions & {
27
- locale?: _intlayer_types3.LocalesValues;
26
+ locale?: _intlayer_types11.LocalesValues;
28
27
  }) => string;
29
28
  //#endregion
30
29
  export { useList };
@@ -1 +1 @@
1
- {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":[],"mappings":";;;;;;;AA2BA;;;;;;;;;;;;;;;;;;cAAa,uDAAO,IAAA,CAAA;WAAA,gBAAA,CAAA"}
1
+ {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;cAAa,OAAA,SAAO,MAAA,uBAAA,OAAA,GAAA,IAAA,CAAA,iBAAA;WAAA,iBAAA,CAAA,aAAA;AAAA"}
@@ -1,7 +1,6 @@
1
- import * as _intlayer_types5 from "@intlayer/types";
1
+ import * as _intlayer_types13 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/format/useNumber.d.ts
4
-
5
4
  /**
6
5
  * React client hook that provides a localized number formatter.
7
6
  *
@@ -25,7 +24,7 @@ import * as _intlayer_types5 from "@intlayer/types";
25
24
  * A number formatting function bound to the active locale.
26
25
  */
27
26
  declare const useNumber: () => (value: string | number, options?: Intl.NumberFormatOptions & {
28
- locale?: _intlayer_types5.LocalesValues;
27
+ locale?: _intlayer_types13.LocalesValues;
29
28
  }) => string;
30
29
  //#endregion
31
30
  export { useNumber };
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":[],"mappings":";;;;;;;AA4BA;;;;;;;;;;;;;;;;;;;cAAa,oDAAS,IAAA,CAAA;WAAA,gBAAA,CAAA"}
1
+ {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"mappings":";;;;;;AA4BA;;;;;;;;;;;;;;;;;;;cAAa,SAAA,SAAS,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,iBAAA,CAAA,aAAA;AAAA"}
@@ -1,7 +1,6 @@
1
- import * as _intlayer_types4 from "@intlayer/types";
1
+ import * as _intlayer_types15 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/format/usePercentage.d.ts
4
-
5
4
  /**
6
5
  * React hook to provide a percentage formatter function
7
6
  * based on the current application locale.
@@ -21,7 +20,7 @@ import * as _intlayer_types4 from "@intlayer/types";
21
20
  * A function that formats numbers or numeric strings into localized percentages.
22
21
  */
23
22
  declare const usePercentage: () => (value: string | number, options?: Intl.NumberFormatOptions & {
24
- locale?: _intlayer_types4.LocalesValues;
23
+ locale?: _intlayer_types15.LocalesValues;
25
24
  }) => string;
26
25
  //#endregion
27
26
  export { usePercentage };
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,wDAAa,IAAA,CAAA;WAAA,gBAAA,CAAA"}
1
+ {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,aAAA,SAAa,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,iBAAA,CAAA,aAAA;AAAA"}
@@ -1,7 +1,6 @@
1
- import * as _intlayer_types2 from "@intlayer/types";
1
+ import * as _intlayer_types14 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/format/useRelativeTime.d.ts
4
-
5
4
  /**
6
5
  * Client-side React hook for accessing a localized relative time formatter.
7
6
  *
@@ -21,7 +20,7 @@ import * as _intlayer_types2 from "@intlayer/types";
21
20
  * bound to the current client locale.
22
21
  */
23
22
  declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
24
- locale?: _intlayer_types2.LocalesValues;
23
+ locale?: _intlayer_types14.LocalesValues;
25
24
  unit?: Intl.RelativeTimeFormatUnit;
26
25
  }) => string;
27
26
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,gDAAe,6BAAA,gBAAA,IAAA,CAAA;WAAA,gBAAA,CAAA"}
1
+ {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,eAAA,SAAe,IAAA,oBAAA,IAAA,EAAA,EAAA,qBAAA,IAAA,EAAA,OAAA,GAAA,IAAA,CAAA,yBAAA;WAAA,iBAAA,CAAA,aAAA"}
@@ -1,7 +1,6 @@
1
- import * as _intlayer_types7 from "@intlayer/types";
1
+ import * as _intlayer_types0 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/format/useUnit.d.ts
4
-
5
4
  /**
6
5
  * React hook that provides a unit formatting function
7
6
  * based on the current locale from {@link useLocaleBase}.
@@ -20,7 +19,7 @@ import * as _intlayer_types7 from "@intlayer/types";
20
19
  * @returns {Function} A unit formatting function that accepts a value and optional formatting options.
21
20
  */
22
21
  declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
23
- locale?: _intlayer_types7.LocalesValues;
22
+ locale?: _intlayer_types0.LocalesValues;
24
23
  }) => string;
25
24
  //#endregion
26
25
  export { useUnit };
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuBA;;;;;;;;;;;;;;cAAa,kDAAO,IAAA,CAAA;WAAA,gBAAA,CAAA"}
1
+ {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;cAAa,OAAA,SAAO,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,gBAAA,CAAA,aAAA;AAAA"}
@@ -1,11 +1,29 @@
1
1
  import { LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
2
2
 
3
3
  //#region src/client/t.d.ts
4
-
5
4
  /**
6
- * On the client side, this function returns the translation of the provided multilang content.
5
+ * Client-side translation function that returns the translation of the provided multilang content.
6
+ *
7
+ * If the locale is not provided, it will use the locale from the client context.
8
+ *
9
+ * @param multilangContent - An object mapping locales to their respective content.
10
+ * @param locale - Optional locale to override the current context locale.
11
+ * @returns The translation for the specified locale.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { t } from 'react-intlayer';
16
+ *
17
+ * const MyComponent = () => {
18
+ * const greeting = t({
19
+ * en: 'Hello',
20
+ * fr: 'Bonjour',
21
+ * es: 'Hola',
22
+ * });
7
23
  *
8
- * If the locale is not provided, it will use the locale from the client context
24
+ * return <h1>{greeting}</h1>;
25
+ * };
26
+ * ```
9
27
  */
10
28
  declare const t: <Content = string>(multilangContent: StrictModeLocaleMap<Content>, locale?: LocalesValues) => Content;
11
29
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/client/t.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;AAEW,cAFE,CAEF,EAAA,CAAA,UAAA,MAAA,CAAA,CAAA,gBAAA,EADS,mBACT,CAD6B,OAC7B,CAAA,EAAA,MAAA,CAAA,EAAA,aAAA,EAAA,GAAa,OAAb"}
1
+ {"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/client/t.ts"],"mappings":";;;;;AA+BA;;;;;;;;;;;;;;;;;;;;;;cAAa,CAAA,qBACX,gBAAA,EAAkB,mBAAA,CAAoB,OAAA,GACtC,MAAA,GAAS,aAAA,KAAa,OAAA"}
@@ -1,15 +1,14 @@
1
1
  import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
2
- import * as _intlayer_core5 from "@intlayer/core";
2
+ import * as _intlayer_core0 from "@intlayer/core";
3
3
  import { DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
4
4
 
5
5
  //#region src/client/useDictionary.d.ts
6
-
7
6
  /**
8
7
  * On the server side, Hook that transform a dictionary and return the content
9
8
  *
10
9
  * If the locale is not provided, it will use the locale from the client context
11
10
  */
12
- declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core5.DeepTransformContent<T["content"], IInterpreterPluginState$1, L>;
11
+ declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1, L>;
13
12
  //#endregion
14
13
  export { useDictionary };
15
14
  //# sourceMappingURL=useDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAgBA;AACY,cADC,aACD,EAAA,CAAA,UAAA,UAAA,EAAA,UACA,aADA,GACgB,eADhB,CAAA,CAAA,UAAA,EAGE,CAHF,EAAA,MAAA,CAAA,EAID,CAJC,EAAA,GAIA,eAAA,CAAA,oBAJA,CAIA,CAJA,CAAA,SAAA,CAAA,EAIA,yBAAA,EAAA,CAJA,CAAA"}
1
+ {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;AAgBA;cAAa,aAAA,aACD,UAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,UAAA,EAAY,CAAA,EACZ,MAAA,GAAS,CAAA,KAAC,eAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,yBAAA,EAAA,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { DeclaredLocales, Dictionary, LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
2
2
 
3
3
  //#region src/client/useDictionaryAsync.d.ts
4
-
5
4
  /**
6
5
  * On the server side, Hook that transform a dictionary and return the content
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":[],"mappings":";;;;;;AAkBA;;;AAE4B,cAFf,kBAEe,EAAA,CAAA,UADhB,UACgB,EAAA,UAAhB,aAAgB,GAAA,eAAA,CAAA,CAAA,iBAAA,EAEP,mBAFO,CAAA,GAAA,GAEmB,OAFnB,CAE2B,CAF3B,CAAA,CAAA,EAAA,MAAA,CAAA,EAGjB,CAHiB,EAAA,GAIzB,OAJyB,CAIjB,CAJiB,CAAA"}
1
+ {"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"mappings":";;;;;AAkBA;;;cAAa,kBAAA,aACD,UAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,MAAA,GAAS,CAAA,KACR,OAAA,CAAQ,CAAA"}
@@ -3,7 +3,6 @@ import * as _intlayer_core0 from "@intlayer/core";
3
3
  import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
4
4
 
5
5
  //#region src/client/useDictionaryDynamic.d.ts
6
-
7
6
  /**
8
7
  * On the server side, Hook that transform a dictionary and return the content
9
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../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A,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;AAmBA;cAAa,oBAAA,aACD,UAAA,YACA,cAAA,EAEV,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,aAAA,KAAa,eAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,yBAAA"}
@@ -3,7 +3,6 @@ import { ValidDotPathsFor } from "@intlayer/core";
3
3
  import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, GetSubPath, LocalesValues } from "@intlayer/types";
4
4
 
5
5
  //#region src/client/useI18n.d.ts
6
-
7
6
  /**
8
7
  * Hook that provides a translation function `t()` for accessing nested content by key.
9
8
  * This hook mimics the pattern found in libraries like i18next, next-intl, and vue-i18n.
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.d.ts","names":[],"sources":["../../../src/client/useI18n.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+BA;;;;;;;;;;;;;;;cAAa,oBACD,0BACA,gBAAgB,4BAEf,YACF,iBAkBY,iBAAiB,UAC9B,MAEL,WAAW,uBAAqB,0BAA0B,KAAK"}
1
+ {"version":3,"file":"useI18n.d.ts","names":[],"sources":["../../../src/client/useI18n.ts"],"mappings":";;;;;;;AA+BA;;;;;;;;;;;;;;;cAAa,OAAA,aACD,cAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,SAAA,EAAW,CAAA,EACX,MAAA,GAAS,CAAA,gBAkBY,gBAAA,CAAiB,CAAA,GAAE,IAAA,EAChC,CAAA,KAEL,UAAA,CAAW,sBAAA,CAAqB,yBAAA,CAA0B,CAAA,IAAK,CAAA"}
@@ -1,18 +1,30 @@
1
1
  import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
2
- import * as _intlayer_core0 from "@intlayer/core";
2
+ import * as _intlayer_core1 from "@intlayer/core";
3
3
  import * as _intlayer_types0 from "@intlayer/types";
4
4
  import { DeclaredLocales, DictionaryKeys, LocalesValues } from "@intlayer/types";
5
5
 
6
6
  //#region src/client/useIntlayer.d.ts
7
-
8
7
  /**
9
- * On the client side, Hook that picking one dictionary by its key and return the content
8
+ * Client-side hook that picks one dictionary by its key and returns its content.
9
+ *
10
+ * If the locale is not provided, it will use the locale from the client context.
11
+ *
12
+ * @param key - The unique key of the dictionary to retrieve.
13
+ * @param locale - Optional locale to override the current context locale.
14
+ * @returns The dictionary content for the specified locale.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { useIntlayer } from 'react-intlayer';
10
19
  *
11
- * If the locale is not provided, it will use the locale from the client context
20
+ * const MyComponent = () => {
21
+ * const content = useIntlayer('my-dictionary-key');
12
22
  *
13
- * When you need the raw string for attributes like `aria-label`, access the `.value` property of the returned content
23
+ * return <div>{content.myField.value}</div>;
24
+ * };
25
+ * ```
14
26
  */
15
- declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => _intlayer_core0.DeepTransformContent<_intlayer_types0.DictionaryRegistryContent<T>, IInterpreterPluginState$1, L>;
27
+ declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => _intlayer_core1.DeepTransformContent<_intlayer_types0.DictionaryRegistryContent<T>, IInterpreterPluginState$1, L>;
16
28
  //#endregion
17
29
  export { useIntlayer };
18
30
  //# sourceMappingURL=useIntlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;AAkBA;;AAEY,cAFC,WAED,EAAA,CAAA,UADA,cACA,EAAA,UAAA,aAAA,GAAgB,eAAhB,CAAA,CAAA,GAAA,EAEL,CAFK,EAAA,MAAA,CAAA,EAGD,CAHC,EAAA,GAGA,eAAA,CAAA,oBAHA,CAGA,gBAAA,CAAA,yBAHA,CAGA,CAHA,CAAA,EAGA,yBAAA,EAAA,CAHA,CAAA"}
1
+ {"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"mappings":";;;;;;;;;;;AA+BA;;;;;;;;;;;;;;;cAAa,WAAA,aACD,cAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,CAAA,KAAC,eAAA,CAAA,oBAAA,CAAA,gBAAA,CAAA,yBAAA,CAAA,CAAA,GAAA,yBAAA,EAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadDynamic.d.ts","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":[],"mappings":";cA2Ba,0CAA2C,QAAQ,OAAK"}
1
+ {"version":3,"file":"useLoadDynamic.d.ts","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"mappings":";cA2Ba,cAAA,MAAqB,GAAA,UAAa,OAAA,EAAS,OAAA,CAAQ,CAAA,MAAK,CAAA"}
@@ -12,7 +12,27 @@ type UseLocaleResult = {
12
12
  setLocale: (locale: LocalesValues) => void;
13
13
  };
14
14
  /**
15
- * On the client side, hook to get the current locale and all related fields
15
+ * Client-side hook to get the current locale and related locale management functions.
16
+ *
17
+ * @param props - Optional properties for the hook.
18
+ * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * import { useLocale } from 'react-intlayer';
23
+ *
24
+ * const LocaleSwitcher = () => {
25
+ * const { locale, setLocale, availableLocales } = useLocale();
26
+ *
27
+ * return (
28
+ * <select value={locale} onChange={(e) => setLocale(e.target.value)}>
29
+ * {availableLocales.map((loc) => (
30
+ * <option key={loc} value={loc}>{loc}</option>
31
+ * ))}
32
+ * </select>
33
+ * );
34
+ * };
35
+ * ```
16
36
  */
17
37
  declare const useLocale: ({
18
38
  isCookieEnabled,
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":[],"mappings":";;;KAQK,cAAA;;EAAA,cAAA,CAAA,EAAc,CAAA,MAAA,EAES,aAAA,EAAA,GAAa,IAAA;AAAA,CAAA;KAGpC,eAAA,GACK;EACO,MAAA,EADP,eACO;EACG,aAAA,EADH,eACG;EACE,gBAAA,EADF,eACE,EAAA;EAAa,SAAA,EAAA,CAAA,MAAA,EAAb,aAAa,EAAA,GAAA,IAAA;AAMnC,CAAA;;;;AAGyB,cAHZ,SAGY,EAAA,CAAA;EAAA,eAAA;EAAA;AAAA,CAAA,CAAA,EAAtB,cAAsB,EAAA,GAAA,eAAA"}
1
+ {"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;;KAQK,cAAA;EACH,eAAA;EACA,cAAA,IAAkB,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGvB,eAAA;EACH,MAAA,EAAQ,eAAA;EACR,aAAA,EAAe,eAAA;EACf,gBAAA,EAAkB,eAAA;EAClB,SAAA,GAAY,MAAA,EAAQ,aAAA;AAAA;;;AAPmB;;;;;;;;;;;;;;;;;;;;AAiCzC;cAAa,SAAA;EAAa,eAAA;EAAA;AAAA,IAGvB,cAAA,KAAsB,eAAA"}
@@ -1,14 +1,14 @@
1
- import * as _intlayer_types8 from "@intlayer/types";
1
+ import * as _intlayer_types1 from "@intlayer/types";
2
2
 
3
3
  //#region src/client/useLocaleBase.d.ts
4
4
  /**
5
5
  * On the client side, hook to get the current locale and all related fields
6
6
  */
7
7
  declare const useLocaleBase: () => {
8
- locale: _intlayer_types8.LocalesValues;
9
- defaultLocale: _intlayer_types8.Locale;
10
- availableLocales: _intlayer_types8.Locale[];
11
- setLocale: (newLocale: _intlayer_types8.LocalesValues) => void;
8
+ locale: _intlayer_types1.LocalesValues;
9
+ defaultLocale: _intlayer_types1.Locale;
10
+ availableLocales: _intlayer_types1.Locale[];
11
+ setLocale: (newLocale: _intlayer_types1.LocalesValues) => void;
12
12
  };
13
13
  //#endregion
14
14
  export { useLocaleBase };
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":[],"mappings":";;;;;;AAYa,cAAA,aASZ,EAAA,GAAA,GAAA;EAAA,MAAA,EAAA,gBAAA,CAAA,aAAA"}
1
+ {"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":";;;;;;cAYa,aAAA;UASZ,gBAAA,CAAA,aAAA"}
@@ -1,21 +1,20 @@
1
- import * as _intlayer_types12 from "@intlayer/types";
1
+ import * as _intlayer_types5 from "@intlayer/types";
2
2
  import { LocalesValues } from "@intlayer/types";
3
3
 
4
4
  //#region src/client/useLocaleStorage.d.ts
5
-
6
5
  /**
7
6
  * Get the locale cookie
8
7
  */
9
8
  /**
10
9
  * Get the locale cookie
11
10
  */
12
- declare const localeInStorage: _intlayer_types12.Locale;
11
+ declare const localeInStorage: _intlayer_types5.Locale;
13
12
  /**
14
13
  * @deprecated Use localeInStorage instead
15
14
  *
16
15
  * Get the locale cookie
17
16
  */
18
- declare const localeCookie: _intlayer_types12.Locale;
17
+ declare const localeCookie: _intlayer_types5.Locale;
19
18
  /**
20
19
  * Set the locale cookie
21
20
  */
@@ -30,7 +29,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?: boolean
30
29
  * Hook that provides the locale cookie and a function to set it
31
30
  */
32
31
  declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
33
- getLocale: () => _intlayer_types12.Locale;
32
+ getLocale: () => _intlayer_types5.Locale;
34
33
  setLocale: (locale: LocalesValues) => void;
35
34
  };
36
35
  /**
@@ -41,7 +40,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
41
40
  * Hook that provides the locale cookie and a function to set it
42
41
  */
43
42
  declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
44
- localeCookie: _intlayer_types12.Locale;
43
+ localeCookie: _intlayer_types5.Locale;
45
44
  setLocaleCookie: (locale: LocalesValues) => void;
46
45
  };
47
46
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAeA;AAMA;AAKA;AAca,cAzBA,eAYH,EAZ+D,iBAAA,CAA7C,MAYL;AAkBvB;AAiBA;;;;cAzCa,cAA8B,iBAAA,CAAlB;;;;cAKZ,6BACH;;;;;;cAaG,0BAbH;;;;cAkBG;mBAQV,iBAAA,CAAA;sBAAA;;;;;;;;;cASU;gBAOZ,iBAAA,CAAA;4BAAA"}
1
+ {"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;;;AAeA;;;AAAA,cAAa,eAAA,EAA4D,gBAAA,CAA7C,MAAA;;AAM5B;;;;cAAa,YAAA,EAA8B,gBAAA,CAAlB,MAAA;AAKzB;;;AAAA,cAAa,kBAAA,GACX,MAAA,EAAQ,aAAA,EACR,eAAA;;;;;;cAYW,eAAA,GAAe,MAAA,EAblB,aAAA,EAAa,eAAA;;;;cAkBV,gBAAA,GAAoB,eAAA;mBAQ9B,gBAAA,CAAA,MAAA;sBAAA,aAAA;AAAA;;AARH;;;;;;cAiBa,eAAA,GAAmB,eAAA;gBAO/B,gBAAA,CAAA,MAAA;4BAAA,aAAA;AAAA"}
@@ -1,7 +1,6 @@
1
1
  import { StrictModeLocaleMap } from "@intlayer/types";
2
2
 
3
3
  //#region src/client/useTraduction.d.ts
4
-
5
4
  /**
6
5
  * On the client side, Hook that picking one dictionary by its id and return the content.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,oDACM,oBAAoB,aACpC"}
1
+ {"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"mappings":";;;;;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,cAAA,qBACX,eAAA,EAAiB,mBAAA,CAAoB,OAAA,MACpC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelectorWrapper.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.tsx"],"sourcesContent":[],"mappings":";;;;KAcY,2BAAA,GAA8B,YACxC,KAAK,eAAe;cAqET,yBAAyB,GAAG"}
1
+ {"version":3,"file":"ContentSelectorWrapper.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.tsx"],"mappings":";;;;KAcY,2BAAA,GAA8B,SAAA,GACxC,IAAA,CAAK,cAAA,CAAe,cAAA;AAAA,cAqET,uBAAA,EAAyB,EAAA,CAAG,2BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerEditorProvider.d.ts","names":[],"sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"sourcesContent":[],"mappings":";;;cAqDa,wBAAwB,GAAG"}
1
+ {"version":3,"file":"IntlayerEditorProvider.d.ts","names":[],"sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"mappings":";;;cAqDa,sBAAA,EAAwB,EAAA,CAAG,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEditedContentRenderer.d.ts","names":[],"sources":["../../../src/editor/useEditedContentRenderer.tsx"],"sourcesContent":[],"mappings":";;;;KAQK,0BAAA;;EAAA,OAAA,EAEM,OAFN,EAAA;EAOQ,QAAA,EAAA,MAAA;EAA4B,MAAA,CAAA,EAH9B,MAG8B;CAAA;AAAA,cAA5B,wBAA4B,EAAA,CAAA;EAAA,aAAA;EAAA,OAAA;EAAA;AAAA,CAAA,EAItC,0BAJsC,EAAA,GAAA,MAAA;AAItC,cAiBU,qBAjBV,EAiBiC,EAjBjC,CAiBoC,0BAjBpC,CAAA"}
1
+ {"version":3,"file":"useEditedContentRenderer.d.ts","names":[],"sources":["../../../src/editor/useEditedContentRenderer.tsx"],"mappings":";;;;KAQK,0BAAA;EACH,aAAA;EACA,OAAA,EAAS,OAAA;EACT,QAAA;EACA,MAAA,GAAS,MAAA;AAAA;AAAA,cAGE,wBAAA;EAA4B,aAAA;EAAA,OAAA;EAAA;AAAA,GAItC,0BAAA;AAAA,cAiBU,qBAAA,EAAuB,EAAA,CAAG,0BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"sourcesContent":[],"mappings":";;;;;cAgBa,0BACD,sBACA,gBAAgB,6BAEd,YACH,uBACW,cACnB,uBAAqB,cAAc"}
1
+ {"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;cAkBa,aAAA,aACD,UAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,UAAA,EAAY,CAAA,EACZ,MAAA,GAAS,CAAA,EACT,iBAAA,GAAoB,OAAA,OACnB,sBAAA,CAAqB,CAAA,aAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../src/getIntlayer.ts"],"sourcesContent":[],"mappings":";;;;;cAca,wBACD,0BACA,gBAAgB,sBAErB,YACI,uBACW,cACnB,uBAAqB,0BAA0B,IAAI"}
1
+ {"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../src/getIntlayer.ts"],"mappings":";;;;;cAgBa,WAAA,aACD,cAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,CAAA,EACT,iBAAA,GAAoB,OAAA,OACnB,sBAAA,CAAqB,yBAAA,CAA0B,CAAA,GAAI,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { FC, PropsWithChildren } from "react";
2
+
3
+ //#region src/html/HTMLProvider.d.ts
4
+ type HTMLContextValue = {
5
+ components?: Record<string, any>;
6
+ };
7
+ type HTMLProviderProps = PropsWithChildren<{
8
+ /**
9
+ * Component overrides for HTML tags.
10
+ */
11
+ components?: Record<string, any>;
12
+ }>;
13
+ declare const useHTMLContext: () => HTMLContextValue;
14
+ declare const HTMLProvider: FC<HTMLProviderProps>;
15
+ //#endregion
16
+ export { HTMLProvider, useHTMLContext };
17
+ //# sourceMappingURL=HTMLProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTMLProvider.d.ts","names":[],"sources":["../../../src/html/HTMLProvider.tsx"],"mappings":";;;KASK,gBAAA;EACH,UAAA,GAAa,MAAA;AAAA;AAAA,KAGV,iBAAA,GAAoB,iBAAA;;;;EAIvB,UAAA,GAAa,MAAA;AAAA;AAAA,cAKF,cAAA,QAAc,gBAAA;AAAA,cAEd,YAAA,EAAc,EAAA,CAAG,iBAAA"}
@@ -0,0 +1,46 @@
1
+ import { ReactHTMLComponent } from "./types.js";
2
+ import { FC, JSX } from "react";
3
+
4
+ //#region src/html/HTMLRenderer.d.ts
5
+ declare const defaultHTMLComponents: Record<string, ReactHTMLComponent>;
6
+ type RenderHTMLProps = {
7
+ /**
8
+ * Component overrides for HTML tags.
9
+ * Allows you to customize how specific HTML elements are rendered.
10
+ */
11
+ components?: Record<string, any>;
12
+ };
13
+ /**
14
+ * Renders HTML-like content to JSX with the provided components.
15
+ *
16
+ * This function does not use context from HTMLProvider. Use `useHTMLRenderer`
17
+ * hook if you want to leverage provider context.
18
+ */
19
+ declare const renderHTML: (content: string, {
20
+ components
21
+ }?: RenderHTMLProps) => JSX.Element;
22
+ /**
23
+ * Hook that returns a function to render HTML content.
24
+ *
25
+ * This hook considers the configuration from the `HTMLProvider` context if available,
26
+ * falling back to the provided components.
27
+ */
28
+ declare const useHTMLRenderer: ({
29
+ components
30
+ }?: RenderHTMLProps) => (content: string) => JSX.Element;
31
+ type HTMLRendererProps = RenderHTMLProps & {
32
+ /**
33
+ * The HTML content to render as a string.
34
+ */
35
+ children: string;
36
+ };
37
+ /**
38
+ * React component that renders HTML-like content to JSX.
39
+ *
40
+ * This component uses the components from the `HTMLProvider` context
41
+ * if available.
42
+ */
43
+ declare const HTMLRenderer: FC<HTMLRendererProps>;
44
+ //#endregion
45
+ export { HTMLRenderer, HTMLRendererProps, RenderHTMLProps, defaultHTMLComponents, renderHTML, useHTMLRenderer };
46
+ //# sourceMappingURL=HTMLRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTMLRenderer.d.ts","names":[],"sources":["../../../src/html/HTMLRenderer.tsx"],"mappings":";;;;cAuBa,qBAAA,EAAqB,MAAA,SAAA,kBAAA;AAAA,KAEtB,eAAA;EAFC;;;;EAOX,UAAA,GAAa,MAAA;AAAA;;;;;AASf;;cAAa,UAAA,GACX,OAAA;EACA;AAAA,IAAgB,eAAA,KACf,GAAA,CAAI,OAAA;;;;;;;cAyBM,eAAA;EAAmB;AAAA,IAAgB,eAAA,MAGtC,OAAA,aAAe,GAAA,CAAA,OAAA;AAAA,KAUb,iBAAA,GAAoB,eAAA;EAvCd;;;EA2ChB,QAAA;AAAA;AAjBF;;;;;;AAAA,cA0Ba,YAAA,EAAc,EAAA,CAAG,iBAAA"}
@@ -0,0 +1,15 @@
1
+ import { FC } from "react";
2
+ import { KeyPath, Locale } from "@intlayer/types";
3
+
4
+ //#region src/html/HTMLRendererPlugin.d.ts
5
+ type HTMLRendererPluginProps = {
6
+ dictionaryKey: string;
7
+ keyPath: KeyPath[];
8
+ html: string;
9
+ locale?: Locale;
10
+ userComponents?: Record<string, any>;
11
+ };
12
+ declare const HTMLRendererPlugin: FC<HTMLRendererPluginProps>;
13
+ //#endregion
14
+ export { HTMLRendererPlugin };
15
+ //# sourceMappingURL=HTMLRendererPlugin.d.ts.map