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.
Files changed (101) hide show
  1. package/dist/commonjs/NativeGtReactNative.js +3 -6
  2. package/dist/commonjs/NativeGtReactNative.js.map +1 -1
  3. package/dist/commonjs/condition-store/NativeConditionStore.js +19 -27
  4. package/dist/commonjs/condition-store/NativeConditionStore.js.map +1 -1
  5. package/dist/commonjs/hooks/selectors.js.map +1 -1
  6. package/dist/commonjs/index.js +35 -10
  7. package/dist/commonjs/plugin-dir/index.js +3 -6
  8. package/dist/commonjs/plugin-dir/index.js.map +1 -1
  9. package/dist/commonjs/plugin.js +2 -5
  10. package/dist/commonjs/provider/GTProvider.js +32 -21
  11. package/dist/commonjs/provider/GTProvider.js.map +1 -1
  12. package/dist/commonjs/provider/NativeGTProvider.js +1 -4
  13. package/dist/commonjs/provider/NativeGTProvider.js.map +1 -1
  14. package/dist/commonjs/setup/initializeGT.js +6 -11
  15. package/dist/commonjs/utils/getInitialNativeConditions.js +2 -2
  16. package/dist/commonjs/utils/getInitialNativeConditions.js.map +1 -1
  17. package/dist/commonjs/utils/getLocale.js +1 -1
  18. package/dist/commonjs/utils/getLocale.js.map +1 -1
  19. package/dist/commonjs/utils/getNativeLocales.js +1 -1
  20. package/dist/commonjs/utils/getNativeLocales.js.map +1 -1
  21. package/dist/commonjs/utils/nativeStore.js +4 -4
  22. package/dist/commonjs/utils/nativeStore.js.map +1 -1
  23. package/dist/commonjs/utils/resolveLocale.js +1 -2
  24. package/dist/commonjs/utils/resolveLocale.js.map +1 -1
  25. package/dist/module/NativeGtReactNative.d.ts +1 -2
  26. package/dist/module/NativeGtReactNative.d.ts.map +1 -1
  27. package/dist/module/NativeGtReactNative.js +2 -2
  28. package/dist/module/NativeGtReactNative.js.map +1 -1
  29. package/dist/module/condition-store/NativeConditionStore.d.ts +0 -7
  30. package/dist/module/condition-store/NativeConditionStore.d.ts.map +1 -1
  31. package/dist/module/condition-store/NativeConditionStore.js +20 -28
  32. package/dist/module/condition-store/NativeConditionStore.js.map +1 -1
  33. package/dist/module/hooks/selectors.d.ts +3 -33
  34. package/dist/module/hooks/selectors.d.ts.map +1 -1
  35. package/dist/module/hooks/selectors.js.map +1 -1
  36. package/dist/module/index.d.ts +13 -18
  37. package/dist/module/index.d.ts.map +1 -1
  38. package/dist/module/index.js +3 -4
  39. package/dist/module/plugin-dir/index.d.ts +1 -1
  40. package/dist/module/plugin-dir/index.d.ts.map +1 -1
  41. package/dist/module/plugin-dir/index.js +2 -2
  42. package/dist/module/plugin-dir/index.js.map +1 -1
  43. package/dist/module/plugin.d.ts +1 -1
  44. package/dist/module/plugin.d.ts.map +1 -1
  45. package/dist/module/plugin.js +2 -2
  46. package/dist/module/provider/GTProvider.d.ts +1 -1
  47. package/dist/module/provider/GTProvider.d.ts.map +1 -1
  48. package/dist/module/provider/GTProvider.js +32 -21
  49. package/dist/module/provider/GTProvider.js.map +1 -1
  50. package/dist/module/provider/NativeGTProvider.d.ts.map +1 -1
  51. package/dist/module/provider/NativeGTProvider.js +1 -4
  52. package/dist/module/provider/NativeGTProvider.js.map +1 -1
  53. package/dist/module/setup/initializeGT.d.ts +3 -4
  54. package/dist/module/setup/initializeGT.d.ts.map +1 -1
  55. package/dist/module/setup/initializeGT.js +1 -11
  56. package/dist/module/utils/getInitialNativeConditions.d.ts.map +1 -1
  57. package/dist/module/utils/getInitialNativeConditions.js +3 -3
  58. package/dist/module/utils/getInitialNativeConditions.js.map +1 -1
  59. package/dist/module/utils/getLocale.d.ts.map +1 -1
  60. package/dist/module/utils/getLocale.js +2 -2
  61. package/dist/module/utils/getLocale.js.map +1 -1
  62. package/dist/module/utils/getNativeLocales.js +2 -2
  63. package/dist/module/utils/getNativeLocales.js.map +1 -1
  64. package/dist/module/utils/nativeStore.d.ts +1 -1
  65. package/dist/module/utils/nativeStore.d.ts.map +1 -1
  66. package/dist/module/utils/nativeStore.js +6 -6
  67. package/dist/module/utils/nativeStore.js.map +1 -1
  68. package/dist/module/utils/resolveLocale.d.ts.map +1 -1
  69. package/dist/module/utils/resolveLocale.js +1 -2
  70. package/dist/module/utils/resolveLocale.js.map +1 -1
  71. package/package.json +6 -6
  72. package/src/NativeGtReactNative.ts +2 -1
  73. package/src/condition-store/NativeConditionStore.ts +21 -40
  74. package/src/hooks/selectors.ts +17 -3
  75. package/src/index.tsx +39 -67
  76. package/src/plugin-dir/index.ts +1 -1
  77. package/src/plugin.ts +1 -1
  78. package/src/provider/GTProvider.tsx +51 -29
  79. package/src/provider/NativeGTProvider.tsx +1 -9
  80. package/src/setup/initializeGT.ts +7 -19
  81. package/src/utils/getInitialNativeConditions.ts +3 -6
  82. package/src/utils/getLocale.ts +2 -2
  83. package/src/utils/getNativeLocales.ts +1 -1
  84. package/src/utils/nativeStore.ts +4 -4
  85. package/src/utils/resolveLocale.ts +1 -5
  86. package/dist/commonjs/hooks/utils.js +0 -17
  87. package/dist/commonjs/hooks/utils.js.map +0 -1
  88. package/dist/commonjs/setup/initializeGT.js.map +0 -1
  89. package/dist/commonjs/utils/utils.js +0 -13
  90. package/dist/commonjs/utils/utils.js.map +0 -1
  91. package/dist/module/hooks/utils.d.ts +0 -3
  92. package/dist/module/hooks/utils.d.ts.map +0 -1
  93. package/dist/module/hooks/utils.js +0 -14
  94. package/dist/module/hooks/utils.js.map +0 -1
  95. package/dist/module/setup/initializeGT.js.map +0 -1
  96. package/dist/module/utils/utils.d.ts +0 -3
  97. package/dist/module/utils/utils.d.ts.map +0 -1
  98. package/dist/module/utils/utils.js +0 -12
  99. package/dist/module/utils/utils.js.map +0 -1
  100. package/src/hooks/utils.ts +0 -14
  101. 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 const i18nConfig = getI18nConfig();\n return (\n i18nConfig.determineLocale(candidates ?? undefined) ||\n i18nConfig.getDefaultLocale()\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,cAAc,YAA8C;CAC1E,MAAM,cAAA,GAAA,iBAAA,gBAA4B;AAClC,QACE,WAAW,gBAAgB,cAAc,KAAA,EAAU,IACnD,WAAW,kBAAkB"}
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 _default: Spec;
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;;AAED,wBAAuE"}
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
- var NativeGtReactNative_default = TurboModuleRegistry.getEnforcing("GtReactNative");
3
+ const GtReactNative = TurboModuleRegistry.getEnforcing("GtReactNative");
4
4
  //#endregion
5
- export { NativeGtReactNative_default as default };
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 default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');\n"],"mappings":";;AASA,IAAA,8BAAe,oBAAoB,aAAmB,gBAAgB"}
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;AAchC,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,GAAG;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,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,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,YAAY,CAAa;gBAErB,MAAM,EAAE,0BAA0B;IAyB9C,YAAY,GAAI,yDAIb,IAAI,CACL,0BAA0B,EAC1B,gBAAgB,GAAG,gBAAgB,GAAG,oBAAoB,CAC3D,KAAG,IAAI,CAIN;IAEF,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"}
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 { defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName } from "@generaltranslation/react-core/pure";
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.localeStoreKey = config.localeStoreKey ?? defaultLocaleCookieName;
18
- this.regionStoreKey = config.regionStoreKey ?? defaultRegionCookieName;
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({ localeStoreKey: this.localeStoreKey });
20
+ return getLocale();
38
21
  };
39
22
  setLocale = (locale) => {
40
23
  const nextLocale = resolveLocale(locale);
41
- nativeStoreSet(this.localeStoreKey, nextLocale);
24
+ nativeStoreSet(getLocaleStoreKey(), nextLocale);
42
25
  this.reload({ locale: nextLocale });
43
26
  };
44
27
  getRegion = () => {
45
- return nativeStoreGet(this.regionStoreKey) || void 0;
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(this.enableI18nStoreKey) !== "false";
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(this.localeStoreKey, resolveLocale(locale));
42
+ nativeStoreSet(getLocaleStoreKey(), resolveLocale(locale));
60
43
  };
61
44
  updateRegion = (region) => {
62
- nativeStoreSet(this.regionStoreKey, region ?? "");
45
+ nativeStoreSet(getRegionStoreKey(), region ?? "");
63
46
  };
64
47
  updateEnableI18n = (enableI18n) => {
65
- nativeStoreSet(this.enableI18nStoreKey, enableI18n ? "true" : "false");
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":["defaultLocaleStoreKey","defaultRegionStoreKey","defaultEnableI18nStoreKey"],"sources":["../../../src/condition-store/NativeConditionStore.ts"],"sourcesContent":["import type {\n LocaleCandidates,\n WritableConditionStoreInterface,\n WritableConditionStoreParams,\n} from 'gt-i18n/internal/types';\nimport {\n defaultEnableI18nCookieName as defaultEnableI18nStoreKey,\n defaultLocaleCookieName as defaultLocaleStoreKey,\n defaultRegionCookieName as defaultRegionStoreKey,\n} 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 localeStoreKey?: string;\n regionStoreKey?: string;\n enableI18nStoreKey?: string;\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 localeStoreKey: string;\n private regionStoreKey: string;\n private enableI18nStoreKey: string;\n private customReload: ReloadType;\n\n constructor(config: NativeConditionStoreParams) {\n this.customReload = config._reload ?? (() => undefined);\n this.localeStoreKey = config.localeStoreKey ?? defaultLocaleStoreKey;\n this.regionStoreKey = config.regionStoreKey ?? defaultRegionStoreKey;\n this.enableI18nStoreKey =\n config.enableI18nStoreKey ?? defaultEnableI18nStoreKey;\n\n this.updateLocale(\n config.locale ?? getLocale({ localeStoreKey: this.localeStoreKey })\n );\n const region = getInitialRegion({\n region: config.region,\n regionStoreKey: this.regionStoreKey,\n });\n if (region !== undefined) {\n this.updateRegion(region);\n }\n this.updateEnableI18n(\n getInitialEnableI18n({\n enableI18n: config.enableI18n,\n enableI18nStoreKey: this.enableI18nStoreKey,\n })\n );\n }\n\n updateConfig = ({\n localeStoreKey,\n regionStoreKey,\n enableI18nStoreKey,\n }: Pick<\n NativeConditionStoreParams,\n 'localeStoreKey' | 'regionStoreKey' | 'enableI18nStoreKey'\n >): void => {\n this.localeStoreKey = localeStoreKey ?? defaultLocaleStoreKey;\n this.regionStoreKey = regionStoreKey ?? defaultRegionStoreKey;\n this.enableI18nStoreKey = enableI18nStoreKey ?? defaultEnableI18nStoreKey;\n };\n\n getLocale = (): string => {\n return getLocale({ localeStoreKey: this.localeStoreKey });\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n const nextLocale = resolveLocale(locale);\n nativeStoreSet(this.localeStoreKey, nextLocale);\n this.reload({ locale: nextLocale });\n };\n\n getRegion = (): string | undefined => {\n return nativeStoreGet(this.regionStoreKey) || 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(this.enableI18nStoreKey) !== '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(this.localeStoreKey, resolveLocale(locale));\n };\n\n updateRegion = (region: string | undefined): void => {\n nativeStoreSet(this.regionStoreKey, region ?? '');\n };\n\n updateEnableI18n = (enableI18n: boolean): void => {\n nativeStoreSet(this.enableI18nStoreKey, 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"],"mappings":";;;;;;;;;AAoCA,IAAa,uBAAb,MAA6E;CAC3E;CACA;CACA;CACA;CAEA,YAAY,QAAoC;AAC9C,OAAK,eAAe,OAAO,kBAAkB,KAAA;AAC7C,OAAK,iBAAiB,OAAO,kBAAkBA;AAC/C,OAAK,iBAAiB,OAAO,kBAAkBC;AAC/C,OAAK,qBACH,OAAO,sBAAsBC;AAE/B,OAAK,aACH,OAAO,UAAU,UAAU,EAAE,gBAAgB,KAAK,gBAAgB,CAAC,CACpE;EACD,MAAM,SAAS,iBAAiB;GAC9B,QAAQ,OAAO;GACf,gBAAgB,KAAK;GACtB,CAAC;AACF,MAAI,WAAW,KAAA,EACb,MAAK,aAAa,OAAO;AAE3B,OAAK,iBACH,qBAAqB;GACnB,YAAY,OAAO;GACnB,oBAAoB,KAAK;GAC1B,CAAC,CACH;;CAGH,gBAAgB,EACd,gBACA,gBACA,yBAIU;AACV,OAAK,iBAAiB,kBAAkBF;AACxC,OAAK,iBAAiB,kBAAkBC;AACxC,OAAK,qBAAqB,sBAAsBC;;CAGlD,kBAA0B;AACxB,SAAO,UAAU,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;;CAG3D,aAAa,WAAmC;EAC9C,MAAM,aAAa,cAAc,OAAO;AACxC,iBAAe,KAAK,gBAAgB,WAAW;AAC/C,OAAK,OAAO,EAAE,QAAQ,YAAY,CAAC;;CAGrC,kBAAsC;AACpC,SAAO,eAAe,KAAK,eAAe,IAAI,KAAA;;CAGhD,aAAa,WAAqC;AAChD,OAAK,aAAa,OAAO;AACzB,OAAK,OAAO,EAAE,QAAQ,CAAC;;CAGzB,sBAA+B;AAC7B,SAAO,eAAe,KAAK,mBAAmB,KAAK;;CAGrD,iBAAiB,eAA8B;AAC7C,OAAK,iBAAiB,WAAW;AACjC,OAAK,OAAO,EAAE,YAAY,CAAC;;CAG7B,gBAAgB,WAAmC;AACjD,iBAAe,KAAK,gBAAgB,cAAc,OAAO,CAAC;;CAG5D,gBAAgB,WAAqC;AACnD,iBAAe,KAAK,gBAAgB,UAAU,GAAG;;CAGnD,oBAAoB,eAA8B;AAChD,iBAAe,KAAK,oBAAoB,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"}
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,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAE1F,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,6BAA6B;;;;;;;;EAIxE"}
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 { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setLocale = useSetLocale();\n const setRegion = useSetRegion();\n return { setLocale, setRegion, ...useInternalRegionSelector(options) };\n}\n"],"mappings":";;;AAOA,SAAgB,kBAAkB,SAAoB;AAEpD,QAAO;EAAE,WADS,cACA;EAAE,GAAG,0BAA0B,QAAQ;EAAE;;AAG7D,SAAgB,kBAAkB,SAAyC;AAGzE,QAAO;EAAE,WAFS,cAEA;EAAE,WADF,cACW;EAAE,GAAG,0BAA0B,QAAQ;EAAE"}
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"}
@@ -1,19 +1,14 @@
1
- import { GTProvider } from './provider/GTProvider';
2
- import { useSetLocale, useSetRegion, useSetEnableI18n } from './hooks/condition-store';
3
- import { useLocaleSelector, useRegionSelector } from './hooks/selectors';
4
- import { useLocaleDirection, useVersionId } from './hooks/utils';
5
- import { getLocaleFromNativeStore } from './utils/nativeStore';
6
- import { getLocale } from './utils/getLocale';
7
- import { initializeGT } from './setup/initializeGT';
8
- import type { GTProviderProps } from './provider/GTProvider';
9
- import type { GetLocaleParams } from './utils/getLocale';
10
- import type { InitializeGTParams } from './setup/initializeGT';
11
- import type { DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions } from '@generaltranslation/react-core/pure';
12
- import type { RenderPipeline, RenderPreparedT } from '@generaltranslation/react-core/pure';
13
- export { Branch, Plural, Derive, T, Currency, DateTime, RelativeTime, Var, Num, } from '@generaltranslation/react-core/components';
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":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAEL,MAAM,EACN,MAAM,EACN,MAAM,EACN,CAAC,EACD,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,GAAG,GACJ,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAEL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAEL,GAAG,EACH,SAAS,EACT,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,SAAS,EACT,UAAU,EACV,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,SAAS,EACT,YAAY,GACb,CAAC;AAEF,YAAY,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,GACnB,CAAC"}
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"}
@@ -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 { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useGTClass, useLocale, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations } from "@generaltranslation/react-core/hooks";
11
- export { Branch, Currency, DateTime, Derive, GTProvider, Num, Plural, RelativeTime, T, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getFormatLocales, getLocale, getLocaleFromNativeStore, getReactI18nCache, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, setReactI18nCache, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useGTClass, useLocale, useLocaleDirection, useLocaleProperties, useLocaleSelector, useLocales, useMessages, useRegion, useRegionSelector, useSetEnableI18n, useSetLocale, useSetRegion, useTranslations, useVersionId };
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 default function (babel: {
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,CAAC,OAAO,WACZ,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EAC9B,EACE,OAAO,EACP,MAAM,EACN,cAAc,EACd,kBAAkE,EAClE,gBAAqB,GACtB,EAAE,aAAa,GACf,SAAS,CAuDX"}
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 plugin_dir_default(babel, { locales, config, configFilePath, entryPointFilePath = path$1.resolve(process.cwd(), "src", "App.tsx"), excludePolyfills = [] }) {
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 { plugin_dir_default as default };
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 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,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"}
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"}
@@ -1,2 +1,2 @@
1
- export { default } from './plugin-dir';
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,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- import plugin_dir_default from "./plugin-dir/index.js";
2
- export { plugin_dir_default as default };
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
- loadingFallback?: ReactNode;
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;AAUjD,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,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC;AAKJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAQhD"}
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
- const { loadingFallback, ...providerProps } = props;
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 { locale, localeStoreKey, region, regionStoreKey, enableI18n, enableI18nStoreKey } = props;
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({ localeStoreKey }),
25
- region: getInitialRegion({
26
- region,
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 localeTranslations = use(loadTranslations(activeLocale));
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
- region: activeRegion,
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 { NativeGTProvider } 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 loadingFallback?: ReactNode;\n };\n\ntype LoadableGTProviderProps = Omit<GTProviderProps, 'loadingFallback'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n const { loadingFallback, ...providerProps } = props;\n\n return (\n <Suspense fallback={loadingFallback ?? <DefaultLoadingFallback />}>\n <LoadableGTProvider {...providerProps} />\n </Suspense>\n );\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: LoadableGTProviderProps) {\n const {\n locale,\n localeStoreKey,\n region,\n regionStoreKey,\n enableI18n,\n enableI18nStoreKey,\n } = props;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale({ localeStoreKey }),\n region: getInitialRegion({ region, regionStoreKey }),\n enableI18n: getInitialEnableI18n({ enableI18n, enableI18nStoreKey }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\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 <NativeGTProvider\n {...props}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={translations}\n _reload={reload}\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":";;;;;;;;;AA+BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,EAAE,iBAAiB,GAAG,kBAAkB;AAE9C,QACE,oBAAC,UAAD;EAAU,UAAU,mBAAmB,oBAAC,wBAAD,EAA0B,CAAA;YAC/D,oBAAC,oBAAD,EAAoB,GAAI,eAAiB,CAAA;EAChC,CAAA;;;;;;AAQf,SAAS,mBAAmB,OAAgC;CAC1D,MAAM,EACJ,QACA,gBACA,QACA,gBACA,YACA,uBACE;CAEJ,MAAM,CAAC,kBAAkB,uBACvB,gBAA2C;EACzC,QAAQ,UAAU,EAAE,gBAAgB,CAAC;EACrC,QAAQ,iBAAiB;GAAE;GAAQ;GAAgB,CAAC;EACpD,YAAY,qBAAqB;GAAE;GAAY;GAAoB,CAAC;EACrE,EAAE;CACL,MAAM,eAAe,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,qBAAqB,IAAI,iBAAiB,aAAa,CAAC;CAC9D,MAAM,eAAe,eACZ,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;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,kBAAD;EACE,GAAI;EACJ,QAAQ;EACR,QAAQ;EACR,YAAY;EACE;EACd,SAAS;EACT,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
+ {"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,2CAyB5D"}
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 }, [\n props.locale,\n props.region,\n props.enableI18n,\n props.localeStoreKey,\n props.regionStoreKey,\n props.enableI18nStoreKey,\n props._reload,\n ]);\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;EACD,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACP,CAAC;CAEF,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
+ {"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
- import type { GTServicesEnabledParams, I18nConfigParams } from 'gt-i18n/internal/types';
3
- export type InitializeGTParams = I18nConfigParams & GTServicesEnabledParams & ReactI18nCacheParams;
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":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAC/C,uBAAuB,GACvB,oBAAoB,CAAC;AAEvB,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAM7D"}
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 { ReactI18nCache, initializeI18nConfig, setReactI18nCache } from "@generaltranslation/react-core/pure";
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;AAO3E,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,cAAsC,GACvC,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAG1C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,kBAA8C,GAC/C,EAAE,uBAAuB,GAAG,OAAO,CAKnC"}
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"}