gt-react 10.6.6 → 10.6.8
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/CHANGELOG.md +18 -0
- package/dist/client.cjs.min.cjs +17 -16
- package/dist/client.cjs.min.cjs.map +1 -0
- package/dist/client.d.ts +7 -740
- package/dist/client.d.ts.map +1 -1
- package/dist/client.esm.min.mjs +17 -16
- package/dist/client.esm.min.mjs.map +1 -0
- package/dist/errors-dir/constants.d.ts +2 -0
- package/dist/errors-dir/constants.d.ts.map +1 -0
- package/dist/index.cjs.min.cjs +21 -3
- package/dist/index.cjs.min.cjs.map +1 -0
- package/dist/index.d.ts +3 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.min.mjs +21 -3
- package/dist/index.esm.min.mjs.map +1 -0
- package/dist/internal.cjs.min.cjs +17 -16
- package/dist/internal.cjs.min.cjs.map +1 -0
- package/dist/internal.d.ts +5 -31
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.esm.min.mjs +17 -16
- package/dist/internal.esm.min.mjs.map +1 -0
- package/dist/provider/ClientProvider.d.ts +1 -1
- package/dist/provider/ClientProvider.d.ts.map +1 -1
- package/dist/provider/GTProvider.d.ts +3 -23
- package/dist/provider/GTProvider.d.ts.map +1 -1
- package/dist/provider/helpers/isSSREnabled.d.ts.map +1 -1
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts +2 -9
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts.map +1 -1
- package/dist/types/config.d.ts +23 -41
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/utils.d.ts +2 -6
- package/dist/utils/utils.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/branches/Branch.d.ts +0 -34
- package/dist/branches/Branch.d.ts.map +0 -1
- package/dist/branches/plurals/Plural.d.ts +0 -38
- package/dist/branches/plurals/Plural.d.ts.map +0 -1
- package/dist/branches/plurals/getPluralBranch.d.ts +0 -9
- package/dist/branches/plurals/getPluralBranch.d.ts.map +0 -1
- package/dist/dictionaries/collectUntranslatedEntries.d.ts +0 -17
- package/dist/dictionaries/collectUntranslatedEntries.d.ts.map +0 -1
- package/dist/dictionaries/getDictionaryEntry.d.ts +0 -4
- package/dist/dictionaries/getDictionaryEntry.d.ts.map +0 -1
- package/dist/dictionaries/getEntryAndMetadata.d.ts +0 -6
- package/dist/dictionaries/getEntryAndMetadata.d.ts.map +0 -1
- package/dist/dictionaries/getSubtree.d.ts +0 -18
- package/dist/dictionaries/getSubtree.d.ts.map +0 -1
- package/dist/dictionaries/indexDict.d.ts +0 -15
- package/dist/dictionaries/indexDict.d.ts.map +0 -1
- package/dist/dictionaries/injectAndMerge.d.ts +0 -9
- package/dist/dictionaries/injectAndMerge.d.ts.map +0 -1
- package/dist/dictionaries/injectEntry.d.ts +0 -18
- package/dist/dictionaries/injectEntry.d.ts.map +0 -1
- package/dist/dictionaries/injectFallbacks.d.ts +0 -17
- package/dist/dictionaries/injectFallbacks.d.ts.map +0 -1
- package/dist/dictionaries/injectHashes.d.ts +0 -11
- package/dist/dictionaries/injectHashes.d.ts.map +0 -1
- package/dist/dictionaries/injectTranslations.d.ts +0 -20
- package/dist/dictionaries/injectTranslations.d.ts.map +0 -1
- package/dist/dictionaries/isDictionaryEntry.d.ts +0 -8
- package/dist/dictionaries/isDictionaryEntry.d.ts.map +0 -1
- package/dist/dictionaries/loadDictionaryHelper.d.ts +0 -3
- package/dist/dictionaries/loadDictionaryHelper.d.ts.map +0 -1
- package/dist/dictionaries/mergeDictionaries.d.ts +0 -3
- package/dist/dictionaries/mergeDictionaries.d.ts.map +0 -1
- package/dist/dictionaries/stripMetadataFromEntries.d.ts +0 -6
- package/dist/dictionaries/stripMetadataFromEntries.d.ts.map +0 -1
- package/dist/errors/createErrors.d.ts +0 -33
- package/dist/errors/createErrors.d.ts.map +0 -1
- package/dist/hooks/useDefaultLocale.d.ts +0 -13
- package/dist/hooks/useDefaultLocale.d.ts.map +0 -1
- package/dist/hooks/useGTClass.d.ts +0 -23
- package/dist/hooks/useGTClass.d.ts.map +0 -1
- package/dist/hooks/useLocale.d.ts +0 -11
- package/dist/hooks/useLocale.d.ts.map +0 -1
- package/dist/hooks/useLocaleDirection.d.ts +0 -14
- package/dist/hooks/useLocaleDirection.d.ts.map +0 -1
- package/dist/hooks/useLocaleSelector.d.ts +0 -42
- package/dist/hooks/useLocaleSelector.d.ts.map +0 -1
- package/dist/hooks/useLocales.d.ts +0 -11
- package/dist/hooks/useLocales.d.ts.map +0 -1
- package/dist/hooks/useRegion.d.ts +0 -20
- package/dist/hooks/useRegion.d.ts.map +0 -1
- package/dist/hooks/useRegionSelector.d.ts +0 -82
- package/dist/hooks/useRegionSelector.d.ts.map +0 -1
- package/dist/hooks/useSetLocale.d.ts +0 -12
- package/dist/hooks/useSetLocale.d.ts.map +0 -1
- package/dist/internal/addGTIdentifier.d.ts +0 -4
- package/dist/internal/addGTIdentifier.d.ts.map +0 -1
- package/dist/internal/flattenDictionary.d.ts +0 -11
- package/dist/internal/flattenDictionary.d.ts.map +0 -1
- package/dist/internal/writeChildrenAsObjects.d.ts +0 -10
- package/dist/internal/writeChildrenAsObjects.d.ts.map +0 -1
- package/dist/messages/messages.d.ts +0 -43
- package/dist/messages/messages.d.ts.map +0 -1
- package/dist/promises/dangerouslyUsable.d.ts +0 -37
- package/dist/promises/dangerouslyUsable.d.ts.map +0 -1
- package/dist/promises/reactHasUse.d.ts +0 -2
- package/dist/promises/reactHasUse.d.ts.map +0 -1
- package/dist/provider/GTContext.d.ts +0 -4
- package/dist/provider/GTContext.d.ts.map +0 -1
- package/dist/provider/config/defaultProps.d.ts +0 -4
- package/dist/provider/config/defaultProps.d.ts.map +0 -1
- package/dist/provider/helpers/validateString.d.ts +0 -6
- package/dist/provider/helpers/validateString.d.ts.map +0 -1
- package/dist/provider/hooks/locales/useLocaleState.d.ts +0 -16
- package/dist/provider/hooks/locales/useLocaleState.d.ts.map +0 -1
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts +0 -18
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts.map +0 -1
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts +0 -4
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts.map +0 -1
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts +0 -4
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts.map +0 -1
- package/dist/provider/hooks/useErrorChecks.d.ts +0 -9
- package/dist/provider/hooks/useErrorChecks.d.ts.map +0 -1
- package/dist/provider/hooks/useLoadDictionary.d.ts +0 -15
- package/dist/provider/hooks/useLoadDictionary.d.ts.map +0 -1
- package/dist/provider/hooks/useLoadTranslations.d.ts +0 -17
- package/dist/provider/hooks/useLoadTranslations.d.ts.map +0 -1
- package/dist/provider/hooks/useRuntimeTranslation.d.ts +0 -23
- package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +0 -1
- package/dist/rendering/defaultRenderSettings.d.ts +0 -6
- package/dist/rendering/defaultRenderSettings.d.ts.map +0 -1
- package/dist/rendering/getGTTag.d.ts +0 -3
- package/dist/rendering/getGTTag.d.ts.map +0 -1
- package/dist/rendering/isVariableObject.d.ts +0 -3
- package/dist/rendering/isVariableObject.d.ts.map +0 -1
- package/dist/rendering/renderDefaultChildren.d.ts +0 -8
- package/dist/rendering/renderDefaultChildren.d.ts.map +0 -1
- package/dist/rendering/renderSkeleton.d.ts +0 -8
- package/dist/rendering/renderSkeleton.d.ts.map +0 -1
- package/dist/rendering/renderTranslatedChildren.d.ts +0 -9
- package/dist/rendering/renderTranslatedChildren.d.ts.map +0 -1
- package/dist/rendering/renderVariable.d.ts +0 -4
- package/dist/rendering/renderVariable.d.ts.map +0 -1
- package/dist/translation/hooks/useGT.d.ts +0 -20
- package/dist/translation/hooks/useGT.d.ts.map +0 -1
- package/dist/translation/hooks/useMessages.d.ts +0 -19
- package/dist/translation/hooks/useMessages.d.ts.map +0 -1
- package/dist/translation/hooks/useTranslations.d.ts +0 -17
- package/dist/translation/hooks/useTranslations.d.ts.map +0 -1
- package/dist/translation/inline/T.d.ts +0 -42
- package/dist/translation/inline/T.d.ts.map +0 -1
- package/dist/types/context.d.ts +0 -30
- package/dist/types/context.d.ts.map +0 -1
- package/dist/types/runtime.d.ts +0 -20
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -90
- package/dist/types/types.d.ts.map +0 -1
- package/dist/utils/cookies.d.ts +0 -9
- package/dist/utils/cookies.d.ts.map +0 -1
- package/dist/utils/fetchTranslations.d.ts +0 -9
- package/dist/utils/fetchTranslations.d.ts.map +0 -1
- package/dist/variables/Currency.d.ts +0 -30
- package/dist/variables/Currency.d.ts.map +0 -1
- package/dist/variables/DateTime.d.ts +0 -29
- package/dist/variables/DateTime.d.ts.map +0 -1
- package/dist/variables/Num.d.ts +0 -31
- package/dist/variables/Num.d.ts.map +0 -1
- package/dist/variables/Var.d.ts +0 -32
- package/dist/variables/Var.d.ts.map +0 -1
- package/dist/variables/_getVariableProps.d.ts +0 -11
- package/dist/variables/_getVariableProps.d.ts.map +0 -1
- package/dist/variables/getVariableName.d.ts +0 -10
- package/dist/variables/getVariableName.d.ts.map +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Dictionary, DictionaryEntry } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description A function that gets a value from a dictionary, only one level
|
|
4
|
-
* @param dictionary - dictionary to get the value from
|
|
5
|
-
* @param id - id of the value to get
|
|
6
|
-
*/
|
|
7
|
-
export declare function get(dictionary: Dictionary, id: string | number): DictionaryEntry | Dictionary;
|
|
8
|
-
/**
|
|
9
|
-
* @description A function that sets a value in a dictionary
|
|
10
|
-
* @param dictionary - dictionary to set the value in
|
|
11
|
-
* @param id - id of the value to set
|
|
12
|
-
* @param value - value to set
|
|
13
|
-
*/
|
|
14
|
-
export declare function set(dictionary: Dictionary, id: string | number, value: Dictionary | DictionaryEntry): void;
|
|
15
|
-
//# sourceMappingURL=indexDict.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexDict.d.ts","sourceRoot":"","sources":["../../src/dictionaries/indexDict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,gCAQ9D;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CACjB,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,KAAK,EAAE,UAAU,GAAG,eAAe,QAOpC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id
|
|
4
|
-
* @param dictionary - The dictionary to inject the subtree into
|
|
5
|
-
* @param subtree - The subtree to inject into the dictionary
|
|
6
|
-
* @param id - The id of the subtree to inject into the dictionary
|
|
7
|
-
*/
|
|
8
|
-
export declare function injectAndMerge(dictionary: Dictionary, subtree: Dictionary, id: string): Dictionary;
|
|
9
|
-
//# sourceMappingURL=injectAndMerge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectAndMerge.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectAndMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAY7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,EACnB,EAAE,EAAE,MAAM,cAeX"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Dictionary, DictionaryEntry, TranslatedChildren } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Injects an entry into a translations object
|
|
4
|
-
* @param translations - The translations object to inject the entry into
|
|
5
|
-
* @param entry - The entry to inject
|
|
6
|
-
* @param hash - The hash of the entry
|
|
7
|
-
* @param sourceDictionary - The source dictionary to model the new dictionary after
|
|
8
|
-
*/
|
|
9
|
-
export declare function injectEntry(dictionaryEntry: DictionaryEntry, dictionary: Dictionary | DictionaryEntry, id: string, sourceDictionary: Dictionary | DictionaryEntry): DictionaryEntry | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* @description Merge results into a dictionary
|
|
12
|
-
* @param dictionary - The dictionary to merge the results into
|
|
13
|
-
* @param results - The results to merge into the dictionary
|
|
14
|
-
* @param sourceDictionary - The source dictionary to model the new dictionary after
|
|
15
|
-
* @returns The merged dictionary
|
|
16
|
-
*/
|
|
17
|
-
export declare function mergeResultsIntoDictionary(dictionary: Dictionary, results: [string, TranslatedChildren][], sourceDictionary: Dictionary): Dictionary;
|
|
18
|
-
//# sourceMappingURL=injectEntry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAYxB;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,GAAG,eAAe,EACxC,EAAE,EAAE,MAAM,EACV,gBAAgB,EAAE,UAAU,GAAG,eAAe,+BAiC/C;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,EACvC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAKZ"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Injects fallbacks into a dictionary
|
|
4
|
-
* @param dictionary - The dictionary to inject translations into
|
|
5
|
-
* @param translationsDictionary - The translations to inject into the dictionary
|
|
6
|
-
* @param translations - The translations to inject into the dictionary
|
|
7
|
-
* @param id - The id of the dictionary to inject translations into
|
|
8
|
-
*/
|
|
9
|
-
export declare function injectFallbacks(dictionary: Dictionary, translationsDictionary: Dictionary, missingTranslations: {
|
|
10
|
-
source: string;
|
|
11
|
-
metadata: {
|
|
12
|
-
$id: string;
|
|
13
|
-
$context?: string;
|
|
14
|
-
$_hash: string;
|
|
15
|
-
};
|
|
16
|
-
}[], prefixToRemove?: string): Dictionary;
|
|
17
|
-
//# sourceMappingURL=injectFallbacks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectFallbacks.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectFallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,cAuB5B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Given a dictionary, adds hashes to all dictionary entries
|
|
4
|
-
* @param dictionary - The dictionary to add hashes to
|
|
5
|
-
* @param id - The starting point of dictionary (if subtree)
|
|
6
|
-
*/
|
|
7
|
-
export declare function injectHashes(dictionary: Dictionary, id?: string): {
|
|
8
|
-
dictionary: Dictionary;
|
|
9
|
-
updateDictionary: boolean;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=injectHashes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectHashes.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectHashes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,EAAE,GAAE,MAAW,GACd;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAwBvD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Dictionary, Translations } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Injects translations into a dictionary
|
|
4
|
-
* @param dictionary - The dictionary to inject translations into
|
|
5
|
-
* @param translationsDictionary - The translations to inject into the dictionary
|
|
6
|
-
* @param translations - The translations to inject into the dictionary
|
|
7
|
-
* @param id - The id of the dictionary to inject translations into
|
|
8
|
-
*/
|
|
9
|
-
export declare function injectTranslations(dictionary: Dictionary, translationsDictionary: Dictionary, translations: Translations, missingTranslations: {
|
|
10
|
-
source: string;
|
|
11
|
-
metadata: {
|
|
12
|
-
$id: string;
|
|
13
|
-
$context?: string;
|
|
14
|
-
$_hash: string;
|
|
15
|
-
};
|
|
16
|
-
}[], prefixToRemove?: string): {
|
|
17
|
-
dictionary: Dictionary;
|
|
18
|
-
updateDictionary: boolean;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=injectTranslations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectTranslations.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,GAC1B;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CA8BvD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Dictionary, DictionaryEntry } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* Type guard function that checks if a value is a DictionaryEntry
|
|
4
|
-
* @param value - The value to check
|
|
5
|
-
* @returns true if the value is a DictionaryEntry, false otherwise
|
|
6
|
-
*/
|
|
7
|
-
export declare function isDictionaryEntry(value: Dictionary | DictionaryEntry | undefined): value is DictionaryEntry;
|
|
8
|
-
//# sourceMappingURL=isDictionaryEntry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/isDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,GAC9C,KAAK,IAAI,eAAe,CAoC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadDictionaryHelper.d.ts","sourceRoot":"","sources":["../../src/dictionaries/loadDictionaryHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1D,wBAA8B,oBAAoB,CAChD,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,YAAY,GAC3B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAkBjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/mergeDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAU7D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,uBAAuB,EAAE,UAAU,EACnC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAiDZ"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Iterate over tree and remove metadata leaving just the entry
|
|
4
|
-
*/
|
|
5
|
-
export declare function stripMetadataFromEntries(dictionary: Dictionary): Dictionary;
|
|
6
|
-
//# sourceMappingURL=stripMetadataFromEntries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stripMetadataFromEntries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/stripMetadataFromEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAc3E"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const projectIdMissingError = "gt-react Error: General Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.";
|
|
2
|
-
export declare const devApiKeyProductionError = "gt-react Error: Production environments cannot include a development api key.";
|
|
3
|
-
export declare const apiKeyInProductionError = "gt-react Error: Production environments cannot include an api key.";
|
|
4
|
-
export declare const createNoAuthError = "gt-react Error: Configuration is missing a projectId and/or devApiKey. Please add these values to your environment or pass them to the <GTProvider> directly.";
|
|
5
|
-
export declare const createPluralMissingError: (children: any) => string;
|
|
6
|
-
export declare const createClientSideTDictionaryCollisionError: (id: string) => string;
|
|
7
|
-
export declare const createClientSideTHydrationError: (id: string) => string;
|
|
8
|
-
export declare const renderingError = "General Translation: Rendering error.";
|
|
9
|
-
export declare const dynamicTranslationError = "Error fetching batched translations:";
|
|
10
|
-
export declare const createGenericRuntimeTranslationError: (id: string | undefined, hash: string) => string;
|
|
11
|
-
export declare const runtimeTranslationError = "gt-react Error: Runtime translation failed: ";
|
|
12
|
-
export declare const customLoadTranslationsError: (locale?: string) => string;
|
|
13
|
-
export declare const customLoadDictionaryWarning: (locale?: string) => string;
|
|
14
|
-
export declare const missingVariablesError: (variables: string[], message: string) => string;
|
|
15
|
-
export declare const createStringRenderError: (message: string, id: string | undefined) => string;
|
|
16
|
-
export declare const createStringTranslationError: (string: string, id?: string, functionName?: string) => string;
|
|
17
|
-
export declare const invalidLocalesError: (locales: string[]) => string;
|
|
18
|
-
export declare const invalidCanonicalLocalesError: (locales: string[]) => string;
|
|
19
|
-
export declare const createEmptyIdError: () => string;
|
|
20
|
-
export declare const createSubtreeNotFoundError: (id: string) => string;
|
|
21
|
-
export declare const createDictionaryEntryError: () => string;
|
|
22
|
-
export declare const createCannotInjectDictionaryEntryError: () => string;
|
|
23
|
-
export declare const projectIdMissingWarning = "gt-react: Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.";
|
|
24
|
-
export declare const createNoEntryFoundWarning: (id: string) => string;
|
|
25
|
-
export declare const createInvalidDictionaryEntryWarning: (id: string) => string;
|
|
26
|
-
export declare const createNoEntryTranslationWarning: (id: string, prefixedId: string) => string;
|
|
27
|
-
export declare const createMismatchingHashWarning: (expectedHash: string, receivedHash: string) => string;
|
|
28
|
-
export declare const APIKeyMissingWarn: string;
|
|
29
|
-
export declare const createUnsupportedLocalesWarning: (locales: string[]) => string;
|
|
30
|
-
export declare const runtimeTranslationTimeoutWarning = "gt-react: Runtime translation timed out.";
|
|
31
|
-
export declare const createUnsupportedLocaleWarning: (validatedLocale: string, newLocale: string) => string;
|
|
32
|
-
export declare const dictionaryMissingWarning = "gt-react Warning: No dictionary was found. Ensure you are either passing your dictionary to the <GTProvider>.";
|
|
33
|
-
//# sourceMappingURL=createErrors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createErrors.d.ts","sourceRoot":"","sources":["../../src/errors/createErrors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,6HAC0F,CAAC;AAE7H,eAAO,MAAM,wBAAwB,kFAC4C,CAAC;AAElF,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE,eAAO,MAAM,iBAAiB,kKACmI,CAAC;AAElK,eAAO,MAAM,wBAAwB,GAAI,UAAU,GAAG,WACiB,CAAC;AAExE,eAAO,MAAM,yCAAyC,GAAI,IAAI,MAAM,WAC6D,CAAC;AAElI,eAAO,MAAM,+BAA+B,GAAI,IAAI,MAAM,WAEmE,CAAC;AAE9H,eAAO,MAAM,cAAc,0CAA0C,CAAC;AAEtE,eAAO,MAAM,uBAAuB,yCAAyC,CAAC;AAE9E,eAAO,MAAM,oCAAoC,GAC/C,IAAI,MAAM,GAAG,SAAS,EACtB,MAAM,MAAM,WAOb,CAAC;AAEF,eAAO,MAAM,uBAAuB,iDAAiD,CAAC;AAEtF,eAAO,MAAM,2BAA2B,GAAI,SAAQ,MAAW,WACwF,CAAC;AAExJ,eAAO,MAAM,2BAA2B,GAAI,SAAQ,MAAW,WACoF,CAAC;AAEpJ,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,EAAE,SAAS,MAAM,WACiB,CAAC;AAE5F,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,IAAI,MAAM,GAAG,SAAS,WAEgF,CAAC;AAEzG,eAAO,MAAM,4BAA4B,GACvC,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,qBAAmB,WAIa,CAAC;AAEnC,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,WAGwB,CAAC;AAE9E,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,EAAE,WACgD,CAAC;AAE/G,eAAO,MAAM,kBAAkB,cAC8B,CAAC;AAE9D,eAAO,MAAM,0BAA0B,GAAI,IAAI,MAAM,WACW,CAAC;AAEjE,eAAO,MAAM,0BAA0B,cACuB,CAAC;AAE/D,eAAO,MAAM,sCAAsC,cACW,CAAC;AAI/D,eAAO,MAAM,uBAAuB,+GAC0E,CAAC;AAE/G,eAAO,MAAM,yBAAyB,GAAI,IAAI,MAAM,WACD,CAAC;AAEpD,eAAO,MAAM,mCAAmC,GAAI,IAAI,MAAM,WACZ,CAAC;AAEnD,eAAO,MAAM,+BAA+B,GAC1C,IAAI,MAAM,EACV,YAAY,MAAM,WACwD,CAAC;AAE7E,eAAO,MAAM,4BAA4B,GACvC,cAAc,MAAM,EACpB,cAAc,MAAM,WAEkL,CAAC;AAEzM,eAAO,MAAM,iBAAiB,QAGqF,CAAC;AAEpH,eAAO,MAAM,+BAA+B,GAAI,SAAS,MAAM,EAAE,WAMhD,CAAC;AAElB,eAAO,MAAM,gCAAgC,6CAA6C,CAAC;AAE3F,eAAO,MAAM,8BAA8B,GACzC,iBAAiB,MAAM,EACvB,WAAW,MAAM,WAOlB,CAAC;AAEF,eAAO,MAAM,wBAAwB,kHAAkH,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the application's default locale from the `<GTProvider>` context.
|
|
3
|
-
*
|
|
4
|
-
* If no default locale is passed to the `<GTProvider>`, it defaults to providing 'en'.
|
|
5
|
-
*
|
|
6
|
-
* @returns {string} The application's default locale, e.g., 'en-US'.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const locale = useDefaultLocale();
|
|
10
|
-
* console.log(locale); // 'en-US'
|
|
11
|
-
*/
|
|
12
|
-
export default function useDefaultLocale(): string;
|
|
13
|
-
//# sourceMappingURL=useDefaultLocale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultLocale.d.ts","sourceRoot":"","sources":["../../src/hooks/useDefaultLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,IAAI,MAAM,CAIjD"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { LocaleProperties } from 'generaltranslation/types';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the configured GT class instance.
|
|
4
|
-
*
|
|
5
|
-
* @returns {GT} The configured GT class instance.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const gt = useGTClass();
|
|
9
|
-
* console.log(gt.getLocaleProperties('en-US'));
|
|
10
|
-
*/
|
|
11
|
-
export declare function useGTClass(): import("generaltranslation").GT;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the locale properties for the given locale.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} locale - The locale to get the properties for.
|
|
16
|
-
* @returns {LocaleProperties} The locale properties for the given locale.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* const localeProperties = useLocaleProperties('en-US');
|
|
20
|
-
* console.log(localeProperties);
|
|
21
|
-
*/
|
|
22
|
-
export declare function useLocaleProperties(locale: string): LocaleProperties;
|
|
23
|
-
//# sourceMappingURL=useGTClass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGTClass.d.ts","sourceRoot":"","sources":["../../src/hooks/useGTClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;GAQG;AACH,wBAAgB,UAAU,oCAIzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAGpE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the user's locale from the `<GTProvider>` context.
|
|
3
|
-
*
|
|
4
|
-
* @returns {string} The user's locale, e.g., 'en-US'.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* const locale = useLocale();
|
|
8
|
-
* console.log(locale); // 'en-US'
|
|
9
|
-
*/
|
|
10
|
-
export default function useLocale(): string;
|
|
11
|
-
//# sourceMappingURL=useLocale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,MAAM,CAI1C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the text direction ('ltr' or 'rtl') for the current or specified locale from the `<GTProvider>` context.
|
|
3
|
-
*
|
|
4
|
-
* If no locale is provided, the direction for the current user's locale is returned.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} [locale] - Optional locale code (e.g., 'ar', 'en-US'). If omitted, uses the current locale from context.
|
|
7
|
-
* @returns {'ltr' | 'rtl'} The text direction for the locale: 'rtl' for right-to-left languages, otherwise 'ltr'.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const dir = useLocaleDirection(); // e.g., 'ltr'
|
|
11
|
-
* const arabicDir = useLocaleDirection('ar'); // 'rtl'
|
|
12
|
-
*/
|
|
13
|
-
export declare function useLocaleDirection(locale?: string): 'ltr' | 'rtl';
|
|
14
|
-
//# sourceMappingURL=useLocaleDirection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleDirection.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocaleDirection.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAKjE"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Gets the list of properties for using a locale selector.
|
|
4
|
-
* Provides locale management utilities for the application.
|
|
5
|
-
* @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.
|
|
6
|
-
* Provides locale management utilities for the application.
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object} An object containing locale-related utilities:
|
|
9
|
-
* @returns {string} return.locale - The currently selected locale.
|
|
10
|
-
* @returns {string[]} return.locales - The list of all available locales.
|
|
11
|
-
* @returns {(locale: string) => void} return.setLocale - Function to update the current locale.
|
|
12
|
-
* @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.
|
|
13
|
-
*/
|
|
14
|
-
export default function useLocaleSelector(locales?: string[]): {
|
|
15
|
-
locale: string;
|
|
16
|
-
locales: string[];
|
|
17
|
-
setLocale: (locale: string) => void;
|
|
18
|
-
getLocaleProperties: (locale: string) => {
|
|
19
|
-
code: string;
|
|
20
|
-
name: string;
|
|
21
|
-
nativeName: string;
|
|
22
|
-
languageCode: string;
|
|
23
|
-
languageName: string;
|
|
24
|
-
nativeLanguageName: string;
|
|
25
|
-
nameWithRegionCode: string;
|
|
26
|
-
nativeNameWithRegionCode: string;
|
|
27
|
-
regionCode: string;
|
|
28
|
-
regionName: string;
|
|
29
|
-
nativeRegionName: string;
|
|
30
|
-
scriptCode: string;
|
|
31
|
-
scriptName: string;
|
|
32
|
-
nativeScriptName: string;
|
|
33
|
-
maximizedCode: string;
|
|
34
|
-
maximizedName: string;
|
|
35
|
-
nativeMaximizedName: string;
|
|
36
|
-
minimizedCode: string;
|
|
37
|
-
minimizedName: string;
|
|
38
|
-
nativeMinimizedName: string;
|
|
39
|
-
emoji: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=useLocaleSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocaleSelector.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE;;;;kCAoB/C,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAYlB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the user's list of supported locales from the `<GTProvider>` context.
|
|
3
|
-
*
|
|
4
|
-
* @returns {string[]} The user's locales, e.g., ['en-US', 'fr', 'jp'].
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* const locales = useLocales();
|
|
8
|
-
* console.log(locale); // ['en-US', 'fr', 'jp]
|
|
9
|
-
*/
|
|
10
|
-
export default function useLocales(): string[];
|
|
11
|
-
//# sourceMappingURL=useLocales.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocales.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocales.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,IAAI,MAAM,EAAE,CAI7C"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A React hook that retrieves the user's currently selected region from the `<GTProvider>` context.
|
|
3
|
-
*
|
|
4
|
-
* Returns the `region` value as a string (e.g., `"US"`, `"CA"`) or `undefined` if no region has been set.
|
|
5
|
-
*
|
|
6
|
-
* @returns {string | undefined} The currently active region code, or `undefined` if not set.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* const region = useRegion();
|
|
11
|
-
*
|
|
12
|
-
* if (!region) {
|
|
13
|
-
* console.log("No region set yet");
|
|
14
|
-
* } else {
|
|
15
|
-
* console.log(`Current region: ${region}`);
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export default function useRegion(): string | undefined;
|
|
20
|
-
//# sourceMappingURL=useRegion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRegion.d.ts","sourceRoot":"","sources":["../../src/hooks/useRegion.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,MAAM,GAAG,SAAS,CAItD"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
type RegionData = {
|
|
2
|
-
code: string;
|
|
3
|
-
name: string;
|
|
4
|
-
emoji: string;
|
|
5
|
-
locale: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* React hook for managing region selection logic in applications supporting multiple regions.
|
|
9
|
-
*
|
|
10
|
-
* This hook provides the necessary data and handlers to implement a region selector UI component.
|
|
11
|
-
* It returns the current region, a list of available regions, region metadata, and functions to update the region or associated locale.
|
|
12
|
-
*
|
|
13
|
-
* ### Parameters
|
|
14
|
-
* @param {Object} [options] - Optional configuration object.
|
|
15
|
-
* @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.
|
|
16
|
-
* @param {Object.<string, string|{name?: string, emoji?: string, locale?: string}>} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.
|
|
17
|
-
* @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.
|
|
18
|
-
* @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.
|
|
19
|
-
*
|
|
20
|
-
* ### Returns
|
|
21
|
-
* @returns {{
|
|
22
|
-
* region: string | undefined,
|
|
23
|
-
* setRegion: (region: string) => void,
|
|
24
|
-
* regions: string[],
|
|
25
|
-
* regionData: Map<string, { code: string, name: string, emoji: string, locale: string }>,
|
|
26
|
-
* locale: string,
|
|
27
|
-
* setLocale: (locale: string) => void
|
|
28
|
-
* }} An object containing:
|
|
29
|
-
* - `region`: The currently selected region code.
|
|
30
|
-
* - `setRegion`: Function to update the selected region.
|
|
31
|
-
* - `regions`: Array of available region codes.
|
|
32
|
-
* - `regionData`: Map of region codes to their display data (name, emoji, locale).
|
|
33
|
-
* - `locale`: The current locale.
|
|
34
|
-
* - `setLocale`: Function to update the locale.
|
|
35
|
-
*
|
|
36
|
-
* ### Example
|
|
37
|
-
* ```tsx
|
|
38
|
-
* const {
|
|
39
|
-
* region,
|
|
40
|
-
* setRegion,
|
|
41
|
-
* regions,
|
|
42
|
-
* regionData,
|
|
43
|
-
* locale,
|
|
44
|
-
* setLocale
|
|
45
|
-
* } = useRegionSelector({
|
|
46
|
-
* customMapping: { US: { name: "United States", emoji: "🇺🇸" } }
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* return (
|
|
50
|
-
* <select value={region} onChange={e => setRegion(e.target.value)}>
|
|
51
|
-
* {regions.map(r => (
|
|
52
|
-
* <option key={r} value={r}>
|
|
53
|
-
* {regionData.get(r)?.name}
|
|
54
|
-
* </option>
|
|
55
|
-
* ))}
|
|
56
|
-
* </select>
|
|
57
|
-
* );
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function useRegionSelector({ regions: _regions, customMapping, prioritizeCurrentLocaleRegion, sortRegionsAlphabetically, }?: {
|
|
61
|
-
regions?: string[];
|
|
62
|
-
customMapping?: {
|
|
63
|
-
[region: string]: string | {
|
|
64
|
-
name?: string;
|
|
65
|
-
emoji?: string;
|
|
66
|
-
locale?: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
prioritizeCurrentLocaleRegion?: boolean;
|
|
70
|
-
sortRegionsAlphabetically?: boolean;
|
|
71
|
-
}): {
|
|
72
|
-
region: string | undefined;
|
|
73
|
-
setRegion: (region: string | undefined) => void;
|
|
74
|
-
regions: string[];
|
|
75
|
-
regionData: Map<string, RegionData>;
|
|
76
|
-
locales: string[];
|
|
77
|
-
locale: string;
|
|
78
|
-
localeRegion: string;
|
|
79
|
-
setLocale: (locale: string) => void;
|
|
80
|
-
};
|
|
81
|
-
export {};
|
|
82
|
-
//# sourceMappingURL=useRegionSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRegionSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useRegionSelector.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,iBAAiB,CAC/B,EACE,OAAO,EAAE,QAAQ,EACjB,aAAa,EACb,6BAAoC,EACpC,yBAAgC,GACjC,GAAE;IACD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE;QACd,CAAC,MAAM,EAAE,MAAM,GACX,MAAM,GACN;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACxD,CAAC;IACF,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CAIrC;;;;;;;;;EAmEF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sets the user's locale in the `<GTProvider>` context.
|
|
3
|
-
* If the locale passed is not supported, will fallback on current locale and then defaultLocale if necessary.
|
|
4
|
-
* @note Unless a locale has explicitly been passed to the `<GTProvider>`, this will override the user's browser preferences. The locale passed to `<GTProvider>` will always take priority.
|
|
5
|
-
*
|
|
6
|
-
* @returns {(locale: string) => void} A function that sets the user's locale.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* setLocale('en-US');
|
|
10
|
-
*/
|
|
11
|
-
export default function useSetLocale(): (locale: string) => void;
|
|
12
|
-
//# sourceMappingURL=useSetLocale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSetLocale.d.ts","sourceRoot":"","sources":["../../src/hooks/useSetLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAK/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addGTIdentifier.d.ts","sourceRoot":"","sources":["../../src/internal/addGTIdentifier.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgC,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAGL,cAAc,EAGf,MAAM,gBAAgB,CAAC;AAOxB,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,QAAQ,EAAE,SAAS,EACnB,aAAa,GAAE,MAAU,GACxB,cAAc,CAmGhB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Dictionary, FlattenedDictionary } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* Flattens a nested dictionary by concatenating nested keys.
|
|
4
|
-
* Throws an error if two keys result in the same flattened key.
|
|
5
|
-
* @param {Record<string, any>} dictionary - The dictionary to flatten.
|
|
6
|
-
* @param {string} [prefix=''] - The prefix for nested keys.
|
|
7
|
-
* @returns {Record<string, React.ReactNode>} The flattened dictionary object.
|
|
8
|
-
* @throws {Error} If two keys result in the same flattened key.
|
|
9
|
-
*/
|
|
10
|
-
export default function flattenDictionary(dictionary: Dictionary, prefix?: string): FlattenedDictionary;
|
|
11
|
-
//# sourceMappingURL=flattenDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flattenDictionary.d.ts","sourceRoot":"","sources":["../../src/internal/flattenDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEV,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAKxB;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,UAAU,EAAE,UAAU,EACtB,MAAM,GAAE,MAAW,GAClB,mBAAmB,CA6BrB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TaggedChildren } from '../types/types';
|
|
2
|
-
import { JsxChildren } from 'generaltranslation/internal';
|
|
3
|
-
/**
|
|
4
|
-
* Transforms children elements into objects, processing each child recursively if needed.
|
|
5
|
-
* TaggedChildren are transformed into JsxChildren
|
|
6
|
-
* @param {Children} children - The children to process.
|
|
7
|
-
* @returns {object} The processed children as objects.
|
|
8
|
-
*/
|
|
9
|
-
export default function writeChildrenAsObjects(children: TaggedChildren): JsxChildren;
|
|
10
|
-
//# sourceMappingURL=writeChildrenAsObjects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeChildrenAsObjects.d.ts","sourceRoot":"","sources":["../../src/internal/writeChildrenAsObjects.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,cAAc,EAAiB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAEL,WAAW,EAGZ,MAAM,6BAA6B,CAAC;AA8JrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,QAAQ,EAAE,cAAc,GACvB,WAAW,CAKb"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { InlineTranslationOptions } from '../types/types';
|
|
2
|
-
export declare function icuMessageContainsVariables(message: string): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Encodes content into a message that contains important translation metadata
|
|
5
|
-
* @param message The message to encode.
|
|
6
|
-
* @param options The options to encode.
|
|
7
|
-
* @returns The encoded message.
|
|
8
|
-
*
|
|
9
|
-
* @note - Message format
|
|
10
|
-
* A message is broken into two parts separated by colons:
|
|
11
|
-
* - interpolated content - the content with interpolated variables
|
|
12
|
-
* - hash + options - a unique identifier for the source content and options for the translation
|
|
13
|
-
*
|
|
14
|
-
* @example - Basic usage
|
|
15
|
-
*
|
|
16
|
-
* ```jsx
|
|
17
|
-
* import { msg } from 'gt-react';
|
|
18
|
-
* const message = msg('Hello, {name}!', { name: 'Brian' });
|
|
19
|
-
* console.log(message); // "Hello, Brian:eyIkX2hhc2giOiAiMHgxMjMiLCAiJF9zb3VyY2UiOiAiSGVsbG8sIHtuYW1lfSEiLCAibmFtZSI6ICJCcmlhbiJ9"
|
|
20
|
-
* ```
|
|
21
|
-
* eyIkX2hhc2giOiAiMHgxMjMiLCAiJF9zb3VyY2UiOiAiSGVsbG8sIHtuYW1lfSEiLCAibmFtZSI6ICJCcmlhbiJ9
|
|
22
|
-
* encodes to {"$_hash": "0x123", "$_source": "Hello, {name}!", "name": "Brian"}
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
export declare function msg(message: string, options?: InlineTranslationOptions): string;
|
|
26
|
-
/**
|
|
27
|
-
* Extracts the original interpolated message string.
|
|
28
|
-
* If the message cannot be decoded (i.e., it does not contain a colon separator),
|
|
29
|
-
* the input is returned as-is.
|
|
30
|
-
* @param encodedMsg The message to decode.
|
|
31
|
-
* @returns The decoded message, or the input if it cannot be decoded.
|
|
32
|
-
*/
|
|
33
|
-
export declare function decodeMsg<T extends string | null | undefined>(encodedMsg: T): T;
|
|
34
|
-
/**
|
|
35
|
-
* Decodes the options from an encoded message.
|
|
36
|
-
* @param encodedMsg The message to decode.
|
|
37
|
-
* @returns The decoded options.
|
|
38
|
-
*/
|
|
39
|
-
export declare function decodeOptions(encodedMsg: string): ({
|
|
40
|
-
$_source: string;
|
|
41
|
-
$_hash: string;
|
|
42
|
-
} & InlineTranslationOptions) | null;
|
|
43
|
-
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/messages/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAiDpE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAuCR;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3D,UAAU,EAAE,CAAC,GACZ,CAAC,CAKH;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAC5C,CAAC;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,wBAAwB,CAAC,GAC7B,IAAI,CAeP"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type CacheKey = string | number | symbol | ReadonlyArray<unknown> | Readonly<Record<string, unknown>>;
|
|
2
|
-
type Status = 'pending' | 'fulfilled' | 'rejected';
|
|
3
|
-
export type Thenable<T> = Promise<T> & {
|
|
4
|
-
status?: Status;
|
|
5
|
-
value?: T;
|
|
6
|
-
reason?: unknown;
|
|
7
|
-
};
|
|
8
|
-
type Cell<T> = {
|
|
9
|
-
thenable: Thenable<T>;
|
|
10
|
-
createdAt: number;
|
|
11
|
-
expiresAt: number;
|
|
12
|
-
};
|
|
13
|
-
export type UseableOptions = {
|
|
14
|
-
/** How long to keep a resolved/rejected promise before it’s eligible for GC. Default: Infinity */
|
|
15
|
-
ttl?: number;
|
|
16
|
-
/** Provide your own Map if you want scoping or SSR hydration games. */
|
|
17
|
-
cache?: Map<string, Cell<any>>;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Create or load a cached thenable for use() *even if* it's created during render.
|
|
21
|
-
* On first call (per key), invokes `create()`, instruments the promise,
|
|
22
|
-
* caches it, and returns the same thenable instance forever (or until invalidated / TTL elapses).
|
|
23
|
-
*/
|
|
24
|
-
export declare function useable<T>(key: CacheKey, create: () => Promise<T>, opts?: UseableOptions): Thenable<T>;
|
|
25
|
-
/** Kick off work early without reading. */
|
|
26
|
-
export declare function preload<T>(key: CacheKey, create: () => Promise<T>, opts?: UseableOptions): void;
|
|
27
|
-
/** Invalidate a key; the next call will recreate the promise. */
|
|
28
|
-
export declare function invalidate(key: CacheKey, opts?: UseableOptions): void;
|
|
29
|
-
/** If resolved, synchronously read the cached value without suspending. */
|
|
30
|
-
export declare function peek<T>(key: CacheKey, opts?: UseableOptions): T | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* ⚠️ DEV-ONLY: Mute React’s "uncached promise" console warning.
|
|
33
|
-
* You should NOT need this if you use `useable()` correctly, but… you asked for risky.
|
|
34
|
-
*/
|
|
35
|
-
export declare function muteReactUncachedPromiseWarning(enable?: boolean): void;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=dangerouslyUsable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dangerouslyUsable.d.ts","sourceRoot":"","sources":["../../src/promises/dangerouslyUsable.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,MAAM,GACN,aAAa,CAAC,OAAO,CAAC,GACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtC,KAAK,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEnD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,IAAI,CAAC,CAAC,IAAI;IACb,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,kGAAkG;IAClG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;CAChC,CAAC;AA+DF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,CAAC,EAAE,cAAc,GACpB,QAAQ,CAAC,CAAC,CAAC,CAuCb;AAED,2CAA2C;AAC3C,wBAAgB,OAAO,CAAC,CAAC,EACvB,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,CAAC,EAAE,cAAc,GACpB,IAAI,CAEN;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,CAGrE;AAED,2EAA2E;AAC3E,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,CAAC,GAAG,SAAS,CAK3E;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,UAAO,GAAG,IAAI,CAkBnE"}
|