preact-intlayer 6.1.6 → 7.0.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/IntlayerNode.cjs +15 -45
- package/dist/cjs/IntlayerNode.cjs.map +1 -1
- package/dist/cjs/UI/ContentSelector.cjs +98 -130
- package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
- package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/cjs/client/IntlayerProvider.cjs +67 -95
- package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
- package/dist/cjs/client/format/index.cjs +17 -50
- package/dist/cjs/client/format/useCompact.cjs +29 -39
- package/dist/cjs/client/format/useCompact.cjs.map +1 -1
- package/dist/cjs/client/format/useCurrency.cjs +43 -39
- package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
- package/dist/cjs/client/format/useDate.cjs +45 -36
- package/dist/cjs/client/format/useDate.cjs.map +1 -1
- package/dist/cjs/client/format/useList.cjs +40 -39
- package/dist/cjs/client/format/useList.cjs.map +1 -1
- package/dist/cjs/client/format/useNumber.cjs +41 -39
- package/dist/cjs/client/format/useNumber.cjs.map +1 -1
- package/dist/cjs/client/format/usePercentage.cjs +37 -39
- package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
- package/dist/cjs/client/format/useRelativeTime.cjs +37 -39
- package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
- package/dist/cjs/client/format/useUnit.cjs +36 -39
- package/dist/cjs/client/format/useUnit.cjs.map +1 -1
- package/dist/cjs/client/index.cjs +29 -69
- package/dist/cjs/client/t.cjs +21 -34
- package/dist/cjs/client/t.cjs.map +1 -1
- package/dist/cjs/client/useContent.cjs +16 -36
- package/dist/cjs/client/useContent.cjs.map +1 -1
- package/dist/cjs/client/useDictionary.cjs +26 -36
- package/dist/cjs/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +23 -52
- package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +22 -42
- package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs +26 -36
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/client/useLoadDynamic.cjs +21 -50
- package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
- package/dist/cjs/client/useLocale.cjs +36 -67
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/client/useLocaleBase.cjs +25 -53
- package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +60 -0
- package/dist/cjs/client/useLocaleStorage.cjs.map +1 -0
- package/dist/cjs/client/useTraduction.cjs +34 -35
- package/dist/cjs/client/useTraduction.cjs.map +1 -1
- package/dist/cjs/editor/CommunicatorContext.cjs +40 -62
- package/dist/cjs/editor/CommunicatorContext.cjs.map +1 -1
- package/dist/cjs/editor/ConfigurationContext.cjs +26 -47
- package/dist/cjs/editor/ConfigurationContext.cjs.map +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +58 -94
- package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/editor/DictionariesRecordContext.cjs +47 -73
- package/dist/cjs/editor/DictionariesRecordContext.cjs.map +1 -1
- package/dist/cjs/editor/EditedContentContext.cjs +160 -211
- package/dist/cjs/editor/EditedContentContext.cjs.map +1 -1
- package/dist/cjs/editor/EditorEnabledContext.cjs +34 -59
- package/dist/cjs/editor/EditorEnabledContext.cjs.map +1 -1
- package/dist/cjs/editor/EditorProvider.cjs +62 -66
- package/dist/cjs/editor/EditorProvider.cjs.map +1 -1
- package/dist/cjs/editor/FocusDictionaryContext.cjs +51 -75
- package/dist/cjs/editor/FocusDictionaryContext.cjs.map +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +45 -94
- package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -1
- package/dist/cjs/editor/index.cjs +3 -23
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +73 -50
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +106 -73
- package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +67 -66
- package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +27 -59
- package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs +24 -47
- package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs +15 -40
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs +15 -36
- package/dist/cjs/getIntlayer.cjs.map +1 -1
- package/dist/cjs/index.cjs +30 -62
- package/dist/cjs/markdown/MarkdownProvider.cjs +19 -39
- package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +39 -80
- package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
- package/dist/cjs/markdown/index.cjs +7 -25
- package/dist/cjs/plugins.cjs +97 -119
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/cjs/preactElement/renderPreactElement.cjs +34 -59
- package/dist/cjs/preactElement/renderPreactElement.cjs.map +1 -1
- package/dist/esm/IntlayerNode.mjs +13 -25
- package/dist/esm/IntlayerNode.mjs.map +1 -1
- package/dist/esm/UI/ContentSelector.mjs +94 -105
- package/dist/esm/UI/ContentSelector.mjs.map +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +51 -54
- package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
- package/dist/esm/client/format/index.mjs +2 -11
- package/dist/esm/client/format/useCompact.mjs +24 -13
- package/dist/esm/client/format/useCompact.mjs.map +1 -1
- package/dist/esm/client/format/useCurrency.mjs +38 -13
- package/dist/esm/client/format/useCurrency.mjs.map +1 -1
- package/dist/esm/client/format/useDate.mjs +40 -10
- package/dist/esm/client/format/useDate.mjs.map +1 -1
- package/dist/esm/client/format/useList.mjs +35 -13
- package/dist/esm/client/format/useList.mjs.map +1 -1
- package/dist/esm/client/format/useNumber.mjs +36 -13
- package/dist/esm/client/format/useNumber.mjs.map +1 -1
- package/dist/esm/client/format/usePercentage.mjs +32 -13
- package/dist/esm/client/format/usePercentage.mjs.map +1 -1
- package/dist/esm/client/format/useRelativeTime.mjs +32 -13
- package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
- package/dist/esm/client/format/useUnit.mjs +31 -13
- package/dist/esm/client/format/useUnit.mjs.map +1 -1
- package/dist/esm/client/index.mjs +5 -32
- package/dist/esm/client/t.mjs +16 -8
- package/dist/esm/client/t.mjs.map +1 -1
- package/dist/esm/client/useContent.mjs +14 -10
- package/dist/esm/client/useContent.mjs.map +1 -1
- package/dist/esm/client/useDictionary.mjs +23 -11
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +18 -16
- package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +17 -15
- package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs +23 -11
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/client/useLoadDynamic.mjs +20 -26
- package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +31 -31
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/client/useLocaleBase.mjs +19 -16
- package/dist/esm/client/useLocaleBase.mjs.map +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +52 -0
- package/dist/esm/client/useLocaleStorage.mjs.map +1 -0
- package/dist/esm/client/useTraduction.mjs +29 -9
- package/dist/esm/client/useTraduction.mjs.map +1 -1
- package/dist/esm/editor/CommunicatorContext.mjs +28 -24
- package/dist/esm/editor/CommunicatorContext.mjs.map +1 -1
- package/dist/esm/editor/ConfigurationContext.mjs +20 -24
- package/dist/esm/editor/ConfigurationContext.mjs.map +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +50 -70
- package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/editor/DictionariesRecordContext.mjs +37 -47
- package/dist/esm/editor/DictionariesRecordContext.mjs.map +1 -1
- package/dist/esm/editor/EditedContentContext.mjs +146 -187
- package/dist/esm/editor/EditedContentContext.mjs.map +1 -1
- package/dist/esm/editor/EditorEnabledContext.mjs +23 -33
- package/dist/esm/editor/EditorEnabledContext.mjs.map +1 -1
- package/dist/esm/editor/EditorProvider.mjs +57 -54
- package/dist/esm/editor/EditorProvider.mjs.map +1 -1
- package/dist/esm/editor/FocusDictionaryContext.mjs +42 -49
- package/dist/esm/editor/FocusDictionaryContext.mjs.map +1 -1
- package/dist/esm/editor/IntlayerEditorProvider.mjs +37 -55
- package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
- package/dist/esm/editor/index.mjs +3 -2
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +68 -24
- package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -1
- package/dist/esm/editor/useCrossFrameState.mjs +102 -47
- package/dist/esm/editor/useCrossFrameState.mjs.map +1 -1
- package/dist/esm/editor/useCrossURLPathState.mjs +60 -40
- package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -1
- package/dist/esm/editor/useEditedContentRenderer.mjs +23 -33
- package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs +18 -20
- package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -1
- package/dist/esm/getDictionary.mjs +13 -22
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs +13 -18
- package/dist/esm/getIntlayer.mjs.map +1 -1
- package/dist/esm/index.mjs +13 -39
- package/dist/esm/markdown/MarkdownProvider.mjs +14 -16
- package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
- package/dist/esm/markdown/MarkdownRenderer.mjs +34 -57
- package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
- package/dist/esm/markdown/index.mjs +4 -3
- package/dist/esm/plugins.mjs +86 -92
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/esm/preactElement/renderPreactElement.mjs +31 -34
- package/dist/esm/preactElement/renderPreactElement.mjs.map +1 -1
- package/dist/types/IntlayerNode.d.ts +19 -12
- package/dist/types/IntlayerNode.d.ts.map +1 -1
- package/dist/types/UI/ContentSelector.d.ts +12 -9
- package/dist/types/UI/ContentSelector.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +22 -16
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/format/index.d.ts +9 -9
- package/dist/types/client/format/useCompact.d.ts +8 -2
- package/dist/types/client/format/useCompact.d.ts.map +1 -1
- package/dist/types/client/format/useCurrency.d.ts +8 -2
- package/dist/types/client/format/useCurrency.d.ts.map +1 -1
- package/dist/types/client/format/useDate.d.ts +7 -2
- package/dist/types/client/format/useDate.d.ts.map +1 -1
- package/dist/types/client/format/useList.d.ts +8 -2
- package/dist/types/client/format/useList.d.ts.map +1 -1
- package/dist/types/client/format/useNumber.d.ts +8 -2
- package/dist/types/client/format/useNumber.d.ts.map +1 -1
- package/dist/types/client/format/usePercentage.d.ts +8 -2
- package/dist/types/client/format/usePercentage.d.ts.map +1 -1
- package/dist/types/client/format/useRelativeTime.d.ts +9 -3
- package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/client/format/useUnit.d.ts +8 -2
- package/dist/types/client/format/useUnit.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +11 -12
- package/dist/types/client/t.d.ts +7 -3
- package/dist/types/client/t.d.ts.map +1 -1
- package/dist/types/client/useContent.d.ts +10 -5
- package/dist/types/client/useContent.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +9 -3
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +7 -3
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +9 -3
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +8 -5
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useLoadDynamic.d.ts +4 -1
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +16 -8
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +10 -5
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +45 -0
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -0
- package/dist/types/client/useTraduction.d.ts +7 -2
- package/dist/types/client/useTraduction.d.ts.map +1 -1
- package/dist/types/editor/CommunicatorContext.d.ts +15 -11
- package/dist/types/editor/CommunicatorContext.d.ts.map +1 -1
- package/dist/types/editor/ConfigurationContext.d.ts +12 -7
- package/dist/types/editor/ConfigurationContext.d.ts.map +1 -1
- package/dist/types/editor/ContentSelectorWrapper.d.ts +8 -4
- package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/editor/DictionariesRecordContext.d.ts +15 -12
- package/dist/types/editor/DictionariesRecordContext.d.ts.map +1 -1
- package/dist/types/editor/EditedContentContext.d.ts +32 -29
- package/dist/types/editor/EditedContentContext.d.ts.map +1 -1
- package/dist/types/editor/EditorEnabledContext.d.ts +14 -9
- package/dist/types/editor/EditorEnabledContext.d.ts.map +1 -1
- package/dist/types/editor/EditorProvider.d.ts +9 -5
- package/dist/types/editor/EditorProvider.d.ts.map +1 -1
- package/dist/types/editor/FocusDictionaryContext.d.ts +18 -15
- package/dist/types/editor/FocusDictionaryContext.d.ts.map +1 -1
- package/dist/types/editor/IntlayerEditorProvider.d.ts +7 -3
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
- package/dist/types/editor/index.d.ts +2 -2
- package/dist/types/editor/useCrossFrameMessageListener.d.ts +7 -2
- package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -1
- package/dist/types/editor/useCrossFrameState.d.ts +11 -7
- package/dist/types/editor/useCrossFrameState.d.ts.map +1 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +8 -3
- package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts +16 -10
- package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -1
- package/dist/types/editor/useIframeClickInterceptor.d.ts +5 -2
- package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +8 -4
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +8 -4
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/index.d.ts +18 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +8 -5
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +13 -11
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/index.d.ts +3 -3
- package/dist/types/plugins.d.ts +33 -27
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/preactElement/renderPreactElement.d.ts +7 -3
- package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -1
- package/package.json +40 -46
- package/LICENSE +0 -202
- package/dist/cjs/client/format/index.cjs.map +0 -1
- package/dist/cjs/client/getBrowserLocale.cjs +0 -173
- package/dist/cjs/client/getBrowserLocale.cjs.map +0 -1
- package/dist/cjs/client/index.cjs.map +0 -1
- package/dist/cjs/client/useLocaleCookie.cjs +0 -60
- package/dist/cjs/client/useLocaleCookie.cjs.map +0 -1
- package/dist/cjs/editor/index.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/markdown/index.cjs.map +0 -1
- package/dist/esm/client/format/index.mjs.map +0 -1
- package/dist/esm/client/getBrowserLocale.mjs +0 -138
- package/dist/esm/client/getBrowserLocale.mjs.map +0 -1
- package/dist/esm/client/index.mjs.map +0 -1
- package/dist/esm/client/useLocaleCookie.mjs +0 -24
- package/dist/esm/client/useLocaleCookie.mjs.map +0 -1
- package/dist/esm/editor/index.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/markdown/index.mjs.map +0 -1
- package/dist/types/client/format/index.d.ts.map +0 -1
- package/dist/types/client/getBrowserLocale.d.ts +0 -25
- package/dist/types/client/getBrowserLocale.d.ts.map +0 -1
- package/dist/types/client/index.d.ts.map +0 -1
- package/dist/types/client/useLocaleCookie.d.ts +0 -17
- package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
- package/dist/types/editor/index.d.ts.map +0 -1
- package/dist/types/markdown/index.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerProvider.d.ts","
|
|
1
|
+
{"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"sourcesContent":[],"mappings":";;;;;KAgBK,aAAA;UACK;yBACe;EAFpB,aAAA,CAAA,EAAa,OAAA;EAUL,eAAA,CAAA,EAAA,OAIX;AAKF,CAAA;AAEA;;;AAGkB,cAdL,qBAcK,EAdgB,OAAA,CAAA,OAchB,CAdgB,aAchB,CAAA;;;AASlB;AAoDa,cAlEA,kBAkEoC,EAAA,GAAA,GAlElB,aAkEA;KAhEnB,qBAAA;aACC;WACF;kBACO;uBACK;;;;;;;cAQV,yBAAyB,kBACpC;cAmDW,kBAAkB,kBAAkB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useCompact } from "./useCompact.js";
|
|
2
|
+
import { useCurrency } from "./useCurrency.js";
|
|
3
|
+
import { useDate } from "./useDate.js";
|
|
4
|
+
import { useList } from "./useList.js";
|
|
5
|
+
import { useNumber } from "./useNumber.js";
|
|
6
|
+
import { usePercentage } from "./usePercentage.js";
|
|
7
|
+
import { useRelativeTime } from "./useRelativeTime.js";
|
|
8
|
+
import { useUnit } from "./useUnit.js";
|
|
9
|
+
export { useCompact, useCurrency, useDate, useList, useNumber, usePercentage, useRelativeTime, useUnit };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer18 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useCompact.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React client hook that provides a compact number formatter
|
|
3
7
|
* bound to the current application locale.
|
|
@@ -8,7 +12,9 @@
|
|
|
8
12
|
* formatCompact(1500); // "1.5K"
|
|
9
13
|
* ```
|
|
10
14
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
16
|
+
locale?: intlayer18.LocalesValues;
|
|
13
17
|
}) => string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useCompact };
|
|
14
20
|
//# sourceMappingURL=useCompact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;;;;;;;cAAa,qDAAU,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer13 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useCurrency.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React client hook that provides a currency formatter
|
|
3
7
|
* bound to the current application locale.
|
|
@@ -22,7 +26,9 @@
|
|
|
22
26
|
* // "¥9,876,543"
|
|
23
27
|
* ```
|
|
24
28
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
30
|
+
locale?: intlayer13.LocalesValues;
|
|
27
31
|
}) => string;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { useCurrency };
|
|
28
34
|
//# sourceMappingURL=useCurrency.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrency.d.ts","
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":[],"mappings":";;;;;;;AA8BA;;;;;;;;;;;;;;;;;;;;;cAAa,sDAAW,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { date } from
|
|
1
|
+
import { date } from "@intlayer/core";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useDate.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* React client hook that provides a localized date/time formatter
|
|
4
7
|
* bound to the current application locale.
|
|
@@ -25,5 +28,7 @@ import { date } from '@intlayer/core';
|
|
|
25
28
|
*
|
|
26
29
|
* @see createDate
|
|
27
30
|
*/
|
|
28
|
-
|
|
31
|
+
declare const useDate: () => (...args: Parameters<typeof date>) => string;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { useDate };
|
|
29
34
|
//# sourceMappingURL=useDate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDate.d.ts","
|
|
1
|
+
{"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":[],"mappings":";;;;;;AAgCA;;;;;;;;;;;;;;;;;;;;;;;;cAAa,yBAGM,kBAAkB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer15 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useList.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React client hook that provides a list formatter
|
|
3
7
|
* bound to the current application locale.
|
|
@@ -19,7 +23,9 @@
|
|
|
19
23
|
* // "1, 2 und 3"
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
declare const useList: () => (values: (string | number)[], options?: Intl.ListFormatOptions & {
|
|
27
|
+
locale?: intlayer15.LocalesValues;
|
|
24
28
|
}) => string;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { useList };
|
|
25
31
|
//# sourceMappingURL=useList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.d.ts","
|
|
1
|
+
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":[],"mappings":";;;;;;;AA2BA;;;;;;;;;;;;;;;;;;cAAa,uDAAO,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer19 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useNumber.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React client hook that provides a localized number formatter.
|
|
3
7
|
*
|
|
@@ -20,7 +24,9 @@
|
|
|
20
24
|
* @returns {(value: string | number, options?: import("../createNumber").NumberProps) => string}
|
|
21
25
|
* A number formatting function bound to the active locale.
|
|
22
26
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
declare const useNumber: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
28
|
+
locale?: intlayer19.LocalesValues;
|
|
25
29
|
}) => string;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { useNumber };
|
|
26
32
|
//# sourceMappingURL=useNumber.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumber.d.ts","
|
|
1
|
+
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":[],"mappings":";;;;;;;AA4BA;;;;;;;;;;;;;;;;;;;cAAa,oDAAS,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer17 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/usePercentage.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React hook to provide a percentage formatter function
|
|
3
7
|
* based on the current application locale.
|
|
@@ -16,7 +20,9 @@
|
|
|
16
20
|
* @returns {(value: string | number, options?: Omit<PercentageOptions, "value">) => string}
|
|
17
21
|
* A function that formats numbers or numeric strings into localized percentages.
|
|
18
22
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
declare const usePercentage: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
24
|
+
locale?: intlayer17.LocalesValues;
|
|
21
25
|
}) => string;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { usePercentage };
|
|
22
28
|
//# sourceMappingURL=usePercentage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePercentage.d.ts","
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,wDAAa,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer14 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useRelativeTime.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* Client-side React hook for accessing a localized relative time formatter.
|
|
3
7
|
*
|
|
@@ -16,8 +20,10 @@
|
|
|
16
20
|
* @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function
|
|
17
21
|
* bound to the current client locale.
|
|
18
22
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
|
|
24
|
+
locale?: intlayer14.LocalesValues;
|
|
25
|
+
unit?: Intl.RelativeTimeFormatUnit;
|
|
22
26
|
}) => string;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useRelativeTime };
|
|
23
29
|
//# sourceMappingURL=useRelativeTime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRelativeTime.d.ts","
|
|
1
|
+
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwBA;;;;;;;;;;;;;;;cAAa,gDAAe,6BAAA,gBAAA,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as intlayer16 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/format/useUnit.d.ts
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* React hook that provides a unit formatting function
|
|
3
7
|
* based on the current locale from {@link useLocaleBase}.
|
|
@@ -15,7 +19,9 @@
|
|
|
15
19
|
*
|
|
16
20
|
* @returns {Function} A unit formatting function that accepts a value and optional formatting options.
|
|
17
21
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
23
|
+
locale?: intlayer16.LocalesValues;
|
|
20
24
|
}) => string;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useUnit };
|
|
21
27
|
//# sourceMappingURL=useUnit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnit.d.ts","
|
|
1
|
+
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuBA;;;;;;;;;;;;;;cAAa,kDAAO,IAAA,CAAA;WAAA,UAAA,CAAA"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { localeCookie, setLocaleCookie,
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, IntlayerProviderProps, useIntlayerContext } from "./IntlayerProvider.js";
|
|
2
|
+
import { t } from "./t.js";
|
|
3
|
+
import { useDictionary } from "./useDictionary.js";
|
|
4
|
+
import { useDictionaryAsync } from "./useDictionaryAsync.js";
|
|
5
|
+
import { useDictionaryDynamic } from "./useDictionaryDynamic.js";
|
|
6
|
+
import { useIntlayer } from "./useIntlayer.js";
|
|
7
|
+
import { useLoadDynamic } from "./useLoadDynamic.js";
|
|
8
|
+
import { useLocale } from "./useLocale.js";
|
|
9
|
+
import { useLocaleBase } from "./useLocaleBase.js";
|
|
10
|
+
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.js";
|
|
11
|
+
export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage };
|
package/dist/types/client/t.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Locale, StrictModeLocaleMap } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/client/t.d.ts
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* On the client side, this function returns the translation of the provided multilang content.
|
|
5
7
|
*
|
|
6
8
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
9
|
*/
|
|
8
|
-
|
|
10
|
+
declare const t: <Content = string>(multilangContent: StrictModeLocaleMap<Content>, locale?: Locale) => Content;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t };
|
|
9
13
|
//# sourceMappingURL=t.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"t.d.ts","
|
|
1
|
+
{"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/client/t.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;AAEW,cAFE,CAEF,EAAA,CAAA,UAAA,MAAA,CAAA,CAAA,gBAAA,EADS,mBACT,CAD6B,OAC7B,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,GAAM,OAAN"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { StrictModeLocaleMap } from "@intlayer/types";
|
|
2
|
+
import * as intlayer2 from "intlayer";
|
|
3
|
+
|
|
4
|
+
//#region src/client/useContent.d.ts
|
|
2
5
|
/**
|
|
3
6
|
* On the client side, hook to get the translation content based on the locale
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
9
|
+
locale: intlayer2.Locale | (string & {});
|
|
10
|
+
content: Content;
|
|
11
|
+
t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
|
|
9
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useContent };
|
|
10
15
|
//# sourceMappingURL=useContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContent.d.ts","
|
|
1
|
+
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"sourcesContent":[],"mappings":";;;;;;;AAOa,cAAA,UAYZ,EAAA,CAAA,OAAA,CAAA,CAAA,eAAA,EAXkB,mBAWlB,CAXsC,OAWtC,CAAA,EAAA,GAAA;EAXsC,MAAA,EAAD,SAAA,CAAA,MAAA,GAAC,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;EAApB,OAAA,SAAA;EAAmB,CAAA,EAAA,CAAA,YAAA,MAAA,CAAA,CAAA,eAAA,qBAAA,UAAA,CAAA,EAAA,YAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
|
|
2
|
+
import * as _intlayer_core0 from "@intlayer/core";
|
|
3
|
+
import { DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
4
|
+
import * as intlayer11 from "intlayer";
|
|
5
|
+
|
|
6
|
+
//#region src/client/useDictionary.d.ts
|
|
3
7
|
/**
|
|
4
8
|
* On the server side, Hook that transform a dictionary and return the content
|
|
5
9
|
*
|
|
6
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1, intlayer11.Locale>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useDictionary };
|
|
9
15
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAgBa,cAAA,aAcZ,EAAA,CAAA,UAbW,UAaX,EAAA,UAZW,aAYX,GAZ2B,eAY3B,CAAA,CAAA,UAAA,EAVa,CAUb,EAAA,MAAA,CAAA,EATU,CASV,EAAA,GATW,eAAA,CAAA,oBASX,CATW,CASX,CAAA,SAAA,CAAA,EATW,yBAAA,EAAA,UAAA,CAAA,MAAA,CASX"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Dictionary, LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/client/useDictionaryAsync.d.ts
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* On the server side, Hook that transform a dictionary and return the content
|
|
5
7
|
*
|
|
6
8
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
9
|
*/
|
|
8
|
-
|
|
10
|
+
declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<T>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useDictionaryAsync };
|
|
9
13
|
//# sourceMappingURL=useDictionaryAsync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryAsync.d.ts","
|
|
1
|
+
{"version":3,"file":"useDictionaryAsync.d.ts","names":[],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":[],"mappings":";;;;;;AAiBA;;;AAC+C,cADlC,kBACkC,EAAA,CAAA,UADI,UACJ,CAAA,CAAA,iBAAA,EAA1B,mBAA0B,CAAA,GAAA,GAAA,OAAA,CAAQ,CAAR,CAAA,CAAA,EAAA,MAAA,CAAA,EACpC,aADoC,EAAA,GAE5C,OAF4C,CAEpC,CAFoC,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
|
|
2
|
+
import * as _intlayer_core0 from "@intlayer/core";
|
|
3
|
+
import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
|
|
4
|
+
import * as intlayer12 from "intlayer";
|
|
5
|
+
|
|
6
|
+
//#region src/client/useDictionaryDynamic.d.ts
|
|
3
7
|
/**
|
|
4
8
|
* On the server side, Hook that transform a dictionary and return the content
|
|
5
9
|
*
|
|
6
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1, intlayer12.Locale>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useDictionaryDynamic };
|
|
9
15
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAkBa,cAAA,oBAoBZ,EAAA,CAAA,UAnBW,UAmBX,EAAA,UAlBW,cAkBX,CAAA,CAAA,iBAAA,EAhBoB,mBAgBpB,CAAA,GAAA,GAhB8C,OAgB9C,CAhBsD,CAgBtD,CAAA,CAAA,EAAA,GAAA,EAfM,CAeN,EAAA,MAAA,CAAA,EAdU,aAcV,EAAA,GAduB,eAAA,CAAA,oBAcvB,CAduB,CAcvB,CAAA,SAAA,CAAA,EAduB,yBAAA,EAAA,UAAA,CAAA,MAAA,CAcvB"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DeepTransformContent } from "../plugins.js";
|
|
2
|
+
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/client/useIntlayer.d.ts
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* On the client side, Hook that picking one dictionary by its key and return the content
|
|
7
8
|
*
|
|
8
9
|
* If the locale is not provided, it will use the locale from the client context
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { useIntlayer };
|
|
11
14
|
//# sourceMappingURL=useIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.d.ts","
|
|
1
|
+
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiBA;;;AACO,cADM,WACN,EAAA,CAAA,UAD+B,cAC/B,EAAA,UADyD,aACzD,CAAA,CAAA,GAAA,EAAA,CAAA,EAAA,MAAA,CAAA,EACI,CADJ,EAAA,GACK,oBADL,CACK,yBADL,CACK,CADL,CAAA,CAAA"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/client/useLoadDynamic.d.ts
|
|
2
|
+
declare const useLoadDynamic: <T>(key: string, promise: Promise<T>) => T;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { useLoadDynamic };
|
|
2
5
|
//# sourceMappingURL=useLoadDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadDynamic.d.ts","
|
|
1
|
+
{"version":3,"file":"useLoadDynamic.d.ts","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":[],"mappings":";cA2Ba,0CAA2C,QAAQ,OAAK"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LocalesValues } from "@intlayer/types";
|
|
2
|
+
import * as intlayer0 from "intlayer";
|
|
3
|
+
|
|
4
|
+
//#region src/client/useLocale.d.ts
|
|
2
5
|
type useLocaleProps = {
|
|
3
|
-
|
|
6
|
+
isCookieEnabled?: boolean;
|
|
7
|
+
onLocaleChange?: (locale: LocalesValues) => void;
|
|
4
8
|
};
|
|
5
9
|
/**
|
|
6
10
|
* On the client side, hook to get the current locale and all related fields
|
|
7
11
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
declare const useLocale: ({
|
|
13
|
+
isCookieEnabled,
|
|
14
|
+
onLocaleChange
|
|
15
|
+
}?: useLocaleProps) => {
|
|
16
|
+
locale: intlayer0.Locale | (string & {});
|
|
17
|
+
defaultLocale: intlayer0.Locale;
|
|
18
|
+
availableLocales: intlayer0.Locale[];
|
|
19
|
+
setLocale: (locale: LocalesValues) => void;
|
|
13
20
|
};
|
|
14
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
export { useLocale };
|
|
15
23
|
//# sourceMappingURL=useLocale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":[],"mappings":";;;;KAQK,cAAA;;4BAEuB;AAPyB,CAAA;AAarD;;;AAGG,cAHU,SAGV,EAAA,CAAA;EAAA,eAAA;EAAA;AAAA,CAAA,CAAA,EAAA,cAAA,EAAA,GAAA;EAAmB,MAAA,EAAA,SAAA,CAAA,MAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;;;EAUO,SAAA,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,GAAA,IAAA;CAAa"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import * as intlayer3 from "intlayer";
|
|
2
|
+
|
|
3
|
+
//#region src/client/useLocaleBase.d.ts
|
|
1
4
|
/**
|
|
2
5
|
* On the client side, hook to get the current locale and all related fields
|
|
3
6
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare const useLocaleBase: () => {
|
|
8
|
+
locale: intlayer3.Locale | (string & {});
|
|
9
|
+
defaultLocale: intlayer3.Locale;
|
|
10
|
+
availableLocales: intlayer3.Locale[];
|
|
11
|
+
setLocale: (newLocale: intlayer3.LocalesValues) => void;
|
|
9
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useLocaleBase };
|
|
10
15
|
//# sourceMappingURL=useLocaleBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleBase.d.ts","
|
|
1
|
+
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":[],"mappings":";;;;;;AAYa,cAAA,aASZ,EAAA,GAAA,GAAA;EAAA,MAAA,EAAA,SAAA,CAAA,MAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types";
|
|
2
|
+
import * as intlayer7 from "intlayer";
|
|
3
|
+
|
|
4
|
+
//#region src/client/useLocaleStorage.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Get the locale cookie
|
|
7
|
+
*/
|
|
8
|
+
declare const localeInStorage: intlayer7.Locale;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use localeInStorage instead
|
|
11
|
+
*
|
|
12
|
+
* Get the locale cookie
|
|
13
|
+
*/
|
|
14
|
+
declare const localeCookie: intlayer7.Locale;
|
|
15
|
+
/**
|
|
16
|
+
* Set the locale cookie
|
|
17
|
+
*/
|
|
18
|
+
declare const setLocaleInStorage: (locale: LocalesValues, isCookieEnabled: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use setLocaleInStorage instead
|
|
21
|
+
*
|
|
22
|
+
* Set the locale cookie
|
|
23
|
+
*/
|
|
24
|
+
declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Hook that provides the locale storage and a function to set it
|
|
27
|
+
*/
|
|
28
|
+
declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
29
|
+
getLocale: () => intlayer7.Locale;
|
|
30
|
+
setLocale: (locale: LocalesValues) => void;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use useLocaleStorage instead
|
|
34
|
+
*
|
|
35
|
+
* For GDPR compliance, use useLocaleStorage instead
|
|
36
|
+
*
|
|
37
|
+
* Hook that provides the locale cookie and a function to set it
|
|
38
|
+
*/
|
|
39
|
+
declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
40
|
+
localeCookie: intlayer7.Locale;
|
|
41
|
+
setLocaleCookie: (locale: LocalesValues) => void;
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage };
|
|
45
|
+
//# sourceMappingURL=useLocaleStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":[],"mappings":";;;;;;;AAYa,cAAA,eAA4D,EAAA,SAAA,CAA7C,MAA6C;AAMzE;AAKA;AAcA;AAKA;AAiBA;cAzCa,cAA8B,SAAA,CAAlB;;;;cAKZ,6BACH;;;;;;cAaG,0BAbH;;;;cAkBG;mBAQV,SAAA,CAAA;sBAAA;;;;;;;;;cASU;gBAMZ,SAAA,CAAA;4BAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StrictModeLocaleMap } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/client/useTraduction.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* On the client side, Hook that picking one dictionary by its id and return the content.
|
|
4
7
|
*
|
|
@@ -20,5 +23,7 @@ import { type LanguageContent } from '@intlayer/core';
|
|
|
20
23
|
* - this function will require each locale to be defined if defined in the project configuration.
|
|
21
24
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
22
25
|
*/
|
|
23
|
-
|
|
26
|
+
declare const useTranslation: <Content = string>(languageContent: StrictModeLocaleMap<Content>) => Content;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useTranslation };
|
|
24
29
|
//# sourceMappingURL=useTraduction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTraduction.d.ts","
|
|
1
|
+
{"version":3,"file":"useTraduction.d.ts","names":[],"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,oDACM,oBAAoB,aACpC"}
|