@generaltranslation/react-core 0.0.0 → 0.0.1-alpha.0
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/LICENSE.md +105 -0
- package/README.md +9 -0
- package/dist/branches/Branch.d.ts +34 -0
- package/dist/branches/Branch.d.ts.map +1 -0
- package/dist/branches/plurals/Plural.d.ts +38 -0
- package/dist/branches/plurals/Plural.d.ts.map +1 -0
- package/dist/branches/plurals/getPluralBranch.d.ts +9 -0
- package/dist/branches/plurals/getPluralBranch.d.ts.map +1 -0
- package/dist/dictionaries/collectUntranslatedEntries.d.ts +17 -0
- package/dist/dictionaries/collectUntranslatedEntries.d.ts.map +1 -0
- package/dist/dictionaries/getDictionaryEntry.d.ts +4 -0
- package/dist/dictionaries/getDictionaryEntry.d.ts.map +1 -0
- package/dist/dictionaries/getEntryAndMetadata.d.ts +6 -0
- package/dist/dictionaries/getEntryAndMetadata.d.ts.map +1 -0
- package/dist/dictionaries/getSubtree.d.ts +18 -0
- package/dist/dictionaries/getSubtree.d.ts.map +1 -0
- package/dist/dictionaries/indexDict.d.ts +15 -0
- package/dist/dictionaries/indexDict.d.ts.map +1 -0
- package/dist/dictionaries/injectAndMerge.d.ts +9 -0
- package/dist/dictionaries/injectAndMerge.d.ts.map +1 -0
- package/dist/dictionaries/injectEntry.d.ts +18 -0
- package/dist/dictionaries/injectEntry.d.ts.map +1 -0
- package/dist/dictionaries/injectFallbacks.d.ts +17 -0
- package/dist/dictionaries/injectFallbacks.d.ts.map +1 -0
- package/dist/dictionaries/injectHashes.d.ts +11 -0
- package/dist/dictionaries/injectHashes.d.ts.map +1 -0
- package/dist/dictionaries/injectTranslations.d.ts +20 -0
- package/dist/dictionaries/injectTranslations.d.ts.map +1 -0
- package/dist/dictionaries/isDictionaryEntry.d.ts +8 -0
- package/dist/dictionaries/isDictionaryEntry.d.ts.map +1 -0
- package/dist/dictionaries/loadDictionaryHelper.d.ts +3 -0
- package/dist/dictionaries/loadDictionaryHelper.d.ts.map +1 -0
- package/dist/dictionaries/mergeDictionaries.d.ts +3 -0
- package/dist/dictionaries/mergeDictionaries.d.ts.map +1 -0
- package/dist/dictionaries/stripMetadataFromEntries.d.ts +6 -0
- package/dist/dictionaries/stripMetadataFromEntries.d.ts.map +1 -0
- package/dist/errors-dir/constants.d.ts +2 -0
- package/dist/errors-dir/constants.d.ts.map +1 -0
- package/dist/errors-dir/createErrors.d.ts +32 -0
- package/dist/errors-dir/createErrors.d.ts.map +1 -0
- package/dist/errors-dir/internalErrors.d.ts +8 -0
- package/dist/errors-dir/internalErrors.d.ts.map +1 -0
- package/dist/errors.cjs.min.cjs +1 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.esm.min.mjs +1 -0
- package/dist/hooks/useDefaultLocale.d.ts +13 -0
- package/dist/hooks/useDefaultLocale.d.ts.map +1 -0
- package/dist/hooks/useGTClass.d.ts +23 -0
- package/dist/hooks/useGTClass.d.ts.map +1 -0
- package/dist/hooks/useLocale.d.ts +11 -0
- package/dist/hooks/useLocale.d.ts.map +1 -0
- package/dist/hooks/useLocaleDirection.d.ts +14 -0
- package/dist/hooks/useLocaleDirection.d.ts.map +1 -0
- package/dist/hooks/useLocaleSelector.d.ts +42 -0
- package/dist/hooks/useLocaleSelector.d.ts.map +1 -0
- package/dist/hooks/useLocales.d.ts +11 -0
- package/dist/hooks/useLocales.d.ts.map +1 -0
- package/dist/hooks/useRegion.d.ts +20 -0
- package/dist/hooks/useRegion.d.ts.map +1 -0
- package/dist/hooks/useRegionSelector.d.ts +82 -0
- package/dist/hooks/useRegionSelector.d.ts.map +1 -0
- package/dist/hooks/useSetLocale.d.ts +12 -0
- package/dist/hooks/useSetLocale.d.ts.map +1 -0
- package/dist/index.cjs.min.cjs +18 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.min.mjs +18 -0
- package/dist/internal/addGTIdentifier.d.ts +4 -0
- package/dist/internal/addGTIdentifier.d.ts.map +1 -0
- package/dist/internal/flattenDictionary.d.ts +11 -0
- package/dist/internal/flattenDictionary.d.ts.map +1 -0
- package/dist/internal/writeChildrenAsObjects.d.ts +10 -0
- package/dist/internal/writeChildrenAsObjects.d.ts.map +1 -0
- package/dist/internal.cjs.min.cjs +18 -0
- package/dist/internal.d.ts +32 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.esm.min.mjs +18 -0
- package/dist/messages/messages.d.ts +43 -0
- package/dist/messages/messages.d.ts.map +1 -0
- package/dist/promises/dangerouslyUsable.d.ts +37 -0
- package/dist/promises/dangerouslyUsable.d.ts.map +1 -0
- package/dist/promises/reactHasUse.d.ts +2 -0
- package/dist/promises/reactHasUse.d.ts.map +1 -0
- package/dist/provider/GTContext.d.ts +4 -0
- package/dist/provider/GTContext.d.ts.map +1 -0
- package/dist/provider/GTProvider.d.ts +32 -0
- package/dist/provider/GTProvider.d.ts.map +1 -0
- package/dist/provider/config/defaultProps.d.ts +4 -0
- package/dist/provider/config/defaultProps.d.ts.map +1 -0
- package/dist/provider/helpers/isSSREnabled.d.ts +5 -0
- package/dist/provider/helpers/isSSREnabled.d.ts.map +1 -0
- package/dist/provider/helpers/validateString.d.ts +6 -0
- package/dist/provider/helpers/validateString.d.ts.map +1 -0
- package/dist/provider/hooks/locales/types.d.ts +11 -0
- package/dist/provider/hooks/locales/types.d.ts.map +1 -0
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts +6 -0
- package/dist/provider/hooks/locales/useDetermineLocale.d.ts.map +1 -0
- package/dist/provider/hooks/locales/useLocaleState.d.ts +18 -0
- package/dist/provider/hooks/locales/useLocaleState.d.ts.map +1 -0
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts +18 -0
- package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts.map +1 -0
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts +4 -0
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts.map +1 -0
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts +4 -0
- package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts.map +1 -0
- package/dist/provider/hooks/types.d.ts +10 -0
- package/dist/provider/hooks/types.d.ts.map +1 -0
- package/dist/provider/hooks/useErrorChecks.d.ts +9 -0
- package/dist/provider/hooks/useErrorChecks.d.ts.map +1 -0
- package/dist/provider/hooks/useLoadDictionary.d.ts +15 -0
- package/dist/provider/hooks/useLoadDictionary.d.ts.map +1 -0
- package/dist/provider/hooks/useLoadTranslations.d.ts +17 -0
- package/dist/provider/hooks/useLoadTranslations.d.ts.map +1 -0
- package/dist/provider/hooks/useRegionState.d.ts +6 -0
- package/dist/provider/hooks/useRegionState.d.ts.map +1 -0
- package/dist/provider/hooks/useRuntimeTranslation.d.ts +23 -0
- package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +1 -0
- package/dist/rendering/defaultRenderSettings.d.ts +6 -0
- package/dist/rendering/defaultRenderSettings.d.ts.map +1 -0
- package/dist/rendering/getGTTag.d.ts +3 -0
- package/dist/rendering/getGTTag.d.ts.map +1 -0
- package/dist/rendering/isVariableObject.d.ts +3 -0
- package/dist/rendering/isVariableObject.d.ts.map +1 -0
- package/dist/rendering/renderDefaultChildren.d.ts +8 -0
- package/dist/rendering/renderDefaultChildren.d.ts.map +1 -0
- package/dist/rendering/renderSkeleton.d.ts +8 -0
- package/dist/rendering/renderSkeleton.d.ts.map +1 -0
- package/dist/rendering/renderTranslatedChildren.d.ts +9 -0
- package/dist/rendering/renderTranslatedChildren.d.ts.map +1 -0
- package/dist/rendering/renderVariable.d.ts +4 -0
- package/dist/rendering/renderVariable.d.ts.map +1 -0
- package/dist/translation/hooks/useGT.d.ts +20 -0
- package/dist/translation/hooks/useGT.d.ts.map +1 -0
- package/dist/translation/hooks/useMessages.d.ts +19 -0
- package/dist/translation/hooks/useMessages.d.ts.map +1 -0
- package/dist/translation/hooks/useTranslations.d.ts +17 -0
- package/dist/translation/hooks/useTranslations.d.ts.map +1 -0
- package/dist/translation/inline/T.d.ts +42 -0
- package/dist/translation/inline/T.d.ts.map +1 -0
- package/dist/types-dir/config.d.ts +50 -0
- package/dist/types-dir/config.d.ts.map +1 -0
- package/dist/types-dir/context.d.ts +30 -0
- package/dist/types-dir/context.d.ts.map +1 -0
- package/dist/types-dir/runtime.d.ts +20 -0
- package/dist/types-dir/runtime.d.ts.map +1 -0
- package/dist/types-dir/types.d.ts +90 -0
- package/dist/types-dir/types.d.ts.map +1 -0
- package/dist/types.d.ts +214 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/LocaleSelector.d.ts +7 -0
- package/dist/ui/LocaleSelector.d.ts.map +1 -0
- package/dist/ui/RegionSelector.d.ts +7 -0
- package/dist/ui/RegionSelector.d.ts.map +1 -0
- package/dist/ui/types.d.ts +18 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/utils/cookies.d.ts +9 -0
- package/dist/utils/cookies.d.ts.map +1 -0
- package/dist/utils/fetchTranslations.d.ts +9 -0
- package/dist/utils/fetchTranslations.d.ts.map +1 -0
- package/dist/utils/types.d.ts +9 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/utils.d.ts +8 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/variables/Currency.d.ts +30 -0
- package/dist/variables/Currency.d.ts.map +1 -0
- package/dist/variables/DateTime.d.ts +29 -0
- package/dist/variables/DateTime.d.ts.map +1 -0
- package/dist/variables/Num.d.ts +31 -0
- package/dist/variables/Num.d.ts.map +1 -0
- package/dist/variables/Var.d.ts +32 -0
- package/dist/variables/Var.d.ts.map +1 -0
- package/dist/variables/_getVariableProps.d.ts +11 -0
- package/dist/variables/_getVariableProps.d.ts.map +1 -0
- package/dist/variables/getVariableName.d.ts +10 -0
- package/dist/variables/getVariableName.d.ts.map +1 -0
- package/package.json +109 -14
- package/index.d.ts +0 -4
- package/index.js +0 -7
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { GTProp, Variable, VariableType, JsxChildren, CustomMapping } from 'generaltranslation/types';
|
|
2
|
+
export { GTProp } from 'generaltranslation/types';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
import { GT } from 'generaltranslation';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* For dictionaries, we have Entry and MetaEntry
|
|
8
|
+
*/
|
|
9
|
+
type Entry = string;
|
|
10
|
+
type MetaEntry = {
|
|
11
|
+
$context?: string;
|
|
12
|
+
$_hash?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
type DictionaryEntry = Entry | [Entry] | [Entry, MetaEntry];
|
|
16
|
+
type Dictionary = {
|
|
17
|
+
[key: string]: Dictionary | DictionaryEntry;
|
|
18
|
+
} | (Dictionary | DictionaryEntry)[];
|
|
19
|
+
type FlattenedDictionary = {
|
|
20
|
+
[key: string]: DictionaryEntry;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Translated content types
|
|
24
|
+
*/
|
|
25
|
+
type TranslatedElement = {
|
|
26
|
+
i?: number;
|
|
27
|
+
d?: GTProp;
|
|
28
|
+
c?: TranslatedChildren;
|
|
29
|
+
};
|
|
30
|
+
type TranslatedChild = TranslatedElement | string | Variable;
|
|
31
|
+
type TranslatedChildren = TranslatedChild | TranslatedChild[];
|
|
32
|
+
type Translations = {
|
|
33
|
+
[hash: string]: TranslatedChildren | null;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use {@link Dictionary}
|
|
37
|
+
*/
|
|
38
|
+
type DictionaryContent = string;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use {@link Dictionary}
|
|
41
|
+
*/
|
|
42
|
+
type DictionaryObject = {
|
|
43
|
+
[id: string]: DictionaryContent;
|
|
44
|
+
};
|
|
45
|
+
type LocalesDictionary = {
|
|
46
|
+
[locale: string]: DictionaryObject;
|
|
47
|
+
};
|
|
48
|
+
type CustomLoader = (locale: string) => Promise<any>;
|
|
49
|
+
type RenderMethod = 'skeleton' | 'replace' | 'default';
|
|
50
|
+
type DictionaryTranslationOptions = Record<string, any>;
|
|
51
|
+
type InlineTranslationOptions = DictionaryTranslationOptions & {
|
|
52
|
+
$context?: string;
|
|
53
|
+
$id?: string;
|
|
54
|
+
$_hash?: string;
|
|
55
|
+
$_source?: string;
|
|
56
|
+
};
|
|
57
|
+
type RuntimeTranslationOptions = {
|
|
58
|
+
locale?: string;
|
|
59
|
+
} & Omit<InlineTranslationOptions, 'id'>;
|
|
60
|
+
type VariableProps = {
|
|
61
|
+
variableType: VariableType;
|
|
62
|
+
variableValue: any;
|
|
63
|
+
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
|
64
|
+
variableName: string;
|
|
65
|
+
};
|
|
66
|
+
type RenderVariable = ({ variableType, variableValue, variableOptions, locales, }: Omit<VariableProps, 'variableName'> & {
|
|
67
|
+
locales: string[];
|
|
68
|
+
}) => React.JSX.Element;
|
|
69
|
+
type _Message = {
|
|
70
|
+
message: string;
|
|
71
|
+
$id?: string;
|
|
72
|
+
$context?: string;
|
|
73
|
+
$_hash?: string;
|
|
74
|
+
};
|
|
75
|
+
type _Messages = _Message[];
|
|
76
|
+
type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
|
|
77
|
+
type TFunctionType = (message: string, options?: InlineTranslationOptions) => string;
|
|
78
|
+
|
|
79
|
+
type TranslateIcuCallback = (params: {
|
|
80
|
+
source: string;
|
|
81
|
+
targetLocale: string;
|
|
82
|
+
metadata: {
|
|
83
|
+
hash: string;
|
|
84
|
+
context?: string;
|
|
85
|
+
} & Record<string, any>;
|
|
86
|
+
}) => Promise<TranslatedChildren>;
|
|
87
|
+
type TranslateChildrenCallback = (params: {
|
|
88
|
+
source: JsxChildren | undefined;
|
|
89
|
+
targetLocale: string;
|
|
90
|
+
metadata: {
|
|
91
|
+
hash: string;
|
|
92
|
+
context?: string;
|
|
93
|
+
} & Record<string, any>;
|
|
94
|
+
}) => Promise<TranslatedChildren>;
|
|
95
|
+
|
|
96
|
+
type GTContextType = {
|
|
97
|
+
gt: GT;
|
|
98
|
+
registerIcuForTranslation: TranslateIcuCallback;
|
|
99
|
+
registerJsxForTranslation: TranslateChildrenCallback;
|
|
100
|
+
_tFunction: (message: string, options?: InlineTranslationOptions, preloadedTranslations?: Translations) => string;
|
|
101
|
+
_mFunction: <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>, preloadedTranslations?: Translations) => T extends string ? string : T;
|
|
102
|
+
_filterMessagesForPreload: (_messages: _Messages) => _Messages;
|
|
103
|
+
_preloadMessages: (_messages: _Messages) => Promise<Translations>;
|
|
104
|
+
_dictionaryFunction: (id: string, options?: DictionaryTranslationOptions) => string;
|
|
105
|
+
_dictionaryObjFunction: (id: string, idWithParent: string, options?: DictionaryTranslationOptions) => Dictionary | DictionaryEntry | string | undefined;
|
|
106
|
+
developmentApiEnabled: boolean;
|
|
107
|
+
locale: string;
|
|
108
|
+
locales: string[];
|
|
109
|
+
setLocale: (locale: string) => void;
|
|
110
|
+
defaultLocale: string;
|
|
111
|
+
region: string | undefined;
|
|
112
|
+
setRegion: (region: string | undefined) => void;
|
|
113
|
+
translations: Translations | null;
|
|
114
|
+
translationRequired: boolean;
|
|
115
|
+
dialectTranslationRequired: boolean;
|
|
116
|
+
renderSettings: {
|
|
117
|
+
method: RenderMethod;
|
|
118
|
+
timeout?: number;
|
|
119
|
+
};
|
|
120
|
+
projectId?: string;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
type AuthFromEnvParams = {
|
|
124
|
+
projectId?: string;
|
|
125
|
+
devApiKey?: string;
|
|
126
|
+
};
|
|
127
|
+
type AuthFromEnvReturn = {
|
|
128
|
+
projectId: string;
|
|
129
|
+
devApiKey?: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type UseDetermineLocaleParams = {
|
|
133
|
+
defaultLocale: string;
|
|
134
|
+
locales: string[];
|
|
135
|
+
locale?: string;
|
|
136
|
+
localeCookieName?: string;
|
|
137
|
+
ssr?: boolean;
|
|
138
|
+
customMapping?: CustomMapping;
|
|
139
|
+
};
|
|
140
|
+
type UseDetermineLocaleReturn = [string, (locale: string) => void];
|
|
141
|
+
|
|
142
|
+
type UseRegionStateParams = {
|
|
143
|
+
_region: string | undefined;
|
|
144
|
+
ssr: boolean;
|
|
145
|
+
regionCookieName: string;
|
|
146
|
+
};
|
|
147
|
+
type UseRegionStateReturn = {
|
|
148
|
+
region: string | undefined;
|
|
149
|
+
setRegion: (region: string | undefined) => void;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
type LocaleSelectorProps = {
|
|
153
|
+
locales?: string[];
|
|
154
|
+
customNames?: {
|
|
155
|
+
[key: string]: string;
|
|
156
|
+
};
|
|
157
|
+
customMapping?: CustomMapping;
|
|
158
|
+
[key: string]: any;
|
|
159
|
+
};
|
|
160
|
+
type RegionSelectorProps<Regions extends string[]> = {
|
|
161
|
+
regions?: Regions;
|
|
162
|
+
placeholder?: ReactNode;
|
|
163
|
+
customMapping?: CustomMapping;
|
|
164
|
+
prioritizeCurrentLocaleRegion?: boolean;
|
|
165
|
+
sortRegionsAlphabetically?: boolean;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
type GTConfig = {
|
|
169
|
+
projectId?: string;
|
|
170
|
+
devApiKey?: string;
|
|
171
|
+
locales?: string[];
|
|
172
|
+
defaultLocale?: string;
|
|
173
|
+
dictionary?: string;
|
|
174
|
+
runtimeUrl?: string;
|
|
175
|
+
cacheUrl?: string;
|
|
176
|
+
renderSettings?: {
|
|
177
|
+
method: RenderMethod;
|
|
178
|
+
timeout?: number;
|
|
179
|
+
};
|
|
180
|
+
_versionId?: string;
|
|
181
|
+
ssr?: boolean;
|
|
182
|
+
localeCookieName?: string;
|
|
183
|
+
customMapping?: CustomMapping;
|
|
184
|
+
modelProvider?: string;
|
|
185
|
+
};
|
|
186
|
+
type GTProviderProps = {
|
|
187
|
+
children?: React.ReactNode;
|
|
188
|
+
projectId?: string;
|
|
189
|
+
devApiKey?: string;
|
|
190
|
+
dictionary?: any;
|
|
191
|
+
locales?: string[];
|
|
192
|
+
defaultLocale?: string;
|
|
193
|
+
locale?: string;
|
|
194
|
+
region?: string;
|
|
195
|
+
cacheUrl?: string;
|
|
196
|
+
runtimeUrl?: string;
|
|
197
|
+
renderSettings?: {
|
|
198
|
+
method: RenderMethod;
|
|
199
|
+
timeout?: number;
|
|
200
|
+
};
|
|
201
|
+
_versionId?: string;
|
|
202
|
+
ssr?: boolean;
|
|
203
|
+
localeCookieName?: string;
|
|
204
|
+
translations?: Translations | null;
|
|
205
|
+
loadDictionary?: CustomLoader;
|
|
206
|
+
loadTranslations?: CustomLoader;
|
|
207
|
+
config?: GTConfig;
|
|
208
|
+
fallback?: React.ReactNode;
|
|
209
|
+
customMapping?: CustomMapping;
|
|
210
|
+
modelProvider?: string;
|
|
211
|
+
[key: string]: any;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export type { AuthFromEnvParams, AuthFromEnvReturn, CustomLoader, Dictionary, DictionaryContent, DictionaryEntry, DictionaryObject, DictionaryTranslationOptions, Entry, FlattenedDictionary, GTContextType, GTProviderProps, InlineTranslationOptions, LocaleSelectorProps, LocalesDictionary, MFunctionType, MetaEntry as Metadata, RegionSelectorProps, RenderMethod, RenderVariable, RuntimeTranslationOptions, TFunctionType, TranslatedChildren, Translations, UseDetermineLocaleParams, UseDetermineLocaleReturn, UseRegionStateParams, UseRegionStateReturn, VariableProps, _Message, _Messages };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,KAAK,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,IAAI,QAAQ,EACrB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,GACrB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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({}: LocaleSelectorProps): React.JSX.Element | null;
|
|
7
|
+
//# sourceMappingURL=LocaleSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAExF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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[]>({}: RegionSelectorProps<Regions>): React.JSX.Element | null;
|
|
7
|
+
//# sourceMappingURL=RegionSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CACpC,OAAO,SAAS,MAAM,EAAE,EACxB,EAAE,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAE5D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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({}: AuthFromEnvParams): AuthFromEnvReturn;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,EAAE,iBAAiB,GAAG,iBAAiB,CAExE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAe3B;kBAxBQ,QAAQ;;;AA6BjB,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `<Num>` component renders a formatted number string, allowing customization of the name, default value, and formatting options.
|
|
4
|
+
* It formats the number according to the current locale and optionally passed formatting options.
|
|
5
|
+
* Must be used inside a `<GTProvider>`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```jsx
|
|
9
|
+
* <Num
|
|
10
|
+
* options={{ style: "decimal", maximumFractionDigits: 2 }}
|
|
11
|
+
* >
|
|
12
|
+
* 1000
|
|
13
|
+
* </Num>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param {number | string | null | undefined} children - Content to render inside the number component.
|
|
17
|
+
* @param {string[]} [locales] - Optional locales to use for number formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
|
18
|
+
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
19
|
+
* @returns {React.JSX.Element} The formatted number component.
|
|
20
|
+
*/
|
|
21
|
+
declare function Num({ children, locales, options, }: {
|
|
22
|
+
children: number | string | null | undefined;
|
|
23
|
+
name?: string;
|
|
24
|
+
locales?: string[];
|
|
25
|
+
options?: Intl.NumberFormatOptions;
|
|
26
|
+
}): React.JSX.Element | null;
|
|
27
|
+
declare namespace Num {
|
|
28
|
+
var _gtt: string;
|
|
29
|
+
}
|
|
30
|
+
export default Num;
|
|
31
|
+
//# sourceMappingURL=Num.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,GAAG,CAAC,EACX,QAAQ,EACR,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,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,CAiB3B;kBA1BQ,GAAG;;;AA8BZ,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `value`.
|
|
4
|
+
* If `children` is provided, it will be used; otherwise, the `value` is rendered.
|
|
5
|
+
*
|
|
6
|
+
* @example Inline usage:
|
|
7
|
+
* ```jsx
|
|
8
|
+
* function MyComponent() {
|
|
9
|
+
* const name = 'Archie';
|
|
10
|
+
* return (
|
|
11
|
+
* <T>
|
|
12
|
+
* <p>
|
|
13
|
+
* Hello, <Var> {name} </Var>!
|
|
14
|
+
* </p>
|
|
15
|
+
* </T>
|
|
16
|
+
* );
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
|
22
|
+
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
|
23
|
+
*/
|
|
24
|
+
declare function Var({ children, }: {
|
|
25
|
+
children?: any;
|
|
26
|
+
name?: string;
|
|
27
|
+
}): React.JSX.Element | null;
|
|
28
|
+
declare namespace Var {
|
|
29
|
+
var _gtt: string;
|
|
30
|
+
}
|
|
31
|
+
export default Var;
|
|
32
|
+
//# sourceMappingURL=Var.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,GAAG,CAAC,EACX,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAE3B;kBAPQ,GAAG;;;AAYZ,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GTTag, VariableProps } from '../types-dir/types';
|
|
2
|
+
type VariableElementProps = {
|
|
3
|
+
'data-_gt': GTTag & {
|
|
4
|
+
transformation: 'variable';
|
|
5
|
+
};
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare function isVariableElementProps(props: unknown): props is VariableElementProps;
|
|
9
|
+
export default function getVariableProps(props: VariableElementProps): VariableProps;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=_getVariableProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_getVariableProps.d.ts","sourceRoot":"","sources":["../../src/variables/_getVariableProps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI1D,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,KAAK,GAAG;QAClB,cAAc,EAAE,UAAU,CAAC;KAC5B,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAU/B;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,KAAK,EAAE,oBAAoB,GAC1B,aAAa,CA6Bf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const defaultVariableNames: {
|
|
2
|
+
readonly variable: "value";
|
|
3
|
+
readonly number: "n";
|
|
4
|
+
readonly datetime: "date";
|
|
5
|
+
readonly currency: "cost";
|
|
6
|
+
};
|
|
7
|
+
export declare const baseVariablePrefix = "_gt_";
|
|
8
|
+
export default function getVariableName(props: Record<string, any> | undefined, variableType: keyof typeof defaultVariableNames): string;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=getVariableName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVariableName.d.ts","sourceRoot":"","sources":["../../src/variables/getVariableName.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,oBAAoB;;;;;CAKhB,CAAC;AAEX,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EAC/B,YAAY,EAAE,MAAM,OAAO,oBAAoB,GAC9C,MAAM,CAIR"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,119 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@generaltranslation/react-core",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "A pure React library for
|
|
5
|
-
"main": "index.
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "A pure React library for internationalization",
|
|
5
|
+
"main": "./dist/index.cjs.min.cjs",
|
|
6
|
+
"module": "./dist/index.esm.min.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CHANGELOG.md"
|
|
11
|
+
],
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": ">=16.8.0"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"generaltranslation": "7.6.5",
|
|
17
|
+
"@generaltranslation/supported-locales": "2.0.15"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/generaltranslation/gt.git"
|
|
22
|
+
},
|
|
8
23
|
"author": "General Translation, Inc.",
|
|
9
24
|
"license": "FSL-1.1-ALv2",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/generaltranslation/gt/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://generaltranslation.com/",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@babel/preset-react": "^7.26.3",
|
|
31
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
32
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
33
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
35
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
36
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
37
|
+
"@types/node": "^24.8.0",
|
|
38
|
+
"@types/react": ">=18.0.0 <20.0.0",
|
|
39
|
+
"rollup": "^4.32.1",
|
|
40
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
41
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
42
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
43
|
+
"rollup-preserve-directives": "^1.1.3",
|
|
44
|
+
"tslib": "^2.8.1",
|
|
45
|
+
"typescript": "^5.7.3"
|
|
46
|
+
},
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/index.d.ts",
|
|
50
|
+
"require": "./dist/index.cjs.min.cjs",
|
|
51
|
+
"import": "./dist/index.esm.min.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./internal": {
|
|
54
|
+
"types": "./dist/internal.d.ts",
|
|
55
|
+
"require": "./dist/internal.cjs.min.cjs",
|
|
56
|
+
"import": "./dist/internal.esm.min.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./errors": {
|
|
59
|
+
"types": "./dist/errors.d.ts",
|
|
60
|
+
"require": "./dist/errors.cjs.min.cjs",
|
|
61
|
+
"import": "./dist/errors.esm.min.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./types": {
|
|
64
|
+
"types": "./dist/types.d.ts"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"typesVersions": {
|
|
68
|
+
"*": {
|
|
69
|
+
"types": [
|
|
70
|
+
"./dist/types.d.ts"
|
|
71
|
+
],
|
|
72
|
+
"internal": [
|
|
73
|
+
"./dist/internal.d.ts"
|
|
74
|
+
],
|
|
75
|
+
"errors": [
|
|
76
|
+
"./dist/errors.d.ts"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"compilerOptions": {
|
|
81
|
+
"baseUrl": ".",
|
|
82
|
+
"paths": {
|
|
83
|
+
"@generaltranslation/react-core/client": [
|
|
84
|
+
"./dist/client"
|
|
85
|
+
],
|
|
86
|
+
"@generaltranslation/react-core/internal": [
|
|
87
|
+
"./dist/internal"
|
|
88
|
+
],
|
|
89
|
+
"@generaltranslation/react-core/types": [
|
|
90
|
+
"./dist/types.d.ts"
|
|
91
|
+
],
|
|
92
|
+
"@generaltranslation/react-core/errors": [
|
|
93
|
+
"./dist/errors.d.ts"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
10
97
|
"keywords": [
|
|
11
98
|
"react",
|
|
12
99
|
"translation",
|
|
13
|
-
"
|
|
100
|
+
"internationalization",
|
|
14
101
|
"localization",
|
|
15
|
-
"
|
|
102
|
+
"i18n"
|
|
16
103
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
104
|
+
"scripts": {
|
|
105
|
+
"patch": "pnpm version patch",
|
|
106
|
+
"transpile": "tsc",
|
|
107
|
+
"build": "rollup -c",
|
|
108
|
+
"build:clean": "sh ../../scripts/clean.sh && pnpm run build",
|
|
109
|
+
"build:release": "pnpm run build:clean",
|
|
110
|
+
"release": "pnpm run build:clean && pnpm publish",
|
|
111
|
+
"release:alpha": "pnpm run build:clean && pnpm publish --tag alpha",
|
|
112
|
+
"release:beta": "pnpm run build:clean && pnpm publish --tag beta",
|
|
113
|
+
"release:latest": "pnpm run build:clean && pnpm publish --tag latest",
|
|
114
|
+
"lint": "eslint \"src/**/*.{js,ts,tsx}\" \"__tests__/**/*.{js,ts,tsx}\"",
|
|
115
|
+
"lint:fix": "eslint \"src/**/*.{js,ts,tsx}\" \"__tests__/**/*.{js,ts,tsx}\" --fix",
|
|
116
|
+
"test": "vitest run",
|
|
117
|
+
"test:watch": "vitest"
|
|
23
118
|
}
|
|
24
|
-
}
|
|
119
|
+
}
|
package/index.d.ts
DELETED