gt-react-native 0.0.1-alpha.9 → 0.0.2-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/README.md +34 -11
- package/lib/commonjs/NativeGtReactNative.js +9 -0
- package/lib/commonjs/NativeGtReactNative.js.map +1 -0
- package/lib/commonjs/errors-dir/constants.js +8 -0
- package/lib/commonjs/errors-dir/constants.js.map +1 -0
- package/lib/commonjs/errors-dir/errors.js +10 -0
- package/lib/commonjs/errors-dir/errors.js.map +1 -0
- package/lib/commonjs/errors-dir/warnings.js +18 -0
- package/lib/commonjs/errors-dir/warnings.js.map +1 -0
- package/lib/commonjs/index.js +158 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal.js +13 -0
- package/lib/commonjs/internal.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/plugin-dir/index.js +54 -0
- package/lib/commonjs/plugin-dir/index.js.map +1 -0
- package/lib/commonjs/plugin-dir/types.js +2 -0
- package/lib/commonjs/plugin-dir/types.js.map +1 -0
- package/lib/commonjs/plugin-dir/utils/resolveLocales.js +74 -0
- package/lib/commonjs/plugin-dir/utils/resolveLocales.js.map +1 -0
- package/lib/commonjs/plugin.js +14 -0
- package/lib/commonjs/plugin.js.map +1 -0
- package/lib/commonjs/provider/GTProvider.js +24 -0
- package/lib/commonjs/provider/GTProvider.js.map +1 -0
- package/lib/commonjs/provider/hooks/locale/useDetermineLocale.js +146 -0
- package/lib/commonjs/provider/hooks/locale/useDetermineLocale.js.map +1 -0
- package/lib/commonjs/provider/hooks/useRegionState.js +47 -0
- package/lib/commonjs/provider/hooks/useRegionState.js.map +1 -0
- package/lib/commonjs/tools/testLocalePolyfill.js +68 -0
- package/lib/commonjs/tools/testLocalePolyfill.js.map +1 -0
- package/lib/commonjs/types/config.js +6 -0
- package/lib/commonjs/types/config.js.map +1 -0
- package/lib/commonjs/utils/getNativeLocales.js +58 -0
- package/lib/commonjs/utils/getNativeLocales.js.map +1 -0
- package/lib/commonjs/utils/nativeStore.js +39 -0
- package/lib/commonjs/utils/nativeStore.js.map +1 -0
- package/lib/commonjs/utils/utils.js +17 -0
- package/lib/commonjs/utils/utils.js.map +1 -0
- package/lib/module/errors-dir/constants.js +1 -1
- package/lib/module/errors-dir/constants.js.map +1 -1
- package/lib/module/errors-dir/errors.js +5 -0
- package/lib/module/errors-dir/errors.js.map +1 -0
- package/lib/module/errors-dir/warnings.js +12 -0
- package/lib/module/errors-dir/warnings.js.map +1 -0
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +4 -0
- package/lib/module/internal.js.map +1 -0
- package/lib/module/plugin-dir/index.js +49 -0
- package/lib/module/plugin-dir/index.js.map +1 -0
- package/lib/module/plugin-dir/types.js +2 -0
- package/lib/module/plugin-dir/types.js.map +1 -0
- package/lib/module/plugin-dir/utils/resolveLocales.js +69 -0
- package/lib/module/plugin-dir/utils/resolveLocales.js.map +1 -0
- package/lib/module/plugin.js +4 -0
- package/lib/module/plugin.js.map +1 -0
- package/lib/module/tools/testLocalePolyfill.js +64 -0
- package/lib/module/tools/testLocalePolyfill.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeGtReactNative.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors-dir/constants.d.ts +2 -0
- package/lib/typescript/commonjs/src/errors-dir/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors-dir/errors.d.ts +2 -0
- package/lib/typescript/commonjs/src/errors-dir/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors-dir/warnings.d.ts +4 -0
- package/lib/typescript/commonjs/src/errors-dir/warnings.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internal.d.ts +2 -0
- package/lib/typescript/commonjs/src/internal.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin-dir/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/plugin-dir/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin-dir/types.d.ts +10 -0
- package/lib/typescript/commonjs/src/plugin-dir/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin-dir/utils/resolveLocales.d.ts +13 -0
- package/lib/typescript/commonjs/src/plugin-dir/utils/resolveLocales.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin.d.ts +2 -0
- package/lib/typescript/commonjs/src/plugin.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/provider/GTProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/provider/hooks/locale/useDetermineLocale.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/provider/hooks/useRegionState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/tools/testLocalePolyfill.d.ts +12 -0
- package/lib/typescript/commonjs/src/tools/testLocalePolyfill.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/getNativeLocales.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/nativeStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/vitest.config.d.ts +3 -0
- package/lib/typescript/commonjs/vitest.config.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeGtReactNative.d.ts +10 -0
- package/lib/typescript/module/src/NativeGtReactNative.d.ts.map +1 -0
- package/lib/typescript/module/src/errors-dir/constants.d.ts +2 -0
- package/lib/typescript/module/src/errors-dir/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/errors-dir/errors.d.ts +2 -0
- package/lib/typescript/module/src/errors-dir/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/errors-dir/warnings.d.ts +4 -0
- package/lib/typescript/module/src/errors-dir/warnings.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/internal.d.ts +2 -0
- package/lib/typescript/module/src/internal.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin-dir/index.d.ts +6 -0
- package/lib/typescript/module/src/plugin-dir/index.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin-dir/types.d.ts +10 -0
- package/lib/typescript/module/src/plugin-dir/types.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts +13 -0
- package/lib/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin.d.ts +2 -0
- package/lib/typescript/module/src/plugin.d.ts.map +1 -0
- package/lib/typescript/module/src/provider/GTProvider.d.ts +4 -0
- package/lib/typescript/module/src/provider/GTProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts +4 -0
- package/lib/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts.map +1 -0
- package/lib/typescript/module/src/provider/hooks/useRegionState.d.ts +3 -0
- package/lib/typescript/module/src/provider/hooks/useRegionState.d.ts.map +1 -0
- package/lib/typescript/module/src/tools/testLocalePolyfill.d.ts +12 -0
- package/lib/typescript/module/src/tools/testLocalePolyfill.d.ts.map +1 -0
- package/lib/typescript/module/src/types/config.d.ts +30 -0
- package/lib/typescript/module/src/types/config.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/getNativeLocales.d.ts +10 -0
- package/lib/typescript/module/src/utils/getNativeLocales.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/nativeStore.d.ts +16 -0
- package/lib/typescript/module/src/utils/nativeStore.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/utils.d.ts +3 -0
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -0
- package/lib/typescript/module/vitest.config.d.ts +3 -0
- package/lib/typescript/module/vitest.config.d.ts.map +1 -0
- package/package.json +48 -17
- package/src/errors-dir/constants.ts +1 -1
- package/src/errors-dir/errors.ts +3 -0
- package/src/errors-dir/warnings.ts +14 -0
- package/src/index.tsx +0 -2
- package/src/internal.ts +1 -0
- package/src/plugin-dir/index.ts +80 -0
- package/src/plugin-dir/types.ts +10 -0
- package/src/plugin-dir/utils/resolveLocales.ts +95 -0
- package/src/plugin.ts +1 -0
- package/src/tools/testLocalePolyfill.ts +82 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeGtReactNativeSpec.java +0 -51
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/app/build/generated/source/codegen/jni/GtReactNativeSpec-generated.cpp +0 -50
- package/android/app/build/generated/source/codegen/jni/GtReactNativeSpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI-generated.cpp +0 -51
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI.h +0 -98
- package/lib/module/utils/polyfill.js +0 -39
- package/lib/module/utils/polyfill.js.map +0 -1
- package/lib/typescript/src/NativeGtReactNative.d.ts.map +0 -1
- package/lib/typescript/src/errors-dir/constants.d.ts +0 -2
- package/lib/typescript/src/errors-dir/constants.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/provider/GTProvider.d.ts.map +0 -1
- package/lib/typescript/src/provider/hooks/locale/useDetermineLocale.d.ts.map +0 -1
- package/lib/typescript/src/provider/hooks/useRegionState.d.ts.map +0 -1
- package/lib/typescript/src/types/config.d.ts.map +0 -1
- package/lib/typescript/src/utils/getNativeLocales.d.ts.map +0 -1
- package/lib/typescript/src/utils/nativeStore.d.ts.map +0 -1
- package/lib/typescript/src/utils/polyfill.d.ts +0 -29
- package/lib/typescript/src/utils/polyfill.d.ts.map +0 -1
- package/lib/typescript/src/utils/utils.d.ts.map +0 -1
- package/src/utils/polyfill.ts +0 -51
- /package/lib/typescript/{src → commonjs/src}/NativeGtReactNative.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/provider/GTProvider.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/provider/hooks/locale/useDetermineLocale.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/provider/hooks/useRegionState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/types/config.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/utils/getNativeLocales.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/utils/nativeStore.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/utils/utils.d.ts +0 -0
- /package/lib/typescript/{package.json → module/package.json} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { polyfillLocales } from './utils/polyfill';
|
|
2
1
|
import { GTProvider } from './provider/GTProvider';
|
|
3
2
|
export declare function multiply(a: number, b: number): number;
|
|
4
3
|
import { T, useGT, useTranslations, useDefaultLocale, useLocale, useRegion, Var, Num, Currency, DateTime, Plural, Branch, useLocales, useLocaleSelector, useSetLocale, useGTClass, useLocaleProperties, useRegionSelector, useLocaleDirection, useMessages, msg, decodeMsg, decodeOptions } from '@generaltranslation/react-core';
|
|
5
4
|
import type { DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions } from '@generaltranslation/react-core/types';
|
|
6
|
-
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, type DictionaryTranslationOptions, type InlineTranslationOptions, type RuntimeTranslationOptions, msg, decodeMsg, decodeOptions, useMessages,
|
|
5
|
+
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, type DictionaryTranslationOptions, type InlineTranslationOptions, type RuntimeTranslationOptions, msg, decodeMsg, decodeOptions, useMessages, };
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,OAAO,EACL,CAAC,EACD,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,GAAG,EACH,SAAS,EACT,aAAa,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,CAAC,EACD,UAAU,EACV,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,GAAG,EACH,SAAS,EACT,aAAa,EACb,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PluginObj, types } from '@babel/core';
|
|
2
|
+
import type { PluginOptions } from './types';
|
|
3
|
+
export default function (babel: {
|
|
4
|
+
types: typeof types;
|
|
5
|
+
}, { locales, config, configFilePath, entryPointFilePath, }: PluginOptions): PluginObj;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,MAAM,CAAC,OAAO,WACZ,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EAC9B,EACE,OAAO,EACP,MAAM,EACN,cAAc,EACd,kBAAkE,GACnE,EAAE,aAAa,GACf,SAAS,CAkEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAE5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5E,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a list of locales or a config object or a path to a config file, return a list of locales to polyfill.
|
|
3
|
+
* Preference order: locales > config > configFilePaths > library default locale
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveLocales({ locales, config, configFilePath, }: {
|
|
6
|
+
locales?: string[];
|
|
7
|
+
config?: {
|
|
8
|
+
defaultLocale: string;
|
|
9
|
+
locales: string[];
|
|
10
|
+
} & Record<string, any>;
|
|
11
|
+
configFilePath?: string;
|
|
12
|
+
}): string[];
|
|
13
|
+
//# sourceMappingURL=resolveLocales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocales.d.ts","sourceRoot":"","sources":["../../../../../../src/plugin-dir/utils/resolveLocales.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,cAAc,GACf,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,EAAE,CA0BX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAKvD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAWpE;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDetermineLocale.d.ts","sourceRoot":"","sources":["../../../../../../../src/provider/hooks/locale/useDetermineLocale.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,OAAY,EACpB,aAAoC,EACpC,OAAY,EACZ,gBAA8C,EAC9C,GAAW,EAAE,eAAe;AAC5B,aAAa,GACd,EAAE,wBAAwB,GAAG,wBAAwB,CA2DrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegionState.d.ts","sourceRoot":"","sources":["../../../../../../src/provider/hooks/useRegionState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sCAAsC,CAAC;AAsB9C,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,GAAG,EACH,gBAAgB,GACjB,EAAE,oBAAoB,GAAG,oBAAoB,CAoB7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function testLocalePolyfill(locale?: string): {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
problems: string[];
|
|
4
|
+
group: string | undefined;
|
|
5
|
+
decimal: string | undefined;
|
|
6
|
+
example: {
|
|
7
|
+
number: string;
|
|
8
|
+
date: string;
|
|
9
|
+
weekday: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=testLocalePolyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testLocalePolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/tools/testLocalePolyfill.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,MAAM,SAAU;;;;;;;;;;EAiFlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,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,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNativeLocales.d.ts","sourceRoot":"","sources":["../../../../../src/utils/getNativeLocales.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAa3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeStore.d.ts","sourceRoot":"","sources":["../../../../../src/utils/nativeStore.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAM5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAkBG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
multiply(a: number, b: number): number;
|
|
4
|
+
getNativeLocales(): string[];
|
|
5
|
+
nativeStoreGet(key: string): string | null;
|
|
6
|
+
nativeStoreSet(key: string, value: string): void;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: Spec;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=NativeGtReactNative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeGtReactNative.d.ts","sourceRoot":"","sources":["../../../../src/NativeGtReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,gBAAgB,IAAI,MAAM,EAAE,CAAC;IAC7B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3C,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD;;AAED,wBAAuE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/errors-dir/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/errors-dir/errors.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,WACO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../../../src/errors-dir/warnings.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B,QAIO,CAAC;AAEhD,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,WACG,CAAC;AAEhE,eAAO,MAAM,qBAAqB,GAAI,gBAAgB,MAAM,EAAE,WACwB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GTProvider } from './provider/GTProvider';
|
|
2
|
+
export declare function multiply(a: number, b: number): number;
|
|
3
|
+
import { T, useGT, useTranslations, useDefaultLocale, useLocale, useRegion, Var, Num, Currency, DateTime, Plural, Branch, useLocales, useLocaleSelector, useSetLocale, useGTClass, useLocaleProperties, useRegionSelector, useLocaleDirection, useMessages, msg, decodeMsg, decodeOptions } from '@generaltranslation/react-core';
|
|
4
|
+
import type { DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions } from '@generaltranslation/react-core/types';
|
|
5
|
+
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, type DictionaryTranslationOptions, type InlineTranslationOptions, type RuntimeTranslationOptions, msg, decodeMsg, decodeOptions, useMessages, };
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,OAAO,EACL,CAAC,EACD,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,GAAG,EACH,SAAS,EACT,aAAa,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,CAAC,EACD,UAAU,EACV,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,GAAG,EACH,SAAS,EACT,aAAa,EACb,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PluginObj, types } from '@babel/core';
|
|
2
|
+
import type { PluginOptions } from './types';
|
|
3
|
+
export default function (babel: {
|
|
4
|
+
types: typeof types;
|
|
5
|
+
}, { locales, config, configFilePath, entryPointFilePath, }: PluginOptions): PluginObj;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,MAAM,CAAC,OAAO,WACZ,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EAC9B,EACE,OAAO,EACP,MAAM,EACN,cAAc,EACd,kBAAkE,GACnE,EAAE,aAAa,GACf,SAAS,CAkEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAE5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5E,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a list of locales or a config object or a path to a config file, return a list of locales to polyfill.
|
|
3
|
+
* Preference order: locales > config > configFilePaths > library default locale
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveLocales({ locales, config, configFilePath, }: {
|
|
6
|
+
locales?: string[];
|
|
7
|
+
config?: {
|
|
8
|
+
defaultLocale: string;
|
|
9
|
+
locales: string[];
|
|
10
|
+
} & Record<string, any>;
|
|
11
|
+
configFilePath?: string;
|
|
12
|
+
}): string[];
|
|
13
|
+
//# sourceMappingURL=resolveLocales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocales.d.ts","sourceRoot":"","sources":["../../../../../../src/plugin-dir/utils/resolveLocales.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,cAAc,GACf,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,EAAE,CA0BX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAKvD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAWpE;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UseDetermineLocaleParams, UseDetermineLocaleReturn } from '@generaltranslation/react-core/types';
|
|
2
|
+
export declare function useDetermineLocale({ locale: _locale, defaultLocale, locales, localeCookieName, ssr, // not relevant
|
|
3
|
+
customMapping, }: UseDetermineLocaleParams): UseDetermineLocaleReturn;
|
|
4
|
+
//# sourceMappingURL=useDetermineLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDetermineLocale.d.ts","sourceRoot":"","sources":["../../../../../../../src/provider/hooks/locale/useDetermineLocale.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,OAAY,EACpB,aAAoC,EACpC,OAAY,EACZ,gBAA8C,EAC9C,GAAW,EAAE,eAAe;AAC5B,aAAa,GACd,EAAE,wBAAwB,GAAG,wBAAwB,CA2DrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegionState.d.ts","sourceRoot":"","sources":["../../../../../../src/provider/hooks/useRegionState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sCAAsC,CAAC;AAsB9C,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,GAAG,EACH,gBAAgB,GACjB,EAAE,oBAAoB,GAAG,oBAAoB,CAoB7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function testLocalePolyfill(locale?: string): {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
problems: string[];
|
|
4
|
+
group: string | undefined;
|
|
5
|
+
decimal: string | undefined;
|
|
6
|
+
example: {
|
|
7
|
+
number: string;
|
|
8
|
+
date: string;
|
|
9
|
+
weekday: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=testLocalePolyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testLocalePolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/tools/testLocalePolyfill.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,MAAM,SAAU;;;;;;;;;;EAiFlD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RenderMethod, Translations, CustomLoader, GTConfig } from '@generaltranslation/react-core/types';
|
|
2
|
+
import type { CustomMapping } from 'generaltranslation/types';
|
|
3
|
+
export type GTProviderProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
devApiKey?: string;
|
|
7
|
+
dictionary?: any;
|
|
8
|
+
locales?: string[];
|
|
9
|
+
defaultLocale?: string;
|
|
10
|
+
locale?: string;
|
|
11
|
+
region?: string;
|
|
12
|
+
cacheUrl?: string;
|
|
13
|
+
runtimeUrl?: string;
|
|
14
|
+
renderSettings?: {
|
|
15
|
+
method: RenderMethod;
|
|
16
|
+
timeout?: number;
|
|
17
|
+
};
|
|
18
|
+
_versionId?: string;
|
|
19
|
+
ssr?: boolean;
|
|
20
|
+
localeCookieName?: string;
|
|
21
|
+
translations?: Translations | null;
|
|
22
|
+
loadDictionary?: CustomLoader;
|
|
23
|
+
loadTranslations?: CustomLoader;
|
|
24
|
+
config?: GTConfig;
|
|
25
|
+
fallback?: React.ReactNode;
|
|
26
|
+
customMapping?: CustomMapping;
|
|
27
|
+
modelProvider?: string;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,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,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get native device locales in preference order
|
|
3
|
+
* Returns an empty array if detection fails or is not supported
|
|
4
|
+
*
|
|
5
|
+
* iOS: Returns current locale first, followed by preferred languages
|
|
6
|
+
* Android: Returns user's preferred language list (LocaleList on API 24+, single locale on older versions)
|
|
7
|
+
* Web: Returns browser language preferences from navigator
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNativeLocales(): string[];
|
|
10
|
+
//# sourceMappingURL=getNativeLocales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNativeLocales.d.ts","sourceRoot":"","sources":["../../../../../src/utils/getNativeLocales.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAa3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native store interface, used to replace cookie behavior from gt-react
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get a value from the native store
|
|
6
|
+
* @param key - The key to get the value for
|
|
7
|
+
* @returns The value for the key
|
|
8
|
+
*/
|
|
9
|
+
export declare function nativeStoreGet(key: string): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Set a value in the native store
|
|
12
|
+
* @param key - The key to set the value for
|
|
13
|
+
* @param value - The value to set
|
|
14
|
+
*/
|
|
15
|
+
export declare function nativeStoreSet(key: string, value: string): void;
|
|
16
|
+
//# sourceMappingURL=nativeStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeStore.d.ts","sourceRoot":"","sources":["../../../../../src/utils/nativeStore.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAM5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAkBG"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-alpha.0",
|
|
4
4
|
"description": "An i18n package for React Native",
|
|
5
|
-
"main": "./lib/
|
|
6
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
5
|
+
"main": "./lib/commonjs/index.js",
|
|
6
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"source": "./src/index.tsx",
|
|
10
|
-
"
|
|
11
|
-
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
},
|
|
18
|
+
"default": "./lib/commonjs/index.js"
|
|
12
19
|
},
|
|
13
|
-
"./
|
|
20
|
+
"./plugin": {
|
|
21
|
+
"source": "./src/plugin.ts",
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./lib/typescript/module/src/plugin.d.ts",
|
|
24
|
+
"default": "./lib/module/plugin.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./lib/typescript/commonjs/src/plugin.d.ts",
|
|
28
|
+
"default": "./lib/commonjs/plugin.js"
|
|
29
|
+
},
|
|
30
|
+
"default": "./lib/commonjs/plugin.js"
|
|
31
|
+
},
|
|
32
|
+
"./internal": {
|
|
33
|
+
"source": "./src/internal.ts",
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./lib/typescript/module/src/internal.d.ts",
|
|
36
|
+
"default": "./lib/module/internal.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./lib/typescript/commonjs/src/internal.d.ts",
|
|
40
|
+
"default": "./lib/commonjs/internal.js"
|
|
41
|
+
},
|
|
42
|
+
"default": "./lib/commonjs/internal.js"
|
|
43
|
+
}
|
|
14
44
|
},
|
|
15
45
|
"files": [
|
|
16
46
|
"src",
|
|
@@ -18,6 +48,7 @@
|
|
|
18
48
|
"android",
|
|
19
49
|
"ios",
|
|
20
50
|
"cpp",
|
|
51
|
+
"package.json",
|
|
21
52
|
"*.podspec",
|
|
22
53
|
"!ios/build",
|
|
23
54
|
"!android/build",
|
|
@@ -32,7 +63,8 @@
|
|
|
32
63
|
],
|
|
33
64
|
"scripts": {
|
|
34
65
|
"example": "yarn workspace gt-react-native-example",
|
|
35
|
-
"test": "
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:watch": "vitest",
|
|
36
68
|
"typecheck": "tsc",
|
|
37
69
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
38
70
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
@@ -59,6 +91,8 @@
|
|
|
59
91
|
"registry": "https://registry.npmjs.org/"
|
|
60
92
|
},
|
|
61
93
|
"devDependencies": {
|
|
94
|
+
"@babel/core": "^7.28.4",
|
|
95
|
+
"@babel/types": "^7.28.4",
|
|
62
96
|
"@commitlint/config-conventional": "^19.8.1",
|
|
63
97
|
"@eslint/compat": "^1.3.2",
|
|
64
98
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -68,20 +102,21 @@
|
|
|
68
102
|
"@react-native/babel-preset": "0.81.1",
|
|
69
103
|
"@react-native/eslint-config": "^0.81.1",
|
|
70
104
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
71
|
-
"@types/jest": "^29.5.14",
|
|
72
105
|
"@types/react": "^19.1.0",
|
|
106
|
+
"@vitest/coverage-v8": "^1.0.4",
|
|
107
|
+
"@vitest/ui": "^1.0.4",
|
|
73
108
|
"commitlint": "^19.8.1",
|
|
74
109
|
"del-cli": "^6.0.0",
|
|
75
110
|
"eslint": "^9.35.0",
|
|
76
111
|
"eslint-config-prettier": "^10.1.8",
|
|
77
112
|
"eslint-plugin-prettier": "^5.5.4",
|
|
78
|
-
"jest": "^29.7.0",
|
|
79
113
|
"prettier": "^3.6.2",
|
|
80
114
|
"react": "19.1.0",
|
|
81
115
|
"react-native": "0.81.1",
|
|
82
116
|
"react-native-builder-bob": "^0.40.13",
|
|
83
117
|
"turbo": "^2.5.6",
|
|
84
|
-
"typescript": "^5.9.2"
|
|
118
|
+
"typescript": "^5.9.2",
|
|
119
|
+
"vitest": "^1.0.4"
|
|
85
120
|
},
|
|
86
121
|
"dependencies": {
|
|
87
122
|
"@formatjs/intl-datetimeformat": "^6.18.2",
|
|
@@ -104,13 +139,6 @@
|
|
|
104
139
|
"example"
|
|
105
140
|
],
|
|
106
141
|
"packageManager": "yarn@3.6.1",
|
|
107
|
-
"jest": {
|
|
108
|
-
"preset": "react-native",
|
|
109
|
-
"modulePathIgnorePatterns": [
|
|
110
|
-
"<rootDir>/example/node_modules",
|
|
111
|
-
"<rootDir>/lib/"
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
142
|
"commitlint": {
|
|
115
143
|
"extends": [
|
|
116
144
|
"@commitlint/config-conventional"
|
|
@@ -133,6 +161,9 @@
|
|
|
133
161
|
"esm": true
|
|
134
162
|
}
|
|
135
163
|
],
|
|
164
|
+
[
|
|
165
|
+
"commonjs"
|
|
166
|
+
],
|
|
136
167
|
[
|
|
137
168
|
"typescript",
|
|
138
169
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_NAME = 'gt-react';
|
|
1
|
+
export const PACKAGE_NAME = 'gt-react-native';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { libraryDefaultLocale } from 'generaltranslation/internal';
|
|
2
|
+
import { PACKAGE_NAME } from './constants';
|
|
3
|
+
|
|
4
|
+
export const resolveLocalesFailedWarning = `${PACKAGE_NAME}: Failed to resolve locales for polyfill. Falling back to ${libraryDefaultLocale}.
|
|
5
|
+
Specify a list of locales for the gt-react-native babel plugin by:
|
|
6
|
+
(1) Providing a list of locales
|
|
7
|
+
(2) Providing your GT Config to the plugin
|
|
8
|
+
(3) Providing the path to your GT Config file.`;
|
|
9
|
+
|
|
10
|
+
export const couldNotLocateConfigWarning = (filePath: string) =>
|
|
11
|
+
`${PACKAGE_NAME}: Could not locate GT Config at ${filePath}.`;
|
|
12
|
+
|
|
13
|
+
export const invalidLocalesWarning = (invalidLocales: string[]) =>
|
|
14
|
+
`${PACKAGE_NAME}: Invalid locales found in GT Config: ${invalidLocales.join(', ')}.`;
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { polyfillLocales } from './utils/polyfill';
|
|
2
1
|
import GtReactNative from './NativeGtReactNative';
|
|
3
2
|
|
|
4
3
|
import { GTProvider } from './provider/GTProvider';
|
|
@@ -65,5 +64,4 @@ export {
|
|
|
65
64
|
decodeMsg,
|
|
66
65
|
decodeOptions,
|
|
67
66
|
useMessages,
|
|
68
|
-
polyfillLocales,
|
|
69
67
|
};
|
package/src/internal.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { testLocalePolyfill } from './tools/testLocalePolyfill';
|