gt-react-native 0.0.1-alpha.9 → 0.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +34 -11
  2. package/lib/commonjs/NativeGtReactNative.js +9 -0
  3. package/lib/commonjs/NativeGtReactNative.js.map +1 -0
  4. package/lib/commonjs/errors-dir/constants.js +8 -0
  5. package/lib/commonjs/errors-dir/constants.js.map +1 -0
  6. package/lib/commonjs/errors-dir/errors.js +10 -0
  7. package/lib/commonjs/errors-dir/errors.js.map +1 -0
  8. package/lib/commonjs/errors-dir/warnings.js +18 -0
  9. package/lib/commonjs/errors-dir/warnings.js.map +1 -0
  10. package/lib/commonjs/index.js +158 -0
  11. package/lib/commonjs/index.js.map +1 -0
  12. package/lib/commonjs/internal.js +13 -0
  13. package/lib/commonjs/internal.js.map +1 -0
  14. package/lib/commonjs/package.json +1 -0
  15. package/lib/commonjs/plugin-dir/index.js +54 -0
  16. package/lib/commonjs/plugin-dir/index.js.map +1 -0
  17. package/lib/commonjs/plugin-dir/types.js +2 -0
  18. package/lib/commonjs/plugin-dir/types.js.map +1 -0
  19. package/lib/commonjs/plugin-dir/utils/resolveLocales.js +74 -0
  20. package/lib/commonjs/plugin-dir/utils/resolveLocales.js.map +1 -0
  21. package/lib/commonjs/plugin.js +14 -0
  22. package/lib/commonjs/plugin.js.map +1 -0
  23. package/lib/commonjs/provider/GTProvider.js +24 -0
  24. package/lib/commonjs/provider/GTProvider.js.map +1 -0
  25. package/lib/commonjs/provider/hooks/locale/useDetermineLocale.js +146 -0
  26. package/lib/commonjs/provider/hooks/locale/useDetermineLocale.js.map +1 -0
  27. package/lib/commonjs/provider/hooks/useRegionState.js +47 -0
  28. package/lib/commonjs/provider/hooks/useRegionState.js.map +1 -0
  29. package/lib/commonjs/tools/testLocalePolyfill.js +68 -0
  30. package/lib/commonjs/tools/testLocalePolyfill.js.map +1 -0
  31. package/lib/commonjs/types/config.js +6 -0
  32. package/lib/commonjs/types/config.js.map +1 -0
  33. package/lib/commonjs/utils/getNativeLocales.js +58 -0
  34. package/lib/commonjs/utils/getNativeLocales.js.map +1 -0
  35. package/lib/commonjs/utils/nativeStore.js +39 -0
  36. package/lib/commonjs/utils/nativeStore.js.map +1 -0
  37. package/lib/commonjs/utils/utils.js +17 -0
  38. package/lib/commonjs/utils/utils.js.map +1 -0
  39. package/lib/module/errors-dir/constants.js +1 -1
  40. package/lib/module/errors-dir/constants.js.map +1 -1
  41. package/lib/module/errors-dir/errors.js +5 -0
  42. package/lib/module/errors-dir/errors.js.map +1 -0
  43. package/lib/module/errors-dir/warnings.js +12 -0
  44. package/lib/module/errors-dir/warnings.js.map +1 -0
  45. package/lib/module/index.js +1 -2
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/internal.js +4 -0
  48. package/lib/module/internal.js.map +1 -0
  49. package/lib/module/plugin-dir/index.js +49 -0
  50. package/lib/module/plugin-dir/index.js.map +1 -0
  51. package/lib/module/plugin-dir/types.js +2 -0
  52. package/lib/module/plugin-dir/types.js.map +1 -0
  53. package/lib/module/plugin-dir/utils/resolveLocales.js +69 -0
  54. package/lib/module/plugin-dir/utils/resolveLocales.js.map +1 -0
  55. package/lib/module/plugin.js +4 -0
  56. package/lib/module/plugin.js.map +1 -0
  57. package/lib/module/tools/testLocalePolyfill.js +64 -0
  58. package/lib/module/tools/testLocalePolyfill.js.map +1 -0
  59. package/lib/typescript/commonjs/package.json +1 -0
  60. package/lib/typescript/commonjs/src/NativeGtReactNative.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/src/errors-dir/constants.d.ts +2 -0
  62. package/lib/typescript/commonjs/src/errors-dir/constants.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/src/errors-dir/errors.d.ts +2 -0
  64. package/lib/typescript/commonjs/src/errors-dir/errors.d.ts.map +1 -0
  65. package/lib/typescript/commonjs/src/errors-dir/warnings.d.ts +4 -0
  66. package/lib/typescript/commonjs/src/errors-dir/warnings.d.ts.map +1 -0
  67. package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -2
  68. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/src/internal.d.ts +2 -0
  70. package/lib/typescript/commonjs/src/internal.d.ts.map +1 -0
  71. package/lib/typescript/commonjs/src/plugin-dir/index.d.ts +6 -0
  72. package/lib/typescript/commonjs/src/plugin-dir/index.d.ts.map +1 -0
  73. package/lib/typescript/commonjs/src/plugin-dir/types.d.ts +10 -0
  74. package/lib/typescript/commonjs/src/plugin-dir/types.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/src/plugin-dir/utils/resolveLocales.d.ts +13 -0
  76. package/lib/typescript/commonjs/src/plugin-dir/utils/resolveLocales.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/src/plugin.d.ts +2 -0
  78. package/lib/typescript/commonjs/src/plugin.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/src/provider/GTProvider.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/provider/hooks/locale/useDetermineLocale.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/src/provider/hooks/useRegionState.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/tools/testLocalePolyfill.d.ts +12 -0
  83. package/lib/typescript/commonjs/src/tools/testLocalePolyfill.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/src/types/config.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/src/utils/getNativeLocales.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/utils/nativeStore.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/vitest.config.d.ts +3 -0
  89. package/lib/typescript/commonjs/vitest.config.d.ts.map +1 -0
  90. package/lib/typescript/module/src/NativeGtReactNative.d.ts +10 -0
  91. package/lib/typescript/module/src/NativeGtReactNative.d.ts.map +1 -0
  92. package/lib/typescript/module/src/errors-dir/constants.d.ts +2 -0
  93. package/lib/typescript/module/src/errors-dir/constants.d.ts.map +1 -0
  94. package/lib/typescript/module/src/errors-dir/errors.d.ts +2 -0
  95. package/lib/typescript/module/src/errors-dir/errors.d.ts.map +1 -0
  96. package/lib/typescript/module/src/errors-dir/warnings.d.ts +4 -0
  97. package/lib/typescript/module/src/errors-dir/warnings.d.ts.map +1 -0
  98. package/lib/typescript/module/src/index.d.ts +6 -0
  99. package/lib/typescript/module/src/index.d.ts.map +1 -0
  100. package/lib/typescript/module/src/internal.d.ts +2 -0
  101. package/lib/typescript/module/src/internal.d.ts.map +1 -0
  102. package/lib/typescript/module/src/plugin-dir/index.d.ts +6 -0
  103. package/lib/typescript/module/src/plugin-dir/index.d.ts.map +1 -0
  104. package/lib/typescript/module/src/plugin-dir/types.d.ts +10 -0
  105. package/lib/typescript/module/src/plugin-dir/types.d.ts.map +1 -0
  106. package/lib/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts +13 -0
  107. package/lib/typescript/module/src/plugin-dir/utils/resolveLocales.d.ts.map +1 -0
  108. package/lib/typescript/module/src/plugin.d.ts +2 -0
  109. package/lib/typescript/module/src/plugin.d.ts.map +1 -0
  110. package/lib/typescript/module/src/provider/GTProvider.d.ts +4 -0
  111. package/lib/typescript/module/src/provider/GTProvider.d.ts.map +1 -0
  112. package/lib/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts +4 -0
  113. package/lib/typescript/module/src/provider/hooks/locale/useDetermineLocale.d.ts.map +1 -0
  114. package/lib/typescript/module/src/provider/hooks/useRegionState.d.ts +3 -0
  115. package/lib/typescript/module/src/provider/hooks/useRegionState.d.ts.map +1 -0
  116. package/lib/typescript/module/src/tools/testLocalePolyfill.d.ts +12 -0
  117. package/lib/typescript/module/src/tools/testLocalePolyfill.d.ts.map +1 -0
  118. package/lib/typescript/module/src/types/config.d.ts +30 -0
  119. package/lib/typescript/module/src/types/config.d.ts.map +1 -0
  120. package/lib/typescript/module/src/utils/getNativeLocales.d.ts +10 -0
  121. package/lib/typescript/module/src/utils/getNativeLocales.d.ts.map +1 -0
  122. package/lib/typescript/module/src/utils/nativeStore.d.ts +16 -0
  123. package/lib/typescript/module/src/utils/nativeStore.d.ts.map +1 -0
  124. package/lib/typescript/module/src/utils/utils.d.ts +3 -0
  125. package/lib/typescript/module/src/utils/utils.d.ts.map +1 -0
  126. package/lib/typescript/module/vitest.config.d.ts +3 -0
  127. package/lib/typescript/module/vitest.config.d.ts.map +1 -0
  128. package/package.json +48 -17
  129. package/src/errors-dir/constants.ts +1 -1
  130. package/src/errors-dir/errors.ts +3 -0
  131. package/src/errors-dir/warnings.ts +14 -0
  132. package/src/index.tsx +0 -2
  133. package/src/internal.ts +1 -0
  134. package/src/plugin-dir/index.ts +80 -0
  135. package/src/plugin-dir/types.ts +10 -0
  136. package/src/plugin-dir/utils/resolveLocales.ts +95 -0
  137. package/src/plugin.ts +1 -0
  138. package/src/tools/testLocalePolyfill.ts +82 -0
  139. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeGtReactNativeSpec.java +0 -51
  140. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  141. package/android/app/build/generated/source/codegen/jni/GtReactNativeSpec-generated.cpp +0 -50
  142. package/android/app/build/generated/source/codegen/jni/GtReactNativeSpec.h +0 -31
  143. package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI-generated.cpp +0 -51
  144. package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI.h +0 -98
  145. package/lib/module/utils/polyfill.js +0 -39
  146. package/lib/module/utils/polyfill.js.map +0 -1
  147. package/lib/typescript/src/NativeGtReactNative.d.ts.map +0 -1
  148. package/lib/typescript/src/errors-dir/constants.d.ts +0 -2
  149. package/lib/typescript/src/errors-dir/constants.d.ts.map +0 -1
  150. package/lib/typescript/src/index.d.ts.map +0 -1
  151. package/lib/typescript/src/provider/GTProvider.d.ts.map +0 -1
  152. package/lib/typescript/src/provider/hooks/locale/useDetermineLocale.d.ts.map +0 -1
  153. package/lib/typescript/src/provider/hooks/useRegionState.d.ts.map +0 -1
  154. package/lib/typescript/src/types/config.d.ts.map +0 -1
  155. package/lib/typescript/src/utils/getNativeLocales.d.ts.map +0 -1
  156. package/lib/typescript/src/utils/nativeStore.d.ts.map +0 -1
  157. package/lib/typescript/src/utils/polyfill.d.ts +0 -29
  158. package/lib/typescript/src/utils/polyfill.d.ts.map +0 -1
  159. package/lib/typescript/src/utils/utils.d.ts.map +0 -1
  160. package/src/utils/polyfill.ts +0 -51
  161. /package/lib/typescript/{src → commonjs/src}/NativeGtReactNative.d.ts +0 -0
  162. /package/lib/typescript/{src → commonjs/src}/provider/GTProvider.d.ts +0 -0
  163. /package/lib/typescript/{src → commonjs/src}/provider/hooks/locale/useDetermineLocale.d.ts +0 -0
  164. /package/lib/typescript/{src → commonjs/src}/provider/hooks/useRegionState.d.ts +0 -0
  165. /package/lib/typescript/{src → commonjs/src}/types/config.d.ts +0 -0
  166. /package/lib/typescript/{src → commonjs/src}/utils/getNativeLocales.d.ts +0 -0
  167. /package/lib/typescript/{src → commonjs/src}/utils/nativeStore.d.ts +0 -0
  168. /package/lib/typescript/{src → commonjs/src}/utils/utils.d.ts +0 -0
  169. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNativeLocales.d.ts","sourceRoot":"","sources":["../../../../src/utils/getNativeLocales.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAa3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nativeStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/nativeStore.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM/D"}
@@ -1,29 +0,0 @@
1
- import '@formatjs/intl-getcanonicallocales/polyfill';
2
- import '@formatjs/intl-locale/polyfill';
3
- import '@formatjs/intl-displaynames/polyfill';
4
- import '@formatjs/intl-listformat/polyfill';
5
- import '@formatjs/intl-pluralrules/polyfill-force';
6
- import '@formatjs/intl-numberformat/polyfill';
7
- import '@formatjs/intl-relativetimeformat/polyfill';
8
- import '@formatjs/intl-datetimeformat/polyfill';
9
- import '@formatjs/intl-datetimeformat/add-all-tz';
10
- import '@formatjs/intl-displaynames/locale-data/en';
11
- import '@formatjs/intl-displaynames/locale-data/zh';
12
- import '@formatjs/intl-displaynames/locale-data/es';
13
- import '@formatjs/intl-listformat/locale-data/en';
14
- import '@formatjs/intl-listformat/locale-data/zh';
15
- import '@formatjs/intl-listformat/locale-data/es';
16
- import '@formatjs/intl-pluralrules/locale-data/en';
17
- import '@formatjs/intl-pluralrules/locale-data/zh';
18
- import '@formatjs/intl-pluralrules/locale-data/es';
19
- import '@formatjs/intl-numberformat/locale-data/en';
20
- import '@formatjs/intl-numberformat/locale-data/zh';
21
- import '@formatjs/intl-numberformat/locale-data/es';
22
- import '@formatjs/intl-relativetimeformat/locale-data/en';
23
- import '@formatjs/intl-relativetimeformat/locale-data/zh';
24
- import '@formatjs/intl-relativetimeformat/locale-data/es';
25
- import '@formatjs/intl-datetimeformat/locale-data/en';
26
- import '@formatjs/intl-datetimeformat/locale-data/zh';
27
- import '@formatjs/intl-datetimeformat/locale-data/es';
28
- export declare function polyfillLocales(locales: string[]): Promise<void>;
29
- //# sourceMappingURL=polyfill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../../../src/utils/polyfill.ts"],"names":[],"mappings":"AAGA,OAAO,6CAA6C,CAAC;AACrD,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,2CAA2C,CAAC;AACnD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,4CAA4C,CAAC;AACpD,OAAO,wCAAwC,CAAC;AAChD,OAAO,0CAA0C,CAAC;AAElD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAEpD,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAElD,OAAO,2CAA2C,CAAC;AACnD,OAAO,2CAA2C,CAAC;AACnD,OAAO,2CAA2C,CAAC;AAEnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAEpD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAE1D,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AAatD,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,iBAEtD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAM5E"}
@@ -1,51 +0,0 @@
1
- // Intl object not natively supported, see: https://formatjs.github.io/docs/polyfills
2
- // See also: The Ultimate Guide to React Native Optimization - page 124
3
-
4
- import '@formatjs/intl-getcanonicallocales/polyfill';
5
- import '@formatjs/intl-locale/polyfill';
6
- import '@formatjs/intl-displaynames/polyfill';
7
- import '@formatjs/intl-listformat/polyfill';
8
- import '@formatjs/intl-pluralrules/polyfill-force'; // https://github.com/formatjs/formatjs/issues/4463
9
- import '@formatjs/intl-numberformat/polyfill';
10
- import '@formatjs/intl-relativetimeformat/polyfill';
11
- import '@formatjs/intl-datetimeformat/polyfill';
12
- import '@formatjs/intl-datetimeformat/add-all-tz';
13
-
14
- import '@formatjs/intl-displaynames/locale-data/en';
15
- import '@formatjs/intl-displaynames/locale-data/zh';
16
- import '@formatjs/intl-displaynames/locale-data/es';
17
-
18
- import '@formatjs/intl-listformat/locale-data/en';
19
- import '@formatjs/intl-listformat/locale-data/zh';
20
- import '@formatjs/intl-listformat/locale-data/es';
21
-
22
- import '@formatjs/intl-pluralrules/locale-data/en';
23
- import '@formatjs/intl-pluralrules/locale-data/zh';
24
- import '@formatjs/intl-pluralrules/locale-data/es';
25
-
26
- import '@formatjs/intl-numberformat/locale-data/en';
27
- import '@formatjs/intl-numberformat/locale-data/zh';
28
- import '@formatjs/intl-numberformat/locale-data/es';
29
-
30
- import '@formatjs/intl-relativetimeformat/locale-data/en';
31
- import '@formatjs/intl-relativetimeformat/locale-data/zh';
32
- import '@formatjs/intl-relativetimeformat/locale-data/es';
33
-
34
- import '@formatjs/intl-datetimeformat/locale-data/en';
35
- import '@formatjs/intl-datetimeformat/locale-data/zh';
36
- import '@formatjs/intl-datetimeformat/locale-data/es';
37
-
38
- async function polyfillLocale(locale: string) {
39
- await Promise.all([
40
- import(`@formatjs/intl-displaynames/locale-data/${locale}`),
41
- import(`@formatjs/intl-listformat/locale-data/${locale}`),
42
- import(`@formatjs/intl-pluralrules/locale-data/${locale}`),
43
- import(`@formatjs/intl-numberformat/locale-data/${locale}`),
44
- import(`@formatjs/intl-relativetimeformat/locale-data/${locale}`),
45
- import(`@formatjs/intl-datetimeformat/locale-data/${locale}`),
46
- ]);
47
- }
48
-
49
- export async function polyfillLocales(locales: string[]) {
50
- await Promise.all(locales.map(polyfillLocale));
51
- }