preact-intlayer 9.4.3 → 9.5.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/README.md +0 -2
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/types/IntlayerNode.d.ts +2 -3
- 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 +1 -2
- package/dist/types/analytics/AnalyticsProvider.d.ts.map +1 -1
- package/dist/types/analytics/exposureSink.d.ts +4 -5
- package/dist/types/analytics/exposureSink.d.ts.map +1 -1
- package/dist/types/analytics/useAnalytics.d.ts +1 -2
- package/dist/types/analytics/useAnalytics.d.ts.map +1 -1
- package/dist/types/analytics/useConversion.d.ts +2 -3
- package/dist/types/analytics/useConversion.d.ts.map +1 -1
- package/dist/types/analytics/useExperiment.d.ts +2 -3
- package/dist/types/analytics/useExperiment.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +5 -6
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/t.d.ts +1 -2
- package/dist/types/client/t.d.ts.map +1 -1
- package/dist/types/client/useContent.d.ts +2 -4
- package/dist/types/client/useContent.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +1 -2
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +1 -2
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -2
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +1 -2
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useLoadDynamic.d.ts +1 -2
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +1 -2
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +5 -7
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +7 -9
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/client/usePathname.d.ts +1 -2
- package/dist/types/client/usePathname.d.ts.map +1 -1
- package/dist/types/client/useTraduction.d.ts +1 -2
- package/dist/types/client/useTraduction.d.ts.map +1 -1
- package/dist/types/editor/ContentSelector.d.ts +2 -3
- package/dist/types/editor/ContentSelector.d.ts.map +1 -1
- package/dist/types/editor/EditorProvider.d.ts +1 -2
- package/dist/types/editor/EditorProvider.d.ts.map +1 -1
- package/dist/types/editor/useEditor.d.ts +1 -2
- package/dist/types/editor/useEditor.d.ts.map +1 -1
- package/dist/types/format/useCompact.d.ts +2 -4
- package/dist/types/format/useCompact.d.ts.map +1 -1
- package/dist/types/format/useCurrency.d.ts +2 -4
- package/dist/types/format/useCurrency.d.ts.map +1 -1
- package/dist/types/format/useDate.d.ts +1 -2
- package/dist/types/format/useDate.d.ts.map +1 -1
- package/dist/types/format/useIntl.d.ts +1 -2
- package/dist/types/format/useIntl.d.ts.map +1 -1
- package/dist/types/format/useList.d.ts +2 -8
- package/dist/types/format/useList.d.ts.map +1 -1
- package/dist/types/format/useNumber.d.ts +2 -4
- package/dist/types/format/useNumber.d.ts.map +1 -1
- package/dist/types/format/usePercentage.d.ts +2 -4
- package/dist/types/format/usePercentage.d.ts.map +1 -1
- package/dist/types/format/useRelativeTime.d.ts +2 -4
- package/dist/types/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/format/useUnit.d.ts +2 -4
- package/dist/types/format/useUnit.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/html/HTMLProvider.d.ts +2 -3
- package/dist/types/html/HTMLProvider.d.ts.map +1 -1
- package/dist/types/html/HTMLRenderer.d.ts +5 -6
- package/dist/types/html/HTMLRenderer.d.ts.map +1 -1
- package/dist/types/html/types.d.ts +2 -3
- package/dist/types/html/types.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +3 -4
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +5 -6
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts +2 -3
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -1
- package/dist/types/markdown/compiler.d.ts +4 -4
- package/dist/types/markdown/compiler.d.ts.map +1 -1
- package/dist/types/markdown/runtime.d.ts +2 -2
- package/dist/types/markdown/runtime.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +16 -17
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/preactElement/renderPreactElement.d.ts +1 -2
- package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/types/intlayer/dist/types/index.d.ts +0 -14
package/README.md
CHANGED
|
@@ -69,8 +69,6 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
69
69
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) <br> - [Intlayer compat adapters](https://intlayer.org/doc/compatibility) |
|
|
70
70
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
|
|
71
71
|
|
|
72
|
-
---
|
|
73
|
-
|
|
74
72
|
## 📦 Installation
|
|
75
73
|
|
|
76
74
|
Start your journey with Intlayer today and experience a smoother, more powerful approach to internationalization.
|
|
@@ -5,6 +5,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
|
|
|
5
5
|
let preact_hooks = require("preact/hooks");
|
|
6
6
|
|
|
7
7
|
//#region src/client/useLocale.ts
|
|
8
|
+
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
8
9
|
/**
|
|
9
10
|
* Preact hook to get the current locale and related locale management functions.
|
|
10
11
|
*
|
|
@@ -29,7 +30,6 @@ let preact_hooks = require("preact/hooks");
|
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
32
|
const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
32
|
-
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
33
33
|
const { locale, setLocale: setLocaleState, isCookieEnabled: isCookieEnabledContext } = (0, preact_hooks.useContext)(require_client_IntlayerProvider.IntlayerClientContext) ?? {};
|
|
34
34
|
const setLocale = (locale) => {
|
|
35
35
|
if (!availableLocales?.map(String).includes(locale)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.cjs","names":["internationalization","useContext","IntlayerClientContext"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\ntype UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {
|
|
1
|
+
{"version":3,"file":"useLocale.cjs","names":["internationalization","useContext","IntlayerClientContext"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\ntype UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext) ?? {};\n\n const setLocale = (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n\n onLocaleChange?.(locale as DeclaredLocales);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;AAqBA,MAAM,EAAE,eAAe,SAAS,qBAAqBA,+CAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,MAAa,aAAa,EACxB,iBACA,mBACkB,CAAC,MAAuB;CAC1C,MAAM,EACJ,QACA,WAAW,gBACX,iBAAiB,+BACfC,yBAAWC,qDAAqB,KAAK,CAAC;CAE1C,MAAM,aAAa,WAA0B;EAC3C,IAAI,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG;GACnD,QAAQ,MAAM,UAAU,OAAO,kBAAkB;GACjD;EACF;EAEA,eAAe,MAAM;EAErB,mDACE,QACA,mBAAmB,0BAA0B,IAC/C;EAEA,iBAAiB,MAAyB;CAC5C;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -4,6 +4,7 @@ import { internationalization } from "@intlayer/config/built";
|
|
|
4
4
|
import { useContext } from "preact/hooks";
|
|
5
5
|
|
|
6
6
|
//#region src/client/useLocale.ts
|
|
7
|
+
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
7
8
|
/**
|
|
8
9
|
* Preact hook to get the current locale and related locale management functions.
|
|
9
10
|
*
|
|
@@ -28,7 +29,6 @@ import { useContext } from "preact/hooks";
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
31
|
-
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
32
32
|
const { locale, setLocale: setLocaleState, isCookieEnabled: isCookieEnabledContext } = useContext(IntlayerClientContext) ?? {};
|
|
33
33
|
const setLocale = (locale) => {
|
|
34
34
|
if (!availableLocales?.map(String).includes(locale)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\ntype UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {
|
|
1
|
+
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\ntype UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext) ?? {};\n\n const setLocale = (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n\n onLocaleChange?.(locale as DeclaredLocales);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;AAqBA,MAAM,EAAE,eAAe,SAAS,qBAAqB,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,MAAa,aAAa,EACxB,iBACA,mBACkB,CAAC,MAAuB;CAC1C,MAAM,EACJ,QACA,WAAW,gBACX,iBAAiB,2BACf,WAAW,qBAAqB,KAAK,CAAC;CAE1C,MAAM,aAAa,WAA0B;EAC3C,IAAI,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG;GACnD,QAAQ,MAAM,UAAU,OAAO,kBAAkB;GACjD;EACF;EAEA,eAAe,MAAM;EAErB,mBACE,QACA,mBAAmB,0BAA0B,IAC/C;EAEA,iBAAiB,MAAyB;CAC5C;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -2,7 +2,7 @@ import { NodeProps } from "@intlayer/core/interpreter";
|
|
|
2
2
|
import { ResolvedEditor } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { ComponentChildren, VNode } from "preact";
|
|
4
4
|
//#region src/IntlayerNode.d.ts
|
|
5
|
-
type IntlayerNode<T = NodeProps['children'], AdditionalProps = {}> = ResolvedEditor<T, VNode> & {
|
|
5
|
+
export type IntlayerNode<T = NodeProps['children'], AdditionalProps = {}> = ResolvedEditor<T, VNode> & {
|
|
6
6
|
value: T;
|
|
7
7
|
} & AdditionalProps & T;
|
|
8
8
|
type RenderIntlayerNodeProps<T> = {
|
|
@@ -12,7 +12,6 @@ type RenderIntlayerNodeProps<T> = {
|
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
declare const renderIntlayerNode: <T>({ children, value, additionalProps }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
|
|
15
|
+
export declare const renderIntlayerNode: <T>({ children, value, additionalProps }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { IntlayerNode, renderIntlayerNode };
|
|
18
17
|
//# sourceMappingURL=IntlayerNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerNode.d.ts","names":[],"sources":["../../src/IntlayerNode.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"IntlayerNode.d.ts","names":[],"sources":["../../src/IntlayerNode.tsx"],"mappings":";;;;YAUY,aACV,IAAI,uBACJ,wBACE,eAAe,GAAG;EACpB,OAAO;IACL,kBACF;KAEG,wBAAwB;EAC3B,OAAO;EACP,UAAU;EACV;KAAqB;;;qBAGV,qBACX,KAAC,UAAA,OAAA,mBAKA,wBAAwB,OAAK,aAAa"}
|
|
@@ -8,7 +8,6 @@ type ContentSelectorProps = {
|
|
|
8
8
|
pressDuration?: number;
|
|
9
9
|
isSelecting?: boolean;
|
|
10
10
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'content'>;
|
|
11
|
-
declare const ContentSelector: FunctionalComponent<ContentSelectorProps>;
|
|
11
|
+
export declare const ContentSelector: FunctionalComponent<ContentSelectorProps>;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { ContentSelector };
|
|
14
13
|
//# sourceMappingURL=ContentSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/UI/ContentSelector.tsx"],"mappings":";;KAKK;EACH;EACA;EACA;EACA;EACA;EACA;IACE,KAAK,IAAI,eAAe;
|
|
1
|
+
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/UI/ContentSelector.tsx"],"mappings":";;KAKK;EACH;EACA;EACA;EACA;EACA;EACA;IACE,KAAK,IAAI,eAAe;qBAEf,iBAAiB,oBAAoB"}
|
|
@@ -4,9 +4,8 @@ import { ComponentChildren, FunctionComponent } from "preact";
|
|
|
4
4
|
* Runs {@link useAnalytics} and renders its children unchanged. Mounted inside
|
|
5
5
|
* {@link IntlayerProvider} alongside `EditorProvider`.
|
|
6
6
|
*/
|
|
7
|
-
declare const AnalyticsProvider: FunctionComponent<{
|
|
7
|
+
export declare const AnalyticsProvider: FunctionComponent<{
|
|
8
8
|
children?: ComponentChildren;
|
|
9
9
|
}>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { AnalyticsProvider };
|
|
12
11
|
//# sourceMappingURL=AnalyticsProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsProvider.d.ts","names":[],"sources":["../../../src/analytics/AnalyticsProvider.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"AnalyticsProvider.d.ts","names":[],"sources":["../../../src/analytics/AnalyticsProvider.tsx"],"mappings":";;;;;;qBAOa,mBAAmB;EAC9B,WAAW"}
|
|
@@ -5,28 +5,27 @@ import { KeyPath } from "@intlayer/types/keyPath";
|
|
|
5
5
|
* only) so the interpreter hot path in `plugins.tsx` never statically imports
|
|
6
6
|
* `@intlayer/analytics` — the package stays optional and tree-shakeable.
|
|
7
7
|
*/
|
|
8
|
-
type ExposureInput = {
|
|
8
|
+
export type ExposureInput = {
|
|
9
9
|
dictionaryKey: string;
|
|
10
10
|
keyPath: KeyPath[];
|
|
11
11
|
locale?: string;
|
|
12
12
|
nodeType?: string;
|
|
13
13
|
};
|
|
14
14
|
/** Consumer of exposure reports, installed by `useAnalytics` after init. */
|
|
15
|
-
type ExposureSink = (input: ExposureInput) => void;
|
|
15
|
+
export type ExposureSink = (input: ExposureInput) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Installs (or clears) the exposure sink. `useAnalytics` sets this once the
|
|
18
18
|
* analytics client has loaded, and clears it on unmount.
|
|
19
19
|
*
|
|
20
20
|
* @param next - The sink to install, or `null` to clear.
|
|
21
21
|
*/
|
|
22
|
-
declare const setExposureSink: (next: ExposureSink | null) => void;
|
|
22
|
+
export declare const setExposureSink: (next: ExposureSink | null) => void;
|
|
23
23
|
/**
|
|
24
24
|
* Forwards a content exposure to the installed sink. A cheap null-check when
|
|
25
25
|
* analytics is not running, so it is safe to call from every node resolution.
|
|
26
26
|
*
|
|
27
27
|
* @param input - The node metadata to report.
|
|
28
28
|
*/
|
|
29
|
-
declare const reportExposure: (input: ExposureInput) => void;
|
|
29
|
+
export declare const reportExposure: (input: ExposureInput) => void;
|
|
30
30
|
//#endregion
|
|
31
|
-
export { ExposureInput, ExposureSink, reportExposure, setExposureSink };
|
|
32
31
|
//# sourceMappingURL=exposureSink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposureSink.d.ts","names":[],"sources":["../../../src/analytics/exposureSink.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"exposureSink.d.ts","names":[],"sources":["../../../src/analytics/exposureSink.ts"],"mappings":";;;;;;;YAOY;EACV;EACA,SAAS;EACT;EACA;;;YAIU,gBAAgB,OAAO;;;;;;;qBAUtB,kBAAe,MAAU;;;;;;;qBAUzB,iBAAc,OAAW"}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* guarded by `INTLAYER_ANALYTICS_ENABLED` and dead-code-eliminated at build
|
|
10
10
|
* time.
|
|
11
11
|
*/
|
|
12
|
-
declare const useAnalytics: () => void;
|
|
12
|
+
export declare const useAnalytics: () => void;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { useAnalytics };
|
|
15
14
|
//# sourceMappingURL=useAnalytics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnalytics.d.ts","names":[],"sources":["../../../src/analytics/useAnalytics.tsx"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useAnalytics.d.ts","names":[],"sources":["../../../src/analytics/useAnalytics.tsx"],"mappings":";;;;;;;;;;;qBAgBa"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Parameters describing a conversion to record.
|
|
4
4
|
*/
|
|
5
|
-
type ConversionParams = {
|
|
5
|
+
export type ConversionParams = {
|
|
6
6
|
/** The experiment this conversion is attributed to. */
|
|
7
7
|
experimentKey: string;
|
|
8
8
|
/** The variant the session was assigned. */
|
|
@@ -25,7 +25,6 @@ type ConversionParams = {
|
|
|
25
25
|
* })}>Get started</button>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
declare const useConversion: () => (params: ConversionParams) => void;
|
|
28
|
+
export declare const useConversion: () => (params: ConversionParams) => void;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ConversionParams, useConversion };
|
|
31
30
|
//# sourceMappingURL=useConversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversion.d.ts","names":[],"sources":["../../../src/analytics/useConversion.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useConversion.d.ts","names":[],"sources":["../../../src/analytics/useConversion.ts"],"mappings":";;;;YAMY;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;qBAgBW,sBAAa,QACI"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The state of an A/B experiment for the current session.
|
|
4
4
|
*/
|
|
5
|
-
type ExperimentState = {
|
|
5
|
+
export type ExperimentState = {
|
|
6
6
|
/**
|
|
7
7
|
* The variant assigned to this session. Until assignment resolves (and on
|
|
8
8
|
* the server, or when analytics is disabled), this is the first variant —
|
|
@@ -35,7 +35,6 @@ type ExperimentState = {
|
|
|
35
35
|
* const content = useIntlayer(variant === 'b' ? 'hero-b' : 'hero');
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare const useExperiment: (experimentKey: string, variants: string[], weights?: number[]) => ExperimentState;
|
|
38
|
+
export declare const useExperiment: (experimentKey: string, variants: string[], weights?: number[]) => ExperimentState;
|
|
39
39
|
//#endregion
|
|
40
|
-
export { ExperimentState, useExperiment };
|
|
41
40
|
//# sourceMappingURL=useExperiment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExperiment.d.ts","names":[],"sources":["../../../src/analytics/useExperiment.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useExperiment.d.ts","names":[],"sources":["../../../src/analytics/useExperiment.ts"],"mappings":";;;;YAMY;;;;;;EAMV;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;qBAsBW,gBAAa,uBACH,oBACH,uBAEjB"}
|
|
@@ -14,12 +14,12 @@ type IntlayerValue = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Context that store the current locale on the client side
|
|
16
16
|
*/
|
|
17
|
-
declare const IntlayerClientContext: import("preact").Context<IntlayerValue>;
|
|
17
|
+
export declare const IntlayerClientContext: import("preact").Context<IntlayerValue>;
|
|
18
18
|
/**
|
|
19
19
|
* Hook that provides the current locale
|
|
20
20
|
*/
|
|
21
|
-
declare const useIntlayerContext: () => {};
|
|
22
|
-
type IntlayerProviderProps = {
|
|
21
|
+
export declare const useIntlayerContext: () => {};
|
|
22
|
+
export type IntlayerProviderProps = {
|
|
23
23
|
children?: ComponentChild;
|
|
24
24
|
locale?: LocalesValues;
|
|
25
25
|
defaultLocale?: LocalesValues;
|
|
@@ -47,7 +47,7 @@ type IntlayerProviderProps = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Provider that store the current locale on the client side
|
|
49
49
|
*/
|
|
50
|
-
declare const IntlayerProviderContent: FunctionComponent<IntlayerProviderProps>;
|
|
50
|
+
export declare const IntlayerProviderContent: FunctionComponent<IntlayerProviderProps>;
|
|
51
51
|
/**
|
|
52
52
|
* Main provider for Intlayer in Preact applications.
|
|
53
53
|
*
|
|
@@ -68,7 +68,6 @@ declare const IntlayerProviderContent: FunctionComponent<IntlayerProviderProps>;
|
|
|
68
68
|
* );
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare const IntlayerProvider: FunctionComponent<IntlayerProviderProps>;
|
|
71
|
+
export declare const IntlayerProvider: FunctionComponent<IntlayerProviderProps>;
|
|
72
72
|
//#endregion
|
|
73
|
-
export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, IntlayerProviderProps, useIntlayerContext };
|
|
74
73
|
//# sourceMappingURL=IntlayerProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"mappings":";;;KAiBK;EACH,QAAQ;EACR,YAAY,WAAW;;;;;EAKvB,UAAU;EACV;;;;;
|
|
1
|
+
{"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"mappings":";;;KAiBK;EACH,QAAQ;EACR,YAAY,WAAW;;;;;EAKvB,UAAU;EACV;;;;;qBAMW,wCAAqB,QAAA;;;;qBAQrB;YAED;EACV,WAAW;EACX,SAAS;EACT,gBAAgB;;;;;;;;;;;;;;;;;;EAkBhB,UAAU;EACV,aAAa,QAAQ;EACrB;;;;;qBAMW,yBAAyB,kBACpC;;;;;;;;;;;;;;;;;;;;;qBA+EW,kBAAkB,kBAAkB"}
|
package/dist/types/client/t.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { Locale } from "@intlayer/types/allLocales";
|
|
|
6
6
|
*
|
|
7
7
|
* If the locale is not provided, it will use the locale from the client context
|
|
8
8
|
*/
|
|
9
|
-
declare const t: <Content = string>(multilangContent: StrictModeLocaleMap<Content>, locale?: Locale) => Content;
|
|
9
|
+
export declare const t: <Content = string>(multilangContent: StrictModeLocaleMap<Content>, locale?: Locale) => Content;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { t };
|
|
12
11
|
//# sourceMappingURL=t.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/client/t.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/client/t.ts"],"mappings":";;;;;;;;qBAWa,IAAK,kBAAgB,kBACd,oBAAoB,UAAQ,SACrC,WAAM"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { LocalesValues as LocalesValues$1 } from "../intlayer/dist/types/index.js";
|
|
2
1
|
import { useTranslation } from "./useTraduction.js";
|
|
3
2
|
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
4
3
|
//#region src/client/useContent.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* On the client side, hook to get the translation content based on the locale
|
|
7
6
|
*/
|
|
8
|
-
declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
9
|
-
locale: LocalesValues
|
|
7
|
+
export declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
8
|
+
locale: import("@intlayer/types").LocalesValues;
|
|
10
9
|
content: Content;
|
|
11
10
|
t: typeof useTranslation;
|
|
12
11
|
};
|
|
13
12
|
//#endregion
|
|
14
|
-
export { useContent };
|
|
15
13
|
//# sourceMappingURL=useContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"mappings":";;;;;;qBAOa,aAAc,SAAO,iBACf,oBAAoB"}
|
|
@@ -9,7 +9,6 @@ import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup } from
|
|
|
9
9
|
* If the locale is not provided (directly or through the selector), it will use
|
|
10
10
|
* the locale from the client context.
|
|
11
11
|
*/
|
|
12
|
-
declare const useDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends LocalesValues | DictionarySelectorForGroup<T> = DeclaredLocales>(dictionary: T, localeOrSelector?: A) => import("@intlayer/core/interpreter").DeepTransformContent<import("@intlayer/types").ResolveQualifiedDictionaryContent<T, A>, IInterpreterPluginState, import("@intlayer/types").ExtractSelectorLocale<A>>;
|
|
12
|
+
export declare const useDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends LocalesValues | DictionarySelectorForGroup<T> = DeclaredLocales>(dictionary: T, localeOrSelector?: A) => import("@intlayer/core/interpreter").DeepTransformContent<import("@intlayer/types").ResolveQualifiedDictionaryContent<T, A>, IInterpreterPluginState, import("@intlayer/types").ExtractSelectorLocale<A>>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { useDictionary };
|
|
15
14
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;;;qBAwBa,sBACL,UAAU,aAAa,gCACvB,UACF,gBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,2CAAC,+CAAA,kCAAA,GAAA,IAAA,mDAAA,sBAAA"}
|
|
@@ -6,7 +6,6 @@ import { Dictionary } from "@intlayer/types/dictionary";
|
|
|
6
6
|
*
|
|
7
7
|
* If the locale is not provided, it will use the locale from the client context
|
|
8
8
|
*/
|
|
9
|
-
declare const useDictionaryAsync: <const T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<T>;
|
|
9
|
+
export declare const useDictionaryAsync: <const T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<T>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { useDictionaryAsync };
|
|
12
11
|
//# sourceMappingURL=useDictionaryAsync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"mappings":";;;;;;;;qBAea,2BAAkC,UAAU,YAAU,mBAC9C,0BAA0B,QAAQ,KAAG,SAC/C,kBACR,QAAQ"}
|
|
@@ -13,7 +13,6 @@ import { QualifiedDynamicLoaderMap } from "@intlayer/core/dictionaryManipulator"
|
|
|
13
13
|
* If the locale is not provided (directly or through the selector), the client
|
|
14
14
|
* context locale is used.
|
|
15
15
|
*/
|
|
16
|
-
declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys, const A extends LocalesValues | DictionarySelectorForKey<K> = DeclaredLocales>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>> | QualifiedDynamicLoaderMap, key: K, localeOrSelector?: A) => any;
|
|
16
|
+
export declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys, const A extends LocalesValues | DictionarySelectorForKey<K> = DeclaredLocales>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>> | QualifiedDynamicLoaderMap, key: K, localeOrSelector?: A) => any;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { useDictionaryDynamic };
|
|
19
18
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;;;qBAmCa,6BACL,UAAU,kBACV,UAAU,sBACV,UAAU,gBAAgB,yBAAyB,KAAK,iBAAe,mBAGzE,0BAA0B,QAAQ,MAClC,2BAAyB,KACxB,GAAC,mBACa"}
|
|
@@ -25,7 +25,6 @@ import { DeclaredLocales, DictionaryKeys, DictionarySelectorForKey, LocalesValue
|
|
|
25
25
|
* };
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
declare const useIntlayer: <const T extends DictionaryKeys, const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales>(key: T, localeOrSelector?: A) => import("@intlayer/core/interpreter").DeepTransformContent<import("@intlayer/types").DictionaryRegistryResult<T, A>, IInterpreterPluginState, import("@intlayer/types").ExtractSelectorLocale<A>>;
|
|
28
|
+
export declare const useIntlayer: <const T extends DictionaryKeys, const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales>(key: T, localeOrSelector?: A) => import("@intlayer/core/interpreter").DeepTransformContent<import("@intlayer/types").DictionaryRegistryResult<T, A>, IInterpreterPluginState, import("@intlayer/types").ExtractSelectorLocale<A>>;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { useIntlayer };
|
|
31
30
|
//# sourceMappingURL=useIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsCa,oBACL,UAAU,sBACV,UAAU,gBAAgB,yBAAyB,KAAK,iBAAe,KAExE,GAAC,mBACa,2CAAC,+CAAA,yBAAA,GAAA,IAAA,mDAAA,sBAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/client/useLoadDynamic.d.ts
|
|
2
|
-
declare const useLoadDynamic: <T>(key: string, promise: Promise<T>) => T;
|
|
2
|
+
export declare const useLoadDynamic: <T>(key: string, promise: Promise<T>) => T;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { useLoadDynamic };
|
|
5
4
|
//# sourceMappingURL=useLoadDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadDynamic.d.ts","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useLoadDynamic.d.ts","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"mappings":";qBA2Ba,iBAAkB,GAAC,aAAa,SAAW,QAAQ,OAAK"}
|
|
@@ -33,7 +33,6 @@ type UseLocaleResult = {
|
|
|
33
33
|
* };
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare const useLocale: ({ isCookieEnabled, onLocaleChange }?: UseLocaleProps) => UseLocaleResult;
|
|
36
|
+
export declare const useLocale: ({ isCookieEnabled, onLocaleChange }?: UseLocaleProps) => UseLocaleResult;
|
|
37
37
|
//#endregion
|
|
38
|
-
export { useLocale };
|
|
39
38
|
//# sourceMappingURL=useLocale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;KASK;EACH;EACA,kBAAkB,QAAQ;;KAGvB;EACH,QAAQ;EACR,eAAe;EACf,kBAAkB;EAClB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;KASK;EACH;EACA,kBAAkB,QAAQ;;KAGvB;EACH,QAAQ;EACR,eAAe;EACf,kBAAkB;EAClB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBA4BT,cAAS,iBAAA,mBAGnB,mBAAsB"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
1
|
//#region src/client/useLocaleBase.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* On the client side, hook to get the current locale and all related fields
|
|
5
4
|
*/
|
|
6
|
-
declare const useLocaleBase: () => {
|
|
7
|
-
locale: LocalesValues;
|
|
8
|
-
defaultLocale:
|
|
9
|
-
availableLocales:
|
|
10
|
-
setLocale: (newLocale: LocalesValues) => void;
|
|
5
|
+
export declare const useLocaleBase: () => {
|
|
6
|
+
locale: import("@intlayer/types").LocalesValues;
|
|
7
|
+
defaultLocale: import("@intlayer/types").Locale;
|
|
8
|
+
availableLocales: import("@intlayer/types").Locale[];
|
|
9
|
+
setLocale: (newLocale: import("@intlayer/types").LocalesValues) => void;
|
|
11
10
|
};
|
|
12
11
|
//#endregion
|
|
13
|
-
export { useLocaleBase };
|
|
14
12
|
//# sourceMappingURL=useLocaleBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":";;;;qBASa"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { Locale } from "../intlayer/dist/types/index.js";
|
|
2
1
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
2
|
//#region src/client/useLocaleStorage.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Get the locale cookie
|
|
6
5
|
*/
|
|
7
|
-
declare const localeInStorage: Locale;
|
|
6
|
+
export declare const localeInStorage: import("@intlayer/types").Locale;
|
|
8
7
|
/**
|
|
9
8
|
* @deprecated Use localeInStorage instead
|
|
10
9
|
*
|
|
11
10
|
* Get the locale cookie
|
|
12
11
|
*/
|
|
13
|
-
declare const localeCookie: Locale;
|
|
12
|
+
export declare const localeCookie: import("@intlayer/types").Locale;
|
|
14
13
|
/**
|
|
15
14
|
* Set the locale cookie
|
|
16
15
|
*/
|
|
17
|
-
declare const setLocaleInStorage: (locale: LocalesValues, isCookieEnabled: boolean) => void;
|
|
16
|
+
export declare const setLocaleInStorage: (locale: LocalesValues, isCookieEnabled: boolean) => void;
|
|
18
17
|
/**
|
|
19
18
|
* @deprecated Use setLocaleInStorage instead
|
|
20
19
|
*
|
|
21
20
|
* Set the locale cookie
|
|
22
21
|
*/
|
|
23
|
-
declare const setLocaleCookie: typeof setLocaleInStorage;
|
|
22
|
+
export declare const setLocaleCookie: typeof setLocaleInStorage;
|
|
24
23
|
/**
|
|
25
24
|
* Hook that provides the locale storage and a function to set it
|
|
26
25
|
*/
|
|
27
|
-
declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
28
|
-
getLocale: () => Locale;
|
|
26
|
+
export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
27
|
+
getLocale: () => import("@intlayer/types").Locale;
|
|
29
28
|
setLocale: (locale: LocalesValues) => void;
|
|
30
29
|
};
|
|
31
30
|
/**
|
|
@@ -35,7 +34,6 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
|
35
34
|
*
|
|
36
35
|
* Hook that provides the locale cookie and a function to set it
|
|
37
36
|
*/
|
|
38
|
-
declare const useLocaleCookie: typeof useLocaleStorage;
|
|
37
|
+
export declare const useLocaleCookie: typeof useLocaleStorage;
|
|
39
38
|
//#endregion
|
|
40
|
-
export { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage };
|
|
41
39
|
//# sourceMappingURL=useLocaleStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;qBAYa,2CAAe;;;;;;qBAMf,wCAAY;;;;qBAKZ,qBAAkB,QACrB,eAAa;;;;;;qBAaV,wBAAe;;;;qBAKf,mBAAgB;;sBAAhB;;;;;;;;;qBAiBA,wBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePathname.d.ts","names":[],"sources":["../../../src/client/usePathname.ts"],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePathname.d.ts","names":[],"sources":["../../../src/client/usePathname.ts"],"mappings":";;;;;;;;;;;;;;;;;;;qBAqBa"}
|
|
@@ -21,7 +21,6 @@ import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
|
21
21
|
* - this function will require each locale to be defined if defined in the project configuration.
|
|
22
22
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
23
23
|
*/
|
|
24
|
-
declare const useTranslation: <Content = string>(languageContent: StrictModeLocaleMap<Content>) => Content;
|
|
24
|
+
export declare const useTranslation: <Content = string>(languageContent: StrictModeLocaleMap<Content>) => Content;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { useTranslation };
|
|
27
26
|
//# sourceMappingURL=useTraduction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;qBA0Ba,iBAAkB,kBAAgB,iBAC5B,oBAAoB,aACpC"}
|
|
@@ -11,8 +11,7 @@ declare module 'preact' {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
type ContentSelectorWrapperProps = NodeProps & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
15
|
-
declare const ContentSelector: FunctionalComponent<ContentSelectorWrapperProps>;
|
|
14
|
+
export type ContentSelectorWrapperProps = NodeProps & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
15
|
+
export declare const ContentSelector: FunctionalComponent<ContentSelectorWrapperProps>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { ContentSelector, ContentSelectorWrapperProps };
|
|
18
17
|
//# sourceMappingURL=ContentSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/editor/ContentSelector.tsx"],"mappings":";;;;YAOY;cACE;MACR,qCAAqC,eAAe;QAClD;QACA;;;;;
|
|
1
|
+
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/editor/ContentSelector.tsx"],"mappings":";;;;YAOY;cACE;MACR,qCAAqC,eAAe;QAClD;QACA;;;;;YAMI,8BAA8B,YACxC,KAAK,eAAe;qBAET,iBAAiB,oBAC5B"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentChild, FunctionComponent } from "preact";
|
|
2
2
|
//#region src/editor/EditorProvider.d.ts
|
|
3
|
-
declare const EditorProvider: FunctionComponent<{
|
|
3
|
+
export declare const EditorProvider: FunctionComponent<{
|
|
4
4
|
children?: ComponentChild;
|
|
5
5
|
}>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { EditorProvider };
|
|
8
7
|
//# sourceMappingURL=EditorProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorProvider.d.ts","names":[],"sources":["../../../src/editor/EditorProvider.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"EditorProvider.d.ts","names":[],"sources":["../../../src/editor/EditorProvider.tsx"],"mappings":";;qBAGa,gBAAgB;EAC3B,WAAW"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Syncs the current locale from the Intlayer context into the editor manager so
|
|
5
5
|
* the editor always knows which locale the app is displaying.
|
|
6
6
|
*/
|
|
7
|
-
declare const useEditor: () => void;
|
|
7
|
+
export declare const useEditor: () => void;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { useEditor };
|
|
10
9
|
//# sourceMappingURL=useEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.d.ts","names":[],"sources":["../../../src/editor/useEditor.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"useEditor.d.ts","names":[],"sources":["../../../src/editor/useEditor.tsx"],"mappings":";;;;;;qBAWa"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
1
|
//#region src/format/useCompact.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* React client hook that provides a compact number formatter
|
|
@@ -10,9 +9,8 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
|
10
9
|
* formatCompact(1500); // "1.5K"
|
|
11
10
|
* ```
|
|
12
11
|
*/
|
|
13
|
-
declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
14
|
-
locale?: LocalesValues;
|
|
12
|
+
export declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
13
|
+
locale?: import("@intlayer/types").LocalesValues;
|
|
15
14
|
}) => string;
|
|
16
15
|
//#endregion
|
|
17
|
-
export { useCompact };
|
|
18
16
|
//# sourceMappingURL=useCompact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;;;;;;;;;;qBAca,mBAAU,wBAAA,UAAA,KAAA"}
|