gt-react 9.2.12 → 9.2.14-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs.min.cjs +3 -3
- package/dist/client.d.ts +16 -11
- package/dist/client.esm.min.mjs +3 -3
- package/dist/hooks/internal/useCreateInternalUseDictFunction.d.ts.map +1 -1
- package/dist/hooks/internal/useCreateInternalUseGTFunction.d.ts.map +1 -1
- package/dist/hooks/internal/useRuntimeTranslation.d.ts +1 -0
- package/dist/hooks/internal/useRuntimeTranslation.d.ts.map +1 -1
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.esm.min.mjs +3 -3
- package/dist/internal.cjs.min.cjs +1 -1
- package/dist/internal.esm.min.mjs +1 -1
- package/dist/provider/ClientProvider.d.ts +1 -1
- package/dist/provider/ClientProvider.d.ts.map +1 -1
- package/dist/provider/GTProvider.d.ts +3 -2
- package/dist/provider/GTProvider.d.ts.map +1 -1
- package/dist/provider/helpers/isSSREnabled.d.ts +2 -0
- package/dist/provider/helpers/isSSREnabled.d.ts.map +1 -0
- package/dist/provider/rendering/renderVariable.d.ts.map +1 -1
- package/dist/translation/inline/T.d.ts +3 -3
- package/dist/variables/Currency.d.ts +2 -1
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/DateTime.d.ts +2 -1
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/Num.d.ts +2 -1
- package/dist/variables/Num.d.ts.map +1 -1
- package/dist/variables/Var.d.ts +2 -1
- package/dist/variables/Var.d.ts.map +1 -1
- package/dist/variables/getVariableName.d.ts.map +1 -1
- package/package.json +3 -3
- package/rollup.base.config.mjs +2 -2
package/dist/client.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as React
|
1
|
+
import * as React from 'react';
|
2
2
|
import React__default from 'react';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
|
@@ -131,7 +131,7 @@ type ClientProviderProps = {
|
|
131
131
|
gtServicesEnabled?: boolean;
|
132
132
|
};
|
133
133
|
|
134
|
-
declare const GTContext: React
|
134
|
+
declare const GTContext: React.Context<GTContextType | undefined>;
|
135
135
|
|
136
136
|
declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId, defaultLocale, runtimeUrl, renderSettings, setTranslations, runtimeTranslationEnabled, ...globalMetadata }: {
|
137
137
|
projectId?: string;
|
@@ -154,7 +154,7 @@ declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId
|
|
154
154
|
|
155
155
|
declare const renderVariable: RenderVariable;
|
156
156
|
|
157
|
-
declare function ClientProvider({ children, dictionary, initialTranslations, dictionaryTranslations, locale: _locale, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales, renderSettings, projectId, devApiKey, runtimeUrl, runtimeTranslationEnabled, onLocaleChange, cookieName, }: ClientProviderProps):
|
157
|
+
declare function ClientProvider({ children, dictionary, initialTranslations, dictionaryTranslations, locale: _locale, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales, renderSettings, projectId, devApiKey, runtimeUrl, runtimeTranslationEnabled, onLocaleChange, cookieName, }: ClientProviderProps): React.JSX.Element;
|
158
158
|
|
159
159
|
/**
|
160
160
|
* The `<Branch>` component dynamically renders a specified branch of content or a fallback child component.
|
@@ -292,7 +292,7 @@ declare function useLocale(): string;
|
|
292
292
|
* ```jsx
|
293
293
|
* // Basic usage:
|
294
294
|
* <T id="welcome_message">
|
295
|
-
* Hello, <Var
|
295
|
+
* Hello, <Var>{name}</Var>!
|
296
296
|
* </T>
|
297
297
|
* ```
|
298
298
|
*
|
@@ -300,8 +300,8 @@ declare function useLocale(): string;
|
|
300
300
|
* ```jsx
|
301
301
|
* // Translating a plural
|
302
302
|
* <T id="item_count">
|
303
|
-
* <Plural n={3} singular={<>You have <Num
|
304
|
-
* You have <Num
|
303
|
+
* <Plural n={3} singular={<>You have <Num children={n}/> item.</>}>
|
304
|
+
* You have <Num children={n}/> items.
|
305
305
|
* </Plural>
|
306
306
|
* </T>
|
307
307
|
* ```
|
@@ -341,9 +341,10 @@ declare namespace T {
|
|
341
341
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
342
342
|
* @returns {JSX.Element} The formatted currency component.
|
343
343
|
*/
|
344
|
-
declare function Currency({ children, currency, locales, options, }: {
|
344
|
+
declare function Currency({ children, currency, name, locales, options, }: {
|
345
345
|
children?: any;
|
346
346
|
currency?: string;
|
347
|
+
name?: string;
|
347
348
|
locales?: string[];
|
348
349
|
options?: Intl.NumberFormatOptions;
|
349
350
|
}): React__default.JSX.Element;
|
@@ -368,9 +369,10 @@ declare namespace Currency {
|
|
368
369
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
369
370
|
* @returns {JSX.Element} The formatted date or time component.
|
370
371
|
*/
|
371
|
-
declare function DateTime({ children, locales, options, }: {
|
372
|
+
declare function DateTime({ children, locales, name, options, }: {
|
372
373
|
children?: any;
|
373
374
|
locales?: string[];
|
375
|
+
name?: string;
|
374
376
|
options?: Intl.DateTimeFormatOptions;
|
375
377
|
}): React__default.JSX.Element;
|
376
378
|
declare namespace DateTime {
|
@@ -395,10 +397,11 @@ declare namespace DateTime {
|
|
395
397
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
396
398
|
* @returns {JSX.Element} The formatted number component.
|
397
399
|
*/
|
398
|
-
declare function Num({ children, locales, options, }: {
|
400
|
+
declare function Num({ children, name, locales, options, }: {
|
399
401
|
children?: any;
|
400
402
|
locales?: string[];
|
401
403
|
options?: Intl.NumberFormatOptions;
|
404
|
+
name?: string;
|
402
405
|
}): React__default.JSX.Element;
|
403
406
|
declare namespace Num {
|
404
407
|
var gtTransformation: string;
|
@@ -426,8 +429,9 @@ declare namespace Num {
|
|
426
429
|
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
427
430
|
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
428
431
|
*/
|
429
|
-
declare function Var({ children }: {
|
432
|
+
declare function Var({ children, name, }: {
|
430
433
|
children?: any;
|
434
|
+
name?: string;
|
431
435
|
}): React__default.JSX.Element;
|
432
436
|
declare namespace Var {
|
433
437
|
var gtTransformation: string;
|
@@ -462,7 +466,7 @@ declare function LocaleSelector({ locales: _locales, ...props }: {
|
|
462
466
|
*
|
463
467
|
* @returns {JSX.Element} The provider component for General Translation context.
|
464
468
|
*/
|
465
|
-
declare function GTProvider({ children, projectId: _projectId, devApiKey: _devApiKey, dictionary: _dictionary, locales, defaultLocale, locale: _locale, cacheUrl, runtimeUrl, renderSettings, loadDictionary, loadTranslations, fallback, _versionId, ...metadata }: {
|
469
|
+
declare function GTProvider({ children, projectId: _projectId, devApiKey: _devApiKey, dictionary: _dictionary, locales, defaultLocale, locale: _locale, cacheUrl, runtimeUrl, renderSettings, loadDictionary, loadTranslations, fallback, ssr, _versionId, ...metadata }: {
|
466
470
|
children?: React__default.ReactNode;
|
467
471
|
projectId?: string;
|
468
472
|
devApiKey?: string;
|
@@ -479,6 +483,7 @@ declare function GTProvider({ children, projectId: _projectId, devApiKey: _devAp
|
|
479
483
|
loadDictionary?: CustomLoader;
|
480
484
|
loadTranslations?: CustomLoader;
|
481
485
|
_versionId?: string;
|
486
|
+
ssr?: boolean;
|
482
487
|
[key: string]: any;
|
483
488
|
}): React__default.JSX.Element;
|
484
489
|
|