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.
- package/dist/assets/markdown/_fixture.md +896 -0
- package/dist/cjs/client/IntlayerProvider.cjs +30 -3
- package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
- package/dist/cjs/client/format/index.cjs +2 -0
- package/dist/cjs/client/format/useIntl.cjs +45 -0
- package/dist/cjs/client/format/useIntl.cjs.map +1 -0
- package/dist/cjs/client/t.cjs +21 -2
- package/dist/cjs/client/t.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs +16 -3
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/client/useLocale.cjs +27 -7
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs +2 -0
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs +2 -0
- package/dist/cjs/getIntlayer.cjs.map +1 -1
- package/dist/cjs/html/HTMLProvider.cjs +18 -0
- package/dist/cjs/html/HTMLProvider.cjs.map +1 -0
- package/dist/cjs/html/HTMLRenderer.cjs +59 -0
- package/dist/cjs/html/HTMLRenderer.cjs.map +1 -0
- package/dist/cjs/html/HTMLRendererPlugin.cjs +36 -0
- package/dist/cjs/html/HTMLRendererPlugin.cjs.map +1 -0
- package/dist/cjs/html/index.cjs +11 -0
- package/dist/cjs/html/types.cjs +0 -0
- package/dist/cjs/index.cjs +13 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs +76 -5
- package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +192 -32
- package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
- package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +33 -0
- package/dist/cjs/markdown/MarkdownRendererPlugin.cjs.map +1 -0
- package/dist/cjs/markdown/index.cjs +19 -2
- package/dist/cjs/markdown/processor.cjs +61 -0
- package/dist/cjs/markdown/processor.cjs.map +1 -0
- package/dist/cjs/markdown/runtime.cjs +45 -0
- package/dist/cjs/markdown/runtime.cjs.map +1 -0
- package/dist/cjs/plugins.cjs +83 -7
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/cjs/reactElement/renderReactElement.cjs +8 -8
- package/dist/cjs/reactElement/renderReactElement.cjs.map +1 -1
- package/dist/cjs/server/IntlayerServerProvider.cjs +2 -2
- package/dist/cjs/server/IntlayerServerProvider.cjs.map +1 -1
- package/dist/cjs/server/format/useIntl.cjs +44 -0
- package/dist/cjs/server/format/useIntl.cjs.map +1 -0
- package/dist/cjs/server/index.cjs +2 -0
- package/dist/esm/IntlayerNode.mjs +2 -2
- package/dist/esm/IntlayerNode.mjs.map +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +30 -3
- package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
- package/dist/esm/client/format/index.mjs +2 -1
- package/dist/esm/client/format/useIntl.mjs +44 -0
- package/dist/esm/client/format/useIntl.mjs.map +1 -0
- package/dist/esm/client/t.mjs +21 -2
- package/dist/esm/client/t.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs +16 -3
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +27 -7
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/editor/IntlayerEditorProvider.mjs +3 -3
- package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
- package/dist/esm/getDictionary.mjs +3 -1
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs +3 -1
- package/dist/esm/getIntlayer.mjs.map +1 -1
- package/dist/esm/html/HTMLProvider.mjs +16 -0
- package/dist/esm/html/HTMLProvider.mjs.map +1 -0
- package/dist/esm/html/HTMLRenderer.mjs +55 -0
- package/dist/esm/html/HTMLRenderer.mjs.map +1 -0
- package/dist/esm/html/HTMLRendererPlugin.mjs +35 -0
- package/dist/esm/html/HTMLRendererPlugin.mjs.map +1 -0
- package/dist/esm/html/index.mjs +5 -0
- package/dist/esm/html/types.mjs +0 -0
- package/dist/esm/index.mjs +5 -1
- package/dist/esm/markdown/MarkdownProvider.mjs +76 -5
- package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
- package/dist/esm/markdown/MarkdownRenderer.mjs +191 -32
- package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
- package/dist/esm/markdown/MarkdownRendererPlugin.mjs +31 -0
- package/dist/esm/markdown/MarkdownRendererPlugin.mjs.map +1 -0
- package/dist/esm/markdown/index.mjs +5 -2
- package/dist/esm/markdown/processor.mjs +54 -0
- package/dist/esm/markdown/processor.mjs.map +1 -0
- package/dist/esm/markdown/runtime.mjs +41 -0
- package/dist/esm/markdown/runtime.mjs.map +1 -0
- package/dist/esm/plugins.mjs +82 -8
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/esm/reactElement/renderReactElement.mjs +8 -8
- package/dist/esm/reactElement/renderReactElement.mjs.map +1 -1
- package/dist/esm/server/IntlayerServerProvider.mjs +2 -2
- package/dist/esm/server/IntlayerServerProvider.mjs.map +1 -1
- package/dist/esm/server/format/useIntl.mjs +42 -0
- package/dist/esm/server/format/useIntl.mjs.map +1 -0
- package/dist/esm/server/index.mjs +2 -1
- package/dist/types/IntlayerNode.d.ts.map +1 -1
- package/dist/types/UI/ContentSelector.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +50 -5
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/format/index.d.ts +2 -1
- package/dist/types/client/format/useCompact.d.ts +2 -3
- package/dist/types/client/format/useCompact.d.ts.map +1 -1
- package/dist/types/client/format/useCurrency.d.ts +2 -3
- package/dist/types/client/format/useCurrency.d.ts.map +1 -1
- package/dist/types/client/format/useDate.d.ts +0 -1
- package/dist/types/client/format/useDate.d.ts.map +1 -1
- package/dist/types/client/format/useIntl.d.ts +92 -0
- package/dist/types/client/format/useIntl.d.ts.map +1 -0
- package/dist/types/client/format/useList.d.ts +2 -3
- package/dist/types/client/format/useList.d.ts.map +1 -1
- package/dist/types/client/format/useNumber.d.ts +2 -3
- package/dist/types/client/format/useNumber.d.ts.map +1 -1
- package/dist/types/client/format/usePercentage.d.ts +2 -3
- package/dist/types/client/format/usePercentage.d.ts.map +1 -1
- package/dist/types/client/format/useRelativeTime.d.ts +2 -3
- package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/client/format/useUnit.d.ts +2 -3
- package/dist/types/client/format/useUnit.d.ts.map +1 -1
- package/dist/types/client/t.d.ts +21 -3
- package/dist/types/client/t.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +2 -3
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +0 -1
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +0 -1
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useI18n.d.ts +0 -1
- package/dist/types/client/useI18n.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +18 -6
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +21 -1
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +5 -5
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +5 -6
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/client/useTraduction.d.ts +0 -1
- package/dist/types/client/useTraduction.d.ts.map +1 -1
- package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/html/HTMLProvider.d.ts +17 -0
- package/dist/types/html/HTMLProvider.d.ts.map +1 -0
- package/dist/types/html/HTMLRenderer.d.ts +46 -0
- package/dist/types/html/HTMLRenderer.d.ts.map +1 -0
- package/dist/types/html/HTMLRendererPlugin.d.ts +15 -0
- package/dist/types/html/HTMLRendererPlugin.d.ts.map +1 -0
- package/dist/types/html/index.d.ts +5 -0
- package/dist/types/html/types.d.ts +26 -0
- package/dist/types/html/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +42 -3
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +251 -11
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts +19 -0
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -0
- package/dist/types/markdown/index.d.ts +6 -3
- package/dist/types/markdown/processor.d.ts +92 -0
- package/dist/types/markdown/processor.d.ts.map +1 -0
- package/dist/types/markdown/runtime.d.ts +19 -0
- package/dist/types/markdown/runtime.d.ts.map +1 -0
- package/dist/types/plugins.d.ts +35 -13
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/reactElement/renderReactElement.d.ts +2 -2
- package/dist/types/reactElement/renderReactElement.d.ts.map +1 -1
- package/dist/types/server/IntlayerServerProvider.d.ts +2 -2
- package/dist/types/server/IntlayerServerProvider.d.ts.map +1 -1
- package/dist/types/server/format/useCompact.d.ts +0 -1
- package/dist/types/server/format/useCompact.d.ts.map +1 -1
- package/dist/types/server/format/useCurrency.d.ts +0 -1
- package/dist/types/server/format/useCurrency.d.ts.map +1 -1
- package/dist/types/server/format/useDate.d.ts +0 -1
- package/dist/types/server/format/useDate.d.ts.map +1 -1
- package/dist/types/server/format/useIntl.d.ts +92 -0
- package/dist/types/server/format/useIntl.d.ts.map +1 -0
- package/dist/types/server/format/useList.d.ts +0 -1
- package/dist/types/server/format/useList.d.ts.map +1 -1
- package/dist/types/server/format/useNumber.d.ts +0 -1
- package/dist/types/server/format/useNumber.d.ts.map +1 -1
- package/dist/types/server/format/usePercentage.d.ts +0 -1
- package/dist/types/server/format/usePercentage.d.ts.map +1 -1
- package/dist/types/server/format/useRelativeTime.d.ts +0 -1
- package/dist/types/server/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/server/format/useUnit.d.ts +0 -1
- package/dist/types/server/format/useUnit.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +2 -1
- package/dist/types/server/serverContext.d.ts +0 -1
- package/dist/types/server/serverContext.d.ts.map +1 -1
- package/dist/types/server/t.d.ts +0 -1
- package/dist/types/server/t.d.ts.map +1 -1
- package/dist/types/server/useDictionary.d.ts +2 -3
- package/dist/types/server/useDictionary.d.ts.map +1 -1
- package/dist/types/server/useDictionaryAsync.d.ts +2 -3
- package/dist/types/server/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/server/useDictionaryDynamic.d.ts +0 -1
- package/dist/types/server/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/server/useI18n.d.ts +0 -1
- package/dist/types/server/useI18n.d.ts.map +1 -1
- package/dist/types/server/useIntlayer.d.ts +3 -3
- package/dist/types/server/useIntlayer.d.ts.map +1 -1
- package/dist/types/server/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/server/useLocale.d.ts.map +1 -1
- 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
|
|
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?:
|
|
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"],"
|
|
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
|
|
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?:
|
|
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"],"
|
|
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
|
|
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?:
|
|
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"],"
|
|
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
|
|
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?:
|
|
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"],"
|
|
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
|
|
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?:
|
|
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"],"
|
|
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"}
|
package/dist/types/client/t.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
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"],"
|
|
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
|
|
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) =>
|
|
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"],"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"
|
|
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":["../../../src/client/useDictionaryDynamic.ts"],"
|
|
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"],"
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
20
|
+
* const MyComponent = () => {
|
|
21
|
+
* const content = useIntlayer('my-dictionary-key');
|
|
12
22
|
*
|
|
13
|
-
*
|
|
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) =>
|
|
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"],"
|
|
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"],"
|
|
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
|
-
*
|
|
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"],"
|
|
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
|
|
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:
|
|
9
|
-
defaultLocale:
|
|
10
|
-
availableLocales:
|
|
11
|
-
setLocale: (newLocale:
|
|
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"],"
|
|
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
|
|
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:
|
|
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:
|
|
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: () =>
|
|
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:
|
|
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"],"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"
|
|
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"],"
|
|
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"],"
|
|
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"],"
|
|
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"],"
|
|
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"],"
|
|
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
|