gt-react-native 0.0.2 → 0.0.4
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/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 +11 -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 +182 -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/plugin-dir/index.js +4 -4
- package/lib/module/plugin-dir/index.js.map +1 -1
- package/lib/module/plugin-dir/types.js +5 -0
- package/lib/module/plugin-dir/types.js.map +1 -1
- package/lib/module/tools/testLocalePolyfill.js +125 -11
- package/lib/module/tools/testLocalePolyfill.js.map +1 -1
- 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.map +1 -0
- package/lib/typescript/commonjs/src/errors-dir/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors-dir/warnings.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -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 +13 -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.map +1 -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 +8 -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.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 +13 -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 +8 -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 +11 -6
- package/src/plugin-dir/index.ts +6 -16
- package/src/plugin-dir/types.ts +23 -0
- package/src/tools/testLocalePolyfill.ts +170 -15
- package/lib/typescript/src/NativeGtReactNative.d.ts.map +0 -1
- package/lib/typescript/src/errors-dir/constants.d.ts.map +0 -1
- package/lib/typescript/src/errors-dir/errors.d.ts.map +0 -1
- package/lib/typescript/src/errors-dir/warnings.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/internal.d.ts.map +0 -1
- package/lib/typescript/src/plugin-dir/index.d.ts +0 -6
- package/lib/typescript/src/plugin-dir/index.d.ts.map +0 -1
- package/lib/typescript/src/plugin-dir/types.d.ts +0 -10
- package/lib/typescript/src/plugin-dir/types.d.ts.map +0 -1
- package/lib/typescript/src/plugin-dir/utils/resolveLocales.d.ts.map +0 -1
- package/lib/typescript/src/plugin.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/tools/testLocalePolyfill.d.ts +0 -12
- package/lib/typescript/src/tools/testLocalePolyfill.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/utils.d.ts.map +0 -1
- package/lib/typescript/vitest.config.d.ts.map +0 -1
- /package/lib/typescript/{src → commonjs/src}/NativeGtReactNative.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/errors-dir/constants.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/errors-dir/errors.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/errors-dir/warnings.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/internal.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/plugin-dir/utils/resolveLocales.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/plugin.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/{vitest.config.d.ts → commonjs/vitest.config.d.ts} +0 -0
- /package/lib/typescript/{package.json → module/package.json} +0 -0
|
@@ -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 @@
|
|
|
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, excludePolyfills, }: 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,EAA+B,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1E,MAAM,CAAC,OAAO,WACZ,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EAC9B,EACE,OAAO,EACP,MAAM,EACN,cAAc,EACd,kBAAkE,EAClE,gBAAqB,GACtB,EAAE,aAAa,GACf,SAAS,CAuDX"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const POLYFILLS: readonly ["@formatjs/intl-getcanonicallocales/polyfill", "@formatjs/intl-locale/polyfill", "@formatjs/intl-displaynames/polyfill", "@formatjs/intl-listformat/polyfill", "@formatjs/intl-pluralrules/polyfill-force", "@formatjs/intl-numberformat/polyfill", "@formatjs/intl-relativetimeformat/polyfill", "@formatjs/intl-datetimeformat/polyfill", "@formatjs/intl-datetimeformat/add-all-tz"];
|
|
2
|
+
export declare const LOCALE_POLYFILLS: readonly ["@formatjs/intl-displaynames/locale-data", "@formatjs/intl-listformat/locale-data", "@formatjs/intl-pluralrules/locale-data", "@formatjs/intl-numberformat/locale-data", "@formatjs/intl-relativetimeformat/locale-data", "@formatjs/intl-datetimeformat/locale-data"];
|
|
3
|
+
export interface PluginOptions {
|
|
4
|
+
locales?: string[];
|
|
5
|
+
config?: {
|
|
6
|
+
defaultLocale: string;
|
|
7
|
+
locales: string[];
|
|
8
|
+
} & Record<string, any>;
|
|
9
|
+
configFilePath?: string;
|
|
10
|
+
entryPointFilePath?: string;
|
|
11
|
+
excludePolyfills?: (typeof POLYFILLS)[number][];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,mYAUZ,CAAC;AAEX,eAAO,MAAM,gBAAgB,kRAOnB,CAAC;AAEX,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;IAE5B,gBAAgB,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CACjD"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"testLocalePolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/tools/testLocalePolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,MAAM,OAAuB;;;;;;EA0O/D"}
|
|
@@ -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, excludePolyfills, }: 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,EAA+B,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1E,MAAM,CAAC,OAAO,WACZ,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EAC9B,EACE,OAAO,EACP,MAAM,EACN,cAAc,EACd,kBAAkE,EAClE,gBAAqB,GACtB,EAAE,aAAa,GACf,SAAS,CAuDX"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const POLYFILLS: readonly ["@formatjs/intl-getcanonicallocales/polyfill", "@formatjs/intl-locale/polyfill", "@formatjs/intl-displaynames/polyfill", "@formatjs/intl-listformat/polyfill", "@formatjs/intl-pluralrules/polyfill-force", "@formatjs/intl-numberformat/polyfill", "@formatjs/intl-relativetimeformat/polyfill", "@formatjs/intl-datetimeformat/polyfill", "@formatjs/intl-datetimeformat/add-all-tz"];
|
|
2
|
+
export declare const LOCALE_POLYFILLS: readonly ["@formatjs/intl-displaynames/locale-data", "@formatjs/intl-listformat/locale-data", "@formatjs/intl-pluralrules/locale-data", "@formatjs/intl-numberformat/locale-data", "@formatjs/intl-relativetimeformat/locale-data", "@formatjs/intl-datetimeformat/locale-data"];
|
|
3
|
+
export interface PluginOptions {
|
|
4
|
+
locales?: string[];
|
|
5
|
+
config?: {
|
|
6
|
+
defaultLocale: string;
|
|
7
|
+
locales: string[];
|
|
8
|
+
} & Record<string, any>;
|
|
9
|
+
configFilePath?: string;
|
|
10
|
+
entryPointFilePath?: string;
|
|
11
|
+
excludePolyfills?: (typeof POLYFILLS)[number][];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-dir/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,mYAUZ,CAAC;AAEX,eAAO,MAAM,gBAAgB,kRAOnB,CAAC;AAEX,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;IAE5B,gBAAgB,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CACjD"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"testLocalePolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/tools/testLocalePolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,MAAM,OAAuB;;;;;;EA0O/D"}
|
|
@@ -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,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "An i18n package for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
6
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"source": "./src/index.tsx",
|
|
10
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
10
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
11
11
|
"default": "./lib/module/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./plugin": {
|
|
14
14
|
"source": "./src/plugin.ts",
|
|
15
|
-
"types": "./lib/typescript/src/plugin.d.ts",
|
|
16
|
-
"
|
|
15
|
+
"types": "./lib/typescript/module/src/plugin.d.ts",
|
|
16
|
+
"require": "./lib/commonjs/plugin.js",
|
|
17
|
+
"import": "./lib/module/plugin.js",
|
|
18
|
+
"default": "./lib/commonjs/plugin.js"
|
|
17
19
|
},
|
|
18
20
|
"./internal": {
|
|
19
21
|
"source": "./src/internal.ts",
|
|
20
|
-
"types": "./lib/typescript/src/internal.d.ts",
|
|
22
|
+
"types": "./lib/typescript/module/src/internal.d.ts",
|
|
21
23
|
"default": "./lib/module/internal.js"
|
|
22
24
|
}
|
|
23
25
|
},
|
|
@@ -134,6 +136,9 @@
|
|
|
134
136
|
"source": "src",
|
|
135
137
|
"output": "lib",
|
|
136
138
|
"targets": [
|
|
139
|
+
[
|
|
140
|
+
"commonjs"
|
|
141
|
+
],
|
|
137
142
|
[
|
|
138
143
|
"module",
|
|
139
144
|
{
|
package/src/plugin-dir/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import type { PluginObj, types } from '@babel/core';
|
|
3
|
-
import type
|
|
3
|
+
import { LOCALE_POLYFILLS, POLYFILLS, type PluginOptions } from './types';
|
|
4
4
|
import { resolveLocales } from './utils/resolveLocales';
|
|
5
5
|
|
|
6
6
|
export default function (
|
|
@@ -10,6 +10,7 @@ export default function (
|
|
|
10
10
|
config,
|
|
11
11
|
configFilePath,
|
|
12
12
|
entryPointFilePath = path.resolve(process.cwd(), 'src', 'App.tsx'),
|
|
13
|
+
excludePolyfills = [],
|
|
13
14
|
}: PluginOptions
|
|
14
15
|
): PluginObj {
|
|
15
16
|
const { types: t } = babel;
|
|
@@ -35,22 +36,11 @@ export default function (
|
|
|
35
36
|
|
|
36
37
|
// TODO: smart imports based on if the polyfill is required, do this as a wrapper around AppRegistry.registerComponent()
|
|
37
38
|
const imports = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'@formatjs/intl-listformat/polyfill',
|
|
42
|
-
'@formatjs/intl-pluralrules/polyfill-force', // https://github.com/formatjs/formatjs/issues/4463
|
|
43
|
-
'@formatjs/intl-numberformat/polyfill',
|
|
44
|
-
'@formatjs/intl-relativetimeformat/polyfill',
|
|
45
|
-
'@formatjs/intl-datetimeformat/polyfill',
|
|
46
|
-
'@formatjs/intl-datetimeformat/add-all-tz',
|
|
39
|
+
...POLYFILLS.filter(
|
|
40
|
+
(polyfill) => !excludePolyfills.includes(polyfill)
|
|
41
|
+
),
|
|
47
42
|
...resolvedLocales.flatMap((locale) => [
|
|
48
|
-
|
|
49
|
-
`@formatjs/intl-listformat/locale-data/${locale}`,
|
|
50
|
-
`@formatjs/intl-pluralrules/locale-data/${locale}`,
|
|
51
|
-
`@formatjs/intl-numberformat/locale-data/${locale}`,
|
|
52
|
-
`@formatjs/intl-relativetimeformat/locale-data/${locale}`,
|
|
53
|
-
`@formatjs/intl-datetimeformat/locale-data/${locale}`,
|
|
43
|
+
...LOCALE_POLYFILLS.map((localeData) => `${localeData}/${locale}`),
|
|
54
44
|
]),
|
|
55
45
|
];
|
|
56
46
|
|
package/src/plugin-dir/types.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
export const POLYFILLS = [
|
|
2
|
+
'@formatjs/intl-getcanonicallocales/polyfill',
|
|
3
|
+
'@formatjs/intl-locale/polyfill',
|
|
4
|
+
'@formatjs/intl-displaynames/polyfill',
|
|
5
|
+
'@formatjs/intl-listformat/polyfill',
|
|
6
|
+
'@formatjs/intl-pluralrules/polyfill-force', // https://github.com/formatjs/formatjs/issues/4463
|
|
7
|
+
'@formatjs/intl-numberformat/polyfill',
|
|
8
|
+
'@formatjs/intl-relativetimeformat/polyfill',
|
|
9
|
+
'@formatjs/intl-datetimeformat/polyfill',
|
|
10
|
+
'@formatjs/intl-datetimeformat/add-all-tz',
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export const LOCALE_POLYFILLS = [
|
|
14
|
+
`@formatjs/intl-displaynames/locale-data`,
|
|
15
|
+
`@formatjs/intl-listformat/locale-data`,
|
|
16
|
+
`@formatjs/intl-pluralrules/locale-data`,
|
|
17
|
+
`@formatjs/intl-numberformat/locale-data`,
|
|
18
|
+
`@formatjs/intl-relativetimeformat/locale-data`,
|
|
19
|
+
`@formatjs/intl-datetimeformat/locale-data`,
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
1
22
|
export interface PluginOptions {
|
|
2
23
|
/* List of locales to polyfill */
|
|
3
24
|
locales?: string[];
|
|
@@ -7,4 +28,6 @@ export interface PluginOptions {
|
|
|
7
28
|
configFilePath?: string;
|
|
8
29
|
/* Resolved from package.json */
|
|
9
30
|
entryPointFilePath?: string;
|
|
31
|
+
/* Polyfills to exclude */
|
|
32
|
+
excludePolyfills?: (typeof POLYFILLS)[number][];
|
|
10
33
|
}
|