gt-react-native 10.19.16 → 10.19.17
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/commonjs/NativeGtReactNative.js +9 -7
- package/dist/commonjs/NativeGtReactNative.js.map +1 -1
- package/dist/commonjs/_virtual/_rolldown/runtime.js +23 -0
- package/dist/commonjs/errors-dir/constants.js +5 -6
- package/dist/commonjs/errors-dir/constants.js.map +1 -1
- package/dist/commonjs/errors-dir/errors.js +12 -7
- package/dist/commonjs/errors-dir/errors.js.map +1 -1
- package/dist/commonjs/errors-dir/warnings.js +34 -15
- package/dist/commonjs/errors-dir/warnings.js.map +1 -1
- package/dist/commonjs/index.js +35 -194
- package/dist/commonjs/internal.js +3 -13
- package/dist/commonjs/plugin-dir/index.js +35 -51
- package/dist/commonjs/plugin-dir/index.js.map +1 -1
- package/dist/commonjs/plugin-dir/types.js +24 -9
- package/dist/commonjs/plugin-dir/types.js.map +1 -1
- package/dist/commonjs/plugin-dir/utils/resolveLocales.js +52 -69
- package/dist/commonjs/plugin-dir/utils/resolveLocales.js.map +1 -1
- package/dist/commonjs/plugin.js +5 -13
- package/dist/commonjs/provider/GTProvider.js +22 -20
- package/dist/commonjs/provider/GTProvider.js.map +1 -1
- package/dist/commonjs/provider/hooks/locale/useDetermineLocale.js +96 -160
- package/dist/commonjs/provider/hooks/locale/useDetermineLocale.js.map +1 -1
- package/dist/commonjs/provider/hooks/useRegionState.js +32 -44
- package/dist/commonjs/provider/hooks/useRegionState.js.map +1 -1
- package/dist/commonjs/tools/testLocalePolyfill.js +125 -146
- package/dist/commonjs/tools/testLocalePolyfill.js.map +1 -1
- package/dist/commonjs/types/config.js +1 -6
- package/dist/commonjs/utils/getNativeLocales.js +36 -54
- package/dist/commonjs/utils/getNativeLocales.js.map +1 -1
- package/dist/commonjs/utils/nativeStore.js +37 -42
- package/dist/commonjs/utils/nativeStore.js.map +1 -1
- package/dist/commonjs/utils/utils.js +10 -14
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/module/NativeGtReactNative.d.ts.map +1 -0
- package/dist/module/NativeGtReactNative.js +5 -3
- package/dist/module/NativeGtReactNative.js.map +1 -1
- package/dist/module/errors-dir/constants.d.ts.map +1 -0
- package/dist/module/errors-dir/constants.js +4 -2
- package/dist/module/errors-dir/constants.js.map +1 -1
- package/dist/module/errors-dir/errors.d.ts.map +1 -0
- package/dist/module/errors-dir/errors.js +11 -3
- package/dist/module/errors-dir/errors.js.map +1 -1
- package/dist/{typescript/commonjs/src → module}/errors-dir/warnings.d.ts +1 -1
- package/dist/module/errors-dir/warnings.d.ts.map +1 -0
- package/dist/module/errors-dir/warnings.js +31 -11
- package/dist/module/errors-dir/warnings.js.map +1 -1
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +2 -5
- package/dist/module/internal.d.ts.map +1 -0
- package/dist/module/internal.js +2 -4
- package/dist/module/plugin-dir/index.d.ts.map +1 -0
- package/dist/module/plugin-dir/index.js +28 -45
- package/dist/module/plugin-dir/index.js.map +1 -1
- package/dist/module/plugin-dir/types.d.ts.map +1 -0
- package/dist/module/plugin-dir/types.js +22 -5
- package/dist/module/plugin-dir/types.js.map +1 -1
- package/dist/module/plugin-dir/utils/resolveLocales.d.ts.map +1 -0
- package/dist/module/plugin-dir/utils/resolveLocales.js +46 -62
- package/dist/module/plugin-dir/utils/resolveLocales.js.map +1 -1
- package/dist/module/plugin.d.ts.map +1 -0
- package/dist/module/plugin.js +2 -4
- package/dist/module/provider/GTProvider.d.ts.map +1 -0
- package/dist/module/provider/GTProvider.js +15 -14
- package/dist/module/provider/GTProvider.js.map +1 -1
- package/dist/module/provider/hooks/locale/useDetermineLocale.d.ts.map +1 -0
- package/dist/module/provider/hooks/locale/useDetermineLocale.js +91 -153
- package/dist/module/provider/hooks/locale/useDetermineLocale.js.map +1 -1
- package/dist/module/provider/hooks/useRegionState.d.ts.map +1 -0
- package/dist/module/provider/hooks/useRegionState.js +29 -39
- package/dist/module/provider/hooks/useRegionState.js.map +1 -1
- package/dist/module/tools/testLocalePolyfill.d.ts.map +1 -0
- package/dist/module/tools/testLocalePolyfill.js +124 -143
- package/dist/module/tools/testLocalePolyfill.js.map +1 -1
- package/dist/module/types/config.d.ts.map +1 -0
- package/dist/module/types/config.js +0 -3
- package/dist/module/utils/getNativeLocales.d.ts.map +1 -0
- package/dist/module/utils/getNativeLocales.js +35 -51
- package/dist/module/utils/getNativeLocales.js.map +1 -1
- package/dist/module/utils/nativeStore.d.ts.map +1 -0
- package/dist/module/utils/nativeStore.js +35 -38
- package/dist/module/utils/nativeStore.js.map +1 -1
- package/dist/module/utils/utils.d.ts.map +1 -0
- package/dist/module/utils/utils.js +10 -11
- package/dist/module/utils/utils.js.map +1 -1
- package/package.json +15 -37
- package/src/errors-dir/errors.ts +8 -1
- package/src/errors-dir/warnings.ts +30 -9
- package/dist/commonjs/index.js.map +0 -1
- package/dist/commonjs/internal.js.map +0 -1
- package/dist/commonjs/package.json +0 -1
- package/dist/commonjs/plugin.js.map +0 -1
- package/dist/commonjs/types/config.js.map +0 -1
- package/dist/module/index.js.map +0 -1
- package/dist/module/internal.js.map +0 -1
- package/dist/module/package.json +0 -1
- package/dist/module/plugin.js.map +0 -1
- package/dist/module/types/config.js.map +0 -1
- package/dist/typescript/commonjs/package.json +0 -1
- package/dist/typescript/commonjs/src/NativeGtReactNative.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/errors-dir/constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/errors-dir/errors.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/errors-dir/warnings.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/internal.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/plugin-dir/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/plugin-dir/types.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/plugin-dir/utils/resolveLocales.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/plugin.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/provider/GTProvider.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/provider/hooks/locale/useDetermineLocale.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/provider/hooks/useRegionState.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/tools/testLocalePolyfill.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/types/config.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/utils/getNativeLocales.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/utils/nativeStore.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/utils/utils.d.ts.map +0 -1
- package/dist/typescript/module/package.json +0 -1
- package/dist/typescript/module/src/NativeGtReactNative.d.ts +0 -10
- package/dist/typescript/module/src/NativeGtReactNative.d.ts.map +0 -1
- package/dist/typescript/module/src/errors-dir/constants.d.ts +0 -2
- package/dist/typescript/module/src/errors-dir/constants.d.ts.map +0 -1
- package/dist/typescript/module/src/errors-dir/errors.d.ts +0 -2
- package/dist/typescript/module/src/errors-dir/errors.d.ts.map +0 -1
- package/dist/typescript/module/src/errors-dir/warnings.d.ts +0 -5
- package/dist/typescript/module/src/errors-dir/warnings.d.ts.map +0 -1
- package/dist/typescript/module/src/index.d.ts +0 -5
- package/dist/typescript/module/src/index.d.ts.map +0 -1
- package/dist/typescript/module/src/internal.d.ts +0 -2
- package/dist/typescript/module/src/internal.d.ts.map +0 -1
- package/dist/typescript/module/src/plugin-dir/index.d.ts +0 -6
- package/dist/typescript/module/src/plugin-dir/index.d.ts.map +0 -1
- package/dist/typescript/module/src/plugin-dir/types.d.ts +0 -13
- package/dist/typescript/module/src/plugin-dir/types.d.ts.map +0 -1
- package/dist/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts +0 -13
- package/dist/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts.map +0 -1
- package/dist/typescript/module/src/plugin.d.ts +0 -2
- package/dist/typescript/module/src/plugin.d.ts.map +0 -1
- package/dist/typescript/module/src/provider/GTProvider.d.ts +0 -4
- package/dist/typescript/module/src/provider/GTProvider.d.ts.map +0 -1
- package/dist/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts +0 -4
- package/dist/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts.map +0 -1
- package/dist/typescript/module/src/provider/hooks/useRegionState.d.ts +0 -3
- package/dist/typescript/module/src/provider/hooks/useRegionState.d.ts.map +0 -1
- package/dist/typescript/module/src/tools/testLocalePolyfill.d.ts +0 -8
- package/dist/typescript/module/src/tools/testLocalePolyfill.d.ts.map +0 -1
- package/dist/typescript/module/src/types/config.d.ts +0 -30
- package/dist/typescript/module/src/types/config.d.ts.map +0 -1
- package/dist/typescript/module/src/utils/getNativeLocales.d.ts +0 -10
- package/dist/typescript/module/src/utils/getNativeLocales.d.ts.map +0 -1
- package/dist/typescript/module/src/utils/nativeStore.d.ts +0 -16
- package/dist/typescript/module/src/utils/nativeStore.d.ts.map +0 -1
- package/dist/typescript/module/src/utils/utils.d.ts +0 -3
- package/dist/typescript/module/src/utils/utils.d.ts.map +0 -1
- /package/dist/{typescript/commonjs/src → module}/NativeGtReactNative.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/errors-dir/constants.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/errors-dir/errors.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/index.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/internal.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/plugin-dir/index.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/plugin-dir/types.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/plugin-dir/utils/resolveLocales.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/plugin.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/provider/GTProvider.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/provider/hooks/locale/useDetermineLocale.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/provider/hooks/useRegionState.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/tools/testLocalePolyfill.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/types/config.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/utils/getNativeLocales.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/utils/nativeStore.d.ts +0 -0
- /package/dist/{typescript/commonjs/src → module}/utils/utils.d.ts +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
5
|
+
require("./_virtual/_rolldown/runtime.js");
|
|
6
|
+
//#region src/NativeGtReactNative.ts
|
|
7
|
+
var NativeGtReactNative_default = require("react-native").TurboModuleRegistry.getEnforcing("GtReactNative");
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.default = NativeGtReactNative_default;
|
|
10
|
+
|
|
9
11
|
//# sourceMappingURL=NativeGtReactNative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"NativeGtReactNative.js","names":["TurboModuleRegistry"],"sources":["../../src/NativeGtReactNative.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nexport interface Spec extends TurboModule {\n multiply(a: number, b: number): number;\n getNativeLocales(): string[];\n nativeStoreGet(key: string): string | null;\n nativeStoreSet(key: string, value: string): void;\n}\n\nexport default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');\n"],"mappings":";;;;;;AASA,IAAA,qDAAeA,CAAAA,oBAAoB,aAAmB,gBAAgB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/errors-dir/constants.ts
|
|
3
|
+
const PACKAGE_NAME = "gt-react-native";
|
|
4
|
+
//#endregion
|
|
5
|
+
exports.PACKAGE_NAME = PACKAGE_NAME;
|
|
2
6
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PACKAGE_NAME = void 0;
|
|
7
|
-
const PACKAGE_NAME = exports.PACKAGE_NAME = 'gt-react-native';
|
|
8
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../../src/errors-dir/constants.ts"],"sourcesContent":["export const PACKAGE_NAME = 'gt-react-native';\n"],"mappings":";;AAAA,MAAa,eAAe"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_errors_dir_constants = require("./constants.js");
|
|
4
|
+
let generaltranslation_internal = require("generaltranslation/internal");
|
|
5
|
+
//#region src/errors-dir/errors.ts
|
|
6
|
+
const failedToReadConfigFileError = (filePath) => (0, generaltranslation_internal.createDiagnosticMessage)({
|
|
7
|
+
source: require_errors_dir_constants.PACKAGE_NAME,
|
|
8
|
+
severity: "Error",
|
|
9
|
+
whatHappened: `GT Config at ${filePath} could not be read`,
|
|
10
|
+
fix: "Check that the file exists and contains valid JSON"
|
|
5
11
|
});
|
|
6
|
-
|
|
7
|
-
var _constants = require("./constants");
|
|
8
|
-
const failedToReadConfigFileError = filePath => `${_constants.PACKAGE_NAME} Error: Failed to read GT Config at ${filePath}.`;
|
|
12
|
+
//#endregion
|
|
9
13
|
exports.failedToReadConfigFileError = failedToReadConfigFileError;
|
|
14
|
+
|
|
10
15
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"errors.js","names":["PACKAGE_NAME"],"sources":["../../../src/errors-dir/errors.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { PACKAGE_NAME } from './constants';\n\nexport const failedToReadConfigFileError = (filePath: string) =>\n createDiagnosticMessage({\n source: PACKAGE_NAME,\n severity: 'Error',\n whatHappened: `GT Config at ${filePath} could not be read`,\n fix: 'Check that the file exists and contains valid JSON',\n });\n"],"mappings":";;;;;AAGA,MAAa,+BAA+B,cAAA,GAAA,4BAAA,yBAClB;CACtB,QAAQA,6BAAAA;CACR,UAAU;CACV,cAAc,gBAAgB,SAAS;CACvC,KAAK;CACN,CAAC"}
|
|
@@ -1,19 +1,38 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_errors_dir_constants = require("./constants.js");
|
|
4
|
+
let generaltranslation_internal = require("generaltranslation/internal");
|
|
5
|
+
//#region src/errors-dir/warnings.ts
|
|
6
|
+
const resolveLocalesFailedWarning = (0, generaltranslation_internal.createDiagnosticMessage)({
|
|
7
|
+
source: require_errors_dir_constants.PACKAGE_NAME,
|
|
8
|
+
severity: "Warning",
|
|
9
|
+
whatHappened: "Locales for the polyfill could not be resolved",
|
|
10
|
+
fix: "Provide locales directly, pass your GT Config to the plugin, or provide the path to your GT Config file",
|
|
11
|
+
wayOut: `The library will fall back to ${generaltranslation_internal.libraryDefaultLocale}`
|
|
12
|
+
});
|
|
13
|
+
const couldNotLocateConfigWarning = (filePath) => (0, generaltranslation_internal.createDiagnosticMessage)({
|
|
14
|
+
source: require_errors_dir_constants.PACKAGE_NAME,
|
|
15
|
+
severity: "Warning",
|
|
16
|
+
whatHappened: `GT Config could not be found at ${filePath}`,
|
|
17
|
+
fix: "Check the path or pass locales directly to the plugin"
|
|
18
|
+
});
|
|
19
|
+
const invalidLocalesWarning = (invalidLocales) => (0, generaltranslation_internal.createDiagnosticMessage)({
|
|
20
|
+
source: require_errors_dir_constants.PACKAGE_NAME,
|
|
21
|
+
severity: "Warning",
|
|
22
|
+
whatHappened: "GT Config contains invalid locales",
|
|
23
|
+
fix: "Use valid BCP 47 locale codes or add custom mappings",
|
|
24
|
+
details: invalidLocales
|
|
5
25
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(3) Providing the path to your GT Config file.`;
|
|
14
|
-
const couldNotLocateConfigWarning = filePath => `${_constants.PACKAGE_NAME}: Could not locate GT Config at ${filePath}.`;
|
|
26
|
+
const ssrUnsupportedWarning = (0, generaltranslation_internal.createDiagnosticMessage)({
|
|
27
|
+
source: require_errors_dir_constants.PACKAGE_NAME,
|
|
28
|
+
severity: "Warning",
|
|
29
|
+
whatHappened: "Server-side environments are not explicitly supported",
|
|
30
|
+
wayOut: "Some features may not work as expected"
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
15
33
|
exports.couldNotLocateConfigWarning = couldNotLocateConfigWarning;
|
|
16
|
-
const invalidLocalesWarning = invalidLocales => `${_constants.PACKAGE_NAME}: Invalid locales found in GT Config: ${invalidLocales.join(', ')}.`;
|
|
17
34
|
exports.invalidLocalesWarning = invalidLocalesWarning;
|
|
18
|
-
|
|
35
|
+
exports.resolveLocalesFailedWarning = resolveLocalesFailedWarning;
|
|
36
|
+
exports.ssrUnsupportedWarning = ssrUnsupportedWarning;
|
|
37
|
+
|
|
19
38
|
//# sourceMappingURL=warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"warnings.js","names":["PACKAGE_NAME","libraryDefaultLocale"],"sources":["../../../src/errors-dir/warnings.ts"],"sourcesContent":["import {\n createDiagnosticMessage,\n libraryDefaultLocale,\n} from 'generaltranslation/internal';\nimport { PACKAGE_NAME } from './constants';\n\nexport const resolveLocalesFailedWarning = createDiagnosticMessage({\n source: PACKAGE_NAME,\n severity: 'Warning',\n whatHappened: 'Locales for the polyfill could not be resolved',\n fix: 'Provide locales directly, pass your GT Config to the plugin, or provide the path to your GT Config file',\n wayOut: `The library will fall back to ${libraryDefaultLocale}`,\n});\n\nexport const couldNotLocateConfigWarning = (filePath: string) =>\n createDiagnosticMessage({\n source: PACKAGE_NAME,\n severity: 'Warning',\n whatHappened: `GT Config could not be found at ${filePath}`,\n fix: 'Check the path or pass locales directly to the plugin',\n });\n\nexport const invalidLocalesWarning = (invalidLocales: string[]) =>\n createDiagnosticMessage({\n source: PACKAGE_NAME,\n severity: 'Warning',\n whatHappened: 'GT Config contains invalid locales',\n fix: 'Use valid BCP 47 locale codes or add custom mappings',\n details: invalidLocales,\n });\n\nexport const ssrUnsupportedWarning = createDiagnosticMessage({\n source: PACKAGE_NAME,\n severity: 'Warning',\n whatHappened: 'Server-side environments are not explicitly supported',\n wayOut: 'Some features may not work as expected',\n});\n"],"mappings":";;;;;AAMA,MAAa,+BAAA,GAAA,4BAAA,yBAAsD;CACjE,QAAQA,6BAAAA;CACR,UAAU;CACV,cAAc;CACd,KAAK;CACL,QAAQ,iCAAiCC,4BAAAA;CAC1C,CAAC;AAEF,MAAa,+BAA+B,cAAA,GAAA,4BAAA,yBAClB;CACtB,QAAQD,6BAAAA;CACR,UAAU;CACV,cAAc,mCAAmC;CACjD,KAAK;CACN,CAAC;AAEJ,MAAa,yBAAyB,oBAAA,GAAA,4BAAA,yBACZ;CACtB,QAAQA,6BAAAA;CACR,UAAU;CACV,cAAc;CACd,KAAK;CACL,SAAS;CACV,CAAC;AAEJ,MAAa,yBAAA,GAAA,4BAAA,yBAAgD;CAC3D,QAAQA,6BAAAA;CACR,UAAU;CACV,cAAc;CACd,QAAQ;CACT,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -1,194 +1,35 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Object.defineProperty(exports, "Plural", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _reactCore.Plural;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "Static", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _reactCore.Static;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "T", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _reactCore.T;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "Var", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _reactCore.Var;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "declareStatic", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _reactCore.declareStatic;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "declareVar", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _reactCore.declareVar;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "decodeMsg", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return _reactCore.decodeMsg;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "decodeOptions", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _reactCore.decodeOptions;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "decodeVars", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _reactCore.decodeVars;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "gtFallback", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _reactCore.gtFallback;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "mFallback", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _reactCore.mFallback;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "msg", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _reactCore.msg;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "useDefaultLocale", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _reactCore.useDefaultLocale;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "useGT", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _reactCore.useGT;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "useGTClass", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _reactCore.useGTClass;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "useLocale", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _reactCore.useLocale;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "useLocaleDirection", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _reactCore.useLocaleDirection;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "useLocaleProperties", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function () {
|
|
141
|
-
return _reactCore.useLocaleProperties;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "useLocaleSelector", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () {
|
|
147
|
-
return _reactCore.useLocaleSelector;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(exports, "useLocales", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function () {
|
|
153
|
-
return _reactCore.useLocales;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(exports, "useMessages", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function () {
|
|
159
|
-
return _reactCore.useMessages;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(exports, "useRegion", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function () {
|
|
165
|
-
return _reactCore.useRegion;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "useRegionSelector", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function () {
|
|
171
|
-
return _reactCore.useRegionSelector;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
Object.defineProperty(exports, "useSetLocale", {
|
|
175
|
-
enumerable: true,
|
|
176
|
-
get: function () {
|
|
177
|
-
return _reactCore.useSetLocale;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
Object.defineProperty(exports, "useTranslations", {
|
|
181
|
-
enumerable: true,
|
|
182
|
-
get: function () {
|
|
183
|
-
return _reactCore.useTranslations;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
Object.defineProperty(exports, "useVersionId", {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function () {
|
|
189
|
-
return _reactCore.useVersionId;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
var _GTProvider = require("./provider/GTProvider");
|
|
193
|
-
var _reactCore = require("@generaltranslation/react-core");
|
|
194
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_provider_GTProvider = require("./provider/GTProvider.js");
|
|
4
|
+
let _generaltranslation_react_core = require("@generaltranslation/react-core");
|
|
5
|
+
exports.Branch = _generaltranslation_react_core.Branch;
|
|
6
|
+
exports.Currency = _generaltranslation_react_core.Currency;
|
|
7
|
+
exports.DateTime = _generaltranslation_react_core.DateTime;
|
|
8
|
+
exports.GTProvider = require_provider_GTProvider.GTProvider;
|
|
9
|
+
exports.Num = _generaltranslation_react_core.Num;
|
|
10
|
+
exports.Plural = _generaltranslation_react_core.Plural;
|
|
11
|
+
exports.Static = _generaltranslation_react_core.Static;
|
|
12
|
+
exports.T = _generaltranslation_react_core.T;
|
|
13
|
+
exports.Var = _generaltranslation_react_core.Var;
|
|
14
|
+
exports.declareStatic = _generaltranslation_react_core.declareStatic;
|
|
15
|
+
exports.declareVar = _generaltranslation_react_core.declareVar;
|
|
16
|
+
exports.decodeMsg = _generaltranslation_react_core.decodeMsg;
|
|
17
|
+
exports.decodeOptions = _generaltranslation_react_core.decodeOptions;
|
|
18
|
+
exports.decodeVars = _generaltranslation_react_core.decodeVars;
|
|
19
|
+
exports.gtFallback = _generaltranslation_react_core.gtFallback;
|
|
20
|
+
exports.mFallback = _generaltranslation_react_core.mFallback;
|
|
21
|
+
exports.msg = _generaltranslation_react_core.msg;
|
|
22
|
+
exports.useDefaultLocale = _generaltranslation_react_core.useDefaultLocale;
|
|
23
|
+
exports.useGT = _generaltranslation_react_core.useGT;
|
|
24
|
+
exports.useGTClass = _generaltranslation_react_core.useGTClass;
|
|
25
|
+
exports.useLocale = _generaltranslation_react_core.useLocale;
|
|
26
|
+
exports.useLocaleDirection = _generaltranslation_react_core.useLocaleDirection;
|
|
27
|
+
exports.useLocaleProperties = _generaltranslation_react_core.useLocaleProperties;
|
|
28
|
+
exports.useLocaleSelector = _generaltranslation_react_core.useLocaleSelector;
|
|
29
|
+
exports.useLocales = _generaltranslation_react_core.useLocales;
|
|
30
|
+
exports.useMessages = _generaltranslation_react_core.useMessages;
|
|
31
|
+
exports.useRegion = _generaltranslation_react_core.useRegion;
|
|
32
|
+
exports.useRegionSelector = _generaltranslation_react_core.useRegionSelector;
|
|
33
|
+
exports.useSetLocale = _generaltranslation_react_core.useSetLocale;
|
|
34
|
+
exports.useTranslations = _generaltranslation_react_core.useTranslations;
|
|
35
|
+
exports.useVersionId = _generaltranslation_react_core.useVersionId;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "testLocalePolyfill", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _testLocalePolyfill.testLocalePolyfill;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _testLocalePolyfill = require("./tools/testLocalePolyfill");
|
|
13
|
-
//# sourceMappingURL=internal.js.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_tools_testLocalePolyfill = require("./tools/testLocalePolyfill.js");
|
|
3
|
+
exports.testLocalePolyfill = require_tools_testLocalePolyfill.testLocalePolyfill;
|
|
@@ -1,54 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// TODO: smart imports based on if the polyfill is required, do this as a wrapper around AppRegistry.registerComponent()
|
|
38
|
-
const imports = [..._types.POLYFILLS.filter(polyfill => !excludePolyfills.includes(polyfill)), ...resolvedLocales.flatMap(locale => _types.LOCALE_POLYFILLS.map(localeData => `${localeData}/${locale}`))];
|
|
39
|
-
const existingImports = new Set();
|
|
40
|
-
programPath.node.body.forEach(node => {
|
|
41
|
-
if (t.isImportDeclaration(node) && typeof node.source.value === 'string' && imports.includes(node.source.value)) {
|
|
42
|
-
existingImports.add(node.source.value);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const importsToAdd = imports.filter(imp => !existingImports.has(imp));
|
|
46
|
-
if (importsToAdd.length > 0) {
|
|
47
|
-
const newImports = importsToAdd.map(importPath => t.importDeclaration([], t.stringLiteral(importPath)));
|
|
48
|
-
programPath.node.body.unshift(...newImports);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
5
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
6
|
+
const require_plugin_dir_types = require("./types.js");
|
|
7
|
+
const require_plugin_dir_utils_resolveLocales = require("./utils/resolveLocales.js");
|
|
8
|
+
let path = require("path");
|
|
9
|
+
path = require_runtime.__toESM(path);
|
|
10
|
+
//#region src/plugin-dir/index.ts
|
|
11
|
+
function plugin_dir_default(babel, { locales, config, configFilePath, entryPointFilePath = path.resolve(process.cwd(), "src", "App.tsx"), excludePolyfills = [] }) {
|
|
12
|
+
const { types: t } = babel;
|
|
13
|
+
return {
|
|
14
|
+
name: "gt-react-native/plugin",
|
|
15
|
+
visitor: { Program(programPath, state) {
|
|
16
|
+
if (path.resolve(state.filename || state.file.opts.filename || "") !== entryPointFilePath) return;
|
|
17
|
+
const resolvedLocales = require_plugin_dir_utils_resolveLocales.resolveLocales({
|
|
18
|
+
locales,
|
|
19
|
+
config,
|
|
20
|
+
configFilePath
|
|
21
|
+
});
|
|
22
|
+
const imports = [...require_plugin_dir_types.POLYFILLS.filter((polyfill) => !excludePolyfills.includes(polyfill)), ...resolvedLocales.flatMap((locale) => require_plugin_dir_types.LOCALE_POLYFILLS.map((localeData) => `${localeData}/${locale}`))];
|
|
23
|
+
const existingImports = /* @__PURE__ */ new Set();
|
|
24
|
+
programPath.node.body.forEach((node) => {
|
|
25
|
+
if (t.isImportDeclaration(node) && typeof node.source.value === "string" && imports.includes(node.source.value)) existingImports.add(node.source.value);
|
|
26
|
+
});
|
|
27
|
+
const importsToAdd = imports.filter((imp) => !existingImports.has(imp));
|
|
28
|
+
if (importsToAdd.length > 0) {
|
|
29
|
+
const newImports = importsToAdd.map((importPath) => t.importDeclaration([], t.stringLiteral(importPath)));
|
|
30
|
+
programPath.node.body.unshift(...newImports);
|
|
31
|
+
}
|
|
32
|
+
} }
|
|
33
|
+
};
|
|
53
34
|
}
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.default = plugin_dir_default;
|
|
37
|
+
|
|
54
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["resolveLocales","POLYFILLS","LOCALE_POLYFILLS"],"sources":["../../../src/plugin-dir/index.ts"],"sourcesContent":["import * as path from 'path';\nimport type { PluginObj, types } from '@babel/core';\nimport { LOCALE_POLYFILLS, POLYFILLS, type PluginOptions } from './types';\nimport { resolveLocales } from './utils/resolveLocales';\n\nexport default function (\n babel: { types: typeof types },\n {\n locales,\n config,\n configFilePath,\n entryPointFilePath = path.resolve(process.cwd(), 'src', 'App.tsx'),\n excludePolyfills = [],\n }: PluginOptions\n): PluginObj {\n const { types: t } = babel;\n\n return {\n name: 'gt-react-native/plugin',\n visitor: {\n Program(programPath, state) {\n const currentFilePath = path.resolve(\n state.filename || state.file.opts.filename || ''\n );\n\n // Only apply polyfills to files that import gt-react-native or generaltranslation\n if (currentFilePath !== entryPointFilePath) {\n return;\n }\n\n const resolvedLocales = resolveLocales({\n locales,\n config,\n configFilePath,\n });\n\n // TODO: smart imports based on if the polyfill is required, do this as a wrapper around AppRegistry.registerComponent()\n const imports = [\n ...POLYFILLS.filter(\n (polyfill) => !excludePolyfills.includes(polyfill)\n ),\n ...resolvedLocales.flatMap((locale) =>\n LOCALE_POLYFILLS.map((localeData) => `${localeData}/${locale}`)\n ),\n ];\n\n const existingImports = new Set<string>();\n programPath.node.body.forEach((node) => {\n if (\n t.isImportDeclaration(node) &&\n typeof node.source.value === 'string' &&\n imports.includes(node.source.value)\n ) {\n existingImports.add(node.source.value);\n }\n });\n\n const importsToAdd = imports.filter((imp) => !existingImports.has(imp));\n\n if (importsToAdd.length > 0) {\n const newImports = importsToAdd.map((importPath) =>\n t.importDeclaration([], t.stringLiteral(importPath))\n );\n\n programPath.node.body.unshift(...newImports);\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;AAKA,SAAA,mBACE,OACA,EACE,SACA,QACA,gBACA,qBAAqB,KAAK,QAAQ,QAAQ,KAAK,EAAE,OAAO,UAAU,EAClE,mBAAmB,EAAE,IAEZ;CACX,MAAM,EAAE,OAAO,MAAM;AAErB,QAAO;EACL,MAAM;EACN,SAAS,EACP,QAAQ,aAAa,OAAO;AAM1B,OALwB,KAAK,QAC3B,MAAM,YAAY,MAAM,KAAK,KAAK,YAAY,GAI7B,KAAK,mBACtB;GAGF,MAAM,kBAAkBA,wCAAAA,eAAe;IACrC;IACA;IACA;IACD,CAAC;GAGF,MAAM,UAAU,CACd,GAAGC,yBAAAA,UAAU,QACV,aAAa,CAAC,iBAAiB,SAAS,SAAS,CACnD,EACD,GAAG,gBAAgB,SAAS,WAC1BC,yBAAAA,iBAAiB,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,CAChE,CACF;GAED,MAAM,kCAAkB,IAAI,KAAa;AACzC,eAAY,KAAK,KAAK,SAAS,SAAS;AACtC,QACE,EAAE,oBAAoB,KAAK,IAC3B,OAAO,KAAK,OAAO,UAAU,YAC7B,QAAQ,SAAS,KAAK,OAAO,MAAM,CAEnC,iBAAgB,IAAI,KAAK,OAAO,MAAM;KAExC;GAEF,MAAM,eAAe,QAAQ,QAAQ,QAAQ,CAAC,gBAAgB,IAAI,IAAI,CAAC;AAEvE,OAAI,aAAa,SAAS,GAAG;IAC3B,MAAM,aAAa,aAAa,KAAK,eACnC,EAAE,kBAAkB,EAAE,EAAE,EAAE,cAAc,WAAW,CAAC,CACrD;AAED,gBAAY,KAAK,KAAK,QAAQ,GAAG,WAAW;;KAGjD;EACF"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/plugin-dir/types.ts
|
|
3
|
+
const POLYFILLS = [
|
|
4
|
+
"@formatjs/intl-getcanonicallocales/polyfill",
|
|
5
|
+
"@formatjs/intl-locale/polyfill",
|
|
6
|
+
"@formatjs/intl-displaynames/polyfill",
|
|
7
|
+
"@formatjs/intl-listformat/polyfill",
|
|
8
|
+
"@formatjs/intl-pluralrules/polyfill-force",
|
|
9
|
+
"@formatjs/intl-numberformat/polyfill",
|
|
10
|
+
"@formatjs/intl-relativetimeformat/polyfill",
|
|
11
|
+
"@formatjs/intl-datetimeformat/polyfill",
|
|
12
|
+
"@formatjs/intl-datetimeformat/add-all-tz"
|
|
13
|
+
];
|
|
14
|
+
const LOCALE_POLYFILLS = [
|
|
15
|
+
`@formatjs/intl-displaynames/locale-data`,
|
|
16
|
+
`@formatjs/intl-listformat/locale-data`,
|
|
17
|
+
`@formatjs/intl-pluralrules/locale-data`,
|
|
18
|
+
`@formatjs/intl-numberformat/locale-data`,
|
|
19
|
+
`@formatjs/intl-relativetimeformat/locale-data`,
|
|
20
|
+
`@formatjs/intl-datetimeformat/locale-data`
|
|
21
|
+
];
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.LOCALE_POLYFILLS = LOCALE_POLYFILLS;
|
|
24
|
+
exports.POLYFILLS = POLYFILLS;
|
|
2
25
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.POLYFILLS = exports.LOCALE_POLYFILLS = void 0;
|
|
7
|
-
const POLYFILLS = exports.POLYFILLS = ['@formatjs/intl-getcanonicallocales/polyfill', '@formatjs/intl-locale/polyfill', '@formatjs/intl-displaynames/polyfill', '@formatjs/intl-listformat/polyfill', '@formatjs/intl-pluralrules/polyfill-force',
|
|
8
|
-
// https://github.com/formatjs/formatjs/issues/4463
|
|
9
|
-
'@formatjs/intl-numberformat/polyfill', '@formatjs/intl-relativetimeformat/polyfill', '@formatjs/intl-datetimeformat/polyfill', '@formatjs/intl-datetimeformat/add-all-tz'];
|
|
10
|
-
const LOCALE_POLYFILLS = exports.LOCALE_POLYFILLS = [`@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`];
|
|
11
26
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/plugin-dir/types.ts"],"sourcesContent":["export const POLYFILLS = [\n '@formatjs/intl-getcanonicallocales/polyfill',\n '@formatjs/intl-locale/polyfill',\n '@formatjs/intl-displaynames/polyfill',\n '@formatjs/intl-listformat/polyfill',\n '@formatjs/intl-pluralrules/polyfill-force', // https://github.com/formatjs/formatjs/issues/4463\n '@formatjs/intl-numberformat/polyfill',\n '@formatjs/intl-relativetimeformat/polyfill',\n '@formatjs/intl-datetimeformat/polyfill',\n '@formatjs/intl-datetimeformat/add-all-tz',\n] as const;\n\nexport const LOCALE_POLYFILLS = [\n `@formatjs/intl-displaynames/locale-data`,\n `@formatjs/intl-listformat/locale-data`,\n `@formatjs/intl-pluralrules/locale-data`,\n `@formatjs/intl-numberformat/locale-data`,\n `@formatjs/intl-relativetimeformat/locale-data`,\n `@formatjs/intl-datetimeformat/locale-data`,\n] as const;\n\nexport interface PluginOptions {\n /* List of locales to polyfill */\n locales?: string[];\n /* Gt config object */\n config?: { defaultLocale: string; locales: string[] } & Record<\n string,\n unknown\n >;\n /* Path to the gt config file */\n configFilePath?: string;\n /* Resolved from package.json */\n entryPointFilePath?: string;\n /* Polyfills to exclude */\n excludePolyfills?: (typeof POLYFILLS)[number][];\n}\n"],"mappings":";;AAAA,MAAa,YAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACD"}
|