gt-react-native 11.0.0-odysseus.4 → 11.0.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/dist/commonjs/NativeGtReactNative.js +3 -6
- package/dist/commonjs/NativeGtReactNative.js.map +1 -1
- package/dist/commonjs/condition-store/NativeConditionStore.js +19 -27
- package/dist/commonjs/condition-store/NativeConditionStore.js.map +1 -1
- package/dist/commonjs/hooks/selectors.js.map +1 -1
- package/dist/commonjs/index.js +35 -10
- package/dist/commonjs/plugin-dir/index.js +3 -6
- package/dist/commonjs/plugin-dir/index.js.map +1 -1
- package/dist/commonjs/plugin.js +2 -5
- package/dist/commonjs/provider/GTProvider.js +32 -21
- package/dist/commonjs/provider/GTProvider.js.map +1 -1
- package/dist/commonjs/provider/NativeGTProvider.js +1 -4
- package/dist/commonjs/provider/NativeGTProvider.js.map +1 -1
- package/dist/commonjs/setup/initializeGT.js +6 -11
- package/dist/commonjs/utils/getInitialNativeConditions.js +2 -2
- package/dist/commonjs/utils/getInitialNativeConditions.js.map +1 -1
- package/dist/commonjs/utils/getLocale.js +1 -1
- package/dist/commonjs/utils/getLocale.js.map +1 -1
- package/dist/commonjs/utils/getNativeLocales.js +1 -1
- package/dist/commonjs/utils/getNativeLocales.js.map +1 -1
- package/dist/commonjs/utils/nativeStore.js +4 -4
- package/dist/commonjs/utils/nativeStore.js.map +1 -1
- package/dist/commonjs/utils/resolveLocale.js +1 -2
- package/dist/commonjs/utils/resolveLocale.js.map +1 -1
- package/dist/module/NativeGtReactNative.d.ts +1 -2
- package/dist/module/NativeGtReactNative.d.ts.map +1 -1
- package/dist/module/NativeGtReactNative.js +2 -2
- package/dist/module/NativeGtReactNative.js.map +1 -1
- package/dist/module/condition-store/NativeConditionStore.d.ts +0 -7
- package/dist/module/condition-store/NativeConditionStore.d.ts.map +1 -1
- package/dist/module/condition-store/NativeConditionStore.js +20 -28
- package/dist/module/condition-store/NativeConditionStore.js.map +1 -1
- package/dist/module/hooks/selectors.d.ts +3 -33
- package/dist/module/hooks/selectors.d.ts.map +1 -1
- package/dist/module/hooks/selectors.js.map +1 -1
- package/dist/module/index.d.ts +13 -18
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +3 -4
- package/dist/module/plugin-dir/index.d.ts +1 -1
- package/dist/module/plugin-dir/index.d.ts.map +1 -1
- package/dist/module/plugin-dir/index.js +2 -2
- package/dist/module/plugin-dir/index.js.map +1 -1
- package/dist/module/plugin.d.ts +1 -1
- package/dist/module/plugin.d.ts.map +1 -1
- package/dist/module/plugin.js +2 -2
- package/dist/module/provider/GTProvider.d.ts +1 -1
- package/dist/module/provider/GTProvider.d.ts.map +1 -1
- package/dist/module/provider/GTProvider.js +32 -21
- package/dist/module/provider/GTProvider.js.map +1 -1
- package/dist/module/provider/NativeGTProvider.d.ts.map +1 -1
- package/dist/module/provider/NativeGTProvider.js +1 -4
- package/dist/module/provider/NativeGTProvider.js.map +1 -1
- package/dist/module/setup/initializeGT.d.ts +3 -4
- package/dist/module/setup/initializeGT.d.ts.map +1 -1
- package/dist/module/setup/initializeGT.js +1 -11
- package/dist/module/utils/getInitialNativeConditions.d.ts.map +1 -1
- package/dist/module/utils/getInitialNativeConditions.js +3 -3
- package/dist/module/utils/getInitialNativeConditions.js.map +1 -1
- package/dist/module/utils/getLocale.d.ts.map +1 -1
- package/dist/module/utils/getLocale.js +2 -2
- package/dist/module/utils/getLocale.js.map +1 -1
- package/dist/module/utils/getNativeLocales.js +2 -2
- package/dist/module/utils/getNativeLocales.js.map +1 -1
- package/dist/module/utils/nativeStore.d.ts +1 -1
- package/dist/module/utils/nativeStore.d.ts.map +1 -1
- package/dist/module/utils/nativeStore.js +6 -6
- package/dist/module/utils/nativeStore.js.map +1 -1
- package/dist/module/utils/resolveLocale.d.ts.map +1 -1
- package/dist/module/utils/resolveLocale.js +1 -2
- package/dist/module/utils/resolveLocale.js.map +1 -1
- package/package.json +6 -6
- package/src/NativeGtReactNative.ts +2 -1
- package/src/condition-store/NativeConditionStore.ts +21 -40
- package/src/hooks/selectors.ts +17 -3
- package/src/index.tsx +39 -67
- package/src/plugin-dir/index.ts +1 -1
- package/src/plugin.ts +1 -1
- package/src/provider/GTProvider.tsx +51 -29
- package/src/provider/NativeGTProvider.tsx +1 -9
- package/src/setup/initializeGT.ts +7 -19
- package/src/utils/getInitialNativeConditions.ts +3 -6
- package/src/utils/getLocale.ts +2 -2
- package/src/utils/getNativeLocales.ts +1 -1
- package/src/utils/nativeStore.ts +4 -4
- package/src/utils/resolveLocale.ts +1 -5
- package/dist/commonjs/hooks/utils.js +0 -17
- package/dist/commonjs/hooks/utils.js.map +0 -1
- package/dist/commonjs/setup/initializeGT.js.map +0 -1
- package/dist/commonjs/utils/utils.js +0 -13
- package/dist/commonjs/utils/utils.js.map +0 -1
- package/dist/module/hooks/utils.d.ts +0 -3
- package/dist/module/hooks/utils.d.ts.map +0 -1
- package/dist/module/hooks/utils.js +0 -14
- package/dist/module/hooks/utils.js.map +0 -1
- package/dist/module/setup/initializeGT.js.map +0 -1
- package/dist/module/utils/utils.d.ts +0 -3
- package/dist/module/utils/utils.d.ts.map +0 -1
- package/dist/module/utils/utils.js +0 -12
- package/dist/module/utils/utils.js.map +0 -1
- package/src/hooks/utils.ts +0 -14
- package/src/utils/utils.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLocale.js","names":[],"sources":["../../../src/utils/resolveLocale.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\n\nexport function resolveLocale(candidates?: LocaleCandidates | null): string {\n
|
|
1
|
+
{"version":3,"file":"resolveLocale.js","names":[],"sources":["../../../src/utils/resolveLocale.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\n\nexport function resolveLocale(candidates?: LocaleCandidates | null): string {\n return getI18nConfig().resolveSupportedLocale(candidates ?? undefined);\n}\n"],"mappings":";;;;AAGA,SAAgB,cAAc,YAA8C;AAC1E,SAAA,GAAA,iBAAA,gBAAsB,CAAC,uBAAuB,cAAc,KAAA,EAAU"}
|
|
@@ -5,6 +5,5 @@ export interface Spec extends TurboModule {
|
|
|
5
5
|
nativeStoreGet(key: string): string | null;
|
|
6
6
|
nativeStoreSet(key: string, value: string): void;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default _default;
|
|
8
|
+
export declare const GtReactNative: Spec;
|
|
10
9
|
//# sourceMappingURL=NativeGtReactNative.d.ts.map
|
|
@@ -1 +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
|
|
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,eAAO,MAAM,aAAa,MAC+B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TurboModuleRegistry } from "react-native";
|
|
2
2
|
//#region src/NativeGtReactNative.ts
|
|
3
|
-
|
|
3
|
+
const GtReactNative = TurboModuleRegistry.getEnforcing("GtReactNative");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { GtReactNative };
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=NativeGtReactNative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGtReactNative.js","names":[],"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
|
|
1
|
+
{"version":3,"file":"NativeGtReactNative.js","names":[],"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 const GtReactNative =\n TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');\n"],"mappings":";;AASA,MAAa,gBACX,oBAAoB,aAAmB,gBAAgB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { LocaleCandidates, WritableConditionStoreInterface, WritableConditionStoreParams } from 'gt-i18n/internal/types';
|
|
2
2
|
export type NativeConditionStoreParams = WritableConditionStoreParams & {
|
|
3
|
-
localeStoreKey?: string;
|
|
4
|
-
regionStoreKey?: string;
|
|
5
|
-
enableI18nStoreKey?: string;
|
|
6
3
|
_reload?: ReloadType;
|
|
7
4
|
};
|
|
8
5
|
export type NativeConditionStoreState = {
|
|
@@ -15,12 +12,8 @@ export type ReloadType = (state: NativeConditionStoreState) => void;
|
|
|
15
12
|
* Condition store implementation for React Native.
|
|
16
13
|
*/
|
|
17
14
|
export declare class NativeConditionStore implements WritableConditionStoreInterface {
|
|
18
|
-
private localeStoreKey;
|
|
19
|
-
private regionStoreKey;
|
|
20
|
-
private enableI18nStoreKey;
|
|
21
15
|
private customReload;
|
|
22
16
|
constructor(config: NativeConditionStoreParams);
|
|
23
|
-
updateConfig: ({ localeStoreKey, regionStoreKey, enableI18nStoreKey, }: Pick<NativeConditionStoreParams, "localeStoreKey" | "regionStoreKey" | "enableI18nStoreKey">) => void;
|
|
24
17
|
getLocale: () => string;
|
|
25
18
|
setLocale: (locale: LocaleCandidates) => void;
|
|
26
19
|
getRegion: () => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeConditionStore.d.ts","sourceRoot":"","sources":["../../../src/condition-store/NativeConditionStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeConditionStore.d.ts","sourceRoot":"","sources":["../../../src/condition-store/NativeConditionStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAUhC,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,GAAG;IACtE,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;AAEpE;;GAEG;AACH,qBAAa,oBAAqB,YAAW,+BAA+B;IAC1E,OAAO,CAAC,YAAY,CAAa;gBAErB,MAAM,EAAE,0BAA0B;IAiB9C,SAAS,QAAO,MAAM,CAEpB;IAEF,SAAS,GAAI,QAAQ,gBAAgB,KAAG,IAAI,CAI1C;IAEF,SAAS,QAAO,MAAM,GAAG,SAAS,CAEhC;IAEF,SAAS,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,IAAI,CAG5C;IAEF,aAAa,QAAO,OAAO,CAEzB;IAEF,aAAa,GAAI,YAAY,OAAO,KAAG,IAAI,CAGzC;IAEF,YAAY,GAAI,QAAQ,gBAAgB,KAAG,IAAI,CAE7C;IAEF,YAAY,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,IAAI,CAE/C;IAEF,gBAAgB,GAAI,YAAY,OAAO,KAAG,IAAI,CAE5C;IAEF,MAAM,GAAI,QAAO,OAAO,CAAC,yBAAyB,CAAM,KAAG,IAAI,CAM7D;CACH"}
|
|
@@ -2,67 +2,50 @@ import { nativeStoreGet, nativeStoreSet } from "../utils/nativeStore.js";
|
|
|
2
2
|
import { resolveLocale } from "../utils/resolveLocale.js";
|
|
3
3
|
import { getLocale } from "../utils/getLocale.js";
|
|
4
4
|
import { getInitialEnableI18n, getInitialRegion } from "../utils/getInitialNativeConditions.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getI18nConfig } from "@generaltranslation/react-core/pure";
|
|
6
6
|
//#region src/condition-store/NativeConditionStore.ts
|
|
7
7
|
/**
|
|
8
8
|
* Condition store implementation for React Native.
|
|
9
9
|
*/
|
|
10
10
|
var NativeConditionStore = class {
|
|
11
|
-
localeStoreKey;
|
|
12
|
-
regionStoreKey;
|
|
13
|
-
enableI18nStoreKey;
|
|
14
11
|
customReload;
|
|
15
12
|
constructor(config) {
|
|
16
13
|
this.customReload = config._reload ?? (() => void 0);
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
this.enableI18nStoreKey = config.enableI18nStoreKey ?? defaultEnableI18nCookieName;
|
|
20
|
-
this.updateLocale(config.locale ?? getLocale({ localeStoreKey: this.localeStoreKey }));
|
|
21
|
-
const region = getInitialRegion({
|
|
22
|
-
region: config.region,
|
|
23
|
-
regionStoreKey: this.regionStoreKey
|
|
24
|
-
});
|
|
14
|
+
this.updateLocale(config.locale ?? getLocale());
|
|
15
|
+
const region = getInitialRegion({ region: config.region });
|
|
25
16
|
if (region !== void 0) this.updateRegion(region);
|
|
26
|
-
this.updateEnableI18n(getInitialEnableI18n({
|
|
27
|
-
enableI18n: config.enableI18n,
|
|
28
|
-
enableI18nStoreKey: this.enableI18nStoreKey
|
|
29
|
-
}));
|
|
17
|
+
this.updateEnableI18n(getInitialEnableI18n({ enableI18n: config.enableI18n }));
|
|
30
18
|
}
|
|
31
|
-
updateConfig = ({ localeStoreKey, regionStoreKey, enableI18nStoreKey }) => {
|
|
32
|
-
this.localeStoreKey = localeStoreKey ?? defaultLocaleCookieName;
|
|
33
|
-
this.regionStoreKey = regionStoreKey ?? defaultRegionCookieName;
|
|
34
|
-
this.enableI18nStoreKey = enableI18nStoreKey ?? defaultEnableI18nCookieName;
|
|
35
|
-
};
|
|
36
19
|
getLocale = () => {
|
|
37
|
-
return getLocale(
|
|
20
|
+
return getLocale();
|
|
38
21
|
};
|
|
39
22
|
setLocale = (locale) => {
|
|
40
23
|
const nextLocale = resolveLocale(locale);
|
|
41
|
-
nativeStoreSet(
|
|
24
|
+
nativeStoreSet(getLocaleStoreKey(), nextLocale);
|
|
42
25
|
this.reload({ locale: nextLocale });
|
|
43
26
|
};
|
|
44
27
|
getRegion = () => {
|
|
45
|
-
return nativeStoreGet(
|
|
28
|
+
return nativeStoreGet(getRegionStoreKey()) || void 0;
|
|
46
29
|
};
|
|
47
30
|
setRegion = (region) => {
|
|
48
31
|
this.updateRegion(region);
|
|
49
32
|
this.reload({ region });
|
|
50
33
|
};
|
|
51
34
|
getEnableI18n = () => {
|
|
52
|
-
return nativeStoreGet(
|
|
35
|
+
return nativeStoreGet(getEnableI18nStoreKey()) !== "false";
|
|
53
36
|
};
|
|
54
37
|
setEnableI18n = (enableI18n) => {
|
|
55
38
|
this.updateEnableI18n(enableI18n);
|
|
56
39
|
this.reload({ enableI18n });
|
|
57
40
|
};
|
|
58
41
|
updateLocale = (locale) => {
|
|
59
|
-
nativeStoreSet(
|
|
42
|
+
nativeStoreSet(getLocaleStoreKey(), resolveLocale(locale));
|
|
60
43
|
};
|
|
61
44
|
updateRegion = (region) => {
|
|
62
|
-
nativeStoreSet(
|
|
45
|
+
nativeStoreSet(getRegionStoreKey(), region ?? "");
|
|
63
46
|
};
|
|
64
47
|
updateEnableI18n = (enableI18n) => {
|
|
65
|
-
nativeStoreSet(
|
|
48
|
+
nativeStoreSet(getEnableI18nStoreKey(), enableI18n ? "true" : "false");
|
|
66
49
|
};
|
|
67
50
|
reload = (state = {}) => {
|
|
68
51
|
this.customReload({
|
|
@@ -72,6 +55,15 @@ var NativeConditionStore = class {
|
|
|
72
55
|
});
|
|
73
56
|
};
|
|
74
57
|
};
|
|
58
|
+
function getLocaleStoreKey() {
|
|
59
|
+
return getI18nConfig().getLocaleCookieName();
|
|
60
|
+
}
|
|
61
|
+
function getRegionStoreKey() {
|
|
62
|
+
return getI18nConfig().getRegionCookieName();
|
|
63
|
+
}
|
|
64
|
+
function getEnableI18nStoreKey() {
|
|
65
|
+
return getI18nConfig().getEnableI18nCookieName();
|
|
66
|
+
}
|
|
75
67
|
//#endregion
|
|
76
68
|
export { NativeConditionStore };
|
|
77
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeConditionStore.js","names":[
|
|
1
|
+
{"version":3,"file":"NativeConditionStore.js","names":[],"sources":["../../../src/condition-store/NativeConditionStore.ts"],"sourcesContent":["import type {\n LocaleCandidates,\n WritableConditionStoreInterface,\n WritableConditionStoreParams,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { nativeStoreGet, nativeStoreSet } from '../utils/nativeStore';\nimport { resolveLocale } from '../utils/resolveLocale';\n\nexport type NativeConditionStoreParams = WritableConditionStoreParams & {\n _reload?: ReloadType;\n};\n\nexport type NativeConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\n\nexport type ReloadType = (state: NativeConditionStoreState) => void;\n\n/**\n * Condition store implementation for React Native.\n */\nexport class NativeConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n\n constructor(config: NativeConditionStoreParams) {\n this.customReload = config._reload ?? (() => undefined);\n\n this.updateLocale(config.locale ?? getLocale());\n const region = getInitialRegion({\n region: config.region,\n });\n if (region !== undefined) {\n this.updateRegion(region);\n }\n this.updateEnableI18n(\n getInitialEnableI18n({\n enableI18n: config.enableI18n,\n })\n );\n }\n\n getLocale = (): string => {\n return getLocale();\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n const nextLocale = resolveLocale(locale);\n nativeStoreSet(getLocaleStoreKey(), nextLocale);\n this.reload({ locale: nextLocale });\n };\n\n getRegion = (): string | undefined => {\n return nativeStoreGet(getRegionStoreKey()) || undefined;\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload({ region });\n };\n\n getEnableI18n = (): boolean => {\n return nativeStoreGet(getEnableI18nStoreKey()) !== 'false';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload({ enableI18n });\n };\n\n updateLocale = (locale: LocaleCandidates): void => {\n nativeStoreSet(getLocaleStoreKey(), resolveLocale(locale));\n };\n\n updateRegion = (region: string | undefined): void => {\n nativeStoreSet(getRegionStoreKey(), region ?? '');\n };\n\n updateEnableI18n = (enableI18n: boolean): void => {\n nativeStoreSet(getEnableI18nStoreKey(), enableI18n ? 'true' : 'false');\n };\n\n reload = (state: Partial<NativeConditionStoreState> = {}): void => {\n this.customReload({\n locale: state.locale ?? this.getLocale(),\n region: 'region' in state ? state.region : this.getRegion(),\n enableI18n: state.enableI18n ?? this.getEnableI18n(),\n });\n };\n}\n\nfunction getLocaleStoreKey(): string {\n return getI18nConfig().getLocaleCookieName();\n}\n\nfunction getRegionStoreKey(): string {\n return getI18nConfig().getRegionCookieName();\n}\n\nfunction getEnableI18nStoreKey(): string {\n return getI18nConfig().getEnableI18nCookieName();\n}\n"],"mappings":";;;;;;;;;AA6BA,IAAa,uBAAb,MAA6E;CAC3E;CAEA,YAAY,QAAoC;AAC9C,OAAK,eAAe,OAAO,kBAAkB,KAAA;AAE7C,OAAK,aAAa,OAAO,UAAU,WAAW,CAAC;EAC/C,MAAM,SAAS,iBAAiB,EAC9B,QAAQ,OAAO,QAChB,CAAC;AACF,MAAI,WAAW,KAAA,EACb,MAAK,aAAa,OAAO;AAE3B,OAAK,iBACH,qBAAqB,EACnB,YAAY,OAAO,YACpB,CAAC,CACH;;CAGH,kBAA0B;AACxB,SAAO,WAAW;;CAGpB,aAAa,WAAmC;EAC9C,MAAM,aAAa,cAAc,OAAO;AACxC,iBAAe,mBAAmB,EAAE,WAAW;AAC/C,OAAK,OAAO,EAAE,QAAQ,YAAY,CAAC;;CAGrC,kBAAsC;AACpC,SAAO,eAAe,mBAAmB,CAAC,IAAI,KAAA;;CAGhD,aAAa,WAAqC;AAChD,OAAK,aAAa,OAAO;AACzB,OAAK,OAAO,EAAE,QAAQ,CAAC;;CAGzB,sBAA+B;AAC7B,SAAO,eAAe,uBAAuB,CAAC,KAAK;;CAGrD,iBAAiB,eAA8B;AAC7C,OAAK,iBAAiB,WAAW;AACjC,OAAK,OAAO,EAAE,YAAY,CAAC;;CAG7B,gBAAgB,WAAmC;AACjD,iBAAe,mBAAmB,EAAE,cAAc,OAAO,CAAC;;CAG5D,gBAAgB,WAAqC;AACnD,iBAAe,mBAAmB,EAAE,UAAU,GAAG;;CAGnD,oBAAoB,eAA8B;AAChD,iBAAe,uBAAuB,EAAE,aAAa,SAAS,QAAQ;;CAGxE,UAAU,QAA4C,EAAE,KAAW;AACjE,OAAK,aAAa;GAChB,QAAQ,MAAM,UAAU,KAAK,WAAW;GACxC,QAAQ,YAAY,QAAQ,MAAM,SAAS,KAAK,WAAW;GAC3D,YAAY,MAAM,cAAc,KAAK,eAAe;GACrD,CAAC;;;AAIN,SAAS,oBAA4B;AACnC,QAAO,eAAe,CAAC,qBAAqB;;AAG9C,SAAS,oBAA4B;AACnC,QAAO,eAAe,CAAC,qBAAqB;;AAG9C,SAAS,wBAAgC;AACvC,QAAO,eAAe,CAAC,yBAAyB"}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
import type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';
|
|
2
|
-
export declare function useLocaleSelector(locales?: string[]): {
|
|
3
|
-
locale: string;
|
|
4
|
-
locales: string[];
|
|
5
|
-
getLocaleProperties: (locale: string) => {
|
|
6
|
-
code: string;
|
|
7
|
-
name: string;
|
|
8
|
-
nativeName: string;
|
|
9
|
-
languageCode: string;
|
|
10
|
-
languageName: string;
|
|
11
|
-
nativeLanguageName: string;
|
|
12
|
-
nameWithRegionCode: string;
|
|
13
|
-
nativeNameWithRegionCode: string;
|
|
14
|
-
regionCode: string;
|
|
15
|
-
regionName: string;
|
|
16
|
-
nativeRegionName: string;
|
|
17
|
-
scriptCode: string;
|
|
18
|
-
scriptName: string;
|
|
19
|
-
nativeScriptName: string;
|
|
20
|
-
maximizedCode: string;
|
|
21
|
-
maximizedName: string;
|
|
22
|
-
nativeMaximizedName: string;
|
|
23
|
-
minimizedCode: string;
|
|
24
|
-
minimizedName: string;
|
|
25
|
-
nativeMinimizedName: string;
|
|
26
|
-
emoji: string;
|
|
27
|
-
};
|
|
1
|
+
import type { InternalLocaleSelectorResult, InternalRegionSelectorOptions, InternalRegionSelectorResult } from '@generaltranslation/react-core/hooks';
|
|
2
|
+
export declare function useLocaleSelector(locales?: string[]): InternalLocaleSelectorResult & {
|
|
28
3
|
setLocale: (locale: string) => void;
|
|
29
4
|
};
|
|
30
|
-
export declare function useRegionSelector(options?: InternalRegionSelectorOptions): {
|
|
31
|
-
region: string | undefined;
|
|
32
|
-
regions: string[];
|
|
33
|
-
regionData: Map<string, import("@generaltranslation/react-core/hooks").RegionData>;
|
|
34
|
-
locale: string;
|
|
35
|
-
localeRegion: string;
|
|
5
|
+
export declare function useRegionSelector(options?: InternalRegionSelectorOptions): InternalRegionSelectorResult & {
|
|
36
6
|
setLocale: (locale: string) => void;
|
|
37
7
|
setRegion: (region: string | undefined) => void;
|
|
38
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/hooks/selectors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/hooks/selectors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAK9C,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,4BAA4B,GAAG;IAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAGxE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,6BAA6B,GACtC,4BAA4B,GAAG;IAChC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACjD,CAIA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","names":[],"sources":["../../../src/hooks/selectors.ts"],"sourcesContent":["import { useSetLocale, useSetRegion } from './condition-store';\nimport {\n useInternalLocaleSelector,\n useInternalRegionSelector,\n} from '@generaltranslation/react-core/hooks';\nimport type {
|
|
1
|
+
{"version":3,"file":"selectors.js","names":[],"sources":["../../../src/hooks/selectors.ts"],"sourcesContent":["import { useSetLocale, useSetRegion } from './condition-store';\nimport {\n useInternalLocaleSelector,\n useInternalRegionSelector,\n} from '@generaltranslation/react-core/hooks';\nimport type {\n InternalLocaleSelectorResult,\n InternalRegionSelectorOptions,\n InternalRegionSelectorResult,\n} from '@generaltranslation/react-core/hooks';\n\n// Explicit return types are required: project references make TypeScript try to\n// name the inferred selector types, which otherwise reach into\n// generaltranslation's non-portable bundled declarations (TS2742).\nexport function useLocaleSelector(\n locales?: string[]\n): InternalLocaleSelectorResult & { setLocale: (locale: string) => void } {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n\nexport function useRegionSelector(\n options?: InternalRegionSelectorOptions\n): InternalRegionSelectorResult & {\n setLocale: (locale: string) => void;\n setRegion: (region: string | undefined) => void;\n} {\n const setLocale = useSetLocale();\n const setRegion = useSetRegion();\n return { setLocale, setRegion, ...useInternalRegionSelector(options) };\n}\n"],"mappings":";;;AAcA,SAAgB,kBACd,SACwE;AAExE,QAAO;EAAE,WADS,cACA;EAAE,GAAG,0BAA0B,QAAQ;EAAE;;AAG7D,SAAgB,kBACd,SAIA;AAGA,QAAO;EAAE,WAFS,cAEA;EAAE,WADF,cACW;EAAE,GAAG,0BAA0B,QAAQ;EAAE"}
|
package/dist/module/index.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
export { useLocale, useCustomMapping, useDefaultLocale, useEnableI18n, useLocales, useFormatLocales, useGT, useMessages, useTranslations, } from '@generaltranslation/react-core/hooks';
|
|
15
|
-
export { msg, decodeMsg, decodeOptions, derive, declareVar, decodeVars, mFallback, gtFallback, getFormatLocales, getTranslationsSnapshot, getReactI18nCache, setReactI18nCache, createRenderPipeline, } from '@generaltranslation/react-core/pure';
|
|
16
|
-
export { useRegion, useGTClass, useLocaleProperties, } from '@generaltranslation/react-core/hooks';
|
|
17
|
-
export { GTProvider, useSetLocale, useSetRegion, useSetEnableI18n, useLocaleSelector, useRegionSelector, useLocaleDirection, useVersionId, getLocaleFromNativeStore, getLocale, initializeGT, };
|
|
18
|
-
export type { DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions, RenderPipeline, RenderPreparedT, GTProviderProps, GetLocaleParams, InitializeGTParams, };
|
|
1
|
+
export { Branch, Currency, DateTime, Derive, Num, Plural, RelativeTime, T, Var, } from '@generaltranslation/react-core/components';
|
|
2
|
+
export { GTProvider } from './provider/GTProvider';
|
|
3
|
+
export { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations, } from '@generaltranslation/react-core/hooks';
|
|
4
|
+
export { useSetLocale, useSetRegion, useSetEnableI18n, } from './hooks/condition-store';
|
|
5
|
+
export { useLocaleSelector, useRegionSelector } from './hooks/selectors';
|
|
6
|
+
export { createRenderPipeline, decodeMsg, decodeOptions, decodeVars, declareVar, derive, getDefaultLocale, getFormatLocales, getLocales, resolveCanonicalLocale, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, setReactI18nCache, } from '@generaltranslation/react-core/pure';
|
|
7
|
+
export { getLocaleFromNativeStore } from './utils/nativeStore';
|
|
8
|
+
export { getLocale } from './utils/getLocale';
|
|
9
|
+
export { initializeGT } from './setup/initializeGT';
|
|
10
|
+
export type { GTTranslationOptions, RuntimeTranslationOptions, RenderPipeline, RenderPreparedT, } from '@generaltranslation/react-core/pure';
|
|
11
|
+
export type { GTProviderProps } from './provider/GTProvider';
|
|
12
|
+
export type { GetLocaleParams } from './utils/getLocale';
|
|
13
|
+
export type { InitializeGTParams } from './setup/initializeGT';
|
|
19
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,GAAG,EACH,MAAM,EACN,YAAY,EACZ,CAAC,EACD,GAAG,GACJ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,GAAG,EACH,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,cAAc,EACd,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/module/index.js
CHANGED
|
@@ -3,9 +3,8 @@ import { getLocale } from "./utils/getLocale.js";
|
|
|
3
3
|
import { GTProvider } from "./provider/GTProvider.js";
|
|
4
4
|
import { useSetEnableI18n, useSetLocale, useSetRegion } from "./hooks/condition-store.js";
|
|
5
5
|
import { useLocaleSelector, useRegionSelector } from "./hooks/selectors.js";
|
|
6
|
-
import { useLocaleDirection, useVersionId } from "./hooks/utils.js";
|
|
7
6
|
import { initializeGT } from "./setup/initializeGT.js";
|
|
8
|
-
import { createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getFormatLocales, getReactI18nCache, getTranslationsSnapshot, gtFallback, mFallback, msg, setReactI18nCache } from "@generaltranslation/react-core/pure";
|
|
9
7
|
import { Branch, Currency, DateTime, Derive, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
10
|
-
import {
|
|
11
|
-
|
|
8
|
+
import { createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, resolveCanonicalLocale, setReactI18nCache } from "@generaltranslation/react-core/pure";
|
|
9
|
+
import { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations } from "@generaltranslation/react-core/hooks";
|
|
10
|
+
export { Branch, Currency, DateTime, Derive, GTProvider, Num, Plural, RelativeTime, T, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocale, getLocaleFromNativeStore, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, initializeGT, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocaleSelector, useLocales, useMessages, useRegion, useRegionSelector, useSetEnableI18n, useSetLocale, useSetRegion, useTranslations };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginObj, types } from '@babel/core';
|
|
2
2
|
import { type PluginOptions } from './types';
|
|
3
|
-
export
|
|
3
|
+
export declare function plugin(babel: {
|
|
4
4
|
types: typeof types;
|
|
5
5
|
}, { locales, config, configFilePath, entryPointFilePath, excludePolyfills, }: PluginOptions): PluginObj;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,
|
|
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,wBAAgB,MAAM,CACpB,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"}
|
|
@@ -2,7 +2,7 @@ import { LOCALE_POLYFILLS, POLYFILLS } from "./types.js";
|
|
|
2
2
|
import { resolveLocales } from "./utils/resolveLocales.js";
|
|
3
3
|
import * as path$1 from "path";
|
|
4
4
|
//#region src/plugin-dir/index.ts
|
|
5
|
-
function
|
|
5
|
+
function plugin(babel, { locales, config, configFilePath, entryPointFilePath = path$1.resolve(process.cwd(), "src", "App.tsx"), excludePolyfills = [] }) {
|
|
6
6
|
const { types: t } = babel;
|
|
7
7
|
return {
|
|
8
8
|
name: "gt-react-native/plugin",
|
|
@@ -27,6 +27,6 @@ function plugin_dir_default(babel, { locales, config, configFilePath, entryPoint
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
export {
|
|
30
|
+
export { plugin };
|
|
31
31
|
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["path"],"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
|
|
1
|
+
{"version":3,"file":"index.js","names":["path"],"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 function plugin(\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,SAAgB,OACd,OACA,EACE,SACA,QACA,gBACA,qBAAqBA,OAAK,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,OALwBA,OAAK,QAC3B,MAAM,YAAY,MAAM,KAAK,KAAK,YAAY,GAI7B,KAAK,mBACtB;GAGF,MAAM,kBAAkB,eAAe;IACrC;IACA;IACA;IACD,CAAC;GAGF,MAAM,UAAU,CACd,GAAG,UAAU,QACV,aAAa,CAAC,iBAAiB,SAAS,SAAS,CACnD,EACD,GAAG,gBAAgB,SAAS,WAC1B,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"}
|
package/dist/module/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { plugin } from './plugin-dir';
|
|
2
2
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/module/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
1
|
+
import { plugin } from "./plugin-dir/index.js";
|
|
2
|
+
export { plugin };
|
|
@@ -5,7 +5,7 @@ import type { NativeConditionStoreParams } from '../condition-store/NativeCondit
|
|
|
5
5
|
export type GTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore' | 'translations'> & Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
locale?: LocaleCandidates;
|
|
8
|
-
|
|
8
|
+
fallback?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export declare function GTProvider(props: GTProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
//# sourceMappingURL=GTProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;AAajD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,GAAG,cAAc,CAChD,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAKJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAEhD"}
|
|
@@ -8,34 +8,25 @@ import { Suspense, use, useCallback, useMemo, useState } from "react";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/provider/GTProvider.tsx
|
|
10
10
|
function GTProvider(props) {
|
|
11
|
-
|
|
12
|
-
return /* @__PURE__ */ jsx(Suspense, {
|
|
13
|
-
fallback: loadingFallback ?? /* @__PURE__ */ jsx(DefaultLoadingFallback, {}),
|
|
14
|
-
children: /* @__PURE__ */ jsx(LoadableGTProvider, { ...providerProps })
|
|
15
|
-
});
|
|
11
|
+
return /* @__PURE__ */ jsx(LoadableGTProvider, { ...props });
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
14
|
* This wrapper takes the place of a loader that would be present in
|
|
19
15
|
* SSR style applications.
|
|
20
16
|
*/
|
|
21
17
|
function LoadableGTProvider(props) {
|
|
22
|
-
const {
|
|
18
|
+
const { fallback, ...providerProps } = props;
|
|
19
|
+
const renderedFallback = fallback ?? /* @__PURE__ */ jsx(DefaultLoadingFallback, {});
|
|
20
|
+
const { locale, region, enableI18n } = providerProps;
|
|
23
21
|
const [nativeConditions, setNativeConditions] = useState(() => ({
|
|
24
|
-
locale: getLocale(
|
|
25
|
-
region: getInitialRegion({
|
|
26
|
-
|
|
27
|
-
regionStoreKey
|
|
28
|
-
}),
|
|
29
|
-
enableI18n: getInitialEnableI18n({
|
|
30
|
-
enableI18n,
|
|
31
|
-
enableI18nStoreKey
|
|
32
|
-
})
|
|
22
|
+
locale: getLocale(),
|
|
23
|
+
region: getInitialRegion({ region }),
|
|
24
|
+
enableI18n: getInitialEnableI18n({ enableI18n })
|
|
33
25
|
}));
|
|
34
26
|
const activeLocale = resolveLocale(locale ?? nativeConditions.locale);
|
|
35
27
|
const activeRegion = region ?? nativeConditions.region;
|
|
36
28
|
const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;
|
|
37
|
-
const
|
|
38
|
-
const translations = useMemo(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
29
|
+
const fallbackTranslations = useMemo(() => ({ [activeLocale]: {} }), [activeLocale]);
|
|
39
30
|
const reload = useCallback((state) => {
|
|
40
31
|
setNativeConditions((previousState) => ({
|
|
41
32
|
locale: locale === void 0 ? state.locale : previousState.locale,
|
|
@@ -47,13 +38,33 @@ function LoadableGTProvider(props) {
|
|
|
47
38
|
locale,
|
|
48
39
|
region
|
|
49
40
|
]);
|
|
41
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
42
|
+
fallback: /* @__PURE__ */ jsx(NativeGTProvider, {
|
|
43
|
+
...providerProps,
|
|
44
|
+
locale: activeLocale,
|
|
45
|
+
region: activeRegion,
|
|
46
|
+
enableI18n: activeEnableI18n,
|
|
47
|
+
translations: fallbackTranslations,
|
|
48
|
+
_reload: reload,
|
|
49
|
+
children: renderedFallback
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ jsx(LoadedGTProvider, {
|
|
52
|
+
...providerProps,
|
|
53
|
+
locale: activeLocale,
|
|
54
|
+
region: activeRegion,
|
|
55
|
+
enableI18n: activeEnableI18n,
|
|
56
|
+
_reload: reload
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function LoadedGTProvider(props) {
|
|
61
|
+
const activeLocale = resolveLocale(props.locale);
|
|
62
|
+
const localeTranslations = use(loadTranslations(activeLocale));
|
|
63
|
+
const translations = useMemo(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
50
64
|
return /* @__PURE__ */ jsx(NativeGTProvider, {
|
|
51
65
|
...props,
|
|
52
66
|
locale: activeLocale,
|
|
53
|
-
|
|
54
|
-
enableI18n: activeEnableI18n,
|
|
55
|
-
translations,
|
|
56
|
-
_reload: reload
|
|
67
|
+
translations
|
|
57
68
|
});
|
|
58
69
|
}
|
|
59
70
|
function DefaultLoadingFallback() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.js","names":[],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {
|
|
1
|
+
{"version":3,"file":"GTProvider.js","names":[],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore' | 'translations'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,oBAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,oBAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,uBACvB,gBAA2C;EACzC,QAAQ,WAAW;EACnB,QAAQ,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAY,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAe,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,uBAAuB,eACpB,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,SAAS,aACZ,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,oBAAC,UAAD;EACE,UACE,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAe,cAAc,MAAM,OAAO;CAChD,MAAM,qBAAqB,IAAI,iBAAiB,aAAa,CAAC;CAC9D,MAAM,eAAe,eACZ,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,oBAAC,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,oBAAC,MAAD;EAAM,OAAO,OAAO;YAClB,oBAAC,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAAS,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,CAC/B,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,CAC/B,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAiB5D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeConditionStore } from "../condition-store/NativeConditionStore.js";
|
|
2
|
-
import { useMemo, useRef } from "react";
|
|
3
2
|
import { I18nStore, InternalGTProvider } from "@generaltranslation/react-core/components";
|
|
3
|
+
import { useMemo, useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/provider/NativeGTProvider.tsx
|
|
6
6
|
function NativeGTProvider(props) {
|
|
@@ -10,9 +10,6 @@ function NativeGTProvider(props) {
|
|
|
10
10
|
props.locale,
|
|
11
11
|
props.region,
|
|
12
12
|
props.enableI18n,
|
|
13
|
-
props.localeStoreKey,
|
|
14
|
-
props.regionStoreKey,
|
|
15
|
-
props.enableI18nStoreKey,
|
|
16
13
|
props._reload
|
|
17
14
|
]);
|
|
18
15
|
const i18nStoreRef = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGTProvider.js","names":[],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [
|
|
1
|
+
{"version":3,"file":"NativeGTProvider.js","names":[],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,iBAAiB,cAAc;AACnC,SAAO,IAAI,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAI,WAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ReactI18nCacheParams } from '@generaltranslation/react-core/pure';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function initializeGT(config: InitializeGTParams): void;
|
|
1
|
+
import type { I18nConfigParams, ReactI18nCacheParams } from '@generaltranslation/react-core/pure';
|
|
2
|
+
export type InitializeGTParams = I18nConfigParams & ReactI18nCacheParams;
|
|
3
|
+
export { internalInitializeGTSRA as initializeGT } from '@generaltranslation/react-core/pure';
|
|
5
4
|
//# sourceMappingURL=initializeGT.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeGT.d.ts","sourceRoot":"","sources":["../../../src/setup/initializeGT.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializeGT.d.ts","sourceRoot":"","sources":["../../../src/setup/initializeGT.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAKzE,OAAO,EAAE,uBAAuB,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { setupGTServicesEnabled } from "gt-i18n/internal";
|
|
3
|
-
//#region src/setup/initializeGT.ts
|
|
4
|
-
function initializeGT(config) {
|
|
5
|
-
setupGTServicesEnabled(config);
|
|
6
|
-
initializeI18nConfig(config, "server-render");
|
|
7
|
-
setReactI18nCache(new ReactI18nCache(config));
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
1
|
+
import { internalInitializeGTSRA as initializeGT } from "@generaltranslation/react-core/pure";
|
|
10
2
|
export { initializeGT };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=initializeGT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInitialNativeConditions.d.ts","sourceRoot":"","sources":["../../../src/utils/getInitialNativeConditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"getInitialNativeConditions.d.ts","sourceRoot":"","sources":["../../../src/utils/getInitialNativeConditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAI3E,KAAK,mBAAmB,GAAG,IAAI,CAAC,4BAA4B,EAAE,QAAQ,CAAC,GAAG;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,uBAAuB,GAAG,IAAI,CACjC,4BAA4B,EAC5B,YAAY,CACb,GAAG;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,cAAsD,GACvD,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAG1C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,kBAA8D,GAC/D,EAAE,uBAAuB,GAAG,OAAO,CAKnC"}
|