react-intlayer 9.6.0 → 9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/IntlayerNode.cjs +1 -2
- package/dist/cjs/UI/ContentSelector.cjs +1 -2
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/analytics/AnalyticsProvider.cjs +2 -3
- package/dist/cjs/analytics/exposureSink.cjs +1 -2
- package/dist/cjs/analytics/index.cjs +4 -4
- package/dist/cjs/analytics/useAnalytics.cjs +4 -5
- package/dist/cjs/analytics/useConversion.cjs +2 -3
- package/dist/cjs/analytics/useExperiment.cjs +2 -3
- package/dist/cjs/client/IntlayerProvider.cjs +6 -7
- package/dist/cjs/client/format/index.cjs +9 -9
- package/dist/cjs/client/format/useCompact.cjs +2 -3
- package/dist/cjs/client/format/useCurrency.cjs +2 -3
- package/dist/cjs/client/format/useDate.cjs +2 -3
- package/dist/cjs/client/format/useIntl.cjs +2 -3
- package/dist/cjs/client/format/useList.cjs +2 -3
- package/dist/cjs/client/format/useNumber.cjs +2 -3
- package/dist/cjs/client/format/usePercentage.cjs +2 -3
- package/dist/cjs/client/format/useRelativeTime.cjs +2 -3
- package/dist/cjs/client/format/useUnit.cjs +2 -3
- package/dist/cjs/client/index.cjs +13 -13
- package/dist/cjs/client/t.cjs +3 -4
- package/dist/cjs/client/useDictionary.cjs +3 -4
- package/dist/cjs/client/useDictionaryAsync.cjs +4 -5
- package/dist/cjs/client/useDictionaryDynamic.cjs +5 -6
- package/dist/cjs/client/useI18n.cjs +3 -4
- package/dist/cjs/client/useIntlayer.cjs +3 -4
- package/dist/cjs/client/useLoadDynamic.cjs +1 -2
- package/dist/cjs/client/useLocale.cjs +4 -5
- package/dist/cjs/client/useLocaleBase.cjs +3 -4
- package/dist/cjs/client/useLocaleStorage.cjs +1 -2
- package/dist/cjs/client/usePathname.cjs +1 -2
- package/dist/cjs/client/useRewriteURL.cjs +3 -4
- package/dist/cjs/client/useTraduction.cjs +3 -4
- package/dist/cjs/editor/ContentSelector.cjs +1 -2
- package/dist/cjs/editor/EditorProvider.cjs +2 -3
- package/dist/cjs/editor/useEditor.cjs +11 -4
- package/dist/cjs/editor/useEditor.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs +2 -3
- package/dist/cjs/getIntlayer.cjs +2 -3
- package/dist/cjs/html/HTMLProvider.cjs +1 -2
- package/dist/cjs/html/HTMLRenderer.cjs +3 -4
- package/dist/cjs/html/HTMLRendererPlugin.cjs +3 -4
- package/dist/cjs/html/index.cjs +2 -2
- package/dist/cjs/index.cjs +23 -24
- package/dist/cjs/markdown/MarkdownProvider.cjs +2 -3
- package/dist/cjs/markdown/MarkdownRenderer.cjs +3 -4
- package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +3 -4
- package/dist/cjs/markdown/index.cjs +3 -3
- package/dist/cjs/markdown/processor.cjs +2 -3
- package/dist/cjs/markdown/runtime.cjs +1 -2
- package/dist/cjs/plugins.cjs +10 -11
- package/dist/cjs/reactElement/renderReactElement.cjs +1 -2
- package/dist/cjs/server/IntlayerServerProvider.cjs +3 -4
- package/dist/cjs/server/format/index.cjs +8 -8
- package/dist/cjs/server/format/useCompact.cjs +3 -4
- package/dist/cjs/server/format/useCurrency.cjs +3 -4
- package/dist/cjs/server/format/useDate.cjs +3 -4
- package/dist/cjs/server/format/useIntl.cjs +4 -6
- package/dist/cjs/server/format/useIntl.cjs.map +1 -1
- package/dist/cjs/server/format/useList.cjs +3 -4
- package/dist/cjs/server/format/useNumber.cjs +3 -4
- package/dist/cjs/server/format/usePercentage.cjs +3 -4
- package/dist/cjs/server/format/useRelativeTime.cjs +3 -4
- package/dist/cjs/server/format/useUnit.cjs +3 -4
- package/dist/cjs/server/index.cjs +11 -11
- package/dist/cjs/server/serverContext.cjs +2 -3
- package/dist/cjs/server/t.cjs +3 -4
- package/dist/cjs/server/useDictionary.cjs +4 -5
- package/dist/cjs/server/useDictionaryAsync.cjs +4 -5
- package/dist/cjs/server/useDictionaryDynamic.cjs +5 -6
- package/dist/cjs/server/useI18n.cjs +4 -5
- package/dist/cjs/server/useIntlayer.cjs +4 -5
- package/dist/cjs/server/useLoadDynamic.cjs +2 -3
- package/dist/cjs/server/useLocale.cjs +3 -4
- package/dist/esm/IntlayerNode.mjs +1 -2
- package/dist/esm/UI/ContentSelector.mjs +1 -2
- package/dist/esm/analytics/AnalyticsProvider.mjs +1 -2
- package/dist/esm/analytics/exposureSink.mjs +1 -2
- package/dist/esm/analytics/index.mjs +1 -1
- package/dist/esm/analytics/useAnalytics.mjs +3 -4
- package/dist/esm/analytics/useConversion.mjs +2 -3
- package/dist/esm/analytics/useExperiment.mjs +2 -3
- package/dist/esm/client/IntlayerProvider.mjs +4 -5
- package/dist/esm/client/format/index.mjs +5 -5
- package/dist/esm/client/format/useCompact.mjs +1 -2
- package/dist/esm/client/format/useCurrency.mjs +1 -2
- package/dist/esm/client/format/useDate.mjs +1 -2
- package/dist/esm/client/format/useIntl.mjs +1 -2
- package/dist/esm/client/format/useList.mjs +1 -2
- package/dist/esm/client/format/useNumber.mjs +1 -2
- package/dist/esm/client/format/usePercentage.mjs +1 -2
- package/dist/esm/client/format/useRelativeTime.mjs +1 -2
- package/dist/esm/client/format/useUnit.mjs +1 -2
- package/dist/esm/client/index.mjs +2 -2
- package/dist/esm/client/t.mjs +2 -3
- package/dist/esm/client/useDictionary.mjs +1 -2
- package/dist/esm/client/useDictionaryAsync.mjs +2 -3
- package/dist/esm/client/useDictionaryDynamic.mjs +3 -4
- package/dist/esm/client/useI18n.mjs +2 -3
- package/dist/esm/client/useIntlayer.mjs +1 -2
- package/dist/esm/client/useLoadDynamic.mjs +1 -2
- package/dist/esm/client/useLocale.mjs +3 -4
- package/dist/esm/client/useLocaleBase.mjs +2 -3
- package/dist/esm/client/useLocaleStorage.mjs +1 -2
- package/dist/esm/client/usePathname.mjs +1 -2
- package/dist/esm/client/useRewriteURL.mjs +2 -3
- package/dist/esm/client/useTraduction.mjs +2 -3
- package/dist/esm/editor/ContentSelector.mjs +1 -2
- package/dist/esm/editor/EditorProvider.mjs +1 -2
- package/dist/esm/editor/useEditor.mjs +10 -3
- package/dist/esm/editor/useEditor.mjs.map +1 -1
- package/dist/esm/getDictionary.mjs +1 -2
- package/dist/esm/getIntlayer.mjs +1 -2
- package/dist/esm/html/HTMLProvider.mjs +1 -2
- package/dist/esm/html/HTMLRenderer.mjs +2 -3
- package/dist/esm/html/HTMLRendererPlugin.mjs +1 -2
- package/dist/esm/index.mjs +7 -8
- package/dist/esm/markdown/MarkdownProvider.mjs +1 -2
- package/dist/esm/markdown/MarkdownRenderer.mjs +2 -3
- package/dist/esm/markdown/MarkdownRendererPlugin.mjs +2 -3
- package/dist/esm/markdown/index.mjs +1 -1
- package/dist/esm/markdown/processor.mjs +1 -2
- package/dist/esm/markdown/runtime.mjs +1 -2
- package/dist/esm/plugins.mjs +4 -5
- package/dist/esm/reactElement/renderReactElement.mjs +1 -2
- package/dist/esm/server/IntlayerServerProvider.mjs +2 -3
- package/dist/esm/server/format/index.mjs +4 -4
- package/dist/esm/server/format/useCompact.mjs +2 -3
- package/dist/esm/server/format/useCurrency.mjs +2 -3
- package/dist/esm/server/format/useDate.mjs +2 -3
- package/dist/esm/server/format/useIntl.mjs +3 -5
- package/dist/esm/server/format/useIntl.mjs.map +1 -1
- package/dist/esm/server/format/useList.mjs +2 -3
- package/dist/esm/server/format/useNumber.mjs +2 -3
- package/dist/esm/server/format/usePercentage.mjs +2 -3
- package/dist/esm/server/format/useRelativeTime.mjs +2 -3
- package/dist/esm/server/format/useUnit.mjs +2 -3
- package/dist/esm/server/index.mjs +6 -6
- package/dist/esm/server/serverContext.mjs +1 -2
- package/dist/esm/server/t.mjs +2 -3
- package/dist/esm/server/useDictionary.mjs +2 -3
- package/dist/esm/server/useDictionaryAsync.mjs +2 -3
- package/dist/esm/server/useDictionaryDynamic.mjs +3 -4
- package/dist/esm/server/useI18n.mjs +2 -3
- package/dist/esm/server/useIntlayer.mjs +2 -3
- package/dist/esm/server/useLoadDynamic.mjs +1 -2
- package/dist/esm/server/useLocale.mjs +2 -3
- package/dist/types/IntlayerNode.d.ts +1 -2
- package/dist/types/IntlayerNode.d.ts.map +1 -1
- package/dist/types/UI/ContentSelector.d.ts +1 -2
- package/dist/types/UI/ContentSelector.d.ts.map +1 -1
- package/dist/types/analytics/AnalyticsProvider.d.ts +0 -2
- package/dist/types/analytics/AnalyticsProvider.d.ts.map +1 -1
- package/dist/types/analytics/exposureSink.d.ts +0 -2
- package/dist/types/analytics/exposureSink.d.ts.map +1 -1
- package/dist/types/analytics/useAnalytics.d.ts +0 -2
- package/dist/types/analytics/useAnalytics.d.ts.map +1 -1
- package/dist/types/analytics/useConversion.d.ts +0 -2
- package/dist/types/analytics/useConversion.d.ts.map +1 -1
- package/dist/types/analytics/useExperiment.d.ts +0 -2
- package/dist/types/analytics/useExperiment.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +1 -2
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/format/useCompact.d.ts +0 -2
- package/dist/types/client/format/useCompact.d.ts.map +1 -1
- package/dist/types/client/format/useCurrency.d.ts +0 -2
- package/dist/types/client/format/useCurrency.d.ts.map +1 -1
- package/dist/types/client/format/useDate.d.ts +0 -2
- package/dist/types/client/format/useDate.d.ts.map +1 -1
- package/dist/types/client/format/useIntl.d.ts +0 -2
- package/dist/types/client/format/useIntl.d.ts.map +1 -1
- package/dist/types/client/format/useList.d.ts +0 -2
- package/dist/types/client/format/useList.d.ts.map +1 -1
- package/dist/types/client/format/useNumber.d.ts +0 -2
- package/dist/types/client/format/useNumber.d.ts.map +1 -1
- package/dist/types/client/format/usePercentage.d.ts +0 -2
- package/dist/types/client/format/usePercentage.d.ts.map +1 -1
- package/dist/types/client/format/useRelativeTime.d.ts +0 -2
- package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/client/format/useUnit.d.ts +0 -2
- package/dist/types/client/format/useUnit.d.ts.map +1 -1
- package/dist/types/client/t.d.ts +0 -2
- package/dist/types/client/t.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +0 -2
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +0 -2
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +0 -2
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useI18n.d.ts +0 -2
- package/dist/types/client/useI18n.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +0 -2
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useLoadDynamic.d.ts +0 -2
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +0 -2
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +0 -2
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +0 -2
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/client/usePathname.d.ts +0 -2
- package/dist/types/client/usePathname.d.ts.map +1 -1
- package/dist/types/client/useRewriteURL.d.ts +0 -2
- package/dist/types/client/useRewriteURL.d.ts.map +1 -1
- package/dist/types/client/useTraduction.d.ts +0 -2
- package/dist/types/client/useTraduction.d.ts.map +1 -1
- package/dist/types/editor/ContentSelector.d.ts +0 -2
- package/dist/types/editor/ContentSelector.d.ts.map +1 -1
- package/dist/types/editor/EditorProvider.d.ts +0 -2
- package/dist/types/editor/EditorProvider.d.ts.map +1 -1
- package/dist/types/editor/useEditor.d.ts +0 -2
- package/dist/types/editor/useEditor.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +0 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +0 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/html/HTMLComponentTypes.d.ts +1 -2
- package/dist/types/html/HTMLComponentTypes.d.ts.map +1 -1
- package/dist/types/html/HTMLProvider.d.ts +1 -2
- package/dist/types/html/HTMLProvider.d.ts.map +1 -1
- package/dist/types/html/HTMLRenderer.d.ts +0 -2
- package/dist/types/html/HTMLRenderer.d.ts.map +1 -1
- package/dist/types/html/HTMLRendererPlugin.d.ts +1 -2
- package/dist/types/html/HTMLRendererPlugin.d.ts.map +1 -1
- package/dist/types/html/types.d.ts +0 -2
- package/dist/types/html/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +0 -2
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +1 -3
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts +1 -2
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -1
- package/dist/types/markdown/index.d.ts +1 -1
- package/dist/types/markdown/processor.d.ts +0 -2
- package/dist/types/markdown/processor.d.ts.map +1 -1
- package/dist/types/markdown/runtime.d.ts +0 -2
- package/dist/types/markdown/runtime.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +1 -3
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/reactElement/renderReactElement.d.ts +0 -2
- package/dist/types/reactElement/renderReactElement.d.ts.map +1 -1
- package/dist/types/server/IntlayerServerProvider.d.ts +0 -2
- package/dist/types/server/IntlayerServerProvider.d.ts.map +1 -1
- package/dist/types/server/format/useCompact.d.ts +0 -2
- package/dist/types/server/format/useCompact.d.ts.map +1 -1
- package/dist/types/server/format/useCurrency.d.ts +0 -2
- package/dist/types/server/format/useCurrency.d.ts.map +1 -1
- package/dist/types/server/format/useDate.d.ts +0 -2
- package/dist/types/server/format/useDate.d.ts.map +1 -1
- package/dist/types/server/format/useIntl.d.ts +0 -2
- package/dist/types/server/format/useIntl.d.ts.map +1 -1
- package/dist/types/server/format/useList.d.ts +0 -2
- package/dist/types/server/format/useList.d.ts.map +1 -1
- package/dist/types/server/format/useNumber.d.ts +0 -2
- package/dist/types/server/format/useNumber.d.ts.map +1 -1
- package/dist/types/server/format/usePercentage.d.ts +0 -2
- package/dist/types/server/format/usePercentage.d.ts.map +1 -1
- package/dist/types/server/format/useRelativeTime.d.ts +0 -2
- package/dist/types/server/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/server/format/useUnit.d.ts +0 -2
- package/dist/types/server/format/useUnit.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +2 -2
- package/dist/types/server/serverContext.d.ts +0 -2
- package/dist/types/server/serverContext.d.ts.map +1 -1
- package/dist/types/server/t.d.ts +0 -2
- package/dist/types/server/t.d.ts.map +1 -1
- package/dist/types/server/useDictionary.d.ts +0 -2
- package/dist/types/server/useDictionary.d.ts.map +1 -1
- package/dist/types/server/useDictionaryAsync.d.ts +0 -2
- package/dist/types/server/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/server/useDictionaryDynamic.d.ts +0 -2
- package/dist/types/server/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/server/useI18n.d.ts +0 -2
- package/dist/types/server/useI18n.d.ts.map +1 -1
- package/dist/types/server/useIntlayer.d.ts +0 -2
- package/dist/types/server/useIntlayer.d.ts.map +1 -1
- package/dist/types/server/useLoadDynamic.d.ts +0 -2
- package/dist/types/server/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/server/useLocale.d.ts +0 -2
- package/dist/types/server/useLocale.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -4,7 +4,7 @@ import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
|
4
4
|
import { useCallback, useContext } from "react";
|
|
5
5
|
import { list } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/format/useList.ts
|
|
8
8
|
/**
|
|
9
9
|
* React client hook that provides a list formatter
|
|
10
10
|
* bound to the current application locale.
|
|
@@ -34,6 +34,5 @@ const useList = () => {
|
|
|
34
34
|
}), [locale]);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { useList };
|
|
39
38
|
//# sourceMappingURL=useList.mjs.map
|
|
@@ -4,7 +4,7 @@ import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
|
4
4
|
import { useCallback, useContext } from "react";
|
|
5
5
|
import { number } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/format/useNumber.ts
|
|
8
8
|
/**
|
|
9
9
|
* React client hook that provides a localized number formatter.
|
|
10
10
|
*
|
|
@@ -35,6 +35,5 @@ const useNumber = () => {
|
|
|
35
35
|
}), [locale]);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { useNumber };
|
|
40
39
|
//# sourceMappingURL=useNumber.mjs.map
|
|
@@ -4,7 +4,7 @@ import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
|
4
4
|
import { useCallback, useContext } from "react";
|
|
5
5
|
import { percentage } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/format/usePercentage.ts
|
|
8
8
|
/**
|
|
9
9
|
* React hook to provide a percentage formatter function
|
|
10
10
|
* based on the current application locale.
|
|
@@ -31,6 +31,5 @@ const usePercentage = () => {
|
|
|
31
31
|
}), [locale]);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
//#endregion
|
|
35
34
|
export { usePercentage };
|
|
36
35
|
//# sourceMappingURL=usePercentage.mjs.map
|
|
@@ -4,7 +4,7 @@ import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
|
4
4
|
import { useCallback, useContext } from "react";
|
|
5
5
|
import { relativeTime } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/format/useRelativeTime.ts
|
|
8
8
|
/**
|
|
9
9
|
* Client-side React hook for accessing a localized relative time formatter.
|
|
10
10
|
*
|
|
@@ -31,6 +31,5 @@ const useRelativeTime = () => {
|
|
|
31
31
|
}), [locale]);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
//#endregion
|
|
35
34
|
export { useRelativeTime };
|
|
36
35
|
//# sourceMappingURL=useRelativeTime.mjs.map
|
|
@@ -4,7 +4,7 @@ import { IntlayerClientContext } from "../IntlayerProvider.mjs";
|
|
|
4
4
|
import { useCallback, useContext } from "react";
|
|
5
5
|
import { units } from "@intlayer/core/formatters";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/format/useUnit.ts
|
|
8
8
|
/**
|
|
9
9
|
* React hook that provides a unit formatting function
|
|
10
10
|
* based on the current locale from {@link useLocaleBase}.
|
|
@@ -30,6 +30,5 @@ const useUnit = () => {
|
|
|
30
30
|
}), [locale]);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
export { useUnit };
|
|
35
34
|
//# sourceMappingURL=useUnit.mjs.map
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
2
|
-
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.mjs";
|
|
3
1
|
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./IntlayerProvider.mjs";
|
|
4
2
|
import { t } from "./t.mjs";
|
|
5
3
|
import { useDictionary } from "./useDictionary.mjs";
|
|
@@ -7,8 +5,10 @@ import { useDictionaryAsync } from "./useDictionaryAsync.mjs";
|
|
|
7
5
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
8
6
|
import { useI18n } from "./useI18n.mjs";
|
|
9
7
|
import { useIntlayer } from "./useIntlayer.mjs";
|
|
8
|
+
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
10
9
|
import { useLocale } from "./useLocale.mjs";
|
|
11
10
|
import { useLocaleBase } from "./useLocaleBase.mjs";
|
|
11
|
+
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.mjs";
|
|
12
12
|
import { usePathname } from "./usePathname.mjs";
|
|
13
13
|
import { useRewriteURL } from "./useRewriteURL.mjs";
|
|
14
14
|
|
package/dist/esm/client/t.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { getTranslation } from "@intlayer/core/interpreter";
|
|
5
4
|
import { useContext } from "react";
|
|
5
|
+
import { getTranslation } from "@intlayer/core/interpreter";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/t.ts
|
|
8
8
|
/**
|
|
9
9
|
* Client-side translation function that returns the translation of the provided multilang content.
|
|
10
10
|
*
|
|
@@ -34,6 +34,5 @@ const t = (multilangContent, locale) => {
|
|
|
34
34
|
return getTranslation(multilangContent, locale ?? currentLocale);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { t };
|
|
39
38
|
//# sourceMappingURL=t.mjs.map
|
|
@@ -5,7 +5,7 @@ import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
|
5
5
|
import { useContext, useMemo } from "react";
|
|
6
6
|
import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/client/useDictionary.ts
|
|
9
9
|
/**
|
|
10
10
|
* Client-side hook that transforms a dictionary (or qualified dictionary
|
|
11
11
|
* group) and returns the content.
|
|
@@ -26,6 +26,5 @@ const useDictionary = (dictionary, localeOrSelector) => {
|
|
|
26
26
|
return useMemo(() => getDictionary(dictionary, argument), [dictionary.key, argumentIdentity]);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { useDictionary };
|
|
31
30
|
//# sourceMappingURL=useDictionary.mjs.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
4
|
import { useDictionary } from "./useDictionary.mjs";
|
|
5
|
-
import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
|
|
6
5
|
import { useContext, useMemo } from "react";
|
|
6
|
+
import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/client/useDictionaryAsync.ts
|
|
9
9
|
/**
|
|
10
10
|
* On the server side, Hook that transform a dictionary and return the content
|
|
11
11
|
*
|
|
@@ -18,6 +18,5 @@ const useDictionaryAsync = async (dictionaryPromise, locale) => {
|
|
|
18
18
|
return useDictionary(dictionary, localeTarget);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { useDictionaryAsync };
|
|
23
22
|
//# sourceMappingURL=useDictionaryAsync.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
4
3
|
import { getDictionary as getDictionary$1 } from "../getDictionary.mjs";
|
|
5
4
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
7
6
|
import { useContext } from "react";
|
|
7
|
+
import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
|
|
8
8
|
import { getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryArgument, resolveQualifiedDynamicContent } from "@intlayer/core/dictionaryManipulator";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/client/useDictionaryDynamic.ts
|
|
11
11
|
/**
|
|
12
12
|
* Client-side hook that lazily loads a dictionary and returns its content.
|
|
13
13
|
*
|
|
@@ -46,6 +46,5 @@ const useDictionaryDynamic = (dictionaryPromise, key, localeOrSelector) => {
|
|
|
46
46
|
return getDictionary$1(dictionary, localeTarget);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
//#endregion
|
|
50
49
|
export { useDictionaryDynamic };
|
|
51
50
|
//# sourceMappingURL=useDictionaryDynamic.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { getIntlayer } from "@intlayer/core/interpreter";
|
|
5
4
|
import { useContext, useMemo } from "react";
|
|
5
|
+
import { getIntlayer } from "@intlayer/core/interpreter";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useI18n.ts
|
|
8
8
|
/**
|
|
9
9
|
* Hook that provides a translation function `t()` for accessing nested content by key.
|
|
10
10
|
* This hook mimics the pattern found in libraries like i18next, next-intl, and vue-i18n.
|
|
@@ -39,6 +39,5 @@ const useI18n = (namespace, locale) => {
|
|
|
39
39
|
return t;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { useI18n };
|
|
44
43
|
//# sourceMappingURL=useI18n.mjs.map
|
|
@@ -5,7 +5,7 @@ import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
|
5
5
|
import { useContext, useMemo } from "react";
|
|
6
6
|
import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/client/useIntlayer.ts
|
|
9
9
|
/**
|
|
10
10
|
* Client-side hook that picks one dictionary by its key and returns its content.
|
|
11
11
|
*
|
|
@@ -46,6 +46,5 @@ const useIntlayer = (key, localeOrSelector) => {
|
|
|
46
46
|
return useMemo(() => getIntlayer(key, argument), [key, argumentIdentity]);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
//#endregion
|
|
50
49
|
export { useIntlayer };
|
|
51
50
|
//# sourceMappingURL=useIntlayer.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/client/useLoadDynamic.ts
|
|
2
2
|
const createSuspender = (promise) => {
|
|
3
3
|
let status = "pending";
|
|
4
4
|
let result;
|
|
@@ -47,6 +47,5 @@ const preloadDynamic = (key, loader) => {
|
|
|
47
47
|
return cache.get(key).settled;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { preloadDynamic, useLoadDynamic };
|
|
52
51
|
//# sourceMappingURL=useLoadDynamic.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
4
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
5
|
-
import {
|
|
4
|
+
import { setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
6
5
|
import { useCallback, useContext } from "react";
|
|
6
|
+
import { internationalization } from "@intlayer/config/built";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/client/useLocale.ts
|
|
9
9
|
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
10
10
|
/**
|
|
11
11
|
* Client-side hook to get the current locale and related locale management functions.
|
|
@@ -54,6 +54,5 @@ const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { useLocale };
|
|
59
58
|
//# sourceMappingURL=useLocale.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { internationalization } from "@intlayer/config/built";
|
|
5
4
|
import { useContext } from "react";
|
|
5
|
+
import { internationalization } from "@intlayer/config/built";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useLocaleBase.ts
|
|
8
8
|
const { defaultLocale, locales: availableLocales } = internationalization;
|
|
9
9
|
/**
|
|
10
10
|
* On the client side, hook to get the current locale and all related fields
|
|
@@ -19,6 +19,5 @@ const useLocaleBase = () => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { useLocaleBase };
|
|
24
23
|
//# sourceMappingURL=useLocaleBase.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { LocaleStorageClient, getCachedLocaleFromStorageClient, getLocaleFromStorageClient, localeStorageOptions, setLocaleInStorageClient } from "@intlayer/core/utils";
|
|
3
3
|
|
|
4
|
-
|
|
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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { getPathWithoutLocale } from "@intlayer/core/localization";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/client/usePathname.ts
|
|
7
7
|
/**
|
|
8
8
|
* React hook that returns the current pathname with the locale segment removed.
|
|
9
9
|
*
|
|
@@ -34,6 +34,5 @@ const usePathname = () => {
|
|
|
34
34
|
return useMemo(() => getPathWithoutLocale(rawPathname), [rawPathname]);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { usePathname };
|
|
39
38
|
//# sourceMappingURL=usePathname.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useLocale } from "./useLocale.mjs";
|
|
4
|
-
import { routing } from "@intlayer/config/built";
|
|
5
4
|
import { useEffect } from "react";
|
|
5
|
+
import { routing } from "@intlayer/config/built";
|
|
6
6
|
import { getRewritePath } from "@intlayer/core/localization";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/client/useRewriteURL.ts
|
|
9
9
|
/**
|
|
10
10
|
* Client-side hook to manage URL rewrites without triggering a router navigation.
|
|
11
11
|
* It uses `window.history.replaceState` to update the URL in the address bar.
|
|
@@ -35,6 +35,5 @@ const useRewriteURL = () => {
|
|
|
35
35
|
}, [locale, rewrite]);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { useRewriteURL };
|
|
40
39
|
//# sourceMappingURL=useRewriteURL.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 "react";
|
|
3
|
+
import { getTranslation } from "@intlayer/core/interpreter";
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { isEnabled } from "@intlayer/editor/isEnabled";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/editor/ContentSelector.tsx
|
|
7
7
|
const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
|
|
8
8
|
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !isEnabled) return children;
|
|
9
9
|
return createElement("intlayer-content-selector-wrapper", {
|
|
@@ -12,6 +12,5 @@ const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
|
|
|
12
12
|
}, children);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { ContentSelector };
|
|
17
16
|
//# sourceMappingURL=ContentSelector.mjs.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useEditor } from "./useEditor.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
@@ -4,23 +4,31 @@ import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
|
|
|
4
4
|
import { useContext, useEffect, useRef } from "react";
|
|
5
5
|
import { isEnabled } from "@intlayer/editor/isEnabled";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/editor/useEditor.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Initializes the Intlayer editor client singleton when the editor is enabled.
|
|
10
10
|
* Syncs the current locale from the Intlayer context into the editor manager so
|
|
11
11
|
* the editor always knows which locale the app is displaying.
|
|
12
12
|
*/
|
|
13
13
|
const useEditor = () => {
|
|
14
|
-
const { locale } = useContext(IntlayerClientContext) ?? {};
|
|
14
|
+
const { locale, setLocale } = useContext(IntlayerClientContext) ?? {};
|
|
15
15
|
const managerRef = useRef(null);
|
|
16
|
+
const setLocaleRef = useRef(setLocale);
|
|
17
|
+
setLocaleRef.current = setLocale;
|
|
16
18
|
useEffect(() => {
|
|
17
19
|
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !isEnabled) return;
|
|
20
|
+
let unsubscribeLocaleRequest = null;
|
|
21
|
+
let isStopped = false;
|
|
18
22
|
import("@intlayer/editor").then(({ initEditorClient }) => {
|
|
23
|
+
if (isStopped) return;
|
|
19
24
|
const manager = initEditorClient();
|
|
20
25
|
managerRef.current = manager;
|
|
21
26
|
if (locale) manager.currentLocale.set(locale);
|
|
27
|
+
unsubscribeLocaleRequest = manager.onLocaleChangeRequested((requestedLocale) => setLocaleRef.current?.(requestedLocale));
|
|
22
28
|
}).catch(() => {});
|
|
23
29
|
return () => {
|
|
30
|
+
isStopped = true;
|
|
31
|
+
unsubscribeLocaleRequest?.();
|
|
24
32
|
managerRef.current = null;
|
|
25
33
|
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
26
34
|
stopEditorClient();
|
|
@@ -33,6 +41,5 @@ const useEditor = () => {
|
|
|
33
41
|
}, [locale]);
|
|
34
42
|
};
|
|
35
43
|
|
|
36
|
-
//#endregion
|
|
37
44
|
export { useEditor };
|
|
38
45
|
//# sourceMappingURL=useEditor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { useContext, useEffect, useRef } from 'react';\nimport { IntlayerClientContext } from '../client/IntlayerProvider';\n\n/**\n * Initializes the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the Intlayer context into the editor manager so\n * the editor always knows which locale the app is displaying.\n */\nexport const useEditor = () => {\n const { locale } = useContext(IntlayerClientContext) ?? {};\n const managerRef = useRef<EditorStateManager | null>(null);\n\n useEffect(() => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled) return;\n\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n const manager = initEditorClient();\n managerRef.current = manager;\n\n if (locale) manager.currentLocale.set(locale as Locale);\n })\n .catch(() => {});\n\n return () => {\n managerRef.current = null;\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n };\n }, []);\n\n useEffect(() => {\n if (!locale || !managerRef.current) return;\n\n managerRef.current.currentLocale.set(locale as Locale);\n }, [locale]);\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { useContext, useEffect, useRef } from 'react';\nimport { IntlayerClientContext } from '../client/IntlayerProvider';\n\n/**\n * Initializes the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the Intlayer context into the editor manager so\n * the editor always knows which locale the app is displaying.\n */\nexport const useEditor = () => {\n const { locale, setLocale } = useContext(IntlayerClientContext) ?? {};\n const managerRef = useRef<EditorStateManager | null>(null);\n // Read through a ref: the subscription outlives the render that created it\n const setLocaleRef = useRef(setLocale);\n setLocaleRef.current = setLocale;\n\n useEffect(() => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled) return;\n\n let unsubscribeLocaleRequest: (() => void) | null = null;\n let isStopped = false;\n\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n if (isStopped) return;\n\n const manager = initEditorClient();\n managerRef.current = manager;\n\n if (locale) manager.currentLocale.set(locale as Locale);\n\n unsubscribeLocaleRequest = manager.onLocaleChangeRequested(\n (requestedLocale) => setLocaleRef.current?.(requestedLocale)\n );\n })\n .catch(() => {});\n\n return () => {\n isStopped = true;\n unsubscribeLocaleRequest?.();\n managerRef.current = null;\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n };\n }, []);\n\n useEffect(() => {\n if (!locale || !managerRef.current) return;\n\n managerRef.current.currentLocale.set(locale as Locale);\n }, [locale]);\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,MAAM,EAAE,QAAQ,cAAc,WAAW,qBAAqB,KAAK,CAAC;CACpE,MAAM,aAAa,OAAkC,IAAI;CAEzD,MAAM,eAAe,OAAO,SAAS;CACrC,aAAa,UAAU;CAEvB,gBAAgB;EACd,IAAI,QAAQ,IAAI,4BAA4B,WAAW,CAAC,WAAW;EAEnE,IAAI,2BAAgD;EACpD,IAAI,YAAY;EAEhB,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;GAC9B,IAAI,WAAW;GAEf,MAAM,UAAU,iBAAiB;GACjC,WAAW,UAAU;GAErB,IAAI,QAAQ,QAAQ,cAAc,IAAI,MAAgB;GAEtD,2BAA2B,QAAQ,yBAChC,oBAAoB,aAAa,UAAU,eAAe,CAC7D;EACF,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;EAEjB,aAAa;GACX,YAAY;GACZ,2BAA2B;GAC3B,WAAW,UAAU;GACrB,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;IAC9B,iBAAiB;GACnB,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;EACnB;CACF,GAAG,CAAC,CAAC;CAEL,gBAAgB;EACd,IAAI,CAAC,UAAU,CAAC,WAAW,SAAS;EAEpC,WAAW,QAAQ,cAAc,IAAI,MAAgB;CACvD,GAAG,CAAC,MAAM,CAAC;AACb"}
|
|
@@ -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
|
-
|
|
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
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -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
|
-
|
|
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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/html/HTMLProvider.tsx
|
|
7
7
|
const HTMLContext = createContext(void 0);
|
|
8
8
|
const useHTMLContext = () => useContext(HTMLContext);
|
|
9
9
|
const HTMLProvider = ({ children, components }) => /* @__PURE__ */ jsx(HTMLContext.Provider, {
|
|
@@ -11,6 +11,5 @@ const HTMLProvider = ({ children, components }) => /* @__PURE__ */ jsx(HTMLConte
|
|
|
11
11
|
children
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { HTMLProvider, useHTMLContext };
|
|
16
15
|
//# sourceMappingURL=HTMLProvider.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useHTMLContext } from "./HTMLProvider.mjs";
|
|
4
|
-
import { getHTML } from "@intlayer/core/interpreter";
|
|
5
4
|
import { Fragment, createElement } from "react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { getHTML } from "@intlayer/core/interpreter";
|
|
7
7
|
import { VOID_HTML_ELEMENTS } from "@intlayer/core/transpiler";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/html/HTMLRenderer.tsx
|
|
10
10
|
/**
|
|
11
11
|
* Renders HTML-like content to JSX with the provided components.
|
|
12
12
|
*
|
|
@@ -49,6 +49,5 @@ const HTMLRenderer = ({ children = "", components }) => {
|
|
|
49
49
|
return useHTMLRenderer({ components })(children);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
export { HTMLRenderer, renderHTML, useHTMLRenderer };
|
|
54
53
|
//# sourceMappingURL=HTMLRenderer.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useHTMLContext } from "./HTMLProvider.mjs";
|
|
2
2
|
import { renderHTML } from "./HTMLRenderer.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/html/HTMLRendererPlugin.tsx
|
|
5
5
|
const HTMLRendererPlugin = (props) => {
|
|
6
6
|
const { html, userComponents } = props;
|
|
7
7
|
const context = useHTMLContext();
|
|
@@ -11,6 +11,5 @@ const HTMLRendererPlugin = (props) => {
|
|
|
11
11
|
} });
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { HTMLRendererPlugin };
|
|
16
15
|
//# sourceMappingURL=HTMLRendererPlugin.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
2
|
-
import { getDictionary } from "./getDictionary.mjs";
|
|
3
|
-
import { getIntlayer } from "./getIntlayer.mjs";
|
|
4
|
-
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.mjs";
|
|
5
|
-
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./client/IntlayerProvider.mjs";
|
|
6
|
-
import { useAnalytics } from "./analytics/useAnalytics.mjs";
|
|
7
1
|
import { AnalyticsProvider } from "./analytics/AnalyticsProvider.mjs";
|
|
2
|
+
import { useAnalytics } from "./analytics/useAnalytics.mjs";
|
|
8
3
|
import { useConversion } from "./analytics/useConversion.mjs";
|
|
9
4
|
import { useExperiment } from "./analytics/useExperiment.mjs";
|
|
10
5
|
import { useIntl } from "./client/format/useIntl.mjs";
|
|
6
|
+
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./client/IntlayerProvider.mjs";
|
|
11
7
|
import { t } from "./client/t.mjs";
|
|
12
8
|
import { useDictionary } from "./client/useDictionary.mjs";
|
|
13
9
|
import { useDictionaryAsync } from "./client/useDictionaryAsync.mjs";
|
|
14
10
|
import { useDictionaryDynamic } from "./client/useDictionaryDynamic.mjs";
|
|
15
11
|
import { useI18n } from "./client/useI18n.mjs";
|
|
16
12
|
import { useIntlayer } from "./client/useIntlayer.mjs";
|
|
13
|
+
import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
17
14
|
import { useLocale } from "./client/useLocale.mjs";
|
|
18
15
|
import { useLocaleBase } from "./client/useLocaleBase.mjs";
|
|
16
|
+
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.mjs";
|
|
19
17
|
import { usePathname } from "./client/usePathname.mjs";
|
|
20
18
|
import { useRewriteURL } from "./client/useRewriteURL.mjs";
|
|
19
|
+
import { getDictionary } from "./getDictionary.mjs";
|
|
20
|
+
import { getIntlayer } from "./getIntlayer.mjs";
|
|
21
21
|
import { MarkdownProvider as MarkdownProvider$1, useMarkdownContext as useMarkdownContext$1 } from "./markdown/MarkdownProvider.mjs";
|
|
22
22
|
import { MarkdownRenderer as MarkdownRenderer$1, renderMarkdown as renderMarkdown$1, useMarkdownRenderer as useMarkdownRenderer$1 } from "./markdown/MarkdownRenderer.mjs";
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// src/index.ts
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated import from react-intlayer/markdown instead
|
|
27
27
|
*/
|
|
@@ -43,6 +43,5 @@ const useMarkdownRenderer = useMarkdownRenderer$1;
|
|
|
43
43
|
*/
|
|
44
44
|
const MarkdownRenderer = MarkdownRenderer$1;
|
|
45
45
|
|
|
46
|
-
//#endregion
|
|
47
46
|
export { AnalyticsProvider, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, MarkdownProvider, MarkdownRenderer, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useAnalytics, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
|
|
48
47
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -4,7 +4,7 @@ import { compileMarkdown } from "./processor.mjs";
|
|
|
4
4
|
import { createContext, useContext } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/markdown/MarkdownProvider.tsx
|
|
8
8
|
const MarkdownContext = createContext(void 0);
|
|
9
9
|
/**
|
|
10
10
|
* Returns the raw `MarkdownProvider` context value — the active
|
|
@@ -81,6 +81,5 @@ const MarkdownProvider = ({ children, components, wrapper, forceBlock, forceInli
|
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
//#endregion
|
|
85
84
|
export { MarkdownProvider, useMarkdownContext };
|
|
86
85
|
//# sourceMappingURL=MarkdownProvider.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { compileMarkdown } from "./processor.mjs";
|
|
4
3
|
import { useMarkdownContext } from "./MarkdownProvider.mjs";
|
|
4
|
+
import { compileMarkdown } from "./processor.mjs";
|
|
5
5
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/markdown/MarkdownRenderer.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Renders markdown content to JSX with the provided components and options.
|
|
10
10
|
*
|
|
@@ -193,6 +193,5 @@ const MarkdownRenderer = ({ children = "", components, wrapper, forceBlock, forc
|
|
|
193
193
|
}) });
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
//#endregion
|
|
197
196
|
export { MarkdownRenderer, renderMarkdown, useMarkdownRenderer };
|
|
198
197
|
//# sourceMappingURL=MarkdownRenderer.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { compileMarkdown } from "./processor.mjs";
|
|
4
3
|
import { useMarkdownContext } from "./MarkdownProvider.mjs";
|
|
4
|
+
import { compileMarkdown } from "./processor.mjs";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/markdown/MarkdownRendererPlugin.tsx
|
|
7
7
|
const MarkdownRendererPlugin = (props) => {
|
|
8
8
|
const { children, options, components } = props;
|
|
9
9
|
const context = useMarkdownContext();
|
|
@@ -17,6 +17,5 @@ const MarkdownRendererPlugin = (props) => {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
export { MarkdownRendererPlugin };
|
|
22
21
|
//# sourceMappingURL=MarkdownRendererPlugin.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compileMarkdown, parseMarkdown } from "./processor.mjs";
|
|
2
1
|
import { MarkdownProvider, useMarkdownContext } from "./MarkdownProvider.mjs";
|
|
3
2
|
import { MarkdownRenderer, renderMarkdown, useMarkdownRenderer } from "./MarkdownRenderer.mjs";
|
|
3
|
+
import { compileMarkdown, parseMarkdown } from "./processor.mjs";
|
|
4
4
|
|
|
5
5
|
export { MarkdownProvider, MarkdownRenderer, compileMarkdown, parseMarkdown, renderMarkdown, useMarkdownContext, useMarkdownRenderer };
|