@hedia/recommendation-screen 2.1.22 → 2.1.23-alpha.1

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 (72) hide show
  1. package/.flowconfig +65 -0
  2. package/android/app/build.gradle +20 -18
  3. package/android/app/src/debug/AndroidManifest.xml +7 -2
  4. package/android/app/src/main/AndroidManifest.xml +0 -2
  5. package/android/app/src/main/res/values/styles.xml +1 -2
  6. package/android/build.gradle +8 -8
  7. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  8. package/android/gradle.properties +1 -1
  9. package/android/gradlew +14 -17
  10. package/android/gradlew.bat +7 -18
  11. package/coverage/clover.xml +716 -0
  12. package/coverage/coverage-final.json +28 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +79 -0
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +201 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +170 -0
  21. package/coverage/lcov-report/src/RecommendationScreen.tsx.html +2501 -0
  22. package/coverage/lcov-report/src/__tests__/index.html +111 -0
  23. package/coverage/lcov-report/src/__tests__/utils.tsx.html +533 -0
  24. package/coverage/lcov-report/src/components/Header.tsx.html +356 -0
  25. package/coverage/lcov-report/src/components/InfoBars.tsx.html +518 -0
  26. package/coverage/lcov-report/src/components/InvisibleNumberInput.tsx.html +566 -0
  27. package/coverage/lcov-report/src/components/LimitationMessage.tsx.html +209 -0
  28. package/coverage/lcov-report/src/components/LineSeparator.tsx.html +161 -0
  29. package/coverage/lcov-report/src/components/RecentInsulin.tsx.html +410 -0
  30. package/coverage/lcov-report/src/components/RecommendationModal.tsx.html +923 -0
  31. package/coverage/lcov-report/src/components/RecommendedCarbs.tsx.html +1061 -0
  32. package/coverage/lcov-report/src/components/RecommendedInsulin.tsx.html +779 -0
  33. package/coverage/lcov-report/src/components/Remeasure.tsx.html +551 -0
  34. package/coverage/lcov-report/src/components/TransferToLogbook.tsx.html +443 -0
  35. package/coverage/lcov-report/src/components/TwoOptionModal.tsx.html +665 -0
  36. package/coverage/lcov-report/src/components/activity/Activity.tsx.html +371 -0
  37. package/coverage/lcov-report/src/components/activity/ActivityIcon.tsx.html +281 -0
  38. package/coverage/lcov-report/src/components/activity/ActivityIntensity.tsx.html +281 -0
  39. package/coverage/lcov-report/src/components/activity/index.html +141 -0
  40. package/coverage/lcov-report/src/components/index.html +276 -0
  41. package/coverage/lcov-report/src/components/mood/Emotion.tsx.html +353 -0
  42. package/coverage/lcov-report/src/components/mood/MoodIcon.tsx.html +335 -0
  43. package/coverage/lcov-report/src/components/mood/index.html +126 -0
  44. package/coverage/lcov-report/src/index.html +111 -0
  45. package/coverage/lcov-report/src/locale/i18nUtils.ts.html +206 -0
  46. package/coverage/lcov-report/src/locale/index.html +111 -0
  47. package/coverage/lcov-report/src/utils/AttentionMessages.tsx.html +554 -0
  48. package/coverage/lcov-report/src/utils/Constants.ts.html +248 -0
  49. package/coverage/lcov-report/src/utils/RecommendationError.tsx.html +620 -0
  50. package/coverage/lcov-report/src/utils/RecommendationUtils.ts.html +764 -0
  51. package/coverage/lcov-report/src/utils/Translations.ts.html +131 -0
  52. package/coverage/lcov-report/src/utils/Utils.ts.html +545 -0
  53. package/coverage/lcov-report/src/utils/Validations.ts.html +1544 -0
  54. package/coverage/lcov-report/src/utils/index.html +201 -0
  55. package/coverage/lcov.info +1611 -0
  56. package/ios/HediaRecommendationScreen/AppDelegate.m +7 -4
  57. package/ios/HediaRecommendationScreen/Info.plist +0 -2
  58. package/ios/HediaRecommendationScreen/LaunchScreen.storyboard +47 -0
  59. package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +192 -549
  60. package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +1 -1
  61. package/ios/Podfile +13 -87
  62. package/ios/Podfile.lock +353 -283
  63. package/jest.config.js +3 -3
  64. package/jest.mock.js +1 -1
  65. package/metro.config.js +1 -1
  66. package/package.json +10 -9
  67. package/src/RecommendationScreen.d.ts +6 -1
  68. package/src/RecommendationScreen.js +5 -5
  69. package/src/__tests__/RecommendationScreen.test.js +4 -6
  70. package/ios/HediaRecommendationScreen/Base.lproj/LaunchScreen.xib +0 -42
  71. package/ios/HediaRecommendationScreen-tvOS/Info.plist +0 -53
  72. package/ios/HediaRecommendationScreen-tvOSTests/Info.plist +0 -24
package/.flowconfig ADDED
@@ -0,0 +1,65 @@
1
+ [ignore]
2
+ ; We fork some components by platform
3
+ .*/*[.]android.js
4
+
5
+ ; Ignore "BUCK" generated dirs
6
+ <PROJECT_ROOT>/\.buckd/
7
+
8
+ ; Ignore polyfills
9
+ node_modules/react-native/Libraries/polyfills/.*
10
+
11
+ ; Flow doesn't support platforms
12
+ .*/Libraries/Utilities/LoadingView.js
13
+
14
+ [untyped]
15
+ .*/node_modules/@react-native-community/cli/.*/.*
16
+
17
+ [include]
18
+
19
+ [libs]
20
+ node_modules/react-native/interface.js
21
+ node_modules/react-native/flow/
22
+
23
+ [options]
24
+ emoji=true
25
+
26
+ exact_by_default=true
27
+
28
+ format.bracket_spacing=false
29
+
30
+ module.file_ext=.js
31
+ module.file_ext=.json
32
+ module.file_ext=.ios.js
33
+
34
+ munge_underscores=true
35
+
36
+ module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
37
+ module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
38
+
39
+ suppress_type=$FlowIssue
40
+ suppress_type=$FlowFixMe
41
+ suppress_type=$FlowFixMeProps
42
+ suppress_type=$FlowFixMeState
43
+
44
+ [lints]
45
+ sketchy-null-number=warn
46
+ sketchy-null-mixed=warn
47
+ sketchy-number=warn
48
+ untyped-type-import=warn
49
+ nonstrict-import=warn
50
+ deprecated-type=warn
51
+ unsafe-getters-setters=warn
52
+ unnecessary-invariant=warn
53
+ signature-verification-failure=warn
54
+
55
+ [strict]
56
+ deprecated-type
57
+ nonstrict-import
58
+ sketchy-null
59
+ unclear-type
60
+ unsafe-getters-setters
61
+ untyped-import
62
+ untyped-type-import
63
+
64
+ [version]
65
+ ^0.158.0
@@ -20,7 +20,7 @@ import com.android.build.OutputFile
20
20
  * // default. Can be overridden with ENTRY_FILE environment variable.
21
21
  * entryFile: "index.android.js",
22
22
  *
23
- * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
23
+ * // https://reactnative.dev/docs/performance#enable-the-ram-format
24
24
  * bundleCommand: "ram-bundle",
25
25
  *
26
26
  * // whether to bundle JS and assets in debug mode
@@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+'
120
120
  */
121
121
  def enableHermes = project.ext.react.get("enableHermes", false);
122
122
 
123
+ /**
124
+ * Architectures to build native code for in debug.
125
+ */
126
+ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
127
+
123
128
  android {
124
- compileSdkVersion rootProject.ext.compileSdkVersion
129
+ ndkVersion rootProject.ext.ndkVersion
125
130
 
126
- compileOptions {
127
- sourceCompatibility JavaVersion.VERSION_1_8
128
- targetCompatibility JavaVersion.VERSION_1_8
129
- }
131
+ compileSdkVersion rootProject.ext.compileSdkVersion
130
132
 
131
133
  defaultConfig {
132
134
  applicationId "com.hediarecommendationscreen"
@@ -154,33 +156,32 @@ android {
154
156
  buildTypes {
155
157
  debug {
156
158
  signingConfig signingConfigs.debug
159
+ if (nativeArchitectures) {
160
+ ndk {
161
+ abiFilters nativeArchitectures.split(',')
162
+ }
163
+ }
157
164
  }
158
165
  release {
159
166
  // Caution! In production, you need to generate your own keystore file.
160
- // see https://facebook.github.io/react-native/docs/signed-apk-android.
167
+ // see https://reactnative.dev/docs/signed-apk-android.
161
168
  signingConfig signingConfigs.debug
162
169
  minifyEnabled enableProguardInReleaseBuilds
163
170
  proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
164
171
  }
165
172
  }
166
173
 
167
- packagingOptions {
168
- pickFirst "lib/armeabi-v7a/libc++_shared.so"
169
- pickFirst "lib/arm64-v8a/libc++_shared.so"
170
- pickFirst "lib/x86/libc++_shared.so"
171
- pickFirst "lib/x86_64/libc++_shared.so"
172
- }
173
-
174
174
  // applicationVariants are e.g. debug, release
175
175
  applicationVariants.all { variant ->
176
176
  variant.outputs.each { output ->
177
177
  // For each separate APK per architecture, set a unique version code as described here:
178
178
  // https://developer.android.com/studio/build/configure-apk-splits.html
179
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
179
180
  def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
180
181
  def abi = output.getFilter(OutputFile.ABI)
181
182
  if (abi != null) { // null for the universal-debug, universal-release variants
182
183
  output.versionCodeOverride =
183
- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
184
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
184
185
  }
185
186
 
186
187
  }
@@ -195,11 +196,12 @@ dependencies {
195
196
  implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
196
197
 
197
198
  debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
198
- exclude group:'com.facebook.fbjni'
199
+ exclude group:'com.facebook.fbjni'
199
200
  }
200
201
 
201
202
  debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
202
203
  exclude group:'com.facebook.flipper'
204
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
203
205
  }
204
206
 
205
207
  debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
@@ -218,9 +220,9 @@ dependencies {
218
220
  // Run this once to be able to run the application with BUCK
219
221
  // puts all compile dependencies into folder libs for BUCK to use
220
222
  task copyDownloadableDepsToLibs(type: Copy) {
221
- from configurations.compile
223
+ from configurations.implementation
222
224
  into 'libs'
223
225
  }
224
226
 
225
227
  apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
226
- apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
228
+ apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
@@ -1,8 +1,13 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- xmlns:tools="http://schemas.android.com/tools">
3
+ xmlns:tools="http://schemas.android.com/tools">
4
4
 
5
5
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
6
 
7
- <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12
+ </application>
8
13
  </manifest>
@@ -21,7 +21,5 @@
21
21
  <category android:name="android.intent.category.LAUNCHER" />
22
22
  </intent-filter>
23
23
  </activity>
24
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
25
24
  </application>
26
-
27
25
  </manifest>
@@ -1,9 +1,8 @@
1
1
  <resources>
2
2
 
3
3
  <!-- Base application theme. -->
4
- <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5
5
  <!-- Customize your theme here. -->
6
- <item name="android:textColor">#000000</item>
7
6
  <item name="colorPrimary">@color/colorPrimary</item>
8
7
  <item name="colorPrimaryDark">@color/colorPrimary</item>
9
8
  <item name="colorAccent">@color/colorPrimary</item>
@@ -2,18 +2,18 @@
2
2
 
3
3
  buildscript {
4
4
  ext {
5
- buildToolsVersion = "28.0.3"
6
- minSdkVersion = 16
7
- compileSdkVersion = 28
8
- targetSdkVersion = 28
5
+ buildToolsVersion = "30.0.2"
6
+ minSdkVersion = 21
7
+ compileSdkVersion = 30
8
+ targetSdkVersion = 30
9
+ ndkVersion = "21.4.7075529"
9
10
  }
10
11
  repositories {
11
12
  google()
12
- jcenter()
13
+ mavenCentral()
13
14
  }
14
15
  dependencies {
15
- classpath("com.android.tools.build:gradle:3.5.2")
16
-
16
+ classpath("com.android.tools.build:gradle:4.2.2")
17
17
  // NOTE: Do not place your application dependencies here; they belong
18
18
  // in the individual module build.gradle files
19
19
  }
@@ -21,6 +21,7 @@ buildscript {
21
21
 
22
22
  allprojects {
23
23
  repositories {
24
+ mavenCentral()
24
25
  mavenLocal()
25
26
  maven {
26
27
  // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
@@ -32,7 +33,6 @@ allprojects {
32
33
  }
33
34
 
34
35
  google()
35
- jcenter()
36
36
  maven { url 'https://www.jitpack.io' }
37
37
  }
38
38
  }
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -25,4 +25,4 @@ android.useAndroidX=true
25
25
  android.enableJetifier=true
26
26
 
27
27
  # Version of flipper SDK to use with React Native
28
- FLIPPER_VERSION=0.33.1
28
+ FLIPPER_VERSION=0.99.0
package/android/gradlew CHANGED
@@ -82,6 +82,7 @@ esac
82
82
 
83
83
  CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84
84
 
85
+
85
86
  # Determine the Java command to use to start the JVM.
86
87
  if [ -n "$JAVA_HOME" ] ; then
87
88
  if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129
130
  if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130
131
  APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131
132
  CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133
+
132
134
  JAVACMD=`cygpath --unix "$JAVACMD"`
133
135
 
134
136
  # We build the pattern for arguments to be converted via cygpath
@@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
154
156
  else
155
157
  eval `echo args$i`="\"$arg\""
156
158
  fi
157
- i=$((i+1))
159
+ i=`expr $i + 1`
158
160
  done
159
161
  case $i in
160
- (0) set -- ;;
161
- (1) set -- "$args0" ;;
162
- (2) set -- "$args0" "$args1" ;;
163
- (3) set -- "$args0" "$args1" "$args2" ;;
164
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
162
+ 0) set -- ;;
163
+ 1) set -- "$args0" ;;
164
+ 2) set -- "$args0" "$args1" ;;
165
+ 3) set -- "$args0" "$args1" "$args2" ;;
166
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170
172
  esac
171
173
  fi
172
174
 
@@ -175,14 +177,9 @@ save () {
175
177
  for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176
178
  echo " "
177
179
  }
178
- APP_ARGS=$(save "$@")
180
+ APP_ARGS=`save "$@"`
179
181
 
180
182
  # Collect all arguments for the java command, following the shell quoting and substitution rules
181
183
  eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182
184
 
183
- # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184
- if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185
- cd "$(dirname "$0")"
186
- fi
187
-
188
185
  exec "$JAVACMD" "$@"
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
29
29
  set APP_BASE_NAME=%~n0
30
30
  set APP_HOME=%DIRNAME%
31
31
 
32
+ @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33
+ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
+
32
35
  @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33
36
  set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34
37
 
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
37
40
 
38
41
  set JAVA_EXE=java.exe
39
42
  %JAVA_EXE% -version >NUL 2>&1
40
- if "%ERRORLEVEL%" == "0" goto init
43
+ if "%ERRORLEVEL%" == "0" goto execute
41
44
 
42
45
  echo.
43
46
  echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
51
54
  set JAVA_HOME=%JAVA_HOME:"=%
52
55
  set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53
56
 
54
- if exist "%JAVA_EXE%" goto init
57
+ if exist "%JAVA_EXE%" goto execute
55
58
 
56
59
  echo.
57
60
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
61
64
 
62
65
  goto fail
63
66
 
64
- :init
65
- @rem Get command-line arguments, handling Windows variants
66
-
67
- if not "%OS%" == "Windows_NT" goto win9xME_args
68
-
69
- :win9xME_args
70
- @rem Slurp the command line arguments.
71
- set CMD_LINE_ARGS=
72
- set _SKIP=2
73
-
74
- :win9xME_args_slurp
75
- if "x%~1" == "x" goto execute
76
-
77
- set CMD_LINE_ARGS=%*
78
-
79
67
  :execute
80
68
  @rem Setup the command line
81
69
 
82
70
  set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83
71
 
72
+
84
73
  @rem Execute Gradle
85
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74
+ "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
86
75
 
87
76
  :end
88
77
  @rem End local scope for the variables with windows NT shell