@computools/react-native-template-controller 1.0.41 → 1.0.43

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/README.md CHANGED
@@ -39,6 +39,7 @@ See the below table to find out which version of the template to use.
39
39
 
40
40
  | React Native | Template |
41
41
  | ------------ | -------- |
42
+ | 0.79 | 1.0.43 |
42
43
  | 0.78 | 1.0.34 |
43
44
  | 0.77 | 1.0.33 |
44
45
  | 0.76 | 1.0.29 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@computools/react-native-template-controller",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Computools react native template by using mobx as controllers",
5
5
  "main": "template.config.js",
6
6
  "scripts": {
package/template/Gemfile CHANGED
@@ -7,4 +7,10 @@ ruby ">= 2.6.10"
7
7
  gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8
8
  gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9
9
  gem 'xcodeproj', '< 1.26.0'
10
- gem 'concurrent-ruby', '< 1.3.4'
10
+ gem 'concurrent-ruby', '< 1.3.4'
11
+
12
+ # Ruby 3.4.0 has removed some libraries from the standard library.
13
+ gem 'bigdecimal'
14
+ gem 'logger'
15
+ gem 'benchmark'
16
+ gem 'mutex_m'
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -205,7 +205,7 @@ fi
205
205
  DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206
206
 
207
207
  # Collect all arguments for the java command:
208
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209
209
  # and any embedded shellness will be escaped.
210
210
  # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211
211
  # treated as '${Hostname}' itself on the command line.
@@ -2,23 +2,42 @@ import UIKit
2
2
  import React
3
3
  import React_RCTAppDelegate
4
4
  import ReactAppDependencyProvider
5
+ import RNBootSplash
5
6
 
6
7
  @main
7
- class AppDelegate: RCTAppDelegate {
8
+ class AppDelegate: UIResponder, UIApplicationDelegate {
9
+ var window: UIWindow?
10
+
11
+ var reactNativeDelegate: ReactNativeDelegate?
12
+ var reactNativeFactory: RCTReactNativeFactory?
13
+
14
+ func application(
15
+ _ application: UIApplication,
16
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
17
+ ) -> Bool {
18
+ let delegate = ReactNativeDelegate()
19
+ let factory = RCTReactNativeFactory(delegate: delegate)
20
+ delegate.dependencyProvider = RCTAppDependencyProvider()
21
+
22
+ reactNativeDelegate = delegate
23
+ reactNativeFactory = factory
24
+
25
+ window = UIWindow(frame: UIScreen.main.bounds)
26
+
27
+ factory.startReactNative(
28
+ withModuleName: "ReactNativeTemplate",
29
+ in: window,
30
+ launchOptions: launchOptions
31
+ )
32
+
33
+ return true
34
+ }
35
+ }
36
+
37
+ class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
8
38
  override func customize(_ rootView: RCTRootView!) {
9
- super.customize(rootView)
10
- RNBootSplash.initWithStoryboard("LaunchScreen", rootView: rootView)
11
- }
12
-
13
- override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
14
- self.moduleName = "ReactNativeTemplate"
15
- self.dependencyProvider = RCTAppDependencyProvider()
16
-
17
- // You can add your custom initial props in the dictionary below.
18
- // They will be passed down to the ViewController used by React Native.
19
- self.initialProps = [:]
20
-
21
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
39
+ super.customize(rootView)
40
+ RNBootSplash.initWithStoryboard("LaunchScreen", rootView: rootView)
22
41
  }
23
42
 
24
43
  override func sourceURL(for bridge: RCTBridge) -> URL? {
@@ -36,8 +36,8 @@
36
36
  "react": "19.0.0",
37
37
  "react-hook-form": "7.54.2",
38
38
  "react-i18next": "15.4.1",
39
- "react-native": "0.78.1",
40
- "react-native-bootsplash": "6.3.2",
39
+ "react-native": "0.79.1",
40
+ "react-native-bootsplash": "6.3.5",
41
41
  "react-native-config": "1.5.3",
42
42
  "react-native-mmkv": "3.2.0",
43
43
  "react-native-safe-area-context": "5.3.0",
@@ -49,13 +49,13 @@
49
49
  "@babel/core": "^7.25.2",
50
50
  "@babel/preset-env": "^7.25.3",
51
51
  "@babel/runtime": "^7.25.0",
52
- "@react-native-community/cli": "15.0.1",
53
- "@react-native-community/cli-platform-android": "15.0.1",
54
- "@react-native-community/cli-platform-ios": "15.0.1",
55
- "@react-native/babel-preset": "0.78.1",
56
- "@react-native/eslint-config": "0.78.1",
57
- "@react-native/metro-config": "0.78.1",
58
- "@react-native/typescript-config": "0.78.1",
52
+ "@react-native-community/cli": "18.0.0",
53
+ "@react-native-community/cli-platform-android": "18.0.0",
54
+ "@react-native-community/cli-platform-ios": "18.0.0",
55
+ "@react-native/babel-preset": "0.79.1",
56
+ "@react-native/eslint-config": "0.79.1",
57
+ "@react-native/metro-config": "0.79.1",
58
+ "@react-native/typescript-config": "0.79.1",
59
59
  "@types/jest": "^29.5.13",
60
60
  "@types/metro-config": "^0.76.3",
61
61
  "@types/react": "19.0.0",
@@ -12,6 +12,7 @@ import {InputField} from '@ui-kit/InputField.component';
12
12
  import {Button} from '@ui-kit/buttons/Button.component';
13
13
  import {localization} from '@localization/localization';
14
14
  import {Computools} from '@ui-kit/icons/computools/Computools.icon';
15
+ import {KeyboardView} from '@ui-kit/keyboard-view/keyboard-view.component';
15
16
  import {MainStackParamsList, MainStackRoutes} from '@infra/MainStackRoutes.routes';
16
17
 
17
18
  enum LoginField {
@@ -71,7 +72,7 @@ export const Login: React.FC<NativeStackScreenProps<MainStackParamsList, MainSta
71
72
  );
72
73
 
73
74
  return (
74
- <View style={styles.screen}>
75
+ <KeyboardView style={styles.screen}>
75
76
  <View style={[styles.headerContainer, styles.row]}>
76
77
  <View style={styles.iconWrapper}>
77
78
  <Computools />
@@ -83,16 +84,14 @@ export const Login: React.FC<NativeStackScreenProps<MainStackParamsList, MainSta
83
84
  <Text style={[styles.forgetPassword, styles.row]}>{localization.t('forgotPass')}</Text>
84
85
  <Button style={styles.row} onPress={handleSubmit(onLogin)} text={localization.t('buttons.login')} />
85
86
  <Button style={styles.row} onPress={onSignUp} text={localization.t('buttons.signup')} />
86
- </View>
87
+ </KeyboardView>
87
88
  );
88
89
  };
89
90
 
90
91
  const styles = StyleSheet.create({
91
92
  screen: {
92
- flex: 1,
93
93
  justifyContent: 'center',
94
94
  paddingHorizontal: 30,
95
- paddingTop: 25,
96
95
  },
97
96
  headerContainer: {
98
97
  alignItems: 'center',
@@ -1,8 +1,8 @@
1
1
  import {z} from 'zod';
2
2
  import React from 'react';
3
3
  import {zodResolver} from '@hookform/resolvers/zod';
4
+ import {View, Text, StyleSheet, Alert} from 'react-native';
4
5
  import {useForm, Controller, ControllerProps} from 'react-hook-form';
5
- import {View, Text, StyleSheet, Alert, SafeAreaView} from 'react-native';
6
6
  import {type NativeStackScreenProps} from '@react-navigation/native-stack';
7
7
 
8
8
  import {InputField} from '@ui-kit/InputField.component';
@@ -10,6 +10,7 @@ import {Button} from '@ui-kit/buttons/Button.component';
10
10
  import {HeaderBack} from '@ui-kit/HeaderBack.component';
11
11
  import {localization} from '@localization/localization';
12
12
  import {Computools} from '@ui-kit/icons/computools/Computools.icon';
13
+ import {KeyboardView} from '@ui-kit/keyboard-view/keyboard-view.component';
13
14
  import {MainStackParamsList, MainStackRoutes} from '@infra/MainStackRoutes.routes';
14
15
 
15
16
  enum SignUpField {
@@ -77,7 +78,7 @@ export const SignUp: React.FC<NativeStackScreenProps<MainStackParamsList, MainSt
77
78
  );
78
79
 
79
80
  return (
80
- <SafeAreaView style={styles.safeArea}>
81
+ <KeyboardView>
81
82
  <HeaderBack goBack={navigation.goBack} />
82
83
  <View style={styles.screen}>
83
84
  <View style={[styles.headerContainer, styles.row]}>
@@ -91,14 +92,11 @@ export const SignUp: React.FC<NativeStackScreenProps<MainStackParamsList, MainSt
91
92
  <Controller name={SignUpField.RepeatPassword} control={control} render={renderRepeatPassword} />
92
93
  <Button style={styles.row} onPress={handleSubmit(onSignUp)} text={localization.t('buttons.signup')} />
93
94
  </View>
94
- </SafeAreaView>
95
+ </KeyboardView>
95
96
  );
96
97
  };
97
98
 
98
99
  const styles = StyleSheet.create({
99
- safeArea: {
100
- flex: 1,
101
- },
102
100
  screen: {
103
101
  flex: 1,
104
102
  justifyContent: 'center',
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import {useSafeAreaInsets} from 'react-native-safe-area-context';
3
+ import {Keyboard, KeyboardAvoidingView, KeyboardAvoidingViewProps, Platform, StyleSheet} from 'react-native';
4
+
5
+ export const KeyboardView: React.FC<KeyboardAvoidingViewProps> = ({children, style, ...props}) => {
6
+ const {top} = useSafeAreaInsets();
7
+
8
+ return (
9
+ <KeyboardAvoidingView
10
+ onTouchStart={Keyboard.dismiss}
11
+ style={[styles.keyboardView, {paddingTop: top}, style]}
12
+ behavior={Platform.select({ios: 'padding', android: 'height'})}
13
+ {...props}>
14
+ {children}
15
+ </KeyboardAvoidingView>
16
+ );
17
+ };
18
+
19
+ const styles = StyleSheet.create({
20
+ keyboardView: {flex: 1},
21
+ });