@generaltranslation/react-core 1.8.17 → 1.8.18
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 +14 -0
- package/dist/errors.cjs.min.cjs +2 -2
- package/dist/errors.cjs.min.cjs.map +1 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.esm.min.mjs +2 -2
- package/dist/errors.esm.min.mjs.map +1 -1
- package/dist/index.cjs.min.cjs +2 -2
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +1384 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.min.mjs +2 -2
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/internal.cjs.min.cjs +2 -2
- package/dist/internal.cjs.min.cjs.map +1 -1
- package/dist/internal.d.ts +764 -31
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.esm.min.mjs +2 -2
- package/dist/internal.esm.min.mjs.map +1 -1
- package/dist/types.d.ts +357 -174
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
- 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 -18
- 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 -18
- 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 -21
- 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-dir/constants.d.ts +0 -2
- package/dist/errors-dir/constants.d.ts.map +0 -1
- package/dist/errors-dir/createErrors.d.ts +0 -36
- package/dist/errors-dir/createErrors.d.ts.map +0 -1
- package/dist/errors-dir/internalErrors.d.ts +0 -8
- package/dist/errors-dir/internalErrors.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 -19
- 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/hooks/useVersionId.d.ts +0 -11
- package/dist/hooks/useVersionId.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/removeInjectedT.d.ts +0 -11
- package/dist/internal/removeInjectedT.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 -2
- 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/GTProvider.d.ts +0 -3
- package/dist/provider/GTProvider.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/isSSREnabled.d.ts +0 -5
- package/dist/provider/helpers/isSSREnabled.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/types.d.ts +0 -13
- package/dist/provider/hooks/locales/types.d.ts.map +0 -1
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts +0 -6
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts.map +0 -1
- package/dist/provider/hooks/locales/useLocaleState.d.ts +0 -20
- package/dist/provider/hooks/locales/useLocaleState.d.ts.map +0 -1
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts +0 -19
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts.map +0 -1
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts +0 -5
- 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/types.d.ts +0 -19
- package/dist/provider/hooks/types.d.ts.map +0 -1
- package/dist/provider/hooks/useEnableI18n.d.ts +0 -3
- package/dist/provider/hooks/useEnableI18n.d.ts.map +0 -1
- package/dist/provider/hooks/useErrorChecks.d.ts +0 -10
- 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/useRegionState.d.ts +0 -6
- package/dist/provider/hooks/useRegionState.d.ts.map +0 -1
- package/dist/provider/hooks/useRuntimeTranslation.d.ts +0 -24
- package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +0 -1
- package/dist/rendering/getDefaultRenderSettings.d.ts +0 -6
- package/dist/rendering/getDefaultRenderSettings.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/T.d.ts +0 -42
- package/dist/translation/T.d.ts.map +0 -1
- package/dist/translation/hooks/useGT.d.ts +0 -21
- 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/types-dir/config.d.ts +0 -69
- package/dist/types-dir/config.d.ts.map +0 -1
- package/dist/types-dir/context.d.ts +0 -31
- package/dist/types-dir/context.d.ts.map +0 -1
- package/dist/types-dir/runtime.d.ts +0 -22
- package/dist/types-dir/runtime.d.ts.map +0 -1
- package/dist/types-dir/types.d.ts +0 -90
- package/dist/types-dir/types.d.ts.map +0 -1
- package/dist/ui/LocaleSelector.d.ts +0 -7
- package/dist/ui/LocaleSelector.d.ts.map +0 -1
- package/dist/ui/RegionSelector.d.ts +0 -7
- package/dist/ui/RegionSelector.d.ts.map +0 -1
- package/dist/ui/types.d.ts +0 -18
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/utils/cookies.d.ts +0 -14
- 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/utils/types.d.ts +0 -9
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/use.d.ts +0 -4
- package/dist/utils/use.d.ts.map +0 -1
- package/dist/utils/utils.d.ts +0 -8
- package/dist/utils/utils.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/Derive.d.ts +0 -76
- package/dist/variables/Derive.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/RelativeTime.d.ts +0 -45
- package/dist/variables/RelativeTime.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 -11
- package/dist/variables/getVariableName.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderTranslatedChildren.d.ts","sourceRoot":"","sources":["../../src/rendering/renderTranslatedChildren.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,cAAc,EAEd,kBAAkB,EAClB,cAAc,EAGf,MAAM,oBAAoB,CAAC;AA+G5B,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,MAAM,EACN,MAAM,EACN,OAAgC,EAChC,cAAc,GACf,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,cAAc,CAAC;CAChC,GAAG,SAAS,CA+IZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderVariable.d.ts","sourceRoot":"","sources":["../../src/rendering/renderVariable.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA6B,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE/E,QAAA,MAAM,cAAc,EAAE,cAkDrB,CAAC;AACF,eAAe,cAAc,CAAC"}
|
package/dist/translation/T.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Build-time translation component that renders its children in the user's given locale.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```jsx
|
|
7
|
-
* // Basic usage:
|
|
8
|
-
* <T id="welcome_message">
|
|
9
|
-
* Hello, <Var>{name}</Var>!
|
|
10
|
-
* </T>
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```jsx
|
|
15
|
-
* // Translating a plural
|
|
16
|
-
* <T id="item_count">
|
|
17
|
-
* <Plural n={3} singular={<>You have <Num children={n}/> item.</>}>
|
|
18
|
-
* You have <Num children={n}/> items.
|
|
19
|
-
* </Plural>
|
|
20
|
-
* </T>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @param {React.ReactNode} children - The content to be translated or displayed.
|
|
24
|
-
* @param {string} [id] - Optional identifier for the translation string. If not provided, a hash will be generated from the content.
|
|
25
|
-
* @param {any} [context] - Additional context for translation key generation.
|
|
26
|
-
*
|
|
27
|
-
* @returns {JSX.Element} The rendered translation or fallback content based on the provided configuration.
|
|
28
|
-
*
|
|
29
|
-
* @throws {Error} If a plural translation is requested but the `n` option is not provided.
|
|
30
|
-
*/
|
|
31
|
-
declare function T({ children, id, context, _hash, ...options }: {
|
|
32
|
-
children: any;
|
|
33
|
-
id?: string;
|
|
34
|
-
context?: string;
|
|
35
|
-
_hash?: string;
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}): React.JSX.Element | undefined;
|
|
38
|
-
declare namespace T {
|
|
39
|
-
var _gtt: string;
|
|
40
|
-
}
|
|
41
|
-
export default T;
|
|
42
|
-
//# sourceMappingURL=T.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../src/translation/T.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAaxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,iBAAS,CAAC,CAAC,EACT,QAAQ,EACR,EAAE,EACF,OAAO,EACP,KAAK,EACL,GAAG,OAAO,EACX,EAAE;IACD,QAAQ,EAAE,GAAG,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,SAAS,CA2KhC;kBAvLQ,CAAC;;;AA2LV,eAAe,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { _Messages } from '../../types-dir/types';
|
|
2
|
-
/**
|
|
3
|
-
* Gets the translation function `gt` provided by `<GTProvider>`.
|
|
4
|
-
*
|
|
5
|
-
* @returns {Function} A translation function that accepts an ICU message format string and returns the translation of that string.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const gt = useGT();
|
|
9
|
-
* console.log(gt('To be or not to be...'));
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const gt = useGT();
|
|
13
|
-
* gt('My name is {customName}', { customName: "Brian", id: 'my-name', context: 'a proper noun' } )
|
|
14
|
-
*/
|
|
15
|
-
export default function useGT(_messages?: _Messages): (string: string, options?: Record<string, any> & {
|
|
16
|
-
$id?: string;
|
|
17
|
-
$context?: string;
|
|
18
|
-
$maxChars?: number;
|
|
19
|
-
$_hash?: string;
|
|
20
|
-
}) => string;
|
|
21
|
-
//# sourceMappingURL=useGT.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGT.d.ts","sourceRoot":"","sources":["../../../src/translation/hooks/useGT.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgB,MAAM,uBAAuB,CAAC;AAKhE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,YA8BvC,MAAM,YACL,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KACA,MAAM,CAuBV"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { _Messages } from '../../types-dir/types';
|
|
2
|
-
import { MFunctionType } from '../../types-dir/types';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the message decoding and translation function `m` provided by `<GTProvider>`.
|
|
5
|
-
*
|
|
6
|
-
* @returns {Function} A translation function that accepts an encoded message, decodes it, and returns the translated value.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const encodedMessage = msg("Hello, world")
|
|
10
|
-
* const m = useMessages();
|
|
11
|
-
* m(encodedMessage) // returns "Hello, world" translated
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* const encodedMessage = msg("My name is {name}", { name: "Brian" });
|
|
15
|
-
* const m = useMessages();
|
|
16
|
-
* m(encodedMessage) // returns "My name is Brian" translated
|
|
17
|
-
*/
|
|
18
|
-
export default function useMessages(_messages?: _Messages): MFunctionType;
|
|
19
|
-
//# sourceMappingURL=useMessages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMessages.d.ts","sourceRoot":"","sources":["../../../src/translation/hooks/useMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgB,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAwDxE"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the dictionary access function `t` provided by `<GTProvider>`.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} [id] - Optional prefix to prepend to the translation keys.
|
|
5
|
-
* @returns {Function} A translation function that accepts a key string and returns the translated value.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const t = useTranslations('user');
|
|
9
|
-
* console.log(t('name')); // Translates item 'user.name'
|
|
10
|
-
*
|
|
11
|
-
* const t = useTranslations();
|
|
12
|
-
* console.log(t('hello')); // Translates item 'hello'
|
|
13
|
-
*/
|
|
14
|
-
export default function useTranslations(id?: string): ((id: string, options?: Record<string, any>) => string) & {
|
|
15
|
-
obj: (id: string, options?: Record<string, any>) => any | undefined;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useTranslations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslations.d.ts","sourceRoot":"","sources":["../../../src/translation/hooks/useTranslations.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CACrD,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC1B,MAAM,CAAC,GAAG;IACb,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,SAAS,CAAC;CACrE,CAkDA"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RenderMethod } from './types';
|
|
3
|
-
import { Translations, CustomLoader } from './types';
|
|
4
|
-
import { CustomMapping } from 'generaltranslation/types';
|
|
5
|
-
import { AuthFromEnvParams, AuthFromEnvReturn } from '../utils/types';
|
|
6
|
-
import { UseDetermineLocaleParams, UseDetermineLocaleReturn } from '../provider/hooks/locales/types';
|
|
7
|
-
import { UseRegionStateParams, UseRegionStateReturn, UseEnableI18nParams, UseEnableI18nReturn } from '../provider/hooks/types';
|
|
8
|
-
export type EnableI18nConfig = {
|
|
9
|
-
/** Persist the feature flag as a cookie @default false (use when loading flag asynchronously) */
|
|
10
|
-
persist?: boolean;
|
|
11
|
-
/** Name of cookie @default defaultEnableI18nCookieName */
|
|
12
|
-
cookieName?: string;
|
|
13
|
-
};
|
|
14
|
-
export type GTConfig = {
|
|
15
|
-
projectId?: string;
|
|
16
|
-
devApiKey?: string;
|
|
17
|
-
locales?: string[];
|
|
18
|
-
defaultLocale?: string;
|
|
19
|
-
dictionary?: string;
|
|
20
|
-
runtimeUrl?: string | null;
|
|
21
|
-
cacheUrl?: string | null;
|
|
22
|
-
renderSettings?: {
|
|
23
|
-
method: RenderMethod;
|
|
24
|
-
timeout?: number;
|
|
25
|
-
};
|
|
26
|
-
_versionId?: string;
|
|
27
|
-
ssr?: boolean;
|
|
28
|
-
localeCookieName?: string;
|
|
29
|
-
customMapping?: CustomMapping;
|
|
30
|
-
modelProvider?: string;
|
|
31
|
-
enableI18n?: boolean;
|
|
32
|
-
};
|
|
33
|
-
export type InternalGTProviderProps = {
|
|
34
|
-
children?: React.ReactNode;
|
|
35
|
-
projectId?: string;
|
|
36
|
-
devApiKey?: string;
|
|
37
|
-
dictionary?: any;
|
|
38
|
-
locales?: string[];
|
|
39
|
-
defaultLocale?: string;
|
|
40
|
-
locale?: string;
|
|
41
|
-
region?: string;
|
|
42
|
-
cacheUrl?: string | null;
|
|
43
|
-
runtimeUrl?: string | null;
|
|
44
|
-
renderSettings?: {
|
|
45
|
-
method: RenderMethod;
|
|
46
|
-
timeout?: number;
|
|
47
|
-
};
|
|
48
|
-
_versionId?: string;
|
|
49
|
-
ssr?: boolean;
|
|
50
|
-
localeCookieName?: string;
|
|
51
|
-
translations?: Translations | null;
|
|
52
|
-
loadDictionary?: CustomLoader;
|
|
53
|
-
loadTranslations?: CustomLoader;
|
|
54
|
-
config?: GTConfig;
|
|
55
|
-
fallback?: React.ReactNode;
|
|
56
|
-
customMapping?: CustomMapping;
|
|
57
|
-
modelProvider?: string;
|
|
58
|
-
environment: 'development' | 'production' | 'test';
|
|
59
|
-
enableI18n?: boolean;
|
|
60
|
-
/** Flag to indicate if the enableI18n flag is finished loading asynchronously */
|
|
61
|
-
enableI18nLoaded?: boolean;
|
|
62
|
-
readAuthFromEnv: (params: AuthFromEnvParams) => AuthFromEnvReturn;
|
|
63
|
-
useDetermineLocale: (params: UseDetermineLocaleParams) => UseDetermineLocaleReturn;
|
|
64
|
-
useRegionState: (params: UseRegionStateParams) => UseRegionStateReturn;
|
|
65
|
-
useEnableI18n?: (params: UseEnableI18nParams) => UseEnableI18nReturn;
|
|
66
|
-
reloadOnLocaleUpdate?: boolean;
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types-dir/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,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AAC,EAAE;QACf,MAAM,EAAE,YAAY,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;IAEnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,iBAAiB,CAAC;IAClE,kBAAkB,EAAE,CAClB,MAAM,EAAE,wBAAwB,KAC7B,wBAAwB,CAAC;IAC9B,cAAc,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,oBAAoB,CAAC;IACvE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,mBAAmB,CAAC;IACrE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Translations, RenderMethod, InlineTranslationOptions, DictionaryTranslationOptions, _Messages, Dictionary, DictionaryEntry } from './types';
|
|
2
|
-
import { TranslateIcuCallback, TranslateChildrenCallback } from './runtime';
|
|
3
|
-
import { GT } from 'generaltranslation';
|
|
4
|
-
export type GTContextType = {
|
|
5
|
-
gt: GT;
|
|
6
|
-
registerIcuForTranslation: TranslateIcuCallback;
|
|
7
|
-
registerJsxForTranslation: TranslateChildrenCallback;
|
|
8
|
-
_gtFunction: (message: string, options?: InlineTranslationOptions, preloadedTranslations?: Translations) => string;
|
|
9
|
-
_mFunction: <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>, preloadedTranslations?: Translations) => T extends string ? string : T;
|
|
10
|
-
_filterMessagesForPreload: (_messages: _Messages) => _Messages;
|
|
11
|
-
_preloadMessages: (_messages: _Messages) => Promise<Translations>;
|
|
12
|
-
_dictionaryFunction: (id: string, options?: DictionaryTranslationOptions) => string;
|
|
13
|
-
_dictionaryObjFunction: (id: string, idWithParent: string, options?: DictionaryTranslationOptions) => Dictionary | DictionaryEntry | string | undefined;
|
|
14
|
-
developmentApiEnabled: boolean;
|
|
15
|
-
locale: string;
|
|
16
|
-
locales: string[];
|
|
17
|
-
setLocale: (locale: string) => void;
|
|
18
|
-
defaultLocale: string;
|
|
19
|
-
region: string | undefined;
|
|
20
|
-
setRegion: (region: string | undefined) => void;
|
|
21
|
-
translations: Translations | null;
|
|
22
|
-
translationRequired: boolean;
|
|
23
|
-
dialectTranslationRequired: boolean;
|
|
24
|
-
renderSettings: {
|
|
25
|
-
method: RenderMethod;
|
|
26
|
-
timeout?: number;
|
|
27
|
-
};
|
|
28
|
-
projectId?: string;
|
|
29
|
-
_versionId?: string;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types-dir/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,4BAA4B,EAC5B,SAAS,EACT,UAAU,EACV,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,EA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AE,YAAY,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0BAA0B,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { JsxChildren } from 'generaltranslation/types';
|
|
2
|
-
import { TranslatedChildren } from './types';
|
|
3
|
-
export type TranslateIcuCallback = (params: {
|
|
4
|
-
source: string;
|
|
5
|
-
targetLocale: string;
|
|
6
|
-
metadata: {
|
|
7
|
-
hash: string;
|
|
8
|
-
context?: string;
|
|
9
|
-
maxChars?: number;
|
|
10
|
-
} & Record<string, any>;
|
|
11
|
-
}) => Promise<TranslatedChildren>;
|
|
12
|
-
export type TranslateI18nextCallback = TranslateIcuCallback;
|
|
13
|
-
export type TranslateChildrenCallback = (params: {
|
|
14
|
-
source: JsxChildren | undefined;
|
|
15
|
-
targetLocale: string;
|
|
16
|
-
metadata: {
|
|
17
|
-
hash: string;
|
|
18
|
-
context?: string;
|
|
19
|
-
maxChars?: number;
|
|
20
|
-
} & Record<string, any>;
|
|
21
|
-
}) => Promise<TranslatedChildren>;
|
|
22
|
-
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/types-dir/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CACtE,MAAM,EACN,GAAG,CACJ,CAAC;CACH,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElC,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE;IAC/C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CACtE,MAAM,EACN,GAAG,CACJ,CAAC;CACH,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Variable, VariableTransformationSuffix, TransformationPrefix, GTProp, VariableType, InjectionType } from 'generaltranslation/types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export type { GTFunctionType, MFunctionType, InlineTranslationOptions, DictionaryTranslationOptions, RuntimeTranslationOptions, } from 'gt-i18n/types';
|
|
4
|
-
/**
|
|
5
|
-
* TaggedElement is a React element with a GTProp property.
|
|
6
|
-
*/
|
|
7
|
-
export type GTTag = {
|
|
8
|
-
id: number;
|
|
9
|
-
injectionType: InjectionType;
|
|
10
|
-
transformation?: TransformationPrefix;
|
|
11
|
-
branches?: Record<string, TaggedChildren>;
|
|
12
|
-
variableType?: VariableTransformationSuffix;
|
|
13
|
-
};
|
|
14
|
-
export type TaggedElementProps = Record<string, any> & {
|
|
15
|
-
'data-_gt': GTTag;
|
|
16
|
-
};
|
|
17
|
-
export type TaggedElement = React.ReactElement<TaggedElementProps>;
|
|
18
|
-
export type TaggedChild = Exclude<React.ReactNode, React.ReactElement> | TaggedElement;
|
|
19
|
-
export type TaggedChildren = TaggedChild[] | TaggedChild;
|
|
20
|
-
/**
|
|
21
|
-
* For dictionaries, we have Entry and MetaEntry
|
|
22
|
-
*/
|
|
23
|
-
export type Entry = string;
|
|
24
|
-
export type MetaEntry = {
|
|
25
|
-
$context?: string;
|
|
26
|
-
$maxChars?: number;
|
|
27
|
-
$_hash?: string;
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
30
|
-
export type DictionaryEntry = Entry | [Entry] | [Entry, MetaEntry];
|
|
31
|
-
export type Dictionary = {
|
|
32
|
-
[key: string]: Dictionary | DictionaryEntry;
|
|
33
|
-
} | (Dictionary | DictionaryEntry)[];
|
|
34
|
-
export type FlattenedDictionary = {
|
|
35
|
-
[key: string]: DictionaryEntry;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Translated content types
|
|
39
|
-
* TODO: move these types to JsxElement etc from generaltranslation/types
|
|
40
|
-
* remember to omit the t property (tag name) from the translated element
|
|
41
|
-
*/
|
|
42
|
-
export type TranslatedElement = {
|
|
43
|
-
i?: number;
|
|
44
|
-
d?: GTProp;
|
|
45
|
-
c?: TranslatedChildren;
|
|
46
|
-
};
|
|
47
|
-
export type TranslatedChild = TranslatedElement | string | Variable;
|
|
48
|
-
export type TranslatedChildren = TranslatedChild | TranslatedChild[];
|
|
49
|
-
export type Translations = {
|
|
50
|
-
[hash: string]: TranslatedChildren | null;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated use {@link Dictionary}
|
|
54
|
-
*/
|
|
55
|
-
export type DictionaryContent = string;
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated use {@link Dictionary}
|
|
58
|
-
*/
|
|
59
|
-
export type DictionaryObject = {
|
|
60
|
-
[id: string]: DictionaryContent;
|
|
61
|
-
};
|
|
62
|
-
export type LocalesDictionary = {
|
|
63
|
-
[locale: string]: DictionaryObject;
|
|
64
|
-
};
|
|
65
|
-
export type CustomLoader = (locale: string) => Promise<any>;
|
|
66
|
-
export type RenderMethod = 'skeleton' | 'replace' | 'default';
|
|
67
|
-
export type RelativeTimeFormatOptions = Intl.RelativeTimeFormatOptions & {
|
|
68
|
-
unit?: Intl.RelativeTimeFormatUnit;
|
|
69
|
-
baseDate?: Date;
|
|
70
|
-
};
|
|
71
|
-
export type VariableProps = {
|
|
72
|
-
/** Whether the variable was automatically injected by the compiler */
|
|
73
|
-
variableType: VariableType;
|
|
74
|
-
variableValue: any;
|
|
75
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | RelativeTimeFormatOptions;
|
|
76
|
-
variableName: string;
|
|
77
|
-
injectionType: InjectionType;
|
|
78
|
-
};
|
|
79
|
-
export type RenderVariable = ({ variableType, variableValue, variableOptions, locales, injectionType, }: Omit<VariableProps, 'variableName'> & {
|
|
80
|
-
locales: string[];
|
|
81
|
-
}) => React.ReactNode;
|
|
82
|
-
export type _Message = {
|
|
83
|
-
message: string;
|
|
84
|
-
$id?: string;
|
|
85
|
-
$context?: string;
|
|
86
|
-
$maxChars?: number;
|
|
87
|
-
$_hash?: string;
|
|
88
|
-
};
|
|
89
|
-
export type _Messages = _Message[];
|
|
90
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types-dir/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,oBAAoB,EACpB,MAAM,EACN,YAAY,EACZ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,YAAY,EACV,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,aAAa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GACd,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,KAAK,KAAK,CAAC,SAAS,CAAC;AAEtB,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,QAAQ,EAAE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LocaleSelectorProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated - this function is to always be overridden by a wrapper react package
|
|
5
|
-
*/
|
|
6
|
-
export default function LocaleSelector(_props: LocaleSelectorProps): React.JSX.Element | null;
|
|
7
|
-
//# sourceMappingURL=LocaleSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleSelector.d.ts","sourceRoot":"","sources":["../../src/ui/LocaleSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,MAAM,EAAE,mBAAmB,GAC1B,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAE1B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RegionSelectorProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated - this function is to always be overridden by a wrapper react package
|
|
5
|
-
*/
|
|
6
|
-
export default function RegionSelector<Regions extends string[]>(_props: RegionSelectorProps<Regions>): React.JSX.Element | null;
|
|
7
|
-
//# sourceMappingURL=RegionSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegionSelector.d.ts","sourceRoot":"","sources":["../../src/ui/RegionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,OAAO,SAAS,MAAM,EAAE,EAC7D,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,GACnC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAE1B"}
|
package/dist/ui/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CustomMapping } from 'generaltranslation/types';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export type LocaleSelectorProps = {
|
|
4
|
-
locales?: string[];
|
|
5
|
-
customNames?: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
};
|
|
8
|
-
customMapping?: CustomMapping;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
export type RegionSelectorProps<Regions extends string[]> = {
|
|
12
|
-
regions?: Regions;
|
|
13
|
-
placeholder?: ReactNode;
|
|
14
|
-
customMapping?: CustomMapping;
|
|
15
|
-
prioritizeCurrentLocaleRegion?: boolean;
|
|
16
|
-
sortRegionsAlphabetically?: boolean;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/ui/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,MAAM,EAAE,IAAI;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC"}
|
package/dist/utils/cookies.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cookie name for tracking the referrer locale
|
|
3
|
-
*/
|
|
4
|
-
export declare const defaultLocaleCookieName = "generaltranslation.locale";
|
|
5
|
-
/**
|
|
6
|
-
* Cookie name for tracking the user's selected region
|
|
7
|
-
*/
|
|
8
|
-
export declare const defaultRegionCookieName = "generaltranslation.region";
|
|
9
|
-
/**
|
|
10
|
-
* Cookie name for persisting the enableI18n feature flag
|
|
11
|
-
* "true" or "false"
|
|
12
|
-
*/
|
|
13
|
-
export declare const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
|
|
14
|
-
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/utils/cookies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AACnE;;GAEG;AACH,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AACnE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,mCAAmC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GT } from 'generaltranslation';
|
|
2
|
-
export default function fetchTranslations({ cacheUrl, projectId, locale, versionId, gt, }: {
|
|
3
|
-
cacheUrl: string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
locale: string;
|
|
6
|
-
versionId?: string;
|
|
7
|
-
gt: GT;
|
|
8
|
-
}): Promise<any>;
|
|
9
|
-
//# sourceMappingURL=fetchTranslations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchTranslations.d.ts","sourceRoot":"","sources":["../../src/utils/fetchTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,wBAA8B,iBAAiB,CAAC,EAC9C,QAAQ,EACR,SAAS,EACT,MAAM,EACN,SAAS,EACT,EAAE,GACH,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,EAAE,CAAC;CACR,gBAUA"}
|
package/dist/utils/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
package/dist/utils/use.d.ts
DELETED
package/dist/utils/use.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../src/utils/use.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,IAAI,QAAQ,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC;AAY3C,eAAe,QAAQ,CAAC"}
|
package/dist/utils/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TaggedElement } from '../types-dir/types';
|
|
2
|
-
import { AuthFromEnvParams, AuthFromEnvReturn } from './types';
|
|
3
|
-
export declare function isValidTaggedElement(target: unknown): target is TaggedElement;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated - this function is to always be overridden by a wrapper react package
|
|
6
|
-
*/
|
|
7
|
-
export declare function readAuthFromEnv(_params: AuthFromEnvParams): AuthFromEnvReturn;
|
|
8
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG/D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAE7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CAE7E"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The `<Currency>` component renders a formatted currency string, allowing customization of name, default value, currency type, and formatting options.
|
|
4
|
-
* Must be used inside a `<GTProvider>`.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```jsx
|
|
8
|
-
* <Currency currency="USD">
|
|
9
|
-
* 1000
|
|
10
|
-
* </Currency>
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param {number | string | null | undefined} children - Content to render inside the currency component.
|
|
14
|
-
* @param {string} [currency="USD"] - The currency type (e.g., USD, EUR, etc.).
|
|
15
|
-
* @param {string[]} [locales] - Optional locales to use for currency formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
|
16
|
-
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options to customize how the currency is displayed.
|
|
17
|
-
* @returns {JSX.Element} The formatted currency component.
|
|
18
|
-
*/
|
|
19
|
-
declare function Currency({ children, currency, locales, options, }: {
|
|
20
|
-
children: number | string | null | undefined;
|
|
21
|
-
currency?: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
locales?: string[];
|
|
24
|
-
options?: Intl.NumberFormatOptions;
|
|
25
|
-
}): React.JSX.Element | null;
|
|
26
|
-
declare namespace Currency {
|
|
27
|
-
var _gtt: string;
|
|
28
|
-
}
|
|
29
|
-
export default Currency;
|
|
30
|
-
//# sourceMappingURL=Currency.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,QAAgB,EAChB,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACpC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAoB3B;kBA/BQ,QAAQ;;;AAoCjB,eAAe,QAAQ,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The `<DateTime>` component renders a formatted date or time string, allowing customization of the name, default value, and formatting options.
|
|
4
|
-
* It utilizes the current locale and optional format settings to display the date.
|
|
5
|
-
* Must be used inside a `<GTProvider>`.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```jsx
|
|
9
|
-
* <DateTime>
|
|
10
|
-
* {new Date()}
|
|
11
|
-
* </DateTime>
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @param {Date} children - Content to render inside the date component.
|
|
15
|
-
* @param {string[]} [locales] - Optional locales to use for date formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
|
16
|
-
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
|
17
|
-
* @returns {JSX.Element} The formatted date or time component.
|
|
18
|
-
*/
|
|
19
|
-
declare function DateTime({ children, locales, options, }: {
|
|
20
|
-
children: Date | null | undefined;
|
|
21
|
-
name?: string;
|
|
22
|
-
locales?: string[];
|
|
23
|
-
options?: Intl.DateTimeFormatOptions;
|
|
24
|
-
}): React.JSX.Element | null;
|
|
25
|
-
declare namespace DateTime {
|
|
26
|
-
var _gtt: string;
|
|
27
|
-
}
|
|
28
|
-
export default DateTime;
|
|
29
|
-
//# sourceMappingURL=DateTime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CACtC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAmB3B;kBA5BQ,QAAQ;;;AAiCjB,eAAe,QAAQ,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Marks JSX children as derivable by the GT compiler and CLI.
|
|
4
|
-
*
|
|
5
|
-
* Use `<Derive>` inside translated JSX when child content is computed from
|
|
6
|
-
* source code, but should still be discovered during extraction instead of
|
|
7
|
-
* treated as a runtime interpolation variable. The CLI attempts to resolve the
|
|
8
|
-
* derivable children into every possible static value and includes those values
|
|
9
|
-
* in the source content that gets translated.
|
|
10
|
-
*
|
|
11
|
-
* `<Derive>` renders its children unchanged at runtime.
|
|
12
|
-
*
|
|
13
|
-
* Run `gt validate` after adding or changing `<Derive>` usage to verify that
|
|
14
|
-
* each derivable expression can be resolved by the CLI before translating or
|
|
15
|
-
* building.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```jsx
|
|
19
|
-
* function getSubject() {
|
|
20
|
-
* return (Math.random() > 0.5) ? "Alice" : "Brian";
|
|
21
|
-
* }
|
|
22
|
-
* ...
|
|
23
|
-
* <T>
|
|
24
|
-
* <Derive>
|
|
25
|
-
* {getSubject()}
|
|
26
|
-
* </Derive>
|
|
27
|
-
* is going to school today.
|
|
28
|
-
* </T>
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.
|
|
32
|
-
* @returns {T} The same children, unchanged at runtime.
|
|
33
|
-
*/
|
|
34
|
-
declare function Derive<T extends React.ReactNode>({ children }: {
|
|
35
|
-
children: T;
|
|
36
|
-
}): T;
|
|
37
|
-
declare namespace Derive {
|
|
38
|
-
var _gtt: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `<Derive>` instead.
|
|
42
|
-
*
|
|
43
|
-
* Marks JSX children as derivable by the GT compiler and CLI.
|
|
44
|
-
*
|
|
45
|
-
* Use `<Derive>` instead of `<Static>` for new code. This alias is kept for
|
|
46
|
-
* backwards compatibility and renders its children unchanged at runtime.
|
|
47
|
-
*
|
|
48
|
-
* Run `gt validate` after adding or changing derived JSX content to verify that
|
|
49
|
-
* each derivable expression can be resolved by the CLI before translating or
|
|
50
|
-
* building.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```jsx
|
|
54
|
-
* function getSubject() {
|
|
55
|
-
* return (Math.random() > 0.5) ? "Alice" : "Brian";
|
|
56
|
-
* }
|
|
57
|
-
* ...
|
|
58
|
-
* <T>
|
|
59
|
-
* <Static>
|
|
60
|
-
* {getSubject()}
|
|
61
|
-
* </Static>
|
|
62
|
-
* is going to school today.
|
|
63
|
-
* </T>
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.
|
|
67
|
-
* @returns {T} The same children, unchanged at runtime.
|
|
68
|
-
*/
|
|
69
|
-
declare function Static<T extends React.ReactNode>(props: {
|
|
70
|
-
children: T;
|
|
71
|
-
}): T;
|
|
72
|
-
declare namespace Static {
|
|
73
|
-
var _gtt: string;
|
|
74
|
-
}
|
|
75
|
-
export { Derive, Static };
|
|
76
|
-
//# sourceMappingURL=Derive.d.ts.map
|